|
@@ -4,12 +4,9 @@ import cn.dev33.satoken.stp.StpUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.fdkankan.fusion.common.ResultCode;
|
|
|
-import com.fdkankan.fusion.entity.Model;
|
|
|
-import com.fdkankan.fusion.entity.TmDepartment;
|
|
|
-import com.fdkankan.fusion.entity.TmUser;
|
|
|
+import com.fdkankan.fusion.entity.*;
|
|
|
import com.fdkankan.fusion.exception.BusinessException;
|
|
|
import com.fdkankan.fusion.common.PageInfo;
|
|
|
-import com.fdkankan.fusion.entity.CaseEntity;
|
|
|
import com.fdkankan.fusion.mapper.ICaseMapper;
|
|
|
import com.fdkankan.fusion.request.CaseParam;
|
|
|
import com.fdkankan.fusion.request.ScenePram;
|
|
@@ -22,6 +19,7 @@ import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.time.Period;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
@@ -70,6 +68,31 @@ public class CaseServiceImpl extends ServiceImpl<ICaseMapper, CaseEntity> implem
|
|
|
wrapper.eq(CaseEntity::getType,0);
|
|
|
wrapper.orderByDesc(CaseEntity::getCreateTime);
|
|
|
Page<CaseEntity> page = this.page( new Page<>(param.getPageNum(), param.getPageSize()), wrapper);
|
|
|
+
|
|
|
+
|
|
|
+ Set<String> tmProIds = page.getRecords().stream().filter(entity -> StringUtils.isNotBlank(entity.getTmProjectId()))
|
|
|
+ .map(CaseEntity::getTmProjectId).collect(Collectors.toSet());
|
|
|
+ HashMap<String, TmProject> proMap = tmProjectService.getMapByIds(tmProIds);
|
|
|
+
|
|
|
+ for (CaseEntity record : page.getRecords()) {
|
|
|
+ if(StringUtils.isNotBlank(record.getTmProjectId())){
|
|
|
+ TmProject project = proMap.get(record.getTmProjectId());
|
|
|
+ if(project != null){
|
|
|
+ record.setDeptId(project.getDeptId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ Set<String> deptIds1 = page.getRecords().stream().filter(entity -> StringUtils.isNotBlank(entity.getDeptId()))
|
|
|
+ .map(CaseEntity::getDeptId).collect(Collectors.toSet());
|
|
|
+ HashMap<String, TmDepartment> mapByDeptIds = tmDepartmentService.getMapByDeptIds(deptIds1);
|
|
|
+
|
|
|
+ for (CaseEntity record : page.getRecords()) {
|
|
|
+ TmDepartment department = mapByDeptIds.get(record.getDeptId());
|
|
|
+ if(department != null){
|
|
|
+ record.setDeptName(department.getName());
|
|
|
+ }
|
|
|
+ }
|
|
|
return PageInfo.PageInfo(page);
|
|
|
}
|
|
|
|