人员权限划分接口开发

This commit is contained in:
bonus 2025-07-17 13:06:45 +08:00
parent 812387edcc
commit 3ed544f28a
4 changed files with 28 additions and 4 deletions

View File

@ -7,9 +7,12 @@ import com.bonus.common.core.utils.ServletUtils;
import com.bonus.common.core.utils.poi.ExcelUtil;
import com.bonus.common.core.web.controller.BaseController;
import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.common.security.utils.SecurityUtils;
import com.bonus.material.basic.domain.*;
import com.bonus.material.basic.domain.vo.MaTypeSelectInfo;
import com.bonus.material.basic.service.ComplexQueryService;
import com.bonus.system.api.domain.SysUser;
import com.bonus.system.api.model.LoginUser;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
@ -39,6 +42,8 @@ public class ComplexQueryController extends BaseController {
@GetMapping("/getRetainedEquipmentList")
public AjaxResult getRetainedEquipmentList(RetainedEquipmentInfo bean) {
bean.setIsExport(1);
LoginUser loginUser = SecurityUtils.getLoginUser();
bean.setUserId(loginUser.getUserid());
if (bean.getIsApp() != null && bean.getIsApp() == 1) {
List<RetainedEquipmentInfo> pageList = complexQueryService.getRetainedEquipmentList(bean);
return AjaxResult.success(pageList);
@ -284,6 +289,8 @@ public class ComplexQueryController extends BaseController {
@ApiOperation(value = "综合查询--工程机具使用列表")
@GetMapping("/getProjUsingRecordList")
public AjaxResult getProjUsingRecordList(ProjUsingRecord bean) {
LoginUser loginUser = SecurityUtils.getLoginUser();
bean.setUserId(loginUser.getUserid());
startPage();
List<ProjUsingRecord> pageList = complexQueryService.getProjUsingRecordList(bean);
return AjaxResult.success(getDataTable(pageList));

View File

@ -113,4 +113,6 @@ public class ProjUsingRecord {
private String externalIds;
@ApiModelProperty(value = "关联外部(第三方)的工程ID")
private String externalId;
}
private Long userId;
}

View File

@ -157,4 +157,6 @@ public class RetainedEquipmentInfo {
@ApiModelProperty(value = "三级类型id")
private Integer thirdTypeId;
}
@ApiModelProperty(value = "用户id")
private Long userId;
}

View File

@ -37,6 +37,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN bm_unit bu ON bu.unit_id = bai.unit_id
LEFT JOIN ma_type mt ON mt.type_id = sai.type_id
LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id
LEFT JOIN ma_type mt3 ON mt2.parent_id = mt3.type_id
LEFT JOIN ma_type mt4 ON mt3.parent_id = mt4.type_id
LEFT JOIN ma_type_manage mtm ON mt3.parent_id = mtm.type_id
WHERE
1=1
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
@ -52,6 +55,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
sd.dept_name like concat('%', #{keyWord}, '%')
)
</if>
<if test="userId != null">
and mtm.user_id = #{userId}
</if>
<if test="unitId != null">
and bu.unit_id = #{unitId}
</if>
@ -354,7 +361,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN ma_type mt3 ON mt3.type_id = mt2.parent_id
LEFT JOIN ma_type mt4 ON mt4.type_id = mt3.parent_id
WHERE
sai.`status` = '0'
sai.`status` = '0' and sai.`is_slt` = '0'
AND sai.end_time IS NULL
AND sai.back_id IS NULL
GROUP BY mt.type_id
@ -456,8 +463,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN ma_type mt2 on mt2.type_id = mt.parent_id
LEFT JOIN ma_type mt3 ON mt3.type_id = mt2.parent_id
LEFT JOIN ma_type mt4 ON mt4.type_id = mt3.parent_id
LEFT JOIN ma_type_manage mtm ON mt4.type_id = mtm.type_id
WHERE mt.`level` = 4
and mt.del_flag = '0'
<if test="userId != null ">
and mtm.user_id = #{userId}
</if>
<if test="typeId != null">
<if test="level == 3">
and mt.parent_id = #{typeId}
@ -474,6 +486,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
mt.type_name like concat('%',#{keyWord},'%')
)
</if>
<if test="typeName != null and typeName != ''">
and mt2.type_name like concat('%',#{typeName},'%')
</if>
@ -493,7 +506,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
bs.create_time as inputTime,
CASE
WHEN tt.`code` LIKE 'XG%' THEN '新购入库'
WHEN tt.`code` LIKE 'R%' THEN '修入库'
WHEN tt.`code` LIKE 'R%' THEN '修入库'
WHEN tt.`code` LIKE 'PD%' THEN '盘点入库'
ELSE '未知入库类型'
END AS inputType,