Commit 97de4088 authored by huyuchen's avatar huyuchen

huych-入离职登记提交

parent 05e180ef
......@@ -8,6 +8,7 @@ import lombok.Data;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Set;
/**
* 入离职登记表
......@@ -74,4 +75,8 @@ public class EmployeeRegistrationSearchVo extends EmployeeRegistration {
@TableField(exist = false)
private List<String> typeList;
@Schema(description = "部门权限数组")
@TableField(exist = false)
private Set<String> departIdSet;
}
......@@ -7,7 +7,6 @@ import com.yifu.cloud.plus.v1.csp.service.EmployeeRegistrationService;
import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationSearchVo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProjectBelongDept;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeProjectBelongDeptSearchCspVo;
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.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
......@@ -52,6 +51,19 @@ public class EmployeeRegistrationController {
return new R<>(employeeRegistrationService.getEmployeeRegistrationPage(page, employeeRegistration));
}
/**
* 入离职登记表代办列表简单分页查询
*
* @param page 分页对象
* @param employeeRegistration 入离职登记表
* @return
*/
@Operation(description = "入离职登记表代办列表简单分页查询")
@GetMapping("/hrPage")
public R<IPage<EmployeeRegistration>> getHrEmployeeRegistrationPage(Page<EmployeeRegistration> page, EmployeeRegistrationSearchVo employeeRegistration) {
return new R<>(employeeRegistrationService.getHrEmployeeRegistrationPage(page, employeeRegistration));
}
/**
* 通过id查询入离职登记表
*
......
......@@ -28,6 +28,13 @@ public interface EmployeeRegistrationService extends IService<EmployeeRegistrati
*/
IPage<EmployeeRegistration> getEmployeeRegistrationPage(Page<EmployeeRegistration> page, EmployeeRegistrationSearchVo employeeRegistration);
/**
* 入离职登记表简单分页查询
* @param employeeRegistration 入离职登记表
* @return
*/
IPage<EmployeeRegistration> getHrEmployeeRegistrationPage(Page<EmployeeRegistration> page, EmployeeRegistrationSearchVo employeeRegistration);
/**
* 入离职登记表导入
* @param inputStream 文件流
......
......@@ -31,6 +31,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainSelectVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.UserPermissionVo;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprArchivesProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.ArchivesDaprUtil;
......@@ -50,10 +51,7 @@ import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.net.URLEncoder;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
......@@ -92,6 +90,18 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
*/
@Override
public IPage<EmployeeRegistration> getEmployeeRegistrationPage(Page<EmployeeRegistration> page, EmployeeRegistrationSearchVo employeeRegistration) {
getDtpeAuth(employeeRegistration);
return baseMapper.getEmployeeRegistrationPage(page, employeeRegistration);
}
/**
* hr入离职登记表代办列表简单分页查询
*
* @param employeeRegistration 入离职登记表
* @return
*/
@Override
public IPage<EmployeeRegistration> getHrEmployeeRegistrationPage(Page<EmployeeRegistration> page, EmployeeRegistrationSearchVo employeeRegistration) {
return baseMapper.getEmployeeRegistrationPage(page, employeeRegistration);
}
......@@ -161,6 +171,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, CommonConstants.UTF8));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter excelWriter = EasyExcel.write(out, EmployeeRegistrationHrExportVo.class).build();
getDtpeAuth(searchVo);
int index = 0;
if (count > CommonConstants.ZERO_INT) {
for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT) {
......@@ -447,10 +458,8 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
if (sendUser != null) {
RestTemplate restTemplate = new RestTemplate();
Map<String, Object> requestMap = new HashMap<>();
String authUrl = null;
Map<String, Object> textcard = new HashMap<>();
authUrl = String.format(SecurityConstants.WX_GET_MESSAGE_AUTH_URL, wxConfig.getCorpid(), wxConfig.getDomainName()+"/auth/oauth/wxLogin", "01"+registration.getId());
String authUrl = String.format(SecurityConstants.WX_GET_MESSAGE_AUTH_URL, wxConfig.getCorpid(), "javascript:void(0)", "01"+registration.getId());
StringBuilder description = new StringBuilder();
String title = "";
if (CommonConstants.ONE_STRING.equals(type) || CommonConstants.TWO_STRING.equals(type)) {
......@@ -545,4 +554,28 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
return false;
}
/**
* @Description: 获取部门权限
* @Author: huych
* @Date: 2025/3/4 10:41
* @return:
**/
private void getDtpeAuth(EmployeeRegistrationSearchVo searchVo) {
YifuUser user = SecurityUtils.getUser();
if (null != user && Common.isNotNull(user.getId())) {
List<UserPermissionVo> cspPermList = user.getCspPermMap();
if (Common.isNotNull(cspPermList)) {
// 获取用户在当前项目下的权限
UserPermissionVo authority = null;
for (UserPermissionVo userPermissionVo : cspPermList) {
if (searchVo.getDeptNo().equals(userPermissionVo.getProjectNo())) {
authority = userPermissionVo;
}
}
if (Common.isNotNull(authority) && !authority.isHaveAll()) {
searchVo.setDepartIdSet(authority.getDepartIdSet());
}
}
}
}
}
......@@ -29,6 +29,7 @@
<result property="deptId" column="dept_id"/>
<result property="customerPhone" column="customer_phone"/>
<result property="customerUsername" column="customer_username"/>
<result property="customerUserLoginname" column="customer_user_loginname"/>
</resultMap>
<resultMap id="employeeRegistrationExportMap" type="com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationExportVo">
......@@ -84,7 +85,8 @@
a.dept_id,
a.dept_no,
a.customer_username,
a.customer_phone
a.customer_phone,
a.customer_user_loginname
</sql>
<sql id="employeeRegistration_where">
<if test="employeeRegistration != null">
......@@ -157,6 +159,19 @@
<if test="employeeRegistration.createName != null and employeeRegistration.createName.trim() != ''">
AND a.create_name = #{employeeRegistration.createName}
</if>
<if test="employeeRegistration.customerUserLoginname != null and employeeRegistration.customerUserLoginname.trim() != ''">
AND a.customer_user_loginname = #{employeeRegistration.customerUserLoginname}
</if>
<if test="employeeRegistration.deptNo != null and employeeRegistration.deptNo.trim() != ''">
AND a.dept_no = #{employeeRegistration.deptNo}
</if>
<if test="employeeRegistration.departIdSet != null and employeeRegistration.departIdSet.size > 0">
AND a.emp_deptid in
<foreach item="idStr" index="index" collection="employeeRegistration.departIdSet" open="(" separator=","
close=")">
#{idStr}
</foreach>
</if>
</if>
</sql>
<!--employeeRegistration简单分页查询-->
......
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