Browse Source

暂存

master
常熟吴彦祖 4 weeks ago
parent
commit
c129229b2c
  1. 23
      src/main/java/com/xujie/modules/srm/data/SrmSupplierData.java
  2. 8
      src/main/java/com/xujie/modules/srm/entity/SrmSupplier.java
  3. 140
      src/main/resources/mapper/srm/SrmSupplierMapper.xml

23
src/main/java/com/xujie/modules/srm/data/SrmSupplierData.java

@ -6,27 +6,24 @@ import org.apache.ibatis.type.Alias;
import java.util.List; import java.util.List;
@Data @Data
@Alias("SrmSupplierData") @Alias("SrmSupplierData")
public class SrmSupplierData extends SrmSupplier { public class SrmSupplierData extends SrmSupplier {
/** 可选:列表联表展示的付款条款说明(非主表字段) */
private String paymentTermDesc;
/** 可选:列表联表展示的交货条款说明(非主表字段) */
private String deliveryTermDesc;
/** 可选:列表联表展示的税率说明(非主表字段) */
private String taxDesc;
/** 可选:按主表 id 限定列表(如首页资质到期提醒跳转),与普通条件叠加且仍受供应商权限 SQL 约束 */ /** 可选:按主表 id 限定列表(如首页资质到期提醒跳转),与普通条件叠加且仍受供应商权限 SQL 约束 */
private List<Integer> supplierIdList; private List<Integer> supplierIdList;
// 供应商分组描述
/** 供应商分组描述 */
private String groupDesc; private String groupDesc;
public String getGroupDesc() {
return this.groupDesc;
}
public void setGroupDesc(String groupDesc) {
this.groupDesc = groupDesc;
}
private String groupDocType; private String groupDocType;
public String getGroupDocType() {
return this.groupDocType;
}
public void setGroupDocType(String groupDocType) {
this.groupDocType = groupDocType;
}
} }

8
src/main/java/com/xujie/modules/srm/entity/SrmSupplier.java

@ -1,6 +1,7 @@
package com.xujie.modules.srm.entity; package com.xujie.modules.srm.entity;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.xujie.common.utils.QueryPage; import com.xujie.common.utils.QueryPage;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
@ -90,8 +91,8 @@ public class SrmSupplier extends QueryPage {
// 采购员 // 采购员
private String buyer; private String buyer;
//Sourcing专员
private String sourcingstaff;
// Sourcing专员
private String sourcingStaff;
// 币种 // 币种
private String currency; private String currency;
@ -125,9 +126,12 @@ public class SrmSupplier extends QueryPage {
//备注 //备注
private String memo; private String memo;
/** JSON 名固定为 cShortOffice:避免 Jackson 对 c+大写字段推导出 cshortOffice */
@JsonProperty("cShortOffice")
@ApiModelProperty(value = "供应商简称(Office)") @ApiModelProperty(value = "供应商简称(Office)")
private String cShortOffice; private String cShortOffice;
@JsonProperty("cShortNpc")
@ApiModelProperty(value = "供应商简称(NPC)") @ApiModelProperty(value = "供应商简称(NPC)")
private String cShortNpc; private String cShortNpc;

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

@ -5,22 +5,52 @@
<!-- 基础字段映射 --> <!-- 基础字段映射 -->
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id,site,supplier_no,supplier_name,supplier_group,create_date,create_by,update_date,update_by,supplier_doc_type, id,site,supplier_no,supplier_name,supplier_group,create_date,create_by,update_date,update_by,supplier_doc_type,
TaxCode,tax,FaxNo,PhoneNo,PhoneNo2,PhoneNo3,Contact,Address,PaymentTerm,DeliveryTerm,Buyer,SourcingStaff,
Currency,ABC,Active,BankName,BankAccount,TaxNo,Email,Email2,Other_contact1,Other_contact2,Other_contact3,Memo
TaxCode,FaxNo,PhoneNo,Contact,Address,PaymentTerm,DeliveryTerm,Buyer,Currency,ABC,Active,CreateDate,BankName,BankAccount,
TaxNo,Email,Memo,CustomerAddress,Tax,Email2,PhoneNo2,PhoneNo3,SourcingStaff,Other_contact1,Other_contact2,Other_contact3,
c_short_office,c_short_npc
</sql> </sql>
<select id="searchSrmSupplierList" resultType="SrmSupplierData"> <select id="searchSrmSupplierList" resultType="SrmSupplierData">
SELECT SELECT
s.id,s.site,s.supplier_no,s.supplier_name,s.supplier_group,sg.GroupDesc AS groupDesc,s.supplier_doc_type,
s.create_date,s.create_by,s.update_date,s.update_by,s.Buyer,s.SourcingStaff AS sourcingStaff,s.PhoneNo,
s.PhoneNo2,s.PhoneNo3,s.FaxNo,s.Contact,s.Address,s.Email,s.Email2,
s.PaymentTerm,pt.payment_term AS paymentTermDesc,
s.DeliveryTerm,dt.delivery_term AS deliveryTermDesc,
s.Currency, s.TaxCode,t.tax_desc AS taxDesc,s.tax AS taxRate,
s.ABC,s.Active,s.BankName,s.BankAccount,s.TaxNo,
s.Other_contact1,s.Other_contact2,s.Other_contact3,
s.Memo
s.id AS id,
s.site AS site,
s.supplier_no AS supplierNo,
s.supplier_name AS supplierName,
s.supplier_group AS supplierGroup,
sg.GroupDesc AS groupDesc,
s.supplier_doc_type AS supplierDocType,
s.create_date AS createDate,
s.create_by AS createBy,
s.update_date AS updateDate,
s.update_by AS updateBy,
s.Buyer AS buyer,
s.SourcingStaff AS sourcingStaff,
s.PhoneNo AS phoneNo,
s.PhoneNo2 AS phoneNo2,
s.PhoneNo3 AS phoneNo3,
s.FaxNo AS faxNo,
s.Contact AS contact,
s.Address AS address,
s.Email AS email,
s.Email2 AS email2,
s.PaymentTerm AS paymentTerm,
pt.payment_term AS paymentTermDesc,
s.DeliveryTerm AS deliveryTerm,
dt.delivery_term AS deliveryTermDesc,
s.Currency AS currency,
s.TaxCode AS taxCode,
t.tax_desc AS taxDesc,
s.tax AS tax,
s.ABC AS abc,
s.Active AS active,
s.BankName AS bankName,
s.BankAccount AS bankAccount,
s.TaxNo AS taxNo,
s.Other_contact1 AS otherContact1,
s.Other_contact2 AS otherContact2,
s.Other_contact3 AS otherContact3,
s.Memo AS memo, s.c_short_office,s.c_short_npc
FROM srm_supplier s LEFT JOIN SupplierGroup sg ON sg.supplier_group = s.supplier_group FROM srm_supplier s LEFT JOIN SupplierGroup sg ON sg.supplier_group = s.supplier_group
AND sg.Site = s.site LEFT JOIN Currency c ON c.Currency = s.Currency AND sg.Site = s.site LEFT JOIN Currency c ON c.Currency = s.Currency
AND c.Site = s.site LEFT JOIN Tax t ON t.tax_code = s.TaxCode AND c.Site = s.site LEFT JOIN Tax t ON t.tax_code = s.TaxCode
@ -58,7 +88,7 @@
</foreach> </foreach>
</if> </if>
</where> </where>
ORDER BY id
ORDER BY s.id
</select> </select>
<select id="checkSrmSupplierList" resultType="SrmSupplierData"> <select id="checkSrmSupplierList" resultType="SrmSupplierData">
SELECT SELECT
@ -312,7 +342,7 @@
Other_contact1, Other_contact1,
Other_contact2, Other_contact2,
Other_contact3, Other_contact3,
Memo
Memo,c_short_office,c_short_npc
) VALUES ( ) VALUES (
#{site}, #{site},
#{supplierNo}, #{supplierNo},
@ -334,7 +364,7 @@
#{paymentTerm}, #{paymentTerm},
#{deliveryTerm}, #{deliveryTerm},
#{buyer}, #{buyer},
#{sourcingstaff},
#{sourcingStaff},
#{currency}, #{currency},
#{abc}, #{abc},
#{active}, #{active},
@ -346,87 +376,17 @@
#{otherContact1}, #{otherContact1},
#{otherContact2}, #{otherContact2},
#{otherContact3}, #{otherContact3},
#{memo}
#{memo},#{cShortOffice},#{cShortNpc}
) )
</insert> </insert>
<!-- 更新供应商 --> <!-- 更新供应商 -->
<update id="updateSrmSupplier" parameterType="com.xujie.modules.srm.entity.SrmSupplier"> <update id="updateSrmSupplier" parameterType="com.xujie.modules.srm.entity.SrmSupplier">
UPDATE srm_supplier
<set>
<if test="supplierNo != null and supplierNo != ''">
supplier_no = #{supplierNo},
</if>
<if test="supplierName != null and supplierName != ''">
supplier_name = #{supplierName},
</if>
<if test="supplierGroup != null and supplierGroup != ''">
supplier_group = #{supplierGroup},
</if>
<if test="active != null and active != ''">
active = #{active},
</if>
<if test="supplierDocType != null and supplierDocType != ''">
supplier_doc_type = #{supplierDocType},
</if>
<if test="taxCode != null and taxCode != ''">
taxCode = #{taxCode},
</if>
<if test="abc != null and abc != ''">
abc = #{abc},
</if>
<if test="sourcingstaff != null and sourcingstaff != ''">
sourcingStaff = #{sourcingstaff},
</if>
<if test="currency != null and currency != ''">
currency = #{currency},
</if>
<if test="paymentTerm != null and paymentTerm != ''">
paymentTerm = #{paymentTerm},
</if>
<if test="deliveryTerm != null and deliveryTerm != ''">
deliveryTerm = #{deliveryTerm},
</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="email != null and email != ''">
email = #{email},
</if>
<if test="email2 != null and email2 != ''">
email2 = #{email2},
</if>
<if test="faxNo != null and faxNo != ''">
faxNo = #{faxNo},
</if>
<if test="otherContact1 != null and otherContact1 != ''">
otherContact1 = #{otherContact1},
</if>
<if test="otherContact2 != null and otherContact2 != ''">
otherContact2 = #{otherContact2},
</if>
<if test="otherContact3 != null and 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 test="memo != null and memo != ''">
memo = #{memo},
</if>
</set>
UPDATE srm_supplier set supplier_name = #{supplierName}, supplier_group = #{supplierGroup}, active = #{active}, supplier_doc_type = #{supplierDocType},
taxCode = #{taxCode}, abc = #{abc}, sourcingStaff = #{sourcingStaff}, currency = #{currency}, paymentTerm = #{paymentTerm}, deliveryTerm = #{deliveryTerm},
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}
WHERE id = #{id} WHERE id = #{id}
</update> </update>

Loading…
Cancel
Save