| | |
| | | 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; |
| | |
| | | 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, // 任务号 |
| | |
| | | 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; |
| | | } |
| | | |
| | | |
| | | } |