Merge pull request 'demand: 批次规则批量修改,扫描漏组批次过滤线路014' (#81) from develop into master
Reviewed-on: http://git.xdadan.loc/tanex/emis-service/pulls/81
This commit is contained in:
commit
e809f1a817
@ -174,9 +174,18 @@ public interface EmisTransPlanRuleMapper {
|
||||
List<EmisTransPlanRule> checkTransPlanRule(EmisTransPlanRule emisTransPlanRule);
|
||||
|
||||
/**
|
||||
* 查询供应商线路规划列表(不查询名称相关)
|
||||
*
|
||||
* @param emisTransPlanRule
|
||||
* @return
|
||||
*/
|
||||
List<EmisTransPlanRule> selectEmisTransPlanRuleListWithoutName(EmisTransPlanRule emisTransPlanRule);
|
||||
|
||||
/**
|
||||
* 查询供应商线路规划列表(不查询网点名称、创建人名称等)
|
||||
*
|
||||
* @param emisTransPlanRule
|
||||
* @return
|
||||
*/
|
||||
List<EmisTransPlanRule> selectEmisTransPlanRuleTree(EmisTransPlanRule emisTransPlanRule);
|
||||
}
|
||||
@ -4258,14 +4258,7 @@ public class EmisBaseService {
|
||||
|
||||
// 新增方法:根据ID查找节点
|
||||
private EmisTransPlanRule findNodeById(Long id) {
|
||||
// 由于deepCopyNode递归时无法直接访问所有节点,这里可通过全量查询实现,实际生产建议优化
|
||||
List<EmisTransPlanRule> allRules = emisTransPlanRuleMapper.selectEmisTransPlanRuleList(new EmisTransPlanRule());
|
||||
for (EmisTransPlanRule rule : allRules) {
|
||||
if (rule.getId() != null && rule.getId().equals(id)) {
|
||||
return rule;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
return emisTransPlanRuleMapper.selectEmisTransPlanRuleById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -5032,7 +5025,7 @@ public class EmisBaseService {
|
||||
if(StringUtil.isNotBlank(emisWaybillOld.getVirtualRemark())){
|
||||
throw new EmisBizError(EmisBizErrorType.FAIL, "主单不能改虚拟单");
|
||||
}
|
||||
if (emisWaybillSave.getParcelQty() != 1) {
|
||||
if (("078".equals(emisWaybillSave.getTransLineType()) || "002".equals(emisWaybillSave.getTransLineType())) && emisWaybillSave.getParcelQty() != 1) {
|
||||
throw new EmisBizError(EmisBizErrorType.FAIL, "虚拟单件数只能为1");
|
||||
}
|
||||
if (emisWaybillSave.getMasterBillCode().equals(emisWaybillSave.getBillCode())) {
|
||||
|
||||
@ -138,7 +138,7 @@ public class EmisTransPlanRuleServiceImpl extends EmisBaseService implements IEm
|
||||
@Override
|
||||
public List<EmisTransPlanRule> selectEmisTransPlanRuleTree(EmisTransPlanRule emisTransPlanRule) {
|
||||
// 查询所有规则
|
||||
List<EmisTransPlanRule> allRules = emisTransPlanRuleMapper.selectEmisTransPlanRuleList(emisTransPlanRule);
|
||||
List<EmisTransPlanRule> allRules = emisTransPlanRuleMapper.selectEmisTransPlanRuleTree(emisTransPlanRule);
|
||||
|
||||
if (allRules == null || allRules.isEmpty()) {
|
||||
return new ArrayList<>();
|
||||
@ -382,7 +382,7 @@ public class EmisTransPlanRuleServiceImpl extends EmisBaseService implements IEm
|
||||
|
||||
@Override
|
||||
public List<String> checkTree(EmisTransPlanRule emisTransPlanRule) {
|
||||
List<EmisTransPlanRule> allRules = emisTransPlanRuleMapper.selectEmisTransPlanRuleList(emisTransPlanRule);
|
||||
List<EmisTransPlanRule> allRules = emisTransPlanRuleMapper.selectEmisTransPlanRuleTree(emisTransPlanRule);
|
||||
return buildTreeForCheck(allRules);
|
||||
}
|
||||
|
||||
|
||||
@ -47,22 +47,58 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<where>
|
||||
r.del_flag = '0'
|
||||
<if test="lineCode != null and lineCode != ''"> and r.line_code = #{lineCode}</if>
|
||||
<if test="productType != null and productType != ''"> and ( FIND_IN_SET(#{productType},r.product_type) )</if>
|
||||
<if test="startSiteCode != null and startSiteCode != ''"> and r.start_site_code = #{startSiteCode}</if>
|
||||
<if test="nextSiteCode != null and nextSiteCode != ''"> and r.next_site_code = #{nextSiteCode}</if>
|
||||
<if test="manager != null and manager != ''"> and r.manager = #{manager}</if>
|
||||
<if test="supplierCode != null and supplierCode != ''"> and ( FIND_IN_SET(#{supplierCode},r.supplier_code) )</if>
|
||||
<if test="startDate != null"> and r.start_date = #{startDate}</if>
|
||||
<if test="endDate != null"> and r.end_date = #{endDate}</if>
|
||||
<if test="transManager != null and transManager != ''">
|
||||
AND l.trans_manager like concat('%', #{transManager}, '%')
|
||||
</if>
|
||||
<if test="productType != null and productType != ''"> and ( FIND_IN_SET(#{productType},r.product_type) )</if>
|
||||
<if test="supplierCode != null and supplierCode != ''"> and ( FIND_IN_SET(#{supplierCode},r.supplier_code) )</if>
|
||||
</where>
|
||||
order by id desc
|
||||
</select>
|
||||
|
||||
<select id="selectEmisTransPlanRuleTree" parameterType="EmisTransPlanRule" resultMap="EmisTransPlanRuleResult">
|
||||
select r.id, r.line_code, r.product_type, r.start_site_code,
|
||||
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,
|
||||
(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)
|
||||
AND s.del_flag = '0') as supplier_name,
|
||||
(SELECT GROUP_CONCAT(p.prod_name ORDER BY FIND_IN_SET(p.prod_code, r.product_type))
|
||||
FROM emis_trans_product p
|
||||
WHERE FIND_IN_SET(p.prod_code, r.product_type)
|
||||
AND p.del_flag = '0') as product_type_name
|
||||
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>
|
||||
<if test="startSiteCode != null and startSiteCode != ''"> and r.start_site_code = #{startSiteCode}</if>
|
||||
<if test="nextSiteCode != null and nextSiteCode != ''"> and r.next_site_code = #{nextSiteCode}</if>
|
||||
<if test="manager != null and manager != ''"> and r.manager = #{manager}</if>
|
||||
<if test="startDate != null"> and r.start_date = #{startDate}</if>
|
||||
<if test="endDate != null"> and r.end_date = #{endDate}</if>
|
||||
<if test="transManager != null and transManager != ''">
|
||||
AND l.trans_manager like concat('%', #{transManager}, '%')
|
||||
</if>
|
||||
<if test="productType != null and productType != ''"> and ( FIND_IN_SET(#{productType},r.product_type) )</if>
|
||||
<if test="supplierCode != null and supplierCode != ''"> and ( FIND_IN_SET(#{supplierCode},r.supplier_code) )</if>
|
||||
</where>
|
||||
order by id desc
|
||||
</select>
|
||||
|
||||
<select id="selectEmisTransPlanRuleListWithoutName" parameterType="EmisTransPlanRule" resultMap="EmisTransPlanRuleResult">
|
||||
select r.*
|
||||
select r.id, r.line_code, r.product_type, r.start_site_code,r.next_site_code,
|
||||
r.manager, r.supplier_code, r.start_date, r.end_date, r.remark
|
||||
from emis_trans_plan_rule r
|
||||
<where>
|
||||
r.del_flag = '0'
|
||||
|
||||
Loading…
Reference in New Issue
Block a user