|
@@ -319,17 +319,43 @@ public class SysUserOrderAuthorServiceImpl implements ISysUserOrderAuthorService
|
|
public void initUserAuthor() {
|
|
public void initUserAuthor() {
|
|
List<SysUserOrderAuthor> userOrderAuthorList = new ArrayList<>();
|
|
List<SysUserOrderAuthor> userOrderAuthorList = new ArrayList<>();
|
|
//diy
|
|
//diy
|
|
- List<SysUserOrderAuthor> userOrderAuthorDiyList = sysUserOrderAuthorMapper.selectAuthorIdByCode("tuc_diy");
|
|
|
|
|
|
+ List<SysUserOrderAuthor> userOrderAuthorDiyList = sysUserOrderAuthorMapper.selectAuthorIdByCode("tuc_diy",null);
|
|
List<Long> diyauthList=userOrderAuthorDiyList.stream().map(SysUserOrderAuthor::getAuthorId).collect(Collectors.toList());
|
|
List<Long> diyauthList=userOrderAuthorDiyList.stream().map(SysUserOrderAuthor::getAuthorId).collect(Collectors.toList());
|
|
List<SysUserOrderAuthor> diyrole=sysUserOrderAuthorMapper.selectByParentId(diyauthList);
|
|
List<SysUserOrderAuthor> diyrole=sysUserOrderAuthorMapper.selectByParentId(diyauthList);
|
|
userOrderAuthorDiyList.addAll(diyrole);
|
|
userOrderAuthorDiyList.addAll(diyrole);
|
|
|
|
+ //division
|
|
|
|
+ //BMD-NVB2023T05
|
|
|
|
+ List<SysUserOrderAuthor> userOrderAuthorBMDList = sysUserOrderAuthorMapper.selectAuthorIdByCode("tuc_diy","NVB2023T05");
|
|
|
|
+ List<Long> BMdAuthList=userOrderAuthorBMDList.stream().map(SysUserOrderAuthor::getAuthorId).collect(Collectors.toList());
|
|
|
|
+ List<SysUserOrderAuthor> BMdRole=sysUserOrderAuthorMapper.selectByParentId(BMdAuthList);
|
|
|
|
+ userOrderAuthorBMDList.addAll(BMdRole);
|
|
|
|
+ //12北-NVB2023T01
|
|
|
|
+ List<SysUserOrderAuthor> userOrderAuthor12bList = sysUserOrderAuthorMapper.selectAuthorIdByCode("tuc_diy","NVB2023T01");
|
|
|
|
+ List<Long> b12AuthList=userOrderAuthor12bList.stream().map(SysUserOrderAuthor::getAuthorId).collect(Collectors.toList());
|
|
|
|
+ List<SysUserOrderAuthor> b12Role=sysUserOrderAuthorMapper.selectByParentId(b12AuthList);
|
|
|
|
+ userOrderAuthor12bList.addAll(b12Role);
|
|
|
|
+ //12南-NVB2023T02
|
|
|
|
+ List<SysUserOrderAuthor> userOrderAuthor12nList = sysUserOrderAuthorMapper.selectAuthorIdByCode("tuc_diy","NVB2023T02");
|
|
|
|
+ List<Long> n12AuthList=userOrderAuthor12nList.stream().map(SysUserOrderAuthor::getAuthorId).collect(Collectors.toList());
|
|
|
|
+ List<SysUserOrderAuthor> n12Role=sysUserOrderAuthorMapper.selectByParentId(n12AuthList);
|
|
|
|
+ userOrderAuthor12nList.addAll(n12Role);
|
|
|
|
+ //12中-NVB2023T03
|
|
|
|
+ List<SysUserOrderAuthor> userOrderAuthor12zList = sysUserOrderAuthorMapper.selectAuthorIdByCode("tuc_diy","NVB2023T03");
|
|
|
|
+ List<Long> z12AuthList=userOrderAuthor12zList.stream().map(SysUserOrderAuthor::getAuthorId).collect(Collectors.toList());
|
|
|
|
+ List<SysUserOrderAuthor> z12Role=sysUserOrderAuthorMapper.selectByParentId(z12AuthList);
|
|
|
|
+ userOrderAuthor12zList.addAll(z12Role);
|
|
|
|
+ //36城-NVB2023T04
|
|
|
|
+ List<SysUserOrderAuthor> userOrderAuthor36List = sysUserOrderAuthorMapper.selectAuthorIdByCode("tuc_diy","NVB2023T04");
|
|
|
|
+ List<Long> c36AuthList=userOrderAuthor36List.stream().map(SysUserOrderAuthor::getAuthorId).collect(Collectors.toList());
|
|
|
|
+ List<SysUserOrderAuthor> c36Role=sysUserOrderAuthorMapper.selectByParentId(c36AuthList);
|
|
|
|
+ userOrderAuthor36List.addAll(c36Role);
|
|
//cw
|
|
//cw
|
|
/* List<SysUserOrderAuthor> userOrderAuthorCwList = sysUserOrderAuthorMapper.selectAuthorIdByCode("tuc_cw");
|
|
/* List<SysUserOrderAuthor> userOrderAuthorCwList = sysUserOrderAuthorMapper.selectAuthorIdByCode("tuc_cw");
|
|
List<Long> cwauthList=userOrderAuthorCwList.stream().map(SysUserOrderAuthor::getAuthorId).collect(Collectors.toList());
|
|
List<Long> cwauthList=userOrderAuthorCwList.stream().map(SysUserOrderAuthor::getAuthorId).collect(Collectors.toList());
|
|
List<SysUserOrderAuthor> cwrole=sysUserOrderAuthorMapper.selectByParentId(cwauthList);
|
|
List<SysUserOrderAuthor> cwrole=sysUserOrderAuthorMapper.selectByParentId(cwauthList);
|
|
userOrderAuthorCwList.addAll(cwrole);*/
|
|
userOrderAuthorCwList.addAll(cwrole);*/
|
|
//ysl
|
|
//ysl
|
|
- List<SysUserOrderAuthor> userOrderAuthorYSLList = sysUserOrderAuthorMapper.selectAuthorIdByCode("YSL");
|
|
|
|
|
|
+ List<SysUserOrderAuthor> userOrderAuthorYSLList = sysUserOrderAuthorMapper.selectAuthorIdByCode("YSL",null);
|
|
List<Long> yslauthList=userOrderAuthorYSLList.stream().map(SysUserOrderAuthor::getAuthorId).collect(Collectors.toList());
|
|
List<Long> yslauthList=userOrderAuthorYSLList.stream().map(SysUserOrderAuthor::getAuthorId).collect(Collectors.toList());
|
|
List<SysUserOrderAuthor> yslrole=sysUserOrderAuthorMapper.selectByParentId(yslauthList);
|
|
List<SysUserOrderAuthor> yslrole=sysUserOrderAuthorMapper.selectByParentId(yslauthList);
|
|
userOrderAuthorYSLList.addAll(yslrole);
|
|
userOrderAuthorYSLList.addAll(yslrole);
|
|
@@ -349,10 +375,23 @@ public class SysUserOrderAuthorServiceImpl implements ISysUserOrderAuthorService
|
|
} else if (intNumber.equals("ysl")) {
|
|
} else if (intNumber.equals("ysl")) {
|
|
userOrderAuthorList.clear();
|
|
userOrderAuthorList.clear();
|
|
userOrderAuthorList.addAll(userOrderAuthorYSLList);
|
|
userOrderAuthorList.addAll(userOrderAuthorYSLList);
|
|
- }
|
|
|
|
|
|
+ }else if (intNumber.equals("division")) {
|
|
|
|
+ userOrderAuthorList.clear();
|
|
|
|
+ if(("NVB2023T05").equals(sysUserExt.getOrgCode())){
|
|
|
|
+ userOrderAuthorList.addAll(userOrderAuthorBMDList);
|
|
|
|
+ }else if(("NVB2023T01").equals(sysUserExt.getOrgCode())){
|
|
|
|
+ userOrderAuthorList.addAll(userOrderAuthor12bList);
|
|
|
|
+ }else if(("NVB2023T02").equals(sysUserExt.getOrgCode())){
|
|
|
|
+ userOrderAuthorList.addAll(userOrderAuthor12nList);
|
|
|
|
+ }else if(("NVB2023T03").equals(sysUserExt.getOrgCode())){
|
|
|
|
+ userOrderAuthorList.addAll(userOrderAuthor12zList);
|
|
|
|
+ }else if(("NVB2023T04").equals(sysUserExt.getOrgCode())){
|
|
|
|
+ userOrderAuthorList.addAll(userOrderAuthor36List);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
if(userOrderAuthorList.size()>0){
|
|
if(userOrderAuthorList.size()>0){
|
|
- List<Long> userole = userAuthorRelMapper.selectSysUserAuthorRelListById(sysUserExt.getUserId());
|
|
|
|
- if (userole ==null ||userole.size() == 0) {
|
|
|
|
|
|
+ userAuthorRelMapper.deleteSysUserAuthorRelById(sysUserExt.getUserId());
|
|
SysUserAuthorRel role = new SysUserAuthorRel();
|
|
SysUserAuthorRel role = new SysUserAuthorRel();
|
|
role.setUserId(sysUserExt.getUserId());
|
|
role.setUserId(sysUserExt.getUserId());
|
|
role.setAuthorId(userOrderAuthorList.get(0).getParentId());
|
|
role.setAuthorId(userOrderAuthorList.get(0).getParentId());
|
|
@@ -363,20 +402,6 @@ public class SysUserOrderAuthorServiceImpl implements ISysUserOrderAuthorService
|
|
userRel.setAuthorId(sysUserOrderAuthor.getAuthorId());
|
|
userRel.setAuthorId(sysUserOrderAuthor.getAuthorId());
|
|
userAuthorRelMapper.insertSysUserAuthorRel(userRel);
|
|
userAuthorRelMapper.insertSysUserAuthorRel(userRel);
|
|
});
|
|
});
|
|
- }else{
|
|
|
|
- userole.remove(0);
|
|
|
|
- List<Long> uinon=userOrderAuthorList.stream().map(SysUserOrderAuthor::getAuthorId).collect(Collectors.toList());
|
|
|
|
- uinon.removeAll(userole);
|
|
|
|
- if(uinon.size()>0){
|
|
|
|
- List<Long> newrole=uinon.stream().distinct().collect(Collectors.toList());
|
|
|
|
- newrole.forEach(role -> {
|
|
|
|
- SysUserAuthorRel userRel = new SysUserAuthorRel();
|
|
|
|
- userRel.setUserId(sysUserExt.getUserId());
|
|
|
|
- userRel.setAuthorId(role);
|
|
|
|
- userAuthorRelMapper.insertSysUserAuthorRel(userRel);
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|