Browse Source

bug 修复

傅行帆 3 years ago
parent
commit
98a86d2b1e
19 changed files with 378 additions and 35 deletions
  1. 15
    0
      src/main/java/com/yunzhi/marketing/base/BaseController.java
  2. 292
    0
      src/main/java/com/yunzhi/marketing/center/taUser/entity/TaUserVO.java
  3. 3
    0
      src/main/java/com/yunzhi/marketing/center/taUser/mapper/TaUserMapper.java
  4. 9
    2
      src/main/java/com/yunzhi/marketing/controller/TaChannelController.java
  5. 3
    2
      src/main/java/com/yunzhi/marketing/controller/TaPersonController.java
  6. 1
    0
      src/main/java/com/yunzhi/marketing/controller/TaPolicyController.java
  7. 3
    2
      src/main/java/com/yunzhi/marketing/controller/TaRecommendCustomerController.java
  8. 3
    0
      src/main/java/com/yunzhi/marketing/controller/TdBuildingTypeController.java
  9. 2
    2
      src/main/java/com/yunzhi/marketing/mapper/TaChannelMapper.java
  10. 2
    1
      src/main/java/com/yunzhi/marketing/service/ITaPersonService.java
  11. 3
    2
      src/main/java/com/yunzhi/marketing/service/ITaRecommendCustomerService.java
  12. 5
    9
      src/main/java/com/yunzhi/marketing/service/impl/TaPersonServiceImpl.java
  13. 6
    14
      src/main/java/com/yunzhi/marketing/service/impl/TaRecommendCustomerServiceImpl.java
  14. 3
    0
      src/main/java/com/yunzhi/marketing/xlk/controller/BrandController.java
  15. 1
    0
      src/main/java/com/yunzhi/marketing/xlk/controller/CurriculumController.java
  16. 3
    0
      src/main/java/com/yunzhi/marketing/xlk/controller/TaPolicyTypeController.java
  17. 1
    0
      src/main/java/com/yunzhi/marketing/xlk/controller/VideoController.java
  18. 5
    1
      src/main/resources/mapper/TaChannelMapper.xml
  19. 18
    0
      src/main/resources/mapper/TaUserMapper.xml

+ 15
- 0
src/main/java/com/yunzhi/marketing/base/BaseController.java View File

119
         return taUser.getInstitutionId();
119
         return taUser.getInstitutionId();
120
     }
120
     }
121
 
121
 
122
+    /**
123
+     * 获取组织机构id
124
+     *
125
+     * @param request
126
+     * @return
127
+     */
128
+    public List<String> getInstitutionCodes(HttpServletRequest request) {
129
+        TaUser taUser = taUserService.getById(getUserId(request));
130
+        Institution institution = iInstitutionService.getById(taUser.getInstitutionId());
131
+        LambdaQueryWrapper<Institution> queryWrapper = new LambdaQueryWrapper<>();
132
+        queryWrapper.likeRight(Institution::getInstitutionCode,institution.getInstitutionCode());
133
+        List<Institution> list = iInstitutionService.list(queryWrapper);
134
+        return list.stream().map(Institution::getInstitutionId).collect(Collectors.toList());
135
+    }
136
+
122
     /**
137
     /**
123
      * 获取服务管理后台用户ID
138
      * 获取服务管理后台用户ID
124
      *
139
      *

+ 292
- 0
src/main/java/com/yunzhi/marketing/center/taUser/entity/TaUserVO.java View File

1
+package com.yunzhi.marketing.center.taUser.entity;
2
+
3
+import com.baomidou.mybatisplus.annotation.FieldStrategy;
4
+import com.baomidou.mybatisplus.annotation.IdType;
5
+import com.baomidou.mybatisplus.annotation.TableField;
6
+import com.baomidou.mybatisplus.annotation.TableId;
7
+import com.yunzhi.marketing.entity.*;
8
+import com.yunzhi.marketing.xlk.entity.Institution;
9
+import lombok.Data;
10
+import lombok.EqualsAndHashCode;
11
+import lombok.experimental.Accessors;
12
+
13
+import java.io.Serializable;
14
+import java.time.LocalDateTime;
15
+import java.util.ArrayList;
16
+import java.util.List;
17
+
18
+/**
19
+ * <p>
20
+ * 用户表 
21
+ * </p>
22
+ *
23
+ * @author jobob
24
+ * @since 2019-09-11
25
+ */
26
+@Data
27
+@EqualsAndHashCode(callSuper = false)
28
+@Accessors(chain = true)
29
+public class TaUserVO implements Serializable {
30
+
31
+    private static final long serialVersionUID = 1L;
32
+
33
+    /**
34
+     * 用户ID
35
+     */
36
+    private String userId;
37
+
38
+    /**
39
+     * 公司id
40
+     */
41
+    private Integer orgId;
42
+
43
+    /**
44
+     * 用户名称
45
+     */
46
+    private String userName;
47
+
48
+    /**
49
+     * 登录账户
50
+     */
51
+    private String loginName;
52
+
53
+    /**
54
+     * 手机号
55
+     */
56
+    private String phone;
57
+
58
+    /**
59
+     * 登录密码
60
+     */
61
+    private String loginPassword;
62
+
63
+    /**
64
+     * 用户头像
65
+     */
66
+    private String avatar;
67
+
68
+    /**
69
+     * 用户状态
70
+     */
71
+    private Integer status;
72
+
73
+    /**
74
+     * 创建时间
75
+     */
76
+    private LocalDateTime createDate;
77
+
78
+    /**
79
+     * 账户过期时间
80
+     */
81
+    private LocalDateTime expDate;
82
+
83
+    /**
84
+     * 是否管理员
85
+     */
86
+    private Boolean isAdmin;
87
+
88
+    /**
89
+     * 公司名称
90
+     */
91
+    private String orgName;
92
+
93
+    /**
94
+     * 部门
95
+     */
96
+    private String department;
97
+
98
+    /**
99
+     * 职位
100
+     */
101
+    private String position;
102
+
103
+    /**
104
+     * 邮箱
105
+     */
106
+    private String email;
107
+
108
+    /**
109
+     * 身份证号
110
+     */
111
+    private String idNo;
112
+    
113
+    private String address;
114
+    private String photo;
115
+    private String description;
116
+
117
+    /**
118
+     * 工号
119
+     */
120
+    private String jobNumber;
121
+
122
+    /**
123
+     * 组织结构id
124
+     */
125
+    private String institutionId;
126
+
127
+    /**
128
+     * 组织机构编号
129
+     */
130
+    @TableField(exist = false)
131
+    private List<String> institutionIdLis;
132
+
133
+    /**
134
+     * 当前人员拥有的所有组织权限
135
+     */
136
+    @TableField(exist = false)
137
+    private List<Institution> institutionList;
138
+
139
+    /**
140
+     * 权重
141
+     */
142
+    @TableField(strategy= FieldStrategy.IGNORED)
143
+    private String weight;
144
+
145
+    /**
146
+     * 是否置业顾问
147
+     */
148
+    private Boolean isConsultant;
149
+
150
+    /**
151
+     * 公司水印
152
+     */
153
+    @TableField(exist = false)
154
+    private String waterMark;
155
+
156
+    /**
157
+     * 关联小程序
158
+     */
159
+    @TableField(exist = false)
160
+    private TaMiniapp miniapp;
161
+
162
+    /**
163
+     * 授权角色列表
164
+     */
165
+    @TableField(exist = false)
166
+    private List<TaRole> roles;
167
+
168
+    /**
169
+     * 授权菜单列表
170
+     */
171
+    @TableField(exist = false)
172
+    private List<SysMenu> menus;
173
+
174
+    /**
175
+     * 授权按钮列表
176
+     */
177
+    @TableField(exist = false)
178
+    private List<SysButtonInMenu> buttons;
179
+    
180
+    @TableField(exist = false)
181
+    private List<TaTags> taTagsList = new ArrayList<TaTags>();
182
+    
183
+    @TableField(exist = false)
184
+    private List<Integer> taTags = new ArrayList<Integer>();
185
+    
186
+    @TableField(exist = false)
187
+    private List<Integer> roleIds = new ArrayList<Integer>();
188
+    
189
+    @TableField(exist = false)
190
+    private String buildingId;
191
+
192
+    @TableField(exist = false)
193
+    private List<String> projects;
194
+
195
+    /**
196
+     * ta_org/orgNum楼盘最大数
197
+     */
198
+  @TableField(exist = false)
199
+    private int orgNum;
200
+
201
+    // 所有省份城市
202
+    @TableField(exist = false)
203
+    List<TdCity> tdCityList;
204
+
205
+    /**
206
+     * 前台传值城市
207
+     */
208
+    @TableField(exist = false)
209
+    private ArrayList<String> selectCityTree;
210
+
211
+    /**
212
+     * 城市ID
213
+     */
214
+    @TableField(exist = false)
215
+    private Integer cityId;
216
+
217
+    /**
218
+     * 默认城市
219
+     */
220
+    @TableField(exist = false)
221
+    private Integer defaultCityId;
222
+
223
+    /**
224
+     * 小程序绑定状态
225
+     *
226
+     * 0 未绑定 1 绑定
227
+     */
228
+    @TableField(exist = false)
229
+    private Integer miniStatus;
230
+
231
+    @TableField(exist = false)
232
+    private List<String> buildingIds = new ArrayList<String>();
233
+
234
+    /**
235
+     * 新密码
236
+     */
237
+    @TableField(exist = false)
238
+    private String newPassword;
239
+
240
+    /**
241
+     * 确认新密码
242
+     */
243
+    @TableField(exist = false)
244
+    private String confirmPassword;
245
+
246
+    /**
247
+     * 置业顾问的personid
248
+     */
249
+    @TableField(exist = false)
250
+    private String consultantPersonId;
251
+
252
+    /**
253
+     * personId集合
254
+     */
255
+    @TableField(exist = false)
256
+    private List<TaPerson> personIds;
257
+
258
+    /**
259
+     * customerId集合
260
+     */
261
+    @TableField(exist = false)
262
+    private List<TaRecommendCustomer> customerIds;
263
+
264
+    @TableField(exist = false)
265
+    private String miniAppName;
266
+
267
+    private Boolean notShow;
268
+
269
+    /**
270
+     * 公司封面
271
+     */
272
+    @TableField(exist = false)
273
+    private String orgThumb;
274
+
275
+    /**
276
+     * 公司描述
277
+     */
278
+    @TableField(exist = false)
279
+    private String orgDesc;
280
+
281
+    /**
282
+     * 公司Logo
283
+     */
284
+    @TableField(exist = false)
285
+    private String orgLogo;
286
+
287
+    /**
288
+     * BOSS 开屏图
289
+     */
290
+    @TableField(exist = false)
291
+    private String bossDisplay;
292
+}

+ 3
- 0
src/main/java/com/yunzhi/marketing/center/taUser/mapper/TaUserMapper.java View File

4
 import com.baomidou.mybatisplus.core.metadata.IPage;
4
 import com.baomidou.mybatisplus.core.metadata.IPage;
5
 import com.yunzhi.marketing.center.taUser.entity.TaTags;
5
 import com.yunzhi.marketing.center.taUser.entity.TaTags;
6
 import com.yunzhi.marketing.center.taUser.entity.TaUser;
6
 import com.yunzhi.marketing.center.taUser.entity.TaUser;
7
+import com.yunzhi.marketing.center.taUser.entity.TaUserVO;
7
 import com.yunzhi.marketing.entity.TaPersonBuilding;
8
 import com.yunzhi.marketing.entity.TaPersonBuilding;
8
 import org.apache.ibatis.annotations.Mapper;
9
 import org.apache.ibatis.annotations.Mapper;
9
 import org.apache.ibatis.annotations.Param;
10
 import org.apache.ibatis.annotations.Param;
37
     List<String> getBuildingIdsOf(@Param("userId") Integer userId,@Param("buildingId") String buildingId);
38
     List<String> getBuildingIdsOf(@Param("userId") Integer userId,@Param("buildingId") String buildingId);
38
 
39
 
39
     TaUser getUserByPerson(@Param("orgId") Integer orgId, @Param("personId") String personId);
40
     TaUser getUserByPerson(@Param("orgId") Integer orgId, @Param("personId") String personId);
41
+
42
+    IPage<TaUserVO> selectPageList(IPage<TaUserVO> page, @Param("idLists") List<Integer> idLists);
40
 }
43
 }

+ 9
- 2
src/main/java/com/yunzhi/marketing/controller/TaChannelController.java View File

23
 import com.yunzhi.marketing.excel.ActivityStatistics.ChannelVisitNum;
23
 import com.yunzhi.marketing.excel.ActivityStatistics.ChannelVisitNum;
24
 import com.yunzhi.marketing.excel.ActivityStatistics.ChannelVisitPersonNum;
24
 import com.yunzhi.marketing.excel.ActivityStatistics.ChannelVisitPersonNum;
25
 import com.yunzhi.marketing.excel.ActivityStatistics.TsChannelDaily;
25
 import com.yunzhi.marketing.excel.ActivityStatistics.TsChannelDaily;
26
+import com.yunzhi.marketing.xlk.entity.Institution;
27
+import com.yunzhi.marketing.xlk.service.IInstitutionService;
26
 import io.swagger.annotations.Api;
28
 import io.swagger.annotations.Api;
27
 import io.swagger.annotations.ApiImplicitParam;
29
 import io.swagger.annotations.ApiImplicitParam;
28
 import io.swagger.annotations.ApiImplicitParams;
30
 import io.swagger.annotations.ApiImplicitParams;
68
     @Autowired
70
     @Autowired
69
     private TaChannelPersonService taChannelPersonService;
71
     private TaChannelPersonService taChannelPersonService;
70
 
72
 
73
+    @Autowired
74
+    private IInstitutionService iInstitutionService;
75
+
71
 
76
 
72
     /**
77
     /**
73
      * 渠道管理列表
78
      * 渠道管理列表
88
                                     HttpServletRequest request){
93
                                     HttpServletRequest request){
89
         ResponseBean responseBean = new ResponseBean();
94
         ResponseBean responseBean = new ResponseBean();
90
         Integer orgId = getOrgId(request);
95
         Integer orgId = getOrgId(request);
96
+        Institution institution = iInstitutionService.getById(getInstitutionId(request));
97
+
91
         try {
98
         try {
92
             //使用分页插件
99
             //使用分页插件
93
 		    IPage<TaChannel> pg = new Page<>(pageNum, pageSize);
100
 		    IPage<TaChannel> pg = new Page<>(pageNum, pageSize);
94
-            IPage<TaChannel> result = taChannelMapper.pageTaChannel(pg,orgId,channelId);
95
-            List<TaChannel> recommendCount = taChannelMapper.recommendCount(orgId, channelId);
101
+            IPage<TaChannel> result = taChannelMapper.pageTaChannel(pg,orgId,channelId,institution.getInstitutionCode());
102
+            List<TaChannel> recommendCount = taChannelMapper.recommendCount(orgId, channelId, institution.getInstitutionCode());
96
 
103
 
97
             result.getRecords().stream().forEach(e -> {
104
             result.getRecords().stream().forEach(e -> {
98
                 for(TaChannel channel : recommendCount){
105
                 for(TaChannel channel : recommendCount){

+ 3
- 2
src/main/java/com/yunzhi/marketing/controller/TaPersonController.java View File

8
 import com.yunzhi.marketing.base.BaseController;
8
 import com.yunzhi.marketing.base.BaseController;
9
 import com.yunzhi.marketing.base.ResponseBean;
9
 import com.yunzhi.marketing.base.ResponseBean;
10
 import com.yunzhi.marketing.center.taUser.entity.TaUser;
10
 import com.yunzhi.marketing.center.taUser.entity.TaUser;
11
+import com.yunzhi.marketing.center.taUser.entity.TaUserVO;
11
 import com.yunzhi.marketing.center.taUser.service.ITaUserService;
12
 import com.yunzhi.marketing.center.taUser.service.ITaUserService;
12
 import com.yunzhi.marketing.common.CommConstant;
13
 import com.yunzhi.marketing.common.CommConstant;
13
 import com.yunzhi.marketing.common.SMSUtils;
14
 import com.yunzhi.marketing.common.SMSUtils;
531
         if (null == pageNumber) pageNumber = 1;
532
         if (null == pageNumber) pageNumber = 1;
532
         if (null == pageSize) pageSize = 10;
533
         if (null == pageSize) pageSize = 10;
533
 
534
 
534
-        IPage<TaUser> taPersonIPage = taPersonService.getBuildingConsultantList(pageNumber,pageSize,buildingId);
535
+        IPage<TaUserVO> taPersonIPage = taPersonService.getBuildingConsultantList(pageNumber,pageSize,buildingId);
535
         return ResponseBean.success(taPersonIPage);
536
         return ResponseBean.success(taPersonIPage);
536
     }
537
     }
537
 
538
 
544
         if (null == pageNumber) pageNumber = 1;
545
         if (null == pageNumber) pageNumber = 1;
545
         if (null == pageSize) pageSize = 10;
546
         if (null == pageSize) pageSize = 10;
546
 
547
 
547
-        IPage<TaUser> taPersonIPage = taPersonService.getBuildingConsultantList(pageNumber,pageSize,buildingId);
548
+        IPage<TaUserVO> taPersonIPage = taPersonService.getBuildingConsultantList(pageNumber,pageSize,buildingId);
548
         return ResponseBean.success(taPersonIPage);
549
         return ResponseBean.success(taPersonIPage);
549
     }
550
     }
550
 
551
 

+ 1
- 0
src/main/java/com/yunzhi/marketing/controller/TaPolicyController.java View File

85
             queryWrapper.orderByDesc("weight", "create_date");
85
             queryWrapper.orderByDesc("weight", "create_date");
86
             queryWrapper.eq("status", CommConstant.STATUS_NORMAL);
86
             queryWrapper.eq("status", CommConstant.STATUS_NORMAL);
87
             queryWrapper.eq("org_id", getOrgId(request));
87
             queryWrapper.eq("org_id", getOrgId(request));
88
+            queryWrapper.in("institution_id",getInstitutionCodes(request));
88
 
89
 
89
             IPage<TaPolicy> result = iTaPolicyService.page(pg, queryWrapper);
90
             IPage<TaPolicy> result = iTaPolicyService.page(pg, queryWrapper);
90
             List<TaPolicy> records = result.getRecords();
91
             List<TaPolicy> records = result.getRecords();

+ 3
- 2
src/main/java/com/yunzhi/marketing/controller/TaRecommendCustomerController.java View File

10
 import com.yunzhi.marketing.base.BaseController;
10
 import com.yunzhi.marketing.base.BaseController;
11
 import com.yunzhi.marketing.base.ResponseBean;
11
 import com.yunzhi.marketing.base.ResponseBean;
12
 import com.yunzhi.marketing.center.taUser.entity.TaUser;
12
 import com.yunzhi.marketing.center.taUser.entity.TaUser;
13
+import com.yunzhi.marketing.center.taUser.entity.TaUserVO;
13
 import com.yunzhi.marketing.center.taUser.service.ITaUserService;
14
 import com.yunzhi.marketing.center.taUser.service.ITaUserService;
14
 import com.yunzhi.marketing.common.CommConstant;
15
 import com.yunzhi.marketing.common.CommConstant;
15
 import com.yunzhi.marketing.common.StringUtils;
16
 import com.yunzhi.marketing.common.StringUtils;
547
      * 分配置业顾问
548
      * 分配置业顾问
548
      */
549
      */
549
     @RequestMapping(value = "/admin/customer/consultant/assist/{personId}", method = RequestMethod.POST)
550
     @RequestMapping(value = "/admin/customer/consultant/assist/{personId}", method = RequestMethod.POST)
550
-    public ResponseBean assistConsultant(@RequestBody TaUser taUser, @PathVariable String personId, HttpServletRequest request) {
551
+    public ResponseBean assistConsultant(@RequestBody TaUserVO taUser, @PathVariable String personId, HttpServletRequest request) {
551
         try {
552
         try {
552
             Integer orgId = getOrgId(request);
553
             Integer orgId = getOrgId(request);
553
             return taRecommendCustomerService.consultantAssist(taUser, personId, orgId);
554
             return taRecommendCustomerService.consultantAssist(taUser, personId, orgId);
561
      * 批量分配置业顾问
562
      * 批量分配置业顾问
562
      */
563
      */
563
     @RequestMapping(value = "/admin/customer/consultant/batchAssist", method = RequestMethod.POST)
564
     @RequestMapping(value = "/admin/customer/consultant/batchAssist", method = RequestMethod.POST)
564
-    public ResponseBean batchAssistConsultant(@RequestBody TaUser taUser, HttpServletRequest request) {
565
+    public ResponseBean batchAssistConsultant(@RequestBody TaUserVO taUser, HttpServletRequest request) {
565
         if (CollectionUtils.isEmpty(taUser.getCustomerIds())) {
566
         if (CollectionUtils.isEmpty(taUser.getCustomerIds())) {
566
             return ResponseBean.error("请至少选择一条数据", ResponseBean.ERROR_UNAVAILABLE);
567
             return ResponseBean.error("请至少选择一条数据", ResponseBean.ERROR_UNAVAILABLE);
567
         }
568
         }

+ 3
- 0
src/main/java/com/yunzhi/marketing/controller/TdBuildingTypeController.java View File

12
 import com.yunzhi.marketing.service.ITaBuildingProjectTypeService;
12
 import com.yunzhi.marketing.service.ITaBuildingProjectTypeService;
13
 import com.yunzhi.marketing.service.ITdBuildingTypeService;
13
 import com.yunzhi.marketing.service.ITdBuildingTypeService;
14
 import com.yunzhi.marketing.base.BaseController;
14
 import com.yunzhi.marketing.base.BaseController;
15
+import com.yunzhi.marketing.xlk.entity.Institution;
15
 import io.swagger.annotations.Api;
16
 import io.swagger.annotations.Api;
16
 import io.swagger.annotations.ApiImplicitParam;
17
 import io.swagger.annotations.ApiImplicitParam;
17
 import io.swagger.annotations.ApiImplicitParams;
18
 import io.swagger.annotations.ApiImplicitParams;
79
             queryWrapper.eq("status", 1);
80
             queryWrapper.eq("status", 1);
80
             queryWrapper.orderByDesc("create_date");
81
             queryWrapper.orderByDesc("create_date");
81
             queryWrapper.eq("org_id", getOrgId(request));
82
             queryWrapper.eq("org_id", getOrgId(request));
83
+            queryWrapper.in("institution_id",getInstitutionCodes(request));
82
 
84
 
83
             IPage<TdBuildingType> result = iTdBuildingTypeService.page(pg, queryWrapper);
85
             IPage<TdBuildingType> result = iTdBuildingTypeService.page(pg, queryWrapper);
84
             responseBean.addSuccess(result);
86
             responseBean.addSuccess(result);
85
         }catch (Exception e){
87
         }catch (Exception e){
88
+            e.printStackTrace();
86
             logger.error("tdBuildingTypeList -=- {}",e.toString());
89
             logger.error("tdBuildingTypeList -=- {}",e.toString());
87
             responseBean.addError(e.getMessage());
90
             responseBean.addError(e.getMessage());
88
         }
91
         }

+ 2
- 2
src/main/java/com/yunzhi/marketing/mapper/TaChannelMapper.java View File

44
      * @param pg
44
      * @param pg
45
      * @return
45
      * @return
46
      */
46
      */
47
-    IPage<TaChannel> pageTaChannel(IPage<TaChannel> pg,@Param("orgId")Integer orgId,@Param("channelId")Integer channelId);
47
+    IPage<TaChannel> pageTaChannel(IPage<TaChannel> pg,@Param("orgId")Integer orgId,@Param("channelId")Integer channelId,@Param("institutionCode") String institutionCode);
48
 
48
 
49
-    List<TaChannel> recommendCount(@Param("orgId")Integer orgId,@Param("channelId")Integer channelId);
49
+    List<TaChannel> recommendCount(@Param("orgId")Integer orgId,@Param("channelId")Integer channelId,@Param("institutionCode") String institutionCode);
50
 
50
 
51
     /**
51
     /**
52
      * 渠道引进客户统计
52
      * 渠道引进客户统计

+ 2
- 1
src/main/java/com/yunzhi/marketing/service/ITaPersonService.java View File

4
 import com.baomidou.mybatisplus.core.metadata.IPage;
4
 import com.baomidou.mybatisplus.core.metadata.IPage;
5
 import com.yunzhi.marketing.base.ResponseBean;
5
 import com.yunzhi.marketing.base.ResponseBean;
6
 import com.yunzhi.marketing.center.taUser.entity.TaUser;
6
 import com.yunzhi.marketing.center.taUser.entity.TaUser;
7
+import com.yunzhi.marketing.center.taUser.entity.TaUserVO;
7
 import com.yunzhi.marketing.dto.PersonMarketingDTO;
8
 import com.yunzhi.marketing.dto.PersonMarketingDTO;
8
 import com.yunzhi.marketing.entity.TaCustomerFrom;
9
 import com.yunzhi.marketing.entity.TaCustomerFrom;
9
 import com.yunzhi.marketing.entity.TaPerson;
10
 import com.yunzhi.marketing.entity.TaPerson;
45
 
46
 
46
     IPage<TaPerson> getPersonList(int pageNumber, int pageSize, String personType, String name, String phone, Integer status, String buildingId, String personTags);
47
     IPage<TaPerson> getPersonList(int pageNumber, int pageSize, String personType, String name, String phone, Integer status, String buildingId, String personTags);
47
 
48
 
48
-    IPage<TaUser> getBuildingConsultantList(int pageNumber, int pageSize, String buildingId);
49
+    IPage<TaUserVO> getBuildingConsultantList(int pageNumber, int pageSize, String buildingId);
49
 
50
 
50
     TaPerson newPersonByOpenid(String openid, Integer orgId);
51
     TaPerson newPersonByOpenid(String openid, Integer orgId);
51
 
52
 

+ 3
- 2
src/main/java/com/yunzhi/marketing/service/ITaRecommendCustomerService.java View File

4
 import com.baomidou.mybatisplus.extension.service.IService;
4
 import com.baomidou.mybatisplus.extension.service.IService;
5
 import com.yunzhi.marketing.base.ResponseBean;
5
 import com.yunzhi.marketing.base.ResponseBean;
6
 import com.yunzhi.marketing.center.taUser.entity.TaUser;
6
 import com.yunzhi.marketing.center.taUser.entity.TaUser;
7
+import com.yunzhi.marketing.center.taUser.entity.TaUserVO;
7
 import com.yunzhi.marketing.dto.AverageReportDTO;
8
 import com.yunzhi.marketing.dto.AverageReportDTO;
8
 import com.yunzhi.marketing.dto.ChannelReportDTO;
9
 import com.yunzhi.marketing.dto.ChannelReportDTO;
9
 import com.yunzhi.marketing.excel.AgentsRecommendCustomer;
10
 import com.yunzhi.marketing.excel.AgentsRecommendCustomer;
61
 
62
 
62
     TaRecommendCustomer newByPerson(TaPerson person);
63
     TaRecommendCustomer newByPerson(TaPerson person);
63
 
64
 
64
-    ResponseBean consultantAssist(TaUser taUser, String customerId, Integer orgId);
65
+    ResponseBean consultantAssist(TaUserVO taUser, String customerId, Integer orgId);
65
 
66
 
66
-    ResponseBean batchConsultantAssist(TaUser taUser, Integer orgId);
67
+    ResponseBean batchConsultantAssist(TaUserVO taUser, Integer orgId);
67
 
68
 
68
     /**
69
     /**
69
      * 导出数据(推荐客户)
70
      * 导出数据(推荐客户)

+ 5
- 9
src/main/java/com/yunzhi/marketing/service/impl/TaPersonServiceImpl.java View File

9
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
9
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
10
 import com.yunzhi.marketing.base.ResponseBean;
10
 import com.yunzhi.marketing.base.ResponseBean;
11
 import com.yunzhi.marketing.center.taUser.entity.TaUser;
11
 import com.yunzhi.marketing.center.taUser.entity.TaUser;
12
+import com.yunzhi.marketing.center.taUser.entity.TaUserVO;
12
 import com.yunzhi.marketing.center.taUser.mapper.TaUserMapper;
13
 import com.yunzhi.marketing.center.taUser.mapper.TaUserMapper;
13
 import com.yunzhi.marketing.center.taUser.service.ITaUserService;
14
 import com.yunzhi.marketing.center.taUser.service.ITaUserService;
14
 import com.yunzhi.marketing.common.CommConstant;
15
 import com.yunzhi.marketing.common.CommConstant;
527
     }
528
     }
528
 
529
 
529
     @Override
530
     @Override
530
-    public IPage<TaUser> getBuildingConsultantList(int pageNumber, int pageSize,String buildingId){
531
-        IPage<TaUser> page = new Page<>(pageNumber,pageSize);
531
+    public IPage<TaUserVO> getBuildingConsultantList(int pageNumber, int pageSize, String buildingId){
532
+        IPage<TaUserVO> page = new Page<>(pageNumber,pageSize);
532
         QueryWrapper<TaPersonBuilding> personBuildingQueryWrapper = new QueryWrapper<>();
533
         QueryWrapper<TaPersonBuilding> personBuildingQueryWrapper = new QueryWrapper<>();
533
         personBuildingQueryWrapper.eq("building_id",buildingId);
534
         personBuildingQueryWrapper.eq("building_id",buildingId);
534
         List<TaPersonBuilding> list = taPersonBuildingMapper.selectList(personBuildingQueryWrapper);
535
         List<TaPersonBuilding> list = taPersonBuildingMapper.selectList(personBuildingQueryWrapper);
535
         List<Integer>idLists = new ArrayList<>();
536
         List<Integer>idLists = new ArrayList<>();
536
-//        for(int i=0; i<list.size();i++){
537
-//            if(null != list.get(i).getUserId()){
538
-//                idLists.add(list.get(i).getUserId());
539
-//            }
540
-//        }
541
 
537
 
542
         idLists = list.stream().filter(e -> null != e.getUserId()).map(e -> e.getUserId()).collect(Collectors.toList());
538
         idLists = list.stream().filter(e -> null != e.getUserId()).map(e -> e.getUserId()).collect(Collectors.toList());
543
-        IPage<TaUser> data = new Page<>();
539
+        IPage<TaUserVO> data = new Page<>();
544
         if(CollectionUtils.isNotEmpty(idLists)) {
540
         if(CollectionUtils.isNotEmpty(idLists)) {
545
             QueryWrapper<TaUser> userQueryWrapper = new QueryWrapper<>();
541
             QueryWrapper<TaUser> userQueryWrapper = new QueryWrapper<>();
546
             userQueryWrapper.in("user_id",idLists);
542
             userQueryWrapper.in("user_id",idLists);
547
             userQueryWrapper.eq("is_consultant", true);
543
             userQueryWrapper.eq("is_consultant", true);
548
             userQueryWrapper.eq("status",CommConstant.STATUS_NORMAL);
544
             userQueryWrapper.eq("status",CommConstant.STATUS_NORMAL);
549
-            data = taUserService.page(page,userQueryWrapper);
545
+            data = taUserMapper.selectPageList(page,idLists);
550
         }
546
         }
551
 
547
 
552
         return data;
548
         return data;

+ 6
- 14
src/main/java/com/yunzhi/marketing/service/impl/TaRecommendCustomerServiceImpl.java View File

8
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
8
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
9
 import com.yunzhi.marketing.base.ResponseBean;
9
 import com.yunzhi.marketing.base.ResponseBean;
10
 import com.yunzhi.marketing.center.taUser.entity.TaUser;
10
 import com.yunzhi.marketing.center.taUser.entity.TaUser;
11
+import com.yunzhi.marketing.center.taUser.entity.TaUserVO;
11
 import com.yunzhi.marketing.center.taUser.mapper.TaUserMapper;
12
 import com.yunzhi.marketing.center.taUser.mapper.TaUserMapper;
12
 import com.yunzhi.marketing.center.taUser.service.ITaUserService;
13
 import com.yunzhi.marketing.center.taUser.service.ITaUserService;
13
 import com.yunzhi.marketing.common.CommConstant;
14
 import com.yunzhi.marketing.common.CommConstant;
1411
     }
1412
     }
1412
 
1413
 
1413
     @Override
1414
     @Override
1414
-    public ResponseBean batchConsultantAssist(TaUser taUser, Integer orgId) {
1415
+    public ResponseBean batchConsultantAssist(TaUserVO taUser, Integer orgId) {
1415
         Integer failNum = 0;
1416
         Integer failNum = 0;
1416
         if (CollectionUtils.isNotEmpty(taUser.getCustomerIds())) {
1417
         if (CollectionUtils.isNotEmpty(taUser.getCustomerIds())) {
1417
             for (TaRecommendCustomer taRecommendCustomer : taUser.getCustomerIds()) {
1418
             for (TaRecommendCustomer taRecommendCustomer : taUser.getCustomerIds()) {
1428
     }
1429
     }
1429
 
1430
 
1430
     @Override
1431
     @Override
1431
-    public ResponseBean consultantAssist(TaUser taUser, String customerId, Integer orgId) {
1432
+    public ResponseBean consultantAssist(TaUserVO taUser, String customerId, Integer orgId) {
1432
         logger.info("公客分配置业顾问 接收参数,taUser={},customerId={},orgId={}",
1433
         logger.info("公客分配置业顾问 接收参数,taUser={},customerId={},orgId={}",
1433
                 JSONObject.toJSONString(taUser), customerId, orgId);
1434
                 JSONObject.toJSONString(taUser), customerId, orgId);
1434
 
1435
 
1435
         ResponseBean responseBean = new ResponseBean();
1436
         ResponseBean responseBean = new ResponseBean();
1436
 
1437
 
1437
-        // 1.校验置业顾问
1438
-        QueryWrapper<TaUser> queryWrapper = new QueryWrapper();
1439
-        queryWrapper.eq("user_id", taUser.getUserId());
1440
-        TaUser userInfo = taUserMapper.selectOne(queryWrapper);
1441
 
1438
 
1442
         QueryWrapper<TaPersonBuilding> taPersonBuildingQueryWrapper = new QueryWrapper();
1439
         QueryWrapper<TaPersonBuilding> taPersonBuildingQueryWrapper = new QueryWrapper();
1443
-        taPersonBuildingQueryWrapper.eq("user_id", taUser.getUserId());
1440
+        taPersonBuildingQueryWrapper.eq("person_id", taUser.getUserId());
1444
         taPersonBuildingQueryWrapper.eq(!StringUtils.isEmpty(taUser.getBuildingId()), "building_id", taUser.getBuildingId());
1441
         taPersonBuildingQueryWrapper.eq(!StringUtils.isEmpty(taUser.getBuildingId()), "building_id", taUser.getBuildingId());
1445
         TaPersonBuilding taPersonBuilding = taPersonBuildingMapper.selectOne(taPersonBuildingQueryWrapper);
1442
         TaPersonBuilding taPersonBuilding = taPersonBuildingMapper.selectOne(taPersonBuildingQueryWrapper);
1446
 
1443
 
1447
-        if (null == userInfo || CommConstant.STATUS_NORMAL != userInfo.getStatus()) {
1448
-            responseBean.addError("置业顾问不存在或已被注销");
1449
-            return responseBean;
1450
-        }
1451
-
1452
         // 2.根据customerId获取personId
1444
         // 2.根据customerId获取personId
1453
         QueryWrapper<TaRecommendCustomer> customerQueryWrapper = new QueryWrapper<>();
1445
         QueryWrapper<TaRecommendCustomer> customerQueryWrapper = new QueryWrapper<>();
1454
         customerQueryWrapper.eq("customer_id", customerId);
1446
         customerQueryWrapper.eq("customer_id", customerId);
1464
         // 3.判断是否有buildingId,有则直接更新数据
1456
         // 3.判断是否有buildingId,有则直接更新数据
1465
         if (!StringUtils.isEmpty(customerInfo.getBuildingId())) {
1457
         if (!StringUtils.isEmpty(customerInfo.getBuildingId())) {
1466
             logger.info("公客分配置业顾问 customer={}", JSONObject.toJSONString(customerInfo));
1458
             logger.info("公客分配置业顾问 customer={}", JSONObject.toJSONString(customerInfo));
1467
-            customerInfo.setRealtyConsultant(userInfo.getUserId().toString());
1459
+            customerInfo.setRealtyConsultant(taUser.getUserId());
1468
             responseBean.addSuccess(taRecommendCustomerMapper.updateById(customerInfo));
1460
             responseBean.addSuccess(taRecommendCustomerMapper.updateById(customerInfo));
1469
             return responseBean;
1461
             return responseBean;
1470
         }
1462
         }
1498
         taRecommendCustomer.setPicture(taPerson.getAvatarurl());
1490
         taRecommendCustomer.setPicture(taPerson.getAvatarurl());
1499
         taRecommendCustomer.setPhone(taPerson.getPhone());
1491
         taRecommendCustomer.setPhone(taPerson.getPhone());
1500
         taRecommendCustomer.setSex(null == taPerson.getGender() ? null : ("1".equals(taPerson.getGender()) ? 1 : 2));
1492
         taRecommendCustomer.setSex(null == taPerson.getGender() ? null : ("1".equals(taPerson.getGender()) ? 1 : 2));
1501
-        taRecommendCustomer.setRealtyConsultant(userInfo.getUserId().toString());
1493
+        taRecommendCustomer.setRealtyConsultant(taUser.getUserId());
1502
         taRecommendCustomer.setBuildingId(taPersonBuilding.getBuildingId());
1494
         taRecommendCustomer.setBuildingId(taPersonBuilding.getBuildingId());
1503
         TaBuilding building = taBuildingMapper.selectById(taPersonBuilding.getBuildingId());
1495
         TaBuilding building = taBuildingMapper.selectById(taPersonBuilding.getBuildingId());
1504
         taRecommendCustomer.setIntention(building.getBuildingName());
1496
         taRecommendCustomer.setIntention(building.getBuildingName());

+ 3
- 0
src/main/java/com/yunzhi/marketing/xlk/controller/BrandController.java View File

74
             queryWrapper.eq(Brand::getOrgId,getOrgId(request));
74
             queryWrapper.eq(Brand::getOrgId,getOrgId(request));
75
             queryWrapper.like(!StringUtils.isEmpty(brandName),Brand::getBrandName,brandName);
75
             queryWrapper.like(!StringUtils.isEmpty(brandName),Brand::getBrandName,brandName);
76
             queryWrapper.orderByDesc(Brand::getCreatedTime);
76
             queryWrapper.orderByDesc(Brand::getCreatedTime);
77
+            if ("admin".equals(plat)) {
78
+                queryWrapper.in(Brand::getInstitutionId,getInstitutionCodes(request));
79
+            }
77
 
80
 
78
             IPage<Brand> result = iBrandService.page(pg, queryWrapper);
81
             IPage<Brand> result = iBrandService.page(pg, queryWrapper);
79
             responseBean.addSuccess(result);
82
             responseBean.addSuccess(result);

+ 1
- 0
src/main/java/com/yunzhi/marketing/xlk/controller/CurriculumController.java View File

86
             queryWrapper.eq(Curriculum::getOrgId,getOrgId(request));
86
             queryWrapper.eq(Curriculum::getOrgId,getOrgId(request));
87
             queryWrapper.like(!StringUtils.isEmpty(name),Curriculum::getName,'%'+name+'%');
87
             queryWrapper.like(!StringUtils.isEmpty(name),Curriculum::getName,'%'+name+'%');
88
             queryWrapper.eq(null != roleId,Curriculum::getRoleId,roleId);
88
             queryWrapper.eq(null != roleId,Curriculum::getRoleId,roleId);
89
+            queryWrapper.in(Curriculum::getInstitutionId,getInstitutionCodes(request));
89
             queryWrapper.orderByDesc(Curriculum::getWeight);
90
             queryWrapper.orderByDesc(Curriculum::getWeight);
90
             queryWrapper.orderByDesc(Curriculum::getCreatedTime);
91
             queryWrapper.orderByDesc(Curriculum::getCreatedTime);
91
 
92
 

+ 3
- 0
src/main/java/com/yunzhi/marketing/xlk/controller/TaPolicyTypeController.java View File

62
 		    IPage<TaPolicyType> pg = new Page<>(pageNum, pageSize);
62
 		    IPage<TaPolicyType> pg = new Page<>(pageNum, pageSize);
63
             LambdaQueryWrapper<TaPolicyType> queryWrapper = new LambdaQueryWrapper<>();
63
             LambdaQueryWrapper<TaPolicyType> queryWrapper = new LambdaQueryWrapper<>();
64
             queryWrapper.eq(TaPolicyType::getOrgId,getOrgId(request));
64
             queryWrapper.eq(TaPolicyType::getOrgId,getOrgId(request));
65
+            if ("admin".equals(plat)) {
66
+                queryWrapper.in(TaPolicyType::getInstitutionId,getInstitutionCodes(request));
67
+            }
65
             queryWrapper.orderByDesc(TaPolicyType::getSort);
68
             queryWrapper.orderByDesc(TaPolicyType::getSort);
66
 
69
 
67
             IPage<TaPolicyType> result = iTaPolicyTypeService.page(pg, queryWrapper);
70
             IPage<TaPolicyType> result = iTaPolicyTypeService.page(pg, queryWrapper);

+ 1
- 0
src/main/java/com/yunzhi/marketing/xlk/controller/VideoController.java View File

77
             LambdaQueryWrapper<Video> queryWrapper = new LambdaQueryWrapper<>();
77
             LambdaQueryWrapper<Video> queryWrapper = new LambdaQueryWrapper<>();
78
             queryWrapper.eq(!StringUtils.isEmpty(name),Video::getName,name);
78
             queryWrapper.eq(!StringUtils.isEmpty(name),Video::getName,name);
79
             queryWrapper.eq(Video::getOrgId,getOrgId(request));
79
             queryWrapper.eq(Video::getOrgId,getOrgId(request));
80
+            queryWrapper.in(Video::getInstitutionId,getInstitutionCodes(request));
80
             queryWrapper.orderByDesc(Video::getWeight);
81
             queryWrapper.orderByDesc(Video::getWeight);
81
             queryWrapper.orderByDesc(Video::getCreatedTime);
82
             queryWrapper.orderByDesc(Video::getCreatedTime);
82
 
83
 

+ 5
- 1
src/main/resources/mapper/TaChannelMapper.xml View File

22
         ta_channel c
22
         ta_channel c
23
         LEFT JOIN ta_channel_person cp ON c.channel_id = cp.channel_id
23
         LEFT JOIN ta_channel_person cp ON c.channel_id = cp.channel_id
24
         LEFT JOIN ta_person tp ON cp.person_id = tp.person_id	AND cp.STATUS = 1
24
         LEFT JOIN ta_person tp ON cp.person_id = tp.person_id	AND cp.STATUS = 1
25
+        LEFT JOIN xlk_institution i ON c.institution_id = i.institution_id
25
         LEFT JOIN (
26
         LEFT JOIN (
26
         SELECT sum(new_customers) as customerNum,qr_code_id,channel_id,org_id from ts_channel_daily where channel_id is not null and org_id = #{orgId} GROUP BY channel_id) ts on c.channel_id = ts.channel_id
27
         SELECT sum(new_customers) as customerNum,qr_code_id,channel_id,org_id from ts_channel_daily where channel_id is not null and org_id = #{orgId} GROUP BY channel_id) ts on c.channel_id = ts.channel_id
27
         <where>
28
         <where>
30
             </if>
31
             </if>
31
             and c.org_id = #{orgId}
32
             and c.org_id = #{orgId}
32
             and c.status = 1
33
             and c.status = 1
34
+            AND i.institution_code like CONCAT(#{institutionCode}, '%')
33
         </where>
35
         </where>
34
         GROUP BY c.channel_id
36
         GROUP BY c.channel_id
35
     </select>
37
     </select>
41
         FROM
43
         FROM
42
         ta_channel c
44
         ta_channel c
43
         LEFT JOIN ta_channel_person cp ON c.channel_id = cp.channel_id and cp.`status` = 1
45
         LEFT JOIN ta_channel_person cp ON c.channel_id = cp.channel_id and cp.`status` = 1
44
-        LEFT JOIN ta_person t on cp.person_id = t.person_id and t.person_type = 'estate agent'
46
+        LEFT JOIN ta_person t on cp.person_id = t.person_id and t.person_type in ('estate agent','channel agent')
47
+        LEFT JOIN xlk_institution i ON c.institution_id = i.institution_id
45
         LEFT JOIN ta_recommend_customer rc ON t.person_id = rc.recommend_person AND rc.verify_status = 1
48
         LEFT JOIN ta_recommend_customer rc ON t.person_id = rc.recommend_person AND rc.verify_status = 1
46
         <where>
49
         <where>
47
             <if test="channelId != null and channelId != ''">
50
             <if test="channelId != null and channelId != ''">
48
                 c.channel_id = #{channelId}
51
                 c.channel_id = #{channelId}
49
             </if>
52
             </if>
50
             and c.org_id = #{orgId}
53
             and c.org_id = #{orgId}
54
+            AND i.institution_code like CONCAT(#{institutionCode}, '%')
51
         </where>
55
         </where>
52
         GROUP BY c.channel_id
56
         GROUP BY c.channel_id
53
     </select>
57
     </select>

+ 18
- 0
src/main/resources/mapper/TaUserMapper.xml View File

158
         Limit 1
158
         Limit 1
159
     </select>
159
     </select>
160
 
160
 
161
+    <select id="selectPageList" resultType="com.yunzhi.marketing.center.taUser.entity.TaUserVO">
162
+        SELECT
163
+            s.person_id as user_id,
164
+            t.*
165
+        FROM
166
+            ta_user t
167
+        INNER JOIN ta_person s ON s.user_id = t.user_id
168
+        where
169
+        t.is_consultant = 1
170
+        and t.status = 1
171
+        <if test="idLists != null and idLists.size() > 0 ">
172
+            and t.user_id in
173
+            <foreach collection="idLists" item="item" index="index" open="(" close=")" separator=",">
174
+                #{item}
175
+            </foreach>
176
+        </if>
177
+    </select>
178
+
161
 </mapper>
179
 </mapper>