|
@@ -30,10 +30,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.ObjectUtils;
|
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Date;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
+import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@Service
|
|
@@ -112,10 +109,24 @@ public class BaseExpertServiceImpl extends ServiceImpl<BaseExpertMapper, BaseExp
|
|
|
Date accessTime = pmDemandExpertRefList.get(0).getAccessTime();
|
|
|
Map<String, String> map = baseExpertMapper.getExpertNameList(expertList);
|
|
|
if (!ObjectUtils.isEmpty(map)) {
|
|
|
+ // 专家名称
|
|
|
String expertNameStr = map.get("expertName");
|
|
|
+ // 采购品种
|
|
|
String varietyPurchaseStr = map.get("varietyPurchase");
|
|
|
+ List<String> list = Arrays.stream(varietyPurchaseStr.split(",")).map(s -> String.valueOf(s.trim())).collect(Collectors.toList());
|
|
|
+ List<String> newList = method(list);
|
|
|
+ // 查询采购品种 中文
|
|
|
+ String varietyPurchaseName = "";
|
|
|
+ for (String i : newList) {
|
|
|
+ String name = PurchaseType.getCodeToInfo(i);
|
|
|
+ if ("".equals(varietyPurchaseName)) {
|
|
|
+ varietyPurchaseName = name;
|
|
|
+ } else {
|
|
|
+ varietyPurchaseName = "," + name;
|
|
|
+ }
|
|
|
+ }
|
|
|
pmDemandResVo.setExpertNameStr(expertNameStr);
|
|
|
- pmDemandResVo.setVarietyPurchaseStr(varietyPurchaseStr);
|
|
|
+ pmDemandResVo.setVarietyPurchaseStr(varietyPurchaseName);
|
|
|
}
|
|
|
pmDemandResVo.setAccessTime(accessTime);
|
|
|
}
|
|
@@ -125,8 +136,25 @@ public class BaseExpertServiceImpl extends ServiceImpl<BaseExpertMapper, BaseExp
|
|
|
return AjaxResult.success(pageInfo);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 自定义去重
|
|
|
+ *
|
|
|
+ * @param list
|
|
|
+ */
|
|
|
+ public static List<String> method(List<String> list) {
|
|
|
+ // 新集合
|
|
|
+ List<String> newList = new ArrayList<>(list.size());
|
|
|
+ list.forEach(i -> {
|
|
|
+ // 如果新集合中不存在则插入
|
|
|
+ if (!newList.contains(i)) {
|
|
|
+ newList.add(i);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return newList;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
- public List<BaseUnitInformation> getBaseUnitInformationList(){
|
|
|
+ public List<BaseUnitInformation> getBaseUnitInformationList() {
|
|
|
List<BaseUnitInformation> baseUnitInformationList = baseExpertMapper.selectByUnitInformation(null);
|
|
|
return baseUnitInformationList;
|
|
|
}
|