From 7bc7f8455d60a4a59e5e23aceddf434b03b740ee Mon Sep 17 00:00:00 2001
From: Junjie <xjj@123>
Date: 星期三, 27 三月 2024 08:19:58 +0800
Subject: [PATCH] #

---
 zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/entity/Motion.java |   59 ++++++++++++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 52 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..b51d92c 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,27 @@
         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;
+    }
+
+    public String generateFlag() {
+        return this.getUuid() + "銆�" + this.getPriority() + " - " + this.getMotionCtg$() + "銆�";
+    }
+
+    public String getDeviceCtgEl(){
+        DeviceCtgService service = SpringUtils.getBean(DeviceCtgService.class);
+        DeviceCtg entity = service.getById(this.deviceCtg);
+        if (!Cools.isEmpty(entity)){
+            return String.valueOf(entity.getFlag());
+        }
+        return null;
+    }
+
 
 }

--
Gitblit v1.9.1