| | |
| | | private ErpService erpService; |
| | | @Autowired |
| | | private ApiLogService apiLogService; |
| | | @Autowired |
| | | private WaitPakinService waitPakinService; |
| | | @Autowired |
| | | private ManPakOutService manPakOutService; |
| | | |
| | | @Value("${u8.url}") |
| | | private String url; |
| | |
| | | } |
| | | } |
| | | // 如果 作业数量等于单据总数量 && 工作明细档中无该单据的数据 && AGV工作明细档中无该单据的数据 |
| | | if (complete |
| | | && wrkDetlService.selectCount(new EntityWrapper<WrkDetl>().like("order_no", orderNo)) < 1 |
| | | && agvWrkDetlService.selectCount(new EntityWrapper<AgvWrkDetl>().like("order_no",orderNo)) < 1) { |
| | | boolean wrkDeltExist = wrkDetlService.selectCount(new EntityWrapper<WrkDetl>().eq("order_no", orderNo)) < 1; |
| | | boolean agvWrkDetlExist = agvWrkDetlService.selectCount(new EntityWrapper<AgvWrkDetl>().eq("order_no",orderNo)) < 1; |
| | | boolean waitPakinExist = waitPakinService.selectCount(new EntityWrapper<WaitPakin>().eq("order_no",orderNo)) < 1; |
| | | |
| | | ManPakOut manPakOut = manPakOutService.selectByOrderWithName(orderNo); |
| | | |
| | | boolean manPakoutExist = Cools.isEmpty(manPakOut) || manPakOut.getPayment() == 1; |
| | | if (complete && wrkDeltExist && agvWrkDetlExist && waitPakinExist && manPakoutExist) { |
| | | |
| | | // 出库订单重新整理明细 |
| | | // DocType docType = docTypeService.selectById(order.getDocType()); |
| | | // if (null != docType && docType.getPakout() == 1) { |
| | |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | if (!this.updateSettle(order.getId(), 4L, null)) { |
| | | throw new CoolException("修改订单【orderNo = " + order.getOrderNo() + "】状态为已完成失败"); |
| | | } |
| | |
| | | orderDetlService.delete(new EntityWrapper<OrderDetl>().eq("order_id", orderId)); |
| | | } |
| | | |
| | | public void report(Long orderId, Long userId) { |
| | | public void report(Long orderId, String username) { |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | Order order = this.selectById(orderId); |
| | | Map<String, String> param = new HashMap<>(); |
| | | Map<String, Object> param = new HashMap<>(); |
| | | param.put("id",order.getOrderNo()); |
| | | param.put("dDate",sdf.format(new Date())); |
| | | param.put("cHandler",userId.toString()); |
| | | param.put("cHandler",username); |
| | | |
| | | List<Map<String,Object>> orderDetlsParam = new ArrayList<>(); |
| | | param.put("orderDetails",orderDetlsParam); |
| | | |
| | | List<OrderDetl> orderDetls = orderDetlService.selectByOrderId(orderId); |
| | | |
| | | for (OrderDetl orderDetl : orderDetls){ |
| | | Map<String, Object> odMap = new HashMap<>(); |
| | | odMap.put("autoid",orderDetl.getItemNum()); |
| | | odMap.put("iQuantity",orderDetl.getQty()); |
| | | orderDetlsParam.add(odMap); |
| | | } |
| | | |
| | | int code = doHttpRequest(param, "单据审核", url, orderReportPath, null, "127.0.0.1"); |
| | | //int code = doHttpRequest(param, "单据审核", "localhost:8080", "/test/report", null, "127.0.0.1"); |
| | | if(code == 200){ |
| | | if(code == 0){ |
| | | order.setSettle(6L); |
| | | this.updateById(order); |
| | | } |
| | |
| | | .doPost(); |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | |
| | | int code = (int) jsonObject.get("code"); |
| | | if(code != 200){ |
| | | throw new CoolException(jsonObject.get("msg").toString()); |
| | | if(Cools.isEmpty(jsonObject.get("errCode"))){ |
| | | throw new CoolException(jsonObject.get("Message").toString()); |
| | | } |
| | | |
| | | int code = (int) jsonObject.get("errCode"); |
| | | if(code != 0){ |
| | | throw new CoolException(jsonObject.get("errMsg").toString()); |
| | | } |
| | | success = true; |
| | | return code; |