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