diff --git a/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/BaseModuleController.java b/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/BaseModuleController.java index f8f552332..044e78f9f 100644 --- a/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/BaseModuleController.java +++ b/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/BaseModuleController.java @@ -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> getModuleAndMenuList(@ApiIgnore @RequestBody HashMap paramMap) { diff --git a/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/OperationLogController.java b/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/OperationLogController.java index 028180e05..b3ad11e05 100644 --- a/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/OperationLogController.java +++ b/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/OperationLogController.java @@ -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> queryPageList(@RequestBody Map map) { return Result.success(operationLogService.selectOperationLogPage(map)); diff --git a/src/main/java/com/zhgd/xmgl/modules/basicdata/mapper/xml/OperationLogMapper.xml b/src/main/java/com/zhgd/xmgl/modules/basicdata/mapper/xml/OperationLogMapper.xml index f3567a3c0..d1227f7d9 100644 --- a/src/main/java/com/zhgd/xmgl/modules/basicdata/mapper/xml/OperationLogMapper.xml +++ b/src/main/java/com/zhgd/xmgl/modules/basicdata/mapper/xml/OperationLogMapper.xml @@ -14,19 +14,19 @@ Left JOIN company cf ON cp.parent_id=cf.company_id - (cp.headquarters_sn=#{param.sn} OR pb.headquarters_sn=#{param.sn}) + and (cp.headquarters_sn=#{param.sn} OR pb.headquarters_sn=#{param.sn}) - (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}) - (b.sn=#{param.sn} OR pb.company_sn=#{param.sn}) + and (b.sn=#{param.sn} OR pb.company_sn=#{param.sn}) - (b.sn=#{param.sn}) + and (b.sn=#{param.sn}) - (b.sn=#{param.sn} OR py.company_sn=#{param.sn}) + and (b.sn=#{param.sn} OR py.company_sn=#{param.sn}) and b.real_name like CONCAT(CONCAT('%',#{param.userName}),'%') @@ -43,6 +43,9 @@ AND a.oper_create_time <=CONCAT(DATE_FORMAT(#{param.endTime},'%Y-%m-%d'),' 23:59:59') + + and b.user_id like CONCAT(CONCAT('%',#{param.operUserId}),'%') + ORDER BY oper_create_time DESC diff --git a/src/main/java/com/zhgd/xmgl/modules/basicdata/service/impl/BaseModuleServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/basicdata/service/impl/BaseModuleServiceImpl.java index 9209b1d6f..693a40846 100644 --- a/src/main/java/com/zhgd/xmgl/modules/basicdata/service/impl/BaseModuleServiceImpl.java +++ b/src/main/java/com/zhgd/xmgl/modules/basicdata/service/impl/BaseModuleServiceImpl.java @@ -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 getModuleAndMenuList(HashMap 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 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; } } diff --git a/src/main/java/com/zhgd/xmgl/modules/xz/service/impl/XzProjectOrgServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/xz/service/impl/XzProjectOrgServiceImpl.java index d971ab532..86ec7b605 100644 --- a/src/main/java/com/zhgd/xmgl/modules/xz/service/impl/XzProjectOrgServiceImpl.java +++ b/src/main/java/com/zhgd/xmgl/modules/xz/service/impl/XzProjectOrgServiceImpl.java @@ -73,7 +73,7 @@ public class XzProjectOrgServiceImpl extends ServiceImpl() .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 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; }