|
@@ -1,16 +1,21 @@
|
|
|
package com.zd.laboratory.controller;
|
|
package com.zd.laboratory.controller;
|
|
|
|
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.zd.common.core.annotation.Log;
|
|
import com.zd.common.core.annotation.Log;
|
|
|
import com.zd.common.core.annotation.PreAuthorize;
|
|
import com.zd.common.core.annotation.PreAuthorize;
|
|
|
import com.zd.common.core.log.BusinessType;
|
|
import com.zd.common.core.log.BusinessType;
|
|
|
|
|
+import com.zd.common.core.redis.RedisService;
|
|
|
import com.zd.common.core.utils.DictUtils;
|
|
import com.zd.common.core.utils.DictUtils;
|
|
|
import com.zd.common.core.utils.ExcelUtil;
|
|
import com.zd.common.core.utils.ExcelUtil;
|
|
|
import com.zd.common.core.web.controller.BaseController;
|
|
import com.zd.common.core.web.controller.BaseController;
|
|
|
import com.zd.laboratory.domain.LabAbnormal;
|
|
import com.zd.laboratory.domain.LabAbnormal;
|
|
|
import com.zd.laboratory.domain.vo.LabAbnormalVO;
|
|
import com.zd.laboratory.domain.vo.LabAbnormalVO;
|
|
|
|
|
+import com.zd.laboratory.domain.vo.LabDealyNotifyVo;
|
|
|
import com.zd.laboratory.service.ILabAbnormalService;
|
|
import com.zd.laboratory.service.ILabAbnormalService;
|
|
|
import com.zd.laboratory.socket.command.Symbol;
|
|
import com.zd.laboratory.socket.command.Symbol;
|
|
|
import com.zd.laboratory.socket.service.SocketService;
|
|
import com.zd.laboratory.socket.service.SocketService;
|
|
|
|
|
+import com.zd.model.constant.BaseConstants;
|
|
|
import com.zd.model.domain.ResultData;
|
|
import com.zd.model.domain.ResultData;
|
|
|
import com.zd.model.domain.per.PerFun;
|
|
import com.zd.model.domain.per.PerFun;
|
|
|
import com.zd.model.domain.per.PerPrefix;
|
|
import com.zd.model.domain.per.PerPrefix;
|
|
@@ -23,10 +28,8 @@ import javax.servlet.http.HttpServletResponse;
|
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.time.LocalDate;
|
|
import java.time.LocalDate;
|
|
|
-import java.util.Collections;
|
|
|
|
|
-import java.util.List;
|
|
|
|
|
-import java.util.Map;
|
|
|
|
|
-import java.util.Optional;
|
|
|
|
|
|
|
+import java.util.*;
|
|
|
|
|
+import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 异常设备Controller
|
|
* 异常设备Controller
|
|
@@ -42,6 +45,9 @@ public class LabAbnormalController extends BaseController {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private SocketService socketService;
|
|
private SocketService socketService;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private RedisService redisService;
|
|
|
|
|
+
|
|
|
@GetMapping("/send")
|
|
@GetMapping("/send")
|
|
|
public ResultData send(int num, String deviceNum, int type) {
|
|
public ResultData send(int num, String deviceNum, int type) {
|
|
|
|
|
|
|
@@ -187,4 +193,24 @@ public class LabAbnormalController extends BaseController {
|
|
|
public ResultData getAbnormalCount(LabAbnormalVO labAbnormal) {
|
|
public ResultData getAbnormalCount(LabAbnormalVO labAbnormal) {
|
|
|
return ResultData.success(labAbnormalService.getAbnormalCount(labAbnormal));
|
|
return ResultData.success(labAbnormalService.getAbnormalCount(labAbnormal));
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ @GetMapping("/sendMsg")
|
|
|
|
|
+ public ResultData sendMsg() {
|
|
|
|
|
+ LabDealyNotifyVo labDealyNotifyVo = new LabDealyNotifyVo();
|
|
|
|
|
+ labDealyNotifyVo.setRandomNum(UUID.randomUUID().toString());
|
|
|
|
|
+ labDealyNotifyVo.setHardwareNum("123455");
|
|
|
|
|
+ labDealyNotifyVo.setOpenOrCloseType(1);
|
|
|
|
|
+ JSONObject jsonObj = new JSONObject();
|
|
|
|
|
+ jsonObj.put(BaseConstants.DELAY_QUEUE,labDealyNotifyVo);
|
|
|
|
|
+ redisService.setCacheObject(BaseConstants.DELAY_QUEUE+"~"+ jsonObj,jsonObj, 10L, TimeUnit.SECONDS);
|
|
|
|
|
+
|
|
|
|
|
+ LabDealyNotifyVo labDealyNotifyVo2 = new LabDealyNotifyVo();
|
|
|
|
|
+ labDealyNotifyVo2.setRandomNum(UUID.randomUUID().toString());
|
|
|
|
|
+ labDealyNotifyVo2.setHardwareNum("123455");
|
|
|
|
|
+ labDealyNotifyVo2.setOpenOrCloseType(0);
|
|
|
|
|
+ JSONObject jsonObj2 = new JSONObject();
|
|
|
|
|
+ jsonObj2.put(BaseConstants.DELAY_QUEUE,labDealyNotifyVo2);
|
|
|
|
|
+ redisService.setCacheObject(BaseConstants.DELAY_QUEUE+"~"+ jsonObj2,jsonObj2, 20L, TimeUnit.SECONDS);
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|