|
@@ -0,0 +1,78 @@
|
|
|
+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.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.List;
|
|
|
+
|
|
|
+import static com.rongwei.bscommon.sys.utils.JXKHConstant.DefaultSource.TWO_SOURCE;
|
|
|
+
|
|
|
+
|
|
|
+/**
|
|
|
+ * ScoreCalculationServiceNum1 class
|
|
|
+ *
|
|
|
+ * @author XH
|
|
|
+ * @date 2024/12/09
|
|
|
+ */
|
|
|
+@Service
|
|
|
+public class ScoreCalculationServiceNum30 implements ScoreCalculationService {
|
|
|
+ @Autowired
|
|
|
+ private JtZjfjflqdService jtZjfjflqdService;
|
|
|
+ @Autowired
|
|
|
+ private JtFjglxmService jtFjglxmService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 专家分级分类管理制度为空,扣2分
|
|
|
+ * 专家责任为空扣1分
|
|
|
+ * “是否为新兴业务项目”=是(分级管理-项目清单)且是否为新兴业务专家为否,扣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 = "";
|
|
|
+ //专家分级分类管理制度为空,扣2分
|
|
|
+ if (ObjectUtil.isEmpty(jtGsjtbsj.getZjfjflglzd())) {
|
|
|
+ finalScore = finalScore.subtract(TWO_SOURCE);
|
|
|
+ errorMsg += "公司级:专家分级分类管理制度为空。";
|
|
|
+ }
|
|
|
+ //专家责任为空扣1分
|
|
|
+ if (ObjectUtil.isEmpty(jtGsjtbsj.getZjzr())) {
|
|
|
+ finalScore = finalScore.subtract(BigDecimal.ONE);
|
|
|
+ errorMsg += "公司级:专家责任为空。";
|
|
|
+ }
|
|
|
+ // “是否为新兴业务项目”=是(分级管理-项目清单)且是否为新兴业务专家为否,扣0.5分
|
|
|
+ List<JtFjglxm> list = jtFjglxmService.list(new LambdaQueryWrapper<JtFjglxm>()
|
|
|
+ .eq(JtFjglxm::getDeleted, "0")
|
|
|
+ .in(JtFjglxm::getMainid, khbmList.stream().map(JtXmkh::getId))
|
|
|
+ .eq(JtFjglxm::getSfxxyw, "0"));
|
|
|
+ if (!list.isEmpty()) {
|
|
|
+ List<JtZjfjflqd> list2 = jtZjfjflqdService.list(new LambdaQueryWrapper<JtZjfjflqd>()
|
|
|
+ .eq(JtZjfjflqd::getDeleted, "0")
|
|
|
+ .eq(JtZjfjflqd::getMainid, jtGsjtbsj.getId())
|
|
|
+ .eq(JtZjfjflqd::getSfwxxywzj, "0"));
|
|
|
+ if (list2.isEmpty()) {
|
|
|
+ finalScore = finalScore.subtract(BigDecimal.valueOf(0.5));
|
|
|
+ errorMsg += "公司级:存在新兴业务项目,但没有新兴业务专家。";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return assemblyYcpfhzDetail(jtYcpfhz, jkAssessmentRules, finalScore, errorMsg, currentUser);
|
|
|
+ }
|
|
|
+
|
|
|
+}
|