Pārlūkot izejas kodu

巡检人员相关接口查询

jichaobo 2 gadi atpakaļ
vecāks
revīzija
e26c4ca61a
16 mainītis faili ar 465 papildinājumiem un 31 dzēšanām
  1. 10 0
      service-fire/service-fire-biz/pom.xml
  2. 1 1
      service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/MybatisGeneratorUtils.java
  3. 87 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/web/PatrolInspectionPersonnelController.java
  4. 20 5
      service-fire/service-fire-biz/src/main/java/com/usky/fire/domain/PatrolInspectionPersonnel.java
  5. 3 3
      service-fire/service-fire-biz/src/main/java/com/usky/fire/mapper/PatrolInspectionPersonnelMapper.java
  6. 18 3
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/PatrolInspectionPersonnelService.java
  7. 11 2
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/PatrolInspectionAreaServiceImpl.java
  8. 6 1
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/PatrolInspectionContentServiceImpl.java
  9. 182 3
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/PatrolInspectionPersonnelServiceImpl.java
  10. 16 3
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/PatrolInspectionPlanServiceImpl.java
  11. 11 2
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/PatrolInspectionRecordServiceImpl.java
  12. 16 6
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/PatrolInspectionSiteServiceImpl.java
  13. 5 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/vo/PatrolInspectionAreaVo.java
  14. 74 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/vo/PatrolInspectionPersonnelVo.java
  15. 1 1
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/vo/PatrolInspectionSiteExportOneVo.java
  16. 4 1
      service-fire/service-fire-biz/src/main/resources/mapper.fire/PatrolInspectionPersonnelMapper.xml

+ 10 - 0
service-fire/service-fire-biz/pom.xml

@@ -24,6 +24,16 @@
             <groupId>com.github.pagehelper</groupId>
             <artifactId>pagehelper-spring-boot-starter</artifactId>
         </dependency>
+        <dependency>
+            <groupId>com.usky</groupId>
+            <artifactId>ruoyi-common-core</artifactId>
+            <version>0.0.1</version>
+        </dependency>
+        <dependency>
+            <groupId>com.usky</groupId>
+            <artifactId>service-system-api</artifactId>
+            <version>0.0.1</version>
+        </dependency>
 
 
     </dependencies>

+ 1 - 1
service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/MybatisGeneratorUtils.java

@@ -71,7 +71,7 @@ public class MybatisGeneratorUtils {
         // strategy.setTablePrefix("t_"); // 表名前缀
         strategy.setEntityLombokModel(true); //使用lombok
         //修改自己想要生成的表
-        strategy.setInclude("patrol_inspection_record");  // 逆向工程使用的表   如果要生成多个,这里可以传入String[]
+        strategy.setInclude("patrol_inspection_personnel");  // 逆向工程使用的表   如果要生成多个,这里可以传入String[]
         mpg.setStrategy(strategy);
 
         // 关闭默认 xml 生成,调整生成 至 根目录

+ 87 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/web/PatrolInspectionPersonnelController.java

@@ -0,0 +1,87 @@
+package com.usky.fire.controller.web;
+
+
+import com.usky.common.core.bean.ApiResult;
+import com.usky.common.core.bean.CommonPage;
+import com.usky.fire.domain.PatrolInspectionPersonnel;
+import com.usky.fire.service.PatrolInspectionPersonnelService;
+import com.usky.fire.service.vo.PatrolInspectionAreaVo;
+import com.usky.fire.service.vo.PatrolInspectionPersonnelVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 巡查自检-巡检人员
+ *
+ * @author JCB
+ * @since 2022-07-26
+ */
+@RestController
+@RequestMapping("/patrolInspectionPersonnel")
+public class PatrolInspectionPersonnelController {
+
+    @Autowired
+    private PatrolInspectionPersonnelService patrolInspectionPersonnelService;
+
+    /**
+     * 巡查自检-巡检人员-新增
+     * @param patrolInspectionPersonnel
+     * @return
+     */
+    @PostMapping("addPatrolInspectionPersonnel")
+    public ApiResult<Void> addPatrolInspectionPersonnel(@RequestBody PatrolInspectionPersonnel patrolInspectionPersonnel) {
+        patrolInspectionPersonnelService.addPatrolInspectionPersonnel(patrolInspectionPersonnel);
+        return ApiResult.success();
+    }
+
+    /**
+     * 巡查自检-巡检人员-修改
+     * @param patrolInspectionPersonnel
+     * @return
+     */
+    @PostMapping("updatePatrolInspectionPersonnel")
+    public ApiResult<Void> updatePatrolInspectionPersonnel(@RequestBody PatrolInspectionPersonnel patrolInspectionPersonnel) {
+        patrolInspectionPersonnelService.updatePatrolInspectionPersonnel(patrolInspectionPersonnel);
+        return ApiResult.success();
+    }
+
+    /**
+     * 巡查自检-巡检人员-删除
+     * @param id 人员记录表ID
+     * @return
+     */
+    @GetMapping("delPatrolInspectionPersonnel")
+    public ApiResult<Void> delPatrolInspectionPersonnel(@RequestParam(value = "id") Integer id) {
+        patrolInspectionPersonnelService.delPatrolInspectionPersonnel(id);
+        return ApiResult.success();
+    }
+
+    /**
+     * 巡查自检-巡检人员-列表查询
+     * @param areaId 区域ID
+     * @param pageNum 当前页
+     * @param pageSize 每页条数
+     * @param id 人员记录表ID
+     * @return
+     */
+    @GetMapping("patrolInspectionPersonnelList")
+    public ApiResult<CommonPage<PatrolInspectionPersonnelVo>> patrolInspectionPersonnelList(@RequestParam(value = "areaId", required = false) Integer areaId,
+                                                                                            @RequestParam(value = "pageNum", required = false, defaultValue = "1") Integer pageNum,
+                                                                                            @RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize,
+                                                                                            @RequestParam(value = "id", required = false, defaultValue = "0") Integer id) {
+        return ApiResult.success(patrolInspectionPersonnelService.patrolInspectionPersonnelList(areaId,pageNum, pageSize, id));
+    }
+
+    /**
+     * 巡查自检-巡检人员-左侧树形数据
+     * @return
+     */
+    @GetMapping("personnelLeftList")
+    public ApiResult<List<PatrolInspectionAreaVo>> personnelLeftList() {
+        return ApiResult.success(patrolInspectionPersonnelService.personnelLeftList());
+    }
+
+}
+

+ 20 - 5
service-fire/service-fire-biz/src/main/java/com/usky/fire/domain/PatrolInspectionPersonnel.java

@@ -10,11 +10,11 @@ import lombok.experimental.Accessors;
 
 /**
  * <p>
- * 
+ * 巡检人员表
  * </p>
  *
  * @author JCB
- * @since 2022-07-12
+ * @since 2022-07-26
  */
 @Data
 @EqualsAndHashCode(callSuper = false)
@@ -24,21 +24,26 @@ public class PatrolInspectionPersonnel implements Serializable {
     private static final long serialVersionUID=1L;
 
     /**
-     * 巡检人员关联ID
+     * 巡检人员表主键ID
      */
     @TableId(value = "id", type = IdType.AUTO)
     private Integer id;
 
     /**
-     * 人员ID
+     * 用户ID
      */
-    private Integer personnelId;
+    private Integer userId;
 
     /**
      * 区域ID
      */
     private Integer areaId;
 
+    /**
+     * 租户ID
+     */
+    private Integer tenantId;
+
     /**
      * 创建时间
      */
@@ -49,5 +54,15 @@ public class PatrolInspectionPersonnel implements Serializable {
      */
     private String creator;
 
+    /**
+     * 使能标识(0 不生效,1 生效)
+     */
+    private Integer enable;
+
+    /**
+     * 单位ID
+     */
+    private Integer companyId;
+
 
 }

+ 3 - 3
service-fire/service-fire-biz/src/main/java/com/usky/fire/mapper/PatrolInspectionPersonnelMapper.java

@@ -1,15 +1,15 @@
 package com.usky.fire.mapper;
 
-import com.usky.common.mybatis.core.CrudMapper;
 import com.usky.fire.domain.PatrolInspectionPersonnel;
+import com.usky.common.mybatis.core.CrudMapper;
 
 /**
  * <p>
- * Mapper 接口
+ * 巡检人员表 Mapper 接口
  * </p>
  *
  * @author JCB
- * @since 2022-07-12
+ * @since 2022-07-26
  */
 public interface PatrolInspectionPersonnelMapper extends CrudMapper<PatrolInspectionPersonnel> {
 

+ 18 - 3
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/PatrolInspectionPersonnelService.java

@@ -1,16 +1,31 @@
 package com.usky.fire.service;
 
-import com.usky.common.mybatis.core.CrudService;
+import com.usky.common.core.bean.CommonPage;
 import com.usky.fire.domain.PatrolInspectionPersonnel;
+import com.usky.common.mybatis.core.CrudService;
+import com.usky.fire.service.vo.PatrolInspectionAreaVo;
+import com.usky.fire.service.vo.PatrolInspectionPersonnelVo;
+
+import java.util.List;
 
 /**
  * <p>
- * 服务类
+ * 巡检人员表 服务类
  * </p>
  *
  * @author JCB
- * @since 2022-07-12
+ * @since 2022-07-26
  */
 public interface PatrolInspectionPersonnelService extends CrudService<PatrolInspectionPersonnel> {
 
+    void addPatrolInspectionPersonnel(PatrolInspectionPersonnel patrolInspectionPersonnel);
+
+    void updatePatrolInspectionPersonnel(PatrolInspectionPersonnel patrolInspectionPersonnel);
+
+    void delPatrolInspectionPersonnel(Integer id);
+
+    CommonPage<PatrolInspectionPersonnelVo> patrolInspectionPersonnelList(Integer areaId,Integer pageNum, Integer pageSize,Integer id);
+
+    List<PatrolInspectionAreaVo> personnelLeftList();
+
 }

+ 11 - 2
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/PatrolInspectionAreaServiceImpl.java

@@ -8,6 +8,7 @@ import com.usky.fire.domain.PatrolInspectionArea;
 import com.usky.fire.mapper.PatrolInspectionAreaMapper;
 import com.usky.fire.service.PatrolInspectionAreaService;
 import com.usky.fire.service.vo.PatrolInspectionAreaVo;
+import com.usky.system.model.LoginUser;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -101,7 +102,11 @@ public class PatrolInspectionAreaServiceImpl extends AbstractCrudService<PatrolI
      * @return
      */
     public List<PatrolInspectionArea> patrolInspectionAreaList(Integer id, String areaName, Integer pageNum, Integer pageSize) {
-        String userType = SecurityUtils.getLoginUser().getUserType();
+        LoginUser loginUser = SecurityUtils.getLoginUser();
+        String userType = null;
+        if (loginUser!=null&&!"".equals(loginUser)){
+            userType = loginUser.getUserType();
+        }
         LambdaQueryWrapper<PatrolInspectionArea> queryWrapper = Wrappers.lambdaQuery();
         queryWrapper.eq(PatrolInspectionArea::getEnable, 1)
                 .eq(PatrolInspectionArea::getTenantId, SecurityUtils.getTenantId());
@@ -125,7 +130,11 @@ public class PatrolInspectionAreaServiceImpl extends AbstractCrudService<PatrolI
      * @return
      */
     public List<PatrolInspectionArea> patrolInspectionAreaSelect() {
-        String userType = SecurityUtils.getLoginUser().getUserType();
+        LoginUser loginUser = SecurityUtils.getLoginUser();
+        String userType = null;
+        if (loginUser!=null&&!"".equals(loginUser)){
+            userType = loginUser.getUserType();
+        }
         LambdaQueryWrapper<PatrolInspectionArea> queryWrapper = Wrappers.lambdaQuery();
         queryWrapper.eq(PatrolInspectionArea::getTenantId, SecurityUtils.getTenantId())
                 .eq(PatrolInspectionArea::getEnable, 1)

+ 6 - 1
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/PatrolInspectionContentServiceImpl.java

@@ -14,6 +14,7 @@ import com.usky.fire.service.ContentOptionService;
 import com.usky.fire.service.PatrolInspectionContentService;
 import com.usky.fire.service.SiteContentService;
 import com.usky.fire.service.vo.PatrolInspectionContentVo;
+import com.usky.system.model.LoginUser;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -142,7 +143,11 @@ public class PatrolInspectionContentServiceImpl extends AbstractCrudService<Patr
 
     @Override
     public CommonPage<PatrolInspectionContentVo> patrolInspectionContentList(String contentTitle, Integer pageNum, Integer pageSize, Integer id) {
-        String userType = SecurityUtils.getLoginUser().getUserType();
+        LoginUser loginUser = SecurityUtils.getLoginUser();
+        String userType = null;
+        if (loginUser!=null&&!"".equals(loginUser)){
+            userType = loginUser.getUserType();
+        }
         LambdaQueryWrapper<PatrolInspectionContent> queryWrapper = Wrappers.lambdaQuery();
         queryWrapper.eq(PatrolInspectionContent::getEnable, 1)
                 .eq(PatrolInspectionContent::getTenantId, SecurityUtils.getTenantId());

+ 182 - 3
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/PatrolInspectionPersonnelServiceImpl.java

@@ -1,20 +1,199 @@
 package com.usky.fire.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.usky.common.core.bean.ApiResult;
+import com.usky.common.core.bean.CommonPage;
+import com.usky.common.core.exception.BusinessException;
 import com.usky.common.mybatis.core.AbstractCrudService;
+import com.usky.common.security.utils.SecurityUtils;
+import com.usky.fire.domain.PatrolInspectionArea;
 import com.usky.fire.domain.PatrolInspectionPersonnel;
+import com.usky.fire.domain.PatrolInspectionSite;
+import com.usky.fire.domain.PlanSchedule;
 import com.usky.fire.mapper.PatrolInspectionPersonnelMapper;
+import com.usky.fire.service.PatrolInspectionAreaService;
 import com.usky.fire.service.PatrolInspectionPersonnelService;
+import com.usky.fire.service.PlanScheduleService;
+import com.usky.fire.service.util.OnlineMethod;
+import com.usky.fire.service.vo.DataCountVo;
+import com.usky.fire.service.vo.PatrolInspectionAreaVo;
+import com.usky.fire.service.vo.PatrolInspectionPersonnelVo;
+import com.usky.system.RemoteUserService;
+import com.usky.system.domain.SysUser;
+import com.usky.system.model.LoginUser;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.time.LocalDateTime;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
 /**
  * <p>
- * 服务实现类
+ * 巡检人员表 服务实现类
  * </p>
  *
  * @author JCB
- * @since 2022-07-12
+ * @since 2022-07-26
  */
 @Service
 public class PatrolInspectionPersonnelServiceImpl extends AbstractCrudService<PatrolInspectionPersonnelMapper, PatrolInspectionPersonnel> implements PatrolInspectionPersonnelService {
 
-}
+    @Autowired
+    private PlanScheduleService planScheduleService;
+
+    @Autowired
+    private PatrolInspectionAreaService patrolInspectionAreaService;
+
+    @Autowired
+    private RemoteUserService remoteUserService;
+
+    @Override
+    public void addPatrolInspectionPersonnel(PatrolInspectionPersonnel patrolInspectionPersonnel) {
+        patrolInspectionPersonnel.setCompanyId(0);
+        patrolInspectionPersonnel.setTenantId(SecurityUtils.getTenantId());
+        patrolInspectionPersonnel.setCreator(SecurityUtils.getUsername());
+        patrolInspectionPersonnel.setEnable(1);
+        patrolInspectionPersonnel.setCreateTime(LocalDateTime.now());
+        this.save(patrolInspectionPersonnel);
+    }
+
+    public void updatePatrolInspectionPersonnel(PatrolInspectionPersonnel patrolInspectionPersonnel) {
+        LoginUser loginUser = SecurityUtils.getLoginUser();
+        String userType = null;
+        if (loginUser != null && !"".equals(loginUser)) {
+            userType = loginUser.getUserType();
+        }
+        LambdaQueryWrapper<PatrolInspectionPersonnel> queryWrapper = Wrappers.lambdaQuery();
+        queryWrapper.eq(PatrolInspectionPersonnel::getEnable, 1)
+                .eq(PatrolInspectionPersonnel::getUserId, patrolInspectionPersonnel.getUserId())
+                .eq(PatrolInspectionPersonnel::getAreaId, patrolInspectionPersonnel.getAreaId())
+                .eq(PatrolInspectionPersonnel::getTenantId, SecurityUtils.getTenantId());
+        if ("00".equals(userType)) {
+            queryWrapper.eq(PatrolInspectionPersonnel::getCreator, SecurityUtils.getUsername());
+        }
+        List<PatrolInspectionPersonnel> list = this.list(queryWrapper);
+        if (list.size() > 0) {
+            throw new BusinessException("巡检人员录入重复不可修改");
+        }
+        this.updateById(patrolInspectionPersonnel);
+    }
+
+    public void delPatrolInspectionPersonnel(Integer id) {
+        LambdaQueryWrapper<PlanSchedule> queryWrapper = Wrappers.lambdaQuery();
+        queryWrapper.eq(PlanSchedule::getPersonnelId, id);
+        List<PlanSchedule> listOne = planScheduleService.list(queryWrapper);
+        if (listOne.size() > 0) {
+            throw new BusinessException("人员使用中重复不可删除");
+        }
+        this.removeById(id);
+    }
+
+    @Override
+    public CommonPage<PatrolInspectionPersonnelVo> patrolInspectionPersonnelList(Integer areaId, Integer pageNum, Integer pageSize, Integer id) {
+        LoginUser loginUser = SecurityUtils.getLoginUser();
+        String userType = null;
+        if (loginUser != null && !"".equals(loginUser)) {
+            userType = loginUser.getUserType();
+        }
+        LambdaQueryWrapper<PatrolInspectionPersonnel> queryWrapper = Wrappers.lambdaQuery();
+        queryWrapper.eq(PatrolInspectionPersonnel::getEnable, 1)
+                .eq(PatrolInspectionPersonnel::getTenantId, SecurityUtils.getTenantId());
+        if ("00".equals(userType)) {
+            queryWrapper.eq(PatrolInspectionPersonnel::getCreator, SecurityUtils.getUsername());
+        }
+        if (id != 0 && id != null) {
+            queryWrapper.eq(PatrolInspectionPersonnel::getId, id);
+        }
+        List<PatrolInspectionPersonnel> list = this.list(queryWrapper);
+        List<PatrolInspectionPersonnelVo> list1 = new ArrayList<>();
+        if (list.size() > 0) {
+            ApiResult<List<SysUser>> userApi = remoteUserService.userList();
+            List<SysUser> userList = userApi.getData();
+            for (int i = 0; i < list.size(); i++) {
+                PatrolInspectionPersonnelVo patrolInspectionPersonnelVo = new PatrolInspectionPersonnelVo();
+                patrolInspectionPersonnelVo.setCreator(list.get(i).getCreator());
+                patrolInspectionPersonnelVo.setCompanyId(list.get(i).getCompanyId());
+                patrolInspectionPersonnelVo.setEnable(list.get(i).getEnable());
+                patrolInspectionPersonnelVo.setCreateTime(list.get(i).getCreateTime());
+                patrolInspectionPersonnelVo.setId(list.get(i).getId());
+                patrolInspectionPersonnelVo.setTenantId(list.get(i).getTenantId());
+                patrolInspectionPersonnelVo.setAreaId(list.get(i).getAreaId());
+                patrolInspectionPersonnelVo.setUserId(list.get(i).getUserId());
+                for (int j = 0; j <userList.size(); j++) {
+                    if (list.get(i).getUserId().longValue()==userList.get(j).getUserId()){
+                        patrolInspectionPersonnelVo.setName(userList.get(j).getNickName());
+                    }
+                }
+                list1.add(patrolInspectionPersonnelVo);
+            }
+        }
+        List<PatrolInspectionPersonnelVo> list2 = list1.stream().skip((pageNum - 1) * pageSize).limit(pageSize).collect(Collectors.toList());
+        return new CommonPage<>(list2, list1.size(), pageSize,pageNum);
+    }
+
+
+    @Override
+    public List<PatrolInspectionAreaVo> personnelLeftList() {
+        LoginUser loginUser = SecurityUtils.getLoginUser();
+        String userType = null;
+        if (loginUser != null && !"".equals(loginUser)) {
+            userType = loginUser.getUserType();
+        }
+        LambdaQueryWrapper<PatrolInspectionArea> queryWrapper = Wrappers.lambdaQuery();
+        queryWrapper.eq(PatrolInspectionArea::getEnable, 1)
+                .eq(PatrolInspectionArea::getTenantId, SecurityUtils.getTenantId());
+        if ("00".equals(userType)) {
+            queryWrapper.eq(PatrolInspectionArea::getCreator, SecurityUtils.getUsername());
+        }
+        List<PatrolInspectionArea> patrolInspectionAreaList = patrolInspectionAreaService.list(queryWrapper);
+
+        LambdaQueryWrapper<PatrolInspectionPersonnel> queryWrapperOne = Wrappers.lambdaQuery();
+        queryWrapperOne.eq(PatrolInspectionPersonnel::getEnable, 1)
+                .eq(PatrolInspectionPersonnel::getTenantId, SecurityUtils.getTenantId());
+        if ("00".equals(userType)) {
+            queryWrapperOne.eq(PatrolInspectionPersonnel::getCreator, SecurityUtils.getUsername());
+        }
+        List<PatrolInspectionPersonnel> list = this.list(queryWrapperOne);
+        Map<Integer, List<PatrolInspectionPersonnel>> grouypByAreaId = list.stream().collect(
+                Collectors.groupingBy(o -> o.getAreaId())
+        );
+        List<DataCountVo> dataCountVoList = new ArrayList<>();
+        grouypByAreaId.forEach((k, v) -> {
+            DataCountVo dataCountVo = new DataCountVo();
+            dataCountVo.setListCount(v.size());
+            dataCountVo.setId(k);
+            dataCountVoList.add(dataCountVo);
+        });
+        List<PatrolInspectionAreaVo> patrolInspectionAreaVoList = new ArrayList<>();
+        if (patrolInspectionAreaList.size() > 0) {
+            for (int i = 0; i < patrolInspectionAreaList.size(); i++) {
+                PatrolInspectionAreaVo patrolInspectionAreaVo = new PatrolInspectionAreaVo();
+                patrolInspectionAreaVo.setId(patrolInspectionAreaList.get(i).getId());
+                patrolInspectionAreaVo.setAreaName(patrolInspectionAreaList.get(i).getAreaName());
+                patrolInspectionAreaVo.setAreaFid(patrolInspectionAreaList.get(i).getAreaFid());
+                patrolInspectionAreaVo.setCompanyId(patrolInspectionAreaList.get(i).getCompanyId());
+                patrolInspectionAreaVo.setTenantId(patrolInspectionAreaList.get(i).getTenantId());
+                patrolInspectionAreaVo.setCreator(patrolInspectionAreaList.get(i).getCreator());
+                patrolInspectionAreaVo.setCreateTime(patrolInspectionAreaList.get(i).getCreateTime());
+                patrolInspectionAreaVo.setEnable(patrolInspectionAreaList.get(i).getEnable());
+                patrolInspectionAreaVo.setPersonnelCount(0);
+                for (int j = 0; j < dataCountVoList.size(); j++) {
+                    if (patrolInspectionAreaList.get(i).getId() == dataCountVoList.get(j).getId()) {
+                        patrolInspectionAreaVo.setPersonnelCount(dataCountVoList.get(j).getListCount());
+                    }
+                }
+                patrolInspectionAreaVoList.add(patrolInspectionAreaVo);
+            }
+        }
+        List<PatrolInspectionAreaVo> patrolInspectionAreaVoListOne = new ArrayList<>();
+        if (patrolInspectionAreaVoList.size() > 0) {
+            patrolInspectionAreaVoListOne = OnlineMethod.getChildPerms(patrolInspectionAreaVoList, 0);
+        }
+        return patrolInspectionAreaVoListOne;
+    }
+
+}

+ 16 - 3
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/PatrolInspectionPlanServiceImpl.java

@@ -11,6 +11,7 @@ import com.usky.fire.mapper.PatrolInspectionPlanMapper;
 import com.usky.fire.service.*;
 import com.usky.fire.service.util.OnlineMethod;
 import com.usky.fire.service.vo.*;
+import com.usky.system.model.LoginUser;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -62,7 +63,11 @@ public class PatrolInspectionPlanServiceImpl extends AbstractCrudService<PatrolI
 
     @Override
     public List<PatrolInspectionAreaVo> planLeftList() {
-        String userType = SecurityUtils.getLoginUser().getUserType();
+        LoginUser loginUser = SecurityUtils.getLoginUser();
+        String userType = null;
+        if (loginUser!=null&&!"".equals(loginUser)){
+            userType = loginUser.getUserType();
+        }
         LambdaQueryWrapper<PatrolInspectionArea> queryWrapper = Wrappers.lambdaQuery();
         queryWrapper.eq(PatrolInspectionArea::getEnable, 1)
                 .eq(PatrolInspectionArea::getTenantId, SecurityUtils.getTenantId());
@@ -502,7 +507,11 @@ public class PatrolInspectionPlanServiceImpl extends AbstractCrudService<PatrolI
 
 
     public CommonPage<PatrolInspectionPlanDataVo> patrolInspectionPlanList(String planName, Integer planType, Integer areaId, Integer pageNum, Integer pageSize, Integer id) {
-        String userType = SecurityUtils.getLoginUser().getUserType();
+        LoginUser loginUser = SecurityUtils.getLoginUser();
+        String userType = null;
+        if (loginUser!=null&&!"".equals(loginUser)){
+            userType = loginUser.getUserType();
+        }
         LambdaQueryWrapper<PatrolInspectionPlan> queryWrapper = Wrappers.lambdaQuery();
         queryWrapper.eq(PatrolInspectionPlan::getEnable, 1)
                 .eq(PatrolInspectionPlan::getTenantId, SecurityUtils.getTenantId());
@@ -578,7 +587,11 @@ public class PatrolInspectionPlanServiceImpl extends AbstractCrudService<PatrolI
 
 
     public List<PatrolInspectionSiteVo> patrolInspectionSiteVoList(Integer planId, Integer areaId) {
-        String userType = SecurityUtils.getLoginUser().getUserType();
+        LoginUser loginUser = SecurityUtils.getLoginUser();
+        String userType = null;
+        if (loginUser!=null&&!"".equals(loginUser)){
+            userType = loginUser.getUserType();
+        }
         LambdaQueryWrapper<PatrolInspectionSite> queryWrapper = Wrappers.lambdaQuery();
         queryWrapper.eq(PatrolInspectionSite::getEnable, 1)
                 .eq(PatrolInspectionSite::getAreaId, areaId)

+ 11 - 2
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/PatrolInspectionRecordServiceImpl.java

@@ -12,6 +12,7 @@ import com.usky.fire.service.vo.ContentOptionVo;
 import com.usky.fire.service.vo.PatrolInspectionContentVo;
 import com.usky.fire.service.vo.PatrolInspectionRecordVo;
 import com.usky.fire.service.vo.RecordStatisticsVo;
+import com.usky.system.model.LoginUser;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -54,7 +55,11 @@ public class PatrolInspectionRecordServiceImpl extends AbstractCrudService<Patro
     public CommonPage<PatrolInspectionRecord> patrolInspectionRecordLsit(String areaName, String siteName, String name,
                                                                          Integer planType, String startDateTime, String endDateTime,
                                                                          Integer pageNum, Integer pageSize) {
-        String userType = SecurityUtils.getLoginUser().getUserType();
+        LoginUser loginUser = SecurityUtils.getLoginUser();
+        String userType = null;
+        if (loginUser!=null&&!"".equals(loginUser)){
+            userType = loginUser.getUserType();
+        }
         LambdaQueryWrapper<PatrolInspectionRecord> queryWrapper = Wrappers.lambdaQuery();
         queryWrapper.eq(PatrolInspectionRecord::getTenantId, SecurityUtils.getTenantId());
         if ("00".equals(userType)) {
@@ -259,7 +264,11 @@ public class PatrolInspectionRecordServiceImpl extends AbstractCrudService<Patro
      */
     @Override
     public List<Integer> getPlanSon(String startDate, String endDate) {
-        String userType = SecurityUtils.getLoginUser().getUserType();
+        LoginUser loginUser = SecurityUtils.getLoginUser();
+        String userType = null;
+        if (loginUser!=null&&!"".equals(loginUser)){
+            userType = loginUser.getUserType();
+        }
         LambdaQueryWrapper<PatrolInspectionPlanSon> queryWrapper = Wrappers.lambdaQuery();
         queryWrapper.eq(PatrolInspectionPlanSon::getPlanType, 1)
                 .eq(PatrolInspectionPlanSon::getTenantId, SecurityUtils.getTenantId());

+ 16 - 6
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/PatrolInspectionSiteServiceImpl.java

@@ -18,6 +18,7 @@ import com.usky.fire.service.SiteContentService;
 import com.usky.fire.service.util.OnlineMethod;
 import com.usky.fire.service.vo.DataCountVo;
 import com.usky.fire.service.vo.PatrolInspectionAreaVo;
+import com.usky.system.model.LoginUser;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -49,7 +50,11 @@ public class PatrolInspectionSiteServiceImpl extends AbstractCrudService<PatrolI
 
     @Override
     public List<PatrolInspectionAreaVo> areaLeftList() {
-        String userType = SecurityUtils.getLoginUser().getUserType();
+        LoginUser loginUser = SecurityUtils.getLoginUser();
+        String userType = null;
+        if (loginUser!=null&&!"".equals(loginUser)){
+            userType = loginUser.getUserType();
+        }
         LambdaQueryWrapper<PatrolInspectionArea> queryWrapper = Wrappers.lambdaQuery();
         queryWrapper.eq(PatrolInspectionArea::getEnable, 1)
                 .eq(PatrolInspectionArea::getTenantId, SecurityUtils.getTenantId());
@@ -104,7 +109,11 @@ public class PatrolInspectionSiteServiceImpl extends AbstractCrudService<PatrolI
 
     @Override
     public CommonPage<PatrolInspectionSite> patrolInspectionSiteList(Integer areaId, String siteName, Integer pageNum, Integer pageSize, Integer id) {
-        String userType = SecurityUtils.getLoginUser().getUserType();
+        LoginUser loginUser = SecurityUtils.getLoginUser();
+        String userType = null;
+        if (loginUser!=null&&!"".equals(loginUser)){
+            userType = loginUser.getUserType();
+        }
         LambdaQueryWrapper<PatrolInspectionSite> queryWrapper = Wrappers.lambdaQuery();
         queryWrapper.eq(PatrolInspectionSite::getEnable, 1)
                 .eq(PatrolInspectionSite::getTenantId, SecurityUtils.getTenantId());
@@ -204,10 +213,11 @@ public class PatrolInspectionSiteServiceImpl extends AbstractCrudService<PatrolI
 
 //    @Override
 //    public List<PatrolInspectionSiteExportVo> patrolInspectionSiteListExport(Integer areaId, String siteName, Integer id) {
-//
-////        LoginUser a = SecurityUtils.getLoginUser();
-////        String userType = SecurityUtils.getLoginUser().getUserType();
-//        String userType = null;
+//LoginUser loginUser = SecurityUtils.getLoginUser();
+//    String userType = null;
+//        if (loginUser!=null&&!"".equals(loginUser)){
+//        userType = loginUser.getUserType();
+//    }
 //        LambdaQueryWrapper<PatrolInspectionSite> queryWrapper = Wrappers.lambdaQuery();
 //        queryWrapper.eq(PatrolInspectionSite::getEnable, 1)
 //                .eq(PatrolInspectionSite::getTenantId, SecurityUtils.getTenantId());

+ 5 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/vo/PatrolInspectionAreaVo.java

@@ -84,6 +84,11 @@ public class PatrolInspectionAreaVo implements Serializable {
      */
     private Integer planCount;
 
+    /**
+     * 人员数量
+     */
+    private Integer personnelCount;
+
     /** 子菜单 */
     @TableField(exist = false)
     private List<PatrolInspectionAreaVo> children = new ArrayList<PatrolInspectionAreaVo>();

+ 74 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/vo/PatrolInspectionPersonnelVo.java

@@ -0,0 +1,74 @@
+package com.usky.fire.service.vo;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+/**
+ * <p>
+ * 巡检人员表
+ * </p>
+ *
+ * @author JCB
+ * @since 2022-07-26
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class PatrolInspectionPersonnelVo implements Serializable {
+
+    private static final long serialVersionUID=1L;
+
+    /**
+     * 巡检人员表主键ID
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 用户ID
+     */
+    private Integer userId;
+
+    /**
+     * 区域ID
+     */
+    private Integer areaId;
+
+    /**
+     * 租户ID
+     */
+    private Integer tenantId;
+
+    /**
+     * 创建时间
+     */
+    private LocalDateTime createTime;
+
+    /**
+     * 创建人
+     */
+    private String creator;
+
+    /**
+     * 使能标识(0 不生效,1 生效)
+     */
+    private Integer enable;
+
+    /**
+     * 单位ID
+     */
+    private Integer companyId;
+
+    /**
+     * 人员名称
+     */
+    private String name;
+
+
+}

+ 1 - 1
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/vo/PatrolInspectionSiteExportOneVo.java

@@ -1,6 +1,6 @@
 package com.usky.fire.service.vo;
 
-import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.ruoyi.common.core.annotation.Excel;
 import lombok.Data;
 
 /**

+ 4 - 1
service-fire/service-fire-biz/src/main/resources/mapper.fire/PatrolInspectionPersonnelMapper.xml

@@ -5,10 +5,13 @@
     <!-- 通用查询映射结果 -->
     <resultMap id="BaseResultMap" type="com.usky.fire.domain.PatrolInspectionPersonnel">
         <id column="id" property="id" />
-        <result column="personnel_id" property="personnelId" />
+        <result column="user_id" property="userId" />
         <result column="area_id" property="areaId" />
+        <result column="tenant_id" property="tenantId" />
         <result column="create_time" property="createTime" />
         <result column="creator" property="creator" />
+        <result column="enable" property="enable" />
+        <result column="company_id" property="companyId" />
     </resultMap>
 
 </mapper>