Commit 6d1e7585 authored by yzc's avatar yzc

fix: 会员考评首页统计修改

parent 40d0d787
...@@ -11,7 +11,7 @@ import java.util.Arrays; ...@@ -11,7 +11,7 @@ import java.util.Arrays;
public enum MemberAppraisalItemStatusEnum { public enum MemberAppraisalItemStatusEnum {
/** /**
* 待发布考评表 - 0 * 待考评打分 - 0
*/ */
WAIT_GRADE(0, "待考评打分"), WAIT_GRADE(0, "待考评打分"),
......
...@@ -24,11 +24,21 @@ public interface IReportFeignService { ...@@ -24,11 +24,21 @@ public interface IReportFeignService {
void increaseReport(Integer dataSource, Integer operateType, Long memberId, Long roleId); void increaseReport(Integer dataSource, Integer operateType, Long memberId, Long roleId);
/** /**
* 首页统计增加(数量)
*/
void increaseReport(Integer dataSource, Integer operateType, Long memberId, Long roleId, Integer count);
/**
* 首页统计减少 * 首页统计减少
*/ */
void reduceReport(Integer dataSource, Integer operateType, Long memberId, Long roleId); void reduceReport(Integer dataSource, Integer operateType, Long memberId, Long roleId);
/** /**
* 首页统计减少(数量)
*/
void reduceReport(Integer dataSource, Integer operateType, Long memberId, Long roleId, Integer count);
/**
* 首页统计一方减少一方增加 * 首页统计一方减少一方增加
*/ */
void reduceAndIncreaseReport(Integer dataSource, Integer operateType, Long memberId, Long roleId, void reduceAndIncreaseReport(Integer dataSource, Integer operateType, Long memberId, Long roleId,
......
...@@ -94,9 +94,15 @@ public class ReportFeignServiceImpl implements IReportFeignService { ...@@ -94,9 +94,15 @@ public class ReportFeignServiceImpl implements IReportFeignService {
} }
} }
@Async
@Override @Override
public void increaseReport(Integer dataSource, Integer operateType, Long memberId, Long roleId) { public void increaseReport(Integer dataSource, Integer operateType, Long memberId, Long roleId) {
this.increaseReport(dataSource, operateType, memberId, roleId, 1);
}
@Async
@Override
public void increaseReport(Integer dataSource, Integer operateType, Long memberId, Long roleId, Integer count) {
List<OperateNoticeVO> operateNoticeVOList = new ArrayList<>(); List<OperateNoticeVO> operateNoticeVOList = new ArrayList<>();
// 待发送 - 增加 // 待发送 - 增加
OperateNoticeVO increaseOperateNotice = new OperateNoticeVO(); OperateNoticeVO increaseOperateNotice = new OperateNoticeVO();
...@@ -104,7 +110,7 @@ public class ReportFeignServiceImpl implements IReportFeignService { ...@@ -104,7 +110,7 @@ public class ReportFeignServiceImpl implements IReportFeignService {
increaseOperateNotice.setRoleId(roleId); increaseOperateNotice.setRoleId(roleId);
increaseOperateNotice.setDataSource(dataSource); increaseOperateNotice.setDataSource(dataSource);
increaseOperateNotice.setIncreaseOperateType(operateType); increaseOperateNotice.setIncreaseOperateType(operateType);
increaseOperateNotice.setIncreaseCount(1L); increaseOperateNotice.setIncreaseCount(Long.valueOf(count));
operateNoticeVOList.add(increaseOperateNotice); operateNoticeVOList.add(increaseOperateNotice);
try { try {
...@@ -114,9 +120,15 @@ public class ReportFeignServiceImpl implements IReportFeignService { ...@@ -114,9 +120,15 @@ public class ReportFeignServiceImpl implements IReportFeignService {
} }
} }
@Async
@Override @Override
public void reduceReport(Integer dataSource, Integer operateType, Long memberId, Long roleId) { public void reduceReport(Integer dataSource, Integer operateType, Long memberId, Long roleId) {
this.reduceReport(dataSource, operateType, memberId, roleId, 1);
}
@Async
@Override
public void reduceReport(Integer dataSource, Integer operateType, Long memberId, Long roleId, Integer count) {
List<OperateNoticeVO> operateNoticeVOList = new ArrayList<>(); List<OperateNoticeVO> operateNoticeVOList = new ArrayList<>();
// 待整改 - 减少 // 待整改 - 减少
OperateNoticeVO reduceOperateNotice = new OperateNoticeVO(); OperateNoticeVO reduceOperateNotice = new OperateNoticeVO();
...@@ -124,7 +136,7 @@ public class ReportFeignServiceImpl implements IReportFeignService { ...@@ -124,7 +136,7 @@ public class ReportFeignServiceImpl implements IReportFeignService {
reduceOperateNotice.setRoleId(roleId); reduceOperateNotice.setRoleId(roleId);
reduceOperateNotice.setDataSource(dataSource); reduceOperateNotice.setDataSource(dataSource);
reduceOperateNotice.setReduceOperateType(operateType); reduceOperateNotice.setReduceOperateType(operateType);
reduceOperateNotice.setReduceCount(1L); reduceOperateNotice.setReduceCount(Long.valueOf(count));
operateNoticeVOList.add(reduceOperateNotice); operateNoticeVOList.add(reduceOperateNotice);
try { try {
...@@ -134,6 +146,7 @@ public class ReportFeignServiceImpl implements IReportFeignService { ...@@ -134,6 +146,7 @@ public class ReportFeignServiceImpl implements IReportFeignService {
} }
} }
@Async @Async
@Override @Override
public void reduceAndIncreaseReport(Integer dataSource, Integer operateType, Long memberId, Long roleId, Integer subDataSource, Integer subOperateType, Long subMemberId, Long subRoleId) { public void reduceAndIncreaseReport(Integer dataSource, Integer operateType, Long memberId, Long roleId, Integer subDataSource, Integer subOperateType, Long subMemberId, Long subRoleId) {
......
...@@ -1032,6 +1032,8 @@ public class MemberAppraisalServiceImpl implements IMemberAppraisalService { ...@@ -1032,6 +1032,8 @@ public class MemberAppraisalServiceImpl implements IMemberAppraisalService {
// 根据itemIds查询考评项目 // 根据itemIds查询考评项目
List<Long> itemIdList = submitVO.getItems().stream().map(MemberAppraisalItemSubmitVO::getId).collect(Collectors.toList()); List<Long> itemIdList = submitVO.getItems().stream().map(MemberAppraisalItemSubmitVO::getId).collect(Collectors.toList());
List<MemberAppraisalItemDO> items = memberAppraisalItemRepository.findAllById(itemIdList); List<MemberAppraisalItemDO> items = memberAppraisalItemRepository.findAllById(itemIdList);
// 未打分的考评打分数量
int notGradeCount = 0;
for (MemberAppraisalItemDO item : items) { for (MemberAppraisalItemDO item : items) {
// 判断是否属于同一考评 // 判断是否属于同一考评
if (!item.getAppraisal().getId().equals(memberAppraisalDO.getId())) { if (!item.getAppraisal().getId().equals(memberAppraisalDO.getId())) {
...@@ -1044,6 +1046,11 @@ public class MemberAppraisalServiceImpl implements IMemberAppraisalService { ...@@ -1044,6 +1046,11 @@ public class MemberAppraisalServiceImpl implements IMemberAppraisalService {
return Wrapper.fail(ResponseCode.MC_MS_APPRAISAL_ITEM_NO_RELATION); return Wrapper.fail(ResponseCode.MC_MS_APPRAISAL_ITEM_NO_RELATION);
} }
// 统计未打分数量
if (MemberAppraisalItemStatusEnum.WAIT_GRADE.getCode().equals(item.getStatus())) {
notGradeCount++;
}
item.setScoreWeight(itemSubmitVO.getScoreWeight()); item.setScoreWeight(itemSubmitVO.getScoreWeight());
BigDecimal grade = Objects.isNull(itemSubmitVO.getGrade()) ? BigDecimal.ZERO : itemSubmitVO.getGrade(); BigDecimal grade = Objects.isNull(itemSubmitVO.getGrade()) ? BigDecimal.ZERO : itemSubmitVO.getGrade();
item.setGrade(grade); item.setGrade(grade);
...@@ -1075,6 +1082,9 @@ public class MemberAppraisalServiceImpl implements IMemberAppraisalService { ...@@ -1075,6 +1082,9 @@ public class MemberAppraisalServiceImpl implements IMemberAppraisalService {
// 首页统计 // 首页统计
reportFeignService.reduceAndIncreaseReport(OperateDataSourceEnum.MEMBER_KPI.getCode(), MemberKpiOperateTypeEnum.TO_BE_COMMIT_COUNT.getCode(), memberAppraisalDO.getMember().getId(), memberAppraisalDO.getRole().getId(), reportFeignService.reduceAndIncreaseReport(OperateDataSourceEnum.MEMBER_KPI.getCode(), MemberKpiOperateTypeEnum.TO_BE_COMMIT_COUNT.getCode(), memberAppraisalDO.getMember().getId(), memberAppraisalDO.getRole().getId(),
OperateDataSourceEnum.MEMBER_KPI.getCode(), MemberKpiOperateTypeEnum.TO_BE_VALIFY_STEP1_COUNT.getCode(), memberAppraisalDO.getMember().getId(), memberAppraisalDO.getRole().getId()); OperateDataSourceEnum.MEMBER_KPI.getCode(), MemberKpiOperateTypeEnum.TO_BE_VALIFY_STEP1_COUNT.getCode(), memberAppraisalDO.getMember().getId(), memberAppraisalDO.getRole().getId());
// 减少剩余打分的数量
reportFeignService.reduceReport(OperateDataSourceEnum.MEMBER_KPI.getCode(), MemberKpiOperateTypeEnum.TO_BE_SCORING_COUNT.getCode(),
memberAppraisalDO.getMember().getId(), memberAppraisalDO.getRole().getId(), notGradeCount);
// 发送消息 // 发送消息
messageFeignService.sendSystemMessage(memberAppraisalDO.getMember().getId(), memberAppraisalDO.getRole().getId(), messageFeignService.sendSystemMessage(memberAppraisalDO.getMember().getId(), memberAppraisalDO.getRole().getId(),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment