Commit cf26680f authored by hongguangwu's avatar hongguangwu

MVP1.7.12-瓜子导出offer

parent fee071c6
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.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.constant.ExcelAttributeConstants;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* 导出-瓜子offer信息接收表
*
* @author hgw
* @date 2025-6-17 09:38:47
*/
@Data
public class TGzOfferInfoExportDetailVo implements Serializable {
@ExcelProperty("流程ID")
private String bizId;
@ExcelProperty("人员类别编码")
private String empType;
@ExcelProperty("人员类别名称")
private String empTypeDescr;
/**
* 外签类型:A: 洼地外签/ B:属地外签
*/
@ExcelAttribute(name = "外签类型", isDataId = true, dataType = ExcelAttributeConstants.GZ_OUT_SGIN_TYPE)
@ExcelProperty("外签类型")
private String outSginType;
/**
* 合同公司主体:公司信息表
*/
@ExcelProperty("合同公司主体")
private String comраnу;
@ExcelProperty("姓名")
private String name;
@ExcelProperty("姓名拼音")
private String nameAc;
@ExcelProperty("姓氏拼音")
private String lastNameAc;
@ExcelProperty("名字拼音")
private String firstNameAc;
@ExcelProperty("国籍编码")
private String country;
@ExcelProperty("国籍描述")
private String countryDescr;
@ExcelProperty("证件类型编码")
private String nationalIdType;
@ExcelProperty("证件类型描述")
private String nationalIdTypeDescr;
@ExcelProperty("证件号码")
private String nationalId;
@ExcelAttribute(name = "性别", isDataId = true, dataType = ExcelAttributeConstants.GZ_SEX)
@ExcelProperty("性别")
private String sex;
@ExcelProperty("个人手机号")
private String phone;
@ExcelProperty("个人邮箱")
private String email;
@ExcelProperty("直接上级姓名")
private String supervisorName;
@ExcelProperty("职务描述")
private String jobcodeDescr;
@ExcelProperty("工作地点")
private String workLocation;
@ExcelProperty("工作地点描述")
private String workLocationDescr;
@ExcelProperty("预计入职日期")
private String expEntryDate;
@ExcelProperty("部门名称")
private String deptName;
/**
* 基本工资,两位小数
*/
@ExcelProperty("基本工资")
private BigDecimal basePay;
/**
* 绩效工资,两位小数
*/
@ExcelProperty("绩效工资")
private BigDecimal perfomPay;
@ExcelProperty("年终奖月数")
private Integer yearBonusMonth;
@ExcelProperty("社保缴纳地编码")
private String socialInsuranceLocation;
@ExcelProperty("社保缴纳地")
private String socialInsuranceLocationDescr;
@ExcelProperty("社保基数")
private BigDecimal socialInsuranceBase;
@ExcelProperty("公积金基数")
private BigDecimal houseAccFundBaseMax;
/**
* 是否转正后缴纳公积金(Y:是 N:否)
*/
@ExcelAttribute(name = "是否转正后缴纳公积金", isDataId = true, readConverterExp = "Y=是,N=否")
@ExcelProperty("是否转正后缴纳公积金")
private String beRegularEmpPay;
@ExcelProperty("申请人邮箱")
private String applyUserEmail;
@ExcelProperty("接收瓜子Offer时间")
private String createTime;
@ExcelAttribute(name = "Offer短信通知状态", isDataId = true, readConverterExp = "0=已发送,1=未发送")
@ExcelProperty("Offer短信通知状态")
private String offerSendStatus;
@ExcelAttribute(name = "Offer短信通知状态", isDataId = true, readConverterExp = "3=待发送Offer,4=待接受Offer,5=拒绝Offer,7=接受offer,9=候选人填写信息,10=取消offer,12=候选人信息审核,13=待签署,8=合同审核通过,99=已归档,98=信息待收集,97=候选人审核通过")
@ExcelProperty("Offer状态")
private String offerStatus;
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.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.util.LocalDateTimeUtils;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 导出-瓜子offer信息接收表
*
* @author hgw
* @date 2025-6-17 09:38:47
*/
@Data
public class TGzOfferInfoExportMainVo implements Serializable {
@ExcelProperty("流程ID")
private String bizId;
@ExcelProperty("姓名")
private String name;
@ExcelProperty("证件号码")
private String nationalId;
@ExcelProperty("个人手机号")
private String phone;
@ExcelProperty("职务描述")
private String jobcodeDescr;
@ExcelProperty("预计入职日期")
private String expEntryDate;
@ExcelProperty("接收瓜子Offer时间")
private String createTime;
@ExcelAttribute(name = "Offer短信通知状态", isDataId = true, readConverterExp = "0=已发送,1=未发送")
@ExcelProperty("Offer短信通知状态")
private String offerSendStatus;
@ExcelAttribute(name = "Offer短信通知状态", isDataId = true, readConverterExp = "3=待发送Offer,4=待接受Offer,5=拒绝Offer,7=接受offer,9=候选人填写信息,10=取消offer,12=候选人信息审核,13=待签署,8=合同审核通过,99=已归档,98=信息待收集,97=候选人审核通过")
@ExcelProperty("Offer状态")
private String offerStatus;
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TGzOfferInfo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDate;
/**
* 瓜子offer信息接收表——导出查询vo,主要加limit参数
*
* @author hgw
* @date 2025-6-17 10:00:43
*/
@Data
public class TGzOfferInfoExportSearchVo extends TGzOfferInfo {
private LocalDate createTimeStart;
private LocalDate createTimeEnd;
@TableField(exist = false)
@Schema(description = "id集合")
private String[] idList;
@TableField(exist = false)
@Schema(description = "查询起")
private int limitStart;
@TableField(exist = false)
@Schema(description = "查询止")
private int limitEnd;
}
...@@ -19,21 +19,23 @@ package com.yifu.cloud.plus.v1.yifu.archives.controller; ...@@ -19,21 +19,23 @@ package com.yifu.cloud.plus.v1.yifu.archives.controller;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TGzOfferInfo;
import com.yifu.cloud.plus.v1.yifu.archives.service.TGzOfferInfoService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TGzOfferInfoExportSearchVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TGzOfferInfoVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.TGzOfferInfoVo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common; 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.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog; import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TGzOfferInfo;
import com.yifu.cloud.plus.v1.yifu.archives.service.TGzOfferInfoService;
import lombok.SneakyThrows;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -181,4 +183,28 @@ public class TGzOfferInfoController { ...@@ -181,4 +183,28 @@ public class TGzOfferInfoController {
return tGzOfferInfoService.sendOfferAlert(tGzOfferInfo); return tGzOfferInfoService.sendOfferAlert(tGzOfferInfo);
} }
/**
* 社保导出花名册记录表 批量导出
* @author hgw
* @date 2025-06-16 14:29:13
**/
@SysLog("导出瓜子offer列表")
@Operation(description = "导出瓜子offer列表")
@PostMapping("/exportMain")
public void exportMain(HttpServletResponse response, @RequestBody TGzOfferInfoExportSearchVo searchVo) {
tGzOfferInfoService.exportMain(response, searchVo);
}
/**
* 社保导出花名册记录表 批量导出
* @author hgw
* @date 2025-06-16 14:29:13
**/
@SysLog("导出瓜子offer详情")
@Operation(description = "导出瓜子offer详情")
@PostMapping("/exportDetail")
public void exportDetail(HttpServletResponse response, @RequestBody TGzOfferInfoExportSearchVo searchVo) {
tGzOfferInfoService.exportDetail(response, searchVo);
}
} }
...@@ -21,6 +21,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -21,6 +21,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TGzOfferInfo; import com.yifu.cloud.plus.v1.yifu.archives.entity.TGzOfferInfo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TGzOfferInfoExportDetailVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TGzOfferInfoExportMainVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TGzOfferInfoExportSearchVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TGzOfferInfoVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.TGzOfferInfoVo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -64,4 +67,11 @@ public interface TGzOfferInfoMapper extends BaseMapper<TGzOfferInfo> { ...@@ -64,4 +67,11 @@ public interface TGzOfferInfoMapper extends BaseMapper<TGzOfferInfo> {
*/ */
Integer getTGzOfferInfoCount(@Param("tGzOfferInfo") TGzOfferInfoVo tGzOfferInfo); Integer getTGzOfferInfoCount(@Param("tGzOfferInfo") TGzOfferInfoVo tGzOfferInfo);
int getTGzOfferCount(@Param("tGzOfferInfo") TGzOfferInfoExportSearchVo tGzOfferInfo);
List<TGzOfferInfoExportMainVo> getTGzOfferMainList(@Param("tGzOfferInfo") TGzOfferInfoExportSearchVo tGzOfferInfo);
List<TGzOfferInfoExportDetailVo> getTGzOfferDetailList(@Param("tGzOfferInfo") TGzOfferInfoExportSearchVo tGzOfferInfo);
} }
...@@ -21,10 +21,13 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -21,10 +21,13 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TGzOfferInfo; import com.yifu.cloud.plus.v1.yifu.archives.entity.TGzOfferInfo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TGzOfferInfoExportSearchVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TGzOfferInfoVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TGzOfferInfoVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.TGzOfferInfoVo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage; import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream; import java.io.InputStream;
import java.util.List; import java.util.List;
...@@ -35,12 +38,13 @@ import java.util.List; ...@@ -35,12 +38,13 @@ import java.util.List;
* @date 2025-06-11 15:58:37 * @date 2025-06-11 15:58:37
*/ */
public interface TGzOfferInfoService extends IService<TGzOfferInfo> { public interface TGzOfferInfoService extends IService<TGzOfferInfo> {
/** /**
* 瓜子offer信息接收表简单分页查询 * 瓜子offer信息接收表简单分页查询
* @param tGzOfferInfo 瓜子offer信息接收表 *
* @return * @param tGzOfferInfo 瓜子offer信息接收表
*/ * @return
IPage<TGzOfferInfoVo> getTGzOfferInfoPage(Page<TGzOfferInfoVo> page, TGzOfferInfoVo tGzOfferInfo); */
IPage<TGzOfferInfoVo> getTGzOfferInfoPage(Page<TGzOfferInfoVo> page, TGzOfferInfoVo tGzOfferInfo);
/** /**
* 仅返回指定条数的列表数据 * 仅返回指定条数的列表数据
...@@ -62,6 +66,7 @@ public interface TGzOfferInfoService extends IService<TGzOfferInfo> { ...@@ -62,6 +66,7 @@ public interface TGzOfferInfoService extends IService<TGzOfferInfo> {
/** /**
* 修改瓜子offer信息 * 修改瓜子offer信息
*
* @param tGzOfferInfo 字典 * @param tGzOfferInfo 字典
* @return R<String> * @return R<String>
*/ */
...@@ -69,6 +74,7 @@ public interface TGzOfferInfoService extends IService<TGzOfferInfo> { ...@@ -69,6 +74,7 @@ public interface TGzOfferInfoService extends IService<TGzOfferInfo> {
/** /**
* 瓜子offer手动状态更新 * 瓜子offer手动状态更新
*
* @param tGzOfferInfo 字典 * @param tGzOfferInfo 字典
* @return R<String> * @return R<String>
*/ */
...@@ -83,8 +89,31 @@ public interface TGzOfferInfoService extends IService<TGzOfferInfo> { ...@@ -83,8 +89,31 @@ public interface TGzOfferInfoService extends IService<TGzOfferInfo> {
/**
* @Description: 批量导入
* @Author: hgw
* @Date: 2025/6/17 9:32
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.util.List < com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage>>
**/
R<List<ErrorMessage>> importDiy(InputStream inputStream); R<List<ErrorMessage>> importDiy(InputStream inputStream);
R<String> sendOfferAlert(TGzOfferInfoVo tGzOfferInfo); R<String> sendOfferAlert(TGzOfferInfoVo tGzOfferInfo);
/**
* @Description: 导出列表
* @Author: hgw
* @Date: 2025/6/17 9:33
* @return: void
**/
void exportMain(HttpServletResponse response, TGzOfferInfoExportSearchVo searchVo);
/**
* @Description: 导出详情
* @Author: hgw
* @Date: 2025/6/17 9:33
* @return: void
**/
void exportDetail(HttpServletResponse response, TGzOfferInfoExportSearchVo searchVo);
} }
...@@ -18,11 +18,15 @@ package com.yifu.cloud.plus.v1.yifu.archives.service.impl; ...@@ -18,11 +18,15 @@ package com.yifu.cloud.plus.v1.yifu.archives.service.impl;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import com.alibaba.excel.EasyExcel; import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.EasyExcelFactory;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.context.AnalysisContext; import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.read.listener.ReadListener; import com.alibaba.excel.read.listener.ReadListener;
import com.alibaba.excel.read.metadata.holder.ReadRowHolder; import com.alibaba.excel.read.metadata.holder.ReadRowHolder;
import com.alibaba.excel.util.ListUtils; import com.alibaba.excel.util.ListUtils;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
...@@ -41,17 +45,30 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.*; ...@@ -41,17 +45,30 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.core.util.alisms.AliSmsResult; import com.yifu.cloud.plus.v1.yifu.common.core.util.alisms.AliSmsResult;
import com.yifu.cloud.plus.v1.yifu.common.core.util.alisms.RegistParamVo; import com.yifu.cloud.plus.v1.yifu.common.core.util.alisms.RegistParamVo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.alisms.YiFuSmsUtil; import com.yifu.cloud.plus.v1.yifu.common.core.util.alisms.YiFuSmsUtil;
import com.yifu.cloud.plus.v1.yifu.archives.vo.*;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser; import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils; import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.social.entity.TDispatchExportLog;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import org.apache.commons.lang.ArrayUtils; import org.apache.commons.lang.ArrayUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.lang.reflect.Field;
import java.net.URLEncoder;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 瓜子offer信息接收表 * 瓜子offer信息接收表
...@@ -118,7 +135,7 @@ public class TGzOfferInfoServiceImpl extends ServiceImpl<TGzOfferInfoMapper, TGz ...@@ -118,7 +135,7 @@ public class TGzOfferInfoServiceImpl extends ServiceImpl<TGzOfferInfoMapper, TGz
return R.failed(CommonConstants.PLEASE_LOG_IN); return R.failed(CommonConstants.PLEASE_LOG_IN);
} }
TGzOfferInfo findInfo = this.getInfoCommon(tGzOfferInfo.getId()); TGzOfferInfo findInfo = this.getInfoCommon(tGzOfferInfo.getId());
if (Common.isEmpty(findInfo)){ if (Common.isEmpty(findInfo)) {
return R.failed(CommonConstants.ERROR_NO_DOMAIN); return R.failed(CommonConstants.ERROR_NO_DOMAIN);
} }
...@@ -143,28 +160,28 @@ public class TGzOfferInfoServiceImpl extends ServiceImpl<TGzOfferInfoMapper, TGz ...@@ -143,28 +160,28 @@ public class TGzOfferInfoServiceImpl extends ServiceImpl<TGzOfferInfoMapper, TGz
if (user == null || Common.isEmpty(user.getId())) { if (user == null || Common.isEmpty(user.getId())) {
return R.failed(CommonConstants.PLEASE_LOG_IN); return R.failed(CommonConstants.PLEASE_LOG_IN);
} }
if(Common.isEmpty(tGzOfferInfo.getId())){ if (Common.isEmpty(tGzOfferInfo.getId())) {
return R.failed(CommonConstants.PARAM_IS_NOT_EMPTY); return R.failed(CommonConstants.PARAM_IS_NOT_EMPTY);
} }
if(Common.isEmpty(tGzOfferInfo.getOfferStatus())){ if (Common.isEmpty(tGzOfferInfo.getOfferStatus())) {
return R.failed("更新状态不能为空"); return R.failed("更新状态不能为空");
} }
TGzOfferInfo findInfo = this.getInfoCommon(tGzOfferInfo.getId()); TGzOfferInfo findInfo = this.getInfoCommon(tGzOfferInfo.getId());
if (Common.isEmpty(findInfo)){ if (Common.isEmpty(findInfo)) {
return R.failed(CommonConstants.ERROR_NO_DOMAIN); return R.failed(CommonConstants.ERROR_NO_DOMAIN);
} }
// 更新为同一状态的提示操作失败 // 更新为同一状态的提示操作失败
if(findInfo.getOfferStatus().equals(tGzOfferInfo.getOfferStatus())){ if (findInfo.getOfferStatus().equals(tGzOfferInfo.getOfferStatus())) {
return R.failed("当前Offer更新状态失败,请刷新页面后重试"); return R.failed("当前Offer更新状态失败,请刷新页面后重试");
} }
// 当前Offer更新状态,无法再发起更新:5:拒绝Offer、10:取消offer、8:合同审核通过、99:已归档 // 当前Offer更新状态,无法再发起更新:5:拒绝Offer、10:取消offer、8:合同审核通过、99:已归档
String[] forbidStatusArr = {"5", "10", "8","99"}; String[] forbidStatusArr = {"5", "10", "8", "99"};
if (ArrayUtils.contains(forbidStatusArr, findInfo.getOfferStatus())) { if (ArrayUtils.contains(forbidStatusArr, findInfo.getOfferStatus())) {
return R.failed("当前Offer更新状态,无法再发起更新"); return R.failed("当前Offer更新状态,无法再发起更新");
} }
// 获取当前状态下,允许更新的状态列表 // 获取当前状态下,允许更新的状态列表
List<String> allowUpdateStatusList = this.allowUpdateStatus(findInfo.getOfferStatus()); List<String> allowUpdateStatusList = this.allowUpdateStatus(findInfo.getOfferStatus());
if(!allowUpdateStatusList.contains(tGzOfferInfo.getOfferStatus())){ if (!allowUpdateStatusList.contains(tGzOfferInfo.getOfferStatus())) {
return R.failed("当前Offer更新状态失败,禁止更新为所选状态,请刷新页面后重试"); return R.failed("当前Offer更新状态失败,禁止更新为所选状态,请刷新页面后重试");
} }
// 更新状态 // 更新状态
...@@ -238,31 +255,31 @@ public class TGzOfferInfoServiceImpl extends ServiceImpl<TGzOfferInfoMapper, TGz ...@@ -238,31 +255,31 @@ public class TGzOfferInfoServiceImpl extends ServiceImpl<TGzOfferInfoMapper, TGz
* @param orgStatus 当前状态 * @param orgStatus 当前状态
* @return List<String> 允许更新的状态列表 * @return List<String> 允许更新的状态列表
*/ */
private List<String> allowUpdateStatus(String orgStatus){ private List<String> allowUpdateStatus(String orgStatus) {
List<String> allowUpdateStatusList = new ArrayList<>(); List<String> allowUpdateStatusList = new ArrayList<>();
// 3:待发送Offer // 3:待发送Offer
if(CommonConstants.THREE_STRING.equals(orgStatus)){ if (CommonConstants.THREE_STRING.equals(orgStatus)) {
// 可更新为:4:待接受Offer、10:取消offer // 可更新为:4:待接受Offer、10:取消offer
allowUpdateStatusList.add(CommonConstants.FOUR_STRING); allowUpdateStatusList.add(CommonConstants.FOUR_STRING);
allowUpdateStatusList.add(CommonConstants.TEN_STRING); allowUpdateStatusList.add(CommonConstants.TEN_STRING);
} }
// 4:待接受Offer // 4:待接受Offer
if(CommonConstants.FOUR_STRING.equals(orgStatus)){ if (CommonConstants.FOUR_STRING.equals(orgStatus)) {
// 可更新为:5:拒绝Offer、7:接受offer、10:取消offer // 可更新为:5:拒绝Offer、7:接受offer、10:取消offer
allowUpdateStatusList.add(CommonConstants.FIVE_STRING); allowUpdateStatusList.add(CommonConstants.FIVE_STRING);
allowUpdateStatusList.add(CommonConstants.SEVEN_STRING); allowUpdateStatusList.add(CommonConstants.SEVEN_STRING);
allowUpdateStatusList.add(CommonConstants.TEN_STRING); allowUpdateStatusList.add(CommonConstants.TEN_STRING);
} }
// 7:接受Offer // 7:接受Offer
if(CommonConstants.SEVEN_STRING.equals(orgStatus)){ if (CommonConstants.SEVEN_STRING.equals(orgStatus)) {
// 可更新为:98:信息待收集、10:取消offer // 可更新为:98:信息待收集、10:取消offer
allowUpdateStatusList.add("98"); allowUpdateStatusList.add("98");
allowUpdateStatusList.add(CommonConstants.TEN_STRING); allowUpdateStatusList.add(CommonConstants.TEN_STRING);
} }
// 98:信息待收集、9:候选人填写信息、12:候选人信息审核、97:候选人审核通过、13:待签署 // 98:信息待收集、9:候选人填写信息、12:候选人信息审核、97:候选人审核通过、13:待签署
if("98".equals(orgStatus) || CommonConstants.NINE_STRING.equals(orgStatus) if ("98".equals(orgStatus) || CommonConstants.NINE_STRING.equals(orgStatus)
|| CommonConstants.TWELVE_STRING.equals(orgStatus) || "97".equals(orgStatus) || CommonConstants.TWELVE_STRING.equals(orgStatus) || "97".equals(orgStatus)
|| CommonConstants.THIRTEEN_STRING.equals(orgStatus)){ || CommonConstants.THIRTEEN_STRING.equals(orgStatus)) {
// 可更新为:10:取消offer // 可更新为:10:取消offer
allowUpdateStatusList.add(CommonConstants.TEN_STRING); allowUpdateStatusList.add(CommonConstants.TEN_STRING);
} }
...@@ -270,7 +287,7 @@ public class TGzOfferInfoServiceImpl extends ServiceImpl<TGzOfferInfoMapper, TGz ...@@ -270,7 +287,7 @@ public class TGzOfferInfoServiceImpl extends ServiceImpl<TGzOfferInfoMapper, TGz
return allowUpdateStatusList; return allowUpdateStatusList;
} }
private TGzOfferInfo getInfoCommon(Integer id){ private TGzOfferInfo getInfoCommon(Integer id) {
return this.getOne(Wrappers.<TGzOfferInfo>query().lambda() return this.getOne(Wrappers.<TGzOfferInfo>query().lambda()
.eq(TGzOfferInfo::getId, id) .eq(TGzOfferInfo::getId, id)
.eq(TGzOfferInfo::getDelFlag, CommonConstants.ZERO_STRING) .eq(TGzOfferInfo::getDelFlag, CommonConstants.ZERO_STRING)
...@@ -300,11 +317,11 @@ public class TGzOfferInfoServiceImpl extends ServiceImpl<TGzOfferInfoMapper, TGz ...@@ -300,11 +317,11 @@ public class TGzOfferInfoServiceImpl extends ServiceImpl<TGzOfferInfoMapper, TGz
public void invoke(TGzOfferInfoImportVo data, AnalysisContext context) { public void invoke(TGzOfferInfoImportVo data, AnalysisContext context) {
ReadRowHolder readRowHolder = context.readRowHolder(); ReadRowHolder readRowHolder = context.readRowHolder();
Integer rowIndex = readRowHolder.getRowIndex(); Integer rowIndex = readRowHolder.getRowIndex();
data.setRowIndex(rowIndex+1); data.setRowIndex(rowIndex + 1);
ErrorMessage errorMessage = util1.checkEntity(data, data.getRowIndex()); ErrorMessage errorMessage = util1.checkEntity(data, data.getRowIndex());
if (Common.isNotNull(errorMessage)){ if (Common.isNotNull(errorMessage)) {
errorMessageList.add(errorMessage); errorMessageList.add(errorMessage);
}else { } else {
cachedDataList.add(data); cachedDataList.add(data);
} }
if (cachedDataList.size() >= BATCH_COUNT) { if (cachedDataList.size() >= BATCH_COUNT) {
...@@ -313,6 +330,7 @@ public class TGzOfferInfoServiceImpl extends ServiceImpl<TGzOfferInfoMapper, TGz ...@@ -313,6 +330,7 @@ public class TGzOfferInfoServiceImpl extends ServiceImpl<TGzOfferInfoMapper, TGz
cachedDataList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT); cachedDataList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT);
} }
} }
@Override @Override
public void doAfterAllAnalysed(AnalysisContext context) { public void doAfterAllAnalysed(AnalysisContext context) {
saveData(); saveData();
...@@ -323,17 +341,18 @@ public class TGzOfferInfoServiceImpl extends ServiceImpl<TGzOfferInfoMapper, TGz ...@@ -323,17 +341,18 @@ public class TGzOfferInfoServiceImpl extends ServiceImpl<TGzOfferInfoMapper, TGz
*/ */
private void saveData() { private void saveData() {
log.info("{}条数据,开始存储数据库!", cachedDataList.size()); log.info("{}条数据,开始存储数据库!", cachedDataList.size());
importTDispatchExportLog(cachedDataList,errorMessageList); importTDispatchExportLog(cachedDataList, errorMessageList);
log.info("存储数据库成功!"); log.info("存储数据库成功!");
} }
}).sheet().doRead(); }).sheet().doRead();
}catch (Exception e){ } catch (Exception e) {
log.error(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR,e); log.error(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR, e);
return R.failed(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR); return R.failed(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR);
} }
return R.ok(errorMessageList); return R.ok(errorMessageList);
} }
@Override @Override
public R<String> sendOfferAlert(TGzOfferInfoVo tGzOfferInfo) { public R<String> sendOfferAlert(TGzOfferInfoVo tGzOfferInfo) {
//获取所有满足条件的未发送offer提醒的数据 //获取所有满足条件的未发送offer提醒的数据
...@@ -422,6 +441,7 @@ public class TGzOfferInfoServiceImpl extends ServiceImpl<TGzOfferInfoMapper, TGz ...@@ -422,6 +441,7 @@ public class TGzOfferInfoServiceImpl extends ServiceImpl<TGzOfferInfoMapper, TGz
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), CommonConstants.SAVE_SUCCESS)); errorMessageList.add(new ErrorMessage(excel.getRowIndex(), CommonConstants.SAVE_SUCCESS));
} }
} }
/** /**
* 插入excel bad record * 插入excel bad record
*/ */
...@@ -431,4 +451,173 @@ public class TGzOfferInfoServiceImpl extends ServiceImpl<TGzOfferInfoMapper, TGz ...@@ -431,4 +451,173 @@ public class TGzOfferInfoServiceImpl extends ServiceImpl<TGzOfferInfoMapper, TGz
this.save(insert); this.save(insert);
} }
/**
* 导出瓜子OFFER
*
* @return
*/
@Override
public void exportMain(HttpServletResponse response, TGzOfferInfoExportSearchVo searchVo) {
String prfName = "瓜子OFFER信息";
String fileName = prfName + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表
List<TGzOfferInfoExportMainVo> list = new ArrayList<>();
long count = baseMapper.getTGzOfferCount(searchVo);
ServletOutputStream out = null;
try {
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));
Map<String,String> redisLabelMap = (Map<String, String>) RedisUtil.redis.opsForValue().get(CacheConstants.REDIS_DICT_LABLE);
Map<String,String> nameAndDicTypeMap = getConverterDicTypeAndArea(TGzOfferInfoExportMainVo.class, redisLabelMap);
ExcelWriter excelWriter = EasyExcelFactory.write(out, TGzOfferInfoExportMainVo.class).registerConverter(new DictConverter(nameAndDicTypeMap, redisLabelMap)).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.getTGzOfferMainList(searchVo);
if (Common.isNotNull(list)) {
ExcelUtil<TGzOfferInfoExportMainVo> util = new ExcelUtil<>(TGzOfferInfoExportMainVo.class);
for (TGzOfferInfoExportMainVo vo : list) {
util.convertEntity(vo, null, null, null);
}
}
if (Common.isNotNull(list)) {
WriteSheet writeSheet = EasyExcelFactory.writerSheet(prfName + index).build();
excelWriter.write(list, writeSheet);
index++;
}
if (Common.isNotNull(list)) {
list.clear();
}
}
} else {
WriteSheet writeSheet = EasyExcelFactory.writerSheet(prfName + index).build();
excelWriter.write(list, writeSheet);
}
if (Common.isNotNull(list)) {
list.clear();
}
out.flush();
excelWriter.finish();
} catch (Exception e) {
log.error("执行异常", e);
} finally {
try {
if (null != out) {
out.close();
}
} catch (IOException e) {
log.error("执行异常", e);
}
}
}
/**
* 导出瓜子OFFER详情
*
* @return
*/
@Override
public void exportDetail(HttpServletResponse response, TGzOfferInfoExportSearchVo searchVo) {
String prfName = "瓜子OFFER详情信息";
String fileName = prfName + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表
List<TGzOfferInfoExportDetailVo> list = new ArrayList<>();
long count = baseMapper.getTGzOfferCount(searchVo);
ServletOutputStream out = null;
try {
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));
// 这是获取所有字典的值
Map<String,String> redisLabelMap = (Map<String, String>) RedisUtil.redis.opsForValue().get(CacheConstants.REDIS_DICT_LABLE);
Map<String,String> nameAndDicTypeMap = getConverterDicTypeAndArea(TGzOfferInfoExportDetailVo.class, redisLabelMap);
ExcelWriter excelWriter = EasyExcelFactory.write(out, TGzOfferInfoExportDetailVo.class).registerConverter(new DictConverter(nameAndDicTypeMap, redisLabelMap)).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.getTGzOfferDetailList(searchVo);
if (Common.isNotNull(list)) {
WriteSheet writeSheet = EasyExcelFactory.writerSheet(prfName + index).build();
excelWriter.write(list, writeSheet);
index++;
}
if (Common.isNotNull(list)) {
list.clear();
}
}
} else {
WriteSheet writeSheet = EasyExcelFactory.writerSheet(prfName + index).build();
excelWriter.write(list, writeSheet);
}
if (Common.isNotNull(list)) {
list.clear();
}
out.flush();
excelWriter.finish();
} catch (Exception e) {
log.error("执行异常", e);
} finally {
try {
if (null != out) {
out.close();
}
} catch (IOException e) {
log.error("执行异常", e);
}
}
}
private Map<String,String> getConverterDicTypeAndArea(Class<?> clazz, Map<String,String> redisLabelMap) {
// 得到所有定义字段
Field[] allFields = clazz.getDeclaredFields();
Map<String,String> nameDicMap = new HashMap<>();
List<Field> fields = new ArrayList<>();
// 将需要字典表头存起来备用,如果没传,则全部翻译
for (Field field : allFields) {
if (field.isAnnotationPresent(ExcelAttribute.class)) {
fields.add(field);
}
}
ExcelAttribute attr;
Field field;
String[] convertSource;
String[] itemArray;
for (int j = 0; j < fields.size(); j++) {
field = fields.get(j);
attr = field.getAnnotation(ExcelAttribute.class);
if (Common.isNotNull(field) && Common.isNotNull(attr)){
if (Common.isNotNull(attr.dataType())) {
nameDicMap.put(field.getName(), attr.dataType());
} else if (Common.isNotNull(attr.isArea()) && attr.isArea()) {
nameDicMap.put(field.getName(), CacheConstants.AREA_VALUE_ALL);
} else if (Common.isNotNull(attr.readConverterExp())) {
convertSource = attr.readConverterExp().split(",");
if (Common.isNotNull(convertSource)) {
for (String item : convertSource) {
itemArray = item.split("=");
if (itemArray.length >1) {
redisLabelMap.put(field.getName()+CommonConstants.DOWN_LINE_STRING+itemArray[0],itemArray[1]);
}
}
nameDicMap.put(field.getName(), field.getName());
}
}
}
}
return nameDicMap;
}
} }
...@@ -290,4 +290,81 @@ ...@@ -290,4 +290,81 @@
<include refid="tGzOfferInfo_where"/> <include refid="tGzOfferInfo_where"/>
</where> </where>
</select> </select>
<!--导出先查条数-->
<select id="getTGzOfferCount" resultType="java.lang.Integer">
SELECT
count(1)
FROM t_gz_offer_info a
where a.del_flag = '0'
<include refid="tGzOfferInfo_where"/>
ORDER by a.create_time desc,a.id desc
</select>
<!-- 导出ORRER字段 -->
<sql id="Export_Column_List">
a.biz_id,
a.offer_status,
a.offer_send_status,
a.update_by,
a.update_time,
a.emp_type,
a.emp_type_descr,
a.out_sgin_type,
a.comраnу,
a.name,
a.name_ac,
a.last_name_ac,
a.first_name_ac,
a.country,
a.country_descr,
a.national_id_type,
a.national_id_type_descr,
a.national_id,
a.sex,
a.phone,
a.email,
a.supervisor_name,
a.jobcode_descr,
a.work_location,
a.work_location_descr,
date_format(a.exp_entry_date, '%Y-%m-%d') exp_entry_date,
a.dept_name,
a.base_pay,
a.perfom_pay,
a.year_bonus_month,
a.social_insurance_location,
a.social_insurance_location_descr,
a.social_insurance_base,
a.house_acc_fund_base_max,
a.be_regular_emp_pay,
a.apply_user_email,
date_format(a.create_time, '%Y-%m-%d %H:%i:%s') create_time
</sql>
<!--导出主表-->
<select id="getTGzOfferMainList" resultType="com.yifu.cloud.plus.v1.yifu.archives.vo.TGzOfferInfoExportMainVo">
SELECT
<include refid="Export_Column_List"/>
FROM t_gz_offer_info a
where a.del_flag = '0'
<include refid="tGzOfferInfo_where"/>
ORDER by a.create_time desc,a.id desc
<if test="tGzOfferInfo.limitStart != null">
limit #{tGzOfferInfo.limitStart},#{tGzOfferInfo.limitEnd}
</if>
</select>
<!--导出详情-->
<select id="getTGzOfferDetailList" resultType="com.yifu.cloud.plus.v1.yifu.archives.vo.TGzOfferInfoExportDetailVo">
SELECT
<include refid="Export_Column_List"/>
FROM t_gz_offer_info a
where a.del_flag = '0'
<include refid="tGzOfferInfo_where"/>
ORDER by a.create_time desc,a.id desc
<if test="tGzOfferInfo.limitStart != null">
limit #{tGzOfferInfo.limitStart},#{tGzOfferInfo.limitEnd}
</if>
</select>
</mapper> </mapper>
...@@ -165,4 +165,14 @@ public class ExcelAttributeConstants { ...@@ -165,4 +165,14 @@ public class ExcelAttributeConstants {
//社保派减委托备注 //社保派减委托备注
public static final String TRUST_REMARK_ADD = "trustRemark"; public static final String TRUST_REMARK_ADD = "trustRemark";
// 瓜子的人员类别编码
public static final String GZ_EMP_TYPE = "gz_emp_type";
// 瓜子的证件类型编码
public static final String GZ_NATIONAL_ID_TYPE = "gz_national_id_type";
// 瓜子的国籍
public static final String GZ_COUNTRY = "gz_country";
// 瓜子的性别
public static final String GZ_SEX = "gz_sex";
// 瓜子的外签类型
public static final String GZ_OUT_SGIN_TYPE = "gz_out_sgin_type";
} }
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