|
@@ -1,7 +1,8 @@
|
|
package com.rongwei.bscommon.sys.strategy.scoreCalculation;
|
|
package com.rongwei.bscommon.sys.strategy.scoreCalculation;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
-import com.rongwei.bscommon.sys.service.impl.JtZbrygwjzrfgqdServiceImpl;
|
|
|
|
|
|
+import com.rongwei.bscommon.sys.service.impl.JtFjglxmServiceImpl;
|
|
|
|
+import com.rongwei.bscommon.sys.service.impl.JtPxjhqdServiceImpl;
|
|
import com.rongwei.bsentity.domain.*;
|
|
import com.rongwei.bsentity.domain.*;
|
|
import com.rongwei.rwadmincommon.system.vo.SysUserVo;
|
|
import com.rongwei.rwadmincommon.system.vo.SysUserVo;
|
|
import com.rongwei.rwcommon.base.BaseDo;
|
|
import com.rongwei.rwcommon.base.BaseDo;
|
|
@@ -10,9 +11,12 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
|
+import java.util.Collections;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
+import static com.rongwei.bscommon.sys.utils.JXKHConstant.DatePattern.DATE_PATTERN_YM;
|
|
import static com.rongwei.bscommon.sys.utils.JXKHConstant.DefaultSource.TWO_SOURCE;
|
|
import static com.rongwei.bscommon.sys.utils.JXKHConstant.DefaultSource.TWO_SOURCE;
|
|
import static com.rongwei.bscommon.sys.utils.JXKHConstant.DefaultSource.ZERO_POINT_FIVE_SOURCE;
|
|
import static com.rongwei.bscommon.sys.utils.JXKHConstant.DefaultSource.ZERO_POINT_FIVE_SOURCE;
|
|
|
|
|
|
@@ -27,13 +31,16 @@ public class ScoreCalculationServiceNum20 implements ScoreCalculationService {
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
- private JtZbrygwjzrfgqdServiceImpl jtZbrygwjzrfgqdService;
|
|
|
|
|
|
+ private JtPxjhqdServiceImpl jtPxjhqdService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private JtFjglxmServiceImpl jtFjglxmService;
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 按实施方案要求组织开展了技术方案标准化实施行动得1分;开展了国际标准制修订能力提升行动方案得1分。
|
|
|
|
- * 未按文件要求组织申报标准立项申报或结题总结、优秀技术成果和集团工法申报,每项扣0.5分,包括迟报漏报等
|
|
|
|
- * 集团组织开展的优秀总工程师培训班、优秀工程部长培训班等培训汇总获优秀个人的得0.5分/人,最高得1分。
|
|
|
|
|
|
+ * 培训计划为空,扣3分。
|
|
|
|
+ * 每个培训开展时间与计划培训时间不在同一月份扣0.5分/培训计划。
|
|
|
|
+ * 培训分类中不存在年度技术交流会,扣1分。
|
|
|
|
+ * 若“是否属于新兴业务项目”=是(分级管理-项目清单),新兴业务培训人员清单为空,扣0.5分。
|
|
*
|
|
*
|
|
* @param khbmList
|
|
* @param khbmList
|
|
* @param jtKhxmList
|
|
* @param jtKhxmList
|
|
@@ -47,7 +54,43 @@ public class ScoreCalculationServiceNum20 implements ScoreCalculationService {
|
|
BigDecimal finalScore = jkAssessmentRules.getWeight();
|
|
BigDecimal finalScore = jkAssessmentRules.getWeight();
|
|
// 扣分细则
|
|
// 扣分细则
|
|
String errorMsg = null;
|
|
String errorMsg = null;
|
|
-
|
|
|
|
|
|
+ List<JtPxjhqd> list = Collections.unmodifiableList(jtPxjhqdService.list(new LambdaQueryWrapper<JtPxjhqd>()
|
|
|
|
+ .eq(BaseDo::getDeleted, "0")
|
|
|
|
+ .eq(JtPxjhqd::getMainid, jtGsjtbsj.getId())));
|
|
|
|
+ if (list.isEmpty()) {
|
|
|
|
+ finalScore = finalScore.subtract(TWO_SOURCE);
|
|
|
|
+ errorMsg = "公司级:培训计划为空";
|
|
|
|
+ return assemblyYcpfhzDetail(jtYcpfhz, jkAssessmentRules, finalScore, errorMsg, currentUser);
|
|
|
|
+ }
|
|
|
|
+ SimpleDateFormat simpleDateFormat = new SimpleDateFormat(DATE_PATTERN_YM);
|
|
|
|
+ List<String> collect = list.stream().filter(info -> info.getJhpxsj() != null && info.getPxkzsj() != null &&
|
|
|
|
+ !simpleDateFormat.format(info.getJhpxsj()).equals(simpleDateFormat.format(info.getPxkzsj())))
|
|
|
|
+ .map(JtPxjhqd::getPxmc).distinct().collect(Collectors.toList());
|
|
|
|
+ if (!collect.isEmpty()) {
|
|
|
|
+ finalScore = finalScore.subtract(ZERO_POINT_FIVE_SOURCE.multiply(BigDecimal.valueOf(collect.size())));
|
|
|
|
+ errorMsg = "公司级:以下培训计划" + String.join(",", collect) + "的培训开展时间与计划培训时间不在同一月份 ";
|
|
|
|
+ if (collect.size() >= 6) {
|
|
|
|
+ finalScore = BigDecimal.ZERO;
|
|
|
|
+ return assemblyYcpfhzDetail(jtYcpfhz, jkAssessmentRules, finalScore, errorMsg, currentUser);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ boolean b = list.stream().anyMatch(info -> info.getPxfl().equals("0"));
|
|
|
|
+ if (b) {
|
|
|
|
+ finalScore = finalScore.subtract(BigDecimal.ONE);
|
|
|
|
+ errorMsg = errorMsg + "公司级: 不包含培训分类为年度技术交流会的培训计划";
|
|
|
|
+ }
|
|
|
|
+ // 若“是否属于新兴业务项目”=是(分级管理-项目清单),新兴业务培训人员清单为空,扣0.5分
|
|
|
|
+ List<JtFjglxm> fjglxmList = jtFjglxmService.list(new LambdaQueryWrapper<JtFjglxm>()
|
|
|
|
+ .eq(BaseDo::getDeleted, "0")
|
|
|
|
+ .eq(JtFjglxm::getSfxxyw, "0")
|
|
|
|
+ .in(JtFjglxm::getMainid, khbmList.stream().map(JtXmkh::getId)));
|
|
|
|
+ if (!fjglxmList.isEmpty() && list.stream().anyMatch(info -> StringUtils.isBlank(info.getXxywpxryqd()))) {
|
|
|
|
+ finalScore = finalScore.subtract(ZERO_POINT_FIVE_SOURCE);
|
|
|
|
+ errorMsg = errorMsg + "公司级: 存在新兴业务项目,但新兴业务培训人员清单为空";
|
|
|
|
+ }
|
|
|
|
+ if (finalScore.compareTo(BigDecimal.ZERO) <= 0) {
|
|
|
|
+ finalScore = BigDecimal.ZERO;
|
|
|
|
+ }
|
|
return assemblyYcpfhzDetail(jtYcpfhz, jkAssessmentRules, finalScore, errorMsg, currentUser);
|
|
return assemblyYcpfhzDetail(jtYcpfhz, jkAssessmentRules, finalScore, errorMsg, currentUser);
|
|
}
|
|
}
|
|
|
|
|