Przeglądaj źródła

修复 bug, 物业端号码校验更改,修改 bug 4477

魏熙美 6 lat temu
rodzic
commit
e96270173b

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

@@ -335,13 +335,13 @@ public class TaUserServiceImpl implements ITaUserService {
335 335
         // 查询出这个手机号
336 336
         TaUser hasUserPhone = hasUserPhone(phone);
337 337
         if (null != hasUserPhone && user.getId().intValue() != hasUserPhone.getId().intValue()) {
338
-            response.addError("号码已占用");
338
+            response.addError("手机号已被使用,请更换其他手机号");
339 339
             return response;
340 340
         }
341 341
 
342
-        // 如果提交上来的手机号 和 这个用户本身的手机号相等,就直接返回成功!
342
+        // 如果提交上来的手机号 和 这个用户本身的手机号相等,就直接返回,不做其他操作
343 343
         if (null != hasUserPhone && user.getLoginName().equals(phone)) {
344
-            response.addSuccess(new String[0]);
344
+            response.addError("手机号已被使用,请更换其他手机号");
345 345
             return response;
346 346
         }
347 347
         TpEquipmentTree tpEquipmentTree = tpEquipmentTreeMapper.selectByCommunityId(userElement.getCommunityId());
@@ -350,7 +350,7 @@ public class TaUserServiceImpl implements ITaUserService {
350 350
         int errorCode = jsonobject.getInteger("errorCode");
351 351
         if (errorCode != 0) {
352 352
             log.error("海康电话已存在,推送海康电话修改失败");
353
-            response.addError("此手机号已注册");
353
+            response.addError("手机号已被使用,请更换其他手机号");
354 354
             return response;
355 355
         }
356 356
 
@@ -361,7 +361,7 @@ public class TaUserServiceImpl implements ITaUserService {
361 361
         taUser.setUpdateDate(new Date());
362 362
         taUser.setUpdateUser(user.getId());
363 363
         taUserMapper.updateLongName(taUser);
364
-        response.addSuccess("修改成功");
364
+        response.addSuccess("修改手机号成功,以后请使用新手机号登录");
365 365
 
366 366
         // 修改楼栋资料库手机号
367 367
         tpBuildingOwnerInfoMapper.updateAllByPhone(user.getLoginName(), phone);

+ 2
- 12
CODE/smart-community/property-api/src/main/java/com/community/huiju/controller/AnnouncementTelController.java Wyświetl plik

@@ -80,22 +80,12 @@ public class AnnouncementTelController extends BaseController {
80 80
 	@RequestMapping(value = "/tel/add",method = RequestMethod.POST)
81 81
 	public ResponseBean addTel(@Valid @RequestBody AnnouncementTel announcementTel, HttpSession session){
82 82
 		ResponseBean responseBean = new ResponseBean();
83
-		boolean isPhone = true;
84
-		boolean isLandline = true;
85
-//		if (!AccountValidatorUtil.isLandline(announcementTel.getTel())){
86
-//			isLandline = false;
87
-//		}
88
-//		if (!AccountValidatorUtil.isPhone(announcementTel.getTel())){
89
-//			isPhone = false;
90
-//		}
91
-//		if (isPhone == false && isLandline == false) {
92
-//			responseBean.addError("输入的号码不正确!");
93
-//			return responseBean;
94
-//		}
83
+
95 84
 		if (!AccountValidatorUtil.isNumber(announcementTel.getTel())) {
96 85
 			responseBean.addError("输入的号码不正确!");
97 86
 			return responseBean;
98 87
 		}
88
+
99 89
 		UserElement userElement = getUserElement(session);
100 90
 		QueryWrapper<AnnouncementTel> announcementTelQueryWrapper = new QueryWrapper<>();
101 91
 		announcementTelQueryWrapper.eq("tel", announcementTel.getTel());

+ 12
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/dao/TaUserVerifyMapper.java Wyświetl plik

@@ -80,6 +80,18 @@ public interface TaUserVerifyMapper extends BaseMapper<TaUserVerify> {
80 80
     TaUserVerify selectCommunityAndAddressName(@Param("communityId") Integer communityId, @Param("phaseName") String phaseName, @Param("buildingName") String buildingName, @Param("unitName") String unitName, @Param("levelName") String levelName, @Param("roomNoName") String roomNoName);
81 81
 
82 82
 
83
+    /**
84
+     * 查询用户审核数据!   小区id,用户id,期id,栋id,单元id,楼层id,房间id,审核状态
85
+     * @param userId
86
+     * @param communityId
87
+     * @param phaseId
88
+     * @param buildingId
89
+     * @param unitId
90
+     * @param levelId
91
+     * @param roomNoId
92
+     * @param verifyStatus
93
+     * @return
94
+     */
83 95
     List<TaUserVerify> selectUserVerifyCommunityAndAddress(@Param("userId") Integer userId,
84 96
                                                  @Param("communityId") Integer communityId,
85 97
                                                  @Param("phaseId") Integer phaseId,

+ 5
- 4
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/BuildingOwnerInfoServiceImpl.java Wyświetl plik

@@ -22,6 +22,7 @@ import com.community.huiju.service.IBillInvoiceService;
22 22
 import com.community.huiju.service.IBuildingOwnerInfoService;
23 23
 import com.google.common.collect.Maps;
24 24
 
25
+import org.apache.commons.collections.CollectionUtils;
25 26
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
26 27
 import org.apache.poi.ss.usermodel.*;
27 28
 import org.apache.poi.xssf.usermodel.*;
@@ -544,12 +545,12 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
544 545
             taUserVerify.setRoleId(2);
545 546
         }
546 547
 
547
-        // TODO 是否只允许一个房产中只有一个角色?还是说多个角色?排除业主角色
548
-        TaUserVerify boolUserVerify = taUserVerifyMapper.selectCommunityAndAddressAndRoleId(userId, userElement.getCommunityId(), tpBuildingOwnerInfo.getPhaseId(),
548
+        // 只允许一个房产中只有一个角色
549
+        List<TaUserVerify> userVerifyList = taUserVerifyMapper.selectUserVerifyCommunityAndAddress(userId, userElement.getCommunityId(), tpBuildingOwnerInfo.getPhaseId(),
549 550
                 tpBuildingOwnerInfo.getBuildingId(), tpBuildingOwnerInfo.getUnitId(),
550
-                tpBuildingOwnerInfo.getLevelId(), tpBuildingOwnerInfo.getRoomNoId(), taUserVerify.getRoleId());
551
+                tpBuildingOwnerInfo.getLevelId(), tpBuildingOwnerInfo.getRoomNoId(), 1);
551 552
         // 表示这个用户在这个房产中已经有了这个角色, 就不进行插入
552
-        if (null != boolUserVerify) {
553
+        if (CollectionUtils.isNotEmpty(userVerifyList) && userVerifyList.size() > 0) {
553 554
             return;
554 555
         }
555 556
 

+ 2
- 2
VUECODE/smart-property-manage/src/views/building/batch/batchImport.vue Wyświetl plik

@@ -4,7 +4,7 @@
4 4
     <el-form :inline="true" :model="listQuery" class="form-listQuery">
5 5
       <el-form-item>
6 6
         <div style="display: flex;">
7
-          <el-button style="margin-left: 10px;" size="large" type="primary" @click="exportExcel">下载模板-小区</el-button>
7
+          <el-button style="margin-left: 10px;" size="large" type="primary" @click="exportExcel">下载模板</el-button>
8 8
           <el-upload :on-change="handleChange" :before-upload="beforeUpload" :limit="1" class="upload-demo" action="" multiple>
9 9
             <!-- <a href="http://jingcheng-h5temp.oss-cn-shanghai.aliyuncs.com/%E6%A5%BC%E6%A0%8B%E5%BA%93%E6%A8%A1%E6%9D%BF.xlsx?Expires=1548327771"></a> -->
10 10
             <el-button slot="trigger" size="large" type="primary" style="margin-left: 10px;">选取文件并预览</el-button>
@@ -155,7 +155,7 @@ export default {
155 155
         const link = document.createElement('a')
156 156
         link.style.display = 'none'
157 157
         link.href = url
158
-        link.setAttribute('download', '主资料库.xlsx')
158
+        link.setAttribute('download', '主资料库.xlsx')
159 159
         document.body.appendChild(link)
160 160
         link.click()
161 161
       }).catch(() => {

+ 21
- 14
VUECODE/smart-property-manage/src/views/systemResources/property/add/index.vue Wyświetl plik

@@ -1,6 +1,6 @@
1 1
 <template>
2 2
   <div id="root">
3
-    <el-form :model="formInline" :rules="rules" label-width="80px" class="form-class">
3
+    <el-form ref="ruleForm" :model="formInline" :rules="rules" label-width="80px" class="form-class">
4 4
       <el-form-item label="名称" prop="name">
5 5
         <el-input v-model="formInline.name"/>
6 6
       </el-form-item>
@@ -12,7 +12,7 @@
12 12
       </el-form-item>
13 13
       <div class="button-class">
14 14
         <el-button type="info" @click="exit">取消</el-button>
15
-        <el-button type="primary" @click="add">保存</el-button>
15
+        <el-button type="primary" @click="add('ruleForm')">保存</el-button>
16 16
       </div>
17 17
     </el-form>
18 18
   </div>
@@ -33,24 +33,31 @@ export default {
33 33
           { required: true, message: '请输入名称', trigger: 'blur' }
34 34
         ],
35 35
         tel: [
36
-          { required: true, message: '请输入手机号', trigger: 'blur' },
37
-          { min: 11, max: 11, required: true, message: '请输入11位手机号', trigger: 'blur' }
36
+          { required: true, message: '请输入号', trigger: 'blur' },
37
+          { min: 6, max: 11, required: true, message: '请输入6~11位号码', trigger: 'blur' }
38 38
         ]
39 39
       }
40 40
     }
41 41
   },
42 42
   methods: {
43
-    add() {
44
-      this.$store.dispatch('TelAdd', this.formInline).then(res => {
45
-        const resCode = res.code
46
-        if (resCode === '1') {
47
-          this.$message.error(res.message)
48
-          return
43
+    add(formName) {
44
+      this.$refs[formName].validate((valid) => {
45
+        if (valid) {
46
+          this.$store.dispatch('TelAdd', this.formInline).then(res => {
47
+            const resCode = res.code
48
+            if (resCode === '1') {
49
+              this.$message.error(res.message)
50
+              return
51
+            }
52
+            this.$message.success(res.message)
53
+            this.$router.go(-1)
54
+          }).catch(() => {
55
+            console.log('error TelAdd')
56
+          })
57
+        } else {
58
+          console.log('error submit!!')
59
+          return false
49 60
         }
50
-        this.$message.success(res.message)
51
-        this.$router.go(-1)
52
-      }).catch(() => {
53
-        console.log('error TelAdd')
54 61
       })
55 62
     },
56 63
     exit() {

+ 21
- 14
VUECODE/smart-property-manage/src/views/systemResources/property/edi/index.vue Wyświetl plik

@@ -1,6 +1,6 @@
1 1
 <template>
2 2
   <div id="root">
3
-    <el-form :model="formInline" :rules="rules" label-width="80px" class="form-class">
3
+    <el-form ref="ruleForm" :model="formInline" :rules="rules" label-width="80px" class="form-class">
4 4
       <el-form-item label="名称" prop="name">
5 5
         <el-input v-model="formInline.name"/>
6 6
       </el-form-item>
@@ -12,7 +12,7 @@
12 12
       </el-form-item>
13 13
       <div class="button-class">
14 14
         <el-button type="info" @click="exit">取消</el-button>
15
-        <el-button type="primary" @click="updateTels">保存</el-button>
15
+        <el-button type="primary" @click="updateTels('ruleForm')">保存</el-button>
16 16
       </div>
17 17
     </el-form>
18 18
   </div>
@@ -34,8 +34,8 @@ export default {
34 34
           { required: true, message: '请输入名称', trigger: 'blur' }
35 35
         ],
36 36
         tel: [
37
-          { required: true, message: '请输入手机号', trigger: 'blur' },
38
-          { min: 11, max: 11, required: true, message: '请输入11位手机号', trigger: 'blur' }
37
+          { required: true, message: '请输入号', trigger: 'blur' },
38
+          { min: 6, max: 11, required: true, message: '请输入6~11位号码', trigger: 'blur' }
39 39
         ]
40 40
       }
41 41
     }
@@ -45,17 +45,24 @@ export default {
45 45
     this.getTelsById()
46 46
   },
47 47
   methods: {
48
-    updateTels() {
49
-      this.$store.dispatch('TelUpdate', this.formInline).then(res => {
50
-        const resCode = res.code
51
-        if (resCode === '1') {
52
-          this.$message.error(res.message)
53
-          return
48
+    updateTels(formName) {
49
+      this.$refs[formName].validate((valid) => {
50
+        if (valid) {
51
+          this.$store.dispatch('TelUpdate', this.formInline).then(res => {
52
+            const resCode = res.code
53
+            if (resCode === '1') {
54
+              this.$message.error(res.message)
55
+              return
56
+            }
57
+            this.$message.success(res.message)
58
+            this.$router.go(-1)
59
+          }).catch(() => {
60
+            console.log('error TelUpdate')
61
+          })
62
+        } else {
63
+          console.log('error submit!!')
64
+          return false
54 65
         }
55
-        this.$message.success(res.message)
56
-        this.$router.go(-1)
57
-      }).catch(() => {
58
-        console.log('error TelUpdate')
59 66
       })
60 67
     },
61 68
     exit() {