diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsOpinionGather/entity/LawsOpinionGatherEO.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsOpinionGather/entity/LawsOpinionGatherEO.java index f3bdee2c6..54bdb668d 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsOpinionGather/entity/LawsOpinionGatherEO.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsOpinionGather/entity/LawsOpinionGatherEO.java @@ -73,6 +73,9 @@ public class LawsOpinionGatherEO implements Serializable { @Excel(name = "技术领域", width = 15) @ApiModelProperty(value = "技术领域") private String technologyTerritory; + @TableField(exist = false) + /**技术领域展示字段*/ + private String technologyTerritoryShow; /**收集结果*/ @Excel(name = "收集结果", width = 15) diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsOpinionGather/service/impl/LawsOpinionGatherEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsOpinionGather/service/impl/LawsOpinionGatherEOServiceImpl.java index da95056f0..241da71dc 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsOpinionGather/service/impl/LawsOpinionGatherEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsOpinionGather/service/impl/LawsOpinionGatherEOServiceImpl.java @@ -2,6 +2,7 @@ package com.jero.modules.lawsOpinionGather.service.impl; import com.alibaba.fastjson.JSONObject; import com.jero.common.api.vo.Result; +import com.jero.common.constant.enums.CutEnum; import com.jero.common.exception.JeroBootException; import com.jero.modules.lawsOpinionGather.entity.LawsOpinionGatherEO; import com.jero.modules.lawsOpinionGather.enums.GatherResultEnum; @@ -9,11 +10,16 @@ import com.jero.modules.lawsOpinionGather.mapper.LawsOpinionGatherEOMapper; import com.jero.modules.lawsOpinionGather.service.ILawsOpinionGatherEOService; import com.jero.modules.project.enums.OperatorTypeEnum; import com.jero.modules.project.enums.RequestSourceEnum; +import com.jero.modules.system.entity.SysCategory; +import com.jero.modules.system.service.impl.SysCategoryServiceImpl; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; import java.util.Date; +import java.util.stream.Collectors; + import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; /** @@ -25,6 +31,9 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @Service public class LawsOpinionGatherEOServiceImpl extends ServiceImpl implements ILawsOpinionGatherEOService { + @Autowired + private SysCategoryServiceImpl sysCategoryService; + /** * 保存 * @@ -130,11 +139,46 @@ public class LawsOpinionGatherEOServiceImpl extends ServiceImpl lawsOpinionGatherEOList,String cut) { if(CollectionUtils.isNotEmpty(lawsOpinionGatherEOList)){ + //树形数据字典 + List technologyTerritoryList = sysCategoryService.list(); lawsOpinionGatherEOList.forEach(lawsOpinionGather -> { if(StringUtils.isNotEmpty(lawsOpinionGather.getGatherResult())){ lawsOpinionGather.setGatherResultShow(GatherResultEnum.getTextByValue(lawsOpinionGather.getGatherResult(),cut)); } + if(StringUtils.isNotEmpty(lawsOpinionGather.getTechnologyTerritory())){ + String technologyTerritoryShow = disposeTechnologyTerritory(technologyTerritoryList, lawsOpinionGather.getTechnologyTerritory(), cut); + lawsOpinionGather.setTechnologyTerritoryShow(technologyTerritoryShow); + } }); } } + + /** + * 处理技术领域展示字段 + * @param technologyTerritoryList + * @param technologyTerritory + * @param cut + * @return + */ + public String disposeTechnologyTerritory(List technologyTerritoryList,String technologyTerritory,String cut){ + String result = ""; + // technology_territory + if(StringUtils.isNotEmpty(technologyTerritory)){ + StringBuilder sb = new StringBuilder(); + for (String technologyTerritoryId : technologyTerritory.split(",")) { + List collect = technologyTerritoryList.stream().filter(e -> e.getId().equals(technologyTerritoryId)).collect(Collectors.toList()); + if(collect.size() != 0){ + if(CutEnum.CN.getValue().equals(cut)){ + sb.append(collect.get(0).getName()+","); + }else{ + sb.append(collect.get(0).getEnName()+","); + } + } + } + if(StringUtils.isNotEmpty(sb)){ + result = sb.substring(0, sb.length() - 1); + } + } + return result; + } }