Browse Source

part增加品牌字段

master
han\hanst 6 days ago
parent
commit
91b3e5bf2e
  1. 1
      src/main/java/com/xujie/sys/modules/ecss/entity/EcssHsCode.java
  2. 6
      src/main/java/com/xujie/sys/modules/ecss/mapper/CoDelMapper.java
  3. 14
      src/main/java/com/xujie/sys/modules/ecss/service/impl/CoDelExcelTXServiceImpl.java
  4. 1
      src/main/java/com/xujie/sys/modules/orderIssure/entity/PartData.java
  5. 14
      src/main/resources/mapper/ecss/CoDelMapper.xml

1
src/main/java/com/xujie/sys/modules/ecss/entity/EcssHsCode.java

@ -30,6 +30,7 @@ public class EcssHsCode extends QueryPage {
private String hsCodeDescEn; private String hsCodeDescEn;
private String unit; private String unit;
private String brand;
/** /**
* *

6
src/main/java/com/xujie/sys/modules/ecss/mapper/CoDelMapper.java

@ -50,9 +50,9 @@ public interface CoDelMapper {
List<PartData> checkPart(@Param("site") String site, @Param("partNo") String partNo); List<PartData> checkPart(@Param("site") String site, @Param("partNo") String partNo);
List<PartData> getPartNo(@Param("site") String site, @Param("partNo") String partNo, @Param("userName") String userName, @Param("buNo") String buNo); List<PartData> getPartNo(@Param("site") String site, @Param("partNo") String partNo, @Param("userName") String userName, @Param("buNo") String buNo);
@Update("update Part set hsCode = #{hsCode}, hsCodeDesc = #{hsCodeDesc} where site = #{site} and part_no = #{partNo}")
void updatePartHsCode(@Param("site") String site, @Param("partNo") String partNo, @Param("hsCode") String hsCode, @Param("hsCodeDesc") String hsCodeDesc);
@Update("update Part set hsCode = ISNULL(NULLIF(#{hsCode},''),hsCode), hsCodeDesc = ISNULL(NULLIF(#{hsCodeDesc},''),hsCodeDesc), brand = ISNULL(NULLIF(#{brand},'无'),brand) where site = #{site} and part_no = #{partNo}")
void updatePartHsCode(@Param("site") String site, @Param("partNo") String partNo, @Param("hsCode") String hsCode, @Param("hsCodeDesc") String hsCodeDesc, @Param("brand") String brand);
List<PartData> getPartInfo(@Param("site") String site, @Param("partNo") String partNo); List<PartData> getPartInfo(@Param("site") String site, @Param("partNo") String partNo);

14
src/main/java/com/xujie/sys/modules/ecss/service/impl/CoDelExcelTXServiceImpl.java

@ -432,18 +432,26 @@ public class CoDelExcelTXServiceImpl implements CoDelExcelTXService {
} else { } else {
PartData partData = parts.getFirst(); PartData partData = parts.getFirst();
detail.setPartNo(partData.getPartNo()); detail.setPartNo(partData.getPartNo());
if (StringUtils.isBlank(partData.getHsCode()) || StringUtils.isBlank(partData.getHsCodeDesc())) {
if (StringUtils.isBlank(partData.getHsCode()) || StringUtils.isBlank(partData.getHsCodeDesc())
|| StringUtils.isBlank(partData.getBrand()) || "无".equals(partData.getBrand())) {
String hsCode = headerMap.containsKey("HS Code") ? getMergedCellValue(sheet, r, headerMap.get("HS Code")) : ""; String hsCode = headerMap.containsKey("HS Code") ? getMergedCellValue(sheet, r, headerMap.get("HS Code")) : "";
String hsCodeDesc = headerMap.containsKey("申报品名") ? getMergedCellValue(sheet, r, headerMap.get("申报品名")) : ""; String hsCodeDesc = headerMap.containsKey("申报品名") ? getMergedCellValue(sheet, r, headerMap.get("申报品名")) : "";
String brand = "";
if (headerMap.containsKey("品牌")) {
brand = getMergedCellValue(sheet, r, headerMap.get("品牌"));
} else if (headerMap.containsKey("Brand")) {
brand = getMergedCellValue(sheet, r, headerMap.get("Brand"));
}
if (StringUtils.isNotBlank(hsCode) || StringUtils.isNotBlank(hsCodeDesc)) {
coDelMapper.updatePartHsCode(site, partData.getPartNo(), hsCode, hsCodeDesc);
if (StringUtils.isNotBlank(hsCode) || StringUtils.isNotBlank(hsCodeDesc) || StringUtils.isNotBlank(brand)) {
coDelMapper.updatePartHsCode(site, partData.getPartNo(), hsCode, hsCodeDesc, brand);
if (StringUtils.isNotBlank(hsCodeDesc)) { if (StringUtils.isNotBlank(hsCodeDesc)) {
EcssHsCodeData hsCodeData = new EcssHsCodeData(); EcssHsCodeData hsCodeData = new EcssHsCodeData();
hsCodeData.setSite(site); hsCodeData.setSite(site);
hsCodeData.setBuNo(data.getBuNo()); hsCodeData.setBuNo(data.getBuNo());
hsCodeData.setHsCodeDesc(hsCodeDesc); hsCodeData.setHsCodeDesc(hsCodeDesc);
hsCodeData.setBrand(brand);
List<EcssHsCodeData> existHsCodes = coDelMapper.checkHsCodeDescData(hsCodeData); List<EcssHsCodeData> existHsCodes = coDelMapper.checkHsCodeDescData(hsCodeData);
if (existHsCodes == null || existHsCodes.isEmpty()) { if (existHsCodes == null || existHsCodes.isEmpty()) {
hsCodeData.setHsCode(hsCode); hsCodeData.setHsCode(hsCode);

1
src/main/java/com/xujie/sys/modules/orderIssure/entity/PartData.java

@ -13,4 +13,5 @@ public class PartData extends Part {
private String packageNo; private String packageNo;
private String hsCode; private String hsCode;
private String hsCodeDesc; private String hsCodeDesc;
private String brand;
} }

14
src/main/resources/mapper/ecss/CoDelMapper.xml

@ -223,7 +223,7 @@
</select> </select>
<select id="getPartNo" resultType="PartData"> <select id="getPartNo" resultType="PartData">
select top 1 site,part_no,hsCode,hsCodeDesc,part_desc,umid from Part where site=#{site,jdbcType=VARCHAR} and sku=#{partNo} and sourceBu=#{buNo} and
select top 1 site,part_no,hsCode,hsCodeDesc,part_desc,umid,brand from Part where site=#{site,jdbcType=VARCHAR} and sku=#{partNo} and sourceBu=#{buNo} and
site in (select site from eam_access_site where username = #{userName}) site in (select site from eam_access_site where username = #{userName})
and (site + '-' + sourceBu) in (select * from dbo.query_bu(#{userName})) and (site + '-' + sourceBu) in (select * from dbo.query_bu(#{userName}))
</select> </select>
@ -355,7 +355,7 @@
<select id="searchHsCodeData" resultType="EcssHsCodeData"> <select id="searchHsCodeData" resultType="EcssHsCodeData">
select a.Site,a.BuNo,a.HsCode,a.Remark,a.CreateBy,a.CreateDate,a.UpdateBy,a.UpdateDate,a.codeNo select a.Site,a.BuNo,a.HsCode,a.Remark,a.CreateBy,a.CreateDate,a.UpdateBy,a.UpdateDate,a.codeNo
,dbo.get_bu_desc(a.site,a.BuNo) as BuDesc,a.hsCodeDesc,a.hsCodeDescEn,a.unit
,dbo.get_bu_desc(a.site,a.BuNo) as BuDesc,a.hsCodeDesc,a.hsCodeDescEn,a.unit,a.brand
from ecss_hsCode a from ecss_hsCode a
left join accessBu D on A.site=D.site and A.BuNo=d.bu_no and D.username=#{query.username} left join accessBu D on A.site=D.site and A.BuNo=d.bu_no and D.username=#{query.username}
@ -374,7 +374,7 @@
</select> </select>
<select id="checkHsCodeDescData" resultType="EcssHsCodeData"> <select id="checkHsCodeDescData" resultType="EcssHsCodeData">
select a.Site,a.BuNo,a.HsCode,a.hsCodeDesc
select a.Site,a.BuNo,a.HsCode,a.hsCodeDesc,a.brand
from ecss_hsCode a where a.site=#{site} and a.buNo=#{buNo} and a.HsCodeDesc=#{hsCodeDesc} from ecss_hsCode a where a.site=#{site} and a.buNo=#{buNo} and a.HsCodeDesc=#{hsCodeDesc}
</select> </select>
<select id="checkPropertiesModel" resultType="com.xujie.sys.modules.attrbute.entity.PropertyModelHeader"> <select id="checkPropertiesModel" resultType="com.xujie.sys.modules.attrbute.entity.PropertyModelHeader">
@ -383,12 +383,12 @@
</select> </select>
<insert id="insertHsCodeData" > <insert id="insertHsCodeData" >
insert into ecss_hsCode (Site,BuNo,HsCode,Remark,CreateBy,CreateDate,codeNo,hsCodeDesc,hsCodeDescEn,unit)
values(#{site},#{buNo},#{hsCode},#{remark},#{createBy},GetDate(),#{codeNo},#{hsCodeDesc},#{hsCodeDescEn},#{unit})
insert into ecss_hsCode (Site,BuNo,HsCode,Remark,CreateBy,CreateDate,codeNo,hsCodeDesc,hsCodeDescEn,unit,brand)
values(#{site},#{buNo},#{hsCode},#{remark},#{createBy},GetDate(),#{codeNo},#{hsCodeDesc},#{hsCodeDescEn},#{unit},#{brand})
</insert> </insert>
<update id="updateHsCodeData"> <update id="updateHsCodeData">
update ecss_hsCode set Remark=#{remark} ,codeNo=#{codeNo},HsCode=#{hsCode},unit=#{unit} ,UpdateDate=GetDate(),UpdateBy=#{updateBy},hsCodeDescEn=#{hsCodeDescEn}
update ecss_hsCode set Remark=#{remark} ,codeNo=#{codeNo},HsCode=#{hsCode},unit=#{unit} ,brand=#{brand},UpdateDate=GetDate(),UpdateBy=#{updateBy},hsCodeDescEn=#{hsCodeDescEn}
where site=#{site} and buNo=#{buNo} and hsCodeDesc=#{hsCodeDesc} where site=#{site} and buNo=#{buNo} and hsCodeDesc=#{hsCodeDesc}
</update> </update>
@ -822,7 +822,7 @@ left join ecss_CoDelNotifyHeader noHeader on a.site=noHeader.site and a.delNo=no
</select> </select>
<select id="searchHsCodeList" resultType="java.util.Map"> <select id="searchHsCodeList" resultType="java.util.Map">
select a.BuNo,a.HsCode,a.hsCodeDesc,a.unit,a.hsCodeDescEn
select a.BuNo,a.HsCode,a.hsCodeDesc,a.unit,a.hsCodeDescEn,a.brand
from ecss_hsCode a from ecss_hsCode a
<where> a.BuNo = #{buNo} <where> a.BuNo = #{buNo}
<if test="hsCode != null and hsCode != ''"> <if test="hsCode != null and hsCode != ''">

Loading…
Cancel
Save