demand: TMS-运输管理-漏组批次扫描-针对分批组批次判断不准确问题修复 运单总运费计算支持选择多个产品类型

committer: heyu
This commit is contained in:
aike 2025-08-20 16:22:34 +08:00
parent 384fc6565e
commit ed9a360929
3 changed files with 34 additions and 20 deletions

View File

@ -4651,6 +4651,7 @@ public class EmisBaseService {
// 合并相同起始网点和下一网点的批次
Map<String, EmisTmsSiteBatch> mergedBatches = new HashMap<>();
int status2Index = 0;
for (EmisTmsSiteBatch batch : waybillBatches) {
if (StringUtils.isAnyBlank(batch.getStartSiteCode(), batch.getNextSiteCode(),
batch.getSupplierCode())) {
@ -4668,8 +4669,18 @@ public class EmisBaseService {
}
}
// 如果有waybillBatchStatus=2的记录,跳过合并
// 如果有waybillBatchStatus=2的记录,不合并supplierCode,但添加到mergedBatches
if (hasWaybillBatchStatus2) {
String specialKey = batch.getStartSiteCode() + "_" + batch.getNextSiteCode() + "_S2_"
+ (status2Index++);
EmisTmsSiteBatch newBatch = new EmisTmsSiteBatch();
BeanUtils.copyProperties(batch, newBatch);
Set<String> supplierSet = new TreeSet<>();
if (StringUtils.isNotBlank(batch.getSupplierCode())) {
supplierSet.addAll(Arrays.asList(batch.getSupplierCode().split(",")));
}
newBatch.setSupplierCode(String.join(",", supplierSet));
mergedBatches.put(specialKey, newBatch);
continue;
}

View File

@ -64,6 +64,7 @@
<collection property="batchDtlList" ofType="com.xdadan.erp.emis.domain.EmisTmsSiteBatchDtl">
<result property="billCode" column="bill_code"/>
<result property="waybillBatchStatus" column="waybill_batch_status"/>
</collection>
</resultMap>
@ -527,7 +528,8 @@
<!-- 根据运单号列表查询组批次信息 -->
<select id="selectEmisTmsSiteBatchListByBillCodes" resultMap="EmisTransPlanRuleSimpleResult">
select distinct b.id, b.batch_no, b.supplier_code, b.trans_line_type, b.product_type, b.trans_type, b.start_site_code, b.next_site_code, b.etd, d.bill_code
select distinct b.id, b.batch_no, b.supplier_code, b.trans_line_type, b.product_type, b.trans_type,
b.start_site_code, b.next_site_code, b.etd, d.bill_code,d.waybill_batch_status
from emis_tms_site_batch b
inner join emis_tms_site_batch_dtl d on b.batch_no = d.batch_no
where d.bill_code in

View File

@ -2073,7 +2073,7 @@
<if test="custNo != null and custNo != ''"> and cust_no like concat('%', #{custNo}, '%')</if>
<if test="custName != null and custName != ''"> and cust_name like concat('%', #{custName}, '%')</if>
<if test="transLineType != null and transLineType != ''"> and trans_line_type=#{transLineType}</if>
<if test="productType != null and productType != ''"> and product_type=#{productType}</if>
<if test="productType != null and productType != ''"> and FIND_IN_SET(product_type,#{productType})</if>
<if test="timeType != null and timeType != ''"> and time_type like concat('%', #{timeType}, '%')</if>
<if test="meterType != null and meterType != ''"> and meter_type like concat('%', #{meterType}, '%')</if>
<if test="carryType != null and carryType != ''"> and FIND_IN_SET(a.carry_type,#{carryType}) </if>
@ -3851,6 +3851,7 @@
and ((a.virtual_remark is null or a.virtual_remark = '' or a.virtual_remark = ' ')or a.receive_country !=
'0095')
and a.order_status not in ('0','2')
and a.bill_code='T7080300154556'
and not exists (
select 1 from emis_waybill_batch_status b where a.bill_code = b.bill_code and b.site_batch_status = '1' and b.del_flag = '0'
)