自动化立体仓库 - WMS系统
#
luxiaotao1123
2022-12-08 c2fa05e374856644788e7604daab44de16a5ae65
src/main/java/com/zy/common/service/erp/task/ErpScheduler.java
@@ -37,6 +37,14 @@
    @Autowired
    private MatService matService;
    @Scheduled(cron = "0/5 * * * * ? ")
    @Synchronized
    @Transactional
    public synchronized void syncMat1() {
        erpService.updateStateForGoods("PL0122231401176", 1);
    }
    @Scheduled(cron = "0/5 * * * * ? ")
    @Synchronized
    @Transactional
@@ -65,7 +73,12 @@
                    }
                    if (!matService.insert(mat)) {
                        throw new CoolException(JSON.toJSONString(good) + "商品同步失败");
                        throw new CoolException(good.getBarCode() + "商品同步失败");
                    } else {
                        int state = 1;
                        if (!erpService.updateStateForGoods(good.getBarCode(), state)) {
                            throw new CoolException(good.getBarCode() + "商品修改State为"+state+"失败");
                        }
                    }
                }
            }