8dd8c848 康伟

Merge remote-tracking branch 'origin/master'

2 个父辈 59f25509 d1431d0a
...@@ -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 *
......
...@@ -62,6 +62,9 @@ public class APPDangerInspectionRecordController { ...@@ -62,6 +62,9 @@ public class APPDangerInspectionRecordController {
62 if(dangerInspectionRecord.getDangerId() != null && dangerInspectionRecord.getDangerId().length() > 0 ){ 62 if(dangerInspectionRecord.getDangerId() != null && dangerInspectionRecord.getDangerId().length() > 0 ){
63 queryWrapper.eq("danger_id", dangerInspectionRecord.getDangerId()); 63 queryWrapper.eq("danger_id", dangerInspectionRecord.getDangerId());
64 } 64 }
65 if(StringUtils.isNotBlank(dangerInspectionRecord.getDepartId())){
66 queryWrapper.ge("depart_id", dangerInspectionRecord.getDepartId() ) ;
67 }
65 if(StringUtils.isNotBlank(dangerInspectionRecord.getStartTime())){ 68 if(StringUtils.isNotBlank(dangerInspectionRecord.getStartTime())){
66 queryWrapper.ge("report_date", dangerInspectionRecord.getStartTime() ) ; 69 queryWrapper.ge("report_date", dangerInspectionRecord.getStartTime() ) ;
67 } 70 }
......
...@@ -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>
......
...@@ -2,16 +2,14 @@ package com.skua.modules.dataAnalysis.service.impl; ...@@ -2,16 +2,14 @@ package com.skua.modules.dataAnalysis.service.impl;
2 2
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.DoubleOperaUtils;
6 import com.skua.modules.dataAnalysis.mapper.FactoryOperateCenterMapper; 6 import com.skua.modules.dataAnalysis.mapper.FactoryOperateCenterMapper;
7 import com.skua.modules.dataAnalysis.service.IFactoryOperateCenterService; 7 import com.skua.modules.dataAnalysis.service.IFactoryOperateCenterService;
8 import com.skua.modules.dataAnalysis.vo.ArchivesWarnVO; 8 import com.skua.modules.dataAnalysis.vo.ArchivesWarnVO;
9 import com.skua.modules.dataAnalysis.vo.EquipAlarmVO; 9 import com.skua.modules.dataAnalysis.vo.EquipAlarmVO;
10 import com.skua.modules.dataAnalysis.vo.EquipRunTimeVO; 10 import com.skua.modules.dataAnalysis.vo.EquipRunTimeVO;
11 import com.skua.modules.dataAnalysis.vo.EquipWarnVO; 11 import com.skua.modules.dataAnalysis.vo.EquipWarnVO;
12 import com.skua.modules.flow.service.FlowForThirdBusinessService;
13 import com.skua.tool.util.DateUtils; 12 import com.skua.tool.util.DateUtils;
14 import org.springframework.beans.factory.annotation.Autowired;
15 import org.springframework.stereotype.Service; 13 import org.springframework.stereotype.Service;
16 import javax.annotation.Resource; 14 import javax.annotation.Resource;
17 import java.util.ArrayList; 15 import java.util.ArrayList;
...@@ -24,20 +22,36 @@ public class FactoryOperateCenterServiceImpl implements IFactoryOperateCenterSer ...@@ -24,20 +22,36 @@ public class FactoryOperateCenterServiceImpl implements IFactoryOperateCenterSer
24 22
25 @Resource 23 @Resource
26 private FactoryOperateCenterMapper factoryOperateCenterMapper; 24 private FactoryOperateCenterMapper factoryOperateCenterMapper;
27 @Autowired
28 private FlowForThirdBusinessService flowForThirdBusinessService;
29 25
30 @Override 26 @Override
31 public Map<String, Object> getData(String departId, String month) { 27 public Map<String, Object> getData(String departId, String month) {
28 String tbMonth = DateUtils.getTbMonth(month);
29 String hbMonth = DateUtils.getHbMonth(month);
30 String year = month.substring(0,4);
31 String tbYear = String.valueOf(Integer.parseInt(year) - 1);
32 String dataViewName2119Year = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departId, year);
33 String dataViewName2119YearTb = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departId, tbYear);
34 String dataViewName2119Month = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departId, month);
35 String dataViewName2119MonthTb = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departId, tbMonth);
36 String dataViewName2119MonthHb = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departId, hbMonth);
37
38 String field3a24 = "DLHJ,PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,PFS,FHTY,RYXNJ," +
39 "YWL,GXCLJ,CH3COONA,HXT,FECL3,SH,CH3COOH,FESO4G,FESO4Y,H2O2";
40 String dataViewName3a24Year = ReportViewUtil.buildViewLike(ReportConstant.view3a24,field3a24, departId, year);
41 String dataViewName3a24YearTb = ReportViewUtil.buildViewLike(ReportConstant.view3a24,field3a24, departId, tbYear);
42 String dataViewName3a24Month = ReportViewUtil.buildViewLike(ReportConstant.view3a24,field3a24, departId, month);
43 String dataViewName3a24MonthTb = ReportViewUtil.buildViewLike(ReportConstant.view3a24,field3a24, departId, tbMonth);
44 String dataViewName3a24MonthHb = ReportViewUtil.buildViewLike(ReportConstant.view3a24,field3a24, departId, hbMonth);
45
32 Map<String, Object> map = new HashMap<>(); 46 Map<String, Object> map = new HashMap<>();
33 map.put("nclsl",new HashMap<>()); 47 map.put("nclsl",new HashMap<>());
34 Map<String, Object> nclslMap = new HashMap<>(); 48 Map<String, Object> nclslMap = new HashMap<>();
35 nclslMap.put("nsjsl","1267"); 49 nclslMap.put("nsjsl","1267");
36 nclslMap.put("wcbfb","80"); 50 nclslMap.put("wcbfb","80");
37 nclslMap.put("nmb","1678"); 51 nclslMap.put("nmb","1678");
38 nclslMap.put("nmbTb","5"); 52 nclslMap.put("nmbTb","1");
39 nclslMap.put("nwcd","1234"); 53 nclslMap.put("nwcd","1234");
40 nclslMap.put("nwcdTb","5"); 54 nclslMap.put("nwcdTb","3");
41 55
42 map.put("yclsl",new HashMap<>()); 56 map.put("yclsl",new HashMap<>());
43 Map<String, Object> yclslMap = new HashMap<>(); 57 Map<String, Object> yclslMap = new HashMap<>();
...@@ -46,23 +60,23 @@ public class FactoryOperateCenterServiceImpl implements IFactoryOperateCenterSer ...@@ -46,23 +60,23 @@ public class FactoryOperateCenterServiceImpl implements IFactoryOperateCenterSer
46 yclslMap.put("ymb","161"); 60 yclslMap.put("ymb","161");
47 yclslMap.put("ymbTb","5"); 61 yclslMap.put("ymbTb","5");
48 yclslMap.put("ywcd","161"); 62 yclslMap.put("ywcd","161");
49 yclslMap.put("ywcdTb","5"); 63 yclslMap.put("ywcdTb","2");
50 64
51 map.put("ndsdh",new HashMap<>()); 65 map.put("ndsdh",new HashMap<>());
52 Map<String, Object> ndsdhMap = new HashMap<>(); 66 Map<String, Object> ndsdhMap = new HashMap<>();
53 ndsdhMap.put("ndsdh","0.5"); 67 ndsdhMap.put("ndsdh","0.5");
54 ndsdhMap.put("nmb","0.45"); 68 ndsdhMap.put("nmb","0.45");
55 ndsdhMap.put("nmbTb","5"); 69 ndsdhMap.put("nmbTb","1");
56 ndsdhMap.put("ydsdh","1234"); 70 ndsdhMap.put("ydsdh","0.32");
57 ndsdhMap.put("ydsdhTb","5"); 71 ndsdhMap.put("ydsdhTb","0");
58 72
59 map.put("ndsyf",new HashMap<>()); 73 map.put("ndsyf",new HashMap<>());
60 Map<String, Object> ndsyfMap = new HashMap<>(); 74 Map<String, Object> ndsyfMap = new HashMap<>();
61 ndsyfMap.put("ndsyf","0.8"); 75 ndsyfMap.put("ndsyf","0.8");
62 ndsyfMap.put("nmb","0.65"); 76 ndsyfMap.put("nmb","0.65");
63 ndsyfMap.put("nmbTb","4"); 77 ndsyfMap.put("nmbTb","2");
64 ndsyfMap.put("ydsyf","0.68"); 78 ndsyfMap.put("ydsyf","0.68");
65 ndsyfMap.put("ydsyfTb","5"); 79 ndsyfMap.put("ydsyfTb","1");
66 80
67 map.put("zhpf",new HashMap<>()); 81 map.put("zhpf",new HashMap<>());
68 Map<String, Object> zhpfMap = new HashMap<>(); 82 Map<String, Object> zhpfMap = new HashMap<>();
...@@ -93,54 +107,72 @@ public class FactoryOperateCenterServiceImpl implements IFactoryOperateCenterSer ...@@ -93,54 +107,72 @@ public class FactoryOperateCenterServiceImpl implements IFactoryOperateCenterSer
93 107
94 @Override 108 @Override
95 public Map<String, Object> getReportData(String departId, String month) { 109 public Map<String, Object> getReportData(String departId, String month) {
110 int dayCount = DateUtils.getDayCountByMonth(month);
96 Map<String, Object> map = new HashMap<>(); 111 Map<String, Object> map = new HashMap<>();
97 int nh = 100; 112 double nh = 100;int nhd = 30;
98 int hy = 100; 113 double hy = 100;int hyd = 30;
99 int df = 100; 114 double df = 100;int dfd = 1;int dfs = 1;
100 int yyzb = 100; 115 double yyzb = 100;int yyzbd = 4;int yyzbs = 4;
101 int ndmb = 100; 116 double ndmb = 100;int ndmbd = 1;int ndmbs = 1;
102 int scyb = 100; 117 double scyb = 100;int scybd = 1;int scybs = 1;
103 int zhf = 100; 118 double zhf = 100;
119 List<Map<String,String>> nhList = factoryOperateCenterMapper.getReportCount(departId,month,"view_3a24");//能耗日报表
120 List<Map<String,String>> yyzbList = factoryOperateCenterMapper.getReportCount(departId,month,"view_30a8");//运营周报表
121 List<Map<String,String>> scybList = factoryOperateCenterMapper.getReportCount(departId,month,"view_4411");//月度生产数据报表
122 List<Map<String,String>> hyList = factoryOperateCenterMapper.getReportCount(departId,month,"view_9bff");//化验数据日报表
123 //能耗报表
124 nhd = nhList.size();
125 nh = DoubleOperaUtils.bigDecimalRound((100*nhd)/dayCount,0);
104 map.put("nh",new HashMap<>()); 126 map.put("nh",new HashMap<>());
105 Map<String, Object> nhMap = new HashMap<>(); 127 Map<String, Object> nhMap = new HashMap<>();
106 nhMap.put("bfb",98); 128 nhMap.put("bfb",nh);
107 nhMap.put("done",29); 129 nhMap.put("done",nhd);
108 nhMap.put("should",30); 130 nhMap.put("should",dayCount);
109 131 //化验报表
132 hyd = hyList.size();
133 hy = DoubleOperaUtils.bigDecimalRound((100*hyd)/dayCount,0);
110 map.put("hy",new HashMap<>()); 134 map.put("hy",new HashMap<>());
111 Map<String, Object> hyMap = new HashMap<>(); 135 Map<String, Object> hyMap = new HashMap<>();
112 hyMap.put("bfb",98); 136 hyMap.put("bfb",hy);
113 hyMap.put("done",29); 137 hyMap.put("done",hyd);
114 hyMap.put("should",30); 138 hyMap.put("should",dayCount);
115 139 //电费报表
116 map.put("df",new HashMap<>()); 140 map.put("df",new HashMap<>());
117 Map<String, Object> dfMap = new HashMap<>(); 141 Map<String, Object> dfMap = new HashMap<>();
118 dfMap.put("bfb",98); 142 dfMap.put("bfb",df);
119 dfMap.put("done",29); 143 dfMap.put("done",dfd);
120 dfMap.put("should",30); 144 dfMap.put("should",dfs);
121 145 //运营报表
146 yyzbd = yyzbList.size();
147 yyzb = DoubleOperaUtils.bigDecimalRound((100*yyzbd)/dayCount,0);
122 map.put("yyzb",new HashMap<>()); 148 map.put("yyzb",new HashMap<>());
123 Map<String, Object> yyzbMap = new HashMap<>(); 149 Map<String, Object> yyzbMap = new HashMap<>();
124 yyzbMap.put("bfb",75); 150 yyzbMap.put("bfb",yyzb);
125 yyzbMap.put("done",3); 151 yyzbMap.put("done",yyzbd);
126 yyzbMap.put("should",4); 152 yyzbMap.put("should",yyzbs);
127 153 //年度目标报表
128 map.put("ndmb",new HashMap<>()); 154 map.put("ndmb",new HashMap<>());
129 Map<String, Object> ndmbMap = new HashMap<>(); 155 Map<String, Object> ndmbMap = new HashMap<>();
130 ndmbMap.put("bfb",100); 156 ndmbMap.put("bfb",ndmb);
131 ndmbMap.put("done",1); 157 ndmbMap.put("done",ndmbd);
132 ndmbMap.put("should",1); 158 ndmbMap.put("should",ndmbs);
133 159 //生产报表
160 if(scybList.size()>0){
161 scyb = 100;scybd = 1;scybs = 1;
162 }else{
163 scyb = 0;scybd = 0;scybs = 1;
164 }
134 map.put("scyb",new HashMap<>()); 165 map.put("scyb",new HashMap<>());
135 Map<String, Object> scybMap = new HashMap<>(); 166 Map<String, Object> scybMap = new HashMap<>();
136 scybMap.put("bfb",100); 167 scybMap.put("bfb",scyb);
137 scybMap.put("done",1); 168 scybMap.put("done",scybd);
138 scybMap.put("should",1); 169 scybMap.put("should",scybs);
139 170 //综合报表
140 map.put("zhf",new HashMap<>()); 171 map.put("zhf",new HashMap<>());
141 Map<String, Object> zhfMap = new HashMap<>(); 172 Map<String, Object> zhfMap = new HashMap<>();
142 zhfMap.put("zhf",98); 173 zhf = DoubleOperaUtils.bigDecimalRound((nh + hy + df + yyzb + ndmb + scyb)/6,0);
143 zhfMap.put("zhfHb",3); 174 zhfMap.put("zhf", zhf);
175 zhfMap.put("zhfHb", 1);
144 //汇总 176 //汇总
145 map.put("nh", nhMap); 177 map.put("nh", nhMap);
146 map.put("hy", hyMap); 178 map.put("hy", hyMap);
...@@ -170,6 +202,10 @@ public class FactoryOperateCenterServiceImpl implements IFactoryOperateCenterSer ...@@ -170,6 +202,10 @@ public class FactoryOperateCenterServiceImpl implements IFactoryOperateCenterSer
170 public List<EquipRunTimeVO> getEquipRunTime(String departId, String month) { 202 public List<EquipRunTimeVO> getEquipRunTime(String departId, String month) {
171 List<EquipRunTimeVO> list = new ArrayList<>(); 203 List<EquipRunTimeVO> list = new ArrayList<>();
172 list = factoryOperateCenterMapper.getEquipRunTime(departId, month); 204 list = factoryOperateCenterMapper.getEquipRunTime(departId, month);
205 for (EquipRunTimeVO equipRunTime : list) {
206 String monitorId = equipRunTime.getRunTime();
207 equipRunTime.setRunTime("0");
208 }
173 return list; 209 return list;
174 } 210 }
175 211
...@@ -185,19 +221,24 @@ public class FactoryOperateCenterServiceImpl implements IFactoryOperateCenterSer ...@@ -185,19 +221,24 @@ public class FactoryOperateCenterServiceImpl implements IFactoryOperateCenterSer
185 Map<String, Object> map = new HashMap<>(); 221 Map<String, Object> map = new HashMap<>();
186 int no = 0;//未完成工单 222 int no = 0;//未完成工单
187 int yes = 0;//完成工单 223 int yes = 0;//完成工单
224 int ing = 0;//完成工单
188 List<Map<String, Object>> list = factoryOperateCenterMapper.getFlowData(departId,month); 225 List<Map<String, Object>> list = factoryOperateCenterMapper.getFlowData(departId,month);
189 if(list.size() > 0){ 226 if(list.size() > 0){
190 for (Map<String, Object> flowMap : list) { 227 for (Map<String, Object> flowMap : list) {
228 if(flowMap.get("status") == null){
229 no++;
230 }else{
191 if("2".equals(flowMap.get("status").toString())){ 231 if("2".equals(flowMap.get("status").toString())){
192 yes = Integer.parseInt(flowMap.get("status").toString()); 232 yes = Integer.parseInt(flowMap.get("status").toString());
193 }else{ 233 }else{
194 no = no + Integer.parseInt(flowMap.get("status").toString()); 234 ing = ing + Integer.parseInt(flowMap.get("status").toString());
235 }
195 } 236 }
196 } 237 }
197 } 238 }
198 map.put("total", yes + no); 239 map.put("total", yes + no + ing);
199 map.put("no", no); 240 map.put("no", no);
200 map.put("ing", no); 241 map.put("ing", ing);
201 map.put("yes", yes); 242 map.put("yes", yes);
202 return map; 243 return map;
203 } 244 }
......
...@@ -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!