同步旧物料检验标准

master^2
FCD 1 month ago
parent 1b679cfb9a
commit 25e722ba5f

@ -176,6 +176,9 @@ public class SapBaseProduct extends BaseEntity {
@Excel(name = "基本计量单位转换分母") @Excel(name = "基本计量单位转换分母")
private BigDecimal umren; private BigDecimal umren;
/** 检验标准 **/
private String inspectionStandard;
public BigDecimal getUmrez() { public BigDecimal getUmrez() {
return umrez; return umrez;
@ -468,6 +471,14 @@ public class SapBaseProduct extends BaseEntity {
return appendPercent; return appendPercent;
} }
public String getInspectionStandard() {
return inspectionStandard;
}
public void setInspectionStandard(String inspectionStandard) {
this.inspectionStandard = inspectionStandard;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -161,6 +161,7 @@ public class SapItemSyncImpl implements SapItemSyncService {
String ZLONG = maraTable.getString("ZLONG"); String ZLONG = maraTable.getString("ZLONG");
String ZWIDE = maraTable.getString("ZWIDE"); String ZWIDE = maraTable.getString("ZWIDE");
String ZHIGH = maraTable.getString("ZHIGH"); String ZHIGH = maraTable.getString("ZHIGH");
String BISMT = maraTable.getString("BISMT");
log.info(i+"物料基础数据同步数据输出----" + log.info(i+"物料基础数据同步数据输出----" +
"工厂:" +WERKS+ "工厂:" +WERKS+
"物料号:" + MATNR + "物料号:" + MATNR +
@ -205,6 +206,7 @@ public class SapItemSyncImpl implements SapItemSyncService {
baseProduct.setNetWeight(NTGEW); baseProduct.setNetWeight(NTGEW);
baseProduct.setVolume(VOLUM); baseProduct.setVolume(VOLUM);
baseProduct.setMeins(MEINS); baseProduct.setMeins(MEINS);
baseProduct.setOldProductCode(BISMT);
baseProduct.setDelFlag("0"); baseProduct.setDelFlag("0");
baseProduct.setActiveFlag("1"); baseProduct.setActiveFlag("1");
baseProduct.setCreateBy(SecurityUtils.getUsername()); baseProduct.setCreateBy(SecurityUtils.getUsername());
@ -364,6 +366,17 @@ public class SapItemSyncImpl implements SapItemSyncService {
try { try {
// 验证是否存在这个物料 // 验证是否存在这个物料
SapBaseProduct u = sapBaseProductMapper.selectBaseProductByProductCode(sapBaseProduct); 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)) { if (StringUtils.isNull(u)) {
BeanValidators.validateWithException(validator, sapBaseProduct); BeanValidators.validateWithException(validator, sapBaseProduct);
sapBaseProduct.setCreateBy("job"); sapBaseProduct.setCreateBy("job");

@ -53,7 +53,7 @@
</resultMap> </resultMap>
<sql id="selectBaseProductVo"> <sql id="selectBaseProductVo">
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
</sql> </sql>
<select id="selectSBaseProductList" parameterType="com.op.system.api.domain.sap.SapBaseProduct" <select id="selectSBaseProductList" parameterType="com.op.system.api.domain.sap.SapBaseProduct"
@ -161,6 +161,7 @@
<if test="convIssue != null">conv_issue,</if> <if test="convIssue != null">conv_issue,</if>
<if test="appendFlag != null">append_flag,</if> <if test="appendFlag != null">append_flag,</if>
<if test="appendPercent != null">append_percent,</if> <if test="appendPercent != null">append_percent,</if>
<if test="inspectionStandard != null">mvgr5,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="productId != null">#{productId},</if> <if test="productId != null">#{productId},</if>
@ -208,6 +209,7 @@
<if test="convIssue != null">#{convIssue},</if> <if test="convIssue != null">#{convIssue},</if>
<if test="appendFlag != null">#{appendFlag},</if> <if test="appendFlag != null">#{appendFlag},</if>
<if test="appendPercent != null">#{appendPercent},</if> <if test="appendPercent != null">#{appendPercent},</if>
<if test="inspectionStandard != null">#{inspectionStandard},</if>
</trim> </trim>
</insert> </insert>
@ -258,6 +260,7 @@
<if test="convIssue != null">conv_issue = #{convIssue},</if> <if test="convIssue != null">conv_issue = #{convIssue},</if>
<if test="appendFlag != null">append_flag = #{appendFlag},</if> <if test="appendFlag != null">append_flag = #{appendFlag},</if>
<if test="appendPercent != null">append_percent = #{appendPercent},</if> <if test="appendPercent != null">append_percent = #{appendPercent},</if>
<if test="inspectionStandard != null">mvgr5 = #{inspectionStandard},</if>
</trim> </trim>
where product_id = #{productId} where product_id = #{productId}
</update> </update>

Loading…
Cancel
Save