bug修复
This commit is contained in:
parent
d2a26b02ec
commit
5d1cf14e76
@ -187,6 +187,7 @@ public class BaseModuleController {
|
||||
@ApiOperation(value = "查询项目配置的模块和菜单列表", notes = "查询项目配置的模块和菜单列表", httpMethod = "POST")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "body", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "userId", value = "用户id", paramType = "body", required = true, dataType = "String"),
|
||||
})
|
||||
@PostMapping(value = "/getModuleAndMenuList")
|
||||
public Result<Map<String, Object>> getModuleAndMenuList(@ApiIgnore @RequestBody HashMap<String, Object> paramMap) {
|
||||
|
||||
@ -51,15 +51,16 @@ public class OperationLogController {
|
||||
*/
|
||||
@ApiOperation(value = "分页列表查询操作日志表信息", notes = "分页列表查询操作日志表信息", httpMethod = "POST")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "userName", value = "操作人", paramType = "body", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "operName", value = "操作名称", paramType = "body", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "startTime", value = "开始时间,格式2021-08-15", paramType = "body", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "endTime", value = "结束时间,格式2021-08-15", paramType = "body", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "sn", value = "项目SN或企业sn", paramType = "body", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "operModul", value = "功能模块", paramType = "body", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "pageNo", value = "第几页", paramType = "body", required = true, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "pageSize", value = "每页显示条数", paramType = "body", required = true, dataType = "Integer"),
|
||||
})
|
||||
@ApiImplicitParam(name = "userName", value = "操作人", paramType = "body", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "operName", value = "操作名称", paramType = "body", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "startTime", value = "开始时间,格式2021-08-15", paramType = "body", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "endTime", value = "结束时间,格式2021-08-15", paramType = "body", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "sn", value = "项目SN或企业sn", paramType = "body", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "operModul", value = "功能模块", paramType = "body", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "pageNo", value = "第几页", paramType = "body", required = true, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "pageSize", value = "每页显示条数", paramType = "body", required = true, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "operUserId", value = "项目子账号传用户id", paramType = "body", required = true, dataType = "Integer"),
|
||||
})
|
||||
@PostMapping(value = "/list")
|
||||
public Result<IPage<OperationLog>> queryPageList(@RequestBody Map<String, Object> map) {
|
||||
return Result.success(operationLogService.selectOperationLogPage(map));
|
||||
|
||||
@ -14,19 +14,19 @@
|
||||
Left JOIN company cf ON cp.parent_id=cf.company_id
|
||||
<where>
|
||||
<if test="param.companyType == '1'.toString()">
|
||||
(cp.headquarters_sn=#{param.sn} OR pb.headquarters_sn=#{param.sn})
|
||||
and (cp.headquarters_sn=#{param.sn} OR pb.headquarters_sn=#{param.sn})
|
||||
</if>
|
||||
<if test="param.companyType == '2'.toString()">
|
||||
(b.sn=#{param.sn} OR f.company_sn=#{param.sn} or cf.company_sn=#{param.sn})
|
||||
and (b.sn=#{param.sn} OR f.company_sn=#{param.sn} or cf.company_sn=#{param.sn})
|
||||
</if>
|
||||
<if test="param.companyType == '3'.toString()">
|
||||
(b.sn=#{param.sn} OR pb.company_sn=#{param.sn})
|
||||
and (b.sn=#{param.sn} OR pb.company_sn=#{param.sn})
|
||||
</if>
|
||||
<if test="param.companyType == '4'.toString()">
|
||||
(b.sn=#{param.sn})
|
||||
and (b.sn=#{param.sn})
|
||||
</if>
|
||||
<if test="param.companyType == '5'.toString()">
|
||||
(b.sn=#{param.sn} OR py.company_sn=#{param.sn})
|
||||
and (b.sn=#{param.sn} OR py.company_sn=#{param.sn})
|
||||
</if>
|
||||
<if test="param.userName != null and param.userName != ''">
|
||||
and b.real_name like CONCAT(CONCAT('%',#{param.userName}),'%')
|
||||
@ -43,6 +43,9 @@
|
||||
<if test="param.endTime != null and param.endTime != ''">
|
||||
AND a.oper_create_time <=CONCAT(DATE_FORMAT(#{param.endTime},'%Y-%m-%d'),' 23:59:59')
|
||||
</if>
|
||||
<if test="param.operUserId != null and param.operUserId != ''">
|
||||
and b.user_id like CONCAT(CONCAT('%',#{param.operUserId}),'%')
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY oper_create_time DESC
|
||||
</select>
|
||||
|
||||
@ -8,10 +8,12 @@ import com.zhgd.jeecg.common.execption.OpenAlertException;
|
||||
import com.zhgd.xmgl.modules.basicdata.entity.BaseMenu;
|
||||
import com.zhgd.xmgl.modules.basicdata.entity.BaseModule;
|
||||
import com.zhgd.xmgl.modules.basicdata.entity.CompanyConfig;
|
||||
import com.zhgd.xmgl.modules.basicdata.entity.SystemUser;
|
||||
import com.zhgd.xmgl.modules.basicdata.entity.dto.ModuleListPageDto;
|
||||
import com.zhgd.xmgl.modules.basicdata.mapper.BaseMenuMapper;
|
||||
import com.zhgd.xmgl.modules.basicdata.mapper.BaseModuleMapper;
|
||||
import com.zhgd.xmgl.modules.basicdata.mapper.CompanyConfigMapper;
|
||||
import com.zhgd.xmgl.modules.basicdata.mapper.SystemUserMapper;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.IBaseAuthorityService;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.IBaseModuleService;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
@ -22,6 +24,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@ -38,6 +41,8 @@ public class BaseModuleServiceImpl extends ServiceImpl<BaseModuleMapper, BaseMod
|
||||
@Autowired
|
||||
private BaseMenuMapper baseMenuMapper;
|
||||
@Autowired
|
||||
private SystemUserMapper systemUserMapper;
|
||||
@Autowired
|
||||
private SystemUserServiceImpl systemUserService;
|
||||
@Autowired
|
||||
private CompanyConfigMapper companyConfigMapper;
|
||||
@ -115,11 +120,20 @@ public class BaseModuleServiceImpl extends ServiceImpl<BaseModuleMapper, BaseMod
|
||||
public Map<String, Object> getModuleAndMenuList(HashMap<String, Object> paramMap) {
|
||||
String projectSn = MapUtils.getString(paramMap, "projectSn");
|
||||
Integer moduleType = MapUtils.getInteger(paramMap, "moduleType");
|
||||
String userId = MapUtils.getString(paramMap, "userId");
|
||||
SystemUser systemUser = systemUserMapper.selectById(userId);
|
||||
if (systemUser == null) {
|
||||
throw new OpenAlertException("账号不存在");
|
||||
}
|
||||
CompanyConfig companyConfig = companyConfigMapper.getCompanyConfigByProject(projectSn);
|
||||
if (companyConfig == null) {
|
||||
throw new OpenAlertException("企业配置不存在");
|
||||
}
|
||||
Map<String, Object> menuAuthority = systemUserService.getUserAuthority(null, 5, projectSn, companyConfig.getHeadquartersSn(), companyConfig.getStyleType(), moduleType);
|
||||
return menuAuthority;
|
||||
if (Objects.equals(systemUser.getAccountType(), 10)) {
|
||||
return systemUserService.getUserAuthority(null, 5, projectSn, companyConfig.getHeadquartersSn(), companyConfig.getStyleType(), moduleType);
|
||||
} else if (Objects.equals(systemUser.getAccountType(), 5) || Objects.equals(systemUser.getAccountType(), 6)) {
|
||||
return systemUserService.getUserAuthority(Long.valueOf(userId), systemUser.getAccountType(), projectSn, companyConfig.getHeadquartersSn(), companyConfig.getStyleType(), moduleType);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@ -73,7 +73,7 @@ public class XzProjectOrgServiceImpl extends ServiceImpl<XzProjectOrgMapper, XzP
|
||||
XzProjectOrg pOrg = xzProjectOrgMapper.selectOne(new LambdaQueryWrapper<XzProjectOrg>()
|
||||
.eq(XzProjectOrg::getId, xzProjectOrg.getParentId()));
|
||||
if (Objects.equals(pOrg.getStatus(), 1)) {
|
||||
throw new OpenAlertException("部门状态为停用,无法添加下级");
|
||||
throw new OpenAlertException("父级部门状态为停用,无法添加下级");
|
||||
}
|
||||
if (pOrg != null) {
|
||||
xzProjectOrg.setAncestors(pOrg.getAncestors() + "," + pOrg.getId());
|
||||
@ -165,6 +165,12 @@ public class XzProjectOrgServiceImpl extends ServiceImpl<XzProjectOrgMapper, XzP
|
||||
.filter(m -> m.getParentId() == 0)
|
||||
.peek(m -> m.setChildren(getChildren(m, allList)))//peek:执行类似map,但操作之后的数据并不返回到Stream中
|
||||
.collect(Collectors.toList());
|
||||
treeList.sort((o1, o2) -> {
|
||||
if (o1.getOrderNum() == null || o2.getOrderNum() == null) {
|
||||
return 0;
|
||||
}
|
||||
return o1.getOrderNum().compareTo(o2.getOrderNum());
|
||||
});
|
||||
}
|
||||
return treeList;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user