From 3789ebc737e8d9d76700862ba5a2f58ecf2052fc Mon Sep 17 00:00:00 2001 From: qiankanghui Date: Tue, 29 Sep 2026 15:01:27 +0800 Subject: [PATCH] =?UTF-8?q?feat(srm):=20=E6=B7=BB=E5=8A=A0=E4=BE=9B?= =?UTF-8?q?=E5=BA=94=E5=95=86=E9=BB=98=E8=AE=A4=E5=A7=8B=E5=8F=91=E6=B8=AF?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 SrmSupplier 实体类中新增 defaultOriginPort 字段 - 更新数据库映射文件中的查询和更新语句以包含新字段 - 修改 updateProductionLeadTime 方法支持同时更新生产 Lead Time 和默认始发港 - 在服务层实现中添加对默认始发港字段的处理逻辑 - 确保空字符串自动转换为 null 以便正确清空数据库字段 --- .../com/xujie/modules/srm/entity/SrmSupplier.java | 5 +++++ .../xujie/modules/srm/mapper/SrmSupplierMapper.java | 3 ++- .../srm/service/impl/SrmSupplierServiceImpl.java | 9 +++++++++ src/main/resources/mapper/srm/SrmSupplierMapper.xml | 13 ++++++++----- 4 files changed, 24 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/xujie/modules/srm/entity/SrmSupplier.java b/src/main/java/com/xujie/modules/srm/entity/SrmSupplier.java index a7216c6..0331c4b 100644 --- a/src/main/java/com/xujie/modules/srm/entity/SrmSupplier.java +++ b/src/main/java/com/xujie/modules/srm/entity/SrmSupplier.java @@ -157,4 +157,9 @@ public class SrmSupplier extends QueryPage { * 生产 Lead Time(srm_supplier.production_lead_time),由 Lead Time 维护页单独编辑。 */ private Integer productionLeadTime; + + /** + * 默认始发港(srm_supplier.default_origin_port),非必填。 + */ + private String defaultOriginPort; } diff --git a/src/main/java/com/xujie/modules/srm/mapper/SrmSupplierMapper.java b/src/main/java/com/xujie/modules/srm/mapper/SrmSupplierMapper.java index 7dfa59d..6212cbb 100644 --- a/src/main/java/com/xujie/modules/srm/mapper/SrmSupplierMapper.java +++ b/src/main/java/com/xujie/modules/srm/mapper/SrmSupplierMapper.java @@ -50,11 +50,12 @@ public interface SrmSupplierMapper extends BaseMapper { void updateSrmSupplier(SrmSupplier supplier); /** - * Lead Time 维护页专用:按 site + supplierNo 单独更新 production_lead_time(允许 null 清空)。 + * Lead Time 维护页专用:按 site + supplierNo 单独更新 production_lead_time 与 default_origin_port(均允许 null 清空)。 */ int updateProductionLeadTime(@Param("site") String site, @Param("supplierNo") String supplierNo, @Param("productionLeadTime") Integer productionLeadTime, + @Param("defaultOriginPort") String defaultOriginPort, @Param("updateBy") String updateBy); SrmSupplier selectSrmSupplierById(@Param("id") Integer id); diff --git a/src/main/java/com/xujie/modules/srm/service/impl/SrmSupplierServiceImpl.java b/src/main/java/com/xujie/modules/srm/service/impl/SrmSupplierServiceImpl.java index 0d5ef8e..ec020b1 100644 --- a/src/main/java/com/xujie/modules/srm/service/impl/SrmSupplierServiceImpl.java +++ b/src/main/java/com/xujie/modules/srm/service/impl/SrmSupplierServiceImpl.java @@ -360,12 +360,21 @@ public class SrmSupplierServiceImpl extends ServiceImpl @@ -59,7 +59,8 @@ s.min_ship_account AS minShipAccount, s.handling_charge as handlingCharge, - s.production_lead_time AS productionLeadTime + s.production_lead_time AS productionLeadTime, + s.default_origin_port AS defaultOriginPort FROM srm_supplier s LEFT JOIN sys_dict_data sg ON sg.dict_value = s.supplier_group AND sg.dict_type='supplier_group' @@ -395,7 +396,7 @@ Other_contact1, Other_contact2, Other_contact3, - Memo,c_short_office,c_short_npc,planner,min_ship_account,handling_charge + Memo,c_short_office,c_short_npc,planner,min_ship_account,handling_charge,default_origin_port ) VALUES ( #{site}, #{supplierNo}, @@ -430,7 +431,7 @@ #{otherContact1}, #{otherContact2}, #{otherContact3}, - #{memo},#{cShortOffice},#{cShortNpc},#{planner},#{minShipAccount},#{handlingCharge} + #{memo},#{cShortOffice},#{cShortNpc},#{planner},#{minShipAccount},#{handlingCharge},#{defaultOriginPort} ) @@ -441,7 +442,8 @@ phoneNo = #{phoneNo},phoneNo2 = #{phoneNo2},phoneNo3 = #{phoneNo3},email = #{email}, email2 = #{email2},faxNo = #{faxNo},Other_contact1 = #{otherContact1},Other_contact2 = #{otherContact2}, Other_contact3 = #{otherContact3},bankName= #{bankName},bankAccount = #{bankAccount}, address = #{address},memo = #{memo},c_short_office=#{cShortOffice},c_short_npc=#{cShortNpc},planner=#{planner}, min_ship_account = #{minShipAccount}, - handling_charge = #{handlingCharge} + handling_charge = #{handlingCharge}, + default_origin_port = #{defaultOriginPort} WHERE id = #{id} @@ -451,6 +453,7 @@ UPDATE srm_supplier SET production_lead_time = #{productionLeadTime,jdbcType=INTEGER}, + default_origin_port = #{defaultOriginPort,jdbcType=VARCHAR}, update_date = GETDATE(), update_by = #{updateBy} WHERE site = #{site}