Browse Source

任务配置流程枚举

k 1 year ago
parent
commit
b18d02338e

+ 0 - 62
ruoyi-admin/src/main/java/com/ruoyi/init/StartService.java

@@ -53,66 +53,4 @@ public class StartService implements CommandLineRunner {
     }
 
 
-    /**
-     * 自动接驳位任务
-     * 1.扫描有货的接驳位,如果标记是ASN则进行自动入库
-     * 2.扫描有货的接驳位,如果标记是SO则进行自动出库
-     */
-    public void autoTranSitTask() {
-        autoTranSitTask.run();
-    }
-
-    /**
-     * 自动RFID读取任务(墙外)
-     * 1.带有标签的人工叉车靠近RFID阅读器,开启自动门
-     * 2.带有标签的人工叉车离开RFID阅读器,关闭自动门
-     */
-    public void autoRfidReaderTask() {
-        autoRfidReaderTask.run();
-    }
-
-    /**
-     * 自动RFID读取任务(室内)
-     */
-    public void autoRfidReaderTask01() {
-        autoRfidReaderTask.run01();
-    }
-
-    /**
-     * 自动按钮盒监控任务
-     * 1.人工卸完货之后按下冲边按钮,触发冲边搬运任务
-     * 2.人工卸完货之后按下硫化按钮,触发硫化搬运任务
-     */
-    public void autoButtonBoxTask() {
-        autoButtonBoxTask.run();
-    }
-
-    /**
-     * 空托盘入库测试
-     *
-     * @param locationFrom
-     */
-    public void emptyPalletStorage(String locationFrom) {
-        // 验证起始点是否空闲
-        Boolean isIdle = baseLocationInfoService.verifyLocationIsIdle(locationFrom,Constant.WAREHOUSE_ID);
-        if (!isIdle) {
-            return;
-        }
-        // 下发任务
-        AgvCallDTO agvCallDTO = new AgvCallDTO();
-        agvCallDTO.setWarehouseId(Constant.WAREHOUSE_ID);
-        agvCallDTO.setLocationFrom(locationFrom);
-        List<AgvCallItemDTO> agvCallItemDTOList = new ArrayList<>();
-        AgvCallItemDTO agvCallItemDTO = new AgvCallItemDTO();
-        agvCallItemDTO.setSku("EMPTY_TRAY");
-        agvCallItemDTO.setQty(1d);
-        agvCallItemDTO.setWeight(1d);
-        LotattDTO lotattDTO = new LotattDTO();
-        lotattDTO.setLotatt01("EMPTY_TRAY");
-        lotattDTO.setLotatt05("90");
-        agvCallItemDTO.setLotattDTO(lotattDTO);
-        agvCallItemDTOList.add(agvCallItemDTO);
-        agvCallDTO.setAgvCallItemDTOList(agvCallItemDTOList);
-        businessService.agvCall(Constant.IN_TRAN_FLOW_ID, agvCallDTO);
-    }
 }

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warewms/pda/PdaDocAsnController.java

@@ -96,7 +96,7 @@ public class PdaDocAsnController {
             agvCallItemDTOList.add(agvCallItemDTO);
         });
         agvCallDTO.setAgvCallItemDTOList(agvCallItemDTOList);
-        return businessService.agvCall(Constant.IN_TRAN_FLOW_ID, agvCallDTO);
+        return businessService.agvCall(1l, agvCallDTO);
     }
 
     @Data

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warewms/pda/PdaDocSoController.java

@@ -129,7 +129,7 @@ public class PdaDocSoController {
         agvCallItemDTO.setLotattDTO(lotattDTO);
         agvCallItemDTOList.add(agvCallItemDTO);
         agvCallDTO.setAgvCallItemDTOList(agvCallItemDTOList);
-        return businessService.agvCall(Constant.STO_TRAN_FLOW_ID, agvCallDTO);
+        return businessService.agvCall(1l, agvCallDTO);
     }
 
     @Data

+ 2 - 2
warewms-ams/src/main/java/com/ruoyi/ams/agv/ndc/thread/AutoButtonBoxTask.java

@@ -60,7 +60,7 @@ public class AutoButtonBoxTask {
         agvCallItemDTO.setLotattDTO(lotattDTO);
         agvCallItemDTOList.add(agvCallItemDTO);
         agvCallDTO.setAgvCallItemDTOList(agvCallItemDTOList);
-        AjaxResult ajaxResult = businessService.agvCall(Constant.MOLD_HANDLING_LH_FLOW_ID, agvCallDTO);
+        AjaxResult ajaxResult = businessService.agvCall(1l, agvCallDTO);
         if (!ajaxResult.isSuccess()) {
             log.error("下发模具搬运任务(硫化)失败:" + ajaxResult.getMsg());
             return;
@@ -96,7 +96,7 @@ public class AutoButtonBoxTask {
         agvCallItemDTO.setLotattDTO(lotattDTO);
         agvCallItemDTOList.add(agvCallItemDTO);
         agvCallDTO.setAgvCallItemDTOList(agvCallItemDTOList);
-        AjaxResult ajaxResult = businessService.agvCall(Constant.MOLD_HANDLING_CB_FLOW_ID, agvCallDTO);
+        AjaxResult ajaxResult = businessService.agvCall(1l, agvCallDTO);
         if (!ajaxResult.isSuccess()) {
             log.error("下发模具搬运任务(冲边)失败:" + ajaxResult.getMsg());
             return;

+ 19 - 19
warewms-ams/src/main/java/com/ruoyi/ams/business/BusinessServiceImpl.java

@@ -680,25 +680,25 @@ public class BusinessServiceImpl implements IBusinessService {
     public void autoSendTranSit() {
         List<BaseLocationInfo> baseLocationInfos = baseLocationInfoService.selectSortedLocatinListByZoneId(Constant.ZONE_TYPE.TRANSIT.getValue()
                 , Constant.WAREHOUSE_ID, null);
-        for (BaseLocationInfo baseLocationInfo : baseLocationInfos) {
-            // 判断是否有货并且空闲
-            if (baseLocationInfo.getStockStatus().equals(Constant.STOCK_STATUS.STOCK00.getValue())
-                    && baseLocationInfo.getIsEmpty().equals(Constant.IS_YES.N.name())) {
-                if (baseLocationInfo.getUserdefine1().equals("ASN")) {
-                    AgvCallDTO agvCallDTO = new AgvCallDTO();
-                    agvCallDTO.setLocationFrom(baseLocationInfo.getLocationNo());
-                    businessService.agvCall(Constant.TRAN_STO_FLOW_ID, agvCallDTO);
-                } else if (baseLocationInfo.getUserdefine1().equals("SO_HG")) {
-                    AgvCallDTO agvCallDTO = new AgvCallDTO();
-                    agvCallDTO.setLocationFrom(baseLocationInfo.getLocationNo());
-                    businessService.agvCall(Constant.TRAN_OUT_FLOW_ID, agvCallDTO);
-                } else if (baseLocationInfo.getUserdefine1().equals("SO_BHG")) {
-                    AgvCallDTO agvCallDTO = new AgvCallDTO();
-                    agvCallDTO.setLocationFrom(baseLocationInfo.getLocationNo());
-                    businessService.agvCall(Constant.TRAN_OUT_BHG_FLOW_ID, agvCallDTO);
-                }
-            }
-        }
+//        for (BaseLocationInfo baseLocationInfo : baseLocationInfos) {
+//            // 判断是否有货并且空闲
+//            if (baseLocationInfo.getStockStatus().equals(Constant.STOCK_STATUS.STOCK00.getValue())
+//                    && baseLocationInfo.getIsEmpty().equals(Constant.IS_YES.N.name())) {
+//                if (baseLocationInfo.getUserdefine1().equals("ASN")) {
+//                    AgvCallDTO agvCallDTO = new AgvCallDTO();
+//                    agvCallDTO.setLocationFrom(baseLocationInfo.getLocationNo());
+//                    businessService.agvCall(Constant.TRAN_STO_FLOW_ID, agvCallDTO);
+//                } else if (baseLocationInfo.getUserdefine1().equals("SO_HG")) {
+//                    AgvCallDTO agvCallDTO = new AgvCallDTO();
+//                    agvCallDTO.setLocationFrom(baseLocationInfo.getLocationNo());
+//                    businessService.agvCall(Constant.TRAN_OUT_FLOW_ID, agvCallDTO);
+//                } else if (baseLocationInfo.getUserdefine1().equals("SO_BHG")) {
+//                    AgvCallDTO agvCallDTO = new AgvCallDTO();
+//                    agvCallDTO.setLocationFrom(baseLocationInfo.getLocationNo());
+//                    businessService.agvCall(Constant.TRAN_OUT_BHG_FLOW_ID, agvCallDTO);
+//                }
+//            }
+//        }
     }
 
     @Transactional

+ 8 - 8
warewms-ams/src/main/resources/mapper/ams/FlowConfigHeaderMapper.xml

@@ -3,7 +3,7 @@
 PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.ruoyi.ams.config.mapper.FlowConfigHeaderMapper">
-    
+
     <resultMap type="FlowConfigHeader" id="FlowConfigHeaderResult">
         <result property="id"    column="id"    />
         <result property="flowName"    column="flow_name"    />
@@ -104,7 +104,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <where>
             <if test="flowName != null  and flowName != ''"> and flow_name like concat('%', #{flowName}, '%')</if>
         </where>
-        order by create_time desc
+        order by id
     </select>
 
     <select id="selectFlowConfigHeaderDict" parameterType="Long" resultMap="FlowConfigHeaderResult">
@@ -118,7 +118,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="flowName != null  and flowName != ''"> and flow_name = #{flowName}</if>
         </where>
     </select>
-    
+
     <select id="selectFlowConfigHeaderById" parameterType="Long" resultMap="FlowConfigHeaderFlowConfigDetailsResult">
         select a.id, a.flow_name,a.flow_type, a.sku_type, a.sku_type_flag, a.qty, a.qty_flag, a.weight, a.weight_flag, a.supplier, a.supplier_flag, a.location_from,a.location_from_flag, a.location_from_device, a.location_to,a.location_to_flag, a.location_to_device, a.create_by, a.create_time, a.update_by, a.update_time, a.remark,
         a.qty_range,a.weight_range,a.supplier_range,b.id as sub_id, b.header_id as sub_header_id, b.lotatt_id as sub_lotatt_id,cf.lotatt_name as sub_lotatt_name, b.lotatt_flag as sub_lotatt_flag, b.create_by as sub_create_by, b.create_time as sub_create_time, b.update_by as sub_update_by, b.update_time as sub_update_time, b.remark as sub_remark,b.default_value as sub_default_value,
@@ -128,7 +128,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         left join lotatt_config cf on b.lotatt_id = cf.lotatt_id
         where a.id = #{id}
     </select>
-        
+
     <insert id="insertFlowConfigHeader" parameterType="FlowConfigHeader" useGeneratedKeys="true" keyProperty="id">
         insert into flow_config_header
         <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -230,14 +230,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </delete>
 
     <delete id="deleteFlowConfigHeaderByIds" parameterType="String">
-        delete from flow_config_header where id in 
+        delete from flow_config_header where id in
         <foreach item="id" collection="array" open="(" separator="," close=")">
             #{id}
         </foreach>
     </delete>
-    
+
     <delete id="deleteFlowConfigDetailsByHeaderIds" parameterType="String">
-        delete from flow_config_details where header_id in 
+        delete from flow_config_details where header_id in
         <foreach item="headerId" collection="array" open="(" separator="," close=")">
             #{headerId}
         </foreach>
@@ -265,4 +265,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectFlowConfigHeaderVo"/>
         where root_flow = #{headerId}
     </select>
-</mapper>
+</mapper>

+ 76 - 35
warewms-base/src/main/java/com/ruoyi/base/constant/Constant.java

@@ -9,41 +9,6 @@ public class Constant {
     public static final String CUSTOMER_ID = "default";
     public static final Long WAREHOUSE_ID = 1L;
 
-    /**
-     * 接驳位(模具-东)库位ID
-     * 这个点在叉车取货完成之后需要发送关闭自动门的命令
-     */
-    public static final Integer LOC_MJ_EAST = 10047;
-    /**
-     * 入库缓存区到接驳位
-     */
-    public static final long IN_TRAN_FLOW_ID = 18;
-    /**
-     * 接驳位到仓储区
-     */
-    public static final long TRAN_STO_FLOW_ID = 19;
-    /**
-     * 仓储区到接驳位
-     */
-    public static final long STO_TRAN_FLOW_ID = 20;
-    /**
-     * 接驳位到出库缓存区
-     */
-    public static final long TRAN_OUT_FLOW_ID = 21;
-    /**
-     * 接驳位到不合格区
-     */
-    public static final long TRAN_OUT_BHG_FLOW_ID = 22;
-    /**
-     * 模具搬运(硫化)
-     */
-    public static final long MOLD_HANDLING_LH_FLOW_ID = 24;
-    /**
-     * 模具搬运(冲边)
-     */
-    public static final long MOLD_HANDLING_CB_FLOW_ID = 25;
-
-
     /**
      * 入库缓存位
      */
@@ -60,6 +25,82 @@ public class Constant {
      */
     public static final Long LOC_MIDDLE_CACHE = 99999l;
 
+    /**
+     * 搬运任务配置id
+     */
+    public enum FLOW_CONFIG_ID {
+        /***
+         * 补空托(空托暂存区)
+         */
+        ONE(1l),
+        /**
+         * 空托上料(硫酸镍)
+         */
+        TWO(2l),
+        /**
+         * 空托上料(氯化镍)
+         */
+        THREE(3l),
+        /**
+         * 废料搬运(硫酸镍)
+         */
+        FOUR(4l),
+        /**
+         * 废料退空(硫酸镍)
+         */
+        FIVE(5l),
+        /**
+         * 废料搬运(氯化镍)
+         */
+        SIX(6l),
+        /**
+         * 废料退空(氯化镍)
+         */
+        SEVEN(7l),
+        /**
+         * 成品下线(硫酸镍)->裹膜
+         */
+        EIGHT(8l),
+        /**
+         * 成品下线(硫酸镍)->仓储区
+         */
+        NINE(9l),
+        /**
+         * 成品下线(硫酸镍)-裹膜->仓储区
+         */
+        TEN(10l),
+        /**
+         * 成品下线(氯化镍)->裹膜
+         */
+        ELEVEN(11l),
+        /**
+         * 成品下线(氯化镍)->仓储区
+         */
+        TWELVE(12l),
+        /**
+         * 成品下线(氯化镍)-裹膜->仓储区
+         */
+        THIRTEEN(13l),
+        /**
+         * 成品出库(硫酸镍)
+         */
+        FOURTEEN(14l),
+        /**
+         * 成品出库(氯化镍)
+         */
+        FIFTEEN(15l);
+
+        private Long flowId;
+
+        FLOW_CONFIG_ID(Long flowId) {
+            this.flowId = flowId;
+        }
+
+        public Long getValue() {
+            return flowId;
+        }
+    }
+
     /**
      * 是否
      */