#
18516761980
2021-09-29 15c8f00ab3a1e3d2d96b56bae0ec11efedd60231
src/main/java/com/zy/common/service/erp/task/ErpScheduler.java
@@ -57,6 +57,16 @@
    public void inStockExecute(){
        List<InStockDto> readyInStock = erpService.getReadyInStock();
        for (InStockDto dto : readyInStock) {
            //同一单号存在相同物料编码数据,该单号不予处理
            Number fnumberCount = erpService.QueryFnumberInCount(dto.getInStockBill().getFInterID());
            if(fnumberCount.intValue() > 1){
                if (!erpService.haveReadInStock(dto.getInStockBill().getFBillNo(),-1)) {
                    log.error("标记原材料入库通知单已读InStockBill为-1失败[FBillNo={},FInterID={}]", dto.getInStockBill().getFBillNo(),dto.getInStockBill().getFInterID());
                }
                continue;
            }
            for (InStockBillEntry entry : dto.getInStockBillEntries()) {
                MatCode matCode = matCodeService.selectById(entry.getFnumber());
                if (null != matCode) {
@@ -100,7 +110,7 @@
                    }
                }
            }
            if (!erpService.haveReadInStock(dto.getInStockBill().getFBillNo())) {
            if (!erpService.haveReadInStock(dto.getInStockBill().getFBillNo(),1)) {
                log.error("标记原材料入库通知单已读InStockBill失败[FBillNo={}]", dto.getInStockBill().getFBillNo());
            }
        }
@@ -116,6 +126,16 @@
    public void inCPICMOExecute(){
        List<CPICMO> cpicmos = erpService.getReadyCPICMO();
        for (CPICMO cpicmo : cpicmos) {
            //同一单号存在相同物料编码数据,该单号不予处理
            Number fnumberCount = erpService.QueryFnumberCPICMOCount(cpicmo.getFInterID());
            if(fnumberCount.intValue() > 1){
                if (!erpService.haveReadCPICMO(cpicmo.getFInterID(),-1)) {
                    log.error("标记成品入库通知单已读CPICMO为-1失败[Fnumber={},FInterID={}]", cpicmo.getFnumber(),cpicmo.getFInterID());
                }
                continue;
            }
            MatCode matCode = matCodeService.selectById(cpicmo.getFnumber());
            if (null != matCode) {
                // 生成入库通知单
@@ -151,7 +171,7 @@
                        log.info("同步更新成品入库通知单CPICMO失败[FBillNo={},Fnumber={}]", waitPakin.getSupplier(), waitPakin.getMatnr());
                    }
                }
                if (!erpService.haveReadCPICMO(cpicmo.getFBillNo())) {
                if (!erpService.haveReadCPICMO(cpicmo.getFInterID(),1)) {
                    log.error("标记成品入库通知单已读CPICMO失败[FBillNo={}]", cpicmo.getFBillNo());
                }
            }
@@ -198,6 +218,16 @@
        List<OutStockBill> outStockBills = erpService.syncOutStock();
        for (Integer i = 0; i < outStockBills.size(); i++) {
            OutStockBill outStockBill = outStockBills.get(i);
            //同一单号存在相同物料编码数据,该单号不予处理
            Number fnumberCount = erpService.QueryFnumberOutCount(outStockBill.getFInterID());
            if(fnumberCount.intValue() > 1){
                if (!erpService.haveReadOutBill(outStockBill.getFBillNo(),outStockBill.getFInterID(),-1)) {
                    log.error("更新出库通知单读取状态为-1失败[FBrNo={},FInterID={}]", outStockBill.getFBrNo(),outStockBill.getFInterID());
                }
                continue;
            }
            OutStockBill main = outStockMainService.selectOne(new EntityWrapper<OutStockBill>().eq("FBillNo",outStockBill.getFBillNo()).and().eq("FInterID", outStockBill.getFInterID()));
            if (null == main) {
                outStockBill.setFflag_rw(1);
@@ -242,7 +272,7 @@
            }
            if (!erpService.haveReadOutBill(outStockBill.getFBillNo(),outStockBill.getFInterID())) {
            if (!erpService.haveReadOutBill(outStockBill.getFBillNo(),outStockBill.getFInterID(),1)) {
                log.error("更新出库通知单读取状态失败[FBrNo={},FInterID={}]", outStockBill.getFBrNo(),outStockBill.getFInterID());
            }
        }