Browse Source

绩效考核

lihui007 3 years ago
parent
commit
f369f5de49

+ 13 - 3
operation_manager/src/main/java/com/huaxu/evaluation/job/EvaluationResultJob.java

@@ -72,7 +72,7 @@ public class EvaluationResultJob {
 
 
 
-    //@Scheduled(cron = "0/5 * * * * ?")
+    @Scheduled(cron = "0/5 * * * * ?")
     @Async
     public void run(){
         if (lock){
@@ -114,11 +114,14 @@ public class EvaluationResultJob {
     **/
     public void userTask(String tenantId, Integer companyOrgId, Integer cycle){
         // 查询该租户公司下的所有用户
-        List<Integer> userIds = getUserIds(tenantId, companyOrgId);
-        Map<Long, UserEntity> userEntityMap = toMap(userIds);
         String startTime = null;
         String endTime   = null;
         List<EvaluationItemVo> itemEntityList = null;
+        List<Integer> userIds = getUserIds(tenantId, companyOrgId);
+        Map<Long, UserEntity> userEntityMap = toMap(userIds);
+        if (userEntityMap == null) {
+            return;
+        }
         for (Integer userId : userIds) {
             UserEntity userEntity = userEntityMap.get(Long.parseLong(userId.toString()));
             if (userEntity == null) {
@@ -299,6 +302,13 @@ public class EvaluationResultJob {
         return userEntities.stream().collect(Collectors.toMap(UserEntity::getId, a -> a,(k1, k2)->k1));
     }
 
+    /**
+    * @Author lihui
+    * @Description 获取对应的分数
+    * @Date 11:25 2021/5/14
+    * @Param [type, list, evaluationValue]
+    * @return java.math.BigDecimal
+    **/
     private BigDecimal getScore (Integer type, List<EvaluationItemValueVo> list, BigDecimal evaluationValue){
         if (type != 1 && type != 2) {
             return null;

+ 3 - 3
operation_manager/src/main/java/com/huaxu/evaluation/vo/EvaluationResultDetailsVo.java

@@ -7,21 +7,21 @@ import lombok.Data;
 import java.math.BigDecimal;
 
 /**
- * @ClassName EvaluationResultVo
+ * @ClassName EvaluationResultDetailsVo
  * @Description: 考核结果出参
  * @Author lihui
  * @Date 2021/5/7
  * @Version V1.0
  **/
 @Data
-@ApiModel(value = "考评结果详情")
+@ApiModel(value = "考评结果详情vo")
 public class EvaluationResultDetailsVo {
 
     @ApiModelProperty(value = "考评结果详情ID")
     private Integer resultDetailsId;
 
     @ApiModelProperty(value = "考评项名字")
-    private Integer itemName;
+    private String itemName;
 
     @ApiModelProperty(value = "考评项总分值")
     private BigDecimal itemScore;

+ 3 - 0
operation_manager/src/main/java/com/huaxu/evaluation/vo/EvaluationResultVo.java

@@ -27,6 +27,9 @@ public class EvaluationResultVo {
     @ApiModelProperty(value = "被考评人")
     private String evaluationBe;
 
+    @ApiModelProperty(value = "被考评人用户ID")
+    private String evaluationBeUserId;
+
     @ApiModelProperty(value = "所属公司名字")
     private String companyOrgName;
 

+ 4 - 4
operation_manager/src/main/java/com/huaxu/order/controller/WorkOrderManageController.java

@@ -1033,14 +1033,14 @@ public class WorkOrderManageController {
     @RequestMapping(value = "findWorkOrderPage", method = RequestMethod.GET)
     @ApiOperation(value = "APP运维管理全部查询")
     public AjaxMessage<Pagination<WorkOrderManageDto>> findWorkOrderPage(@ApiParam(value = "用户Id")@RequestParam(required = false) Integer userId,
-                                                              @ApiParam(value = "周期类型:1月度,2季度,3年度")@RequestParam(required = false) Integer cycle,
+                                                              @ApiParam(value = "周期类型:0月度,1季度,2年度")@RequestParam(required = false) Integer cycle,
                                                               @ApiParam(value = "年份")@RequestParam(required = false) Integer year,
                                                               @ApiParam(value = "月份")@RequestParam(required = false) Integer month,
                                                               @ApiParam(value = "页数", required = true)@RequestParam Integer pageNum,
                                                               @ApiParam(value = "条数", required = true)@RequestParam Integer pageSize) {
         String startTime = null;
         String endTime   = null;
-        if (cycle == 2) {
+        if (cycle == 1) {
             if (month == 1) {
                 startTime = year + "-1-1 00:00:00";
                 endTime   = year + "-3";
@@ -1054,10 +1054,10 @@ public class WorkOrderManageController {
                 startTime = year + "-10-1 00:00:00";
                 endTime   = year + "-12";
             }
-        } else if (cycle == 1) {
+        } else if (cycle == 0) {
             startTime = year + "-" + month + "-1 00:00:00";
             endTime   = year + "-" + month;
-        } else if (cycle == 3) {
+        } else if (cycle == 2) {
             startTime = year + "-1-1 00:00:00";
             endTime   = year + "-12";
         }

+ 3 - 2
operation_manager/src/main/resources/mapper/evaluation/EvaluationResultMapper.xml

@@ -9,6 +9,7 @@
            a.DEPT_ORG_ID,
            a.EVALUATION_BY,
            a.EVALUATION_BE,
+           a.EVALUATION_BE_USER_ID,
            a.STATE,
            a.CYCLE,
            a.YEAR,
@@ -49,11 +50,11 @@
     </sql>
 
     <insert id="insertEvaluationResult" useGeneratedKeys="true"  keyProperty="id" parameterType="com.huaxu.evaluation.entity.EvaluationResultEntity">
-        insert sc_evaluation_result (TENANT_ID,COMPANY_ORG_ID,DEPT_ORG_ID,EVALUATION_BE,`STATE`,`CYCLE`,`YEAR`,`MONTH`,EVALUATION_GRADE,
+        insert sc_evaluation_result (TENANT_ID,COMPANY_ORG_ID,DEPT_ORG_ID,EVALUATION_BE,EVALUATION_BE_USER_ID,`STATE`,`CYCLE`,`YEAR`,`MONTH`,EVALUATION_GRADE,
                 `VALUE`,DATE_START,DATE_END,DATE_EVALUATION,STATUS,DATE_CREATE,CREATE_BY,DATE_UPDATE,UPDATE_BY)
         values
             (
-            #{item.tenantId}, #{item.companyOrgId}, #{item.deptOrgId}, #{item.evaluationBe}, #{item.state},
+            #{item.tenantId}, #{item.companyOrgId}, #{item.deptOrgId}, #{item.evaluationBe}, #{item.evaluationBeUserId},#{item.state},
             #{item.cycle}, #{item.year}, #{item.month}, #{item.evaluationGrade}, #{item.value},
             #{item.dateStart}, #{item.dateEnd}, #{item.dateEvaluation}, #{item.status}, #{item.dateCreate},
             #{item.createBy}, #{item.dateUpdate}, #{item.updateBy})