#
luxiaotao1123
2021-08-10 f0bfe3ba02dda63d4e557647baac6ac263bcb115
src/main/java/zy/cloud/wms/common/service/erp/ErpScheduler.java
@@ -35,7 +35,7 @@
@RestController
public class ErpScheduler {
    public static final String URI = "http://8.133.182.21:6220/api";
    public static final String URI = "http://123.60.34.127:6220/api";
    public static final String GET_ORDERS = "cM/basis/getOrders";
    public static final String GET_BASIS = "cM/basis/getBasis";
    public static final String UPLOAD_BILL = "cM/basis/uploadBill";
@@ -65,6 +65,8 @@
    private NodeService nodeService;
    @Autowired
    private DocLogService docLogService;
    @Autowired
    private RequestLogService requestLogService;
    /**
     * 商品下载
@@ -217,7 +219,7 @@
    /**
     * 商品下载
     */
    @Scheduled(cron = "0/5 * * * * ? ")
    @Scheduled(cron = "0 */2 * * * ? ")
    public void updateMatExecute(){
        try {
            Map<String, Object> param = new HashMap<>();
@@ -425,7 +427,7 @@
    /**
     * 持久化销售订单
     */
    @Scheduled(cron = "0/5 * * * * ? ")
    @Scheduled(cron = "0 */1 * * * ?")
    @Transactional
//    @PostConstruct
    public void getOrdersExecute(){
@@ -602,7 +604,17 @@
                            .doPost();
                    try {
                        docLogService.insertBatch(docLogs);
                        for (DocLog docLog : docLogs) {
                            docLogService.insert(docLog);
                        }
                        RequestLog logInfo = new RequestLog();
                        logInfo.setName("单据上传,单据类型" + 11);
                        logInfo.setRequest(JSON.toJSONString(getOrderResult0)); // 入参
                        logInfo.setResponse(response); // 出参
                        logInfo.setCreateTime(new Date());
                        requestLogService.insert(logInfo);
                    } catch (Exception e) {
                        log.error(e.getMessage());
                    }
@@ -610,20 +622,13 @@
                    if (!Cools.isEmpty(response)) {
                        log.warn(response);
                        Result result = JSON.parseObject(response, Result.class);
                        if (result.getCode() != 1) {
                        if (result.getCode() != 1 && !result.getMsg().equals("单据已经审核完成或删除,不能审核。")) {
                            continue;
                        }
                        if (!orderService.updateSettle(order.getOrderNo(), 6L)) {
                            throw new CoolException("修改订单状态失败");
                        }
//                        // 转历史档
//                        int save = custOrderMapper.saveLog(getOrderResult0.getNumber());
//                        if (save > 0) {
//                            if (custOrderMapper.delete(new EntityWrapper<CustOrder>().eq("number", getOrderResult0.getNumber())) == 0) {
//                                throw new CoolException("删除销售订单失败");
//                            }
//                            log.info("{}销售订单拣货结束", getOrderResult0.getNumber());
//                        }
                    }
                }
@@ -702,7 +707,16 @@
                            .doPost();
                    try {
                        docLogService.insertBatch(docLogs);
                        for (DocLog docLog : docLogs) {
                            docLogService.insert(docLog);
                        }
                        RequestLog logInfo = new RequestLog();
                        logInfo.setName("单据上传,单据类型" + 6);
                        logInfo.setRequest(JSON.toJSONString(getOrderResult0)); // 入参
                        logInfo.setResponse(response); // 出参
                        logInfo.setCreateTime(new Date());
                        requestLogService.insert(logInfo);
                    } catch (Exception e) {
                        log.error(e.getMessage());
                    }