内部账号添加直销类别字段
This commit is contained in:
parent
10e2351a24
commit
34c1ffb170
|
|
@ -54,4 +54,9 @@ public class AccountAddRequest {
|
||||||
*/
|
*/
|
||||||
@JsonProperty("isGongFuHandler")
|
@JsonProperty("isGongFuHandler")
|
||||||
private boolean isGongFuHandler = false;
|
private boolean isGongFuHandler = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 直销类别(国内、国外),字典id
|
||||||
|
*/
|
||||||
|
private Long categoryId;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -84,5 +84,15 @@ public class AdminUserVO {
|
||||||
@JsonProperty("isGongfu")
|
@JsonProperty("isGongfu")
|
||||||
private boolean isGongfu;
|
private boolean isGongfu;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 直销类别(国内、国外),字典id
|
||||||
|
*/
|
||||||
|
private Long categoryId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 直销类别
|
||||||
|
*/
|
||||||
|
private String categoryName;
|
||||||
|
|
||||||
private List<AdminUserVO> children = new ArrayList<>();
|
private List<AdminUserVO> children = new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -132,4 +132,9 @@ public class AdminUser implements Serializable {
|
||||||
*/
|
*/
|
||||||
@TableField("is_gongfu")
|
@TableField("is_gongfu")
|
||||||
private boolean gongfu;
|
private boolean gongfu;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 直销类别(国内、国外),字典id
|
||||||
|
*/
|
||||||
|
private Long categoryId;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -67,6 +67,9 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
|
||||||
@Resource
|
@Resource
|
||||||
private IDictionaryItemTranslateService dictionaryItemTranslateService;
|
private IDictionaryItemTranslateService dictionaryItemTranslateService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IDictionaryItemService dictionaryItemService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AdminUser getUser(String userName, String password) {
|
public AdminUser getUser(String userName, String password) {
|
||||||
AdminUser user = lambdaQuery()
|
AdminUser user = lambdaQuery()
|
||||||
|
|
@ -99,6 +102,7 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
|
||||||
.setProductLine(request.getProductLine())
|
.setProductLine(request.getProductLine())
|
||||||
.setGongFuHandler(request.isGongFuHandler())
|
.setGongFuHandler(request.isGongFuHandler())
|
||||||
.setGongfu(StrUtil.contains(request.getProductLine(), Constant.MOBILE_BROKEN))
|
.setGongfu(StrUtil.contains(request.getProductLine(), Constant.MOBILE_BROKEN))
|
||||||
|
.setCategoryId(request.getCategoryId())
|
||||||
.setUpdateBy(AdminUserUtil.getUserId())
|
.setUpdateBy(AdminUserUtil.getUserId())
|
||||||
.setUpdateTime(LocalDateTime.now());
|
.setUpdateTime(LocalDateTime.now());
|
||||||
updateById(user);
|
updateById(user);
|
||||||
|
|
@ -115,6 +119,7 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
|
||||||
.setProductLine(request.getProductLine())
|
.setProductLine(request.getProductLine())
|
||||||
.setGongFuHandler(request.isGongFuHandler())
|
.setGongFuHandler(request.isGongFuHandler())
|
||||||
.setGongfu(StrUtil.contains(request.getProductLine(), Constant.MOBILE_BROKEN))
|
.setGongfu(StrUtil.contains(request.getProductLine(), Constant.MOBILE_BROKEN))
|
||||||
|
.setCategoryId(request.getCategoryId())
|
||||||
.setTitleId(request.getTitleId())
|
.setTitleId(request.getTitleId())
|
||||||
.setCreateBy(AdminUserUtil.getUserId())
|
.setCreateBy(AdminUserUtil.getUserId())
|
||||||
.setCreateTime(LocalDateTime.now());
|
.setCreateTime(LocalDateTime.now());
|
||||||
|
|
@ -164,6 +169,12 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
|
||||||
List<AdminUser> users = lambdaQuery().list();
|
List<AdminUser> users = lambdaQuery().list();
|
||||||
List<AdminUserRoleMap> roleMaps = adminUserRoleMapService.lambdaQuery().list();
|
List<AdminUserRoleMap> roleMaps = adminUserRoleMapService.lambdaQuery().list();
|
||||||
List<AdminRole> roles = roleService.lambdaQuery().list();
|
List<AdminRole> roles = roleService.lambdaQuery().list();
|
||||||
|
List<DictionaryItem> categories = dictionaryItemService.lambdaQuery()
|
||||||
|
.in(DictionaryItem::getId, page.getRecords().stream()
|
||||||
|
.map(AdminUser::getCategoryId)
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.collect(Collectors.toList())
|
||||||
|
).list();
|
||||||
pageData.setItems(page.getRecords().stream().map(u -> {
|
pageData.setItems(page.getRecords().stream().map(u -> {
|
||||||
AdminUser userCreate = users.stream()
|
AdminUser userCreate = users.stream()
|
||||||
.filter(it -> Objects.equals(it.getId(), u.getCreateBy()))
|
.filter(it -> Objects.equals(it.getId(), u.getCreateBy()))
|
||||||
|
|
@ -188,6 +199,10 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
|
||||||
.filter(it -> Objects.equals(it.getUserId(), u.getId()))
|
.filter(it -> Objects.equals(it.getUserId(), u.getId()))
|
||||||
.map(AdminUserRoleMap::getRoleId)
|
.map(AdminUserRoleMap::getRoleId)
|
||||||
.collect(Collectors.toSet());
|
.collect(Collectors.toSet());
|
||||||
|
DictionaryItem category = categories.stream()
|
||||||
|
.filter(c -> Objects.equals(c.getId(), u.getCategoryId()))
|
||||||
|
.findFirst()
|
||||||
|
.orElse(null);
|
||||||
return new AdminUserVO()
|
return new AdminUserVO()
|
||||||
.setId(u.getId())
|
.setId(u.getId())
|
||||||
.setUserCode(u.getUserCode())
|
.setUserCode(u.getUserCode())
|
||||||
|
|
@ -209,6 +224,8 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
|
||||||
.setGongFuHandler(u.isGongFuHandler())
|
.setGongFuHandler(u.isGongFuHandler())
|
||||||
.setProductLine(u.getProductLine())
|
.setProductLine(u.getProductLine())
|
||||||
.setGongfu(u.isGongfu())
|
.setGongfu(u.isGongfu())
|
||||||
|
.setCategoryId(u.getCategoryId())
|
||||||
|
.setCategoryName(Objects.isNull(category) ? "" : category.getName())
|
||||||
.setRoles(
|
.setRoles(
|
||||||
roles.stream()
|
roles.stream()
|
||||||
.filter(r -> rmaps.contains(r.getId()))
|
.filter(r -> rmaps.contains(r.getId()))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue