wuxw лет назад: 7
Родитель
Сommit
bf468ffc41

+ 12 - 0
WebService/docker/docker-compose.yml

@@ -0,0 +1,12 @@
+version: '2'
+services:
+   communityserivce:
+       container_name: webserivce-1
+       build:
+          context: .
+          dockerfile: Dockerfile
+       restart: always
+       ports:
+       - "8443:443"
+       volumes:
+       - ../target/WebService.jar:/root/target/WebService.jar

+ 3 - 2
WebService/src/main/java/com/java110/web/WebServiceApplicationStart.java

@@ -32,7 +32,7 @@ import java.nio.charset.Charset;
  * @date 2016年8月6日
  * @tag
  */
-@SpringBootApplication(scanBasePackages={"com.java110.service","com.java110.web","com.java110.core","com.java110.cache"})
+@SpringBootApplication(scanBasePackages = {"com.java110.service", "com.java110.web", "com.java110.core", "com.java110.cache"})
 @EnableDiscoveryClient
 //@EnableConfigurationProperties(EventProperties.class)
 
@@ -40,6 +40,7 @@ public class WebServiceApplicationStart {
 
     /**
      * 实例化RestTemplate,通过@LoadBalanced注解开启均衡负载能力.
+     *
      * @return restTemplate
      */
     @Bean
@@ -51,7 +52,7 @@ public class WebServiceApplicationStart {
     }
 
 
-    public static void main(String[] args) throws Exception{
+    public static void main(String[] args) throws Exception {
         ApplicationContext context = SpringApplication.run(WebServiceApplicationStart.class, args);
         ServiceStartInit.initSystemConfig(context);
         VueComponentTemplate.initComponent(VueComponentTemplate.DEFAULT_COMPONENT_PACKAGE_PATH);

+ 41 - 0
WebService/src/main/java/com/java110/web/components/room/AddRoomComponent.java

@@ -0,0 +1,41 @@
+package com.java110.web.components.room;
+
+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;
+
+/**
+ * @ClassName AddRoomComponent
+ * @Description TODO 添加房屋
+ * @Author wuxw
+ * @Date 2019/5/6 20:23
+ * @Version 1.0
+ * add by wuxw 2019/5/6
+ **/
+@Component("addRoom")
+public class AddRoomComponent {
+
+    @Autowired
+    private IUnitServiceSMO unitServiceSMOImpl;
+
+    /**
+     * 根据 floorId 查询单元信息
+     *
+     * @param pd 包含floorId 和小区ID 页面封装对象
+     * @return 单元信息
+     */
+    public ResponseEntity<String> loadUnits(IPageData pd) {
+        return unitServiceSMOImpl.listUnits(pd);
+    }
+
+
+    public IUnitServiceSMO getUnitServiceSMOImpl() {
+        return unitServiceSMOImpl;
+    }
+
+    public void setUnitServiceSMOImpl(IUnitServiceSMO unitServiceSMOImpl) {
+        this.unitServiceSMOImpl = unitServiceSMOImpl;
+    }
+}

+ 1 - 1
WebService/src/main/resources/application-dev.yml

@@ -40,7 +40,7 @@ spring:
       enabled: true
       force: true
   application:
-    name: console-service
+    name: web-service
   redis:
     database: 0
     host: dev.redis.java110.com

+ 1 - 1
WebService/src/main/resources/application-prod.yml

@@ -40,7 +40,7 @@ spring:
       enabled: true
       force: true
   application:
-    name: console-service
+    name: web-service
   redis:
     database: 0
     host: prod.redis.java110.com

+ 1 - 1
WebService/src/main/resources/application-test.yml

@@ -40,7 +40,7 @@ spring:
       enabled: true
       force: true
   application:
-    name: console-service
+    name: web-service
   redis:
     database: 0
     host: test.redis.java110.com

+ 31 - 9
WebService/src/main/resources/components/add-room/addRoom.html

@@ -7,23 +7,45 @@
                     <div>
                         <div>
                             <div class="form-group row">
-                                <label class="col-sm-2 col-form-label">单元编号</label>
-                                <div class="col-sm-10"><input v-model="addRoomInfo.unitNum" type="text" placeholder="必填,请填写单元编号" class="form-control"></div>
+                                <label class="col-sm-2 col-form-label">房屋编号</label>
+                                <div class="col-sm-10"><input v-model="addRoomInfo.roomNum" 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="addRoomInfo.layerCount" type="number" placeholder="必填,请填写单元总层数" class="form-control"></div>
+                                <label class="col-sm-2 col-form-label">房屋楼层</label>
+                                <div class="col-sm-10"><input v-model="addRoomInfo.layer" type="number" placeholder="必填,请填写房屋楼层" class="form-control"></div>
                             </div>
                             <div class="form-group row">
-                                <label class="col-sm-2 col-form-label">电梯</label>
+                                <label class="col-sm-2 col-form-label">房屋单元</label>
                                 <div class="col-sm-10">
-                                    <select class="custom-select" v-model="addRoomInfo.lift">
-                                        <option selected value="">必填,请选择是否有电梯</option>
-                                        <option value="1010">有</option>
-                                        <option value="2020">无</option>
+                                    <select class="custom-select" v-model="addRoomInfo.unitId">
+                                        <option selected  disabled value="">必填,请选择单元</option>
+                                        <option v-for="(unit,index) in addRoomUnits" :key="index" v-bind:value="unit.unitId">{{unit.unitNum}}单元</option>
                                     </select>
                                 </div>
                             </div>
+                            <div class="form-group row">
+                                <label class="col-sm-2 col-form-label">房间数</label>
+                                <div class="col-sm-10"><input v-model="addRoomInfo.section" type="number" 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">
+                                    <select class="custom-select" v-model="addRoomInfo.apartment">
+                                        <option selected disabled value="">必填,请选择房屋户型</option>
+                                        <option value="1010">一室两厅</option>
+                                        <option value="2020">两室两厅</option>
+                                    </select>
+                                </div>
+                            </div>
+                            <div class="form-group row">
+                                <label class="col-sm-2 col-form-label">建筑面积</label>
+                                <div class="col-sm-10"><input v-model="addRoomInfo.builtUpArea" type="number" 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="addRoomInfo.unitPrice" type="number" 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="addRoomInfo.remark" type="text" placeholder="请填写备注信息" class="form-control"></div>

+ 50 - 6
WebService/src/main/resources/components/add-room/addRoom.js

@@ -2,11 +2,15 @@
 
     vc.extends({
         data:{
+            addRoomUnits:[],
             addRoomInfo:{
-                floorId:'',
+                unitId:'',
                 roomNum:'',
-                layerCount:'',
-                lift:'',
+                layer:'',
+                section:'',
+                apartment:'',
+                builtUpArea:'',
+                unitPrice:'',
                 remark:'',
                 communityId:''
             }
@@ -17,12 +21,49 @@
          _initEvent:function(){
              vc.on('addRoom','addRoomModel',function(_params){
                 vc.component.refreshAddRoomInfo();
+                vc.component.loadUnits(_params.floorId);
                 $('#addRoomModel').modal('show');
                 vc.component.addRoomInfo.floorId = _params.floorId;
                 vc.component.addRoomInfo.communityId = vc.getCurrentCommunity().communityId;
             });
         },
         methods:{
+            /**
+                根据楼ID加载单元
+            **/
+            loadUnits:function(_floorId){
+                vc.component.addRoomUnits = [];
+                var param = {
+                    params:{
+                        floorId:_floorId,
+                        communityId:vc.getCurrentCommunity().communityId
+                    }
+                }
+                vc.http.get(
+                    'addRoom',
+                    'loadUnits',
+                     param,
+                     function(json,res){
+                        //vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
+                        if(res.status == 200){
+                            var tmpUnits = JSON.parse(json);
+                            vc.component.addRoomUnits = tmpUnits;
+                            /*if(tmpUnits == null || tmpUnits.length == 0){
+                                return ;
+                            }
+                            for(var unitIndex = 0; unitIndex < tmpUnits.length;unitIndex++){
+                               vc.component.addRoomInfo.units[unitIndex] = tmpUnits[unitIndex];
+                            }*/
+                            return ;
+                        }
+                        vc.message(json);
+                     },
+                     function(errInfo,error){
+                        console.log('请求失败处理');
+
+                        vc.message(errInfo);
+                     });
+            },
             addRoomValidate:function(){
                         return vc.validate.validate({
                             addRoomInfo:vc.component.addRoomInfo
@@ -108,10 +149,13 @@
             },
             refreshAddRoomInfo:function(){
                 vc.component.addRoomInfo= {
-                  floorId:'',
+                  unitId:'',
                   roomNum:'',
-                  layerCount:'',
-                  lift:'',
+                  layer:'',
+                  section:'',
+                  apartment:'',
+                  builtUpArea:'',
+                  unitPrice:'',
                   remark:'',
                   communityId:''
                 }

+ 1 - 1
WebService/src/main/resources/components/add-unit/addUnit.html

@@ -18,7 +18,7 @@
                                 <label class="col-sm-2 col-form-label">电梯</label>
                                 <div class="col-sm-10">
                                     <select class="custom-select" v-model="addUnitInfo.lift">
-                                        <option selected value="">必填,请选择是否有电梯</option>
+                                        <option selected disabled value="">必填,请选择是否有电梯</option>
                                         <option value="1010">有</option>
                                         <option value="2020">无</option>
                                     </select>