wuxw
2019-07-31 567e0527be8d48ca5fd5856c09023f61a4a0ed04
添加房屋功能测试bug优化
15个文件已修改
2 文件已重命名
12个文件已添加
985 ■■■■ 已修改文件
WebService/src/main/java/com/java110/web/components/floor/ChooseFloorComponent.java 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/java/com/java110/web/components/unit/ChooseUnitComponent.java 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/java/com/java110/web/smo/impl/FloorServiceSMOImpl.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/floorPackage/add-floor/addFloor.html 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/floorPackage/add-floor/addFloor.js 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/floorPackage/choose-floor/chooseFloor.html 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/floorPackage/choose-floor/chooseFloor.js 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/floorPackage/floor-manage/listFloor.html 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/floorPackage/view-floor-info/viewFloorInfo.html 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/floorPackage/view-floor-info/viewFloorInfo.js 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/roomPackage/addRoomBinding/addRoomBinding.js 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/roomPackage/addRoomView/addRoomView.html 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/roomPackage/addRoomView/addRoomView.js 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/unitPackage/add-unit/addUnit.js 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/unitPackage/choose-unit/chooseUnit.html 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/unitPackage/choose-unit/chooseUnit.js 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/unitPackage/view-unit-info/viewUnitInfo.html 58 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/unitPackage/view-unit-info/viewUnitInfo.js 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/views/addRoomBindingFlow.html 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-code-generator/src/main/java/com/java110/code/relationship/GeneratorBindingComponent.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-code-generator/src/main/java/com/java110/code/web/GeneratorViewComponent.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-code-generator/src/main/resources/relationship/flow.html 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-code-generator/src/main/resources/web/add/add.js 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-code-generator/src/main/resources/web/choose/ChooseComponent.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-code-generator/src/main/resources/web/manage/manage.html 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-code-generator/src/main/resources/web/template_1.json 141 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-code-generator/src/main/resources/web/template_service.json 148 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-code-generator/src/main/resources/web/template_unit.json 58 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-code-generator/src/main/resources/web/view/viewInfo.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/java/com/java110/web/components/floor/ChooseFloorComponent.java
New file
@@ -0,0 +1,41 @@
package com.java110.web.components.floor;
import com.java110.core.context.IPageData;
import com.java110.web.smo.IFloorServiceSMO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
/**
 * 应用组件管理类
 * <p>
 * add by wuxw
 * <p>
 * 2019-06-29
 */
@Component("chooseFloor")
public class ChooseFloorComponent {
    @Autowired
    private IFloorServiceSMO listFloorsSMOImpl;
    /**
     * 查询应用列表
     *
     * @param pd 页面数据封装
     * @return 返回 ResponseEntity 对象
     */
    public ResponseEntity<String> list(IPageData pd) {
        return listFloorsSMOImpl.listFloor(pd);
    }
    public IFloorServiceSMO getListFloorsSMOImpl() {
        return listFloorsSMOImpl;
    }
    public void setListFloorsSMOImpl(IFloorServiceSMO listFloorsSMOImpl) {
        this.listFloorsSMOImpl = listFloorsSMOImpl;
    }
}
WebService/src/main/java/com/java110/web/components/unit/ChooseUnitComponent.java
New file
@@ -0,0 +1,42 @@
package com.java110.web.components.unit;
import com.java110.core.context.IPageData;
import com.java110.web.smo.IUnitServiceSMO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
/**
 * 应用组件管理类
 * <p>
 * add by wuxw
 * <p>
 * 2019-06-29
 */
@Component("chooseUnit")
public class ChooseUnitComponent {
    @Autowired
    private IUnitServiceSMO listUnitsSMOImpl;
    /**
     * 查询应用列表
     *
     * @param pd 页面数据封装
     * @return 返回 ResponseEntity 对象
     */
    public ResponseEntity<String> list(IPageData pd) {
        return listUnitsSMOImpl.listUnits(pd);
    }
    public IUnitServiceSMO getListUnitsSMOImpl() {
        return listUnitsSMOImpl;
    }
    public void setListUnitsSMOImpl(IUnitServiceSMO listUnitsSMOImpl) {
        this.listUnitsSMOImpl = listUnitsSMOImpl;
    }
}
WebService/src/main/java/com/java110/web/smo/impl/FloorServiceSMOImpl.java
@@ -43,10 +43,12 @@
     */
    @Override
    public ResponseEntity<String> listFloor(IPageData pd) {
        validateListFloor(pd);
        JSONObject paramIn = JSONObject.parseObject(pd.getReqData());
        if(paramIn.containsKey("row")){
            paramIn.put("rows",paramIn.getString("row"));
        }
        validateListFloor(pd,paramIn);
        int page = Integer.parseInt(paramIn.getString("page"));
        int rows = Integer.parseInt(paramIn.getString("rows"));
        String communityId = paramIn.getString("communityId");
@@ -223,11 +225,11 @@
     *
     * @param pd 页面封装对象
     */
    private void validateListFloor(IPageData pd) {
        Assert.jsonObjectHaveKey(pd.getReqData(), "page", "请求报文中未包含page节点");
        Assert.jsonObjectHaveKey(pd.getReqData(), "rows", "请求报文中未包含rows节点");
        Assert.jsonObjectHaveKey(pd.getReqData(), "communityId", "请求报文中未包含communityId节点");
        JSONObject paramIn = JSONObject.parseObject(pd.getReqData());
    private void validateListFloor(IPageData pd, JSONObject paramIn) {
        Assert.jsonObjectHaveKey(paramIn, "page", "请求报文中未包含page节点");
        Assert.jsonObjectHaveKey(paramIn, "rows", "请求报文中未包含rows节点");
        Assert.jsonObjectHaveKey(paramIn, "communityId", "请求报文中未包含communityId节点");
        //JSONObject paramIn = JSONObject.parseObject(pd.getReqData());
        Assert.isInteger(paramIn.getString("page"), "page不是数字");
        Assert.isInteger(paramIn.getString("rows"), "rows不是数字");
        Assert.hasLength(paramIn.getString("communityId"), "小区ID不能为空");
WebService/src/main/resources/components/floorPackage/add-floor/addFloor.html
@@ -13,7 +13,7 @@
                            </div>
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label">楼编号</label>
                                <div class="col-sm-10"><input v-model="addFloorInfo.floorNum" type="email" placeholder="必填,请填写编号" class="form-control"></div>
                                <div class="col-sm-10"><input v-model="addFloorInfo.floorNum" type="text" placeholder="必填,请填写编号" class="form-control"></div>
                            </div>
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label">备注</label>
WebService/src/main/resources/components/floorPackage/add-floor/addFloor.js
@@ -1,6 +1,10 @@
(function(vc){
    vc.extends({
        propTypes: {
                   callBackListener:vc.propTypes.string, //父组件名称
                   callBackFunction:vc.propTypes.string //父组件监听方法
        },
        data:{
            addFloorInfo:{
                name:'',
@@ -59,14 +63,21 @@
            },
            saveFloorInfo:function(){
                if(!vc.component.addFloorValidate()){
                    vc.component.addFloorInfo.errorInfo = vc.validate.errInfo;
                    vc.message(vc.validate.errInfo);
                    return ;
                }
                vc.component.addFloorInfo.errorInfo = "";
                vc.component.addFloorInfo.communityId = vc.getCurrentCommunity().communityId;
                //不提交数据将数据 回调给侦听处理
                if(vc.notNull($props.callBackListener)){
                    vc.emit($props.callBackListener,$props.callBackFunction,vc.component.addFloorInfo);
                    $('#addFloorModel').modal('hide');
                    return ;
                }
                vc.http.post(
                    'addFloor',
                    'saveFloor',
WebService/src/main/resources/components/floorPackage/choose-floor/chooseFloor.html
New file
@@ -0,0 +1,60 @@
<div id = "chooseFloorModel" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="chooseFloorModelLabel" aria-hidden="true" >
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <h3 class="modal-title" id="chooseFloorModelLabel">选择楼</h3>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">
                <div class=" row">
                    <div class="col-lg-12">
                        <div class="ibox ">
                            <div class="row">
                                <div class="col-sm-7 m-b-xs">
                                </div>
                                <div class="col-sm-5">
                                    <div class="input-group">
                                        <input placeholder="输入楼名称" type="text" v-model="chooseFloorInfo._currentFloorName" class="form-control form-control-sm">
                                        <span class="input-group-append">
                                                <button type="button" class="btn btn-sm btn-primary" v-on:click="queryFloors()">查询</button>
                                            </span>
                                    </div>
                                </div>
                            </div>
                            <div class="table-responsive" style="margin-top:15px">
                                <table class="table table-striped">
                                    <thead>
                                        <tr>
                                                                        <th class="text-center">楼ID</th>
                            <th class="text-center">楼名称</th>
                            <th class="text-center">楼编号</th>
                            <th class="text-center">备注</th>
                            <th class="text-center">操作</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr v-for="floor in chooseFloorInfo.floors">
                                                                        <td class="text-center">{{floor.floorId}}</td>
                            <td class="text-center">{{floor.floorName}}</td>
                            <td class="text-center">{{floor.floorNum}}</td>
                            <td class="text-center">{{floor.remark}}</td>
                                            <td>
                                                <button class="btn btn-primary btn-xs" v-on:click="chooseFloor(floor)">选择</button>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
WebService/src/main/resources/components/floorPackage/choose-floor/chooseFloor.js
New file
@@ -0,0 +1,61 @@
(function(vc){
    vc.extends({
        propTypes: {
           emitChooseFloor:vc.propTypes.string,
           emitLoadData:vc.propTypes.string
        },
        data:{
            chooseFloorInfo:{
                floors:[],
                _currentFloorName:'',
            }
        },
        _initMethod:function(){
        },
        _initEvent:function(){
            vc.on('chooseFloor','openChooseFloorModel',function(_param){
                $('#chooseFloorModel').modal('show');
                vc.component._refreshChooseFloorInfo();
                vc.component._loadAllFloorInfo(1,10,'');
            });
        },
        methods:{
            _loadAllFloorInfo:function(_page,_row,_name){
                var param = {
                    params:{
                        page:_page,
                        row:_row,
                        communityId:vc.getCurrentCommunity().communityId,
                        name:_name
                    }
                };
                //发送get请求
               vc.http.get('chooseFloor',
                            'list',
                             param,
                             function(json){
                                var _floorInfo = JSON.parse(json);
                                vc.component.chooseFloorInfo.floors = _floorInfo.apiFloorDataVoList;
                             },function(){
                                console.log('请求失败处理');
                             }
                           );
            },
            chooseFloor:function(_floor){
                vc.emit($props.emitChooseFloor,'chooseFloor',_floor);
                vc.emit($props.emitLoadData,'listFloorData',{
                    floorId:_floor.floorId
                });
                $('#chooseFloorModel').modal('hide');
            },
            queryFloors:function(){
                vc.component._loadAllFloorInfo(1,10,vc.component.chooseFloorInfo._currentFloorName);
            },
            _refreshChooseFloorInfo:function(){
                vc.component.chooseFloorInfo._currentFloorName = "";
            }
        }
    });
})(window.vc);
WebService/src/main/resources/components/floorPackage/floor-manage/listFloor.html
@@ -68,7 +68,10 @@
        </div>
    </div>
    <vc:create name="addFloor"></vc:create>
    <vc:create name="addFloor"
               callBackListener=""
               callBackFunction=""
    ></vc:create>
    <vc:create name="editFloor"></vc:create>
    <vc:create name="deleteFloor"></vc:create>
WebService/src/main/resources/components/floorPackage/view-floor-info/viewFloorInfo.html
New file
@@ -0,0 +1,50 @@
<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" v-if="viewFloorInfo.index != 2" class="btn btn-primary btn-sm" style="margin-right:10px;"  v-on:click="_openSelectFloorInfoModel()">
                        <i class="glyphicon glyphicon-search"></i> 选择楼</button>
                    <button type="button" v-if="viewFloorInfo.index != 2" class="btn btn-primary btn-sm" v-on:click="_openAddFloorInfoModel()">
                        <i class="glyphicon glyphicon-plus"></i> 添加楼</button>
                </div>
            </div>
            <div class="ibox-content">
                <div class="row">
<div class="col-sm-4">
                        <div class="form-group">
                            <label class="col-form-label" >楼名称:</label>
                            <label class="">{{viewFloorInfo.name}}</label>
                        </div>
</div>
<div class="col-sm-4">
                        <div class="form-group">
                            <label class="col-form-label" >楼编号:</label>
                            <label class="">{{viewFloorInfo.floorNum}}</label>
                        </div>
</div>
<div class="col-sm-4">
                        <div class="form-group">
                            <label class="col-form-label" >备注:</label>
                            <label class="">{{viewFloorInfo.remark}}</label>
                        </div>
</div>
</div>
            </div>
        </div>
    </div>
    <vc:create name="addFloor"
               callBackListener="viewFloorInfo"
               callBackFunction="chooseFloor"
    ></vc:create>
    <vc:create name="chooseFloor"
               emitChooseFloor="viewFloorInfo"
               emitLoadData="viewFloorInfo"
    ></vc:create>
</div>
WebService/src/main/resources/components/floorPackage/view-floor-info/viewFloorInfo.js
New file
@@ -0,0 +1,50 @@
/**
    楼 组件
**/
(function(vc){
    vc.extends({
        propTypes: {
           callBackListener:vc.propTypes.string, //父组件名称
           callBackFunction:vc.propTypes.string //父组件监听方法
        },
        data:{
            viewFloorInfo:{
                index:0,
                flowComponent:'viewFloorInfo',
                name:'',
floorNum:'',
remark:'',
            }
        },
        _initMethod:function(){
            //根据请求参数查询 查询 业主信息
            vc.component._loadFloorInfoData();
        },
        _initEvent:function(){
            vc.on('viewFloorInfo','chooseFloor',function(_app){
                vc.copyObject(_app, vc.component.viewFloorInfo);
                vc.emit($props.callBackListener,$props.callBackFunction,vc.component.viewFloorInfo);
            });
            vc.on('viewFloorInfo', 'onIndex', function(_index){
                vc.component.viewFloorInfo.index = _index;
            });
        },
        methods:{
            _openSelectFloorInfoModel(){
                vc.emit('chooseFloor','openChooseFloorModel',{});
            },
            _openAddFloorInfoModel(){
                vc.emit('addFloor','openAddFloorModal',{});
            },
            _loadFloorInfoData:function(){
            }
        }
    });
})(window.vc);
WebService/src/main/resources/components/roomPackage/addRoomBinding/addRoomBinding.js
@@ -33,9 +33,9 @@
                vc.component.addRoomBindingInfo.$step.prevStep();
                vc.component.addRoomBindingInfo.index = vc.component.addRoomBindingInfo.$step.getIndex();
                vc.emit('viewFloorInfo', 'onIndex', vc.component.serviceBindingInfo.index);
vc.emit('viewUnitInfo', 'onIndex', vc.component.serviceBindingInfo.index);
vc.emit('addRoomView', 'onIndex', vc.component.serviceBindingInfo.index);
                vc.emit('viewFloorInfo', 'onIndex', vc.component.addRoomBindingInfo.index);
vc.emit('viewUnitInfo', 'onIndex', vc.component.addRoomBindingInfo.index);
vc.emit('addRoomView', 'onIndex', vc.component.addRoomBindingInfo.index);
            },
            _nextStep:function(){
@@ -47,9 +47,9 @@
                vc.component.addRoomBindingInfo.$step.nextStep();
                vc.component.addRoomBindingInfo.index = vc.component.addRoomBindingInfo.$step.getIndex();
                 vc.emit('viewFloorInfo', 'onIndex', vc.component.serviceBindingInfo.index);
vc.emit('viewUnitInfo', 'onIndex', vc.component.serviceBindingInfo.index);
vc.emit('addRoomView', 'onIndex', vc.component.serviceBindingInfo.index);
                 vc.emit('viewFloorInfo', 'onIndex', vc.component.addRoomBindingInfo.index);
vc.emit('viewUnitInfo', 'onIndex', vc.component.addRoomBindingInfo.index);
vc.emit('addRoomView', 'onIndex', vc.component.addRoomBindingInfo.index);
            },
            _finishStep:function(){
WebService/src/main/resources/components/roomPackage/addRoomView/addRoomView.html
WebService/src/main/resources/components/roomPackage/addRoomView/addRoomView.js
WebService/src/main/resources/components/unitPackage/add-unit/addUnit.js
@@ -1,6 +1,10 @@
(function(vc,vm){
    vc.extends({
        propTypes: {
                   callBackListener:vc.propTypes.string, //父组件名称
                   callBackFunction:vc.propTypes.string //父组件监听方法
        },
        data:{
            addUnitInfo:{
                floorId:'',
@@ -15,6 +19,12 @@
         },
         _initEvent:function(){
             vc.on('addUnit','openAddUnitModal',function(_params){
                 vc.component.refreshAddUnitInfo();
                $('#addUnitModel').modal('show');
                vc.component.addUnitInfo.floorId = _params.floorId;
                vc.component.addUnitInfo.communityId = vc.getCurrentCommunity().communityId;
             });
             vc.on('addUnit','addUnitModel',function(_params){
                vc.component.refreshAddUnitInfo();
                $('#addUnitModel').modal('show');
@@ -81,6 +91,15 @@
                    return ;
                }
                 vc.component.addUnitInfo.communityId = vc.getCurrentCommunity().communityId;
                //不提交数据将数据 回调给侦听处理
                if(vc.notNull($props.callBackListener)){
                    vc.emit($props.callBackListener,$props.callBackFunction,vc.component.addUnitInfo);
                    $('#addUnitModel').modal('hide');
                    return ;
                }
                vc.http.post(
                    'addUnit',
                    'save',
WebService/src/main/resources/components/unitPackage/choose-unit/chooseUnit.html
New file
@@ -0,0 +1,62 @@
<div id = "chooseUnitModel" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="chooseUnitModelLabel" aria-hidden="true" >
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <h3 class="modal-title" id="chooseUnitModelLabel">选择单元</h3>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">
                <div class=" row">
                    <div class="col-lg-12">
                        <div class="ibox ">
                            <div class="row">
                                <div class="col-sm-7 m-b-xs">
                                </div>
                                <div class="col-sm-5">
                                    <div class="input-group">
                                        <input placeholder="输入单元名称" type="text" v-model="chooseUnitInfo._currentUnitName" class="form-control form-control-sm">
                                        <span class="input-group-append">
                                                <button type="button" class="btn btn-sm btn-primary" v-on:click="queryUnits()">查询</button>
                                            </span>
                                    </div>
                                </div>
                            </div>
                            <div class="table-responsive" style="margin-top:15px">
                                <table class="table table-striped">
                                    <thead>
                                        <tr>
                                                                        <th class="text-center">单元ID</th>
                            <th class="text-center">单元编号</th>
                            <th class="text-center">总层数</th>
                            <th class="text-center">电梯</th>
                            <th class="text-center">备注</th>
                            <th class="text-center">操作</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr v-for="unit in chooseUnitInfo.units">
                                                                        <td class="text-center">{{unit.unitId}}</td>
                            <td class="text-center">{{unit.unitNum}}</td>
                            <td class="text-center">{{unit.layerCount}}</td>
                            <td class="text-center">{{unit.lift}}</td>
                            <td class="text-center">{{unit.remark}}</td>
                                            <td>
                                                <button class="btn btn-primary btn-xs" v-on:click="chooseUnit(unit)">选择</button>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
WebService/src/main/resources/components/unitPackage/choose-unit/chooseUnit.js
New file
@@ -0,0 +1,61 @@
(function(vc){
    vc.extends({
        propTypes: {
           emitChooseUnit:vc.propTypes.string,
           emitLoadData:vc.propTypes.string
        },
        data:{
            chooseUnitInfo:{
                units:[],
                _currentUnitName:'',
            }
        },
        _initMethod:function(){
        },
        _initEvent:function(){
            vc.on('chooseUnit','openChooseUnitModel',function(_param){
                $('#chooseUnitModel').modal('show');
                vc.component._refreshChooseUnitInfo();
                vc.component._loadAllUnitInfo(1,10,'');
            });
        },
        methods:{
            _loadAllUnitInfo:function(_page,_row,_name){
                var param = {
                    params:{
                        page:_page,
                        row:_row,
                        communityId:vc.getCurrentCommunity().communityId,
                        name:_name
                    }
                };
                //发送get请求
               vc.http.get('chooseUnit',
                            'list',
                             param,
                             function(json){
                                var _unitInfo = JSON.parse(json);
                                vc.component.chooseUnitInfo.units = _unitInfo.units;
                             },function(){
                                console.log('请求失败处理');
                             }
                           );
            },
            chooseUnit:function(_unit){
                vc.emit($props.emitChooseUnit,'chooseUnit',_unit);
                vc.emit($props.emitLoadData,'listUnitData',{
                    unitId:_unit.unitId
                });
                $('#chooseUnitModel').modal('hide');
            },
            queryUnits:function(){
                vc.component._loadAllUnitInfo(1,10,vc.component.chooseUnitInfo._currentUnitName);
            },
            _refreshChooseUnitInfo:function(){
                vc.component.chooseUnitInfo._currentUnitName = "";
            }
        }
    });
})(window.vc);
WebService/src/main/resources/components/unitPackage/view-unit-info/viewUnitInfo.html
New file
@@ -0,0 +1,58 @@
<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" v-if="viewUnitInfo.index != 2" class="btn btn-primary btn-sm" style="margin-right:10px;"  v-on:click="_openSelectUnitInfoModel()">
                        <i class="glyphicon glyphicon-search"></i> 选择单元</button>
                    <button type="button" v-if="viewUnitInfo.index != 2" class="btn btn-primary btn-sm" v-on:click="_openAddUnitInfoModel()">
                        <i class="glyphicon glyphicon-plus"></i> 添加单元</button>
                </div>
            </div>
            <div class="ibox-content">
                <div class="row">
<div class="col-sm-4">
                        <div class="form-group">
                            <label class="col-form-label" >单元编号:</label>
                            <label class="">{{viewUnitInfo.unitNum}}</label>
                        </div>
</div>
<div class="col-sm-4">
                        <div class="form-group">
                            <label class="col-form-label" >总层数:</label>
                            <label class="">{{viewUnitInfo.layerCount}}</label>
                        </div>
</div>
<div class="col-sm-4">
                        <div class="form-group">
                            <label class="col-form-label" >电梯:</label>
                            <label class="">{{viewUnitInfo.lift}}</label>
                        </div>
</div>
</div>
<div class="row">
<div class="col-sm-4">
                        <div class="form-group">
                            <label class="col-form-label" >备注:</label>
                            <label class="">{{viewUnitInfo.remark}}</label>
                        </div>
</div>
</div>
            </div>
        </div>
    </div>
    <vc:create name="addUnit"
               callBackListener="viewUnitInfo"
               callBackFunction="chooseUnit"
    ></vc:create>
    <vc:create name="chooseUnit"
               emitChooseUnit="viewUnitInfo"
               emitLoadData="viewUnitInfo"
    ></vc:create>
</div>
WebService/src/main/resources/components/unitPackage/view-unit-info/viewUnitInfo.js
New file
@@ -0,0 +1,51 @@
/**
    单元 组件
**/
(function(vc){
    vc.extends({
        propTypes: {
           callBackListener:vc.propTypes.string, //父组件名称
           callBackFunction:vc.propTypes.string //父组件监听方法
        },
        data:{
            viewUnitInfo:{
                index:0,
                flowComponent:'viewUnitInfo',
                unitNum:'',
layerCount:'',
lift:'',
remark:'',
            }
        },
        _initMethod:function(){
            //根据请求参数查询 查询 业主信息
            vc.component._loadUnitInfoData();
        },
        _initEvent:function(){
            vc.on('viewUnitInfo','chooseUnit',function(_app){
                vc.copyObject(_app, vc.component.viewUnitInfo);
                vc.emit($props.callBackListener,$props.callBackFunction,vc.component.viewUnitInfo);
            });
            vc.on('viewUnitInfo', 'onIndex', function(_index){
                vc.component.viewUnitInfo.index = _index;
            });
        },
        methods:{
            _openSelectUnitInfoModel(){
                vc.emit('chooseUnit','openChooseUnitModel',{});
            },
            _openAddUnitInfoModel(){
                vc.emit('addUnit','openAddUnitModal',{});
            },
            _loadUnitInfoData:function(){
            }
        }
    });
})(window.vc);
WebService/src/main/resources/views/addRoomBindingFlow.html
@@ -7,6 +7,8 @@
    <meta charset="UTF-8"/>
    <title>添加房屋|java110</title>
    <vc:create name="commonTop"></vc:create>
    <link href="/css/jquery.step.css" rel="stylesheet"/>
    <script src="/js/jquery.step.min.js" ></script>
</head>
<body>
<vc:create name="bodyTop"></vc:create>
java110-code-generator/src/main/java/com/java110/code/relationship/GeneratorBindingComponent.java
@@ -86,7 +86,7 @@
        String writePath = this.getClass().getResource("/").getPath()
                + "out/relationship/component/" + _currentObj.getString("package") + "/" + _currentObj.getString("templateCode") + "View/" + toUpperCaseFirstOne(_currentObj.getString("templateCode")) + "View.html";
                + "out/relationship/component/" + _currentObj.getString("package") + "/" + _currentObj.getString("templateCode") + "View/" + _currentObj.getString("templateCode") + "View.html";
        System.out.printf("writePath: " + writePath);
        writeFile(writePath,
                fileContext);
@@ -148,7 +148,7 @@
        String writePath = this.getClass().getResource("/").getPath()
                + "out/relationship/component/" + _currentObj.getString("package") + "/" + _currentObj.getString("templateCode") + "View/" + toUpperCaseFirstOne(_currentObj.getString("templateCode")) + "View.js";
                + "out/relationship/component/" + _currentObj.getString("package") + "/" + _currentObj.getString("templateCode") + "View/" + _currentObj.getString("templateCode") + "View.js";
        System.out.printf("writePath: " + writePath);
        writeFile(writePath,
                fileContext);
@@ -256,7 +256,7 @@
            }
            validateInfo.append("vc.emit('" + flow.getString("vcName") + "', 'onIndex', vc.component.serviceBindingInfo.index);\n");
            validateInfo.append("vc.emit('" + flow.getString("vcName") + "', 'onIndex', vc.component."+data.getString("templateCode")+"Info.index);\n");
            //如果相应组件不存在,则根据组件配置自动生成
            if (!flow.getBoolean("existsComponent")) {
java110-code-generator/src/main/java/com/java110/code/web/GeneratorViewComponent.java
@@ -43,7 +43,7 @@
            thSb.append("<div class=\"col-sm-4\">\n" +
                    "                        <div class=\"form-group\">\n" +
                    "                            <label class=\"col-form-label\" >"+column.getString("cnCode")+":</label>\n" +
                    "                            <label class=\"\">{{view"+toUpperCaseFirstOne(column.getString("code"))+"Info."+column.getString("code")+"Id}}</label>\n" +
                    "                            <label class=\"\">{{view"+toUpperCaseFirstOne(data.getString("templateCode"))+"Info."+column.getString("code")+"}}</label>\n" +
                    "                        </div>\n" +
                    "</div>\n");
java110-code-generator/src/main/resources/relationship/flow.html
@@ -7,6 +7,8 @@
    <meta charset="UTF-8"/>
    <title>@@templateName@@|java110</title>
    <vc:create name="commonTop"></vc:create>
    <link href="/css/jquery.step.css" rel="stylesheet"/>
    <script src="/js/jquery.step.min.js" ></script>
</head>
<body>
<vc:create name="bodyTop"></vc:create>
java110-code-generator/src/main/resources/web/add/add.js
@@ -1,6 +1,10 @@
(function(vc){
    vc.extends({
        propTypes: {
               callBackListener:vc.propTypes.string, //父组件名称
               callBackFunction:vc.propTypes.string //父组件监听方法
        },
        data:{
            add@@TemplateCode@@Info:{
                @@templateCodeColumns@@
@@ -33,6 +37,12 @@
                }
                vc.component.add@@TemplateCode@@Info.communityId = vc.getCurrentCommunity().communityId;
                //不提交数据将数据 回调给侦听处理
                if(vc.notNull($props.callBackListener)){
                    vc.emit($props.callBackListener,$props.callBackFunction,vc.component.add@@TemplateCode@@Info);
                    $('#add@@TemplateCode@@Model').modal('hide');
                    return ;
                }
                vc.http.post(
                    'add@@TemplateCode@@',
java110-code-generator/src/main/resources/web/choose/ChooseComponent.java
@@ -16,7 +16,7 @@
 * 2019-06-29
 */
@Component("choose@@TemplateCode@@")
public class Choose@@TemplateCodeComponent {
public class Choose@@TemplateCode@@Component {
    @Autowired
    private IList@@TemplateCode@@sSMO list@@TemplateCode@@sSMOImpl;
java110-code-generator/src/main/resources/web/manage/manage.html
@@ -58,7 +58,10 @@
        </div>
    </div>
    <vc:create name="add@@TemplateCode@@"></vc:create>
    <vc:create name="add@@TemplateCode@@"
               callBackListener=""
               callBackFunction=""
    ></vc:create>
    <vc:create name="edit@@TemplateCode@@"></vc:create>
    <vc:create name="delete@@TemplateCode@@"></vc:create>
java110-code-generator/src/main/resources/web/template_1.json
@@ -1,147 +1,44 @@
{
  "templateName":"服务",
  "templateCode":"service",
  "templateKey":"serviceId",
  "templateKeyName":"服务ID",
  "searchCode": "name",
  "searchName": "服务名称",
  "templateName":"楼",
  "templateCode":"floor",
  "templateKey":"floorId",
  "templateKeyName":"楼ID",
  "searchCode": "floorNum",
  "searchName": "楼编号",
  "columns":[
    {
      "code":"name",
      "cnCode":"服务名称",
      "desc":"必填,请填写服务名称",
      "cnCode":"楼名称",
      "desc":"必填,请填写名称,如一号楼",
      "required":true,
      "hasDefaultValue":false,
      "inputType":"input",
      "limit":"maxLength",
      "limitParam":"50",
      "limitErrInfo":"服务名称不能超过50"
      "limitErrInfo":"楼名称不能超过50"
    },
    {
      "code":"serviceCode",
      "cnCode":"服务编码",
      "desc":"必填,请填写服务编码如 service.saveService",
      "code":"floorNum",
      "cnCode":"楼编号",
      "desc":"必填,请填写楼编号如 C_001",
      "required":true,
      "hasDefaultValue":false,
      "inputType":"input",
      "limit":"maxin",
      "limitParam":"2,50",
      "limitErrInfo":"服务编码必须在2至50字符之间"
      "limitParam":"1,12",
      "limitErrInfo":"楼编号必须在1至12字符之间"
    },
    {
      "code":"businessTypeCd",
      "cnCode":"秘钥",
      "desc":"可填,请填写秘钥,如果填写了需要加密传输",
      "required":true,
      "hasDefaultValue":true,
      "defaultValue":"API",
      "inputType":"none",
      "limit":"maxin",
      "limitParam":"2,4",
      "limitErrInfo":"业务类型必须为API"
    },
    {
      "code":"seq",
      "cnCode":"序列",
      "desc":"必填,请填写序列",
      "required":true,
      "hasDefaultValue":true,
      "defaultValue":"1",
      "inputType":"none",
      "limit":"maxLength",
      "limitParam":"1",
      "limitErrInfo":"序列格式错误"
    },
    {
      "code":"messageQueueName",
      "cnCode":"消息队列",
      "desc":"可填,请填写消息队列,订单在异步调用时使用",
      "code":"remark",
      "cnCode":"备注",
      "desc":"可填,请填写备注",
      "required":false,
      "hasDefaultValue":false,
      "defaultValue":"",
      "inputType":"input",
      "limit":"maxLength",
      "limitParam":"50",
      "limitErrInfo":"消息队列不能超过50"
    }
  ,
    {
      "code":"isInstance",
      "cnCode":"是否实例",
      "desc":"可填,请填写实例 Y 或N",
      "required":true,
      "hasDefaultValue":true,
      "defaultValue":"Y",
      "inputType":"input",
      "limit":"maxLength",
      "limitParam":"50",
      "limitErrInfo":"实例不能超过50"
    }
  ,
    {
      "code":"url",
      "cnCode":"调用地址",
      "desc":"可填,请填写调用地址",
      "required":false,
      "hasDefaultValue":true,
      "defaultValue":"http://order-service/orderApi/service",
      "inputType":"input",
      "inputType":"textarea",
      "limit":"maxLength",
      "limitParam":"200",
      "limitErrInfo":"调用地址不能超过200"
    },
    {
      "code":"method",
      "cnCode":"调用方式",
      "desc":"必填,请填写调用方式",
      "required":true,
      "hasDefaultValue":false,
      "inputType":"select",
      "selectValue":"GET,POST",
      "selectValueName":"http get,http post",
      "limit":"maxLength",
      "limitParam":"50",
      "limitErrInfo":"调用方式不能超过50"
    },
    {
      "code":"timeout",
      "cnCode":"超时时间",
      "desc":"必填,请填写超时时间",
      "required":true,
      "hasDefaultValue":true,
      "defaultValue":"60",
      "inputType":"input",
      "limit":"num",
      "limitParam":"",
      "limitErrInfo":"超时时间必须为数字"
    },
    {
      "code":"retryCount",
      "cnCode":"重试次数",
      "desc":"必填,请填写重试次数",
      "required":true,
      "hasDefaultValue":true,
      "defaultValue":"3",
      "inputType":"input",
      "limit":"num",
      "limitParam":"",
      "limitErrInfo":"重试次数必须为数字"
    },
    {
      "code":"provideAppId",
      "cnCode":"提供服务",
      "desc":"必填,请填写提供服务",
      "required":true,
      "hasDefaultValue":true,
      "defaultValue":"8000418002",
      "inputType":"none",
      "limit":"num",
      "limitParam":"",
      "limitErrInfo":"重试次数必须为数字"
      "limitErrInfo":"备注内容不能超过200"
    }
  ]
java110-code-generator/src/main/resources/web/template_service.json
New file
@@ -0,0 +1,148 @@
{
  "templateName":"服务",
  "templateCode":"service",
  "templateKey":"serviceId",
  "templateKeyName":"服务ID",
  "searchCode": "name",
  "searchName": "服务名称",
  "columns":[
    {
      "code":"name",
      "cnCode":"服务名称",
      "desc":"必填,请填写服务名称",
      "required":true,
      "hasDefaultValue":false,
      "inputType":"input",
      "limit":"maxLength",
      "limitParam":"50",
      "limitErrInfo":"服务名称不能超过50"
    },
    {
      "code":"serviceCode",
      "cnCode":"服务编码",
      "desc":"必填,请填写服务编码如 service.saveService",
      "required":true,
      "hasDefaultValue":false,
      "inputType":"input",
      "limit":"maxin",
      "limitParam":"2,50",
      "limitErrInfo":"服务编码必须在2至50字符之间"
    },
    {
      "code":"businessTypeCd",
      "cnCode":"秘钥",
      "desc":"可填,请填写秘钥,如果填写了需要加密传输",
      "required":true,
      "hasDefaultValue":true,
      "defaultValue":"API",
      "inputType":"none",
      "limit":"maxin",
      "limitParam":"2,4",
      "limitErrInfo":"业务类型必须为API"
    },
    {
      "code":"seq",
      "cnCode":"序列",
      "desc":"必填,请填写序列",
      "required":true,
      "hasDefaultValue":true,
      "defaultValue":"1",
      "inputType":"none",
      "limit":"maxLength",
      "limitParam":"1",
      "limitErrInfo":"序列格式错误"
    },
    {
      "code":"messageQueueName",
      "cnCode":"消息队列",
      "desc":"可填,请填写消息队列,订单在异步调用时使用",
      "required":false,
      "hasDefaultValue":false,
      "defaultValue":"",
      "inputType":"input",
      "limit":"maxLength",
      "limitParam":"50",
      "limitErrInfo":"消息队列不能超过50"
    }
  ,
    {
      "code":"isInstance",
      "cnCode":"是否实例",
      "desc":"可填,请填写实例 Y 或N",
      "required":true,
      "hasDefaultValue":true,
      "defaultValue":"Y",
      "inputType":"input",
      "limit":"maxLength",
      "limitParam":"50",
      "limitErrInfo":"实例不能超过50"
    }
  ,
    {
      "code":"url",
      "cnCode":"调用地址",
      "desc":"可填,请填写调用地址",
      "required":false,
      "hasDefaultValue":true,
      "defaultValue":"http://order-service/orderApi/service",
      "inputType":"input",
      "limit":"maxLength",
      "limitParam":"200",
      "limitErrInfo":"调用地址不能超过200"
    },
    {
      "code":"method",
      "cnCode":"调用方式",
      "desc":"必填,请填写调用方式",
      "required":true,
      "hasDefaultValue":false,
      "inputType":"select",
      "selectValue":"GET,POST",
      "selectValueName":"http get,http post",
      "limit":"maxLength",
      "limitParam":"50",
      "limitErrInfo":"调用方式不能超过50"
    },
    {
      "code":"timeout",
      "cnCode":"超时时间",
      "desc":"必填,请填写超时时间",
      "required":true,
      "hasDefaultValue":true,
      "defaultValue":"60",
      "inputType":"input",
      "limit":"num",
      "limitParam":"",
      "limitErrInfo":"超时时间必须为数字"
    },
    {
      "code":"retryCount",
      "cnCode":"重试次数",
      "desc":"必填,请填写重试次数",
      "required":true,
      "hasDefaultValue":true,
      "defaultValue":"3",
      "inputType":"input",
      "limit":"num",
      "limitParam":"",
      "limitErrInfo":"重试次数必须为数字"
    },
    {
      "code":"provideAppId",
      "cnCode":"提供服务",
      "desc":"必填,请填写提供服务",
      "required":true,
      "hasDefaultValue":true,
      "defaultValue":"8000418002",
      "inputType":"none",
      "limit":"num",
      "limitParam":"",
      "limitErrInfo":"重试次数必须为数字"
    }
  ]
}
java110-code-generator/src/main/resources/web/template_unit.json
New file
@@ -0,0 +1,58 @@
{
  "templateName":"单元",
  "templateCode":"unit",
  "templateKey":"unitId",
  "templateKeyName":"单元ID",
  "searchCode": "unitNum",
  "searchName": "单元编号",
  "columns":[
    {
      "code":"unitNum",
      "cnCode":"单元编号",
      "desc":"必填,请填写单元编号,如1",
      "required":true,
      "hasDefaultValue":false,
      "inputType":"input",
      "limit":"num",
      "limitParam":"",
      "limitErrInfo":"单元编号必须是数字"
    },
    {
      "code":"layerCount",
      "cnCode":"总层数",
      "desc":"必填,请填写单元总层数",
      "required":true,
      "hasDefaultValue":false,
      "inputType":"input",
      "limit":"num",
      "limitParam":"",
      "limitErrInfo":"单元总层数必须是数字"
    },
    {
      "code":"lift",
      "cnCode":"电梯",
      "desc":"必填,请选择是否有电梯",
      "required":true,
      "hasDefaultValue":false,
      "inputType":"select",
      "selectValue":"1010,2020",
      "selectValueName":"有,无",
      "limit":"maxLength",
      "limitParam":"10",
      "limitErrInfo":"电梯错误"
    },
    {
      "code":"remark",
      "cnCode":"备注",
      "desc":"可填,请填写备注",
      "required":false,
      "hasDefaultValue":false,
      "defaultValue":"",
      "inputType":"textarea",
      "limit":"maxLength",
      "limitParam":"200",
      "limitErrInfo":"备注内容不能超过200"
    }
  ]
}
java110-code-generator/src/main/resources/web/view/viewInfo.js
@@ -11,7 +11,7 @@
        data:{
            view@@TemplateCode@@Info:{
                index:0,
                flowComponent:'@@TemplateCode@@',
                flowComponent:'view@@TemplateCode@@Info',
                @@templateCodeColumns@@
            }
        },