Przeglądaj źródła

Merge remote-tracking branch 'origin/20210223' into 20210223

wangyangyang 3 lat temu
rodzic
commit
9407b7f358

+ 7 - 2
operation_manager/src/main/java/com/huaxu/evaluation/dto/EvaluationResultDto.java

@@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
+import javax.validation.constraints.NotNull;
 import java.util.List;
 
 /**
@@ -17,7 +18,6 @@ import java.util.List;
 @ApiModel(value = "考评结果")
 public class EvaluationResultDto extends  BasePageDto{
 
-
     @ApiModelProperty(value="用户名")
     private String userName;
 
@@ -30,6 +30,7 @@ public class EvaluationResultDto extends  BasePageDto{
     @ApiModelProperty(value="考评状态:0未考评 1已考评")
     private Integer state;
 
+    @NotNull
     @ApiModelProperty(value="类型:周期(0月度 1季度 2年度)")
     private Integer cycle;
 
@@ -39,6 +40,10 @@ public class EvaluationResultDto extends  BasePageDto{
     @ApiModelProperty(value="月/季度")
     private Integer month;
 
+    @NotNull
     @ApiModelProperty(value="1:考评,2:得分")
-    private int sort;
+    private Integer sort;
+
+    @ApiModelProperty(value="查找ID")
+    private List<Integer> ids;
 }

+ 43 - 16
operation_manager/src/main/java/com/huaxu/evaluation/job/EvaluationResultJob.java

@@ -84,15 +84,13 @@ public class EvaluationResultJob {
     static Map<String,  List<Integer>> userIdsMap = new HashMap<>();
 
 
-
     /***
-     *@Scheduled(cron = "0/5 * * * * ?")
+     *  @Scheduled(cron = "0/5 * * * * ?")
      *  异步启动定时任务
      * @Author lihui
      * @Date 18:26 2021/5/17
      * @return void
      **/
-
     @Async
     public void run(){
         if (lock){
@@ -100,6 +98,8 @@ public class EvaluationResultJob {
         }
         lock = true;
         log.info("============绩效考评数据生成begin=====================");
+        String startTime = null;
+        String endTime   = null;
         EvaluationCycleEntity queryEntity = new EvaluationCycleEntity();
         queryEntity.setEvaluationDay(Calendar.getInstance().get(Calendar.DAY_OF_MONTH));
         // 首先查询当天哪些公司设置了绩效考评
@@ -111,7 +111,13 @@ public class EvaluationResultJob {
                         !EvaluationUtil.sameMonth(1)) {
                     continue;
                 }
-                userTask(evaluationCycleEntity, queryEntity.getEvaluationDay());
+                // 根据类型(0月度 1季度 2年度)得到当前的开始时间和结束时间,如果是按季度,当月必须是1,4,7,10
+                startTime = EvaluationUtil.getStartTime(evaluationCycleEntity.getType(), queryEntity.getEvaluationDay());
+                endTime   = EvaluationUtil.getEndTime(evaluationCycleEntity.getType(), queryEntity.getEvaluationDay());
+                if (startTime == null || endTime == null) {
+                    continue;
+                }
+                userTask(evaluationCycleEntity,  startTime,  endTime);
             }
         } catch (Exception e) {
             log.error("绩效考评定时任务出错->", e);
@@ -124,22 +130,17 @@ public class EvaluationResultJob {
     }
 
     /***
-     * 用户任务分解
+     * 用户任务分解 ..
      * @author lihui
-     * @date 10:44 2021/5/19
-     * @param evaluationCycleEntity : 考评
-     * @param evaluationDay : 考评周期
+     * @date 11:12 2021/5/20
+     * @param evaluationCycleEntity : 参数
+     * @param startTime :  开始时间
+     * @param endTime :   结束时间
      * @return void
      **/
-    public void userTask(EvaluationCycleEntity evaluationCycleEntity, Integer evaluationDay){
+    public void userTask(EvaluationCycleEntity evaluationCycleEntity, String startTime, String endTime){
         List<EvaluationItemVo> itemEntityList = null;
         Integer cycle = evaluationCycleEntity.getType();
-        // 根据类型(0月度 1季度 2年度)得到当前的开始时间和结束时间,如果是按季度,当月必须是1,4,7,10
-        String startTime = EvaluationUtil.getStartTime(cycle, evaluationDay);
-        String endTime   = EvaluationUtil.getEndTime(cycle, evaluationDay);
-        if (startTime == null || endTime == null) {
-            return;
-        }
         // 查询该租户公司下的所有用户
         List<Integer> userIds = getUserIds(evaluationCycleEntity.getTenantId(), evaluationCycleEntity.getCompanyOrgId());
         Map<Long, UserEntity> userEntityMap = toMap(userIds);
@@ -254,7 +255,7 @@ public class EvaluationResultJob {
                 taskEntity.setNoCompleteCount(taskEntity.getNoCompleteCount() + (!completedBoolean ? 1 : 0));
                 int addMinute = valueCondition == null ? EvaluationUtil.minute(dto.getDateLimit()) : valueCondition.intValue();
                 // 计算完成的是否属于延期完成
-                if (completedBoolean && EvaluationUtil.isDelay(dto.getFinishDate(), dto.getPlanFinishDate(), addMinute)) {
+                if (completedBoolean && isDelay(dto, addMinute)) {
                     taskEntity.setDelayCompleteCount(taskEntity.getDelayCompleteCount() + 1);
                 }
             }
@@ -269,6 +270,32 @@ public class EvaluationResultJob {
         return taskEntity;
     }
 
+    /***
+     * 是否过期
+     * 任务:
+     *    开始时间:date_create
+     *    计划完成时间:plan_end_date  + " 23:59:59"
+     *    完成时间:finish_date
+     * 工单:
+     *    开始时间: date_create
+     *    计划完成时间: send_time + date_limit分钟
+     *    完成时间:finish_date
+     * @author lihui
+     * @date 10:56 2021/5/20
+     * @param dto :
+     * @param addMinute :
+     * @return boolean
+     **/
+    private boolean isDelay(WorkOrderManageDto dto, int addMinute){
+        Date planFinishDate = dto.getSendTime();
+        // 判断是不是任务
+        if (!EvaluationUtil.isWork(dto.getOrderTypeId())) {
+            planFinishDate = DatesUtil.parseDate(DatesUtil.formatDate(dto.getPlanFinishDate(), "yyyy-MM-dd") + " 23:59:59",
+                    "yyyy-MM-dd HH:mm:ss");
+        }
+        return EvaluationUtil.isDelay(dto.getFinishDate(), planFinishDate, addMinute);
+    }
+
     /**
      * @Author lihui
      * @Description 获取部门考评项

+ 1 - 1
operation_manager/src/main/java/com/huaxu/evaluation/service/impl/EvaluationResultServiceImpl.java

@@ -166,7 +166,7 @@ public class EvaluationResultServiceImpl implements EvaluationResultService {
         queryDto.setUserType("3");
         queryDto.setPermissonType(currentUser.getPermissonType());
         // 季度需要格式化月份
-        if (queryDto.getCycle() == EvaluationCycleEnums.QUARTER.getType()){
+        if (queryDto.getCycle() != null && queryDto.getCycle() == EvaluationCycleEnums.QUARTER.getType()){
             queryDto.setMonth(format(queryDto.getCycle(), queryDto.getMonth()));
         }
         return queryDto;

+ 10 - 0
operation_manager/src/main/java/com/huaxu/evaluation/vo/EvaluationResultTaskDetailsVo.java

@@ -1,5 +1,6 @@
 package com.huaxu.evaluation.vo;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fasterxml.jackson.annotation.JsonIgnore;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -7,6 +8,7 @@ import io.swagger.models.auth.In;
 import lombok.Data;
 
 import java.math.BigDecimal;
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -56,6 +58,14 @@ public class EvaluationResultTaskDetailsVo {
     @ApiModelProperty(value = "考评周期")
     private String cycle;
 
+    @ApiModelProperty(value = "考评周期")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date dateStart;
+
+    @ApiModelProperty(value = "考评周期")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date dateEnd;
+
     @JsonIgnore
     @ApiModelProperty(value = "考评年份")
     private String year;

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

@@ -1,4 +1,5 @@
 package com.huaxu.order.controller;
+import cn.hutool.core.collection.CollectionUtil;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -7,10 +8,14 @@ import com.huaxu.common.ConvertXY;
 import com.huaxu.common.FileUploadUtil;
 import com.huaxu.common.MyPoint;
 import com.huaxu.entity.Message;
+import com.huaxu.evaluation.entity.EvaluationCycleEntity;
+import com.huaxu.evaluation.enums.EvaluationCycleEnums;
+import com.huaxu.evaluation.service.EvaluationCycleService;
 import com.huaxu.model.AjaxMessage;
 import com.huaxu.model.LoginUser;
 import com.huaxu.model.Pagination;
 import com.huaxu.model.ResultStatus;
+import com.huaxu.order.dto.WorkOrderEvaluationDto;
 import com.huaxu.order.dto.WorkOrderManageByAlarmDto;
 import com.huaxu.order.dto.WorkOrderManageDto;
 import com.huaxu.order.entity.WorkFlowDetail;
@@ -29,9 +34,11 @@ import com.huaxu.task.service.PlanManageService;
 import com.huaxu.util.DatesUtil;
 import com.huaxu.util.MessageSendUtil;
 import com.huaxu.util.UserUtil;
+import com.huaxu.utils.EvaluationUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
+import lombok.extern.slf4j.Slf4j;
 import org.activiti.engine.task.Task;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
@@ -39,6 +46,7 @@ import org.springframework.util.StringUtils;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
+import javax.validation.Valid;
 import java.io.IOException;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
@@ -48,6 +56,7 @@ import java.util.stream.Collectors;
 @RestController
 @RequestMapping("/order/workOrderManage")
 @Api(tags = "工单管理")
+@Slf4j
 public class WorkOrderManageController {
 
     @Autowired
@@ -68,6 +77,9 @@ public class WorkOrderManageController {
     @Autowired
     UserCenterClient userCenterClient;
 
+    @Autowired
+    private EvaluationCycleService evaluationCycleService;
+
     @Autowired
     private MessageSendUtil messageSendUtil;
 
@@ -238,8 +250,9 @@ public class WorkOrderManageController {
                 if(childOrder.size()>1){
                     for(int i=1;i<childOrder.size();i++) {
                         WorkOrderManageDto child=childOrder.get(i);
-                        if(child.getOrderTypeId()==4&&child.getOrderStatus()!=2&&child.getOrderStatus()!=3)
+                        if(child.getOrderTypeId()==4&&child.getOrderStatus()!=2&&child.getOrderStatus()!=3) {
                             return new AjaxMessage<>(ResultStatus.CHILD_ORDER_ING);
+                        }
                     }
                 }
                 //判断父单完成情况后才可以提交
@@ -1026,46 +1039,36 @@ public class WorkOrderManageController {
         return new AjaxMessage<>(ResultStatus.OK, result );
     }
 
+
     /**
      * APP运维管理全部查询
      * @return Response对象
      */
-    @RequestMapping(value = "findWorkOrderPage", method = RequestMethod.GET)
     @ApiOperation(value = "APP运维管理全部查询")
-    public AjaxMessage<Pagination<WorkOrderManageDto>> findWorkOrderPage(@ApiParam(value = "用户Id")@RequestParam(required = false) Integer userId,
-                                                              @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 == 1) {
-            if (month == 1) {
-                startTime = year + "-1-1 00:00:00";
-                endTime   = year + "-3";
-            } else if (month == 2 ){
-                startTime = year + "-4-1 00:00:00";
-                endTime   = year + "-6";
-            } else if (month == 3) {
-                startTime = year + "-7-1 00:00:00";
-                endTime   = year + "-9";
-            } else if (month == 4) {
-                startTime = year + "-10-1 00:00:00";
-                endTime   = year + "-12";
-            }
-        } else if (cycle == 0) {
-            startTime = year + "-" + month + "-1 00:00:00";
-            endTime   = year + "-" + month;
-        } else if (cycle == 2) {
-            startTime = year + "-1-1 00:00:00";
-            endTime   = year + "-12";
-        }
-        endTime = endTime + "-" + DatesUtil.getMouthDays(endTime) + " 23:59:59";
-        IPage<WorkOrderManageDto> iPage = new Page<>(pageNum, pageSize);
-        iPage = workOrderManageService.selectByTime(iPage, userId, startTime, endTime);
+    @RequestMapping(value = "findWorkOrderPage", method = RequestMethod.POST)
+    @ResponseBody
+    public AjaxMessage<Pagination<WorkOrderManageDto>> findWorkOrderPage(@RequestBody @Valid WorkOrderEvaluationDto dto) {
+        IPage<WorkOrderManageDto> iPage = new Page<>(dto.getPageNum(), dto.getPageSize());
+        iPage = workOrderManageService.selectByTime(iPage,  dto.getTenantId(), dto.getUserId(), dto.getStartTime(), dto.getEndTime());
         Pagination<WorkOrderManageDto> pages = new Pagination<>(iPage);
         setName(pages.getList());
+        if (CollectionUtil.isEmpty(pages.getList())) {
+            return new AjaxMessage<>(ResultStatus.OK, pages);
+        }
+        /**
+         *任务:  开始时间:date_create  计划完成时间:plan_end_date  + " 23:59:59"  完成时间:finish_date
+         *工单:  开始时间:date_create  计划完成时间:send_time + date_limit分钟     完成时间:finish_date
+         */
+        Date planFinishDate = null;
+        for (WorkOrderManageDto workOrderManageDto : pages.getList()) {
+            if (EvaluationUtil.isWork(workOrderManageDto.getOrderTypeId())) {
+                planFinishDate = DatesUtil.addMinuteOfDate(workOrderManageDto.getSendTime(), EvaluationUtil.minute(workOrderManageDto.getDateLimit()));
+            } else {
+                planFinishDate = DatesUtil.parseDate(DatesUtil.formatDate(workOrderManageDto.getPlanFinishDate(), "yyyy-MM-dd") + " 23:59:59",
+                        "yyyy-MM-dd HH:mm:ss");
+            }
+            workOrderManageDto.setPlanFinishDate(planFinishDate);
+        }
         return new AjaxMessage<>(ResultStatus.OK, pages);
     }
 

+ 38 - 0
operation_manager/src/main/java/com/huaxu/order/dto/WorkOrderEvaluationDto.java

@@ -0,0 +1,38 @@
+package com.huaxu.order.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import io.swagger.annotations.ApiParam;
+import lombok.Data;
+import org.springframework.web.bind.annotation.RequestParam;
+
+/**
+ * 工作流绩效考评
+ *
+ * @author lihui
+ * @version V1.0
+ * @date 2021/5/19
+ **/
+@Data
+@ApiModel(value = "工作流绩效考评")
+public class WorkOrderEvaluationDto {
+
+    @ApiModelProperty(value = "用户Id")
+    private Integer userId;
+
+    @ApiModelProperty(value = "租户ID")
+    private String tenantId;
+
+    @ApiModelProperty(value = "开始时间")
+    private String startTime;
+
+    @ApiModelProperty(value = "结束时间")
+    private String endTime;
+
+    @ApiModelProperty(value = "页数")
+    private Integer pageNum;
+
+    @ApiModelProperty(value = "条数")
+    private  Integer pageSize;
+
+}

+ 1 - 1
operation_manager/src/main/java/com/huaxu/order/service/WorkOrderManageService.java

@@ -149,7 +149,7 @@ public interface WorkOrderManageService {
     * @Param [page, userId, startTime, endTime]
     * @return com.baomidou.mybatisplus.extension.plugins.pagination.Page<com.huaxu.order.dto.WorkOrderManageDto>
     **/
-    Page<WorkOrderManageDto> selectByTime(IPage<WorkOrderManageDto> page, Integer userId, String startTime, String endTime);
+    Page<WorkOrderManageDto> selectByTime(IPage<WorkOrderManageDto> page, String tenantId, Integer userId, String startTime, String endTime);
 
     /**
     * @Author lihui

+ 2 - 3
operation_manager/src/main/java/com/huaxu/order/service/impl/WorkOrderManageServiceImpl.java

@@ -294,9 +294,8 @@ public class WorkOrderManageServiceImpl implements WorkOrderManageService {
     }
 
     @Override
-    public Page<WorkOrderManageDto> selectByTime(IPage<WorkOrderManageDto> page, Integer userId, String startTime, String endTime) {
-        LoginUser currentUser = UserUtil.getCurrentUser();
-        return workOrderManageMapper.selectByTime(page, userId, currentUser.getTenantId(), startTime, endTime);
+    public Page<WorkOrderManageDto> selectByTime(IPage<WorkOrderManageDto> page, String tenantId, Integer userId, String startTime, String endTime) {
+        return workOrderManageMapper.selectByTime(page, userId, tenantId, startTime, endTime);
     }
 
     @Override

+ 137 - 20
operation_manager/src/main/java/com/huaxu/utils/EvaluationUtil.java

@@ -3,6 +3,7 @@ package com.huaxu.utils;
 import com.huaxu.evaluation.enums.EvaluationCycleEnums;
 import com.huaxu.evaluation.vo.EvaluationItemVo;
 import com.huaxu.evaluation.vo.EvaluationResultVo;
+import com.huaxu.order.dto.WorkOrderManageDto;
 import com.huaxu.util.DatesUtil;
 import org.apache.commons.lang3.StringUtils;
 
@@ -10,10 +11,7 @@ import java.math.BigDecimal;
 import java.math.RoundingMode;
 import java.time.LocalDate;
 import java.time.temporal.TemporalAdjusters;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.List;
+import java.util.*;
 import java.util.stream.Collectors;
 
 /**
@@ -30,6 +28,51 @@ public class EvaluationUtil {
      */
     private static final String DATE_STRING = "%s年%s";
 
+    /**
+     * 3月
+     */
+    private static final int MARCH = 3;
+
+    /**
+     * 6月
+     */
+    private static final int JUNE = 6;
+
+    /**
+     * 9月
+     */
+    private static final int SEPTEMBER = 9;
+
+    /**
+     * 12月
+     */
+    private static final int DECEMBER = 12;
+
+    /**
+     * 第一季度
+     */
+    private static final String Q1 = "1";
+
+    /**
+     * 第二度
+     */
+    private static final String Q2 = "2";
+
+    /**
+     * 第三季度
+     */
+    private static final String Q3 = "3";
+
+    /**
+     * 第四季度
+     */
+    private static final String Q4 = "4";
+
+    /**
+     * 工单类型
+     */
+    static List<Integer> workList = Arrays.asList(1,2,3,4,5,6);
+
     private static Calendar getCalendar(){
         return Calendar.getInstance();
     }
@@ -40,6 +83,15 @@ public class EvaluationUtil {
         return calendar;
     }
 
+    /**
+     * 判断是不是工单
+     * @param orderTypeId
+     * @return
+     */
+    public static boolean isWork(Integer orderTypeId){
+        return workList.contains(orderTypeId);
+    }
+
     /***
      * 格式化考评周期时间
      * @author lihui
@@ -50,20 +102,32 @@ public class EvaluationUtil {
      * @return java.lang.String
      **/
     public static String formatCycle(int cycle, String year, String month){
-        String monthString = "";
-        if (cycle != EvaluationCycleEnums.YEAR.getType()) {
-            monthString = cycle == 0 ?  month + "月" :  month + "季度";
+        // 格式化月度
+        if (cycle == EvaluationCycleEnums.MONTH.getType()) {
+            return String.format(DATE_STRING, year, month + "月");
         }
-        if ("3".equals(month)) {
-            month = "1";
-        } else if ("6".equals(month)){
-            month = "2";
-        } else if ("9".equals(month)){
-            month = "3";
-        } else if ("12".equals(month)){
-            month = "4";
+        // 格式化年度
+        if (cycle == EvaluationCycleEnums.YEAR.getType()) {
+            return String.format(DATE_STRING, year, "");
         }
-        return String.format(DATE_STRING, year, monthString);
+        // 格式化季度
+        switch (Integer.parseInt(month)) {
+            case MARCH :
+                month = Q1;
+                break;
+            case JUNE :
+                month = Q2;
+                break;
+            case SEPTEMBER :
+                month = Q3;
+                break;
+            case DECEMBER :
+                month = Q4;
+                break;
+            default:
+                month = "";
+        }
+        return String.format(DATE_STRING, year, month + "季度");
     }
 
     public static Integer toInteger(Long lon) {
@@ -242,6 +306,59 @@ public class EvaluationUtil {
         return localDate.toString() + " 23:59:59";
     }
 
+    public static String getStartTime(int cycle, int year, int newMonth, int day) {
+        LocalDate localDate = LocalDate.now();
+        localDate = localDate.withYear(year);
+        localDate = localDate.withMonth(newMonth);
+        if (cycle == EvaluationCycleEnums.MONTH.getType()) {
+            localDate = localDate.plusMonths(-1);
+        }
+
+        if (cycle == EvaluationCycleEnums.QUARTER.getType()){
+            int month = newMonth == 1 ? 1 :
+                        newMonth == 2 ? 4 :
+                        newMonth == 3 ? 7 :
+                        newMonth == 4 ? 10 : null;
+
+            localDate = localDate.withMonth(month);
+        }
+
+        if (cycle == EvaluationCycleEnums.YEAR.getType()){
+            localDate = localDate.plusYears(-1);
+            localDate = localDate.withMonth(1);
+        }
+        localDate = localDate.withDayOfMonth(day);
+        return localDate.toString() + " 00:00:00";
+    }
+
+    public static String getEndTime(int cycle, int year, int newMonth, int day) {
+        LocalDate localDate = LocalDate.now();
+        localDate = localDate.withYear(year);
+        localDate = localDate.withMonth(newMonth);
+        if (cycle == EvaluationCycleEnums.MONTH.getType()) {
+            localDate = day == 1 ? localDate.plusMonths(-1) : localDate;
+        }
+
+        if (cycle == EvaluationCycleEnums.QUARTER.getType()){
+            int month = newMonth == 1 ? 4 :
+                        newMonth == 2 ? 7 :
+                        newMonth == 3 ? 10 :
+                        newMonth == 4 ? 1 : null;
+            localDate = localDate.withMonth(month);
+            // 设置月份
+            localDate = day == 1 ? localDate.plusMonths(-1) : localDate;
+            localDate = newMonth == 4 ? localDate.plusYears(1) : localDate;
+        }
+
+        if (cycle == EvaluationCycleEnums.YEAR.getType()){
+            localDate = localDate.withMonth(1);
+            localDate = day == 1 ? localDate.plusMonths(-1) : localDate;
+        }
+
+        localDate = day != 1 ? localDate.withDayOfMonth(day - 1) : localDate.with(TemporalAdjusters.lastDayOfMonth());
+        return localDate.toString() + " 23:59:59";
+    }
+
     public static LocalDate getLocalDateByCycle(String startTime, String endTime, int cycle){
         // 季度获取后面的时间
         String quarterString = "4,7,10,1";
@@ -255,7 +372,7 @@ public class EvaluationUtil {
     }
 
     public static List<List<String>> getExcelTitle(){
-        String string[] = {"No.","用户名","所属公司","所属部门","绩效等级","绩效得分","考评周期"};
+        String[] string = new String[]{"No.","用户名","所属公司","所属部门","绩效等级","绩效得分","考评周期"};
         List<List<String>> list = new ArrayList<>();
         for (String str : string) {
             List<String> title = new ArrayList<>();
@@ -275,7 +392,7 @@ public class EvaluationUtil {
             list.add(evaluationResultVo.getCompanyOrgName());
             list.add(evaluationResultVo.getDeptOrgName());
             list.add(evaluationResultVo.getEvaluationGrade());
-            list.add(evaluationResultVo.getValue().toString());
+            list.add(evaluationResultVo.getValue()!= null ? evaluationResultVo.getValue().toString() : "");
             list.add(evaluationResultVo.getCycle());
             result.add(list);
             total++;
@@ -285,8 +402,8 @@ public class EvaluationUtil {
 
 
     public static void main(String[] args) {
-        LocalDate localDate = EvaluationUtil.getLocalDateByCycle("2020-12-01 00:00:00","2021-01-30 00:00:00",1);
-        System.out.println(localDate.getYear() + "-" + localDate.getMonthValue());
+        System.out.println(EvaluationUtil.getStartTime(1, 15));
+        System.out.println(EvaluationUtil.getEndTime(1, 15));
     }
 
 }

+ 31 - 22
operation_manager/src/main/resources/mapper/evaluation/EvaluationResultMapper.xml

@@ -218,29 +218,38 @@
         <include refid="evaluation_result_list"></include>
         from sc_evaluation_result a
         <where>
-            a.status = 1 and a.tenant_id = #{dto.tenantId}
-            <if test="dto.userType != null and dto.userType != -999 and dto.userType != -9999 and  dto.programItems != null and dto.programItems.size() > 0">
-                <include refid="permissonSql"></include>
-            </if>
-            <if test="dto.userName != null">
-                and a.EVALUATION_BE like CONCAT('%',#{dto.userName,jdbcType=VARCHAR},'%')
-            </if>
-            <if test="dto.companyOrgId != null">
-                and a.COMPANY_ORG_ID = #{dto.companyOrgId}
-            </if>
-            <if test="dto.deptOrgId != null">
-                and a.DEPT_ORG_ID = #{dto.deptOrgId}
-            </if>
-            <if test="dto.sort == 1 and dto.state != null">
-                and a.`STATE` = #{dto.state}
-            </if>
-            <if test="dto.sort == 2">
-                and a.`STATE` = 1
+            <if test="dto.ids != null">
+                and a.id in
+                <foreach collection="dto.ids" item="resultId" open="(" close=")" separator=",">
+                    #{resultId}
+                </foreach>
             </if>
-            and a.`cycle` = #{dto.cycle}
-            and a.`YEAR`  = #{dto.year}
-            <if test="dto.cycle != 2">
-                and a.`month` = #{dto.month}
+            <if test="dto.ids == null">
+                a.status = 1 and a.tenant_id = #{dto.tenantId}
+                <if test="dto.userType != null and dto.userType != -999 and dto.userType != -9999 and  dto.programItems != null and dto.programItems.size() > 0">
+                    <include refid="permissonSql"></include>
+                </if>
+
+                <if test="dto.userName != null">
+                    and a.EVALUATION_BE like CONCAT('%',#{dto.userName,jdbcType=VARCHAR},'%')
+                </if>
+                <if test="dto.companyOrgId != null">
+                    and a.COMPANY_ORG_ID = #{dto.companyOrgId}
+                </if>
+                <if test="dto.deptOrgId != null">
+                    and a.DEPT_ORG_ID = #{dto.deptOrgId}
+                </if>
+                <if test="dto.sort == 1 and dto.state != null">
+                    and a.`STATE` = #{dto.state}
+                </if>
+                <if test="dto.sort == 2">
+                    and a.`STATE` = 1
+                </if>
+                and a.`cycle` = #{dto.cycle}
+                and a.`YEAR`  = #{dto.year}
+                <if test="dto.cycle != 2">
+                    and a.`month` = #{dto.month}
+                </if>
             </if>
         </where>
         <if test="dto.sort == 1">

+ 3 - 1
operation_manager/src/main/resources/mapper/evaluation/EvaluationResultTaskMapper.xml

@@ -19,6 +19,8 @@
         <result property="month" column="MONTH" jdbcType="INTEGER"/>
         <result property="cycle" column="CYCLE" jdbcType="INTEGER"/>
         <result property="delayCompleteCount" column="DELAY_COMPLETE_COUNT" jdbcType="INTEGER"/>
+        <result property="dateStart" column="DATE_START" jdbcType="INTEGER"/>
+        <result property="dateEnd" column="DATE_END" jdbcType="INTEGER"/>
         <collection property="detailsVoList"  resultMap="detailsVoMap"></collection>
     </resultMap>
 
@@ -33,7 +35,7 @@
 
     <select id="findResultTaskDetail" resultMap="evaluationResultTaskDetailsVo">
         select
-            r.id as "resultId",r.`YEAR`, r.`MONTH`,r.`VALUE` as "performanceScore",r.EVALUATION_GRADE,r.COMPANY_ORG_ID,r.TENANT_ID,r.CYCLE,
+            r.id as "resultId",r.`YEAR`, r.`MONTH`,r.`VALUE` as "performanceScore",r.EVALUATION_GRADE,r.COMPANY_ORG_ID,r.TENANT_ID,r.CYCLE,r.DATE_START,DATE_END,
             t.TOTAL_COUNT,t.COMPLETE_COUNT,t.NO_COMPLETE_COUNT,t.DELAY_COMPLETE_COUNT,t.COMPLETION_RATE,t.DELAY_RATE,
             d.ID as "resultDetailsId", d.`VALUE` as "score",
             i.`NAME` as "itemName",i.`VALUE` as "itemScore",i.REMARKS

+ 1 - 1
operation_manager/src/main/resources/mapper/order/WorkOrderManageMapper.xml

@@ -1189,7 +1189,7 @@
       and (t2.id is null or t1.order_user_id=t2.handle_user_id)
       and t1.date_create between #{startTime} and #{endTime}
     union
-    select id,plan_id,plan_date,task_area_name,task_type,current_task_name,create_by,update_by,task_content,plan_status,in_process_status,plan_end_date,finish_date,date_create,"0"
+    select id,plan_id,plan_date,task_area_name,task_type,current_task_name,create_by,update_by,plan_name,plan_status,in_process_status,plan_end_date,finish_date,date_create,"0"
     from sc_plan_manage
     where (find_in_set(#{userId},current_users)
       or id in(select flow_id from sc_work_flow_log where flow_type=1 and find_in_set(#{userId},handle_user_id)))