|
@@ -6,7 +6,10 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.google.code.kaptcha.impl.DefaultKaptcha;
|
|
|
import com.gree.mall.manager.bean.ExcelData;
|
|
|
import com.gree.mall.manager.bean.SVerification;
|
|
|
-import com.gree.mall.manager.bean.admin.*;
|
|
|
+import com.gree.mall.manager.bean.admin.AdminModuleTree;
|
|
|
+import com.gree.mall.manager.bean.admin.AdminUserBean;
|
|
|
+import com.gree.mall.manager.bean.admin.AdminUserCom;
|
|
|
+import com.gree.mall.manager.bean.admin.AdminWebsitGrantBean;
|
|
|
import com.gree.mall.manager.bean.admin.reqDto.AdminUserAddReqBean;
|
|
|
import com.gree.mall.manager.bean.admin.respDto.AdminCompanyWechatRespPageBean;
|
|
|
import com.gree.mall.manager.commonmapper.AdminMapper;
|
|
@@ -212,6 +215,10 @@ public class AdminUserLogic {
|
|
|
if (!StringUtil.isEmpty(adminUser.getAdminWebsitId())) {
|
|
|
AdminWebsit adminWebsit = adminWebsitService.getById(adminUser.getAdminWebsitId());
|
|
|
|
|
|
+ if (adminWebsit.getType().equals(AdminWebsitTypeEnum.A.getKey()) && curAdminUser.getType() != 2) {
|
|
|
+ throw new RemoteServiceException("当前账号非“平台”类型不能创建平台账号");
|
|
|
+ }
|
|
|
+
|
|
|
//非平台账号
|
|
|
if (!StringUtils.equals(adminWebsit.getType(), AdminWebsitTypeEnum.A.getKey())) {
|
|
|
adminUser.setCompanyWechatId(adminWebsit.getCompanyWechatId());
|
|
@@ -314,6 +321,10 @@ public class AdminUserLogic {
|
|
|
throw new RemoteServiceException("请选择部门");
|
|
|
}
|
|
|
|
|
|
+ if (adminWebsit.getType().equals(AdminWebsitTypeEnum.A.getKey()) && admin.getType() != 2) {
|
|
|
+ throw new RemoteServiceException("当前账号非“平台”类型不能创建平台账号");
|
|
|
+ }
|
|
|
+
|
|
|
if (admin.getType() == 0 && !StringUtils.equals(adminWebsit.getType(), AdminWebsitTypeEnum.C.getKey())) {
|
|
|
throw new RemoteServiceException("网点账号请选择普通网点");
|
|
|
}
|
|
@@ -394,11 +405,15 @@ public class AdminUserLogic {
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
- public IPage<AdminUser> list(String companyWechatId,String companyWechatName,String roleId, Boolean status, String userName, Integer pageNum, Integer pageSize) {
|
|
|
+ public IPage<AdminUser> list(String companyWechatId, String companyWechatName, String roleId, Boolean status, String userName, Integer pageNum, Integer pageSize) {
|
|
|
AdminUserCom adminUser = commonLogic.getAdminUser();
|
|
|
+
|
|
|
+ if (adminUser.getType() != 2) {
|
|
|
+ companyWechatId = adminUser.getAdminCompanyWechat().getCompanyWechatId();
|
|
|
+ }
|
|
|
IPage<AdminUser> page = adminUserService.lambdaQuery()
|
|
|
- .eq(StringUtils.isNotBlank(companyWechatId),AdminUser::getCompanyWechatId,companyWechatId)
|
|
|
- .like(StringUtils.isNotBlank(companyWechatName),AdminUser::getCompanyName,companyWechatName)
|
|
|
+ .eq(StringUtils.isNotBlank(companyWechatId), AdminUser::getCompanyWechatId, companyWechatId)
|
|
|
+ .like(StringUtils.isNotBlank(companyWechatName), AdminUser::getCompanyName, companyWechatName)
|
|
|
.eq(StringUtils.isNotBlank(roleId), AdminUser::getRoleId, roleId)
|
|
|
.eq(status != null, AdminUser::getStatus, status)
|
|
|
.in(CollectionUtils.isNotEmpty(adminUser.getCompanyWechatIds()), AdminUser::getCompanyWechatId, adminUser.getCompanyWechatIds())
|
|
@@ -455,10 +470,11 @@ public class AdminUserLogic {
|
|
|
BeanUtils.copyProperties(adminUser, adminUserBean);
|
|
|
|
|
|
AdminWebsit adminWebsit = adminWebsitService.lambdaQuery()
|
|
|
- .eq(AdminWebsit::getCompanyWechatId,adminUser.getCompanyWechatId())
|
|
|
- .eq(AdminWebsit::getType,AdminWebsitTypeEnum.B.getKey())
|
|
|
- .last("limit 1").one();
|
|
|
- if(adminWebsit != null){
|
|
|
+ .eq(AdminWebsit::getCompanyWechatId, adminUser.getCompanyWechatId())
|
|
|
+ .eq(AdminWebsit::getType, AdminWebsitTypeEnum.B.getKey())
|
|
|
+ .last("limit 1")
|
|
|
+ .one();
|
|
|
+ if (adminWebsit != null) {
|
|
|
adminUserBean.setJoinCode(adminWebsit.getJoinCode());
|
|
|
}
|
|
|
|
|
@@ -502,7 +518,7 @@ public class AdminUserLogic {
|
|
|
AdminUserDeptRela adminUserDeptRela = adminUserDeptRelaService.lambdaQuery()
|
|
|
.eq(AdminUserDeptRela::getAdminUserId, adminUser.getAdminUserId()).last("limit 1").one();
|
|
|
|
|
|
- if (adminUserDeptRela != null){
|
|
|
+ if (adminUserDeptRela != null) {
|
|
|
adminUserBean.setAdminDeptId(adminUserDeptRela.getAdminDeptId());
|
|
|
List<AdminDeptWebsit> adminDeptWebsitList = adminDeptWebsitService.lambdaQuery().eq(AdminDeptWebsit::getAdminDeptId, adminUserDeptRela.getAdminDeptId()).list();
|
|
|
List<String> collect = adminDeptWebsitList.stream().map(AdminDeptWebsit::getWebsitId).collect(Collectors.toList());
|