Преглед изворни кода

保修 优化中 加入房屋教研

webapp пре 6 година
родитељ
комит
d0b13a8df3

+ 3 - 0
Api/src/main/java/com/java110/api/listener/ownerRepair/SaveOwnerRepairListener.java

@@ -10,6 +10,7 @@ import com.java110.event.service.api.ServiceDataFlowEvent;
 import com.java110.utils.constant.BusinessTypeConstant;
 import com.java110.utils.constant.CommonConstant;
 import com.java110.utils.constant.ServiceCodeOwnerRepairConstant;
+import com.java110.utils.constant.StateConstant;
 import com.java110.utils.util.Assert;
 import org.springframework.http.HttpHeaders;
 import org.springframework.http.HttpMethod;
@@ -88,6 +89,8 @@ public class SaveOwnerRepairListener extends AbstractServiceApiListener {
         JSONObject businessOwnerRepair = new JSONObject();
         businessOwnerRepair.putAll(paramInJson);
         businessOwnerRepair.put("repairId", "-1");
+        businessOwnerRepair.put("state", StateConstant.REPAIR_NO_DISPATCH);
+
         //计算 应收金额
         business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessOwnerRepair", businessOwnerRepair);
         return business;

+ 31 - 1
WebService/src/main/java/com/java110/web/components/ownerRepair/AddOwnerRepairComponent.java

@@ -1,8 +1,11 @@
 package com.java110.web.components.ownerRepair;
 
 import com.java110.core.context.IPageData;
+import com.java110.web.smo.IOwnerServiceSMO;
+import com.java110.web.smo.IRoomServiceSMO;
 import com.java110.web.smo.ownerRepair.IAddOwnerRepairSMO;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
 import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Component;
 
@@ -15,15 +18,34 @@ public class AddOwnerRepairComponent {
     @Autowired
     private IAddOwnerRepairSMO addOwnerRepairSMOImpl;
 
+
+    @Autowired
+    private IOwnerServiceSMO ownerServiceSMOImpl;
+
     /**
      * 添加业主报修数据
+     *
      * @param pd 页面数据封装
      * @return ResponseEntity 对象
      */
-    public ResponseEntity<String> save(IPageData pd){
+    public ResponseEntity<String> save(IPageData pd) {
         return addOwnerRepairSMOImpl.saveOwnerRepair(pd);
     }
 
+    /**
+     * 查询业主房屋信息
+     *
+     * @param pd 页面数据封装
+     * @return ResponseEntity 对象
+     */
+    public ResponseEntity<String> getOwner(IPageData pd) {
+        ResponseEntity<String> responseEntity = null;
+        responseEntity = ownerServiceSMOImpl.listOwner(pd);
+
+        return responseEntity;
+    }
+
+
     public IAddOwnerRepairSMO getAddOwnerRepairSMOImpl() {
         return addOwnerRepairSMOImpl;
     }
@@ -31,4 +53,12 @@ public class AddOwnerRepairComponent {
     public void setAddOwnerRepairSMOImpl(IAddOwnerRepairSMO addOwnerRepairSMOImpl) {
         this.addOwnerRepairSMOImpl = addOwnerRepairSMOImpl;
     }
+
+    public IOwnerServiceSMO getOwnerServiceSMOImpl() {
+        return ownerServiceSMOImpl;
+    }
+
+    public void setOwnerServiceSMOImpl(IOwnerServiceSMO ownerServiceSMOImpl) {
+        this.ownerServiceSMOImpl = ownerServiceSMOImpl;
+    }
 }

+ 17 - 0
WebService/src/main/java/com/java110/web/components/ownerRepair/OwnerRepairManageComponent.java

@@ -2,6 +2,7 @@ package com.java110.web.components.ownerRepair;
 
 
 import com.java110.core.context.IPageData;
+import com.java110.web.smo.IRoomServiceSMO;
 import com.java110.web.smo.ownerRepair.IListOwnerRepairsSMO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.ResponseEntity;
@@ -21,6 +22,9 @@ public class OwnerRepairManageComponent {
     @Autowired
     private IListOwnerRepairsSMO listOwnerRepairsSMOImpl;
 
+    @Autowired
+    private IRoomServiceSMO roomServiceSMOImpl;
+
     /**
      * 查询业主报修列表
      * @param pd 页面数据封装
@@ -30,6 +34,11 @@ public class OwnerRepairManageComponent {
         return listOwnerRepairsSMOImpl.listOwnerRepairs(pd);
     }
 
+    public ResponseEntity<String> getRoom(IPageData pd){
+
+        return roomServiceSMOImpl.listRoom(pd);
+    }
+
     public IListOwnerRepairsSMO getListOwnerRepairsSMOImpl() {
         return listOwnerRepairsSMOImpl;
     }
@@ -37,4 +46,12 @@ public class OwnerRepairManageComponent {
     public void setListOwnerRepairsSMOImpl(IListOwnerRepairsSMO listOwnerRepairsSMOImpl) {
         this.listOwnerRepairsSMOImpl = listOwnerRepairsSMOImpl;
     }
+
+    public IRoomServiceSMO getRoomServiceSMOImpl() {
+        return roomServiceSMOImpl;
+    }
+
+    public void setRoomServiceSMOImpl(IRoomServiceSMO roomServiceSMOImpl) {
+        this.roomServiceSMOImpl = roomServiceSMOImpl;
+    }
 }

+ 3 - 15
WebService/src/main/resources/components/ownerRepairPackage/add-ownerRepair/addOwnerRepair.html

@@ -3,22 +3,10 @@
     <div class="modal-dialog modal-lg">
         <div class="modal-content">
             <div class="modal-body">
-                <h3 class="m-t-none m-b ">添加业主报修</h3>
+                <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="addFloorInfo.name" 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="addFloorInfo.floorNum" type="email" 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="addFloorInfo.remark" type="tel" placeholder="可填,请填写备注" class="form-control"></div>
-                            </div>-->
 
                             <div class="form-group row">
                                 <label class="col-sm-2 col-form-label">报修类型</label>
@@ -47,7 +35,7 @@
                             <div class="form-group row">
                                 <label class="col-sm-2 col-form-label">房屋编号</label>
                                 <div class="col-sm-10">
-                                    <input v-model="addOwnerRepairInfo.roomId" readonly type="text" placeholder="必填,请填写房屋编号"
+                                    <input v-model="addOwnerRepairInfo.roomName" readonly type="text" placeholder="必填,请填写房屋编号"
                                            class="form-control">
                                 </div>
                             </div>
@@ -67,7 +55,7 @@
 
                             <div class="ibox-content">
                                 <button class="btn btn-primary float-right" type="button"
-                                        v-on:click="saveOwnerRepairInfo()"><i class="fa fa-check"></i>&nbsp;保存
+                                        v-on:click="saveOwnerRepairInfo()"><i class="fa fa-check"></i>&nbsp;提交
                                 </button>
                                 <button type="button" class="btn btn-warning float-right" style="margin-right:20px;"
                                         data-dismiss="modal">取消

+ 53 - 30
WebService/src/main/resources/components/ownerRepairPackage/add-ownerRepair/addOwnerRepair.js

@@ -12,6 +12,7 @@
                 repairName:'',
                 tel:'',
                 roomId:'',
+                roomName:'',
                 appointmentTime:'',
                 context:'',
 
@@ -21,7 +22,8 @@
 
          },
          _initEvent:function(){
-            vc.on('addOwnerRepair','openAddOwnerRepairModal',function(){
+            vc.on('addOwnerRepair','openAddOwnerRepairModal',function(_ownerInfo){
+                vc.component._freshOwnerInfo(_ownerInfo);
                 $('#addOwnerRepairModel').modal('show');
             });
         },
@@ -31,81 +33,77 @@
                     addOwnerRepairInfo:vc.component.addOwnerRepairInfo
                 },{
                     'addOwnerRepairInfo.repairType':[
-{
+                        {
                             limit:"required",
                             param:"",
                             errInfo:"报修类型不能为空"
                         },
- {
+                        {
                             limit:"maxin",
                             param:"2,50",
                             errInfo:"报修类型错误"
                         },
                     ],
-'addOwnerRepairInfo.repairName':[
-{
+                        'addOwnerRepairInfo.repairName':[
+                        {
                             limit:"required",
                             param:"",
                             errInfo:"报修人不能为空"
                         },
- {
+                        {
                             limit:"maxin",
                             param:"2,50",
                             errInfo:"报修人名称必须在2至50字符之间"
                         },
                     ],
-'addOwnerRepairInfo.tel':[
-{
+                        'addOwnerRepairInfo.tel':[
+                        {
                             limit:"required",
                             param:"",
                             errInfo:"联系方式不能为空"
                         },
- {
+                        {
                             limit:"phone",
                             param:"",
                             errInfo:"联系方式格式不正确"
                         },
                     ],
-'addOwnerRepairInfo.roomId':[
-{
+                    'addOwnerRepairInfo.roomId':[
+                    {
                             limit:"required",
                             param:"",
                             errInfo:"房屋ID不能为空"
                         },
- {
+                    {
                             limit:"num",
                             param:"",
                             errInfo:"房屋ID错误"
                         },
                     ],
-'addOwnerRepairInfo.appointmentTime':[
-{
+                    'addOwnerRepairInfo.appointmentTime':[
+                    {
                             limit:"required",
                             param:"",
                             errInfo:"预约时间不能为空"
                         },
- {
+                        {
                             limit:"dateTime",
                             param:"",
                             errInfo:"预约时间格式错误"
                         },
                     ],
-'addOwnerRepairInfo.context':[
-{
+                    'addOwnerRepairInfo.context':[
+                    {
                             limit:"required",
                             param:"",
                             errInfo:"报修内容不能为空"
                         },
- {
+                        {
                             limit:"maxLength",
                             param:"2000",
                             errInfo:"报修内容不能超过2000"
                         },
                     ],
-
-
-
-
                 });
             },
             saveOwnerRepairInfo:function(){
@@ -152,14 +150,39 @@
             },
             clearAddOwnerRepairInfo:function(){
                 vc.component.addOwnerRepairInfo = {
-                                            repairType:'',
-repairName:'',
-tel:'',
-roomId:'',
-appointmentTime:'',
-context:'',
-
-                                        };
+                        repairType:'',
+                        repairName:'',
+                        tel:'',
+                        roomId:'',
+                        appointmentTime:'',
+                        context:'',
+                    };
+            },
+            _freshOwnerInfo:function(_ownerInfo){
+                vc.component.addOwnerRepairInfo.roomId = _ownerInfo.roomId;
+                vc.component.addOwnerRepairInfo.roomName = _ownerInfo.roomName;
+
+                var param={
+                    params:{
+                        ownerId:_ownerInfo.ownerId,
+                        communityId:vc.getCurrentCommunity().communityId,
+                        page:1,
+                        row:1
+                    }
+                }
+                //查询房屋信息 业主信息
+               vc.http.get('addOwnerRepair',
+                            'getOwner',
+                             param,
+                             function(json,res){
+                                var _ownerInfos=JSON.parse(json);
+                                var _ownerInfo = _ownerInfos.owners[0];
+                               vc.component.addOwnerRepairInfo.repairName= _ownerInfo.name;
+                                vc.component.addOwnerRepairInfo.tel= _ownerInfo.link;
+                             },function(errInfo,error){
+                                console.log('请求失败处理');
+                             }
+                           );
             }
         }
     });

+ 1 - 1
WebService/src/main/resources/components/ownerRepairPackage/edit-ownerRepair/editOwnerRepair.html

@@ -34,7 +34,7 @@
                             <div class="form-group row">
                                 <label class="col-sm-2 col-form-label">房屋编号</label>
                                 <div class="col-sm-10">
-                                    <input v-model="editOwnerRepairInfo.roomId" readonly type="text" placeholder="必填,请填写房屋编号"
+                                    <input v-model="editOwnerRepairInfo.roomName" readonly type="text" placeholder="必填,请填写房屋编号"
                                            class="form-control">
                                 </div>
                             </div>

+ 7 - 6
WebService/src/main/resources/components/ownerRepairPackage/edit-ownerRepair/editOwnerRepair.js

@@ -4,12 +4,13 @@
         data:{
             editOwnerRepairInfo:{
                 repairId:'',
-repairType:'',
-repairName:'',
-tel:'',
-roomId:'',
-appointmentTime:'',
-context:'',
+                repairType:'',
+                repairName:'',
+                tel:'',
+                roomId:'',
+                roomName:'',
+                appointmentTime:'',
+                context:'',
 
             }
         },

+ 1 - 1
WebService/src/main/resources/components/ownerRepairPackage/ownerRepair-manage/ownerRepairManage.html

@@ -57,7 +57,7 @@
                 <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="_openAddOwnerRepairModal()">
+                        <button type="button" class="btn btn-primary btn-sm" v-on:click="_openAddOwnerRepairModal()" v-if:click="ownerRepairManageInfo.conditions.roomId != ''">
                             <i class="glyphicon glyphicon-plus"></i>
                             报修登记
                         </button>

+ 51 - 7
WebService/src/main/resources/components/ownerRepairPackage/ownerRepair-manage/ownerRepairManage.js

@@ -14,15 +14,18 @@
                 repairName:'',
                 conditions:{
                     repairId:'',
-repairName:'',
-tel:'',
-repairType:'',
-
+                    repairName:'',
+                    tel:'',
+                    repairType:'',
+                    roomId:'',
+                    roomName:'',
+                    ownerId:''
                 }
             }
         },
         _initMethod:function(){
-            vc.component._listOwnerRepairs(DEFAULT_PAGE, DEFAULT_ROWS);
+            //vc.component._listOwnerRepairs(DEFAULT_PAGE, DEFAULT_ROWS);
+            vc.component._validateParam();
         },
         _initEvent:function(){
             
@@ -34,8 +37,47 @@ repairType:'',
             });
         },
         methods:{
-            _listOwnerRepairs:function(_page, _rows){
+            _validateParam:function(){
+                var _ownerId = vc.getParam('ownerId')
+                var _roomId = vc.getParam('roomId')
 
+                if(!vc.notNull(_roomId)){
+                    vc.message("非法操作,未找到房屋信息");
+                    vc.jumpToPage('/flow/ownerFlow');
+                    return ;
+                }
+                vc.component.ownerRepairManageInfo.conditions.roomId = _roomId;
+                vc.component.ownerRepairManageInfo.conditions.ownerId = _ownerId;
+                var param={
+                    params:{
+                        roomId:vc.component.ownerRepairManageInfo.conditions.roomId,
+                        communityId:vc.getCurrentCommunity().communityId,
+                        page:1,
+                        row:1
+                    }
+                };
+                //查询房屋信息 业主信息
+               vc.http.get('ownerRepairManage',
+                            'getRoom',
+                             param,
+                             function(json,res){
+                                if(res.status == 200){
+                                    var _roomInfos=JSON.parse(json);
+                                    var _roomInfo = _roomInfos.rooms[0];
+                                    vc.component.ownerRepairManageInfo.conditions.roomName= _roomInfo.floorNum+"楼 "+_roomInfo.unitNum+"单元 "+_roomInfo.roomNum + "室";
+                                    vc.component._listOwnerRepairs(DEFAULT_PAGE, DEFAULT_ROWS);
+                                }else{
+                                     vc.message("非法操作,未找到房屋信息");
+                                     vc.jumpToPage('/flow/ownerFlow');
+                                }
+                             },function(errInfo,error){
+                                console.log('请求失败处理');
+                                vc.message("非法操作,未找到房屋信息");
+                                vc.jumpToPage('/flow/ownerFlow');
+                             }
+                 );
+            },
+            _listOwnerRepairs:function(_page, _rows){
                 vc.component.ownerRepairManageInfo.conditions.page = _page;
                 vc.component.ownerRepairManageInfo.conditions.row = _rows;
                 vc.component.ownerRepairManageInfo.conditions.communityId = vc.getCurrentCommunity().communityId;
@@ -62,9 +104,11 @@ repairType:'',
                            );
             },
             _openAddOwnerRepairModal:function(){
-                vc.emit('addOwnerRepair','openAddOwnerRepairModal',{});
+                vc.emit('addOwnerRepair','openAddOwnerRepairModal',vc.component.ownerRepairManageInfo.conditions);
             },
             _openEditOwnerRepairModel:function(_ownerRepair){
+                _ownerRepair.roomName = vc.component.ownerRepairManageInfo.conditions.roomName;
+                _ownerRepair.roomId = vc.component.ownerRepairManageInfo.conditions.roomId;
                 vc.emit('editOwnerRepair','openEditOwnerRepairModal',_ownerRepair);
             },
             _openDeleteOwnerRepairModel:function(_ownerRepair){

+ 1 - 1
WebService/src/main/resources/views/ownerRepairFlow.html

@@ -5,7 +5,7 @@
       xmlns:vc="http://www.thymeleaf.org">
 <head>
     <meta charset="UTF-8"/>
-    <title>业主报修初始化|java110</title>
+    <title>业主报修|java110</title>
     <vc:create name="commonTop"></vc:create>
 </head>
 <body>

+ 16 - 0
java110-utils/src/main/java/com/java110/utils/constant/StateConstant.java

@@ -21,4 +21,20 @@ public class StateConstant {
     public static final String REJECT_AUDIT = "1200";
 
 
+    /**
+     * 未派单
+     */
+    public static final String REPAIR_NO_DISPATCH = "1000";
+
+    /**
+     * 拍单处理中
+     */
+    public static final String REPAIR_DISPATCHING = "1100";
+
+    /**
+     * 拍单处理完成
+     */
+    public static final String REPAIR_DISPATCH_FINISH = "1200";
+
+
 }