法规清单-关联平台件(处理项目名称)
This commit is contained in:
+43
@@ -0,0 +1,43 @@
|
|||||||
|
package com.jero.modules.system.util;
|
||||||
|
|
||||||
|
import com.jero.common.constant.enums.CutEnum;
|
||||||
|
import com.jero.common.system.vo.DictModel;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description
|
||||||
|
* @date 2023/10/18 10:59
|
||||||
|
* @auth zhn
|
||||||
|
*/
|
||||||
|
public class DictItemUtil {
|
||||||
|
public static String getDictItemText(String cut, String value, List<DictModel> dictModelAll) {
|
||||||
|
if (StringUtils.isBlank(value)) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
List<DictModel> dictModelList = new ArrayList<>();
|
||||||
|
for (String s : value.split(",")) {
|
||||||
|
List<DictModel> dictModelListTemp = dictModelAll.stream()
|
||||||
|
.filter(e -> s.equals(e.getValue())).collect(Collectors.toList());
|
||||||
|
dictModelList.addAll(dictModelListTemp);
|
||||||
|
}
|
||||||
|
String targetMarket = "";
|
||||||
|
if (dictModelList.size() != 0) {
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
for (DictModel dictModel : dictModelList) {
|
||||||
|
if (CutEnum.CN.getValue().equals(cut)) {
|
||||||
|
sb.append(dictModel.getText() + ",");
|
||||||
|
} else {
|
||||||
|
sb.append(dictModel.getTextEn() + ",");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (com.jero.modules.system.util.StringUtils.isNotBlank(sb)) {
|
||||||
|
targetMarket = sb.substring(0, sb.length() - 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return targetMarket;
|
||||||
|
}
|
||||||
|
}
|
||||||
+6
-1
@@ -129,6 +129,7 @@ import com.jero.modules.system.service.ISysDictService;
|
|||||||
import com.jero.modules.system.service.ISysUserService;
|
import com.jero.modules.system.service.ISysUserService;
|
||||||
import com.jero.modules.system.service.impl.SysCategoryServiceImpl;
|
import com.jero.modules.system.service.impl.SysCategoryServiceImpl;
|
||||||
import com.jero.modules.system.service.impl.SysDictItemServiceImpl;
|
import com.jero.modules.system.service.impl.SysDictItemServiceImpl;
|
||||||
|
import com.jero.modules.system.util.DictItemUtil;
|
||||||
import com.jero.modules.system.util.PDFUtils;
|
import com.jero.modules.system.util.PDFUtils;
|
||||||
import com.jero.modules.todoCenter.entity.ProcessInfoDetailEO;
|
import com.jero.modules.todoCenter.entity.ProcessInfoDetailEO;
|
||||||
import com.jero.modules.todoCenter.entity.ProcessInfoEO;
|
import com.jero.modules.todoCenter.entity.ProcessInfoEO;
|
||||||
@@ -12391,6 +12392,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
List<DictModel> targetMarketList = sysDictService.queryDictItemsByCode(DicCodeEnum.REGION.getCode());
|
||||||
if(!projectLawsInventoryEOList.isEmpty()){
|
if(!projectLawsInventoryEOList.isEmpty()){
|
||||||
List<String> projectLibraryIdList = projectLawsInventoryEOList.stream().map(ProjectLawsInventoryEO::getProjectLibraryId).distinct().collect(Collectors.toList());
|
List<String> projectLibraryIdList = projectLawsInventoryEOList.stream().map(ProjectLawsInventoryEO::getProjectLibraryId).distinct().collect(Collectors.toList());
|
||||||
LambdaQueryWrapper<ProjectLibraryBase> wrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<ProjectLibraryBase> wrapper = new LambdaQueryWrapper<>();
|
||||||
@@ -12402,7 +12404,10 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
|||||||
for (ProjectLawsInventoryEO inventoryEO : lawsInventoryEOS) {
|
for (ProjectLawsInventoryEO inventoryEO : lawsInventoryEOS) {
|
||||||
List<ProjectLibraryBase> collect = libraryBaseList.stream().filter(e -> inventoryEO.getProjectLibraryId().equals(e.getId())).collect(Collectors.toList());
|
List<ProjectLibraryBase> collect = libraryBaseList.stream().filter(e -> inventoryEO.getProjectLibraryId().equals(e.getId())).collect(Collectors.toList());
|
||||||
if(!collect.isEmpty()){
|
if(!collect.isEmpty()){
|
||||||
inventoryEO.setProjectName(collect.get(0).getProjectNameId());
|
//目标市场
|
||||||
|
String targetMarket = DictItemUtil.getDictItemText(cut,collect.get(0).getTargetMarket(),targetMarketList);
|
||||||
|
String projectName = collect.get(0).getPower()+collect.get(0).getProducer() + targetMarket;
|
||||||
|
inventoryEO.setProjectName(projectName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user