|
@@ -94,6 +94,7 @@ import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO;
|
|
|
import cn.iocoder.yudao.module.system.dal.dataobject.dict.DictDataDO;
|
|
import cn.iocoder.yudao.module.system.dal.dataobject.dict.DictDataDO;
|
|
|
import cn.iocoder.yudao.module.system.service.dept.DeptService;
|
|
import cn.iocoder.yudao.module.system.service.dept.DeptService;
|
|
|
import cn.iocoder.yudao.module.system.service.dict.DictDataService;
|
|
import cn.iocoder.yudao.module.system.service.dict.DictDataService;
|
|
|
|
|
+import cn.iocoder.yudao.module.system.service.dict.DictTypeService;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.google.common.collect.ImmutableList;
|
|
import com.google.common.collect.ImmutableList;
|
|
@@ -101,6 +102,7 @@ import com.google.common.collect.ImmutableMap;
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
import lombok.Data;
|
|
import lombok.Data;
|
|
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
@@ -141,6 +143,7 @@ import static cn.iocoder.yudao.module.pms.enums.ErrorCodeConstant.IOT_DAILY_REPO
|
|
|
@RestController
|
|
@RestController
|
|
|
@RequestMapping("/rq/stat")
|
|
@RequestMapping("/rq/stat")
|
|
|
@Validated
|
|
@Validated
|
|
|
|
|
+@Slf4j
|
|
|
public class IotStaticController {
|
|
public class IotStaticController {
|
|
|
@Resource
|
|
@Resource
|
|
|
private IotFailureReportMapper iotFailureReportMapper;
|
|
private IotFailureReportMapper iotFailureReportMapper;
|
|
@@ -206,6 +209,8 @@ public class IotStaticController {
|
|
|
private IotProjectTaskService iotProjectTaskService;
|
|
private IotProjectTaskService iotProjectTaskService;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private IotYfClassifyMapper iotYfClassifyMapper;
|
|
private IotYfClassifyMapper iotYfClassifyMapper;
|
|
|
|
|
+ @Resource
|
|
|
|
|
+ private DictTypeService dictTypeService;
|
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/main/day")
|
|
@GetMapping("/main/day")
|
|
@@ -2750,8 +2755,10 @@ public class IotStaticController {
|
|
|
if (ObjUtil.isNotEmpty(timeRange) && timeRange.length >= 2) {
|
|
if (ObjUtil.isNotEmpty(timeRange) && timeRange.length >= 2) {
|
|
|
LocalDateTime originalStart = timeRange[0];
|
|
LocalDateTime originalStart = timeRange[0];
|
|
|
LocalDateTime originalEnd = timeRange[1];
|
|
LocalDateTime originalEnd = timeRange[1];
|
|
|
- // 取当年1月1日零点
|
|
|
|
|
- LocalDateTime yearBegin = LocalDateTime.of(originalStart.getYear(), 1, 1, 0, 0);
|
|
|
|
|
|
|
+ int statYear = originalStart.getYear();
|
|
|
|
|
+ // 取当年1月1日零点 从去掉12月26日开始统计 工作量
|
|
|
|
|
+ // LocalDateTime yearBegin = LocalDateTime.of(originalStart.getYear(), 1, 1, 0, 0);
|
|
|
|
|
+ LocalDateTime yearBegin = LocalDateTime.of(statYear - 1, 12, 26, 0, 0);
|
|
|
yearReqVO.setCreateTime(new LocalDateTime[]{yearBegin, originalEnd});
|
|
yearReqVO.setCreateTime(new LocalDateTime[]{yearBegin, originalEnd});
|
|
|
}
|
|
}
|
|
|
List<IotRhDailyReportDO> yearDailyReports = iotRhDailyReportMapper.dailyReports(yearReqVO);
|
|
List<IotRhDailyReportDO> yearDailyReports = iotRhDailyReportMapper.dailyReports(yearReqVO);
|
|
@@ -2991,8 +2998,9 @@ public class IotStaticController {
|
|
|
if (ObjUtil.isNotEmpty(reqVO.getCreateTime()) && reqVO.getCreateTime().length >= 2) {
|
|
if (ObjUtil.isNotEmpty(reqVO.getCreateTime()) && reqVO.getCreateTime().length >= 2) {
|
|
|
// 取查询结束日期
|
|
// 取查询结束日期
|
|
|
LocalDateTime queryEndTime = reqVO.getCreateTime()[1];
|
|
LocalDateTime queryEndTime = reqVO.getCreateTime()[1];
|
|
|
- // 当年1月1日 零点
|
|
|
|
|
- LocalDate yearStartDate = LocalDate.of(queryEndTime.getYear(), 1, 1);
|
|
|
|
|
|
|
+ int startYear = queryEndTime.getYear();
|
|
|
|
|
+ // 当年1月1日 零点 从前一年12月26日统计 累计工作量
|
|
|
|
|
+ LocalDate yearStartDate = LocalDate.of(startYear - 1, 12, 26);
|
|
|
LocalDate queryEndDate = queryEndTime.toLocalDate();
|
|
LocalDate queryEndDate = queryEndTime.toLocalDate();
|
|
|
// 首尾都包含,+1
|
|
// 首尾都包含,+1
|
|
|
yearTotalDay = ChronoUnit.DAYS.between(yearStartDate, queryEndDate) + 1;
|
|
yearTotalDay = ChronoUnit.DAYS.between(yearStartDate, queryEndDate) + 1;
|