| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import zy.cloud.wms.common.model.BillDto; |
| | | import zy.cloud.wms.common.model.OrderStoDto; |
| | | import zy.cloud.wms.common.service.MainService; |
| | | import zy.cloud.wms.common.service.asrs.AsrsService; |
| | |
| | | } |
| | | |
| | | // 上报给erp |
| | | if (!erpService.uploadBill(combs, param.getDocType(), docNum)) { |
| | | List<BillDto> dtos = new ArrayList<>(); |
| | | for (Comb comb : combs) { |
| | | BillDto billDto = new BillDto(); |
| | | billDto.setMatnr(comb.getMatnr()); |
| | | billDto.setQty(comb.getAnfme()); |
| | | dtos.add(billDto); |
| | | } |
| | | if (!erpService.uploadBill(dtos, param.getDocType(), docNum)) { |
| | | throw new CoolException("无法上报至erp"); |
| | | } |
| | | |
| | |
| | | if (!custOrderService.updateStatus(param.getNumber(), 4)) { |
| | | throw new CoolException("修改单据状态失败"); |
| | | } |
| | | // 采购退货单 |
| | | if (param.getNumber().startsWith("PR-")) { |
| | | List<BillDto> dtos = new ArrayList<>(); |
| | | for (Pakout pakout : pakouts) { |
| | | BillDto billDto = new BillDto(); |
| | | billDto.setMatnr(pakout.getMatnr()); |
| | | billDto.setQty(pakout.getAnfme()); |
| | | dtos.add(billDto); |
| | | } |
| | | // erp单据上传 -- 采购退货单 |
| | | if (!erpService.uploadBill(dtos, 6, pakouts.get(0).getDocNum())) { |
| | | throw new CoolException("无法上报至erp"); |
| | | } |
| | | |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |