Prechádzať zdrojové kódy

feature 代码提交

xiahan 7 mesiacov pred
rodič
commit
c25632454c

+ 49 - 6
jsglkh-common/src/main/java/com/rongwei/bscommon/sys/strategy/scoreCalculation/ScoreCalculationServiceNum20.java

@@ -1,7 +1,8 @@
 package com.rongwei.bscommon.sys.strategy.scoreCalculation;
 
 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.rwadmincommon.system.vo.SysUserVo;
 import com.rongwei.rwcommon.base.BaseDo;
@@ -10,9 +11,12 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.math.BigDecimal;
+import java.text.SimpleDateFormat;
+import java.util.Collections;
 import java.util.List;
 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.ZERO_POINT_FIVE_SOURCE;
 
@@ -27,13 +31,16 @@ public class ScoreCalculationServiceNum20 implements ScoreCalculationService {
 
 
     @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 jtKhxmList
@@ -47,7 +54,43 @@ public class ScoreCalculationServiceNum20 implements ScoreCalculationService {
         BigDecimal finalScore = jkAssessmentRules.getWeight();
         // 扣分细则
         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);
     }
 

+ 16 - 15
jsglkh-entity/src/main/java/com/rongwei/bsentity/domain/JtPxjhqd.java

@@ -20,87 +20,88 @@ public class JtPxjhqd extends BaseDo implements Serializable {
     /**
      * 主键ID
      */
-    @TableId(value = "ID")
+    @TableId
     private String id;
 
     /**
      * 数据编码
      */
-    @TableField(value = "DATAID")
     private String dataid;
 
     /**
      * 数据主键
      */
-    @TableField(value = "INDEXID")
     private String indexid;
 
     /**
      * 租户id
      */
-    @TableField(value = "TENANTID")
     private String tenantid;
 
     /**
      * 扩展json格式配置
      */
-    @TableField(value = "ROPTION")
     private String roption;
-
     /**
      * 培训编号
      */
-    @TableField(value = "PXBH")
     private String pxbh;
 
     /**
      * 培训名称
      */
-    @TableField(value = "PXMC")
     private String pxmc;
 
     /**
      * 培训目的
      */
-    @TableField(value = "PXMD")
     private String pxmd;
 
     /**
      * 培训分类
      */
-    @TableField(value = "PXFL")
     private String pxfl;
 
     /**
      * 计划培训时间
      */
-    @TableField(value = "JHPXSJ")
     private Date jhpxsj;
 
     /**
      * 培训开展时间
      */
-    @TableField(value = "PXKZSJ")
     private Date pxkzsj;
 
     /**
      * 培训会议通知
      */
-    @TableField(value = "PXHYTZ")
     private String pxhytz;
 
     /**
      * 新兴业务培训人员清单
      */
-    @TableField(value = "XXYWPXRYQD")
     private String xxywpxryqd;
 
     /**
      * 同步状态
      */
-    @TableField(value = "SYNCSTATE")
     private String syncstate;
 
+    /**
+     * 年份
+     */
+    private String year;
+
+    /**
+     * 管理单位
+     */
+    private String gldw;
+
+    /**
+     * 公司考核管理ID
+     */
+    private String mainid;
+
     @TableField(exist = false)
     private static final long serialVersionUID = 1L;
 }