demand: TMS系统 - 客户管理 - 现金客户额度 - 超期已用额度 与运单明细单号运费不一致;

committer: heyu
This commit is contained in:
aike 2025-06-23 14:07:08 +08:00
parent 99c8bbbda3
commit 659179197a
5 changed files with 38 additions and 17 deletions

View File

@ -456,6 +456,8 @@ public class WaybillOrder implements Serializable {
voItem.setDeclareGoodsList(declareGoodsCvt.cvtToVoList(dbDecareGoodsList));
voItem.setDeclareAttachmentList(declareAttachmentCvt.cvtToVoList(dbDeclareAttachmentList));
voItem.setStartSiteCode(dbWaybill.getStartSiteCode());
voItem.setStartSiteName(dbWaybill.getStartSiteName());
// 收件人
Reciever reciever = new Reciever();

View File

@ -4781,11 +4781,11 @@ public class EmisBaseService {
}
}
public void handleVirtual(EmisWaybill emisWaybillSave) throws EmisBizError {
public void handleVirtual(EmisWaybill emisWaybillSave,EmisWaybill emisWaybillOld) throws EmisBizError {
if (!"1".equals(emisWaybillSave.getBlVirtual())) {
return;
}
updateMasterWaybill(emisWaybillSave);
updateMasterWaybill(emisWaybillSave,emisWaybillOld);
// 做问题件录入
scanProblemInfo(emisWaybillSave);
}
@ -4819,8 +4819,8 @@ public class EmisBaseService {
emisTmsScanRecordService.scan(scanInfoProm, dispatchOrSendManCode, emisWaybillSave.getSendSiteCode());
}
public void updateMasterWaybill(EmisWaybill emisWaybillSave) throws EmisBizError {
EmisWaybill masterWaybill = checkVirtualParam(emisWaybillSave);
public void updateMasterWaybill(EmisWaybill emisWaybillSave,EmisWaybill emisWaybillOld) throws EmisBizError {
EmisWaybill masterWaybill = checkVirtualParam(emisWaybillSave, emisWaybillOld);
String virtualRemark = masterWaybill.getVirtualRemark();
String virtualBillCode = emisWaybillSave.getBillCode();
String virtualBillCodeLastSix = virtualBillCode.substring(virtualBillCode.length() - 6);
@ -4839,7 +4839,7 @@ public class EmisBaseService {
emisWaybillMapper.updateEmisWaybill(emisWaybill);
}
public EmisWaybill checkVirtualParam(EmisWaybill emisWaybillSave) throws EmisBizError {
public EmisWaybill checkVirtualParam(EmisWaybill emisWaybillSave, EmisWaybill emisWaybillOld) throws EmisBizError {
if (StringUtil.isBlank(emisWaybillSave.getMasterBillCode())) {
throw new EmisBizError(EmisBizErrorType.FAIL, "主单号不能为空");
}
@ -4858,6 +4858,11 @@ public class EmisBaseService {
if ("1".equals(masterWaybill.getBlVirtual())) {
throw new EmisBizError(EmisBizErrorType.FAIL, "虚拟单不能作为主单");
}
if (emisWaybillOld == null || !"1".equals(emisWaybillOld.getBlVirtual())) {
if (masterWaybill.getVirtualRemark().split(",").length >= masterWaybill.getParcelQty()) {
throw new EmisBizError(EmisBizErrorType.FAIL, emisWaybillSave.getMasterBillCode() + "最多只能绑定" + masterWaybill.getParcelQty() + "个虚拟单");
}
}
List<EmisTmsSiteBatch> batchList = emisTmsSiteBatchMapper.selectEmisTmsSiteBatchListByBillCodes(
Lists.newArrayList(Collections.singleton(emisWaybillSave.getMasterBillCode())));
@ -4869,7 +4874,7 @@ public class EmisBaseService {
public void handleVirtualForUpdate(EmisWaybill emisWaybillSave, EmisWaybill emisWaybillOld) throws EmisBizError {
if (!StringUtils.isEmpty(emisWaybillSave.getBlVirtual()) && "1".equals(emisWaybillSave.getBlVirtual())) {
handleVirtual(emisWaybillSave);
handleVirtual(emisWaybillSave,emisWaybillOld);
} else {
String masterBillCode = emisWaybillOld.getMasterBillCode();
if (StringUtil.isNotBlank(masterBillCode)) {

View File

@ -141,7 +141,9 @@ public class EmisWaybillAjustApplyServiceImpl extends EmisBaseService implements
}
// 校验虚拟单逻辑
checkVirtualParam(getEmisWaybillNewFromJson(emisWaybillAjustApply));
if ("1".equals(getEmisWaybillNewFromJson(emisWaybillAjustApply).getBlVirtual())) {
checkVirtualParam(getEmisWaybillNewFromJson(emisWaybillAjustApply),emisWaybillOld);
}
// 插入数据
emisWaybillAjustApplyMapper.insertEmisWaybillAjustApply(emisWaybillAjustApply);

View File

@ -3128,7 +3128,7 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
// 虚拟件逻辑
if ("1".equals(emisWaybillSave.getBlVirtual())) {
updateMasterWaybill(emisWaybillSave);
updateMasterWaybill(emisWaybillSave,null);
}
//插入新单

View File

@ -392,7 +392,7 @@
<!-- 单个对象可以返回子单数据 -->
<sql id="selectEmisWaybillDetailVo">
select
a.id,a.order_sn, a.cust_order_id, a.bill_code,a.bill_code_sub, a.order_status, a.waybill_status,a.bl_virtual,a.master_bill_code,a.virtual_remark,
a.id,a.order_sn, a.cust_order_id, a.bill_code,a.bill_code_sub, a.order_status, a.waybill_status,a.bl_virtual,a.master_bill_code,a.virtual_remark,a.start_site_code,
a.order_type, a.order_date, a.user_id, a.customer_code, a.customer_name, a.open_id, a.receive_name,
a.receive_company, a.receive_mobile, a.receive_tel, a.receive_country, a.receive_province, a.receive_city,
a.receive_county, a.receive_town, a.receive_address, a.receive_postcode, a.receive_pcd, a.send_name, a.send_company,
@ -445,6 +445,7 @@
x.site_name as next_site_name,
y.site_name as last_site_name,
z.type_name as problem_type_name,
start.site_name as start_site_name,
k.trans_type as trans_type
@ -485,6 +486,7 @@
left join emis_customer_user a3 on a.customer_code=a3.customer_code and a3.del_flag='0'
left join emis_site seaway1 on a.departure_port=seaway1.site_code and seaway1.del_flag='0'
left join emis_site seaway2 on a.destination_port=seaway2.site_code and seaway2.del_flag='0'
left join emis_site start on a.start_site_code=start.site_code and start.del_flag='0'
</sql>
@ -568,17 +570,27 @@
<select id="selectMasterEmisWaybills" parameterType="EmisWaybill" resultMap="EmisWaybillResult">
<include refid="selectEmisWaybillVo"/>
where a.del_flag = '0'
and a.send_date >= date_sub(curdate(), interval 3 day)
and a.trans_line_type = #{transLineType}
-- and a.send_date >= date_sub(curdate(), interval 3 day)
<if test="transLineType != null and transLineType != ''">
and a.trans_line_type = #{transLineType}
</if>
<if test="productType != null and productType != ''">
and a.product_type=#{productType}
</if>
<if test="sendSiteCode != null and sendSiteCode != ''">
and a.send_site_code=#{sendSiteCode}
</if>
and (a.bl_virtual is null or a.bl_virtual != '1')
<if test="billCode != null and billCode != ''">
and a.bill_code like concat('%', #{billCode}, '%')
</if>
<if test="params.privSiteCode != null and params.privSiteCode != '88888'">
and (
a.send_site_code=#{params.privSiteCode}
)
</if>
<!-- <if test="params.privSiteCode != null and params.privSiteCode != '88888'">-->
<!-- and (-->
<!-- a.send_site_code=#{params.privSiteCode}-->
<!-- or a.dispatch_underling_site_code=#{params.privSiteCode}-->
<!-- )-->
<!-- </if>-->
limit 10
</select>
<select id="selectWaitGotOrderList" parameterType="EmisWaybill" resultMap="EmisWaybillResult">
@ -1169,7 +1181,7 @@
<if test="sendCity != null and sendCity != ''"> and send_city=#{sendCity}</if>
<if test="sendCounty != null and sendCounty != ''"> and send_county=#{sendCounty}</if>
<if test="sendTown != null and sendTown != ''"> and send_town=#{sendTown}</if>
<if test="blVirtual != null and blVirtual != ''"> and bl_virtual=#{blVirtual}</if>
<if test="blVirtual ==1"> and bl_virtual=#{blVirtual}</if>
<if test="sendAddress != null and sendAddress != ''"> and send_address like concat('%', #{sendAddress}, '%')</if>
<if test="sendPostcode != null and sendPostcode != ''"> and send_postcode like concat('%', #{sendPostcode}, '%')</if>
<if test="paymentType != null and paymentType != ''"> and FIND_IN_SET(payment_type,#{paymentType})</if>