cl
1 天以前 bb36bbb0968f6f599e18a651f5e385b98c4e1532
rsf-server/src/main/java/com/vincent/rsf/server/manager/service/CusBarcodeSyncMatnrApplyService.java
@@ -2,6 +2,7 @@
import com.vincent.rsf.server.api.controller.erp.params.SyncOrdersItem;
import com.vincent.rsf.server.manager.entity.Matnr;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -19,6 +20,7 @@
/**
 * 主库 man_matnr 按视图结果写入;独立事务,与副库视图查询分离
 */
@Slf4j
@Service
public class CusBarcodeSyncMatnrApplyService {
@@ -55,6 +57,7 @@
                        .setCreateTime(new Date())
                        .setUpdateTime(new Date());
                matnrService.save(matnr);
                log.info("[cus_barcode_sync] man_matnr 新增 code={}", matCode);
                continue;
            }
            boolean nameDiff = incomingName != null
@@ -64,6 +67,7 @@
                    && (!StringUtils.equals(StringUtils.trimToEmpty(local.getUnit()), viewUnit)
                    || !StringUtils.equals(StringUtils.trimToEmpty(local.getStockUnit()), viewUnit));
            if (!nameDiff && !specDiff && !unitDiff) {
                log.debug("[cus_barcode_sync] man_matnr 已存在且无变更 code={} id={}", matCode, local.getId());
                continue;
            }
            Matnr update = new Matnr();
@@ -79,6 +83,8 @@
            }
            update.setUpdateBy(loginUserId).setUpdateTime(new Date());
            matnrService.updateById(update);
            log.info("[cus_barcode_sync] man_matnr 更新 code={} id={} nameDiff={} specDiff={} unitDiff={}",
                    matCode, local.getId(), nameDiff, specDiff, unitDiff);
        }
    }