报警短信修改、安环底图问题修改
正在显示
10 个修改的文件
包含
226 行增加
和
22 行删除
... | @@ -35,4 +35,30 @@ public interface CacheConstant { | ... | @@ -35,4 +35,30 @@ public interface CacheConstant { |
35 | */ | 35 | */ |
36 | public static final String DEPART_IDMODEL_CACHE = "departCache_idmodel"; | 36 | public static final String DEPART_IDMODEL_CACHE = "departCache_idmodel"; |
37 | 37 | ||
38 | /** | ||
39 | * 阈值报警模版 | ||
40 | */ | ||
41 | public static final String SMS_TEMPLATE_LIMIT = "SMS_474515061"; | ||
42 | |||
43 | /** | ||
44 | * 设备报警模版 | ||
45 | */ | ||
46 | public static final String SMS_TEMPLATE_EQUIP = "SMS_474510018"; | ||
47 | |||
48 | /** | ||
49 | * 修改密码验证码 | ||
50 | */ | ||
51 | public static final String SMS_TEMPLATE_UPDATE = "SMS_71850022"; | ||
52 | |||
53 | /** | ||
54 | * 用户注册验证码 | ||
55 | */ | ||
56 | public static final String SMS_TEMPLATE_REGISTER = "SMS_71850024"; | ||
57 | |||
58 | /** | ||
59 | * 登录确认验证码 | ||
60 | */ | ||
61 | public static final String SMS_TEMPLATE_LOGIN = "SMS_71850026"; | ||
62 | |||
63 | |||
38 | } | 64 | } | ... | ... |
1 | package com.skua.modules.common.vo; | ||
2 | |||
3 | import io.swagger.annotations.ApiModelProperty; | ||
4 | import lombok.Data; | ||
5 | |||
6 | @Data | ||
7 | public class AliAlarm { | ||
8 | |||
9 | @ApiModelProperty(value = "时间") | ||
10 | private String time; | ||
11 | |||
12 | @ApiModelProperty(value = "机构名称:水厂名称") | ||
13 | private String factory; | ||
14 | |||
15 | @ApiModelProperty(value = "指标名称") | ||
16 | private String alarmParamName; | ||
17 | |||
18 | @ApiModelProperty(value = "指标单位") | ||
19 | private String alarmParamUnit; | ||
20 | |||
21 | @ApiModelProperty(value = "超标值") | ||
22 | private String alarmParamValue; | ||
23 | |||
24 | @ApiModelProperty(value = "指标限值") | ||
25 | private String limitValue; | ||
26 | |||
27 | @ApiModelProperty(value = "超标原因:大于上限,小于下限") | ||
28 | private String alarmParamReason; | ||
29 | |||
30 | @ApiModelProperty(value = "接收手机号,多个手机号逗号隔开") | ||
31 | private String phone; | ||
32 | |||
33 | } | ||
34 |
1 | package com.skua.modules.common.vo; | ||
2 | |||
3 | import io.swagger.annotations.ApiModelProperty; | ||
4 | import lombok.Data; | ||
5 | |||
6 | @Data | ||
7 | public class AliCode { | ||
8 | |||
9 | @ApiModelProperty(value = "验证码") | ||
10 | private String code; | ||
11 | |||
12 | @ApiModelProperty(value = "项目名称") | ||
13 | private String product; | ||
14 | |||
15 | @ApiModelProperty(value = "手机号") | ||
16 | private String phone; | ||
17 | |||
18 | @ApiModelProperty(value = "短信类型 修改密码:update,注册:register,登录:login") | ||
19 | private String type; | ||
20 | |||
21 | } | ||
22 |
1 | package com.skua.tool.util; | 1 | package com.skua.tool.util; |
2 | 2 | ||
3 | import com.fasterxml.jackson.databind.ObjectMapper; | 3 | import com.fasterxml.jackson.databind.ObjectMapper; |
4 | import com.skua.common.constant.CacheConstant; | ||
4 | import com.skua.core.exception.JeecgBootException; | 5 | import com.skua.core.exception.JeecgBootException; |
6 | import com.skua.modules.common.vo.AliAlarm; | ||
7 | import com.skua.modules.common.vo.AliCode; | ||
5 | import lombok.extern.slf4j.Slf4j; | 8 | import lombok.extern.slf4j.Slf4j; |
9 | import org.apache.commons.lang.StringUtils; | ||
6 | import org.springframework.http.RequestEntity; | 10 | import org.springframework.http.RequestEntity; |
7 | import org.springframework.http.ResponseEntity; | 11 | import org.springframework.http.ResponseEntity; |
8 | import org.springframework.stereotype.Service; | 12 | import org.springframework.stereotype.Service; |
... | @@ -63,18 +67,78 @@ public class AliSmsUtil { | ... | @@ -63,18 +67,78 @@ public class AliSmsUtil { |
63 | /** | 67 | /** |
64 | * 发送阈值报警短信 | 68 | * 发送阈值报警短信 |
65 | */ | 69 | */ |
66 | public static void sendLimitAlarmMsg() { | 70 | public static void sendLimitAlarmMsg(AliAlarm aliAlarm) { |
71 | if(StringUtils.isNotEmpty(aliAlarm.getPhone())){ | ||
67 | HashMap<String, Object> message = new HashMap<>(); | 72 | HashMap<String, Object> message = new HashMap<>(); |
68 | message.put("time","2024-10-12"); | 73 | message.put("time", aliAlarm.getTime()); |
69 | message.put("factory","天长市污水处理厂"); | 74 | message.put("factory", aliAlarm.getFactory()); |
70 | message.put("alarmParamName","进水COD"); | 75 | message.put("alarmParamName", aliAlarm.getAlarmParamName()); |
71 | message.put("actualAvgValue","130"+"mg/L"); | 76 | message.put("actualAvgValue", aliAlarm.getAlarmParamValue() + aliAlarm.getAlarmParamUnit()); |
72 | message.put("limit","105"+"mg/L"); | 77 | message.put("limit", aliAlarm.getLimitValue() + aliAlarm.getAlarmParamUnit()); |
73 | message.put("alarmParamUnit","大于上限"); | 78 | message.put("alarmParamUnit", aliAlarm.getAlarmParamReason()); |
74 | AliSmsUtil.sendMsg("18519526218", "SMS_474510018",message); | 79 | AliSmsUtil.sendMsg(aliAlarm.getPhone(), CacheConstant.SMS_TEMPLATE_LIMIT, message); |
80 | }else{ | ||
81 | log.info("=======>>>>>>>>>>【阈值报警】接收人手机号未设定!"); | ||
82 | } | ||
83 | |||
84 | } | ||
85 | |||
86 | /** | ||
87 | * 发送设备报警短信 | ||
88 | */ | ||
89 | public static void sendEquipAlarmMsg(AliAlarm aliAlarm) { | ||
90 | if(StringUtils.isNotEmpty(aliAlarm.getPhone())){ | ||
91 | HashMap<String, Object> message = new HashMap<>(); | ||
92 | message.put("time", aliAlarm.getTime()); | ||
93 | message.put("factory", aliAlarm.getFactory()); | ||
94 | message.put("alarmParamName", aliAlarm.getAlarmParamName()); | ||
95 | message.put("actualAvgValue", aliAlarm.getAlarmParamValue() + aliAlarm.getAlarmParamUnit()); | ||
96 | message.put("limit", aliAlarm.getLimitValue() + aliAlarm.getAlarmParamUnit()); | ||
97 | message.put("alarmParamUnit", aliAlarm.getAlarmParamReason()); | ||
98 | AliSmsUtil.sendMsg(aliAlarm.getPhone(), CacheConstant.SMS_TEMPLATE_EQUIP, message); | ||
99 | }else{ | ||
100 | log.info("=======>>>>>>>>>>【设备报警】接收人手机号未设定!"); | ||
101 | } | ||
102 | } | ||
103 | |||
104 | /** | ||
105 | * 发送验证码短信 | ||
106 | */ | ||
107 | public static void sendCodeMsg(AliCode aliCode) { | ||
108 | if(StringUtils.isNotEmpty(aliCode.getPhone())){ | ||
109 | HashMap<String, Object> message = new HashMap<>(); | ||
110 | message.put("code", aliCode.getCode()); | ||
111 | message.put("product", aliCode.getProduct()); | ||
112 | if("update".equals(aliCode.getType())){ | ||
113 | AliSmsUtil.sendMsg(aliCode.getPhone(), CacheConstant.SMS_TEMPLATE_UPDATE, message); | ||
114 | }else if("login".equals(aliCode.getType())){ | ||
115 | AliSmsUtil.sendMsg(aliCode.getPhone(), CacheConstant.SMS_TEMPLATE_LOGIN, message); | ||
116 | }else if("register".equals(aliCode.getType())){ | ||
117 | AliSmsUtil.sendMsg(aliCode.getPhone(), CacheConstant.SMS_TEMPLATE_REGISTER, message); | ||
118 | }else{ | ||
119 | log.info("=======>>>>>>>>>>短信验证码缺少对应模版"); | ||
120 | } | ||
121 | }else{ | ||
122 | log.info("=======>>>>>>>>>>【验证码】接收人手机号未设定!"); | ||
123 | } | ||
75 | } | 124 | } |
76 | 125 | ||
77 | public static void main(String[] args) { | 126 | public static void main(String[] args) { |
78 | sendLimitAlarmMsg(); | 127 | // AliAlarm aliAlarm = new AliAlarm(); |
128 | // aliAlarm.setPhone("18519526218"); | ||
129 | // aliAlarm.setTime("2024-11-01 11:25:29"); | ||
130 | // aliAlarm.setFactory("天长市污水处理厂"); | ||
131 | // aliAlarm.setAlarmParamName("进水COD"); | ||
132 | // aliAlarm.setAlarmParamValue("130"); | ||
133 | // aliAlarm.setAlarmParamUnit("mg/L"); | ||
134 | // aliAlarm.setLimitValue("100"); | ||
135 | // aliAlarm.setAlarmParamReason("大于上限"); | ||
136 | // sendLimitAlarmMsg(aliAlarm); | ||
137 | AliCode aliCode = new AliCode(); | ||
138 | aliCode.setPhone("18519526218"); | ||
139 | aliCode.setCode("889955"); | ||
140 | aliCode.setProduct("数字化企业大脑"); | ||
141 | aliCode.setType("login"); | ||
142 | sendCodeMsg(aliCode); | ||
79 | } | 143 | } |
80 | } | 144 | } | ... | ... |
... | @@ -14,6 +14,8 @@ import java.util.Set; | ... | @@ -14,6 +14,8 @@ import java.util.Set; |
14 | import java.util.UUID; | 14 | import java.util.UUID; |
15 | import java.util.stream.Collectors; | 15 | import java.util.stream.Collectors; |
16 | 16 | ||
17 | import com.skua.modules.common.vo.AliAlarm; | ||
18 | import com.skua.tool.util.AliSmsUtil; | ||
17 | import org.apache.commons.lang3.StringUtils; | 19 | import org.apache.commons.lang3.StringUtils; |
18 | import org.flowable.engine.ProcessEngine; | 20 | import org.flowable.engine.ProcessEngine; |
19 | import org.flowable.engine.ProcessEngines; | 21 | import org.flowable.engine.ProcessEngines; |
... | @@ -126,7 +128,6 @@ public class RealTimeAlarmJob implements Job { | ... | @@ -126,7 +128,6 @@ public class RealTimeAlarmJob implements Job { |
126 | if(equipAlarmRuleAndAlarmRuleLevelVOList!=null&&equipAlarmRuleAndAlarmRuleLevelVOList.size()>0) { | 128 | if(equipAlarmRuleAndAlarmRuleLevelVOList!=null&&equipAlarmRuleAndAlarmRuleLevelVOList.size()>0) { |
127 | allAlarmRuleAndAlarmRuleLevelVOList.addAll(equipAlarmRuleAndAlarmRuleLevelVOList); | 129 | allAlarmRuleAndAlarmRuleLevelVOList.addAll(equipAlarmRuleAndAlarmRuleLevelVOList); |
128 | } | 130 | } |
129 | |||
130 | //查询pg数据超标警报 | 131 | //查询pg数据超标警报 |
131 | Map<String, Object> excessAlarmPgList = checkPgExcessAlarm(allAlarmRuleAndAlarmRuleLevelVOList); | 132 | Map<String, Object> excessAlarmPgList = checkPgExcessAlarm(allAlarmRuleAndAlarmRuleLevelVOList); |
132 | sendMessage(excessAlarmPgList); | 133 | sendMessage(excessAlarmPgList); |
... | @@ -398,11 +399,16 @@ public class RealTimeAlarmJob implements Job { | ... | @@ -398,11 +399,16 @@ public class RealTimeAlarmJob implements Job { |
398 | String alarmRuleLevelName = alarmRuleLevelConfig.getAlarmRuleLevelName(); | 399 | String alarmRuleLevelName = alarmRuleLevelConfig.getAlarmRuleLevelName(); |
399 | String alarmRuleLevelConfigId = alarmRuleLevelConfig.getId(); | 400 | String alarmRuleLevelConfigId = alarmRuleLevelConfig.getId(); |
400 | String content = ""; | 401 | String content = ""; |
402 | AliAlarm aliAlarm = new AliAlarm();//报警实体 | ||
401 | String departName = departNameTemplete.replace("${departName}", alarmRuleAndAlarmRuleLevelVO.getDepartName()); | 403 | String departName = departNameTemplete.replace("${departName}", alarmRuleAndAlarmRuleLevelVO.getDepartName()); |
404 | aliAlarm.setFactory(alarmRuleAndAlarmRuleLevelVO.getDepartName()); | ||
402 | String unit = ""; | 405 | String unit = ""; |
403 | if (alarmRuleAndAlarmRuleLevelVO.getAlarmParamUnit() != null) { | 406 | if (alarmRuleAndAlarmRuleLevelVO.getAlarmParamUnit() != null) { |
404 | unit = alarmRuleAndAlarmRuleLevelVO.getAlarmParamUnit(); | 407 | unit = alarmRuleAndAlarmRuleLevelVO.getAlarmParamUnit(); |
405 | } | 408 | } |
409 | aliAlarm.setAlarmParamName(alarmParamName); | ||
410 | aliAlarm.setAlarmParamValue(alarmValue.doubleValue()+""); | ||
411 | aliAlarm.setAlarmParamUnit(unit); | ||
406 | if (alarmValue > maxValue) { | 412 | if (alarmValue > maxValue) { |
407 | //最大值超标 | 413 | //最大值超标 |
408 | content = contentTemplete.replace("${alarmParamName}", alarmParamName) | 414 | content = contentTemplete.replace("${alarmParamName}", alarmParamName) |
... | @@ -410,6 +416,8 @@ public class RealTimeAlarmJob implements Job { | ... | @@ -410,6 +416,8 @@ public class RealTimeAlarmJob implements Job { |
410 | .replace("${limit}", ">" + maxValue) | 416 | .replace("${limit}", ">" + maxValue) |
411 | .replace("${alarmParamUnit}", unit); | 417 | .replace("${alarmParamUnit}", unit); |
412 | content = content +"大于上限"; | 418 | content = content +"大于上限"; |
419 | aliAlarm.setLimitValue(maxValue.toString()); | ||
420 | aliAlarm.setAlarmParamReason("大于上限"); | ||
413 | } else { | 421 | } else { |
414 | //最小值超标 | 422 | //最小值超标 |
415 | content = contentTemplete.replace("${alarmParamName}", alarmParamName) | 423 | content = contentTemplete.replace("${alarmParamName}", alarmParamName) |
... | @@ -417,6 +425,8 @@ public class RealTimeAlarmJob implements Job { | ... | @@ -417,6 +425,8 @@ public class RealTimeAlarmJob implements Job { |
417 | .replace("${limit}", "<" + minValue) | 425 | .replace("${limit}", "<" + minValue) |
418 | .replace("${alarmParamUnit}", unit); | 426 | .replace("${alarmParamUnit}", unit); |
419 | content = content +"小于下限"; | 427 | content = content +"小于下限"; |
428 | aliAlarm.setLimitValue(minValue.toString()); | ||
429 | aliAlarm.setAlarmParamReason("小于下限"); | ||
420 | } | 430 | } |
421 | //查询短信上一条报警是否处理,未处理就不新增报警记录 | 431 | //查询短信上一条报警是否处理,未处理就不新增报警记录 |
422 | //TODO 先从数据库中获取,后期优化放redis中 | 432 | //TODO 先从数据库中获取,后期优化放redis中 |
... | @@ -568,8 +578,11 @@ public class RealTimeAlarmJob implements Job { | ... | @@ -568,8 +578,11 @@ public class RealTimeAlarmJob implements Job { |
568 | String phone1 = sysUserList.get(i).getPhone(); | 578 | String phone1 = sysUserList.get(i).getPhone(); |
569 | if (StringUtils.isNotBlank(phone1)) { | 579 | if (StringUtils.isNotBlank(phone1)) { |
570 | phoneStringBuilder.append(phone1); | 580 | phoneStringBuilder.append(phone1); |
581 | aliAlarm.setTime(date); | ||
582 | aliAlarm.setPhone(phone1); | ||
571 | //发送短信 | 583 | //发送短信 |
572 | HttpSenderMsg.sendMsg(prefix + date + "时" + departName + "采集数据" + content + suffix, phone1); | 584 | HttpSenderMsg.sendMsg(prefix + date + "时" + departName + "采集数据" + content + suffix, phone1); |
585 | AliSmsUtil.sendLimitAlarmMsg(aliAlarm);//新版短息发送工具 | ||
573 | log.info("短信发送成功手机号:" + phone1 + ",内容:" + content); | 586 | log.info("短信发送成功手机号:" + phone1 + ",内容:" + content); |
574 | } | 587 | } |
575 | } | 588 | } | ... | ... |
... | @@ -23,6 +23,12 @@ import com.skua.modules.flow.custombiz.handle.IFlowCustomHandle; | ... | @@ -23,6 +23,12 @@ import com.skua.modules.flow.custombiz.handle.IFlowCustomHandle; |
23 | import com.skua.modules.flow.custombiz.vo.FlowProcessFormFieldInfoVO; | 23 | import com.skua.modules.flow.custombiz.vo.FlowProcessFormFieldInfoVO; |
24 | import com.skua.modules.flow.support.Kv; | 24 | import com.skua.modules.flow.support.Kv; |
25 | import com.skua.modules.flow.utils.Func; | 25 | import com.skua.modules.flow.utils.Func; |
26 | import com.skua.modules.safe.entity.DangerInspectionRecord; | ||
27 | import com.skua.modules.safe.entity.DangerLevelManage; | ||
28 | import com.skua.modules.safe.entity.DangerLevelManageShare; | ||
29 | import com.skua.modules.safe.mapper.DangerInspectionRecordMapper; | ||
30 | import com.skua.modules.safe.mapper.DangerLevelManageMapper; | ||
31 | import com.skua.modules.safe.mapper.DangerLevelManageShareMapper; | ||
26 | import com.skua.tool.util.UniqIdUtils; | 32 | import com.skua.tool.util.UniqIdUtils; |
27 | import org.apache.commons.lang3.StringUtils; | 33 | import org.apache.commons.lang3.StringUtils; |
28 | import org.springframework.beans.BeanUtils; | 34 | import org.springframework.beans.BeanUtils; |
... | @@ -47,6 +53,12 @@ public class EmergencyRiskEventServiceImpl extends ServiceImpl<EmergencyRiskEven | ... | @@ -47,6 +53,12 @@ public class EmergencyRiskEventServiceImpl extends ServiceImpl<EmergencyRiskEven |
47 | private FlowBusinessService flowBusinessService; | 53 | private FlowBusinessService flowBusinessService; |
48 | @Autowired | 54 | @Autowired |
49 | private EmergencyRiskEventMapper emergencyRiskEventMapper; | 55 | private EmergencyRiskEventMapper emergencyRiskEventMapper; |
56 | @Autowired | ||
57 | private DangerLevelManageMapper dangerLevelManageMapper; | ||
58 | @Autowired | ||
59 | private DangerLevelManageShareMapper dangerLevelManageShareMapper; | ||
60 | @Autowired | ||
61 | private DangerInspectionRecordMapper dangerInspectionRecordMapper; | ||
50 | 62 | ||
51 | @Override | 63 | @Override |
52 | @Transactional(rollbackFor = Exception.class) | 64 | @Transactional(rollbackFor = Exception.class) |
... | @@ -100,33 +112,66 @@ public class EmergencyRiskEventServiceImpl extends ServiceImpl<EmergencyRiskEven | ... | @@ -100,33 +112,66 @@ public class EmergencyRiskEventServiceImpl extends ServiceImpl<EmergencyRiskEven |
100 | @Override | 112 | @Override |
101 | public Map<String, Object> getCount(String year) { | 113 | public Map<String, Object> getCount(String year) { |
102 | Map<String, Object> map = new HashMap<>(); | 114 | Map<String, Object> map = new HashMap<>(); |
115 | int aqyhTotal = 0;//隐患排查总数 | ||
116 | int aqyhYes = 0;//隐患排查处理数 | ||
117 | int aqyhNo = 0;//隐患排查未完成数 | ||
118 | int fxTotal = 0;//风险库总数 | ||
119 | int fxShare = 0;//风险库共享总数 | ||
103 | Map<String, Object> aqyhMap = new HashMap<>(); | 120 | Map<String, Object> aqyhMap = new HashMap<>(); |
104 | aqyhMap.put("total","9"); | 121 | List<DangerInspectionRecord> inspectionList = dangerInspectionRecordMapper.selectList(new QueryWrapper<>()); |
105 | aqyhMap.put("yes","5"); | 122 | if(inspectionList.size() > 0){ |
106 | aqyhMap.put("no","4"); | 123 | aqyhTotal = inspectionList.size(); |
124 | for (DangerInspectionRecord dangerInspectionRecord : inspectionList) { | ||
125 | if("2".equals(dangerInspectionRecord.getStatus())){ | ||
126 | aqyhYes++; | ||
127 | }else{ | ||
128 | aqyhNo++; | ||
129 | } | ||
130 | } | ||
131 | } | ||
132 | aqyhMap.put("total", aqyhTotal); | ||
133 | aqyhMap.put("yes", aqyhYes); | ||
134 | aqyhMap.put("no", aqyhNo); | ||
107 | map.put("aqyh",aqyhMap); | 135 | map.put("aqyh",aqyhMap); |
108 | Map<String, Object> fxkMap = new HashMap<>(); | 136 | Map<String, Object> fxkMap = new HashMap<>(); |
109 | fxkMap.put("total","9"); | 137 | List<DangerLevelManage> dangerList = dangerLevelManageMapper.selectList(new QueryWrapper<>()); |
110 | fxkMap.put("share","5"); | 138 | List<DangerLevelManageShare> dangerShareList = dangerLevelManageShareMapper.selectList(new QueryWrapper<>()); |
111 | map.put("fxk",fxkMap); | 139 | if(dangerList.size() > 0){ |
112 | map.put("yhpcyj","6"); | 140 | fxTotal = dangerList.size(); |
141 | } | ||
142 | if(dangerList.size() > 0){ | ||
143 | fxShare = dangerShareList.size(); | ||
144 | } | ||
145 | fxkMap.put("total", fxTotal+fxShare); | ||
146 | fxkMap.put("share", fxShare); | ||
147 | map.put("fxk", fxkMap); | ||
148 | map.put("yhpcyj", aqyhTotal); | ||
113 | return map; | 149 | return map; |
114 | } | 150 | } |
115 | 151 | ||
116 | @Override | 152 | @Override |
117 | public List<RiskDatabaseResult> getRiskList(String year) { | 153 | public List<RiskDatabaseResult> getRiskList(String year) { |
154 | if(year==null){ | ||
155 | year = String.valueOf(DateUtils.getYear()); | ||
156 | } | ||
118 | List<RiskDatabaseResult> list = emergencyRiskEventMapper.getRiskList(year); | 157 | List<RiskDatabaseResult> list = emergencyRiskEventMapper.getRiskList(year); |
119 | return list; | 158 | return list; |
120 | } | 159 | } |
121 | 160 | ||
122 | @Override | 161 | @Override |
123 | public List<DangerDatabaseResult> getDangerList(String year) { | 162 | public List<DangerDatabaseResult> getDangerList(String year) { |
163 | if(year==null){ | ||
164 | year = String.valueOf(DateUtils.getYear()); | ||
165 | } | ||
124 | List<DangerDatabaseResult> list = emergencyRiskEventMapper.getDangerList(year); | 166 | List<DangerDatabaseResult> list = emergencyRiskEventMapper.getDangerList(year); |
125 | return list; | 167 | return list; |
126 | } | 168 | } |
127 | 169 | ||
128 | @Override | 170 | @Override |
129 | public List<MapDatabaseResult> getMapData(String year) { | 171 | public List<MapDatabaseResult> getMapData(String year) { |
172 | if(year==null){ | ||
173 | year = String.valueOf(DateUtils.getYear()); | ||
174 | } | ||
130 | List<MapDatabaseResult> list = emergencyRiskEventMapper.getMapData(year); | 175 | List<MapDatabaseResult> list = emergencyRiskEventMapper.getMapData(year); |
131 | return list; | 176 | return list; |
132 | } | 177 | } | ... | ... |
... | @@ -654,15 +654,12 @@ public class ScreenDataController { | ... | @@ -654,15 +654,12 @@ public class ScreenDataController { |
654 | public Result<List<SysFactoryInfoVO>> getFactoryListByWrapper(SysFactoryInfoVO sysFactoryInfoVO) { | 654 | public Result<List<SysFactoryInfoVO>> getFactoryListByWrapper(SysFactoryInfoVO sysFactoryInfoVO) { |
655 | Result<List<SysFactoryInfoVO>> result = new Result<>(); | 655 | Result<List<SysFactoryInfoVO>> result = new Result<>(); |
656 | QueryWrapper<SysFactoryInfoVO> queryWrapper = new QueryWrapper<>(); | 656 | QueryWrapper<SysFactoryInfoVO> queryWrapper = new QueryWrapper<>(); |
657 | |||
658 | String departType = sysFactoryInfoVO.getDepartType(); | 657 | String departType = sysFactoryInfoVO.getDepartType(); |
659 | if (ConvertUtils.isNotEmpty(departType)) { | 658 | if (ConvertUtils.isNotEmpty(departType)) { |
660 | queryWrapper.in("d.depart_type", departType.split(",")); | 659 | queryWrapper.in("d.depart_type", departType.split(",")); |
661 | } | 660 | } |
662 | 661 | if (ConvertUtils.isNotEmpty(sysFactoryInfoVO.getDepartId())) { | |
663 | String dataDepartId = sysFactoryInfoVO.getDepartId(); | 662 | queryWrapper.in("d.id", sysFactoryInfoVO.getDepartId().split(",")); |
664 | if (ConvertUtils.isNotEmpty(dataDepartId)) { | ||
665 | queryWrapper.in("d.id", dataDepartId.split(",")); | ||
666 | } else{ | 663 | } else{ |
667 | queryWrapper.in("d.id", BaseContextHandler.getDeparts().split(",")); | 664 | queryWrapper.in("d.id", BaseContextHandler.getDeparts().split(",")); |
668 | } | 665 | } | ... | ... |
... | @@ -90,6 +90,7 @@ spring: | ... | @@ -90,6 +90,7 @@ spring: |
90 | datasource: | 90 | datasource: |
91 | master: | 91 | master: |
92 | url: jdbc:mysql://47.104.179.187:6003/sk-zhongye?characterEncoding=UTF-8&useUnicode=true&useSSL=false&connectTimeout=60000&socketTimeout=1800 | 92 | url: jdbc:mysql://47.104.179.187:6003/sk-zhongye?characterEncoding=UTF-8&useUnicode=true&useSSL=false&connectTimeout=60000&socketTimeout=1800 |
93 | # url: jdbc:mysql://113.249.91.27:3306/sk-zhongye?characterEncoding=UTF-8&useUnicode=true&useSSL=false&connectTimeout=60000&socketTimeout=1800 | ||
93 | username: root | 94 | username: root |
94 | password: jkauto@123 | 95 | password: jkauto@123 |
95 | driver-class-name: com.mysql.jdbc.Driver | 96 | driver-class-name: com.mysql.jdbc.Driver | ... | ... |
... | @@ -249,6 +249,7 @@ public class EquipmentSparepartController { | ... | @@ -249,6 +249,7 @@ public class EquipmentSparepartController { |
249 | .innerJoin(EquipmentSparepartSupplies.class, EquipmentSparepartSupplies.class.getDeclaredField("id"), EquipmentSparepart.class.getDeclaredField("suppliesId")) | 249 | .innerJoin(EquipmentSparepartSupplies.class, EquipmentSparepartSupplies.class.getDeclaredField("id"), EquipmentSparepart.class.getDeclaredField("suppliesId")) |
250 | .where() | 250 | .where() |
251 | .ge(equipmentSparepartDTO.getNum()>0, "equipment_sparepart.storage_num", equipmentSparepartDTO.getNum()) | 251 | .ge(equipmentSparepartDTO.getNum()>0, "equipment_sparepart.storage_num", equipmentSparepartDTO.getNum()) |
252 | .eq(StringUtils.isNotEmpty(equipmentSparepartDTO.getDepartId()), "equipment_sparepart_supplies.depart_id", equipmentSparepartDTO.getDepartId()) | ||
252 | .like(StringUtils.isNotEmpty(equipmentSparepartDTO.getSparepartCode()), "equipment_sparepart_supplies.sparepart_code", equipmentSparepartDTO.getSparepartCode()) | 253 | .like(StringUtils.isNotEmpty(equipmentSparepartDTO.getSparepartCode()), "equipment_sparepart_supplies.sparepart_code", equipmentSparepartDTO.getSparepartCode()) |
253 | .like(StringUtils.isNotEmpty(equipmentSparepartDTO.getSpecification()), "equipment_sparepart_supplies.specification", equipmentSparepartDTO.getSpecification()) | 254 | .like(StringUtils.isNotEmpty(equipmentSparepartDTO.getSpecification()), "equipment_sparepart_supplies.specification", equipmentSparepartDTO.getSpecification()) |
254 | .like(StringUtils.isNotEmpty(equipmentSparepartDTO.getSparepartName()), "equipment_sparepart_supplies.sparepart_name", equipmentSparepartDTO.getSparepartName()) | 255 | .like(StringUtils.isNotEmpty(equipmentSparepartDTO.getSparepartName()), "equipment_sparepart_supplies.sparepart_name", equipmentSparepartDTO.getSparepartName()) | ... | ... |
... | @@ -25,6 +25,7 @@ public class EquipmentSparepartDTO extends EquipmentSparepart { | ... | @@ -25,6 +25,7 @@ public class EquipmentSparepartDTO extends EquipmentSparepart { |
25 | private String startTime; | 25 | private String startTime; |
26 | 26 | ||
27 | private String endTime; | 27 | private String endTime; |
28 | |||
28 | private String warehouseName; | 29 | private String warehouseName; |
29 | 30 | ||
30 | } | 31 | } | ... | ... |
-
请 注册 或 登录 后发表评论