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

Reviewed-on: http://git.xdadan.loc/tanex/emis-service/pulls/96
This commit is contained in:
heyu 2025-07-05 17:19:10 +08:00
commit b9c95f5d0a
2 changed files with 31 additions and 15 deletions

View File

@ -4140,19 +4140,29 @@ public class EmisBaseService {
List<EmisTransPlanRule> toAdd = new ArrayList<>();
for (EmisTransPlanRule node : topLevelNodes) {
// 柯桥市场部
//南京市场部
if ("25001".equals(node.getStartSiteCode())) {
List<EmisTransPlanRule> filterRules = allRules.stream().filter(i -> "25000".equals(i.getStartSiteCode())).collect(Collectors.toList());
EmisTransPlanRule copyRule = new EmisTransPlanRule();
BeanUtils.copyProperties(node, copyRule);
copyRule.setStartSiteCode("25000");
copyRule.setStartSiteName("南京分拨中心");
if(CollectionUtil.isNotEmpty(filterRules)){
copyRule.setManager(filterRules.get(0).getManager());
}
toAdd.add(copyRule);
continue;
}
// 南京市场部
// 柯桥市场部
if ("57502".equals(node.getStartSiteCode())) {
List<EmisTransPlanRule> filterRules = allRules.stream().filter(i -> "57501".equals(i.getStartSiteCode())).collect(Collectors.toList());
EmisTransPlanRule copyRule = new EmisTransPlanRule();
BeanUtils.copyProperties(node, copyRule);
copyRule.setStartSiteCode("57501");
copyRule.setStartSiteName("柯桥分拨中心");
if(CollectionUtil.isNotEmpty(filterRules)){
copyRule.setManager(filterRules.get(0).getManager());
}
toAdd.add(copyRule);
}
}
@ -5119,6 +5129,9 @@ public class EmisBaseService {
emisWaybill.setVirtualRemark(virtualRemark);
emisWaybill.setId(masterWaybill.getId());
emisWaybillMapper.updateEmisWaybill(emisWaybill);
if(StringUtil.isNotBlank(emisWaybillOld.getMasterBillCode())){
updateOldMasterBill(emisWaybillSave,emisWaybillOld.getMasterBillCode());
}
}
public EmisWaybill checkVirtualParam(EmisWaybill emisWaybillSave, EmisWaybill emisWaybillOld) throws EmisBizError {
@ -5181,17 +5194,7 @@ public class EmisBaseService {
String masterBillCode = emisWaybillOld.getMasterBillCode();
if (StringUtil.isNotBlank(masterBillCode)) {
emisWaybillSave.setMasterBillCode(" ");
String virtualBillCode = emisWaybillSave.getBillCode();
EmisWaybill masterWaybill = emisWaybillMapper
.selectEmisWaybillByBillCode(masterBillCode);
List<String> filterVirtualRemark = Arrays.stream(masterWaybill.getVirtualRemark().split(","))
.filter(i -> !i.equals(virtualBillCode)).collect(Collectors.toList());
String virtualRemark = String.join(",", filterVirtualRemark);
if(StringUtil.isBlank(virtualRemark)) {
virtualRemark = " ";
}
masterWaybill.setVirtualRemark(virtualRemark);
emisWaybillMapper.updateEmisWaybill(masterWaybill);
updateOldMasterBill(emisWaybillSave, masterBillCode);
if (!"078".equals(emisWaybillSave.getTransLineType())) {
emisWaybillProblemInfoService.deleteEmisWaybillProblemInfoByBillCode(emisWaybillSave.getBillCode());
}
@ -5201,6 +5204,20 @@ public class EmisBaseService {
}
}
private void updateOldMasterBill(EmisWaybill emisWaybillSave, String masterBillCode) {
String virtualBillCode = emisWaybillSave.getBillCode();
EmisWaybill masterWaybill = emisWaybillMapper
.selectEmisWaybillByBillCode(masterBillCode);
List<String> filterVirtualRemark = Arrays.stream(masterWaybill.getVirtualRemark().split(","))
.filter(i -> !i.equals(virtualBillCode)).collect(Collectors.toList());
String virtualRemark = String.join(",", filterVirtualRemark);
if(StringUtil.isBlank(virtualRemark)) {
virtualRemark = " ";
}
masterWaybill.setVirtualRemark(virtualRemark);
emisWaybillMapper.updateEmisWaybill(masterWaybill);
}
public static void main(String[] args) throws ParseException {
// Date startDate = new Date("202");
Date startDate= new SimpleDateFormat("yyyy-MM-dd").parse("2025-05-11");

View File

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