demand: 组树接口增加根据产品类型过滤,定时扫描接口适应打散的产品类型,组批次供应商名称不准确修复,规则接口重复校验
committer: heyu
This commit is contained in:
parent
fa2406e3b1
commit
a290399ad8
@ -4011,7 +4011,7 @@ public class EmisBaseService {
|
|||||||
return weekDays;
|
return weekDays;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<EmisTransPlanRule> buildTree(List<EmisTransPlanRule> allRules) {
|
public List<EmisTransPlanRule> buildTree(List<EmisTransPlanRule> allRules, EmisTransPlanRule emisTransPlanRule) {
|
||||||
// 按lineCode分组
|
// 按lineCode分组
|
||||||
Map<String, List<EmisTransPlanRule>> groupByLine = allRules.stream()
|
Map<String, List<EmisTransPlanRule>> groupByLine = allRules.stream()
|
||||||
.collect(Collectors.groupingBy(EmisTransPlanRule::getLineCode));
|
.collect(Collectors.groupingBy(EmisTransPlanRule::getLineCode));
|
||||||
@ -4067,6 +4067,19 @@ public class EmisBaseService {
|
|||||||
entry.setValue(deduped);
|
entry.setValue(deduped);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Map<String, List<EmisTransPlanRule>> tempMap = new HashMap<>();
|
||||||
|
if (StringUtil.isNotBlank(emisTransPlanRule.getProductType())) {
|
||||||
|
Iterator<Map.Entry<String, List<EmisTransPlanRule>>> iterator = groupByProductType.entrySet().iterator();
|
||||||
|
while (iterator.hasNext()) {
|
||||||
|
Map.Entry<String, List<EmisTransPlanRule>> entry = iterator.next();
|
||||||
|
if (emisTransPlanRule.getProductType().equals(entry.getKey())) {
|
||||||
|
tempMap.put(entry.getKey(), entry.getValue());
|
||||||
|
groupByProductType = tempMap;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 处理每个productType分组
|
// 处理每个productType分组
|
||||||
for (Map.Entry<String, List<EmisTransPlanRule>> productEntry : groupByProductType.entrySet()) {
|
for (Map.Entry<String, List<EmisTransPlanRule>> productEntry : groupByProductType.entrySet()) {
|
||||||
List<EmisTransPlanRule> productRules = productEntry.getValue();
|
List<EmisTransPlanRule> productRules = productEntry.getValue();
|
||||||
@ -4527,7 +4540,7 @@ public class EmisBaseService {
|
|||||||
public List<EmisTransPlanRule> selectEmisTransPlanRuleTree(List<String> lineCodes) {
|
public List<EmisTransPlanRule> selectEmisTransPlanRuleTree(List<String> lineCodes) {
|
||||||
log.info("Start querying supplier route plan tree in EmisBaseService");
|
log.info("Start querying supplier route plan tree in EmisBaseService");
|
||||||
List<EmisTransPlanRule> list = emisTransPlanRuleMapper.selectEmisTransPlanRuleByLineCodes(lineCodes);
|
List<EmisTransPlanRule> list = emisTransPlanRuleMapper.selectEmisTransPlanRuleByLineCodes(lineCodes);
|
||||||
List<EmisTransPlanRule> tree = buildTree(list);
|
List<EmisTransPlanRule> tree = buildTree(list, new EmisTransPlanRule());
|
||||||
log.info("Queried supplier route plan tree in EmisBaseService, node count={}", tree != null ? tree.size() : 0);
|
log.info("Queried supplier route plan tree in EmisBaseService, node count={}", tree != null ? tree.size() : 0);
|
||||||
return tree;
|
return tree;
|
||||||
}
|
}
|
||||||
@ -4773,57 +4786,99 @@ public class EmisBaseService {
|
|||||||
return hasCurrentLevelMatch && hasNextLevelMatch;
|
return hasCurrentLevelMatch && hasNextLevelMatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新版漏组分组与筛选逻辑:
|
||||||
|
* 1. 先将rule从根节点拆成每个children只有一个的所有路径(allPaths)。
|
||||||
|
* 2. 统计每条path的匹配度(path上所有节点与missRecords的匹配数之和)。
|
||||||
|
* 3. 过滤出匹配度最高的path(可多个)。
|
||||||
|
* 4. 对这些path的节点分组去重并做漏组处理。
|
||||||
|
*/
|
||||||
private void setMissRecords(List<EmisTmsSiteBatchMiss> missRecords,
|
private void setMissRecords(List<EmisTmsSiteBatchMiss> missRecords,
|
||||||
EmisTransPlanRule rule,
|
EmisTransPlanRule rule,
|
||||||
List<EmisTransPlanRule> filterRules, EmisWaybill waybill) {
|
List<EmisTransPlanRule> filterRules, EmisWaybill waybill) {
|
||||||
// 1. 递归收集所有节点,按ancestors长度分组
|
// 1. 获取所有路径
|
||||||
Map<Integer, List<EmisTransPlanRule>> levelMap = new HashMap<>();
|
List<List<EmisTransPlanRule>> allPaths = new ArrayList<>();
|
||||||
collectByLevel(rule, levelMap);
|
getAllPaths(rule, new ArrayList<>(), allPaths);
|
||||||
|
|
||||||
// 2. 逐级处理
|
// 2. 统计每条路径的匹配度
|
||||||
for (Map.Entry<Integer, List<EmisTransPlanRule>> entry : levelMap.entrySet())
|
Map<List<EmisTransPlanRule>, Integer> pathMatchCountMap = new HashMap<>();
|
||||||
{
|
for (List<EmisTransPlanRule> path : allPaths) {
|
||||||
|
int pathMatchCount = 0;
|
||||||
|
for (EmisTransPlanRule node : path) {
|
||||||
|
for (EmisTransPlanRule filterRule : filterRules) {
|
||||||
|
if (Objects.equals(node.getStartSiteCode(), filterRule.getStartSiteCode()) &&
|
||||||
|
Objects.equals(node.getNextSiteCode(), filterRule.getNextSiteCode()) &&
|
||||||
|
compareSupplierCodes(node.getSupplierCode(), filterRule.getSupplierCode())) {
|
||||||
|
pathMatchCount++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
pathMatchCountMap.put(path, pathMatchCount);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3. 过滤出匹配度最高的path(可多个)
|
||||||
|
int maxMatch = pathMatchCountMap.values().stream().max(Integer::compareTo).orElse(0);
|
||||||
|
List<List<EmisTransPlanRule>> bestPaths = pathMatchCountMap.entrySet().stream()
|
||||||
|
.filter(e -> e.getValue() == maxMatch)
|
||||||
|
.map(Map.Entry::getKey)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
// 4. 对这些path的节点分组去重并做漏组处理
|
||||||
|
// 先收集bestPaths中的所有节点
|
||||||
|
List<EmisTransPlanRule> allNodes = new ArrayList<>();
|
||||||
|
for (List<EmisTransPlanRule> path : bestPaths) {
|
||||||
|
allNodes.addAll(path);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 按ancestors长度分组去重
|
||||||
|
Map<Integer, List<EmisTransPlanRule>> levelMap = new HashMap<>();
|
||||||
|
for (EmisTransPlanRule node : allNodes) {
|
||||||
|
int level = 0;
|
||||||
|
if (node.getAncestors() != null && !node.getAncestors().isEmpty()) {
|
||||||
|
level = node.getAncestors().split(",").length;
|
||||||
|
}
|
||||||
|
levelMap.computeIfAbsent(level, k -> new ArrayList<>()).add(node);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 每一级仅按ID去重(不再合并供应商)
|
||||||
|
for (List<EmisTransPlanRule> rules : levelMap.values()) {
|
||||||
|
List<EmisTransPlanRule> distinct = rules.stream().collect(Collectors.collectingAndThen(
|
||||||
|
Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(EmisTransPlanRule::getId))),
|
||||||
|
ArrayList::new));
|
||||||
|
rules.clear();
|
||||||
|
rules.addAll(distinct);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 每一级与filterRules做比较,生成漏组记录
|
||||||
|
for (Map.Entry<Integer, List<EmisTransPlanRule>> entry : levelMap.entrySet()) {
|
||||||
List<EmisTransPlanRule> levelRules = entry.getValue();
|
List<EmisTransPlanRule> levelRules = entry.getValue();
|
||||||
boolean matched = false;
|
// 按 startSiteCode + nextSiteCode 分组
|
||||||
for (EmisTransPlanRule levelRule : levelRules) {
|
Map<String, List<EmisTransPlanRule>> groupMap = new HashMap<>();
|
||||||
boolean isMatched = filterRules.stream()
|
for (EmisTransPlanRule ruleItem : levelRules) {
|
||||||
.anyMatch(filterRule ->
|
String key = ruleItem.getStartSiteCode() + "_" + ruleItem.getNextSiteCode();
|
||||||
filterRule.getStartSiteCode().equals(levelRule.getStartSiteCode()) &&
|
groupMap.computeIfAbsent(key, k -> new ArrayList<>()).add(ruleItem);
|
||||||
filterRule.getNextSiteCode().equals(levelRule.getNextSiteCode()) &&
|
|
||||||
compareSupplierCodes(filterRule.getSupplierCode(),
|
|
||||||
levelRule.getSupplierCode()));
|
|
||||||
if (isMatched) {
|
|
||||||
matched = true;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
for (List<EmisTransPlanRule> group : groupMap.values()) {
|
||||||
if (!matched) {
|
// 判断该组是否有匹配
|
||||||
// 该级无匹配,只生成一条漏组记录,字段用逗号拼接
|
boolean matched = group.stream().anyMatch(levelRule -> filterRules.stream().anyMatch(
|
||||||
String startSiteCodes =
|
filterRule -> Objects.equals(filterRule.getStartSiteCode(), levelRule.getStartSiteCode()) &&
|
||||||
levelRules.stream().map(EmisTransPlanRule::getStartSiteCode).distinct()
|
Objects.equals(filterRule.getNextSiteCode(), levelRule.getNextSiteCode()) &&
|
||||||
.collect(Collectors.joining(","));
|
compareSupplierCodes(filterRule.getSupplierCode(), levelRule.getSupplierCode())));
|
||||||
String nextSiteCodes =
|
if (!matched && !group.isEmpty()) {
|
||||||
levelRules.stream().map(EmisTransPlanRule::getNextSiteCode).distinct()
|
// 聚合supplierCode、supplierName等
|
||||||
.collect(Collectors.joining(","));
|
String supplierCodes = group.stream().map(EmisTransPlanRule::getSupplierCode)
|
||||||
String supplierCodes =
|
.filter(Objects::nonNull).distinct().collect(Collectors.joining(","));
|
||||||
levelRules.stream().map(EmisTransPlanRule::getSupplierCode).distinct()
|
String supplierNames = group.stream().map(EmisTransPlanRule::getSupplierName)
|
||||||
.collect(Collectors.joining(","));
|
.filter(Objects::nonNull).distinct().collect(Collectors.joining(","));
|
||||||
String managers =
|
EmisTransPlanRule first = group.get(0);
|
||||||
levelRules.stream().map(EmisTransPlanRule::getManager).filter(Objects::nonNull)
|
String missReason = String.format("%s-%s-%s", first.getStartSiteName(),
|
||||||
.distinct().collect(Collectors.joining(","));
|
first.getNextSiteName(), supplierNames);
|
||||||
String missReason = levelRules.stream()
|
|
||||||
.map(r -> String.format("%s-%s-%s", r.getStartSiteName(),
|
|
||||||
r.getNextSiteName(), r.getSupplierName()))
|
|
||||||
.distinct()
|
|
||||||
.collect(Collectors.joining(" 或 "));
|
|
||||||
EmisTmsSiteBatchMiss miss = createMissRecord(waybill);
|
EmisTmsSiteBatchMiss miss = createMissRecord(waybill);
|
||||||
miss.setMissReason("组批次有遗漏/错误,请根据推荐路线排查: " + missReason);
|
miss.setMissReason("组批次有遗漏/错误,请根据推荐路线排查: " + missReason);
|
||||||
miss.setStartSiteCode(startSiteCodes);
|
miss.setStartSiteCode(first.getStartSiteCode());
|
||||||
miss.setNextSiteCode(nextSiteCodes);
|
miss.setNextSiteCode(first.getNextSiteCode());
|
||||||
miss.setSupplierCode(supplierCodes);
|
miss.setSupplierCode(supplierCodes);
|
||||||
miss.setManager(managers);
|
miss.setManager(first.getManager());
|
||||||
// 其他字段取第一个节点
|
|
||||||
EmisTransPlanRule first = levelRules.get(0);
|
|
||||||
miss.setTransPlanRuleId(first.getId());
|
miss.setTransPlanRuleId(first.getId());
|
||||||
miss.setLineCode(first.getLineCode());
|
miss.setLineCode(first.getLineCode());
|
||||||
miss.setProductType(first.getProductType());
|
miss.setProductType(first.getProductType());
|
||||||
@ -4834,6 +4889,23 @@ public class EmisBaseService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 辅助方法:递归获取所有从根到叶子的路径
|
||||||
|
private void getAllPaths(EmisTransPlanRule node, List<EmisTransPlanRule> current,
|
||||||
|
List<List<EmisTransPlanRule>> result) {
|
||||||
|
if (node == null)
|
||||||
|
return;
|
||||||
|
current.add(node);
|
||||||
|
if (node.getChildren() == null || node.getChildren().isEmpty()) {
|
||||||
|
result.add(new ArrayList<>(current));
|
||||||
|
} else {
|
||||||
|
for (EmisTransPlanRule child : node.getChildren()) {
|
||||||
|
getAllPaths(child, current, result);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
current.remove(current.size() - 1);
|
||||||
|
}
|
||||||
|
|
||||||
// 辅助方法:递归收集所有节点,按ancestors长度分组
|
// 辅助方法:递归收集所有节点,按ancestors长度分组
|
||||||
private void collectByLevel(EmisTransPlanRule node, Map<Integer, List<EmisTransPlanRule>> levelMap) {
|
private void collectByLevel(EmisTransPlanRule node, Map<Integer, List<EmisTransPlanRule>> levelMap) {
|
||||||
|
|||||||
@ -7,12 +7,10 @@ import java.util.concurrent.Future;
|
|||||||
import java.util.concurrent.Executors;
|
import java.util.concurrent.Executors;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import com.beust.jcommander.internal.Lists;
|
|
||||||
import com.xdadan.erp.emis.domain.*;
|
import com.xdadan.erp.emis.domain.*;
|
||||||
import com.xdadan.erp.emis.mapper.*;
|
import com.xdadan.erp.emis.mapper.*;
|
||||||
import com.xdadan.erp.emis.service.EmisBaseService;
|
import com.xdadan.erp.emis.service.EmisBaseService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.scheduling.annotation.Async;
|
import org.springframework.scheduling.annotation.Async;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@ -304,7 +302,7 @@ public class EmisTmsSiteBatchMissServiceImpl extends EmisBaseService implements
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
executor.shutdown();
|
executor.shutdown();
|
||||||
List<EmisTransPlanRule> tree = buildTree(allRules);
|
List<EmisTransPlanRule> tree = buildTree(allRules, new EmisTransPlanRule());
|
||||||
log.info("Queried supplier route plan tree, node count={}", tree != null ? tree.size() : 0);
|
log.info("Queried supplier route plan tree, node count={}", tree != null ? tree.size() : 0);
|
||||||
return tree;
|
return tree;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -123,7 +123,7 @@ public class EmisTransPlanRuleServiceImpl extends EmisBaseService implements IEm
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 构建树形结构
|
// 构建树形结构
|
||||||
return buildTree(allRules);
|
return buildTree(allRules, emisTransPlanRule);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -206,21 +206,82 @@ public class EmisTransPlanRuleServiceImpl extends EmisBaseService implements IEm
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void checkDuplicate(EmisTransPlanRule emisTransPlanRule) throws EmisBizError {
|
private void checkDuplicate(EmisTransPlanRule emisTransPlanRule) throws EmisBizError {
|
||||||
List<EmisTransPlanRule> existingRules = emisTransPlanRuleMapper.checkDuplicate(emisTransPlanRule);
|
// 检查正向规则(起始网点到下一网点)
|
||||||
|
List<EmisTransPlanRule> existingRules = checkDuplicateDirection(emisTransPlanRule,
|
||||||
|
emisTransPlanRule.getStartSiteCode(), emisTransPlanRule.getNextSiteCode());
|
||||||
if (existingRules != null && !existingRules.isEmpty()) {
|
if (existingRules != null && !existingRules.isEmpty()) {
|
||||||
throw new EmisBizError(EmisBizErrorType.EXISTS, "已存在相同的规则配置");
|
throw new EmisBizError(EmisBizErrorType.EXISTS, "已存在相同的规则配置");
|
||||||
}
|
}
|
||||||
EmisTransPlanRule emisTransPlanRule1 = new EmisTransPlanRule();
|
|
||||||
emisTransPlanRule1.setLineCode(emisTransPlanRule.getLineCode());
|
// 检查反向规则(下一网点到起始网点)
|
||||||
emisTransPlanRule1.setProductType(emisTransPlanRule.getProductType());
|
List<EmisTransPlanRule> existingRules1 = checkDuplicateDirection(emisTransPlanRule,
|
||||||
emisTransPlanRule1.setStartSiteCode(emisTransPlanRule.getNextSiteCode());
|
emisTransPlanRule.getNextSiteCode(), emisTransPlanRule.getStartSiteCode());
|
||||||
emisTransPlanRule1.setNextSiteCode(emisTransPlanRule.getStartSiteCode());
|
|
||||||
List<EmisTransPlanRule> existingRules1 = emisTransPlanRuleMapper.checkDuplicate(emisTransPlanRule);
|
|
||||||
if (existingRules1 != null && !existingRules1.isEmpty()) {
|
if (existingRules1 != null && !existingRules1.isEmpty()) {
|
||||||
throw new EmisBizError(EmisBizErrorType.EXISTS, "已存在相同的规则配置");
|
throw new EmisBizError(EmisBizErrorType.EXISTS, "已存在相同的规则配置");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private List<EmisTransPlanRule> checkDuplicateDirection(EmisTransPlanRule emisTransPlanRule,
|
||||||
|
String startSiteCode, String nextSiteCode) {
|
||||||
|
// 构建查询条件
|
||||||
|
EmisTransPlanRule queryRule = new EmisTransPlanRule();
|
||||||
|
queryRule.setLineCode(emisTransPlanRule.getLineCode());
|
||||||
|
queryRule.setStartSiteCode(startSiteCode);
|
||||||
|
queryRule.setNextSiteCode(nextSiteCode);
|
||||||
|
queryRule.setStartDate(emisTransPlanRule.getStartDate());
|
||||||
|
queryRule.setEndDate(emisTransPlanRule.getEndDate());
|
||||||
|
|
||||||
|
// 查询所有匹配的规则
|
||||||
|
List<EmisTransPlanRule> allRules = emisTransPlanRuleMapper.checkDuplicate(queryRule);
|
||||||
|
|
||||||
|
if (allRules == null || allRules.isEmpty()) {
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查productType和supplierCode是否有交集
|
||||||
|
String newProductType = emisTransPlanRule.getProductType();
|
||||||
|
String newSupplierCode = emisTransPlanRule.getSupplierCode();
|
||||||
|
|
||||||
|
for (EmisTransPlanRule existingRule : allRules) {
|
||||||
|
// 检查产品类型是否有交集
|
||||||
|
boolean productTypeOverlap = hasOverlap(newProductType, existingRule.getProductType());
|
||||||
|
// 检查供应商编码是否有交集
|
||||||
|
boolean supplierCodeOverlap = hasOverlap(newSupplierCode, existingRule.getSupplierCode());
|
||||||
|
|
||||||
|
// 如果产品类型和供应商编码都有交集,则认为重复
|
||||||
|
if (productTypeOverlap && supplierCodeOverlap) {
|
||||||
|
return Arrays.asList(existingRule);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查两个逗号分隔的字符串是否有交集
|
||||||
|
*
|
||||||
|
* @param str1 第一个字符串(逗号分隔)
|
||||||
|
* @param str2 第二个字符串(逗号分隔)
|
||||||
|
* @return 是否有交集
|
||||||
|
*/
|
||||||
|
private boolean hasOverlap(String str1, String str2) {
|
||||||
|
if (StringUtil.isBlank(str1) || StringUtil.isBlank(str2)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
Set<String> set1 = new HashSet<>(Arrays.asList(str1.split(",")));
|
||||||
|
Set<String> set2 = new HashSet<>(Arrays.asList(str2.split(",")));
|
||||||
|
|
||||||
|
// 检查是否有交集
|
||||||
|
for (String item : set1) {
|
||||||
|
if (set2.contains(item.trim())) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
private static void checkName(EmisTransPlanRule emisTransPlanRule) throws EmisBizError {
|
private static void checkName(EmisTransPlanRule emisTransPlanRule) throws EmisBizError {
|
||||||
if (StringUtil.isBlank(emisTransPlanRule.getManager())) {
|
if (StringUtil.isBlank(emisTransPlanRule.getManager())) {
|
||||||
throw new EmisBizError(EmisBizErrorType.PARAM_ERROR, "节点负责人不能为空");
|
throw new EmisBizError(EmisBizErrorType.PARAM_ERROR, "节点负责人不能为空");
|
||||||
|
|||||||
@ -260,11 +260,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
|
|
||||||
<select id="selectSupplierInfoByConditions" parameterType="emisSupplier" resultMap="EmisSupplierResult">
|
<select id="selectSupplierInfoByConditions" parameterType="emisSupplier" resultMap="EmisSupplierResult">
|
||||||
select distinct r.supplier_code as code,
|
select distinct r.supplier_code as code,
|
||||||
(SELECT GROUP_CONCAT(s.name)
|
(SELECT GROUP_CONCAT(s.name ORDER BY FIND_IN_SET(s.code, r.supplier_code))
|
||||||
FROM emis_supplier s
|
FROM emis_supplier s
|
||||||
WHERE FIND_IN_SET(s.code, r.supplier_code)
|
WHERE FIND_IN_SET(s.code, r.supplier_code)
|
||||||
AND s.del_flag = '0') as name,
|
AND s.del_flag = '0') as name,
|
||||||
(SELECT GROUP_CONCAT(s.name_en)
|
(SELECT GROUP_CONCAT(s.name_en ORDER BY FIND_IN_SET(s.code, r.supplier_code))
|
||||||
FROM emis_supplier s
|
FROM emis_supplier s
|
||||||
WHERE FIND_IN_SET(s.code, r.supplier_code)
|
WHERE FIND_IN_SET(s.code, r.supplier_code)
|
||||||
AND s.del_flag = '0') as name_en
|
AND s.del_flag = '0') as name_en
|
||||||
|
|||||||
@ -132,10 +132,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<where>
|
<where>
|
||||||
r.del_flag = '0'
|
r.del_flag = '0'
|
||||||
<if test="lineCode != null and lineCode != ''">and r.line_code = #{lineCode}</if>
|
<if test="lineCode != null and lineCode != ''">and r.line_code = #{lineCode}</if>
|
||||||
<if test="productType != null and productType != ''">and r.product_type=#{productType}</if>
|
|
||||||
<if test="startSiteCode != null and startSiteCode != ''">and r.start_site_code = #{startSiteCode}</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="nextSiteCode != null and nextSiteCode != ''">and r.next_site_code = #{nextSiteCode}</if>
|
||||||
<if test="supplierCode != null and supplierCode != ''">and r.supplier_code=#{supplierCode}</if>
|
<if test="startDate != null">and r.start_date = #{startDate}</if>
|
||||||
|
<if test="endDate != null">and r.end_date = #{endDate}</if>
|
||||||
</where>
|
</where>
|
||||||
order by id desc
|
order by id desc
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user