Commit 7a5c835b authored by hongguangwu's avatar hongguangwu

档案相关权限-优化

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