Explorar o código

Merge branch 'master' of http://git.homecommunity.cn/supervip/MicroCommunity

java110 %!s(int64=4) %!d(string=hai) anos
pai
achega
f1d1ad21ca

+ 205 - 0
java110-db/src/main/resources/mapper/community/BuildingRoomV1ServiceDaoImplMapper.xml

@@ -0,0 +1,205 @@
+<?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="buildingRoomV1ServiceDaoImpl">
+
+
+
+
+
+    <!-- 保存房屋信息 add by wuxw 2018-07-03 -->
+    <insert id="saveBuildingRoomInfo" parameterType="Map">
+        insert into building_room(
+section,remark,room_sub_type,room_area,user_id,room_id,layer,fee_coefficient,built_up_area,room_num,unit_id,state,community_id,apartment,room_type,room_rent
+) values (
+#{section},#{remark},#{roomSubType},#{roomArea},#{userId},#{roomId},#{layer},#{feeCoefficient},#{builtUpArea},#{roomNum},#{unitId},#{state},#{communityId},#{apartment},#{roomType},#{roomRent}
+)
+    </insert>
+
+
+
+    <!-- 查询房屋信息 add by wuxw 2018-07-03 -->
+    <select id="getBuildingRoomInfo" parameterType="Map" resultType="Map">
+        select  t.section,t.remark,t.status_cd,t.status_cd statusCd,t.room_sub_type,t.room_sub_type roomSubType,t.room_area,t.room_area roomArea,t.user_id,t.user_id userId,t.room_id,t.room_id roomId,t.layer,t.fee_coefficient,t.fee_coefficient feeCoefficient,t.built_up_area,t.built_up_area builtUpArea,t.room_num,t.room_num roomNum,t.unit_id,t.unit_id unitId,t.state,t.community_id,t.community_id communityId,t.apartment,t.room_type,t.room_type roomType,t.room_rent,t.room_rent roomRent 
+from building_room t 
+where 1 =1 
+<if test="section !=null and section != ''">
+   and t.section= #{section}
+</if> 
+<if test="remark !=null and remark != ''">
+   and t.remark= #{remark}
+</if> 
+<if test="statusCd !=null and statusCd != ''">
+   and t.status_cd= #{statusCd}
+</if> 
+<if test="roomSubType !=null and roomSubType != ''">
+   and t.room_sub_type= #{roomSubType}
+</if> 
+<if test="roomArea !=null and roomArea != ''">
+   and t.room_area= #{roomArea}
+</if> 
+<if test="userId !=null and userId != ''">
+   and t.user_id= #{userId}
+</if> 
+<if test="roomId !=null and roomId != ''">
+   and t.room_id= #{roomId}
+</if> 
+<if test="layer !=null and layer != ''">
+   and t.layer= #{layer}
+</if> 
+<if test="feeCoefficient !=null and feeCoefficient != ''">
+   and t.fee_coefficient= #{feeCoefficient}
+</if> 
+<if test="builtUpArea !=null and builtUpArea != ''">
+   and t.built_up_area= #{builtUpArea}
+</if> 
+<if test="roomNum !=null and roomNum != ''">
+   and t.room_num= #{roomNum}
+</if> 
+<if test="unitId !=null and unitId != ''">
+   and t.unit_id= #{unitId}
+</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="apartment !=null and apartment != ''">
+   and t.apartment= #{apartment}
+</if> 
+<if test="roomType !=null and roomType != ''">
+   and t.room_type= #{roomType}
+</if> 
+<if test="roomRent !=null and roomRent != ''">
+   and t.room_rent= #{roomRent}
+</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="updateBuildingRoomInfo" parameterType="Map">
+        update  building_room t set t.status_cd = #{statusCd}
+<if test="newBId != null and newBId != ''">
+,t.b_id = #{newBId}
+</if> 
+<if test="section !=null and section != ''">
+, t.section= #{section}
+</if> 
+<if test="remark !=null and remark != ''">
+, t.remark= #{remark}
+</if> 
+<if test="roomSubType !=null and roomSubType != ''">
+, t.room_sub_type= #{roomSubType}
+</if> 
+<if test="roomArea !=null and roomArea != ''">
+, t.room_area= #{roomArea}
+</if> 
+<if test="userId !=null and userId != ''">
+, t.user_id= #{userId}
+</if> 
+<if test="layer !=null and layer != ''">
+, t.layer= #{layer}
+</if> 
+<if test="feeCoefficient !=null and feeCoefficient != ''">
+, t.fee_coefficient= #{feeCoefficient}
+</if> 
+<if test="builtUpArea !=null and builtUpArea != ''">
+, t.built_up_area= #{builtUpArea}
+</if> 
+<if test="roomNum !=null and roomNum != ''">
+, t.room_num= #{roomNum}
+</if> 
+<if test="unitId !=null and unitId != ''">
+, t.unit_id= #{unitId}
+</if> 
+<if test="state !=null and state != ''">
+, t.state= #{state}
+</if> 
+<if test="communityId !=null and communityId != ''">
+, t.community_id= #{communityId}
+</if> 
+<if test="apartment !=null and apartment != ''">
+, t.apartment= #{apartment}
+</if> 
+<if test="roomType !=null and roomType != ''">
+, t.room_type= #{roomType}
+</if> 
+<if test="roomRent !=null and roomRent != ''">
+, t.room_rent= #{roomRent}
+</if> 
+ where 1=1 <if test="roomId !=null and roomId != ''">
+and t.room_id= #{roomId}
+</if> 
+
+    </update>
+
+    <!-- 查询房屋数量 add by wuxw 2018-07-03 -->
+     <select id="queryBuildingRoomsCount" parameterType="Map" resultType="Map">
+        select  count(1) count 
+from building_room t 
+where 1 =1 
+<if test="section !=null and section != ''">
+   and t.section= #{section}
+</if> 
+<if test="remark !=null and remark != ''">
+   and t.remark= #{remark}
+</if> 
+<if test="statusCd !=null and statusCd != ''">
+   and t.status_cd= #{statusCd}
+</if> 
+<if test="roomSubType !=null and roomSubType != ''">
+   and t.room_sub_type= #{roomSubType}
+</if> 
+<if test="roomArea !=null and roomArea != ''">
+   and t.room_area= #{roomArea}
+</if> 
+<if test="userId !=null and userId != ''">
+   and t.user_id= #{userId}
+</if> 
+<if test="roomId !=null and roomId != ''">
+   and t.room_id= #{roomId}
+</if> 
+<if test="layer !=null and layer != ''">
+   and t.layer= #{layer}
+</if> 
+<if test="feeCoefficient !=null and feeCoefficient != ''">
+   and t.fee_coefficient= #{feeCoefficient}
+</if> 
+<if test="builtUpArea !=null and builtUpArea != ''">
+   and t.built_up_area= #{builtUpArea}
+</if> 
+<if test="roomNum !=null and roomNum != ''">
+   and t.room_num= #{roomNum}
+</if> 
+<if test="unitId !=null and unitId != ''">
+   and t.unit_id= #{unitId}
+</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="apartment !=null and apartment != ''">
+   and t.apartment= #{apartment}
+</if> 
+<if test="roomType !=null and roomType != ''">
+   and t.room_type= #{roomType}
+</if> 
+<if test="roomRent !=null and roomRent != ''">
+   and t.room_rent= #{roomRent}
+</if> 
+
+
+     </select>
+
+</mapper>

+ 205 - 0
java110-db/src/main/resources/mapper/community/RoomV1ServiceDaoImplMapper.xml

@@ -0,0 +1,205 @@
+<?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="roomV1ServiceDaoImpl">
+
+
+
+
+
+    <!-- 保存房屋信息 add by wuxw 2018-07-03 -->
+    <insert id="saveRoomInfo" parameterType="Map">
+        insert into building_room(
+section,remark,room_sub_type,room_area,user_id,room_id,layer,fee_coefficient,built_up_area,room_num,unit_id,state,community_id,apartment,room_type,room_rent
+) values (
+#{section},#{remark},#{roomSubType},#{roomArea},#{userId},#{roomId},#{layer},#{feeCoefficient},#{builtUpArea},#{roomNum},#{unitId},#{state},#{communityId},#{apartment},#{roomType},#{roomRent}
+)
+    </insert>
+
+
+
+    <!-- 查询房屋信息 add by wuxw 2018-07-03 -->
+    <select id="getRoomInfo" parameterType="Map" resultType="Map">
+        select  t.section,t.remark,t.status_cd,t.status_cd statusCd,t.room_sub_type,t.room_sub_type roomSubType,t.room_area,t.room_area roomArea,t.user_id,t.user_id userId,t.room_id,t.room_id roomId,t.layer,t.fee_coefficient,t.fee_coefficient feeCoefficient,t.built_up_area,t.built_up_area builtUpArea,t.room_num,t.room_num roomNum,t.unit_id,t.unit_id unitId,t.state,t.community_id,t.community_id communityId,t.apartment,t.room_type,t.room_type roomType,t.room_rent,t.room_rent roomRent 
+from building_room t 
+where 1 =1 
+<if test="section !=null and section != ''">
+   and t.section= #{section}
+</if> 
+<if test="remark !=null and remark != ''">
+   and t.remark= #{remark}
+</if> 
+<if test="statusCd !=null and statusCd != ''">
+   and t.status_cd= #{statusCd}
+</if> 
+<if test="roomSubType !=null and roomSubType != ''">
+   and t.room_sub_type= #{roomSubType}
+</if> 
+<if test="roomArea !=null and roomArea != ''">
+   and t.room_area= #{roomArea}
+</if> 
+<if test="userId !=null and userId != ''">
+   and t.user_id= #{userId}
+</if> 
+<if test="roomId !=null and roomId != ''">
+   and t.room_id= #{roomId}
+</if> 
+<if test="layer !=null and layer != ''">
+   and t.layer= #{layer}
+</if> 
+<if test="feeCoefficient !=null and feeCoefficient != ''">
+   and t.fee_coefficient= #{feeCoefficient}
+</if> 
+<if test="builtUpArea !=null and builtUpArea != ''">
+   and t.built_up_area= #{builtUpArea}
+</if> 
+<if test="roomNum !=null and roomNum != ''">
+   and t.room_num= #{roomNum}
+</if> 
+<if test="unitId !=null and unitId != ''">
+   and t.unit_id= #{unitId}
+</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="apartment !=null and apartment != ''">
+   and t.apartment= #{apartment}
+</if> 
+<if test="roomType !=null and roomType != ''">
+   and t.room_type= #{roomType}
+</if> 
+<if test="roomRent !=null and roomRent != ''">
+   and t.room_rent= #{roomRent}
+</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="updateRoomInfo" parameterType="Map">
+        update  building_room t set t.status_cd = #{statusCd}
+<if test="newBId != null and newBId != ''">
+,t.b_id = #{newBId}
+</if> 
+<if test="section !=null and section != ''">
+, t.section= #{section}
+</if> 
+<if test="remark !=null and remark != ''">
+, t.remark= #{remark}
+</if> 
+<if test="roomSubType !=null and roomSubType != ''">
+, t.room_sub_type= #{roomSubType}
+</if> 
+<if test="roomArea !=null and roomArea != ''">
+, t.room_area= #{roomArea}
+</if> 
+<if test="userId !=null and userId != ''">
+, t.user_id= #{userId}
+</if> 
+<if test="layer !=null and layer != ''">
+, t.layer= #{layer}
+</if> 
+<if test="feeCoefficient !=null and feeCoefficient != ''">
+, t.fee_coefficient= #{feeCoefficient}
+</if> 
+<if test="builtUpArea !=null and builtUpArea != ''">
+, t.built_up_area= #{builtUpArea}
+</if> 
+<if test="roomNum !=null and roomNum != ''">
+, t.room_num= #{roomNum}
+</if> 
+<if test="unitId !=null and unitId != ''">
+, t.unit_id= #{unitId}
+</if> 
+<if test="state !=null and state != ''">
+, t.state= #{state}
+</if> 
+<if test="communityId !=null and communityId != ''">
+, t.community_id= #{communityId}
+</if> 
+<if test="apartment !=null and apartment != ''">
+, t.apartment= #{apartment}
+</if> 
+<if test="roomType !=null and roomType != ''">
+, t.room_type= #{roomType}
+</if> 
+<if test="roomRent !=null and roomRent != ''">
+, t.room_rent= #{roomRent}
+</if> 
+ where 1=1 <if test="roomId !=null and roomId != ''">
+and t.room_id= #{roomId}
+</if> 
+
+    </update>
+
+    <!-- 查询房屋数量 add by wuxw 2018-07-03 -->
+     <select id="queryRoomsCount" parameterType="Map" resultType="Map">
+        select  count(1) count 
+from building_room t 
+where 1 =1 
+<if test="section !=null and section != ''">
+   and t.section= #{section}
+</if> 
+<if test="remark !=null and remark != ''">
+   and t.remark= #{remark}
+</if> 
+<if test="statusCd !=null and statusCd != ''">
+   and t.status_cd= #{statusCd}
+</if> 
+<if test="roomSubType !=null and roomSubType != ''">
+   and t.room_sub_type= #{roomSubType}
+</if> 
+<if test="roomArea !=null and roomArea != ''">
+   and t.room_area= #{roomArea}
+</if> 
+<if test="userId !=null and userId != ''">
+   and t.user_id= #{userId}
+</if> 
+<if test="roomId !=null and roomId != ''">
+   and t.room_id= #{roomId}
+</if> 
+<if test="layer !=null and layer != ''">
+   and t.layer= #{layer}
+</if> 
+<if test="feeCoefficient !=null and feeCoefficient != ''">
+   and t.fee_coefficient= #{feeCoefficient}
+</if> 
+<if test="builtUpArea !=null and builtUpArea != ''">
+   and t.built_up_area= #{builtUpArea}
+</if> 
+<if test="roomNum !=null and roomNum != ''">
+   and t.room_num= #{roomNum}
+</if> 
+<if test="unitId !=null and unitId != ''">
+   and t.unit_id= #{unitId}
+</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="apartment !=null and apartment != ''">
+   and t.apartment= #{apartment}
+</if> 
+<if test="roomType !=null and roomType != ''">
+   and t.room_type= #{roomType}
+</if> 
+<if test="roomRent !=null and roomRent != ''">
+   and t.room_rent= #{roomRent}
+</if> 
+
+
+     </select>
+
+</mapper>

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 214 - 0
java110-db/src/main/resources/mapper/community/房屋IDV1ServiceDaoImplMapper.xml


+ 14 - 3
java110-generator/src/main/java/com/java110/code/TableToJson.java

@@ -34,7 +34,7 @@ public class TableToJson {
             ")";
             ")";
 
 
     public static void main(String[] args) {
     public static void main(String[] args) {
-
+        //业务名称 desc 业务编码名称生成后类名 name 主键 id  需要放到那个服务 shareName
         String newSql = createTableSql.substring(createTableSql.indexOf("(") + 1, createTableSql.lastIndexOf(")"));
         String newSql = createTableSql.substring(createTableSql.indexOf("(") + 1, createTableSql.lastIndexOf(")"));
         String tableName = createTableSql.substring(createTableSql.indexOf("TABLE") + 5, createTableSql.indexOf("("));
         String tableName = createTableSql.substring(createTableSql.indexOf("TABLE") + 5, createTableSql.indexOf("("));
         tableName = tableName.replaceAll("`", "").trim();
         tableName = tableName.replaceAll("`", "").trim();
@@ -45,9 +45,9 @@ public class TableToJson {
         param.put("desc", "");
         param.put("desc", "");
         param.put("id", "");
         param.put("id", "");
         param.put("name", "");
         param.put("name", "");
-        param.put("shareColumn", "");
+        param.put("shareColumn", "community_id");
         param.put("shareName", "");
         param.put("shareName", "");
-        param.put("shareParam", "");
+        param.put("shareParam", "communityId");
         param.put("tableName", tableName);
         param.put("tableName", tableName);
         JSONObject paramColumn = new JSONObject();
         JSONObject paramColumn = new JSONObject();
         JSONArray requireds = new JSONArray();
         JSONArray requireds = new JSONArray();
@@ -64,12 +64,23 @@ public class TableToJson {
             if ("KEY".equals(key)) {
             if ("KEY".equals(key)) {
                 continue;
                 continue;
             }
             }
+            if ("b_id".equals(key)) {
+                continue;
+            }
             if ("create_time".equals(key)) {
             if ("create_time".equals(key)) {
                 continue;
                 continue;
             }
             }
             if (rowSql.toLowerCase().contains("not null")) {
             if (rowSql.toLowerCase().contains("not null")) {
                 required.put("code", StringUtil.lineToHump(key));
                 required.put("code", StringUtil.lineToHump(key));
                 String comment = rowSql.contains("COMMENT") ? rowSql.substring(rowSql.indexOf("COMMENT '") + 9) : StringUtil.lineToHump(key);
                 String comment = rowSql.contains("COMMENT") ? rowSql.substring(rowSql.indexOf("COMMENT '") + 9) : StringUtil.lineToHump(key);
+                comment = comment.trim();
+                if(comment.contains(",")){
+                    comment = comment.split(",")[0];
+                }
+                if(comment.contains(" ")){
+                    comment = comment.split(" ")[0];
+                }
+
                 required.put("msg", comment + "不能为空");
                 required.put("msg", comment + "不能为空");
                 requireds.add(required);
                 requireds.add(required);
             }
             }

+ 117 - 0
java110-generator/src/main/java/com/java110/code/TableToJsonWeb.java

@@ -0,0 +1,117 @@
+package com.java110.code;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.java110.utils.util.StringUtil;
+
+public class TableToJsonWeb {
+
+    //show create table c_orders  用这个语句获取
+    public static final String createTableSql = "CREATE TABLE `building_room` (\n" +
+            "  `room_id` varchar(30) NOT NULL COMMENT '房屋ID',\n" +
+            "  `b_id` varchar(30) NOT NULL COMMENT '业务Id',\n" +
+            "  `room_num` varchar(12) NOT NULL COMMENT '房屋编号',\n" +
+            "  `unit_id` varchar(30) NOT NULL COMMENT '单元ID',\n" +
+            "  `layer` int(11) NOT NULL COMMENT '层数',\n" +
+            "  `section` int(11) DEFAULT NULL COMMENT '室',\n" +
+            "  `apartment` varchar(20) NOT NULL COMMENT '户型',\n" +
+            "  `built_up_area` decimal(6,2) NOT NULL COMMENT '建筑面积',\n" +
+            "  `fee_coefficient` decimal(12,2) NOT NULL DEFAULT '1.00' COMMENT '算费系数',\n" +
+            "  `user_id` varchar(30) NOT NULL COMMENT '用户ID',\n" +
+            "  `remark` varchar(200) DEFAULT NULL COMMENT '备注',\n" +
+            "  `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',\n" +
+            "  `status_cd` varchar(2) NOT NULL DEFAULT '0' COMMENT '数据状态,详细参考c_status表,S 保存,0, 在用 1失效',\n" +
+            "  `state` varchar(4) NOT NULL COMMENT '房屋状态,如房屋出售等,请查看state 表',\n" +
+            "  `community_id` varchar(30) DEFAULT NULL COMMENT '小区ID',\n" +
+            "  `room_type` varchar(12) NOT NULL DEFAULT '1010301' COMMENT '房屋类型',\n" +
+            "  `room_sub_type` varchar(12) NOT NULL DEFAULT '110' COMMENT '房屋类型 110 住宅房屋,119 办公室 120 宿舍',\n" +
+            "  `room_area` decimal(6,2) NOT NULL COMMENT '室内面积',\n" +
+            "  `room_rent` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '租金',\n" +
+            "  UNIQUE KEY `room_id` (`room_id`) USING BTREE,\n" +
+            "  UNIQUE KEY `idx_room_id` (`room_id`) USING BTREE,\n" +
+            "  KEY `idx_room_b_id` (`b_id`) USING BTREE,\n" +
+            "  KEY `i_br_unit_id` (`unit_id`)\n" +
+            ")";
+
+    public static void main(String[] args) {
+
+        // templateName 业务名称 业务编码名称生成后文件名 templateCode 主键 templateKey
+        // 业务主键名称 templateKeyName=templateName+ID 主机驼峰 searchCode 主键名称 searchName
+        // directories 放在前端那个目录下
+        String newSql = createTableSql.substring(createTableSql.indexOf("(") + 1, createTableSql.lastIndexOf(")"));
+        String tableName = createTableSql.substring(createTableSql.indexOf("TABLE") + 5, createTableSql.indexOf("("));
+        tableName = tableName.replaceAll("`", "").trim();
+        newSql = newSql.replaceAll("\n", "");
+        String[] rowSqls = newSql.split("',");
+        JSONObject param = new JSONObject();
+        param.put("templateName", "");
+        param.put("templateCode", "");
+        param.put("templateKey", "");
+        param.put("templateKeyName", "");
+        param.put("searchCode", "");
+        param.put("searchName", "");
+        param.put("directories", "");
+        JSONObject paramColumn = null;
+        JSONArray conditions = new JSONArray();
+        JSONArray paramColumns = new JSONArray();
+        JSONObject condition = null;
+        String key = "";
+        for (String rowSql : rowSqls) {
+            condition = new JSONObject();
+            paramColumn = new JSONObject();
+            key = rowSql.trim();
+            key = key.substring(0, key.indexOf(" "));
+            key = key.replaceAll("`", "");
+            if ("UNIQUE".equals(key)) {
+                continue;
+            }
+            if ("KEY".equals(key)) {
+                continue;
+            }
+            if ("b_id".equals(key)) {
+                continue;
+            }
+            if ("create_time".equals(key)) {
+                continue;
+            }
+            String comment = rowSql.contains("COMMENT") ? rowSql.substring(rowSql.indexOf("COMMENT '") + 9) : StringUtil.lineToHump(key);
+            comment = comment.trim();
+            if(comment.contains(",")){
+                comment = comment.split(",")[0];
+            }
+            if(comment.contains(" ")){
+                comment = comment.split(" ")[0];
+            }
+            paramColumn.put("desc", comment);
+            if (rowSql.toLowerCase().contains("not null")) {
+
+                condition.put("name", comment);
+                condition.put("inputType", "input");
+                condition.put("code", StringUtil.lineToHump(key));
+                condition.put("whereCondition", "equal");
+                conditions.add(condition);
+                paramColumn.put("desc", "必填,"+comment);
+            }
+            String limit = rowSql.substring(rowSql.indexOf("(") + 1,rowSql.indexOf(")"));
+            if(limit.contains(",")){
+                limit = limit.split(",")[0];
+            }
+
+            paramColumn.put("code", StringUtil.lineToHump(key));
+            paramColumn.put("cnCode", comment);
+            paramColumn.put("required", true);
+            paramColumn.put("hasDefaultValue", false);
+            paramColumn.put("inputType", "input");
+            paramColumn.put("limit", "maxLength");
+            paramColumn.put("limitParam",limit );
+            paramColumn.put("limitErrInfo", comment+"不能超过"+limit);
+            paramColumn.put("show", true);
+            paramColumns.add(paramColumn);
+        }
+        param.put("columns", paramColumns);
+        param.put("conditions", conditions);
+        System.out.println(param.toJSONString());
+
+    }
+
+}

+ 64 - 24
java110-generator/src/main/resources/newBack/template_1.json

@@ -1,47 +1,87 @@
 {
 {
   "param": {
   "param": {
-    "requestTime": "request_time",
-    "finishTime": "finish_time",
-    "orderTypeCd": "order_type_cd",
-    "extTransactionId": "ext_transaction_id",
-    "appId": "app_id",
+    "section": "section",
     "remark": "remark",
     "remark": "remark",
     "statusCd": "status_cd",
     "statusCd": "status_cd",
-    "oId": "o_id",
-    "userId": "user_id"
+    "roomSubType": "room_sub_type",
+    "roomArea": "room_area",
+    "userId": "user_id",
+    "roomId": "room_id",
+    "layer": "layer",
+    "feeCoefficient": "fee_coefficient",
+    "builtUpArea": "built_up_area",
+    "roomNum": "room_num",
+    "unitId": "unit_id",
+    "state": "state",
+    "communityId": "community_id",
+    "apartment": "apartment",
+    "roomType": "room_type",
+    "roomRent": "room_rent"
   },
   },
-  "name": "",
-  "shareColumn": "",
-  "id": "",
-  "shareName": "",
+  "name": "room",
+  "shareColumn": "community_id",
+  "id": "roomId",
+  "shareName": "community",
   "autoMove": true,
   "autoMove": true,
   "required": [
   "required": [
     {
     {
-      "msg": "订单ID不能为空",
-      "code": "oId"
+      "msg": "房屋ID不能为空",
+      "code": "roomId"
     },
     },
     {
     {
-      "msg": "应用ID不能为空",
-      "code": "appId"
+      "msg": "房屋编号不能为空",
+      "code": "roomNum"
+    },
+    {
+      "msg": "单元ID不能为空",
+      "code": "unitId"
+    },
+    {
+      "msg": "层数不能为空",
+      "code": "layer"
+    },
+    {
+      "msg": "户型不能为空",
+      "code": "apartment"
+    },
+    {
+      "msg": "建筑面积不能为空",
+      "code": "builtUpArea"
+    },
+    {
+      "msg": "算费系数不能为空",
+      "code": "feeCoefficient"
     },
     },
     {
     {
       "msg": "用户ID不能为空",
       "msg": "用户ID不能为空",
       "code": "userId"
       "code": "userId"
     },
     },
     {
     {
-      "msg": "外部系统请求时间不能为空",
-      "code": "requestTime"
+      "msg": "数据状态,详细参考c_status表,S 保存,0, 在用 1失效不能为空",
+      "code": "statusCd"
     },
     },
     {
     {
-      "msg": "订单类型,参考c_order_type表不能为空",
-      "code": "orderTypeCd"
+      "msg": "房屋状态,如房屋出售等,请查看state 表不能为空",
+      "code": "state"
     },
     },
     {
     {
-      "msg": "数据状态,详细参考c_status表不能为空",
-      "code": "statusCd"
+      "msg": "房屋类型不能为空",
+      "code": "roomType"
+    },
+    {
+      "msg": "房屋类型 110 住宅房屋,119 办公室 120 宿舍不能为空",
+      "code": "roomSubType"
+    },
+    {
+      "msg": "室内面积不能为空",
+      "code": "roomArea"
+    },
+    {
+      "msg": "租金不能为空",
+      "code": "roomRent"
     }
     }
   ],
   ],
-  "desc": "",
-  "shareParam": "",
-  "tableName": "c_orders"
+  "desc": "房屋",
+  "shareParam": "communityId",
+  "tableName": "building_room"
 }
 }

+ 265 - 60
java110-generator/src/main/resources/web/template_1.json

@@ -1,96 +1,301 @@
 {
 {
-  "templateName": "业务轨迹",
-  "templateCode": "businessTableHis",
-  "templateKey": "hisId",
-  "templateKeyName": "轨迹ID",
-  "searchCode": "hisId",
-  "searchName": "轨迹ID",
-  "directories": "dev",
-  "conditions": [
+  "templateKeyName": "",
+  "templateName": "",
+  "columns": [
     {
     {
-      "name": "动作",
-      "inputType": "select",
-      "selectValue":"ADD,MOD,DEL",
-      "selectValueName":"添加,修改,删除",
-      "code": "action",
-      "whereCondition": "equal"
+      "hasDefaultValue": false,
+      "limitParam": "30",
+      "code": "roomId",
+      "limitErrInfo": "房屋ID不能超过30",
+      "cnCode": "房屋ID",
+      "limit": "maxLength",
+      "show": true,
+      "inputType": "input",
+      "required": true,
+      "desc": "必填,房屋ID"
     },
     },
     {
     {
-      "name": "表名",
+      "hasDefaultValue": false,
+      "limitParam": "12",
+      "code": "roomNum",
+      "limitErrInfo": "房屋编号不能超过12",
+      "cnCode": "房屋编号",
+      "limit": "maxLength",
+      "show": true,
       "inputType": "input",
       "inputType": "input",
-      "code": "actionObj",
-      "whereCondition": "equal"
+      "required": true,
+      "desc": "必填,房屋编号"
     },
     },
     {
     {
-      "name": "业务类型",
+      "hasDefaultValue": false,
+      "limitParam": "30",
+      "code": "unitId",
+      "limitErrInfo": "单元ID不能超过30",
+      "cnCode": "单元ID",
+      "limit": "maxLength",
+      "show": true,
       "inputType": "input",
       "inputType": "input",
-      "code": "businessTypeCd",
-      "whereCondition": "equal"
-    }
-  ],
-  "columns": [
-    {
-      "code": "businessTypeCd",
-      "cnCode": "业务类型",
-      "desc": "必填,请填写业务类型",
       "required": true,
       "required": true,
+      "desc": "必填,单元ID"
+    },
+    {
       "hasDefaultValue": false,
       "hasDefaultValue": false,
+      "limitParam": "11",
+      "code": "layer",
+      "limitErrInfo": "层数不能超过11",
+      "cnCode": "层数",
+      "limit": "maxLength",
+      "show": true,
       "inputType": "input",
       "inputType": "input",
+      "required": true,
+      "desc": "必填,层数"
+    },
+    {
+      "hasDefaultValue": false,
+      "limitParam": "11",
+      "code": "section",
+      "limitErrInfo": "室不能超过11",
+      "cnCode": "室",
       "limit": "maxLength",
       "limit": "maxLength",
-      "limitParam": "30",
-      "limitErrInfo": "业务类型超过30位",
-      "show": true
+      "show": true,
+      "inputType": "input",
+      "required": true,
+      "desc": "室"
     },
     },
     {
     {
-      "code": "action",
-      "cnCode": "动作",
-      "desc": "必填,请选择动作",
+      "hasDefaultValue": false,
+      "limitParam": "20",
+      "code": "apartment",
+      "limitErrInfo": "户型不能超过20",
+      "cnCode": "户型",
+      "limit": "maxLength",
+      "show": true,
+      "inputType": "input",
       "required": true,
       "required": true,
+      "desc": "必填,户型"
+    },
+    {
       "hasDefaultValue": false,
       "hasDefaultValue": false,
-      "inputType": "select",
-      "selectValue":"ADD,MOD,DEL",
-      "selectValueName":"添加,修改,删除",
+      "limitParam": "6",
+      "code": "builtUpArea",
+      "limitErrInfo": "建筑面积不能超过6",
+      "cnCode": "建筑面积",
       "limit": "maxLength",
       "limit": "maxLength",
+      "show": true,
+      "inputType": "input",
+      "required": true,
+      "desc": "必填,建筑面积"
+    },
+    {
+      "hasDefaultValue": false,
       "limitParam": "12",
       "limitParam": "12",
-      "limitErrInfo": "动作不能为空",
-      "show": true
+      "code": "feeCoefficient",
+      "limitErrInfo": "算费系数不能超过12",
+      "cnCode": "算费系数",
+      "limit": "maxLength",
+      "show": true,
+      "inputType": "input",
+      "required": true,
+      "desc": "必填,算费系数"
     },
     },
     {
     {
-      "code": "actionObj",
-      "cnCode": "表名",
-      "desc": "必填,请填写表名",
+      "hasDefaultValue": false,
+      "limitParam": "30",
+      "code": "userId",
+      "limitErrInfo": "用户ID不能超过30",
+      "cnCode": "用户ID",
+      "limit": "maxLength",
+      "show": true,
+      "inputType": "input",
       "required": true,
       "required": true,
+      "desc": "必填,用户ID"
+    },
+    {
       "hasDefaultValue": false,
       "hasDefaultValue": false,
+      "limitParam": "200",
+      "code": "remark",
+      "limitErrInfo": "备注不能超过200",
+      "cnCode": "备注",
+      "limit": "maxLength",
+      "show": true,
       "inputType": "input",
       "inputType": "input",
+      "required": true,
+      "desc": "备注"
+    },
+    {
+      "hasDefaultValue": false,
+      "limitParam": "2",
+      "code": "statusCd",
+      "limitErrInfo": "数据状态不能超过2",
+      "cnCode": "数据状态",
       "limit": "maxLength",
       "limit": "maxLength",
-      "limitParam": "64",
-      "limitErrInfo": "表名超过64位",
-      "show": true
+      "show": true,
+      "inputType": "input",
+      "required": true,
+      "desc": "必填,数据状态"
     },
     },
     {
     {
-      "code": "actionObjHis",
-      "cnCode": "轨迹表名",
-      "desc": "必填,请填写轨迹表名",
+      "hasDefaultValue": false,
+      "limitParam": "4",
+      "code": "state",
+      "limitErrInfo": "房屋状态不能超过4",
+      "cnCode": "房屋状态",
+      "limit": "maxLength",
+      "show": true,
+      "inputType": "input",
       "required": true,
       "required": true,
+      "desc": "必填,房屋状态"
+    },
+    {
       "hasDefaultValue": false,
       "hasDefaultValue": false,
+      "limitParam": "30",
+      "code": "communityId",
+      "limitErrInfo": "小区ID不能超过30",
+      "cnCode": "小区ID",
+      "limit": "maxLength",
+      "show": true,
       "inputType": "input",
       "inputType": "input",
+      "required": true,
+      "desc": "小区ID"
+    },
+    {
+      "hasDefaultValue": false,
+      "limitParam": "12",
+      "code": "roomType",
+      "limitErrInfo": "房屋类型不能超过12",
+      "cnCode": "房屋类型",
       "limit": "maxLength",
       "limit": "maxLength",
-      "limitParam": "64",
-      "limitErrInfo": "轨迹表名超过64位",
-      "show": true
+      "show": true,
+      "inputType": "input",
+      "required": true,
+      "desc": "必填,房屋类型"
+    },
+    {
+      "hasDefaultValue": false,
+      "limitParam": "12",
+      "code": "roomSubType",
+      "limitErrInfo": "房屋类型不能超过12",
+      "cnCode": "房屋类型",
+      "limit": "maxLength",
+      "show": true,
+      "inputType": "input",
+      "required": true,
+      "desc": "必填,房屋类型"
     },
     },
     {
     {
-      "code": "remark",
-      "cnCode": "备注",
-      "desc": "可填,请填写备注",
-      "required": false,
       "hasDefaultValue": false,
       "hasDefaultValue": false,
-      "defaultValue": "",
+      "limitParam": "6",
+      "code": "roomArea",
+      "limitErrInfo": "室内面积不能超过6",
+      "cnCode": "室内面积",
+      "limit": "maxLength",
+      "show": true,
       "inputType": "input",
       "inputType": "input",
+      "required": true,
+      "desc": "必填,室内面积"
+    },
+    {
+      "hasDefaultValue": false,
+      "limitParam": "10",
+      "code": "roomRent",
+      "limitErrInfo": "租金不能超过10",
+      "cnCode": "租金",
       "limit": "maxLength",
       "limit": "maxLength",
-      "limitParam": "200",
-      "limitErrInfo": "备注内容不能超过200",
-      "show": false
+      "show": true,
+      "inputType": "input",
+      "required": true,
+      "desc": "必填,租金"
     }
     }
-  ]
-}
+  ],
+  "searchName": "",
+  "directories": "",
+  "searchCode": "",
+  "templateCode": "",
+  "conditions": [
+    {
+      "whereCondition": "equal",
+      "code": "roomId",
+      "name": "房屋ID",
+      "inputType": "input"
+    },
+    {
+      "whereCondition": "equal",
+      "code": "roomNum",
+      "name": "房屋编号",
+      "inputType": "input"
+    },
+    {
+      "whereCondition": "equal",
+      "code": "unitId",
+      "name": "单元ID",
+      "inputType": "input"
+    },
+    {
+      "whereCondition": "equal",
+      "code": "layer",
+      "name": "层数",
+      "inputType": "input"
+    },
+    {
+      "whereCondition": "equal",
+      "code": "apartment",
+      "name": "户型",
+      "inputType": "input"
+    },
+    {
+      "whereCondition": "equal",
+      "code": "builtUpArea",
+      "name": "建筑面积",
+      "inputType": "input"
+    },
+    {
+      "whereCondition": "equal",
+      "code": "feeCoefficient",
+      "name": "算费系数",
+      "inputType": "input"
+    },
+    {
+      "whereCondition": "equal",
+      "code": "userId",
+      "name": "用户ID",
+      "inputType": "input"
+    },
+    {
+      "whereCondition": "equal",
+      "code": "statusCd",
+      "name": "数据状态",
+      "inputType": "input"
+    },
+    {
+      "whereCondition": "equal",
+      "code": "state",
+      "name": "房屋状态",
+      "inputType": "input"
+    },
+    {
+      "whereCondition": "equal",
+      "code": "roomType",
+      "name": "房屋类型",
+      "inputType": "input"
+    },
+    {
+      "whereCondition": "equal",
+      "code": "roomSubType",
+      "name": "房屋类型",
+      "inputType": "input"
+    },
+    {
+      "whereCondition": "equal",
+      "code": "roomArea",
+      "name": "室内面积",
+      "inputType": "input"
+    },
+    {
+      "whereCondition": "equal",
+      "code": "roomRent",
+      "name": "租金",
+      "inputType": "input"
+    }
+  ],
+  "templateKey": ""
+}

+ 68 - 0
java110-interface/src/main/java/com/java110/intf/community/IRoomV1InnerServiceSMO.java

@@ -0,0 +1,68 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.intf.community;
+
+import com.java110.config.feign.FeignConfiguration;
+import com.java110.dto.RoomDto;
+import com.java110.po.room.RoomPo;
+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;
+
+/**
+ * 类表述: 服务之前调用的接口类,不对外提供接口能力 只用于接口建调用
+ * add by 吴学文 at 2021-09-14 14:28:56 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+@FeignClient(name = "community-service", configuration = {FeignConfiguration.class})
+@RequestMapping("/roomV1Api")
+public interface IRoomV1InnerServiceSMO {
+
+
+    @RequestMapping(value = "/saveRoom", method = RequestMethod.POST)
+    public int saveRoom(@RequestBody  RoomPo roomPo);
+
+    @RequestMapping(value = "/updateRoom", method = RequestMethod.POST)
+    public int updateRoom(@RequestBody  RoomPo roomPo);
+
+    @RequestMapping(value = "/deleteRoom", method = RequestMethod.POST)
+    public int deleteRoom(@RequestBody  RoomPo roomPo);
+
+    /**
+     * <p>查询小区楼信息</p>
+     *
+     *
+     * @param roomDto 数据对象分享
+     * @return RoomDto 对象数据
+     */
+    @RequestMapping(value = "/queryRooms", method = RequestMethod.POST)
+    List<RoomDto> queryRooms(@RequestBody RoomDto roomDto);
+
+    /**
+     * 查询<p>小区楼</p>总记录数
+     *
+     * @param roomDto 数据对象分享
+     * @return 小区下的小区楼记录数
+     */
+    @RequestMapping(value = "/queryRoomsCount", method = RequestMethod.POST)
+    int queryRoomsCount(@RequestBody RoomDto roomDto);
+}

+ 72 - 0
service-community/src/main/java/com/java110/community/cmd/room/DeleteRoomCmd.java

@@ -0,0 +1,72 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.community.cmd.room;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.annotation.Java110Cmd;
+import com.java110.core.annotation.Java110Transactional;
+import com.java110.core.context.ICmdDataFlowContext;
+import com.java110.core.event.cmd.AbstractServiceCmdListener;
+import com.java110.core.event.cmd.CmdEvent;
+import com.java110.core.factory.GenerateCodeFactory;
+import com.java110.intf.community.IRoomV1InnerServiceSMO;
+import com.java110.po.room.RoomPo;
+import com.java110.utils.exception.CmdException;
+import com.java110.utils.util.Assert;
+import com.java110.utils.util.BeanConvertUtil;
+import com.java110.vo.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * 类表述:删除
+ * 服务编码:room.deleteRoom
+ * 请求路劲:/app/room.DeleteRoom
+ * add by 吴学文 at 2021-09-14 14:28:56 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+@Java110Cmd(serviceCode = "room.DeleteRoom")
+public class DeleteRoomCmd extends AbstractServiceCmdListener {
+    private static Logger logger = LoggerFactory.getLogger(DeleteRoomCmd.class);
+
+    @Autowired
+    private IRoomV1InnerServiceSMO roomV1InnerServiceSMOImpl;
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
+        Assert.hasKeyAndValue(reqJson, "roomId", "roomId不能为空");
+        Assert.hasKeyAndValue(reqJson, "communityId", "communityId不能为空");
+
+    }
+
+    @Override
+    @Java110Transactional
+    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
+
+        RoomPo roomPo = BeanConvertUtil.covertBean(reqJson, RoomPo.class);
+        int flag = roomV1InnerServiceSMOImpl.deleteRoom(roomPo);
+
+        if (flag < 1) {
+            throw new CmdException("删除数据失败");
+        }
+
+        cmdDataFlowContext.setResponseEntity(ResultVo.success());
+    }
+}

+ 85 - 0
service-community/src/main/java/com/java110/community/cmd/room/ListRoomCmd.java

@@ -0,0 +1,85 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.community.cmd.room;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.annotation.Java110Cmd;
+import com.java110.core.annotation.Java110Transactional;
+import com.java110.core.context.ICmdDataFlowContext;
+import com.java110.core.event.cmd.AbstractServiceCmdListener;
+import com.java110.core.event.cmd.CmdEvent;
+import com.java110.core.factory.GenerateCodeFactory;
+import com.java110.dto.RoomDto;
+import com.java110.intf.community.IRoomV1InnerServiceSMO;
+import com.java110.po.room.RoomPo;
+import com.java110.utils.exception.CmdException;
+import com.java110.utils.util.Assert;
+import com.java110.utils.util.BeanConvertUtil;
+import com.java110.vo.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import java.util.List;
+import java.util.ArrayList;
+import org.springframework.http.ResponseEntity;
+import org.springframework.http.HttpStatus;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * 类表述:查询
+ * 服务编码:room.listRoom
+ * 请求路劲:/app/room.ListRoom
+ * add by 吴学文 at 2021-09-14 14:28:56 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+@Java110Cmd(serviceCode = "room.ListRoom")
+public class ListRoomCmd extends AbstractServiceCmdListener {
+
+  private static Logger logger = LoggerFactory.getLogger(ListRoomCmd.class);
+    @Autowired
+    private IRoomV1InnerServiceSMO roomV1InnerServiceSMOImpl;
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
+        super.validatePageInfo(reqJson);
+    }
+
+    @Override
+    @Java110Transactional
+    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
+
+           RoomDto roomDto = BeanConvertUtil.covertBean(reqJson, RoomDto.class);
+
+           int count = roomV1InnerServiceSMOImpl.queryRoomsCount(roomDto);
+
+           List<RoomDto> roomDtos = null;
+
+           if (count > 0) {
+               roomDtos = roomV1InnerServiceSMOImpl.queryRooms(roomDto);
+           } else {
+               roomDtos = new ArrayList<>();
+           }
+
+           ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) reqJson.getInteger("row")), count, roomDtos);
+
+           ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
+
+           cmdDataFlowContext.setResponseEntity(responseEntity);
+    }
+}

+ 87 - 0
service-community/src/main/java/com/java110/community/cmd/room/SaveRoomCmd.java

@@ -0,0 +1,87 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.community.cmd.room;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.annotation.Java110Cmd;
+import com.java110.core.annotation.Java110Transactional;
+import com.java110.core.context.ICmdDataFlowContext;
+import com.java110.core.event.cmd.AbstractServiceCmdListener;
+import com.java110.core.event.cmd.CmdEvent;
+import com.java110.core.factory.GenerateCodeFactory;
+import com.java110.intf.community.IRoomV1InnerServiceSMO;
+import com.java110.po.room.RoomPo;
+import com.java110.utils.exception.CmdException;
+import com.java110.utils.util.Assert;
+import com.java110.utils.util.BeanConvertUtil;
+import com.java110.vo.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * 类表述:保存
+ * 服务编码:room.saveRoom
+ * 请求路劲:/app/room.SaveRoom
+ * add by 吴学文 at 2021-09-14 14:28:56 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+@Java110Cmd(serviceCode = "room.SaveRoom")
+public class SaveRoomCmd extends AbstractServiceCmdListener {
+
+    private static Logger logger = LoggerFactory.getLogger(SaveRoomCmd.class);
+
+    public static final String CODE_PREFIX_ID = "10";
+
+    @Autowired
+    private IRoomV1InnerServiceSMO roomV1InnerServiceSMOImpl;
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
+        Assert.hasKeyAndValue(reqJson, "roomNum", "请求报文中未包含roomNum");
+        Assert.hasKeyAndValue(reqJson, "unitId", "请求报文中未包含unitId");
+        Assert.hasKeyAndValue(reqJson, "layer", "请求报文中未包含layer");
+        Assert.hasKeyAndValue(reqJson, "apartment", "请求报文中未包含apartment");
+        Assert.hasKeyAndValue(reqJson, "builtUpArea", "请求报文中未包含builtUpArea");
+        Assert.hasKeyAndValue(reqJson, "feeCoefficient", "请求报文中未包含feeCoefficient");
+        Assert.hasKeyAndValue(reqJson, "userId", "请求报文中未包含userId");
+        Assert.hasKeyAndValue(reqJson, "statusCd", "请求报文中未包含statusCd");
+        Assert.hasKeyAndValue(reqJson, "state", "请求报文中未包含state");
+        Assert.hasKeyAndValue(reqJson, "roomType", "请求报文中未包含roomType");
+        Assert.hasKeyAndValue(reqJson, "roomSubType", "请求报文中未包含roomSubType");
+        Assert.hasKeyAndValue(reqJson, "roomArea", "请求报文中未包含roomArea");
+        Assert.hasKeyAndValue(reqJson, "roomRent", "请求报文中未包含roomRent");
+
+    }
+
+    @Override
+    @Java110Transactional
+    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
+
+        RoomPo roomPo = BeanConvertUtil.covertBean(reqJson, RoomPo.class);
+        roomPo.setRoomId(GenerateCodeFactory.getGeneratorId(CODE_PREFIX_ID));
+        int flag = roomV1InnerServiceSMOImpl.saveRoom(roomPo);
+
+        if (flag < 1) {
+            throw new CmdException("保存数据失败");
+        }
+
+        cmdDataFlowContext.setResponseEntity(ResultVo.success());
+    }
+}

+ 75 - 0
service-community/src/main/java/com/java110/community/cmd/room/UpdateRoomCmd.java

@@ -0,0 +1,75 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.community.cmd.room;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.annotation.Java110Cmd;
+import com.java110.core.annotation.Java110Transactional;
+import com.java110.core.context.ICmdDataFlowContext;
+import com.java110.core.event.cmd.AbstractServiceCmdListener;
+import com.java110.core.event.cmd.CmdEvent;
+import com.java110.core.factory.GenerateCodeFactory;
+import com.java110.intf.community.IRoomV1InnerServiceSMO;
+import com.java110.po.room.RoomPo;
+import com.java110.utils.exception.CmdException;
+import com.java110.utils.util.Assert;
+import com.java110.utils.util.BeanConvertUtil;
+import com.java110.vo.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * 类表述:更新
+ * 服务编码:room.updateRoom
+ * 请求路劲:/app/room.UpdateRoom
+ * add by 吴学文 at 2021-09-14 14:28:56 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+@Java110Cmd(serviceCode = "room.UpdateRoom")
+public class UpdateRoomCmd extends AbstractServiceCmdListener {
+
+    private static Logger logger = LoggerFactory.getLogger(UpdateRoomCmd.class);
+
+
+    @Autowired
+    private IRoomV1InnerServiceSMO roomV1InnerServiceSMOImpl;
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
+        Assert.hasKeyAndValue(reqJson, "roomId", "roomId不能为空");
+        Assert.hasKeyAndValue(reqJson, "communityId", "communityId不能为空");
+
+    }
+
+    @Override
+    @Java110Transactional
+    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
+
+        RoomPo roomPo = BeanConvertUtil.covertBean(reqJson, RoomPo.class);
+        int flag = roomV1InnerServiceSMOImpl.updateRoom(roomPo);
+
+        if (flag < 1) {
+            throw new CmdException("更新数据失败");
+        }
+
+        cmdDataFlowContext.setResponseEntity(ResultVo.success());
+    }
+}

+ 77 - 0
service-community/src/main/java/com/java110/community/dao/IRoomV1ServiceDao.java

@@ -0,0 +1,77 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.community.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;
+
+/**
+ * 类表述:
+ * add by 吴学文 at 2021-09-14 14:28:56 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+public interface IRoomV1ServiceDao {
+
+
+    /**
+     * 保存 房屋信息
+     * @param info
+     * @throws DAOException DAO异常
+     */
+    int saveRoomInfo(Map info) throws DAOException;
+
+
+
+
+    /**
+     * 查询房屋信息(instance过程)
+     * 根据bId 查询房屋信息
+     * @param info bId 信息
+     * @return 房屋信息
+     * @throws DAOException DAO异常
+     */
+    List<Map> getRoomInfo(Map info) throws DAOException;
+
+
+
+    /**
+     * 修改房屋信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    int updateRoomInfo(Map info) throws DAOException;
+
+
+    /**
+     * 查询房屋总数
+     *
+     * @param info 房屋信息
+     * @return 房屋数量
+     */
+    int queryRoomsCount(Map info);
+
+}

+ 112 - 0
service-community/src/main/java/com/java110/community/dao/impl/RoomV1ServiceDaoImpl.java

@@ -0,0 +1,112 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.community.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.community.dao.IRoomV1ServiceDao;
+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;
+
+/**
+ * 类表述:
+ * add by 吴学文 at 2021-09-14 14:28:56 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+@Service("roomV1ServiceDaoImpl")
+public class RoomV1ServiceDaoImpl extends BaseServiceDao implements IRoomV1ServiceDao {
+
+    private static Logger logger = LoggerFactory.getLogger(RoomV1ServiceDaoImpl.class);
+
+
+
+
+
+    /**
+     * 保存房屋信息 到 instance
+     * @param info   bId 信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public int saveRoomInfo(Map info) throws DAOException {
+        logger.debug("保存 saveRoomInfo 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.insert("roomV1ServiceDaoImpl.saveRoomInfo",info);
+
+        return saveFlag;
+    }
+
+
+    /**
+     * 查询房屋信息(instance)
+     * @param info bId 信息
+     * @return List<Map>
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public List<Map> getRoomInfo(Map info) throws DAOException {
+        logger.debug("查询 getRoomInfo 入参 info : {}",info);
+
+        List<Map> businessRoomInfos = sqlSessionTemplate.selectList("roomV1ServiceDaoImpl.getRoomInfo",info);
+
+        return businessRoomInfos;
+    }
+
+
+    /**
+     * 修改房屋信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public int updateRoomInfo(Map info) throws DAOException {
+        logger.debug("修改 updateRoomInfo 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.update("roomV1ServiceDaoImpl.updateRoomInfo",info);
+
+        return saveFlag;
+    }
+
+     /**
+     * 查询房屋数量
+     * @param info 房屋信息
+     * @return 房屋数量
+     */
+    @Override
+    public int queryRoomsCount(Map info) {
+        logger.debug("查询 queryRoomsCount 入参 info : {}",info);
+
+        List<Map> businessRoomInfos = sqlSessionTemplate.selectList("roomV1ServiceDaoImpl.queryRoomsCount", info);
+        if (businessRoomInfos.size() < 1) {
+            return 0;
+        }
+
+        return Integer.parseInt(businessRoomInfos.get(0).get("count").toString());
+    }
+
+
+}

+ 89 - 0
service-community/src/main/java/com/java110/community/smo/impl/RoomV1InnerServiceSMOImpl.java

@@ -0,0 +1,89 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.community.smo.impl;
+
+
+import com.java110.community.dao.IRoomV1ServiceDao;
+import com.java110.dto.RoomDto;
+import com.java110.intf.community.IRoomV1InnerServiceSMO;
+import com.java110.po.room.RoomPo;
+import com.java110.utils.util.BeanConvertUtil;
+import com.java110.core.base.smo.BaseServiceSMO;
+import com.java110.dto.user.UserDto;
+import com.java110.dto.PageDto;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 类表述: 服务之前调用的接口实现类,不对外提供接口能力 只用于接口建调用
+ * add by 吴学文 at 2021-09-14 14:28:56 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+@RestController
+public class RoomV1InnerServiceSMOImpl extends BaseServiceSMO implements IRoomV1InnerServiceSMO {
+
+    @Autowired
+    private IRoomV1ServiceDao roomV1ServiceDaoImpl;
+
+
+    @Override
+    public int saveRoom(@RequestBody  RoomPo roomPo) {
+        int saveFlag = roomV1ServiceDaoImpl.saveRoomInfo(BeanConvertUtil.beanCovertMap(roomPo));
+        return saveFlag;
+    }
+
+     @Override
+    public int updateRoom(@RequestBody  RoomPo roomPo) {
+        int saveFlag = roomV1ServiceDaoImpl.updateRoomInfo(BeanConvertUtil.beanCovertMap(roomPo));
+        return saveFlag;
+    }
+
+     @Override
+    public int deleteRoom(@RequestBody  RoomPo roomPo) {
+       roomPo.setStatusCd("1");
+       int saveFlag = roomV1ServiceDaoImpl.updateRoomInfo(BeanConvertUtil.beanCovertMap(roomPo));
+       return saveFlag;
+    }
+
+    @Override
+    public List<RoomDto> queryRooms(@RequestBody RoomDto roomDto) {
+
+        //校验是否传了 分页信息
+
+        int page = roomDto.getPage();
+
+        if (page != PageDto.DEFAULT_PAGE) {
+            roomDto.setPage((page - 1) * roomDto.getRow());
+        }
+
+        List<RoomDto> rooms = BeanConvertUtil.covertBeanList(roomV1ServiceDaoImpl.getRoomInfo(BeanConvertUtil.beanCovertMap(roomDto)), RoomDto.class);
+
+        return rooms;
+    }
+
+
+    @Override
+    public int queryRoomsCount(@RequestBody RoomDto roomDto) {
+        return roomV1ServiceDaoImpl.queryRoomsCount(BeanConvertUtil.beanCovertMap(roomDto));    }
+
+}