yxh
14 小时以前 db6ffd6a99b46bd27173503c10aa4cd1afc9c775
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/jobrecord/JobRecordController.java
@@ -11,6 +11,7 @@
import java.util.*;
import java.io.IOException;
import java.time.LocalDateTime;
import cn.lihu.jh.framework.common.pojo.PageParam;
import cn.lihu.jh.framework.common.pojo.PageResult;
@@ -31,6 +32,9 @@
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import static cn.lihu.jh.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.lihu.jh.module.ecg.enums.ErrorCodeConstants.JOB_STATISTIC_TIME_REQUIRED;
@Tag(name = "管理后台 - 工作记录")
@RestController
@@ -126,7 +130,12 @@
    @Operation(summary = "工作量统计")
    @PreAuthorize("@ss.hasPermission('ecg:job-record:statistic')")
    public CommonResult<List<JobRecordStatisticVO>> getJobStatistic(@Valid JobRecordPageReqVO pageReqVO) {
        List<JobRecordStatisticDO> statisticDOList = jobRecordService.getJobStatistic(pageReqVO.getJobTime()[0], pageReqVO.getJobTime()[1]);
        // 作业时间范围必填:原实现直接取 jobTime[0]/[1],缺参时 ArrayIndexOutOfBounds/NullPointer → 前端只看到“系统异常”
        LocalDateTime[] jobTime = pageReqVO.getJobTime();
        if (jobTime == null || jobTime.length < 2 || jobTime[0] == null || jobTime[1] == null) {
            throw exception(JOB_STATISTIC_TIME_REQUIRED);
        }
        List<JobRecordStatisticDO> statisticDOList = jobRecordService.getJobStatistic(jobTime[0], jobTime[1]);
        return success(BeanUtils.toBean(statisticDOList, JobRecordStatisticVO.class));
    }
}