| | |
| | | |
| | | 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; |
| | |
| | | /** |
| | | * 主库 man_matnr 按视图结果写入;独立事务,与副库视图查询分离 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class CusBarcodeSyncMatnrApplyService { |
| | | |
| | |
| | | .setCreateTime(new Date()) |
| | | .setUpdateTime(new Date()); |
| | | matnrService.save(matnr); |
| | | log.info("[cus_barcode_sync] man_matnr 新增 code={}", matCode); |
| | | continue; |
| | | } |
| | | boolean nameDiff = incomingName != null |
| | |
| | | && (!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(); |
| | |
| | | } |
| | | 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); |
| | | } |
| | | } |
| | | |