Explorar o código

Merge branch 'dev' of http://192.168.1.43:3000/v2/zd-parents into dev

chaiyunlong %!s(int64=3) %!d(string=hai) anos
pai
achega
338e427009

+ 1 - 8
zd-modules/zd-chemical/src/main/java/com/zd/chemical/service/impl/HxpStockServiceImpl.java

@@ -662,7 +662,7 @@ public class HxpStockServiceImpl implements IHxpStockService {
             subNameMap.put(hxpStock.getSubId(),hxpStock.getSubName());
             // 报警记录
             HxpAlarmRecord hxpAlarmRecord = new HxpAlarmRecord();
-            hxpAlarmRecord.setAlarmContent(hxpStock.getSubName()+"实验室,化学品("+hxpStock.getChemicalName() + ")还有3天过期,请尽快确认处理。");
+            hxpAlarmRecord.setAlarmContent(hxpStock.getSubName()+"实验室,化学品("+hxpStock.getChemicalName() + ")还有30天过期,请尽快确认处理。");
             hxpAlarmRecord.setAlarmType(1);
             hxpAlarmRecord.setHasValid(1);
             hxpAlarmRecord.setAlarmMode(1);
@@ -674,13 +674,6 @@ public class HxpStockServiceImpl implements IHxpStockService {
 
             hxpAlarmRecordMapper.insertHxpAlarmRecord(hxpAlarmRecord);
         }
-        if(stockIds.size() > 0){
-            hxpStockMapper.updateExpiredByIds(stockIds);
-        }
-        if(joinIds.size() > 0){
-            hxpChemicalJoinCabinetMapper.updateExpiredByIds(joinIds);
-        }
-        hxpChemicalJoinCabinetMapper.updateChemicalJoinCabinetByExpired();
 
         subMsg.forEach((k,v) -> {
             Map<String, Object> subMsgData = new HashMap<>();

+ 20 - 30
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/device/DeviceRemoteController.java

@@ -11,6 +11,7 @@ import com.zd.model.domain.ResultData;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -32,6 +33,9 @@ public class DeviceRemoteController {
     @Autowired
     private RedisService redisService;
 
+    @Value("${sys.lockTimer:30}")
+    private Integer lockTimer;
+
 
     @PostMapping("/cabinetLock")
     public ResultData cabinetLock(@RequestBody @Valid CabinetLock cabinetLock){
@@ -54,44 +58,30 @@ public class DeviceRemoteController {
             ops.flush();
             logger.info("柜锁开锁指令:" + instruct);
 
-            Thread.sleep(1500);
-            /*ops.write(ReUtil.hexStringToByteArray(instruct));
-            ops.flush();
-
-            Thread.sleep(300);
-            ops.write(ReUtil.hexStringToByteArray(instruct));
-            ops.flush();
-            Thread.sleep(500);
-            ops.write(ReUtil.hexStringToByteArray(instruct));
-            ops.flush();
-            Thread.sleep(300);
-            ops.write(ReUtil.hexStringToByteArray(instruct));
-            ops.flush();
+            instruct = CRCCHECK.getReadLockOrder(Integer.parseInt(cabinetV2Lock.getLockId()));
             Thread.sleep(500);
-            ops.write(ReUtil.hexStringToByteArray(instruct));
-            ops.flush();
-            Thread.sleep(300);
-            ops.write(ReUtil.hexStringToByteArray(instruct));
-            ops.flush();
 
-            instruct = CRCCHECK.getReadLockOrder(Integer.parseInt(cabinetV2Lock.getLockId()));
-            ops.write(ReUtil.hexStringToByteArray(instruct));
-            ops.flush();
+            int timer = lockTimer;
+            Integer status;
+            while (timer > 1){
 
-            Thread.sleep(500);
-            Integer status = redisService.getCacheObject(relayCode + ":" + cabinetV2Lock.getLockId());
-            logger.info("柜锁开锁锁状态查询:" + instruct + ",开锁结果:" + status);*/
-            /*if(status != null && status == 1){
-                return ResultData.success("开锁成功");
-            }*/
-            // TODO 因样件锁 发送开锁指令后锁未主动弹开,先不关注锁的状态
-            return ResultData.success("开锁成功");
+                ops.write(ReUtil.hexStringToByteArray(instruct));
+                ops.flush();
+                timer--;
+
+                Thread.sleep(900);
+                status = redisService.getCacheObject(relayCode + ":" + cabinetV2Lock.getLockId());
+                logger.info("柜锁开锁锁状态查询:" + instruct + ",开锁结果:" + status);
+                if(status != null && status == 1){
+                    return ResultData.success("开锁成功");
+                }
+            }
         } catch (Exception e) {
             e.printStackTrace();
             logger.error("柜锁连接失败:" + e.getMessage());
             return ResultData.fail("柜锁连接失败!");
         }
-        //return ResultData.fail("开锁失败");
+        return ResultData.fail("开锁失败");
     }
 
     /**

+ 2 - 1
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/LabRiskPlanServiceImpl.java

@@ -1071,7 +1071,6 @@ public class LabRiskPlanServiceImpl extends ServiceImpl<LabRiskPlanMapper, LabRi
                 messageSendService.sendWranFunctionToSub(subFunction.getSubId());
                 //首页预案流程通知
                 messageSendService.SendBigViewUpdate(BigViewDataType.SUB_RISKPLAN_GROUP);
-                messageSendService.riskPlanTriggerNotice();
                 messageSendService.SendBigViewUpdate(BigViewDataType.SUB_RISKPLAN_LOG);
                 //首页预案是否同步疏散线路
                 messageSendService.SendBigViewUpdate(BigViewDataType.SUB_RISKPLAN_EXIT);
@@ -1091,6 +1090,8 @@ public class LabRiskPlanServiceImpl extends ServiceImpl<LabRiskPlanMapper, LabRi
             if (redisService.getCacheObject("subjectByYa" + subFunction.getSubId()) != null) {
                 redisService.deleteObject("subjectByYa" + subFunction.getSubId());
             }
+            //向前端发送预案关闭
+            messageSendService.riskPlanTriggerNotice();
         }
         return 0;
     }