bug修改,推送nameCode不匹配

cert
anthonywj 2 years ago
parent 27b4acadc8
commit 290357a4cd

@ -162,15 +162,18 @@ public class UdiTraceService {
List<String> certNums = toCorpCreditNums.stream().distinct().collect(Collectors.toList()); List<String> certNums = toCorpCreditNums.stream().distinct().collect(Collectors.toList());
for (String certNum : certNums) { for (String certNum : certNums) {
UserCompanyEntity userCompanyEntity = userCompanyService.getOne(new QueryWrapper<UserCompanyEntity>().eq("creditNum", certNum.trim())); UserCompanyEntity userCompanyEntity = userCompanyService.getOne(new QueryWrapper<UserCompanyEntity>().eq("creditNum", certNum.trim()));
TraceTaskNoticeEntity taskNoticeEntity = traceTaskNoticeService.findTask(2, traceProductDetailEntity.getId(), userCompanyEntity.getId()); if (userCompanyEntity != null) {
if (taskNoticeEntity == null) { TraceTaskNoticeEntity taskNoticeEntity = traceTaskNoticeService.findTask(2, traceProductDetailEntity.getId(), userCompanyEntity.getId());
taskNoticeEntity = createTraceNotice(2, traceProductDetailEntity, userCompanyEntity.getId()); if (taskNoticeEntity == null) {
pushDelayExpireTask(taskNoticeEntity); taskNoticeEntity = createTraceNotice(2, traceProductDetailEntity, userCompanyEntity.getId());
pushMq(taskNoticeEntity, userCompanyEntity.getId()); pushDelayExpireTask(taskNoticeEntity);
} else if (taskNoticeEntity.getStatus() == 4) { pushMq(taskNoticeEntity, userCompanyEntity.getId());
//任务超时未处理,重新推送消息 } else if (taskNoticeEntity.getStatus() == 4) {
pushMq(taskNoticeEntity, userCompanyEntity.getId()); //任务超时未处理,重新推送消息
pushMq(taskNoticeEntity, userCompanyEntity.getId());
}
} }
} }
} }
} }
@ -190,32 +193,32 @@ public class UdiTraceService {
} }
// if (traceProductDetailEntity.getStatus() == 2) { //出入库订单未处理完成 // if (traceProductDetailEntity.getStatus() == 2) { //出入库订单未处理完成
//列出需要查询推送企业 //列出需要查询推送企业
List<TraceOrderEntity> traceOrderEntities = traceOrderService.findByProductIdFk(traceProductDetailEntity.getId()); List<TraceOrderEntity> traceOrderEntities = traceOrderService.findByProductIdFk(traceProductDetailEntity.getId());
if (CollUtil.isNotEmpty(traceOrderEntities)) { if (CollUtil.isNotEmpty(traceOrderEntities)) {
List<String> toCorpCreditNums = new ArrayList<>(); List<String> toCorpCreditNums = new ArrayList<>();
for (TraceOrderEntity traceOrderEntity : traceOrderEntities) { for (TraceOrderEntity traceOrderEntity : traceOrderEntities) {
if (StrUtil.isNotEmpty(traceOrderEntity.getToCorpCreditNum())) { if (StrUtil.isNotEmpty(traceOrderEntity.getToCorpCreditNum())) {
toCorpCreditNums.add(traceOrderEntity.getToCorpCreditNum()); toCorpCreditNums.add(traceOrderEntity.getToCorpCreditNum());
}
if (StrUtil.isNotEmpty(traceOrderEntity.getFromCorpCreditNum())) {
toCorpCreditNums.add(traceOrderEntity.getFromCorpCreditNum());
}
} }
List<String> certNums = toCorpCreditNums.stream().distinct().collect(Collectors.toList()); if (StrUtil.isNotEmpty(traceOrderEntity.getFromCorpCreditNum())) {
for (String certNum : certNums) { toCorpCreditNums.add(traceOrderEntity.getFromCorpCreditNum());
UserCompanyEntity userCompanyEntity = userCompanyService.getOne(new QueryWrapper<UserCompanyEntity>().eq("creditNum", certNum)); }
TraceTaskNoticeEntity taskNoticeEntity = traceTaskNoticeService.findTask(1, traceProductDetailEntity.getId(), userCompanyEntity.getId()); }
if (taskNoticeEntity == null) { List<String> certNums = toCorpCreditNums.stream().distinct().collect(Collectors.toList());
taskNoticeEntity = createTraceNotice(1, traceProductDetailEntity, userCompanyEntity.getId()); for (String certNum : certNums) {
pushDelayExpireTask(taskNoticeEntity); UserCompanyEntity userCompanyEntity = userCompanyService.getOne(new QueryWrapper<UserCompanyEntity>().eq("creditNum", certNum));
pushMq(taskNoticeEntity, userCompanyEntity.getId()); TraceTaskNoticeEntity taskNoticeEntity = traceTaskNoticeService.findTask(1, traceProductDetailEntity.getId(), userCompanyEntity.getId());
} else if (taskNoticeEntity.getStatus() == 4) { if (taskNoticeEntity == null) {
//任务超时未处理,重新推送消息 taskNoticeEntity = createTraceNotice(1, traceProductDetailEntity, userCompanyEntity.getId());
pushMq(taskNoticeEntity, userCompanyEntity.getId()); pushDelayExpireTask(taskNoticeEntity);
} pushMq(taskNoticeEntity, userCompanyEntity.getId());
} else if (taskNoticeEntity.getStatus() == 4) {
//任务超时未处理,重新推送消息
pushMq(taskNoticeEntity, userCompanyEntity.getId());
} }
} }
}
// } // }
} }

@ -57,7 +57,7 @@
left join user_company uc on bur.companyIdFk = uc.id left join user_company uc on bur.companyIdFk = uc.id
<where> <where>
<if test="companyIdFk != '' and companyIdFk != null"> <if test="companyIdFk != '' and companyIdFk != null">
AND companyIdFk=#{companyIdFk} AND companyIdFk = #{companyIdFk}
</if> </if>
<if test="ylqxzcrbarmc != '' and ylqxzcrbarmc != null"> <if test="ylqxzcrbarmc != '' and ylqxzcrbarmc != null">
AND ylqxzcrbarmc LIKE concat('%', #{ylqxzcrbarmc}, '%') AND ylqxzcrbarmc LIKE concat('%', #{ylqxzcrbarmc}, '%')
@ -93,11 +93,21 @@
<if test="unionCode != '' and unionCode != null"> <if test="unionCode != '' and unionCode != null">
AND nameCode LIKE concat(#{unionCode}, '%') AND nameCode LIKE concat(#{unionCode}, '%')
</if> </if>
<if test="nameCode != '' and nameCode != null">
AND nameCode = #{nameCode}
</if>
<if test="unionFilterStr != '' and unionFilterStr != null"> <if test="unionFilterStr != '' and unionFilterStr != null">
or p.cpmctymc LIKE concat('%', #{unionFilterStr}, '%') or p.cpmctymc LIKE concat('%', #{unionFilterStr}
or p.ylqxzcrbarmc LIKE concat('%', #{unionFilterStr}, '%') , '%')
or p.ggxh LIKE concat('%', #{unionFilterStr}, '%') or p.ylqxzcrbarmc LIKE concat('%'
or p.zczbhhzbapzbh LIKE concat('%', #{unionFilterStr}, '%') , #{unionFilterStr}
, '%')
or p.ggxh LIKE concat('%'
, #{unionFilterStr}
, '%')
or p.zczbhhzbapzbh LIKE concat('%'
, #{unionFilterStr}
, '%')
</if> </if>
<if test="unionCode != '' and unionCode != null"> <if test="unionCode != '' and unionCode != null">
AND nameCode = #{unionCode} AND nameCode = #{unionCode}
@ -108,60 +118,62 @@
<select id="filterBasicList" parameterType="com.glxp.api.req.basic.FilterUdiRelRequest" <select id="filterBasicList" parameterType="com.glxp.api.req.basic.FilterUdiRelRequest"
resultType="com.glxp.api.res.basic.BasicUdiRelResponse"> resultType="com.glxp.api.res.basic.BasicUdiRelResponse">
select bur.*,sm.*,sc.*, select bur.*,
uc.companyName, sm.*,
nameCode, sc.*,
packRatio, uc.companyName,
packLevel, nameCode,
bhxjsl, packRatio,
bhzxxsbzsl, packLevel,
zxxsbzbhsydysl, bhxjsl,
bhxjcpbm, bhzxxsbzsl,
sjcpbm, zxxsbzbhsydysl,
bzcj, bhxjcpbm,
thirdProductNo, sjcpbm,
thirdProductName, bzcj,
addType, thirdProductNo,
deviceRecordKey, thirdProductName,
isUseDy, addType,
cpmctymc, deviceRecordKey,
cplb, isUseDy,
flbm, cpmctymc,
ggxh, cplb,
qxlb, flbm,
tyshxydm, ggxh,
ylqxzcrbarmc, qxlb,
zczbhhzbapzbh, tyshxydm,
ylqxzcrbarywmc, ylqxzcrbarmc,
sydycpbs, zczbhhzbapzbh,
versionNumber, ylqxzcrbarywmc,
diType, sydycpbs,
scbssfbhph, versionNumber,
scbssfbhxlh, diType,
scbssfbhscrq, scbssfbhph,
scbssfbhsxrq, scbssfbhxlh,
ybbm, scbssfbhscrq,
spmc, scbssfbhsxrq,
cphhhbh, ybbm,
cpms, spmc,
cpbsbmtxmc, cphhhbh,
cplx, cpms,
hchzsb, cpbsbmtxmc,
sfwblztlcp, cplx,
cgzmraqxgxx, hchzsb,
sfbjwycxsy, sfwblztlcp,
zdcfsycs, cgzmraqxgxx,
sfwwjbz, sfbjwycxsy,
syqsfxyjxmj, zdcfsycs,
qtxxdwzlj, sfwwjbz,
mjfs, syqsfxyjxmj,
p.measname, qtxxdwzlj,
p.manufactory mjfs,
p.measname,
p.manufactory
FROM basic_udi_rel bur FROM basic_udi_rel bur
left JOIN basic_udi_product p on bur.uuid = p.uuid left JOIN basic_udi_product p on bur.uuid = p.uuid
left join user_company uc on bur.companyIdFk = uc.id left join user_company uc on bur.companyIdFk = uc.id
left join sup_manufacturer sm on uc.id=sm.manufacturerId left join sup_manufacturer sm on uc.id = sm.manufacturerId
left join sup_company sc on sm.customerId=sc.customerId left join sup_company sc on sm.customerId = sc.customerId
<where> <where>
<if test="companyIdFk != '' and companyIdFk != null"> <if test="companyIdFk != '' and companyIdFk != null">
AND bur.companyIdFk = #{companyIdFk} AND bur.companyIdFk = #{companyIdFk}
@ -175,50 +187,66 @@
<select id="filterCompanyList" parameterType="com.glxp.api.req.basic.FilterUdiRelRequest" <select id="filterCompanyList" parameterType="com.glxp.api.req.basic.FilterUdiRelRequest"
resultType="com.glxp.api.res.basic.BasicUdiRelResponse"> resultType="com.glxp.api.res.basic.BasicUdiRelResponse">
SELECT sup_manufacturer.* ,user_company.companyName as supName SELECT sup_manufacturer.*,
<if test="productStatus!=null"> user_company.companyName as supName
,(SELECT count(*) FROM sup_product WHERE sup_manufacturer.customerId=sup_product.customerId AND sup_product.auditStatus!=0 AND sup_product.auditStatus!=1 AND sup_product.auditStatus!=4 AND sup_manufacturer.manufacturerId=sup_product.manufacturerIdFk ) as failCout, <if test="productStatus != null">
(SELECT count(*) FROM sup_product WHERE sup_manufacturer.customerId=sup_product.customerId AND (sup_product.auditStatus=1 OR sup_product.auditStatus=4) AND sup_manufacturer.manufacturerId=sup_product.manufacturerIdFk ) as passCout ,
(SELECT count(*)
FROM sup_product
WHERE sup_manufacturer.customerId = sup_product.customerId
AND sup_product.auditStatus != 0
AND sup_product.auditStatus != 1
AND sup_product.auditStatus != 4
AND sup_manufacturer.manufacturerId = sup_product.manufacturerIdFk) as failCout,
(SELECT count(*)
FROM sup_product
WHERE sup_manufacturer.customerId = sup_product.customerId
AND (sup_product.auditStatus = 1 OR sup_product.auditStatus = 4)
AND sup_manufacturer.manufacturerId = sup_product.manufacturerIdFk) as passCout
</if> </if>
FROM sup_manufacturer FROM sup_manufacturer
inner join user_company on sup_manufacturer.customerId = user_company.customerId inner join user_company on sup_manufacturer.customerId = user_company.customerId
<where> <where>
<if test="id != null and id != '' and type==null"> <if test="id != null and id != '' and type == null">
and id = #{id} and id = #{id}
</if> </if>
<if test="manufacturerId != null and manufacturerId != ''"> <if test="manufacturerId != null and manufacturerId != ''">
and manufacturerId = #{manufacturerId} and manufacturerId = #{manufacturerId}
</if> </if>
<if test="companyName != null and companyName != ''"> <if test="companyName != null and companyName != ''">
and sup_manufacturer.companyName like concat('%',#{companyName},'%') and sup_manufacturer.companyName like concat('%', #{companyName}, '%')
</if> </if>
<if test="creditCode != null and creditCode != ''"> <if test="creditCode != null and creditCode != ''">
and creditCode like concat('%',#{creditCode},'%') and creditCode like concat('%', #{creditCode}, '%')
</if> </if>
<if test="placeArea != null and placeArea != ''"> <if test="placeArea != null and placeArea != ''">
and placeArea like concat('%',#{placeArea},'%') and placeArea like concat('%', #{placeArea}, '%')
</if> </if>
<if test="customerId != null and customerId != ''"> <if test="customerId != null and customerId != ''">
and sup_manufacturer.customerId = #{customerId} and sup_manufacturer.customerId = #{customerId}
</if> </if>
<if test="auditStatus != null and auditStatus !=20 and auditStatus !=21 and auditStatus !=22"> <if test="auditStatus != null and auditStatus != 20 and auditStatus != 21 and auditStatus != 22">
and sup_manufacturer.auditStatus = #{auditStatus} and sup_manufacturer.auditStatus = #{auditStatus}
</if> </if>
<if test="auditStatus ==20"> <if test="auditStatus == 20">
and (sup_manufacturer.auditStatus = 0 or sup_manufacturer.auditStatus=5 or and (sup_manufacturer.auditStatus = 0 or sup_manufacturer.auditStatus = 5 or
sup_manufacturer.auditStatus=2) sup_manufacturer.auditStatus = 2)
</if> </if>
<if test="auditStatus ==21"> <if test="auditStatus == 21">
and <![CDATA[ sup_manufacturer.auditStatus <> 0 ]]> and <![CDATA[ sup_manufacturer.auditStatus <> 0
]]>
</if> </if>
<if test="auditStatus ==22"> <if test="auditStatus == 22">
and (sup_manufacturer.auditStatus = 1 or sup_manufacturer.auditStatus=4 ) and (sup_manufacturer.auditStatus = 1 or sup_manufacturer.auditStatus = 4)
</if> </if>
<if test="lastUpdateTime!=null and lastUpdateTime!=''"> <if test="lastUpdateTime != null and lastUpdateTime != ''">
<![CDATA[ and DATE_FORMAT(sup_manufacturer.updateTime, '%Y-%m-%d %H:%i:%S')>= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S') ]]> <![CDATA[
and DATE_FORMAT(sup_manufacturer.updateTime, '%Y-%m-%d %H:%i:%S') >=
DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if> </if>
<if test="type != null"> <if test="type != null">
and id != #{id} and id != #{id}

Loading…
Cancel
Save