Przeglądaj źródła

加入 房屋出租 流程后台代码

java110 6 lat temu
rodzic
commit
7fd3885fce
17 zmienionych plików z 1002 dodań i 11 usunięć
  1. 104 0
      java110-bean/src/main/java/com/java110/dto/rentingPoolFlow/RentingPoolFlowDto.java
  2. 99 0
      java110-bean/src/main/java/com/java110/po/rentingPoolFlow/RentingPoolFlowPo.java
  3. 139 0
      java110-db/src/main/resources/mapper/user/RentingPoolFlowServiceDaoImplMapper.xml
  4. 31 11
      java110-generator/src/main/resources/newBack/template_1.json
  5. 53 0
      java110-interface/src/main/java/com/java110/intf/user/IRentingPoolFlowInnerServiceSMO.java
  6. 115 0
      service-user/src/main/java/com/java110/user/api/RentingPoolFlowApi.java
  7. 17 0
      service-user/src/main/java/com/java110/user/bmo/rentingPoolFlow/IDeleteRentingPoolFlowBMO.java
  8. 16 0
      service-user/src/main/java/com/java110/user/bmo/rentingPoolFlow/IGetRentingPoolFlowBMO.java
  9. 17 0
      service-user/src/main/java/com/java110/user/bmo/rentingPoolFlow/ISaveRentingPoolFlowBMO.java
  10. 19 0
      service-user/src/main/java/com/java110/user/bmo/rentingPoolFlow/IUpdateRentingPoolFlowBMO.java
  11. 34 0
      service-user/src/main/java/com/java110/user/bmo/rentingPoolFlow/impl/DeleteRentingPoolFlowBMOImpl.java
  12. 44 0
      service-user/src/main/java/com/java110/user/bmo/rentingPoolFlow/impl/GetRentingPoolFlowBMOImpl.java
  13. 38 0
      service-user/src/main/java/com/java110/user/bmo/rentingPoolFlow/impl/SaveRentingPoolFlowBMOImpl.java
  14. 34 0
      service-user/src/main/java/com/java110/user/bmo/rentingPoolFlow/impl/UpdateRentingPoolFlowBMOImpl.java
  15. 61 0
      service-user/src/main/java/com/java110/user/dao/IRentingPoolFlowServiceDao.java
  16. 98 0
      service-user/src/main/java/com/java110/user/dao/impl/RentingPoolFlowServiceDaoImpl.java
  17. 83 0
      service-user/src/main/java/com/java110/user/smo/impl/RentingPoolFlowInnerServiceSMOImpl.java

+ 104 - 0
java110-bean/src/main/java/com/java110/dto/rentingPoolFlow/RentingPoolFlowDto.java

@@ -0,0 +1,104 @@
+package com.java110.dto.rentingPoolFlow;
+
+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 RentingPoolFlowDto extends PageDto implements Serializable {
+
+    private String dealTime;
+private String useName;
+private String context;
+private String userTel;
+private String state;
+private String userRole;
+private String communityId;
+private String flowId;
+private String rentingId;
+
+
+    private Date createTime;
+
+    private String statusCd = "0";
+
+
+    public String getDealTime() {
+        return dealTime;
+    }
+public void setDealTime(String dealTime) {
+        this.dealTime = dealTime;
+    }
+public String getUseName() {
+        return useName;
+    }
+public void setUseName(String useName) {
+        this.useName = useName;
+    }
+public String getContext() {
+        return context;
+    }
+public void setContext(String context) {
+        this.context = context;
+    }
+public String getUserTel() {
+        return userTel;
+    }
+public void setUserTel(String userTel) {
+        this.userTel = userTel;
+    }
+public String getState() {
+        return state;
+    }
+public void setState(String state) {
+        this.state = state;
+    }
+public String getUserRole() {
+        return userRole;
+    }
+public void setUserRole(String userRole) {
+        this.userRole = userRole;
+    }
+public String getCommunityId() {
+        return communityId;
+    }
+public void setCommunityId(String communityId) {
+        this.communityId = communityId;
+    }
+public String getFlowId() {
+        return flowId;
+    }
+public void setFlowId(String flowId) {
+        this.flowId = flowId;
+    }
+public String getRentingId() {
+        return rentingId;
+    }
+public void setRentingId(String rentingId) {
+        this.rentingId = rentingId;
+    }
+
+
+    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;
+    }
+}

+ 99 - 0
java110-bean/src/main/java/com/java110/po/rentingPoolFlow/RentingPoolFlowPo.java

@@ -0,0 +1,99 @@
+package com.java110.po.rentingPoolFlow;
+
+import java.io.Serializable;
+
+public class RentingPoolFlowPo implements Serializable {
+
+    private String dealTime;
+    private String useName;
+    private String context;
+    private String userTel;
+    private String statusCd = "0";
+    private String state;
+    private String userRole;
+    private String communityId;
+    private String flowId;
+    private String rentingId;
+
+    public String getDealTime() {
+        return dealTime;
+    }
+
+    public void setDealTime(String dealTime) {
+        this.dealTime = dealTime;
+    }
+
+    public String getUseName() {
+        return useName;
+    }
+
+    public void setUseName(String useName) {
+        this.useName = useName;
+    }
+
+    public String getContext() {
+        return context;
+    }
+
+    public void setContext(String context) {
+        this.context = context;
+    }
+
+    public String getUserTel() {
+        return userTel;
+    }
+
+    public void setUserTel(String userTel) {
+        this.userTel = userTel;
+    }
+
+    public String getStatusCd() {
+        return statusCd;
+    }
+
+    public void setStatusCd(String statusCd) {
+        this.statusCd = statusCd;
+    }
+
+    public String getState() {
+        return state;
+    }
+
+    public void setState(String state) {
+        this.state = state;
+    }
+
+    public String getUserRole() {
+        return userRole;
+    }
+
+    public void setUserRole(String userRole) {
+        this.userRole = userRole;
+    }
+
+    public String getCommunityId() {
+        return communityId;
+    }
+
+    public void setCommunityId(String communityId) {
+        this.communityId = communityId;
+    }
+
+    public String getFlowId() {
+        return flowId;
+    }
+
+    public void setFlowId(String flowId) {
+        this.flowId = flowId;
+    }
+
+    public String getRentingId() {
+        return rentingId;
+    }
+
+    public void setRentingId(String rentingId) {
+        this.rentingId = rentingId;
+    }
+
+
+}

+ 139 - 0
java110-db/src/main/resources/mapper/user/RentingPoolFlowServiceDaoImplMapper.xml

@@ -0,0 +1,139 @@
+<?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="rentingPoolFlowServiceDaoImpl">
+
+
+    <!-- 保存出租流程信息 add by wuxw 2018-07-03 -->
+    <insert id="saveRentingPoolFlowInfo" parameterType="Map">
+        insert into renting_pool_flow(
+        deal_time,user_name,context,user_tel,state,user_role,community_id,flow_id,renting_id
+        ) values (
+        #{dealTime},#{useName},#{context},#{userTel},#{state},#{userRole},#{communityId},#{flowId},#{rentingId}
+        )
+    </insert>
+
+
+    <!-- 查询出租流程信息 add by wuxw 2018-07-03 -->
+    <select id="getRentingPoolFlowInfo" parameterType="Map" resultType="Map">
+        select t.deal_time,t.deal_time dealTime,t.user_name,t.user_name useName,t.context,t.user_tel,t.user_tel
+        userTel,t.status_cd,t.status_cd statusCd,t.state,t.user_role,t.user_role userRole,t.community_id,t.community_id
+        communityId,t.flow_id,t.flow_id flowId,t.renting_id,t.renting_id rentingId
+        from renting_pool_flow t
+        where 1 =1
+        <if test="dealTime !=null and dealTime != ''">
+            and t.deal_time= #{dealTime}
+        </if>
+        <if test="useName !=null and useName != ''">
+            and t.user_name= #{useName}
+        </if>
+        <if test="context !=null and context != ''">
+            and t.context= #{context}
+        </if>
+        <if test="userTel !=null and userTel != ''">
+            and t.user_tel= #{userTel}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="state !=null and state != ''">
+            and t.state= #{state}
+        </if>
+        <if test="userRole !=null and userRole != ''">
+            and t.user_role= #{userRole}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
+        <if test="flowId !=null and flowId != ''">
+            and t.flow_id= #{flowId}
+        </if>
+        <if test="rentingId !=null and rentingId != ''">
+            and t.renting_id= #{rentingId}
+        </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="updateRentingPoolFlowInfo" parameterType="Map">
+        update renting_pool_flow t set t.status_cd = #{statusCd}
+        <if test="newBId != null and newBId != ''">
+            ,t.b_id = #{newBId}
+        </if>
+        <if test="dealTime !=null and dealTime != ''">
+            , t.deal_time= #{dealTime}
+        </if>
+        <if test="useName !=null and useName != ''">
+            , t.user_name= #{useName}
+        </if>
+        <if test="context !=null and context != ''">
+            , t.context= #{context}
+        </if>
+        <if test="userTel !=null and userTel != ''">
+            , t.user_tel= #{userTel}
+        </if>
+        <if test="state !=null and state != ''">
+            , t.state= #{state}
+        </if>
+        <if test="userRole !=null and userRole != ''">
+            , t.user_role= #{userRole}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            , t.community_id= #{communityId}
+        </if>
+        <if test="rentingId !=null and rentingId != ''">
+            , t.renting_id= #{rentingId}
+        </if>
+        where 1=1
+        <if test="flowId !=null and flowId != ''">
+            and t.flow_id= #{flowId}
+        </if>
+
+    </update>
+
+    <!-- 查询出租流程数量 add by wuxw 2018-07-03 -->
+    <select id="queryRentingPoolFlowsCount" parameterType="Map" resultType="Map">
+        select count(1) count
+        from renting_pool_flow t
+        where 1 =1
+        <if test="dealTime !=null and dealTime != ''">
+            and t.deal_time= #{dealTime}
+        </if>
+        <if test="useName !=null and useName != ''">
+            and t.user_name= #{useName}
+        </if>
+        <if test="context !=null and context != ''">
+            and t.context= #{context}
+        </if>
+        <if test="userTel !=null and userTel != ''">
+            and t.user_tel= #{userTel}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="state !=null and state != ''">
+            and t.state= #{state}
+        </if>
+        <if test="userRole !=null and userRole != ''">
+            and t.user_role= #{userRole}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
+        <if test="flowId !=null and flowId != ''">
+            and t.flow_id= #{flowId}
+        </if>
+        <if test="rentingId !=null and rentingId != ''">
+            and t.renting_id= #{rentingId}
+        </if>
+
+
+    </select>
+
+</mapper>

+ 31 - 11
java110-generator/src/main/resources/newBack/template_1.json

@@ -1,24 +1,44 @@
 {
   "autoMove": true,
-  "id": "formulaId",
-  "name": "feeFormula",
-  "desc": "费用公式",
+  "id": "flowId",
+  "name": "rentingPoolFlow",
+  "desc": "出租流程",
   "shareParam": "communityId",
   "shareColumn": "community_id",
-  "shareName": "fee",
-  "tableName": "fee_formula",
+  "shareName": "user",
+  "tableName": "renting_pool_flow",
   "param": {
-    "formulaId": "formula_id",
-    "formulaType": "formula_type",
-    "formulaValue": "formula_value",
-    "formulaDesc": "formula_desc",
+    "flowId": "flow_id",
+    "rentingId": "renting_id",
+    "useName": "user_name",
+    "userTel": "user_tel",
+    "dealTime": "deal_time",
+    "state": "state",
+    "userRole": "user_role",
+    "context": "context",
     "communityId": "community_id",
     "statusCd": "status_cd"
   },
   "required": [
     {
-      "code": "formulaValue",
-      "msg": "公式不能为空"
+      "code": "rentingId",
+      "msg": "出租不能为空"
+    },
+    {
+      "code": "useName",
+      "msg": "处理人不能为空"
+    },
+    {
+      "code": "useTel",
+      "msg": "处理人电话不能为空"
+    },
+    {
+      "code": "dealTime",
+      "msg": "处理时间不能为空"
+    },
+    {
+      "code": "userRole",
+      "msg": "处理人角色不能为空"
     },
     {
       "code": "communityId",

+ 53 - 0
java110-interface/src/main/java/com/java110/intf/user/IRentingPoolFlowInnerServiceSMO.java

@@ -0,0 +1,53 @@
+package com.java110.intf;
+
+import com.java110.config.feign.FeignConfiguration;
+import com.java110.dto.rentingPoolFlow.RentingPoolFlowDto;
+import com.java110.po.rentingPoolFlow.RentingPoolFlowPo;
+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 IRentingPoolFlowInnerServiceSMO
+ * @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("/rentingPoolFlowApi")
+public interface IRentingPoolFlowInnerServiceSMO {
+
+
+    @RequestMapping(value = "/saveRentingPoolFlow", method = RequestMethod.POST)
+    public int saveRentingPoolFlow(@RequestBody RentingPoolFlowPo rentingPoolFlowPo);
+
+    @RequestMapping(value = "/updateRentingPoolFlow", method = RequestMethod.POST)
+    public int updateRentingPoolFlow(@RequestBody  RentingPoolFlowPo rentingPoolFlowPo);
+
+    @RequestMapping(value = "/deleteRentingPoolFlow", method = RequestMethod.POST)
+    public int deleteRentingPoolFlow(@RequestBody  RentingPoolFlowPo rentingPoolFlowPo);
+
+    /**
+     * <p>查询小区楼信息</p>
+     *
+     *
+     * @param rentingPoolFlowDto 数据对象分享
+     * @return RentingPoolFlowDto 对象数据
+     */
+    @RequestMapping(value = "/queryRentingPoolFlows", method = RequestMethod.POST)
+    List<RentingPoolFlowDto> queryRentingPoolFlows(@RequestBody RentingPoolFlowDto rentingPoolFlowDto);
+
+    /**
+     * 查询<p>小区楼</p>总记录数
+     *
+     * @param rentingPoolFlowDto 数据对象分享
+     * @return 小区下的小区楼记录数
+     */
+    @RequestMapping(value = "/queryRentingPoolFlowsCount", method = RequestMethod.POST)
+    int queryRentingPoolFlowsCount(@RequestBody RentingPoolFlowDto rentingPoolFlowDto);
+}

+ 115 - 0
service-user/src/main/java/com/java110/user/api/RentingPoolFlowApi.java

@@ -0,0 +1,115 @@
+package com.java110.user.api;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.dto.rentingPoolFlow.RentingPoolFlowDto;
+import com.java110.po.rentingPoolFlow.RentingPoolFlowPo;
+import com.java110.user.bmo.rentingPoolFlow.IDeleteRentingPoolFlowBMO;
+import com.java110.user.bmo.rentingPoolFlow.IGetRentingPoolFlowBMO;
+import com.java110.user.bmo.rentingPoolFlow.ISaveRentingPoolFlowBMO;
+import com.java110.user.bmo.rentingPoolFlow.IUpdateRentingPoolFlowBMO;
+import com.java110.utils.util.Assert;
+import com.java110.utils.util.BeanConvertUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+
+
+@RestController
+@RequestMapping(value = "/rentingPoolFlow")
+public class RentingPoolFlowApi {
+
+    @Autowired
+    private ISaveRentingPoolFlowBMO saveRentingPoolFlowBMOImpl;
+    @Autowired
+    private IUpdateRentingPoolFlowBMO updateRentingPoolFlowBMOImpl;
+    @Autowired
+    private IDeleteRentingPoolFlowBMO deleteRentingPoolFlowBMOImpl;
+
+    @Autowired
+    private IGetRentingPoolFlowBMO getRentingPoolFlowBMOImpl;
+
+    /**
+     * 微信保存消息模板
+     *
+     * @param reqJson
+     * @return
+     * @serviceCode /rentingPoolFlow/saveRentingPoolFlow
+     * @path /app/rentingPoolFlow/saveRentingPoolFlow
+     */
+    @RequestMapping(value = "/saveRentingPoolFlow", method = RequestMethod.POST)
+    public ResponseEntity<String> saveRentingPoolFlow(@RequestBody JSONObject reqJson) {
+
+        Assert.hasKeyAndValue(reqJson, "rentingId", "请求报文中未包含rentingId");
+        Assert.hasKeyAndValue(reqJson, "useName", "请求报文中未包含useName");
+        Assert.hasKeyAndValue(reqJson, "useTel", "请求报文中未包含useTel");
+        Assert.hasKeyAndValue(reqJson, "dealTime", "请求报文中未包含dealTime");
+        Assert.hasKeyAndValue(reqJson, "userRole", "请求报文中未包含userRole");
+        Assert.hasKeyAndValue(reqJson, "communityId", "请求报文中未包含communityId");
+
+
+        RentingPoolFlowPo rentingPoolFlowPo = BeanConvertUtil.covertBean(reqJson, RentingPoolFlowPo.class);
+        return saveRentingPoolFlowBMOImpl.save(rentingPoolFlowPo);
+    }
+
+    /**
+     * 微信修改消息模板
+     *
+     * @param reqJson
+     * @return
+     * @serviceCode /rentingPoolFlow/updateRentingPoolFlow
+     * @path /app/rentingPoolFlow/updateRentingPoolFlow
+     */
+    @RequestMapping(value = "/updateRentingPoolFlow", method = RequestMethod.POST)
+    public ResponseEntity<String> updateRentingPoolFlow(@RequestBody JSONObject reqJson) {
+
+        Assert.hasKeyAndValue(reqJson, "rentingId", "请求报文中未包含rentingId");
+        Assert.hasKeyAndValue(reqJson, "useName", "请求报文中未包含useName");
+        Assert.hasKeyAndValue(reqJson, "useTel", "请求报文中未包含useTel");
+        Assert.hasKeyAndValue(reqJson, "dealTime", "请求报文中未包含dealTime");
+        Assert.hasKeyAndValue(reqJson, "userRole", "请求报文中未包含userRole");
+        Assert.hasKeyAndValue(reqJson, "communityId", "请求报文中未包含communityId");
+        Assert.hasKeyAndValue(reqJson, "flowId", "flowId不能为空");
+
+
+        RentingPoolFlowPo rentingPoolFlowPo = BeanConvertUtil.covertBean(reqJson, RentingPoolFlowPo.class);
+        return updateRentingPoolFlowBMOImpl.update(rentingPoolFlowPo);
+    }
+
+    /**
+     * 微信删除消息模板
+     *
+     * @param reqJson
+     * @return
+     * @serviceCode /rentingPoolFlow/deleteRentingPoolFlow
+     * @path /app/rentingPoolFlow/deleteRentingPoolFlow
+     */
+    @RequestMapping(value = "/deleteRentingPoolFlow", method = RequestMethod.POST)
+    public ResponseEntity<String> deleteRentingPoolFlow(@RequestBody JSONObject reqJson) {
+        Assert.hasKeyAndValue(reqJson, "communityId", "小区ID不能为空");
+
+        Assert.hasKeyAndValue(reqJson, "flowId", "flowId不能为空");
+
+
+        RentingPoolFlowPo rentingPoolFlowPo = BeanConvertUtil.covertBean(reqJson, RentingPoolFlowPo.class);
+        return deleteRentingPoolFlowBMOImpl.delete(rentingPoolFlowPo);
+    }
+
+    /**
+     * 微信删除消息模板
+     *
+     * @param communityId 小区ID
+     * @return
+     * @serviceCode /rentingPoolFlow/queryRentingPoolFlow
+     * @path /app/rentingPoolFlow/queryRentingPoolFlow
+     */
+    @RequestMapping(value = "/queryRentingPoolFlow", method = RequestMethod.GET)
+    public ResponseEntity<String> queryRentingPoolFlow(@RequestParam(value = "communityId") String communityId,
+                                                       @RequestParam(value = "page") int page,
+                                                       @RequestParam(value = "row") int row) {
+        RentingPoolFlowDto rentingPoolFlowDto = new RentingPoolFlowDto();
+        rentingPoolFlowDto.setPage(page);
+        rentingPoolFlowDto.setRow(row);
+        rentingPoolFlowDto.setCommunityId(communityId);
+        return getRentingPoolFlowBMOImpl.get(rentingPoolFlowDto);
+    }
+}

+ 17 - 0
service-user/src/main/java/com/java110/user/bmo/rentingPoolFlow/IDeleteRentingPoolFlowBMO.java

@@ -0,0 +1,17 @@
+package com.java110.user.bmo.rentingPoolFlow;
+import com.java110.po.rentingPoolFlow.RentingPoolFlowPo;
+import org.springframework.http.ResponseEntity;
+
+public interface IDeleteRentingPoolFlowBMO {
+
+
+    /**
+     * 修改出租流程
+     * add by wuxw
+     * @param rentingPoolFlowPo
+     * @return
+     */
+    ResponseEntity<String> delete(RentingPoolFlowPo rentingPoolFlowPo);
+
+
+}

+ 16 - 0
service-user/src/main/java/com/java110/user/bmo/rentingPoolFlow/IGetRentingPoolFlowBMO.java

@@ -0,0 +1,16 @@
+package com.java110.user.bmo.rentingPoolFlow;
+import com.java110.dto.rentingPoolFlow.RentingPoolFlowDto;
+import org.springframework.http.ResponseEntity;
+public interface IGetRentingPoolFlowBMO {
+
+
+    /**
+     * 查询出租流程
+     * add by wuxw
+     * @param  rentingPoolFlowDto
+     * @return
+     */
+    ResponseEntity<String> get(RentingPoolFlowDto rentingPoolFlowDto);
+
+
+}

+ 17 - 0
service-user/src/main/java/com/java110/user/bmo/rentingPoolFlow/ISaveRentingPoolFlowBMO.java

@@ -0,0 +1,17 @@
+package com.java110.user.bmo.rentingPoolFlow;
+
+import com.java110.po.rentingPoolFlow.RentingPoolFlowPo;
+import org.springframework.http.ResponseEntity;
+public interface ISaveRentingPoolFlowBMO {
+
+
+    /**
+     * 添加出租流程
+     * add by wuxw
+     * @param rentingPoolFlowPo
+     * @return
+     */
+    ResponseEntity<String> save(RentingPoolFlowPo rentingPoolFlowPo);
+
+
+}

+ 19 - 0
service-user/src/main/java/com/java110/user/bmo/rentingPoolFlow/IUpdateRentingPoolFlowBMO.java

@@ -0,0 +1,19 @@
+package com.java110.user.bmo.rentingPoolFlow;
+
+import com.java110.po.rentingPoolFlow.RentingPoolFlowPo;
+import org.springframework.http.ResponseEntity;
+
+public interface IUpdateRentingPoolFlowBMO {
+
+
+    /**
+     * 修改出租流程
+     * add by wuxw
+     *
+     * @param rentingPoolFlowPo
+     * @return
+     */
+    ResponseEntity<String> update(RentingPoolFlowPo rentingPoolFlowPo);
+
+
+}

+ 34 - 0
service-user/src/main/java/com/java110/user/bmo/rentingPoolFlow/impl/DeleteRentingPoolFlowBMOImpl.java

@@ -0,0 +1,34 @@
+package com.java110.user.bmo.rentingPoolFlow.impl;
+
+import com.java110.core.annotation.Java110Transactional;
+import com.java110.intf.IRentingPoolFlowInnerServiceSMO;
+import com.java110.po.rentingPoolFlow.RentingPoolFlowPo;
+import com.java110.user.bmo.rentingPoolFlow.IDeleteRentingPoolFlowBMO;
+import com.java110.vo.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+
+@Service("deleteRentingPoolFlowBMOImpl")
+public class DeleteRentingPoolFlowBMOImpl implements IDeleteRentingPoolFlowBMO {
+
+    @Autowired
+    private IRentingPoolFlowInnerServiceSMO rentingPoolFlowInnerServiceSMOImpl;
+
+    /**
+     * @param rentingPoolFlowPo 数据
+     * @return 订单服务能够接受的报文
+     */
+    @Java110Transactional
+    public ResponseEntity<String> delete(RentingPoolFlowPo rentingPoolFlowPo) {
+
+        int flag = rentingPoolFlowInnerServiceSMOImpl.deleteRentingPoolFlow(rentingPoolFlowPo);
+
+        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/rentingPoolFlow/impl/GetRentingPoolFlowBMOImpl.java

@@ -0,0 +1,44 @@
+package com.java110.user.bmo.rentingPoolFlow.impl;
+
+import com.java110.dto.rentingPoolFlow.RentingPoolFlowDto;
+import com.java110.intf.IRentingPoolFlowInnerServiceSMO;
+import com.java110.user.bmo.rentingPoolFlow.IGetRentingPoolFlowBMO;
+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("getRentingPoolFlowBMOImpl")
+public class GetRentingPoolFlowBMOImpl implements IGetRentingPoolFlowBMO {
+
+    @Autowired
+    private IRentingPoolFlowInnerServiceSMO rentingPoolFlowInnerServiceSMOImpl;
+
+    /**
+     * @param rentingPoolFlowDto
+     * @return 订单服务能够接受的报文
+     */
+    public ResponseEntity<String> get(RentingPoolFlowDto rentingPoolFlowDto) {
+
+
+        int count = rentingPoolFlowInnerServiceSMOImpl.queryRentingPoolFlowsCount(rentingPoolFlowDto);
+
+        List<RentingPoolFlowDto> rentingPoolFlowDtos = null;
+        if (count > 0) {
+            rentingPoolFlowDtos = rentingPoolFlowInnerServiceSMOImpl.queryRentingPoolFlows(rentingPoolFlowDto);
+        } else {
+            rentingPoolFlowDtos = new ArrayList<>();
+        }
+
+        ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) rentingPoolFlowDto.getRow()), count, rentingPoolFlowDtos);
+
+        ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
+
+        return responseEntity;
+    }
+
+}

+ 38 - 0
service-user/src/main/java/com/java110/user/bmo/rentingPoolFlow/impl/SaveRentingPoolFlowBMOImpl.java

@@ -0,0 +1,38 @@
+package com.java110.user.bmo.rentingPoolFlow.impl;
+
+import com.java110.core.annotation.Java110Transactional;
+import com.java110.core.factory.GenerateCodeFactory;
+import com.java110.intf.IRentingPoolFlowInnerServiceSMO;
+import com.java110.po.rentingPoolFlow.RentingPoolFlowPo;
+import com.java110.user.bmo.rentingPoolFlow.ISaveRentingPoolFlowBMO;
+import com.java110.vo.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+
+@Service("saveRentingPoolFlowBMOImpl")
+public class SaveRentingPoolFlowBMOImpl implements ISaveRentingPoolFlowBMO {
+
+    @Autowired
+    private IRentingPoolFlowInnerServiceSMO rentingPoolFlowInnerServiceSMOImpl;
+
+    /**
+     * 添加小区信息
+     *
+     * @param rentingPoolFlowPo
+     * @return 订单服务能够接受的报文
+     */
+    @Java110Transactional
+    public ResponseEntity<String> save(RentingPoolFlowPo rentingPoolFlowPo) {
+
+        rentingPoolFlowPo.setFlowId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_flowId));
+        int flag = rentingPoolFlowInnerServiceSMOImpl.saveRentingPoolFlow(rentingPoolFlowPo);
+
+        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/rentingPoolFlow/impl/UpdateRentingPoolFlowBMOImpl.java

@@ -0,0 +1,34 @@
+package com.java110.user.bmo.rentingPoolFlow.impl;
+
+import com.java110.core.annotation.Java110Transactional;
+import com.java110.intf.IRentingPoolFlowInnerServiceSMO;
+import com.java110.po.rentingPoolFlow.RentingPoolFlowPo;
+import com.java110.user.bmo.rentingPoolFlow.IUpdateRentingPoolFlowBMO;
+import com.java110.vo.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+
+@Service("updateRentingPoolFlowBMOImpl")
+public class UpdateRentingPoolFlowBMOImpl implements IUpdateRentingPoolFlowBMO {
+
+    @Autowired
+    private IRentingPoolFlowInnerServiceSMO rentingPoolFlowInnerServiceSMOImpl;
+
+    /**
+     * @param rentingPoolFlowPo
+     * @return 订单服务能够接受的报文
+     */
+    @Java110Transactional
+    public ResponseEntity<String> update(RentingPoolFlowPo rentingPoolFlowPo) {
+
+        int flag = rentingPoolFlowInnerServiceSMOImpl.updateRentingPoolFlow(rentingPoolFlowPo);
+
+        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/IRentingPoolFlowServiceDao.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 IRentingPoolFlowServiceDao {
+
+
+    /**
+     * 保存 出租流程信息
+     * @param info
+     * @throws DAOException DAO异常
+     */
+    void saveRentingPoolFlowInfo(Map info) throws DAOException;
+
+
+
+
+    /**
+     * 查询出租流程信息(instance过程)
+     * 根据bId 查询出租流程信息
+     * @param info bId 信息
+     * @return 出租流程信息
+     * @throws DAOException DAO异常
+     */
+    List<Map> getRentingPoolFlowInfo(Map info) throws DAOException;
+
+
+
+    /**
+     * 修改出租流程信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    void updateRentingPoolFlowInfo(Map info) throws DAOException;
+
+
+    /**
+     * 查询出租流程总数
+     *
+     * @param info 出租流程信息
+     * @return 出租流程数量
+     */
+    int queryRentingPoolFlowsCount(Map info);
+
+}

+ 98 - 0
service-user/src/main/java/com/java110/user/dao/impl/RentingPoolFlowServiceDaoImpl.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.IRentingPoolFlowServiceDao;
+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("rentingPoolFlowServiceDaoImpl")
+//@Transactional
+public class RentingPoolFlowServiceDaoImpl extends BaseServiceDao implements IRentingPoolFlowServiceDao {
+
+    private static Logger logger = LoggerFactory.getLogger(RentingPoolFlowServiceDaoImpl.class);
+
+
+
+
+
+    /**
+     * 保存出租流程信息 到 instance
+     * @param info   bId 信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public void saveRentingPoolFlowInfo(Map info) throws DAOException {
+        logger.debug("保存出租流程信息Instance 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.insert("rentingPoolFlowServiceDaoImpl.saveRentingPoolFlowInfo",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> getRentingPoolFlowInfo(Map info) throws DAOException {
+        logger.debug("查询出租流程信息 入参 info : {}",info);
+
+        List<Map> businessRentingPoolFlowInfos = sqlSessionTemplate.selectList("rentingPoolFlowServiceDaoImpl.getRentingPoolFlowInfo",info);
+
+        return businessRentingPoolFlowInfos;
+    }
+
+
+    /**
+     * 修改出租流程信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public void updateRentingPoolFlowInfo(Map info) throws DAOException {
+        logger.debug("修改出租流程信息Instance 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.update("rentingPoolFlowServiceDaoImpl.updateRentingPoolFlowInfo",info);
+
+        if(saveFlag < 1){
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"修改出租流程信息Instance数据失败:"+ JSONObject.toJSONString(info));
+        }
+    }
+
+     /**
+     * 查询出租流程数量
+     * @param info 出租流程信息
+     * @return 出租流程数量
+     */
+    @Override
+    public int queryRentingPoolFlowsCount(Map info) {
+        logger.debug("查询出租流程数据 入参 info : {}",info);
+
+        List<Map> businessRentingPoolFlowInfos = sqlSessionTemplate.selectList("rentingPoolFlowServiceDaoImpl.queryRentingPoolFlowsCount", info);
+        if (businessRentingPoolFlowInfos.size() < 1) {
+            return 0;
+        }
+
+        return Integer.parseInt(businessRentingPoolFlowInfos.get(0).get("count").toString());
+    }
+
+
+}

+ 83 - 0
service-user/src/main/java/com/java110/user/smo/impl/RentingPoolFlowInnerServiceSMOImpl.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.rentingPoolFlow.RentingPoolFlowDto;
+import com.java110.intf.IRentingPoolFlowInnerServiceSMO;
+import com.java110.po.rentingPoolFlow.RentingPoolFlowPo;
+import com.java110.user.dao.IRentingPoolFlowServiceDao;
+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 RentingPoolFlowInnerServiceSMOImpl extends BaseServiceSMO implements IRentingPoolFlowInnerServiceSMO {
+
+    @Autowired
+    private IRentingPoolFlowServiceDao rentingPoolFlowServiceDaoImpl;
+
+
+    @Override
+    public int saveRentingPoolFlow(@RequestBody RentingPoolFlowPo rentingPoolFlowPo) {
+        int saveFlag = 1;
+        rentingPoolFlowServiceDaoImpl.saveRentingPoolFlowInfo(BeanConvertUtil.beanCovertMap(rentingPoolFlowPo));
+        return saveFlag;
+    }
+
+    @Override
+    public int updateRentingPoolFlow(@RequestBody RentingPoolFlowPo rentingPoolFlowPo) {
+        int saveFlag = 1;
+        rentingPoolFlowServiceDaoImpl.updateRentingPoolFlowInfo(BeanConvertUtil.beanCovertMap(rentingPoolFlowPo));
+        return saveFlag;
+    }
+
+    @Override
+    public int deleteRentingPoolFlow(@RequestBody RentingPoolFlowPo rentingPoolFlowPo) {
+        int saveFlag = 1;
+        rentingPoolFlowPo.setStatusCd("1");
+        rentingPoolFlowServiceDaoImpl.updateRentingPoolFlowInfo(BeanConvertUtil.beanCovertMap(rentingPoolFlowPo));
+        return saveFlag;
+    }
+
+    @Override
+    public List<RentingPoolFlowDto> queryRentingPoolFlows(@RequestBody RentingPoolFlowDto rentingPoolFlowDto) {
+
+        //校验是否传了 分页信息
+
+        int page = rentingPoolFlowDto.getPage();
+
+        if (page != PageDto.DEFAULT_PAGE) {
+            rentingPoolFlowDto.setPage((page - 1) * rentingPoolFlowDto.getRow());
+        }
+
+        List<RentingPoolFlowDto> rentingPoolFlows = BeanConvertUtil.covertBeanList(rentingPoolFlowServiceDaoImpl.getRentingPoolFlowInfo(BeanConvertUtil.beanCovertMap(rentingPoolFlowDto)), RentingPoolFlowDto.class);
+
+        return rentingPoolFlows;
+    }
+
+
+    @Override
+    public int queryRentingPoolFlowsCount(@RequestBody RentingPoolFlowDto rentingPoolFlowDto) {
+        return rentingPoolFlowServiceDaoImpl.queryRentingPoolFlowsCount(BeanConvertUtil.beanCovertMap(rentingPoolFlowDto));
+    }
+
+    public IRentingPoolFlowServiceDao getRentingPoolFlowServiceDaoImpl() {
+        return rentingPoolFlowServiceDaoImpl;
+    }
+
+    public void setRentingPoolFlowServiceDaoImpl(IRentingPoolFlowServiceDao rentingPoolFlowServiceDaoImpl) {
+        this.rentingPoolFlowServiceDaoImpl = rentingPoolFlowServiceDaoImpl;
+    }
+}