Commit 61f8e4e4 authored by hongguangwu's avatar hongguangwu

MVP1.7.17-离职待办

parent 3879e29b
......@@ -693,4 +693,7 @@ public interface CommonConstants {
String GU_DING = "gu_ding";
// 税友、关键字里的户:
String HU_CORE = "_户户_";
// 前端客服角色ID(全服管理者)
long CS_ROLE_ID = 1839501715787390978L;
}
......@@ -60,6 +60,8 @@ public class EmployeeRegistrationLeaveSearchVo extends EmployeeRegistrationLeave
@TableField(exist = false)
private List<String> idcardList;
private List<String> idList;
/**
* @Author fxj
* 查询数据起
......@@ -73,6 +75,13 @@ public class EmployeeRegistrationLeaveSearchVo extends EmployeeRegistrationLeave
@Schema(description = "查询limit 数据条数")
private int limitEnd;
@Schema(description = "列表查询类型 1 待办 2监控 3入职确认信息")
private String type;
@Schema(description = "项目权限数组")
@TableField(exist = false)
private List<String> deptNoList;
@ExcelProperty("项目名称")
private String deptName;
......
......@@ -24,11 +24,13 @@ import com.yifu.cloud.plus.v1.csp.service.EmployeeRegistrationLeaveService;
import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationLeaveSearchVo;
import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationLeaveTableVo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.MenuUtil;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
......@@ -49,45 +51,55 @@ public class EmployeeRegistrationLeaveController {
private final EmployeeRegistrationLeaveService employeeRegistrationLeaveService;
private final MenuUtil menuUtil;
/**
* 简单分页查询
*
* @param page 分页对象
* @param employeeRegistrationLeave 自动化离职待办
* @return
*/
@Operation(description = "离职待办分页查询")
@GetMapping("/getEmployeeRegistrationLeaveTablePage")
public R<IPage<EmployeeRegistrationLeaveTableVo>> getEmployeeRegistrationLeaveTablePage(Page<EmployeeRegistrationLeaveTableVo> page
, EmployeeRegistrationLeaveSearchVo employeeRegistrationLeave) {
return new R<>(employeeRegistrationLeaveService.getEmployeeRegistrationLeaveTablePage(page, employeeRegistrationLeave));
, EmployeeRegistrationLeaveSearchVo searchVo) {
this.setLeaveBaseAuth(searchVo);
return new R<>(employeeRegistrationLeaveService.getEmployeeRegistrationLeaveTablePage(page, searchVo));
}
@Operation(description = "离职待办数量查询")
@PostMapping("/getRegistrationLeaveCount")
public R<Long> getRegistrationLeaveCount(@RequestBody EmployeeRegistrationLeaveSearchVo searchVo) {
this.setLeaveBaseAuth(searchVo);
return R.ok(employeeRegistrationLeaveService.getRegistrationLeaveCount(searchVo));
}
/**
* 简单分页查询
*
* @param employeeRegistrationLeave 自动化离职待办
* @param searchVo 自动化离职待办
* @return
*/
@Operation(description = "离职待办分页查询2000条")
@GetMapping("/getEmployeeRegistrationLeaveTablePage2000")
public R<List<EmployeeRegistrationLeaveTableVo>> getEmployeeRegistrationLeaveTablePage2000(EmployeeRegistrationLeaveSearchVo employeeRegistrationLeave) {
return new R<>(employeeRegistrationLeaveService.getEmployeeRegistrationLeaveTablePage2000(employeeRegistrationLeave));
public R<List<EmployeeRegistrationLeaveTableVo>> getEmployeeRegistrationLeaveTablePage2000(EmployeeRegistrationLeaveSearchVo searchVo) {
this.setLeaveBaseAuth(searchVo);
return new R<>(employeeRegistrationLeaveService.getEmployeeRegistrationLeaveTablePage2000(searchVo));
}
/**
* 简单分页查询
*
* @param page 分页对象
* @param employeeRegistrationLeave 自动化离职待办
* @param searchVo 自动化离职待办
* @return
*/
@Operation(description = "离职确认分页查询")
@GetMapping("/getEmployeeRegistrationLeaveConfirmTablePage")
public R<IPage<EmployeeRegistrationLeaveTableVo>> getEmployeeRegistrationLeaveConfirmTablePage(Page<EmployeeRegistrationLeaveTableVo> page
, EmployeeRegistrationLeaveSearchVo employeeRegistrationLeave) {
return new R<>(employeeRegistrationLeaveService.getEmployeeRegistrationLeaveConfirmTablePage(page, employeeRegistrationLeave));
, EmployeeRegistrationLeaveSearchVo searchVo) {
this.setLeaveBaseAuth(searchVo);
return new R<>(employeeRegistrationLeaveService.getEmployeeRegistrationLeaveConfirmTablePage(page, searchVo));
}
/**
......@@ -112,6 +124,7 @@ public class EmployeeRegistrationLeaveController {
@Operation(description = "导出自动化离职待办")
@PostMapping("/exportTable")
public void exportTable(HttpServletResponse response, @RequestBody EmployeeRegistrationLeaveSearchVo searchVo) {
this.setLeaveBaseAuth(searchVo);
employeeRegistrationLeaveService.exportTable(response, searchVo);
}
......@@ -125,6 +138,16 @@ public class EmployeeRegistrationLeaveController {
@Operation(description = "导出自动化离职确认")
@PostMapping("/exportConfirmTable")
public void exportConfirmTable(HttpServletResponse response, @RequestBody EmployeeRegistrationLeaveSearchVo searchVo) {
this.setLeaveBaseAuth(searchVo);
employeeRegistrationLeaveService.exportConfirmTable(response, searchVo);
}
// 设置权限
private void setLeaveBaseAuth(EmployeeRegistrationLeaveSearchVo searchVo) {
YifuUser user = SecurityUtils.getUser();
menuUtil.setAuthSql(user, searchVo);
}
}
......@@ -44,6 +44,8 @@ public interface EmployeeRegistrationLeaveService extends IService<EmployeeRegis
List<EmployeeRegistrationLeaveTableVo> getEmployeeRegistrationLeaveTablePage2000(EmployeeRegistrationLeaveSearchVo employeeRegistrationLeave);
long getRegistrationLeaveCount(EmployeeRegistrationLeaveSearchVo searchVo);
IPage<EmployeeRegistrationLeaveTableVo> getEmployeeRegistrationLeaveConfirmTablePage(Page<EmployeeRegistrationLeaveTableVo> page, EmployeeRegistrationLeaveSearchVo employeeRegistrationLeave);
void exportTable(HttpServletResponse response, EmployeeRegistrationLeaveSearchVo searchVo);
......
......@@ -29,10 +29,17 @@ import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationLeaveConfirmExportVo;
import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationLeaveExportVo;
import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationLeaveSearchVo;
import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationLeaveTableVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainRegistListVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ClientNameConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.ArchivesDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.servlet.ServletOutputStream;
......@@ -51,6 +58,10 @@ import java.util.List;
@Log4j2
@Service
public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRegistrationLeaveMapper, EmployeeRegistrationLeave> implements EmployeeRegistrationLeaveService {
@Autowired
private ArchivesDaprUtil archivesDaprUtil;
/**
* 自动化离职待办简单分页查询
*
......@@ -59,19 +70,62 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
*/
@Override
public IPage<EmployeeRegistrationLeaveTableVo> getEmployeeRegistrationLeaveTablePage(Page<EmployeeRegistrationLeaveTableVo> page, EmployeeRegistrationLeaveSearchVo employeeRegistrationLeave) {
initSearchVo(employeeRegistrationLeave);
return baseMapper.getEmployeeRegistrationLeaveTablePage(page, employeeRegistrationLeave);
}
@Override
public List<EmployeeRegistrationLeaveTableVo> getEmployeeRegistrationLeaveTablePage2000(EmployeeRegistrationLeaveSearchVo employeeRegistrationLeave) {
initSearchVo(employeeRegistrationLeave);
return baseMapper.getEmployeeRegistrationLeaveTablePage2000(employeeRegistrationLeave);
}
@Override
public long getRegistrationLeaveCount(EmployeeRegistrationLeaveSearchVo searchVo) {
initSearchVo(searchVo);
return baseMapper.getEmployeeRegistrationLeaveTableCount(searchVo);
}
@Override
public IPage<EmployeeRegistrationLeaveTableVo> getEmployeeRegistrationLeaveConfirmTablePage(Page<EmployeeRegistrationLeaveTableVo> page, EmployeeRegistrationLeaveSearchVo employeeRegistrationLeave) {
return baseMapper.getEmployeeRegistrationLeaveConfirmTablePage(page, employeeRegistrationLeave);
}
/**
* @Description: 前端客服的权限
* @Author: hgw
* @Date: 2025/11/20 10:37
* @return: void
**/
private void initSearchVo(EmployeeRegistrationLeaveSearchVo searchVo) {
YifuUser user = SecurityUtils.getUser();
boolean isSsc = this.haveRole(user);
if (isSsc || CommonConstants.ZERO_STRING.equals(user.getSystemFlag())) {
searchVo.setAuthSql(null);
return;
}
if (Common.isNotNull(searchVo.getType()) && CommonConstants.ONE_STRING.equals(searchVo.getType())) {
searchVo.setAuthSql(null);
//获取项目信息
R<TSettleDomainRegistListVo> domainR = archivesDaprUtil.getAllDeptByCustomerLoginName(user.getUsername());
if (null != domainR && null != domainR.getData() && null != domainR.getData().getDeptNos() && !domainR.getData().getDeptNos().isEmpty()) {
searchVo.setDeptNoList(domainR.getData().getDeptNos());
} else {
searchVo.setId(CommonConstants.ONE_STRING_NEGATE);
}
}
}
private boolean haveRole(YifuUser user) {
List<Long> roleList = user.getClientRoleMap().get(ClientNameConstants.CLIENT_MVP);
for (Long role : roleList) {
if (role == CommonConstants.CS_ROLE_ID) {
return true;
}
}
return false;
}
/**
* 自动化离职待办批量导出
*
......@@ -83,6 +137,12 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
String fileName = "自动化离职待处理批量导出" + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表
List<EmployeeRegistrationLeaveExportVo> list = new ArrayList<>();
//获取要导出的列表
if (Common.isNotNull(searchVo.getIds())) {
searchVo.setIdList(Common.getList(searchVo.getIds()));
}
//权限赋值
initSearchVo(searchVo);
long count = baseMapper.getEmployeeRegistrationLeaveTableCount(searchVo);
ServletOutputStream out = null;
try {
......
......@@ -135,6 +135,19 @@
<if test="employeeRegistrationLeave.id != null and employeeRegistrationLeave.id.trim() != ''">
AND a.id = #{employeeRegistrationLeave.id}
</if>
<if test="employeeRegistrationLeave.idList != null">
AND a.id in
<foreach item="idStr" index="index" collection="employeeRegistrationLeave.idList" open="(" separator="," close=")">
#{idStr}
</foreach>
</if>
<if test="employeeRegistrationLeave.deptNoList != null and employeeRegistrationLeave.deptNoList.size > 0">
AND b.DEPT_NO in
<foreach item="idStr" index="index" collection="employeeRegistrationLeave.deptNoList" open="(" separator=","
close=")">
#{idStr}
</foreach>
</if>
<if test="employeeRegistrationLeave.employeeName != null and employeeRegistrationLeave.employeeName.trim() != ''">
AND b.employee_name like CONCAT('%',#{employeeRegistrationLeave.employeeName},'%')
</if>
......
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