|
@@ -74,7 +74,7 @@ public class UserLogic {
|
|
private WxCustomerMapper wxCustomerMapper;
|
|
private WxCustomerMapper wxCustomerMapper;
|
|
@Autowired
|
|
@Autowired
|
|
private CustomMemberMapper customMemberMapper;
|
|
private CustomMemberMapper customMemberMapper;
|
|
-// @Autowired
|
|
|
|
|
|
+ // @Autowired
|
|
// private EnterpriseWechatWorkerService enterpriseWechatWorkerService;
|
|
// private EnterpriseWechatWorkerService enterpriseWechatWorkerService;
|
|
@Autowired
|
|
@Autowired
|
|
private CustomWebsitMapper customWebsitMapper;
|
|
private CustomWebsitMapper customWebsitMapper;
|
|
@@ -88,7 +88,7 @@ public class UserLogic {
|
|
UserWaitService userWaitService;
|
|
UserWaitService userWaitService;
|
|
@Autowired
|
|
@Autowired
|
|
WorkerImgService workerImgService;
|
|
WorkerImgService workerImgService;
|
|
-// @Autowired
|
|
|
|
|
|
+ // @Autowired
|
|
// private WorkWechatLogic workWechatLogic;
|
|
// private WorkWechatLogic workWechatLogic;
|
|
@Autowired
|
|
@Autowired
|
|
CouponLogic couponLogic;
|
|
CouponLogic couponLogic;
|
|
@@ -107,10 +107,11 @@ public class UserLogic {
|
|
|
|
|
|
/**
|
|
/**
|
|
* 客户列表-v2
|
|
* 客户列表-v2
|
|
|
|
+ *
|
|
* @param zfireParamBean
|
|
* @param zfireParamBean
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- public IPage<UserCustomerVO> userCustomerList(ZfireParamBean zfireParamBean){
|
|
|
|
|
|
+ public IPage<UserCustomerVO> userCustomerList(ZfireParamBean zfireParamBean) {
|
|
AdminUserCom adminUser = commonLogic.getAdminUser();
|
|
AdminUserCom adminUser = commonLogic.getAdminUser();
|
|
zfireParamBean.setCompanyWechatId(adminUser.getCompanyWechatId());
|
|
zfireParamBean.setCompanyWechatId(adminUser.getCompanyWechatId());
|
|
zfireParamBean = FieldUtils.supplyParam(zfireParamBean, UserCustomerVO.class);
|
|
zfireParamBean = FieldUtils.supplyParam(zfireParamBean, UserCustomerVO.class);
|
|
@@ -122,12 +123,13 @@ public class UserLogic {
|
|
|
|
|
|
/**
|
|
/**
|
|
* 师傅列表-v2
|
|
* 师傅列表-v2
|
|
|
|
+ *
|
|
* @param userZfireParamBean
|
|
* @param userZfireParamBean
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- public IPage<UserVO> page2(ZfireParamBean userZfireParamBean){
|
|
|
|
|
|
+ public IPage<UserVO> page2(ZfireParamBean userZfireParamBean) {
|
|
AdminUserCom adminUser = commonLogic.getAdminUser();
|
|
AdminUserCom adminUser = commonLogic.getAdminUser();
|
|
- ZfireParamBean zfireParamBean = FieldUtils.supplyParam(userZfireParamBean, UserVO.class,adminUser);
|
|
|
|
|
|
+ ZfireParamBean zfireParamBean = FieldUtils.supplyParam(userZfireParamBean, UserVO.class, adminUser);
|
|
|
|
|
|
IPage<UserVO> userVOIPage = commonMapper.userList(new Page(userZfireParamBean.getPageNum(), userZfireParamBean.getPageSize()), zfireParamBean, null);
|
|
IPage<UserVO> userVOIPage = commonMapper.userList(new Page(userZfireParamBean.getPageNum(), userZfireParamBean.getPageSize()), zfireParamBean, null);
|
|
return userVOIPage;
|
|
return userVOIPage;
|
|
@@ -135,12 +137,13 @@ public class UserLogic {
|
|
|
|
|
|
/**
|
|
/**
|
|
* 分销员列表-v2
|
|
* 分销员列表-v2
|
|
|
|
+ *
|
|
* @param userZfireParamBean
|
|
* @param userZfireParamBean
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- public IPage<User2VO> userServiceList(ZfireParamBean userZfireParamBean){
|
|
|
|
|
|
+ public IPage<User2VO> userServiceList(ZfireParamBean userZfireParamBean) {
|
|
AdminUserCom adminUser = commonLogic.getAdminUser();
|
|
AdminUserCom adminUser = commonLogic.getAdminUser();
|
|
- ZfireParamBean zfireParamBean = FieldUtils.supplyParam(userZfireParamBean, User2VO.class,adminUser);
|
|
|
|
|
|
+ ZfireParamBean zfireParamBean = FieldUtils.supplyParam(userZfireParamBean, User2VO.class, adminUser);
|
|
|
|
|
|
IPage<User2VO> userVOIPage = commonMapper.userServiceList(new Page(userZfireParamBean.getPageNum(), userZfireParamBean.getPageSize()), zfireParamBean);
|
|
IPage<User2VO> userVOIPage = commonMapper.userServiceList(new Page(userZfireParamBean.getPageNum(), userZfireParamBean.getPageSize()), zfireParamBean);
|
|
return userVOIPage;
|
|
return userVOIPage;
|
|
@@ -148,11 +151,12 @@ public class UserLogic {
|
|
|
|
|
|
/**
|
|
/**
|
|
* 待入驻用户信息列表-v2
|
|
* 待入驻用户信息列表-v2
|
|
|
|
+ *
|
|
* @param zfireParamBean
|
|
* @param zfireParamBean
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- public IPage<UserWaitVO> userWaitList(ZfireParamBean zfireParamBean){
|
|
|
|
- FieldUtils.supplyParam(zfireParamBean, UserWaitVO.class,commonLogic.getAdminUser());
|
|
|
|
|
|
+ public IPage<UserWaitVO> userWaitList(ZfireParamBean zfireParamBean) {
|
|
|
|
+ FieldUtils.supplyParam(zfireParamBean, UserWaitVO.class, commonLogic.getAdminUser());
|
|
IPage<UserWaitVO> page = commonMapper.userWaitList(new Page(zfireParamBean.getPageNum(), zfireParamBean.getPageSize()), zfireParamBean);
|
|
IPage<UserWaitVO> page = commonMapper.userWaitList(new Page(zfireParamBean.getPageNum(), zfireParamBean.getPageSize()), zfireParamBean);
|
|
return page;
|
|
return page;
|
|
}
|
|
}
|
|
@@ -160,15 +164,17 @@ public class UserLogic {
|
|
|
|
|
|
/**
|
|
/**
|
|
* 待入驻用户信息-删除
|
|
* 待入驻用户信息-删除
|
|
|
|
+ *
|
|
* @param id
|
|
* @param id
|
|
*/
|
|
*/
|
|
- public void userWaitDel(String id){
|
|
|
|
|
|
+ public void userWaitDel(String id) {
|
|
userWaitService.removeById(id);
|
|
userWaitService.removeById(id);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
* 修改师傅资料
|
|
* 修改师傅资料
|
|
|
|
+ *
|
|
* @param userId
|
|
* @param userId
|
|
* @param websitId
|
|
* @param websitId
|
|
* @param name
|
|
* @param name
|
|
@@ -177,10 +183,10 @@ public class UserLogic {
|
|
* @param bankAccount
|
|
* @param bankAccount
|
|
*/
|
|
*/
|
|
@Transactional
|
|
@Transactional
|
|
- public void updateWorker(String userId,String websitId,String name,String idCard,String idCardImg,String bankAccount,Boolean isEs){
|
|
|
|
|
|
+ public void updateWorker(String userId, String websitId, String name, String idCard, String idCardImg, String bankAccount, Boolean isEs) {
|
|
WebsitUser websitUser = websitUserService.lambdaQuery()
|
|
WebsitUser websitUser = websitUserService.lambdaQuery()
|
|
- .eq(WebsitUser::getUserId,userId)
|
|
|
|
- .eq(WebsitUser::getWebsitId,websitId).last("limit 1").one();
|
|
|
|
|
|
+ .eq(WebsitUser::getUserId, userId)
|
|
|
|
+ .eq(WebsitUser::getWebsitId, websitId).last("limit 1").one();
|
|
websitUser.setBankAccount(bankAccount);
|
|
websitUser.setBankAccount(bankAccount);
|
|
websitUser.updateById();
|
|
websitUser.updateById();
|
|
|
|
|
|
@@ -197,7 +203,7 @@ public class UserLogic {
|
|
* 导入待入驻用户信息
|
|
* 导入待入驻用户信息
|
|
*/
|
|
*/
|
|
@Transactional
|
|
@Transactional
|
|
- public void importData(List<Object> datas){
|
|
|
|
|
|
+ public void importData(List<Object> datas) {
|
|
AdminUserCom adminUser = commonLogic.getAdminUser();
|
|
AdminUserCom adminUser = commonLogic.getAdminUser();
|
|
List<AdminWebsit> list = adminWebsitService.lambdaQuery()
|
|
List<AdminWebsit> list = adminWebsitService.lambdaQuery()
|
|
.eq(AdminWebsit::getCompanyWechatId, adminUser.getCompanyWechatId())
|
|
.eq(AdminWebsit::getCompanyWechatId, adminUser.getCompanyWechatId())
|
|
@@ -206,32 +212,32 @@ public class UserLogic {
|
|
Map<String, AdminWebsit> websitMap = list.stream().collect(Collectors.toMap(v -> v.getName(), Function.identity()));
|
|
Map<String, AdminWebsit> websitMap = list.stream().collect(Collectors.toMap(v -> v.getName(), Function.identity()));
|
|
int index = 0;
|
|
int index = 0;
|
|
//先删除
|
|
//先删除
|
|
- userWaitService.lambdaUpdate().eq(UserWait::getCompanyWechatId,adminUser.getCompanyWechatId()).remove();
|
|
|
|
|
|
+ userWaitService.lambdaUpdate().eq(UserWait::getCompanyWechatId, adminUser.getCompanyWechatId()).remove();
|
|
|
|
|
|
List<UserWait> userWaits = new ArrayList<>();
|
|
List<UserWait> userWaits = new ArrayList<>();
|
|
- for(Object o : datas){
|
|
|
|
- index ++;
|
|
|
|
- String errPrefix = "第"+index+"行";
|
|
|
|
- List<Object> row = (List<Object>)o;
|
|
|
|
- CommonUtils.initList2(row,10);
|
|
|
|
|
|
+ for (Object o : datas) {
|
|
|
|
+ index++;
|
|
|
|
+ String errPrefix = "第" + index + "行";
|
|
|
|
+ List<Object> row = (List<Object>) o;
|
|
|
|
+ CommonUtils.initList2(row, 10);
|
|
String name = (String) row.get(0);
|
|
String name = (String) row.get(0);
|
|
String idcard = (String) row.get(1);
|
|
String idcard = (String) row.get(1);
|
|
String mobile = (String) row.get(2);
|
|
String mobile = (String) row.get(2);
|
|
String userType = (String) row.get(3);
|
|
String userType = (String) row.get(3);
|
|
String websitName = (String) row.get(4);
|
|
String websitName = (String) row.get(4);
|
|
String bankAccount = (String) row.get(5);
|
|
String bankAccount = (String) row.get(5);
|
|
- if(StringUtils.isAnyBlank(name,mobile,userType)){
|
|
|
|
|
|
+ if (StringUtils.isAnyBlank(name, mobile, userType)) {
|
|
throw new RemoteServiceException(errPrefix + "黄色区域为必填项");
|
|
throw new RemoteServiceException(errPrefix + "黄色区域为必填项");
|
|
}
|
|
}
|
|
- if(mobile.length() != 11){
|
|
|
|
|
|
+ if (mobile.length() != 11) {
|
|
throw new RemoteServiceException(errPrefix + "手机号格式不正确");
|
|
throw new RemoteServiceException(errPrefix + "手机号格式不正确");
|
|
}
|
|
}
|
|
UserTypeEnum userTypeEnum = BaseEnum.valueToEnum(UserTypeEnum.class, userType);
|
|
UserTypeEnum userTypeEnum = BaseEnum.valueToEnum(UserTypeEnum.class, userType);
|
|
- if(userTypeEnum == null || userTypeEnum == UserTypeEnum.GENERAL){
|
|
|
|
|
|
+ if (userTypeEnum == null || userTypeEnum == UserTypeEnum.GENERAL) {
|
|
throw new RemoteServiceException(errPrefix + "用户类型填写不合规,请填写【师傅】或者【分销员】");
|
|
throw new RemoteServiceException(errPrefix + "用户类型填写不合规,请填写【师傅】或者【分销员】");
|
|
}
|
|
}
|
|
AdminWebsit adminWebsit = null;
|
|
AdminWebsit adminWebsit = null;
|
|
- if(userTypeEnum == UserTypeEnum.WORKER) {
|
|
|
|
|
|
+ if (userTypeEnum == UserTypeEnum.WORKER) {
|
|
if (StringUtils.isBlank(websitName)) {
|
|
if (StringUtils.isBlank(websitName)) {
|
|
throw new RemoteServiceException(errPrefix + "网点名称不能为空");
|
|
throw new RemoteServiceException(errPrefix + "网点名称不能为空");
|
|
}
|
|
}
|
|
@@ -243,13 +249,13 @@ public class UserLogic {
|
|
UserWait userWait = new UserWait();
|
|
UserWait userWait = new UserWait();
|
|
userWait.setUserType(userTypeEnum.getKey());
|
|
userWait.setUserType(userTypeEnum.getKey());
|
|
userWait.setMobile(mobile);
|
|
userWait.setMobile(mobile);
|
|
- if(adminWebsit != null) {
|
|
|
|
|
|
+ if (adminWebsit != null) {
|
|
userWait.setWebsitId(adminWebsit.getWebsitId());
|
|
userWait.setWebsitId(adminWebsit.getWebsitId());
|
|
userWait.setWebsitName(adminWebsit.getName());
|
|
userWait.setWebsitName(adminWebsit.getName());
|
|
//入驻已存在的师傅到网点
|
|
//入驻已存在的师傅到网点
|
|
User worker = userService.lambdaQuery().eq(User::getMobile, mobile).eq(User::getType, UserTypeEnum.WORKER.getKey()).last("limit 1").one();
|
|
User worker = userService.lambdaQuery().eq(User::getMobile, mobile).eq(User::getType, UserTypeEnum.WORKER.getKey()).last("limit 1").one();
|
|
if (worker != null) {
|
|
if (worker != null) {
|
|
- this.saveWebsitUser(adminWebsit.getWebsitId(), worker, bankAccount,"系统导入初始化");
|
|
|
|
|
|
+ this.saveWebsitUser(adminWebsit.getWebsitId(), worker, bankAccount, "系统导入初始化");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
userWait.setName(name);
|
|
userWait.setName(name);
|
|
@@ -263,13 +269,13 @@ public class UserLogic {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* 师傅审核详情
|
|
* 师傅审核详情
|
|
|
|
+ *
|
|
* @param id
|
|
* @param id
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- public UserApplyWorkerBean workerExamineDetail(String id){
|
|
|
|
|
|
+ public UserApplyWorkerBean workerExamineDetail(String id) {
|
|
WebsitUser websitUser = websitUserService.getById(id);
|
|
WebsitUser websitUser = websitUserService.getById(id);
|
|
User user = userService.getById(websitUser.getUserId());
|
|
User user = userService.getById(websitUser.getUserId());
|
|
user.setExamineStatus(websitUser.getExamineStatus());
|
|
user.setExamineStatus(websitUser.getExamineStatus());
|
|
@@ -277,7 +283,7 @@ public class UserLogic {
|
|
user.setApplyWebsitId(websitUser.getWebsitId());
|
|
user.setApplyWebsitId(websitUser.getWebsitId());
|
|
|
|
|
|
AdminWebsit adminWebsit = adminWebsitService.getById(user.getApplyWebsitId());
|
|
AdminWebsit adminWebsit = adminWebsitService.getById(user.getApplyWebsitId());
|
|
- if(adminWebsit == null){
|
|
|
|
|
|
+ if (adminWebsit == null) {
|
|
throw new RemoteServiceException("申请入驻的网点不存在");
|
|
throw new RemoteServiceException("申请入驻的网点不存在");
|
|
}
|
|
}
|
|
|
|
|
|
@@ -306,15 +312,16 @@ public class UserLogic {
|
|
|
|
|
|
/**
|
|
/**
|
|
* 审批
|
|
* 审批
|
|
|
|
+ *
|
|
* @param id
|
|
* @param id
|
|
* @param examineStatus
|
|
* @param examineStatus
|
|
* @Param examineRemark 审核备注
|
|
* @Param examineRemark 审核备注
|
|
*/
|
|
*/
|
|
@Transactional
|
|
@Transactional
|
|
- public void examine(String id, ExamineStatusEnum examineStatus,String examineRemark){
|
|
|
|
|
|
+ public void examine(String id, ExamineStatusEnum examineStatus, String examineRemark) {
|
|
AdminUserCom adminUser = commonLogic.getAdminUser();
|
|
AdminUserCom adminUser = commonLogic.getAdminUser();
|
|
WebsitUser websitUser = websitUserService.getById(id);
|
|
WebsitUser websitUser = websitUserService.getById(id);
|
|
- if(!StringUtils.equals(websitUser.getExamineStatus(),ExamineStatusEnum.WAIT.getKey())){
|
|
|
|
|
|
+ if (!StringUtils.equals(websitUser.getExamineStatus(), ExamineStatusEnum.WAIT.getKey())) {
|
|
throw new RemoteServiceException("非待审批状态不可审批");
|
|
throw new RemoteServiceException("非待审批状态不可审批");
|
|
}
|
|
}
|
|
websitUser.setExamineStatus(examineStatus.getKey());
|
|
websitUser.setExamineStatus(examineStatus.getKey());
|
|
@@ -324,7 +331,7 @@ public class UserLogic {
|
|
websitUser.updateById();
|
|
websitUser.updateById();
|
|
|
|
|
|
User user = userService.getById(websitUser.getUserId());
|
|
User user = userService.getById(websitUser.getUserId());
|
|
- if(examineStatus.getKey().equals(ExamineStatusEnum.OK.getKey())){
|
|
|
|
|
|
+ if (examineStatus.getKey().equals(ExamineStatusEnum.OK.getKey())) {
|
|
user.setType(UserTypeEnum.WORKER.getKey());
|
|
user.setType(UserTypeEnum.WORKER.getKey());
|
|
}
|
|
}
|
|
user.updateById();
|
|
user.updateById();
|
|
@@ -333,21 +340,22 @@ public class UserLogic {
|
|
|
|
|
|
/**
|
|
/**
|
|
* 分销员审核
|
|
* 分销员审核
|
|
|
|
+ *
|
|
* @param userId
|
|
* @param userId
|
|
* @param examineStatus
|
|
* @param examineStatus
|
|
* @param examineRemark
|
|
* @param examineRemark
|
|
*/
|
|
*/
|
|
- public void shareExamine(String userId,ExamineStatusEnum examineStatus,String examineRemark){
|
|
|
|
|
|
+ public void shareExamine(String userId, ExamineStatusEnum examineStatus, String examineRemark) {
|
|
AdminUserCom adminUser = commonLogic.getAdminUser();
|
|
AdminUserCom adminUser = commonLogic.getAdminUser();
|
|
User user = userService.getById(userId);
|
|
User user = userService.getById(userId);
|
|
- if(!user.getType().equals(UserTypeEnum.GENERAL.getKey())){
|
|
|
|
|
|
+ if (!user.getType().equals(UserTypeEnum.GENERAL.getKey())) {
|
|
throw new RemoteServiceException("当前用户类型不可审批");
|
|
throw new RemoteServiceException("当前用户类型不可审批");
|
|
}
|
|
}
|
|
user.setExamineStatus(examineStatus.getKey());
|
|
user.setExamineStatus(examineStatus.getKey());
|
|
user.setExamineRemark(examineRemark);
|
|
user.setExamineRemark(examineRemark);
|
|
user.setExamineBy(adminUser.getNickName());
|
|
user.setExamineBy(adminUser.getNickName());
|
|
user.setExamineTime(new Date());
|
|
user.setExamineTime(new Date());
|
|
- if(user.getExamineStatus().equals(ExamineStatusEnum.OK.getKey())){
|
|
|
|
|
|
+ if (user.getExamineStatus().equals(ExamineStatusEnum.OK.getKey())) {
|
|
user.setType(UserTypeEnum.SERVICE.getKey());
|
|
user.setType(UserTypeEnum.SERVICE.getKey());
|
|
}
|
|
}
|
|
user.updateById();
|
|
user.updateById();
|
|
@@ -356,25 +364,27 @@ public class UserLogic {
|
|
|
|
|
|
/**
|
|
/**
|
|
* 批量设置取消内部分销员
|
|
* 批量设置取消内部分销员
|
|
|
|
+ *
|
|
* @param userIds
|
|
* @param userIds
|
|
* @param innerr
|
|
* @param innerr
|
|
*/
|
|
*/
|
|
- public void batchInner(List<String> userIds,Boolean innerr){
|
|
|
|
- userService.lambdaUpdate().set(User::getInnerr,innerr).in(User::getUserId,userIds).update();
|
|
|
|
|
|
+ public void batchInner(List<String> userIds, Boolean innerr) {
|
|
|
|
+ userService.lambdaUpdate().set(User::getInnerr, innerr).in(User::getUserId, userIds).update();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
* 批量设置二手商品发布权限
|
|
* 批量设置二手商品发布权限
|
|
|
|
+ *
|
|
* @param userIds
|
|
* @param userIds
|
|
*/
|
|
*/
|
|
- public void batchEs(List<String> userIds,Boolean isEs){
|
|
|
|
- userService.lambdaUpdate().set(User::getIsEs,isEs).in(User::getUserId,userIds).update();
|
|
|
|
|
|
+ public void batchEs(List<String> userIds, Boolean isEs) {
|
|
|
|
+ userService.lambdaUpdate().set(User::getIsEs, isEs).in(User::getUserId, userIds).update();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@Transactional
|
|
@Transactional
|
|
- public void batchType(UserApplyBean userApplyBean){
|
|
|
|
|
|
+ public void batchType(UserApplyBean userApplyBean) {
|
|
|
|
|
|
String userId = userApplyBean.getUserId();
|
|
String userId = userApplyBean.getUserId();
|
|
UserTypeEnum type = userApplyBean.getType();
|
|
UserTypeEnum type = userApplyBean.getType();
|
|
@@ -383,40 +393,40 @@ public class UserLogic {
|
|
String idCardImg = userApplyBean.getIdCardImg();
|
|
String idCardImg = userApplyBean.getIdCardImg();
|
|
|
|
|
|
AdminUserCom adminUser = commonLogic.getAdminUser();
|
|
AdminUserCom adminUser = commonLogic.getAdminUser();
|
|
- if(StringUtils.equals(type.getKey(),UserTypeEnum.WORKER.getKey())){
|
|
|
|
- if(StringUtils.isBlank(websitId)){
|
|
|
|
|
|
+ if (StringUtils.equals(type.getKey(), UserTypeEnum.WORKER.getKey())) {
|
|
|
|
+ if (StringUtils.isBlank(websitId)) {
|
|
throw new RemoteServiceException("请为师傅选择网点");
|
|
throw new RemoteServiceException("请为师傅选择网点");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
//非入驻网点,则删除当前用户的所有网点
|
|
//非入驻网点,则删除当前用户的所有网点
|
|
- if(StringUtils.isBlank(websitId)){
|
|
|
|
- websitUserService.lambdaUpdate().eq(WebsitUser::getUserId,userId).remove();
|
|
|
|
|
|
+ if (StringUtils.isBlank(websitId)) {
|
|
|
|
+ websitUserService.lambdaUpdate().eq(WebsitUser::getUserId, userId).remove();
|
|
}
|
|
}
|
|
//否则重新生成当前网点的入驻信息
|
|
//否则重新生成当前网点的入驻信息
|
|
- if(StringUtils.isNotBlank(websitId)){
|
|
|
|
|
|
+ if (StringUtils.isNotBlank(websitId)) {
|
|
|
|
|
|
User user = userService.getById(userId);
|
|
User user = userService.getById(userId);
|
|
- this.saveWebsitUser(websitId,user,userApplyBean.getBankAccount(),"系统手动设置");
|
|
|
|
|
|
+ this.saveWebsitUser(websitId, user, userApplyBean.getBankAccount(), "系统手动设置");
|
|
}
|
|
}
|
|
|
|
|
|
userService.lambdaUpdate()
|
|
userService.lambdaUpdate()
|
|
- .set(StringUtils.isNotBlank(userApplyBean.getName()),User::getNickName,userApplyBean.getName())
|
|
|
|
- .set(StringUtils.isNotBlank(userApplyBean.getBankAccount()),User::getBankAccount,userApplyBean.getBankAccount())
|
|
|
|
- .set(User::getExamineStatus,ExamineStatusEnum.OK.getKey())
|
|
|
|
- .set(User::getExamineTime,new Date())
|
|
|
|
- .set(User::getExamineBy,adminUser.getNickName())
|
|
|
|
- .set(User::getExamineRemark,"系统手动配置")
|
|
|
|
- .set(User::getApplyType,type.getKey())
|
|
|
|
- .set(User::getType,type.getKey())
|
|
|
|
- .set(StringUtils.isNotBlank(idCard),User::getIdCard,idCard)
|
|
|
|
- .set(StringUtils.isNotBlank(idCardImg),User::getIdCardImg,idCardImg)
|
|
|
|
- .in(User::getUserId,userId).update();
|
|
|
|
|
|
+ .set(StringUtils.isNotBlank(userApplyBean.getName()), User::getNickName, userApplyBean.getName())
|
|
|
|
+ .set(StringUtils.isNotBlank(userApplyBean.getBankAccount()), User::getBankAccount, userApplyBean.getBankAccount())
|
|
|
|
+ .set(User::getExamineStatus, ExamineStatusEnum.OK.getKey())
|
|
|
|
+ .set(User::getExamineTime, new Date())
|
|
|
|
+ .set(User::getExamineBy, adminUser.getNickName())
|
|
|
|
+ .set(User::getExamineRemark, "系统手动配置")
|
|
|
|
+ .set(User::getApplyType, type.getKey())
|
|
|
|
+ .set(User::getType, type.getKey())
|
|
|
|
+ .set(StringUtils.isNotBlank(idCard), User::getIdCard, idCard)
|
|
|
|
+ .set(StringUtils.isNotBlank(idCardImg), User::getIdCardImg, idCardImg)
|
|
|
|
+ .in(User::getUserId, userId).update();
|
|
|
|
|
|
//其他图片
|
|
//其他图片
|
|
- if(CollectionUtils.isNotEmpty(userApplyBean.getWorkerImgs())){
|
|
|
|
- workerImgService.lambdaUpdate().eq(WorkerImg::getWebsitId,websitId).eq(WorkerImg::getWorkerId,userId).remove();
|
|
|
|
- for(WorkerImg workerImg : userApplyBean.getWorkerImgs()){
|
|
|
|
|
|
+ if (CollectionUtils.isNotEmpty(userApplyBean.getWorkerImgs())) {
|
|
|
|
+ workerImgService.lambdaUpdate().eq(WorkerImg::getWebsitId, websitId).eq(WorkerImg::getWorkerId, userId).remove();
|
|
|
|
+ for (WorkerImg workerImg : userApplyBean.getWorkerImgs()) {
|
|
workerImg.setWebsitId(websitId);
|
|
workerImg.setWebsitId(websitId);
|
|
workerImg.setWorkerId(userId);
|
|
workerImg.setWorkerId(userId);
|
|
}
|
|
}
|
|
@@ -426,8 +436,8 @@ public class UserLogic {
|
|
}
|
|
}
|
|
|
|
|
|
@Transactional
|
|
@Transactional
|
|
- public void saveWebsitUser(String websitId,User user,String bankAccount,String remark){
|
|
|
|
- websitUserService.lambdaUpdate().eq(WebsitUser::getUserId,user.getUserId()).eq(WebsitUser::getWebsitId,websitId).remove();
|
|
|
|
|
|
+ public void saveWebsitUser(String websitId, User user, String bankAccount, String remark) {
|
|
|
|
+ websitUserService.lambdaUpdate().eq(WebsitUser::getUserId, user.getUserId()).eq(WebsitUser::getWebsitId, websitId).remove();
|
|
WebsitUser websitUser = new WebsitUser();
|
|
WebsitUser websitUser = new WebsitUser();
|
|
websitUser.setWebsitId(websitId);
|
|
websitUser.setWebsitId(websitId);
|
|
websitUser.setUserId(user.getUserId());
|
|
websitUser.setUserId(user.getUserId());
|
|
@@ -442,10 +452,11 @@ public class UserLogic {
|
|
|
|
|
|
/**
|
|
/**
|
|
* 用户详情-v2
|
|
* 用户详情-v2
|
|
|
|
+ *
|
|
* @param userId
|
|
* @param userId
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- public UserDetailBean detailV2(String userId){
|
|
|
|
|
|
+ public UserDetailBean detailV2(String userId) {
|
|
User user = userService.getById(userId);
|
|
User user = userService.getById(userId);
|
|
UserDetailBean userDetailBean = BeanUtil.copyProperties(user, UserDetailBean.class);
|
|
UserDetailBean userDetailBean = BeanUtil.copyProperties(user, UserDetailBean.class);
|
|
//网点对应关系
|
|
//网点对应关系
|
|
@@ -468,7 +479,7 @@ public class UserLogic {
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
public IPage<User> page(HttpServletRequest request, String keyword, String type, Boolean promotionGroupLeader,
|
|
public IPage<User> page(HttpServletRequest request, String keyword, String type, Boolean promotionGroupLeader,
|
|
- Boolean innerr,String startTime, String endTime, String sortJson, String websitId,Boolean isExchangeCode,
|
|
|
|
|
|
+ Boolean innerr, String startTime, String endTime, String sortJson, String websitId, Boolean isExchangeCode,
|
|
Integer pageNum, Integer pageSize) {
|
|
Integer pageNum, Integer pageSize) {
|
|
|
|
|
|
//获取当前登录企业微信id
|
|
//获取当前登录企业微信id
|
|
@@ -478,10 +489,10 @@ public class UserLogic {
|
|
LambdaQueryWrapper<User> memberLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<User> memberLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
memberLambdaQueryWrapper
|
|
memberLambdaQueryWrapper
|
|
.in(CollectionUtils.isNotEmpty(companyWechatIds), User::getCompanyWechatId, companyWechatIds)
|
|
.in(CollectionUtils.isNotEmpty(companyWechatIds), User::getCompanyWechatId, companyWechatIds)
|
|
- .eq(isExchangeCode != null,User::getIsExchangeCode,isExchangeCode)
|
|
|
|
|
|
+ .eq(isExchangeCode != null, User::getIsExchangeCode, isExchangeCode)
|
|
.eq(promotionGroupLeader != null, User::getPromotionGroupLeader, promotionGroupLeader)
|
|
.eq(promotionGroupLeader != null, User::getPromotionGroupLeader, promotionGroupLeader)
|
|
.eq(StringUtils.isNotBlank(type), User::getType, type)
|
|
.eq(StringUtils.isNotBlank(type), User::getType, type)
|
|
- .eq(innerr != null,User::getInnerr,innerr)
|
|
|
|
|
|
+ .eq(innerr != null, User::getInnerr, innerr)
|
|
// .in(!(adminWebsitBean.getType() && org.apache.commons.lang3.StringUtils.isBlank(websitId)), User::getWebsitNumber, websitNoList)
|
|
// .in(!(adminWebsitBean.getType() && org.apache.commons.lang3.StringUtils.isBlank(websitId)), User::getWebsitNumber, websitNoList)
|
|
.between(StringUtils.isNotBlank(startTime) && StringUtils.isNotBlank(endTime), User::getCreateTime, startTime, endTime)
|
|
.between(StringUtils.isNotBlank(startTime) && StringUtils.isNotBlank(endTime), User::getCreateTime, startTime, endTime)
|
|
.and(v -> v.ne(User::getMobile, ""))
|
|
.and(v -> v.ne(User::getMobile, ""))
|
|
@@ -581,25 +592,26 @@ public class UserLogic {
|
|
|
|
|
|
/**
|
|
/**
|
|
* 绑定师傅的辅助师傅
|
|
* 绑定师傅的辅助师傅
|
|
|
|
+ *
|
|
* @param websitId
|
|
* @param websitId
|
|
* @param userId
|
|
* @param userId
|
|
* @param slaveUserId
|
|
* @param slaveUserId
|
|
*/
|
|
*/
|
|
- public void bindSlaveWorker(String websitId,String userId,String slaveUserId){
|
|
|
|
|
|
+ public void bindSlaveWorker(String websitId, String userId, String slaveUserId) {
|
|
User user = userService.getById(userId);
|
|
User user = userService.getById(userId);
|
|
- if(!user.getType().equals(UserTypeEnum.WORKER.getKey())){
|
|
|
|
|
|
+ if (!user.getType().equals(UserTypeEnum.WORKER.getKey())) {
|
|
throw new RemoteServiceException("非师傅身份不可绑定辅助师傅");
|
|
throw new RemoteServiceException("非师傅身份不可绑定辅助师傅");
|
|
}
|
|
}
|
|
Integer count = websitUserService.lambdaQuery()
|
|
Integer count = websitUserService.lambdaQuery()
|
|
.eq(WebsitUser::getWebsitId, websitId)
|
|
.eq(WebsitUser::getWebsitId, websitId)
|
|
.in(WebsitUser::getUserId, userId, slaveUserId).count();
|
|
.in(WebsitUser::getUserId, userId, slaveUserId).count();
|
|
- if(count != 2){
|
|
|
|
|
|
+ if (count != 2) {
|
|
throw new RemoteServiceException("请选择同网点有效的辅助师傅");
|
|
throw new RemoteServiceException("请选择同网点有效的辅助师傅");
|
|
}
|
|
}
|
|
websitUserService.lambdaUpdate()
|
|
websitUserService.lambdaUpdate()
|
|
- .set(WebsitUser::getSlaveWorkerId,slaveUserId)
|
|
|
|
- .eq(WebsitUser::getWebsitId,websitId)
|
|
|
|
- .eq(WebsitUser::getUserId,userId)
|
|
|
|
|
|
+ .set(WebsitUser::getSlaveWorkerId, slaveUserId)
|
|
|
|
+ .eq(WebsitUser::getWebsitId, websitId)
|
|
|
|
+ .eq(WebsitUser::getUserId, userId)
|
|
.update();
|
|
.update();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -621,7 +633,7 @@ public class UserLogic {
|
|
.eq(User::getUserId, userId)
|
|
.eq(User::getUserId, userId)
|
|
.eq(User::getType, UserTypeEnum.SERVICE)
|
|
.eq(User::getType, UserTypeEnum.SERVICE)
|
|
.count();
|
|
.count();
|
|
- if(count == 0){
|
|
|
|
|
|
+ if (count == 0) {
|
|
throw new RemoteServiceException("只有业务员才能成为内部人员");
|
|
throw new RemoteServiceException("只有业务员才能成为内部人员");
|
|
}
|
|
}
|
|
userService.lambdaUpdate()
|
|
userService.lambdaUpdate()
|
|
@@ -636,8 +648,8 @@ public class UserLogic {
|
|
*/
|
|
*/
|
|
public void localUpdateInner(HttpServletRequest request, MultipartFile multipartFile) throws IOException {
|
|
public void localUpdateInner(HttpServletRequest request, MultipartFile multipartFile) throws IOException {
|
|
String loginCompanyWechatId = commonLogic.getAdminUser(request).getCompanyWechatId();
|
|
String loginCompanyWechatId = commonLogic.getAdminUser(request).getCompanyWechatId();
|
|
- if(StringUtils.isBlank(loginCompanyWechatId)){
|
|
|
|
- throw new RemoteServiceException("非租户账号不可操作当前信息");
|
|
|
|
|
|
+ if (StringUtils.isBlank(loginCompanyWechatId)) {
|
|
|
|
+ throw new RemoteServiceException("非租户账号不可操作当前信息");
|
|
}
|
|
}
|
|
|
|
|
|
List<Object> objects = ExcelUtils.importExcel(multipartFile);
|
|
List<Object> objects = ExcelUtils.importExcel(multipartFile);
|
|
@@ -836,24 +848,22 @@ public class UserLogic {
|
|
// //2.禁止用户分享优惠券
|
|
// //2.禁止用户分享优惠券
|
|
// couponLogic.updateUserCouponTransfer(userIds, true);
|
|
// couponLogic.updateUserCouponTransfer(userIds, true);
|
|
// }
|
|
// }
|
|
-
|
|
|
|
-
|
|
|
|
public User getById(String userId) {
|
|
public User getById(String userId) {
|
|
return userService.getById(userId);
|
|
return userService.getById(userId);
|
|
}
|
|
}
|
|
|
|
|
|
public List<User> getById(List<String> userIds) {
|
|
public List<User> getById(List<String> userIds) {
|
|
- if(CollectionUtils.isEmpty(userIds)){
|
|
|
|
|
|
+ if (CollectionUtils.isEmpty(userIds)) {
|
|
return new ArrayList<>();
|
|
return new ArrayList<>();
|
|
}
|
|
}
|
|
- return userService.lambdaQuery().in(User::getUserId,userIds).orderByDesc(User::getCreateTime).list();
|
|
|
|
|
|
+ return userService.lambdaQuery().in(User::getUserId, userIds).orderByDesc(User::getCreateTime).list();
|
|
}
|
|
}
|
|
|
|
|
|
- public List<User> getByMobile(List<String> mobiles){
|
|
|
|
- if(CollectionUtils.isEmpty(mobiles)){
|
|
|
|
|
|
+ public List<User> getByMobile(List<String> mobiles) {
|
|
|
|
+ if (CollectionUtils.isEmpty(mobiles)) {
|
|
return new ArrayList<>();
|
|
return new ArrayList<>();
|
|
}
|
|
}
|
|
- return userService.lambdaQuery().in(User::getMobile,mobiles).orderByDesc(User::getCreateTime).list();
|
|
|
|
|
|
+ return userService.lambdaQuery().in(User::getMobile, mobiles).orderByDesc(User::getCreateTime).list();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|