1893b72a 张雷

运营考核问题修改

1 个父辈 1aa71f8e
...@@ -24,11 +24,17 @@ public class AliAlarm { ...@@ -24,11 +24,17 @@ public class AliAlarm {
24 @ApiModelProperty(value = "指标限值") 24 @ApiModelProperty(value = "指标限值")
25 private String limitValue; 25 private String limitValue;
26 26
27 @ApiModelProperty(value = "超标原因:大于上限,小于下限") 27 @ApiModelProperty(value = "超标原因:大于上限,小于下限,故障")
28 private String alarmParamReason; 28 private String alarmParamReason;
29 29
30 @ApiModelProperty(value = "报警地点")
31 private String alarmLoction;
32
30 @ApiModelProperty(value = "接收手机号,多个手机号逗号隔开") 33 @ApiModelProperty(value = "接收手机号,多个手机号逗号隔开")
31 private String phone; 34 private String phone;
32 35
36 @ApiModelProperty(value = "报警类型:0模拟量、1数字量、2其他")
37 private String alarmType;
38
33 } 39 }
34 40
......
...@@ -36,9 +36,10 @@ public class AliSmsUtil { ...@@ -36,9 +36,10 @@ public class AliSmsUtil {
36 * @param template 短信模板id 36 * @param template 短信模板id
37 * @param message 短信内容 模板内容与模板参数必须完全匹配 37 * @param message 短信内容 模板内容与模板参数必须完全匹配
38 */ 38 */
39 public static void sendMsg(String phoneNumbers, String template, Map<String, Object> message){ 39 public static boolean sendMsg(String phoneNumbers, String template, Map<String, Object> message){
40 RequestEntity<Map> requestEntity = null; 40 RequestEntity<Map> requestEntity = null;
41 ResponseEntity<Map> responseEntity = null; 41 ResponseEntity<Map> responseEntity = null;
42 boolean ok = true;//发送结果标识
42 try { 43 try {
43 Map requestBody = new HashMap(); 44 Map requestBody = new HashMap();
44 requestBody.put("phone_numbers", phoneNumbers); 45 requestBody.put("phone_numbers", phoneNumbers);
...@@ -53,21 +54,26 @@ public class AliSmsUtil { ...@@ -53,21 +54,26 @@ public class AliSmsUtil {
53 .body(requestBody, Map.class); 54 .body(requestBody, Map.class);
54 responseEntity = restTemplate.exchange(requestEntity, Map.class); 55 responseEntity = restTemplate.exchange(requestEntity, Map.class);
55 Integer code = (Integer) responseEntity.getBody().get("code"); 56 Integer code = (Integer) responseEntity.getBody().get("code");
57 ok = true;
56 if (code != 200) { 58 if (code != 200) {
59 ok = false;
57 log.error(String.format("阿里短信发送失败 请求=%s 响应=%s", requestBody.toString(), responseEntity.toString())); 60 log.error(String.format("阿里短信发送失败 请求=%s 响应=%s", requestBody.toString(), responseEntity.toString()));
58 } 61 }
59 } catch (Exception e) { 62 } catch (Exception e) {
63 ok = false;
60 log.error(String.format("阿里短信发送失败 请求=%s 响应=%s", 64 log.error(String.format("阿里短信发送失败 请求=%s 响应=%s",
61 requestEntity == null ? "" : requestEntity.toString() , 65 requestEntity == null ? "" : requestEntity.toString() ,
62 responseEntity == null ? "" : responseEntity.toString()), e); 66 responseEntity == null ? "" : responseEntity.toString()), e);
63 throw new JeecgBootException("阿里短信发送失败");
64 } 67 }
68 return ok;
65 } 69 }
66 70
67 /** 71 /**
68 * 发送阈值报警短信 72 * 发送阈值报警短信
73 * 在${time}时${factory}采集数据${alarmParamName}值:${actualAvgValue},标准要求${limit},当前${alarmParamUnit},请注意!
69 */ 74 */
70 public static void sendLimitAlarmMsg(AliAlarm aliAlarm) { 75 public static boolean sendLimitAlarmMsg(AliAlarm aliAlarm) {
76 boolean ok = true;//发送结果标识
71 if(StringUtils.isNotEmpty(aliAlarm.getPhone())){ 77 if(StringUtils.isNotEmpty(aliAlarm.getPhone())){
72 HashMap<String, Object> message = new HashMap<>(); 78 HashMap<String, Object> message = new HashMap<>();
73 message.put("time", aliAlarm.getTime()); 79 message.put("time", aliAlarm.getTime());
...@@ -76,51 +82,55 @@ public class AliSmsUtil { ...@@ -76,51 +82,55 @@ public class AliSmsUtil {
76 message.put("actualAvgValue", aliAlarm.getAlarmParamValue() + aliAlarm.getAlarmParamUnit()); 82 message.put("actualAvgValue", aliAlarm.getAlarmParamValue() + aliAlarm.getAlarmParamUnit());
77 message.put("limit", aliAlarm.getLimitValue() + aliAlarm.getAlarmParamUnit()); 83 message.put("limit", aliAlarm.getLimitValue() + aliAlarm.getAlarmParamUnit());
78 message.put("alarmParamUnit", aliAlarm.getAlarmParamReason()); 84 message.put("alarmParamUnit", aliAlarm.getAlarmParamReason());
79 AliSmsUtil.sendMsg(aliAlarm.getPhone(), CacheConstant.SMS_TEMPLATE_LIMIT, message); 85 ok = AliSmsUtil.sendMsg(aliAlarm.getPhone(), CacheConstant.SMS_TEMPLATE_LIMIT, message);
80 }else{ 86 }else{
81 log.info("=======>>>>>>>>>>【阈值报警】接收人手机号未设定!"); 87 log.info("=======>>>>>>>>>>【阈值报警】接收人手机号未设定!");
82 } 88 }
83 89 return ok;
84 } 90 }
85 91
86 /** 92 /**
87 * 发送设备报警短信 93 * 发送设备报警短信
94 * ${factory}于${date},${equip}信号为:${level},该设备位于${part},请及时处理。
88 */ 95 */
89 public static void sendEquipAlarmMsg(AliAlarm aliAlarm) { 96 public static boolean sendEquipAlarmMsg(AliAlarm aliAlarm) {
97 boolean ok = true;//发送结果标识
90 if(StringUtils.isNotEmpty(aliAlarm.getPhone())){ 98 if(StringUtils.isNotEmpty(aliAlarm.getPhone())){
91 HashMap<String, Object> message = new HashMap<>(); 99 HashMap<String, Object> message = new HashMap<>();
92 message.put("time", aliAlarm.getTime()); 100 message.put("date", aliAlarm.getTime());
93 message.put("factory", aliAlarm.getFactory()); 101 message.put("factory", aliAlarm.getFactory());
94 message.put("alarmParamName", aliAlarm.getAlarmParamName()); 102 message.put("equip", aliAlarm.getAlarmParamName());
95 message.put("actualAvgValue", aliAlarm.getAlarmParamValue() + aliAlarm.getAlarmParamUnit()); 103 message.put("limit", aliAlarm.getLimitValue());
96 message.put("limit", aliAlarm.getLimitValue() + aliAlarm.getAlarmParamUnit()); 104 message.put("part", aliAlarm.getAlarmLoction());
97 message.put("alarmParamUnit", aliAlarm.getAlarmParamReason()); 105 ok = AliSmsUtil.sendMsg(aliAlarm.getPhone(), CacheConstant.SMS_TEMPLATE_EQUIP, message);
98 AliSmsUtil.sendMsg(aliAlarm.getPhone(), CacheConstant.SMS_TEMPLATE_EQUIP, message);
99 }else{ 106 }else{
100 log.info("=======>>>>>>>>>>【设备报警】接收人手机号未设定!"); 107 log.info("=======>>>>>>>>>>【设备报警】接收人手机号未设定!");
101 } 108 }
109 return ok;
102 } 110 }
103 111
104 /** 112 /**
105 * 发送验证码短信 113 * 发送验证码短信
106 */ 114 */
107 public static void sendCodeMsg(AliCode aliCode) { 115 public static boolean sendCodeMsg(AliCode aliCode) {
116 boolean ok = true;//发送结果标识
108 if(StringUtils.isNotEmpty(aliCode.getPhone())){ 117 if(StringUtils.isNotEmpty(aliCode.getPhone())){
109 HashMap<String, Object> message = new HashMap<>(); 118 HashMap<String, Object> message = new HashMap<>();
110 message.put("code", aliCode.getCode()); 119 message.put("code", aliCode.getCode());
111 message.put("product", aliCode.getProduct()); 120 message.put("product", aliCode.getProduct());
112 if("update".equals(aliCode.getType())){ 121 if("update".equals(aliCode.getType())){
113 AliSmsUtil.sendMsg(aliCode.getPhone(), CacheConstant.SMS_TEMPLATE_UPDATE, message); 122 ok = AliSmsUtil.sendMsg(aliCode.getPhone(), CacheConstant.SMS_TEMPLATE_UPDATE, message);
114 }else if("login".equals(aliCode.getType())){ 123 }else if("login".equals(aliCode.getType())){
115 AliSmsUtil.sendMsg(aliCode.getPhone(), CacheConstant.SMS_TEMPLATE_LOGIN, message); 124 ok = AliSmsUtil.sendMsg(aliCode.getPhone(), CacheConstant.SMS_TEMPLATE_LOGIN, message);
116 }else if("register".equals(aliCode.getType())){ 125 }else if("register".equals(aliCode.getType())){
117 AliSmsUtil.sendMsg(aliCode.getPhone(), CacheConstant.SMS_TEMPLATE_REGISTER, message); 126 ok = AliSmsUtil.sendMsg(aliCode.getPhone(), CacheConstant.SMS_TEMPLATE_REGISTER, message);
118 }else{ 127 }else{
119 log.info("=======>>>>>>>>>>短信验证码缺少对应模版"); 128 log.info("=======>>>>>>>>>>短信验证码缺少对应模版");
120 } 129 }
121 }else{ 130 }else{
122 log.info("=======>>>>>>>>>>【验证码】接收人手机号未设定!"); 131 log.info("=======>>>>>>>>>>【验证码】接收人手机号未设定!");
123 } 132 }
133 return ok;
124 } 134 }
125 135
126 public static void main(String[] args) { 136 public static void main(String[] args) {
......
...@@ -52,6 +52,17 @@ public class DateUtils { ...@@ -52,6 +52,17 @@ public class DateUtils {
52 52
53 return dayNUm; 53 return dayNUm;
54 } 54 }
55
56 /**
57 * 根据月份获取天数
58 * @param month
59 * @return
60 */
61 public static int getDayCountByMonth(String month){
62 YearMonth yearMonth = YearMonth.parse(month);
63 return yearMonth.lengthOfMonth();
64 }
65
55 /** 66 /**
56 * 根据(开始时间, 结束时间)获取每一个时间间隔的数据, 主要用于eCharts图标xData 67 * 根据(开始时间, 结束时间)获取每一个时间间隔的数据, 主要用于eCharts图标xData
57 * 68 *
......
...@@ -23,4 +23,7 @@ public interface FactoryOperateCenterMapper { ...@@ -23,4 +23,7 @@ public interface FactoryOperateCenterMapper {
23 List<ArchivesWarnVO> getArchivesWarn(@Param("departId") String departId); 23 List<ArchivesWarnVO> getArchivesWarn(@Param("departId") String departId);
24 24
25 List<Map<String, Object>> getFlowData(@Param("departId") String departId, @Param("month") String month); 25 List<Map<String, Object>> getFlowData(@Param("departId") String departId, @Param("month") String month);
26
27 List<Map<String, String>> getReportCount(@Param("departId") String departId, @Param("month") String month,
28 @Param("reportName") String reportName);
26 } 29 }
......
...@@ -35,7 +35,6 @@ ...@@ -35,7 +35,6 @@
35 #{item} 35 #{item}
36 </foreach> 36 </foreach>
37 AND a.record_time LIKE CONCAT(#{month},'%') 37 AND a.record_time LIKE CONCAT(#{month},'%')
38 AND a.alarm_rule_type IN ( 'B001B001', 'B001B002', 'B001B003', 'B001B004' )
39 ORDER BY 38 ORDER BY
40 a.record_time 39 a.record_time
41 </select> 40 </select>
...@@ -112,12 +111,21 @@ ...@@ -112,12 +111,21 @@
112 LEFT JOIN sys_user u ON a.ASSIGNEE_ = CONCAT( 'taskUser_', u.id ) 111 LEFT JOIN sys_user u ON a.ASSIGNEE_ = CONCAT( 'taskUser_', u.id )
113 LEFT JOIN sys_user_depart d ON u.id = d.user_id 112 LEFT JOIN sys_user_depart d ON u.id = d.user_id
114 WHERE 113 WHERE
115 a.ASSIGNEE_ IS NOT NULL 114 d.dep_id in
116 AND d.dep_id in
117 <foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")"> 115 <foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")">
118 #{item} 116 #{item}
119 </foreach> 117 </foreach>
120 AND CREATE_TIME_ LIKE CONCAT(#{month},'%') 118 AND CREATE_TIME_ LIKE CONCAT(#{month},'%')
121 GROUP BY a.REV_ 119 GROUP BY a.REV_
122 </select> 120 </select>
121
122 <select id="getReportCount" resultType="java.util.HashMap">
123 SELECT
124 time
125 FROM
126 ${reportName}
127 WHERE
128 depart_id = #{departId}
129 AND time LIKE CONCAT(#{month},'%')
130 </select>
123 </mapper> 131 </mapper>
......
...@@ -3,6 +3,7 @@ package com.skua.modules.dataAnalysis.service.impl; ...@@ -3,6 +3,7 @@ package com.skua.modules.dataAnalysis.service.impl;
3 import com.skua.common.constant.ReportConstant; 3 import com.skua.common.constant.ReportConstant;
4 import com.skua.common.report.ReportViewUtil; 4 import com.skua.common.report.ReportViewUtil;
5 import com.skua.core.util.ConvertUtils; 5 import com.skua.core.util.ConvertUtils;
6 import com.skua.core.util.DoubleOperaUtils;
6 import com.skua.modules.dataAnalysis.mapper.FactoryOperateCenterMapper; 7 import com.skua.modules.dataAnalysis.mapper.FactoryOperateCenterMapper;
7 import com.skua.modules.dataAnalysis.service.IFactoryOperateCenterService; 8 import com.skua.modules.dataAnalysis.service.IFactoryOperateCenterService;
8 import com.skua.modules.dataAnalysis.vo.ArchivesWarnVO; 9 import com.skua.modules.dataAnalysis.vo.ArchivesWarnVO;
...@@ -24,8 +25,6 @@ public class FactoryOperateCenterServiceImpl implements IFactoryOperateCenterSer ...@@ -24,8 +25,6 @@ public class FactoryOperateCenterServiceImpl implements IFactoryOperateCenterSer
24 25
25 @Resource 26 @Resource
26 private FactoryOperateCenterMapper factoryOperateCenterMapper; 27 private FactoryOperateCenterMapper factoryOperateCenterMapper;
27 @Autowired
28 private FlowForThirdBusinessService flowForThirdBusinessService;
29 28
30 @Override 29 @Override
31 public Map<String, Object> getData(String departId, String month) { 30 public Map<String, Object> getData(String departId, String month) {
...@@ -35,9 +34,9 @@ public class FactoryOperateCenterServiceImpl implements IFactoryOperateCenterSer ...@@ -35,9 +34,9 @@ public class FactoryOperateCenterServiceImpl implements IFactoryOperateCenterSer
35 nclslMap.put("nsjsl","1267"); 34 nclslMap.put("nsjsl","1267");
36 nclslMap.put("wcbfb","80"); 35 nclslMap.put("wcbfb","80");
37 nclslMap.put("nmb","1678"); 36 nclslMap.put("nmb","1678");
38 nclslMap.put("nmbTb","5"); 37 nclslMap.put("nmbTb","1");
39 nclslMap.put("nwcd","1234"); 38 nclslMap.put("nwcd","1234");
40 nclslMap.put("nwcdTb","5"); 39 nclslMap.put("nwcdTb","3");
41 40
42 map.put("yclsl",new HashMap<>()); 41 map.put("yclsl",new HashMap<>());
43 Map<String, Object> yclslMap = new HashMap<>(); 42 Map<String, Object> yclslMap = new HashMap<>();
...@@ -46,23 +45,23 @@ public class FactoryOperateCenterServiceImpl implements IFactoryOperateCenterSer ...@@ -46,23 +45,23 @@ public class FactoryOperateCenterServiceImpl implements IFactoryOperateCenterSer
46 yclslMap.put("ymb","161"); 45 yclslMap.put("ymb","161");
47 yclslMap.put("ymbTb","5"); 46 yclslMap.put("ymbTb","5");
48 yclslMap.put("ywcd","161"); 47 yclslMap.put("ywcd","161");
49 yclslMap.put("ywcdTb","5"); 48 yclslMap.put("ywcdTb","2");
50 49
51 map.put("ndsdh",new HashMap<>()); 50 map.put("ndsdh",new HashMap<>());
52 Map<String, Object> ndsdhMap = new HashMap<>(); 51 Map<String, Object> ndsdhMap = new HashMap<>();
53 ndsdhMap.put("ndsdh","0.5"); 52 ndsdhMap.put("ndsdh","0.5");
54 ndsdhMap.put("nmb","0.45"); 53 ndsdhMap.put("nmb","0.45");
55 ndsdhMap.put("nmbTb","5"); 54 ndsdhMap.put("nmbTb","1");
56 ndsdhMap.put("ydsdh","1234"); 55 ndsdhMap.put("ydsdh","0.32");
57 ndsdhMap.put("ydsdhTb","5"); 56 ndsdhMap.put("ydsdhTb","0");
58 57
59 map.put("ndsyf",new HashMap<>()); 58 map.put("ndsyf",new HashMap<>());
60 Map<String, Object> ndsyfMap = new HashMap<>(); 59 Map<String, Object> ndsyfMap = new HashMap<>();
61 ndsyfMap.put("ndsyf","0.8"); 60 ndsyfMap.put("ndsyf","0.8");
62 ndsyfMap.put("nmb","0.65"); 61 ndsyfMap.put("nmb","0.65");
63 ndsyfMap.put("nmbTb","4"); 62 ndsyfMap.put("nmbTb","2");
64 ndsyfMap.put("ydsyf","0.68"); 63 ndsyfMap.put("ydsyf","0.68");
65 ndsyfMap.put("ydsyfTb","5"); 64 ndsyfMap.put("ydsyfTb","1");
66 65
67 map.put("zhpf",new HashMap<>()); 66 map.put("zhpf",new HashMap<>());
68 Map<String, Object> zhpfMap = new HashMap<>(); 67 Map<String, Object> zhpfMap = new HashMap<>();
...@@ -93,54 +92,72 @@ public class FactoryOperateCenterServiceImpl implements IFactoryOperateCenterSer ...@@ -93,54 +92,72 @@ public class FactoryOperateCenterServiceImpl implements IFactoryOperateCenterSer
93 92
94 @Override 93 @Override
95 public Map<String, Object> getReportData(String departId, String month) { 94 public Map<String, Object> getReportData(String departId, String month) {
95 int dayCount = DateUtils.getDayCountByMonth(month);
96 Map<String, Object> map = new HashMap<>(); 96 Map<String, Object> map = new HashMap<>();
97 int nh = 100; 97 double nh = 100;int nhd = 30;
98 int hy = 100; 98 double hy = 100;int hyd = 30;
99 int df = 100; 99 double df = 100;int dfd = 1;int dfs = 1;
100 int yyzb = 100; 100 double yyzb = 100;int yyzbd = 4;int yyzbs = 4;
101 int ndmb = 100; 101 double ndmb = 100;int ndmbd = 1;int ndmbs = 1;
102 int scyb = 100; 102 double scyb = 100;int scybd = 1;int scybs = 1;
103 int zhf = 100; 103 double zhf = 100;
104 List<Map<String,String>> nhList = factoryOperateCenterMapper.getReportCount(departId,month,"view_3a24");//能耗日报表
105 List<Map<String,String>> yyzbList = factoryOperateCenterMapper.getReportCount(departId,month,"view_30a8");//运营周报表
106 List<Map<String,String>> scybList = factoryOperateCenterMapper.getReportCount(departId,month,"view_4411");//月度生产数据报表
107 List<Map<String,String>> hyList = factoryOperateCenterMapper.getReportCount(departId,month,"view_9bff");//化验数据日报表
108 //能耗报表
109 nhd = nhList.size();
110 nh = DoubleOperaUtils.bigDecimalRound((100*nhd)/dayCount,0);
104 map.put("nh",new HashMap<>()); 111 map.put("nh",new HashMap<>());
105 Map<String, Object> nhMap = new HashMap<>(); 112 Map<String, Object> nhMap = new HashMap<>();
106 nhMap.put("bfb",98); 113 nhMap.put("bfb",nh);
107 nhMap.put("done",29); 114 nhMap.put("done",nhd);
108 nhMap.put("should",30); 115 nhMap.put("should",dayCount);
109 116 //化验报表
117 hyd = hyList.size();
118 hy = DoubleOperaUtils.bigDecimalRound((100*hyd)/dayCount,0);
110 map.put("hy",new HashMap<>()); 119 map.put("hy",new HashMap<>());
111 Map<String, Object> hyMap = new HashMap<>(); 120 Map<String, Object> hyMap = new HashMap<>();
112 hyMap.put("bfb",98); 121 hyMap.put("bfb",hy);
113 hyMap.put("done",29); 122 hyMap.put("done",hyd);
114 hyMap.put("should",30); 123 hyMap.put("should",dayCount);
115 124 //电费报表
116 map.put("df",new HashMap<>()); 125 map.put("df",new HashMap<>());
117 Map<String, Object> dfMap = new HashMap<>(); 126 Map<String, Object> dfMap = new HashMap<>();
118 dfMap.put("bfb",98); 127 dfMap.put("bfb",df);
119 dfMap.put("done",29); 128 dfMap.put("done",dfd);
120 dfMap.put("should",30); 129 dfMap.put("should",dfs);
121 130 //运营报表
131 yyzbd = yyzbList.size();
132 yyzb = DoubleOperaUtils.bigDecimalRound((100*yyzbd)/dayCount,0);
122 map.put("yyzb",new HashMap<>()); 133 map.put("yyzb",new HashMap<>());
123 Map<String, Object> yyzbMap = new HashMap<>(); 134 Map<String, Object> yyzbMap = new HashMap<>();
124 yyzbMap.put("bfb",75); 135 yyzbMap.put("bfb",yyzb);
125 yyzbMap.put("done",3); 136 yyzbMap.put("done",yyzbd);
126 yyzbMap.put("should",4); 137 yyzbMap.put("should",yyzbs);
127 138 //年度目标报表
128 map.put("ndmb",new HashMap<>()); 139 map.put("ndmb",new HashMap<>());
129 Map<String, Object> ndmbMap = new HashMap<>(); 140 Map<String, Object> ndmbMap = new HashMap<>();
130 ndmbMap.put("bfb",100); 141 ndmbMap.put("bfb",ndmb);
131 ndmbMap.put("done",1); 142 ndmbMap.put("done",ndmbd);
132 ndmbMap.put("should",1); 143 ndmbMap.put("should",ndmbs);
133 144 //生产报表
145 if(scybList.size()>0){
146 scyb = 100;scybd = 1;scybs = 1;
147 }else{
148 scyb = 0;scybd = 0;scybs = 1;
149 }
134 map.put("scyb",new HashMap<>()); 150 map.put("scyb",new HashMap<>());
135 Map<String, Object> scybMap = new HashMap<>(); 151 Map<String, Object> scybMap = new HashMap<>();
136 scybMap.put("bfb",100); 152 scybMap.put("bfb",scyb);
137 scybMap.put("done",1); 153 scybMap.put("done",scybd);
138 scybMap.put("should",1); 154 scybMap.put("should",scybs);
139 155 //综合报表
140 map.put("zhf",new HashMap<>()); 156 map.put("zhf",new HashMap<>());
141 Map<String, Object> zhfMap = new HashMap<>(); 157 Map<String, Object> zhfMap = new HashMap<>();
142 zhfMap.put("zhf",98); 158 zhf = DoubleOperaUtils.bigDecimalRound((nh + hy + df + yyzb + ndmb + scyb)/6,0);
143 zhfMap.put("zhfHb",3); 159 zhfMap.put("zhf", zhf);
160 zhfMap.put("zhfHb", 1);
144 //汇总 161 //汇总
145 map.put("nh", nhMap); 162 map.put("nh", nhMap);
146 map.put("hy", hyMap); 163 map.put("hy", hyMap);
...@@ -170,6 +187,10 @@ public class FactoryOperateCenterServiceImpl implements IFactoryOperateCenterSer ...@@ -170,6 +187,10 @@ public class FactoryOperateCenterServiceImpl implements IFactoryOperateCenterSer
170 public List<EquipRunTimeVO> getEquipRunTime(String departId, String month) { 187 public List<EquipRunTimeVO> getEquipRunTime(String departId, String month) {
171 List<EquipRunTimeVO> list = new ArrayList<>(); 188 List<EquipRunTimeVO> list = new ArrayList<>();
172 list = factoryOperateCenterMapper.getEquipRunTime(departId, month); 189 list = factoryOperateCenterMapper.getEquipRunTime(departId, month);
190 for (EquipRunTimeVO equipRunTime : list) {
191 String monitorId = equipRunTime.getRunTime();
192 equipRunTime.setRunTime("0");
193 }
173 return list; 194 return list;
174 } 195 }
175 196
...@@ -185,19 +206,24 @@ public class FactoryOperateCenterServiceImpl implements IFactoryOperateCenterSer ...@@ -185,19 +206,24 @@ public class FactoryOperateCenterServiceImpl implements IFactoryOperateCenterSer
185 Map<String, Object> map = new HashMap<>(); 206 Map<String, Object> map = new HashMap<>();
186 int no = 0;//未完成工单 207 int no = 0;//未完成工单
187 int yes = 0;//完成工单 208 int yes = 0;//完成工单
209 int ing = 0;//完成工单
188 List<Map<String, Object>> list = factoryOperateCenterMapper.getFlowData(departId,month); 210 List<Map<String, Object>> list = factoryOperateCenterMapper.getFlowData(departId,month);
189 if(list.size() > 0){ 211 if(list.size() > 0){
190 for (Map<String, Object> flowMap : list) { 212 for (Map<String, Object> flowMap : list) {
191 if("2".equals(flowMap.get("status").toString())){ 213 if(flowMap.get("status") == null){
192 yes = Integer.parseInt(flowMap.get("status").toString()); 214 no++;
193 }else{ 215 }else{
194 no = no + Integer.parseInt(flowMap.get("status").toString()); 216 if("2".equals(flowMap.get("status").toString())){
217 yes = Integer.parseInt(flowMap.get("status").toString());
218 }else{
219 ing = ing + Integer.parseInt(flowMap.get("status").toString());
220 }
195 } 221 }
196 } 222 }
197 } 223 }
198 map.put("total", yes + no); 224 map.put("total", yes + no + ing);
199 map.put("no", no); 225 map.put("no", no);
200 map.put("ing", no); 226 map.put("ing", ing);
201 map.put("yes", yes); 227 map.put("yes", yes);
202 return map; 228 return map;
203 } 229 }
......
...@@ -12,7 +12,9 @@ import javax.servlet.http.HttpServletRequest; ...@@ -12,7 +12,9 @@ import javax.servlet.http.HttpServletRequest;
12 import javax.servlet.http.HttpServletResponse; 12 import javax.servlet.http.HttpServletResponse;
13 13
14 import com.skua.core.util.encryption.MD5Util; 14 import com.skua.core.util.encryption.MD5Util;
15 import com.skua.modules.common.vo.AliCode;
15 import com.skua.modules.system.vo.SsoLogin; 16 import com.skua.modules.system.vo.SsoLogin;
17 import com.skua.tool.util.AliSmsUtil;
16 import org.apache.commons.lang.StringUtils; 18 import org.apache.commons.lang.StringUtils;
17 import org.apache.shiro.SecurityUtils; 19 import org.apache.shiro.SecurityUtils;
18 import org.springframework.beans.factory.annotation.Autowired; 20 import org.springframework.beans.factory.annotation.Autowired;
...@@ -476,9 +478,11 @@ public class LoginController { ...@@ -476,9 +478,11 @@ public class LoginController {
476 result.setSuccess(false); 478 result.setSuccess(false);
477 return result; 479 return result;
478 } 480 }
479
480 //随机数 481 //随机数
481 String captcha = RandomUtil.randomNumbers(6); 482 String captcha = RandomUtil.randomNumbers(6);
483 AliCode aliCode = new AliCode();
484 aliCode.setProduct("数字化企业大脑");
485 aliCode.setCode(captcha);
482 try { 486 try {
483 boolean b = false; 487 boolean b = false;
484 //注册模板 488 //注册模板
...@@ -489,7 +493,8 @@ public class LoginController { ...@@ -489,7 +493,8 @@ public class LoginController {
489 sysBaseAPI.addLog("手机号已经注册,请直接登录!", CommonConstant.LOG_TYPE_1, null); 493 sysBaseAPI.addLog("手机号已经注册,请直接登录!", CommonConstant.LOG_TYPE_1, null);
490 return result; 494 return result;
491 } 495 }
492 b = HttpSenderMsg.sendMsg("注册验证码为:" + captcha, mobile); 496 aliCode.setType("register");
497 // b = HttpSenderMsg.sendMsg("注册验证码为:" + captcha, mobile);
493 } else { 498 } else {
494 //登录模式,校验用户有效性 499 //登录模式,校验用户有效性
495 SysUser sysUser = sysUserService.getUserByPhone(mobile); 500 SysUser sysUser = sysUserService.getUserByPhone(mobile);
...@@ -503,13 +508,15 @@ public class LoginController { ...@@ -503,13 +508,15 @@ public class LoginController {
503 */ 508 */
504 if (CommonConstant.SMS_TPL_TYPE_0.equals(smsmode)) { 509 if (CommonConstant.SMS_TPL_TYPE_0.equals(smsmode)) {
505 //登录模板 510 //登录模板
506 b = HttpSenderMsg.sendMsg("登录验证码为:" + captcha, mobile); 511 aliCode.setType("login");
512 // b = HttpSenderMsg.sendMsg("登录验证码为:" + captcha, mobile);
507 } else if (CommonConstant.SMS_TPL_TYPE_2.equals(smsmode)) { 513 } else if (CommonConstant.SMS_TPL_TYPE_2.equals(smsmode)) {
514 aliCode.setType("update");
508 //忘记密码模板 515 //忘记密码模板
509 b = HttpSenderMsg.sendMsg("验证码为:" + captcha, mobile); 516 // b = HttpSenderMsg.sendMsg("验证码为:" + captcha, mobile);
510 } 517 }
511 } 518 }
512 519 b = AliSmsUtil.sendCodeMsg(aliCode);
513 if (b == false) { 520 if (b == false) {
514 result.setMessage("短信验证码发送失败,请稍后重试"); 521 result.setMessage("短信验证码发送失败,请稍后重试");
515 result.setSuccess(false); 522 result.setSuccess(false);
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!