|
@@ -8,18 +8,25 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
|
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
|
|
|
+import cn.iocoder.yudao.framework.datapermission.core.annotation.DataPermission;
|
|
|
import cn.iocoder.yudao.framework.datapermission.core.util.DataPermissionUtils;
|
|
import cn.iocoder.yudao.framework.datapermission.core.util.DataPermissionUtils;
|
|
|
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
|
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
|
|
import cn.iocoder.yudao.module.pms.controller.admin.iotprojectinfo.vo.IotProjectInfoPageReqVO;
|
|
import cn.iocoder.yudao.module.pms.controller.admin.iotprojectinfo.vo.IotProjectInfoPageReqVO;
|
|
|
import cn.iocoder.yudao.module.pms.controller.admin.iotprojecttask.vo.IotProjectTaskPageReqVO;
|
|
import cn.iocoder.yudao.module.pms.controller.admin.iotprojecttask.vo.IotProjectTaskPageReqVO;
|
|
|
|
|
+import cn.iocoder.yudao.module.pms.controller.admin.iotrddailyreport.vo.IotRdDailyReportPageReqVO;
|
|
|
import cn.iocoder.yudao.module.pms.controller.admin.iotrhdailyreport.vo.*;
|
|
import cn.iocoder.yudao.module.pms.controller.admin.iotrhdailyreport.vo.*;
|
|
|
|
|
+import cn.iocoder.yudao.module.pms.controller.admin.iotrydailyreport.vo.IotRyDailyReportPageReqVO;
|
|
|
|
|
+import cn.iocoder.yudao.module.pms.controller.admin.iotrydailyreport.vo.IotRyDailyReportStatisticsVO;
|
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.iotprojectinfo.IotProjectInfoDO;
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.iotprojectinfo.IotProjectInfoDO;
|
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.iotprojecttask.IotProjectTaskDO;
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.iotprojecttask.IotProjectTaskDO;
|
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.iotprojecttaskattrs.IotTaskAttrModelProperty;
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.iotprojecttaskattrs.IotTaskAttrModelProperty;
|
|
|
|
|
+import cn.iocoder.yudao.module.pms.dal.dataobject.iotrddailyreport.IotRdDailyReportDO;
|
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.iotrhdailyreport.IotRhDailyReportDO;
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.iotrhdailyreport.IotRhDailyReportDO;
|
|
|
import cn.iocoder.yudao.module.pms.service.iotprojectinfo.IotProjectInfoService;
|
|
import cn.iocoder.yudao.module.pms.service.iotprojectinfo.IotProjectInfoService;
|
|
|
import cn.iocoder.yudao.module.pms.service.iotprojecttask.IotProjectTaskService;
|
|
import cn.iocoder.yudao.module.pms.service.iotprojecttask.IotProjectTaskService;
|
|
|
|
|
+import cn.iocoder.yudao.module.pms.service.iotrddailyreport.IotRdDailyReportService;
|
|
|
import cn.iocoder.yudao.module.pms.service.iotrhdailyreport.IotRhDailyReportService;
|
|
import cn.iocoder.yudao.module.pms.service.iotrhdailyreport.IotRhDailyReportService;
|
|
|
|
|
+import cn.iocoder.yudao.module.pms.service.iotrydailyreport.IotRyDailyReportService;
|
|
|
import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO;
|
|
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;
|
|
@@ -36,6 +43,7 @@ import javax.servlet.http.HttpServletResponse;
|
|
|
import javax.validation.Valid;
|
|
import javax.validation.Valid;
|
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
|
|
|
+import java.math.RoundingMode;
|
|
|
import java.text.DecimalFormat;
|
|
import java.text.DecimalFormat;
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
import java.util.concurrent.atomic.AtomicReference;
|
|
import java.util.concurrent.atomic.AtomicReference;
|
|
@@ -60,6 +68,10 @@ public class IotRhDailyReportController {
|
|
|
@Resource
|
|
@Resource
|
|
|
private IotProjectTaskService iotProjectTaskService;
|
|
private IotProjectTaskService iotProjectTaskService;
|
|
|
@Resource
|
|
@Resource
|
|
|
|
|
+ private IotRdDailyReportService iotRdDailyReportService;
|
|
|
|
|
+ @Resource
|
|
|
|
|
+ private IotRyDailyReportService iotRyDailyReportService;
|
|
|
|
|
+ @Resource
|
|
|
private DictDataService dictDataService;
|
|
private DictDataService dictDataService;
|
|
|
|
|
|
|
|
@PostMapping("/create")
|
|
@PostMapping("/create")
|
|
@@ -132,6 +144,94 @@ public class IotRhDailyReportController {
|
|
|
return success(new PageResult<>(buildRhDailyReports(pageResult.getList()), pageResult.getTotal()));
|
|
return success(new PageResult<>(buildRhDailyReports(pageResult.getList()), pageResult.getTotal()));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @GetMapping("/completeRate")
|
|
|
|
|
+ @Operation(summary = "查询各专业公司日报完成率")
|
|
|
|
|
+ @DataPermission(enable = false)
|
|
|
|
|
+ public CommonResult<List<Map<String, Object>>> completeRate(@Valid IotRhDailyReportPageReqVO pageReqVO) {
|
|
|
|
|
+ List<Map<String, Object>> result = new ArrayList<>();
|
|
|
|
|
+ DataPermissionUtils.executeIgnore(() -> {
|
|
|
|
|
+ // 查询3家专业公司的日报完成率
|
|
|
|
|
+ // 瑞都日报完成率
|
|
|
|
|
+ Map<String, Object> rdRate = new HashMap<>();
|
|
|
|
|
+ rdRate.put("department", "四川瑞都");
|
|
|
|
|
+ IotRdDailyReportPageReqVO rdReqVO = new IotRdDailyReportPageReqVO();
|
|
|
|
|
+ rdReqVO.setCreateTime(pageReqVO.getCreateTime());
|
|
|
|
|
+ List<IotRdDailyReportDO> rdReports = iotRdDailyReportService.dailyReports(rdReqVO);
|
|
|
|
|
+ // 瑞都日报总数
|
|
|
|
|
+ Integer rdTotalReportCount = 0;
|
|
|
|
|
+ // 瑞都已填报完成日报总数
|
|
|
|
|
+ Integer rdFilledReportCount = 0;
|
|
|
|
|
+ if (CollUtil.isNotEmpty(rdReports)) {
|
|
|
|
|
+ for (IotRdDailyReportDO report : rdReports) {
|
|
|
|
|
+ if (1 == report.getPlatformWell() || 0 == report.getPlatformWell()) {
|
|
|
|
|
+ rdTotalReportCount++;
|
|
|
|
|
+ if (1 == report.getStatus()) {
|
|
|
|
|
+ // 已经填报完成的日报
|
|
|
|
|
+ rdFilledReportCount++;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ // 计算瑞都日报填报率
|
|
|
|
|
+ if (rdTotalReportCount != 0) {
|
|
|
|
|
+ BigDecimal filled = BigDecimal.valueOf(rdFilledReportCount);
|
|
|
|
|
+ BigDecimal total = BigDecimal.valueOf(rdTotalReportCount);
|
|
|
|
|
+ BigDecimal rate = filled.divide(total, 2, RoundingMode.HALF_UP);
|
|
|
|
|
+ rdRate.put("rate", rate);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ result.add(rdRate);
|
|
|
|
|
+ // 计算瑞恒日报填报完成率
|
|
|
|
|
+ Map<String, Object> rhRate = new HashMap<>();
|
|
|
|
|
+ rhRate.put("department", "瑞恒兴域");
|
|
|
|
|
+ long totalRhCount = 0;
|
|
|
|
|
+ long completeRhCount = 0;
|
|
|
|
|
+ List<IotRhDailyReportStatisticsVO> rhReports = iotRhDailyReportService.rhDailyReportStatistics(pageReqVO);
|
|
|
|
|
+ if (CollUtil.isNotEmpty(rhReports)) {
|
|
|
|
|
+ for (IotRhDailyReportStatisticsVO rhReport : rhReports) {
|
|
|
|
|
+ if ("总数".equals(rhReport.getGroupName())) {
|
|
|
|
|
+ totalRhCount = rhReport.getCount();
|
|
|
|
|
+ }
|
|
|
|
|
+ if ("已填报".equals(rhReport.getGroupName())) {
|
|
|
|
|
+ completeRhCount = rhReport.getCount();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if (totalRhCount != 0l) {
|
|
|
|
|
+ BigDecimal filled = BigDecimal.valueOf(completeRhCount);
|
|
|
|
|
+ BigDecimal total = BigDecimal.valueOf(totalRhCount);
|
|
|
|
|
+ BigDecimal rate = filled.divide(total, 2, RoundingMode.HALF_UP);
|
|
|
|
|
+ rhRate.put("瑞恒兴域", rate);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ result.add(rhRate);
|
|
|
|
|
+ // 计算瑞鹰日报填报完成率
|
|
|
|
|
+ Map<String, Object> ryRate = new HashMap<>();
|
|
|
|
|
+ ryRate.put("department", "瑞鹰国际");
|
|
|
|
|
+ long totalRyCount = 0;
|
|
|
|
|
+ long completeRyCount = 0;
|
|
|
|
|
+ IotRyDailyReportPageReqVO ryReqVO = new IotRyDailyReportPageReqVO();
|
|
|
|
|
+ ryReqVO.setCreateTime(pageReqVO.getCreateTime());
|
|
|
|
|
+ List<IotRyDailyReportStatisticsVO> ryReports = iotRyDailyReportService.ryDailyReportStatistics(ryReqVO);
|
|
|
|
|
+ if (CollUtil.isNotEmpty(ryReports)) {
|
|
|
|
|
+ for (IotRyDailyReportStatisticsVO ryReport : ryReports) {
|
|
|
|
|
+ if ("总数".equals(ryReport.getGroupName())) {
|
|
|
|
|
+ totalRyCount = ryReport.getCount();
|
|
|
|
|
+ }
|
|
|
|
|
+ if ("已填报".equals(ryReport.getGroupName())) {
|
|
|
|
|
+ completeRyCount = ryReport.getCount();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if (totalRhCount != 0l) {
|
|
|
|
|
+ BigDecimal filled = BigDecimal.valueOf(completeRyCount);
|
|
|
|
|
+ BigDecimal total = BigDecimal.valueOf(totalRyCount);
|
|
|
|
|
+ BigDecimal rate = filled.divide(total, 2, RoundingMode.HALF_UP);
|
|
|
|
|
+ ryRate.put("rate", rate);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ result.add(ryRate);
|
|
|
|
|
+ });
|
|
|
|
|
+ return success(result);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@GetMapping("/statistics")
|
|
@GetMapping("/statistics")
|
|
|
@Operation(summary = "获得瑞恒日报汇总统计")
|
|
@Operation(summary = "获得瑞恒日报汇总统计")
|
|
|
@PreAuthorize("@ss.hasPermission('pms:iot-rh-daily-report:query')")
|
|
@PreAuthorize("@ss.hasPermission('pms:iot-rh-daily-report:query')")
|