#
luxiaotao1123
2021-09-28 1d8f4f462fc4be2437dbfa7ad9b5b503019a1193
src/main/java/zy/cloud/wms/common/service/erp/ErpScheduler.java
@@ -17,6 +17,7 @@
import zy.cloud.wms.common.service.erp.entity.*;
import zy.cloud.wms.common.utils.VersionUtils;
import zy.cloud.wms.manager.entity.*;
import zy.cloud.wms.manager.mapper.MatCodeMapper;
import zy.cloud.wms.manager.mapper.TagMapper;
import zy.cloud.wms.manager.service.*;
import zy.cloud.wms.manager.utils.HttpHandler;
@@ -67,6 +68,9 @@
    private DocLogService docLogService;
    @Autowired
    private RequestLogService requestLogService;
    @Autowired
    private MatCodeMapper matCodeMapper;
    /**
     * 商品下载
@@ -170,6 +174,7 @@
                    }
                    if (null == mat) {
                        // 平仓
                        mat = new Mat(
                                String.valueOf(data.getRec()),    // 编号
                                null,    // 所属区域
@@ -195,8 +200,12 @@
                                updateTime,    // 修改时间
                                null    // 备注
                        );
                        matService.insert(mat);
                        // 立库
                    } else {
                        // 平仓
                        mat.setUuid(String.valueOf(data.getRec()));
                        mat.setMatnr(data.getUserCode());
                        mat.setMaktx(data.getFullName());
@@ -205,6 +214,8 @@
                        mat.setBarcode(data.getBarcode());
                        mat.setUnit(data.getUnit3());
                        matService.updateById(mat);
                        // 立库
                    }
                    log.info("====>> 更新物料:{}", data.getUserCode());
                }
@@ -341,7 +352,11 @@
                                updateTime,    // 修改时间
                                null    // 备注
                        );
                        matService.insert(mat);
                        if (matService.insert(mat)) {
                            MatCode matCode = mat.beMatCode();
                            matCodeMapper.insert(matCode);
                        }
                    } else {
                        mat.setUuid(String.valueOf(data.getRec()));
                        mat.setMatnr(data.getUserCode());
@@ -350,7 +365,10 @@
                        mat.setUpdateTime(updateTime);
                        mat.setBarcode(data.getBarcode());
                        mat.setUnit(data.getUnit3());
                        matService.updateById(mat);
                        if (matService.updateById(mat)) {
                            MatCode matCode = mat.beMatCode();
                            matCodeMapper.updateById(matCode);
                        }
                    }
                    log.info("====>> 更新物料:{}", data.getUserCode());
                }