From 9c248839d8750db523fe6192101bfa085fe1305f Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期二, 26 三月 2024 16:20:23 +0800
Subject: [PATCH] Merge branch 'Four-Way-Rack' of http://47.97.1.152:5880/r/zy-asrs-master into Four-Way-Rack

---
 zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/entity/Motion.java |   46 +++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 39 insertions(+), 7 deletions(-)

diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/entity/Motion.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/entity/Motion.java
index 1b895ad..d508c7b 100644
--- a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/entity/Motion.java
+++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/entity/Motion.java
@@ -3,6 +3,10 @@
 import java.text.SimpleDateFormat;
 import java.util.Date;
 
+import com.zy.asrs.wcs.core.BuildSupport;
+import com.zy.asrs.wcs.core.entity.DeviceCtg;
+import com.zy.asrs.wcs.core.model.enums.MotionStsType;
+import com.zy.asrs.wcs.core.service.DeviceCtgService;
 import com.zy.asrs.wcs.rcs.service.DeviceTypeService;
 import com.zy.asrs.wcs.rcs.service.MotionCtgService;
 import com.zy.asrs.wcs.rcs.service.MotionStsService;
@@ -101,7 +105,7 @@
      * 璁惧绫诲瀷
      */
     @ApiModelProperty(value= "璁惧绫诲瀷")
-    private Long deviceType;
+    private Long deviceCtg;
 
     /**
      * 璁惧
@@ -238,7 +242,7 @@
 
     public Motion() {}
 
-    public Motion(String uuid,Integer wrkNo,String serialNo,String title,Integer priority,Integer sync,Long motionCtg,Long motionSts,Long deviceType,String device,String origin,Integer oriDrt,String target,Integer tarDrt,String dockNo,Date ioTime,Date startTime,Date endTime,Date errTime,Long errCode,String errDesc,String temp,Integer status,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo,Integer deleted,Long hostId) {
+    public Motion(String uuid,Integer wrkNo,String serialNo,String title,Integer priority,Integer sync,Long motionCtg,Long motionSts,Long deviceCtg,String device,String origin,Integer oriDrt,String target,Integer tarDrt,String dockNo,Date ioTime,Date startTime,Date endTime,Date errTime,Long errCode,String errDesc,String temp,Integer status,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo,Integer deleted,Long hostId) {
         this.uuid = uuid;
         this.wrkNo = wrkNo;
         this.serialNo = serialNo;
@@ -247,7 +251,7 @@
         this.sync = sync;
         this.motionCtg = motionCtg;
         this.motionSts = motionSts;
-        this.deviceType = deviceType;
+        this.deviceCtg = deviceCtg;
         this.device = device;
         this.origin = origin;
         this.oriDrt = oriDrt;
@@ -269,6 +273,25 @@
         this.memo = memo;
         this.deleted = deleted;
         this.hostId = hostId;
+    }
+
+    public static Motion build(BuildSupport<Motion> support) {
+        Motion motion = new Motion();
+        Date date = new Date();
+
+        support.execute(motion);
+
+        if (null == motion.getSync()) {
+            motion.setSync(1);
+        }
+        if (null == motion.getMotionSts()) {
+            motion.setMotionSts(MotionStsType.INIT.val());
+        }
+
+        motion.setStatus(1);
+        motion.setCreateTime(date);
+        motion.setUpdateTime(date);
+        return motion;
     }
 
 //    Motion motion = new Motion(
@@ -335,10 +358,10 @@
     }
 
     public String getDeviceType$(){
-        DeviceTypeService service = SpringUtils.getBean(DeviceTypeService.class);
-        DeviceType deviceType = service.getById(this.deviceType);
-        if (!Cools.isEmpty(deviceType)){
-            return String.valueOf(deviceType.getName());
+        DeviceCtgService service = SpringUtils.getBean(DeviceCtgService.class);
+        DeviceCtg deviceCtg = service.getById(this.deviceCtg);
+        if (!Cools.isEmpty(deviceCtg)){
+            return String.valueOf(deviceCtg.getName());
         }
         return null;
     }
@@ -436,5 +459,14 @@
         return null;
     }
 
+    public String getMotionCtgEl(){
+        MotionCtgService service = SpringUtils.getBean(MotionCtgService.class);
+        MotionCtg entity = service.getById(this.motionCtg);
+        if (!Cools.isEmpty(entity)){
+            return String.valueOf(entity.getFlag());
+        }
+        return null;
+    }
+
 
 }

--
Gitblit v1.9.1