Browse Source

fix(srm): 修复供应商更新逻辑并优化字段映射

- 移除站点字段的更新逻辑
- 删除创建日期、创建人、更新日期、更新人字段的更新逻辑
- 修复税务代码字段名大小写问题
- 添加ABC分类和采购人员字段支持
- 调整货币、付款条件、交货条件等字段顺序
- 添加调试信息输出更新ID
- 统一字段命名规范为小写驼峰格式
master
qiankanghui 13 hours ago
parent
commit
bf86339c4e
  1. 1
      src/main/java/com/xujie/modules/srm/service/impl/SrmSupplierServiceImpl.java
  2. 99
      src/main/resources/mapper/srm/SrmSupplierMapper.xml

1
src/main/java/com/xujie/modules/srm/service/impl/SrmSupplierServiceImpl.java

@ -259,6 +259,7 @@ public class SrmSupplierServiceImpl extends ServiceImpl<SrmSupplierMapper, SrmSu
if (currentUser != null) { if (currentUser != null) {
supplier.setUpdateBy(currentUser.getUsername()); supplier.setUpdateBy(currentUser.getUsername());
} }
System.out.println("更新ID:" + supplier.getId());
//保存供应商信息 //保存供应商信息
srmSupplierMapper.updateSrmSupplier(supplier); srmSupplierMapper.updateSrmSupplier(supplier);

99
src/main/resources/mapper/srm/SrmSupplierMapper.xml

@ -341,9 +341,6 @@
<update id="updateSrmSupplier" parameterType="com.xujie.modules.srm.entity.SrmSupplier"> <update id="updateSrmSupplier" parameterType="com.xujie.modules.srm.entity.SrmSupplier">
UPDATE srm_supplier UPDATE srm_supplier
<set> <set>
<if test="site != null and site != ''">
site = #{site},
</if>
<if test="supplierNo != null and supplierNo != ''"> <if test="supplierNo != null and supplierNo != ''">
supplier_no = #{supplierNo}, supplier_no = #{supplierNo},
</if> </if>
@ -353,95 +350,71 @@
<if test="supplierGroup != null and supplierGroup != ''"> <if test="supplierGroup != null and supplierGroup != ''">
supplier_group = #{supplierGroup}, supplier_group = #{supplierGroup},
</if> </if>
<if test="createDate != null">
create_date = #{createDate},
</if>
<if test="createBy != null and createBy != ''">
create_by = #{createBy},
</if>
<if test="updateDate != null">
update_date = #{updateDate},
</if>
<if test="updateBy != null and updateBy != ''">
update_by = #{updateBy},
<if test="active != null and active != ''">
active = #{active},
</if> </if>
<if test="supplierDocType != null and supplierDocType != ''"> <if test="supplierDocType != null and supplierDocType != ''">
supplier_doc_type = #{supplierDocType}, supplier_doc_type = #{supplierDocType},
</if> </if>
<if test="taxCode != null and taxCode != ''"> <if test="taxCode != null and taxCode != ''">
TaxCode = #{taxCode},
</if>
<if test="tax != null and tax != ''">
tax = #{tax},
</if>
<if test="faxNo != null and faxNo != ''">
FaxNo = #{faxNo},
</if>
<if test="phoneNo != null and phoneNo != ''">
PhoneNo = #{phoneNo},
</if>
<if test="phoneNo2 != null and phoneNo2 != ''">
PhoneNo2 = #{phoneNo2},
</if>
<if test="phoneNo3 != null and phoneNo3 != ''">
PhoneNo3 = #{phoneNo3},
</if>
<if test="contact != null and contact != ''">
Contact = #{contact},
</if>
<if test="address != null and address != ''">
Address = #{address},
</if>
<if test="paymentTerm != null and paymentTerm != ''">
PaymentTerm = #{paymentTerm},
taxCode = #{taxCode},
</if> </if>
<if test="deliveryTerm != null and deliveryTerm != ''">
DeliveryTerm = #{deliveryTerm},
</if>
<if test="buyer != null and buyer != ''">
Buyer = #{buyer},
<if test="abc != null and abc != ''">
abc = #{abc},
</if> </if>
<if test="sourcingstaff != null and sourcingstaff != ''"> <if test="sourcingstaff != null and sourcingstaff != ''">
SourcingStaff = #{sourcingstaff},
sourcingStaff = #{sourcingstaff},
</if> </if>
<if test="currency != null and currency != ''"> <if test="currency != null and currency != ''">
Currency = #{currency},
currency = #{currency},
</if> </if>
<if test="abc != null and abc != ''">
ABC = #{abc},
<if test="paymentTerm != null and paymentTerm != ''">
paymentTerm = #{paymentTerm},
</if> </if>
<if test="active != null and active != ''">
Active = #{active},
<if test="deliveryTerm != null and deliveryTerm != ''">
deliveryTerm = #{deliveryTerm},
</if> </if>
<if test="bankName != null and bankName != ''">
BankName = #{bankName},
<if test="phoneNo != null and phoneNo != ''">
phoneNo = #{phoneNo},
</if> </if>
<if test="bankAccount != null and bankAccount != ''">
BankAccount = #{bankAccount},
<if test="phoneNo2 != null and phoneNo2 != ''">
phoneNo2 = #{phoneNo2},
</if> </if>
<if test="taxNo != null and taxNo != ''">
TaxNo = #{taxNo},
<if test="phoneNo3 != null and phoneNo3 != ''">
phoneNo3 = #{phoneNo3},
</if> </if>
<if test="email != null and email != ''"> <if test="email != null and email != ''">
Email = #{email},
email = #{email},
</if> </if>
<if test="email2 != null and email2 != ''"> <if test="email2 != null and email2 != ''">
Email2 = #{email2},
email2 = #{email2},
</if>
<if test="faxNo != null and faxNo != ''">
faxNo = #{faxNo},
</if> </if>
<if test="otherContact1 != null and otherContact1 != ''"> <if test="otherContact1 != null and otherContact1 != ''">
Other_contact1 = #{otherContact1},
otherContact1 = #{otherContact1},
</if> </if>
<if test="otherContact2 != null and otherContact2 != ''"> <if test="otherContact2 != null and otherContact2 != ''">
Other_contact2 = #{otherContact2},
otherContact2 = #{otherContact2},
</if> </if>
<if test="otherContact3 != null and otherContact3 != ''"> <if test="otherContact3 != null and otherContact3 != ''">
Other_contact3 = #{otherContact3},
otherContact3 = #{otherContact3},
</if>
<if test="bankName != null and bankName != ''">
bankName = #{bankName},
</if>
<if test="bankAccount != null and bankAccount != ''">
bankAccount = #{bankAccount},
</if>
<if test="address != null and address != ''">
address = #{address},
</if> </if>
<if test="memo != null and memo != ''"> <if test="memo != null and memo != ''">
Memo = #{memo}
memo = #{memo},
</if> </if>
</set> </set>
WHERE id = #{id}
WHERE id = #{id}
</update> </update>
<!-- 根据ID查询供应商 --> <!-- 根据ID查询供应商 -->

Loading…
Cancel
Save