Commit 7a5c835b authored by hongguangwu's avatar hongguangwu

档案相关权限-优化

parent 4fd22658
......@@ -66,17 +66,22 @@ public class TCertRecordController {
@GetMapping("/page" )
//@PreAuthorize("@pms.hasPermission('demo_tcertrecord_get')" )
public R<IPage<TCertRecord>> getTCertRecordPage(Page page, CertRecordSearchVo searchVo) {
setAuth(searchVo);
return R.ok(tCertRecordService.pageDiy(page, searchVo));
}
private void setAuth(CertRecordSearchVo searchVo) {
YifuUser user = SecurityUtils.getUser();
if (user == null || Common.isEmpty(user.getId())) {
return R.failed(CommonConstants.PLEASE_LOG_IN);
}
menuUtil.setAuthSql(user, searchVo);
if (Common.isNotNull(searchVo.getAuthSql()) && searchVo.getAuthSql().contains(CommonConstants.A_DEPT_ID)) {
searchVo.setAuthSql(searchVo.getAuthSql().replace(CommonConstants.A_DEPT_ID, "dept_id"));
}
return R.ok(tCertRecordService.pageDiy(page, searchVo));
}
/**
if (searchVo.getAuthSql().contains(CommonConstants.A_CREATE_BY)) {
searchVo.setAuthSql(searchVo.getAuthSql().replace(CommonConstants.A_CREATE_BY, "CREATE_BY"));
}
}
/**
* 不分页查询
* @param searchVo 证明开具记录表
* @return
......@@ -85,14 +90,7 @@ public class TCertRecordController {
@GetMapping("/noPage" )
//@PreAuthorize("@pms.hasPermission('demo_tcertrecord_get')" )
public R<List<TCertRecord>> getTCertRecordNoPage(CertRecordSearchVo searchVo) {
YifuUser user = SecurityUtils.getUser();
if (user == null || Common.isEmpty(user.getId())) {
return R.failed(CommonConstants.PLEASE_LOG_IN);
}
menuUtil.setAuthSql(user, searchVo);
if (Common.isNotNull(searchVo.getAuthSql()) && searchVo.getAuthSql().contains(CommonConstants.A_DEPT_ID)) {
searchVo.setAuthSql(searchVo.getAuthSql().replace(CommonConstants.A_DEPT_ID, "dept_id"));
}
setAuth(searchVo);
return R.ok(tCertRecordService.getTCertRecordNoPage(searchVo));
}
......
......@@ -65,11 +65,7 @@ public class TEmpContractAlertController {
@GetMapping("/page" )
//@PreAuthorize("@pms.hasPermission('demo_tempcontractalert_get')" )
public R<IPage<TEmpContractAlert>> getTEmpContractAlertPage(Page page, ContractAlertSearchVo searchVo) {
YifuUser user = SecurityUtils.getUser();
menuUtil.setAuthSql(user, searchVo);
if (Common.isNotNull(searchVo.getAuthSql()) && searchVo.getAuthSql().contains(CommonConstants.A_DEPT_ID)) {
searchVo.setAuthSql(searchVo.getAuthSql().replace(CommonConstants.A_DEPT_ID, "dept_id"));
}
setAuth(searchVo);
return R.ok(tEmpContractAlertService.pageDiy(page, searchVo));
}
/**
......@@ -81,6 +77,7 @@ public class TEmpContractAlertController {
@PostMapping("/noPage" )
//@PreAuthorize("@pms.hasPermission('demo_tempcontractalert_get')" )
public R<List<TEmpContractAlert>> getTEmpContractAlertNoPage(@RequestBody ContractAlertSearchVo searchVo) {
setAuth(searchVo);
return R.ok(tEmpContractAlertService.listDiy(searchVo));
}
......@@ -145,13 +142,23 @@ public class TEmpContractAlertController {
@Operation(description = "导出")
@PostMapping("/export")
public void export(HttpServletResponse response, @RequestBody ContractAlertSearchVo searchVo) {
setAuth(searchVo);
tEmpContractAlertService.listExport(response,searchVo);
}
private void setAuth(ContractAlertSearchVo searchVo) {
YifuUser user = SecurityUtils.getUser();
menuUtil.setAuthSql(user, searchVo);
if (Common.isNotNull(searchVo.getAuthSql()) && searchVo.getAuthSql().contains(CommonConstants.A_DEPT_ID)) {
searchVo.setAuthSql(searchVo.getAuthSql().replace(CommonConstants.A_DEPT_ID, "dept_id"));
if (Common.isNotNull(searchVo.getAuthSql())) {
if (searchVo.getAuthSql().contains(CommonConstants.A_DEPT_ID)) {
searchVo.setAuthSql(searchVo.getAuthSql().replace(CommonConstants.A_DEPT_ID, "dept_id"));
}
if (searchVo.getAuthSql().contains(CommonConstants.A_CREATE_BY)) {
searchVo.setAuthSql(searchVo.getAuthSql().replace(CommonConstants.A_CREATE_BY, "CREATE_BY"));
}
}
tEmpContractAlertService.listExport(response,searchVo);
}
/**
* 定时任务生成合同续签代码信息
* @return R<List>
......
......@@ -394,9 +394,6 @@
SELECT
<include refid="Base_Column_List"/>
FROM t_employee_contract_info a
<if test="tEmployeeContractInfo.authSql != null and tEmployeeContractInfo.authSql.trim() != ''">
left join t_employee_contract_area_res p on a.CREATE_BY=p.USER_ID
</if>
<where>
a.DELETE_FLAG = 0
<include refid="tEmployeeContractInfo_where"/>
......@@ -425,9 +422,6 @@
SELECT
<include refid="Base_Export_Column_List"/>
FROM t_employee_contract_info a
<if test="tEmployeeContractInfo.authSql != null and tEmployeeContractInfo.authSql.trim() != ''">
left join t_employee_contract_area_res p on a.CREATE_BY=p.USER_ID
</if>
<where>
a.DELETE_FLAG = 0
<include refid="tEmployeeContractInfo_where"/>
......
......@@ -494,4 +494,5 @@ public interface CommonConstants {
public static final String ERROR_IMPORT = "执行异常";
// 权限使用的
public static final String A_DEPT_ID = "a.dept_id";
public static final String A_CREATE_BY = "a.CREATE_BY";
}
......@@ -155,6 +155,9 @@ public class TSalaryEmployeeController {
if (user != null && Common.isNotNull(user.getId())) {
menuUtil.setAuthSql(user, searchVo);
}
if (searchVo.getAuthSql().contains(CommonConstants.A_CREATE_BY)) {
searchVo.setAuthSql(searchVo.getAuthSql().replace(CommonConstants.A_CREATE_BY, "CREATE_BY"));
}
tSalaryEmployeeService.listExport(response, searchVo);
}
}
......@@ -284,6 +284,9 @@
a.DELETE_FLAG = 0
<!-- 薪资是否可查看 0 是 1否-->
<include refid="tSalaryStandard_where"/>
<if test="tSalaryStandard.authSql != null and tSalaryStandard.authSql.trim() != ''">
${tSalaryStandard.authSql}
</if>
</where>
ORDER BY a.CREATE_TIME desc
</select>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment