| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.Date; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | |
| | |
| | | if (Objects.isNull(mast)) { |
| | | throw new CoolException("数据错误:任务不存在!!"); |
| | | } |
| | | WrkMastLog mastLog = new WrkMastLog(); |
| | | BeanUtils.copyProperties(mast, mastLog); |
| | | mastLog.setLogId(mast.getId()); |
| | | Date now = new Date(); |
| | | WrkMastLog wrkMastLog = new WrkMastLog(); |
| | | wrkMastLog.setWrkNo(mast.getWrkNo()); |
| | | wrkMastLog.setIoTime(now); |
| | | wrkMastLog.setWrkSts(Math.toIntExact(mast.getWrkSts())); |
| | | wrkMastLog.setIoType(mast.getIoType()); |
| | | wrkMastLog.setIoPri(mast.getIoPri()); // 优先级 |
| | | wrkMastLog.setCrnNo(mast.getCrnNo()); |
| | | wrkMastLog.setSourceLocNo(mast.getSourceLocNo()); |
| | | wrkMastLog.setLocNo(mast.getLocNo()); |
| | | wrkMastLog.setBarcode(mast.getBarcode()); // 托盘码 |
| | | wrkMastLog.setFullPlt(mast.getFullPlt()); // 满板:Y |
| | | wrkMastLog.setPicking(mast.getPicking()); // 拣料 |
| | | wrkMastLog.setExitMk(mast.getExitMk()); // 退出 |
| | | wrkMastLog.setEmptyMk(mast.getEmptyMk()); // 空板 |
| | | wrkMastLog.setLinkMis(mast.getLinkMis()); |
| | | wrkMastLog.setWrkDate(mast.getWrkDate()); |
| | | wrkMastLog.setPic(mast.getPic()); |
| | | // 操作人员数据 |
| | | wrkMastLog.setAppeTime(now); |
| | | wrkMastLog.setModiTime(now); |
| | | wrkMastLog.setAppeUser(mast.getAppeUser()); |
| | | wrkMastLog.setModiUser(mast.getModiUser()); |
| | | wrkMastLog.setLogId(mast.getId()); |
| | | boolean res = wrkMastLogService.insert(wrkMastLog); |
| | | |
| | | if (!wrkMastLogService.insert(mastLog)) { |
| | | if (!res) { |
| | | throw new CoolException("任务日志保存失败!!"); |
| | | } |
| | | |