feat: There is no way the, buss tree auth
This commit is contained in:
+95
-9
@@ -19,6 +19,7 @@ import com.adc.da.search.service.StandLawsSearchService;
|
||||
import com.adc.da.slrs.otConvertMq.dao.OtConvertMqDao;
|
||||
import com.adc.da.slrs.otConvertMq.entity.OtConvertMq;
|
||||
import com.adc.da.slrs.sarBussStandAttrInfo.dao.SarBussStandAttrInfoDao;
|
||||
import com.adc.da.slrs.sarBussStandAttrInfo.entity.SarBussStandAttrInfo;
|
||||
import com.adc.da.slrs.sarBussStandFile.dao.SarBussStandFileDao;
|
||||
import com.adc.da.slrs.sarBussStandFile.entity.SarBussStandFile;
|
||||
import com.adc.da.slrs.sarBussStandItems.dao.SarBussStandItemsDao;
|
||||
@@ -42,6 +43,7 @@ import com.adc.da.slrs.sysInfo.service.SysInfoEOService;
|
||||
import com.adc.da.sys.constant.ValueStateEnum;
|
||||
import com.adc.da.sys.dao.DicTypeEODao;
|
||||
import com.adc.da.sys.entity.DicTypeEO;
|
||||
import com.adc.da.sys.sarMenuStandard.service.ISarMenuStandardService;
|
||||
import com.adc.da.sys.util.LoginUserUtil;
|
||||
import com.adc.da.util.UUIDUtils;
|
||||
import com.adc.da.utils.util.FieldConvertUtil;
|
||||
@@ -145,6 +147,9 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
@Autowired
|
||||
private StandLawsSearchService standLawsSearchService;
|
||||
|
||||
@Autowired
|
||||
private ISarMenuStandardService iSarMenuStandardService;
|
||||
|
||||
@Override
|
||||
public SarBussionessStand getStandInfoByReviseStatus(String reviseStatus){
|
||||
return sarBussionessStandEODao.getStandInfoByReviseStatus(reviseStatus);
|
||||
@@ -250,11 +255,13 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
page.setPageSize(10000);
|
||||
//查询当前登录人角色拥有权限的菜单
|
||||
if(page.getMenuId() != null && page.getUserId() != null && StringUtils.isNotBlank(page.getUserId())){
|
||||
String treeType = page.getTreeType();
|
||||
QueryWrapper<TsResource> qw = new QueryWrapper<>();
|
||||
qw.eq("ID",page.getMenuId());
|
||||
qw.isNull("PARENT_ID");
|
||||
List<TsResource> children = iTsResourceService.list(qw);
|
||||
if(children.isEmpty() && !page.getMenuId().equals("nomenu")){
|
||||
|
||||
if(children.isEmpty() && !page.getMenuId().equals("nomenu") && StringUtils.isNotBlank(treeType) && "tsr".equals(treeType)){
|
||||
List<String> getMenuIdList = tsUserService.getResourceUserId(page.getUserId());
|
||||
if (getMenuIdList != null && !getMenuIdList.isEmpty()) {
|
||||
page.setMenuRoleList(getMenuIdList);
|
||||
@@ -265,7 +272,31 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
if (ids != null && !ids.isEmpty()) {
|
||||
page.setMenuAllChildrenIdList(ids);
|
||||
}
|
||||
}else if(!page.getMenuId().equals("nomenu") && StringUtils.isNotBlank(treeType) && "sarMs".equals(treeType)){
|
||||
List<String> getMenuIdList = tsUserService.getResourceUserId(page.getUserId());
|
||||
if (getMenuIdList != null && !getMenuIdList.isEmpty()) {
|
||||
page.setMenuRoleList(getMenuIdList);
|
||||
} else {
|
||||
page.setMenuRoleList(null);
|
||||
}
|
||||
List<String> ids = iSarMenuStandardService.getChildMenuList(page.getMenuId());
|
||||
if (ids != null && !ids.isEmpty()) {
|
||||
page.setMenuAllChildrenIdList(ids);
|
||||
}
|
||||
}
|
||||
|
||||
// if(children.isEmpty() && !page.getMenuId().equals("nomenu")){
|
||||
// List<String> getMenuIdList = tsUserService.getResourceUserId(page.getUserId());
|
||||
// if (getMenuIdList != null && !getMenuIdList.isEmpty()) {
|
||||
// page.setMenuRoleList(getMenuIdList);
|
||||
// } else {
|
||||
// page.setMenuRoleList(null);
|
||||
// }
|
||||
// List<String> ids = iTsResourceService.getChildMenuList(page.getMenuId());
|
||||
// if (ids != null && !ids.isEmpty()) {
|
||||
// page.setMenuAllChildrenIdList(ids);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
if (StringUtils.isNotBlank(page.getAdvanceSearchVOStr())) {
|
||||
List<SarAdvanceSearchVO> searchList = com.alibaba.fastjson.JSONObject.parseArray(page.getAdvanceSearchVOStr(),SarAdvanceSearchVO.class);
|
||||
@@ -850,15 +881,24 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
public SarBussionessStandEOPage updateStandardsMenu(SarBussionessStandEOPage standardsInfoEO) {
|
||||
SarBussStandMenu sarStandMenuEO = new SarBussStandMenu();
|
||||
String nowMenuId = standardsInfoEO.getMenuId();
|
||||
String treeType = standardsInfoEO.getTreeType();
|
||||
String menuName = standardsInfoEO.getMenuName();
|
||||
sarStandMenuEO.setMenuId(nowMenuId);
|
||||
for (int i = 0; i < standardsInfoEO.getIdlist().length; i++) {
|
||||
sarStandMenuEO.setBussStandId(standardsInfoEO.getIdlist()[i]);
|
||||
String standId = standardsInfoEO.getIdlist()[i];
|
||||
sarStandMenuEO.setBussStandId(standId);
|
||||
sarStandMenuEO.setId(null);
|
||||
sarStandMenuEO.setValidFlag(0);
|
||||
sarStandMenuEO.setTreeType("sarMs");
|
||||
// 根据当前目录查询所在父节点
|
||||
String secondLevelId = "";
|
||||
List<String> getMenuPIds = iTsResourceService.getParentMenuId(nowMenuId);
|
||||
if (getMenuPIds != null && getMenuPIds.size() > 1) {
|
||||
List<String> getMenuPIds = new ArrayList<>();
|
||||
if(StringUtils.isNotBlank(treeType) && "sarMs".equals(treeType)){
|
||||
getMenuPIds = iSarMenuStandardService.getChildMenuList(nowMenuId);
|
||||
}else {
|
||||
getMenuPIds = iTsResourceService.getParentMenuId(nowMenuId);
|
||||
}
|
||||
if (!getMenuPIds.isEmpty()) {
|
||||
int idSize = getMenuPIds.size();
|
||||
secondLevelId = getMenuPIds.get(idSize-1);
|
||||
} else {
|
||||
@@ -868,7 +908,13 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
SarBussStandMenu standMenuEOQuery = new SarBussStandMenu();
|
||||
standMenuEOQuery.setMenuId(secondLevelId);
|
||||
standMenuEOQuery.setBussStandId(standardsInfoEO.getIdlist()[i]);
|
||||
List<String> menuIds = iTsResourceService.getChildMenuList(secondLevelId);
|
||||
|
||||
List<String> menuIds = new ArrayList<>();
|
||||
if(StringUtils.isNotBlank(treeType) && "sarMs".equals(treeType)) {
|
||||
menuIds = iSarMenuStandardService.getChildMenuList(secondLevelId);
|
||||
}else {
|
||||
menuIds = iTsResourceService.getChildMenuList(secondLevelId);
|
||||
}
|
||||
standMenuEOQuery.setMenuIds(menuIds);
|
||||
List<SarBussStandMenu> getInfo = sarBussStandMenuEODao.selectMenuByMenuParentId(standMenuEOQuery);
|
||||
//删除节点与根节点的关联
|
||||
@@ -876,14 +922,30 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
sarStandMenuDel.setBussStandId(standardsInfoEO.getIdlist()[i]);
|
||||
sarStandMenuDel.setMenuId(standardsInfoEO.getRootMenuId());
|
||||
sarBussStandMenuEODao.deleteByStandIdAndMenuId(sarStandMenuDel);
|
||||
int op = 0;
|
||||
if (getInfo == null || getInfo.isEmpty()) {
|
||||
sarStandMenuEO.setId(UUIDUtils.randomUUID20());
|
||||
sarBussStandMenuEODao.insert(sarStandMenuEO);
|
||||
op = sarBussStandMenuEODao.insert(sarStandMenuEO);
|
||||
} else {
|
||||
sarStandMenuEO.setOldMenuId(secondLevelId);
|
||||
List<String> menuOldIds = iTsResourceService.getChildMenuList(secondLevelId);
|
||||
List<String> menuOldIds = new ArrayList<>();
|
||||
if(StringUtils.isNotBlank(treeType) && "sarMs".equals(treeType)) {
|
||||
menuOldIds = iSarMenuStandardService.getChildMenuList(secondLevelId);
|
||||
}else {
|
||||
menuOldIds= iTsResourceService.getChildMenuList(secondLevelId);
|
||||
}
|
||||
sarStandMenuEO.setMenuIds(menuOldIds);
|
||||
sarBussStandMenuEODao.updateByStandIdAndMenuId(sarStandMenuEO);
|
||||
op = sarBussStandMenuEODao.updateByStandIdAndMenuId(sarStandMenuEO);
|
||||
}
|
||||
QueryWrapper qw = new QueryWrapper();
|
||||
qw.eq("STAND_ID",standId);
|
||||
List<SarBussStandAttrInfo> infoList = sarBussStandAttrInfoEODao.selectList(qw);
|
||||
if(!infoList.isEmpty()){
|
||||
SarBussStandAttrInfo attrInfo = new SarBussStandAttrInfo();
|
||||
attrInfo.setId(infoList.get(0).getId());
|
||||
attrInfo.setTxlbbuss(menuName);
|
||||
attrInfo.setValidFlag("0");
|
||||
sarBussStandAttrInfoEODao.updateById(attrInfo);
|
||||
}
|
||||
// sarBussStandMenuEODao.updateByStandIDSelective(sarStandMenuEO);
|
||||
}
|
||||
@@ -894,11 +956,12 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
public List<SarBussionessStand> getSarBussionStandPage(SarBussionessStandEOPage page) throws Exception {
|
||||
//查询当前登录人角色拥有权限的菜单
|
||||
if(page.getMenuId() != null && page.getUserId() != null && StringUtils.isNotBlank(page.getUserId())){
|
||||
String treeType = page.getTreeType();
|
||||
QueryWrapper<TsResource> qw = new QueryWrapper<>();
|
||||
qw.eq("ID",page.getMenuId());
|
||||
qw.isNull("PARENT_ID");
|
||||
List<TsResource> children = iTsResourceService.list(qw);
|
||||
if(children.isEmpty() && !page.getMenuId().equals("nomenu")){
|
||||
if(children.isEmpty() && !page.getMenuId().equals("nomenu") && StringUtils.isNotBlank(treeType) && "tsr".equals(treeType)){
|
||||
List<String> getMenuIdList = tsUserService.getResourceUserId(page.getUserId());
|
||||
if (getMenuIdList != null && !getMenuIdList.isEmpty()) {
|
||||
page.setMenuRoleList(getMenuIdList);
|
||||
@@ -909,6 +972,29 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
if (ids != null && !ids.isEmpty()) {
|
||||
page.setMenuAllChildrenIdList(ids);
|
||||
}
|
||||
}else if(!page.getMenuId().equals("nomenu") && StringUtils.isNotBlank(treeType) && "sarMs".equals(treeType)){
|
||||
List<String> getMenuIdList = tsUserService.getResourceUserId(page.getUserId());
|
||||
if (getMenuIdList != null && !getMenuIdList.isEmpty()) {
|
||||
page.setMenuRoleList(getMenuIdList);
|
||||
} else {
|
||||
page.setMenuRoleList(null);
|
||||
}
|
||||
List<String> ids = iSarMenuStandardService.getChildMenuList(page.getMenuId());
|
||||
if (ids != null && !ids.isEmpty()) {
|
||||
page.setMenuAllChildrenIdList(ids);
|
||||
}
|
||||
}else if(page.getMenuId().equals("nomenu") && StringUtils.isNotBlank(page.getSarMsType()) && "filterSarMsMenu".equals(page.getSarMsType())){
|
||||
// List<String> getMenuIdList = tsUserService.getResourceUserId(page.getUserId());
|
||||
// if (getMenuIdList != null && !getMenuIdList.isEmpty()) {
|
||||
// page.setMenuRoleList(getMenuIdList);
|
||||
// } else {
|
||||
// page.setMenuRoleList(null);
|
||||
// }
|
||||
// menuTopId 1级目录下 所有目录 选择的标准不可重复 根据现逻辑 统一根据2级菜单查所有 没有选过的
|
||||
List<String> ids = iSarMenuStandardService.getChildMenuList(page.getMenuTopId());
|
||||
if (ids != null && !ids.isEmpty()) {
|
||||
page.setMenuAllChildrenIdList(ids);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user