| | |
| | | import com.zy.asrs.entity.param.*; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.utils.CodeDetectionUtil; |
| | | import com.zy.asrs.utils.OrderUtils; |
| | | import com.zy.common.model.DetlDto; |
| | | import com.zy.common.service.AgvCommonService; |
| | | import lombok.Synchronized; |
| | |
| | | public String handBack(AgvMobileStartPakin param, Long userId) { |
| | | Date now = new Date(); |
| | | AgvWrkMast agvWrkMast = agvWrkMastService.selectOne(new EntityWrapper<AgvWrkMast>().eq("source_loc_no", param.getDevNo())); |
| | | if (agvWrkMast == null){ |
| | | if (agvWrkMast == null) { |
| | | throw new CoolException("工作档中没有此站点任务"); |
| | | } |
| | | agvWrkMast.setIoType(113); |
| | |
| | | agvWrkMastLogService.save(agvWrkMast); |
| | | agvWrkDetlLogService.save(agvWrkMast.getWrkNo()); |
| | | String sourceLocNo = agvWrkMast.getSourceLocNo(); |
| | | AgvLocMast newLocMast = agvCommonService.getLocNo(3, 1, false, false); |
| | | if (newLocMast==null){ |
| | | //AgvLocMast newLocMast = agvCommonService.getLocNo(3, 1, false, false); |
| | | // TODO: 四期 |
| | | List<AgvWrkDetl> agvWrkDetls = agvWrkDetlService.selectList(new EntityWrapper<AgvWrkDetl>().eq("supp_code", param.getBarcode())); |
| | | String factory = null; |
| | | if (!Cools.isEmpty(agvWrkDetls)) { |
| | | factory = OrderUtils.getFactory(agvWrkDetls.get(0).getThreeCode()); |
| | | } |
| | | AgvLocMast newLocMast = agvCommonService.getLocByLocRule(3, 1, factory); |
| | | if (newLocMast == null) { |
| | | throw new CoolException("无可用库位"); |
| | | } |
| | | agvWrkMast.setSourceLocNo(agvWrkMast.getLocNo()); |
| | |
| | | agvLocMastService.updateLocStsByLocNo(sourceLocNo, "O", "", (short) 30); |
| | | agvLocDetlService.delete(new EntityWrapper<AgvLocDetl>().eq("loc_no", sourceLocNo)); |
| | | |
| | | List<AgvWrkDetl> agvWrkDetls = agvWrkDetlService.selectList(new EntityWrapper<AgvWrkDetl>().eq("supp_code", param.getBarcode())); |
| | | agvWrkDetls.forEach(agvWrkDetl -> { |
| | | for (AgvWrkDetl wrkDetl : param.getWrkDetls()) { |
| | | if (wrkDetl.getMatnr().equals(agvWrkDetl.getMatnr()) && wrkDetl.getThreeCode().equals(agvWrkDetl.getThreeCode())) { |