| | |
| | | package com.zy.asrs.task.handler; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.Cools; |
| | | import com.core.common.SnowflakeIdWorker; |
| | | import com.zy.asrs.entity.RequestLog; |
| | | import com.zy.asrs.entity.WaitPakin; |
| | | import com.zy.asrs.entity.WrkDetl; |
| | | import com.zy.asrs.entity.WrkMast; |
| | |
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Optional; |
| | | |
| | |
| | | @Transactional |
| | | public ReturnT<String> start(WrkMast wrkMast) { |
| | | try { |
| | | |
| | | // 入库 |
| | | if (wrkMast.getWrkSts() == 5) { |
| | | |
| | | // 全板入库 |
| | | if (wrkMast.getIoType() == 1) { |
| | | String docNum = "PU-" + String.valueOf(snowflakeIdWorker.nextId()).substring(0, 15); |
| | | // 上报给erp |
| | | // 单据状态变更 作业中 ===>> 已完成 |
| | | List<MatnrDto> matnrDtos = new ArrayList<>(); |
| | | List<WrkDetl> wrkDetls = wrkDetlService.selectList(new EntityWrapper<WrkDetl>().eq("wrk_no", wrkMast.getWrkNo())); |
| | | for (WrkDetl wrkDetl : wrkDetls) { |
| | |
| | | ReplenishDto param = new ReplenishDto(); |
| | | param.setMatnr(wrkDetl.getMatnr()); |
| | | param.setCount(wrkDetl.getAnfme()); |
| | | param.setWorkNo(wrkMast.getWrkNo()); |
| | | replenishDtos.add(param); |
| | | } |
| | | Result result = wmsService.replenish(replenishDtos); |
| | |
| | | ReplenishDto param = new ReplenishDto(); |
| | | param.setMatnr(wrkDetl.getMatnr()); |
| | | param.setCount(wrkDetl.getAnfme()); |
| | | param.setWorkNo(wrkMast.getWrkNo()); |
| | | replenishDtos.add(param); |
| | | } |
| | | Result result = wmsService.replenish(replenishDtos); |
| | |
| | | ReplenishDto param = new ReplenishDto(); |
| | | param.setMatnr(wrkDetl.getMatnr()); |
| | | param.setCount(more); |
| | | param.setWorkNo(wrkMast.getWrkNo()); |
| | | List<ReplenishDto> replenishDtos = new ArrayList<>(); |
| | | replenishDtos.add(param); |
| | | Result result = wmsService.replenish(replenishDtos); |
| | |
| | | // exceptionHandle("删除工作明细档[workNo={0}]失败", wrkMast.getWrkNo()); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("", e); |
| | | e.printStackTrace(); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return FAIL.setMsg(e.getMessage()); |