Merge pull request 'develop' (#149) from develop into master

Reviewed-on: http://git.xdadan.loc/tanex/emis-service/pulls/149
This commit is contained in:
heyu 2025-08-08 15:40:58 +08:00
commit f6df240b3a
2 changed files with 22 additions and 6 deletions

View File

@ -484,11 +484,16 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
public int draftSubmitOrder(EmisWaybill emisWaybillSave) throws EmisBizError {
// 如果没有单号就生成单号,如果有单号需要判断是否重复
if( !StringUtils.isEmpty(emisWaybillSave.getBillCode()) ) {
if (!StringUtils.isEmpty(emisWaybillSave.getBillCode())) {
String billCode=WaybillHelper.formatQueryValue(emisWaybillSave.getBillCode());
String billCode = WaybillHelper.formatQueryValue(emisWaybillSave.getBillCode());
emisWaybillSave.setBillCode(billCode);
// 校验运单号不能包含特殊字符
if (billCode.matches(".*[^a-zA-Z0-9\\-].*")) {
throw new EmisBizError(EmisBizErrorType.PARAM_ERROR1, "运单号不能包含特殊字符");
}
boolean isExists = this.checkWaybillIsExists(emisWaybillSave.getBillCode());
if (isExists) {
throw new EmisBizError(EmisBizErrorType.EXISTS, "运单号重复");

View File

@ -546,11 +546,21 @@
b.trans_weight, b.pack_num, b.total_waybill_qty, b.total_settlement_weight,
b.op_man, b.remark, b.tenant_id, b.del_flag, b.create_by, b.create_time,
b.update_by, b.update_time, b.create_site, b.update_site, b.bl_entering,
COALESCE(SUM(d.batch_volume), 0) as total_volume,
COALESCE(SUM(d.batch_parcel_qty), 0) as total_parcel_qty,
COALESCE(SUM(d.batch_weight), 0) as total_weight
CASE
WHEN COALESCE(SUM(d.batch_volume), 0) = 0 THEN COALESCE(w.total_volume, 0)
ELSE COALESCE(SUM(d.batch_volume), 0)
END as total_volume,
CASE
WHEN COALESCE(SUM(d.batch_parcel_qty), 0) = 0 THEN COALESCE(w.parcel_qty, 0)
ELSE COALESCE(SUM(d.batch_parcel_qty), 0)
END as total_parcel_qty,
CASE
WHEN COALESCE(SUM(d.batch_weight), 0) = 0 THEN COALESCE(w.bill_weight, 0)
ELSE COALESCE(SUM(d.batch_weight), 0)
END as total_weight
from emis_tms_site_batch b
inner join emis_tms_site_batch_dtl d on b.batch_no = d.batch_no
left join emis_waybill w on d.bill_code = w.bill_code and w.del_flag = '0'
where b.start_site_code = #{startSiteCode}
and b.next_site_code = #{nextSiteCode}
and d.bill_code = #{billCode}
@ -563,6 +573,7 @@
b.clearance_res_status, b.declare_res_status, b.dest_country, b.dest_country_name,
b.trans_weight, b.pack_num, b.total_waybill_qty, b.total_settlement_weight,
b.op_man, b.remark, b.tenant_id, b.del_flag, b.create_by, b.create_time,
b.update_by, b.update_time, b.create_site, b.update_site, b.bl_entering
b.update_by, b.update_time, b.create_site, b.update_site, b.bl_entering,
w.total_volume, w.parcel_qty, w.total_weight
</select>
</mapper>