张延森 4 年前
父节点
当前提交
61ec9e393f
共有 53 个文件被更改,包括 696 次插入214 次删除
  1. 0
    114
      .mvn/wrapper/MavenWrapperDownloader.java
  2. 二进制
      .mvn/wrapper/maven-wrapper.jar
  3. 0
    1
      .mvn/wrapper/maven-wrapper.properties
  4. 1
    1
      pom.xml
  5. 20
    20
      src/main/java/com/huiju/estateagents/center/taUser/controller/TaUserController.java
  6. 7
    0
      src/main/java/com/huiju/estateagents/center/taUser/entity/TaUser.java
  7. 7
    0
      src/main/java/com/huiju/estateagents/center/taUser/mapper/TaUserMapper.java
  8. 2
    0
      src/main/java/com/huiju/estateagents/center/taUser/service/ITaUserService.java
  9. 25
    0
      src/main/java/com/huiju/estateagents/center/taUser/service/impl/TaUserServiceImpl.java
  10. 5
    1
      src/main/java/com/huiju/estateagents/property/controller/AnnouncementTelController.java
  11. 4
    3
      src/main/java/com/huiju/estateagents/property/controller/BillController.java
  12. 21
    6
      src/main/java/com/huiju/estateagents/property/controller/BuildingOwnerInfoController.java
  13. 8
    2
      src/main/java/com/huiju/estateagents/property/controller/BuildingTreeController.java
  14. 160
    0
      src/main/java/com/huiju/estateagents/property/controller/TpCommunityController.java
  15. 4
    2
      src/main/java/com/huiju/estateagents/property/controller/UserVerifyController.java
  16. 2
    1
      src/main/java/com/huiju/estateagents/property/dao/TaUserVerifyMapper.java
  17. 3
    3
      src/main/java/com/huiju/estateagents/property/dao/TpRoomNoMapper.java
  18. 44
    0
      src/main/java/com/huiju/estateagents/property/entity/TaUserCommunity.java
  19. 46
    0
      src/main/java/com/huiju/estateagents/property/entity/TpCommunity.java
  20. 18
    0
      src/main/java/com/huiju/estateagents/property/mapper/TaUserCommunityMapper.java
  21. 21
    0
      src/main/java/com/huiju/estateagents/property/mapper/TpCommunityMapper.java
  22. 3
    1
      src/main/java/com/huiju/estateagents/property/model/AnnouncementTel.java
  23. 3
    1
      src/main/java/com/huiju/estateagents/property/model/TaUserVerify.java
  24. 3
    1
      src/main/java/com/huiju/estateagents/property/model/TpAnnouncement.java
  25. 4
    1
      src/main/java/com/huiju/estateagents/property/model/TpBuilding.java
  26. 4
    2
      src/main/java/com/huiju/estateagents/property/model/TpBuildingOwnerInfo.java
  27. 4
    2
      src/main/java/com/huiju/estateagents/property/model/TpLevel.java
  28. 6
    4
      src/main/java/com/huiju/estateagents/property/model/TpPhase.java
  29. 5
    3
      src/main/java/com/huiju/estateagents/property/model/TpRoomNo.java
  30. 4
    1
      src/main/java/com/huiju/estateagents/property/model/TpTicket.java
  31. 4
    2
      src/main/java/com/huiju/estateagents/property/model/TpUnit.java
  32. 2
    2
      src/main/java/com/huiju/estateagents/property/service/BuildingTreeServiceI.java
  33. 1
    1
      src/main/java/com/huiju/estateagents/property/service/IBillService.java
  34. 7
    4
      src/main/java/com/huiju/estateagents/property/service/IBuildingOwnerInfoService.java
  35. 22
    0
      src/main/java/com/huiju/estateagents/property/service/ITaUserCommunityService.java
  36. 3
    1
      src/main/java/com/huiju/estateagents/property/service/ITaUserVerifyService.java
  37. 19
    0
      src/main/java/com/huiju/estateagents/property/service/ITpCommunityService.java
  38. 4
    4
      src/main/java/com/huiju/estateagents/property/service/impl/BillServiceImpl.java
  39. 16
    17
      src/main/java/com/huiju/estateagents/property/service/impl/BuildingOwnerInfoServiceImpl.java
  40. 17
    4
      src/main/java/com/huiju/estateagents/property/service/impl/BuildingTreeServiceImpl.java
  41. 63
    0
      src/main/java/com/huiju/estateagents/property/service/impl/TaUserCommunityServiceImpl.java
  42. 2
    6
      src/main/java/com/huiju/estateagents/property/service/impl/TaUserVerifyServiceImpl.java
  43. 1
    0
      src/main/java/com/huiju/estateagents/property/service/impl/TpAnnouncementServiceImpl.java
  44. 32
    0
      src/main/java/com/huiju/estateagents/property/service/impl/TpCommunityServiceImpl.java
  45. 4
    2
      src/main/resources/mapper/TaUserAuthMenuMapper.xml
  46. 32
    0
      src/main/resources/mapper/TaUserMapper.xml
  47. 4
    0
      src/main/resources/mapper/property/AnnouncementTelMapper.xml
  48. 5
    0
      src/main/resources/mapper/property/TaUserCommunityMapper.xml
  49. 2
    1
      src/main/resources/mapper/property/TaUserVerifyMapper.xml
  50. 1
    0
      src/main/resources/mapper/property/TpAnnouncementMapper.xml
  51. 16
    0
      src/main/resources/mapper/property/TpCommunityMapper.xml
  52. 3
    0
      src/main/resources/mapper/property/TpRoomNoMapper.xml
  53. 2
    0
      src/main/resources/mapper/property/TpTicketMapper.xml

+ 0
- 114
.mvn/wrapper/MavenWrapperDownloader.java 查看文件

@@ -1,114 +0,0 @@
1
-/*
2
-Licensed to the Apache Software Foundation (ASF) under one
3
-or more contributor license agreements.  See the NOTICE file
4
-distributed with this work for additional information
5
-regarding copyright ownership.  The ASF licenses this file
6
-to you under the Apache License, Version 2.0 (the
7
-"License"); you may not use this file except in compliance
8
-with the License.  You may obtain a copy of the License at
9
-
10
-  https://www.apache.org/licenses/LICENSE-2.0
11
-
12
-Unless required by applicable law or agreed to in writing,
13
-software distributed under the License is distributed on an
14
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
-KIND, either express or implied.  See the License for the
16
-specific language governing permissions and limitations
17
-under the License.
18
-*/
19
-
20
-import java.io.File;
21
-import java.io.FileInputStream;
22
-import java.io.FileOutputStream;
23
-import java.io.IOException;
24
-import java.net.URL;
25
-import java.nio.channels.Channels;
26
-import java.nio.channels.ReadableByteChannel;
27
-import java.util.Properties;
28
-
29
-public class MavenWrapperDownloader {
30
-
31
-    /**
32
-     * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
33
-     */
34
-    private static final String DEFAULT_DOWNLOAD_URL =
35
-            "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar";
36
-
37
-    /**
38
-     * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
39
-     * use instead of the default one.
40
-     */
41
-    private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
42
-            ".mvn/wrapper/maven-wrapper.properties";
43
-
44
-    /**
45
-     * Path where the maven-wrapper.jar will be saved to.
46
-     */
47
-    private static final String MAVEN_WRAPPER_JAR_PATH =
48
-            ".mvn/wrapper/maven-wrapper.jar";
49
-
50
-    /**
51
-     * Name of the property which should be used to override the default download url for the wrapper.
52
-     */
53
-    private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
54
-
55
-    public static void main(String args[]) {
56
-        System.out.println("- Downloader started");
57
-        File baseDirectory = new File(args[0]);
58
-        System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
59
-
60
-        // If the maven-wrapper.properties exists, read it and check if it contains a custom
61
-        // wrapperUrl parameter.
62
-        File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
63
-        String url = DEFAULT_DOWNLOAD_URL;
64
-        if(mavenWrapperPropertyFile.exists()) {
65
-            FileInputStream mavenWrapperPropertyFileInputStream = null;
66
-            try {
67
-                mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
68
-                Properties mavenWrapperProperties = new Properties();
69
-                mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
70
-                url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
71
-            } catch (IOException e) {
72
-                System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
73
-            } finally {
74
-                try {
75
-                    if(mavenWrapperPropertyFileInputStream != null) {
76
-                        mavenWrapperPropertyFileInputStream.close();
77
-                    }
78
-                } catch (IOException e) {
79
-                    // Ignore ...
80
-                }
81
-            }
82
-        }
83
-        System.out.println("- Downloading from: : " + url);
84
-
85
-        File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
86
-        if(!outputFile.getParentFile().exists()) {
87
-            if(!outputFile.getParentFile().mkdirs()) {
88
-                System.out.println(
89
-                        "- ERROR creating output direcrory '" + outputFile.getParentFile().getAbsolutePath() + "'");
90
-            }
91
-        }
92
-        System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
93
-        try {
94
-            downloadFileFromURL(url, outputFile);
95
-            System.out.println("Done");
96
-            System.exit(0);
97
-        } catch (Throwable e) {
98
-            System.out.println("- Error downloading");
99
-            e.printStackTrace();
100
-            System.exit(1);
101
-        }
102
-    }
103
-
104
-    private static void downloadFileFromURL(String urlString, File destination) throws Exception {
105
-        URL website = new URL(urlString);
106
-        ReadableByteChannel rbc;
107
-        rbc = Channels.newChannel(website.openStream());
108
-        FileOutputStream fos = new FileOutputStream(destination);
109
-        fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
110
-        fos.close();
111
-        rbc.close();
112
-    }
113
-
114
-}

二进制
.mvn/wrapper/maven-wrapper.jar 查看文件


+ 0
- 1
.mvn/wrapper/maven-wrapper.properties 查看文件

@@ -1 +0,0 @@
1
-distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.0/apache-maven-3.6.0-bin.zip

+ 1
- 1
pom.xml 查看文件

@@ -10,7 +10,7 @@
10 10
 	</parent>
11 11
 	<groupId>com.huiju</groupId>
12 12
 	<artifactId>xiangsong</artifactId>
13
-	<version>1.0.58</version>
13
+	<version>1.0.59</version>
14 14
 	<name>xiangsong</name>
15 15
 	<description>香颂</description>
16 16
 

+ 20
- 20
src/main/java/com/huiju/estateagents/center/taUser/controller/TaUserController.java 查看文件

@@ -14,6 +14,9 @@ import com.huiju.estateagents.center.taUser.service.*;
14 14
 import com.huiju.estateagents.common.*;
15 15
 import com.huiju.estateagents.entity.*;
16 16
 import com.huiju.estateagents.mapper.TaRoleMapper;
17
+import com.huiju.estateagents.property.entity.TpCommunity;
18
+import com.huiju.estateagents.property.service.ITaUserCommunityService;
19
+import com.huiju.estateagents.property.service.ITpCommunityService;
17 20
 import com.huiju.estateagents.service.*;
18 21
 import io.swagger.annotations.ApiImplicitParam;
19 22
 import io.swagger.annotations.ApiImplicitParams;
@@ -84,6 +87,12 @@ public class TaUserController extends BaseController {
84 87
     @Autowired
85 88
     public ITpLifeConsultantEvaluateService iTpLifeConsultantEvaluateService;
86 89
 
90
+    @Autowired
91
+    public ITpCommunityService iTpCommunityService;
92
+
93
+    @Autowired
94
+    public ITaUserCommunityService iTaUserCommunityService;
95
+
87 96
     @Autowired
88 97
     public CaptchaUtils captchaUtils;
89 98
 
@@ -312,15 +321,20 @@ public class TaUserController extends BaseController {
312 321
             taUser.setOrgLogo(taOrg.getLogo());
313 322
             taUser.setOrgDesc(taOrg.getOrgDesc());
314 323
             taUser.setBossDisplay(taOrg.getBossDisplay());
324
+            //
325
+            taUser.setCommunityList(iTaUserCommunityService.getListBy(taUser.getOrgId(), taUser.getUserId()));
315 326
 
316 327
             //获取所有菜单
317 328
             List<SysMenu> allMenus = (List<SysMenu>) iTaUserAuthMenuService.getAllMenu(null, null,taUser.getOrgId(), roles).getData();
318 329
             List<SysButtonInMenu> allButtons = (List<SysButtonInMenu>) iTaUserAuthButtonService.getAllButton(null, null).getData();
319 330
 
331
+            // 获取所有社区
332
+            List<TpCommunity> communityList = iTpCommunityService.getAllByOrg(taUser.getOrgId());
320 333
 
321 334
             userMap.put("taUser", taUser);
322 335
             userMap.put("menuList", allMenus);
323 336
             userMap.put("buttonList", allButtons);
337
+            userMap.put("communityList", communityList);
324 338
             responseBean.addSuccess(userMap);
325 339
         }catch (Exception e){
326 340
             e.printStackTrace();
@@ -524,6 +538,9 @@ public class TaUserController extends BaseController {
524 538
                     taUser.setBuildingIds(buildings);
525 539
                 }
526 540
             }
541
+
542
+            taUser.setCommunityList(iTaUserCommunityService.getListBy(taUser.getOrgId(), taUser.getUserId()));
543
+
527 544
             responseBean.addSuccess(taUser);
528 545
         }catch (Exception e){
529 546
             e.printStackTrace();
@@ -610,34 +627,17 @@ public class TaUserController extends BaseController {
610 627
     public ResponseBean lifeConsultantList(@PathVariable String client,
611 628
                                            @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
612 629
                                            @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
630
+                                           @RequestParam(value ="communityId") Integer communityId,
613 631
                                            @RequestParam(value ="userName", required = false) String userName,
614 632
                                            @RequestParam(value ="phone", required = false) String phone,
615 633
                                            HttpServletRequest request){
616 634
         ResponseBean responseBean = new ResponseBean();
635
+        String month = new SimpleDateFormat("yyyyMM").format(new Date());
617 636
         try {
618 637
             //使用分页插件
619 638
             IPage<TaUser> pg = new Page<TaUser>(pageNum, pageSize);
620
-            LambdaQueryWrapper<TaUser> queryWrapper = new LambdaQueryWrapper<>();
621
-            queryWrapper.eq(TaUser::getOrgId,getOrgId(request));
622
-            queryWrapper.eq(TaUser::getType,"life-consultant");
623
-            queryWrapper.like(!StringUtils.isEmpty(userName), TaUser::getUserName,"%"+ userName + "%");
624
-            queryWrapper.like(!StringUtils.isEmpty(phone), TaUser::getPhone,"%"+ phone + "%");
625
-            queryWrapper.orderByDesc(TaUser::getCreateDate);
626
-            IPage<TaUser> result = iTaUserService.page(pg,queryWrapper);
627
-            List<TaUser> records = result.getRecords();
628
-            records.forEach(e -> {
629
-                LambdaQueryWrapper<TpLifeConsultantEvaluate> evaluateQueryWrapper = new LambdaQueryWrapper<>();
630
-                evaluateQueryWrapper.eq(TpLifeConsultantEvaluate::getOrgId,getOrgId(request));
631
-                evaluateQueryWrapper.eq(TpLifeConsultantEvaluate::getUserId,e.getUserId());
632
-                evaluateQueryWrapper.eq(TpLifeConsultantEvaluate::getEvaluateTime,new SimpleDateFormat("yyyyMM").format(new Date()));
633
-                List<TpLifeConsultantEvaluate> list = iTpLifeConsultantEvaluateService.list(evaluateQueryWrapper);
634
-                if (list.size() > 0){
635
-                    double asDouble = list.stream().mapToInt(TpLifeConsultantEvaluate::getScore).average().getAsDouble();
636
-                    // 平均分
637
-                    e.setAverageScore(asDouble);
639
+            IPage<TaUser> result = iTaUserService.getLifeConsultants(pg, getOrgId(request), communityId, month, userName, phone);
638 640
 
639
-                }
640
-            });
641 641
             responseBean.addSuccess(result);
642 642
         }catch (Exception e){
643 643
             e.printStackTrace();

+ 7
- 0
src/main/java/com/huiju/estateagents/center/taUser/entity/TaUser.java 查看文件

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
5 5
 import com.baomidou.mybatisplus.annotation.TableField;
6 6
 import com.baomidou.mybatisplus.annotation.TableId;
7 7
 import com.huiju.estateagents.entity.*;
8
+import com.huiju.estateagents.property.entity.TpCommunity;
8 9
 import lombok.Data;
9 10
 import lombok.EqualsAndHashCode;
10 11
 import lombok.experimental.Accessors;
@@ -289,4 +290,10 @@ public class TaUser implements Serializable {
289 290
      */
290 291
     @TableField(exist = false)
291 292
     private Double averageScore;
293
+
294
+    /**
295
+     * 授权的社区
296
+     */
297
+    @TableField(exist = false)
298
+    private List<TpCommunity> communityList;
292 299
 }

+ 7
- 0
src/main/java/com/huiju/estateagents/center/taUser/mapper/TaUserMapper.java 查看文件

@@ -38,4 +38,11 @@ public interface TaUserMapper extends BaseMapper<TaUser> {
38 38
     List<String> getBuildingIdsOf(@Param("userId") Integer userId,@Param("buildingId") String buildingId);
39 39
 
40 40
     TaUser getUserByPerson(@Param("orgId") Integer orgId, @Param("personId") String personId);
41
+
42
+    IPage<TaUser> getLifeConsultants(IPage<TaUser> pg,
43
+                                     @Param("orgId")  Integer orgId,
44
+                                     @Param("communityId")  Integer communityId,
45
+                                     @Param("month")  String month,
46
+                                     @Param("userName")  String userName,
47
+                                     @Param("phone") String phone);
41 48
 }

+ 2
- 0
src/main/java/com/huiju/estateagents/center/taUser/service/ITaUserService.java 查看文件

@@ -75,4 +75,6 @@ public interface ITaUserService extends IService<TaUser> {
75 75
      * @return
76 76
      */
77 77
     TaUser getUserInfoById(Integer userId, Integer orgId);
78
+
79
+    IPage<TaUser> getLifeConsultants(IPage<TaUser> pg, Integer orgId, Integer communityId, String month, String userName, String phone);
78 80
 }

+ 25
- 0
src/main/java/com/huiju/estateagents/center/taUser/service/impl/TaUserServiceImpl.java 查看文件

@@ -22,6 +22,9 @@ import com.huiju.estateagents.common.StringUtils;
22 22
 import com.huiju.estateagents.common.WxUtils;
23 23
 import com.huiju.estateagents.entity.*;
24 24
 import com.huiju.estateagents.mapper.*;
25
+import com.huiju.estateagents.property.entity.TaUserCommunity;
26
+import com.huiju.estateagents.property.entity.TpCommunity;
27
+import com.huiju.estateagents.property.service.ITaUserCommunityService;
25 28
 import com.huiju.estateagents.service.*;
26 29
 import org.apache.commons.collections.CollectionUtils;
27 30
 import org.springframework.beans.factory.annotation.Autowired;
@@ -98,6 +101,9 @@ public class TaUserServiceImpl extends ServiceImpl<TaUserMapper, TaUser> impleme
98 101
     @Autowired
99 102
     private TaChannelProxyMapper taChannelProxyMapper;
100 103
 
104
+    @Autowired
105
+    private ITaUserCommunityService iTaUserCommunityService;
106
+
101 107
     @Autowired
102 108
     private WxUtils wxUtils;
103 109
 
@@ -495,6 +501,13 @@ public class TaUserServiceImpl extends ServiceImpl<TaUserMapper, TaUser> impleme
495 501
             });
496 502
         }
497 503
 
504
+        // 保存授权小区
505
+        if (null == taUser.getCommunityList() || taUser.getCommunityList().size() < 1) {
506
+            throw new Exception("未授权小区");
507
+        }
508
+
509
+        iTaUserCommunityService.addUserCommunity(taUser.getOrgId(), taUser.getUserId(), taUser.getCommunityList());
510
+
498 511
         return taUser;
499 512
     }
500 513
 
@@ -588,6 +601,13 @@ public class TaUserServiceImpl extends ServiceImpl<TaUserMapper, TaUser> impleme
588 601
             });
589 602
         }
590 603
 
604
+        // 保存授权小区
605
+        if (null == taUser.getCommunityList() || taUser.getCommunityList().size() < 1) {
606
+            throw new Exception("未授权小区");
607
+        }
608
+
609
+        iTaUserCommunityService.addUserCommunity(taUser.getOrgId(), taUser.getUserId(), taUser.getCommunityList());
610
+
591 611
         //更新person
592 612
         TaPerson taPerson = new TaPerson();
593 613
         taPerson.setAvatarurl(taUser.getAvatar());
@@ -697,6 +717,11 @@ public class TaUserServiceImpl extends ServiceImpl<TaUserMapper, TaUser> impleme
697 717
         return getOne(userQueryWrapper);
698 718
     }
699 719
 
720
+    @Override
721
+    public IPage<TaUser> getLifeConsultants(IPage<TaUser> pg, Integer orgId, Integer communityId, String month, String userName, String phone) {
722
+        return taUserMapper.getLifeConsultants(pg, orgId, communityId, month, userName, phone);
723
+    }
724
+
700 725
     private boolean updateUserStatus(TaUser user) {
701 726
         UpdateWrapper<TaUser> updateWrapper = new UpdateWrapper<>();
702 727
         updateWrapper.eq("user_id", user.getUserId());

+ 5
- 1
src/main/java/com/huiju/estateagents/property/controller/AnnouncementTelController.java 查看文件

@@ -48,7 +48,9 @@ public class AnnouncementTelController extends BaseController {
48 48
 
49 49
 	})
50 50
 	@RequestMapping(value = "/admin/announcement-tels",method = RequestMethod.GET)
51
-	public ResponseBean getList(@RequestParam(value = "name", required = false) String name,
51
+	public ResponseBean getList(@RequestParam(value = "type") String type,
52
+								@RequestParam(value = "communityId", required = false) Integer communityId,
53
+								@RequestParam(value = "name", required = false) String name,
52 54
                                 @RequestParam(value = "tel", required = false) String tel,
53 55
                                 @RequestParam(value = "remark", required = false) String remark,
54 56
                                 @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
@@ -59,7 +61,9 @@ public class AnnouncementTelController extends BaseController {
59 61
 		announcementTel.setOrgId(userElement.getOrgId());
60 62
 		announcementTel.setName(name);
61 63
 		announcementTel.setTel(tel);
64
+		announcementTel.setType(type);
62 65
 		announcementTel.setRemark(remark);
66
+		announcementTel.setCommunityId(communityId);
63 67
 		responseBean = announcementTelService.getTelList(announcementTel,pageNum,pageSize);
64 68
 		return responseBean;
65 69
 	}

+ 4
- 3
src/main/java/com/huiju/estateagents/property/controller/BillController.java 查看文件

@@ -149,11 +149,12 @@ public class BillController extends BaseController {
149 149
 
150 150
     })
151 151
     @RequestMapping(value = "/admin/bill/downloadExcel", method = RequestMethod.GET)
152
-    public void exportExcel(@RequestParam(value = "phaseId",required = false) String phaseId,
152
+    public void exportExcel(@RequestParam(value = "phaseId") Integer communityId,
153
+                            @RequestParam(value = "phaseId",required = false) String phaseId,
153 154
                             @RequestParam(value = "buildingId",required = false) String buildingId,
154
-            HttpServletResponse response, HttpServletRequest request) {
155
+                            HttpServletResponse response, HttpServletRequest request) {
155 156
         TaUser userElement = getTaUser(request);
156
-        HSSFWorkbook workbook = (HSSFWorkbook) iBillService.downloadExcel(userElement,phaseId,buildingId).getData();
157
+        HSSFWorkbook workbook = (HSSFWorkbook) iBillService.downloadExcel(userElement,communityId, phaseId,buildingId).getData();
157 158
 //        this.setResponseHeader(response, "缴费单模板.xls");
158 159
         response.setContentType("application/octet-stream");
159 160
         response.setCharacterEncoding("utf-8");

+ 21
- 6
src/main/java/com/huiju/estateagents/property/controller/BuildingOwnerInfoController.java 查看文件

@@ -220,14 +220,25 @@ public class BuildingOwnerInfoController extends BaseController {
220 220
         return responseBean;
221 221
     }
222 222
 
223
+    private List<Integer> getCommunityIdsBy(String communityIds) {
224
+        List<Integer> communityIdList = new ArrayList<>();
225
+        String[] parts = communityIds.split(",");
226
+        for (String id : parts) {
227
+            communityIdList.add(Integer.parseInt(id));
228
+        }
229
+        return communityIdList;
230
+    }
231
+
223 232
     // @ApiOperation(value = "查询 期区", notes = "查询 期区")
224 233
     @ApiImplicitParams({
225 234
     })
226 235
     @RequestMapping(value = "/admin/buildingInfo/phase",method = RequestMethod.GET)
227
-    public ResponseBean getPhaseList(HttpServletRequest request){
236
+    public ResponseBean getPhaseList(@RequestParam Integer communityId,
237
+                                     HttpServletRequest request){
228 238
         ResponseBean responseBean = new ResponseBean();
239
+
229 240
         TaUser userElement = getTaUser(request);
230
-        responseBean = iBuildingOwnerInfoService.getPhaseList(userElement.getOrgId());
241
+        responseBean = iBuildingOwnerInfoService.getPhaseList(userElement.getOrgId(), communityId);
231 242
         return responseBean;
232 243
     }
233 244
     
@@ -289,11 +300,13 @@ public class BuildingOwnerInfoController extends BaseController {
289 300
  
290 301
     // @ApiOperation(value = "上传楼栋信息并入库", notes = "上传楼栋信息并入库")
291 302
     @PostMapping(value = "/admin/buildingInfo/submitExcel", consumes = "multipart/*", headers = "content-type=multipart/form-data")
292
-    public ResponseBean submitExcel(@RequestParam("file") MultipartFile file, HttpServletRequest request) {
303
+    public ResponseBean submitExcel(@RequestParam("file") MultipartFile file,
304
+                                    @RequestParam("communityId") Integer communityId,
305
+                                    HttpServletRequest request) {
293 306
         ResponseBean responseBean = new ResponseBean();
294 307
         TaUser userElement = getTaUser(request);
295 308
         try {
296
-            responseBean = iBuildingOwnerInfoService.submitExcelData(file,userElement);
309
+            responseBean = iBuildingOwnerInfoService.submitExcelData(file, communityId, userElement);
297 310
         }catch (Exception e){
298 311
             responseBean.addError("导入数据失败" + e.getMessage());
299 312
             e.printStackTrace();
@@ -364,9 +377,11 @@ public class BuildingOwnerInfoController extends BaseController {
364 377
 
365 378
     })
366 379
     @RequestMapping(value = "/admin/buildingInfo/downloadExcel", method = RequestMethod.GET)
367
-    public void exportExcel(HttpServletResponse response, HttpServletRequest request) {
380
+    public void exportExcel(@RequestParam Integer communityId,
381
+                            HttpServletResponse response,
382
+                            HttpServletRequest request) {
368 383
         TaUser userElement = getTaUser(request);
369
-        XSSFWorkbook workbook = (XSSFWorkbook) iBuildingOwnerInfoService.downloadExcel(userElement).getData();
384
+        XSSFWorkbook workbook = (XSSFWorkbook) iBuildingOwnerInfoService.downloadExcel(communityId, userElement).getData();
370 385
 //        this.setResponseHeader(response, "业主资料库.xlsx");
371 386
         response.setContentType("application/octet-stream");
372 387
         response.setCharacterEncoding("utf-8");

+ 8
- 2
src/main/java/com/huiju/estateagents/property/controller/BuildingTreeController.java 查看文件

@@ -40,10 +40,16 @@ public class BuildingTreeController extends BaseController {
40 40
 	
41 41
 	// @ApiOperation(value = "上传楼栋信息并入库", notes = "上传楼栋信息并入库")
42 42
 	@PostMapping(value = "/admin/buildingInfo/tree/submitExcel", consumes = "multipart/*", headers = "content-type=multipart/form-data")
43
-	public ResponseBean submitExcel(@RequestParam("file") MultipartFile file, HttpServletRequest request) {
43
+	public ResponseBean submitExcel(@RequestParam("file") MultipartFile file,
44
+									@RequestParam("communityId") Integer communityId,
45
+									HttpServletRequest request) {
46
+		if (null == communityId || communityId < 1) {
47
+			return ResponseBean.error("请设置上传小区", ResponseBean.ERROR_MISSING_PARAMS);
48
+		}
49
+
44 50
 		ResponseBean responseBean = new ResponseBean();
45 51
 		TaUser userElement = getTaUser(request);
46
-		responseBean = buildingTreeService.submitExcelData(file,userElement);
52
+		responseBean = buildingTreeService.submitExcelData(file, communityId, userElement);
47 53
 		return responseBean;
48 54
 	}
49 55
 	

+ 160
- 0
src/main/java/com/huiju/estateagents/property/controller/TpCommunityController.java 查看文件

@@ -0,0 +1,160 @@
1
+package com.huiju.estateagents.property.controller;
2
+
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
+import com.huiju.estateagents.base.BaseController;
7
+import com.huiju.estateagents.base.ResponseBean;
8
+import com.huiju.estateagents.common.CommConstant;
9
+import io.swagger.annotations.Api;
10
+import io.swagger.annotations.ApiOperation;
11
+import io.swagger.annotations.ApiParam;
12
+import org.slf4j.Logger;
13
+import org.slf4j.LoggerFactory;
14
+import org.springframework.beans.factory.annotation.Autowired;
15
+import org.springframework.web.bind.annotation.PathVariable;
16
+import org.springframework.web.bind.annotation.RequestBody;
17
+import org.springframework.web.bind.annotation.RequestMapping;
18
+import org.springframework.web.bind.annotation.RequestMethod;
19
+import org.springframework.web.bind.annotation.RequestParam;
20
+import com.huiju.estateagents.property.service.ITpCommunityService;
21
+import com.huiju.estateagents.property.entity.TpCommunity;
22
+import org.springframework.web.bind.annotation.RestController;
23
+
24
+import javax.servlet.http.HttpServletRequest;
25
+
26
+/**
27
+ * <p>
28
+    *  前端控制器
29
+    * </p>
30
+ *
31
+ * @author yansen
32
+ * @since 2021-01-19
33
+ */
34
+
35
+@Api(tags = "")
36
+@RestController
37
+@RequestMapping("/api")
38
+public class TpCommunityController extends BaseController {
39
+
40
+    private final Logger logger = LoggerFactory.getLogger(TpCommunityController.class);
41
+
42
+    @Autowired
43
+    public ITpCommunityService iTpCommunityService;
44
+
45
+
46
+    /**
47
+     * 分页查询列表
48
+     * @param pageNum
49
+     * @param pageSize
50
+     * @return
51
+     */
52
+    @RequestMapping(value="/{client}/tpCommunity",method= RequestMethod.GET)
53
+    @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
54
+    public ResponseBean tpCommunityList(@ApiParam(value = "客户端", allowableValues = "wx,admin") @PathVariable("client") String client,
55
+                                        @ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
56
+                                        @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
57
+                                        HttpServletRequest request) throws Exception{
58
+
59
+		    IPage<TpCommunity> pg = new Page<>(pageNum, pageSize);
60
+            QueryWrapper<TpCommunity> queryWrapper = new QueryWrapper<>();
61
+            queryWrapper.eq("org_id", getOrgId(request));
62
+            queryWrapper.eq("wx".equals(client), "status", CommConstant.STATUS_NORMAL);
63
+            queryWrapper.gt("admin".equals(client), "status", CommConstant.STATUS_DELETE);
64
+            queryWrapper.orderByDesc("create_date");
65
+
66
+            IPage<TpCommunity> result = iTpCommunityService.page(pg, queryWrapper);
67
+            return ResponseBean.success(result);
68
+    }
69
+
70
+    /**
71
+     * 保存对象
72
+     * @param tpCommunity 实体对象
73
+     * @return
74
+     */
75
+    @RequestMapping(value="/admin/tpCommunity",method= RequestMethod.POST)
76
+    @ApiOperation(value="保存", notes = "保存", httpMethod = "POST", response = ResponseBean.class)
77
+    public ResponseBean tpCommunityAdd(@ApiParam("保存内容") @RequestBody TpCommunity tpCommunity,
78
+                                       HttpServletRequest request) throws Exception{
79
+
80
+        tpCommunity.setOrgId(getOrgId(request));
81
+
82
+        if (iTpCommunityService.save(tpCommunity)){
83
+            return ResponseBean.success(tpCommunity);
84
+        }else {
85
+            return ResponseBean.error("保存失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
86
+        }
87
+    }
88
+
89
+    /**
90
+     * 根据id删除对象
91
+     * @param id  实体ID
92
+     */
93
+    @RequestMapping(value="/admin/tpCommunity/{id}", method= RequestMethod.DELETE)
94
+    @ApiOperation(value="删除", notes = "删除", httpMethod = "DELETE", response = ResponseBean.class)
95
+    public ResponseBean tpCommunityDelete(@ApiParam("对象ID") @PathVariable Integer id,
96
+                                          HttpServletRequest request) throws Exception{
97
+
98
+        TpCommunity tpCommunity = iTpCommunityService.getById(id);
99
+        if (null == tpCommunity || CommConstant.STATUS_DELETE.equals(tpCommunity.getStatus())) {
100
+            return ResponseBean.error("没有找到对应的社区信息", ResponseBean.ERROR_ILLEGAL_PARAMS);
101
+        }
102
+
103
+        Integer orgId = getOrgId(request);
104
+        if (!orgId.equals(tpCommunity.getOrgId())) {
105
+            return ResponseBean.error("暂无操作权限", ResponseBean.ERROR_ILLEGAL_PARAMS);
106
+        }
107
+
108
+        tpCommunity.setStatus(CommConstant.STATUS_DELETE);
109
+
110
+        return tpCommunityUpdate(id, tpCommunity, request);
111
+    }
112
+
113
+    /**
114
+     * 修改对象
115
+     * @param id  实体ID
116
+     * @param tpCommunity 实体对象
117
+     * @return
118
+     */
119
+    @RequestMapping(value="/admin/tpCommunity/{id}",method= RequestMethod.PUT)
120
+    @ApiOperation(value="更新", notes = "更新", httpMethod = "PUT", response = ResponseBean.class)
121
+    public ResponseBean tpCommunityUpdate(@ApiParam("对象ID") @PathVariable Integer id,
122
+                                          @ApiParam("更新内容") @RequestBody TpCommunity tpCommunity,
123
+                                          HttpServletRequest request) throws Exception{
124
+        tpCommunity.setId(id);
125
+
126
+        Integer orgId = getOrgId(request);
127
+        if (!orgId.equals(tpCommunity.getOrgId())) {
128
+            return ResponseBean.error("暂无操作权限", ResponseBean.ERROR_ILLEGAL_PARAMS);
129
+        }
130
+
131
+        if (iTpCommunityService.updateById(tpCommunity)){
132
+            return ResponseBean.success(iTpCommunityService.getById(id));
133
+        }else {
134
+            return ResponseBean.error("修改失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
135
+        }
136
+    }
137
+
138
+    /**
139
+     * 根据id查询对象
140
+     * @param id  实体ID
141
+     */
142
+    @RequestMapping(value="/{client}/tpCommunity/{id}",method= RequestMethod.GET)
143
+    @ApiOperation(value="详情", notes = "详情", httpMethod = "GET", response = ResponseBean.class)
144
+    public ResponseBean tpCommunityGet(@ApiParam(value = "客户端", allowableValues = "wx,admin") @PathVariable("client") String client,
145
+                                       @ApiParam("对象ID") @PathVariable Integer id,
146
+                                       HttpServletRequest request) throws Exception{
147
+
148
+        TpCommunity tpCommunity = iTpCommunityService.getById(id);
149
+        if (null == tpCommunity || CommConstant.STATUS_DELETE.equals(tpCommunity.getStatus())) {
150
+            return ResponseBean.error("没有找到对应的社区信息", ResponseBean.ERROR_ILLEGAL_PARAMS);
151
+        }
152
+
153
+        Integer orgId = getOrgId(request);
154
+        if (!orgId.equals(tpCommunity.getOrgId())) {
155
+            return ResponseBean.error("暂无操作权限", ResponseBean.ERROR_ILLEGAL_PARAMS);
156
+        }
157
+
158
+        return ResponseBean.success(tpCommunity);
159
+    }
160
+}

+ 4
- 2
src/main/java/com/huiju/estateagents/property/controller/UserVerifyController.java 查看文件

@@ -34,13 +34,15 @@ public class UserVerifyController extends BaseController {
34 34
     @RequestMapping(value = "/admin/prop-user/verify/all", method = RequestMethod.GET)
35 35
     // @ApiOperation(value = "获取待审核的用户列表", notes = "获取待审核的用户列表")
36 36
     @ApiImplicitParams({
37
+            @ApiImplicitParam(paramType = "query", dataTypeClass = String.class, name = "communityId", value = "小区ID"),
37 38
             @ApiImplicitParam(paramType = "query", dataTypeClass = String.class, name = "phone", value = "手机号"),
38 39
             @ApiImplicitParam(paramType = "query", dataTypeClass = String.class, name = "userName", value = "用户名"),
39 40
             @ApiImplicitParam(paramType = "query", dataTypeClass = String.class, name = "idCard", value = "身份证"),
40 41
             @ApiImplicitParam(paramType = "query", dataTypeClass = String.class, name = "pageNum", value = "第几页"),
41 42
             @ApiImplicitParam(paramType = "query", dataTypeClass = String.class, name = "pageSize", value = "一页多少行"),
42 43
     })
43
-    public ResponseBean getAll(@RequestParam(value = "phone", required = false) String phone,
44
+    public ResponseBean getAll(@RequestParam(value = "communityId") Integer communityId,
45
+                               @RequestParam(value = "phone", required = false) String phone,
44 46
                                @RequestParam(value = "userName", required = false) String userName,
45 47
                                @RequestParam(value = "idCard", required = false) String idCard,
46 48
                                @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
@@ -49,7 +51,7 @@ public class UserVerifyController extends BaseController {
49 51
 
50 52
         ResponseBean responseBean = new ResponseBean();
51 53
         TaUser userElement = getTaUser(request);
52
-        responseBean = iTaUserVerifyService.selectAll(phone, userName, idCard, pageNum, pageSize, userElement);
54
+        responseBean = iTaUserVerifyService.selectAll(communityId, phone, userName, idCard, pageNum, pageSize, userElement);
53 55
         return responseBean;
54 56
     }
55 57
 

+ 2
- 1
src/main/java/com/huiju/estateagents/property/dao/TaUserVerifyMapper.java 查看文件

@@ -23,12 +23,13 @@ public interface TaUserVerifyMapper extends BaseMapper<TaUserVerify> {
23 23
     /**
24 24
      * 根据 手机号 、用户名、身份证
25 25
      * @param page
26
+     * @param communityId
26 27
      * @param phone
27 28
      * @param userName
28 29
      * @param idCard
29 30
      * @return
30 31
      */
31
-    IPage<TaUserVerify> selectAllByPhoneAndUserNameAndIdCard(Page page, @Param("phone") String phone, @Param("userName") String userName, @Param("idCard") String idCard, @Param("orgId") Integer orgId);
32
+    IPage<TaUserVerify> selectAllByPhoneAndUserNameAndIdCard(Page page, Integer communityId, @Param("phone") String phone, @Param("userName") String userName, @Param("idCard") String idCard, @Param("orgId") Integer orgId);
32 33
 
33 34
     /**
34 35
      * 根据 小区id 、 小区、期、栋、单元、楼层、户号 进行条件查询出 已审核通过的并且是业主

+ 3
- 3
src/main/java/com/huiju/estateagents/property/dao/TpRoomNoMapper.java 查看文件

@@ -47,7 +47,7 @@ public interface TpRoomNoMapper extends BaseMapper<TpRoomNo> {
47 47
      */
48 48
     @ResultType(TpRoomNo.class)
49 49
 //    @Select("select * from tp_room_no where org_id = #{orgId} limit #{pageNum},#{pageSize}")
50
-    List<TpRoomNo> selectCommunityIdList(@Param("orgId") Integer orgId, @Param("pageNum") Integer pageNum, @Param("pageSize") Integer pageSize);
50
+    List<TpRoomNo> selectCommunityIdList(@Param("orgId") Integer orgId, @Param("communityId") Integer communityId, @Param("pageNum") Integer pageNum, @Param("pageSize") Integer pageSize);
51 51
 
52 52
     /**
53 53
      * 查询数据,分页
@@ -56,7 +56,7 @@ public interface TpRoomNoMapper extends BaseMapper<TpRoomNo> {
56 56
      */
57 57
     @ResultType(Long.class)
58 58
 //    @Select("select count(1) from tp_room_no where org_id = #{orgId}")
59
-    Long selectCommunityIdCount(@Param("orgId") Integer orgId);
59
+    Long selectCommunityIdCount(@Param("orgId") Integer orgId, @Param("communityId") Integer communityId);
60 60
 
61 61
     @ResultType(TpRoomNo.class)
62 62
 //    @Select("select * from tp_room_no where org_id=#{orgId} " +
@@ -66,7 +66,7 @@ public interface TpRoomNoMapper extends BaseMapper<TpRoomNo> {
66 66
 //            "and level_id=#{levelId}")
67 67
     List<TpRoomNo> selectByAddress(Integer orgId, Integer phaseId, Integer buildingId, Integer unitId, Integer levelId);
68 68
 
69
-    List<TpRoomNo> selectComunityList(@Param("orgId") Integer orgId, @Param("phaseId") String phaseId, @Param("buildingId") String buildingId, @Param("pageNum") Integer pageNum, @Param("pageSize") Integer pageSize);
69
+    List<TpRoomNo> selectComunityList(@Param("orgId") Integer orgId, @Param("communityId") Integer communityId, @Param("phaseId") String phaseId, @Param("buildingId") String buildingId, @Param("pageNum") Integer pageNum, @Param("pageSize") Integer pageSize);
70 70
 
71 71
     IPage<TpRoomNo> getRoomList(IPage<TpRoomNo> page, @Param("orgId") Integer orgId,@Param("phaseId") Integer phaseId,@Param("buildingId") Integer buildingId,@Param("unitId") Integer unitId,@Param("levelId") Integer levelId,@Param("roomNoId") Integer roomNoId);
72 72
 

+ 44
- 0
src/main/java/com/huiju/estateagents/property/entity/TaUserCommunity.java 查看文件

@@ -0,0 +1,44 @@
1
+package com.huiju.estateagents.property.entity;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
5
+import io.swagger.annotations.ApiModel;
6
+import io.swagger.annotations.ApiModelProperty;
7
+import lombok.Data;
8
+import lombok.EqualsAndHashCode;
9
+import lombok.experimental.Accessors;
10
+
11
+import java.io.Serializable;
12
+import java.time.LocalDateTime;
13
+
14
+/**
15
+ * <p>
16
+ * 
17
+ * </p>
18
+ *
19
+ * @author yansen
20
+ * @since 2021-01-19
21
+ */
22
+@Data
23
+@EqualsAndHashCode(callSuper = false)
24
+@Accessors(chain = true)
25
+@ApiModel(value="TaUserCommunity对象", description="")
26
+public class TaUserCommunity implements Serializable {
27
+
28
+    private static final long serialVersionUID = 1L;
29
+
30
+    @ApiModelProperty(value = "主键")
31
+    @TableId(value = "serial_no", type = IdType.AUTO)
32
+    private Integer serialNo;
33
+
34
+    @ApiModelProperty(value = "用户ID")
35
+    private Integer userId;
36
+
37
+    @ApiModelProperty(value = "小区ID")
38
+    private Integer communityId;
39
+
40
+    @ApiModelProperty(value = "所属机构")
41
+    private Integer orgId;
42
+
43
+
44
+}

+ 46
- 0
src/main/java/com/huiju/estateagents/property/entity/TpCommunity.java 查看文件

@@ -0,0 +1,46 @@
1
+package com.huiju.estateagents.property.entity;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import java.time.LocalDateTime;
5
+import com.baomidou.mybatisplus.annotation.TableId;
6
+import java.io.Serializable;
7
+import io.swagger.annotations.ApiModel;
8
+import io.swagger.annotations.ApiModelProperty;
9
+import lombok.Data;
10
+import lombok.EqualsAndHashCode;
11
+import lombok.experimental.Accessors;
12
+
13
+/**
14
+ * <p>
15
+ * 
16
+ * </p>
17
+ *
18
+ * @author yansen
19
+ * @since 2021-01-19
20
+ */
21
+@Data
22
+@EqualsAndHashCode(callSuper = false)
23
+@Accessors(chain = true)
24
+@ApiModel(value="TpCommunity对象", description="")
25
+public class TpCommunity implements Serializable {
26
+
27
+    private static final long serialVersionUID = 1L;
28
+
29
+    @ApiModelProperty(value = "小区ID")
30
+    @TableId(value = "id", type = IdType.AUTO)
31
+    private Integer id;
32
+
33
+    @ApiModelProperty(value = "小区名称")
34
+    private String name;
35
+
36
+    @ApiModelProperty(value = "状态")
37
+    private Integer status;
38
+
39
+    @ApiModelProperty(value = "创建时间")
40
+    private LocalDateTime createDate;
41
+
42
+    @ApiModelProperty(value = "所属机构")
43
+    private Integer orgId;
44
+
45
+
46
+}

+ 18
- 0
src/main/java/com/huiju/estateagents/property/mapper/TaUserCommunityMapper.java 查看文件

@@ -0,0 +1,18 @@
1
+package com.huiju.estateagents.property.mapper;
2
+
3
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.huiju.estateagents.property.entity.TaUserCommunity;
5
+import org.apache.ibatis.annotations.Mapper;
6
+
7
+/**
8
+ * <p>
9
+ *  Mapper 接口
10
+ * </p>
11
+ *
12
+ * @author yansen
13
+ * @since 2021-01-19
14
+ */
15
+@Mapper
16
+public interface TaUserCommunityMapper extends BaseMapper<TaUserCommunity> {
17
+
18
+}

+ 21
- 0
src/main/java/com/huiju/estateagents/property/mapper/TpCommunityMapper.java 查看文件

@@ -0,0 +1,21 @@
1
+package com.huiju.estateagents.property.mapper;
2
+
3
+import com.huiju.estateagents.property.entity.TpCommunity;
4
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
+import org.apache.ibatis.annotations.Mapper;
6
+
7
+import java.util.List;
8
+
9
+/**
10
+ * <p>
11
+ *  Mapper 接口
12
+ * </p>
13
+ *
14
+ * @author yansen
15
+ * @since 2021-01-19
16
+ */
17
+@Mapper
18
+public interface TpCommunityMapper extends BaseMapper<TpCommunity> {
19
+
20
+    List<TpCommunity> getListOfUser(Integer orgId, Integer userId);
21
+}

+ 3
- 1
src/main/java/com/huiju/estateagents/property/model/AnnouncementTel.java 查看文件

@@ -31,10 +31,12 @@ public class AnnouncementTel implements Serializable {
31 31
     @TableId(value = "id", type = IdType.AUTO)
32 32
     private Integer id;
33 33
 
34
+    private Integer orgId;
35
+
34 36
     /**
35 37
      * 小区id
36 38
      */
37
-    private Integer orgId;
39
+    private Integer communityId;
38 40
 
39 41
     /**
40 42
      * 电话名称

+ 3
- 1
src/main/java/com/huiju/estateagents/property/model/TaUserVerify.java 查看文件

@@ -33,10 +33,12 @@ public class TaUserVerify implements Serializable {
33 33
      */
34 34
     private String personId;
35 35
 
36
+    private Integer orgId;
37
+
36 38
     /**
37 39
      * 小区id
38 40
      */
39
-    private Integer orgId;
41
+    private Integer communityId;
40 42
 
41 43
     /**
42 44
      * 角色ID

+ 3
- 1
src/main/java/com/huiju/estateagents/property/model/TpAnnouncement.java 查看文件

@@ -22,9 +22,11 @@ public class TpAnnouncement implements Serializable {
22 22
     @TableId(value = "id", type = IdType.AUTO)
23 23
     private Integer id;
24 24
 
25
-    /** 小区id**/
26 25
     private Integer orgId;
27 26
 
27
+    /** 小区id**/
28
+    private Integer communityId;
29
+
28 30
     /**公告标题**/
29 31
     private String announcementTitle;
30 32
 

+ 4
- 1
src/main/java/com/huiju/estateagents/property/model/TpBuilding.java 查看文件

@@ -16,10 +16,13 @@ public class TpBuilding implements Serializable {
16 16
 	
17 17
 	@TableId(value = "id", type = IdType.AUTO)
18 18
     private Integer id;
19
+
20
+    private Integer orgId;
21
+
19 22
     /**
20 23
      * 小区ID
21 24
      */
22
-    private Integer orgId;
25
+    private Integer communityId;
23 26
     
24 27
     /**
25 28
      * 期区id

+ 4
- 2
src/main/java/com/huiju/estateagents/property/model/TpBuildingOwnerInfo.java 查看文件

@@ -32,11 +32,13 @@ public class TpBuildingOwnerInfo implements Serializable {
32 32
      */
33 33
     @TableId(value = "id", type = IdType.AUTO)
34 34
     private Integer id;
35
-    
35
+
36
+    private Integer orgId;
37
+
36 38
     /**
37 39
      * 小区id
38 40
      */
39
-    private Integer orgId;
41
+    private Integer communityId;
40 42
     
41 43
     /**
42 44
      * 身份证号码

+ 4
- 2
src/main/java/com/huiju/estateagents/property/model/TpLevel.java 查看文件

@@ -28,11 +28,13 @@ public class TpLevel implements Serializable {
28 28
     
29 29
     @TableId(value = "id", type = IdType.AUTO)
30 30
     private Integer id;
31
-    
31
+
32
+    private Integer orgId;
33
+
32 34
     /**
33 35
      * 小区ID
34 36
      */
35
-    private Integer orgId;
37
+    private Integer communityId;
36 38
 
37 39
     /**
38 40
      * 期区ID

+ 6
- 4
src/main/java/com/huiju/estateagents/property/model/TpPhase.java 查看文件

@@ -28,10 +28,7 @@ public class TpPhase implements Serializable {
28 28
     
29 29
     @TableId(value = "id", type = IdType.AUTO)
30 30
     private Integer id;
31
-    
32
-    /**
33
-     * 小区ID
34
-     */
31
+
35 32
     private Integer orgId;
36 33
 
37 34
     /**
@@ -43,4 +40,9 @@ public class TpPhase implements Serializable {
43 40
      * 创建时间
44 41
      */
45 42
     private LocalDateTime createDate;
43
+
44
+    /**
45
+     * 小区ID
46
+     */
47
+    private Integer communityId;
46 48
 }

+ 5
- 3
src/main/java/com/huiju/estateagents/property/model/TpRoomNo.java 查看文件

@@ -28,11 +28,13 @@ public class TpRoomNo implements Serializable {
28 28
     
29 29
     @TableId(value = "id", type = IdType.AUTO)
30 30
     private Integer id;
31
-    
31
+
32
+    private Integer orgId;
33
+
32 34
     /**
33
-     * 小区id
35
+     * 小区ID
34 36
      */
35
-    private Integer orgId;
37
+    private Integer communityId;
36 38
 
37 39
     /**
38 40
      * 期区ID

+ 4
- 1
src/main/java/com/huiju/estateagents/property/model/TpTicket.java 查看文件

@@ -33,10 +33,13 @@ public class TpTicket implements Serializable {
33 33
      */
34 34
     @TableId(value = "id", type = IdType.AUTO)
35 35
     private Integer id;
36
+
37
+    private Integer orgId;
38
+
36 39
     /**
37 40
      * 小区id
38 41
      */
39
-    private Integer orgId;
42
+    private Integer communityId;
40 43
 
41 44
     /**
42 45
      * 住户app的id

+ 4
- 2
src/main/java/com/huiju/estateagents/property/model/TpUnit.java 查看文件

@@ -28,11 +28,13 @@ public class TpUnit implements Serializable {
28 28
     
29 29
     @TableId(value = "id", type = IdType.AUTO)
30 30
     private Integer id;
31
-    
31
+
32
+    private Integer orgId;
33
+
32 34
     /**
33 35
      * 小区ID
34 36
      */
35
-    private Integer orgId;
37
+    private Integer communityId;
36 38
 
37 39
     /**
38 40
      * 期区ID

+ 2
- 2
src/main/java/com/huiju/estateagents/property/service/BuildingTreeServiceI.java 查看文件

@@ -3,7 +3,6 @@ package com.huiju.estateagents.property.service;
3 3
 import com.baomidou.mybatisplus.core.metadata.IPage;
4 4
 import com.huiju.estateagents.base.ResponseBean;
5 5
 import com.huiju.estateagents.center.taUser.entity.TaUser;
6
-import com.huiju.estateagents.property.common.UserElement;
7 6
 import com.huiju.estateagents.property.model.TpRoomNo;
8 7
 import org.springframework.web.multipart.MultipartFile;
9 8
 
@@ -21,10 +20,11 @@ public interface BuildingTreeServiceI {
21 20
 	/**
22 21
 	 * 上传小区的基础数据
23 22
 	 * @param file
23
+	 * @param communityId
24 24
 	 * @param userElement
25 25
 	 * @return
26 26
 	 */
27
-	ResponseBean submitExcelData(MultipartFile file, TaUser userElement);
27
+	ResponseBean submitExcelData(MultipartFile file, Integer communityId, TaUser userElement);
28 28
 	
29 29
 	/**
30 30
 	 * 获取树形数据

+ 1
- 1
src/main/java/com/huiju/estateagents/property/service/IBillService.java 查看文件

@@ -86,7 +86,7 @@ public interface IBillService extends IService<Bill> {
86 86
 	 * @param userElement
87 87
 	 * @return
88 88
 	 */
89
-	ResponseBean downloadExcel(TaUser userElement,String phaseId,String buildingId);
89
+	ResponseBean downloadExcel(TaUser userElement, Integer communityId, String phaseId,String buildingId);
90 90
 
91 91
 	/**
92 92
 	 * 根据payType分页获取缴费或未缴费的数据

+ 7
- 4
src/main/java/com/huiju/estateagents/property/service/IBuildingOwnerInfoService.java 查看文件

@@ -3,7 +3,6 @@ package com.huiju.estateagents.property.service;
3 3
 import com.baomidou.mybatisplus.extension.service.IService;
4 4
 import com.huiju.estateagents.base.ResponseBean;
5 5
 import com.huiju.estateagents.center.taUser.entity.TaUser;
6
-import com.huiju.estateagents.property.common.UserElement;
7 6
 import com.huiju.estateagents.property.model.TpBuildingOwnerInfo;
8 7
 import org.springframework.web.multipart.MultipartFile;
9 8
 
@@ -62,17 +61,19 @@ public interface IBuildingOwnerInfoService extends IService<TpBuildingOwnerInfo>
62 61
      *   楼栋是根据 小区ID查询
63 62
      *
64 63
      * @param orgId
64
+     * @param communityId
65 65
      * @return
66 66
      */
67
-    ResponseBean getPhaseList(Integer orgId);
67
+    ResponseBean getPhaseList(Integer orgId, Integer communityId);
68 68
     
69 69
     /**
70 70
      * 上传excel里面的内容
71 71
      * @param file
72
+     * @param communityId
72 73
      * @param userElement
73 74
      * @return
74 75
      */
75
-    ResponseBean submitExcelData(MultipartFile file, TaUser userElement);
76
+    ResponseBean submitExcelData(MultipartFile file, Integer communityId, TaUser userElement);
76 77
 
77 78
     /**
78 79
      * 认证用户是否停用
@@ -115,10 +116,12 @@ public interface IBuildingOwnerInfoService extends IService<TpBuildingOwnerInfo>
115 116
 
116 117
     /**
117 118
      * 下载Excel模板(小区楼栋信息)
119
+     *
120
+     * @param communityId
118 121
      * @param userElement
119 122
      * @return
120 123
      */
121
-    ResponseBean downloadExcel(TaUser userElement);
124
+    ResponseBean downloadExcel(Integer communityId, TaUser userElement);
122 125
     
123 126
     /**
124 127
      * 获取楼栋信息

+ 22
- 0
src/main/java/com/huiju/estateagents/property/service/ITaUserCommunityService.java 查看文件

@@ -0,0 +1,22 @@
1
+package com.huiju.estateagents.property.service;
2
+
3
+import com.baomidou.mybatisplus.extension.service.IService;
4
+import com.huiju.estateagents.property.entity.TaUserCommunity;
5
+import com.huiju.estateagents.property.entity.TpCommunity;
6
+
7
+import java.util.List;
8
+
9
+/**
10
+ * <p>
11
+ *  服务类
12
+ * </p>
13
+ *
14
+ * @author yansen
15
+ * @since 2021-01-19
16
+ */
17
+public interface ITaUserCommunityService extends IService<TaUserCommunity> {
18
+
19
+    List<TpCommunity> getListBy(Integer orgId, Integer userId);
20
+
21
+    boolean addUserCommunity(Integer orgId, Integer userId, List<TpCommunity> communityList) throws Exception;
22
+}

+ 3
- 1
src/main/java/com/huiju/estateagents/property/service/ITaUserVerifyService.java 查看文件

@@ -16,6 +16,8 @@ public interface ITaUserVerifyService extends IService<TaUserVerify> {
16 16
 
17 17
     /**
18 18
      * 查询 所有审核数据
19
+     *
20
+     * @param communityId
19 21
      * @param phone
20 22
      * @param userName
21 23
      * @param idCard
@@ -24,7 +26,7 @@ public interface ITaUserVerifyService extends IService<TaUserVerify> {
24 26
      * @param userElement
25 27
      * @return
26 28
      */
27
-    ResponseBean selectAll(String phone, String userName, String idCard, Integer pageNum, Integer pageSize, TaUser userElement);
29
+    ResponseBean selectAll(Integer communityId, String phone, String userName, String idCard, Integer pageNum, Integer pageSize, TaUser userElement);
28 30
 
29 31
     /**
30 32
      * 审核 用户

+ 19
- 0
src/main/java/com/huiju/estateagents/property/service/ITpCommunityService.java 查看文件

@@ -0,0 +1,19 @@
1
+package com.huiju.estateagents.property.service;
2
+
3
+import com.huiju.estateagents.property.entity.TpCommunity;
4
+import com.baomidou.mybatisplus.extension.service.IService;
5
+
6
+import java.util.List;
7
+
8
+/**
9
+ * <p>
10
+ *  服务类
11
+ * </p>
12
+ *
13
+ * @author yansen
14
+ * @since 2021-01-19
15
+ */
16
+public interface ITpCommunityService extends IService<TpCommunity> {
17
+
18
+    List<TpCommunity> getAllByOrg(Integer orgId);
19
+}

+ 4
- 4
src/main/java/com/huiju/estateagents/property/service/impl/BillServiceImpl.java 查看文件

@@ -608,7 +608,7 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements IB
608 608
     }
609 609
 
610 610
     @Override
611
-    public ResponseBean downloadExcel(TaUser userElement,String phaseId,String buildingId) {
611
+    public ResponseBean downloadExcel(TaUser userElement, Integer communityId, String phaseId,String buildingId) {
612 612
         ResponseBean responseBean = new ResponseBean();
613 613
 
614 614
         InputStream inputStream = null;
@@ -631,9 +631,9 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements IB
631 631
         Integer pageSize = 10;
632 632
         // 分页查询
633 633
 
634
-        List<TpRoomNo> records = tpRoomNoMapper.selectComunityList(userElement.getOrgId(), phaseId,buildingId,pageNum * pageSize, pageSize);
634
+        List<TpRoomNo> records = tpRoomNoMapper.selectComunityList(userElement.getOrgId(), communityId, phaseId,buildingId,pageNum * pageSize, pageSize);
635 635
         // 总页数
636
-        Long pages = tpRoomNoMapper.selectCommunityIdCount(userElement.getOrgId());
636
+        Long pages = tpRoomNoMapper.selectCommunityIdCount(userElement.getOrgId(), communityId);
637 637
 
638 638
 
639 639
         // 行数 默认从 第 6 行开始
@@ -662,7 +662,7 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements IB
662 662
                 if (index == records.size()) {
663 663
                     index = 0;
664 664
                     pageNum ++;
665
-                    records = tpRoomNoMapper.selectCommunityIdList(userElement.getOrgId(), pageNum * pageSize, pageSize);
665
+                    records = tpRoomNoMapper.selectCommunityIdList(userElement.getOrgId(), communityId, pageNum * pageSize, pageSize);
666 666
                 }
667 667
                 if (records.isEmpty()) {
668 668
                     break;

+ 16
- 17
src/main/java/com/huiju/estateagents/property/service/impl/BuildingOwnerInfoServiceImpl.java 查看文件

@@ -13,8 +13,6 @@ import com.huiju.estateagents.center.taUser.mapper.TaUserMapper;
13 13
 import com.huiju.estateagents.entity.TaPerson;
14 14
 import com.huiju.estateagents.mapper.TaPersonMapper;
15 15
 import com.huiju.estateagents.property.common.Constant;
16
-import com.huiju.estateagents.property.common.UserElement;
17
-import com.huiju.estateagents.property.common.base.messagePush;
18 16
 import com.huiju.estateagents.property.dao.*;
19 17
 import com.huiju.estateagents.property.exception.WisdomException;
20 18
 import com.huiju.estateagents.property.model.*;
@@ -24,13 +22,11 @@ import com.google.common.collect.Maps;
24 22
 import lombok.extern.slf4j.Slf4j;
25 23
 import org.apache.commons.collections.CollectionUtils;
26 24
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
27
-import org.apache.poi.poifs.filesystem.POIFSFileSystem;
28 25
 import org.apache.poi.ss.usermodel.*;
29 26
 import org.apache.poi.xssf.usermodel.*;
30 27
 import org.slf4j.Logger;
31 28
 import org.slf4j.LoggerFactory;
32 29
 import org.springframework.beans.factory.annotation.Autowired;
33
-import org.springframework.beans.factory.annotation.Qualifier;
34 30
 import org.springframework.stereotype.Service;
35 31
 import org.springframework.transaction.annotation.Transactional;
36 32
 import org.springframework.web.multipart.MultipartFile;
@@ -186,7 +182,7 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
186 182
 
187 183
 //         审核通过后,往楼栋资料库添加数据
188 184
         if ("1".equals(verify)) {
189
-            TpBuildingOwnerInfo tpBuildingOwnerInfo = insertTpBuildingOwnerInfo(userVerify.getPhaseId(), userVerify.getBuildingId(), userVerify.getUnitId(),
185
+            TpBuildingOwnerInfo tpBuildingOwnerInfo = insertTpBuildingOwnerInfo(userVerify.getCommunityId(), userVerify.getPhaseId(), userVerify.getBuildingId(), userVerify.getUnitId(),
190 186
                     userVerify.getLevelId(), userVerify.getRoomNoId(), userElement.getOrgId(), userElement.getUserId(),
191 187
                     userVerify.getGender(), userVerify.getOwnerName(), userVerify.getPhone(), userVerify.getIdCard());
192 188
 
@@ -251,7 +247,7 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
251 247
 //        tpBuildingOwnerInfo.setOwnerName(appUser.getUserName());
252 248
 
253 249
         // 插入楼栋资料库
254
-        tpBuildingOwnerInfo = insertTpBuildingOwnerInfo(tpBuildingOwnerInfo.getPhaseId(), tpBuildingOwnerInfo.getBuildingId(), tpBuildingOwnerInfo.getUnitId(),
250
+        tpBuildingOwnerInfo = insertTpBuildingOwnerInfo(tpBuildingOwnerInfo.getCommunityId(), tpBuildingOwnerInfo.getPhaseId(), tpBuildingOwnerInfo.getBuildingId(), tpBuildingOwnerInfo.getUnitId(),
255 251
                 tpBuildingOwnerInfo.getLevelId(), tpBuildingOwnerInfo.getRoomNoId(), userElement.getOrgId(), userElement.getUserId(),
256 252
                 tpBuildingOwnerInfo.getGender(), tpBuildingOwnerInfo.getOwnerName(), tpBuildingOwnerInfo.getOwnerTel(), tpBuildingOwnerInfo.getIdCard());
257 253
 
@@ -345,6 +341,7 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
345 341
 
346 342
     /**
347 343
      * 插入 楼栋资料库
344
+     * @param communityId
348 345
      * @param phaseId
349 346
      * @param buildingId
350 347
      * @param unitId
@@ -356,9 +353,9 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
356 353
      * @param ownerName
357 354
      * @param ownerTel
358 355
      */
359
-    private TpBuildingOwnerInfo insertTpBuildingOwnerInfo (Integer phaseId, Integer buildingId, Integer unitId,
360
-                                                           Integer levelId, Integer roomNoId, Integer orgId,
361
-                                                           Integer userId, String gender, String ownerName, String ownerTel, String idCard) {
356
+    private TpBuildingOwnerInfo insertTpBuildingOwnerInfo(Integer communityId, Integer phaseId, Integer buildingId, Integer unitId,
357
+                                                          Integer levelId, Integer roomNoId, Integer orgId,
358
+                                                          Integer userId, String gender, String ownerName, String ownerTel, String idCard) {
362 359
         TpBuildingOwnerInfo tpBuildingOwnerInfo = new TpBuildingOwnerInfo();
363 360
 
364 361
         // 查询 期/楼栋/单元/层/户号
@@ -370,6 +367,7 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
370 367
 
371 368
         // 主键是自增的, 所以设置为 null
372 369
         tpBuildingOwnerInfo.setId(null);
370
+        tpBuildingOwnerInfo.setCommunityId(communityId);
373 371
         tpBuildingOwnerInfo.setPhaseId(phaseId);
374 372
         tpBuildingOwnerInfo.setPhaseName(phase.getName());
375 373
         tpBuildingOwnerInfo.setBuildingId(buildingId);
@@ -390,8 +388,6 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
390 388
         tpBuildingOwnerInfo.setCreateUser(userId);
391 389
         tpBuildingOwnerInfo.setVerifyStatus("0");
392 390
         tpBuildingOwnerInfo.setPairStatus("0");
393
-
394
-        // 添加的时候, 默认是当前操作的小区
395 391
         tpBuildingOwnerInfo.setOrgId(orgId);
396 392
 
397 393
         int row = tpBuildingOwnerInfoMapper.insert(tpBuildingOwnerInfo);
@@ -420,7 +416,7 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
420 416
 
421 417
 
422 418
     @Override
423
-    public ResponseBean getPhaseList(Integer orgId) {
419
+    public ResponseBean getPhaseList(Integer orgId, Integer communityId) {
424 420
 
425 421
         ResponseBean responseBean = new ResponseBean();
426 422
         if (null == orgId || "".equals(orgId)) {
@@ -430,6 +426,7 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
430 426
         Map<String, Object> map = Maps.newHashMap();
431 427
         // 小区
432 428
         map.put("org_id", orgId);
429
+        map.put("community_id", communityId);
433 430
         QueryWrapper<TpPhase> queryWrapper = new QueryWrapper<>();
434 431
         queryWrapper.allEq(map, false);
435 432
     
@@ -443,12 +440,13 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
443 440
      * 上传excel里面的内容
444 441
      *
445 442
      * @param file
443
+     * @param communityId
446 444
      * @param userElement
447 445
      * @return
448 446
      */
449 447
     @Override
450 448
     @Transactional(rollbackFor = Exception.class)
451
-    public ResponseBean submitExcelData(MultipartFile file, TaUser userElement) {
449
+    public ResponseBean submitExcelData(MultipartFile file, Integer communityId, TaUser userElement) {
452 450
         ResponseBean responseBean = new ResponseBean();
453 451
         responseBean = getExcelData(file);
454 452
 
@@ -465,6 +463,7 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
465 463
             e.setOrgId(userElement.getOrgId());
466 464
             e.setVerifyStatus("0");
467 465
             e.setPairStatus("0");
466
+            e.setCommunityId(communityId);
468 467
             e.setCreateUser(userElement.getUserId());
469 468
             e.setCreateDate(LocalDateTime.now());
470 469
         });
@@ -977,7 +976,7 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
977 976
     }
978 977
 
979 978
     @Override
980
-    public ResponseBean downloadExcel(TaUser userElement) {
979
+    public ResponseBean downloadExcel(Integer communityId, TaUser userElement) {
981 980
         ResponseBean responseBean = new ResponseBean();
982 981
 
983 982
         InputStream inputStream = null;
@@ -1000,9 +999,9 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
1000 999
         Integer pageSize = 10;
1001 1000
 
1002 1001
         // 分页查询
1003
-        List<TpRoomNo> records = tpRoomNoMapper.selectCommunityIdList(userElement.getOrgId(),pageNum * pageSize, pageSize);
1002
+        List<TpRoomNo> records = tpRoomNoMapper.selectCommunityIdList(userElement.getOrgId(), communityId,pageNum * pageSize, pageSize);
1004 1003
         // 总页数
1005
-        Long pages = tpRoomNoMapper.selectCommunityIdCount(userElement.getOrgId());
1004
+        Long pages = tpRoomNoMapper.selectCommunityIdCount(userElement.getOrgId(), communityId);
1006 1005
 
1007 1006
 
1008 1007
         // 行数 默认从 第 3 行开始
@@ -1051,7 +1050,7 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
1051 1050
                 if (index == records.size()) {
1052 1051
                     index = 0;
1053 1052
                     pageNum ++;
1054
-                    records = tpRoomNoMapper.selectCommunityIdList(userElement.getOrgId(),pageNum * pageSize, pageSize);
1053
+                    records = tpRoomNoMapper.selectCommunityIdList(userElement.getOrgId(), communityId, pageNum * pageSize, pageSize);
1055 1054
                 }
1056 1055
                 if (records.isEmpty()) {
1057 1056
                     break;

+ 17
- 4
src/main/java/com/huiju/estateagents/property/service/impl/BuildingTreeServiceImpl.java 查看文件

@@ -7,7 +7,6 @@ import com.baomidou.mybatisplus.core.toolkit.StringUtils;
7 7
 import com.huiju.estateagents.base.ResponseBean;
8 8
 import com.huiju.estateagents.center.taUser.entity.TaUser;
9 9
 import com.huiju.estateagents.property.common.Constant;
10
-import com.huiju.estateagents.property.common.UserElement;
11 10
 import com.huiju.estateagents.property.dao.*;
12 11
 import com.huiju.estateagents.property.model.*;
13 12
 import com.huiju.estateagents.property.service.BuildingTreeServiceI;
@@ -180,11 +179,12 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
180 179
 	 * 上传小区的基础数据
181 180
 	 *
182 181
 	 * @param file
182
+	 * @param communityId
183 183
 	 * @param userElement
184 184
 	 * @return
185 185
 	 */
186 186
 	@Override
187
-	public ResponseBean submitExcelData(MultipartFile file, TaUser userElement) {
187
+	public ResponseBean submitExcelData(MultipartFile file, Integer communityId, TaUser userElement) {
188 188
 		ResponseBean responseBean = new ResponseBean();
189 189
 		responseBean = getExcelData(file);
190 190
 //		if (!responseBean.getCode().equals(Constant.RESPONSE_SUCCESS)){
@@ -198,7 +198,7 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
198 198
 		Integer orgId = userElement.getOrgId();
199 199
 		
200 200
 		//保存数据到表中--拆分数据
201
-		saveBuildingTreeData(orgId,list);
201
+		saveBuildingTreeData(orgId, communityId, list);
202 202
 		responseBean.addSuccess("success");
203 203
 		return responseBean;
204 204
 	}
@@ -296,6 +296,8 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
296 296
 		 String type= object.getString("type");
297 297
 		 //当前输入的节点内容
298 298
 		 String nodeNumber= object.getString("nodeNumber");
299
+		 // 小区
300
+		Integer communityId = object.getInteger("communityId");
299 301
 
300 302
 		/*查询出期*/
301 303
 		if(type.equals("phase")) {
@@ -311,6 +313,7 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
311 313
 			TpPhase tpPhase= new TpPhase();
312 314
 					tpPhase.setOrgId(orgId);
313 315
 					tpPhase.setName(nodeNumber);
316
+					tpPhase.setCommunityId(communityId);
314 317
 					tpPhase.setCreateDate(LocalDateTime.now());
315 318
 					tpPhaseMapper.insert(tpPhase);
316 319
 			return ResponseBean.success(tpPhase);
@@ -333,6 +336,7 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
333 336
 						 .setPhaseId(tpPhase.getId())
334 337
 						 .setPhaseName(tpPhase.getName())
335 338
 						 .setName(nodeNumber)
339
+							.setCommunityId(communityId)
336 340
 						 .setCreateDate(LocalDateTime.now());
337 341
 			tpBuildingMapper.insert(tpBuilding);
338 342
 			return ResponseBean.success(tpBuilding);
@@ -358,6 +362,7 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
358 362
 						.setBuildingName(selectTpBuilding.getName())
359 363
 						.setBuildingId(selectTpBuilding.getId())
360 364
 						.setName(nodeNumber)
365
+						.setCommunityId(communityId)
361 366
 						.setCreateDate(LocalDateTime.now());
362 367
 		 	 tpUnitMapper.insert(tpUnit);
363 368
 			return ResponseBean.success(tpUnit);
@@ -388,6 +393,7 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
388 393
 				.setUnitId(selectTpUnit.getId())
389 394
 				.setUnitName(selectTpUnit.getName())
390 395
 				.setName(nodeNumber)
396
+				.setCommunityId(communityId)
391 397
 				.setCreateDate(LocalDateTime.now());
392 398
 			 tpLevelMapper.insert(tpLevel);
393 399
 			return ResponseBean.success(tpLevel);
@@ -417,6 +423,7 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
417 423
 							.setLevelId(selectTpLevel.getId())
418 424
 							.setLevelName(selectTpLevel.getName())
419 425
 							.setName(nodeNumber)
426
+					.setCommunityId(communityId)
420 427
 							.setCreateDate(LocalDateTime.now());
421 428
 			tpRoomNoMapper.insert(tpRoomNo);
422 429
 			return ResponseBean.success(tpRoomNo);
@@ -658,7 +665,7 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
658 665
 		return tpRoomNoMapper.getRoomNum(orgId);
659 666
 	}
660 667
 
661
-	private void saveBuildingTreeData(Integer orgId, List<TpBuildingOwnerInfo> list) {
668
+	private void saveBuildingTreeData(Integer orgId, Integer communityId, List<TpBuildingOwnerInfo> list) {
662 669
 		String lastPhaseName = "";
663 670
 		String lastBuildingName = "";
664 671
 		String lastUnitName = "";
@@ -676,9 +683,11 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
676 683
 				tpPhase.setName(tpBuildingOwnerInfo.getPhaseName());
677 684
 				tpPhase.setOrgId(orgId);
678 685
 				tpPhase.setCreateDate(LocalDateTime.now());
686
+			tpPhase.setCommunityId(communityId);
679 687
 
680 688
 				QueryWrapper<TpPhase> phaseQueryWrapper = new QueryWrapper<>();
681 689
 				phaseQueryWrapper.eq("org_id", orgId);
690
+			phaseQueryWrapper.eq("community_id", communityId);
682 691
 				phaseQueryWrapper.eq("`NAME`", tpBuildingOwnerInfo.getPhaseName());
683 692
 				TpPhase selectPhase = tpPhaseMapper.selectOne(phaseQueryWrapper);
684 693
 				// 判断是否存在库里
@@ -702,6 +711,7 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
702 711
 				tpBuilding.setPhaseName(lastPhaseName);
703 712
 				tpBuilding.setName(tpBuildingOwnerInfo.getBuildingName());
704 713
 				tpBuilding.setCreateDate(LocalDateTime.now());
714
+				tpBuilding.setCommunityId(communityId);
705 715
 
706 716
 				QueryWrapper<TpBuilding> buildingQueryWrapper = new QueryWrapper<>();
707 717
 				buildingQueryWrapper.eq("org_id", orgId);
@@ -726,6 +736,7 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
726 736
 				tpUnit.setBuildingName(lastBuildingName);
727 737
 				tpUnit.setName(tpBuildingOwnerInfo.getUnitName());
728 738
 				tpUnit.setCreateDate(LocalDateTime.now());
739
+				tpUnit.setCommunityId(communityId);
729 740
 
730 741
 				QueryWrapper<TpUnit> unitQueryWrapper = new QueryWrapper<>();
731 742
 				unitQueryWrapper.eq("org_id", orgId);
@@ -755,6 +766,7 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
755 766
 				tpLevel.setUnitName(lastUnitName);
756 767
 				tpLevel.setName(tpBuildingOwnerInfo.getLevelName());
757 768
 				tpLevel.setCreateDate(LocalDateTime.now());
769
+				tpLevel.setCommunityId(communityId);
758 770
 
759 771
 				QueryWrapper<TpLevel> levelQueryWrapper = new QueryWrapper<>();
760 772
 				levelQueryWrapper.eq("org_id", orgId);
@@ -786,6 +798,7 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
786 798
 				tpRoomNo.setLevelName(lastLevelName);
787 799
 				tpRoomNo.setName(tpBuildingOwnerInfo.getRoomNoName());
788 800
 				tpRoomNo.setCreateDate(LocalDateTime.now());
801
+				tpRoomNo.setCommunityId(communityId);
789 802
 
790 803
 				QueryWrapper<TpRoomNo> roomNoQueryWrapper = new QueryWrapper<>();
791 804
 				roomNoQueryWrapper.eq("org_id", orgId);

+ 63
- 0
src/main/java/com/huiju/estateagents/property/service/impl/TaUserCommunityServiceImpl.java 查看文件

@@ -0,0 +1,63 @@
1
+package com.huiju.estateagents.property.service.impl;
2
+
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
5
+import com.huiju.estateagents.property.entity.TaUserCommunity;
6
+import com.huiju.estateagents.property.entity.TpCommunity;
7
+import com.huiju.estateagents.property.mapper.TaUserCommunityMapper;
8
+import com.huiju.estateagents.property.mapper.TpCommunityMapper;
9
+import com.huiju.estateagents.property.service.ITaUserCommunityService;
10
+import org.springframework.beans.factory.annotation.Autowired;
11
+import org.springframework.stereotype.Service;
12
+
13
+import java.util.ArrayList;
14
+import java.util.List;
15
+
16
+
17
+/**
18
+ * <p>
19
+ *  服务实现类
20
+ * </p>
21
+ *
22
+ * @author yansen
23
+ * @since 2021-01-19
24
+ */
25
+@Service
26
+public class TaUserCommunityServiceImpl extends ServiceImpl<TaUserCommunityMapper, TaUserCommunity> implements ITaUserCommunityService {
27
+
28
+    @Autowired
29
+    TaUserCommunityMapper taUserCommunityMapper;
30
+
31
+    @Autowired
32
+    TpCommunityMapper tpCommunityMapper;
33
+
34
+    @Override
35
+    public List<TpCommunity> getListBy(Integer orgId, Integer userId) {
36
+        return tpCommunityMapper.getListOfUser(orgId, userId);
37
+    }
38
+
39
+    @Override
40
+    public boolean addUserCommunity(Integer orgId, Integer userId, List<TpCommunity> communityList) throws Exception {
41
+        if (null == orgId || null == userId || null == communityList) {
42
+            throw new Exception("未找到授权小区需要操作的记录");
43
+        }
44
+
45
+        // 先删除原有授权记录
46
+        QueryWrapper<TaUserCommunity> deleteQuery = new QueryWrapper<>();
47
+        deleteQuery.eq("org_id", orgId);
48
+        deleteQuery.eq("user_id", userId);
49
+        remove(deleteQuery);
50
+
51
+        // 新增记录
52
+        List<TaUserCommunity> list = new ArrayList<>();
53
+        for (TpCommunity community: communityList) {
54
+            TaUserCommunity userCommunity = new TaUserCommunity();
55
+            userCommunity.setOrgId(orgId);
56
+            userCommunity.setUserId(userId);
57
+            userCommunity.setCommunityId(community.getId());
58
+            list.add(userCommunity);
59
+        }
60
+
61
+        return saveBatch(list);
62
+    }
63
+}

+ 2
- 6
src/main/java/com/huiju/estateagents/property/service/impl/TaUserVerifyServiceImpl.java 查看文件

@@ -12,7 +12,6 @@ import com.huiju.estateagents.entity.TaPerson;
12 12
 import com.huiju.estateagents.event.EventBus;
13 13
 import com.huiju.estateagents.mapper.TaPersonMapper;
14 14
 import com.huiju.estateagents.property.common.Constant;
15
-import com.huiju.estateagents.property.common.UserElement;
16 15
 import com.huiju.estateagents.property.common.base.messagePush;
17 16
 import com.huiju.estateagents.property.dao.*;
18 17
 import com.huiju.estateagents.property.exception.WisdomException;
@@ -20,15 +19,12 @@ import com.huiju.estateagents.property.model.*;
20 19
 import com.huiju.estateagents.property.service.ITaUserVerifyService;
21 20
 import lombok.extern.slf4j.Slf4j;
22 21
 import org.apache.commons.lang3.StringUtils;
23
-import org.apache.poi.ss.formula.functions.T;
24 22
 import org.springframework.beans.factory.annotation.Autowired;
25 23
 import org.springframework.context.ApplicationContext;
26 24
 import org.springframework.stereotype.Service;
27 25
 import org.springframework.transaction.annotation.Transactional;
28 26
 
29 27
 import java.time.LocalDateTime;
30
-import java.util.Date;
31
-import java.util.HashMap;
32 28
 import java.util.List;
33 29
 import java.util.Map;
34 30
 
@@ -78,14 +74,14 @@ public class TaUserVerifyServiceImpl extends ServiceImpl<TaUserVerifyMapper, TaU
78 74
     private ApplicationContext applicationContext;
79 75
 
80 76
     @Override
81
-    public ResponseBean selectAll(String phone, String userName, String idCard, Integer pageNum, Integer pageSize, TaUser userElement) {
77
+    public ResponseBean selectAll(Integer communityId, String phone, String userName, String idCard, Integer pageNum, Integer pageSize, TaUser userElement) {
82 78
         ResponseBean responseBean = new ResponseBean();
83 79
 
84 80
         Page<TaUserVerify> page = new Page<>();
85 81
         page.setCurrent(pageNum);
86 82
         page.setSize(pageSize);
87 83
 
88
-        IPage<TaUserVerify> userVerifyIPage = taUserVerifyMapper.selectAllByPhoneAndUserNameAndIdCard(page, phone, userName, idCard, userElement.getOrgId());
84
+        IPage<TaUserVerify> userVerifyIPage = taUserVerifyMapper.selectAllByPhoneAndUserNameAndIdCard(page, communityId, phone, userName, idCard, userElement.getOrgId());
89 85
         responseBean.addSuccess(userVerifyIPage);
90 86
 
91 87
         return responseBean;

+ 1
- 0
src/main/java/com/huiju/estateagents/property/service/impl/TpAnnouncementServiceImpl.java 查看文件

@@ -65,6 +65,7 @@ private  TpAnnouncementMapper tpAnnouncementMapper;
65 65
         Integer announcementNumber = jsonobject.getInteger("announcementNumber");
66 66
         Integer pageSize = jsonobject.getInteger("pageSize");
67 67
         String announcementTitle = jsonobject.getString("announcementTitle");
68
+
68 69
         tpAnnouncement.setId(announcementNumber);
69 70
         if (!StringUtils.isEmpty(announcementTitle)) {
70 71
             tpAnnouncement.setAnnouncementTitle(announcementTitle);

+ 32
- 0
src/main/java/com/huiju/estateagents/property/service/impl/TpCommunityServiceImpl.java 查看文件

@@ -0,0 +1,32 @@
1
+package com.huiju.estateagents.property.service.impl;
2
+
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+import com.huiju.estateagents.common.CommConstant;
5
+import com.huiju.estateagents.property.entity.TpCommunity;
6
+import com.huiju.estateagents.property.mapper.TpCommunityMapper;
7
+import com.huiju.estateagents.property.service.ITpCommunityService;
8
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
9
+import org.springframework.stereotype.Service;
10
+
11
+import java.util.List;
12
+
13
+/**
14
+ * <p>
15
+ *  服务实现类
16
+ * </p>
17
+ *
18
+ * @author yansen
19
+ * @since 2021-01-19
20
+ */
21
+@Service
22
+public class TpCommunityServiceImpl extends ServiceImpl<TpCommunityMapper, TpCommunity> implements ITpCommunityService {
23
+
24
+    @Override
25
+    public List<TpCommunity> getAllByOrg(Integer orgId) {
26
+        QueryWrapper<TpCommunity> queryWrapper = new QueryWrapper<>();
27
+        queryWrapper.eq("org_id", orgId);
28
+        queryWrapper.eq("status", CommConstant.STATUS_NORMAL);
29
+
30
+        return list(queryWrapper);
31
+    }
32
+}

+ 4
- 2
src/main/resources/mapper/TaUserAuthMenuMapper.xml 查看文件

@@ -19,7 +19,8 @@
19 19
         from
20 20
             sys_menu t
21 21
         where
22
-            t.menu_id in (
22
+            t.status = 1
23
+            and t.menu_id in (
23 24
                 SELECT
24 25
                     a.menu_id
25 26
                 from
@@ -43,7 +44,8 @@
43 44
         from
44 45
           sys_menu t
45 46
         where
46
-          t.app_type = 'estateagent-admin'
47
+          t.status = 1
48
+          and t.app_type = 'estateagent-admin'
47 49
           order by t.sort_num
48 50
     </select>
49 51
 

+ 32
- 0
src/main/resources/mapper/TaUserMapper.xml 查看文件

@@ -154,5 +154,37 @@
154 154
         AND t.status &gt; -1
155 155
         Limit 1
156 156
     </select>
157
+    <select id="getLifeConsultants" resultType="com.huiju.estateagents.center.taUser.entity.TaUser">
158
+        SELECT
159
+            t.*,
160
+            m.score as average_score
161
+        FROM
162
+            ta_user t
163
+            INNER JOIN ta_user_community s ON s.user_id = t.user_id
164
+            LEFT JOIN (
165
+                SELECT
166
+                    a.user_id,
167
+                    avg( a.score ) AS score
168
+                FROM
169
+                    tp_life_consultant_evaluate a
170
+                WHERE
171
+                    a.org_id = 1
172
+                    AND a.evaluate_time = #{month}
173
+                GROUP BY
174
+                    a.user_id
175
+            ) m ON m.user_id = t.user_id
176
+        WHERE
177
+            t.org_id = #{orgId}
178
+            AND t.type = 'life-consultant'
179
+            AND s.community_id = #{communityId}
180
+        <if test="userName != null and userName != ''">
181
+            AND t.user_name LIKE CONCAT( '%', #{userName}, '%' )
182
+        </if>
183
+        <if test="phone != null and phone != ''">
184
+            AND t.phone LIKE CONCAT( '%', #{phone}, '%' )
185
+        </if>
186
+        ORDER BY
187
+            t.create_date DESC
188
+    </select>
157 189
 
158 190
 </mapper>

+ 4
- 0
src/main/resources/mapper/property/AnnouncementTelMapper.xml 查看文件

@@ -6,6 +6,10 @@
6 6
         FROM
7 7
             tp_announcement_tel t
8 8
         WHERE t.org_id = #{announcementTel.orgId}
9
+        and t.type = #{announcementTel.type}
10
+        <if test="announcementTel.communityId != null">
11
+            and t.community_id = #{announcementTel.communityId}
12
+        </if>
9 13
         <if test="announcementTel.tel != null and announcementTel.tel != ''">
10 14
           AND t.tel like concat('%',#{announcementTel.tel},'%')
11 15
         </if>

+ 5
- 0
src/main/resources/mapper/property/TaUserCommunityMapper.xml 查看文件

@@ -0,0 +1,5 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+<mapper namespace="com.huiju.estateagents.property.mapper.TaUserCommunityMapper">
4
+
5
+</mapper>

+ 2
- 1
src/main/resources/mapper/property/TaUserVerifyMapper.xml 查看文件

@@ -14,8 +14,9 @@
14 14
         from
15 15
           ta_user_verify tav
16 16
         <where>
17
+            tav.community_id = #{communityId}
17 18
             <trim suffixOverrides="and | or">
18
-                tav.verify_status = 0
19
+                and tav.verify_status = 0
19 20
                 <if test="phone != null and phone != ''">
20 21
                     and tav.phone like CONCAT('%',#{phone},'%')
21 22
                 </if>

+ 1
- 0
src/main/resources/mapper/property/TpAnnouncementMapper.xml 查看文件

@@ -11,6 +11,7 @@
11 11
    FROM
12 12
       tp_announcement
13 13
       <where>
14
+        community_id = #{record.communityId}
14 15
         <if test="record.id != null" >
15 16
           AND id like concat('%',#{record.id,jdbcType=VARCHAR},'%')
16 17
         </if>

+ 16
- 0
src/main/resources/mapper/property/TpCommunityMapper.xml 查看文件

@@ -0,0 +1,16 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+<mapper namespace="com.huiju.estateagents.property.mapper.TpCommunityMapper">
4
+
5
+    <select id="getListOfUser" resultType="com.huiju.estateagents.property.entity.TpCommunity">
6
+        SELECT DISTINCT
7
+            t.*
8
+        FROM
9
+            tp_community t
10
+            INNER JOIN ta_user_community s ON s.org_id = t.org_id
11
+            AND s.community_id = t.id
12
+        WHERE
13
+            s.org_id = #{orgId}
14
+            AND s.user_id = #{userId}
15
+    </select>
16
+</mapper>

+ 3
- 0
src/main/resources/mapper/property/TpRoomNoMapper.xml 查看文件

@@ -13,6 +13,7 @@
13 13
             INNER JOIN tp_phase q ON q.id = t.phase_id
14 14
         WHERE
15 15
             t.org_id = #{orgId}
16
+            AND t.community_id = #{communityId}
16 17
         LIMIT #{pageNum}, #{pageSize}
17 18
     </select>
18 19
     <select id="selectCommunityIdCount" resultType="java.lang.Long">
@@ -26,6 +27,7 @@
26 27
             INNER JOIN tp_phase q ON q.id = t.phase_id
27 28
         WHERE
28 29
             t.org_id = #{orgId}
30
+        AND t.community_id = #{communityId}
29 31
     </select>
30 32
     <select id="selectCommunityIdAndAddressName" resultType="com.huiju.estateagents.property.model.TpRoomNo">
31 33
         SELECT
@@ -71,6 +73,7 @@
71 73
         INNER JOIN tp_phase q ON q.id = t.phase_id
72 74
         WHERE
73 75
         t.org_id = #{orgId}
76
+        and t.community_id = #{communityId}
74 77
         <if test="phaseId != null and phaseId != ''" >
75 78
             and t.phase_id = #{phaseId,jdbcType=VARCHAR}
76 79
         </if>

+ 2
- 0
src/main/resources/mapper/property/TpTicketMapper.xml 查看文件

@@ -5,6 +5,7 @@
5 5
     SELECT
6 6
     p.id,
7 7
     p.org_id,
8
+        p.community_id,
8 9
     p.person_id,
9 10
     p.ticket_title,
10 11
     p.ticket_content,
@@ -23,6 +24,7 @@
23 24
     tp_ticket p
24 25
     LEFT JOIN ta_person AS us ON p.create_user=us.person_id
25 26
 <where>
27
+    p.community_id = #{ticket.communityId}
26 28
     <if test="ticket.id != null and ticket.id !=''">
27 29
         and  p.id like concat('%',#{ticket.id,jdbcType=INTEGER},'%')
28 30
     </if>