自动化立体仓库 - WMS系统
pang.jiabao
2025-04-28 a85a8d0c33d4a821a98a0ff6789298a23a180006
src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java
@@ -34,6 +34,7 @@
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
/**
 * Created by vincent on 2022/4/9
@@ -51,6 +52,8 @@
    @Autowired
    private OrderService orderService;
    @Autowired
    private OrderLogService orderLogService;
    @Autowired
    private OrderDetlService orderDetlService;
    @Autowired
@@ -211,6 +214,11 @@
            }
            orderService.remove(order.getId());
        }
        OrderLog orderLog = orderLogService.selectByNo(param.getCCode());
        if (!Cools.isEmpty(orderLog)) {
            throw new CoolException(param.getCCode() + "单据已经完成,不需要再传递");
        }
        DocType docType = docTypeService.selectOrAdd(param.getType(), Boolean.FALSE);
        Date now = new Date();
@@ -573,7 +581,7 @@
        JSONArray jsonArray = JSONArray.parseArray(json.getJSONArray("pla").toJSONString());
        List<OpenOrderPakoutParam> list = new ArrayList<>();
        String time = new Date().getTime() + "";
        for (Object o : jsonArray) {
            JSONObject jsonObject = (JSONObject) o;
            String brand = jsonObject.get("brand").toString();
@@ -582,15 +590,12 @@
            Pla pla = plaService.selectByBatchAndPackageNo(batch, packageNo, brand);
            Mat mat = matService.selectByMaktx(pla.getBrand());
            if (Cools.isEmpty(pla.getProOrderNo())) {
                pla.setProOrderNo(time);
            }
            //当生产单号不一致时,需要新建一个param
            if (list.isEmpty() || checkOrder(list, pla.getProOrderNo()) == null) {
            if (list.isEmpty() || (!Cools.isEmpty(pla.getProOrderNo()) && checkOrder(list, pla.getProOrderNo()) == null)) {
                OpenOrderPakoutParam param = new OpenOrderPakoutParam();
                param.setcMaker(json.get("user").toString());
                String type = Cools.isEmpty(pla.getProOrderNo()) ? "调拨入库单" : "产成品入库";
                param.setcCode(Cools.isEmpty(pla.getProOrderNo()) ? time : pla.getProOrderNo());
                param.setcCode(Cools.isEmpty(pla.getProOrderNo()) ? (new Date().getTime()) + "" : pla.getProOrderNo());
                param.setcAccount(pla.getWorkshop());
                param.setdDate(Utils.getDateStr(new Date()));
                param.setType(type);
@@ -599,7 +604,8 @@
                OpenOrderPakoutParam.Body body = new OpenOrderPakoutParam.Body();
                body.setcInvCode(mat.getMatnr());
                body.setiQuantity(pla.getWeightAnfme());
                body.setcBatch("");
                body.setcBatch(pla.getBatch());
                body.setCPackage(pla.getPackageNo()+"");
                body.setCbMemo(pla.getMemo());
                bodyList.add(body);
@@ -615,10 +621,14 @@
                    body = new OpenOrderPakoutParam.Body();
                    body.setcInvCode(mat.getMatnr());
                    body.setiQuantity(pla.getWeightAnfme());
                    body.setcBatch(pla.getBatch());
                    body.setCPackage(pla.getPackageNo()+"");
                    body.setCbMemo(pla.getMemo());
                    bodyList.add(body);
                } else {
                    body.setiQuantity(body.getIQuantity() + pla.getWeightAnfme());
                    body.setcBatch(pla.getBatch());
                    body.setCPackage(pla.getPackageNo()+"");
                }
            }
        }
@@ -630,6 +640,7 @@
        return 200;
        //return doHttpRequest(list, "入库单上报", url, orderReportPath, null, "127.0.0.1");
    }
    @Override
@@ -694,6 +705,7 @@
            log.info("请求参数:{}", requestParam);
            response = new HttpHandler.Builder()
                    .setUri(url)
                    .setTimeout(30, TimeUnit.SECONDS)
                    .setPath(path)
                    .setJson(JSONObject.toJSONString(requestParam))
                    .build()