|
|
@@ -18,6 +18,7 @@ import cn.iocoder.yudao.module.pms.controller.admin.iotdevicerunlog.vo.IotDevice
|
|
|
import cn.iocoder.yudao.module.pms.controller.admin.iotmainworkorder.vo.IotMainWorkOrderPageReqVO;
|
|
|
import cn.iocoder.yudao.module.pms.controller.admin.iotopeationfill.vo.IotOpeationFillPageReqVO;
|
|
|
import cn.iocoder.yudao.module.pms.controller.admin.iotoutbound.vo.IotOutboundPageReqVO;
|
|
|
+import cn.iocoder.yudao.module.pms.controller.admin.iotrhdailyreport.vo.IotRhDailyReportPageReqVO;
|
|
|
import cn.iocoder.yudao.module.pms.controller.admin.maintain.vo.IotMaintainPageReqVO;
|
|
|
import cn.iocoder.yudao.module.pms.controller.admin.stat.vo.OrderVo;
|
|
|
import cn.iocoder.yudao.module.pms.controller.admin.stat.vo.YearTotalGas;
|
|
|
@@ -45,6 +46,7 @@ import cn.iocoder.yudao.module.pms.dal.mysql.iotdevicerunlog.IotDeviceRunLogMapp
|
|
|
import cn.iocoder.yudao.module.pms.dal.mysql.iotmainworkorder.IotMainWorkOrderMapper;
|
|
|
import cn.iocoder.yudao.module.pms.dal.mysql.iotopeationfill.IotOpeationFillMapper;
|
|
|
import cn.iocoder.yudao.module.pms.dal.mysql.iotoutbound.IotOutboundMapper;
|
|
|
+import cn.iocoder.yudao.module.pms.dal.mysql.iotrhdailyreport.IotRhDailyReportMapper;
|
|
|
import cn.iocoder.yudao.module.pms.dal.mysql.iotsapstock.IotSapStockMapper;
|
|
|
import cn.iocoder.yudao.module.pms.dal.mysql.maintain.IotMaintainMapper;
|
|
|
import cn.iocoder.yudao.module.pms.service.DeviceServiceImpl;
|
|
|
@@ -134,6 +136,8 @@ public class IotStaticController {
|
|
|
private IotOutboundMapper iotOutboundMapper;
|
|
|
@Autowired
|
|
|
private IotInspectPlanMapper iotInspectPlanMapper;
|
|
|
+ @Autowired
|
|
|
+ private IotRhDailyReportMapper iotRhDailyReportMapper;
|
|
|
|
|
|
@GetMapping("/main/day")
|
|
|
public CommonResult<Map<String, Object>> getMaintainDay() {
|
|
|
@@ -928,6 +932,59 @@ public class IotStaticController {
|
|
|
fillData.add(v);
|
|
|
});
|
|
|
|
|
|
+// iotDeviceRunLogPageReqVO.setPointName("当日注水量");
|
|
|
+// List<Map<String, Object>> waters = iotDeviceRunLogMapper.selectListByCreateTimeAndDeptList(iotDeviceRunLogPageReqVO).stream().map(e -> {
|
|
|
+// Map<String, Object> abc = new HashMap<>();
|
|
|
+// abc.put("id", e.getId());
|
|
|
+// abc.put("createTime", e.getCreateTime());
|
|
|
+// abc.put("total", e.getTotalRunTime());
|
|
|
+// abc.put("today", e.getFillContent());
|
|
|
+// return abc;
|
|
|
+// }).collect(Collectors.toList());
|
|
|
+// LinkedHashMap<String, Long> waterMap = sumTotalByDate(waters, 7,"today");
|
|
|
+// LinkedList<Object> waterxAxis = new LinkedList<>();
|
|
|
+// LinkedList<Object> waterData = new LinkedList<>();
|
|
|
+// waterMap.forEach( (k,v)->{
|
|
|
+// waterxAxis.add(k);
|
|
|
+// waterData.add(v);
|
|
|
+// });
|
|
|
+
|
|
|
+ ImmutableMap<String, Serializable> fillResult = ImmutableMap.of("name", "当日注气量~~en**daily gas injection", "data", fillData);
|
|
|
+// ImmutableMap<String, Serializable> waterResult = ImmutableMap.of("name", "当日注水量~~en**daily water injection", "data", waterData);
|
|
|
+ return success(ImmutableMap.of("xAxis", xAxis, "series", ImmutableList.of(fillResult)));
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @GetMapping("/rh/zql/daily/{dept}")
|
|
|
+ @PermitAll
|
|
|
+ public CommonResult<Map<String, Object>> rhOrderDaily(@PathVariable("dept") String dept) {
|
|
|
+ Set<Long> ids = getDeptIds(dept);
|
|
|
+ List<String> lastSevenDays = DateUtils.getLastSevenDays();
|
|
|
+ String first = lastSevenDays.get(0);
|
|
|
+ String last = lastSevenDays.get(lastSevenDays.size() - 1);
|
|
|
+ LocalDateTime startOfDay = getStartOfDay(last);
|
|
|
+ LocalDateTime endOfDay = getEndOfDay(first);
|
|
|
+ LocalDateTime[] createTime = new LocalDateTime[]{startOfDay, endOfDay};
|
|
|
+
|
|
|
+ IotRhDailyReportPageReqVO iotRhDailyReportPageReqVO = new IotRhDailyReportPageReqVO();
|
|
|
+ iotRhDailyReportPageReqVO.setCreateTime(createTime);
|
|
|
+ iotRhDailyReportPageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
|
|
+ List<Map<String, Object>> fills = iotRhDailyReportMapper.selectPage(iotRhDailyReportPageReqVO).getList().stream().map(e -> {
|
|
|
+ Map<String, Object> abc = new HashMap<>();
|
|
|
+ abc.put("id", e.getId());
|
|
|
+ abc.put("createTime", e.getCreateTime());
|
|
|
+ abc.put("today", e.getDailyGasInjection());
|
|
|
+ return abc;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+ LinkedHashMap<String, Long> fillMap = sumTotalByDate(fills, 7,"today");
|
|
|
+ LinkedList<Object> xAxis = new LinkedList<>();
|
|
|
+ LinkedList<Object> fillData = new LinkedList<>();
|
|
|
+ fillMap.forEach( (k,v)->{
|
|
|
+ xAxis.add(k);
|
|
|
+ fillData.add(v);
|
|
|
+ });
|
|
|
+
|
|
|
// iotDeviceRunLogPageReqVO.setPointName("当日注水量");
|
|
|
// List<Map<String, Object>> waters = iotDeviceRunLogMapper.selectListByCreateTimeAndDeptList(iotDeviceRunLogPageReqVO).stream().map(e -> {
|
|
|
// Map<String, Object> abc = new HashMap<>();
|