Browse Source

售卖房屋时 在费用表中插入 物业和业主的费用记录

wuxw 7 years ago
parent
commit
7f37cea3c0

+ 35 - 0
Api/src/main/java/com/java110/api/listener/room/SellRoomListener.java

@@ -5,8 +5,10 @@ import com.alibaba.fastjson.JSONObject;
 import com.java110.api.listener.AbstractServiceApiDataFlowListener;
 import com.java110.common.constant.BusinessTypeConstant;
 import com.java110.common.constant.CommonConstant;
+import com.java110.common.constant.FeeTypeConstant;
 import com.java110.common.constant.ServiceCodeConstant;
 import com.java110.common.util.Assert;
+import com.java110.common.util.DateUtil;
 import com.java110.core.annotation.Java110Listener;
 import com.java110.core.context.DataFlowContext;
 import com.java110.core.smo.community.ICommunityInnerServiceSMO;
@@ -70,6 +72,9 @@ public class SellRoomListener extends AbstractServiceApiDataFlowListener {
         //添加单元信息
         businesses.add(sellRoom(paramObj, dataFlowContext));
 
+        //添加物业费用信息
+        businesses.add(addPropertyFee(paramObj, dataFlowContext));
+
         JSONObject paramInObj = super.restToCenterProtocol(businesses, dataFlowContext.getRequestCurrentHeaders());
 
         //将 rest header 信息传递到下层服务中去
@@ -104,6 +109,35 @@ public class SellRoomListener extends AbstractServiceApiDataFlowListener {
         return business;
     }
 
+    /**
+     * 添加物业费用
+     *
+     * @param paramInJson     接口调用放传入入参
+     * @param dataFlowContext 数据上下文
+     * @return 订单服务能够接受的报文
+     */
+    private JSONObject addPropertyFee(JSONObject paramInJson, DataFlowContext dataFlowContext) {
+
+
+        JSONObject business = JSONObject.parseObject("{\"datas\":{}}");
+        business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_SAVE_FEE_INFO);
+        business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ + 1);
+        business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S);
+        JSONObject businessUnit = new JSONObject();
+        businessUnit.put("feeId", "-1");
+        businessUnit.put("feeTypeCd", FeeTypeConstant.FEE_TYPE_PROPERTY);
+        businessUnit.put("incomeObjId", paramInJson.getString("storeId"));
+        businessUnit.put("amount", "-1.00");
+        businessUnit.put("startTime", DateUtil.getCurrentDate());
+        businessUnit.put("endTime", DateUtil.getCurrentDate());
+        businessUnit.put("communityId", paramInJson.getString("communityId"));
+        businessUnit.put("payerObjId", paramInJson.getString("ownerId"));
+        businessUnit.put("userId", dataFlowContext.getRequestCurrentHeaders().get(CommonConstant.HTTP_USER_ID));
+        business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessFee", businessUnit);
+
+        return business;
+    }
+
     /**
      * 数据校验
      *
@@ -116,6 +150,7 @@ public class SellRoomListener extends AbstractServiceApiDataFlowListener {
         Assert.jsonObjectHaveKey(paramIn, "ownerId", "请求报文中未包含ownerId节点");
         Assert.jsonObjectHaveKey(paramIn, "roomId", "请求报文中未包含roomId节点");
         Assert.jsonObjectHaveKey(paramIn, "state", "请求报文中未包含state节点");
+        Assert.jsonObjectHaveKey(paramIn, "storeId", "请求报文中未包含storeId节点");
 
         JSONObject paramObj = JSONObject.parseObject(paramIn);
         Assert.hasLength(paramObj.getString("communityId"), "小区ID不能为空");

+ 1 - 0
WebService/src/main/java/com/java110/web/smo/impl/RoomServiceSMOImpl.java

@@ -230,6 +230,7 @@ public class RoomServiceSMOImpl extends BaseComponentSMO implements IRoomService
         //数据校验是否 商户是否入驻该小区
         super.checkStoreEnterCommunity(pd, storeId, storeTypeCd, communityId, restTemplate);
         paramIn.put("userId", pd.getUserId());
+        paramIn.put("storeId", storeId);
         responseEntity = this.callCenterService(restTemplate, pd, paramIn.toJSONString(),
                 ServiceConstant.SERVICE_API_URL + "/api/room.sellRoom",
                 HttpMethod.POST);

+ 33 - 0
WebService/src/main/resources/views/propertyFeeFlow.html

@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html lang="en"
+      xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:th="http://www.thymeleaf.org"
+      xmlns:vc="http://www.thymeleaf.org">
+<head>
+    <meta charset="UTF-8"/>
+    <title>物业费 |java110</title>
+    <vc:create name="commonTop"></vc:create>
+</head>
+<body>
+<vc:create name="bodyTop"></vc:create>
+<div id="wrapper">
+    <vc:create name="menu"></vc:create>
+
+
+    <div id="page-wrapper" class="gray-bg dashbard-1">
+        <div class="row border-bottom">
+            <vc:create name="nav"></vc:create>
+        </div>
+        <!-- id="component" -->
+        <div class="wrapper wrapper-content animated fadeInRight">
+            <vc:create name="viewPropertyFeeConfig"></vc:create>
+        </div>
+
+        <vc:create name="copyright"></vc:create>
+
+    </div>
+</div>
+
+<vc:create name="commonBottom"></vc:create>
+</body>
+</html>

+ 3 - 3
docs/services/fee/DeleteFeeInfo.md

@@ -43,8 +43,8 @@
 |-|business|?|Array|-|业务节点|-|
 |business|businessTypeCd|1|String|12|业务类型编码|500100030002|
 |business|datas|1|Object|-|数据节点|不同的服务下的节点不一样|
-|datas|businessFeeInfo|1|Object|-|小区成员|小区成员|
-|businessFeeInfo|feeId|1|String|30|-|-|
+|datas|businessFee|1|Object|-|小区成员|小区成员|
+|businessFee|feeId|1|String|30|-|-|
 
 
 ###### 返回协议
@@ -86,7 +86,7 @@ Content-Type:application/json
     "bId":"1234567892",
     "remark": "备注",
     "datas": {
-      "businessFeeInfo": {
+      "businessFee": {
                 "feeId":"填写存在的值"
       }
     },

+ 11 - 11
docs/services/fee/SaveFeeInfo.md

@@ -43,16 +43,16 @@
 |-|business|?|Array|-|业务节点|-|
 |business|businessTypeCd|1|String|12|业务类型编码|500100030002|
 |business|datas|1|Object|-|数据节点|不同的服务下的节点不一样|
-|datas|businessFeeInfo|1|Object|-|小区成员|小区成员|
-|businessFeeInfo|amount|1|String|30|-|-|
-|businessFeeInfo|incomeObjId|1|String|30|-|-|
-|businessFeeInfo|feeTypeCd|1|String|30|-|-|
-|businessFeeInfo|startTime|1|String|30|-|-|
-|businessFeeInfo|endTime|1|String|30|-|-|
-|businessFeeInfo|communityId|1|String|30|-|-|
-|businessFeeInfo|feeId|1|String|30|-|-|
-|businessFeeInfo|userId|1|String|30|-|-|
-|businessFeeInfo|payerObjId|1|String|30|-|-|
+|datas|businessFee|1|Object|-|小区成员|小区成员|
+|businessFee|amount|1|String|30|-|-|
+|businessFee|incomeObjId|1|String|30|-|-|
+|businessFee|feeTypeCd|1|String|30|-|-|
+|businessFee|startTime|1|String|30|-|-|
+|businessFee|endTime|1|String|30|-|-|
+|businessFee|communityId|1|String|30|-|-|
+|businessFee|feeId|1|String|30|-|-|
+|businessFee|userId|1|String|30|-|-|
+|businessFee|payerObjId|1|String|30|-|-|
 
 
 ###### 返回协议
@@ -94,7 +94,7 @@ Content-Type:application/json
     "bId":"1234567892",
     "remark": "备注",
     "datas": {
-      "businessFeeInfo": {
+      "businessFee": {
                 "amount":"填写具体值",
         "incomeObjId":"填写具体值",
         "feeTypeCd":"填写具体值",

+ 11 - 11
docs/services/fee/UpdateFeeInfo.md

@@ -43,16 +43,16 @@
 |-|business|?|Array|-|业务节点|-|
 |business|businessTypeCd|1|String|12|业务类型编码|500100030002|
 |business|datas|1|Object|-|数据节点|不同的服务下的节点不一样|
-|datas|businessFeeInfo|1|Object|-|小区成员|小区成员|
-|businessFeeInfo|amount|1|String|30|-|-|
-|businessFeeInfo|incomeObjId|1|String|30|-|-|
-|businessFeeInfo|feeTypeCd|1|String|30|-|-|
-|businessFeeInfo|startTime|1|String|30|-|-|
-|businessFeeInfo|endTime|1|String|30|-|-|
-|businessFeeInfo|communityId|1|String|30|-|-|
-|businessFeeInfo|feeId|1|String|30|-|-|
-|businessFeeInfo|userId|1|String|30|-|-|
-|businessFeeInfo|payerObjId|1|String|30|-|-|
+|datas|businessFee|1|Object|-|小区成员|小区成员|
+|businessFee|amount|1|String|30|-|-|
+|businessFee|incomeObjId|1|String|30|-|-|
+|businessFee|feeTypeCd|1|String|30|-|-|
+|businessFee|startTime|1|String|30|-|-|
+|businessFee|endTime|1|String|30|-|-|
+|businessFee|communityId|1|String|30|-|-|
+|businessFee|feeId|1|String|30|-|-|
+|businessFee|userId|1|String|30|-|-|
+|businessFee|payerObjId|1|String|30|-|-|
 
 
 ###### 返回协议
@@ -94,7 +94,7 @@ Content-Type:application/json
     "bId":"1234567892",
     "remark": "备注",
     "datas": {
-      "businessFeeInfo": {
+      "businessFee": {
                 "amount":"填写具体值",
         "incomeObjId":"填写具体值",
         "feeTypeCd":"填写具体值",