From 25e722ba5f47a926be8d38f90ba4b153390619dd Mon Sep 17 00:00:00 2001
From: FCD <2453864257@qq.com>
Date: Tue, 24 Mar 2026 09:29:26 +0800
Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E6=97=A7=E7=89=A9=E6=96=99?=
=?UTF-8?q?=E6=A3=80=E9=AA=8C=E6=A0=87=E5=87=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../op/system/api/domain/sap/SapBaseProduct.java | 11 +++++++++++
.../com/op/sap/service/impl/SapItemSyncImpl.java | 13 +++++++++++++
.../resources/mapper/sap/SapBaseProductMapper.xml | 5 ++++-
3 files changed, 28 insertions(+), 1 deletion(-)
diff --git a/op-api/op-api-system/src/main/java/com/op/system/api/domain/sap/SapBaseProduct.java b/op-api/op-api-system/src/main/java/com/op/system/api/domain/sap/SapBaseProduct.java
index d0a376ac5..1bfd75a12 100644
--- a/op-api/op-api-system/src/main/java/com/op/system/api/domain/sap/SapBaseProduct.java
+++ b/op-api/op-api-system/src/main/java/com/op/system/api/domain/sap/SapBaseProduct.java
@@ -176,6 +176,9 @@ public class SapBaseProduct extends BaseEntity {
@Excel(name = "基本计量单位转换分母")
private BigDecimal umren;
+ /** 检验标准 **/
+ private String inspectionStandard;
+
public BigDecimal getUmrez() {
return umrez;
@@ -468,6 +471,14 @@ public class SapBaseProduct extends BaseEntity {
return appendPercent;
}
+ public String getInspectionStandard() {
+ return inspectionStandard;
+ }
+
+ public void setInspectionStandard(String inspectionStandard) {
+ this.inspectionStandard = inspectionStandard;
+ }
+
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
diff --git a/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapItemSyncImpl.java b/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapItemSyncImpl.java
index 022eebe25..d6c89f5e7 100644
--- a/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapItemSyncImpl.java
+++ b/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapItemSyncImpl.java
@@ -161,6 +161,7 @@ public class SapItemSyncImpl implements SapItemSyncService {
String ZLONG = maraTable.getString("ZLONG");
String ZWIDE = maraTable.getString("ZWIDE");
String ZHIGH = maraTable.getString("ZHIGH");
+ String BISMT = maraTable.getString("BISMT");
log.info(i+"物料基础数据同步数据输出----" +
"工厂:" +WERKS+
"物料号:" + MATNR +
@@ -205,6 +206,7 @@ public class SapItemSyncImpl implements SapItemSyncService {
baseProduct.setNetWeight(NTGEW);
baseProduct.setVolume(VOLUM);
baseProduct.setMeins(MEINS);
+ baseProduct.setOldProductCode(BISMT);
baseProduct.setDelFlag("0");
baseProduct.setActiveFlag("1");
baseProduct.setCreateBy(SecurityUtils.getUsername());
@@ -364,6 +366,17 @@ public class SapItemSyncImpl implements SapItemSyncService {
try {
// 验证是否存在这个物料
SapBaseProduct u = sapBaseProductMapper.selectBaseProductByProductCode(sapBaseProduct);
+ //存在旧物料
+ if (!StringUtils.isBlank(sapBaseProduct.getOldProductCode())){
+ SapBaseProduct query = new SapBaseProduct();
+ query.setProductCode(sapBaseProduct.getOldProductCode());
+ SapBaseProduct oldMaterial = sapBaseProductMapper.selectBaseProductByProductCode(query);
+ if (oldMaterial != null){
+ if (StringUtils.isNotBlank(oldMaterial.getInspectionStandard())){
+ sapBaseProduct.setInspectionStandard(oldMaterial.getInspectionStandard());
+ }
+ }
+ }
if (StringUtils.isNull(u)) {
BeanValidators.validateWithException(validator, sapBaseProduct);
sapBaseProduct.setCreateBy("job");
diff --git a/op-modules/op-sap/src/main/resources/mapper/sap/SapBaseProductMapper.xml b/op-modules/op-sap/src/main/resources/mapper/sap/SapBaseProductMapper.xml
index 8db2939d2..5274591d2 100644
--- a/op-modules/op-sap/src/main/resources/mapper/sap/SapBaseProductMapper.xml
+++ b/op-modules/op-sap/src/main/resources/mapper/sap/SapBaseProductMapper.xml
@@ -53,7 +53,7 @@
- select product_id, product_code, product_desc_zh, product_model,product_desc_en, rule_code, old_product_code, parts_product_code, sku_barcode, length, width, height, gross_weight, net_weight, tare_weight, volume,meins, unit_price, product_group, product_group_name, user_defined1, user_defined2, user_defined3, user_defined4, user_defined5, user_defined6, create_by, create_time, update_by, update_time, factory_code, active_flag, sync_flag, primary_uom, del_flag, bstme, basic_order, conv_order, ausme, basic_issue, conv_issue, append_flag, append_percent from base_product
+ select product_id, product_code, product_desc_zh, product_model,product_desc_en, rule_code, old_product_code, parts_product_code, sku_barcode, length, width, height, gross_weight, net_weight, tare_weight, volume,meins, unit_price, product_group, product_group_name, user_defined1, user_defined2, user_defined3, user_defined4, user_defined5, user_defined6, create_by, create_time, update_by, update_time, factory_code, active_flag, sync_flag, primary_uom, del_flag, bstme, basic_order, conv_order, ausme, basic_issue, conv_issue, append_flag, append_percent, mvgr5 inspectionStandard from base_product