| | |
| | | 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 com.zy.common.service.wms.ReplenishDto; |
| | | import com.zy.common.service.wms.Result; |
| | | import com.zy.common.service.wms.WmsService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Optional; |
| | | |
| | | /** |
| | | * Created by vincent on 2020/7/6 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class WorkLogHandler extends AbstractHandler<String> { |
| | | |
| | |
| | | if (!erpService.uploadBill(dtos, 34, docNum)) { |
| | | exceptionHandle("无法上报至erp[workNo={0}]失败", wrkMast.getWrkNo()); |
| | | } |
| | | |
| | | // 入库通知单 |
| | | if (!Cools.isEmpty(wrkMast.getBarcode())) { |
| | | // 保存入库通知档历史档 |
| | |
| | | if (Cools.isEmpty(wrkMast.getPdcType()) || !wrkMast.getPdcType().equals("Y")) { |
| | | List<ReplenishDto> replenishDtos = 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()); |
| | | replenishDtos.add(param); |
| | | } |
| | | Result result = wmsService.replenish(replenishDtos); |
| | | if (result.getCode() != 200) { |
| | | exceptionHandle("补货到平仓[workNo={0}]失败", wrkMast.getWrkNo()); |
| | | if (!Cools.isEmpty(wrkDetls)) { |
| | | for (WrkDetl wrkDetl : wrkDetls) { |
| | | ReplenishDto param = new ReplenishDto(); |
| | | param.setMatnr(wrkDetl.getMatnr()); |
| | | param.setCount(wrkDetl.getAnfme()); |
| | | replenishDtos.add(param); |
| | | } |
| | | Result result = wmsService.replenish(replenishDtos); |
| | | if (result.getCode() != 200) { |
| | | exceptionHandle("补货到平仓[workNo={0}]失败", wrkMast.getWrkNo()); |
| | | } |
| | | } |
| | | // 销售订单 |
| | | } else { |