| | |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.SpringUtils; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.domain.enums.TaskStatusType; |
| | | import com.zy.asrs.entity.BasDevp; |
| | | import com.zy.asrs.entity.CommandInfo; |
| | | import com.zy.asrs.entity.CommandInfoLog; |
| | |
| | | CommandInfoLogService commandInfoLogService = SpringUtils.getBean(CommandInfoLogService.class); |
| | | CommandInfoService commandInfoService = SpringUtils.getBean(CommandInfoService.class); |
| | | CommandInfo commandInfo = commandInfoService.selectById(staProtocol.getCommandId()); |
| | | CommandInfoLog commandInfoLog = JSON.parseObject(JSON.toJSONString(commandInfo), CommandInfoLog.class); |
| | | commandInfoLog.setId(null); |
| | | CommandInfoLog commandInfoLog = new CommandInfoLog(); |
| | | if (commandInfo != null) { |
| | | commandInfoLog = JSON.parseObject(JSON.toJSONString(commandInfo), CommandInfoLog.class); |
| | | commandInfoLog.setId(null); |
| | | }else { |
| | | Date now = new Date(); |
| | | commandInfoLog.setCommand(JSON.toJSONString(staProtocol)); |
| | | commandInfoLog.setCommandStatus(3); |
| | | commandInfoLog.setStartTime(now); |
| | | commandInfoLog.setExecuteTime(now); |
| | | commandInfoLog.setCompleteTime(now); |
| | | commandInfoLog.setDevice(SlaveType.Devp.toString()); |
| | | commandInfoLog.setWrkNo(9999); |
| | | commandInfoLog.setTaskNo("9999"); |
| | | commandInfoLog.setCommandDesc("手动命令"); |
| | | } |
| | | |
| | | OperateResult writeResult; |
| | | //任务下发次数 |