Commit 596964d2 authored by fangxinjiang's avatar fangxinjiang

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

parents f9a09ac7 360753b8
......@@ -34,6 +34,8 @@ public class DispatchConstants {
public static final String DISPATCH_SOCIAL_REDUCE = "社保派减";
public static final String SOCIAL_RECORD_ROSTER_EXPORT = "社保花名册导出";
public static final String SOCIAL_RECORD_EXPORT = "公积金变更清册导出";
public static final String SOCIAL_MEDICAL_EXPORT = "合肥医保花名册";
public static final String SOCIAL_PERSION_EXPORT = "合肥社保花名册";
public static final String DISPATCH_PENSION = "养老、";
public static final String DISPATCH_MEDICAL = "医疗、";
public static final String DISPATCH_BIRTH = "生育、";
......
......@@ -91,4 +91,28 @@ public class SocialHandleSearchVo extends TDispatchInfo {
@Schema(description = "mid" )
@ExcelIgnore
private String mId;
/**
* 单位编号
*/
@TableField(exist = false)
@Schema(description ="单位编号")
@ExcelIgnore
private String customerNo;
/**
* 单位统一信用代码
*/
@TableField(exist = false)
@Schema(description ="单位统一信用代码")
@ExcelIgnore
private String unitCreditCode;
/**
* 派单增/减月份
*/
@TableField(exist = false)
@Schema(description ="派单增/减月份")
@ExcelIgnore
private String disMonth;
}
......@@ -95,7 +95,7 @@ public class TDispatchReduceVo extends RowIndex implements Serializable {
/**
* 减少原因
*/
@ExcelAttribute(name = "减少原因",isNotEmpty = true, isDataId = true,dataType = ExcelAttributeConstants.REDUCE_SOCIAL_REASON)
@ExcelAttribute(name = "减少原因", isDataId = true,dataType = ExcelAttributeConstants.REDUCE_SOCIAL_REASON)
@Schema(description = "减少原因" )
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("减少原因" )
......
/*
* 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.social.vo;
import com.alibaba.excel.annotation.ExcelProperty;
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.math.BigDecimal;
/**
*
*
* @author huyc
* @date 2023-07-18 11:38:05
*/
@Data
public class TDispatchSocialExportVo implements Serializable {
/**
* 序号
*/
@Schema(description = "序号" )
@ExcelAttribute(name = "序号" )
@ExcelProperty("序号")
private Integer num;
/**
* 员工姓名
*/
@Schema(description = "姓名" )
@ExcelAttribute(name = "姓名" )
@ExcelProperty("姓名")
private String empName;
/**
* 身份证件类型
*/
@Schema(description = "身份证件类型" )
@ExcelAttribute(name = "身份证件类型" )
@ExcelProperty("身份证件类型")
private String idcardType;
/**
* 身份证号
*/
@Schema(description = "身份证件号码" )
@ExcelAttribute(name = "身份证件号码" )
@ExcelProperty("身份证件号码")
private String empIdcard;
/**
* 员工类型
*/
@Schema(description = "参保/停保时间" )
@ExcelAttribute(name = "参保/停保时间" )
@ExcelProperty("参保/停保时间")
private String disMonth;
/**
* 申报工资(元)
*/
@Schema(description = "申报工资(元)" )
@ExcelAttribute(name = "申报工资(元)" )
@ExcelProperty("申报工资(元)")
private BigDecimal medicalCardinal;
/**
* 新增
*/
@Schema(description = "新增" )
@ExcelAttribute(name = "新增" )
@ExcelProperty("新增")
private String changeTypeOne;
/**
* 续保
*/
@Schema(description = "续保" )
@ExcelAttribute(name = "续保" )
@ExcelProperty("续保")
private String changeTypeTwo;
/**
* 中断
*/
@Schema(description = "中断" )
@ExcelAttribute(name = "中断" )
@ExcelProperty("中断")
private String changeTypeThree;
/**
* 终止
*/
@Schema(description = "终止" )
@ExcelAttribute(name = "终止" )
@ExcelProperty("终止")
private String changeTypeFour;
/**
* 手机号码
*/
@Schema(description = "手机号码" )
@ExcelAttribute(name = "手机号码" )
@ExcelProperty("手机号码")
private String empMobile;
/**
* 学历
*/
@Schema(description = "学历")
@ExcelAttribute(name = "学历" )
@ExcelProperty("学历")
private String educationName;
/**
* 备注
*/
@Schema(description = "备注")
@ExcelAttribute(name = "备注" )
@ExcelProperty("备注")
private String remark;
}
/*
* 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.social.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 io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
/**
*
*
* @author huyc
* @date 2023-07-18 11:38:05
*/
@Data
public class TDispatchSocialPersionExportVo implements Serializable {
/**
* 序号
*/
@Schema(description = "序号" )
@ExcelAttribute(name = "序号" )
@ExcelProperty("序号")
private Integer num;
/**
* 员工姓名
*/
@Schema(description = "姓名" )
@ExcelAttribute(name = "姓名" )
@ExcelProperty("姓名")
private String empName;
/**
* 职工编码
*/
@Schema(description = "职工编码" )
@ExcelAttribute(name = "职工编码" )
@ExcelProperty("职工编码")
private String empNo;
/**
* 社会保障号码
*/
@Schema(description = "社会保障号码(身份证号码)" )
@ExcelAttribute(name = "社会保障号码(身份证号码)" )
@ExcelProperty("社会保障号码(身份证号码)")
private String empIdcard;
/**
* 性别:1男 2女
*/
@ExcelAttribute(name = "性别" )
@ExcelProperty("性别")
@Schema(description ="性别")
private String sex;
/**
* 民族
*/
@Schema(description = "民族")
@ExcelAttribute(name = "民族", isDataId = true,dataType = ExcelAttributeConstants.EMP_NATIONAL)
@ExcelProperty("民族")
private String empNational;
/**
* 参加工作时间
*/
@Schema(description = "参加工作时间" )
@ExcelAttribute(name = "参加工作时间" )
@ExcelProperty("参加工作时间")
private String workDate;
/**
* 户口性质
*/
@Schema(description = "户口性质" )
@ExcelAttribute(name = "户口性质" )
@ExcelProperty("户口性质")
private String type;
/**
* 个人身份
*/
@Schema(description = "个人身份" )
@ExcelAttribute(name = "个人身份" )
@ExcelProperty("个人身份")
private String signleType;
/**
* 养老
*/
@Schema(description = "养老" )
@ExcelAttribute(name = "养老" )
@ExcelProperty("养老")
private String insuranceTypeOne;
/**
* 失业
*/
@Schema(description = "失业" )
@ExcelAttribute(name = "失业" )
@ExcelProperty("失业")
private String insuranceTypeTwo;
/**
* 医疗
*/
@Schema(description = "医疗" )
@ExcelAttribute(name = "医疗" )
@ExcelProperty("医疗")
private String insuranceTypeThree;
/**
* 工伤
*/
@Schema(description = "工伤" )
@ExcelAttribute(name = "工伤" )
@ExcelProperty("工伤")
private String insuranceTypeFour;
/**
* 生育
*/
@Schema(description = "生育" )
@ExcelAttribute(name = "生育" )
@ExcelProperty("生育")
private String insuranceTypeFive;
/**
* 月工资收入(元)
*/
@Schema(description = "月工资收入(元)" )
@ExcelAttribute(name = "月工资收入(元)" )
@ExcelProperty("月工资收入(元)")
private BigDecimal persionCardinal;
/**
* 补缴保险属期
*/
@Schema(description = "补缴保险属期" )
@ExcelAttribute(name = "补缴保险属期" )
@ExcelProperty("补缴保险属期")
private String dateOne;
/**
* 户籍所在地
*/
@Schema(description = "户籍所在地")
@ExcelAttribute(name = "户籍所在地" )
@ExcelProperty("户籍所在地")
private String contactAddress;
/**
* 学历
*/
@Schema(description = "备注")
@ExcelAttribute(name = "备注" )
@ExcelProperty("备注")
private String remark;
}
......@@ -774,6 +774,28 @@ public class TDispatchInfoController {
searchVo.setAuthSql(searchVo.getAuthSql().replace(CommonConstants.A_DEPT_ID, "a.SETTLE_DOMAIN"));
}
searchVo.setCreateBy(user.getId());
tDispatchInfoService.doexportFundRecordChange(response, searchVo.getIdStr(),searchVo);
tDispatchInfoService.doexportSocialRecordNew(response,searchVo);
}
/**
* @Author huyc
* @Description 导出 导出三险花名册
* @Date 14:01 2023/7/20
* @Param
* @return
**/
@PostMapping("/doexportPensionInfo")
@Operation(description = "导出三险花名册")
@SysLog("导出三险花名册")
@PreAuthorize("@pms.hasPermission('wxhr:tdispatchinfo_doexportFundRecordChange')")
public void doexportPensionInfo(HttpServletResponse response, HttpServletRequest request,
@RequestBody SocialHandleSearchVo searchVo) {
YifuUser user = SecurityUtils.getUser();
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, "a.SETTLE_DOMAIN"));
}
searchVo.setCreateBy(user.getId());
tDispatchInfoService.doexportSocialPensionRecord(response,searchVo);
}
}
......@@ -154,6 +154,42 @@ public interface TDispatchInfoMapper extends BaseMapper<TDispatchInfo> {
int getFundRecordCount(@Param("tDispatchInfo") SocialHandleSearchVo dispatchInfo,
@Param("idsStr") List<String> idsStr);
/**
* @Author huyc
* @Description 社保派单医保模版count
* @Date 15:47 2023/7/18
* @Param
* @return
**/
int getSocialDisRecordCount(@Param("tDispatchInfo") SocialHandleSearchVo dispatchInfo);
/**
* @Author huyc
* @Description 社保派单医保模版
* @Date 15:47 2023/7/18
* @Param
* @return
**/
List<TDispatchSocialExportVo> getSocialDisRecord(@Param("tDispatchInfo") SocialHandleSearchVo dispatchInfo);
/**
* @Author huyc
* @Description 社保派单养老模版count
* @Date 15:47 2023/7/18
* @Param
* @return
**/
int getSocialPersionDisCount(@Param("tDispatchInfo") SocialHandleSearchVo dispatchInfo);
/**
* @Author huyc
* @Description 社保派单养老模版
* @Date 15:47 2023/7/18
* @Param
* @return
**/
List<TDispatchSocialPersionExportVo> getSocialPersionDisRecord(@Param("tDispatchInfo") SocialHandleSearchVo dispatchInfo);
List<FundHandleExportVo> getFundRecordList(@Param("tDispatchInfo") SocialHandleSearchVo dispatchInfo,
@Param("idsStr") List<String> idsStr);
/**
......
......@@ -93,6 +93,10 @@ public interface TDispatchInfoService extends IService<TDispatchInfo> {
void doexportFundRecordChange(HttpServletResponse response,String idStr, SocialHandleSearchVo searchVo);
void doexportSocialRecordNew(HttpServletResponse response, SocialHandleSearchVo searchVo);
void doexportSocialPensionRecord(HttpServletResponse response, SocialHandleSearchVo searchVo);
/**
* 获取社保和公积金派减日期
* @Author hgw
......
......@@ -24,12 +24,14 @@ import com.alibaba.excel.read.listener.ReadListener;
import com.alibaba.excel.read.metadata.holder.ReadRowHolder;
import com.alibaba.excel.util.ListUtils;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.excel.write.metadata.WriteTable;
import com.baomidou.lock.annotation.Lock4j;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.google.common.collect.Lists;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysArea;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.AllUserNaVo;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.AreaVo;
......@@ -2848,6 +2850,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
//批量派减:校验待派减人员五险一金缴纳情况,若有公积金未派减,则会显示社保已派减,公积金未派减,并弹窗提示有派减失败数据,可同步导出派减数据表单
//flag为1时 单独派减社保时校验公积金是否可用
if (Common.isNotNull(flag) && CommonConstants.ONE_STRING.equals(flag)) {
List<ErrorMessage> errorMessageList1 = new ArrayList<>();
for (int i = 0; i < excelVOList.size(); i++) {
socialFund = null;
excel = excelVOList.get(i);
......@@ -2863,10 +2866,12 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
|| CommonConstants.ONE_STRING.equals(socialFund.getFundStatus())
|| CommonConstants.FIVE_STRING.equals(socialFund.getFundStatus())
|| CommonConstants.SIX_STRING.equals(socialFund.getFundStatus()))) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SIGNLE_REDUCE), CommonConstants.RED, CommonConstants.ONE_STRING));
errorMessageList1.add(new ErrorMessage(excel.getRowIndex(), excel.getEmpIdcard() + "-" +excel.getEmpName(), CommonConstants.RED, CommonConstants.ONE_STRING));
}
}
if (!errorMessageList.isEmpty() && errorMessageList.stream().anyMatch(e -> CommonConstants.ONE_STRING.equals(e.getName()))) {
if (!errorMessageList1.isEmpty() && errorMessageList1.stream().anyMatch(e -> CommonConstants.ONE_STRING.equals(e.getName()))) {
errorMessageList.clear();
errorMessageList.addAll(errorMessageList1);
return;
}
}
......@@ -2891,6 +2896,10 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if (Common.isNotNull(socialFundMap)){
socialFund = socialFundMap.get(excel.getEmpIdcard());
}
if (Common.isEmpty(excel.getReasonType())){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), "减少原因不能为空"));
continue;
}
if (Common.isEmpty(setInfoVo)){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_PROJECT_NOT_FOUND)));
continue;
......@@ -5072,6 +5081,298 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
}
}
/**
* @Author huyc
* @Description 导出社保派单花名册
* @Date 10:05 2023/7/18
* @Param
* @return
**/
@Override
public void doexportSocialRecordNew(HttpServletResponse response,SocialHandleSearchVo searchVo) {
String fileName = DispatchConstants.SOCIAL_MEDICAL_EXPORT + DateUtil.getThisTime() + CommonConstants.XLSX;
//获取要导出的列表
List<TDispatchSocialExportVo> list = new ArrayList<>();
try (ServletOutputStream out = response.getOutputStream()){
response.setContentType(CommonConstants.MULTIPART_FORM_DATA);
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName , CommonConstants.UTF8));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter excelWriter = EasyExcel.write(out, TDispatchSocialExportVo.class).build();
WriteSheet writeSheet;
WriteTable writeTable0;
WriteTable writeTable1;
TDispatchSocialExportVo vo;
//派增的数据
searchVo.setType(CommonConstants.ZERO_STRING);
long count = getSocialDisRecordCount(searchVo);
if (count > CommonConstants.ZERO_INT){
list = getSocialDisRecord(searchVo);
if (Common.isNotNull(list)) {
//判断list的大小是否大于10
if (list.size() < 10) {
int size = 10 - list.size();
for (int i =1;i<= size;i++) {
vo = new TDispatchSocialExportVo();
vo.setNum(list.size() + i);
list.add(vo);
}
}
writeSheet = EasyExcel.writerSheet("增员").needHead(Boolean.FALSE).build();
writeTable0 = EasyExcel.writerTable(0).head(head(searchVo.getSocialHouseholdName(),searchVo.getCustomerNo())).build();
writeTable1 = EasyExcel.writerTable(1).head(head1()).build();
// 第一次写入会创建头
excelWriter.write(list, writeSheet, writeTable0);
// 第二次写如也会创建头,然后在第一次的后面写入数据
excelWriter.write(new ArrayList<>(), writeSheet, writeTable1);
}
} else {
writeSheet = EasyExcel.writerSheet("增员").build();
excelWriter.write(list,writeSheet);
}
//派减的数据
searchVo.setType(CommonConstants.ONE_STRING);
long count1 = getSocialDisRecordCount(searchVo);
if (count1 > CommonConstants.ZERO_INT){
list = getSocialDisRecord(searchVo);
if (Common.isNotNull(list)) {
//判断list的大小是否大于10
if (list.size() < 10) {
int size = 10 - list.size();
for (int i =1;i<= size;i++) {
vo = new TDispatchSocialExportVo();
vo.setNum(list.size() + i);
list.add(vo);
}
}
writeSheet = EasyExcel.writerSheet("减员").needHead(Boolean.FALSE).build();
writeTable0 = EasyExcel.writerTable(0).head(head(searchVo.getSocialHouseholdName(),searchVo.getCustomerNo())).build();
writeTable1 = EasyExcel.writerTable(1).head(head1()).build();
// 第一次写入会创建头
excelWriter.write(list, writeSheet, writeTable0);
// 第二次写如也会创建头,然后在第一次的后面写入数据
excelWriter.write(new ArrayList<>(), writeSheet, writeTable1);
}
} else {
writeSheet = EasyExcel.writerSheet("减员").build();
excelWriter.write(list,writeSheet);
}
excelWriter.finish();
}catch (Exception e){
log.error("执行异常" ,e);
}
}
/**
* @Author huyc
* @Description 导出社保派单花名册
* @Date 14:05 2023/7/20
* @Param
* @return
**/
@Override
public void doexportSocialPensionRecord(HttpServletResponse response,SocialHandleSearchVo searchVo) {
String fileName = DispatchConstants.SOCIAL_PERSION_EXPORT + DateUtil.getThisTime() + CommonConstants.XLSX;
//获取要导出的列表
List<TDispatchSocialPersionExportVo> list = new ArrayList<>();
try (ServletOutputStream out = response.getOutputStream()){
response.setContentType(CommonConstants.MULTIPART_FORM_DATA);
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName , CommonConstants.UTF8));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter excelWriter = EasyExcel.write(out, TDispatchSocialPersionExportVo.class).build();
WriteSheet writeSheet;
WriteTable writeTable0;
WriteTable writeTable1;
TDispatchSocialPersionExportVo vo;
//派增的数据
searchVo.setType(CommonConstants.ZERO_STRING);
long count = getSocialPersionDisCount(searchVo);
if (count > CommonConstants.ZERO_INT){
list = getSocialPersionDisRecord(searchVo);
if (Common.isNotNull(list)) {
//判断list的大小是否大于10
if (list.size() < 10) {
int size = 10 - list.size();
for (int i =1;i<= size;i++) {
vo = new TDispatchSocialPersionExportVo();
vo.setNum(list.size() + i);
list.add(vo);
}
}
writeSheet = EasyExcel.writerSheet("增员").needHead(Boolean.FALSE).build();
writeTable0 = EasyExcel.writerTable(0).head(persionHead(searchVo.getSocialHouseholdName(),searchVo.getCustomerNo())).build();
writeTable1 = EasyExcel.writerTable(1).head(persionHead1()).build();
// 第一次写入会创建头
excelWriter.write(list, writeSheet, writeTable0);
// 第二次写如也会创建头,然后在第一次的后面写入数据
excelWriter.write(new ArrayList<>(), writeSheet, writeTable1);
}
} else {
writeSheet = EasyExcel.writerSheet("增员").build();
excelWriter.write(list,writeSheet);
}
//派减的数据
searchVo.setType(CommonConstants.ONE_STRING);
long count1 = getSocialPersionDisCount(searchVo);
if (count1 > CommonConstants.ZERO_INT){
list = getSocialPersionDisRecord(searchVo);
if (Common.isNotNull(list)) {
//判断list的大小是否大于10
if (list.size() < 10) {
int size = 10 - list.size();
for (int i =1;i<= size;i++) {
vo = new TDispatchSocialPersionExportVo();
vo.setNum(list.size() + i);
list.add(vo);
}
}
writeSheet = EasyExcel.writerSheet("减员").needHead(Boolean.FALSE).build();
writeTable0 = EasyExcel.writerTable(0).head(persionHead(searchVo.getSocialHouseholdName(),searchVo.getCustomerNo())).build();
writeTable1 = EasyExcel.writerTable(1).head(persionHead1()).build();
// 第一次写入会创建头
excelWriter.write(list, writeSheet, writeTable0);
// 第二次写如也会创建头,然后在第一次的后面写入数据
excelWriter.write(new ArrayList<>(), writeSheet, writeTable1);
}
} else {
writeSheet = EasyExcel.writerSheet("减员").build();
excelWriter.write(list,writeSheet);
}
excelWriter.finish();
}catch (Exception e){
log.error("执行异常" ,e);
}
}
/**
* @Author huyc
* @Description 导出社保派单花名册
* @Date 09:05 2023/7/19
* @return
*/
public List<List<String>> head(String houseName,String cusNo) {
List<List<String>> list = new ArrayList<>();
//表头数据
String a="合肥市基本医疗保险参保登记表";
String b="单位名称(盖章): " + houseName + " 单位统一信用代码:" + cusNo;
String c="人员类型: □√单位职工 □灵活就业人员";
String d="变更类别";
//第一列
list.add( Lists.newArrayList(a,b,c,"序号","序号"));
//第二列
list.add( Lists.newArrayList(a,b,c,"姓名","姓名"));
//第三列
list.add( Lists.newArrayList(a,b,c,"身份证件类型","身份证件类型"));
//第四列
list.add( Lists.newArrayList(a,b,c,"身份证件号码","身份证件号码"));
//第五列
list.add( Lists.newArrayList(a,b,c,"参报/停保时间","参报/停保时间"));
//第六列
list.add( Lists.newArrayList(a,b,c,"申报工资(元)","申报工资(元)"));
//变更类别
List<String> orderSpeaces = Lists.newArrayList("新增","续保","中断","终止");
orderSpeaces.forEach(e->{
list.add( Lists.newArrayList(a,b,c,d ,e) );
});
//第十一列
list.add( Lists.newArrayList(a,b,c,"手机号码","手机号码"));
//第十二列
list.add( Lists.newArrayList(a,b,c,"学历","学历"));
//第十三列
list.add( Lists.newArrayList(a,b,c,"备注","备注"));
return list;
}
/**
* @Author huyc
* @Description 导出社保派单花名册
* @Date 09:05 2023/7/19
* @return
*/
public List<List<String>> head1() {
List<List<String>> list = new ArrayList<>();
//表头数据
String a = "备注: 1.身份证类型填写:身份证、护照、港澳台通行证等; \n" +
"2.增加人员勾选新增或续保,减少人员勾选中断或终止,按相应类型进行勾选;\n" +
"3.联系电话务必填写准确的手机号码;\n";
String b="填报人: 联系电话: 经办人(盖章): " +
DateUtil.getYear(DateUtil.getCurrentDateTime())+ " 年" + " " +
DateUtil.getMonth(DateUtil.getCurrentDateTime()) +" 月" + " " +
DateUtil.getDay(DateUtil.getCurrentDateTime()) + " 日";
//第一列
list.add(Lists.newArrayList(a,b));
return list;
}
/**
* @Author huyc
* @Description 导出社保派单花名册
* @Date 09:05 2023/7/21
* @return
*/
public List<List<String>> persionHead(String houseName,String cusNo) {
List<List<String>> list = new ArrayList<>();
//表头数据
String a="职 工 社 会 保 险 增 加 花 名 册";
String b="单位名称(签章): " + houseName + " 单位编码:" + cusNo;
String c="参加保险险种";
//第一列
list.add( Lists.newArrayList(a,b,"序号","序号"));
//第二列
list.add( Lists.newArrayList(a,b,"姓名","姓名"));
//第三列
list.add( Lists.newArrayList(a,b,"职工编码","职工编码"));
//第四列
list.add( Lists.newArrayList(a,b,"社会保障号码(身份证号码)","社会保障号码(身份证号码)"));
//第五列
list.add( Lists.newArrayList(a,b,"性别","性别"));
//第六列
list.add( Lists.newArrayList(a,b,"民族","民族"));
//第七列
list.add( Lists.newArrayList(a,b,"参加工作时间","参加工作时间"));
//第八列
list.add( Lists.newArrayList(a,b,"户口性质","户口性质"));
//第九列
list.add( Lists.newArrayList(a,b,"个人身份","个人身份"));
//参加保险险种
List<String> orderSpeaces = Lists.newArrayList("养老","失业","医疗","工伤","生育");
orderSpeaces.forEach(e->{
list.add( Lists.newArrayList(a,b,c,e) );
});
//第十五列
list.add( Lists.newArrayList(a,b,"月工资收入(元)","月工资收入(元)"));
//第十六列
list.add( Lists.newArrayList(a,b,"补缴保险属期","补缴保险属期"));
//第十七列
list.add( Lists.newArrayList(a,b,"户籍所在地","户籍所在地"));
//第十八列
list.add( Lists.newArrayList(a,b,"备注","备注"));
return list;
}
/**
* @Author huyc
* @Description 导出社保派单花名册
* @Date 11:12 2023/7/21
* @return
*/
public List<List<String>> persionHead1() {
List<List<String>> list = new ArrayList<>();
//表头数据
String a = "1、“户口性质”栏按下列类别填写:非农业户口(城镇)、本地非农业户口(本地城镇)、外地非农业户口(外地城镇)、农业户口(农村)、 \n" +
" 本地农业户口(本地农村)、外地农业户口(外地农村)、港澳台、外籍 \n" +
"2、“个人身份”栏按下列类别填写:“企业职工”、“国家公务员”、“事业单位在编人员”、“编外人员”、“现役军人”、“协保人员”、“公益性岗位”“农民工医保” \n" +
"3、“参加保险险种”栏可对应选项打“√” \n" +
"4、新增人员(含断保再次缴费人员),个人月工资收入按起薪工资额申报。\n" +
"5、补缴时段超过3个月的,缴费基数为历年安徽省社平工资,同时加征利息(含参保当月的缴费基数)。\n" +
"6、如属军队退役人员或劳模人员在备注栏中填写,“退役军人类别”栏按下列类别填写:军队转业干部、计划分配的军队转业干部、自主择业的军队转业干部、退伍复员军人、转业复员士官、退伍 \n" +
"义务兵(含伤病残义务兵)、复员干部,“劳模级别”栏按下列类别填写:国家级、省(自治区、直辖市)级、部(委)级、地(市、厅、局)级、其他 \n" +
"7、本表需填制一式两份,经办机构审核盖章后方可有效,一份单位自存,一份报市社会保险经办机构。";
String b="填报人: 单位联系电话: 社保经办机构审核人: " + "填报日期: " + DateUtil.getYear(DateUtil.getCurrentDateTime())+ " 年" + " " + DateUtil.getMonth(DateUtil.getCurrentDateTime()) +" 月" + " " + DateUtil.getDay(DateUtil.getCurrentDateTime()) + " 日";
//第一列
list.add(Lists.newArrayList(a,b));
return list;
}
private List<FundHandleExportVo> getFundRecordList(SocialHandleSearchVo searchVo, String idStr) {
return baseMapper.getFundRecordList(searchVo,Common.getList(idStr));
}
......@@ -5084,6 +5385,22 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
return baseMapper.getFundRecordCount(searchVo,Common.getList(idStr));
}
private long getSocialDisRecordCount(SocialHandleSearchVo searchVo) {
return baseMapper.getSocialDisRecordCount(searchVo);
}
private List<TDispatchSocialExportVo> getSocialDisRecord(SocialHandleSearchVo searchVo) {
return baseMapper.getSocialDisRecord(searchVo);
}
private long getSocialPersionDisCount(SocialHandleSearchVo searchVo) {
return baseMapper.getSocialPersionDisCount(searchVo);
}
private List<TDispatchSocialPersionExportVo> getSocialPersionDisRecord(SocialHandleSearchVo searchVo) {
return baseMapper.getSocialPersionDisRecord(searchVo);
}
/**
* @param socialFundInfo
* @Description: 获取最小起缴日
......@@ -5163,6 +5480,9 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if (!errorMessageList.isEmpty() && errorMessageList.stream().noneMatch(e-> e.getColor().equals(CommonConstants.RED))) {
return R.ok();
}
if (!errorMessageList.isEmpty() && errorMessageList.stream().anyMatch(e -> CommonConstants.ONE_STRING.equals(e.getName()))) {
return R.ok(errorMessageList,"error");
}
return R.ok(errorMessageList);
}
......
......@@ -55,6 +55,8 @@
<id property="id" column="ID"/>
<result property="name" column="NAME"/>
<result property="type" column="TYPE"/>
<result property="customerNo" column="CUSTOMER_NO"/>
<result property="unitCreditCode" column="UNIT_CREDIT_CODE"/>
</resultMap>
<sql id="Base_Column_List">
......@@ -150,6 +152,8 @@
SELECT
a.ID,
a.TYPE,
a.CUSTOMER_NO,
a.UNIT_CREDIT_CODE,
a.NAME
FROM sys_house_hold_info a
where HOUSE_TYPE = '0'
......
......@@ -175,6 +175,43 @@
<result property="empName" column="EMP_NAME"/>
</resultMap>
<resultMap id="socialDisExportMap" type="com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchSocialExportVo">
<result property="num" column="NUM"/>
<result property="empIdcard" column="EMP_IDCARD"/>
<result property="idcardType" column="IDCARD_TYPE"/>
<result property="empName" column="EMP_NAME"/>
<result property="medicalCardinal" column="MEDICAL_CARDINAL"/>
<result property="empMobile" column="EMP_MOBILE"/>
<result property="educationName" column="EDUCATION_NAME"/>
<result property="disMonth" column="DIS_MONTH"/>
<result property="changeTypeOne" column="CHANGE_TYPE_ONE"/>
<result property="changeTypeTwo" column="CHANGE_TYPE_TWO"/>
<result property="changeTypeThree" column="CHANGE_TYPE_THREE"/>
<result property="changeTypeFour" column="CHANGE_TYPE_FOUR"/>
<result property="remark" column="REMARK"/>
</resultMap>
<resultMap id="socialPersionDisExportMap" type="com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchSocialPersionExportVo">
<result property="num" column="num"/>
<result property="empIdcard" column="EMP_IDCARD"/>
<result property="empNo" column="EMP_NO"/>
<result property="empName" column="EMP_NAME"/>
<result property="sex" column="sex"/>
<result property="empNational" column="EMP_NATIONAL"/>
<result property="workDate" column="WORK_DATE"/>
<result property="type" column="type"/>
<result property="signleType" column="SIGNLE_TYPE"/>
<result property="insuranceTypeOne" column="INSURANCE_TYPE_ONE"/>
<result property="insuranceTypeTwo" column="INSURANCE_TYPE_TWO"/>
<result property="insuranceTypeThree" column="INSURANCE_TYPE_THREE"/>
<result property="insuranceTypeFour" column="INSURANCE_TYPE_FOUR"/>
<result property="insuranceTypeFive" column="INSURANCE_TYPE_FIVE"/>
<result property="persionCardinal" column="PERSION_CARDINAL"/>
<result property="dateOne" column="DATE_ONE"/>
<result property="contactAddress" column="CONTRACT_ADRESS"/>
<result property="remark" column="REMARK"/>
</resultMap>
<!-- 派单审核导出vo -->
<resultMap id="exportAuditMap" type="com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchAuditExportVo">
<result property="empName" column="EMP_NAME"/>
......@@ -1148,6 +1185,83 @@
order by a.APPLY_NO desc
</where>) a
</select>
<!--tDispatchInfo 社保花名册派单数据count-->
<select id="getSocialDisRecordCount" resultType="java.lang.Integer">
SELECT
count(1)
FROM t_dispatch_info a
<where>
<include refid="where_getSocialDisRecord"/>
</where>
</select>
<!--tDispatchInfo 社保医疗花名册派单数据-->
<select id="getSocialDisRecord" resultMap="socialDisExportMap">
SELECT
(@i :=@i+1) as NUM,
a.EMP_NAME,
'身份证' as IDCARD_TYPE,
a.EMP_IDCARD,
replace(DATE_FORMAT(a.CREATE_TIME,"%Y-%m"),'-','') as DIS_MONTH,
s.UNIT_MEDICAL_CARDINAL as MEDICAL_CARDINAL,
'' as CHANGE_TYPE_ONE,
'√' as CHANGE_TYPE_TWO,
'' as CHANGE_TYPE_THREE,
'' as CHANGE_TYPE_FOUR,
a.EMP_MOBILE,
a.EDUCATION_NAME,
a.EMP_MOBILE as REMARK
FROM t_dispatch_info a
left join t_social_info s on s.id=a.SOCIAL_ID
,(select @i:=0) as itable
<where>
<include refid="where_getSocialDisRecord"/>
</where>
</select>
<!--tDispatchInfo 社保养老花名册派单数据-->
<select id="getSocialPersionDisCount" resultType="java.lang.Integer">
SELECT count(1)
FROM t_dispatch_info a
<where>
<include refid="where_getSocialPersionDisRecord"/>
</where>
</select>
<!--tDispatchInfo 社保养老花名册派单数据-->
<select id="getSocialPersionDisRecord" resultMap="socialPersionDisExportMap">
SELECT
(@i :=@i+1) as num,
a.EMP_NAME,
a.EMP_NO,
a.EMP_IDCARD,
CASE (SUBSTR(a.EMP_IDCARD,17,1)%2)
WHEN 1 THEN '男'
WHEN 0 THEN '女'
END sex,
a.EMP_NATIONAL,
concat(ifnull(DATE_FORMAT(a.CONTRACT_START,"%Y%m%d"),''),'-',ifnull(DATE_FORMAT(a.CONTRACT_END,"%Y%m%d"),'')) as WORK_DATE,
'非农业户口(城镇)' as type,
'企业职工' as SIGNLE_TYPE,
'√' as INSURANCE_TYPE_ONE,
'√' as INSURANCE_TYPE_TWO,
'' as INSURANCE_TYPE_THREE,
'√' as INSURANCE_TYPE_FOUR,
'' as INSURANCE_TYPE_FIVE,
s.RECORD_BASE as PERSION_CARDINAL,
s.UNIT_MEDICAL_CARDINAL as MEDICAL_CARDINAL,
concat(ifnull(DATE_FORMAT(a.CONTRACT_START,"%Y%m%d"),''),'-',ifnull(DATE_FORMAT(a.CONTRACT_END,"%Y%m%d"),'')) as DATE_ONE,
'安徽省合肥市' as CONTRACT_START,
a.EMP_MOBILE as REMARK
FROM t_dispatch_info a
left join t_social_info s on s.id=a.SOCIAL_ID
,(select @i:=0) as itable
<where>
<include refid="where_getSocialPersionDisRecord"/>
</where>
</select>
<!--tDispatchInfo 公积金变更清册查询-->
<select id="getFundRecordList" resultMap="fundHandleMap">
SELECT
......@@ -1561,6 +1675,61 @@
</if>
</sql>
<sql id="where_getSocialDisRecord">
a.DELETE_FLAG = 0
AND a.social_id is not null
AND a.STATUS = "2"
AND a.DISPATCH_ITEM like concat('%','医疗','%')
<if test="tDispatchInfo != null">
<if test="tDispatchInfo.socialHouseholdName != null and tDispatchInfo.socialHouseholdName.trim() != ''">
AND a.SOCIAL_HOUSEHOLD_NAME = #{tDispatchInfo.socialHouseholdName}
</if>
<if test="tDispatchInfo.type != null and tDispatchInfo.type.trim() != ''">
AND a.TYPE = #{tDispatchInfo.type}
</if>
<if test="tDispatchInfo.socialHouseholdName != null and tDispatchInfo.socialHouseholdName.trim() != ''">
AND a.SOCIAL_HOUSEHOLD_NAME = #{tDispatchInfo.socialHouseholdName}
</if>
<if test="tDispatchInfo.disMonth != null and tDispatchInfo.disMonth.trim() != ''">
AND replace(DATE_FORMAT(a.CREATE_TIME,"%Y-%m"),'-','') = #{tDispatchInfo.disMonth}
</if>
<if test="tDispatchInfo.socialHandleStatus != null and tDispatchInfo.socialHandleStatus.trim() != ''">
AND a.SOCIAL_HANDLE_STATUS = #{tDispatchInfo.socialHandleStatus}
</if>
<if test="tDispatchInfo.authSql != null and tDispatchInfo.authSql.trim() != ''">
${tDispatchInfo.authSql}
</if>
</if>
</sql>
<sql id="where_getSocialPersionDisRecord">
a.DELETE_FLAG = 0
AND a.social_id is not null
AND a.STATUS = "2"
AND (a.DISPATCH_ITEM like concat('%','工伤','%') or a.DISPATCH_ITEM like concat('%','养老','%'))
<if test="tDispatchInfo != null">
<if test="tDispatchInfo.socialHouseholdName != null and tDispatchInfo.socialHouseholdName.trim() != ''">
AND a.SOCIAL_HOUSEHOLD_NAME = #{tDispatchInfo.socialHouseholdName}
</if>
<if test="tDispatchInfo.type != null and tDispatchInfo.type.trim() != ''">
AND a.TYPE = #{tDispatchInfo.type}
</if>
<if test="tDispatchInfo.socialHouseholdName != null and tDispatchInfo.socialHouseholdName.trim() != ''">
AND a.SOCIAL_HOUSEHOLD_NAME = #{tDispatchInfo.socialHouseholdName}
</if>
<if test="tDispatchInfo.disMonth != null and tDispatchInfo.disMonth.trim() != ''">
AND replace(DATE_FORMAT(a.CREATE_TIME,"%Y-%m"),'-','') = #{tDispatchInfo.disMonth}
</if>
<if test="tDispatchInfo.socialHandleStatus != null and tDispatchInfo.socialHandleStatus.trim() != ''">
AND a.SOCIAL_HANDLE_STATUS = #{tDispatchInfo.socialHandleStatus}
</if>
<if test="tDispatchInfo.authSql != null and tDispatchInfo.authSql.trim() != ''">
${tDispatchInfo.authSql}
</if>
</if>
</sql>
<!-- 获取当日最大的编码 -->
<select id="getMaxDispatchCode" resultType="java.lang.String">
SELECT ifnull(max(right(e.APPLY_NO,4)),0) APPLY_NO FROM t_dispatch_info e where e.DELETE_FLAG = 0 and e.CREATE_TIME>DATE_FORMAT(now(),'%Y-%m-%d')
......
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