Ver código fonte

加入房屋租赁代码

java110 6 anos atrás
pai
commit
7c965c5ce6
22 arquivos alterados com 1430 adições e 202 exclusões
  1. 62 25
      java110-bean/src/main/java/com/java110/dto/rentingConfig/RentingConfigDto.java
  2. 139 0
      java110-bean/src/main/java/com/java110/dto/rentingPool/RentingPoolDto.java
  3. 116 0
      java110-bean/src/main/java/com/java110/po/rentingPool/RentingPoolPo.java
  4. 1 0
      java110-core/src/main/java/com/java110/core/factory/GenerateCodeFactory.java
  5. 116 113
      java110-db/src/main/resources/mapper/user/RentingConfigServiceDaoImplMapper.xml
  6. 187 0
      java110-db/src/main/resources/mapper/user/RentingPoolServiceDaoImplMapper.xml
  7. 38 30
      java110-generator/src/main/resources/newBack/template_1.json
  8. 50 0
      java110-generator/src/main/resources/newBack/template_rentingConfig.json
  9. 98 34
      java110-generator/src/main/resources/web/template_1.json
  10. 52 0
      java110-interface/src/main/java/com/java110/intf/user/IRentingPoolInnerServiceSMO.java
  11. 109 0
      service-user/src/main/java/com/java110/user/api/RentingApi.java
  12. 17 0
      service-user/src/main/java/com/java110/user/bmo/rentingPool/IDeleteRentingPoolBMO.java
  13. 16 0
      service-user/src/main/java/com/java110/user/bmo/rentingPool/IGetRentingPoolBMO.java
  14. 17 0
      service-user/src/main/java/com/java110/user/bmo/rentingPool/ISaveRentingPoolBMO.java
  15. 19 0
      service-user/src/main/java/com/java110/user/bmo/rentingPool/IUpdateRentingPoolBMO.java
  16. 35 0
      service-user/src/main/java/com/java110/user/bmo/rentingPool/impl/DeleteRentingPoolBMOImpl.java
  17. 44 0
      service-user/src/main/java/com/java110/user/bmo/rentingPool/impl/GetRentingPoolBMOImpl.java
  18. 38 0
      service-user/src/main/java/com/java110/user/bmo/rentingPool/impl/SaveRentingPoolBMOImpl.java
  19. 34 0
      service-user/src/main/java/com/java110/user/bmo/rentingPool/impl/UpdateRentingPoolBMOImpl.java
  20. 61 0
      service-user/src/main/java/com/java110/user/dao/IRentingPoolServiceDao.java
  21. 98 0
      service-user/src/main/java/com/java110/user/dao/impl/RentingPoolServiceDaoImpl.java
  22. 83 0
      service-user/src/main/java/com/java110/user/smo/impl/RentingPoolInnerServiceSMOImpl.java

+ 62 - 25
java110-bean/src/main/java/com/java110/dto/rentingConfig/RentingConfigDto.java

@@ -1,6 +1,7 @@
 package com.java110.dto.rentingConfig;
 
 import com.java110.dto.PageDto;
+
 import java.io.Serializable;
 import java.util.Date;
 
@@ -15,14 +16,16 @@ import java.util.Date;
 public class RentingConfigDto extends PageDto implements Serializable {
 
     private String serviceTenantRate;
-private String propertySeparateRate;
-private String servicePrice;
-private String adminSeparateRate;
-private String serviceOwnerRate;
-private String rentingConfigId;
-private String rentingType;
-private String proxySeparateRate;
-private String rentingFormula;
+    private String propertySeparateRate;
+    private String servicePrice;
+    private String adminSeparateRate;
+    private String serviceOwnerRate;
+    private String rentingConfigId;
+    private String rentingType;
+    private String rentingTypeName;
+    private String proxySeparateRate;
+    private String rentingFormula;
+    private String rentingFormulaName;
 
 
     private Date createTime;
@@ -33,55 +36,72 @@ private String rentingFormula;
     public String getServiceTenantRate() {
         return serviceTenantRate;
     }
-public void setServiceTenantRate(String serviceTenantRate) {
+
+    public void setServiceTenantRate(String serviceTenantRate) {
         this.serviceTenantRate = serviceTenantRate;
     }
-public String getPropertySeparateRate() {
+
+    public String getPropertySeparateRate() {
         return propertySeparateRate;
     }
-public void setPropertySeparateRate(String propertySeparateRate) {
+
+    public void setPropertySeparateRate(String propertySeparateRate) {
         this.propertySeparateRate = propertySeparateRate;
     }
-public String getServicePrice() {
+
+    public String getServicePrice() {
         return servicePrice;
     }
-public void setServicePrice(String servicePrice) {
+
+    public void setServicePrice(String servicePrice) {
         this.servicePrice = servicePrice;
     }
-public String getAdminSeparateRate() {
+
+    public String getAdminSeparateRate() {
         return adminSeparateRate;
     }
-public void setAdminSeparateRate(String adminSeparateRate) {
+
+    public void setAdminSeparateRate(String adminSeparateRate) {
         this.adminSeparateRate = adminSeparateRate;
     }
-public String getServiceOwnerRate() {
+
+    public String getServiceOwnerRate() {
         return serviceOwnerRate;
     }
-public void setServiceOwnerRate(String serviceOwnerRate) {
+
+    public void setServiceOwnerRate(String serviceOwnerRate) {
         this.serviceOwnerRate = serviceOwnerRate;
     }
-public String getRentingConfigId() {
+
+    public String getRentingConfigId() {
         return rentingConfigId;
     }
-public void setRentingConfigId(String rentingConfigId) {
+
+    public void setRentingConfigId(String rentingConfigId) {
         this.rentingConfigId = rentingConfigId;
     }
-public String getRentingType() {
+
+    public String getRentingType() {
         return rentingType;
     }
-public void setRentingType(String rentingType) {
+
+    public void setRentingType(String rentingType) {
         this.rentingType = rentingType;
     }
-public String getProxySeparateRate() {
+
+    public String getProxySeparateRate() {
         return proxySeparateRate;
     }
-public void setProxySeparateRate(String proxySeparateRate) {
+
+    public void setProxySeparateRate(String proxySeparateRate) {
         this.proxySeparateRate = proxySeparateRate;
     }
-public String getRentingFormula() {
+
+    public String getRentingFormula() {
         return rentingFormula;
     }
-public void setRentingFormula(String rentingFormula) {
+
+    public void setRentingFormula(String rentingFormula) {
         this.rentingFormula = rentingFormula;
     }
 
@@ -101,4 +121,21 @@ public void setRentingFormula(String rentingFormula) {
     public void setStatusCd(String statusCd) {
         this.statusCd = statusCd;
     }
+
+
+    public String getRentingTypeName() {
+        return rentingTypeName;
+    }
+
+    public void setRentingTypeName(String rentingTypeName) {
+        this.rentingTypeName = rentingTypeName;
+    }
+
+    public String getRentingFormulaName() {
+        return rentingFormulaName;
+    }
+
+    public void setRentingFormulaName(String rentingFormulaName) {
+        this.rentingFormulaName = rentingFormulaName;
+    }
 }

+ 139 - 0
java110-bean/src/main/java/com/java110/dto/rentingPool/RentingPoolDto.java

@@ -0,0 +1,139 @@
+package com.java110.dto.rentingPool;
+
+import com.java110.dto.PageDto;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @ClassName FloorDto
+ * @Description 房屋出租数据层封装
+ * @Author wuxw
+ * @Date 2019/4/24 8:52
+ * @Version 1.0
+ * add by wuxw 2019/4/24
+ **/
+public class RentingPoolDto extends PageDto implements Serializable {
+
+    private String latitude;
+private String ownerTel;
+private String rentingConfigId;
+private String rentingDesc;
+private String rentingTitle;
+private String checkInDate;
+private String rentingId;
+private String roomId;
+private String paymentType;
+private String ownerName;
+private String price;
+private String state;
+private String communityId;
+private String longitude;
+
+
+    private Date createTime;
+
+    private String statusCd = "0";
+
+
+    public String getLatitude() {
+        return latitude;
+    }
+public void setLatitude(String latitude) {
+        this.latitude = latitude;
+    }
+public String getOwnerTel() {
+        return ownerTel;
+    }
+public void setOwnerTel(String ownerTel) {
+        this.ownerTel = ownerTel;
+    }
+public String getRentingConfigId() {
+        return rentingConfigId;
+    }
+public void setRentingConfigId(String rentingConfigId) {
+        this.rentingConfigId = rentingConfigId;
+    }
+public String getRentingDesc() {
+        return rentingDesc;
+    }
+public void setRentingDesc(String rentingDesc) {
+        this.rentingDesc = rentingDesc;
+    }
+public String getRentingTitle() {
+        return rentingTitle;
+    }
+public void setRentingTitle(String rentingTitle) {
+        this.rentingTitle = rentingTitle;
+    }
+public String getCheckInDate() {
+        return checkInDate;
+    }
+public void setCheckInDate(String checkInDate) {
+        this.checkInDate = checkInDate;
+    }
+public String getRentingId() {
+        return rentingId;
+    }
+public void setRentingId(String rentingId) {
+        this.rentingId = rentingId;
+    }
+public String getRoomId() {
+        return roomId;
+    }
+public void setRoomId(String roomId) {
+        this.roomId = roomId;
+    }
+public String getPaymentType() {
+        return paymentType;
+    }
+public void setPaymentType(String paymentType) {
+        this.paymentType = paymentType;
+    }
+public String getOwnerName() {
+        return ownerName;
+    }
+public void setOwnerName(String ownerName) {
+        this.ownerName = ownerName;
+    }
+public String getPrice() {
+        return price;
+    }
+public void setPrice(String price) {
+        this.price = price;
+    }
+public String getState() {
+        return state;
+    }
+public void setState(String state) {
+        this.state = state;
+    }
+public String getCommunityId() {
+        return communityId;
+    }
+public void setCommunityId(String communityId) {
+        this.communityId = communityId;
+    }
+public String getLongitude() {
+        return longitude;
+    }
+public void setLongitude(String longitude) {
+        this.longitude = longitude;
+    }
+
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public String getStatusCd() {
+        return statusCd;
+    }
+
+    public void setStatusCd(String statusCd) {
+        this.statusCd = statusCd;
+    }
+}

+ 116 - 0
java110-bean/src/main/java/com/java110/po/rentingPool/RentingPoolPo.java

@@ -0,0 +1,116 @@
+package com.java110.po.rentingPool;
+
+import java.io.Serializable;
+import java.util.Date;
+
+public class RentingPoolPo implements Serializable {
+
+    private String latitude;
+private String ownerTel;
+private String rentingConfigId;
+private String rentingDesc;
+private String statusCd = "0";
+private String rentingTitle;
+private String checkInDate;
+private String rentingId;
+private String roomId;
+private String paymentType;
+private String ownerName;
+private String price;
+private String state;
+private String communityId;
+private String longitude;
+public String getLatitude() {
+        return latitude;
+    }
+public void setLatitude(String latitude) {
+        this.latitude = latitude;
+    }
+public String getOwnerTel() {
+        return ownerTel;
+    }
+public void setOwnerTel(String ownerTel) {
+        this.ownerTel = ownerTel;
+    }
+public String getRentingConfigId() {
+        return rentingConfigId;
+    }
+public void setRentingConfigId(String rentingConfigId) {
+        this.rentingConfigId = rentingConfigId;
+    }
+public String getRentingDesc() {
+        return rentingDesc;
+    }
+public void setRentingDesc(String rentingDesc) {
+        this.rentingDesc = rentingDesc;
+    }
+public String getStatusCd() {
+        return statusCd;
+    }
+public void setStatusCd(String statusCd) {
+        this.statusCd = statusCd;
+    }
+public String getRentingTitle() {
+        return rentingTitle;
+    }
+public void setRentingTitle(String rentingTitle) {
+        this.rentingTitle = rentingTitle;
+    }
+public String getCheckInDate() {
+        return checkInDate;
+    }
+public void setCheckInDate(String checkInDate) {
+        this.checkInDate = checkInDate;
+    }
+public String getRentingId() {
+        return rentingId;
+    }
+public void setRentingId(String rentingId) {
+        this.rentingId = rentingId;
+    }
+public String getRoomId() {
+        return roomId;
+    }
+public void setRoomId(String roomId) {
+        this.roomId = roomId;
+    }
+public String getPaymentType() {
+        return paymentType;
+    }
+public void setPaymentType(String paymentType) {
+        this.paymentType = paymentType;
+    }
+public String getOwnerName() {
+        return ownerName;
+    }
+public void setOwnerName(String ownerName) {
+        this.ownerName = ownerName;
+    }
+public String getPrice() {
+        return price;
+    }
+public void setPrice(String price) {
+        this.price = price;
+    }
+public String getState() {
+        return state;
+    }
+public void setState(String state) {
+        this.state = state;
+    }
+public String getCommunityId() {
+        return communityId;
+    }
+public void setCommunityId(String communityId) {
+        this.communityId = communityId;
+    }
+public String getLongitude() {
+        return longitude;
+    }
+public void setLongitude(String longitude) {
+        this.longitude = longitude;
+    }
+
+
+
+}

+ 1 - 0
java110-core/src/main/java/com/java110/core/factory/GenerateCodeFactory.java

@@ -137,6 +137,7 @@ public class GenerateCodeFactory {
     public static final String CODE_PREFIX_typeUserId = "79";
     public static final String CODE_PREFIX_appraiseId = "80";
     public static final String CODE_PREFIX_rentingConfigId = "81";
+    public static final String CODE_PREFIX_rentingId = "81";
 
 
 

Diferenças do arquivo suprimidas por serem muito extensas
+ 116 - 113
java110-db/src/main/resources/mapper/user/RentingConfigServiceDaoImplMapper.xml


+ 187 - 0
java110-db/src/main/resources/mapper/user/RentingPoolServiceDaoImplMapper.xml

@@ -0,0 +1,187 @@
+<?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="rentingPoolServiceDaoImpl">
+
+
+    <!-- 保存房屋出租信息 add by wuxw 2018-07-03 -->
+    <insert id="saveRentingPoolInfo" parameterType="Map">
+        insert into renting_pool(
+        latitude,owner_tel,renting_config_id,renting_desc,renting_title,check_in_date,renting_id,room_id,payment_type,owner_name,price,state,community_id,longitude
+        ) values (
+        #{latitude},#{ownerTel},#{rentingConfigId},#{rentingDesc},#{rentingTitle},#{checkInDate},#{rentingId},#{roomId},#{paymentType},#{ownerName},#{price},#{state},#{communityId},#{longitude}
+        )
+    </insert>
+
+
+    <!-- 查询房屋出租信息 add by wuxw 2018-07-03 -->
+    <select id="getRentingPoolInfo" parameterType="Map" resultType="Map">
+        select t.latitude,t.owner_tel,t.owner_tel ownerTel,t.renting_config_id,t.renting_config_id
+        rentingConfigId,t.renting_desc,t.renting_desc rentingDesc,t.status_cd,t.status_cd
+        statusCd,t.renting_title,t.renting_title rentingTitle,t.check_in_date,t.check_in_date
+        checkInDate,t.renting_id,t.renting_id rentingId,t.room_id,t.room_id roomId,t.payment_type,t.payment_type
+        paymentType,t.owner_name,t.owner_name ownerName,t.price,t.state,t.community_id,t.community_id
+        communityId,t.longitude
+        from renting_pool t
+        where 1 =1
+        <if test="latitude !=null and latitude != ''">
+            and t.latitude= #{latitude}
+        </if>
+        <if test="ownerTel !=null and ownerTel != ''">
+            and t.owner_tel= #{ownerTel}
+        </if>
+        <if test="rentingConfigId !=null and rentingConfigId != ''">
+            and t.renting_config_id= #{rentingConfigId}
+        </if>
+        <if test="rentingDesc !=null and rentingDesc != ''">
+            and t.renting_desc= #{rentingDesc}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="rentingTitle !=null and rentingTitle != ''">
+            and t.renting_title= #{rentingTitle}
+        </if>
+        <if test="checkInDate !=null and checkInDate != ''">
+            and t.check_in_date= #{checkInDate}
+        </if>
+        <if test="rentingId !=null and rentingId != ''">
+            and t.renting_id= #{rentingId}
+        </if>
+        <if test="roomId !=null and roomId != ''">
+            and t.room_id= #{roomId}
+        </if>
+        <if test="paymentType !=null and paymentType != ''">
+            and t.payment_type= #{paymentType}
+        </if>
+        <if test="ownerName !=null and ownerName != ''">
+            and t.owner_name= #{ownerName}
+        </if>
+        <if test="price !=null and price != ''">
+            and t.price= #{price}
+        </if>
+        <if test="state !=null and state != ''">
+            and t.state= #{state}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
+        <if test="longitude !=null and longitude != ''">
+            and t.longitude= #{longitude}
+        </if>
+        order by t.create_time desc
+        <if test="page != -1 and page != null ">
+            limit #{page}, #{row}
+        </if>
+
+    </select>
+
+
+    <!-- 修改房屋出租信息 add by wuxw 2018-07-03 -->
+    <update id="updateRentingPoolInfo" parameterType="Map">
+        update renting_pool t set t.status_cd = #{statusCd}
+        <if test="newBId != null and newBId != ''">
+            ,t.b_id = #{newBId}
+        </if>
+        <if test="latitude !=null and latitude != ''">
+            , t.latitude= #{latitude}
+        </if>
+        <if test="ownerTel !=null and ownerTel != ''">
+            , t.owner_tel= #{ownerTel}
+        </if>
+        <if test="rentingConfigId !=null and rentingConfigId != ''">
+            , t.renting_config_id= #{rentingConfigId}
+        </if>
+        <if test="rentingDesc !=null and rentingDesc != ''">
+            , t.renting_desc= #{rentingDesc}
+        </if>
+        <if test="rentingTitle !=null and rentingTitle != ''">
+            , t.renting_title= #{rentingTitle}
+        </if>
+        <if test="checkInDate !=null and checkInDate != ''">
+            , t.check_in_date= #{checkInDate}
+        </if>
+        <if test="roomId !=null and roomId != ''">
+            , t.room_id= #{roomId}
+        </if>
+        <if test="paymentType !=null and paymentType != ''">
+            , t.payment_type= #{paymentType}
+        </if>
+        <if test="ownerName !=null and ownerName != ''">
+            , t.owner_name= #{ownerName}
+        </if>
+        <if test="price !=null and price != ''">
+            , t.price= #{price}
+        </if>
+        <if test="state !=null and state != ''">
+            , t.state= #{state}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            , t.community_id= #{communityId}
+        </if>
+        <if test="longitude !=null and longitude != ''">
+            , t.longitude= #{longitude}
+        </if>
+        where 1=1
+        <if test="rentingId !=null and rentingId != ''">
+            and t.renting_id= #{rentingId}
+        </if>
+
+    </update>
+
+    <!-- 查询房屋出租数量 add by wuxw 2018-07-03 -->
+    <select id="queryRentingPoolsCount" parameterType="Map" resultType="Map">
+        select count(1) count
+        from renting_pool t
+        where 1 =1
+        <if test="latitude !=null and latitude != ''">
+            and t.latitude= #{latitude}
+        </if>
+        <if test="ownerTel !=null and ownerTel != ''">
+            and t.owner_tel= #{ownerTel}
+        </if>
+        <if test="rentingConfigId !=null and rentingConfigId != ''">
+            and t.renting_config_id= #{rentingConfigId}
+        </if>
+        <if test="rentingDesc !=null and rentingDesc != ''">
+            and t.renting_desc= #{rentingDesc}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="rentingTitle !=null and rentingTitle != ''">
+            and t.renting_title= #{rentingTitle}
+        </if>
+        <if test="checkInDate !=null and checkInDate != ''">
+            and t.check_in_date= #{checkInDate}
+        </if>
+        <if test="rentingId !=null and rentingId != ''">
+            and t.renting_id= #{rentingId}
+        </if>
+        <if test="roomId !=null and roomId != ''">
+            and t.room_id= #{roomId}
+        </if>
+        <if test="paymentType !=null and paymentType != ''">
+            and t.payment_type= #{paymentType}
+        </if>
+        <if test="ownerName !=null and ownerName != ''">
+            and t.owner_name= #{ownerName}
+        </if>
+        <if test="price !=null and price != ''">
+            and t.price= #{price}
+        </if>
+        <if test="state !=null and state != ''">
+            and t.state= #{state}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
+        <if test="longitude !=null and longitude != ''">
+            and t.longitude= #{longitude}
+        </if>
+
+
+    </select>
+
+</mapper>

+ 38 - 30
java110-generator/src/main/resources/newBack/template_1.json

@@ -1,50 +1,58 @@
 {
   "autoMove": true,
-  "id": "rentingConfigId",
-  "name": "rentingConfig",
-  "desc": "房屋出租配置",
-  "shareParam": "rentingConfigId",
-  "shareColumn": "renting_config_id",
+  "id": "rentingId",
+  "name": "rentingPool",
+  "desc": "房屋出租",
+  "shareParam": "rentingId",
+  "shareColumn": "renting_id",
   "shareName": "user",
-  "tableName": "renting_config",
+  "tableName": "renting_pool",
   "param": {
+    "rentingId": "renting_id",
+    "rentingTitle": "renting_title",
+    "roomId": "room_id",
+    "communityId": "community_id",
+    "price": "price",
+    "paymentType": "payment_type",
+    "checkInDate": "check_in_date",
     "rentingConfigId": "renting_config_id",
-    "rentingType": "renting_type",
-    "rentingFormula": "renting_formula",
-    "servicePrice": "service_price",
-    "serviceOwnerRate": "service_owner_rate",
-    "serviceTenantRate": "service_tenant_rate",
-    "adminSeparateRate": "admin_separate_rate",
-    "proxySeparateRate": "proxy_separate_rate",
-    "propertySeparateRate": "property_separate_rate",
+    "rentingDesc": "renting_desc",
+    "state": "state",
+    "ownerName": "owner_name",
+    "ownerTel": "owner_tel",
+    "longitude": "longitude",
+    "latitude": "latitude",
     "statusCd": "status_cd"
   },
   "required": [
     {
-      "code": "rentingType",
-      "msg": "租户类型不能为空"
+      "code": "rentingTitle",
+      "msg": "租户名称不能为空"
     },
     {
-      "code": "rentingFormula",
-      "msg": "计算公式不能为空"
+      "code": "roomId",
+      "msg": "房屋ID不能为空"
     },{
-      "code": "servicePrice",
-      "msg": "服务金额不能为空"
+      "code": "communityId",
+      "msg": "小区ID不能为空"
     },{
-      "code": "serviceOwnerRate",
-      "msg": "业主收费率不能为空"
+      "code": "price",
+      "msg": "价格不能为空"
     },{
-      "code": "serviceTenantRate",
-      "msg": "租户收费率不能为空"
+      "code": "paymentType",
+      "msg": "付费方式不能为空"
     },{
-      "code": "adminSeparateRate",
-      "msg": "运营收费率不能为空"
+      "code": "checkInDate",
+      "msg": "入住时间不能为空"
     },{
-      "code": "proxySeparateRate",
-      "msg": "代理商收费率不能为空"
+      "code": "rentingConfigId",
+      "msg": "租户配置不能为空"
     },{
-      "code": "propertySeparateRate",
-      "msg": "物业收费率不能为空"
+      "code": "ownerName",
+      "msg": "业主名称不能为空"
+    },{
+      "code": "ownerTel",
+      "msg": "业主手机号不能为空"
     }
   ]
 }

+ 50 - 0
java110-generator/src/main/resources/newBack/template_rentingConfig.json

@@ -0,0 +1,50 @@
+{
+  "autoMove": true,
+  "id": "rentingConfigId",
+  "name": "rentingConfig",
+  "desc": "房屋出租配置",
+  "shareParam": "rentingConfigId",
+  "shareColumn": "renting_config_id",
+  "shareName": "user",
+  "tableName": "renting_config",
+  "param": {
+    "rentingConfigId": "renting_config_id",
+    "rentingType": "renting_type",
+    "rentingFormula": "renting_formula",
+    "servicePrice": "service_price",
+    "serviceOwnerRate": "service_owner_rate",
+    "serviceTenantRate": "service_tenant_rate",
+    "adminSeparateRate": "admin_separate_rate",
+    "proxySeparateRate": "proxy_separate_rate",
+    "propertySeparateRate": "property_separate_rate",
+    "statusCd": "status_cd"
+  },
+  "required": [
+    {
+      "code": "rentingType",
+      "msg": "租户类型不能为空"
+    },
+    {
+      "code": "rentingFormula",
+      "msg": "计算公式不能为空"
+    },{
+      "code": "servicePrice",
+      "msg": "服务金额不能为空"
+    },{
+      "code": "serviceOwnerRate",
+      "msg": "业主收费率不能为空"
+    },{
+      "code": "serviceTenantRate",
+      "msg": "租户收费率不能为空"
+    },{
+      "code": "adminSeparateRate",
+      "msg": "运营收费率不能为空"
+    },{
+      "code": "proxySeparateRate",
+      "msg": "代理商收费率不能为空"
+    },{
+      "code": "propertySeparateRate",
+      "msg": "物业收费率不能为空"
+    }
+  ]
+}

+ 98 - 34
java110-generator/src/main/resources/web/template_1.json

@@ -1,70 +1,134 @@
 {
-  "templateName":"属性值",
-  "directories": "dev",
-  "templateCode":"attrValue",
-  "templateKey":"valueId",
-  "templateKeyName":"值ID",
-  "searchCode": "valueId",
-  "searchName": "值ID",
+  "templateName":"租聘设置",
+  "directories": "admin",
+  "templateCode":"rentingConfig",
+  "templateKey":"rentingConfigId",
+  "templateKeyName":"配置ID",
+  "searchCode": "rentingConfigId",
+  "searchName": "配置ID",
   "conditions": [
     {
-      "name": "值",
+      "name": "配置ID",
       "inputType": "input",
-      "code": "value",
+      "code": "rentingConfigId",
       "whereCondition": "equal"
     },
     {
-      "name": "显示",
+      "name": "租聘类型",
       "inputType": "select",
-      "selectValue":"Y,N",
-      "selectValueName":"是,否",
-      "code": "valueShow",
+      "selectValue":"3344,4455",
+      "selectValueName":"整租,合租",
+      "code": "rentingType",
       "whereCondition": "equal"
     },
     {
-      "name": "值名称",
-      "inputType": "input",
-      "code": "valueName",
+      "name": "收费公式",
+      "inputType": "select",
+      "selectValue":"1001,2002",
+      "selectValueName":"固定值,每月租金比例",
+      "code": "rentingFormula",
       "whereCondition": "equal"
     }
   ],
   "columns":[
     {
-      "code":"value",
-      "cnCode":"值",
+      "code":"rentingType",
+      "cnCode":"租聘类型",
       "desc":"必填,请填写值",
       "required":true,
       "hasDefaultValue":false,
-      "inputType": "input",
+      "inputType": "select",
+      "selectValue":"3344,4455",
+      "selectValueName":"整租,合租",
       "limit":"maxLength",
       "limitParam":"200",
       "limitErrInfo":"值超过200位",
       "show": true
     },
     {
-      "code": "valueName",
-      "cnCode":"值名称",
-      "desc":"必填,请填写值名称",
+      "code":"rentingFormula",
+      "cnCode":"收费公式",
+      "desc":"必填,请选择算费公式",
+      "required":true,
+      "hasDefaultValue":false,
+      "inputType": "select",
+      "selectValue":"1001,2002",
+      "selectValueName":"固定值,每月租金比例",
+      "limit":"num",
+      "limitParam":"",
+      "limitErrInfo":"显示格式错误",
+      "show": true
+    },
+    {
+      "code": "servicePrice",
+      "cnCode":"服务费",
+      "desc":"必填,请填写服务费",
       "required":true,
       "hasDefaultValue":false,
       "inputType": "input",
-      "limit":"maxLength",
-      "limitParam":"200",
-      "limitErrInfo":"值名称超过200位",
+      "limit":"money",
+      "limitParam":"",
+      "limitErrInfo":"格式错误",
       "show": true
     },
     {
-      "code":"valueShow",
-      "cnCode":"显示",
-      "desc":"必填,请选择是否显示",
+      "code": "serviceOwnerRate",
+      "cnCode":"业主收费比率",
+      "desc":"必填,请填写业主收费比率",
       "required":true,
       "hasDefaultValue":false,
-      "inputType": "select",
-      "selectValue":"Y,N",
-      "selectValueName":"是,否",
-      "limit":"maxLength",
-      "limitParam":"2",
-      "limitErrInfo":"显示格式错误",
+      "inputType": "input",
+      "limit":"money",
+      "limitParam":"",
+      "limitErrInfo":"格式错误",
+      "show": true
+    },
+    {
+      "code": "serviceTenantRate",
+      "cnCode":"租客收费比率",
+      "desc":"必填,请填写租客收费比率",
+      "required":true,
+      "hasDefaultValue":false,
+      "inputType": "input",
+      "limit":"money",
+      "limitParam":"",
+      "limitErrInfo":"格式错误",
+      "show": true
+    },
+    {
+      "code": "adminSeparateRate",
+      "cnCode":"运营分账比率",
+      "desc":"必填,请填写运营分账比率",
+      "required":true,
+      "hasDefaultValue":false,
+      "inputType": "input",
+      "limit":"money",
+      "limitParam":"",
+      "limitErrInfo":"格式错误",
+      "show": true
+    },
+    {
+      "code": "proxySeparateRate",
+      "cnCode":"代理商分账比率",
+      "desc":"必填,请填写代理商分账比率",
+      "required":true,
+      "hasDefaultValue":false,
+      "inputType": "input",
+      "limit":"money",
+      "limitParam":"",
+      "limitErrInfo":"格式错误",
+      "show": true
+    },
+    {
+      "code": "propertySeparateRate",
+      "cnCode":"物业分账比率",
+      "desc":"必填,请填写物业分账比率",
+      "required":true,
+      "hasDefaultValue":false,
+      "inputType": "input",
+      "limit":"money",
+      "limitParam":"",
+      "limitErrInfo":"格式错误",
       "show": true
     }
   ]

+ 52 - 0
java110-interface/src/main/java/com/java110/intf/user/IRentingPoolInnerServiceSMO.java

@@ -0,0 +1,52 @@
+package com.java110.intf.user;
+
+import com.java110.config.feign.FeignConfiguration;
+import com.java110.dto.rentingPool.RentingPoolDto;
+import com.java110.po.rentingPool.RentingPoolPo;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+import java.util.List;
+
+/**
+ * @ClassName IRentingPoolInnerServiceSMO
+ * @Description 房屋出租接口类
+ * @Author wuxw
+ * @Date 2019/4/24 9:04
+ * @Version 1.0
+ * add by wuxw 2019/4/24
+ **/
+@FeignClient(name = "user-service", configuration = {FeignConfiguration.class})
+@RequestMapping("/rentingPoolApi")
+public interface IRentingPoolInnerServiceSMO {
+
+
+    @RequestMapping(value = "/saveRentingPool", method = RequestMethod.POST)
+    public int saveRentingPool(@RequestBody RentingPoolPo rentingPoolPo);
+
+    @RequestMapping(value = "/updateRentingPool", method = RequestMethod.POST)
+    public int updateRentingPool(@RequestBody RentingPoolPo rentingPoolPo);
+
+    @RequestMapping(value = "/deleteRentingPool", method = RequestMethod.POST)
+    public int deleteRentingPool(@RequestBody RentingPoolPo rentingPoolPo);
+
+    /**
+     * <p>查询小区楼信息</p>
+     *
+     * @param rentingPoolDto 数据对象分享
+     * @return RentingPoolDto 对象数据
+     */
+    @RequestMapping(value = "/queryRentingPools", method = RequestMethod.POST)
+    List<RentingPoolDto> queryRentingPools(@RequestBody RentingPoolDto rentingPoolDto);
+
+    /**
+     * 查询<p>小区楼</p>总记录数
+     *
+     * @param rentingPoolDto 数据对象分享
+     * @return 小区下的小区楼记录数
+     */
+    @RequestMapping(value = "/queryRentingPoolsCount", method = RequestMethod.POST)
+    int queryRentingPoolsCount(@RequestBody RentingPoolDto rentingPoolDto);
+}

+ 109 - 0
service-user/src/main/java/com/java110/user/api/RentingApi.java

@@ -2,11 +2,17 @@ package com.java110.user.api;
 
 import com.alibaba.fastjson.JSONObject;
 import com.java110.dto.rentingConfig.RentingConfigDto;
+import com.java110.dto.rentingPool.RentingPoolDto;
 import com.java110.po.rentingConfig.RentingConfigPo;
+import com.java110.po.rentingPool.RentingPoolPo;
 import com.java110.user.bmo.rentingConfig.IDeleteRentingConfigBMO;
 import com.java110.user.bmo.rentingConfig.IGetRentingConfigBMO;
 import com.java110.user.bmo.rentingConfig.ISaveRentingConfigBMO;
 import com.java110.user.bmo.rentingConfig.IUpdateRentingConfigBMO;
+import com.java110.user.bmo.rentingPool.IDeleteRentingPoolBMO;
+import com.java110.user.bmo.rentingPool.IGetRentingPoolBMO;
+import com.java110.user.bmo.rentingPool.ISaveRentingPoolBMO;
+import com.java110.user.bmo.rentingPool.IUpdateRentingPoolBMO;
 import com.java110.utils.util.Assert;
 import com.java110.utils.util.BeanConvertUtil;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -28,6 +34,17 @@ public class RentingApi {
     @Autowired
     private IGetRentingConfigBMO getRentingConfigBMOImpl;
 
+
+    @Autowired
+    private ISaveRentingPoolBMO saveRentingPoolBMOImpl;
+    @Autowired
+    private IUpdateRentingPoolBMO updateRentingPoolBMOImpl;
+    @Autowired
+    private IDeleteRentingPoolBMO deleteRentingPoolBMOImpl;
+
+    @Autowired
+    private IGetRentingPoolBMO getRentingPoolBMOImpl;
+
     /**
      * 微信保存消息模板
      *
@@ -114,4 +131,96 @@ public class RentingApi {
         rentingConfigDto.setRow(row);
         return getRentingConfigBMOImpl.get(rentingConfigDto);
     }
+
+
+    /**
+     * 微信保存消息模板
+     *
+     * @param reqJson
+     * @return
+     * @serviceCode /renting/saveRentingPool
+     * @path /app/renting/saveRentingPool
+     */
+    @RequestMapping(value = "/saveRentingPool", method = RequestMethod.POST)
+    public ResponseEntity<String> saveRentingPool(@RequestBody JSONObject reqJson) {
+
+        Assert.hasKeyAndValue(reqJson, "rentingTitle", "请求报文中未包含rentingTitle");
+        Assert.hasKeyAndValue(reqJson, "roomId", "请求报文中未包含roomId");
+        Assert.hasKeyAndValue(reqJson, "communityId", "请求报文中未包含communityId");
+        Assert.hasKeyAndValue(reqJson, "price", "请求报文中未包含price");
+        Assert.hasKeyAndValue(reqJson, "paymentType", "请求报文中未包含paymentType");
+        Assert.hasKeyAndValue(reqJson, "checkInDate", "请求报文中未包含checkInDate");
+        Assert.hasKeyAndValue(reqJson, "rentingConfigId", "请求报文中未包含rentingConfigId");
+        Assert.hasKeyAndValue(reqJson, "ownerName", "请求报文中未包含ownerName");
+        Assert.hasKeyAndValue(reqJson, "ownerTel", "请求报文中未包含ownerTel");
+
+
+        RentingPoolPo rentingPoolPo = BeanConvertUtil.covertBean(reqJson, RentingPoolPo.class);
+        return saveRentingPoolBMOImpl.save(rentingPoolPo);
+    }
+
+    /**
+     * 微信修改消息模板
+     *
+     * @param reqJson
+     * @return
+     * @serviceCode /renting/updateRentingPool
+     * @path /app/renting/updateRentingPool
+     */
+    @RequestMapping(value = "/updateRentingPool", method = RequestMethod.POST)
+    public ResponseEntity<String> updateRentingPool(@RequestBody JSONObject reqJson) {
+
+        Assert.hasKeyAndValue(reqJson, "rentingTitle", "请求报文中未包含rentingTitle");
+        Assert.hasKeyAndValue(reqJson, "roomId", "请求报文中未包含roomId");
+        Assert.hasKeyAndValue(reqJson, "communityId", "请求报文中未包含communityId");
+        Assert.hasKeyAndValue(reqJson, "price", "请求报文中未包含price");
+        Assert.hasKeyAndValue(reqJson, "paymentType", "请求报文中未包含paymentType");
+        Assert.hasKeyAndValue(reqJson, "checkInDate", "请求报文中未包含checkInDate");
+        Assert.hasKeyAndValue(reqJson, "rentingConfigId", "请求报文中未包含rentingConfigId");
+        Assert.hasKeyAndValue(reqJson, "ownerName", "请求报文中未包含ownerName");
+        Assert.hasKeyAndValue(reqJson, "ownerTel", "请求报文中未包含ownerTel");
+        Assert.hasKeyAndValue(reqJson, "rentingId", "rentingId不能为空");
+
+
+        RentingPoolPo rentingPoolPo = BeanConvertUtil.covertBean(reqJson, RentingPoolPo.class);
+        return updateRentingPoolBMOImpl.update(rentingPoolPo);
+    }
+
+    /**
+     * 微信删除消息模板
+     *
+     * @param reqJson
+     * @return
+     * @serviceCode /renting/deleteRentingPool
+     * @path /app/renting/deleteRentingPool
+     */
+    @RequestMapping(value = "/deleteRentingPool", method = RequestMethod.POST)
+    public ResponseEntity<String> deleteRentingPool(@RequestBody JSONObject reqJson) {
+        Assert.hasKeyAndValue(reqJson, "communityId", "小区ID不能为空");
+
+        Assert.hasKeyAndValue(reqJson, "rentingId", "rentingId不能为空");
+
+
+        RentingPoolPo rentingPoolPo = BeanConvertUtil.covertBean(reqJson, RentingPoolPo.class);
+        return deleteRentingPoolBMOImpl.delete(rentingPoolPo);
+    }
+
+    /**
+     * 微信删除消息模板
+     *
+     * @param communityId 小区ID
+     * @return
+     * @serviceCode /renting/queryRentingPool
+     * @path /app/renting/queryRentingPool
+     */
+    @RequestMapping(value = "/queryRentingPool", method = RequestMethod.GET)
+    public ResponseEntity<String> queryRentingPool(@RequestParam(value = "communityId") String communityId,
+                                                   @RequestParam(value = "page") int page,
+                                                   @RequestParam(value = "row") int row) {
+        RentingPoolDto rentingPoolDto = new RentingPoolDto();
+        rentingPoolDto.setPage(page);
+        rentingPoolDto.setRow(row);
+        rentingPoolDto.setCommunityId(communityId);
+        return getRentingPoolBMOImpl.get(rentingPoolDto);
+    }
 }

+ 17 - 0
service-user/src/main/java/com/java110/user/bmo/rentingPool/IDeleteRentingPoolBMO.java

@@ -0,0 +1,17 @@
+package com.java110.user.bmo.rentingPool;
+import com.java110.po.rentingPool.RentingPoolPo;
+import org.springframework.http.ResponseEntity;
+
+public interface IDeleteRentingPoolBMO {
+
+
+    /**
+     * 修改房屋出租
+     * add by wuxw
+     * @param rentingPoolPo
+     * @return
+     */
+    ResponseEntity<String> delete(RentingPoolPo rentingPoolPo);
+
+
+}

+ 16 - 0
service-user/src/main/java/com/java110/user/bmo/rentingPool/IGetRentingPoolBMO.java

@@ -0,0 +1,16 @@
+package com.java110.user.bmo.rentingPool;
+import com.java110.dto.rentingPool.RentingPoolDto;
+import org.springframework.http.ResponseEntity;
+public interface IGetRentingPoolBMO {
+
+
+    /**
+     * 查询房屋出租
+     * add by wuxw
+     * @param  rentingPoolDto
+     * @return
+     */
+    ResponseEntity<String> get(RentingPoolDto rentingPoolDto);
+
+
+}

+ 17 - 0
service-user/src/main/java/com/java110/user/bmo/rentingPool/ISaveRentingPoolBMO.java

@@ -0,0 +1,17 @@
+package com.java110.user.bmo.rentingPool;
+
+import com.java110.po.rentingPool.RentingPoolPo;
+import org.springframework.http.ResponseEntity;
+public interface ISaveRentingPoolBMO {
+
+
+    /**
+     * 添加房屋出租
+     * add by wuxw
+     * @param rentingPoolPo
+     * @return
+     */
+    ResponseEntity<String> save(RentingPoolPo rentingPoolPo);
+
+
+}

+ 19 - 0
service-user/src/main/java/com/java110/user/bmo/rentingPool/IUpdateRentingPoolBMO.java

@@ -0,0 +1,19 @@
+package com.java110.user.bmo.rentingPool;
+
+import com.java110.po.rentingPool.RentingPoolPo;
+import org.springframework.http.ResponseEntity;
+
+public interface IUpdateRentingPoolBMO {
+
+
+    /**
+     * 修改房屋出租
+     * add by wuxw
+     *
+     * @param rentingPoolPo
+     * @return
+     */
+    ResponseEntity<String> update(RentingPoolPo rentingPoolPo);
+
+
+}

+ 35 - 0
service-user/src/main/java/com/java110/user/bmo/rentingPool/impl/DeleteRentingPoolBMOImpl.java

@@ -0,0 +1,35 @@
+package com.java110.user.bmo.rentingPool.impl;
+
+import com.java110.core.annotation.Java110Transactional;
+
+import com.java110.intf.user.IRentingPoolInnerServiceSMO;
+import com.java110.po.rentingPool.RentingPoolPo;
+import com.java110.user.bmo.rentingPool.IDeleteRentingPoolBMO;
+import com.java110.vo.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+
+@Service("deleteRentingPoolBMOImpl")
+public class DeleteRentingPoolBMOImpl implements IDeleteRentingPoolBMO {
+
+    @Autowired
+    private IRentingPoolInnerServiceSMO rentingPoolInnerServiceSMOImpl;
+
+    /**
+     * @param rentingPoolPo 数据
+     * @return 订单服务能够接受的报文
+     */
+    @Java110Transactional
+    public ResponseEntity<String> delete(RentingPoolPo rentingPoolPo) {
+
+        int flag = rentingPoolInnerServiceSMOImpl.deleteRentingPool(rentingPoolPo);
+
+        if (flag > 0) {
+            return ResultVo.createResponseEntity(ResultVo.CODE_OK, "保存成功");
+        }
+
+        return ResultVo.createResponseEntity(ResultVo.CODE_ERROR, "保存失败");
+    }
+
+}

+ 44 - 0
service-user/src/main/java/com/java110/user/bmo/rentingPool/impl/GetRentingPoolBMOImpl.java

@@ -0,0 +1,44 @@
+package com.java110.user.bmo.rentingPool.impl;
+
+import com.java110.dto.rentingPool.RentingPoolDto;
+import com.java110.intf.user.IRentingPoolInnerServiceSMO;
+import com.java110.user.bmo.rentingPool.IGetRentingPoolBMO;
+import com.java110.vo.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@Service("getRentingPoolBMOImpl")
+public class GetRentingPoolBMOImpl implements IGetRentingPoolBMO {
+
+    @Autowired
+    private IRentingPoolInnerServiceSMO rentingPoolInnerServiceSMOImpl;
+
+    /**
+     * @param rentingPoolDto
+     * @return 订单服务能够接受的报文
+     */
+    public ResponseEntity<String> get(RentingPoolDto rentingPoolDto) {
+
+
+        int count = rentingPoolInnerServiceSMOImpl.queryRentingPoolsCount(rentingPoolDto);
+
+        List<RentingPoolDto> rentingPoolDtos = null;
+        if (count > 0) {
+            rentingPoolDtos = rentingPoolInnerServiceSMOImpl.queryRentingPools(rentingPoolDto);
+        } else {
+            rentingPoolDtos = new ArrayList<>();
+        }
+
+        ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) rentingPoolDto.getRow()), count, rentingPoolDtos);
+
+        ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
+
+        return responseEntity;
+    }
+
+}

+ 38 - 0
service-user/src/main/java/com/java110/user/bmo/rentingPool/impl/SaveRentingPoolBMOImpl.java

@@ -0,0 +1,38 @@
+package com.java110.user.bmo.rentingPool.impl;
+
+import com.java110.core.annotation.Java110Transactional;
+import com.java110.core.factory.GenerateCodeFactory;
+import com.java110.intf.user.IRentingPoolInnerServiceSMO;
+import com.java110.po.rentingPool.RentingPoolPo;
+import com.java110.user.bmo.rentingPool.ISaveRentingPoolBMO;
+import com.java110.vo.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+
+@Service("saveRentingPoolBMOImpl")
+public class SaveRentingPoolBMOImpl implements ISaveRentingPoolBMO {
+
+    @Autowired
+    private IRentingPoolInnerServiceSMO rentingPoolInnerServiceSMOImpl;
+
+    /**
+     * 添加小区信息
+     *
+     * @param rentingPoolPo
+     * @return 订单服务能够接受的报文
+     */
+    @Java110Transactional
+    public ResponseEntity<String> save(RentingPoolPo rentingPoolPo) {
+
+        rentingPoolPo.setRentingId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_rentingId));
+        int flag = rentingPoolInnerServiceSMOImpl.saveRentingPool(rentingPoolPo);
+
+        if (flag > 0) {
+            return ResultVo.createResponseEntity(ResultVo.CODE_OK, "保存成功");
+        }
+
+        return ResultVo.createResponseEntity(ResultVo.CODE_ERROR, "保存失败");
+    }
+
+}

+ 34 - 0
service-user/src/main/java/com/java110/user/bmo/rentingPool/impl/UpdateRentingPoolBMOImpl.java

@@ -0,0 +1,34 @@
+package com.java110.user.bmo.rentingPool.impl;
+
+import com.java110.core.annotation.Java110Transactional;
+import com.java110.intf.user.IRentingPoolInnerServiceSMO;
+import com.java110.po.rentingPool.RentingPoolPo;
+import com.java110.user.bmo.rentingPool.IUpdateRentingPoolBMO;
+import com.java110.vo.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+
+@Service("updateRentingPoolBMOImpl")
+public class UpdateRentingPoolBMOImpl implements IUpdateRentingPoolBMO {
+
+    @Autowired
+    private IRentingPoolInnerServiceSMO rentingPoolInnerServiceSMOImpl;
+
+    /**
+     * @param rentingPoolPo
+     * @return 订单服务能够接受的报文
+     */
+    @Java110Transactional
+    public ResponseEntity<String> update(RentingPoolPo rentingPoolPo) {
+
+        int flag = rentingPoolInnerServiceSMOImpl.updateRentingPool(rentingPoolPo);
+
+        if (flag > 0) {
+            return ResultVo.createResponseEntity(ResultVo.CODE_OK, "保存成功");
+        }
+
+        return ResultVo.createResponseEntity(ResultVo.CODE_ERROR, "保存失败");
+    }
+
+}

+ 61 - 0
service-user/src/main/java/com/java110/user/dao/IRentingPoolServiceDao.java

@@ -0,0 +1,61 @@
+package com.java110.user.dao;
+
+
+import com.java110.utils.exception.DAOException;
+import com.java110.entity.merchant.BoMerchant;
+import com.java110.entity.merchant.BoMerchantAttr;
+import com.java110.entity.merchant.Merchant;
+import com.java110.entity.merchant.MerchantAttr;
+
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 房屋出租组件内部之间使用,没有给外围系统提供服务能力
+ * 房屋出租服务接口类,要求全部以字符串传输,方便微服务化
+ * 新建客户,修改客户,删除客户,查询客户等功能
+ *
+ * Created by wuxw on 2016/12/27.
+ */
+public interface IRentingPoolServiceDao {
+
+
+    /**
+     * 保存 房屋出租信息
+     * @param info
+     * @throws DAOException DAO异常
+     */
+    void saveRentingPoolInfo(Map info) throws DAOException;
+
+
+
+
+    /**
+     * 查询房屋出租信息(instance过程)
+     * 根据bId 查询房屋出租信息
+     * @param info bId 信息
+     * @return 房屋出租信息
+     * @throws DAOException DAO异常
+     */
+    List<Map> getRentingPoolInfo(Map info) throws DAOException;
+
+
+
+    /**
+     * 修改房屋出租信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    void updateRentingPoolInfo(Map info) throws DAOException;
+
+
+    /**
+     * 查询房屋出租总数
+     *
+     * @param info 房屋出租信息
+     * @return 房屋出租数量
+     */
+    int queryRentingPoolsCount(Map info);
+
+}

+ 98 - 0
service-user/src/main/java/com/java110/user/dao/impl/RentingPoolServiceDaoImpl.java

@@ -0,0 +1,98 @@
+package com.java110.user.dao.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.utils.constant.ResponseConstant;
+import com.java110.utils.exception.DAOException;
+import com.java110.utils.util.DateUtil;
+import com.java110.core.base.dao.BaseServiceDao;
+import com.java110.user.dao.IRentingPoolServiceDao;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 房屋出租服务 与数据库交互
+ * Created by wuxw on 2017/4/5.
+ */
+@Service("rentingPoolServiceDaoImpl")
+//@Transactional
+public class RentingPoolServiceDaoImpl extends BaseServiceDao implements IRentingPoolServiceDao {
+
+    private static Logger logger = LoggerFactory.getLogger(RentingPoolServiceDaoImpl.class);
+
+
+
+
+
+    /**
+     * 保存房屋出租信息 到 instance
+     * @param info   bId 信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public void saveRentingPoolInfo(Map info) throws DAOException {
+        logger.debug("保存房屋出租信息Instance 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.insert("rentingPoolServiceDaoImpl.saveRentingPoolInfo",info);
+
+        if(saveFlag < 1){
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存房屋出租信息Instance数据失败:"+ JSONObject.toJSONString(info));
+        }
+    }
+
+
+    /**
+     * 查询房屋出租信息(instance)
+     * @param info bId 信息
+     * @return List<Map>
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public List<Map> getRentingPoolInfo(Map info) throws DAOException {
+        logger.debug("查询房屋出租信息 入参 info : {}",info);
+
+        List<Map> businessRentingPoolInfos = sqlSessionTemplate.selectList("rentingPoolServiceDaoImpl.getRentingPoolInfo",info);
+
+        return businessRentingPoolInfos;
+    }
+
+
+    /**
+     * 修改房屋出租信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public void updateRentingPoolInfo(Map info) throws DAOException {
+        logger.debug("修改房屋出租信息Instance 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.update("rentingPoolServiceDaoImpl.updateRentingPoolInfo",info);
+
+        if(saveFlag < 1){
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"修改房屋出租信息Instance数据失败:"+ JSONObject.toJSONString(info));
+        }
+    }
+
+     /**
+     * 查询房屋出租数量
+     * @param info 房屋出租信息
+     * @return 房屋出租数量
+     */
+    @Override
+    public int queryRentingPoolsCount(Map info) {
+        logger.debug("查询房屋出租数据 入参 info : {}",info);
+
+        List<Map> businessRentingPoolInfos = sqlSessionTemplate.selectList("rentingPoolServiceDaoImpl.queryRentingPoolsCount", info);
+        if (businessRentingPoolInfos.size() < 1) {
+            return 0;
+        }
+
+        return Integer.parseInt(businessRentingPoolInfos.get(0).get("count").toString());
+    }
+
+
+}

+ 83 - 0
service-user/src/main/java/com/java110/user/smo/impl/RentingPoolInnerServiceSMOImpl.java

@@ -0,0 +1,83 @@
+package com.java110.user.smo.impl;
+
+
+import com.java110.core.base.smo.BaseServiceSMO;
+import com.java110.dto.PageDto;
+import com.java110.dto.rentingPool.RentingPoolDto;
+import com.java110.intf.user.IRentingPoolInnerServiceSMO;
+import com.java110.po.rentingPool.RentingPoolPo;
+import com.java110.user.dao.IRentingPoolServiceDao;
+import com.java110.utils.util.BeanConvertUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * @ClassName FloorInnerServiceSMOImpl
+ * @Description 房屋出租内部服务实现类
+ * @Author wuxw
+ * @Date 2019/4/24 9:20
+ * @Version 1.0
+ * add by wuxw 2019/4/24
+ **/
+@RestController
+public class RentingPoolInnerServiceSMOImpl extends BaseServiceSMO implements IRentingPoolInnerServiceSMO {
+
+    @Autowired
+    private IRentingPoolServiceDao rentingPoolServiceDaoImpl;
+
+
+    @Override
+    public int saveRentingPool(@RequestBody RentingPoolPo rentingPoolPo) {
+        int saveFlag = 1;
+        rentingPoolServiceDaoImpl.saveRentingPoolInfo(BeanConvertUtil.beanCovertMap(rentingPoolPo));
+        return saveFlag;
+    }
+
+    @Override
+    public int updateRentingPool(@RequestBody RentingPoolPo rentingPoolPo) {
+        int saveFlag = 1;
+        rentingPoolServiceDaoImpl.updateRentingPoolInfo(BeanConvertUtil.beanCovertMap(rentingPoolPo));
+        return saveFlag;
+    }
+
+    @Override
+    public int deleteRentingPool(@RequestBody RentingPoolPo rentingPoolPo) {
+        int saveFlag = 1;
+        rentingPoolPo.setStatusCd("1");
+        rentingPoolServiceDaoImpl.updateRentingPoolInfo(BeanConvertUtil.beanCovertMap(rentingPoolPo));
+        return saveFlag;
+    }
+
+    @Override
+    public List<RentingPoolDto> queryRentingPools(@RequestBody RentingPoolDto rentingPoolDto) {
+
+        //校验是否传了 分页信息
+
+        int page = rentingPoolDto.getPage();
+
+        if (page != PageDto.DEFAULT_PAGE) {
+            rentingPoolDto.setPage((page - 1) * rentingPoolDto.getRow());
+        }
+
+        List<RentingPoolDto> rentingPools = BeanConvertUtil.covertBeanList(rentingPoolServiceDaoImpl.getRentingPoolInfo(BeanConvertUtil.beanCovertMap(rentingPoolDto)), RentingPoolDto.class);
+
+        return rentingPools;
+    }
+
+
+    @Override
+    public int queryRentingPoolsCount(@RequestBody RentingPoolDto rentingPoolDto) {
+        return rentingPoolServiceDaoImpl.queryRentingPoolsCount(BeanConvertUtil.beanCovertMap(rentingPoolDto));
+    }
+
+    public IRentingPoolServiceDao getRentingPoolServiceDaoImpl() {
+        return rentingPoolServiceDaoImpl;
+    }
+
+    public void setRentingPoolServiceDaoImpl(IRentingPoolServiceDao rentingPoolServiceDaoImpl) {
+        this.rentingPoolServiceDaoImpl = rentingPoolServiceDaoImpl;
+    }
+}