소스 검색

瑞恒巡检处理

lipenghui 6 일 전
부모
커밋
1d8ba13e67

+ 9 - 2
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/stat/IotStaticController.java

@@ -8,6 +8,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageParam;
 import cn.iocoder.yudao.framework.common.pojo.PageResult;
 import cn.iocoder.yudao.framework.common.pojo.Pms;
 import cn.iocoder.yudao.framework.common.util.date.DateUtils;
+import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
 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.iotdevicerunlog.vo.IotDeviceRunLogPageReqVO;
@@ -430,6 +431,12 @@ public class IotStaticController {
             depts = deptApi.getDeptByName("瑞恒兴域");
         } else if ("ry".equals(dept)) {
             depts = deptApi.getDeptByName("瑞鹰国际");
+        } else if ("yf".equals(dept)) {
+            depts = deptApi.getDeptByName("科瑞石油技术");
+        } else {
+            Long loginUserDeptId = SecurityFrameworkUtils.getLoginUserDeptId();
+            DeptRespDTO dto = deptApi.getDept(loginUserDeptId);
+            depts = deptApi.getDeptByName(dto.getName());
         }
         if (CollUtil.isNotEmpty(depts)) {
             if (Objects.nonNull(depts.get(0).getId())) {
@@ -555,7 +562,7 @@ public class IotStaticController {
     }
 
     @GetMapping("/home/safe")
-    public CommonResult<Integer> getSafe() {
+    public CommonResult<String> getSafe() {
         List<IotSapStockDO> iotSapStockDOS = iotSapStockMapper.getSafeList();
         List<Long> ids = new ArrayList<>();
         iotSapStockDOS.forEach(e ->{
@@ -563,7 +570,7 @@ public class IotStaticController {
                 ids.add(e.getId());
             }
         });
-        return CommonResult.success(ids.size());
+        return success(String.valueOf(ids.size()));
     }
 
     @GetMapping("/inspect/device")