|
@@ -1,6 +1,7 @@
|
1
|
1
|
package com.yunzhi.marketing.center.taUser.service.impl;
|
2
|
2
|
|
3
|
3
|
import cn.binarywang.wx.miniapp.api.WxMaService;
|
|
4
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
4
|
5
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
5
|
6
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
6
|
7
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
@@ -25,6 +26,7 @@ import com.yunzhi.marketing.mapper.*;
|
25
|
26
|
import com.yunzhi.marketing.service.*;
|
26
|
27
|
import com.yunzhi.marketing.xlk.entity.UserInstitution;
|
27
|
28
|
import com.yunzhi.marketing.xlk.mapper.UserInstitutionMapper;
|
|
29
|
+import me.chanjar.weixin.cp.bean.WxCpAgent;
|
28
|
30
|
import org.apache.commons.collections.CollectionUtils;
|
29
|
31
|
import org.springframework.beans.factory.annotation.Autowired;
|
30
|
32
|
import org.springframework.stereotype.Service;
|
|
@@ -499,20 +501,18 @@ public class TaUserServiceImpl extends ServiceImpl<TaUserMapper, TaUser> impleme
|
499
|
501
|
taPersonBuilding.setUserId(taUser.getUserId());
|
500
|
502
|
taPersonBuilding.setCreateDate(LocalDateTime.now());
|
501
|
503
|
taPersonBuildingMapper.insert(taPersonBuilding);
|
|
504
|
+ } else {
|
|
505
|
+ //非置业顾问可授权多个项目
|
|
506
|
+ List<String> buildingIdList = taUser.getBuildingIds();
|
|
507
|
+ LocalDateTime nowTime = LocalDateTime.now();
|
|
508
|
+ buildingIdList.forEach(e -> {
|
|
509
|
+ TaPersonBuilding taPersonBuilding = new TaPersonBuilding();
|
|
510
|
+ taPersonBuilding.setBuildingId(e);
|
|
511
|
+ taPersonBuilding.setUserId(taUser.getUserId());
|
|
512
|
+ taPersonBuilding.setCreateDate(nowTime);
|
|
513
|
+ taPersonBuildingMapper.insert(taPersonBuilding);
|
|
514
|
+ });
|
502
|
515
|
}
|
503
|
|
-// // 这个版本取消非置业顾问授权
|
504
|
|
-// else {
|
505
|
|
-// //非置业顾问可授权多个项目
|
506
|
|
-// List<String> buildingIdList = taUser.getBuildingIds();
|
507
|
|
-// LocalDateTime nowTime = LocalDateTime.now();
|
508
|
|
-// buildingIdList.forEach(e -> {
|
509
|
|
-// TaPersonBuilding taPersonBuilding = new TaPersonBuilding();
|
510
|
|
-// taPersonBuilding.setBuildingId(e);
|
511
|
|
-// taPersonBuilding.setUserId(taUser.getUserId());
|
512
|
|
-// taPersonBuilding.setCreateDate(nowTime);
|
513
|
|
-// taPersonBuildingMapper.insert(taPersonBuilding);
|
514
|
|
-// });
|
515
|
|
-// }
|
516
|
516
|
|
517
|
517
|
return taUser;
|
518
|
518
|
}
|
|
@@ -607,6 +607,26 @@ public class TaUserServiceImpl extends ServiceImpl<TaUserMapper, TaUser> impleme
|
607
|
607
|
});
|
608
|
608
|
}
|
609
|
609
|
|
|
610
|
+ // 更新这个用户的组织机构
|
|
611
|
+ List<String> institutionIdLis = taUser.getInstitutionIdLis();
|
|
612
|
+ if (institutionIdLis.size() > 0) {
|
|
613
|
+ // 先删除后新增
|
|
614
|
+ LambdaQueryWrapper<UserInstitution> userInstitutionLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
615
|
+ userInstitutionLambdaQueryWrapper.eq(UserInstitution::getUserId,taUser.getUserId());
|
|
616
|
+ userInstitutionMapper.delete(userInstitutionLambdaQueryWrapper);
|
|
617
|
+ // 新增
|
|
618
|
+ institutionIdLis.forEach(e -> {
|
|
619
|
+ UserInstitution userInstitution = new UserInstitution();
|
|
620
|
+ userInstitution.setInstitutionId(e);
|
|
621
|
+ userInstitution.setOrgId(taUser.getOrgId());
|
|
622
|
+ userInstitution.setUserId(taUser.getUserId());
|
|
623
|
+ userInstitution.setCreateDate(LocalDateTime.now());
|
|
624
|
+ userInstitutionMapper.insert(userInstitution);
|
|
625
|
+
|
|
626
|
+ });
|
|
627
|
+ }
|
|
628
|
+
|
|
629
|
+
|
610
|
630
|
//更新person
|
611
|
631
|
TaPerson taPerson = new TaPerson();
|
612
|
632
|
taPerson.setAvatarurl(taUser.getAvatar());
|
|
@@ -703,8 +723,8 @@ public class TaUserServiceImpl extends ServiceImpl<TaUserMapper, TaUser> impleme
|
703
|
723
|
* @return
|
704
|
724
|
*/
|
705
|
725
|
@Override
|
706
|
|
- public IPage<TaUser> seleUserList(IPage pg, TaUser taUser, List<TaPersonBuilding> personBuildingList) {
|
707
|
|
- return taUserMapper.seleUserList(pg, taUser, personBuildingList);
|
|
726
|
+ public IPage<TaUser> seleUserList(IPage pg, TaUser taUser, List<TaPersonBuilding> personBuildingList,List<String> institutionIds) {
|
|
727
|
+ return taUserMapper.seleUserList(pg, taUser, personBuildingList,institutionIds);
|
708
|
728
|
}
|
709
|
729
|
|
710
|
730
|
@Override
|