|
@@ -0,0 +1,79 @@
|
|
|
+package com.rongwei.bscommon.sys.strategy.scoreCalculation;
|
|
|
+
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.rongwei.bscommon.sys.service.impl.JtYjbhglServiceImpl;
|
|
|
+import com.rongwei.bsentity.domain.*;
|
|
|
+import com.rongwei.rwadmincommon.system.vo.SysUserVo;
|
|
|
+import com.rongwei.rwcommon.base.BaseDo;
|
|
|
+import net.logstash.logback.encoder.org.apache.commons.lang3.StringUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
+import java.math.BigDecimal;
|
|
|
+import java.util.List;
|
|
|
+import java.util.stream.Collectors;
|
|
|
+
|
|
|
+import static com.rongwei.bscommon.sys.utils.JXKHConstant.DefaultSource.THREE_SOURCE;
|
|
|
+
|
|
|
+/**
|
|
|
+ * ScoreCalculationServiceNum1 class
|
|
|
+ * 意见闭环管理
|
|
|
+ * @author XH
|
|
|
+ * @date 2024/12/09
|
|
|
+ */
|
|
|
+@Service
|
|
|
+public class ScoreCalculationServiceNum9 implements ScoreCalculationService {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private JtYjbhglServiceImpl jtYjbhglService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 意见清单为空,扣3分。
|
|
|
+ * 外业验收意见提出人、意见提出时间不为空,整改反馈时间、整改反馈责任人任一字段为空,扣0.5分/项。
|
|
|
+ * 项目级该模块无数据不扣分。
|
|
|
+ *
|
|
|
+ * @param khbmList
|
|
|
+ * @param jtKhxmList
|
|
|
+ * @param jtGsjtbsj
|
|
|
+ * @param jkAssessmentRules
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public JtYcpfhzDetail soreCalculation(JtYcpfhz jtYcpfhz, List<JtXmkh> khbmList, List<JtKhxm> jtKhxmList, JtGsjtbsj jtGsjtbsj,
|
|
|
+ JkAssessmentRules jkAssessmentRules,
|
|
|
+ SysUserVo currentUser) {
|
|
|
+ // 考核得分
|
|
|
+ BigDecimal finalScore = BigDecimal.ZERO;
|
|
|
+ // 扣分细则
|
|
|
+ String errorMsg = null;
|
|
|
+ if (StringUtils.isBlank(jtGsjtbsj.getYjbhglyjqd())) {
|
|
|
+ errorMsg = "公司级:意见清单为空";
|
|
|
+ finalScore = finalScore.subtract(THREE_SOURCE);
|
|
|
+ return assemblyYcpfhzDetail(jtYcpfhz, jkAssessmentRules, finalScore, errorMsg, currentUser);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 意见清单为空
|
|
|
+ List<JtYjbhgl> jtYjbhglList = jtYjbhglService.list(new LambdaQueryWrapper<JtYjbhgl>()
|
|
|
+ .eq(BaseDo::getDeleted, "0")
|
|
|
+ .in(JtYjbhgl::getMainid, khbmList.stream().map(JtXmkh::getId)));
|
|
|
+
|
|
|
+ if (jtYjbhglList.isEmpty()) {
|
|
|
+ errorMsg = "项目级:外业验收清单为空";
|
|
|
+ finalScore = THREE_SOURCE;
|
|
|
+ return assemblyYcpfhzDetail(jtYcpfhz, jkAssessmentRules, finalScore, errorMsg, currentUser);
|
|
|
+ }
|
|
|
+ List<String> projectName = jtYjbhglList.stream().filter(data -> (StringUtils.isNotBlank(data.getYjtcr()) && data.getYjtcsj() != null) &&
|
|
|
+ (StringUtils.isBlank(data.getZgfkzrr()) || data.getZgfksj() == null))
|
|
|
+ .map(JtYjbhgl::getXmmc)
|
|
|
+ .distinct()
|
|
|
+ .limit(6)
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ if (projectName.isEmpty()) {
|
|
|
+ return assemblyYcpfhzDetail(jtYcpfhz, jkAssessmentRules, THREE_SOURCE, "", currentUser);
|
|
|
+ }
|
|
|
+ errorMsg = "项目级:以下项目名称:" + String.join(",", projectName) + " 外业验收意见提出人和意见提出时间不为空,但整改反馈时间或整改反馈责任人任为空";
|
|
|
+ finalScore = finalScore.subtract(BigDecimal.valueOf(projectName.size()));
|
|
|
+ return assemblyYcpfhzDetail(jtYcpfhz, jkAssessmentRules, finalScore, errorMsg, currentUser);
|
|
|
+ }
|
|
|
+
|
|
|
+}
|