第三方产品信息接口新增厂家编码,供应商编码

pro
anthonywj 2 years ago
parent 3e53fea186
commit 17827ab959

@ -48,5 +48,7 @@ public class ThrProductsResponse {
private String updateUser; private String updateUser;
private Date updateTime; private Date updateTime;
private String remark; private String remark;
private String manufactoryCode;
private String supCode;
} }

@ -240,7 +240,7 @@ public class BasicBackUpdateProductService {
udiRelevanceEntity1.setThirdId(thrProductsEntity.getCode()); udiRelevanceEntity1.setThirdId(thrProductsEntity.getCode());
udiRelevanceEntity1.setUpdateTime(new Date()); udiRelevanceEntity1.setUpdateTime(new Date());
udiRelevanceEntity1.setModifyTime(new Date()); udiRelevanceEntity1.setModifyTime(new Date());
udiRelevanceEntity1.setId(IdUtil.getSnowflakeNextId()); udiRelevanceEntity1.setId(gennerOrderUtils.getRelId());
udiRelevanceService.insertUdiRelevanceignore(udiRelevanceEntity1); udiRelevanceService.insertUdiRelevanceignore(udiRelevanceEntity1);
} }
} }

@ -295,6 +295,8 @@ public class ThrProductsServiceImpl extends ServiceImpl<ThrProductsDao, ThrProdu
thrProductsEntity.setRemark2(thrProductsResponse.getRemark2()); thrProductsEntity.setRemark2(thrProductsResponse.getRemark2());
thrProductsEntity.setRemark3(thrProductsResponse.getRemark3()); thrProductsEntity.setRemark3(thrProductsResponse.getRemark3());
thrProductsEntity.setPrice(thrProductsResponse.getPrice()); thrProductsEntity.setPrice(thrProductsResponse.getPrice());
thrProductsEntity.setManufactoryCode(thrProductsResponse.getManufactoryCode());
thrProductsEntity.setSupCode(thrProductsResponse.getSupCode());
//比对更新完的对象和原对象是否发生变化,若有变化则说明书有更新 //比对更新完的对象和原对象是否发生变化,若有变化则说明书有更新
return !thrProductsEntity.equals(oldData); return !thrProductsEntity.equals(oldData);

@ -1,36 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.glxp.api.dao.thrsys.ThrProductsDao"> <mapper namespace="com.glxp.api.dao.thrsys.ThrProductsDao">
<select id="filterThrProducts" parameterType="com.glxp.api.req.thrsys.FilterThrProductsRequest" <select id="filterThrProducts" parameterType="com.glxp.api.req.thrsys.FilterThrProductsRequest"
resultType="com.glxp.api.entity.thrsys.ThrProductsEntity"> resultType="com.glxp.api.entity.thrsys.ThrProductsEntity">
SELECT * FROM thr_products SELECT *
FROM thr_products
<where> <where>
<if test="name != '' and name != null"> <if test="name != '' and name != null">
AND name LIKE concat('%',#{name},'%') AND name LIKE concat('%', #{name}, '%')
</if> </if>
<if test="code != '' and code != null"> <if test="code != '' and code != null">
AND code LIKE concat('%',#{code},'%') AND code LIKE concat('%', #{code}, '%')
</if> </if>
<if test="sptm != '' and sptm != null"> <if test="sptm != '' and sptm != null">
AND sptm LIKE concat('%',#{sptm},'%') AND sptm LIKE concat('%', #{sptm}, '%')
</if> </if>
<if test="ybbm != '' and ybbm != null"> <if test="ybbm != '' and ybbm != null">
AND ybbm LIKE concat('%',#{ybbm},'%') AND ybbm LIKE concat('%', #{ybbm}, '%')
</if> </if>
<if test="registerNo != '' and registerNo != null"> <if test="registerNo != '' and registerNo != null">
AND registerNo LIKE concat('%',#{registerNo},'%') AND registerNo LIKE concat('%', #{registerNo}, '%')
</if> </if>
<if test="manufactory != '' and manufactory != null"> <if test="manufactory != '' and manufactory != null">
AND manufactory LIKE concat('%',#{manufactory},'%') AND manufactory LIKE concat('%', #{manufactory}, '%')
</if> </if>
<if test="spec != '' and spec != null"> <if test="spec != '' and spec != null">
AND spec LIKE concat('%',#{spec},'%') AND spec LIKE concat('%', #{spec}, '%')
</if> </if>
<if test="unionCode != '' and unionCode != null"> <if test="unionCode != '' and unionCode != null">
or code LIKE concat('%',#{unionCode},'%') or sptm LIKE concat('%',#{unionCode},'%') or ybbm LIKE or code LIKE concat('%', #{unionCode}, '%')
concat('%',#{unionCode},'%') or sptm LIKE concat('%', #{unionCode}, '%')
or ybbm LIKE
concat('%', #{unionCode}, '%')
</if> </if>
<if test="thirdSysFk != '' and thirdSysFk != null"> <if test="thirdSysFk != '' and thirdSysFk != null">
AND thirdSysFk = #{thirdSysFk} AND thirdSysFk = #{thirdSysFk}
@ -39,16 +40,19 @@
AND thirdSysFk = #{thirdSys} AND thirdSysFk = #{thirdSys}
</if> </if>
<if test="supName != '' and supName != null"> <if test="supName != '' and supName != null">
AND supName LIKE concat('%',#{supName},'%') AND supName LIKE concat('%', #{supName}, '%')
</if> </if>
<if test="lastUpdateTime!=null and lastUpdateTime!=''"> <if test="lastUpdateTime != null and lastUpdateTime != ''">
<![CDATA[ and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S')>= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S') ]]> <![CDATA[
and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S') >= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if> </if>
</where> </where>
</select> </select>
<select id="filterThrProducts1" parameterType="com.glxp.api.req.thrsys.FilterThrProductsRequest" <select id="filterThrProducts1" parameterType="com.glxp.api.req.thrsys.FilterThrProductsRequest"
resultType="com.glxp.api.entity.thrsys.ThrProductsEntity"> resultType="com.glxp.api.entity.thrsys.ThrProductsEntity">
SELECT * FROM thr_products SELECT *
FROM thr_products
<where> <where>
<if test="name != '' and name != null"> <if test="name != '' and name != null">
AND name = #{name} AND name = #{name}
@ -57,23 +61,25 @@
AND code = #{code} AND code = #{code}
</if> </if>
<if test="sptm != '' and sptm != null"> <if test="sptm != '' and sptm != null">
AND sptm= #{sptm} AND sptm = #{sptm}
</if> </if>
<if test="ybbm != '' and ybbm != null"> <if test="ybbm != '' and ybbm != null">
AND ybbm = #{ybbm} AND ybbm = #{ybbm}
</if> </if>
<if test="registerNo != '' and registerNo != null"> <if test="registerNo != '' and registerNo != null">
AND registerNo= #{registerNo} AND registerNo = #{registerNo}
</if> </if>
<if test="manufactory != '' and manufactory != null"> <if test="manufactory != '' and manufactory != null">
AND manufactory= #{manufactory} AND manufactory = #{manufactory}
</if> </if>
<if test="spec != '' and spec != null"> <if test="spec != '' and spec != null">
AND spec = #{spec} AND spec = #{spec}
</if> </if>
<if test="unionCode != '' and unionCode != null"> <if test="unionCode != '' and unionCode != null">
or code LIKE = #{unionCode} or sptm = #{unionCode} or ybbm LIKE or code LIKE = #{unionCode}
= #{unionCode} or sptm = #{unionCode}
or ybbm LIKE
= #{unionCode}
</if> </if>
<if test="thirdSysFk != '' and thirdSysFk != null"> <if test="thirdSysFk != '' and thirdSysFk != null">
AND thirdSysFk = #{thirdSysFk} AND thirdSysFk = #{thirdSysFk}
@ -84,8 +90,10 @@
<if test="supName != '' and supName != null"> <if test="supName != '' and supName != null">
AND supName LIKE = #{supName} AND supName LIKE = #{supName}
</if> </if>
<if test="lastUpdateTime!=null and lastUpdateTime!=''"> <if test="lastUpdateTime != null and lastUpdateTime != ''">
<![CDATA[ and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S')>= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S') ]]> <![CDATA[
and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S') >= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if> </if>
</where> </where>
</select> </select>
@ -93,33 +101,36 @@
<select id="filterJoinThrProducts" parameterType="com.glxp.api.req.thrsys.FilterThrProductsRequest" <select id="filterJoinThrProducts" parameterType="com.glxp.api.req.thrsys.FilterThrProductsRequest"
resultType="com.glxp.api.res.thrsys.ThrProductsResponse"> resultType="com.glxp.api.res.thrsys.ThrProductsResponse">
SELECT thr_products.*,thr_system.thirdName thirdSysName FROM thr_products SELECT thr_products.*, thr_system.thirdName thirdSysName
LEFT JOIN thr_system on thr_products.thirdSysFk = thr_system.thirdId FROM thr_products
LEFT JOIN thr_system on thr_products.thirdSysFk = thr_system.thirdId
<where> <where>
<if test="name != '' and name != null"> <if test="name != '' and name != null">
AND name LIKE concat('%',#{name},'%') AND name LIKE concat('%', #{name}, '%')
</if> </if>
<if test="code != '' and code != null"> <if test="code != '' and code != null">
AND code LIKE concat('%',#{code},'%') AND code LIKE concat('%', #{code}, '%')
</if> </if>
<if test="sptm != '' and sptm != null"> <if test="sptm != '' and sptm != null">
AND sptm LIKE concat('%',#{sptm},'%') AND sptm LIKE concat('%', #{sptm}, '%')
</if> </if>
<if test="ybbm != '' and ybbm != null"> <if test="ybbm != '' and ybbm != null">
AND ybbm LIKE concat('%',#{ybbm},'%') AND ybbm LIKE concat('%', #{ybbm}, '%')
</if> </if>
<if test="registerNo != '' and registerNo != null"> <if test="registerNo != '' and registerNo != null">
AND registerNo LIKE concat('%',#{registerNo},'%') AND registerNo LIKE concat('%', #{registerNo}, '%')
</if> </if>
<if test="manufactory != '' and manufactory != null"> <if test="manufactory != '' and manufactory != null">
AND manufactory LIKE concat('%',#{manufactory},'%') AND manufactory LIKE concat('%', #{manufactory}, '%')
</if> </if>
<if test="spec != '' and spec != null"> <if test="spec != '' and spec != null">
AND spec LIKE concat('%',#{spec},'%') AND spec LIKE concat('%', #{spec}, '%')
</if> </if>
<if test="unionCode != '' and unionCode != null"> <if test="unionCode != '' and unionCode != null">
or code LIKE concat('%',#{unionCode},'%') or sptm LIKE concat('%',#{unionCode},'%') or ybbm LIKE or code LIKE concat('%', #{unionCode}, '%')
concat('%',#{unionCode},'%') or sptm LIKE concat('%', #{unionCode}, '%')
or ybbm LIKE
concat('%', #{unionCode}, '%')
</if> </if>
<if test="thirdSysFk != '' and thirdSysFk != null"> <if test="thirdSysFk != '' and thirdSysFk != null">
AND thirdSysFk = #{thirdSysFk} AND thirdSysFk = #{thirdSysFk}
@ -128,10 +139,12 @@
AND thirdSysFk = #{thirdSys} AND thirdSysFk = #{thirdSys}
</if> </if>
<if test="supName != '' and supName != null"> <if test="supName != '' and supName != null">
AND supName LIKE concat('%',#{supName},'%') AND supName LIKE concat('%', #{supName}, '%')
</if> </if>
<if test="lastUpdateTime!=null and lastUpdateTime!=''"> <if test="lastUpdateTime != null and lastUpdateTime != ''">
<![CDATA[ and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S')>= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S') ]]> <![CDATA[
and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S') >= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if> </if>
</where> </where>
</select> </select>
@ -153,58 +166,60 @@
<insert id="insertThrProducts" keyProperty="id" <insert id="insertThrProducts" keyProperty="id"
parameterType="com.glxp.api.entity.thrsys.ThrProductsEntity"> parameterType="com.glxp.api.entity.thrsys.ThrProductsEntity">
replace replace
INTO thr_products INTO thr_products
(id,code, `name`, measname, spec, registerNo, manufactory, (id, code, `name`, measname, spec, registerNo, manufactory,
cplb, flbm, qxlb, ybbm, sptm, tyshxydm, zczbhhzbapzbh, ylqxzcrbarmc, ylqxzcrbarywmc, cpms, cplb, flbm, qxlb, ybbm, sptm, tyshxydm, zczbhhzbapzbh, ylqxzcrbarmc, ylqxzcrbarywmc, cpms,
thirdSysFk, updateTime, supName, model, standard, qtbm, zczyxqz, remark, remark1, remark2, remark3,price,createUser,createTime,updateUser) thirdSysFk, updateTime, supName, model, standard, qtbm, zczyxqz, remark, remark1, remark2, remark3,
values ( price, createUser, createTime, updateUser, manufactoryCode, supCode)
#{id}, values (#{id},
#{code}, #{code},
#{name}, #{name},
#{measname}, #{measname},
#{spec}, #{spec},
#{registerNo}, #{registerNo},
#{manufactory}, #{manufactory},
#{cplb}, #{cplb},
#{flbm}, #{flbm},
#{qxlb}, #{qxlb},
#{ybbm}, #{ybbm},
#{sptm}, #{sptm},
#{tyshxydm}, #{tyshxydm},
#{zczbhhzbapzbh}, #{zczbhhzbapzbh},
#{ylqxzcrbarmc}, #{ylqxzcrbarmc},
#{ylqxzcrbarywmc}, #{ylqxzcrbarywmc},
#{cpms}, #{cpms},
#{thirdSysFk}, #{thirdSysFk},
#{updateTime}, #{updateTime},
#{supName}, #{supName},
#{model}, #{model},
#{standard}, #{standard},
#{qtbm}, #{qtbm},
#{zczyxqz}, #{zczyxqz},
#{remark}, #{remark},
#{remark1}, #{remark1},
#{remark2}, #{remark2},
#{remark3}, #{remark3},
#{price}, #{price},
#{createUser}, #{createUser},
#{createTime}, #{createTime},
#{updateUser} #{updateUser}, #{manufactoryCode}, #{supCode})
)
</insert> </insert>
<select id="selectByLastTime" resultType="com.glxp.api.entity.thrsys.ThrProductsEntity"> <select id="selectByLastTime" resultType="com.glxp.api.entity.thrsys.ThrProductsEntity">
select * from thr_products where updateTime >= #{lastUpdateTime} select *
from thr_products
where updateTime >= #{lastUpdateTime}
</select> </select>
<insert id="insertThrProductsList"> <insert id="insertThrProductsList">
replace replace
INTO thr_products INTO thr_products
(code, `name`, measname, spec, registerNo, manufactory, (code, `name`, measname, spec, registerNo, manufactory,
cplb, flbm, qxlb, ybbm, sptm, tyshxydm, zczbhhzbapzbh, ylqxzcrbarmc, ylqxzcrbarywmc, cpms, cplb, flbm, qxlb, ybbm, sptm, tyshxydm, zczbhhzbapzbh, ylqxzcrbarmc, ylqxzcrbarywmc, cpms,
thirdSysFk, updateTime, supName, model, standard, qtbm, zczyxqz, remark, remark1, remark2, remark3, price, thirdSysFk, updateTime, supName, model, standard, qtbm, zczyxqz, remark, remark1, remark2, remark3,
createUser, createTime, updateUser) price,
values createUser, createTime, updateUser, manufactoryCode, supCode)
values
<foreach collection="list" index="index" item="item" open="(" close=")" separator=","> <foreach collection="list" index="index" item="item" open="(" close=")" separator=",">
#{item.code}, #{item.code},
#{item.name}, #{item.name},
@ -236,7 +251,7 @@
#{item.price}, #{item.price},
#{item.createUser}, #{item.createUser},
#{item.createTime}, #{item.createTime},
#{item.updateUser} #{item.updateUser}, #{manufactoryCode}, #{supCode}
</foreach> </foreach>
</insert> </insert>
@ -268,7 +283,9 @@
remark1, remark1,
remark2, remark2,
remark3, remark3,
price price,
manufactoryCode,
supCode
from thr_products from thr_products
<where> <where>
<if test="code != null and code != ''"> <if test="code != null and code != ''">
@ -283,33 +300,35 @@
<update id="updateEntityById" parameterType="com.glxp.api.entity.thrsys.ThrProductsEntity"> <update id="updateEntityById" parameterType="com.glxp.api.entity.thrsys.ThrProductsEntity">
update thr_products update thr_products
<set> <set>
code = #{code,jdbcType=VARCHAR}, code = #{code,jdbcType=VARCHAR},
name = #{name,jdbcType=VARCHAR}, name = #{name,jdbcType=VARCHAR},
measname = #{measname,jdbcType=VARCHAR}, measname = #{measname,jdbcType=VARCHAR},
spec = #{spec,jdbcType=VARCHAR}, spec = #{spec,jdbcType=VARCHAR},
registerNo = #{registerNo,jdbcType=VARCHAR}, registerNo = #{registerNo,jdbcType=VARCHAR},
manufactory = #{manufactory,jdbcType=VARCHAR}, manufactory = #{manufactory,jdbcType=VARCHAR},
cplb = #{cplb,jdbcType=VARCHAR}, cplb = #{cplb,jdbcType=VARCHAR},
flbm = #{flbm,jdbcType=VARCHAR}, flbm = #{flbm,jdbcType=VARCHAR},
qxlb = #{qxlb,jdbcType=VARCHAR}, qxlb = #{qxlb,jdbcType=VARCHAR},
ybbm = #{ybbm,jdbcType=VARCHAR}, ybbm = #{ybbm,jdbcType=VARCHAR},
sptm = #{sptm,jdbcType=VARCHAR}, sptm = #{sptm,jdbcType=VARCHAR},
tyshxydm = #{tyshxydm,jdbcType=VARCHAR}, tyshxydm = #{tyshxydm,jdbcType=VARCHAR},
zczbhhzbapzbh = #{zczbhhzbapzbh,jdbcType=VARCHAR}, zczbhhzbapzbh = #{zczbhhzbapzbh,jdbcType=VARCHAR},
ylqxzcrbarmc = #{ylqxzcrbarmc,jdbcType=VARCHAR}, ylqxzcrbarmc = #{ylqxzcrbarmc,jdbcType=VARCHAR},
ylqxzcrbarywmc = #{ylqxzcrbarywmc,jdbcType=VARCHAR}, ylqxzcrbarywmc = #{ylqxzcrbarywmc,jdbcType=VARCHAR},
cpms = #{cpms,jdbcType=LONGVARCHAR}, cpms = #{cpms,jdbcType=LONGVARCHAR},
updateTime = #{updateTime,jdbcType=TIMESTAMP}, updateTime = #{updateTime,jdbcType=TIMESTAMP},
supName = #{supName,jdbcType=VARCHAR}, supName = #{supName,jdbcType=VARCHAR},
model = #{model,jdbcType=VARCHAR}, model = #{model,jdbcType=VARCHAR},
standard = #{standard,jdbcType=VARCHAR}, standard = #{standard,jdbcType=VARCHAR},
qtbm = #{qtbm,jdbcType=VARCHAR}, qtbm = #{qtbm,jdbcType=VARCHAR},
zczyxqz = #{zczyxqz,jdbcType=VARCHAR}, zczyxqz = #{zczyxqz,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR}, remark = #{remark,jdbcType=VARCHAR},
remark1 = #{remark1,jdbcType=VARCHAR}, remark1 = #{remark1,jdbcType=VARCHAR},
remark2 = #{remark2,jdbcType=VARCHAR}, remark2 = #{remark2,jdbcType=VARCHAR},
remark3 = #{remark3,jdbcType=VARCHAR}, remark3 = #{remark3,jdbcType=VARCHAR},
price = #{price,jdbcType=VARCHAR} price = #{price,jdbcType=VARCHAR},
manufactoryCode = #{manufactoryCode,jdbcType=VARCHAR},
supCode = #{supCode,jdbcType=VARCHAR}
</set> </set>
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</update> </update>

Loading…
Cancel
Save