This commit is contained in:
linfso 2025-07-07 09:40:38 +08:00
commit 6998a2ee54
2 changed files with 31 additions and 15 deletions

View File

@ -4140,19 +4140,29 @@ public class EmisBaseService {
List<EmisTransPlanRule> toAdd = new ArrayList<>(); List<EmisTransPlanRule> toAdd = new ArrayList<>();
for (EmisTransPlanRule node : topLevelNodes) { for (EmisTransPlanRule node : topLevelNodes) {
// 柯桥市场部 //南京市场部
if ("25001".equals(node.getStartSiteCode())) { if ("25001".equals(node.getStartSiteCode())) {
List<EmisTransPlanRule> filterRules = allRules.stream().filter(i -> "25000".equals(i.getStartSiteCode())).collect(Collectors.toList());
EmisTransPlanRule copyRule = new EmisTransPlanRule(); EmisTransPlanRule copyRule = new EmisTransPlanRule();
BeanUtils.copyProperties(node, copyRule); BeanUtils.copyProperties(node, copyRule);
copyRule.setStartSiteCode("25000"); copyRule.setStartSiteCode("25000");
copyRule.setStartSiteName("南京分拨中心");
if(CollectionUtil.isNotEmpty(filterRules)){
copyRule.setManager(filterRules.get(0).getManager());
}
toAdd.add(copyRule); toAdd.add(copyRule);
continue; continue;
} }
// 南京市场部 // 柯桥市场部
if ("57502".equals(node.getStartSiteCode())) { if ("57502".equals(node.getStartSiteCode())) {
List<EmisTransPlanRule> filterRules = allRules.stream().filter(i -> "57501".equals(i.getStartSiteCode())).collect(Collectors.toList());
EmisTransPlanRule copyRule = new EmisTransPlanRule(); EmisTransPlanRule copyRule = new EmisTransPlanRule();
BeanUtils.copyProperties(node, copyRule); BeanUtils.copyProperties(node, copyRule);
copyRule.setStartSiteCode("57501"); copyRule.setStartSiteCode("57501");
copyRule.setStartSiteName("柯桥分拨中心");
if(CollectionUtil.isNotEmpty(filterRules)){
copyRule.setManager(filterRules.get(0).getManager());
}
toAdd.add(copyRule); toAdd.add(copyRule);
} }
} }
@ -5119,6 +5129,9 @@ public class EmisBaseService {
emisWaybill.setVirtualRemark(virtualRemark); emisWaybill.setVirtualRemark(virtualRemark);
emisWaybill.setId(masterWaybill.getId()); emisWaybill.setId(masterWaybill.getId());
emisWaybillMapper.updateEmisWaybill(emisWaybill); emisWaybillMapper.updateEmisWaybill(emisWaybill);
if(StringUtil.isNotBlank(emisWaybillOld.getMasterBillCode())){
updateOldMasterBill(emisWaybillSave,emisWaybillOld.getMasterBillCode());
}
} }
public EmisWaybill checkVirtualParam(EmisWaybill emisWaybillSave, EmisWaybill emisWaybillOld) throws EmisBizError { public EmisWaybill checkVirtualParam(EmisWaybill emisWaybillSave, EmisWaybill emisWaybillOld) throws EmisBizError {
@ -5181,6 +5194,17 @@ public class EmisBaseService {
String masterBillCode = emisWaybillOld.getMasterBillCode(); String masterBillCode = emisWaybillOld.getMasterBillCode();
if (StringUtil.isNotBlank(masterBillCode)) { if (StringUtil.isNotBlank(masterBillCode)) {
emisWaybillSave.setMasterBillCode(" "); emisWaybillSave.setMasterBillCode(" ");
updateOldMasterBill(emisWaybillSave, masterBillCode);
if (!"078".equals(emisWaybillSave.getTransLineType())) {
emisWaybillProblemInfoService.deleteEmisWaybillProblemInfoByBillCode(emisWaybillSave.getBillCode());
}
// 重新计算提成
emisCommissionProfitService.reCalcProfitByBillCode(emisWaybillSave.getBillCode());
}
}
}
private void updateOldMasterBill(EmisWaybill emisWaybillSave, String masterBillCode) {
String virtualBillCode = emisWaybillSave.getBillCode(); String virtualBillCode = emisWaybillSave.getBillCode();
EmisWaybill masterWaybill = emisWaybillMapper EmisWaybill masterWaybill = emisWaybillMapper
.selectEmisWaybillByBillCode(masterBillCode); .selectEmisWaybillByBillCode(masterBillCode);
@ -5192,13 +5216,6 @@ public class EmisBaseService {
} }
masterWaybill.setVirtualRemark(virtualRemark); masterWaybill.setVirtualRemark(virtualRemark);
emisWaybillMapper.updateEmisWaybill(masterWaybill); emisWaybillMapper.updateEmisWaybill(masterWaybill);
if (!"078".equals(emisWaybillSave.getTransLineType())) {
emisWaybillProblemInfoService.deleteEmisWaybillProblemInfoByBillCode(emisWaybillSave.getBillCode());
}
// 重新计算提成
emisCommissionProfitService.reCalcProfitByBillCode(emisWaybillSave.getBillCode());
}
}
} }
public static void main(String[] args) throws ParseException { public static void main(String[] args) throws ParseException {

View File

@ -183,8 +183,7 @@
and ( disp_area_id=#{dispAreaId} or disp_area_site_code='-1' ) and ( disp_area_id=#{dispAreaId} or disp_area_site_code='-1' )
and ( send_area_id=#{sendAreaId} or send_area_site_code='-1') and ( send_area_id=#{sendAreaId} or send_area_site_code='-1')
and ( and (
( start_date <![CDATA[< ]]> #{startDate} and #{startDate} <![CDATA[<= ]]> end_date ) or ( start_date start_date &lt;= #{endDate} and end_date &gt;= #{startDate}
<![CDATA[< ]]> #{endDate} and #{endDate} <![CDATA[<= ]]> end_date )
) )
</select> </select>