@@ -35,16 +35,16 @@ public class AppAppraisalController { | |||
return appAppraisalManage.list(req); | |||
} | |||
@GetMapping("/unEvaluate-list/{planId}") | |||
@GetMapping("/unEvaluate-list/{planId}/{reAppraisalGroupId}") | |||
@ApiOperation("当前绩效评价应用待评价列表") | |||
public PageVo<PerformanceAppraisalAppVO> pendingList(@PathVariable Long planId, PerformanceAppraisalListReq req) { | |||
return appAppraisalManage.unEvaluateList(planId,req); | |||
public PageVo<PerformanceAppraisalAppVO> pendingList(@PathVariable Long planId, @PathVariable Long reAppraisalGroupId, PerformanceAppraisalListReq req) { | |||
return appAppraisalManage.unEvaluateList(planId,reAppraisalGroupId,req); | |||
} | |||
@GetMapping("/evaluated-list/{planId}") | |||
@ApiOperation("当前绩效评价应用已评价列表") | |||
public PageVo<PerformanceAppraisalAppVO> evaluatedList(@PathVariable Long planId,PerformanceAppraisalListReq req) { | |||
return appAppraisalManage.evaluatedList(planId,req); | |||
public PageVo<PerformanceAppraisalAppVO> evaluatedList(@PathVariable Long planId, @PathVariable Long reAppraisalGroupId, PerformanceAppraisalListReq req) { | |||
return appAppraisalManage.evaluatedList(planId,reAppraisalGroupId,req); | |||
} | |||
@GetMapping("/detail/{appId}") | |||
@@ -15,9 +15,11 @@ import java.util.List; | |||
public interface TemplateDetailBuildHelper { | |||
/** | |||
* 构建评价模板详情信息 | |||
* | |||
* @param templateDetails | |||
* @param projectCode | |||
* @param vo | |||
* @return | |||
*/ | |||
List<ProjectTemplateDetailVO> buildTemplateDetail(List<PerformanceIndicatorProjectTemplateDetail> templateDetails, ProjectAppraisalIndexDetailVO vo); | |||
List<ProjectTemplateDetailVO> buildTemplateDetail(List<PerformanceIndicatorProjectTemplateDetail> templateDetails, String projectCode, ProjectAppraisalIndexDetailVO vo); | |||
} |
@@ -8,7 +8,6 @@ import com.google.common.collect.Lists; | |||
import com.ningdatech.pmapi.performance.enumration.AppraisalTypeEnum; | |||
import com.ningdatech.pmapi.performance.enumration.PerformanceTemplateTypeEnum; | |||
import com.ningdatech.pmapi.performance.helper.TemplateDetailBuildHelper; | |||
import com.ningdatech.pmapi.performance.model.dto.ProjectAppraisalInfoDTO; | |||
import com.ningdatech.pmapi.performance.model.entity.PerformanceAppraisalScoreInfo; | |||
import com.ningdatech.pmapi.performance.model.entity.PerformanceIndicatorProjectTemplateDetail; | |||
import com.ningdatech.pmapi.performance.model.vo.ProjectAppraisalIndexDetailVO; | |||
@@ -35,7 +34,7 @@ public class TemplateDetailBuildHelperImpl implements TemplateDetailBuildHelper | |||
private final IPerformanceAppraisalScoreInfoService performanceAppraisalScoreInfoService; | |||
@Override | |||
public List<ProjectTemplateDetailVO> buildTemplateDetail(List<PerformanceIndicatorProjectTemplateDetail> templateDetails, ProjectAppraisalIndexDetailVO vo) { | |||
public List<ProjectTemplateDetailVO> buildTemplateDetail(List<PerformanceIndicatorProjectTemplateDetail> templateDetails, String projectCode, ProjectAppraisalIndexDetailVO vo) { | |||
List<ProjectTemplateDetailVO> res = Lists.newArrayList(); | |||
//第一层是 一级的 | |||
for (PerformanceIndicatorProjectTemplateDetail templateDetailFirst : templateDetails) { | |||
@@ -57,6 +56,7 @@ public class TemplateDetailBuildHelperImpl implements TemplateDetailBuildHelper | |||
// 获取自评分数信息 | |||
List<PerformanceAppraisalScoreInfo> selfAppraisalScoreInfo = performanceAppraisalScoreInfoService.list(Wrappers.lambdaQuery(PerformanceAppraisalScoreInfo.class) | |||
.eq(PerformanceAppraisalScoreInfo::getTemplateDetailId, templateDetailThird.getId()) | |||
.eq(PerformanceAppraisalScoreInfo::getAppraisalProjectCode,projectCode) | |||
.eq(PerformanceAppraisalScoreInfo::getAppraisalType, AppraisalTypeEnum.SELF_APPRAISAL.getCode())); | |||
if (CollUtil.isNotEmpty(selfAppraisalScoreInfo)) { | |||
detailThirdVo.setSelfAppraisalScoreInfo(selfAppraisalScoreInfo); | |||
@@ -70,6 +70,7 @@ public class TemplateDetailBuildHelperImpl implements TemplateDetailBuildHelper | |||
// 按照复评人员分组 获取复评分数信息 | |||
List<PerformanceAppraisalScoreInfo> reAppraisalScoreInfo = performanceAppraisalScoreInfoService.list(Wrappers.lambdaQuery(PerformanceAppraisalScoreInfo.class) | |||
.eq(PerformanceAppraisalScoreInfo::getTemplateDetailId, templateDetailThird.getId()) | |||
.eq(PerformanceAppraisalScoreInfo::getAppraisalProjectCode,projectCode) | |||
.eq(PerformanceAppraisalScoreInfo::getAppraisalType, AppraisalTypeEnum.RE_APPRAISAL.getCode())); | |||
if (CollUtil.isNotEmpty(reAppraisalScoreInfo)) { | |||
Map<String, List<PerformanceAppraisalScoreInfo>> reAppScoreInfoMap = reAppraisalScoreInfo.stream().collect(Collectors.groupingBy(PerformanceAppraisalScoreInfo::getAppraisalEmployeeName)); | |||
@@ -93,6 +94,7 @@ public class TemplateDetailBuildHelperImpl implements TemplateDetailBuildHelper | |||
// 按照核查人员分组 获取核查分数信息 | |||
List<PerformanceAppraisalScoreInfo> verifyScoreInfo = performanceAppraisalScoreInfoService.list(Wrappers.lambdaQuery(PerformanceAppraisalScoreInfo.class) | |||
.eq(PerformanceAppraisalScoreInfo::getTemplateDetailId, templateDetailThird.getId()) | |||
.eq(PerformanceAppraisalScoreInfo::getAppraisalProjectCode,projectCode) | |||
.eq(PerformanceAppraisalScoreInfo::getAppraisalType, AppraisalTypeEnum.EXPERT_VERIFY.getCode())); | |||
if (CollUtil.isNotEmpty(verifyScoreInfo)) { | |||
Map<String, List<PerformanceAppraisalScoreInfo>> verifyScoreInfoMap = verifyScoreInfo.stream().collect(Collectors.groupingBy(PerformanceAppraisalScoreInfo::getAppraisalEmployeeName)); | |||
@@ -116,6 +118,7 @@ public class TemplateDetailBuildHelperImpl implements TemplateDetailBuildHelper | |||
// 获取整改审核分数信息 | |||
List<PerformanceAppraisalScoreInfo> rectifyAuditScoreInfo = performanceAppraisalScoreInfoService.list(Wrappers.lambdaQuery(PerformanceAppraisalScoreInfo.class) | |||
.eq(PerformanceAppraisalScoreInfo::getTemplateDetailId, templateDetailThird.getId()) | |||
.eq(PerformanceAppraisalScoreInfo::getAppraisalProjectCode,projectCode) | |||
.eq(PerformanceAppraisalScoreInfo::getAppraisalType, AppraisalTypeEnum.EXPERT_RECTIFY_AUDIT.getCode())); | |||
if (CollUtil.isNotEmpty(rectifyAuditScoreInfo)) { | |||
detailThirdVo.setRectifyAuditScoreInfo(rectifyAuditScoreInfo); | |||
@@ -9,14 +9,11 @@ import cn.hutool.core.map.MapUtil; | |||
import com.ningdatech.pmapi.performance.enumration.AppIndexTypeEnum; | |||
import com.ningdatech.pmapi.performance.model.dto.AppAppraisalInfoDTO; | |||
import com.ningdatech.pmapi.performance.model.vo.*; | |||
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; | |||
import com.ningdatech.pmapi.projectlib.model.entity.ProjectApplication; | |||
import com.ningdatech.pmapi.projectlib.service.IProjectApplicationService; | |||
import org.apache.commons.lang3.StringUtils; | |||
import org.checkerframework.checker.nullness.qual.Nullable; | |||
import org.springframework.beans.BeanUtils; | |||
import org.springframework.stereotype.Component; | |||
import org.springframework.transaction.annotation.Transactional; | |||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
@@ -27,14 +24,10 @@ import com.ningdatech.basic.function.VUtils; | |||
import com.ningdatech.basic.model.PageVo; | |||
import com.ningdatech.basic.util.StrPool; | |||
import com.ningdatech.pmapi.performance.constant.BizConst; | |||
import com.ningdatech.pmapi.performance.enumration.AppraisalTypeEnum; | |||
import com.ningdatech.pmapi.performance.model.dto.ProjectAppraisalDTO; | |||
import com.ningdatech.pmapi.performance.model.dto.ProjectAppraisalInfoDTO; | |||
import com.ningdatech.pmapi.performance.model.entity.*; | |||
import com.ningdatech.pmapi.performance.model.req.PerformanceAppraisalListReq; | |||
import com.ningdatech.pmapi.performance.service.*; | |||
import com.ningdatech.pmapi.projectlib.enumeration.ProjectTypeEnum; | |||
import com.ningdatech.pmapi.projectlib.model.entity.Project; | |||
import com.ningdatech.pmapi.projectlib.service.IProjectService; | |||
import com.ningdatech.pmapi.sys.model.entity.Role; | |||
import com.ningdatech.pmapi.sys.service.IRoleService; | |||
@@ -56,10 +49,7 @@ import lombok.extern.slf4j.Slf4j; | |||
@Slf4j | |||
@AllArgsConstructor | |||
public class AppAppraisalManage { | |||
private final IPerformanceAppraisalService performanceAppraisalService; | |||
private final IPerformanceAppraisalProjectService performanceAppraisalProjectService; | |||
private final IProjectService projectService; | |||
private final IRoleService roleService; | |||
private final IPerformanceAppraisalAppScoreInfoService performanceAppraisalAppScoreInfoService; | |||
private final IPerformanceAppraisalProjectGroupService groupService; | |||
@@ -68,14 +58,13 @@ public class AppAppraisalManage { | |||
private final IPerformanceAppraisalAppIndicatorService performanceAppraisalAppIndicatorService; | |||
private final IProjectCoreBusinessIndicatorsService projectCoreBusinessIndicatorsService; | |||
/** | |||
* 复评-评价计划列表 | |||
* 应用评价-评价计划列表 | |||
* @param req | |||
* @return | |||
*/ | |||
public PageVo<PerformanceAppraisalVO> list(PerformanceAppraisalListReq req) { | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
String employeeCode = user.getEmployeeCode(); | |||
String regionCode = user.getRegionCode(); | |||
// 获取当前登录用户的角色列表,只有绩效复评人员才能查看该列表 | |||
List<Role> userRoleList = user.getUserRoleList(); | |||
List<Long> roleIdList = userRoleList.stream().map(Role::getId).collect(Collectors.toList()); | |||
@@ -90,21 +79,8 @@ public class AppAppraisalManage { | |||
return PageVo.empty(); | |||
} | |||
// 获取登录用户所在区域的所有已终验项目信息 | |||
List<Project> projectLists = projectService.list(Wrappers.lambdaQuery(Project.class) | |||
.eq(Project::getStatus, ProjectStatusEnum.ACCEPTED.getCode()) | |||
.eq(Project::getAreaCode, regionCode)); | |||
List<String> projectCodes = projectLists.stream().map(Project::getProjectCode).collect(Collectors.toList()); | |||
// 获取项目关联的应用信息 | |||
List<ProjectApplication> applications = projectApplicationService.list(Wrappers.lambdaQuery(ProjectApplication.class) | |||
.in(ProjectApplication::getProjectCode, projectCodes)); | |||
// 已验收的项目关联的应用信息不存在 | |||
if(CollUtil.isEmpty(applications)){ | |||
return PageVo.empty(); | |||
} | |||
List<Long> appIds = applications.stream().map(ProjectApplication::getId).collect(Collectors.toList()); | |||
List<PerformanceAppraisalApplication> paas = performanceAppraisalApplicationService.list(Wrappers.lambdaQuery(PerformanceAppraisalApplication.class) | |||
.in(PerformanceAppraisalApplication::getApplicationId, appIds)); | |||
// 获取所有已添加到评价计划中的应用信息 | |||
List<PerformanceAppraisalApplication> paas = performanceAppraisalApplicationService.list(); | |||
// 没有包含应用的评价计划 | |||
if (CollUtil.isEmpty(paas)){ | |||
return PageVo.empty(); | |||
@@ -132,8 +108,11 @@ public class AppAppraisalManage { | |||
if (CollUtil.isEmpty(groupList)){ | |||
return PageVo.empty(); | |||
} | |||
// 因为一个复评用户只能出现在一个计划的一个分组中 所以可以将分组信息按评价计划分组 | |||
Map<Long, PerformanceAppraisalProjectGroup> groupMap = groupList.stream().collect(Collectors.toMap(PerformanceAppraisalProjectGroup::getAppraisalId, g -> g)); | |||
// 获取分组所在的评价计划ID | |||
List<Long> appraisalIds = groupList.stream().map(PerformanceAppraisalProjectGroup::getAppraisalId).collect(Collectors.toList()); | |||
// 获取复评计划列表 | |||
Page<PerformanceAppraisal> page = req.page(); | |||
LambdaQueryWrapper<PerformanceAppraisal> wrapper = Wrappers.lambdaQuery(PerformanceAppraisal.class) | |||
@@ -141,56 +120,37 @@ public class AppAppraisalManage { | |||
.orderByDesc(PerformanceAppraisal::getUpdateOn); | |||
performanceAppraisalService.page(page,wrapper); | |||
List<PerformanceAppraisalVO> res = page.getRecords().stream() | |||
.map(p -> BeanUtil.copyProperties(p, PerformanceAppraisalVO.class)) | |||
.map(p -> { | |||
PerformanceAppraisalVO vo = BeanUtil.copyProperties(p, PerformanceAppraisalVO.class); | |||
PerformanceAppraisalProjectGroup group = groupMap.get(p.getId()); | |||
vo.setReAppraisalGroupId(group.getId()); | |||
return vo; | |||
}) | |||
.collect(Collectors.toList()); | |||
return PageVo.of(res,page.getTotal()); | |||
} | |||
public PageVo<PerformanceAppraisalAppVO> unEvaluateList(Long planId, PerformanceAppraisalListReq req) { | |||
public PageVo<PerformanceAppraisalAppVO> unEvaluateList(Long planId, Long reAppraisalGroupId, PerformanceAppraisalListReq req) { | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
String employeeCode = user.getEmployeeCode(); | |||
PerformanceAppraisal plan = performanceAppraisalService.getById(planId); | |||
VUtils.isTrue(Objects.isNull(plan)).throwMessage("该评价计划不存在!"); | |||
// 获取评价计划内已添加的未完成评价应用信息,且应用为当前登录复评用户所在分组评价项目关联的应用 | |||
List<PerformanceAppraisalProjectGroup> groupList = groupService.list(Wrappers.lambdaQuery(PerformanceAppraisalProjectGroup.class) | |||
.eq(PerformanceAppraisalProjectGroup::getAppraisalId, planId)); | |||
// 筛选出当前登录复评用户所在的分组信息 | |||
List<PerformanceAppraisalProjectGroup> groups = groupList.stream().filter(g -> { | |||
String reAppraisalUsers = g.getReAppraisalUsers(); | |||
if (reAppraisalUsers.contains(employeeCode)) { | |||
return true; | |||
} | |||
return false; | |||
}).collect(Collectors.toList()); | |||
// 获取评价计划分组信息内的项目信息 | |||
List<String> proCodes = groups.stream() | |||
.map(PerformanceAppraisalProjectGroup::getProjectCodes) | |||
.collect(Collectors.toList()); | |||
List<String> projectCodes = Lists.newArrayList(); | |||
for (String proCode : proCodes) { | |||
if (proCode.contains(StrPool.COMMA)){ | |||
projectCodes.addAll(Arrays.asList(proCode.split(StrPool.COMMA))); | |||
}else { | |||
projectCodes.add(proCode); | |||
} | |||
} | |||
PerformanceAppraisalProjectGroup group = groupService.getById(reAppraisalGroupId); | |||
VUtils.isTrue(Objects.isNull(group)).throwMessage("分组不存在!"); | |||
// 获取分组所在评价计划添加的未完成评价的应用信息 | |||
List<PerformanceAppraisalApplication> paas = performanceAppraisalApplicationService.list(Wrappers.lambdaQuery(PerformanceAppraisalApplication.class) | |||
.eq(PerformanceAppraisalApplication::getAppraisalId, plan.getId()) | |||
.in(PerformanceAppraisalApplication::getAppraisalProjectCode,projectCodes) | |||
.eq(PerformanceAppraisalApplication::getIsCompleteAppraisal,Boolean.FALSE)); | |||
.eq(PerformanceAppraisalApplication::getAppraisalId, group.getAppraisalId()) | |||
.eq(PerformanceAppraisalApplication::getIsCompleteAppraisal, Boolean.FALSE)); | |||
if (CollUtil.isEmpty(paas)){ | |||
return PageVo.empty(); | |||
} | |||
Set<Long> appraisalIds = paas.stream() | |||
.map(PerformanceAppraisalApplication::getAppraisalId) | |||
.collect(Collectors.toSet()); | |||
// 从绩效评价打分信息表中获取上述绩效评价计划应用的打分信息 | |||
List<PerformanceAppraisalAppScoreInfo> appraisalScoreInfos = performanceAppraisalAppScoreInfoService.list(Wrappers.lambdaQuery(PerformanceAppraisalAppScoreInfo.class) | |||
.in(PerformanceAppraisalAppScoreInfo::getAppraisalId, appraisalIds)); | |||
.eq(PerformanceAppraisalAppScoreInfo::getAppraisalId, planId)); | |||
// 筛选出当前登录用户未进行打分的应用信息 | |||
List<Long> appIds = appraisalScoreInfos.stream() | |||
.filter(a -> !employeeCode.equals(a.getAppraisalEmployeeCode())) | |||
@@ -224,7 +184,7 @@ public class AppAppraisalManage { | |||
return PageVo.of(res,page.getTotal()); | |||
} | |||
public PageVo<PerformanceAppraisalAppVO> evaluatedList(Long planId, PerformanceAppraisalListReq req) { | |||
public PageVo<PerformanceAppraisalAppVO> evaluatedList(Long planId, Long reAppraisalGroupId, PerformanceAppraisalListReq req) { | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
String employeeCode = user.getEmployeeCode(); | |||
@@ -232,45 +192,20 @@ public class AppAppraisalManage { | |||
PerformanceAppraisal plan = performanceAppraisalService.getById(planId); | |||
VUtils.isTrue(Objects.isNull(plan)).throwMessage("该评价计划不存在!"); | |||
PerformanceAppraisalProjectGroup group = groupService.getById(reAppraisalGroupId); | |||
VUtils.isTrue(Objects.isNull(group)).throwMessage("分组不存在!"); | |||
// 获取评价计划内已添加的未完成评价应用信息,且应用为当前登录复评用户所在分组评价项目关联的应用 | |||
List<PerformanceAppraisalProjectGroup> groupList = groupService.list(Wrappers.lambdaQuery(PerformanceAppraisalProjectGroup.class) | |||
.eq(PerformanceAppraisalProjectGroup::getAppraisalId, planId)); | |||
// 筛选出当前登录复评用户所在的分组信息 | |||
List<PerformanceAppraisalProjectGroup> groups = groupList.stream().filter(g -> { | |||
String reAppraisalUsers = g.getReAppraisalUsers(); | |||
if (reAppraisalUsers.contains(employeeCode)) { | |||
return true; | |||
} | |||
return false; | |||
}).collect(Collectors.toList()); | |||
// 获取评价计划分组信息内的项目信息 | |||
List<String> proCodes = groups.stream() | |||
.map(PerformanceAppraisalProjectGroup::getProjectCodes) | |||
.collect(Collectors.toList()); | |||
List<String> projectCodes = Lists.newArrayList(); | |||
for (String proCode : proCodes) { | |||
if (proCode.contains(StrPool.COMMA)){ | |||
projectCodes.addAll(Arrays.asList(proCode.split(StrPool.COMMA))); | |||
}else { | |||
projectCodes.add(proCode); | |||
} | |||
} | |||
// 获取分组所在评价计划添加的未完成评价的应用信息 | |||
List<PerformanceAppraisalApplication> paas = performanceAppraisalApplicationService.list(Wrappers.lambdaQuery(PerformanceAppraisalApplication.class) | |||
.eq(PerformanceAppraisalApplication::getAppraisalId, plan.getId()) | |||
.in(PerformanceAppraisalApplication::getAppraisalProjectCode,projectCodes) | |||
.eq(PerformanceAppraisalApplication::getIsCompleteAppraisal,Boolean.FALSE)); | |||
.eq(PerformanceAppraisalApplication::getAppraisalId, group.getAppraisalId()) | |||
.eq(PerformanceAppraisalApplication::getIsCompleteAppraisal, Boolean.FALSE)); | |||
if (CollUtil.isEmpty(paas)){ | |||
return PageVo.empty(); | |||
} | |||
Set<Long> appraisalIds = paas.stream() | |||
.map(PerformanceAppraisalApplication::getAppraisalId) | |||
.collect(Collectors.toSet()); | |||
// 从绩效评价打分信息表中获取上述绩效评价计划应用的打分信息 | |||
List<PerformanceAppraisalAppScoreInfo> appraisalScoreInfos = performanceAppraisalAppScoreInfoService.list(Wrappers.lambdaQuery(PerformanceAppraisalAppScoreInfo.class) | |||
.in(PerformanceAppraisalAppScoreInfo::getAppraisalId, appraisalIds)); | |||
// 筛选出当前登录用户未进行打分的应用信息 | |||
.eq(PerformanceAppraisalAppScoreInfo::getAppraisalId, planId)); | |||
// 筛选出当前登录用户已进行打分的应用信息 | |||
List<Long> appIds = appraisalScoreInfos.stream() | |||
.filter(a -> employeeCode.equals(a.getAppraisalEmployeeCode())) | |||
.map(PerformanceAppraisalAppScoreInfo::getApplicationId) | |||
@@ -326,52 +261,45 @@ public class AppAppraisalManage { | |||
public AppAppraisalIndexDetailVO detail(Long appId) { | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
String regionCode = user.getRegionCode(); | |||
AppAppraisalIndexDetailVO resVo = new AppAppraisalIndexDetailVO(); | |||
// 获取指标配置的应用指标信息 | |||
// 登录复评用户所在区域通用指标 | |||
// todo 是否需要过滤展示形式为打分的通用指标 | |||
// 通用指标 | |||
List<PerformanceAppraisalAppIndicator> commonIndexList = performanceAppraisalAppIndicatorService.list(Wrappers.lambdaQuery(PerformanceAppraisalAppIndicator.class) | |||
.eq(PerformanceAppraisalAppIndicator::getRegionCode, regionCode) | |||
.eq(PerformanceAppraisalAppIndicator::getIndexType, AppIndexTypeEnum.COMMON.getCode())); | |||
// 获取当前应用通用指标的的打分信息 | |||
Map<Long, PerformanceAppraisalAppScoreInfo> commonScoreInfoMap = performanceAppraisalAppScoreInfoService.list(Wrappers.lambdaQuery(PerformanceAppraisalAppScoreInfo.class) | |||
.eq(PerformanceAppraisalAppScoreInfo::getApplicationId, appId) | |||
.eq(PerformanceAppraisalAppScoreInfo::getIndexType, AppIndexTypeEnum.COMMON.getCode())) | |||
.stream().collect(Collectors.toMap(PerformanceAppraisalAppScoreInfo::getIndexId, p -> p)); | |||
if (CollUtil.isNotEmpty(commonIndexList)) { | |||
List<AppIndexDetailVO> commonIndexDetails = commonIndexList.stream().map(i -> { | |||
AppIndexDetailVO vo = new AppIndexDetailVO(); | |||
BeanUtils.copyProperties(i, vo); | |||
// 如果进行了打分,按复评人员分组 | |||
List<PerformanceAppraisalAppScoreInfo> appAppraisalScoreInfo = performanceAppraisalAppScoreInfoService.list(Wrappers.lambdaQuery(PerformanceAppraisalAppScoreInfo.class) | |||
.eq(PerformanceAppraisalAppScoreInfo::getApplicationId, appId)); | |||
if (CollUtil.isNotEmpty(appAppraisalScoreInfo)){ | |||
Map<String, List<PerformanceAppraisalAppScoreInfo>> scoreInfoMap = appAppraisalScoreInfo.stream() | |||
.collect(Collectors.groupingBy(PerformanceAppraisalAppScoreInfo::getAppraisalEmployeeName)); | |||
HashMap<String, BigDecimal> scoreMap = MapUtil.newHashMap(); | |||
for (String name : scoreInfoMap.keySet()) { | |||
List<PerformanceAppraisalAppScoreInfo> scoreInfos = scoreInfoMap.get(name); | |||
BigDecimal totalScore = scoreInfos.stream().map(PerformanceAppraisalAppScoreInfo::getAppraisalScore) | |||
.filter(Objects::nonNull) | |||
.reduce(BigDecimal.ZERO, BigDecimal::add); | |||
scoreMap.put(name, totalScore); | |||
} | |||
resVo.setAppraisalScoreInfo(scoreInfoMap); | |||
resVo.setAppraisalTotalScoreInfo(scoreMap); | |||
PerformanceAppraisalAppScoreInfo scoreInfo = commonScoreInfoMap.get(i.getId()); | |||
if (Objects.nonNull(scoreInfo)) { | |||
vo.setAppraisalScore(scoreInfo.getAppraisalScore()); | |||
} | |||
return vo; | |||
}).collect(Collectors.toList()); | |||
resVo.setCommonIndexDetails(commonIndexDetails); | |||
} | |||
// 登录复评用户所在区域辅助指标 | |||
// todo 是否需要过滤展示形式为打分的辅助指标 | |||
// 辅助指标 | |||
List<PerformanceAppraisalAppIndicator> auxIndexList = performanceAppraisalAppIndicatorService.list(Wrappers.lambdaQuery(PerformanceAppraisalAppIndicator.class) | |||
.eq(PerformanceAppraisalAppIndicator::getRegionCode, regionCode) | |||
.eq(PerformanceAppraisalAppIndicator::getIndexType, AppIndexTypeEnum.AUX.getCode())); | |||
// 获取当前应用辅助指标的的打分信息 | |||
Map<Long, PerformanceAppraisalAppScoreInfo> auxScoreInfoMap = performanceAppraisalAppScoreInfoService.list(Wrappers.lambdaQuery(PerformanceAppraisalAppScoreInfo.class) | |||
.eq(PerformanceAppraisalAppScoreInfo::getApplicationId, appId) | |||
.eq(PerformanceAppraisalAppScoreInfo::getIndexType, AppIndexTypeEnum.AUX.getCode())) | |||
.stream().collect(Collectors.toMap(PerformanceAppraisalAppScoreInfo::getIndexId, p -> p)); | |||
if (CollUtil.isNotEmpty(auxIndexList)) { | |||
List<AppIndexDetailVO> auxIndexDetails = auxIndexList.stream().map(i -> { | |||
AppIndexDetailVO vo = new AppIndexDetailVO(); | |||
BeanUtils.copyProperties(i, vo); | |||
PerformanceAppraisalAppScoreInfo scoreInfo = auxScoreInfoMap.get(i.getId()); | |||
if (Objects.nonNull(scoreInfo)) { | |||
vo.setAppraisalScore(scoreInfo.getAppraisalScore()); | |||
} | |||
return vo; | |||
}).collect(Collectors.toList()); | |||
resVo.setAuxIndexDetails(auxIndexDetails); | |||
@@ -379,10 +307,19 @@ public class AppAppraisalManage { | |||
// 获取应用的核心业务指标 | |||
List<ProjectCoreBusinessIndicators> coreBusinessIndicators = projectCoreBusinessIndicatorsService.list(Wrappers.lambdaQuery(ProjectCoreBusinessIndicators.class) | |||
.eq(ProjectCoreBusinessIndicators::getApplicationId, appId)); | |||
// 获取当前应用业务指标的的打分信息 | |||
Map<Long, PerformanceAppraisalAppScoreInfo> businessScoreInfoMap = performanceAppraisalAppScoreInfoService.list(Wrappers.lambdaQuery(PerformanceAppraisalAppScoreInfo.class) | |||
.eq(PerformanceAppraisalAppScoreInfo::getApplicationId, appId) | |||
.eq(PerformanceAppraisalAppScoreInfo::getIndexType, AppIndexTypeEnum.BUSINESS.getCode())) | |||
.stream().collect(Collectors.toMap(PerformanceAppraisalAppScoreInfo::getIndexId, p -> p)); | |||
if (CollUtil.isNotEmpty(coreBusinessIndicators)) { | |||
List<AppBusinessIndexDetailVO> businessIndexDetails = coreBusinessIndicators.stream().map(c -> { | |||
AppBusinessIndexDetailVO appBusinessIndexDetailVo = new AppBusinessIndexDetailVO(); | |||
BeanUtils.copyProperties(coreBusinessIndicators, appBusinessIndexDetailVo); | |||
PerformanceAppraisalAppScoreInfo scoreInfo = businessScoreInfoMap.get(c.getId()); | |||
if (Objects.nonNull(scoreInfo)) { | |||
appBusinessIndexDetailVo.setAppraisalScore(scoreInfo.getAppraisalScore()); | |||
} | |||
return appBusinessIndexDetailVo; | |||
}).collect(Collectors.toList()); | |||
resVo.setBusinessIndexDetails(businessIndexDetails); | |||
@@ -466,46 +403,16 @@ public class AppAppraisalManage { | |||
.map(AppAppraisalInfoDTO::getScore) | |||
.filter(Objects::nonNull) | |||
.reduce(BigDecimal.ZERO, BigDecimal::add); | |||
BigDecimal lastAppraisalTotalScore; | |||
// 判断项目所在分组内其他复评人员是否已经打分 | |||
if (Objects.nonNull(appraisalApplication.getAppraisalTotalScore())){ | |||
// 已经进行了复评,计算两个分值的平均分 | |||
BigDecimal add = appraisalTotalScore.add(appraisalApplication.getAppraisalTotalScore()); | |||
lastAppraisalTotalScore = add.divide(BigDecimal.valueOf(2)); | |||
}else { | |||
// 还没有进行过复评 | |||
lastAppraisalTotalScore = appraisalTotalScore; | |||
} | |||
appraisalApplication.setAppraisalTotalScore(lastAppraisalTotalScore); | |||
// 取最新地打分时间 | |||
appraisalApplication.setAppraisalTotalScore(appraisalTotalScore); | |||
appraisalApplication.setAppraisalScoreTime(LocalDateTime.now()); | |||
// 判断当前复评人是否为该评价应用关联的评价项目所在分组的复评人员中的最后一个复评人 | |||
// 获取评价应用关联的评价项目所在的评价计划关联的分组信息 | |||
String appraisalProjectCode = appraisalApplication.getAppraisalProjectCode(); | |||
List<PerformanceAppraisalProjectGroup> groups = groupService.list(Wrappers.lambdaQuery(PerformanceAppraisalProjectGroup.class) | |||
.eq(PerformanceAppraisalProjectGroup::getAppraisalId,appraisalId)); | |||
// 获取当前登录复评员所在包含该评价应用的分组信息 | |||
List<PerformanceAppraisalProjectGroup> groupList = groups.stream().filter(g -> { | |||
String reAppraisalUsers = g.getReAppraisalUsers(); | |||
String projectCodes = g.getProjectCodes(); | |||
if (reAppraisalUsers.contains(employeeCode) && | |||
projectCodes.contains(appraisalProjectCode)) { | |||
return true; | |||
} | |||
return false; | |||
}).collect(Collectors.toList()); | |||
PerformanceAppraisalProjectGroup projectGroup = groupList.get(0); | |||
judgeCompleteAppraisal(projectGroup, appraisalApplication); | |||
appraisalApplication.setUpdateOn(LocalDateTime.now()); | |||
// 一个复评员打完分就认为完成了打分 | |||
appraisalApplication.setIsCompleteAppraisal(Boolean.TRUE); | |||
appraisalApplication.setUpdateBy(username); | |||
performanceAppraisalApplicationService.updateById(appraisalApplication); | |||
return "提交成功"; | |||
} | |||
return "提交失败"; | |||
} | |||
private void judgeCompleteAppraisal(PerformanceAppraisalProjectGroup group, PerformanceAppraisalApplication appraisalApplication) { | |||
// 获取该评价应用的复评打分信息 | |||
List<PerformanceAppraisalAppScoreInfo> scoreInfos = performanceAppraisalAppScoreInfoService.list(Wrappers.lambdaQuery(PerformanceAppraisalAppScoreInfo.class) | |||
@@ -12,7 +12,6 @@ import com.ningdatech.basic.model.PageVo; | |||
import com.ningdatech.basic.util.StrPool; | |||
import com.ningdatech.pmapi.common.constant.CommonConst; | |||
import com.ningdatech.pmapi.common.enumeration.CommonEnum; | |||
import com.ningdatech.pmapi.common.helper.UserInfoHelper; | |||
import com.ningdatech.pmapi.performance.enumration.PerformanceTemplateTypeEnum; | |||
import com.ningdatech.pmapi.performance.helper.TemplateDetailBuildHelper; | |||
import com.ningdatech.pmapi.performance.model.dto.PerformanceIndicatorAppIndexSaveDTO; | |||
@@ -32,7 +31,6 @@ import com.ningdatech.pmapi.performance.service.IPerformanceAppraisalAppIndicato | |||
import com.ningdatech.pmapi.performance.service.IPerformanceAppraisalProjectIndicatorService; | |||
import com.ningdatech.pmapi.performance.service.IPerformanceIndicatorProjectTemplateDetailService; | |||
import com.ningdatech.pmapi.performance.service.IPerformanceIndicatorProjectTemplateService; | |||
import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO; | |||
import com.ningdatech.pmapi.user.security.auth.model.UserInfoDetails; | |||
import com.ningdatech.pmapi.user.util.LoginUserUtil; | |||
import lombok.AllArgsConstructor; | |||
@@ -116,12 +114,12 @@ public class IndicatorConfigManage { | |||
.eq(PerformanceIndicatorProjectTemplateDetail::getTemplateId, id) | |||
.eq(PerformanceIndicatorProjectTemplateDetail::getIsAdditional,Boolean.TRUE)); | |||
if(CollUtil.isNotEmpty(templateDetails)){ | |||
List<ProjectTemplateDetailVO> templateDetailVos = templateDetailBuildHelper.buildTemplateDetail(templateDetails,null); | |||
List<ProjectTemplateDetailVO> templateDetailVos = templateDetailBuildHelper.buildTemplateDetail(templateDetails, null, null); | |||
vo.setTemplateDetails(templateDetailVos); | |||
} | |||
if (CollUtil.isNotEmpty(additionalTemplateDetails)){ | |||
List<ProjectTemplateDetailVO> additionalTemplateDetailVos = templateDetailBuildHelper.buildTemplateDetail(additionalTemplateDetails,null); | |||
List<ProjectTemplateDetailVO> additionalTemplateDetailVos = templateDetailBuildHelper.buildTemplateDetail(additionalTemplateDetails, null, null); | |||
vo.setAdditionalIndexDetails(additionalTemplateDetailVos); | |||
} | |||
return vo; | |||
@@ -283,8 +283,8 @@ public class OrgSelfAppraisalManage { | |||
List<PerformanceIndicatorProjectTemplateDetail> additionalTemplateDetails = indicatorProjectTemplateDetailService.list(Wrappers.lambdaQuery(PerformanceIndicatorProjectTemplateDetail.class) | |||
.eq(PerformanceIndicatorProjectTemplateDetail::getTemplateId, projectTemplate.getId()) | |||
.eq(PerformanceIndicatorProjectTemplateDetail::getIsAdditional,Boolean.TRUE)); | |||
List<ProjectTemplateDetailVO> templateDetailVos = templateDetailBuildHelper.buildTemplateDetail(templateDetails,vo); | |||
List<ProjectTemplateDetailVO> additionalTemplateDetailVos = templateDetailBuildHelper.buildTemplateDetail(additionalTemplateDetails,vo); | |||
List<ProjectTemplateDetailVO> templateDetailVos = templateDetailBuildHelper.buildTemplateDetail(templateDetails,projectCode,vo); | |||
List<ProjectTemplateDetailVO> additionalTemplateDetailVos = templateDetailBuildHelper.buildTemplateDetail(additionalTemplateDetails,projectCode,vo); | |||
vo.setProjectName(project.getProjectName()); | |||
vo.setBuildOrgName(project.getBuildOrgName()); | |||
vo.setProjectStatus(project.getStatus()); | |||
@@ -4,6 +4,8 @@ import java.time.LocalDateTime; | |||
import java.util.*; | |||
import java.util.stream.Collectors; | |||
import com.ningdatech.pmapi.performance.model.entity.*; | |||
import com.ningdatech.pmapi.performance.service.*; | |||
import org.springframework.stereotype.Component; | |||
import org.springframework.transaction.annotation.Transactional; | |||
@@ -27,19 +29,11 @@ import com.ningdatech.pmapi.common.util.CodeUtil; | |||
import com.ningdatech.pmapi.performance.convert.PerformanceAppraisalConveter; | |||
import com.ningdatech.pmapi.performance.enumration.EvalObjectEnum; | |||
import com.ningdatech.pmapi.performance.model.dto.*; | |||
import com.ningdatech.pmapi.performance.model.entity.PerformanceAppraisal; | |||
import com.ningdatech.pmapi.performance.model.entity.PerformanceAppraisalApplication; | |||
import com.ningdatech.pmapi.performance.model.entity.PerformanceAppraisalProject; | |||
import com.ningdatech.pmapi.performance.model.entity.PerformanceAppraisalProjectGroup; | |||
import com.ningdatech.pmapi.performance.model.req.PerformanceAppraisalListReq; | |||
import com.ningdatech.pmapi.performance.model.vo.PerformanceAppraisalApplicationVO; | |||
import com.ningdatech.pmapi.performance.model.vo.PerformanceAppraisalProjectGroupVO; | |||
import com.ningdatech.pmapi.performance.model.vo.PerformanceAppraisalProjectVO; | |||
import com.ningdatech.pmapi.performance.model.vo.PerformanceAppraisalVO; | |||
import com.ningdatech.pmapi.performance.service.IPerformanceAppraisalApplicationService; | |||
import com.ningdatech.pmapi.performance.service.IPerformanceAppraisalProjectGroupService; | |||
import com.ningdatech.pmapi.performance.service.IPerformanceAppraisalProjectService; | |||
import com.ningdatech.pmapi.performance.service.IPerformanceAppraisalService; | |||
import com.ningdatech.pmapi.projectlib.enumeration.InstTypeEnum; | |||
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; | |||
import com.ningdatech.pmapi.projectlib.enumeration.ProjectTypeEnum; | |||
@@ -84,6 +78,8 @@ public class PerformanceAppraisalPlanManage { | |||
private final IProjectInstService projectInstService; | |||
private final ProcessInstanceService processInstanceService; | |||
private final BuildUserUtils buildUserUtils; | |||
private final IPerformanceAppraisalScoreInfoService performanceAppraisalScoreInfoService; | |||
private final IPerformanceAppraisalAppScoreInfoService performanceAppraisalAppScoreInfoService; | |||
/** | |||
* 绩效列表 | |||
@@ -414,9 +410,17 @@ public class PerformanceAppraisalPlanManage { | |||
return; | |||
} | |||
//删除先 | |||
// 删除计划内的项目 | |||
performanceAppraisalProjectService.remove(Wrappers.lambdaQuery(PerformanceAppraisalProject.class) | |||
.eq(PerformanceAppraisalProject::getAppraisalId,editDTO.getId())); | |||
// 删除项目的打分信息 | |||
List<Long> projectIds = editDTO.getProjects().stream().map(AppraisalProjectDTO::getId).collect(Collectors.toList()); | |||
List<String> projectCodes = projectService.listByIds(projectIds).stream().map(Project::getProjectCode).collect(Collectors.toList()); | |||
// 删除项目的打分信息 | |||
performanceAppraisalScoreInfoService.remove(Wrappers.lambdaQuery(PerformanceAppraisalScoreInfo.class) | |||
.eq(PerformanceAppraisalScoreInfo::getAppraisalId,editDTO.getId()) | |||
.in(PerformanceAppraisalScoreInfo::getAppraisalProjectCode,projectCodes)); | |||
Integer startSelfDays = editDTO.getStartSelfDays(); | |||
Integer completeSelfDays = editDTO.getCompleteSelfDays(); | |||
List<AppraisalProjectDTO> projects = editDTO.getProjects(); | |||
@@ -448,9 +452,16 @@ public class PerformanceAppraisalPlanManage { | |||
if(Objects.isNull(editDTO.getApplicationIds())){ | |||
return; | |||
} | |||
//删除先 | |||
// 删除计划内的应用 | |||
performanceAppraisalApplicationService.remove(Wrappers.lambdaQuery(PerformanceAppraisalApplication.class) | |||
.eq(PerformanceAppraisalApplication::getAppraisalId,editDTO.getId())); | |||
// 删除计划内应用的打分信息 | |||
List<Long> applicationIdList = editDTO.getApplicationIds(); | |||
// 删除应用的打分信息 | |||
performanceAppraisalAppScoreInfoService.remove(Wrappers.lambdaQuery(PerformanceAppraisalAppScoreInfo.class) | |||
.eq(PerformanceAppraisalAppScoreInfo::getAppraisalId,editDTO.getId()) | |||
.in(PerformanceAppraisalAppScoreInfo::getApplicationId,applicationIdList)); | |||
List<Long> applicationIds = editDTO.getApplicationIds(); | |||
Map<Long, ProjectApplication> applicationMap = applicationService.list(Wrappers.lambdaQuery(ProjectApplication.class).in(ProjectApplication::getId, applicationIds)).stream() | |||
.collect(Collectors.toMap(ProjectApplication::getId, a -> a)); | |||
@@ -487,11 +498,21 @@ public class PerformanceAppraisalPlanManage { | |||
List<PerformanceAppraisalProject> paps = performanceAppraisalProjectService.list(Wrappers.lambdaQuery(PerformanceAppraisalProject.class) | |||
.eq(PerformanceAppraisalProject::getAppraisalId, id)); | |||
performanceAppraisalProjectService.removeBatchByIds(paps); | |||
List<String> projectCodes = paps.stream().map(PerformanceAppraisalProject::getProjectCode).collect(Collectors.toList()); | |||
// 删除项目的打分信息 | |||
performanceAppraisalScoreInfoService.remove(Wrappers.lambdaQuery(PerformanceAppraisalScoreInfo.class) | |||
.eq(PerformanceAppraisalScoreInfo::getAppraisalId,id) | |||
.in(PerformanceAppraisalScoreInfo::getAppraisalProjectCode,projectCodes)); | |||
// 删除评价计划关联的应用 | |||
//绩效关联的应用 | |||
List<PerformanceAppraisalApplication> paas = performanceAppraisalApplicationService.list(Wrappers.lambdaQuery(PerformanceAppraisalApplication.class) | |||
.eq(PerformanceAppraisalApplication::getAppraisalId, id)); | |||
performanceAppraisalApplicationService.removeBatchByIds(paas); | |||
List<Long> applicationIds = paas.stream().map(PerformanceAppraisalApplication::getApplicationId).collect(Collectors.toList()); | |||
// 删除应用的打分信息 | |||
performanceAppraisalAppScoreInfoService.remove(Wrappers.lambdaQuery(PerformanceAppraisalAppScoreInfo.class) | |||
.eq(PerformanceAppraisalAppScoreInfo::getAppraisalId,id) | |||
.in(PerformanceAppraisalAppScoreInfo::getApplicationId,applicationIds)); | |||
// 删除评级计划关联的分组信息 | |||
groupService.remove(Wrappers.lambdaQuery(PerformanceAppraisalProjectGroup.class) | |||
.eq(PerformanceAppraisalProjectGroup::getAppraisalId,id)); | |||
@@ -81,7 +81,7 @@ public class RectifyAuditManage { | |||
List<Role> userRoleList = user.getUserRoleList(); | |||
List<Long> roleIdList = userRoleList.stream().map(Role::getId).collect(Collectors.toList()); | |||
Role role = | |||
roleService.getOne(Wrappers.lambdaQuery(Role.class).eq(Role::getName, RoleEnum.COMPANY_MANAGER.getDesc())); | |||
roleService.getOne(Wrappers.lambdaQuery(Role.class).eq(Role::getName, RoleEnum.EXPERT.getDesc())); | |||
if (Objects.isNull(role)) { | |||
throw new BizException("登录用户没有专家角色!"); | |||
} | |||
@@ -96,7 +96,7 @@ public class RectifyAuditManage { | |||
List<PerformanceAppraisalProjectGroup> projectGroups = groupService.list(); | |||
for (PerformanceAppraisalProjectGroup projectGroup : projectGroups) { | |||
String verifyLeader = projectGroup.getVerifyLeader(); | |||
if (verifyLeader.equals(employeeCode)) { | |||
if (Objects.nonNull(verifyLeader) && verifyLeader.equals(employeeCode)) { | |||
groups.add(projectGroup); | |||
} | |||
} | |||
@@ -56,9 +56,6 @@ public class PerformanceAppraisalAppIndicator implements Serializable { | |||
@ApiModelProperty("指标定义") | |||
private String indexDef; | |||
@ApiModelProperty("所属区域") | |||
private String regionCode; | |||
@ApiModelProperty("创建时间") | |||
private LocalDateTime createOn; | |||
@@ -39,7 +39,7 @@ public class AppAppraisalIndexDetailVO implements Serializable { | |||
private List<AppBusinessIndexDetailVO> businessIndexDetails; | |||
@ApiModelProperty("评价分数信息") | |||
private Map<String, List<PerformanceAppraisalAppScoreInfo>> appraisalScoreInfo; | |||
private List<PerformanceAppraisalAppScoreInfo> appraisalScoreInfo; | |||
@ApiModelProperty("评价得分信息") | |||
private Map<String, BigDecimal> appraisalTotalScoreInfo; | |||
@@ -411,7 +411,7 @@ public class ProjectLibManage { | |||
.annualAmount(projectInfo.getAnnualPlanAmount()) | |||
.build()); | |||
List<ProjectRenewalFundDeclaration> renewalDeclarations = renewalFundDeclarationService.list(Wrappers.lambdaQuery(ProjectRenewalFundDeclaration.class) | |||
.eq(ProjectRenewalFundDeclaration::getProjectId, vo.getId()) | |||
.eq(ProjectRenewalFundDeclaration::getProjectId, projectInfo.getId()) | |||
.eq(ProjectRenewalFundDeclaration::getApprovalStatus, ProjectRenewalApprovalStatusEnum.PASS.name()) | |||
.eq(ProjectRenewalFundDeclaration::getDeleted,Boolean.FALSE) | |||
.orderByAsc(ProjectRenewalFundDeclaration::getProjectYear)); | |||
@@ -2,7 +2,9 @@ package com.ningdatech.pmapi.projectlib.manage; | |||
import cn.hutool.core.util.StrUtil; | |||
import com.alibaba.excel.EasyExcel; | |||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||
import com.google.common.collect.Lists; | |||
import com.ningdatech.basic.exception.BizException; | |||
import com.ningdatech.basic.function.VUtils; | |||
import com.ningdatech.basic.model.PageVo; | |||
@@ -22,6 +24,7 @@ import com.ningdatech.pmapi.projectlib.model.entity.ProjectRenewalFundDeclaratio | |||
import com.ningdatech.pmapi.projectlib.model.po.ProjectRenewalFundDeclarationPO; | |||
import com.ningdatech.pmapi.projectlib.model.req.ProjectRenewalAuditReq; | |||
import com.ningdatech.pmapi.projectlib.model.req.ProjectRenewalListReq; | |||
import com.ningdatech.pmapi.projectlib.model.vo.AnnualAmountVO; | |||
import com.ningdatech.pmapi.projectlib.model.vo.ProjectRenewalFundDeclarationVO; | |||
import com.ningdatech.pmapi.projectlib.service.IProjectRenewalFundDeclarationService; | |||
import com.ningdatech.pmapi.projectlib.service.IProjectService; | |||
@@ -37,6 +40,7 @@ import java.io.IOException; | |||
import java.time.LocalDateTime; | |||
import java.util.List; | |||
import java.util.Objects; | |||
import java.util.Optional; | |||
import java.util.stream.Collectors; | |||
/** | |||
@@ -99,7 +103,30 @@ public class ProjectRenewalFundManage { | |||
vo.setStage(project.getStage()); | |||
vo.setStatus(project.getStatus()); | |||
vo.setBuildOrgName(project.getBuildOrgName()); | |||
vo.setAnnualPaymentAmount(project.getAnnualPlanAmount()); | |||
vo.setAnnualPaymentAmount(renewal.getAnnualPaymentAmount()); | |||
if (ProjectStatusEnum.ACCEPTED.getCode().equals(project.getStatus())) { | |||
List<AnnualAmountVO> annualAmounts = Lists.newArrayList(); | |||
annualAmounts.add(AnnualAmountVO.builder() | |||
.projectId(project.getId()) | |||
.projectYear(project.getProjectYear()) | |||
.annualAmount(project.getAnnualPlanAmount()) | |||
.build()); | |||
List<ProjectRenewalFundDeclaration> renewalDeclarations = projectRenewalFundDeclarationService.list(Wrappers.lambdaQuery(ProjectRenewalFundDeclaration.class) | |||
.eq(ProjectRenewalFundDeclaration::getProjectId, vo.getProjectId()) | |||
.eq(ProjectRenewalFundDeclaration::getApprovalStatus, ProjectRenewalApprovalStatusEnum.PASS.name()) | |||
.eq(ProjectRenewalFundDeclaration::getDeleted,Boolean.FALSE) | |||
.orderByAsc(ProjectRenewalFundDeclaration::getProjectYear)); | |||
Optional.ofNullable(renewalDeclarations).ifPresent(declarations -> | |||
declarations.forEach(declaration -> { | |||
annualAmounts.add(AnnualAmountVO.builder() | |||
.projectId(project.getId()) | |||
.projectYear(declaration.getProjectYear()) | |||
.annualAmount(declaration.getAnnualPaymentAmount()) | |||
.build()); | |||
}) | |||
); | |||
vo.setAnnualAccumulateAmountList(annualAmounts); | |||
} | |||
return vo; | |||
} | |||
@@ -122,10 +149,11 @@ public class ProjectRenewalFundManage { | |||
ProjectRenewalFundDeclaration oldDeclaration = projectRenewalFundDeclarationService.getById(dto.getId()); | |||
VUtils.isTrue(Objects.isNull(oldDeclaration)).throwMessage(String.format("重新申报失败 【%s】 该申报不存在!",dto.getId())); | |||
BeanUtils.copyProperties(oldDeclaration,declaration); | |||
}else{ | |||
declaration.setCreateOn(LocalDateTime.now()); | |||
declaration.setUpdateOn(LocalDateTime.now()); | |||
} | |||
BeanUtils.copyProperties(dto,declaration); | |||
declaration.setCreateOn(LocalDateTime.now()); | |||
declaration.setUpdateOn(LocalDateTime.now()); | |||
declaration.setApprovalStatus(ProjectRenewalApprovalStatusEnum.PENDING.name()); | |||
declaration.setRegionCode(project.getAreaCode()); | |||
declaration.setOrgCode(project.getBuildOrgCode()); | |||
@@ -7,6 +7,7 @@ import lombok.Data; | |||
import java.io.Serializable; | |||
import java.math.BigDecimal; | |||
import java.time.LocalDateTime; | |||
import java.util.List; | |||
/** | |||
* <p> | |||
@@ -87,4 +88,7 @@ public class ProjectRenewalFundDeclarationVO implements Serializable { | |||
@ApiModelProperty("审核意见") | |||
private String auditOpinion; | |||
@ApiModelProperty("年度投资金额详情") | |||
private List<AnnualAmountVO> annualAccumulateAmountList; | |||
} |
@@ -114,7 +114,7 @@ public class EarlyWarningInstanceNotStartTask { | |||
.eq(Project::getAreaCode, areaCode) | |||
.eq(Project::getNewest, Boolean.TRUE) | |||
.eq(Project::getStatus,projectStutas)); | |||
log.info("needNextProjects :{}",needNextProjects.size()); | |||
//需要发通知的项目 | |||
List<Project> needToWaringProjects = needNextProjects.stream() | |||
.filter(p -> { | |||
@@ -130,9 +130,6 @@ public class EarlyWarningInstanceNotStartTask { | |||
} | |||
} | |||
log.info("projectId :{}",p.getId()); | |||
log.info("秒数差 :{}",Duration.between(p.getUpdateOn(),LocalDateTime.now()).getSeconds()); | |||
if(Duration.between(p.getUpdateOn(),LocalDateTime.now()).toMinutes() >= time * 60 && //time * 60 | |||
Duration.between(p.getUpdateOn(),LocalDateTime.now()).toMinutes() <= time * 60 + 1){ //time * 60 | |||
return Boolean.TRUE; | |||
@@ -221,7 +218,7 @@ public class EarlyWarningInstanceNotStartTask { | |||
.eq(Project::getAreaCode, areaCode) | |||
.eq(Project::getNewest, Boolean.TRUE) | |||
.eq(Project::getStatus,projectStutas)); | |||
log.info("needNextProjects :{}",needNextProjects.size()); | |||
List<String> projectCodes = needNextProjects.stream().map(Project::getProjectCode).collect(Collectors.toList()); | |||
List<Operation> operations = operationService.list(Wrappers.lambdaQuery(Operation.class) | |||