Merge pull request 'demand: 扫描漏组批次过滤面单删除的,扫描一周以前的。漏组批次从表格复制查询优化' (#88) from develop into master

Reviewed-on: http://git.xdadan.loc/tanex/emis-service/pulls/88
This commit is contained in:
heyu 2025-07-03 14:25:38 +08:00
commit 873677b59b
3 changed files with 36 additions and 8 deletions

View File

@ -10,7 +10,10 @@ import cn.hutool.core.collection.CollectionUtil;
import com.xdadan.erp.emis.domain.*;
import com.xdadan.erp.emis.mapper.*;
import com.xdadan.erp.emis.service.EmisBaseService;
import com.xdadan.erp.emis.utils.WaybillHelper;
import jodd.util.StringUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
@ -67,7 +70,19 @@ public class EmisTmsSiteBatchMissServiceImpl extends EmisBaseService implements
@Override
public List<EmisTmsSiteBatchMiss> selectEmisTmsSiteBatchMissList(EmisTmsSiteBatchMiss emisTmsSiteBatchMiss) {
log.info("Selecting TMS site batch miss list with params: {}", emisTmsSiteBatchMiss);
return emisTmsSiteBatchMissMapper.selectEmisTmsSiteBatchMissList(emisTmsSiteBatchMiss);
List<EmisTmsSiteBatchMiss> list = null;
// 如果单号不为空,则去除其他参数
if(!StringUtils.isEmpty(emisTmsSiteBatchMiss.getBillCode())){
emisTmsSiteBatchMiss.setBillCode(WaybillHelper.formatQueryValue(emisTmsSiteBatchMiss.getBillCode()));
String[] billCodeSortList = emisTmsSiteBatchMiss.getBillCode().split(",");
if(billCodeSortList.length>1){
emisTmsSiteBatchMiss.getParams().put("billCodeSortList",Arrays.asList(billCodeSortList));
}
list = emisTmsSiteBatchMissMapper.selectEmisTmsSiteBatchMissList(emisTmsSiteBatchMiss);
}else{
list = emisTmsSiteBatchMissMapper.selectEmisTmsSiteBatchMissList(emisTmsSiteBatchMiss);
}
return list;
}
/**

View File

@ -164,8 +164,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join emis_country c2 on w.receive_country=c2.code and c2.del_flag=0
<where>
b.site_batch_status = '1'
<if test="billCode != null and billCode != ''">
AND w.bill_code REGEXP REPLACE(#{billCode}, '\n', '|')
<if test="billCode != null and billCode != '' and ( params.billCodeSortList == null or (params.billCodeSortList != null and params.billCodeSortList.size() == 1 ) )">
and ( b.`bill_code`=#{billCode} or b.bill_code like concat('%',#{billCode}) )
</if>
<if test="params.billCodeSortList != null and params.billCodeSortList.size() > 1 ">
and b.bill_code in
<foreach collection="params.billCodeSortList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="lineCode != null and lineCode != ''">
AND w.trans_line_type = #{lineCode}
@ -225,8 +231,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</when>
</choose>
</if>
<if test="billCode != null and billCode != ''">
AND m.bill_code REGEXP REPLACE(#{billCode}, '\n', '|')
<if test="billCode != null and billCode != '' and ( params.billCodeSortList == null or (params.billCodeSortList != null and params.billCodeSortList.size() == 1 ) )">
and ( m.`bill_code`=#{billCode} or m.bill_code like concat('%',#{billCode}) )
</if>
<if test="params.billCodeSortList != null and params.billCodeSortList.size() > 1 ">
and m.bill_code in
<foreach collection="params.billCodeSortList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="missReason != null and missReason != ''">
AND m.miss_reason like concat('%', #{missReason}, '%')

View File

@ -3808,14 +3808,15 @@
select a.id, a.bill_code,a.trans_line_type, a.product_type,a.start_site_code,a.send_site_code
from emis_waybill a
left join emis_waybill_batch_status b on a.bill_code = b.bill_code
where a.bl_sign = '1'
and a.del_flag = '0'
where a.del_flag = '0'
and (b.site_batch_status is null or b.site_batch_status != '1')
<if test="lineCode != null and lineCode != ''">
and a.trans_line_type = #{lineCode}
</if>
and a.send_date <![CDATA[ > ]]> '2025-01-01 00:00:00'
and (a.virtual_remark is null or virtual_remark = '')
and a.send_date <![CDATA[ <= ]]> DATE_SUB(CURDATE(), INTERVAL 7 DAY)
and (a.virtual_remark is null or virtual_remark = '' or virtual_remark = ' ')
and (a.problem_type is null or a.problem_type != 151)
order by a.create_time desc
limit #{offset}, #{pageSize}
</select>