lin 4 年之前
父節點
當前提交
5b7af4d4c9
共有 41 個文件被更改,包括 2494 次插入23 次删除
  1. 1 0
      zoniot-common/zoniot-core-common/src/main/java/com/zcxk/core/common/pojo/LoginUser.java
  2. 24 0
      zoniot-rmcp/zoniot-rmcp-api/src/main/java/com/zcxk/rmcp/api/dto/InstallDetailDto.java
  3. 46 0
      zoniot-rmcp/zoniot-rmcp-api/src/main/java/com/zcxk/rmcp/api/dto/InstallPlanDataDto.java
  4. 60 0
      zoniot-rmcp/zoniot-rmcp-api/src/main/java/com/zcxk/rmcp/api/dto/InstallPlanInputDto.java
  5. 0 15
      zoniot-rmcp/zoniot-rmcp-api/src/main/java/com/zcxk/rmcp/api/query/CommonQueryCondition.java
  6. 18 0
      zoniot-rmcp/zoniot-rmcp-api/src/main/java/com/zcxk/rmcp/api/query/InstallPlanQueryCondition.java
  7. 59 0
      zoniot-rmcp/zoniot-rmcp-api/src/main/java/com/zcxk/rmcp/api/vo/InstallPlanVo.java
  8. 1 1
      zoniot-rmcp/zoniot-rmcp-core/src/main/java/com/zcxk/rmcp/core/dao/DeviceMapper.java
  9. 22 0
      zoniot-rmcp/zoniot-rmcp-core/src/main/java/com/zcxk/rmcp/core/dao/InstallListMapper.java
  10. 22 0
      zoniot-rmcp/zoniot-rmcp-core/src/main/java/com/zcxk/rmcp/core/dao/InstallPlanDataMapper.java
  11. 25 0
      zoniot-rmcp/zoniot-rmcp-core/src/main/java/com/zcxk/rmcp/core/dao/InstallPlanMapper.java
  12. 16 0
      zoniot-rmcp/zoniot-rmcp-core/src/main/java/com/zcxk/rmcp/core/dao/ProductCategoryMapper.java
  13. 16 0
      zoniot-rmcp/zoniot-rmcp-core/src/main/java/com/zcxk/rmcp/core/dao/ProductMapper.java
  14. 1 1
      zoniot-rmcp/zoniot-rmcp-core/src/main/java/com/zcxk/rmcp/core/entity/Device.java
  15. 147 0
      zoniot-rmcp/zoniot-rmcp-core/src/main/java/com/zcxk/rmcp/core/entity/InstallList.java
  16. 78 0
      zoniot-rmcp/zoniot-rmcp-core/src/main/java/com/zcxk/rmcp/core/entity/InstallPlan.java
  17. 60 0
      zoniot-rmcp/zoniot-rmcp-core/src/main/java/com/zcxk/rmcp/core/entity/InstallPlanData.java
  18. 99 0
      zoniot-rmcp/zoniot-rmcp-core/src/main/java/com/zcxk/rmcp/core/entity/Product.java
  19. 66 0
      zoniot-rmcp/zoniot-rmcp-core/src/main/java/com/zcxk/rmcp/core/entity/ProductCategory.java
  20. 2 1
      zoniot-rmcp/zoniot-rmcp-core/src/main/java/com/zcxk/rmcp/core/mapper/DeviceMapper.xml
  21. 261 0
      zoniot-rmcp/zoniot-rmcp-core/src/main/java/com/zcxk/rmcp/core/mapper/InstallListMapper.xml
  22. 134 0
      zoniot-rmcp/zoniot-rmcp-core/src/main/java/com/zcxk/rmcp/core/mapper/InstallPlanDataMapper.xml
  23. 341 0
      zoniot-rmcp/zoniot-rmcp-core/src/main/java/com/zcxk/rmcp/core/mapper/InstallPlanMapper.xml
  24. 98 0
      zoniot-rmcp/zoniot-rmcp-core/src/main/java/com/zcxk/rmcp/core/mapper/ProductCategoryMapper.xml
  25. 160 0
      zoniot-rmcp/zoniot-rmcp-core/src/main/java/com/zcxk/rmcp/core/mapper/ProductMapper.xml
  26. 1 1
      zoniot-rmcp/zoniot-rmcp-web/src/main/java/com/zcxk/rmcp/web/controller/DeviceController.java
  27. 135 0
      zoniot-rmcp/zoniot-rmcp-web/src/main/java/com/zcxk/rmcp/web/controller/InstallPlanController.java
  28. 1 1
      zoniot-rmcp/zoniot-rmcp-web/src/main/java/com/zcxk/rmcp/web/service/DeviceService.java
  29. 16 0
      zoniot-rmcp/zoniot-rmcp-web/src/main/java/com/zcxk/rmcp/web/service/InstallListService.java
  30. 15 0
      zoniot-rmcp/zoniot-rmcp-web/src/main/java/com/zcxk/rmcp/web/service/InstallPlanAsyncService.java
  31. 16 0
      zoniot-rmcp/zoniot-rmcp-web/src/main/java/com/zcxk/rmcp/web/service/InstallPlanDataService.java
  32. 38 0
      zoniot-rmcp/zoniot-rmcp-web/src/main/java/com/zcxk/rmcp/web/service/InstallPlanService.java
  33. 16 0
      zoniot-rmcp/zoniot-rmcp-web/src/main/java/com/zcxk/rmcp/web/service/ProductCategoryService.java
  34. 16 0
      zoniot-rmcp/zoniot-rmcp-web/src/main/java/com/zcxk/rmcp/web/service/ProductService.java
  35. 3 3
      zoniot-rmcp/zoniot-rmcp-web/src/main/java/com/zcxk/rmcp/web/service/impl/DeviceServiceImpl.java
  36. 30 0
      zoniot-rmcp/zoniot-rmcp-web/src/main/java/com/zcxk/rmcp/web/service/impl/InstallListServiceImpl.java
  37. 30 0
      zoniot-rmcp/zoniot-rmcp-web/src/main/java/com/zcxk/rmcp/web/service/impl/InstallPlanDataServiceImpl.java
  38. 292 0
      zoniot-rmcp/zoniot-rmcp-web/src/main/java/com/zcxk/rmcp/web/service/impl/InstallPlanServiceImpl.java
  39. 30 0
      zoniot-rmcp/zoniot-rmcp-web/src/main/java/com/zcxk/rmcp/web/service/impl/ProductCategoryServiceImpl.java
  40. 30 0
      zoniot-rmcp/zoniot-rmcp-web/src/main/java/com/zcxk/rmcp/web/service/impl/ProductServiceImpl.java
  41. 68 0
      zoniot-rmcp/zoniot-rmcp-web/src/main/java/com/zcxk/rmcp/web/util/TreeUtil.java

+ 1 - 0
zoniot-common/zoniot-core-common/src/main/java/com/zcxk/core/common/pojo/LoginUser.java

@@ -150,4 +150,5 @@ public class LoginUser implements UserDetails {
         queryCondition.setPermissionType(getPermissonType());
         return queryCondition;
     }
+
 }

+ 24 - 0
zoniot-rmcp/zoniot-rmcp-api/src/main/java/com/zcxk/rmcp/api/dto/InstallDetailDto.java

@@ -0,0 +1,24 @@
+package com.zcxk.rmcp.api.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class InstallDetailDto {
+    @ApiModelProperty(value="小区名称",position = 1)
+    private String communityName;
+
+    @ApiModelProperty(value="是否启用单元 0:否 1:是", position = 2)
+    private Integer enableUnit;
+
+    @ApiModelProperty(value = "已安总数", position = 3)
+    private Integer installedNumber = 0;
+
+    @ApiModelProperty(value = "总数", position = 4)
+    private Integer totalNumber = 0;
+
+    @ApiModelProperty(value="安装数据", position = 101)
+    List<InstallPlanDataDto> InstallPlanDataList;
+}

+ 46 - 0
zoniot-rmcp/zoniot-rmcp-api/src/main/java/com/zcxk/rmcp/api/dto/InstallPlanDataDto.java

@@ -0,0 +1,46 @@
+package com.zcxk.rmcp.api.dto;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class InstallPlanDataDto {
+
+    @JsonIgnore
+    @ApiModelProperty(value="id",hidden = true)
+    private Long id;
+
+    @JsonIgnore
+    @ApiModelProperty(value="父类id",hidden = true)
+    private Long parentId;
+
+
+    @ApiModelProperty(value="名称")
+    private String name;
+
+    @ApiModelProperty(value = "是否已安装,0否1是")
+    private Integer isInstalled = 0;
+
+    @ApiModelProperty(value="设备状态 1、正常 2、离线 3、报警 4、未启用")
+    private Integer deviceStatus;
+
+    @ApiModelProperty(value="是否验收,0否1是")
+    private Integer isAccepted;
+
+    @ApiModelProperty(value = "已安总数")
+    private Integer installedNumber = 0;
+
+    @ApiModelProperty(value = "总数")
+    private Integer totalNumber = 0;
+
+
+    @ApiModelProperty(value = "类型", position = 4,example = "1")
+    private Integer type;
+
+
+    @ApiModelProperty(value = "子类", position = 5)
+    private List<InstallPlanDataDto> children;
+}

+ 60 - 0
zoniot-rmcp/zoniot-rmcp-api/src/main/java/com/zcxk/rmcp/api/dto/InstallPlanInputDto.java

@@ -0,0 +1,60 @@
+package com.zcxk.rmcp.api.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+/**
+ * @author linqingwei
+ * @date 2021-07-21 10:16
+ */
+@Data
+public class InstallPlanInputDto {
+
+
+
+    @ApiModelProperty(value="计划名称")
+    private String planName;
+
+    @ApiModelProperty(value="小区")
+    private Integer communityId;
+
+    @ApiModelProperty(value="公司")
+    private Integer companyOrgId;
+
+    @ApiModelProperty(value="部门")
+    private Integer deptOrgId;
+
+    @ApiModelProperty(value="产品")
+    private Integer productId;
+
+    @ApiModelProperty(value="施工单位")
+    private String unit;
+
+    @ApiModelProperty(value="施工负责人")
+    private String principal;
+
+    @ApiModelProperty(value="联系电话")
+    private String phone;
+
+    @ApiModelProperty(value="是否启用单元 0:否 1:是")
+    private Integer enableUnit;
+
+    @ApiModelProperty(value="备注")
+    private String remark;
+
+    @ApiModelProperty(value="地址")
+    private String adrress;
+
+    @ApiModelProperty(value="经度")
+    private BigDecimal lng;
+
+    @ApiModelProperty(value="维度")
+    private BigDecimal lat;
+
+    @ApiModelProperty(value="安装数据", position = 103)
+    List<InstallPlanDataDto> installPlanDataList;
+
+}

+ 0 - 15
zoniot-rmcp/zoniot-rmcp-api/src/main/java/com/zcxk/rmcp/api/query/CommonQueryCondition.java

@@ -34,20 +34,5 @@ public class CommonQueryCondition {
     private String sortOrder; //排序方式
     private LocalDateTime startDate; //开始时间
     private LocalDateTime endDate; //结束时间
-    private List<ProgramItem> programItems; //数据项
-    private Integer permissionType; //用户权限类型 1是公司,2是公司及以下,3部门,4部门及以下,5自定义
-    private String userType;//用户类型(-9999 超管 -999普通用户 2普通用户)
 
-   /* public <T> T getCommonQueryCondition (Object source, T target, Class<?> editable){
-        if (!(target instanceof com.zcxk.core.common.pojo.UserCondition)) {
-            throw BusinessException.builder(500, "target cannot cover UserCondition");
-        }
-        BeanCopyUtils.copyProperties(source, target, editable);
-        com.zcxk.core.common.pojo.UserCondition queryCondition = (com.zcxk.core.common.pojo.UserCondition)target;
-        queryCondition.setTenantId(getTenantId());
-        queryCondition.setProgramItems(getProgramItemList());
-        queryCondition.setUserType(getType());
-        queryCondition.setPermissionType(getPermissonType());
-        return target;
-    }*/
 }

+ 18 - 0
zoniot-rmcp/zoniot-rmcp-api/src/main/java/com/zcxk/rmcp/api/query/InstallPlanQueryCondition.java

@@ -0,0 +1,18 @@
+package com.zcxk.rmcp.api.query;
+
+import io.swagger.annotations.ApiParam;
+import lombok.Data;
+import org.springframework.web.bind.annotation.RequestParam;
+
+/**
+ * @author linqingwei
+ * @date 2021-07-21 10:30
+ */
+@Data
+public class InstallPlanQueryCondition {
+    private String name;
+    private Integer companyOrgId;
+    private Integer deptOrgId;
+    private Integer planStatus;
+    private Integer acceptStatus;
+}

+ 59 - 0
zoniot-rmcp/zoniot-rmcp-api/src/main/java/com/zcxk/rmcp/api/vo/InstallPlanVo.java

@@ -0,0 +1,59 @@
+package com.zcxk.rmcp.api.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.time.LocalDateTime;
+
+/**
+ * @author linqingwei
+ * @date 2021-07-21 10:00
+ */
+@Data
+public class InstallPlanVo {
+
+    private Integer id;
+
+    @ApiModelProperty(value="计划名称")
+    private String planName;
+
+    @ApiModelProperty(value="总户数")
+    private Integer doorNum;
+
+    @ApiModelProperty(value="验收数")
+    private Integer acceptedNum;
+
+    @ApiModelProperty(value="安装数")
+    private Integer installNum;
+
+    @ApiModelProperty(value="创建时间")
+    private LocalDateTime createDate;
+
+    @ApiModelProperty(value="产品名称")
+    private String productName;
+
+    @ApiModelProperty(value="产品型号")
+    private String productModel;
+
+    @ApiModelProperty(value="厂商名称")
+    private String manufacturerName;
+
+    @ApiModelProperty(value="公司名称")
+    private String companyName;
+
+    @ApiModelProperty(value="部门名称")
+    private String deptName;
+
+    @ApiModelProperty(value="小区名称")
+    private String communityName;
+
+    @ApiModelProperty(value = "省", position = 101)
+    private String provinceName;
+
+    @ApiModelProperty(value = "市", position = 102)
+    private String cityName;
+
+    @ApiModelProperty(value = "区", position = 103)
+    private String regionName;
+
+}

+ 1 - 1
zoniot-rmcp/zoniot-rmcp-core/src/main/java/com/zcxk/rmcp/core/dao/DeviceMapper.java

@@ -20,7 +20,7 @@ public interface DeviceMapper {
 
     int updateByPrimaryKeySelective(Device record);
 
-    Device findById(@Param("id") Long id);
+    DeviceVo findById(@Param("id") Long id);
 
     List<DeviceVo> findList(@Param("condition") CommonQueryCondition condition, @Param("userCondition") UserCondition userCondition);
 

+ 22 - 0
zoniot-rmcp/zoniot-rmcp-core/src/main/java/com/zcxk/rmcp/core/dao/InstallListMapper.java

@@ -0,0 +1,22 @@
+package com.zcxk.rmcp.core.dao;
+
+import com.zcxk.rmcp.core.entity.InstallList;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * @author linqingwei
+ * @date 2021-07-21 9:44
+ */
+@Mapper
+public interface InstallListMapper {
+    int insertSelective(InstallList record);
+
+    int updateByPrimaryKeySelective(InstallList record);
+
+    int batchInsert(@Param("list") List<InstallList> list);
+
+    List<InstallList> getInstallList(@Param("planId") Integer planId);
+}

+ 22 - 0
zoniot-rmcp/zoniot-rmcp-core/src/main/java/com/zcxk/rmcp/core/dao/InstallPlanDataMapper.java

@@ -0,0 +1,22 @@
+package com.zcxk.rmcp.core.dao;
+
+import com.zcxk.rmcp.core.entity.InstallPlanData;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * @author linqingwei
+ * @date 2021-07-21 9:45
+ */
+@Mapper
+public interface InstallPlanDataMapper {
+    int insertSelective(InstallPlanData record);
+
+    int updateByPrimaryKeySelective(InstallPlanData record);
+
+    int batchInsert(@Param("list") List<InstallPlanData> list);
+
+    List<InstallPlanData> fondByPlanId(@Param("planId") Integer planId);
+}

+ 25 - 0
zoniot-rmcp/zoniot-rmcp-core/src/main/java/com/zcxk/rmcp/core/dao/InstallPlanMapper.java

@@ -0,0 +1,25 @@
+package com.zcxk.rmcp.core.dao;
+
+import com.zcxk.core.common.pojo.UserCondition;
+import com.zcxk.rmcp.api.query.InstallPlanQueryCondition;
+import com.zcxk.rmcp.api.vo.InstallPlanVo;
+import com.zcxk.rmcp.core.entity.InstallPlan;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * @author linqingwei
+ * @date 2021-07-21 10:03
+ */
+@Mapper
+public interface InstallPlanMapper {
+    int insertSelective(InstallPlan record);
+
+    int updateByPrimaryKeySelective(InstallPlan record);
+
+    InstallPlan findById(@Param("planId") Integer planId);
+
+    List<InstallPlanVo> findList(@Param("condition") InstallPlanQueryCondition condition, @Param("userCondition") UserCondition userCondition);
+}

+ 16 - 0
zoniot-rmcp/zoniot-rmcp-core/src/main/java/com/zcxk/rmcp/core/dao/ProductCategoryMapper.java

@@ -0,0 +1,16 @@
+package com.zcxk.rmcp.core.dao;
+
+import com.zcxk.rmcp.core.entity.ProductCategory;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 
+ * @author linqingwei
+ * @date 2021-07-21 17:00
+ */
+@Mapper
+public interface ProductCategoryMapper {
+    int insertSelective(ProductCategory record);
+
+    int updateByPrimaryKeySelective(ProductCategory record);
+}

+ 16 - 0
zoniot-rmcp/zoniot-rmcp-core/src/main/java/com/zcxk/rmcp/core/dao/ProductMapper.java

@@ -0,0 +1,16 @@
+package com.zcxk.rmcp.core.dao;
+
+import com.zcxk.rmcp.core.entity.Product;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 
+ * @author linqingwei
+ * @date 2021-07-21 9:43
+ */
+@Mapper
+public interface ProductMapper {
+    int insertSelective(Product record);
+
+    int updateByPrimaryKeySelective(Product record);
+}

+ 1 - 1
zoniot-rmcp/zoniot-rmcp-core/src/main/java/com/zcxk/rmcp/core/entity/Device.java

@@ -74,7 +74,7 @@ public class Device {
     /**
     * 设备状态
     */
-    @ApiModelProperty(value="设备状态 1、正常 2、离线(超过1天未上报)3、报警(规则)4、未启用")
+    @ApiModelProperty(value="设备状态 1、正常 2、离线 3、报警 4、未启用")
     private Integer deviceStatus;
 
     /**

+ 147 - 0
zoniot-rmcp/zoniot-rmcp-core/src/main/java/com/zcxk/rmcp/core/entity/InstallList.java

@@ -0,0 +1,147 @@
+package com.zcxk.rmcp.core.entity;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.time.LocalDateTime;
+import lombok.Data;
+
+/**
+ * 
+ * @author linqingwei
+ * @date 2021-07-21 9:44
+ */
+/**
+    * 安装清单
+    */
+@ApiModel(value="com-zcxk-rmcp-core-entity-InstallList")
+@Data
+public class InstallList {
+    /**
+    * 主键
+    */
+    @ApiModelProperty(value="主键")
+    private Integer id;
+
+    /**
+    * 租户
+    */
+    @ApiModelProperty(value="租户")
+    private String tenantId;
+
+    /**
+    * 计划id,参考sc_install_plan
+    */
+    @ApiModelProperty(value="计划id,参考sc_install_plan")
+    private Integer installPlanId;
+
+    /**
+    * 安装计划数据id
+    */
+    @ApiModelProperty(value="安装计划数据id")
+    private Long installPlanDataId;
+
+    /**
+    * 门牌
+    */
+    @ApiModelProperty(value="门牌")
+    private String doorNo;
+
+    /**
+    * 设备id
+    */
+    @ApiModelProperty(value="设备id")
+    private Long deviceId;
+
+    /**
+    * 新表起度
+    */
+    @ApiModelProperty(value="新表起度")
+    private String newBeginDegree;
+
+    /**
+    * 旧表止度
+    */
+    @ApiModelProperty(value="旧表止度")
+    private String oldEndDegree;
+
+    /**
+    * 旧表图片URL
+    */
+    @ApiModelProperty(value="旧表图片URL")
+    private String oldImageUrl;
+
+    @ApiModelProperty(value="")
+    private String meterCode;
+
+    /**
+    * 用户姓名
+    */
+    @ApiModelProperty(value="用户姓名")
+    private String userName;
+
+    /**
+    * 用户手机号
+    */
+    @ApiModelProperty(value="用户手机号")
+    private String userPhone;
+
+    /**
+    * 身份证号
+    */
+    @ApiModelProperty(value="身份证号")
+    private String idCard;
+
+    /**
+    * 是否已安装,0否1是
+    */
+    @ApiModelProperty(value="是否已安装,0否1是")
+    private Integer isInstalled;
+
+    /**
+    * 是否验收,0否1是
+    */
+    @ApiModelProperty(value="是否验收,0否1是")
+    private Integer isAccepted;
+
+    /**
+    * 验收时间
+    */
+    @ApiModelProperty(value="验收时间")
+    private LocalDateTime acceptTime;
+
+    /**
+    * 备注
+    */
+    @ApiModelProperty(value="备注")
+    private String remark;
+
+    /**
+    * 状态
+    */
+    @ApiModelProperty(value="状态")
+    private Integer status;
+
+    /**
+    * 创建时间
+    */
+    @ApiModelProperty(value="创建时间")
+    private LocalDateTime createDate;
+
+    /**
+    * 更新时间
+    */
+    @ApiModelProperty(value="更新时间")
+    private LocalDateTime updateDate;
+
+    /**
+    * 创建人
+    */
+    @ApiModelProperty(value="创建人")
+    private String createBy;
+
+    /**
+    * 更新人
+    */
+    @ApiModelProperty(value="更新人")
+    private String updateBy;
+}

+ 78 - 0
zoniot-rmcp/zoniot-rmcp-core/src/main/java/com/zcxk/rmcp/core/entity/InstallPlan.java

@@ -0,0 +1,78 @@
+package com.zcxk.rmcp.core.entity;
+
+import com.zcxk.core.mysql.base.BaseDO;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.time.LocalDateTime;
+import lombok.Data;
+
+/**
+ * 
+ * @author linqingwei
+ * @date 2021-07-21 10:03
+ */
+/**
+* 安装计划
+*/
+@ApiModel(value="安装计划")
+@Data
+public class InstallPlan extends BaseDO {
+
+    @ApiModelProperty(value="租户")
+    private String tenantId;
+
+    @ApiModelProperty(value="计划名称")
+    private String planName;
+
+    @ApiModelProperty(value="小区")
+    private Integer communityId;
+
+    @ApiModelProperty(value="公司")
+    private Integer companyOrgId;
+
+    @ApiModelProperty(value="部门")
+    private Integer deptOrgId;
+
+    @ApiModelProperty(value="产品")
+    private Integer productId;
+
+    @ApiModelProperty(value="户数")
+    private Integer doorNum;
+
+    @ApiModelProperty(value="安装数")
+    private Integer installNum;
+
+    @ApiModelProperty(value="验收数")
+    private Integer acceptedNum;
+
+    @ApiModelProperty(value="施工单位")
+    private String unit;
+
+    @ApiModelProperty(value="施工负责人")
+    private String principal;
+
+    @ApiModelProperty(value="联系电话")
+    private String phone;
+
+    @ApiModelProperty(value="计划状态,0:未结束,1:已结束")
+    private Integer planStatus;
+
+    @ApiModelProperty(value="验收状态,0:未结束,1:已结束")
+    private Integer acceptStatus;
+
+    @ApiModelProperty(value="1为水务平台,2为计费平台")
+    private Integer platformType;
+
+    @ApiModelProperty(value="是否启用单元 0:否 1:是")
+    private Integer enableUnit;
+
+    @ApiModelProperty(value="生成压缩包文件路径")
+    private String filePath;
+
+    @ApiModelProperty(value="是否启用下载 0:否 1:是")
+    private Integer enableDownload;
+
+    @ApiModelProperty(value="备注")
+    private String remark;
+
+}

+ 60 - 0
zoniot-rmcp/zoniot-rmcp-core/src/main/java/com/zcxk/rmcp/core/entity/InstallPlanData.java

@@ -0,0 +1,60 @@
+package com.zcxk.rmcp.core.entity;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.time.LocalDateTime;
+import lombok.Data;
+
+/**
+ * 
+ * @author linqingwei
+ * @date 2021-07-21 9:45
+ */
+@ApiModel(value="com-zcxk-rmcp-core-entity-InstallPlanData")
+@Data
+public class InstallPlanData {
+    @ApiModelProperty(value="")
+    private Long id;
+
+    /**
+    * 父类id
+    */
+    @ApiModelProperty(value="父类id")
+    private Long parentId;
+
+    /**
+    * 安装计划id
+    */
+    @ApiModelProperty(value="安装计划id")
+    private Integer installPlanId;
+
+    /**
+    * 类型 1:楼栋 2:单元  3:楼层
+    */
+    @ApiModelProperty(value="类型 1:楼栋 2:单元  3:楼层")
+    private Integer type;
+
+    /**
+    * 名称
+    */
+    @ApiModelProperty(value="名称")
+    private String name;
+
+    /**
+    * 状态
+    */
+    @ApiModelProperty(value="状态")
+    private Integer status;
+
+    @ApiModelProperty(value="")
+    private String createBy;
+
+    @ApiModelProperty(value="")
+    private LocalDateTime createDate;
+
+    @ApiModelProperty(value="")
+    private String updateBy;
+
+    @ApiModelProperty(value="")
+    private LocalDateTime updateDate;
+}

+ 99 - 0
zoniot-rmcp/zoniot-rmcp-core/src/main/java/com/zcxk/rmcp/core/entity/Product.java

@@ -0,0 +1,99 @@
+package com.zcxk.rmcp.core.entity;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.time.LocalDateTime;
+import lombok.Data;
+
+/**
+ * 
+ * @author linqingwei
+ * @date 2021-07-21 9:43
+ */
+/**
+    * 产品
+    */
+@ApiModel(value="com-zcxk-rmcp-core-entity-Product")
+@Data
+public class Product {
+    @ApiModelProperty(value="")
+    private Integer id;
+
+    /**
+    * 产品分类id
+    */
+    @ApiModelProperty(value="产品分类id")
+    private Integer productCategoryId;
+
+    /**
+    * 厂商id
+    */
+    @ApiModelProperty(value="厂商id")
+    private Integer manufacturerId;
+
+    /**
+    * 产品名称
+    */
+    @ApiModelProperty(value="产品名称")
+    private String productName;
+
+    /**
+    * 产品型号
+    */
+    @ApiModelProperty(value="产品型号")
+    private String productModel;
+
+    /**
+    * 产品描述
+    */
+    @ApiModelProperty(value="产品描述")
+    private String productDesc;
+
+    /**
+    * 状态
+    */
+    @ApiModelProperty(value="状态")
+    private Integer status;
+
+    /**
+    * 创建时间
+    */
+    @ApiModelProperty(value="创建时间")
+    private LocalDateTime createDate;
+
+    /**
+    * 创建人
+    */
+    @ApiModelProperty(value="创建人")
+    private String createBy;
+
+    /**
+    * 更新时间
+    */
+    @ApiModelProperty(value="更新时间")
+    private LocalDateTime updateDate;
+
+    /**
+    * 更新人
+    */
+    @ApiModelProperty(value="更新人")
+    private String updateBy;
+
+    /**
+    * 是否支持阀控,1是,0否
+    */
+    @ApiModelProperty(value="是否支持阀控,1是,0否")
+    private Integer isSupportValve;
+
+    /**
+    * 阀控测点编码
+    */
+    @ApiModelProperty(value="阀控测点编码")
+    private String valveMeasuringCode;
+
+    /**
+    * 读数测点编码
+    */
+    @ApiModelProperty(value="读数测点编码")
+    private String readingMeasuringCode;
+}

+ 66 - 0
zoniot-rmcp/zoniot-rmcp-core/src/main/java/com/zcxk/rmcp/core/entity/ProductCategory.java

@@ -0,0 +1,66 @@
+package com.zcxk.rmcp.core.entity;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.time.LocalDateTime;
+import lombok.Data;
+
+/**
+ * 
+ * @author linqingwei
+ * @date 2021-07-21 17:00
+ */
+/**
+    * 产品分类
+    */
+@ApiModel(value="com-zcxk-rmcp-core-entity-ProductCategory")
+@Data
+public class ProductCategory {
+    /**
+    * id
+    */
+    @ApiModelProperty(value="id")
+    private Integer id;
+
+    /**
+    * 名称
+    */
+    @ApiModelProperty(value="名称")
+    private String name;
+
+    /**
+    * icon
+    */
+    @ApiModelProperty(value="icon")
+    private String icon;
+
+    /**
+    * 状态
+    */
+    @ApiModelProperty(value="状态")
+    private Boolean status;
+
+    /**
+    * 创建时间
+    */
+    @ApiModelProperty(value="创建时间")
+    private LocalDateTime createDate;
+
+    /**
+    * 创建人
+    */
+    @ApiModelProperty(value="创建人")
+    private String createBy;
+
+    /**
+    * 更新时间
+    */
+    @ApiModelProperty(value="更新时间")
+    private LocalDateTime updateDate;
+
+    /**
+    * 更新人
+    */
+    @ApiModelProperty(value="更新人")
+    private String updateBy;
+}

+ 2 - 1
zoniot-rmcp/zoniot-rmcp-core/src/main/java/com/zcxk/rmcp/core/mapper/DeviceMapper.xml

@@ -254,9 +254,10 @@
     where id = #{id}
   </update>
 
-  <select id="findById" resultMap="BaseResultMap">
+  <select id="findById" resultType="com.zcxk.rmcp.api.vo.DeviceVo">
   select <include refid="Base_Column_List"/> from rmcp_device where status = 1 and id = #{id}
   </select>
+
   <sql id="permissionCondition">
     <if test="userCondition.tenantId != null">and rd.tenant_id = #{userCondition.tenantId}</if>
     <if test="userCondition.userType!=null and userCondition.userType!=-999 and userCondition.userType!=-9999 and  userCondition.programItems != null and userCondition.programItems.size() > 0">

+ 261 - 0
zoniot-rmcp/zoniot-rmcp-core/src/main/java/com/zcxk/rmcp/core/mapper/InstallListMapper.xml

@@ -0,0 +1,261 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.zcxk.rmcp.core.dao.InstallListMapper">
+  <resultMap id="BaseResultMap" type="com.zcxk.rmcp.core.entity.InstallList">
+    <!--@mbg.generated-->
+    <!--@Table rmcp_install_list-->
+    <id column="id" property="id" />
+    <result column="tenant_id" property="tenantId" />
+    <result column="install_plan_id" property="installPlanId" />
+    <result column="install_plan_data_id" property="installPlanDataId" />
+    <result column="door_no" property="doorNo" />
+    <result column="device_id" property="deviceId" />
+    <result column="new_begin_degree" property="newBeginDegree" />
+    <result column="old_end_degree" property="oldEndDegree" />
+    <result column="old_image_url" property="oldImageUrl" />
+    <result column="meter_code" property="meterCode" />
+    <result column="user_name" property="userName" />
+    <result column="user_phone" property="userPhone" />
+    <result column="id_card" property="idCard" />
+    <result column="is_installed" property="isInstalled" />
+    <result column="is_accepted" property="isAccepted" />
+    <result column="accept_time" property="acceptTime" />
+    <result column="remark" property="remark" />
+    <result column="status" property="status" />
+    <result column="create_date" property="createDate" />
+    <result column="update_date" property="updateDate" />
+    <result column="create_by" property="createBy" />
+    <result column="update_by" property="updateBy" />
+  </resultMap>
+  <sql id="Base_Column_List">
+    <!--@mbg.generated-->
+    id, tenant_id, install_plan_id, install_plan_data_id, door_no, device_id, new_begin_degree, 
+    old_end_degree, old_image_url, meter_code, user_name, user_phone, id_card, is_installed, 
+    is_accepted, accept_time, remark, `status`, create_date, update_date, create_by, 
+    update_by
+  </sql>
+  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.zcxk.rmcp.core.entity.InstallList" useGeneratedKeys="true">
+    <!--@mbg.generated-->
+    insert into rmcp_install_list
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="tenantId != null">
+        tenant_id,
+      </if>
+      <if test="installPlanId != null">
+        install_plan_id,
+      </if>
+      <if test="installPlanDataId != null">
+        install_plan_data_id,
+      </if>
+      <if test="doorNo != null">
+        door_no,
+      </if>
+      <if test="deviceId != null">
+        device_id,
+      </if>
+      <if test="newBeginDegree != null">
+        new_begin_degree,
+      </if>
+      <if test="oldEndDegree != null">
+        old_end_degree,
+      </if>
+      <if test="oldImageUrl != null">
+        old_image_url,
+      </if>
+      <if test="meterCode != null">
+        meter_code,
+      </if>
+      <if test="userName != null">
+        user_name,
+      </if>
+      <if test="userPhone != null">
+        user_phone,
+      </if>
+      <if test="idCard != null">
+        id_card,
+      </if>
+      <if test="isInstalled != null">
+        is_installed,
+      </if>
+      <if test="isAccepted != null">
+        is_accepted,
+      </if>
+      <if test="acceptTime != null">
+        accept_time,
+      </if>
+      <if test="remark != null">
+        remark,
+      </if>
+      <if test="status != null">
+        `status`,
+      </if>
+      <if test="createDate != null">
+        create_date,
+      </if>
+      <if test="updateDate != null">
+        update_date,
+      </if>
+      <if test="createBy != null">
+        create_by,
+      </if>
+      <if test="updateBy != null">
+        update_by,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="tenantId != null">
+        #{tenantId},
+      </if>
+      <if test="installPlanId != null">
+        #{installPlanId},
+      </if>
+      <if test="installPlanDataId != null">
+        #{installPlanDataId},
+      </if>
+      <if test="doorNo != null">
+        #{doorNo},
+      </if>
+      <if test="deviceId != null">
+        #{deviceId},
+      </if>
+      <if test="newBeginDegree != null">
+        #{newBeginDegree},
+      </if>
+      <if test="oldEndDegree != null">
+        #{oldEndDegree},
+      </if>
+      <if test="oldImageUrl != null">
+        #{oldImageUrl},
+      </if>
+      <if test="meterCode != null">
+        #{meterCode},
+      </if>
+      <if test="userName != null">
+        #{userName},
+      </if>
+      <if test="userPhone != null">
+        #{userPhone},
+      </if>
+      <if test="idCard != null">
+        #{idCard},
+      </if>
+      <if test="isInstalled != null">
+        #{isInstalled},
+      </if>
+      <if test="isAccepted != null">
+        #{isAccepted},
+      </if>
+      <if test="acceptTime != null">
+        #{acceptTime},
+      </if>
+      <if test="remark != null">
+        #{remark},
+      </if>
+      <if test="status != null">
+        #{status},
+      </if>
+      <if test="createDate != null">
+        #{createDate},
+      </if>
+      <if test="updateDate != null">
+        #{updateDate},
+      </if>
+      <if test="createBy != null">
+        #{createBy},
+      </if>
+      <if test="updateBy != null">
+        #{updateBy},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.zcxk.rmcp.core.entity.InstallList">
+    <!--@mbg.generated-->
+    update rmcp_install_list
+    <set>
+      <if test="tenantId != null">
+        tenant_id = #{tenantId},
+      </if>
+      <if test="installPlanId != null">
+        install_plan_id = #{installPlanId},
+      </if>
+      <if test="installPlanDataId != null">
+        install_plan_data_id = #{installPlanDataId},
+      </if>
+      <if test="doorNo != null">
+        door_no = #{doorNo},
+      </if>
+      <if test="deviceId != null">
+        device_id = #{deviceId},
+      </if>
+      <if test="newBeginDegree != null">
+        new_begin_degree = #{newBeginDegree},
+      </if>
+      <if test="oldEndDegree != null">
+        old_end_degree = #{oldEndDegree},
+      </if>
+      <if test="oldImageUrl != null">
+        old_image_url = #{oldImageUrl},
+      </if>
+      <if test="meterCode != null">
+        meter_code = #{meterCode},
+      </if>
+      <if test="userName != null">
+        user_name = #{userName},
+      </if>
+      <if test="userPhone != null">
+        user_phone = #{userPhone},
+      </if>
+      <if test="idCard != null">
+        id_card = #{idCard},
+      </if>
+      <if test="isInstalled != null">
+        is_installed = #{isInstalled},
+      </if>
+      <if test="isAccepted != null">
+        is_accepted = #{isAccepted},
+      </if>
+      <if test="acceptTime != null">
+        accept_time = #{acceptTime},
+      </if>
+      <if test="remark != null">
+        remark = #{remark},
+      </if>
+      <if test="status != null">
+        `status` = #{status},
+      </if>
+      <if test="createDate != null">
+        create_date = #{createDate},
+      </if>
+      <if test="updateDate != null">
+        update_date = #{updateDate},
+      </if>
+      <if test="createBy != null">
+        create_by = #{createBy},
+      </if>
+      <if test="updateBy != null">
+        update_by = #{updateBy},
+      </if>
+    </set>
+    where id = #{id}
+  </update>
+  <insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="map" useGeneratedKeys="true">
+    <!--@mbg.generated-->
+    insert into rmcp_install_list
+    (tenant_id, install_plan_id, install_plan_data_id, door_no, device_id, new_begin_degree,
+    old_end_degree, old_image_url, meter_code, user_name, user_phone, id_card, is_installed,
+    is_accepted, accept_time, remark, `status`, create_date, update_date, create_by,
+    update_by)
+    values
+    <foreach collection="list" item="item" separator=",">
+      (#{item.tenantId}, #{item.installPlanId}, #{item.installPlanDataId}, #{item.doorNo},
+      #{item.deviceId}, #{item.newBeginDegree}, #{item.oldEndDegree}, #{item.oldImageUrl},
+      #{item.meterCode}, #{item.userName}, #{item.userPhone}, #{item.idCard}, #{item.isInstalled},
+      #{item.isAccepted}, #{item.acceptTime}, #{item.remark}, #{item.status}, #{item.createDate},
+      #{item.updateDate}, #{item.createBy}, #{item.updateBy})
+    </foreach>
+  </insert>
+
+  <select id="getInstallList" resultMap="BaseResultMap">
+    select * from rmcp_install_list where status = 1 and install_plan_id = #{planId}
+  </select>
+</mapper>

+ 134 - 0
zoniot-rmcp/zoniot-rmcp-core/src/main/java/com/zcxk/rmcp/core/mapper/InstallPlanDataMapper.xml

@@ -0,0 +1,134 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.zcxk.rmcp.core.dao.InstallPlanDataMapper">
+  <resultMap id="BaseResultMap" type="com.zcxk.rmcp.core.entity.InstallPlanData">
+    <!--@mbg.generated-->
+    <!--@Table rmcp_install_plan_data-->
+    <id column="id" property="id" />
+    <result column="parent_id" property="parentId" />
+    <result column="install_plan_id" property="installPlanId" />
+    <result column="type" property="type" />
+    <result column="name" property="name" />
+    <result column="status" property="status" />
+    <result column="create_by" property="createBy" />
+    <result column="create_date" property="createDate" />
+    <result column="update_by" property="updateBy" />
+    <result column="update_date" property="updateDate" />
+  </resultMap>
+  <sql id="Base_Column_List">
+    <!--@mbg.generated-->
+    id, parent_id, install_plan_id, `type`, `name`, `status`, create_by, create_date, 
+    update_by, update_date
+  </sql>
+  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.zcxk.rmcp.core.entity.InstallPlanData" useGeneratedKeys="true">
+    <!--@mbg.generated-->
+    insert into rmcp_install_plan_data
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="parentId != null">
+        parent_id,
+      </if>
+      <if test="installPlanId != null">
+        install_plan_id,
+      </if>
+      <if test="type != null">
+        `type`,
+      </if>
+      <if test="name != null">
+        `name`,
+      </if>
+      <if test="status != null">
+        `status`,
+      </if>
+      <if test="createBy != null">
+        create_by,
+      </if>
+      <if test="createDate != null">
+        create_date,
+      </if>
+      <if test="updateBy != null">
+        update_by,
+      </if>
+      <if test="updateDate != null">
+        update_date,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="parentId != null">
+        #{parentId},
+      </if>
+      <if test="installPlanId != null">
+        #{installPlanId},
+      </if>
+      <if test="type != null">
+        #{type},
+      </if>
+      <if test="name != null">
+        #{name},
+      </if>
+      <if test="status != null">
+        #{status},
+      </if>
+      <if test="createBy != null">
+        #{createBy},
+      </if>
+      <if test="createDate != null">
+        #{createDate},
+      </if>
+      <if test="updateBy != null">
+        #{updateBy},
+      </if>
+      <if test="updateDate != null">
+        #{updateDate},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.zcxk.rmcp.core.entity.InstallPlanData">
+    <!--@mbg.generated-->
+    update rmcp_install_plan_data
+    <set>
+      <if test="parentId != null">
+        parent_id = #{parentId},
+      </if>
+      <if test="installPlanId != null">
+        install_plan_id = #{installPlanId},
+      </if>
+      <if test="type != null">
+        `type` = #{type},
+      </if>
+      <if test="name != null">
+        `name` = #{name},
+      </if>
+      <if test="status != null">
+        `status` = #{status},
+      </if>
+      <if test="createBy != null">
+        create_by = #{createBy},
+      </if>
+      <if test="createDate != null">
+        create_date = #{createDate},
+      </if>
+      <if test="updateBy != null">
+        update_by = #{updateBy},
+      </if>
+      <if test="updateDate != null">
+        update_date = #{updateDate},
+      </if>
+    </set>
+    where id = #{id}
+  </update>
+  <insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="map" useGeneratedKeys="true">
+    <!--@mbg.generated-->
+    insert into rmcp_install_plan_data
+    (parent_id, install_plan_id, `type`, `name`, `status`, create_by, create_date, update_by,
+    update_date)
+    values
+    <foreach collection="list" item="item" separator=",">
+      (#{item.parentId}, #{item.installPlanId}, #{item.type}, #{item.name}, #{item.status},
+      #{item.createBy}, #{item.createDate}, #{item.updateBy}, #{item.updateDate})
+    </foreach>
+  </insert>
+
+  <select id="fondByPlanId" resultMap="BaseResultMap">
+    select <include refid="Base_Column_List" /> from rmcp_install_plan_data where status = 1 and install_plan_id = #{planId}
+  </select>
+</mapper>

+ 341 - 0
zoniot-rmcp/zoniot-rmcp-core/src/main/java/com/zcxk/rmcp/core/mapper/InstallPlanMapper.xml

@@ -0,0 +1,341 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.zcxk.rmcp.core.dao.InstallPlanMapper">
+  <resultMap id="BaseResultMap" type="com.zcxk.rmcp.core.entity.InstallPlan">
+    <!--@mbg.generated-->
+    <!--@Table rmcp_install_plan-->
+    <id column="id" property="id" />
+    <result column="tenant_id" property="tenantId" />
+    <result column="plan_name" property="planName" />
+    <result column="community_id" property="communityId" />
+    <result column="company_org_id" property="companyOrgId" />
+    <result column="dept_org_id" property="deptOrgId" />
+    <result column="product_id" property="productId" />
+    <result column="door_num" property="doorNum" />
+    <result column="install_num" property="installNum" />
+    <result column="accepted_num" property="acceptedNum" />
+    <result column="unit" property="unit" />
+    <result column="principal" property="principal" />
+    <result column="phone" property="phone" />
+    <result column="plan_status" property="planStatus" />
+    <result column="accept_status" property="acceptStatus" />
+    <result column="platform_type" property="platformType" />
+    <result column="enable_unit" property="enableUnit" />
+    <result column="file_path" property="filePath" />
+    <result column="enable_download" property="enableDownload" />
+    <result column="remark" property="remark" />
+    <result column="status" property="status" />
+    <result column="create_date" property="createDate" />
+    <result column="update_date" property="updateDate" />
+    <result column="create_by" property="createBy" />
+    <result column="update_by" property="updateBy" />
+  </resultMap>
+  <sql id="Base_Column_List">
+    <!--@mbg.generated-->
+    id, tenant_id, plan_name, community_id, company_org_id, dept_org_id, product_id, 
+    door_num, install_num, accepted_num, unit, principal, phone, plan_status, accept_status, 
+    platform_type, enable_unit, file_path, enable_download, remark, `status`, create_date, 
+    update_date, create_by, update_by
+  </sql>
+  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.zcxk.rmcp.core.entity.InstallPlan" useGeneratedKeys="true">
+    <!--@mbg.generated-->
+    insert into rmcp_install_plan
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="tenantId != null">
+        tenant_id,
+      </if>
+      <if test="planName != null">
+        plan_name,
+      </if>
+      <if test="communityId != null">
+        community_id,
+      </if>
+      <if test="companyOrgId != null">
+        company_org_id,
+      </if>
+      <if test="deptOrgId != null">
+        dept_org_id,
+      </if>
+      <if test="productId != null">
+        product_id,
+      </if>
+      <if test="doorNum != null">
+        door_num,
+      </if>
+      <if test="installNum != null">
+        install_num,
+      </if>
+      <if test="acceptedNum != null">
+        accepted_num,
+      </if>
+      <if test="unit != null">
+        unit,
+      </if>
+      <if test="principal != null">
+        principal,
+      </if>
+      <if test="phone != null">
+        phone,
+      </if>
+      <if test="planStatus != null">
+        plan_status,
+      </if>
+      <if test="acceptStatus != null">
+        accept_status,
+      </if>
+      <if test="platformType != null">
+        platform_type,
+      </if>
+      <if test="enableUnit != null">
+        enable_unit,
+      </if>
+      <if test="filePath != null">
+        file_path,
+      </if>
+      <if test="enableDownload != null">
+        enable_download,
+      </if>
+      <if test="remark != null">
+        remark,
+      </if>
+      <if test="status != null">
+        `status`,
+      </if>
+      <if test="createDate != null">
+        create_date,
+      </if>
+      <if test="updateDate != null">
+        update_date,
+      </if>
+      <if test="createBy != null">
+        create_by,
+      </if>
+      <if test="updateBy != null">
+        update_by,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="tenantId != null">
+        #{tenantId},
+      </if>
+      <if test="planName != null">
+        #{planName},
+      </if>
+      <if test="communityId != null">
+        #{communityId},
+      </if>
+      <if test="companyOrgId != null">
+        #{companyOrgId},
+      </if>
+      <if test="deptOrgId != null">
+        #{deptOrgId},
+      </if>
+      <if test="productId != null">
+        #{productId},
+      </if>
+      <if test="doorNum != null">
+        #{doorNum},
+      </if>
+      <if test="installNum != null">
+        #{installNum},
+      </if>
+      <if test="acceptedNum != null">
+        #{acceptedNum},
+      </if>
+      <if test="unit != null">
+        #{unit},
+      </if>
+      <if test="principal != null">
+        #{principal},
+      </if>
+      <if test="phone != null">
+        #{phone},
+      </if>
+      <if test="planStatus != null">
+        #{planStatus},
+      </if>
+      <if test="acceptStatus != null">
+        #{acceptStatus},
+      </if>
+      <if test="platformType != null">
+        #{platformType},
+      </if>
+      <if test="enableUnit != null">
+        #{enableUnit},
+      </if>
+      <if test="filePath != null">
+        #{filePath},
+      </if>
+      <if test="enableDownload != null">
+        #{enableDownload},
+      </if>
+      <if test="remark != null">
+        #{remark},
+      </if>
+      <if test="status != null">
+        #{status},
+      </if>
+      <if test="createDate != null">
+        #{createDate},
+      </if>
+      <if test="updateDate != null">
+        #{updateDate},
+      </if>
+      <if test="createBy != null">
+        #{createBy},
+      </if>
+      <if test="updateBy != null">
+        #{updateBy},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.zcxk.rmcp.core.entity.InstallPlan">
+    <!--@mbg.generated-->
+    update rmcp_install_plan
+    <set>
+      <if test="tenantId != null">
+        tenant_id = #{tenantId},
+      </if>
+      <if test="planName != null">
+        plan_name = #{planName},
+      </if>
+      <if test="communityId != null">
+        community_id = #{communityId},
+      </if>
+      <if test="companyOrgId != null">
+        company_org_id = #{companyOrgId},
+      </if>
+      <if test="deptOrgId != null">
+        dept_org_id = #{deptOrgId},
+      </if>
+      <if test="productId != null">
+        product_id = #{productId},
+      </if>
+      <if test="doorNum != null">
+        door_num = #{doorNum},
+      </if>
+      <if test="installNum != null">
+        install_num = #{installNum},
+      </if>
+      <if test="acceptedNum != null">
+        accepted_num = #{acceptedNum},
+      </if>
+      <if test="unit != null">
+        unit = #{unit},
+      </if>
+      <if test="principal != null">
+        principal = #{principal},
+      </if>
+      <if test="phone != null">
+        phone = #{phone},
+      </if>
+      <if test="planStatus != null">
+        plan_status = #{planStatus},
+      </if>
+      <if test="acceptStatus != null">
+        accept_status = #{acceptStatus},
+      </if>
+      <if test="platformType != null">
+        platform_type = #{platformType},
+      </if>
+      <if test="enableUnit != null">
+        enable_unit = #{enableUnit},
+      </if>
+      <if test="filePath != null">
+        file_path = #{filePath},
+      </if>
+      <if test="enableDownload != null">
+        enable_download = #{enableDownload},
+      </if>
+      <if test="remark != null">
+        remark = #{remark},
+      </if>
+      <if test="status != null">
+        `status` = #{status},
+      </if>
+      <if test="createDate != null">
+        create_date = #{createDate},
+      </if>
+      <if test="updateDate != null">
+        update_date = #{updateDate},
+      </if>
+      <if test="createBy != null">
+        create_by = #{createBy},
+      </if>
+      <if test="updateBy != null">
+        update_by = #{updateBy},
+      </if>
+    </set>
+    where id = #{id}
+  </update>
+
+  <select id="findById" resultMap="BaseResultMap">
+    select <include refid="Base_Column_List"/> from rmcp_install_plan where status = 1 and id = #{planId}
+  </select>
+
+  <select id="findList" resultType="com.zcxk.rmcp.api.vo.InstallPlanVo">
+    select
+    rip.id,
+    rip.plan_name,
+    rip.door_num,
+    rip.accepted_num,
+    rip.install_num,
+    rip.create_date,
+    rp.product_name,
+    rp.product_model,
+    rm.name as manufacturer_name,
+    roc.ORG_NAME as company_name,
+    rod.ORG_NAME as dept_name,
+    rc.name as community_name,
+    a1.name as province_name,
+    a2.name as city_name,
+    a3.name as region_name
+    from rmcp_install_plan rip
+    left join rmcp_product rp on (rp.id = rip.product_id)
+    left join rmcp_manufacturer rm on (rm.id = rp.manufacturer_id)
+    left join rmcp_org roc on (roc.ID = rip.company_org_id)
+    left join rmcp_org rod on (rod.ID = rip.dept_org_id)
+    left join rmcp_community rc on (rc.id = rip.community_id)
+    left join rmcp_area a1 on a1.id = rc.province
+    left join rmcp_area a2 on a2.id = rc.city
+    left join rmcp_area a3 on a3.id = rc.region
+    where rip.status = 1
+    <if test="condition.name != null and condition.name != ''">and 1 = 1</if>
+    <if test="condition.companyOrgId != null">and rip.company_org_id = #{condition.companyOrgId}</if>
+    <if test="condition.deptOrgId != null">and rip.dept_org_id = #{condition.deptOrgId}</if>
+    <if test="condition.acceptStatus != null">and rip.accept_status = #{condition.acceptStatus}</if>
+    <if test="condition.planStatus != null">and rip.plan_status = #{condition.planStatus}</if>
+    <include refid="permissionCondition"/>
+  </select>
+
+  <sql id="permissionCondition">
+    <if test="userCondition.tenantId != null">and rip.tenant_id = #{userCondition.tenantId}</if>
+    <if test="userCondition.userType!=null and userCondition.userType!=-999 and userCondition.userType!=-9999 and  userCondition.programItems != null and userCondition.programItems.size() > 0">
+      <if test="userCondition.permissionType == 5 or userCondition.permissionType == 2">
+        and ( rip.dept_org_id in
+        <foreach collection="userCondition.programItems" item="item" open="(" close=")" separator=",">
+          #{item.orgId}
+        </foreach>
+        or
+        rip.company_org_id in
+        <foreach collection="userCondition.programItems" item="item" open="(" close=")" separator=",">
+          #{item.orgId}
+        </foreach>
+        )
+      </if>
+      <if test="userCondition.permissionType == 4 or userCondition.permissionType == 3">
+        and rip.dept_org_id in
+        <foreach collection="userCondition.programItems" item="item" open="(" close=")" separator=",">
+          #{item.orgId}
+        </foreach>
+      </if>
+      <if test="userCondition.permissionType == 1">
+        and rip.company_org_id in
+        <foreach collection="userCondition.programItems" item="item" open="(" close=")" separator=",">
+          #{item.orgId}
+        </foreach>
+        and (rip.dept_org_id is null or rip.dept_org_id =0)
+      </if>
+    </if>
+  </sql>
+</mapper>

+ 98 - 0
zoniot-rmcp/zoniot-rmcp-core/src/main/java/com/zcxk/rmcp/core/mapper/ProductCategoryMapper.xml

@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.zcxk.rmcp.core.dao.ProductCategoryMapper">
+  <resultMap id="BaseResultMap" type="com.zcxk.rmcp.core.entity.ProductCategory">
+    <!--@mbg.generated-->
+    <!--@Table rmcp_product_category-->
+    <id column="id" property="id" />
+    <result column="name" property="name" />
+    <result column="icon" property="icon" />
+    <result column="status" property="status" />
+    <result column="create_date" property="createDate" />
+    <result column="create_by" property="createBy" />
+    <result column="update_date" property="updateDate" />
+    <result column="update_by" property="updateBy" />
+  </resultMap>
+  <sql id="Base_Column_List">
+    <!--@mbg.generated-->
+    id, `name`, icon, `status`, create_date, create_by, update_date, update_by
+  </sql>
+  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.zcxk.rmcp.core.entity.ProductCategory" useGeneratedKeys="true">
+    <!--@mbg.generated-->
+    insert into rmcp_product_category
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="name != null">
+        `name`,
+      </if>
+      <if test="icon != null">
+        icon,
+      </if>
+      <if test="status != null">
+        `status`,
+      </if>
+      <if test="createDate != null">
+        create_date,
+      </if>
+      <if test="createBy != null">
+        create_by,
+      </if>
+      <if test="updateDate != null">
+        update_date,
+      </if>
+      <if test="updateBy != null">
+        update_by,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="name != null">
+        #{name},
+      </if>
+      <if test="icon != null">
+        #{icon},
+      </if>
+      <if test="status != null">
+        #{status},
+      </if>
+      <if test="createDate != null">
+        #{createDate},
+      </if>
+      <if test="createBy != null">
+        #{createBy},
+      </if>
+      <if test="updateDate != null">
+        #{updateDate},
+      </if>
+      <if test="updateBy != null">
+        #{updateBy},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.zcxk.rmcp.core.entity.ProductCategory">
+    <!--@mbg.generated-->
+    update rmcp_product_category
+    <set>
+      <if test="name != null">
+        `name` = #{name},
+      </if>
+      <if test="icon != null">
+        icon = #{icon},
+      </if>
+      <if test="status != null">
+        `status` = #{status},
+      </if>
+      <if test="createDate != null">
+        create_date = #{createDate},
+      </if>
+      <if test="createBy != null">
+        create_by = #{createBy},
+      </if>
+      <if test="updateDate != null">
+        update_date = #{updateDate},
+      </if>
+      <if test="updateBy != null">
+        update_by = #{updateBy},
+      </if>
+    </set>
+    where id = #{id}
+  </update>
+</mapper>

+ 160 - 0
zoniot-rmcp/zoniot-rmcp-core/src/main/java/com/zcxk/rmcp/core/mapper/ProductMapper.xml

@@ -0,0 +1,160 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.zcxk.rmcp.core.dao.ProductMapper">
+  <resultMap id="BaseResultMap" type="com.zcxk.rmcp.core.entity.Product">
+    <!--@mbg.generated-->
+    <!--@Table rmcp_product-->
+    <id column="id" property="id" />
+    <result column="product_category_id" property="productCategoryId" />
+    <result column="manufacturer_id" property="manufacturerId" />
+    <result column="product_name" property="productName" />
+    <result column="product_model" property="productModel" />
+    <result column="product_desc" property="productDesc" />
+    <result column="status" property="status" />
+    <result column="create_date" property="createDate" />
+    <result column="create_by" property="createBy" />
+    <result column="update_date" property="updateDate" />
+    <result column="update_by" property="updateBy" />
+    <result column="is_support_valve" property="isSupportValve" />
+    <result column="valve_measuring_code" property="valveMeasuringCode" />
+    <result column="reading_measuring_code" property="readingMeasuringCode" />
+  </resultMap>
+  <sql id="Base_Column_List">
+    <!--@mbg.generated-->
+    id, product_category_id, manufacturer_id, product_name, product_model, product_desc, 
+    `status`, create_date, create_by, update_date, update_by, is_support_valve, valve_measuring_code, 
+    reading_measuring_code
+  </sql>
+  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.zcxk.rmcp.core.entity.Product" useGeneratedKeys="true">
+    <!--@mbg.generated-->
+    insert into rmcp_product
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="productCategoryId != null">
+        product_category_id,
+      </if>
+      <if test="manufacturerId != null">
+        manufacturer_id,
+      </if>
+      <if test="productName != null">
+        product_name,
+      </if>
+      <if test="productModel != null">
+        product_model,
+      </if>
+      <if test="productDesc != null">
+        product_desc,
+      </if>
+      <if test="status != null">
+        `status`,
+      </if>
+      <if test="createDate != null">
+        create_date,
+      </if>
+      <if test="createBy != null">
+        create_by,
+      </if>
+      <if test="updateDate != null">
+        update_date,
+      </if>
+      <if test="updateBy != null">
+        update_by,
+      </if>
+      <if test="isSupportValve != null">
+        is_support_valve,
+      </if>
+      <if test="valveMeasuringCode != null">
+        valve_measuring_code,
+      </if>
+      <if test="readingMeasuringCode != null">
+        reading_measuring_code,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="productCategoryId != null">
+        #{productCategoryId},
+      </if>
+      <if test="manufacturerId != null">
+        #{manufacturerId},
+      </if>
+      <if test="productName != null">
+        #{productName},
+      </if>
+      <if test="productModel != null">
+        #{productModel},
+      </if>
+      <if test="productDesc != null">
+        #{productDesc},
+      </if>
+      <if test="status != null">
+        #{status},
+      </if>
+      <if test="createDate != null">
+        #{createDate},
+      </if>
+      <if test="createBy != null">
+        #{createBy},
+      </if>
+      <if test="updateDate != null">
+        #{updateDate},
+      </if>
+      <if test="updateBy != null">
+        #{updateBy},
+      </if>
+      <if test="isSupportValve != null">
+        #{isSupportValve},
+      </if>
+      <if test="valveMeasuringCode != null">
+        #{valveMeasuringCode},
+      </if>
+      <if test="readingMeasuringCode != null">
+        #{readingMeasuringCode},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.zcxk.rmcp.core.entity.Product">
+    <!--@mbg.generated-->
+    update rmcp_product
+    <set>
+      <if test="productCategoryId != null">
+        product_category_id = #{productCategoryId},
+      </if>
+      <if test="manufacturerId != null">
+        manufacturer_id = #{manufacturerId},
+      </if>
+      <if test="productName != null">
+        product_name = #{productName},
+      </if>
+      <if test="productModel != null">
+        product_model = #{productModel},
+      </if>
+      <if test="productDesc != null">
+        product_desc = #{productDesc},
+      </if>
+      <if test="status != null">
+        `status` = #{status},
+      </if>
+      <if test="createDate != null">
+        create_date = #{createDate},
+      </if>
+      <if test="createBy != null">
+        create_by = #{createBy},
+      </if>
+      <if test="updateDate != null">
+        update_date = #{updateDate},
+      </if>
+      <if test="updateBy != null">
+        update_by = #{updateBy},
+      </if>
+      <if test="isSupportValve != null">
+        is_support_valve = #{isSupportValve},
+      </if>
+      <if test="valveMeasuringCode != null">
+        valve_measuring_code = #{valveMeasuringCode},
+      </if>
+      <if test="readingMeasuringCode != null">
+        reading_measuring_code = #{readingMeasuringCode},
+      </if>
+    </set>
+    where id = #{id}
+  </update>
+</mapper>

+ 1 - 1
zoniot-rmcp/zoniot-rmcp-web/src/main/java/com/zcxk/rmcp/web/controller/DeviceController.java

@@ -37,7 +37,7 @@ public class DeviceController {
     public AjaxMessage<Void> test(){
         LoginUser user = UserUtil.getCurrentUser();
         System.out.println(JSON.toJSONString(user));
-        Device device = deviceService.findById(1L);
+        DeviceVo device = deviceService.findById(1L);
         System.out.println(device);
         return AjaxMessage.success();
     }

+ 135 - 0
zoniot-rmcp/zoniot-rmcp-web/src/main/java/com/zcxk/rmcp/web/controller/InstallPlanController.java

@@ -0,0 +1,135 @@
+package com.zcxk.rmcp.web.controller;
+
+import com.zcxk.core.common.pojo.AjaxMessage;
+import com.zcxk.core.mysql.pageing.Pagination;
+import com.zcxk.rmcp.api.dto.InstallDetailDto;
+import com.zcxk.rmcp.api.dto.InstallPlanInputDto;
+import com.zcxk.rmcp.api.query.InstallPlanQueryCondition;
+import com.zcxk.rmcp.api.vo.InstallPlanVo;
+import com.zcxk.rmcp.core.entity.InstallList;
+import com.zcxk.rmcp.web.service.InstallPlanService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+
+/**
+ * @author linqingwei
+ * @date 2021-07-21 9:48
+ */
+@Controller
+@ResponseBody
+@RequestMapping("installPlan")
+@Api(tags = "安装计划")
+public class InstallPlanController {
+
+    @Autowired
+    private InstallPlanService installPlanService;
+
+    @GetMapping("getPage")
+    @ApiOperation(value = "查询安装计划列表分页")
+    public AjaxMessage<Pagination<InstallPlanVo>> getPage(
+            @ApiParam(value = "名称", required = false) @RequestParam(required = false) String name,
+            @ApiParam(value = "公司id", required = false) @RequestParam(required = false) Integer companyOrgId,
+            @ApiParam(value = "部门id", required = false) @RequestParam(required = false) Integer deptOrgId,
+            @ApiParam(value = "计划状态,0:未结束,1:已结束", required = false) @RequestParam(required = false) Integer planStatus,
+            @ApiParam(value = "验收状态,0:未结束,1:已结束", required = false) @RequestParam(required = false) Integer acceptStatus,
+            @ApiParam(value = "页数,默认第一条", required = true, defaultValue = "1") @RequestParam(required = true, defaultValue = "1") int pageNum,
+            @ApiParam(value = "每页显示数,默认第15条", required = true, defaultValue = "15") @RequestParam(required = true, defaultValue = "15") int pageSize,
+            HttpServletRequest httpServletRequest
+    ) {
+
+        InstallPlanQueryCondition condition = new InstallPlanQueryCondition();
+        condition.setName(name);
+        condition.setCompanyOrgId(companyOrgId);
+        condition.setDeptOrgId(deptOrgId);
+        condition.setPlanStatus(planStatus);
+        condition.setAcceptStatus(acceptStatus);
+
+
+        Pagination<InstallPlanVo> list = installPlanService.getPage(condition, pageNum, pageSize);
+        return  AjaxMessage.success(list);
+    }
+
+
+    @PostMapping("add")
+    @ApiOperation(value = "添加安装计划")
+    public AjaxMessage<Void> add(
+            @ApiParam(value = "安装计划", required = true) @RequestBody(required = true) InstallPlanInputDto installPlanInput
+    ) {
+        installPlanService.add(installPlanInput);
+        return AjaxMessage.success();
+    }
+
+    @PostMapping("batchDel")
+    @ApiOperation(value = "批量安装计划")
+    public AjaxMessage<Void> batchDel(
+            @ApiParam(value = "安装计划id", required = true) @RequestParam(required = true)  List<Integer> ids
+    ) {
+        installPlanService.batchDel(ids);
+        return AjaxMessage.success();
+    }
+
+    @PostMapping("allDel")
+    @ApiOperation(value = "全部安装计划")
+    public AjaxMessage<Void> allDel(
+            @ApiParam(value = "名称", required = false) @RequestParam(required = false) String name,
+            @ApiParam(value = "公司id", required = false) @RequestParam(required = false) Integer companyOrgId,
+            @ApiParam(value = "部门id", required = false) @RequestParam(required = false) Integer deptOrgId,
+            @ApiParam(value = "计划状态,0:未结束,1:已结束", required = false) @RequestParam(required = false) Integer planStatus,
+            @ApiParam(value = "验收状态,0:未结束,1:已结束", required = false) @RequestParam(required = false) Integer acceptStatus
+    ) {
+        InstallPlanQueryCondition condition = new InstallPlanQueryCondition();
+        condition.setName(name);
+        condition.setCompanyOrgId(companyOrgId);
+        condition.setDeptOrgId(deptOrgId);
+        condition.setPlanStatus(planStatus);
+        condition.setAcceptStatus(acceptStatus);
+
+        installPlanService.allDel(condition);
+        return AjaxMessage.success();
+    }
+
+    @GetMapping("getInstallDetail")
+    @ApiOperation(value = "查询安装计划详情")
+    public AjaxMessage<InstallDetailDto> getInstallDetail(
+            @ApiParam(value = "安装计划id", required = true) @RequestParam(required = true) Integer id
+    ) {
+        InstallDetailDto detail = installPlanService.getInstallDetail(id);
+        return AjaxMessage.success(detail);
+    }
+
+    @GetMapping("getInstallList")
+    @ApiOperation(value = "查询安装计划清单列表")
+    public AjaxMessage<List<InstallList>> getInstallList(
+            @ApiParam(value = "安装计划id", required = true) @RequestParam(required = true) Integer id
+    ) {
+        //List<InstallList> list = installPlanService.getInstallList(id);
+        return AjaxMessage.success(null);
+    }
+
+    @GetMapping("/downPlanTemplate")
+    @ApiOperation(value = "下载计划模板", notes = "下载计划模板")
+    public void planDownTemplate(
+            @ApiParam(value = "access_token", required = true) @RequestParam(required = true) String access_token,
+            HttpServletRequest request, HttpServletResponse response
+    ) {
+        installPlanService.downPlanTemplate(response);
+    }
+
+    @GetMapping("/downInstallTemplate")
+    @ApiOperation(value = "下载装表模板", notes = "下载装表模板")
+    public void downInstallTemplate(
+            @ApiParam(value = "安装计划id", required = false) @RequestParam(required = false) Integer id,
+            @ApiParam(value = "access_token", required = true) @RequestParam(required = true) String access_token,
+            HttpServletRequest request, HttpServletResponse response
+    ) {
+        installPlanService.downInstallTemplate(id, response);
+    }
+}

+ 1 - 1
zoniot-rmcp/zoniot-rmcp-web/src/main/java/com/zcxk/rmcp/web/service/DeviceService.java

@@ -20,7 +20,7 @@ public interface DeviceService{
 
     int updateByPrimaryKeySelective(Device record);
 
-    Device findById(Long id);
+    DeviceVo findById(Long id);
 
     Pagination<DeviceVo> getList(CommonQueryCondition condition, int pageNum, int pageSize);
 

+ 16 - 0
zoniot-rmcp/zoniot-rmcp-web/src/main/java/com/zcxk/rmcp/web/service/InstallListService.java

@@ -0,0 +1,16 @@
+package com.zcxk.rmcp.web.service;
+
+import com.zcxk.rmcp.core.entity.InstallList;
+    /**
+ * 
+ * @author linqingwei
+ * @date 2021-07-21 9:44
+ */
+public interface InstallListService{
+
+
+    int insertSelective(InstallList record);
+
+    int updateByPrimaryKeySelective(InstallList record);
+
+}

+ 15 - 0
zoniot-rmcp/zoniot-rmcp-web/src/main/java/com/zcxk/rmcp/web/service/InstallPlanAsyncService.java

@@ -0,0 +1,15 @@
+package com.zcxk.rmcp.web.service;
+
+import com.zcxk.core.common.pojo.LoginUser;
+import com.zcxk.rmcp.core.entity.InstallPlan;
+import org.springframework.stereotype.Service;
+
+/**
+ * @author linqingwei
+ * @date 2021-07-21 14:12
+ */
+@Service
+public class InstallPlanAsyncService {
+    public void asyncTaskToZip(LoginUser loginUser, InstallPlan installPlan) {
+    }
+}

+ 16 - 0
zoniot-rmcp/zoniot-rmcp-web/src/main/java/com/zcxk/rmcp/web/service/InstallPlanDataService.java

@@ -0,0 +1,16 @@
+package com.zcxk.rmcp.web.service;
+
+import com.zcxk.rmcp.core.entity.InstallPlanData;
+    /**
+ * 
+ * @author linqingwei
+ * @date 2021-07-21 9:45
+ */
+public interface InstallPlanDataService{
+
+
+    int insertSelective(InstallPlanData record);
+
+    int updateByPrimaryKeySelective(InstallPlanData record);
+
+}

+ 38 - 0
zoniot-rmcp/zoniot-rmcp-web/src/main/java/com/zcxk/rmcp/web/service/InstallPlanService.java

@@ -0,0 +1,38 @@
+package com.zcxk.rmcp.web.service;
+
+import com.zcxk.core.mysql.pageing.Pagination;
+import com.zcxk.rmcp.api.dto.InstallDetailDto;
+import com.zcxk.rmcp.api.dto.InstallPlanInputDto;
+import com.zcxk.rmcp.api.query.InstallPlanQueryCondition;
+import com.zcxk.rmcp.api.vo.InstallPlanVo;
+import com.zcxk.rmcp.core.entity.InstallPlan;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+
+/**
+ * 
+ * @author linqingwei
+ * @date 2021-07-21 10:03
+ */
+public interface InstallPlanService{
+
+
+    int insertSelective(InstallPlan record);
+
+    int updateByPrimaryKeySelective(InstallPlan record);
+
+    Pagination<InstallPlanVo> getPage(InstallPlanQueryCondition condition, int pageNum, int pageSize);
+
+    void add(InstallPlanInputDto installPlanInput);
+
+    void batchDel(List<Integer> ids);
+
+    void allDel(InstallPlanQueryCondition condition);
+
+    InstallDetailDto getInstallDetail(Integer id);
+
+    void downPlanTemplate(HttpServletResponse response);
+
+    void downInstallTemplate(Integer id, HttpServletResponse response);
+}

+ 16 - 0
zoniot-rmcp/zoniot-rmcp-web/src/main/java/com/zcxk/rmcp/web/service/ProductCategoryService.java

@@ -0,0 +1,16 @@
+package com.zcxk.rmcp.web.service;
+
+import com.zcxk.rmcp.core.entity.ProductCategory;
+    /**
+ * 
+ * @author linqingwei
+ * @date 2021-07-21 17:00
+ */
+public interface ProductCategoryService{
+
+
+    int insertSelective(ProductCategory record);
+
+    int updateByPrimaryKeySelective(ProductCategory record);
+
+}

+ 16 - 0
zoniot-rmcp/zoniot-rmcp-web/src/main/java/com/zcxk/rmcp/web/service/ProductService.java

@@ -0,0 +1,16 @@
+package com.zcxk.rmcp.web.service;
+
+import com.zcxk.rmcp.core.entity.Product;
+    /**
+ * 
+ * @author linqingwei
+ * @date 2021-07-21 9:43
+ */
+public interface ProductService{
+
+
+    int insertSelective(Product record);
+
+    int updateByPrimaryKeySelective(Product record);
+
+}

+ 3 - 3
zoniot-rmcp/zoniot-rmcp-web/src/main/java/com/zcxk/rmcp/web/service/impl/DeviceServiceImpl.java

@@ -58,7 +58,7 @@ public class DeviceServiceImpl implements DeviceService{
     }
 
     @Override
-    public Device findById(Long id) {
+    public DeviceVo findById(Long id) {
         return deviceMapper.findById(id);
     }
 
@@ -115,8 +115,8 @@ public class DeviceServiceImpl implements DeviceService{
 
     @Override
     public DeviceVo deviceDetail(Long deviceId) {
-        Device device = findById(deviceId);
-        return null;
+        DeviceVo device = findById(deviceId);
+        return device;
     }
 
     @Override

+ 30 - 0
zoniot-rmcp/zoniot-rmcp-web/src/main/java/com/zcxk/rmcp/web/service/impl/InstallListServiceImpl.java

@@ -0,0 +1,30 @@
+package com.zcxk.rmcp.web.service.impl;
+
+import com.zcxk.rmcp.web.service.InstallListService;
+import org.springframework.stereotype.Service;
+import javax.annotation.Resource;
+import com.zcxk.rmcp.core.entity.InstallList;
+import com.zcxk.rmcp.core.dao.InstallListMapper;
+
+/**
+ * 
+ * @author linqingwei
+ * @date 2021-07-21 9:44
+ */
+@Service
+public class InstallListServiceImpl implements InstallListService {
+
+    @Resource
+    private InstallListMapper installListMapper;
+
+    @Override
+    public int insertSelective(InstallList record) {
+        return installListMapper.insertSelective(record);
+    }
+
+    @Override
+    public int updateByPrimaryKeySelective(InstallList record) {
+        return installListMapper.updateByPrimaryKeySelective(record);
+    }
+
+}

+ 30 - 0
zoniot-rmcp/zoniot-rmcp-web/src/main/java/com/zcxk/rmcp/web/service/impl/InstallPlanDataServiceImpl.java

@@ -0,0 +1,30 @@
+package com.zcxk.rmcp.web.service.impl;
+
+import com.zcxk.rmcp.web.service.InstallPlanDataService;
+import org.springframework.stereotype.Service;
+import javax.annotation.Resource;
+import com.zcxk.rmcp.core.dao.InstallPlanDataMapper;
+import com.zcxk.rmcp.core.entity.InstallPlanData;
+
+/**
+ * 
+ * @author linqingwei
+ * @date 2021-07-21 9:45
+ */
+@Service
+public class InstallPlanDataServiceImpl implements InstallPlanDataService {
+
+    @Resource
+    private InstallPlanDataMapper installPlanDataMapper;
+
+    @Override
+    public int insertSelective(InstallPlanData record) {
+        return installPlanDataMapper.insertSelective(record);
+    }
+
+    @Override
+    public int updateByPrimaryKeySelective(InstallPlanData record) {
+        return installPlanDataMapper.updateByPrimaryKeySelective(record);
+    }
+
+}

+ 292 - 0
zoniot-rmcp/zoniot-rmcp-web/src/main/java/com/zcxk/rmcp/web/service/impl/InstallPlanServiceImpl.java

@@ -0,0 +1,292 @@
+package com.zcxk.rmcp.web.service.impl;
+
+import com.alibaba.fastjson.JSON;
+import com.github.pagehelper.PageHelper;
+import com.zcxk.core.common.enums.StatusEnum;
+import com.zcxk.core.common.pojo.LoginUser;
+import com.zcxk.core.common.util.BeanCopyUtils;
+import com.zcxk.core.common.util.SnowflakeIdWorker;
+import com.zcxk.core.common.util.UserUtil;
+import com.zcxk.core.mysql.pageing.Pagination;
+import com.zcxk.rmcp.api.dto.InstallDetailDto;
+import com.zcxk.rmcp.api.dto.InstallPlanDataDto;
+import com.zcxk.rmcp.api.dto.InstallPlanInputDto;
+import com.zcxk.rmcp.api.query.InstallPlanQueryCondition;
+import com.zcxk.rmcp.api.vo.InstallPlanVo;
+import com.zcxk.rmcp.core.dao.CommunityMapper;
+import com.zcxk.rmcp.core.dao.InstallListMapper;
+import com.zcxk.rmcp.core.dao.InstallPlanDataMapper;
+import com.zcxk.rmcp.core.entity.Community;
+import com.zcxk.rmcp.core.entity.InstallList;
+import com.zcxk.rmcp.core.entity.InstallPlanData;
+import com.zcxk.rmcp.web.service.CommunityService;
+import com.zcxk.rmcp.web.service.InstallListService;
+import com.zcxk.rmcp.web.service.InstallPlanAsyncService;
+import com.zcxk.rmcp.web.service.InstallPlanService;
+import com.zcxk.rmcp.web.util.TreeUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.jdbc.datasource.DataSourceTransactionManager;
+import org.springframework.stereotype.Service;
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+
+import com.zcxk.rmcp.core.dao.InstallPlanMapper;
+import com.zcxk.rmcp.core.entity.InstallPlan;
+import org.springframework.transaction.TransactionDefinition;
+import org.springframework.transaction.TransactionStatus;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.time.LocalDateTime;
+import java.util.List;
+
+import static com.google.common.collect.Lists.newArrayList;
+
+/**
+ * 
+ * @author linqingwei
+ * @date 2021-07-21 10:03
+ */
+@Slf4j
+@Service
+public class InstallPlanServiceImpl implements InstallPlanService {
+
+    @Resource
+    private InstallPlanMapper installPlanMapper;
+    @Resource
+    private CommunityMapper communityMapper;
+    @Autowired
+    private SnowflakeIdWorker idWorker;
+    @Resource
+    private InstallListMapper installListMapper;
+    @Resource
+    private InstallPlanDataMapper installPlanDataMapper;
+    @Autowired
+    private DataSourceTransactionManager dataSourceTransactionManager;
+    @Autowired
+    private TransactionDefinition transactionDefinition;
+    @Autowired
+    private InstallPlanAsyncService installPlanAsyncService;
+
+
+    @Override
+    public int insertSelective(InstallPlan record) {
+        record.setDoorNum(0);
+        record.setInstallNum(0);
+        record.setAcceptedNum(0);
+        record.setPlanStatus(0);
+        record.setAcceptStatus(0);
+        record.setAcceptStatus(0);
+        record.setStatus(StatusEnum.OK.getCode());
+        record.setCreateBy(UserUtil.getUsername());
+        record.setCreateDate(LocalDateTime.now());
+        record.setUpdateBy(UserUtil.getUsername());
+        record.setUpdateDate(LocalDateTime.now());
+        return installPlanMapper.insertSelective(record);
+    }
+
+    @Override
+    public int updateByPrimaryKeySelective(InstallPlan record) {
+        return installPlanMapper.updateByPrimaryKeySelective(record);
+    }
+
+    @Override
+    public Pagination<InstallPlanVo> getPage(InstallPlanQueryCondition condition, int pageNum, int pageSize) {
+
+        PageHelper.startPage(pageNum,pageSize);
+        List<InstallPlanVo> list = installPlanMapper.findList(condition,UserUtil.getCurrentUser().getUserCondition());
+        return new Pagination<>(list);
+    }
+
+    @Override
+    public void add(InstallPlanInputDto dto) {
+        log.info("begin InstallPlanServiceImpl add  : " + JSON.toJSONString(dto));
+        LoginUser loginUser = UserUtil.getCurrentUser();
+
+        TransactionStatus transactionStatus = dataSourceTransactionManager.getTransaction(transactionDefinition);
+        Integer planId = null;
+        try {
+
+            // 1、小区更新
+            Community community = new Community();
+            community.setId(dto.getCommunityId());
+            community.setAddress(dto.getAdrress());
+            community.setLng(dto.getLng());
+            community.setLat(dto.getLat());
+            communityMapper.updateByPrimaryKeySelective(community);
+
+            // 2、保存计划
+            InstallPlan installPlan = new InstallPlan();
+            BeanCopyUtils.copyProperties(dto, installPlan, InstallPlan.class);
+            installPlan.setTenantId(loginUser.getTenantId());
+            installPlan.setPlatformType(1);
+            this.insertSelective(installPlan);
+
+            // 3、添加计划清单数据
+            addPlanData(installPlan.getId(),installPlan.getTenantId(),dto);
+            planId = installPlan.getId();
+
+            dataSourceTransactionManager.commit(transactionStatus);
+        }catch (Exception e){
+            dataSourceTransactionManager.rollback(transactionStatus);
+        }
+
+
+        // 4、异步生成压缩文件
+        InstallPlan installPlan = installPlanMapper.findById(planId);
+        installPlanAsyncService.asyncTaskToZip(loginUser, installPlan);
+
+        log.info("end InstallPlanServiceImpl add");
+    }
+
+    private void addPlanData(Integer planId, String tenantId, InstallPlanInputDto dto){
+        int doorNum = 0;
+        List<InstallPlanDataDto> list = dto.getInstallPlanDataList();
+        if (list != null && list.size() > 0) {
+            List<InstallList> installLists = newArrayList();
+            List<InstallPlanData> installPlanDataList = newArrayList();
+            for (InstallPlanDataDto installPlanBuilding : list) {
+                InstallPlanData installPlanDataBuilding = new InstallPlanData();
+                installPlanDataBuilding.setId(idWorker.nextId());
+                installPlanDataBuilding.setName(installPlanBuilding.getName() + "栋");
+                installPlanDataBuilding.setParentId(0L);
+                installPlanDataBuilding.setInstallPlanId(planId);
+                installPlanDataBuilding.setType(1);
+                installPlanDataBuilding.setStatus(1);
+                installPlanDataList.add(installPlanDataBuilding);
+                //单元
+                if (installPlanBuilding.getChildren() != null && installPlanBuilding.getChildren().size() > 0) {
+                    for (InstallPlanDataDto installPlanUnit : installPlanBuilding.getChildren()) {
+                        InstallPlanData installPlanDataUnit = new InstallPlanData();
+                        installPlanDataUnit.setName(installPlanUnit.getName() != null ? installPlanUnit.getName() + "单元" : "");
+                        installPlanDataUnit.setId(idWorker.nextId());
+                        installPlanDataUnit.setParentId(installPlanDataBuilding.getId());
+                        installPlanDataUnit.setInstallPlanId(planId);
+                        installPlanDataUnit.setType(2);
+                        installPlanDataUnit.setStatus(1);
+                        installPlanDataList.add(installPlanDataUnit);
+
+                        //安装楼层
+                        if (installPlanUnit.getChildren() != null && installPlanUnit.getChildren().size() > 0) {
+                            for (InstallPlanDataDto installPlanFloor : installPlanUnit.getChildren()) {
+                                InstallPlanData installPlanDataFloor = new InstallPlanData();
+                                installPlanDataFloor.setName(installPlanFloor.getName() + "层");
+                                installPlanDataFloor.setId(idWorker.nextId());
+                                installPlanDataFloor.setParentId(installPlanDataUnit.getId());
+                                installPlanDataFloor.setInstallPlanId(planId);
+                                installPlanDataFloor.setType(3);
+                                installPlanDataFloor.setStatus(1);
+                                installPlanDataList.add(installPlanDataFloor);
+                                //安装清单
+                                if (installPlanFloor.getChildren() != null && installPlanFloor.getChildren().size() > 0) {
+                                    for (InstallPlanDataDto installPlanDoor : installPlanFloor.getChildren()) {
+                                        InstallList installList = new InstallList();
+                                        installList.setTenantId(tenantId);
+                                        installList.setInstallPlanId(planId);
+                                        installList.setInstallPlanDataId(installPlanDataFloor.getId());
+                                        installList.setDoorNo(installPlanDoor.getName());
+                                        installList.setIsInstalled(0);
+                                        installList.setIsAccepted(0);
+
+                                        installList.setRemark("");
+                                        installList.setStatus(StatusEnum.OK.getCode());
+                                        installList.setCreateDate(LocalDateTime.now());
+                                        installList.setUpdateDate(LocalDateTime.now());
+                                        installList.setCreateBy(UserUtil.getUsername());
+                                        installList.setUpdateBy(UserUtil.getUsername());
+                                        installLists.add(installList);
+                                        doorNum++;
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            installListMapper.batchInsert(installLists);
+            installPlanDataMapper.batchInsert(installPlanDataList);
+        }
+        //更新数量
+        InstallPlan updateInstallPlan = new InstallPlan();
+        updateInstallPlan.setId(planId);
+        updateInstallPlan.setDoorNum(doorNum);
+        this.updateByPrimaryKeySelective(updateInstallPlan);
+    }
+
+
+    @Override
+    public void batchDel(List<Integer> ids) {
+
+    }
+
+    @Override
+    public void allDel(InstallPlanQueryCondition condition) {
+
+    }
+
+    @Override
+    public InstallDetailDto getInstallDetail(Integer id) {
+        InstallDetailDto installDetail = new InstallDetailDto();
+        List<InstallPlanDataDto> installPlanDataDTOList = newArrayList();
+
+        //1、计划信息
+        InstallPlan installPlan = installPlanMapper.findById(id);
+        if (installPlan != null) {
+            installDetail.setCommunityName(installPlan.getPlanName());
+            installDetail.setEnableUnit(installPlan.getEnableUnit());
+        }
+
+        //2、计划数据(楼栋、单元、楼层)
+        List<InstallPlanData> installPlanDataList = installPlanDataMapper.fondByPlanId(id);
+        if (installPlanDataList != null && installPlanDataList.size() > 0) {
+            for (InstallPlanData installPlanData : installPlanDataList) {
+                InstallPlanDataDto installPlanDataDTO = new InstallPlanDataDto();
+                installPlanDataDTO.setId(installPlanData.getId());
+                installPlanDataDTO.setParentId(installPlanData.getParentId());
+                installPlanDataDTO.setName(installPlanData.getName());
+                installPlanDataDTO.setType(installPlanData.getType());
+                installPlanDataDTOList.add(installPlanDataDTO);
+            }
+        }
+
+        //3、计划清单
+        List<InstallList> installLists = installListMapper.getInstallList(id);
+        if (installLists != null && installLists.size() > 0) {
+            Integer installedNumber = 0;
+            for (InstallList installList : installLists) {
+                InstallPlanDataDto installPlanDataDTO = new InstallPlanDataDto();
+                installPlanDataDTO.setId(Long.valueOf(installList.getId()));
+                installPlanDataDTO.setParentId(installList.getInstallPlanDataId());
+                installPlanDataDTO.setName(installList.getDoorNo());
+                installPlanDataDTO.setType(4);
+                installPlanDataDTO.setIsInstalled(installList.getIsInstalled());
+                installPlanDataDTO.setIsAccepted(installList.getIsAccepted());
+                installPlanDataDTOList.add(installPlanDataDTO);
+                if (installList.getIsInstalled() == 1) {
+                    installedNumber++;
+                }
+            }
+            installDetail.setTotalNumber(installLists.size());
+            installDetail.setInstalledNumber(installedNumber);
+        }
+
+        //4、组装树形数据
+        List<InstallPlanDataDto> list = TreeUtil.getInstallPlanDataTree(installPlanDataDTOList, 0L, 1);
+        TreeUtil.postorderTraversal(list);
+        installDetail.setInstallPlanDataList(list);
+
+
+        return installDetail;
+    }
+
+    @Override
+    public void downPlanTemplate(HttpServletResponse response) {
+
+    }
+
+    @Override
+    public void downInstallTemplate(Integer id, HttpServletResponse response) {
+
+    }
+
+}

+ 30 - 0
zoniot-rmcp/zoniot-rmcp-web/src/main/java/com/zcxk/rmcp/web/service/impl/ProductCategoryServiceImpl.java

@@ -0,0 +1,30 @@
+package com.zcxk.rmcp.web.service.impl;
+
+import com.zcxk.rmcp.web.service.ProductCategoryService;
+import org.springframework.stereotype.Service;
+import javax.annotation.Resource;
+import com.zcxk.rmcp.core.entity.ProductCategory;
+import com.zcxk.rmcp.core.dao.ProductCategoryMapper;
+
+/**
+ * 
+ * @author linqingwei
+ * @date 2021-07-21 17:00
+ */
+@Service
+public class ProductCategoryServiceImpl implements ProductCategoryService {
+
+    @Resource
+    private ProductCategoryMapper productCategoryMapper;
+
+    @Override
+    public int insertSelective(ProductCategory record) {
+        return productCategoryMapper.insertSelective(record);
+    }
+
+    @Override
+    public int updateByPrimaryKeySelective(ProductCategory record) {
+        return productCategoryMapper.updateByPrimaryKeySelective(record);
+    }
+
+}

+ 30 - 0
zoniot-rmcp/zoniot-rmcp-web/src/main/java/com/zcxk/rmcp/web/service/impl/ProductServiceImpl.java

@@ -0,0 +1,30 @@
+package com.zcxk.rmcp.web.service.impl;
+
+import com.zcxk.rmcp.web.service.ProductService;
+import org.springframework.stereotype.Service;
+import javax.annotation.Resource;
+import com.zcxk.rmcp.core.dao.ProductMapper;
+import com.zcxk.rmcp.core.entity.Product;
+
+/**
+ * 
+ * @author linqingwei
+ * @date 2021-07-21 9:43
+ */
+@Service
+public class ProductServiceImpl implements ProductService {
+
+    @Resource
+    private ProductMapper productMapper;
+
+    @Override
+    public int insertSelective(Product record) {
+        return productMapper.insertSelective(record);
+    }
+
+    @Override
+    public int updateByPrimaryKeySelective(Product record) {
+        return productMapper.updateByPrimaryKeySelective(record);
+    }
+
+}

+ 68 - 0
zoniot-rmcp/zoniot-rmcp-web/src/main/java/com/zcxk/rmcp/web/util/TreeUtil.java

@@ -0,0 +1,68 @@
+package com.zcxk.rmcp.web.util;
+
+import com.zcxk.rmcp.api.dto.InstallPlanDataDto;
+import org.springframework.beans.BeanUtils;
+
+import java.util.List;
+
+import static com.google.common.collect.Lists.newArrayList;
+
+/**
+ * @author linqingwei
+ * @date 2021-07-21 16:56
+ */
+public class TreeUtil {
+
+    public static List<InstallPlanDataDto> getInstallPlanDataTree(List<InstallPlanDataDto> list, Long id, Integer leve) {
+        List<InstallPlanDataDto> temList = newArrayList();
+        Integer isInstalled = 0;
+        Integer totalNumber = 0;
+        if (list != null) {
+            for (InstallPlanDataDto installPlanDataDto : list) {
+                if (id.equals(installPlanDataDto.getParentId())) {
+                    List<InstallPlanDataDto> chidren = getInstallPlanDataTree(list, installPlanDataDto.getId(), ++leve);
+                    InstallPlanDataDto temInstallPlanDataDTO = new InstallPlanDataDto();
+                    BeanUtils.copyProperties(installPlanDataDto, temInstallPlanDataDTO);
+                    temInstallPlanDataDTO.setChildren(chidren);
+                    temList.add(temInstallPlanDataDTO);
+                    leve--;
+                }
+
+            }
+        }
+        if(temList.size() > 0){
+            return temList;
+        }else {
+            return null;
+        }
+    }
+
+    //递归后续遍历多叉树
+    public static void  postorderTraversal(List<InstallPlanDataDto> list){
+        if (list != null && list.size()>0) {
+            for (InstallPlanDataDto installPlanDataDto : list) {
+                postorderTraversal(installPlanDataDto.getChildren());
+
+                if(installPlanDataDto.getChildren() != null && installPlanDataDto.getChildren().size() > 0){
+                    //计算安装数和总数
+                    int installedNumber = 0;
+                    int totalNumber = 0;
+                    for (InstallPlanDataDto child : installPlanDataDto.getChildren()) {
+                        if(installPlanDataDto.getType()==3){
+                            if(child.getIsInstalled()==1){
+                                installedNumber++;
+                            }
+                            totalNumber++;
+                        }else {
+                            installedNumber+=child.getInstalledNumber();
+                            totalNumber+=child.getTotalNumber();
+                        }
+
+                    }
+                    installPlanDataDto.setInstalledNumber(installedNumber);
+                    installPlanDataDto.setTotalNumber(totalNumber);
+                }
+            }
+        }
+    }
+}