Преглед на файлове

物业费配置开发中,未开发完成

wuxw преди 7 години
родител
ревизия
23fb871dc3

+ 35 - 0
WebService/src/main/java/com/java110/web/components/fee/ViewPropertyFeeConfigComponent.java

@@ -0,0 +1,35 @@
+package com.java110.web.components.fee;
+
+import com.java110.core.context.IPageData;
+import com.java110.web.smo.IFeeServiceSMO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Component;
+
+/**
+ * @ClassName ViewPropertyFeeConfigComponent
+ * @Description 展示物业费信息
+ * @Author wuxw
+ * @Date 2019/6/1 14:33
+ * @Version 1.0
+ * add by wuxw 2019/6/1
+ **/
+@Component("viewPropertyFeeConfig")
+public class ViewPropertyFeeConfigComponent {
+
+    @Autowired
+    private IFeeServiceSMO feeServiceSMOImpl;
+
+    public ResponseEntity<String> loadData(IPageData pd) {
+        return feeServiceSMOImpl.loadPropertyConfigFee(pd);
+    }
+
+
+    public IFeeServiceSMO getFeeServiceSMOImpl() {
+        return feeServiceSMOImpl;
+    }
+
+    public void setFeeServiceSMOImpl(IFeeServiceSMO feeServiceSMOImpl) {
+        this.feeServiceSMOImpl = feeServiceSMOImpl;
+    }
+}

+ 21 - 0
WebService/src/main/java/com/java110/web/smo/IFeeServiceSMO.java

@@ -0,0 +1,21 @@
+package com.java110.web.smo;
+
+import com.java110.core.context.IPageData;
+import org.springframework.http.ResponseEntity;
+
+/**
+ * 费用服务类
+ */
+public interface IFeeServiceSMO {
+
+    /**
+     * 物业配置费
+     *
+     * @param pd 页面数据封装对象
+     * @return 返回 ResponseEntity对象包含 http状态 信息 body信息
+     */
+    ResponseEntity<String> loadPropertyConfigFee(IPageData pd);
+
+
+
+}

+ 123 - 0
WebService/src/main/java/com/java110/web/smo/impl/FeeServiceSMOImpl.java

@@ -0,0 +1,123 @@
+package com.java110.web.smo.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.common.constant.PrivilegeCodeConstant;
+import com.java110.common.constant.ResponseConstant;
+import com.java110.common.constant.ServiceConstant;
+import com.java110.common.exception.SMOException;
+import com.java110.common.util.Assert;
+import com.java110.core.context.IPageData;
+import com.java110.web.core.BaseComponentSMO;
+import com.java110.web.smo.IFeeServiceSMO;
+import com.java110.web.smo.IRoomServiceSMO;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+import org.springframework.web.client.RestTemplate;
+
+/**
+ * 房屋服务实现类
+ */
+@Service("feeServiceSMOImpl")
+public class FeeServiceSMOImpl extends BaseComponentSMO implements IFeeServiceSMO {
+
+    private static Logger logger = LoggerFactory.getLogger(FeeServiceSMOImpl.class);
+
+
+    @Autowired
+    private RestTemplate restTemplate;
+
+    @Override
+    public ResponseEntity<String> loadPropertyConfigFee(IPageData pd) {
+        validateLoadPropertyConfigFee(pd);
+
+        //校验员工是否有权限操作
+        super.checkUserHasPrivilege(pd, restTemplate, PrivilegeCodeConstant.PRIVILEGE_PROPERTY_CONFIG_FEE);
+
+        JSONObject paramIn = JSONObject.parseObject(pd.getReqData());
+        String communityId = paramIn.getString("communityId");
+        ResponseEntity responseEntity = super.getStoreInfo(pd, restTemplate);
+        if (responseEntity.getStatusCode() != HttpStatus.OK) {
+            return responseEntity;
+        }
+        Assert.jsonObjectHaveKey(responseEntity.getBody().toString(), "storeId", "根据用户ID查询商户ID失败,未包含storeId节点");
+        Assert.jsonObjectHaveKey(responseEntity.getBody().toString(), "storeTypeCd", "根据用户ID查询商户类型失败,未包含storeTypeCd节点");
+
+        String storeId = JSONObject.parseObject(responseEntity.getBody().toString()).getString("storeId");
+        String storeTypeCd = JSONObject.parseObject(responseEntity.getBody().toString()).getString("storeTypeCd");
+        //数据校验是否 商户是否入驻该小区
+        super.checkStoreEnterCommunity(pd, storeId, storeTypeCd, communityId, restTemplate);
+        paramIn.put("userId", pd.getUserId());
+        responseEntity = this.callCenterService(restTemplate, pd, paramIn.toJSONString(),
+                ServiceConstant.SERVICE_API_URL + "/api/room.saveRoom",
+                HttpMethod.POST);
+
+        return responseEntity;
+    }
+
+
+
+
+    /**
+     * 小区房屋查询数据校验
+     *
+     * @param pd 页面数据封装对象
+     */
+    private void validateLoadPropertyConfigFee(IPageData pd) {
+        Assert.jsonObjectHaveKey(pd.getReqData(), "communityId", "请求报文中未包含communityId节点");
+
+        JSONObject paramIn = JSONObject.parseObject(pd.getReqData());
+        Assert.hasLength(paramIn.getString("communityId"), "小区ID不能为空");
+    }
+
+    /**
+     * 校验前台传入房屋信息
+     *
+     * @param pd 页面数据封装
+     */
+    private void validateSaveRoom(IPageData pd) {
+
+        Assert.jsonObjectHaveKey(pd.getReqData(), "communityId", "请求报文中未包含communityId节点");
+        Assert.jsonObjectHaveKey(pd.getReqData(), "unitId", "请求报文中未包含unitId节点");
+        Assert.jsonObjectHaveKey(pd.getReqData(), "roomNum", "请求报文中未包含roomNum节点");
+        Assert.jsonObjectHaveKey(pd.getReqData(), "layer", "请求报文中未包含layer节点");
+        Assert.jsonObjectHaveKey(pd.getReqData(), "section", "请求报文中未包含section节点");
+        Assert.jsonObjectHaveKey(pd.getReqData(), "apartment", "请求报文中未包含apartment节点");
+        Assert.jsonObjectHaveKey(pd.getReqData(), "builtUpArea", "请求报文中未包含builtUpArea节点");
+        Assert.jsonObjectHaveKey(pd.getReqData(), "state", "请求报文中未包含state节点");
+        Assert.jsonObjectHaveKey(pd.getReqData(), "unitPrice", "请求报文中未包含unitPrice节点");
+        JSONObject reqJson = JSONObject.parseObject(pd.getReqData());
+
+        Assert.hasLength(reqJson.getString("communityId"), "小区ID不能为空");
+        Assert.isInteger(reqJson.getString("section"), "房间数不是有效数字");
+        Assert.isMoney(reqJson.getString("builtUpArea"), "建筑面积数据格式错误");
+        Assert.isMoney(reqJson.getString("unitPrice"), "房屋单价数据格式错误");
+
+        if (!"1010".equals(reqJson.getString("apartment")) && !"2020".equals(reqJson.getString("apartment"))) {
+            throw new IllegalArgumentException("不是有效房屋户型 传入数据错误");
+        }
+
+        if (!"2001".equals(reqJson.getString("state"))
+                && !"2002".equals(reqJson.getString("state"))
+                && !"2003".equals(reqJson.getString("state"))
+                && !"2004".equals(reqJson.getString("state"))) {
+            throw new IllegalArgumentException("不是有效房屋状态 传入数据错误");
+        }
+
+    }
+
+
+
+
+    public RestTemplate getRestTemplate() {
+        return restTemplate;
+    }
+
+    public void setRestTemplate(RestTemplate restTemplate) {
+        this.restTemplate = restTemplate;
+    }
+}

+ 27 - 0
WebService/src/main/resources/components/config-property-fee/configPropertyFee.html

@@ -0,0 +1,27 @@
+ <div id = "configPropertyFeeModel" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true" >
+    <div class="modal-dialog modal-lg">
+        <div class="modal-content">
+            <div class="modal-body">
+                <h3 class="m-t-none m-b ">编辑物业费</h3>
+                <div class="ibox-content">
+                    <div>
+                        <div>
+                            <div class="form-group row">
+                                <label class="col-sm-2 col-form-label">每平米单价</label>
+                                <div class="col-sm-10"><input v-model="changeFeeConfigInfo.squarePrice" type="text" placeholder="必填,请填写房屋每平米的物业费单价" class="form-control"></div>
+                            </div>
+                            <div class="form-group row">
+                                <label class="col-sm-2 col-form-label">附加费用</label>
+                                <div class="col-sm-10"><input v-model="changeFeeConfigInfo.additionalAmount" type="text" placeholder="必填,请填写附加费" class="form-control"></div>
+                            </div>
+                            <div class="ibox-content">
+                                <button class="btn btn-primary float-right" type="button" v-on:click="savePropertyConfigFee()" ><i class="fa fa-check"></i>&nbsp;保存</button>
+                                <button type="button" class="btn btn-warning float-right" style="margin-right:20px;" data-dismiss="modal">取消</button>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>

+ 89 - 0
WebService/src/main/resources/components/config-property-fee/configPropertyFee.js

@@ -0,0 +1,89 @@
+(function(vc,vm){
+
+    vc.extends({
+        data:{
+            changeFeeConfigInfo:{
+                configId:"",
+                squarePrice:"",
+                additionalAmount:"0.00"
+            }
+        },
+         _initMethod:function(){
+
+         },
+         _initEvent:function(){
+             vc.on('configPropertyFee','openConfigPropertyFeeModel',function(_params){
+                vc.copyObject(_params, vc.component.changeFeeConfigInfo);
+                $('#configPropertyFeeModel').modal('show');
+            });
+        },
+        methods:{
+            /**
+                根据楼ID加载房屋
+            **/
+
+            changeFeeConfigValidate:function(){
+                        return vc.validate.validate({
+                            changeFeeConfigInfo:vc.component.changeFeeConfigInfo
+                        },{
+                            'changeFeeConfigInfo.squarePrice':[
+                                {
+                                    limit:"required",
+                                    param:"",
+                                    errInfo:"房屋每平米单价不能为空"
+                                },
+                                {
+                                    limit:"money",
+                                    param:"",
+                                    errInfo:"必须是金额,如300.00"
+                                }
+                            ],
+                            'changeFeeConfigInfo.additionalAmount':[
+                                {
+                                    limit:"required",
+                                    param:"",
+                                    errInfo:"附加费不能为空"
+                                },
+                                {
+                                    limit:"money",
+                                    param:"",
+                                    errInfo:"必须是金额,如300.00"
+                                },
+                            ],
+
+
+                        });
+             },
+            savePropertyConfigFee:function(){
+                if(!vc.component.changeFeeConfigValidate()){
+                    vc.message(vc.validate.errInfo);
+                    return ;
+                }
+                vc.component.changeFeeConfigInfo.communityId = vc.getCurrentCommunity().communityId;
+                vc.http.post(
+                    'configPropertyFee',
+                    'change',
+                    JSON.stringify(vc.component.changeFeeConfigInfo),
+                    {
+                        emulateJSON:true
+                     },
+                     function(json,res){
+                        //vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
+                        if(res.status == 200){
+                            //关闭model
+                            $('#configPropertyFeeModel').modal('hide');
+                            vc.emit('viewPropertyFeeConfig','loadPropertyConfigFee',{});
+                            return ;
+                        }
+                        vc.message(json);
+                     },
+                     function(errInfo,error){
+                        console.log('请求失败处理');
+
+                        vc.message(errInfo);
+                     });
+            }
+        }
+    });
+
+})(window.vc,window.vc.component);

+ 30 - 0
WebService/src/main/resources/components/view-property-fee-config/viewPropertyFeeConfig.html

@@ -0,0 +1,30 @@
+<div class="row">
+    <div class="col-lg-12">
+        <div class="ibox ">
+            <div class="ibox-title">
+                <h5>物业费初始化信息</h5>
+                <div class="ibox-tools" style="top:10px;">
+                    <button type="button" class="btn btn-primary btn-sm" v-on:click="openConfigPropertyFeeModel()">
+                        <i class="glyphicon glyphicon-plus"></i> 编辑</button>
+                </div>
+            </div>
+            <div class="ibox-content">
+                <div class="row">
+                        <div class="form-group row">
+                            <label class="col-sm-2 col-form-label">物业费配置ID:</label>
+                            <div class="col-sm-10">{{feeConfigInfo.configId}}</div>
+                        </div>
+                        <div class="form-group row">
+                            <label class="col-sm-2 col-form-label">每平米单价:</label>
+                            <div class="col-sm-10">{{feeConfigInfo.squarePrice}} 元</div>
+                        </div>
+                        <div class="form-group row">
+                            <label class="col-sm-2 col-form-label">附加费用:</label>
+                            <div class="col-sm-10">{{feeConfigInfo.additionalAmount}} 元</div>
+                        </div>
+                </div>
+            </div>
+        </div>
+    </div>
+    <vc:create name="configPropertyFee"></vc:create>
+</div>

+ 58 - 0
WebService/src/main/resources/components/view-property-fee-config/viewPropertyFeeConfig.js

@@ -0,0 +1,58 @@
+/**
+    权限组
+**/
+(function(vc){
+
+    vc.extends({
+        data:{
+            feeConfigInfo:{
+                configId:"",
+                squarePrice:"",
+                additionalAmount:""
+            }
+        },
+        _initMethod:function(){
+                vc.component.loadPropertyConfigFee();
+        },
+        _initEvent:function(){
+            vc.on('viewPropertyFeeConfig','loadPropertyConfigFee',function(){
+                vc.component.loadPropertyConfigFee();
+            });
+
+        },
+        methods:{
+
+            openConfigPropertyFeeModel:function(){
+                vc.emit('configPropertyFee','openConfigPropertyFeeModel',feeConfigInfo);
+            },
+            loadPropertyConfigFee:function(){
+                var param = {
+                    params:{
+                        communityId:vc.getCurrentCommunity().communityId,
+                        configId:feeConfigInfo.configId
+                    }
+                };
+                vc.http.get(
+                    'viewPropertyFeeConfig',
+                    'loadData',
+                     param,
+                     function(json,res){
+                        //vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
+                        if(res.status == 200){
+                            //关闭model
+                            vc.copyObject(JSON.parse(json), vc.component.feeConfigInfo);
+                            return ;
+                        }
+                        vc.message(json);
+                     },
+                     function(errInfo,error){
+                        console.log('请求失败处理');
+
+                        vc.message(errInfo);
+                     });
+            }
+
+        }
+    });
+
+})(window.vc);

+ 33 - 0
WebService/src/main/resources/views/propertyFeeConfigFlow.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 - 0
java110-common/src/main/java/com/java110/common/constant/PrivilegeCodeConstant.java

@@ -32,4 +32,7 @@ public final class PrivilegeCodeConstant {
 
     //出售房屋权限
     public static final String PRIVILEGE_OWNER_ROOM = "500201904015";
+
+    //物业费用配置权限
+    public static final String PRIVILEGE_PROPERTY_CONFIG_FEE = "500201904016";
 }