Commit 7363c29c06a2775008e0ff69fe889dcda0f7a168

Authored by 273548560@qq.com
1 parent ae7e3fdf

修复bug

trash-workFlow/src/main/java/com/trash/casefile/service/impl/ViolationCaseFileServiceImpl.java
... ... @@ -8,6 +8,7 @@ import java.util.stream.Collectors;
8 8 import com.alibaba.fastjson.JSONArray;
9 9 import com.alibaba.fastjson.JSONObject;
10 10 import com.trash.common.core.redis.RedisCache;
  11 +import com.trash.common.utils.StringUtils;
11 12 import org.springframework.beans.factory.annotation.Autowired;
12 13 import org.springframework.stereotype.Service;
13 14 import org.springframework.transaction.annotation.Transactional;
... ... @@ -96,15 +97,16 @@ public class ViolationCaseFileServiceImpl implements IViolationCaseFileService
96 97 violationCaseFile.setStatus(0);
97 98  
98 99 violationCaseFile.setCreateTime(DateUtils.getNowDate());
99   -
100   - JSONArray companyList = redisCache.getCacheObject("companyList");
101   - for(Object o:companyList){
102   - JSONObject jo = (JSONObject) o;
103   - if(violationCaseFile.getCompanyName().equals(jo.getString("name"))){
104   - violationCaseFile.setAbbreviation(jo.getString("abbreviation"));
  100 + //判断公司是否为空,如果不为空则查询公司简称
  101 + if(StringUtils.isNotEmpty(violationCaseFile.getCompanyName())) {
  102 + JSONArray companyList = redisCache.getCacheObject("companyList");
  103 + for (Object o : companyList) {
  104 + JSONObject jo = (JSONObject) o;
  105 + if (violationCaseFile.getCompanyName().equals(jo.getString("name"))) {
  106 + violationCaseFile.setAbbreviation(jo.getString("abbreviation"));
  107 + }
105 108 }
106 109 }
107   -
108 110 Integer result = violationCaseFileMapper.insertViolationCaseFile(violationCaseFile);
109 111 //文件上传
110 112 for (MultipartFile file : files) {
... ... @@ -117,7 +119,7 @@ public class ViolationCaseFileServiceImpl implements IViolationCaseFileService
117 119 }
118 120  
119 121 int i = 0;
120   -
  122 + //根据发送对象判断流程
121 123 if(violationCaseFile.getSendObject().equals("区管理部门(消)")){
122 124 i = 3;
123 125 }else if(violationCaseFile.getSendObject().equals("区管理部门(治)")){
... ...
trash-workFlow/src/main/java/com/trash/casefile/service/impl/ViolationWarningInformationServiceImpl.java
... ... @@ -93,13 +93,17 @@ public class ViolationWarningInformationServiceImpl implements IViolationWarning
93 93 if(StringUtils.isEmpty(violationWarningInformation.getCreateBy())){
94 94 violationWarningInformation.setCreateBy(SecurityUtils.getUsername());
95 95 }
96   - JSONArray companyList = redisCache.getCacheObject("companyList");
97   - for(Object o:companyList){
98   - JSONObject jo = (JSONObject) o;
99   - if(violationWarningInformation.getCompanyName().equals(jo.getString("name"))){
100   - violationWarningInformation.setAbbreviation(jo.getString("abbreviation"));
  96 + //判断公司是否为空,如果不为空则查询公司简称
  97 + if(StringUtils.isNotEmpty(violationWarningInformation.getCompanyName())){
  98 + JSONArray companyList = redisCache.getCacheObject("companyList");
  99 + for(Object o:companyList){
  100 + JSONObject jo = (JSONObject) o;
  101 + if(violationWarningInformation.getCompanyName().equals(jo.getString("name"))){
  102 + violationWarningInformation.setAbbreviation(jo.getString("abbreviation"));
  103 + }
101 104 }
102 105 }
  106 +
103 107 violationWarningInformation.setCreateTime(DateUtils.getNowDate());
104 108 violationWarningInformation.setStatus(0);
105 109 log.info("违规预警信息新增");
... ... @@ -117,7 +121,7 @@ public class ViolationWarningInformationServiceImpl implements IViolationWarning
117 121 }
118 122 }
119 123 int i = 0;
120   -
  124 + //根据发送对象判断流程
121 125 if(violationWarningInformation.getSendObject().equals("区管理部门(消)")){
122 126 i = 3;
123 127 }else if(violationWarningInformation.getSendObject().equals("区管理部门(治)")){
... ...