Browse Source

-- PLC信息读取日志添加

star 1 year ago
parent
commit
1084a1cb18

+ 4 - 0
ruoyi-dongfangyaiye/src/main/java/com/ruoyi/taiye/job/AMSJob.java

@@ -1,7 +1,9 @@
 package com.ruoyi.taiye.job;
 
 import com.ruoyi.ams.tm.service.ITsTaskService;
+import com.ruoyi.system.enums.PLCConnectNameEnum;
 import com.ruoyi.system.enums.PLCEnum;
+import com.ruoyi.taiye.domain.DeviceLog;
 import com.ruoyi.taiye.service.IDeviceLogService;
 import com.ruoyi.taiye.service.ProcessService;
 import lombok.extern.slf4j.Slf4j;
@@ -28,6 +30,7 @@ public class AMSJob {
      */
     public void onePackingMachineUnloadingTask() {
         boolean b = iTsTaskService.readPlcState(PLCEnum.PACKING_BLANK_0.getMetadata());
+        deviceLogService.insertDeviceLog(new DeviceLog(PLCConnectNameEnum.PACKING_MACHINE_1.getMetadata(),PLCConnectNameEnum.PACKING_MACHINE_1.getMetaName(),"获取到下料信号:"+b,"1"));
         //下料信号读取
         log.info("PLC下料信号读取-----"+b);
         if (b) {
@@ -41,6 +44,7 @@ public class AMSJob {
      */
     public void onePackingMachineUpEmptyPallets() {
         boolean b = iTsTaskService.readPlcState(PLCEnum.PACKING_CALL_EMPTY_0.getMetadata());
+        deviceLogService.insertDeviceLog(new DeviceLog(PLCConnectNameEnum.PACKING_MACHINE_1.getMetadata(),PLCConnectNameEnum.PACKING_MACHINE_1.getMetaName(),"获取到上空信号:"+b,"1"));
         //下料信号读取
         log.info("PLC上空信号读取-----"+b);
         if (b) {

+ 0 - 3
warewms-ams/src/main/java/com/ruoyi/ams/tm/service/impl/TsTaskServiceImpl.java

@@ -168,9 +168,6 @@ public class TsTaskServiceImpl implements ITsTaskService {
                         log.info("任务未取卸货,不能直接完成!" + wcsTask.getTaskNo()+"——"+ wcsTask.getTaskNo());
                         return TsTaskStateResponse.error("任务未取卸货,不能直接完成!" ,"");
                     }
-                    if (wcsTask.getState() == 6) {
-                        return TsTaskStateResponse.success("执行成功!" ,"");
-                    }
                     // 解锁终点库位
                     baseLocationInfoService.unLockLocationStockStatus(Long.parseLong(wcsTask.getLocationTo()), Constant.WAREHOUSE_ID, "TS-TM");
                     // 将中间缓存位库存移动到终点

+ 1 - 1
warewms-ams/src/main/resources/mapper/ams/WcsTaskMapper.xml

@@ -369,6 +369,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="parentTask != null  and parentTask != ''"> and parent_task = #{parentTask}</if>
             <if test="agvNo != null  and agvNo != ''"> and agv_no like concat('%', #{agvNo}, '%')</if>
         </where>
-        and state in(1,3,4,5,8,9,10)
+        and state in(1,3,4,5,8,9,10,13,14)
     </select>
 </mapper>