|
|
@@ -12,6 +12,7 @@ import cn.iocoder.yudao.framework.common.pojo.Pms;
|
|
|
import cn.iocoder.yudao.framework.common.util.date.DateUtils;
|
|
|
import cn.iocoder.yudao.framework.common.util.number.NumberUtils;
|
|
|
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
|
|
+import cn.iocoder.yudao.module.pms.controller.admin.depttype.vo.IotDeptTypePageReqVO;
|
|
|
import cn.iocoder.yudao.module.pms.controller.admin.failure.vo.IotFailureReportPageReqVO;
|
|
|
import cn.iocoder.yudao.module.pms.controller.admin.inspect.order.vo.IotInspectOrderPageReqVO;
|
|
|
import cn.iocoder.yudao.module.pms.controller.admin.inspect.plan.vo.IotInspectPlanPageReqVO;
|
|
|
@@ -34,6 +35,7 @@ import cn.iocoder.yudao.module.pms.controller.admin.vo.IotDevicePageReqVO;
|
|
|
import cn.iocoder.yudao.module.pms.controller.admin.vo.IotProductClassifyListReqVO;
|
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.IotDeviceDO;
|
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.IotProductClassifyDO;
|
|
|
+import cn.iocoder.yudao.module.pms.dal.dataobject.depttype.IotDeptTypeDO;
|
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.failure.IotFailureReportDO;
|
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.inspect.IotInspectOrderDO;
|
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.inspect.IotInspectOrderDetailDO;
|
|
|
@@ -49,6 +51,7 @@ import cn.iocoder.yudao.module.pms.dal.dataobject.maintain.IotMaintainDO;
|
|
|
import cn.iocoder.yudao.module.pms.dal.mysql.IotDeviceMapper;
|
|
|
import cn.iocoder.yudao.module.pms.dal.mysql.IotProductClassifyMapper;
|
|
|
import cn.iocoder.yudao.module.pms.dal.mysql.TDDeviceMapper;
|
|
|
+import cn.iocoder.yudao.module.pms.dal.mysql.depttype.IotDeptTypeMapper;
|
|
|
import cn.iocoder.yudao.module.pms.dal.mysql.failure.IotFailureReportMapper;
|
|
|
import cn.iocoder.yudao.module.pms.dal.mysql.inspect.IotInspectOrderDetailMapper;
|
|
|
import cn.iocoder.yudao.module.pms.dal.mysql.inspect.IotInspectOrderMapper;
|
|
|
@@ -166,6 +169,8 @@ public class IotStaticController {
|
|
|
private IotRyDailyReportMapper iotRyDailyReportMapper;
|
|
|
@Autowired
|
|
|
private IotRdDailyReportMapper iotRdDailyReportMapper;
|
|
|
+ @Resource
|
|
|
+ private IotDeptTypeMapper iotDeptTypeMapper;
|
|
|
|
|
|
@GetMapping("/main/day")
|
|
|
public CommonResult<Map<String, Object>> getMaintainDay() {
|
|
|
@@ -1194,12 +1199,32 @@ public class IotStaticController {
|
|
|
Set<Long> projectDeptIds = new HashSet<>();
|
|
|
// key项目部id value项目部名称
|
|
|
Map<Long, String> projectDeptPair = new HashMap<>();
|
|
|
+
|
|
|
+ IotDeptTypePageReqVO deptTypeReqVO = new IotDeptTypePageReqVO();
|
|
|
+ // 查询 钻井 修井 类型的部门
|
|
|
+ if ("repair".equals(type)) {
|
|
|
+ // 修井
|
|
|
+ deptTypeReqVO.setType("xj");
|
|
|
+ } else {
|
|
|
+ // 钻井
|
|
|
+ deptTypeReqVO.setType("zj");
|
|
|
+ }
|
|
|
+ List<IotDeptTypeDO> deptTypes = iotDeptTypeMapper.selectList(deptTypeReqVO);
|
|
|
+ List<Long> zjOrXjDeptIds = new ArrayList<>();
|
|
|
+ if (CollUtil.isNotEmpty(deptTypes)) {
|
|
|
+ deptTypes.forEach(dept -> {
|
|
|
+ zjOrXjDeptIds.add(dept.getDeptId());
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
if (CollUtil.isNotEmpty(depts)) {
|
|
|
depts.forEach(dept -> {
|
|
|
- if (dept.getName().contains("项目部")) {
|
|
|
+ // 类型(公司级1 项目部2 队伍3)
|
|
|
+ if ("2".equals(dept.getType())) {
|
|
|
projectDeptIds.add(dept.getId());
|
|
|
projectDeptPair.put(dept.getId(), dept.getName());
|
|
|
- } else {
|
|
|
+ }
|
|
|
+ if ("3".equals(dept.getType()) && zjOrXjDeptIds.contains(dept.getId())) {
|
|
|
teamProjectPair.put(dept.getId(), dept.getParentId());
|
|
|
}
|
|
|
});
|
|
|
@@ -1350,8 +1375,6 @@ public class IotStaticController {
|
|
|
ImmutableMap<String, Serializable> yearResult = ImmutableMap.of("name", "年累进尺~~en**annualFootage", "data", yearData);
|
|
|
return success(ImmutableMap.of("xAxis", xAxis, "series", ImmutableList.of(dailyResult, monthResult, yearResult)));
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -1372,20 +1395,37 @@ public class IotStaticController {
|
|
|
Set<Long> projectDeptIds = new HashSet<>();
|
|
|
// key项目部id value项目部名称
|
|
|
Map<Long, String> projectDeptPair = new HashMap<>();
|
|
|
+
|
|
|
+ // 查询 钻井 业务相关 部门
|
|
|
+ IotDeptTypePageReqVO deptTypeReqVO = new IotDeptTypePageReqVO();
|
|
|
+ deptTypeReqVO.setType("zj");
|
|
|
+ List<IotDeptTypeDO> deptTypes = iotDeptTypeMapper.selectList(deptTypeReqVO);
|
|
|
+ List<Long> zjOrXjDeptIds = new ArrayList<>();
|
|
|
+ if (CollUtil.isNotEmpty(deptTypes)) {
|
|
|
+ deptTypes.forEach(dept -> {
|
|
|
+ zjOrXjDeptIds.add(dept.getDeptId());
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
if (CollUtil.isNotEmpty(depts)) {
|
|
|
depts.forEach(dept -> {
|
|
|
- if (dept.getName().contains("项目部")) {
|
|
|
+ // 类型(公司级1 项目部2 队伍3)
|
|
|
+ if ("2".equals(dept.getType())) {
|
|
|
+ // 项目部
|
|
|
projectDeptIds.add(dept.getId());
|
|
|
projectDeptPair.put(dept.getId(), dept.getName());
|
|
|
- } else {
|
|
|
+ }
|
|
|
+ if ("3".equals(dept.getType()) && zjOrXjDeptIds.contains(dept.getId())) {
|
|
|
+ // 队伍
|
|
|
teamProjectPair.put(dept.getId(), dept.getParentId());
|
|
|
teamPair.put(dept.getId(), dept.getName());
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
IotRyDailyReportPageReqVO reqVO = new IotRyDailyReportPageReqVO();
|
|
|
// 钻井
|
|
|
- reqVO.setProjectClassification("2");
|
|
|
+ reqVO.setProjectClassification("1");
|
|
|
// 钻井 日报统计 月完井数 年完井数
|
|
|
List<IotRyDailyReportTaskCountVO> repairReports = iotRyDailyReportService.countDateRigTasksByDepartment();
|
|
|
Map<String, Integer> deptDailyPair = new HashMap<>();
|