|
@@ -6,12 +6,11 @@ import cn.cslg.pas.common.model.PersonnelVO;
|
|
|
import cn.cslg.pas.common.model.dto.UploadFileDTO;
|
|
|
import cn.cslg.pas.common.model.params.*;
|
|
|
import cn.cslg.pas.common.model.vo.*;
|
|
|
-import cn.cslg.pas.common.utils.SecurityUtils.LoginUtils;
|
|
|
import cn.cslg.pas.common.utils.*;
|
|
|
+import cn.cslg.pas.common.utils.SecurityUtils.LoginUtils;
|
|
|
import cn.cslg.pas.common.utils.SecurityUtils.SecurityUtils;
|
|
|
import cn.cslg.pas.domain.*;
|
|
|
import cn.cslg.pas.mapper.ProjectMapper;
|
|
|
-import cn.dev33.satoken.stp.StpUtil;
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.collection.IterUtil;
|
|
|
import cn.hutool.core.date.DateField;
|
|
@@ -35,7 +34,6 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import org.apache.poi.ss.usermodel.PictureData;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.context.annotation.Lazy;
|
|
|
import org.springframework.scheduling.annotation.Async;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -133,35 +131,41 @@ public class ProjectService extends ServiceImpl<ProjectMapper, Project> {
|
|
|
IPage<Project> pageList = baseMapper.getPageList(new Page<>(params.getCurrent(), params.getSize()), params);
|
|
|
List<Project> dataList = pageList.getRecords();
|
|
|
|
|
|
-// try {
|
|
|
-// Map<String, Object> map = new HashMap<>();
|
|
|
-// map.put("departmentId", dataList.stream().map(Project::getDepartmentId).collect(Collectors.toList()));
|
|
|
-// String jsonObject = apiUtils.invokeApi(new JSONObject(map), "/permission/api/system/getDepartmentById", "post", "data");
|
|
|
-// JSONArray jsonArray1 = JSON.parseArray(jsonObject);
|
|
|
-// List<ProjectVO.Department> departmentList = jsonArray1.toJavaList(ProjectVO.Department.class);
|
|
|
-// for (Project project : dataList) {
|
|
|
-// for (ProjectVO.Department department : departmentList) {
|
|
|
-// if (project.getDepartmentId().equals(department.getId())) {
|
|
|
-// project.setDepartmentName(department.getDepartmentName());
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-//
|
|
|
-// Map<String, Object> map1 = new HashMap<>();
|
|
|
-// map1.put("personnelId", dataList.stream().map(Project::getPersonnelId).collect(Collectors.toList()));
|
|
|
-// String jsonObject1 = apiUtils.invokeApi(new JSONObject(map1), "/permission/api/system/getPersonnelById", "post", "data");
|
|
|
-// JSONArray jsonArray = JSON.parseArray(jsonObject1);
|
|
|
-// List<ProjectVO.Personnel> personnelList = jsonArray.toJavaList(ProjectVO.Personnel.class);
|
|
|
-// for (Project project : dataList) {
|
|
|
-// for (ProjectVO.Personnel personnel : personnelList) {
|
|
|
-// if (project.getPersonnelId().equals(personnel.getId())) {
|
|
|
-// project.setPersonnelName(personnel.getPersonnelName());
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-// } catch (IOException e) {
|
|
|
-// e.printStackTrace();
|
|
|
-// }
|
|
|
+ try {
|
|
|
+ //获取所属部门对应信息
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ map.put("departmentId", dataList.stream().map(Project::getDepartmentId).collect(Collectors.toList()));
|
|
|
+ String jsonObject = apiUtils.invokeApi(new JSONObject(map), "/permission/api/system/getDepartmentById", "post", "data");
|
|
|
+ JSONArray jsonArray1 = JSON.parseArray(jsonObject);
|
|
|
+ List<ProjectVO.Department> departmentList = jsonArray1.toJavaList(ProjectVO.Department.class);
|
|
|
+ for (Project project : dataList) {
|
|
|
+ for (ProjectVO.Department department : departmentList) {
|
|
|
+ if (project.getDepartmentId() != null) {
|
|
|
+ if (project.getDepartmentId().equals(department.getId())) {
|
|
|
+ project.setDepartmentName(department.getDepartmentName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //获取专题库负责人对应信息
|
|
|
+ Map<String, Object> map1 = new HashMap<>();
|
|
|
+ map1.put("personnelId", dataList.stream().map(Project::getPersonnelId).collect(Collectors.toList()));
|
|
|
+ String jsonObject1 = apiUtils.invokeApi(new JSONObject(map1), "/permission/api/system/getPersonnelById", "post", "data");
|
|
|
+ JSONArray jsonArray = JSON.parseArray(jsonObject1);
|
|
|
+ List<ProjectVO.Personnel> personnelList = jsonArray.toJavaList(ProjectVO.Personnel.class);
|
|
|
+ for (Project project : dataList) {
|
|
|
+ for (ProjectVO.Personnel personnel : personnelList) {
|
|
|
+ if (project.getPersonnelId() != null) {
|
|
|
+ if (project.getPersonnelId().equals(personnel.getId())) {
|
|
|
+ project.setPersonnelName(personnel.getPersonnelName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
|
|
|
this.setDataList(dataList);
|
|
|
pageList.setRecords(dataList);
|