Commit 1e881992 authored by hongguangwu's avatar hongguangwu

Merge remote-tracking branch 'origin/MVP1.7.8' into MVP1.7.8

parents 3421d745 50cb9dd6
package com.yifu.cloud.plus.v1.yifu.archives.vo;
import lombok.Data;
import java.util.List;
@Data
public class TSettleDomainRegistListVo {
/**
* 合同主体项目编码
*/
private List<String> deptNos;
}
......@@ -483,4 +483,21 @@ public class TSettleDomainController {
List<TDomainUpCsVo> list= JSONObject.parseArray(jsonStr, TDomainUpCsVo.class);
return tSettleDomainService.updateProjectCsInfo(list);
}
/**
* 获取登录用户拥有的项目前端客服数据
*
* @param
* @return
* @Author huych
* @Date 2025-03-13
**/
@Operation(description = "获取登录用户拥有的项目前端客服数据)")
@Inner
@PostMapping("/getAllDeptByCustomerLoginName")
public TSettleDomainRegistListVo getAllDeptByCustomerLoginName(@RequestBody String userLoginName) {
TSettleDomainRegistListVo vo = new TSettleDomainRegistListVo();
vo.setDeptNos(tSettleDomainService.getAllDeptByCustomerLoginName(userLoginName));
return vo;
}
}
......@@ -23,12 +23,9 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TCustomerInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TSettleDomain;
import com.yifu.cloud.plus.v1.yifu.archives.vo.*;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.HashMap;
import java.util.List;
/**
......@@ -115,4 +112,6 @@ public interface TSettleDomainMapper extends BaseMapper<TSettleDomain> {
List<TSettleDomain> getAllInfoMap();
List<String> getAllDeptByCustomerLoginName(@Param(value = "userLoginName") String userLoginName);
}
......@@ -21,7 +21,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TCustomerInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpDisabilityInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TSettleDomain;
import com.yifu.cloud.plus.v1.yifu.archives.vo.*;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
......@@ -88,6 +87,8 @@ public interface TSettleDomainService extends IService<TSettleDomain> {
List<String> getSettleDomainIdsByUserId(String id);
List<String> getAllDeptByCustomerLoginName(String userLoginName);
/**
* 获取用户所拥有的项目编码
*/
......
......@@ -17,7 +17,6 @@
package com.yifu.cloud.plus.v1.yifu.archives.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
......@@ -542,4 +541,9 @@ public class TSettleDomainServiceImpl extends ServiceImpl<TSettleDomainMapper, T
}
return R.ok(Boolean.TRUE,CommonConstants.RESULT_DATA_SUCESS);
}
@Override
public List<String> getAllDeptByCustomerLoginName(String userLoginName) {
return baseMapper.getAllDeptByCustomerLoginName(userLoginName);
}
}
......@@ -638,4 +638,12 @@
t_settle_domain a
where a.DELETE_FLAG = '0'
</select>
<select id="getAllDeptByCustomerLoginName" resultType="java.lang.String">
SELECT
distinct(a.DEPART_NO) as DEPART_NO
FROM
t_settle_domain a
where a.DELETE_FLAG = '0' and a.CS_LOGIN_NAME = #{userLoginName}
</select>
</mapper>
......@@ -636,6 +636,8 @@ public interface CommonConstants {
List<String> processStatus = Stream.of("0","1").collect(Collectors.toList());
List<String> processPreStatus = Stream.of("1").collect(Collectors.toList());
List<String> socialInfoStatus = Stream.of("1","3","5","7").collect(Collectors.toList());
List<String> deptList = Stream.of("安徽一册档案管理有限公司","安徽顾合企业管理咨询有限公司","安徽赤道线数字传媒科技有限公司","劳务业务中心","易服智享&研究院").collect(Collectors.toList());
......
......@@ -530,4 +530,19 @@ public class ArchivesDaprUtil {
public R<Boolean> saveOrDeleteDeptRelation(SysCspDeptVo vo) {
return HttpDaprUtil.invokeMethodPost(daprArchivesProperties.getAppUrl(),daprArchivesProperties.getAppId(),"/temployeeprojectbelongdept/inner/saveOrDeleteDeptRelation", JSON.toJSONString(vo), Boolean.class, SecurityConstants.FROM_IN);
}
/**
* @Author huych
* @Description 获取登录人所有的项目对应的前端客服权限
* @Date 15:58 2025/3/13
* @Param
* @return
**/
public R<TSettleDomainRegistListVo> getAllDeptByCustomerLoginName(String userLoginName){
R<TSettleDomainRegistListVo> res = HttpDaprUtil.invokeMethodPost(daprArchivesProperties.getAppUrl(),daprArchivesProperties.getAppId(),"/tsettledomain/getAllDeptByCustomerLoginName",userLoginName, TSettleDomainRegistListVo.class, SecurityConstants.FROM_IN);
if (Common.isEmpty(res)){
return R.failed("获取项目信息失败!");
}
return res;
}
}
......@@ -93,6 +93,9 @@ public class EmployeeRegistration extends BaseEntity {
@Schema(description = "数据来源")
private String dataSource;
@Schema(description = "最新的客服名称")
private String customerUsernameNew;
@Schema(description = "入职登记人数")
@TableField(exist = false)
private int inNum;
......
......@@ -44,7 +44,7 @@ public class EmployeeRegistrationPre extends BaseEntity {
@Schema(description = "入职日期")
private Date joinLeaveDate;
@Schema(description = "状态,0短信待发送,1信息待填写,2信息待审核,3拒绝入职")
@Schema(description = "状态,0短信待发送,1信息待填写,2信息待审核,3拒绝入职,4已完成")
private String processStatus;
@Schema(description = "前端客服")
......@@ -68,6 +68,9 @@ public class EmployeeRegistrationPre extends BaseEntity {
@Schema(description = "合同类型(字典值)")
private String contractType;
@Schema(description = "合同业务细分(字典值)")
private String contractSubName;
@Schema(description = "数据来源")
private String dataSource;
......
package com.yifu.cloud.plus.v1.csp.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 入离职登记表
*
* @author huych
* @date 2025-02-25 14:48:11
*/
@Data
@ColumnWidth(17)
public class EmployeeRegistrationHrPreExportVo implements Serializable {
@ExcelAttribute(name = "项目名称")
@Schema(description = "项目名称")
@ExcelProperty("项目名称")
private String deptName;
@ExcelAttribute(name = "项目编码")
@Schema(description = "项目编码")
@ExcelProperty("项目编码")
private String deptNo;
@ExcelAttribute(name = "员工姓名")
@Schema(description = "员工姓名")
@ExcelProperty("员工姓名")
private String employeeName;
@ExcelAttribute(name = "身份证号")
@Schema(description = "身份证号")
@ExcelProperty("身份证号")
private String empIdcard;
@ExcelAttribute(name = "手机号码")
@Schema(description = "手机号码")
@ExcelProperty("手机号码")
private String empPhone;
@ExcelAttribute(name = "就职岗位")
@Schema(description = "就职岗位")
@ExcelProperty("就职岗位")
private String position;
@ExcelAttribute(name = "入职日期", isDate = true)
@Schema(description = "入职日期")
@ExcelProperty("入职日期")
@DateTimeFormat("yyyy-MM-dd")
private Date joinLeaveDate;
@ExcelAttribute(name = "登记人")
@Schema(description = "登记人")
@ExcelProperty("登记人")
private String registorUsername;
@ExcelAttribute(name = "登记时间", isDate = true)
@Schema(description = "登记时间")
@ExcelProperty("登记时间")
private Date createTime;
@ExcelAttribute(name = "数据来源")
@Schema(description = "数据来源")
@ExcelProperty("数据来源")
private String dataSource;
@ExcelAttribute(name = "前端客服")
@Schema(description = "前端客服")
@ExcelProperty("前端客服")
private String customerUsernameNew;
@ExcelAttribute(name = "状态")
@Schema(description = "状态,0已接收,1未处理,2已处理,3拒绝入职")
@ExcelProperty("状态")
private String processStatus;
}
package com.yifu.cloud.plus.v1.csp.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.RowIndex;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
/**
* 入职待建档表
*
* @author huych
* @date 2025-03-12 17:14:19
*/
@Data
public class EmployeeRegistrationPreVo extends RowIndex implements Serializable {
/**
* 员工姓名
*/
@Length(max = 30, message = "员工姓名 不能超过30 个字符")
@ExcelAttribute(name = "员工姓名", maxLength = 30)
@Schema(description = "员工姓名")
@ExcelProperty("员工姓名")
private String employeeName;
/**
* 身份证号
*/
@NotBlank(message = "身份证号 不能为空")
@Length(max = 18, message = "身份证号 不能超过18 个字符")
@ExcelAttribute(name = "身份证号", isNotEmpty = true, errorInfo = "身份证号 不能为空", maxLength = 18)
@Schema(description = "身份证号")
@ExcelProperty("身份证号")
private String empIdcard;
/**
* 手机号码
*/
@Length(max = 11, message = "手机号码 不能超过11 个字符")
@ExcelAttribute(name = "手机号码", maxLength = 11)
@Schema(description = "手机号码")
@ExcelProperty("手机号码")
private String empPhone;
/**
* 就职岗位
*/
@Length(max = 50, message = "就职岗位 不能超过50 个字符")
@ExcelAttribute(name = "就职岗位", maxLength = 50)
@Schema(description = "就职岗位")
@ExcelProperty("就职岗位")
private String position;
/**
* 入职日期
*/
@ExcelAttribute(name = "入职日期", isDate = true)
@Schema(description = "入职日期")
@ExcelProperty("入职日期")
private Date joinLeaveDate;
/**
* 状态,0短信待发送,1信息待填写,2信息待审核,3拒绝入职
*/
@Length(max = 1, message = "状态,0短信待发送,1信息待填写,2信息待审核,3拒绝入职 不能超过1 个字符")
@ExcelAttribute(name = "状态,0短信待发送,1信息待填写,2信息待审核,3拒绝入职", maxLength = 1)
@Schema(description = "状态,0短信待发送,1信息待填写,2信息待审核,3拒绝入职")
@ExcelProperty("状态,0短信待发送,1信息待填写,2信息待审核,3拒绝入职")
private String processStatus;
/**
* 前端客服
*/
@Length(max = 30, message = "前端客服 不能超过30 个字符")
@ExcelAttribute(name = "前端客服", maxLength = 30)
@Schema(description = "前端客服")
@ExcelProperty("前端客服")
private String customerUsername;
/**
* 前端客服登录名
*/
@Length(max = 30, message = "前端客服登录名 不能超过30 个字符")
@ExcelAttribute(name = "前端客服登录名", maxLength = 30)
@Schema(description = "前端客服登录名")
@ExcelProperty("前端客服登录名")
private String customerUserLoginname;
/**
* 项目名称
*/
@Length(max = 50, message = "项目名称 不能超过50 个字符")
@ExcelAttribute(name = "项目名称", maxLength = 50)
@Schema(description = "项目名称")
@ExcelProperty("项目名称")
private String deptName;
/**
* 项目编码
*/
@Length(max = 30, message = "项目编码 不能超过30 个字符")
@ExcelAttribute(name = "项目编码", maxLength = 30)
@Schema(description = "项目编码")
@ExcelProperty("项目编码")
private String deptNo;
/**
* 项目id
*/
@Length(max = 36, message = "项目id 不能超过36 个字符")
@ExcelAttribute(name = "项目id", maxLength = 36)
@Schema(description = "项目id")
@ExcelProperty("项目id")
private String deptId;
/**
* 员工类型(字典值,0外包1派遣2代理)
*/
@Length(max = 2, message = "员工类型(字典值,0外包1派遣2代理) 不能超过2 个字符")
@ExcelAttribute(name = "员工类型(字典值,0外包1派遣2代理)", maxLength = 2)
@Schema(description = "员工类型(字典值,0外包1派遣2代理)")
@ExcelProperty("员工类型(字典值,0外包1派遣2代理)")
private String empNature;
/**
* 合同类型(字典值)
*/
@Length(max = 2, message = "合同类型(字典值) 不能超过2 个字符")
@ExcelAttribute(name = "合同类型(字典值)", maxLength = 2)
@Schema(description = "合同类型(字典值)")
@ExcelProperty("合同类型(字典值)")
private String contractType;
/**
* 数据来源
*/
@Length(max = 5, message = "数据来源 不能超过5 个字符")
@ExcelAttribute(name = "数据来源", maxLength = 5)
@Schema(description = "数据来源")
@ExcelProperty("数据来源")
private String dataSource;
/**
* 预计收集时间
*/
@ExcelAttribute(name = "预计收集时间", isDate = true)
@Schema(description = "预计收集时间")
@ExcelProperty("预计收集时间")
private Date expectedCollectionTime;
/**
* 服务事项
*/
@Length(max = 50, message = "服务事项 不能超过50 个字符")
@ExcelAttribute(name = "服务事项", maxLength = 50)
@Schema(description = "服务事项")
@ExcelProperty("服务事项")
private String serverItem;
/**
* 档案所在地-省
*/
@ExcelAttribute(name = "档案所在地-省")
@Schema(description = "档案所在地-省")
@ExcelProperty("档案所在地-省")
private String fileProvince;
/**
* 档案所在地-市
*/
@ExcelAttribute(name = "档案所在地-市")
@Schema(description = "档案所在地-市")
@ExcelProperty("档案所在地-市")
private String fileCity;
/**
* 档案所在地-县
*/
@ExcelAttribute(name = "档案所在地-县")
@Schema(description = "档案所在地-县")
@ExcelProperty("档案所在地-县")
private String fileTown;
/**
* 确认人
*/
@Length(max = 30, message = "确认人 不能超过30 个字符")
@ExcelAttribute(name = "确认人", maxLength = 30)
@Schema(description = "确认人")
@ExcelProperty("确认人")
private String confirmUser;
/**
* 确认时间
*/
@ExcelAttribute(name = "确认时间", isDate = true)
@Schema(description = "确认时间")
@ExcelProperty("确认时间")
private Date confirmTime;
/**
* 创建人姓名
*/
@Length(max = 36, message = "创建人姓名 不能超过36 个字符")
@ExcelAttribute(name = "创建人姓名", maxLength = 36)
@Schema(description = "创建人姓名")
@ExcelProperty("创建人姓名")
private String createName;
@ExcelAttribute(name = "创建时间", isDate = true)
@Schema(description = "创建时间")
@ExcelProperty("创建时间")
private LocalDateTime createTime;
}
......@@ -81,6 +81,9 @@ public class EmployeeRegistrationSearchVo extends EmployeeRegistration {
@Schema(description = "项目权限数组")
@TableField(exist = false)
private Set<String> deptIdSet;
private List<String> deptNoList;
@Schema(description = "列表类型 1 待办 2监控")
private String type;
}
......@@ -204,4 +204,16 @@ public class EmployeeRegistrationController {
public R<IPage<EmployeeRegistration>> getHrConfirmEmployeeRegistrationPage(Page<EmployeeRegistration> page, EmployeeRegistrationSearchVo employeeRegistration) {
return new R<>(employeeRegistrationService.getHrConfirmEmployeeRegistrationPage(page, employeeRegistration));
}
/**
* 入职待确认表 批量导出
*
* @author huych
* @date 2025-03-13 16:55:32
**/
@Operation(description = "导出入职待确认表")
@PostMapping("/hrConfirmExport")
public void hrConfirmExport(HttpServletResponse response, @RequestBody EmployeeRegistrationSearchVo searchVo) {
employeeRegistrationService.hrConfirmExport(response, searchVo);
}
}
......@@ -38,7 +38,7 @@ public class EmployeeRegistrationPreController {
@Operation(description = "简单分页查询")
@GetMapping("/page")
public R<IPage<EmployeeRegistrationPre>> getEmployeeRegistrationPrePage(Page<EmployeeRegistrationPre> page, EmployeeRegistrationPreSearchVo employeeRegistrationPre) {
return new R<>(employeeRegistrationPreService.getEmployeeRegistrationPrePage(page,employeeRegistrationPre));
return new R<>(employeeRegistrationPreService.getEmployeeRegistrationPrePage(page,employeeRegistrationPre));
}
/**
* 不分页查询
......@@ -94,6 +94,6 @@ public class EmployeeRegistrationPreController {
@Operation(description = "导出入职待建档表")
@PostMapping("/export")
public void export(HttpServletResponse response, @RequestBody EmployeeRegistrationPreSearchVo searchVo) {
employeeRegistrationPreService.listExport(response,searchVo);
employeeRegistrationPreService.listExport(response,searchVo);
}
}
......@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.csp.entity.EmployeeRegistration;
import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationExportVo;
import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationHrExportVo;
import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationHrPreExportVo;
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;
......@@ -35,6 +36,8 @@ public interface EmployeeRegistrationMapper extends BaseMapper<EmployeeRegistrat
List<EmployeeRegistrationHrExportVo> selectHrExportList(@Param("employeeRegistration") EmployeeRegistrationSearchVo employeeRegistration);
List<EmployeeRegistrationHrPreExportVo> selectHrPreExportList(@Param("employeeRegistration") EmployeeRegistrationSearchVo employeeRegistration);
// 获取已接收的入离职申请,同步所属部门到项目档案里
List<TEmployeeProjectBelongDept> getZeroRegistrationByIdCard(@Param("searchCspVo") TEmployeeProjectBelongDeptSearchCspVo searchCspVo);
......
......@@ -84,6 +84,13 @@ public interface EmployeeRegistrationService extends IService<EmployeeRegistrati
*/
void listHrExport(HttpServletResponse response, EmployeeRegistrationSearchVo searchVo);
/**
* 入职待确认表导出
* @param searchVo 入离职登记
* @return
*/
void hrConfirmExport(HttpServletResponse response, EmployeeRegistrationSearchVo searchVo);
/**
* @param searchCspVo 身份证 与 类型
* @Description: 获取已接收的入离职申请,同步所属部门到项目档案里
......
......@@ -19,15 +19,13 @@ import com.yifu.cloud.plus.v1.csp.entity.TOperationLog;
import com.yifu.cloud.plus.v1.csp.mapper.EmployeeRegistrationMapper;
import com.yifu.cloud.plus.v1.csp.service.EmployeeRegistrationService;
import com.yifu.cloud.plus.v1.csp.service.TOperationLogService;
import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationExportVo;
import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationHrExportVo;
import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationSearchVo;
import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationVo;
import com.yifu.cloud.plus.v1.csp.vo.*;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.SysCspDeptVo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProjectBelongDept;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmpProjectStatusVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeProjectBelongDeptSearchCspVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainRegistListVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainSelectVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ClientNameConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
......@@ -53,7 +51,10 @@ import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.net.URLEncoder;
import java.time.LocalDateTime;
import java.util.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
......@@ -106,7 +107,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
public IPage<EmployeeRegistration> getHrEmployeeRegistrationPage(Page<EmployeeRegistration> page, EmployeeRegistrationSearchVo employeeRegistration) {
YifuUser user = SecurityUtils.getUser();
long roleId = 1839501715787390978L;
boolean isSsc = this.haveRole(user, roleId);
boolean isSsc = this.haveRole(user, roleId);
if (isSsc) {
employeeRegistration.setCustomerUserLoginname(null);
}
......@@ -121,11 +122,11 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
*/
@Override
public IPage<EmployeeRegistration> getHrConfirmEmployeeRegistrationPage(Page<EmployeeRegistration> page, EmployeeRegistrationSearchVo employeeRegistration) {
YifuUser user = SecurityUtils.getUser();
long roleId = 1839501715787390978L;
boolean isSsc = this.haveRole(user, roleId);
if (isSsc) {
employeeRegistration.setCustomerUserLoginname(null);
//前端客服的所有项目权限赋值
initSearchVo(employeeRegistration);
//待办列表只查看未处理的数据
if (CommonConstants.ONE_STRING.equals(employeeRegistration.getType())) {
employeeRegistration.setStatusList(CommonConstants.processPreStatus);
}
return baseMapper.getEmployeeRegistrationPage(page, employeeRegistration);
}
......@@ -227,8 +228,62 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
}
}
/**
* 入离职登记表批量导出
*
* @param searchVo 入离职登记表
* @return
*/
@Override
public void hrConfirmExport(HttpServletResponse response, EmployeeRegistrationSearchVo searchVo) {
String fileName = "入职待确认批量导出" + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表
List<EmployeeRegistrationHrPreExportVo> list = new ArrayList<>();
//前端客服的所有项目权限赋值
initSearchVo(searchVo);
//待办列表只查看未处理的数据
if (CommonConstants.ONE_STRING.equals(searchVo.getType())) {
searchVo.setStatusList(CommonConstants.processPreStatus);
}
long count = baseMapper.selectExportCount(searchVo);
try (ServletOutputStream out = response.getOutputStream()) {
response.setContentType(CommonConstants.MULTIPART_FORM_DATA);
response.setCharacterEncoding("utf-8");
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, CommonConstants.UTF8));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter excelWriter = EasyExcel.write(out, EmployeeRegistrationHrPreExportVo.class).build();
int index = 0;
if (count > CommonConstants.ZERO_INT) {
for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT) {
// 获取实际记录
searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = baseMapper.selectHrPreExportList(searchVo);
if (Common.isNotNull(list)) {
WriteSheet writeSheet = EasyExcel.writerSheet("入职待确认表" + index).build();
excelWriter.write(list, writeSheet);
index++;
}
if (Common.isNotNull(list)) {
list.clear();
}
}
} else {
WriteSheet writeSheet = EasyExcel.writerSheet("入职待确认表" + index).build();
excelWriter.write(list, writeSheet);
}
if (Common.isNotNull(list)) {
list.clear();
}
out.flush();
excelWriter.finish();
} catch (Exception e) {
log.error("执行异常", e);
}
}
@Override
public R<List<ErrorMessage>> importDiy(InputStream inputStream,String deptId) {
public R<List<ErrorMessage>> importDiy(InputStream inputStream, String deptId) {
List<ErrorMessage> errorMessageList = new ArrayList<>();
ExcelUtil<EmployeeRegistrationVo> util1 = new ExcelUtil<>(EmployeeRegistrationVo.class);
YifuUser user = SecurityUtils.getUser();
......@@ -283,7 +338,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
*/
private void saveData() {
log.info("{}条数据,开始存储数据库!", cachedDataList.size());
importEmployeeRegistration(cachedDataList, errorMessageList,user, selectVo);
importEmployeeRegistration(cachedDataList, errorMessageList, user, selectVo);
log.info("存储数据库成功!");
}
}).sheet().doRead();
......@@ -295,7 +350,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
}
private void importEmployeeRegistration(List<EmployeeRegistrationVo> excelVOList,
List<ErrorMessage> errorMessageList,YifuUser user,TSettleDomainSelectVo selectVo) {
List<ErrorMessage> errorMessageList, YifuUser user, TSettleDomainSelectVo selectVo) {
Map<String, String> exitMap = new HashMap<>();
EmployeeRegistrationVo excel;
......@@ -327,17 +382,17 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), error, excel));
continue;
}
initRegistInfo(insert,user, selectVo);
initRegistInfo(insert, user, selectVo);
insertList.add(insert);
//新增记录,新增操作记录
baseMapper.insert(insert);
if (CommonConstants.ONE_STRING.equals(insert.getFeedbackType())) {
inNum ++;
inNum++;
} else {
outNum ++;
outNum++;
}
logService.saveLog(insert.getId(), CommonConstants.ZERO_STRING,RegistConstants.MESSAGE_REGIST, LocalDateTime.now(),
insert.getRegistorUsername(),null);
logService.saveLog(insert.getId(), CommonConstants.ZERO_STRING, RegistConstants.MESSAGE_REGIST, LocalDateTime.now(),
insert.getRegistorUsername(), null);
}
if (!Common.isEmpty(insertList)) {
insertList.clear();
......@@ -365,10 +420,10 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
baseMapper.insert(registration);
}
//企业微信消息提醒
sendMessageToWx(registration,registration.getFeedbackType());
sendMessageToWx(registration, registration.getFeedbackType());
//操作记录
logService.saveLog(registration.getId(), CommonConstants.ZERO_STRING,RegistConstants.MESSAGE_REGIST, LocalDateTime.now(),
registration.getRegistorUsername(),null);
logService.saveLog(registration.getId(), CommonConstants.ZERO_STRING, RegistConstants.MESSAGE_REGIST, LocalDateTime.now(),
registration.getRegistorUsername(), null);
return R.ok();
}
......@@ -394,8 +449,8 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
}
registrationNow.setProcessStatus(CommonConstants.ZERO_STRING);
baseMapper.updateById(registrationNow);
logService.saveLog(registration.getId(), CommonConstants.ZERO_STRING,RegistConstants.CONFIRM_SUBMIT, LocalDateTime.now(),
user.getNickname(),null);
logService.saveLog(registration.getId(), CommonConstants.ZERO_STRING, RegistConstants.CONFIRM_SUBMIT, LocalDateTime.now(),
user.getNickname(), null);
return R.ok();
}
......@@ -406,11 +461,11 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
return R.failed(RegistConstants.NO_DATA_TO_HANDLE);
}
registrationNow.setProcessStatus(CommonConstants.TWO_STRING);
logService.saveLog(registration.getId(), CommonConstants.ZERO_STRING,RegistConstants.CONFIRM_SUBMIT, LocalDateTime.now(),
user.getNickname(),null);
logService.saveLog(registration.getId(), CommonConstants.ZERO_STRING,RegistConstants.MESSAGE_FINISH, registration.getProjectCreateTime(),
user.getNickname(),CommonConstants.ONE_STRING.equals(registrationNow.getFeedbackType())
? RegistConstants.BEFORE_IN_PROJECT :RegistConstants.BEFORE_OUT_PROJECT);
logService.saveLog(registration.getId(), CommonConstants.ZERO_STRING, RegistConstants.CONFIRM_SUBMIT, LocalDateTime.now(),
user.getNickname(), null);
logService.saveLog(registration.getId(), CommonConstants.ZERO_STRING, RegistConstants.MESSAGE_FINISH, registration.getProjectCreateTime(),
user.getNickname(), CommonConstants.ONE_STRING.equals(registrationNow.getFeedbackType())
? RegistConstants.BEFORE_IN_PROJECT : RegistConstants.BEFORE_OUT_PROJECT);
SysCspDeptVo vo = new SysCspDeptVo();
if (CommonConstants.ONE_STRING.equals(registrationNow.getFeedbackType())) {
vo.setDepartName(registrationNow.getEmpDeptname());
......@@ -483,7 +538,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
}
//数据初始化
private void initRegistInfo(EmployeeRegistration insert,YifuUser user,TSettleDomainSelectVo selectVo) {
private void initRegistInfo(EmployeeRegistration insert, YifuUser user, TSettleDomainSelectVo selectVo) {
SysCspDeptVo vo = new SysCspDeptVo();
vo.setUserId(user.getId());
vo.setProjectId(selectVo.getId());
......@@ -518,9 +573,9 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
return;
}
R<SysUser> res = upmsDaprUtils.getSimpleUserByLoginName(registration.getCustomerUserLoginname());
if (Common.isNotNull(res) && Common.isNotNull(res.getData())){
if (Common.isNotNull(res) && Common.isNotNull(res.getData())) {
user = res.getData();
}else {
} else {
return;
}
StringBuilder sendUser = null;
......@@ -531,13 +586,13 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
RestTemplate restTemplate = new RestTemplate();
Map<String, Object> requestMap = new HashMap<>();
Map<String, Object> textcard = new HashMap<>();
String authUrl = String.format(SecurityConstants.WX_GET_MESSAGE_AUTH_URL, wxConfig.getCorpid(), wxConfig.getDomainName()+"/auth/oauth/wxLogin", "66"+registration.getId());
String authUrl = String.format(SecurityConstants.WX_GET_MESSAGE_AUTH_URL, wxConfig.getCorpid(), wxConfig.getDomainName() + "/auth/oauth/wxLogin", "66" + registration.getId());
StringBuilder description = new StringBuilder();
String title = "";
if (CommonConstants.ONE_STRING.equals(type) || CommonConstants.TWO_STRING.equals(type)) {
title = CommonConstants.ONE_STRING.equals(type) ? "人员入职提醒:":"人员离职提醒:";
description.append(CommonConstants.ONE_STRING.equals(type) ? "入职日期:":"离职日期:")
.append(DateUtil.dateToString(registration.getJoinLeaveDate(),DateUtil.ISO_EXPANDED_DATE_FORMAT)).append("<br>");
title = CommonConstants.ONE_STRING.equals(type) ? "人员入职提醒:" : "人员离职提醒:";
description.append(CommonConstants.ONE_STRING.equals(type) ? "入职日期:" : "离职日期:")
.append(DateUtil.dateToString(registration.getJoinLeaveDate(), DateUtil.ISO_EXPANDED_DATE_FORMAT)).append("<br>");
description.append("项目名称:").append(registration.getDeptName()).append("<br>");
description.append("项目编码:").append(registration.getDeptNo()).append("<br>");
description.append("员工姓名:").append(registration.getEmployeeName()).append("<br>");
......@@ -562,8 +617,8 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
wxConfig.sendTextCard(restTemplate, requestMap);
}
//企业微信发送记录
logService.saveLog(user.getUserId(), CommonConstants.ZERO_STRING,"企业微信消息提醒", LocalDateTime.now(),
registration.getRegistorUsername(),"提醒人:" + user.getNickname());
logService.saveLog(user.getUserId(), CommonConstants.ZERO_STRING, "企业微信消息提醒", LocalDateTime.now(),
registration.getRegistorUsername(), "提醒人:" + user.getNickname());
}
}
......@@ -654,6 +709,27 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
}
}
/**
* @Description: 获取前端客服的所有项目权限
* @Author: huych
* @Date: 2025/3/13 17:02
* @return:
**/
public void initSearchVo(EmployeeRegistrationSearchVo searchVo) {
YifuUser user = SecurityUtils.getUser();
long roleId = 1839501715787390978L;
boolean isSsc = this.haveRole(user, roleId);
if (!isSsc && !CommonConstants.ZERO_STRING.equals(user.getSystemFlag())) {
//获取项目信息
R<TSettleDomainRegistListVo> domainR = archivesDaprUtil.getAllDeptByCustomerLoginName(user.getUsername());
if (null != domainR && null != domainR.getData() && null != domainR.getData().getDeptNos()) {
searchVo.setDeptNoList(domainR.getData().getDeptNos());
} else {
searchVo.setId(CommonConstants.ONE_STRING_NEGATE);
}
}
}
public boolean haveRole(YifuUser user, long roleId) {
List<Long> roleList = user.getClientRoleMap().get(ClientNameConstants.CLIENT_MVP);
for (Long role : roleList) {
......
......@@ -31,6 +31,7 @@
<result property="customerUsername" column="customer_username"/>
<result property="customerUserLoginname" column="customer_user_loginname"/>
<result property="dataSource" column="data_source"/>
<result property="customerUsernameNew" column="customer_username_new"/>
</resultMap>
<resultMap id="employeeRegistrationExportMap" type="com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationExportVo">
......@@ -60,6 +61,21 @@
<result property="deptName" column="dept_name"/>
<result property="deptNo" column="dept_no"/>
</resultMap>
<resultMap id="employeeRegistrationHrPreExportMap" type="com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationHrPreExportVo">
<result property="employeeName" column="employee_name"/>
<result property="empIdcard" column="emp_idcard"/>
<result property="empPhone" column="emp_phone"/>
<result property="position" column="position"/>
<result property="joinLeaveDate" column="join_leave_date"/>
<result property="processStatus" column="process_status"/>
<result property="registorUsername" column="registor_username"/>
<result property="createTime" column="create_time"/>
<result property="deptName" column="dept_name"/>
<result property="deptNo" column="dept_no"/>
<result property="dataSource" column="data_source"/>
<result property="customerUsernameNew" column="customer_username_new"/>
</resultMap>
<sql id="Base_Column_List">
a.id,
a.employee_name,
......@@ -86,7 +102,8 @@
a.customer_username,
a.customer_phone,
a.customer_user_loginname,
a.data_source
a.data_source,
a.customer_username_new
</sql>
<sql id="employeeRegistration_where">
<if test="employeeRegistration != null">
......@@ -168,6 +185,9 @@
<if test="employeeRegistration.dataSource != null and employeeRegistration.dataSource.trim() != ''">
AND a.data_source = #{employeeRegistration.dataSource}
</if>
<if test="employeeRegistration.customerUsernameNew != null and employeeRegistration.customerUsernameNew.trim() != ''">
AND a.customer_username_new = #{employeeRegistration.customerUsernameNew}
</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=","
......@@ -175,6 +195,13 @@
#{idStr}
</foreach>
</if>
<if test="employeeRegistration.deptNoList != null and employeeRegistration.deptNoList.size > 0">
AND a.dept_no in
<foreach item="idStr" index="index" collection="employeeRegistration.deptNoList" open="(" separator=","
close=")">
#{idStr}
</foreach>
</if>
<if test="employeeRegistration.authSql != null and employeeRegistration.authSql.trim() != ''">
${employeeRegistration.authSql}
</if>
......@@ -225,7 +252,6 @@
</if>
</select>
<select id="selectHrExportList" resultMap="employeeRegistrationHrExportMap">
SELECT
a.dept_name,
......@@ -251,6 +277,31 @@
</if>
</select>
<select id="selectHrPreExportList" resultMap="employeeRegistrationHrPreExportMap">
SELECT
a.dept_name,
a.dept_no,
a.employee_name,
a.emp_idcard,
a.emp_phone,
a.position,
a.join_leave_date,
if(a.process_status= '0','已接收',if(a.process_status= '1','待处理',if(a.process_status= '2','已处理','拒绝入职')) process_status,
a.registor_username,
a.create_time,
a.customer_username_new,
a.data_source
FROM employee_registration a
<where>
1=1
<include refid="employeeRegistration_where"/>
</where>
order by a.create_time desc
<if test="employeeRegistration.limitStart != null">
limit #{employeeRegistration.limitStart},#{employeeRegistration.limitEnd}
</if>
</select>
<!-- 获取待处理的数据 -->
<select id="getZeroRegistrationByIdCard" resultType="com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProjectBelongDept">
SELECT
......
......@@ -19,6 +19,7 @@
<result property="deptId" column="dept_id"/>
<result property="empNature" column="emp_nature"/>
<result property="contractType" column="contract_type"/>
<result property="contractSubName" column="contract_sub_name"/>
<result property="dataSource" column="data_source"/>
<result property="expectedCollectionTime" column="expected_collection_time"/>
<result property="serverItem" column="server_item"/>
......@@ -60,7 +61,8 @@
a.create_name,
a.create_time,
a.update_by,
a.update_time
a.update_time,
a.contract_sub_name
</sql>
<sql id="employeeRegistrationPre_where">
<if test="employeeRegistrationPre != null">
......
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