Browse Source

区域接口修改

jichaobo 2 years ago
parent
commit
c0bafa13d9

+ 3 - 6
service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/web/PatrolInspectionAreaController.java

@@ -2,7 +2,6 @@ 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.PatrolInspectionArea;
 import com.usky.fire.service.PatrolInspectionAreaService;
 import com.usky.fire.service.vo.PatrolInspectionAreaVo;
@@ -83,11 +82,9 @@ public class PatrolInspectionAreaController {
      * @return
      */
     @GetMapping("patrolInspectionAreaList")
-    public ApiResult<CommonPage<PatrolInspectionArea>> patrolInspectionAreaList(@RequestParam(value = "areaName", required = false) String areaName,
-                                                                                @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(patrolInspectionAreaService.patrolInspectionAreaList(id, areaName, pageNum, pageSize));
+    public ApiResult<List<PatrolInspectionArea>> patrolInspectionAreaList(@RequestParam(value = "areaName", required = false) String areaName,
+                                                                          @RequestParam(value = "id", required = false, defaultValue = "0") Integer id) {
+        return ApiResult.success(patrolInspectionAreaService.patrolInspectionAreaList(id, areaName));
     }
 
     /**

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

@@ -1,6 +1,5 @@
 package com.usky.fire.service;
 
-import com.usky.common.core.bean.CommonPage;
 import com.usky.common.mybatis.core.CrudService;
 import com.usky.fire.domain.PatrolInspectionArea;
 import com.usky.fire.service.vo.PatrolInspectionAreaVo;
@@ -25,7 +24,7 @@ public interface PatrolInspectionAreaService extends CrudService<PatrolInspectio
 
     void delPatrolInspectionArea(Integer id);
 
-    CommonPage<PatrolInspectionArea> patrolInspectionAreaList(Integer id, String areaName, Integer pageNum, Integer pageSize);
+    List<PatrolInspectionArea> patrolInspectionAreaList(Integer id, String areaName);
 
     List<PatrolInspectionArea> patrolInspectionAreaSelect(Integer areaFid);
 }

+ 5 - 14
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/PatrolInspectionAreaServiceImpl.java

@@ -2,7 +2,6 @@ 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.CommonPage;
 import com.usky.common.core.exception.BusinessException;
 import com.usky.common.mybatis.core.AbstractCrudService;
 import com.usky.common.security.utils.SecurityUtils;
@@ -66,7 +65,7 @@ public class PatrolInspectionAreaServiceImpl extends AbstractCrudService<PatrolI
         queryWrapper.eq(PatrolInspectionArea::getEnable, 1)
                 .eq(PatrolInspectionArea::getId, patrolInspectionArea.getAreaFid());
         List<PatrolInspectionArea> list = this.list(queryWrapper);
-        if (list.size()<=0){
+        if (list.size() <= 0) {
             throw new BusinessException("父级ID不存在");
         }
         patrolInspectionArea.setCompanyId(list.get(0).getCompanyId());
@@ -117,15 +116,13 @@ public class PatrolInspectionAreaServiceImpl extends AbstractCrudService<PatrolI
      *
      * @param id       区域ID
      * @param areaName 区域名称
-     * @param pageNum  当前页
-     * @param pageSize 每页条数
      * @return
      */
     @Override
-    public CommonPage<PatrolInspectionArea> patrolInspectionAreaList(Integer id, String areaName, Integer pageNum, Integer pageSize) {
+    public List<PatrolInspectionArea> patrolInspectionAreaList(Integer id, String areaName) {
         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();
@@ -140,15 +137,9 @@ public class PatrolInspectionAreaServiceImpl extends AbstractCrudService<PatrolI
         if (!"".equals(areaName) && areaName != null) {
             queryWrapper.like(PatrolInspectionArea::getAreaName, areaName);
         }
-        Integer total = this.count(queryWrapper);
         queryWrapper.orderByDesc(PatrolInspectionArea::getId);
-        if (pageNum != null && pageNum != 0 && pageSize != null && pageSize != 0) {
-            Integer startFate = OnlineMethod.getStartFate(pageNum, pageSize);
-            queryWrapper.last("limit " + startFate + ","+pageSize);
-        }
         List<PatrolInspectionArea> list = this.list(queryWrapper);
-
-        return new CommonPage<>(list, total, pageSize, pageNum);
+        return list;
     }
 
 
@@ -161,7 +152,7 @@ public class PatrolInspectionAreaServiceImpl extends AbstractCrudService<PatrolI
     public List<PatrolInspectionArea> patrolInspectionAreaSelect(Integer areaFid) {
         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();

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

@@ -281,7 +281,7 @@ public class PatrolInspectionPlanServiceImpl extends AbstractCrudService<PatrolI
         LambdaQueryWrapper<PatrolInspectionRecord> queryWrapperSix = Wrappers.lambdaQuery();
         queryWrapperSix.eq(PatrolInspectionRecord::getPlanId, patrolInspectionPlanVo.getId());
         List<PatrolInspectionRecord> patrolInspectionRecordList = patrolInspectionRecordService.list(queryWrapperSix);
-        if (patrolInspectionRecordList.size() <= 0) {
+        if (patrolInspectionRecordList.size() > 0) {
             throw new BusinessException("巡检计划已执行中不可修改");
         }
         Integer planCycle = patrolInspectionPlanVo.getPlanCycle();
@@ -465,7 +465,7 @@ public class PatrolInspectionPlanServiceImpl extends AbstractCrudService<PatrolI
         LambdaQueryWrapper<PatrolInspectionRecord> queryWrapperSix = Wrappers.lambdaQuery();
         queryWrapperSix.eq(PatrolInspectionRecord::getPlanId, id);
         List<PatrolInspectionRecord> patrolInspectionRecordList = patrolInspectionRecordService.list(queryWrapperSix);
-        if (patrolInspectionRecordList.size() <= 0) {
+        if (patrolInspectionRecordList.size() > 0) {
             throw new BusinessException("巡检计划已执行中不可删除");
         }
         PatrolInspectionPlan patrolInspectionPlan = new PatrolInspectionPlan();

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

@@ -181,9 +181,9 @@ public class PatrolInspectionPlanSonServiceImpl extends AbstractCrudService<Patr
         return map;
     }
 
-//    public void updatePlan(){
-//
-//    }
+    public void updatePlan(){
+
+    }
 
 
     @Override

+ 128 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/vo/PlanRecordVo.java

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