魏熙美 6 lat temu
rodzic
commit
855d4aacd9
15 zmienionych plików z 214 dodań i 57 usunięć
  1. 1
    1
      CODE/smart-community/app-api/src/main/java/com/community/huiju/common/code/ICode.java
  2. 7
    3
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/UserController.java
  3. 1
    1
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpBillInvoiceMapper.java
  4. 1
    1
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/ITaUserService.java
  5. 32
    18
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TaUserServiceImpl.java
  6. 4
    1
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/WxLoginServiceImpl.java
  7. 1
    15
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/WxPayServiceImpl.java
  8. 1
    0
      CODE/smart-community/app-api/src/main/resources/mapper/TaUserMapper.xml
  9. 2
    2
      CODE/smart-community/app-api/src/main/resources/mapper/TpBillInvoiceMapper.xml
  10. 15
    4
      CODE/smart-community/property-api/src/main/java/com/community/huiju/controller/TpEquipmentController.java
  11. 5
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/model/TpConfiguration.java
  12. 5
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/model/TpEquipmentTree.java
  13. 7
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/ITpEquipmentService.java
  14. 84
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/TpEquipmentServiceImpl.java
  15. 48
    11
      VUECODE/smart-property-manage/src/views/systemResources/app/index.vue

+ 1
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/common/code/ICode.java Wyświetl plik

@@ -36,7 +36,7 @@ public interface ICode {
36 36
             throw new WisdomException("请输入验证码!");
37 37
         }
38 38
         // 设置验证码为null字符
39
-        AppkeyCache.setCache(phone,"null");
39
+        // AppkeyCache.setCache(phone,"null");
40 40
 
41 41
     }
42 42
 

+ 7
- 3
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/UserController.java Wyświetl plik

@@ -225,13 +225,17 @@ public class UserController extends BaseController {
225 225
                                     HttpSession session){
226 226
         ResponseBean response = new ResponseBean();
227 227
         UserElement userElement = getUserElement(session);
228
-        response = iTaUserService.getUserInfo(userElement,userId, userVerifyId);
229
-        if ("1".equals(response.getCode())) {
228
+        response = iTaUserService.getUserInfo(userElement,userId, userVerifyId, session);
229
+        Object data = response.getData();
230
+        if ("1".equals(response.getCode()) && null == data) {
230 231
             // 清空 session
231 232
             removeUserElement(session);
232 233
             return response;
233 234
         }
234
-        TaUserVO userVO = (TaUserVO) response.getData();
235
+        if (null != data && data instanceof TaUserVO) {
236
+            setUserElement((TaUserVO) data, session);
237
+        }
238
+        TaUserVO userVO = (TaUserVO) data;
235 239
         userVO.setToken(session.getId());
236 240
 
237 241
         return response;

+ 1
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpBillInvoiceMapper.java Wyświetl plik

@@ -44,7 +44,7 @@ public interface TpBillInvoiceMapper {
44 44
      * @param communityId
45 45
      * @return
46 46
      */
47
-	TpBillInvoice selectByIdAndBuildingOwnerInfoId(@Param("id") Integer billInvoiceId,@Param("buildingOwnerInfoId") Integer buildingOwnerInfoId,@Param("communityId") Integer communityId);
47
+	TpBillInvoice selectByIdAndroomNoId(@Param("id") Integer billInvoiceId,@Param("roomNoId") Integer buildingOwnerInfoId,@Param("communityId") Integer communityId);
48 48
     
49 49
     TpBillInvoice selectByOutTradeNo(@Param("outTradeNo") String outTradeNo);
50 50
 

+ 1
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/ITaUserService.java Wyświetl plik

@@ -140,7 +140,7 @@ public interface ITaUserService {
140 140
      * @param userVerifyId  审核id 只有在 userId 参数存在的情况才有效
141 141
      * @return
142 142
      */
143
-    ResponseBean getUserInfo(UserElement userElement, Integer userId, Integer userVerifyId);
143
+    ResponseBean getUserInfo(UserElement userElement, Integer userId, Integer userVerifyId, HttpSession session);
144 144
 
145 145
     /**
146 146
      * 游客登录

+ 32
- 18
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TaUserServiceImpl.java Wyświetl plik

@@ -226,6 +226,10 @@ public class TaUserServiceImpl implements ITaUserService {
226 226
             taUserVO.setBindingWX(Constant.BINDING_WX);
227 227
         }
228 228
 
229
+        String token = null;
230
+        if (null != session) {
231
+            token = session.getId();
232
+        }
229 233
 
230 234
         // 校验房产
231 235
         List<TaUserVerify> taUserVerifies = taUserVerifyMapper.selectByUserId(currentUser.getId());
@@ -235,10 +239,6 @@ public class TaUserServiceImpl implements ITaUserService {
235 239
         taUserVO.setUserVerifyList(taUserVerifies);
236 240
         // 无关联房产
237 241
         if (null == taUserVerifies || taUserVerifies.size() == 0) {
238
-            String token = null;
239
-            if (null != session) {
240
-                token = session.getId();
241
-            }
242 242
             response.addError(UserVerifyEnum.NO_AUDIT_REAL_ESTATE.getMsg(), taUserVO, loginCodePerproties.getLoginCode().get(UserVerifyEnum.NO_AUDIT_REAL_ESTATE.getCode()) + "&token=" + token);
243 243
             return response;
244 244
         }
@@ -254,7 +254,7 @@ public class TaUserServiceImpl implements ITaUserService {
254 254
 
255 255
             return checkHouse(response, taUserVO, userVerify);
256 256
         } else if (taUserVerifies.size() >= 2) {
257
-            response.addSuccess(UserVerifyEnum.A_MULTIPLE_REAL_ESTATE.getMsg(), taUserVO, loginCodePerproties.getLoginCode().get(UserVerifyEnum.A_MULTIPLE_REAL_ESTATE.getCode()));
257
+            response.addSuccess(UserVerifyEnum.A_MULTIPLE_REAL_ESTATE.getMsg(), taUserVO, loginCodePerproties.getLoginCode().get(UserVerifyEnum.A_MULTIPLE_REAL_ESTATE.getCode())  + "&token=" + token);
258 258
             return response;
259 259
         }
260 260
 
@@ -791,7 +791,7 @@ public class TaUserServiceImpl implements ITaUserService {
791 791
     }
792 792
 
793 793
     @Override
794
-    public ResponseBean getUserInfo(UserElement userElement, Integer userId, Integer userVerifyId) {
794
+    public ResponseBean getUserInfo(UserElement userElement, Integer userId, Integer userVerifyId, HttpSession session) {
795 795
 
796 796
         ResponseBean response = new ResponseBean();
797 797
 
@@ -802,14 +802,20 @@ public class TaUserServiceImpl implements ITaUserService {
802 802
             return response;
803 803
         }
804 804
 
805
+        // 校验房产
806
+        checkLogin(response, user, session);
807
+
805 808
         // 校验用户
806 809
         checkBlacklistStatusUser(user);
807 810
 
808
-        // 当 解除了这个房产关联关系的时候,就不能获取到用户信息
809
-        TaUserVerify userVerify = taUserVerifyMapper.selectByPrimaryKey(userElement.getUserVerifyId());
810
-        if (null == userVerify) {
811
-            response.addError("无关联该房产");
812
-            return response;
811
+        // 当没有可以选择的房产时
812
+        if (((TaUserVO)response.getData()).getUserVerifyList().size() == 0) {
813
+            // 当 解除了这个房产关联关系的时候,就不能获取到用户信息
814
+            TaUserVerify userVerify = taUserVerifyMapper.selectByPrimaryKey(userElement.getUserVerifyId());
815
+            if (null == userVerify ) {
816
+                response.addError("无关联该房产");
817
+                return response;
818
+            }
813 819
         }
814 820
 
815 821
         user.setUserVerifyId(userElement.getUserVerifyId());
@@ -835,13 +841,14 @@ public class TaUserServiceImpl implements ITaUserService {
835 841
         }
836 842
 
837 843
 
838
-        TaUserVO userVO = new TaUserVO();
839
-
840
-        // 根据用户id, 获取 用户的住址, 人脸是否认证, 角色
841
-        userSetUp(user, userVO);
842
-
843
-        response.addSuccess(userVO);
844
-
844
+        if (null != user.getUserVerifyId()) {
845
+            TaUserVO userVO = new TaUserVO();
846
+            // 根据用户id, 获取 用户的住址, 人脸是否认证, 角色
847
+            userSetUp(user, userVO);
848
+            userVO.setUserVerifyList(((TaUserVO)response.getData()).getUserVerifyList());
849
+            response.setUrl(null);
850
+            response.addSuccess(userVO);
851
+        }
845 852
         return response;
846 853
     }
847 854
 
@@ -971,6 +978,13 @@ public class TaUserServiceImpl implements ITaUserService {
971 978
                 throw new WisdomException("您未绑定该房产!");
972 979
             }
973 980
             TaUser currentUser = taUserMapper.selectByPrimaryKey(userElement.getId());
981
+
982
+            // 校验房产
983
+            List<TaUserVerify> taUserVerifies = taUserVerifyMapper.selectByUserId(currentUser.getId());
984
+            taUserVerifies.forEach(e->{
985
+                e.setVerifyUrl(loginCodePerproties.getLoginCode().get("-1") + e.getId());
986
+            });
987
+            taUserVO.setUserVerifyList(taUserVerifies);
974 988
             BeanUtils.copyProperties(currentUser, taUserVO);
975 989
             return checkHouse(responseBean, taUserVO, userVerify);
976 990
         }

+ 4
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/WxLoginServiceImpl.java Wyświetl plik

@@ -5,6 +5,7 @@ import com.community.commom.mode.ResponseBean;
5 5
 import com.community.commom.session.UserElement;
6 6
 import com.community.commom.utils.BeanTools;
7 7
 import com.community.huiju.common.code.ICode;
8
+import com.community.huiju.common.code.cache.AppkeyCache;
8 9
 import com.community.huiju.common.perproties.LoginCodePerproties;
9 10
 import com.community.huiju.dao.TaUserMapper;
10 11
 import com.community.huiju.enums.UserVerifyEnum;
@@ -135,7 +136,7 @@ public class WxLoginServiceImpl implements WxLoginServiceI {
135 136
 		TaUser user = iTaUserService.hasUserPhone(loginName);
136 137
 		// 未注册
137 138
 		if (null == user) {
138
-			responseBean.addError(UserVerifyEnum.NO_UNREGISTERED.getCode(), UserVerifyEnum.NO_UNREGISTERED.getMsg());
139
+			responseBean.addError(UserVerifyEnum.NO_UNREGISTERED.getCode(), UserVerifyEnum.NO_UNREGISTERED.getMsg() + "&phone=" + loginName + "&code=" + code);
139 140
 			return responseBean;
140 141
 		}
141 142
 
@@ -146,6 +147,8 @@ public class WxLoginServiceImpl implements WxLoginServiceI {
146 147
 		responseBean = iTaUserService.checkLogin(responseBean, user, null);
147 148
 
148 149
 
150
+		// 设置验证码为null字符
151
+		AppkeyCache.setCache(loginName,"null");
149 152
 		return responseBean;
150 153
 	}
151 154
 

+ 1
- 15
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/WxPayServiceImpl.java Wyświetl plik

@@ -230,23 +230,9 @@ public class WxPayServiceImpl implements WxPayServiceI {
230 230
 		Random random = new Random();
231 231
 		String orderNo = String.valueOf(System.currentTimeMillis()) + random.nextInt();
232 232
 
233
-		/**
234
-		 * 获取这个房产的业主
235
-		 */
236
-
237
-		TaUserVerify userVerify = taUserVerifyMapper.selectCommunityAndAddressAndRoleId(userElement.getCommunityId(),
238
-				userElement.getPhaseId(), userElement.getBuildingId(), userElement.getUnitId(),
239
-				userElement.getLevelId(), userElement.getRoomNoId());
240
-		// 业主信息
241
-		TaUser user = taUserMapper.selectByPrimaryKey(userVerify.getUserId());
242
-
243
-		TpBuildingOwnerInfo tpBuildingOwnerInfo = tpBuildingOwnerInfoMapper.selectCommunityAndAddressAndPhone(userElement.getCommunityId(),
244
-				userElement.getPhaseId(), userElement.getBuildingId(), userElement.getUnitId(),
245
-				userElement.getLevelId(), userElement.getRoomNoId(), user.getLoginName());
246
-
247 233
 		//获取支付金额
248 234
 		for (Integer billInvoiceId : billInvoiceIdArray) {
249
-			TpBillInvoice tpBillInvoice = tpBillInvoiceMapper.selectByIdAndBuildingOwnerInfoId(billInvoiceId,tpBuildingOwnerInfo.getId(),userElement.getCommunityId());
235
+			TpBillInvoice tpBillInvoice = tpBillInvoiceMapper.selectByPrimaryKey(billInvoiceId);
250 236
 			if (null == tpBillInvoice){
251 237
 				throw new Exception("订单不存在");
252 238
 			}else if (!tpBillInvoice.getBillStatus().equals("0")){

+ 1
- 0
CODE/smart-community/app-api/src/main/resources/mapper/TaUserMapper.xml Wyświetl plik

@@ -353,6 +353,7 @@
353 353
   <select id="selectHouseUserList" resultType="com.community.huiju.model.TaUser" >
354 354
     SELECT
355 355
     tu.id as id,
356
+    tu.gender as gender,
356 357
     tu.user_name as userName,
357 358
     tu.login_name as loginName,
358 359
     tu.head_portrait as headPortrait,

+ 2
- 2
CODE/smart-community/app-api/src/main/resources/mapper/TpBillInvoiceMapper.xml Wyświetl plik

@@ -278,7 +278,7 @@
278 278
     AND i.community_id = #{communityId,jdbcType=INTEGER}
279 279
   </select>
280 280
 
281
-  <select id="selectByIdAndBuildingOwnerInfoId" resultType="com.community.huiju.model.TpBillInvoice" >
281
+  <select id="selectByIdAndroomNoId" resultType="com.community.huiju.model.TpBillInvoice" >
282 282
     SELECT
283 283
         t.id,
284 284
         t.community_id AS communityId,
@@ -298,7 +298,7 @@
298 298
     where t.id = #{id,jdbcType=INTEGER}
299 299
     and t.community_id = #{communityId,jdbcType=INTEGER}
300 300
     and t.status = 1
301
-    and t.building_owner_info_id = #{buildingOwnerInfoId,jdbcType=INTEGER}
301
+    and t.room_no_id = #{roomNoId,jdbcType=INTEGER}
302 302
   </select>
303 303
 
304 304
   <select id="selectByOutTradeNo" resultType="com.community.huiju.model.TpBillInvoice" >

+ 15
- 4
CODE/smart-community/property-api/src/main/java/com/community/huiju/controller/TpEquipmentController.java Wyświetl plik

@@ -12,10 +12,7 @@ import io.swagger.annotations.ApiImplicitParam;
12 12
 import io.swagger.annotations.ApiImplicitParams;
13 13
 import io.swagger.annotations.ApiOperation;
14 14
 import org.springframework.beans.factory.annotation.Autowired;
15
-import org.springframework.web.bind.annotation.RequestMapping;
16
-import org.springframework.web.bind.annotation.RequestMethod;
17
-import org.springframework.web.bind.annotation.RequestParam;
18
-import org.springframework.web.bind.annotation.RestController;
15
+import org.springframework.web.bind.annotation.*;
19 16
 
20 17
 import javax.servlet.http.HttpSession;
21 18
 import java.util.List;
@@ -49,4 +46,18 @@ public class TpEquipmentController extends BaseController {
49 46
         return responseBean;
50 47
     }
51 48
 
49
+
50
+    @RequestMapping(value = "/equipment/monitoring", method = RequestMethod.POST)
51
+    @ApiOperation(value = "添加或修改监控设备", notes = "添加或修改监控设备")
52
+    @ApiImplicitParams({
53
+            @ApiImplicitParam(paramType = "body", dataTypeClass = Integer.class, name = "parameter", value = "监控设备数据"),
54
+            @ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "token")
55
+    })
56
+    public ResponseBean saveOrUpdateMonitoring(@RequestBody String parameter, HttpSession session) {
57
+        ResponseBean responseBean = new ResponseBean();
58
+        UserElement userElement = getUserElement(session);
59
+        responseBean = iTpEquipmentService.saveOrUpdateMonitoring(parameter, userElement);
60
+        return responseBean;
61
+    }
62
+
52 63
 }

+ 5
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/model/TpConfiguration.java Wyświetl plik

@@ -1,5 +1,7 @@
1 1
 package com.community.huiju.model;
2 2
 
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
3 5
 import com.baomidou.mybatisplus.annotation.TableName;
4 6
 import lombok.Data;
5 7
 import lombok.EqualsAndHashCode;
@@ -24,6 +26,9 @@ public class TpConfiguration implements Serializable {
24 26
 
25 27
     private static final long serialVersionUID = 1L;
26 28
 
29
+    @TableId(value = "id", type = IdType.AUTO)
30
+    private Integer id;
31
+
27 32
     /**
28 33
      * 配置key
29 34
      */

+ 5
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/model/TpEquipmentTree.java Wyświetl plik

@@ -1,5 +1,7 @@
1 1
 package com.community.huiju.model;
2 2
 
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
3 5
 import com.baomidou.mybatisplus.annotation.TableName;
4 6
 import lombok.Data;
5 7
 import lombok.EqualsAndHashCode;
@@ -24,6 +26,9 @@ public class TpEquipmentTree implements Serializable {
24 26
 
25 27
     private static final long serialVersionUID = 1L;
26 28
 
29
+    @TableId(value = "id", type = IdType.AUTO)
30
+    private Integer id;
31
+
27 32
     /**
28 33
      * 小区id
29 34
      */

+ 7
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/ITpEquipmentService.java Wyświetl plik

@@ -23,4 +23,11 @@ public interface ITpEquipmentService extends IService<TpEquipment> {
23 23
      */
24 24
     ResponseBean getAllByCommunityAndEquipmentType(UserElement userElement, Integer equipmentType);
25 25
 
26
+    /**
27
+     * 修改或者添加 监控设备
28
+     * @param parameter
29
+     * @param userElement
30
+     * @return
31
+     */
32
+    ResponseBean saveOrUpdateMonitoring(String parameter, UserElement userElement);
26 33
 }

+ 84
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/TpEquipmentServiceImpl.java Wyświetl plik

@@ -1,14 +1,21 @@
1 1
 package com.community.huiju.service.impl;
2 2
 
3
+import com.alibaba.fastjson.JSONObject;
4
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
3 5
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
4 6
 import com.community.commom.mode.ResponseBean;
5 7
 import com.community.commom.session.UserElement;
8
+import com.community.huiju.dao.TpConfigurationMapper;
6 9
 import com.community.huiju.dao.TpEquipmentMapper;
10
+import com.community.huiju.dao.TpEquipmentTreeMapper;
11
+import com.community.huiju.model.TpConfiguration;
7 12
 import com.community.huiju.model.TpEquipment;
13
+import com.community.huiju.model.TpEquipmentTree;
8 14
 import com.community.huiju.service.ITpEquipmentService;
9 15
 import org.springframework.beans.factory.annotation.Autowired;
10 16
 import org.springframework.stereotype.Service;
11 17
 
18
+import java.time.LocalDateTime;
12 19
 import java.util.List;
13 20
 
14 21
 /**
@@ -25,6 +32,12 @@ public class TpEquipmentServiceImpl extends ServiceImpl<TpEquipmentMapper, TpEqu
25 32
     @Autowired
26 33
     private TpEquipmentMapper tpEquipmentMapper;
27 34
 
35
+    @Autowired
36
+    private TpConfigurationMapper tpConfigurationMapper;
37
+
38
+    @Autowired
39
+    private TpEquipmentTreeMapper tpEquipmentTreeMapper;
40
+
28 41
     @Override
29 42
     public ResponseBean getAllByCommunityAndEquipmentType(UserElement userElement, Integer equipmentType) {
30 43
         ResponseBean responseBean = new ResponseBean();
@@ -32,4 +45,75 @@ public class TpEquipmentServiceImpl extends ServiceImpl<TpEquipmentMapper, TpEqu
32 45
         responseBean.addSuccess(tpEquipments);
33 46
         return responseBean;
34 47
     }
48
+
49
+    @Override
50
+    public ResponseBean saveOrUpdateMonitoring(String parameter, UserElement userElement) {
51
+        ResponseBean responseBean = new ResponseBean();
52
+
53
+        // 获取这个小区的根节点树
54
+        QueryWrapper<TpEquipmentTree> equipmentTreeQueryWrapper = new QueryWrapper<>();
55
+        equipmentTreeQueryWrapper.eq("community_id", userElement.getCommunityId());
56
+        TpEquipmentTree tpEquipmentTree = tpEquipmentTreeMapper.selectOne(equipmentTreeQueryWrapper);
57
+
58
+        List<TpEquipment> tpEquipments = JSONObject.parseArray(parameter, TpEquipment.class);
59
+        for (int i = 0; i < tpEquipments.size(); i++){
60
+            TpEquipment equipment = tpEquipments.get(0);
61
+            Integer id = equipment.getId();
62
+            if (null == id) {
63
+                // 监控地址
64
+                String address = equipment.getAddress();
65
+                // 监控url
66
+                String url = equipment.getUrl();
67
+                // 保安人员号码
68
+                String securityGuardTel = equipment.getSecurityGuardTel();
69
+                // 保安室号码
70
+                String securityRoomTel = equipment.getSecurityRoomTel();
71
+
72
+                // 开始插入设备数据
73
+                // 地址
74
+                TpConfiguration tpConfigurationAddress = insertConfigguration(userElement.getCommunityId(), "监控地址" + i, address, userElement.getId());
75
+                // 监控url
76
+                TpConfiguration tpConfigurationUrl = insertConfigguration(userElement.getCommunityId(), "监控" + i, url, userElement.getId());
77
+                // 保安人员号码
78
+                TpConfiguration tpConfigurationSecurityGuardTel = insertConfigguration(userElement.getCommunityId(), "保安电话" + i, securityGuardTel, userElement.getId());
79
+                // 保安室号码
80
+                TpConfiguration tpConfigurationSecurityRoomTel = insertConfigguration(userElement.getCommunityId(), "安保室电话" + i, securityRoomTel, userElement.getId());
81
+
82
+                equipment.setAddressId(tpConfigurationAddress.getId());
83
+                equipment.setUrlId(tpConfigurationUrl.getId());
84
+                equipment.setSecurityGuardTelId(tpConfigurationSecurityGuardTel.getId());
85
+                equipment.setSecurityRoomTelId(tpConfigurationSecurityRoomTel.getId());
86
+                equipment.setEquipmentType("1");
87
+                equipment.setEquipmentTreeId(tpEquipmentTree.getId());
88
+
89
+                tpEquipmentMapper.insert(equipment);
90
+            } else {
91
+                tpEquipmentMapper.updateById(equipment);
92
+            }
93
+        }
94
+
95
+        return responseBean;
96
+    }
97
+
98
+    /**
99
+     * 插入数据
100
+     * @param communityId
101
+     * @param name
102
+     * @param value
103
+     * @param userId
104
+     * @return
105
+     */
106
+    private TpConfiguration insertConfigguration(Integer communityId, String name, String value, Integer userId) {
107
+
108
+        TpConfiguration tpConfiguration = new TpConfiguration();
109
+        tpConfiguration.setCommunityId(communityId);
110
+        tpConfiguration.setConfigurationName(name);
111
+        tpConfiguration.setConfigurationType(1);
112
+        tpConfiguration.setConfigurationValue(value);
113
+        tpConfiguration.setCreateTiem(LocalDateTime.now());
114
+        tpConfiguration.setCreateUser(userId);
115
+        tpConfigurationMapper.insert(tpConfiguration);
116
+
117
+        return tpConfiguration;
118
+    }
35 119
 }

+ 48
- 11
VUECODE/smart-property-manage/src/views/systemResources/app/index.vue Wyświetl plik

@@ -116,29 +116,34 @@
116 116
           </el-table-column>
117 117
         </el-table>
118 118
       </el-tab-pane>
119
-      <el-tab-pane label="区监控" name="monitoring">
119
+      <el-tab-pane label="区监控" name="monitoring">
120 120
         <span style="display: flex; justify-content: center;">可配置项</span>
121
+        <div style="display: flex; justify-content: center; margin-top: 20px;">
122
+          <span style="display: flex; justify-content: center; color: #409EFF;cursor: pointer; margin-right: 50px;" @click="addMonitoring">添加一个配置</span>
123
+          <span style="display: flex; justify-content: center; color: #409EFF;cursor: pointer; margin-left: 50px;" @click="monitoringSubmit">提交</span>
124
+        </div>
121 125
         <div style="display: flex; justify-content: center; flex-wrap: wrap;">
122 126
           <el-form v-for="(item, index) in equipmentList" ref="monitoringForm" label-width="120px" style="margin-top: 20px;">
123 127
             <div>
124 128
               <el-form-item label="编号">
125
-                <span>{{ item.id }}</span>
129
+                <!-- item.id -->
130
+                <span>{{ index }}</span>
126 131
               </el-form-item>
127 132
               <el-form-item label="视频流地址">
128
-                <el-input :value="item.url" :disabled="true" name="name"/>
133
+                <el-input v-model="item.url" :disabled="false" name="name"/>
129 134
               </el-form-item>
130 135
               <el-form-item label="地址">
131
-                <el-input :value="item.address" :disabled="true" name="address"/>
136
+                <el-input v-model="item.address" :disabled="false" name="address"/>
132 137
               </el-form-item>
133 138
               <el-form-item label="安保人员电话">
134
-                <el-input :value="item.securityGuardTel" :disabled="true" name="phone"/>
139
+                <el-input v-model="item.securityGuardTel" :disabled="false" name="phone"/>
135 140
               </el-form-item>
136 141
               <el-form-item label="保安室电话">
137
-                <el-input :value="item.securityRoomTel" :disabled="true" name="phone-2"/>
142
+                <el-input v-model="item.securityRoomTel" :disabled="false" name="phone-2"/>
138 143
               </el-form-item>
139 144
             </div>
140 145
             <el-form-item>
141
-              <el-button type="primary" @click="monitoringSubmit(item.id, index)" >确认</el-button>
146
+              <el-button type="info" @click="monitoringRemover(item.id, index)" >删除</el-button>
142 147
             </el-form-item>
143 148
           </el-form>
144 149
         </div>
@@ -171,7 +176,6 @@ export default {
171 176
       announcementBannerBool: false, // 是否显示公告的保存按钮
172 177
       activityBannerNumBool: false, // 是否显示活动的保存按钮
173 178
       equipmentList: [] // 处理过后的监控数据
174
-      // equipmentRequestList: [] // 监控数据,后台获取的
175 179
     }
176 180
   },
177 181
   mounted() {
@@ -206,8 +210,19 @@ export default {
206 210
         this.equipmentGetAll()
207 211
       }
208 212
     },
209
-    monitoringSubmit(id, index) { // 监控提交
210
-      console.log('monitoringForm : ', this.$refs.monitoringForm)
213
+    monitoringSubmit() { // 监控提交
214
+      console.log('monitoringForm : ', this.equipmentList)
215
+    },
216
+    monitoringRemover(id, equipmentIndex) { // 监控删除
217
+      // console.log('monitoringForm : ', this.equipmentList, '  下坐标:', index)
218
+      const tempEquipmentList = []
219
+      this.equipmentList.map((item, index) => {
220
+        // 排除需要删除的下坐标的数据
221
+        if (index !== equipmentIndex) {
222
+          tempEquipmentList.push(item)
223
+        }
224
+      })
225
+      this.equipmentList = tempEquipmentList
211 226
     },
212 227
     onSubmit() {
213 228
       this.getPropertyData()
@@ -341,13 +356,35 @@ export default {
341 356
         console.log('error CarouselGetBanner')
342 357
       })
343 358
     },
344
-    equipmentGetAll() {
359
+    equipmentGetAll() { // 监控配置
345 360
       const eqData = { type: 1 }
346 361
       this.$store.dispatch('EquipmentGetAll', eqData).then((res) => {
347 362
         this.equipmentList = res.data
348 363
       }).catch(() => {
349 364
         console.log('EquipmentGetAll error')
350 365
       })
366
+    },
367
+    addMonitoring() { // 添加一个公区监控配置
368
+      this.equipmentList.push({
369
+        'address': '',
370
+        'addressId': '',
371
+        'communityId': '',
372
+        'createTime': '',
373
+        'createUser': '',
374
+        'equipmentTreeId': '',
375
+        'equipmentType': '',
376
+        'id': '',
377
+        'securityGuardTel': '',
378
+        'securityGuardTelId': '',
379
+        'securityRoomTel': '',
380
+        'securityRoomTelId': '',
381
+        'updateTime': '',
382
+        'updateUser': '',
383
+        'url': '',
384
+        'urlId': '',
385
+        'uuid': '',
386
+        'uuidId': ''
387
+      })
351 388
     }
352 389
   }
353 390
 }