自动化立体仓库 - WMS系统
#
lsh
2024-12-17 949ebb08ec84f8ec7c59f4a955ccb882a136cc2e
src/main/java/com/zy/asrs/task/handler/OrderSyncHandler.java
@@ -44,15 +44,30 @@
    private ApiLogService apiLogService;
    @Autowired
    private DocTypeService docTypeService;
    @Transactional
    public ReturnT<String> start(Order order) {
    public ReturnT<String> startOrderInAndOutUtil(Order order) {
        DocType docType = docTypeService.selectById(order.getDocType());
        if (null == docType) {
            return SUCCESS;
        }
//        List<OrderDetl> orderDetls = orderDetlService.selectByOrderId(order.getId());
        List<OrderDetl> orderDetls = OrderInAndOutUtil.selectByOrderId(order.getPakinPakoutStatus$(), order.getId());
        Order orderNew = new Order(order);
        orderService.insert(orderNew);
        for (OrderDetl orderDetl : orderDetls){
            OrderDetl orderDetlNew = new OrderDetl(orderDetl);
            orderDetlService.insert(orderDetlNew);
        }
        // 修改订单状态 4.完成 ===>> 6.已上报
        OrderInAndOutUtil.updateOrder(order.getPakinPakoutStatus$(),order.getId(),6L,null);
        return SUCCESS;
    }
    @Transactional
    public ReturnT<String> startOrder(Order order) {
        DocType docType = docTypeService.selectById(order.getDocType());
        if (null == docType) {
            return SUCCESS;
        }
        List<OrderDetl> orderDetls = orderDetlService.selectByOrderId(order.getId());
        // 入库完成上报
        if (docType.getPakin() == 1) {
            MesPakinParam pakinParam = new MesPakinParam();
@@ -76,10 +91,9 @@
                if (jsonObject.getInteger("code").equals(200)) {
                    success = true;
                    // 修改订单状态 4.完成 ===>> 6.已上报
//                    if (!orderService.updateSettle(order.getId(), 6L, null)) {
//                        throw new CoolException("服务器内部错误,请联系管理员");
//                    }
                    OrderInAndOutUtil.updateOrder(order.getPakinPakoutStatus$(),order.getId(),6L,null);
                    if (!orderService.updateSettle(order.getId(), 6L, null)) {
                        throw new CoolException("服务器内部错误,请联系管理员");
                    }
                } else {
                    log.error("请求接口失败!!!url:{};request:{};response:{}", MesConstant.URL+MesConstant.PAKIN_URL, JSON.toJSONString(pakinParam), response);
                    throw new CoolException("上报mes系统失败");
@@ -131,10 +145,9 @@
                if (jsonObject.getInteger("code").equals(200)) {
                    success = true;
                    // 修改订单状态 4.完成 ===>> 6.已上报
//                    if (!orderService.updateSettle(order.getId(), 6L, null)) {
//                        throw new CoolException("服务器内部错误,请联系管理员");
//                    }
                    OrderInAndOutUtil.updateOrder(order.getPakinPakoutStatus$(),order.getId(),6L,null);
                    if (!orderService.updateSettle(order.getId(), 6L, null)) {
                        throw new CoolException("服务器内部错误,请联系管理员");
                    }
                } else {
                    log.error("请求接口失败!!!url:{};request:{};response:{}", MesConstant.URL+MesConstant.PAKOUT_URL, JSON.toJSONString(pakoutParam), response);
                    throw new CoolException("上报mes系统失败");