Merge remote-tracking branch 'origin/dev_20230216' into dev_20230216

This commit is contained in:
SUNJIABIN
2023-04-25 17:52:23 +08:00
4 changed files with 238 additions and 10 deletions
@@ -11,6 +11,7 @@ import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
import java.util.List;
/**
* <p>
@@ -77,5 +78,13 @@ public class SarBussionessStandStatePage extends BasePage {
@ApiModelProperty(value = "标准类别")
private String menuId;
private List<String> menuAllChildrenIdList;
private String userId;
private String treeType;
private List<String> menuRoleList;
}
@@ -5,7 +5,14 @@ import com.adc.da.slrs.sarBussionessStandState.entity.SarBussionessStandState;
import com.adc.da.slrs.sarBussionessStandState.dao.SarBussionessStandStateDao;
import com.adc.da.slrs.sarBussionessStandState.entity.SarBussionessStandStatePage;
import com.adc.da.slrs.sarBussionessStandState.service.ISarBussionessStandStateService;
import com.adc.da.slrs.sarResource.entity.TsResource;
import com.adc.da.slrs.sarResource.service.ITsResourceService;
import com.adc.da.slrs.sarUser.service.ITsUserService;
import com.adc.da.sys.sarMenuStandard.service.ISarMenuStandardService;
import com.adc.da.util.utils.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@@ -21,6 +28,15 @@ import java.util.List;
@Service
public class SarBussionessStandStateServiceImpl extends ServiceImpl<SarBussionessStandStateDao, SarBussionessStandState> implements ISarBussionessStandStateService {
@Autowired
private ISarMenuStandardService iSarMenuStandardService;
@Autowired
private ITsResourceService iTsResourceService;
@Autowired
private ITsUserService tsUserService;
@Override
public List<ModelData> getSarBussionessStandStateProcessList(SarBussionessStandStatePage page){
List<ModelData> stateList = this.baseMapper.getSarBussionessStandStateProcessList(page);
@@ -29,6 +45,54 @@ public class SarBussionessStandStateServiceImpl extends ServiceImpl<SarBussiones
@Override
public List<SarBussionessStandState> getSarBussionessStandStatePageNo(SarBussionessStandStatePage page) throws Exception{
if(page.getMenuId()!=null && StringUtils.isNotBlank(page.getMenuId())){
}
//查询当前登录人角色拥有权限的菜单
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") && StringUtils.isNotBlank(treeType) && "tsr".equals(treeType)){
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);
}
}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);
// }
// }
}
Integer rowCount = this.baseMapper.getBussionessStandStateCountNo(page);
page.getPager().setRowCount(rowCount);
List<SarBussionessStandState> stateList = this.baseMapper.getSarBussionessStandStatePageNo(page);
@@ -37,6 +101,51 @@ public class SarBussionessStandStateServiceImpl extends ServiceImpl<SarBussiones
@Override
public List<SarBussionessStandState> getSarBussionessStandStatePage(SarBussionessStandStatePage 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") && StringUtils.isNotBlank(treeType) && "tsr".equals(treeType)){
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);
}
}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);
// }
// }
}
Integer rowCount = this.baseMapper.getBussionessStandStateCount(page);
page.getPager().setRowCount(rowCount);
List<SarBussionessStandState> stateList = this.baseMapper.getBussionessStandStatePage(page);