#
luxiaotao1123
2021-04-22 7fd1dc4865b941ec8c6c1215fe5adecab80381d9
#
1个文件已修改
21 ■■■■■ 已修改文件
src/main/java/zy/cloud/wms/common/service/erp/ErpScheduler.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/zy/cloud/wms/common/service/erp/ErpScheduler.java
@@ -465,7 +465,7 @@
    }
    /**
     * 完成销售订单
     * 完成采购退货订单
     */
    @Scheduled(cron = "0/10 * * * * ? ")
    @Transactional
@@ -596,15 +596,17 @@
    /**
     * 获取取消订单
     */
    @Scheduled(cron = "0/5 * * * * ? ")
    @Scheduled(cron = "0/10 * * * * ? ")
    @Transactional
//    @PostConstruct
    public void getCancelOrdersExecute(){
        try {
            Map<String, Object> json = new HashMap<>();
            json.put("vchType", 151);
            json.put("flag", 2);
            String response = new HttpHandler.Builder()
                    .setUri(URI)
                    .setPath(OVER_BILL)
                    .setPath(GET_ORDERS)
                    .setJson(JSON.toJSONString(json))
                    .build()
                    .doPost();
@@ -617,14 +619,15 @@
                }
                List<GetOrderResult0> list = JSON.parseArray(result.getData(), GetOrderResult0.class);
                if (!Cools.isEmpty(list)) {
                    boolean complete = true;
                    Set<String> existNumbers = new HashSet<>();
                    String cancelNumber = "";
                    if (!orderService.updateSettle(cancelNumber, 5L)) {
                        throw new CoolException("修改订单状态失败");
                    for (GetOrderResult0 result0 : list) {
                        existNumbers.add(result0.getNumber());
                    }
                    for (String number : existNumbers) {
                        if (!orderService.updateSettle(number, 3L)) {
//                            throw new CoolException("修改订单状态失败");
                        }
                    }
                }
            }