瀏覽代碼

导出相关接口

jichaobo 2 年之前
父節點
當前提交
8371ecc6eb
共有 14 個文件被更改,包括 519 次插入140 次删除
  1. 22 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/web/PatrolInspectionContentController.java
  2. 30 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/web/PatrolInspectionRecordController.java
  3. 21 26
      service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/web/PatrolInspectionSiteController.java
  4. 5 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/PatrolInspectionContentService.java
  5. 5 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/PatrolInspectionRecordService.java
  6. 2 1
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/PatrolInspectionSiteService.java
  7. 62 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/PatrolInspectionContentServiceImpl.java
  8. 59 6
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/PatrolInspectionRecordServiceImpl.java
  9. 45 107
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/PatrolInspectionSiteServiceImpl.java
  10. 5 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/vo/PatrolInspectionAreaVo.java
  11. 101 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/vo/PatrolInspectionContentExportVo.java
  12. 5 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/vo/PatrolInspectionContentVo.java
  13. 149 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/vo/PatrolInspectionRecordExportVo.java
  14. 8 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/vo/PatrolInspectionSiteExportVo.java

+ 22 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/web/PatrolInspectionContentController.java

@@ -1,13 +1,19 @@
 package com.usky.fire.controller.web;
 
 
+import com.ruoyi.common.core.utils.poi.ExcelUtil;
 import com.usky.common.core.bean.ApiResult;
 import com.usky.common.core.bean.CommonPage;
 import com.usky.fire.service.PatrolInspectionContentService;
+import com.usky.fire.service.vo.PatrolInspectionContentExportVo;
 import com.usky.fire.service.vo.PatrolInspectionContentVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.List;
+
 /**
  * 巡查自检-巡检内容
  *
@@ -74,5 +80,21 @@ public class PatrolInspectionContentController {
         return ApiResult.success();
     }
 
+    /**
+     * 巡查自检-巡检内容-导出
+     * @param response
+     * @param contentTitle 内容标题
+     * @param id 巡检内容ID
+     * @throws IOException
+     */
+    @GetMapping("/contentListExport")
+    public void export(HttpServletResponse response,
+                       @RequestParam(value = "contentTitle",required = false) String contentTitle,
+                       @RequestParam(value = "id",required = false, defaultValue = "0") Integer id) throws IOException {
+        List<PatrolInspectionContentExportVo> list = patrolInspectionContentService.contentListExport(contentTitle, id);
+        ExcelUtil<PatrolInspectionContentExportVo> util = new ExcelUtil<PatrolInspectionContentExportVo>(PatrolInspectionContentExportVo.class);
+        util.exportExcel(response, list, "巡检内容列表", "巡检内容列表");
+    }
+
 }
 

+ 30 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/web/PatrolInspectionRecordController.java

@@ -1,10 +1,13 @@
 package com.usky.fire.controller.web;
 
 
+import com.ruoyi.common.core.utils.poi.ExcelUtil;
 import com.usky.common.core.bean.ApiResult;
 import com.usky.common.core.bean.CommonPage;
 import com.usky.fire.domain.PatrolInspectionRecord;
 import com.usky.fire.service.PatrolInspectionRecordService;
+import com.usky.fire.service.vo.PatrolInspectionContentExportVo;
+import com.usky.fire.service.vo.PatrolInspectionRecordExportVo;
 import com.usky.fire.service.vo.PatrolInspectionRecordVo;
 import com.usky.fire.service.vo.RecordStatisticsVo;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -13,6 +16,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
 import java.util.List;
 
 /**
@@ -76,5 +81,30 @@ public class PatrolInspectionRecordController {
                                                           @RequestParam(value = "endDate") String endDate) {
         return ApiResult.success(patrolInspectionRecordService.recordStatistics(startDate, endDate));
     }
+
+
+    /**
+     * 巡查自检-巡检记录-导出
+     * @param response
+     * @param areaName        区域名称
+     * @param siteName        地点名称
+     * @param name            人员名称
+     * @param planType        计划类型
+     * @param startDateTime   开始时间
+     * @param endDateTime     结束时间
+     * @throws IOException
+     */
+    @GetMapping("/recordLsitExport")
+    public void export(HttpServletResponse response,
+                       @RequestParam(value = "areaName", required = false) String areaName,
+                       @RequestParam(value = "siteName", required = false) String siteName,
+                       @RequestParam(value = "name", required = false) String name,
+                       @RequestParam(value = "planType", required = false) Integer planType,
+                       @RequestParam(value = "startDateTime", required = false) String startDateTime,
+                       @RequestParam(value = "endDateTime", required = false) String endDateTime) throws IOException {
+        List<PatrolInspectionRecordExportVo> list = patrolInspectionRecordService.recordLsitExport(areaName, siteName, name, planType, startDateTime, endDateTime);
+        ExcelUtil<PatrolInspectionRecordExportVo> util = new ExcelUtil<PatrolInspectionRecordExportVo>(PatrolInspectionRecordExportVo.class);
+        util.exportExcel(response, list, "巡检记录", "巡检记录");
+    }
 }
 

+ 21 - 26
service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/web/PatrolInspectionSiteController.java

@@ -1,6 +1,6 @@
 package com.usky.fire.controller.web;
 
-
+import com.ruoyi.common.core.utils.poi.ExcelUtil;
 import com.usky.common.core.bean.ApiResult;
 import com.usky.common.core.bean.CommonPage;
 import com.usky.fire.domain.PatrolInspectionSite;
@@ -8,9 +8,12 @@ import com.usky.fire.domain.SiteContent;
 import com.usky.fire.service.PatrolInspectionContentService;
 import com.usky.fire.service.PatrolInspectionSiteService;
 import com.usky.fire.service.vo.PatrolInspectionAreaVo;
+import com.usky.fire.service.vo.PatrolInspectionSiteExportVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -27,6 +30,7 @@ public class PatrolInspectionSiteController {
 
     @Autowired
     private PatrolInspectionSiteService patrolInspectionSiteService;
+
     @Autowired
     private PatrolInspectionContentService patrolInspectionContentService;
 
@@ -128,30 +132,21 @@ public class PatrolInspectionSiteController {
         return ApiResult.success();
     }
 
-//    /**
-//     * 巡查自检-巡检地点-列表导出
-//     *
-//     * @param areaId   区域id
-//     * @param siteName 地点名称
-//     * @param id       地点ID
-//     * @return
-//     */
-//    @GetMapping("/patrolInspectionSiteListExport")
-//    public void export(HttpServletResponse response,
-//                       @RequestParam(required = false) Integer areaId,
-//                       @RequestParam(required = false) String siteName,
-//                       @RequestParam(required = false) Integer id) throws IOException {
-//        List<PatrolInspectionSiteExportVo> list = patrolInspectionSiteService.patrolInspectionSiteListExport(areaId, siteName, id);
-//        ExcelUtil<PatrolInspectionSiteExportVo> util = new ExcelUtil<PatrolInspectionSiteExportVo>(PatrolInspectionSiteExportVo.class);
-//        util.exportExcel(response, list, "巡检地点列表");
-//    }
-//
-//    @GetMapping("correspondDeviceExport")
-//    public ApiResult<String> correspondDeviceExport(@RequestParam(required = false) Integer areaId,
-//                                                    @RequestParam(required = false) String siteName,
-//                                                    @RequestParam(required = false) Integer id) {
-//        return ApiResult.success(patrolInspectionSiteService.correspondDeviceExport(areaId,siteName,id));
-//    }
-
+    /**
+     * 巡查自检-巡检地点-列表导出
+     *
+     * @param areaId   区域id
+     * @param siteName 地点名称
+     * @param id       地点ID
+     * @return
+     */
+    @GetMapping("/patrolInspectionSiteListExport")
+    public void export(HttpServletResponse response, @RequestParam(required = false) Integer areaId,
+                       @RequestParam(value = "id", required = false) String siteName,
+                       @RequestParam(value = "id", required = false, defaultValue = "0") Integer id) throws IOException {
+        List<PatrolInspectionSiteExportVo> list = patrolInspectionSiteService.patrolInspectionSiteListExport(areaId, siteName, id);
+        ExcelUtil<PatrolInspectionSiteExportVo> util = new ExcelUtil<PatrolInspectionSiteExportVo>(PatrolInspectionSiteExportVo.class);
+        util.exportExcel(response, list, "巡检地点列表", "巡检地点列表");
+    }
 }
 

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

@@ -3,8 +3,11 @@ package com.usky.fire.service;
 import com.usky.common.core.bean.CommonPage;
 import com.usky.fire.domain.PatrolInspectionContent;
 import com.usky.common.mybatis.core.CrudService;
+import com.usky.fire.service.vo.PatrolInspectionContentExportVo;
 import com.usky.fire.service.vo.PatrolInspectionContentVo;
 
+import java.util.List;
+
 /**
  * <p>
  *  服务类
@@ -22,4 +25,6 @@ public interface PatrolInspectionContentService extends CrudService<PatrolInspec
     void delPatrolInspectionContent(Integer id);
 
     CommonPage<PatrolInspectionContentVo> patrolInspectionContentList(String contentTitle, Integer pageNum, Integer pageSize, Integer id);
+
+    List<PatrolInspectionContentExportVo> contentListExport(String contentTitle, Integer id);
 }

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

@@ -3,6 +3,7 @@ package com.usky.fire.service;
 import com.usky.common.core.bean.CommonPage;
 import com.usky.fire.domain.PatrolInspectionRecord;
 import com.usky.common.mybatis.core.CrudService;
+import com.usky.fire.service.vo.PatrolInspectionRecordExportVo;
 import com.usky.fire.service.vo.PatrolInspectionRecordVo;
 import com.usky.fire.service.vo.RecordStatisticsVo;
 
@@ -35,4 +36,8 @@ public interface PatrolInspectionRecordService extends CrudService<PatrolInspect
     Integer getPlanSiteSonCount(List<Integer> planSonidList, Integer inspectionStatus);
 
     RecordStatisticsVo recordStatistics(String startDate, String endDate);
+
+    List<PatrolInspectionRecordExportVo> recordLsitExport(String areaName, String siteName, String name,
+                                                          Integer planType, String startDateTime,
+                                                          String endDateTime);
 }

+ 2 - 1
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/PatrolInspectionSiteService.java

@@ -5,6 +5,7 @@ import com.usky.common.mybatis.core.CrudService;
 import com.usky.fire.domain.PatrolInspectionSite;
 import com.usky.fire.domain.SiteContent;
 import com.usky.fire.service.vo.PatrolInspectionAreaVo;
+import com.usky.fire.service.vo.PatrolInspectionSiteExportVo;
 
 import java.util.List;
 
@@ -32,7 +33,7 @@ public interface PatrolInspectionSiteService extends CrudService<PatrolInspectio
 
     Integer[] siteContentList(Integer siteId);
 
-//    List<PatrolInspectionSiteExportVo> patrolInspectionSiteListExport(Integer areaId, String siteName, Integer id);
+    List<PatrolInspectionSiteExportVo> patrolInspectionSiteListExport(Integer areaId, String siteName, Integer id);
 //
 //    String correspondDeviceExport(Integer areaId, String siteName, Integer id);
 }

+ 62 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/PatrolInspectionContentServiceImpl.java

@@ -13,6 +13,7 @@ import com.usky.fire.mapper.PatrolInspectionContentMapper;
 import com.usky.fire.service.ContentOptionService;
 import com.usky.fire.service.PatrolInspectionContentService;
 import com.usky.fire.service.SiteContentService;
+import com.usky.fire.service.vo.PatrolInspectionContentExportVo;
 import com.usky.fire.service.vo.PatrolInspectionContentVo;
 import com.usky.system.model.LoginUser;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -20,6 +21,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.stream.Collectors;
@@ -143,6 +145,7 @@ public class PatrolInspectionContentServiceImpl extends AbstractCrudService<Patr
 
     @Override
     public CommonPage<PatrolInspectionContentVo> patrolInspectionContentList(String contentTitle, Integer pageNum, Integer pageSize, Integer id) {
+        DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
         LoginUser loginUser = SecurityUtils.getLoginUser();
         String userType = null;
         if (loginUser!=null&&!"".equals(loginUser)){
@@ -175,6 +178,7 @@ public class PatrolInspectionContentServiceImpl extends AbstractCrudService<Patr
             List<ContentOption> contentOptionList = contentOptionService.list(queryWrapperOne);
             for (int i = 0; i < patrolInspectionContentList.size(); i++) {
                 PatrolInspectionContentVo patrolInspectionContentVo = new PatrolInspectionContentVo();
+                patrolInspectionContentVo.setXh(i+1);
                 patrolInspectionContentVo.setId(patrolInspectionContentList.get(i).getId());
                 patrolInspectionContentVo.setContentTitle(patrolInspectionContentList.get(i).getContentTitle());
                 patrolInspectionContentVo.setContentDescribe(patrolInspectionContentList.get(i).getContentDescribe());
@@ -200,4 +204,62 @@ public class PatrolInspectionContentServiceImpl extends AbstractCrudService<Patr
     }
 
 
+    @Override
+    public List<PatrolInspectionContentExportVo> contentListExport(String contentTitle, Integer id) {
+        DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+        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());
+        if ("00".equals(userType)) {
+            queryWrapper.eq(PatrolInspectionContent::getCreator, SecurityUtils.getUsername());
+        }
+        if (contentTitle != null && !"".equals(contentTitle)) {
+            queryWrapper.like(PatrolInspectionContent::getContentTitle, contentTitle);
+        }
+        if (id != 0 && id != null) {
+            queryWrapper.eq(PatrolInspectionContent::getId, id);
+        }
+        queryWrapper.orderByDesc(PatrolInspectionContent::getId);
+        List<PatrolInspectionContent> patrolInspectionContentList = this.list(queryWrapper);
+        List<PatrolInspectionContentExportVo> patrolInspectionContentVoList = new ArrayList<>();
+        if (patrolInspectionContentList.size() > 0) {
+            List<Integer> idList = new ArrayList<>();
+            for (int i = 0; i < patrolInspectionContentList.size(); i++) {
+                idList.add(patrolInspectionContentList.get(i).getId());
+            }
+            LambdaQueryWrapper<ContentOption> queryWrapperOne = Wrappers.lambdaQuery();
+            queryWrapperOne.eq(ContentOption::getEnable, 1)
+                    .in(ContentOption::getContentId, idList);
+            List<ContentOption> contentOptionList = contentOptionService.list(queryWrapperOne);
+            for (int i = 0; i < patrolInspectionContentList.size(); i++) {
+                PatrolInspectionContentExportVo patrolInspectionContentVo = new PatrolInspectionContentExportVo();
+                patrolInspectionContentVo.setXh(i+1);
+                patrolInspectionContentVo.setId(patrolInspectionContentList.get(i).getId());
+                patrolInspectionContentVo.setContentTitle(patrolInspectionContentList.get(i).getContentTitle());
+                patrolInspectionContentVo.setContentDescribe(patrolInspectionContentList.get(i).getContentDescribe());
+                patrolInspectionContentVo.setSubmissionMethod(patrolInspectionContentList.get(i).getSubmissionMethod());
+                patrolInspectionContentVo.setTenantId(patrolInspectionContentList.get(i).getTenantId());
+                patrolInspectionContentVo.setCompanyId(patrolInspectionContentList.get(i).getCompanyId());
+                patrolInspectionContentVo.setCreator(patrolInspectionContentList.get(i).getCreator());
+                patrolInspectionContentVo.setCreateTime(patrolInspectionContentList.get(i).getCreateTime().format(df));
+                patrolInspectionContentVo.setEnable(patrolInspectionContentList.get(i).getEnable());
+                List<ContentOption> contentOptionListOne = new ArrayList<>();
+                for (int j = 0; j < contentOptionList.size(); j++) {
+                    if (patrolInspectionContentList.get(i).getId() == contentOptionList.get(j).getContentId()) {
+                        contentOptionListOne.add(contentOptionList.get(j));
+                    }
+                }
+                patrolInspectionContentVo.setContentOptionList(contentOptionListOne);
+                patrolInspectionContentVoList.add(patrolInspectionContentVo);
+            }
+        }
+        return patrolInspectionContentVoList;
+    }
+
+
 }

+ 59 - 6
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/PatrolInspectionRecordServiceImpl.java

@@ -8,14 +8,12 @@ import com.usky.common.security.utils.SecurityUtils;
 import com.usky.fire.domain.*;
 import com.usky.fire.mapper.PatrolInspectionRecordMapper;
 import com.usky.fire.service.*;
-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.fire.service.vo.*;
 import com.usky.system.model.LoginUser;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.time.format.DateTimeFormatter;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.stream.Collectors;
@@ -57,7 +55,7 @@ public class PatrolInspectionRecordServiceImpl extends AbstractCrudService<Patro
                                                                          Integer pageNum, Integer pageSize) {
         LoginUser loginUser = SecurityUtils.getLoginUser();
         String userType = null;
-        if (loginUser!=null&&!"".equals(loginUser)){
+        if (loginUser != null && !"".equals(loginUser)) {
             userType = loginUser.getUserType();
         }
         LambdaQueryWrapper<PatrolInspectionRecord> queryWrapper = Wrappers.lambdaQuery();
@@ -266,7 +264,7 @@ public class PatrolInspectionRecordServiceImpl extends AbstractCrudService<Patro
     public List<Integer> getPlanSon(String startDate, String endDate) {
         LoginUser loginUser = SecurityUtils.getLoginUser();
         String userType = null;
-        if (loginUser!=null&&!"".equals(loginUser)){
+        if (loginUser != null && !"".equals(loginUser)) {
             userType = loginUser.getUserType();
         }
         LambdaQueryWrapper<PatrolInspectionPlanSon> queryWrapper = Wrappers.lambdaQuery();
@@ -303,4 +301,59 @@ public class PatrolInspectionRecordServiceImpl extends AbstractCrudService<Patro
         }
         return planSonidListOne;
     }
+
+
+    @Override
+    public List<PatrolInspectionRecordExportVo> recordLsitExport(String areaName, String siteName, String name,
+                                                               Integer planType, String startDateTime,
+                                                               String endDateTime) {
+        DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+        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)) {
+            queryWrapper.eq(PatrolInspectionRecord::getCreator, SecurityUtils.getUsername());
+        }
+        if (areaName != null && "".equals(areaName)) {
+            queryWrapper.like(PatrolInspectionRecord::getAreaName, areaName);
+        }
+        if (siteName != null && "".equals(siteName)) {
+            queryWrapper.like(PatrolInspectionRecord::getSiteName, siteName);
+        }
+        if (name != null && "".equals(name)) {
+            queryWrapper.like(PatrolInspectionRecord::getName, name);
+        }
+        if (planType != null && planType != 0) {
+            queryWrapper.eq(PatrolInspectionRecord::getPlanType, planType);
+        }
+        if (startDateTime != null && "".equals(startDateTime) && endDateTime != null && "".equals(endDateTime)) {
+            queryWrapper.between(PatrolInspectionRecord::getCreateTime, startDateTime, endDateTime);
+        }
+        queryWrapper.orderByDesc(PatrolInspectionRecord::getId);
+        List<PatrolInspectionRecord> patrolInspectionRecordList = this.list(queryWrapper);
+        List<PatrolInspectionRecordExportVo> list = new ArrayList<>();
+        for (int i = 0; i < patrolInspectionRecordList.size(); i++) {
+            PatrolInspectionRecordExportVo patrolInspectionRecordExportVo = new PatrolInspectionRecordExportVo();
+            patrolInspectionRecordExportVo.setXh(i + 1);
+            patrolInspectionRecordExportVo.setId(patrolInspectionRecordList.get(i).getId());
+            patrolInspectionRecordExportVo.setSiteNubmber(patrolInspectionRecordList.get(i).getSiteNubmber());
+            patrolInspectionRecordExportVo.setSiteType(patrolInspectionRecordList.get(i).getSiteType());
+            patrolInspectionRecordExportVo.setAreaName(patrolInspectionRecordList.get(i).getAreaName());
+            patrolInspectionRecordExportVo.setSiteName(patrolInspectionRecordList.get(i).getSiteName());
+            patrolInspectionRecordExportVo.setName(patrolInspectionRecordList.get(i).getName());
+            patrolInspectionRecordExportVo.setPhone(patrolInspectionRecordList.get(i).getPhone());
+            patrolInspectionRecordExportVo.setPlanType(patrolInspectionRecordList.get(i).getPlanType());
+            patrolInspectionRecordExportVo.setLongitude(patrolInspectionRecordList.get(i).getLongitude());
+            patrolInspectionRecordExportVo.setLatitude(patrolInspectionRecordList.get(i).getLatitude());
+            patrolInspectionRecordExportVo.setStartDate(patrolInspectionRecordList.get(i).getStartDate().format(df));
+            patrolInspectionRecordExportVo.setEndDate(patrolInspectionRecordList.get(i).getEndDate().format(df));
+            patrolInspectionRecordExportVo.setCreateTime(patrolInspectionRecordList.get(i).getCreateTime().format(df));
+            list.add(patrolInspectionRecordExportVo);
+        }
+        return list;
+    }
 }

+ 45 - 107
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/PatrolInspectionSiteServiceImpl.java

@@ -18,11 +18,13 @@ 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.fire.service.vo.PatrolInspectionSiteExportVo;
 import com.usky.system.model.LoginUser;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.time.format.DateTimeFormatter;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
@@ -50,9 +52,10 @@ public class PatrolInspectionSiteServiceImpl extends AbstractCrudService<PatrolI
 
     @Override
     public List<PatrolInspectionAreaVo> areaLeftList() {
+        DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
         LoginUser loginUser = SecurityUtils.getLoginUser();
         String userType = null;
-        if (loginUser!=null&&!"".equals(loginUser)){
+        if (loginUser != null && !"".equals(loginUser)) {
             userType = loginUser.getUserType();
         }
         LambdaQueryWrapper<PatrolInspectionArea> queryWrapper = Wrappers.lambdaQuery();
@@ -83,6 +86,7 @@ public class PatrolInspectionSiteServiceImpl extends AbstractCrudService<PatrolI
         if (patrolInspectionAreaList.size() > 0) {
             for (int i = 0; i < patrolInspectionAreaList.size(); i++) {
                 PatrolInspectionAreaVo patrolInspectionAreaVo = new PatrolInspectionAreaVo();
+                patrolInspectionAreaVo.setXh(i + 1);
                 patrolInspectionAreaVo.setId(patrolInspectionAreaList.get(i).getId());
                 patrolInspectionAreaVo.setAreaName(patrolInspectionAreaList.get(i).getAreaName());
                 patrolInspectionAreaVo.setAreaFid(patrolInspectionAreaList.get(i).getAreaFid());
@@ -111,7 +115,7 @@ public class PatrolInspectionSiteServiceImpl extends AbstractCrudService<PatrolI
     public CommonPage<PatrolInspectionSite> patrolInspectionSiteList(Integer areaId, String siteName, Integer pageNum, Integer pageSize, Integer id) {
         LoginUser loginUser = SecurityUtils.getLoginUser();
         String userType = null;
-        if (loginUser!=null&&!"".equals(loginUser)){
+        if (loginUser != null && !"".equals(loginUser)) {
             userType = loginUser.getUserType();
         }
         LambdaQueryWrapper<PatrolInspectionSite> queryWrapper = Wrappers.lambdaQuery();
@@ -211,109 +215,43 @@ public class PatrolInspectionSiteServiceImpl extends AbstractCrudService<PatrolI
     }
 
 
-//    @Override
-//    public List<PatrolInspectionSiteExportVo> patrolInspectionSiteListExport(Integer areaId, String siteName, Integer id) {
-//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());
-//        if ("00".equals(userType)) {
-//            queryWrapper.eq(PatrolInspectionSite::getCreator, SecurityUtils.getUsername());
-//        }
-//        if (areaId != null) {
-//            queryWrapper.eq(PatrolInspectionSite::getAreaId, areaId);
-//        }
-//        if (id != null && id != 0) {
-//            queryWrapper.eq(PatrolInspectionSite::getId, id);
-//        }
-//        if (siteName != null && !"".equals(siteName)) {
-//            queryWrapper.like(PatrolInspectionSite::getSiteName, siteName);
-//        }
-//        queryWrapper.orderByDesc(PatrolInspectionSite::getId);
-//        List<PatrolInspectionSite> patrolInspectionSiteList = this.list(queryWrapper);
-//        List<PatrolInspectionSiteExportVo> list = new ArrayList<>();
-//        for (int i = 0; i < patrolInspectionSiteList.size(); i++) {
-//            PatrolInspectionSiteExportVo patrolInspectionSiteExportVo = new PatrolInspectionSiteExportVo();
-//            patrolInspectionSiteExportVo.setXh(i + 1);
-//            patrolInspectionSiteExportVo.setSiteName(patrolInspectionSiteList.get(i).getSiteName());
-//            patrolInspectionSiteExportVo.setSiteNubmber(patrolInspectionSiteList.get(i).getSiteNubmber());
-//            patrolInspectionSiteExportVo.setLatitude(patrolInspectionSiteList.get(i).getLatitude());
-//            patrolInspectionSiteExportVo.setLongitude(patrolInspectionSiteList.get(i).getLongitude());
-//            patrolInspectionSiteExportVo.setPictureUrl(patrolInspectionSiteList.get(i).getPictureUrl());
-//            patrolInspectionSiteExportVo.setCreateTime("1111");
-//            list.add(patrolInspectionSiteExportVo);
-//        }
-//        return list;
-//    }
-//
-//
-//    @Override
-//    public String correspondDeviceExport(Integer areaId, String siteName, Integer id) {
-//        DateFormat dFormat = new SimpleDateFormat("yyyy年MM月dd日 HH时mm分ss秒");
-//        SimpleDateFormat longSdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-//        Workbook workbook = null;
-//        File file = null;
-//        try {
-//            ExportParams params = new ExportParams(null, "巡检地点列表");
-//            workbook = ExcelExportUtil.exportBigExcel(params, PatrolInspectionSiteExportOneVo.class,
-//                    (o, i) -> {
-//                        String userType = null;
-//                        LambdaQueryWrapper<PatrolInspectionSite> queryWrapper = Wrappers.lambdaQuery();
-//                        queryWrapper.eq(PatrolInspectionSite::getEnable, 1)
-//                                .eq(PatrolInspectionSite::getTenantId, SecurityUtils.getTenantId());
-//                        if ("00".equals(userType)) {
-//                            queryWrapper.eq(PatrolInspectionSite::getCreator, SecurityUtils.getUsername());
-//                        }
-//                        if (areaId != null) {
-//                            queryWrapper.eq(PatrolInspectionSite::getAreaId, areaId);
-//                        }
-//                        if (id != null && id != 0) {
-//                            queryWrapper.eq(PatrolInspectionSite::getId, id);
-//                        }
-//                        if (siteName != null && !"".equals(siteName)) {
-//                            queryWrapper.like(PatrolInspectionSite::getSiteName, siteName);
-//                        }
-//                        queryWrapper.orderByDesc(PatrolInspectionSite::getId);
-//                        List<PatrolInspectionSite> patrolInspectionSiteList = this.list(queryWrapper);
-//                        List<PatrolInspectionSiteExportVo> list = new ArrayList<>();
-//                        for (int j = 0; j < patrolInspectionSiteList.size(); j++) {
-//                            PatrolInspectionSiteExportVo patrolInspectionSiteExportVo = new PatrolInspectionSiteExportVo();
-//                            patrolInspectionSiteExportVo.setId(patrolInspectionSiteList.get(j).getId());
-//                            patrolInspectionSiteExportVo.setXh(j + 1);
-//                            patrolInspectionSiteExportVo.setSiteName(patrolInspectionSiteList.get(j).getSiteName());
-//                            patrolInspectionSiteExportVo.setSiteNubmber(patrolInspectionSiteList.get(j).getSiteNubmber());
-//                            patrolInspectionSiteExportVo.setLatitude(patrolInspectionSiteList.get(j).getLatitude());
-//                            patrolInspectionSiteExportVo.setLongitude(patrolInspectionSiteList.get(j).getLongitude());
-//                            patrolInspectionSiteExportVo.setPictureUrl(patrolInspectionSiteList.get(j).getPictureUrl());
-//                            patrolInspectionSiteExportVo.setCreateTime("1111");
-//                            list.add(patrolInspectionSiteExportVo);
-//                        }
-//                        return new ArrayList<>(BeanMapperUtils.mapList(list, PatrolInspectionSiteExportVo.class, PatrolInspectionSiteExportOneVo.class));
-//                    }, null);
-//            if (null != workbook) {
-//                file = FileUtils.getFile(GlobalUtils.getTempBaseDir(), String.format("%s-%s.xlsx", "巡检地点列表", dFormat.format(System.currentTimeMillis()) + ""));
-//                FileUtils.createFile(file.getAbsolutePath());
-//                FileOutputStream allListingFileOutputStream = new FileOutputStream(file);
-//                workbook.write(allListingFileOutputStream);
-//            } else {
-//                throw new BusinessException("表格数据为空");
-//            }
-//        } catch (Exception e) {
-//            log.error("导出文件失败", e);
-//            throw new BusinessException("导出文件失败");
-//        } finally {
-//            if (workbook != null) {
-//                try {
-//                    workbook.close();
-//                } catch (IOException e) {
-//                    log.error("===export spec=== 关闭workbook失败", e);
-//                }
-//            }
-//        }
-//        return file.getName();
-//    }
+    @Override
+    public List<PatrolInspectionSiteExportVo> patrolInspectionSiteListExport(Integer areaId, String siteName, Integer id) {
+        DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+        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());
+        if ("00".equals(userType)) {
+            queryWrapper.eq(PatrolInspectionSite::getCreator, SecurityUtils.getUsername());
+        }
+        if (areaId != null) {
+            queryWrapper.eq(PatrolInspectionSite::getAreaId, areaId);
+        }
+        if (id != null && id != 0) {
+            queryWrapper.eq(PatrolInspectionSite::getId, id);
+        }
+        if (siteName != null && !"".equals(siteName)) {
+            queryWrapper.like(PatrolInspectionSite::getSiteName, siteName);
+        }
+        queryWrapper.orderByDesc(PatrolInspectionSite::getId);
+        List<PatrolInspectionSite> patrolInspectionSiteList = this.list(queryWrapper);
+        List<PatrolInspectionSiteExportVo> list = new ArrayList<>();
+        for (int i = 0; i < patrolInspectionSiteList.size(); i++) {
+            PatrolInspectionSiteExportVo patrolInspectionSiteExportVo = new PatrolInspectionSiteExportVo();
+            patrolInspectionSiteExportVo.setXh(i + 1);
+            patrolInspectionSiteExportVo.setSiteName(patrolInspectionSiteList.get(i).getSiteName());
+            patrolInspectionSiteExportVo.setSiteNubmber(patrolInspectionSiteList.get(i).getSiteNubmber());
+            patrolInspectionSiteExportVo.setLatitude(patrolInspectionSiteList.get(i).getLatitude());
+            patrolInspectionSiteExportVo.setLongitude(patrolInspectionSiteList.get(i).getLongitude());
+            patrolInspectionSiteExportVo.setPictureUrl(patrolInspectionSiteList.get(i).getPictureUrl());
+            patrolInspectionSiteExportVo.setCreateTime(patrolInspectionSiteList.get(i).getCreateTime().format(df));
+            list.add(patrolInspectionSiteExportVo);
+        }
+        return list;
+    }
 }

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

@@ -34,6 +34,11 @@ public class PatrolInspectionAreaVo implements Serializable {
     @TableId(value = "id", type = IdType.AUTO)
     private Integer id;
 
+    /**
+     * 序号
+     */
+    private Integer xh;
+
     /**
      * 区域名称
      */

+ 101 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/vo/PatrolInspectionContentExportVo.java

@@ -0,0 +1,101 @@
+package com.usky.fire.service.vo;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.ruoyi.common.core.annotation.Excel;
+import com.usky.fire.domain.ContentOption;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author JCB
+ * @since 2022-07-15
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class PatrolInspectionContentExportVo implements Serializable {
+
+    private static final long serialVersionUID=1L;
+
+    /**
+     * 巡检内容信息表主键ID
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 序号
+     */
+    @Excel(name = "序号")
+    private Integer xh;
+
+    /**
+     * 内容标题
+     */
+    @Excel(name = "用户名称")
+    private String contentTitle;
+
+    /**
+     * 内容描述
+     */
+    @Excel(name = "内容描述")
+    private String contentDescribe;
+
+    /**
+     * 提交方式
+     */
+    @Excel(name = "提交方式", readConverterExp = "1=多选,2=单选,3=输入框")
+    private Integer submissionMethod;
+
+    /**
+     * 租户ID
+     */
+    private Integer tenantId;
+
+    /**
+     * 创建时间
+     */
+    @Excel(name = "创建时间")
+    private String createTime;
+
+    /**
+     * 创建人
+     */
+    private String creator;
+
+    /**
+     * 使能标识(0 不生效,1 生效)
+     */
+    private Integer enable;
+
+    /**
+     * 单位ID
+     */
+    private Integer companyId;
+
+    /**
+     * 选项内容
+     */
+    private List<ContentOption> contentOptionList;
+
+    /**
+     * 选项内容
+     */
+    private List<ContentOptionVo> contentOptionVoList;
+
+    /**
+     * 备注
+     */
+    private String remarks;
+
+
+}

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

@@ -32,6 +32,11 @@ public class PatrolInspectionContentVo implements Serializable {
     @TableId(value = "id", type = IdType.AUTO)
     private Integer id;
 
+    /**
+     * 序号
+     */
+    private Integer xh;
+
     /**
      * 内容标题
      */

+ 149 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/vo/PatrolInspectionRecordExportVo.java

@@ -0,0 +1,149 @@
+package com.usky.fire.service.vo;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.ruoyi.common.core.annotation.Excel;
+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-21
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class PatrolInspectionRecordExportVo implements Serializable {
+
+    private static final long serialVersionUID=1L;
+
+    /**
+     * 巡检记录表主键ID
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 序号
+     */
+    @Excel(name = "序号")
+    private Integer xh;
+
+    /**
+     * 地点号码
+     */
+    @Excel(name = "地点号码")
+    private String siteNubmber;
+
+    /**
+     * 地点类型
+     */
+    @Excel(name = "地点类型", readConverterExp = "1=二维码,2=NFC")
+    private Integer siteType;
+
+    /**
+     * 区域名称
+     */
+    @Excel(name = "区域名称")
+    private String areaName;
+
+    /**
+     * 地点名称
+     */
+    @Excel(name = "地点名称")
+    private String siteName;
+
+    /**
+     * 巡检人员
+     */
+    @Excel(name = "巡检人员")
+    private String name;
+
+    /**
+     * 联系电话
+     */
+    @Excel(name = "联系电话")
+    private String phone;
+
+    /**
+     * 计划类型(1 普通计划,2 按次计划)
+     */
+    @Excel(name = "地点类型", readConverterExp = "1=普通计划,2=按次计划")
+    private Integer planType;
+
+    /**
+     * 定位 (0:未定位 1:已定位)
+     */
+    private Integer siteStatus;
+
+    /**
+     * 经度
+     */
+    @Excel(name = "经度")
+    private String longitude;
+
+    /**
+     * 纬度
+     */
+    @Excel(name = "纬度")
+    private String latitude;
+
+    /**
+     * 开始时间
+     */
+    @Excel(name = "开始时间")
+    private String startDate;
+
+    /**
+     * 结束时间
+     */
+    @Excel(name = "结束时间")
+    private String endDate;
+
+    /**
+     * 创建时间/巡检时间
+     */
+    @Excel(name = "巡检时间")
+    private String createTime;
+
+    /**
+     * 巡检计划主表ID
+     */
+    private Integer planId;
+
+    /**
+     * 巡检计划子表ID
+     */
+    private Integer planSonId;
+
+    /**
+     * 巡检地点ID
+     */
+    private Integer siteId;
+
+    /**
+     * 租户ID
+     */
+    private Integer tenantId;
+
+    /**
+     * 单位ID
+     */
+    private Integer companyId;
+
+    /**
+     * 用户名
+     */
+    private String creator;
+
+
+
+}

+ 8 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/vo/PatrolInspectionSiteExportVo.java

@@ -2,6 +2,7 @@ package com.usky.fire.service.vo;
 
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
+import com.ruoyi.common.core.annotation.Excel;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
@@ -30,36 +31,43 @@ public class PatrolInspectionSiteExportVo implements Serializable {
     /**
      * 序号
      */
+    @Excel(name = "序号", width = 20)
     private Integer xh;
 
     /**
      * 地点名称
      */
+    @Excel(name = "地点名称", width = 20)
     private String siteName;
 
     /**
      * 地点号码
      */
+    @Excel(name = "地点号码", width = 20)
     private String siteNubmber;
 
     /**
      * 经度
      */
+    @Excel(name = "经度",  width = 20)
     private String longitude;
 
     /**
      * 纬度
      */
+    @Excel(name = "纬度",  width = 20)
     private String latitude;
 
     /**
      * 图片地址
      */
+    @Excel(name = "图片地址",  width = 50)
     private String pictureUrl;
 
     /**
      * 创建时间
      */
+    @Excel(name = "创建时间",  width = 20)
     private String createTime;
 
 }