|
@@ -1025,6 +1025,23 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
|
|
sysOrganizationUserLink.setOrganizationId(sysUserVo.getOrganizationId());
|
|
sysOrganizationUserLink.setOrganizationId(sysUserVo.getOrganizationId());
|
|
|
sysOrganizationUserLinkService.save(sysOrganizationUserLink);
|
|
sysOrganizationUserLinkService.save(sysOrganizationUserLink);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ //修改团队类型
|
|
|
|
|
+ sysOrganizationUserLinkService.getOrganizationUser(Long.parseLong(originSysUser.getId()),baseController.getSystemCode());
|
|
|
|
|
+ if (sysUserVo.getTypeAttr() != null && !sysUserVo.getTypeAttr().equals("")){
|
|
|
|
|
+ List<SysUserJzgInfoSalesman> typeAttrByUserId = sysUserJzgInfoSalesmanService.getTypeAttrByUserId(sysUserJzgInfo.getId());
|
|
|
|
|
+ // 个代 团队 电销 渠道 只能存在一条
|
|
|
|
|
+ List<SysUserJzgInfoSalesman> list = typeAttrByUserId.stream().filter(x -> x.getTypeAttr().equals("5") || x.getTypeAttr().equals("6") || x.getTypeAttr().equals("7") || x.getTypeAttr().equals("8")).toList();
|
|
|
|
|
+ List<String> ids = list.stream().map(SysUserJzgInfoSalesman::getId).collect(Collectors.toList());
|
|
|
|
|
+ sysUserJzgInfoSalesmanService.removeByIds(ids);
|
|
|
|
|
+ //新增一条
|
|
|
|
|
+ SysUserJzgInfoSalesman salesman = new SysUserJzgInfoSalesman();
|
|
|
|
|
+ salesman.setId(IdGenerate.nextId());
|
|
|
|
|
+ salesman.setSysUserJzgInfoId(sysUserJzgInfo.getId());
|
|
|
|
|
+ salesman.setTypeAttr(sysUserVo.getTypeAttr());
|
|
|
|
|
+ sysUserJzgInfoSalesmanService.save(salesman);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
boolean isPartner = sysUserJzgInfoService.isPartnerPresent(sysUserJzgInfo.getId());
|
|
boolean isPartner = sysUserJzgInfoService.isPartnerPresent(sysUserJzgInfo.getId());
|
|
|
if (isPartner){
|
|
if (isPartner){
|
|
|
sysUserJzgInfoService.updatePartnerByUserId(sysUserJzgInfo);
|
|
sysUserJzgInfoService.updatePartnerByUserId(sysUserJzgInfo);
|