|
@@ -8,11 +8,11 @@ import com.bz.smart_city.commom.util.*;
|
|
|
import com.bz.smart_city.config.AccessTokenService;
|
|
|
import com.bz.smart_city.dao.PermissionMapper;
|
|
|
import com.bz.smart_city.dao.SitePermissionMapper;
|
|
|
+import com.bz.smart_city.dao.WarningLogMapper;
|
|
|
+import com.bz.smart_city.dao.WarningMessageMapper;
|
|
|
import com.bz.smart_city.dto.LoginUser;
|
|
|
import com.bz.smart_city.dto.ZipStreamEntity;
|
|
|
-import com.bz.smart_city.entity.Permission;
|
|
|
-import com.bz.smart_city.entity.SitePermission;
|
|
|
-import com.bz.smart_city.entity.User;
|
|
|
+import com.bz.smart_city.entity.*;
|
|
|
import com.bz.smart_city.quartz.entity.QuartzEntity;
|
|
|
import com.bz.smart_city.quartz.job.WaterMeterReadJobV2;
|
|
|
import com.bz.smart_city.quartz.service.JobAndTriggerService;
|
|
@@ -89,6 +89,10 @@ public class TestController {
|
|
|
SitePermissionMapper sitePermissionMapper;
|
|
|
@Autowired
|
|
|
MeterReadRecordService meterReadRecordService;
|
|
|
+ @Resource
|
|
|
+ WarningLogMapper warningLogMapper;
|
|
|
+ @Resource
|
|
|
+ WarningMessageMapper warningMessageMapper;
|
|
|
|
|
|
@GetMapping("test")
|
|
|
@ApiOperation(value = "test")
|
|
@@ -131,8 +135,8 @@ public class TestController {
|
|
|
@ApiParam(value = "opendid", required = true) @RequestParam String opendid
|
|
|
) {
|
|
|
String accessToken = accessTokenService.getMpAccessToken();
|
|
|
- String url = "http://smartcity.100zone.cn";
|
|
|
- String pagepath = "pages/workorder/detail?orderNo=2019031904500057";
|
|
|
+ String url = "https://www.zoniot.com";
|
|
|
+ String pagepath = "";
|
|
|
/*SendWechatPush.sendDeviceFaultNotice(accessToken,opendid,url,"您好,您的监控设备发生了故障","电气火灾探测器","TR-18WD01L",
|
|
|
"1305办公室","过压","2018-10-25 17:59:32","请尽快查看故障详细信息并及时处理");*/
|
|
|
/*SendWechatPush.sendDeviceAlarmNotice(accessToken,opendid,url,"您好,您的监控设备发生了报警","电气火灾探测器","TR-18WD01L",
|
|
@@ -140,8 +144,10 @@ public class TestController {
|
|
|
/*String result = SendWechatPush.sendDispatchNotice(accessToken, opendid, url, "您好,您有新派单待处理", "张三", "T3-207室",
|
|
|
"电气火灾探测器-025A", "供电中断", "2018-10-25 17:59:32", "请尽快查看并及时处理");*/
|
|
|
|
|
|
- String result = SendWechatPush.sendUniformNotice(accessToken, "wx6b2ce547cd593413", opendid, url, "wx890c58705ee4e2de", pagepath, "您好,您有新派单待处理", "张三", "T3-207室",
|
|
|
- "电气火灾探测器-025A", "供电中断", "2018-10-25 17:59:32", "请尽快查看并及时处理");
|
|
|
+ /*String result = SendWechatPush.sendUniformNotice(accessToken, "wx6b2ce547cd593413", opendid, url, "wx890c58705ee4e2de", pagepath, "您好,您有新派单待处理", "张三", "T3-207室",
|
|
|
+ "电气火灾探测器-025A", "供电中断", "2018-10-25 17:59:32", "请尽快查看并及时处理");*/
|
|
|
+ String result = SendWechatPush.sendAbnormalNotice(accessToken, "wx6b2ce547cd593413", opendid, url, "wx759db34b9c2e1491", pagepath, "用户用水异常", "水量预警", "单日用水量超过2吨",
|
|
|
+ "2021-02-23 17:59:32", "1030844808林家栋13765510000长泽花园2-1-502楼梯间用水量有异常情况,请及时关注用户情况!");
|
|
|
log.info(result);
|
|
|
return new AjaxMessage(ResultStatus.OK);
|
|
|
}
|
|
@@ -486,4 +492,53 @@ public class TestController {
|
|
|
//int result = deviceService.importRemoteMeterExcel(file);
|
|
|
return "ok";
|
|
|
}
|
|
|
+
|
|
|
+ @ResponseBody
|
|
|
+ @PostMapping("/addDemoWarningLog")
|
|
|
+ @ApiOperation(value = "添加演示告警记录", notes = "添加演示告警记录")
|
|
|
+ public String addDemoWarningLog(
|
|
|
+ @ApiParam(value = "openId", required = true) @RequestParam String openId,
|
|
|
+ @ApiParam(value = "deviceId", required = true) @RequestParam Long deviceId,
|
|
|
+ @ApiParam(value = "type", required = true) @RequestParam Integer type
|
|
|
+ ) {
|
|
|
+ //int result = deviceService.importRemoteMeterExcel(file);
|
|
|
+ WarningLog warningLogNew = new WarningLog();
|
|
|
+ //warningLogNew.setClientUserId(clientUserDevice.getClientUserId());
|
|
|
+ warningLogNew.setDeviceId(deviceId);
|
|
|
+ warningLogNew.setWarningType(type);
|
|
|
+ warningLogNew.setFeedbackStatus(0);
|
|
|
+ warningLogNew.setFeedbackContent("");
|
|
|
+ warningLogNew.setLastDate(LocalDateTime.now());
|
|
|
+ warningLogNew.setStatus(1);
|
|
|
+ warningLogNew.setCreateBy("system");
|
|
|
+ warningLogNew.setDateCreate(LocalDateTime.now());
|
|
|
+ warningLogNew.setUpdateBy("system");
|
|
|
+ warningLogNew.setDateUpdate(LocalDateTime.now());
|
|
|
+ warningLogMapper.insertSelective(warningLogNew);
|
|
|
+
|
|
|
+
|
|
|
+ String content = "";
|
|
|
+ if(type==3)content="单日用水量0.01吨";
|
|
|
+ if(type==4)content="单日用水量超过2吨";
|
|
|
+
|
|
|
+ WarningMessage warningMessageNew = new WarningMessage();
|
|
|
+ warningMessageNew.setWarningLogId(warningLogNew.getId());
|
|
|
+ warningMessageNew.setContent(content);
|
|
|
+ warningMessageNew.setStatus(1);
|
|
|
+ warningMessageNew.setCreateBy("system");
|
|
|
+ warningMessageNew.setDateCreate(LocalDateTime.now());
|
|
|
+ warningMessageNew.setUpdateBy("system");
|
|
|
+ warningMessageNew.setDateUpdate(LocalDateTime.now());
|
|
|
+ warningMessageMapper.insertSelective(warningMessageNew);
|
|
|
+ DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
+
|
|
|
+ String accessToken = accessTokenService.getMpAccessToken();
|
|
|
+ String url = "https://www.zoniot.com";
|
|
|
+ String pagepath = "";
|
|
|
+ String result = SendWechatPush.sendAbnormalNotice(accessToken, "wx6b2ce547cd593413", openId, url, "wx759db34b9c2e1491", pagepath, "用户用水异常", "水量预警", content,
|
|
|
+ LocalDateTime.now().format(df), "1030844808林家栋13765510000长泽花园2-1-502楼梯间用水量有异常情况,请及时关注用户情况!");
|
|
|
+ log.info(result);
|
|
|
+ return "ok";
|
|
|
+ }
|
|
|
+
|
|
|
}
|