demand: 组批次添加操作监控,批量扫描漏组批次改为硬删除

committer: heyu
This commit is contained in:
aike 2025-07-10 12:00:57 +08:00
parent 547f1be88f
commit c476bd6060
4 changed files with 51 additions and 35 deletions

View File

@ -74,6 +74,12 @@ public class EmisTransPlanRule extends BaseEntity {
/** 供应商名称 */
private String supplierName;
/** 起始国家 */
private String fromCountry;
/** 目的国家 */
private String country;
/** 生效时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
private Date startDate;

View File

@ -4147,41 +4147,44 @@ public class EmisBaseService {
boolean isChild = productRules.stream()
.anyMatch(potential -> potential.getChildren() != null
&& potential.getChildren().contains(rule));
if ("53200,25000,57501".contains(rule.getStartSiteCode()) && !"0086".equals(rule.getCountry())) {
return true;
}
return !isChild;
})
.collect(Collectors.toList());
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);
}
}
if (!toAdd.isEmpty()) {
topLevelNodes.addAll(toAdd);
}
// 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);
// }
// }
// if (!toAdd.isEmpty()) {
// topLevelNodes.addAll(toAdd);
// }
// 将顶级节点直接添加到结果中(进行深度复制)
for (EmisTransPlanRule node : topLevelNodes) {

View File

@ -137,6 +137,9 @@ public class EmisTransPlanRuleServiceImpl extends EmisBaseService implements IEm
*/
@Override
public List<EmisTransPlanRule> selectEmisTransPlanRuleTree(EmisTransPlanRule emisTransPlanRule) {
if(StringUtil.isBlank(emisTransPlanRule.getLineCode())||StringUtil.isBlank(emisTransPlanRule.getProductType())||StringUtil.isBlank(emisTransPlanRule.getStartSiteCode())){
return Lists.newArrayList();
}
// 查询所有规则
List<EmisTransPlanRule> allRules = emisTransPlanRuleMapper.selectEmisTransPlanRuleTree(emisTransPlanRule);

View File

@ -20,6 +20,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="endDate" column="end_date" />
<result property="supplierName" column="supplier_name" />
<result property="productTypeName" column="product_type_name" />
<result property="fromCountry" column="from_country" />
<result property="country" column="country" />
</resultMap>
<sql id="selectEmisTransPlanRuleVo">
@ -27,7 +29,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
s1.site_name as start_site_name, r.next_site_code, s2.site_name as next_site_name,
r.manager, r.supplier_code, r.start_date, r.end_date, r.remark,
r.del_flag, r.create_by, r.create_time, r.update_by, r.update_time, r.create_site, r.update_site,
l.line_name,l.trans_manager,
l.line_name,l.trans_manager, l.from_country, l.country,
(SELECT GROUP_CONCAT(s.name ORDER BY FIND_IN_SET(s.code, r.supplier_code))
FROM emis_supplier s
WHERE FIND_IN_SET(s.code, r.supplier_code)
@ -66,7 +68,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
s1.site_name as start_site_name, r.next_site_code, s2.site_name as next_site_name,
r.manager, r.supplier_code, r.start_date, r.end_date, r.remark,
r.del_flag,
l.line_name,l.trans_manager,
l.line_name,l.trans_manager, l.from_country, l.country
(SELECT GROUP_CONCAT(s.name ORDER BY FIND_IN_SET(s.code, r.supplier_code))
FROM emis_supplier s
WHERE FIND_IN_SET(s.code, r.supplier_code)
@ -133,7 +135,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectEmisTransPlanRuleByLineCodes" parameterType="list" resultMap="EmisTransPlanRuleResult">
select r.id, r.line_code, r.product_type, r.start_site_code,r.next_site_code, s1.site_name as start_site_name,
s2.site_name as next_site_name,
s2.site_name as next_site_name,l.line_name,l.trans_manager, l.from_country, l.country,
r.manager, r.supplier_code, r.start_date, r.end_date, (SELECT GROUP_CONCAT(s.name ORDER BY FIND_IN_SET(s.code, r.supplier_code))
FROM emis_supplier s
WHERE FIND_IN_SET(s.code, r.supplier_code)
@ -141,6 +143,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from emis_trans_plan_rule r
left join emis_site s1 on r.start_site_code = s1.site_code and s1.del_flag='0'
left join emis_site s2 on r.next_site_code = s2.site_code and s2.del_flag='0'
left join emis_trans_line l on r.line_code = l.line_code and l.del_flag='0'
<where>
r.del_flag = '0'
AND r.line_code in
@ -338,7 +341,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectRulesForAllScan" parameterType="EmisTransPlanRule" resultMap="EmisTransPlanRuleResult">
select r.id, r.line_code, r.product_type, r.start_site_code, r.next_site_code, s1.site_name as start_site_name,
s2.site_name as next_site_name,
s2.site_name as next_site_name, l.line_name,l.trans_manager, l.from_country, l.country,
r.manager, r.supplier_code, r.start_date, r.end_date, (SELECT GROUP_CONCAT(s.name)
FROM emis_supplier s
WHERE FIND_IN_SET(s.code, r.supplier_code)
@ -346,6 +349,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from emis_trans_plan_rule r
left join emis_site s1 on r.start_site_code = s1.site_code and s1.del_flag='0'
left join emis_site s2 on r.next_site_code = s2.site_code and s2.del_flag='0'
left join emis_trans_line l on r.line_code = l.line_code and l.del_flag='0'
<where>
r.del_flag = '0'
<if test="lineCode != null and lineCode != ''">and r.line_code = #{lineCode}</if>