#
Junjie
2024-03-27 4a7f884100b5583b1fe1fbe3d9e5f2c5ace7b624
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/entity/Motion.java
@@ -3,7 +3,9 @@
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;
@@ -273,6 +275,25 @@
        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(
//            null,    // 编号
//            null,    // 任务号
@@ -447,5 +468,18 @@
        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;
    }
}