|
@@ -0,0 +1,80 @@
|
|
|
+package com.rongwei.bscommon.sys.strategy.scoreCalculation;
|
|
|
+
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.rongwei.bscommon.sys.service.JtFjglxmService;
|
|
|
+import com.rongwei.bscommon.sys.service.JtXcjhqdService;
|
|
|
+import com.rongwei.bscommon.sys.service.JtZjfjflqdService;
|
|
|
+import com.rongwei.bsentity.domain.*;
|
|
|
+import com.rongwei.rwadmincommon.system.vo.SysUserVo;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
+import java.math.BigDecimal;
|
|
|
+import java.util.LinkedList;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+import static com.rongwei.bscommon.sys.utils.JXKHConstant.DefaultSource.TWO_SOURCE;
|
|
|
+import static com.rongwei.bscommon.sys.utils.JXKHConstant.DefaultSource.ZERO_POINT_FIVE_SOURCE;
|
|
|
+
|
|
|
+
|
|
|
+/**
|
|
|
+ * ScoreCalculationServiceNum1 class
|
|
|
+ *
|
|
|
+ * @author XH
|
|
|
+ * @date 2024/12/09
|
|
|
+ */
|
|
|
+@Service
|
|
|
+public class ScoreCalculationServiceNum29 implements ScoreCalculationService {
|
|
|
+ @Autowired
|
|
|
+ private JtXcjhqdService jtXcjhqdService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 巡查通报文件为空扣2分。
|
|
|
+ * 整改反馈文件为空扣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 = jkAssessmentRules.getWeight();
|
|
|
+ // 扣分细则
|
|
|
+ String errorMsg = "";
|
|
|
+
|
|
|
+ List<JtXcjhqd> list = jtXcjhqdService.list(new LambdaQueryWrapper<JtXcjhqd>()
|
|
|
+ .eq(JtXcjhqd::getDeleted, "0")
|
|
|
+ .in(JtXcjhqd::getMainid, khbmList.stream().map(JtXmkh::getId)));
|
|
|
+ //巡查通报文件为空扣2分。
|
|
|
+ long count = list.stream().filter(info -> ObjectUtil.isEmpty(info.getXctbwj())).count();
|
|
|
+ if (count > 0) {
|
|
|
+ finalScore = finalScore.subtract(TWO_SOURCE);
|
|
|
+ errorMsg = errorMsg + "公司级:巡查通报文件为空。";
|
|
|
+ return assemblyYcpfhzDetail(jtYcpfhz, jkAssessmentRules, finalScore, errorMsg, currentUser);
|
|
|
+ }
|
|
|
+ //整改反馈文件为空扣0.5分/项。
|
|
|
+ List<String> xmmcList = new LinkedList<>();
|
|
|
+ for (JtXcjhqd jtXcjhqd : list) {
|
|
|
+ if (xmmcList.contains(jtXcjhqd.getXmmc())) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ xmmcList.add(jtXcjhqd.getXmmc());
|
|
|
+ if (ObjectUtil.isEmpty(jtXcjhqd.getZgfkwj())) {
|
|
|
+ finalScore = finalScore.subtract(ZERO_POINT_FIVE_SOURCE);
|
|
|
+ errorMsg = errorMsg + "项目级:" + jtXcjhqd.getXmmc() + "的整改反馈文件为空。";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (finalScore.compareTo(BigDecimal.ZERO) < 0) {
|
|
|
+ finalScore = BigDecimal.ZERO;
|
|
|
+ }
|
|
|
+ return assemblyYcpfhzDetail(jtYcpfhz, jkAssessmentRules, finalScore, errorMsg, currentUser);
|
|
|
+ }
|
|
|
+
|
|
|
+}
|