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

committer: heyu
This commit is contained in:
aike 2025-06-23 15:20:22 +08:00
parent 659179197a
commit 9a9aa336e6
3 changed files with 61 additions and 51 deletions

View File

@ -4843,7 +4843,8 @@ public class EmisBaseService {
if (StringUtil.isBlank(emisWaybillSave.getMasterBillCode())) {
throw new EmisBizError(EmisBizErrorType.FAIL, "主单号不能为空");
}
if (!"002".equals(emisWaybillSave.getTransLineType()) && !"012".equals(emisWaybillSave.getTransLineType()) && !"014".equals(emisWaybillSave.getTransLineType())) {
if (!"002".equals(emisWaybillSave.getTransLineType()) && !"012".equals(emisWaybillSave.getTransLineType())
&& !"014".equals(emisWaybillSave.getTransLineType())) {
throw new EmisBizError(EmisBizErrorType.FAIL, "虚拟单只支持线路为缅甸快递/缅甸快递进口/柬埔寨快递进口");
}
EmisWaybill masterWaybill = emisWaybillMapper
@ -4852,15 +4853,21 @@ public class EmisBaseService {
throw new EmisBizError(EmisBizErrorType.FAIL, "主单号不存在");
}
if (!emisWaybillSave.getReceiveCountry().equals(masterWaybill.getReceiveCountry())
|| !emisWaybillSave.getTransLineType().equals(masterWaybill.getTransLineType()) || !emisWaybillSave.getProductType().equals(masterWaybill.getProductType())) {
|| !emisWaybillSave.getTransLineType().equals(masterWaybill.getTransLineType())
|| !emisWaybillSave.getProductType().equals(masterWaybill.getProductType())) {
throw new EmisBizError(EmisBizErrorType.FAIL, "主单和虚拟单线路不一致");
}
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() + "个虚拟单");
if (!emisWaybillSave.getMasterBillCode().equals(emisWaybillOld.getMasterBillCode())) {
String virtualRemark = masterWaybill.getVirtualRemark() == null ? "" : masterWaybill.getVirtualRemark();
long count = Arrays.stream(virtualRemark.split(","))
.filter(s -> s != null && !s.trim().isEmpty())
.count();
if (count >= masterWaybill.getParcelQty()) {
throw new EmisBizError(EmisBizErrorType.FAIL,
emisWaybillSave.getMasterBillCode() + "最多只能绑定" + masterWaybill.getParcelQty() + "个虚拟单");
}
}
@ -4878,10 +4885,12 @@ public class EmisBaseService {
} else {
String masterBillCode = emisWaybillOld.getMasterBillCode();
if (StringUtil.isNotBlank(masterBillCode)) {
String virtualBillCodeLastSix = emisWaybillSave.getBillCode().substring(emisWaybillSave.getBillCode().length() - 6);
String virtualBillCodeLastSix = emisWaybillSave.getBillCode()
.substring(emisWaybillSave.getBillCode().length() - 6);
EmisWaybill masterWaybill = emisWaybillMapper
.selectEmisWaybillByBillCode(masterBillCode);
List<String> filterVirtualRemark = Arrays.stream(masterWaybill.getVirtualRemark().split(",")).filter(i -> !i.equals(virtualBillCodeLastSix)).collect(Collectors.toList());
List<String> filterVirtualRemark = Arrays.stream(masterWaybill.getVirtualRemark().split(","))
.filter(i -> !i.equals(virtualBillCodeLastSix)).collect(Collectors.toList());
String virtualRemark = String.join(",", filterVirtualRemark);
masterWaybill.setVirtualRemark(virtualRemark);
emisWaybillMapper.updateEmisWaybill(masterWaybill);

View File

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

View File

@ -590,6 +590,7 @@
<!-- or a.dispatch_underling_site_code=#{params.privSiteCode}-->
<!-- )-->
<!-- </if>-->
order by a.send_date desc
limit 10
</select>