Commit 03a3738e authored by huyuchen's avatar huyuchen

优化修改

parent 117f2673
......@@ -555,4 +555,16 @@ public interface ErrorCodes {
* 公积金办理:办理失败,失败原因必填
*/
String FUND_IMPORT_HANDLE_REASON_NOT_EMPY = "fund_import_handle_reason_not_empty";
/**
* 社保办理:任一险种办理失败,失败原因必填
*/
String SOCIAL_IMPORT_HANDLE_REASON_NOT_EMPY = "social_import_handle_reason_not_empty";
/**
* 社保办理失败,必须办理其中一个险种
*/
String SOCIAL_IMPORT_HANDLE_NOT_EMPY = "social_import_handle_not_empty";
/**
* 社保办理:无办理权限或无可需要办理的社保数据
*/
String SOCIAL_IMPORT_HANDLE_NOT_EXITS = "social.import.handle.not.exits";
}
......@@ -218,6 +218,10 @@ fund.import.handle.not.exits=\u65E0\u529E\u7406\u6743\u9650\u6216\u65E0\u53EF\u9
fund_import_handle_reason_not_empty=\u516C\u79EF\u91D1\u529E\u7406\uFF1A\u529E\u7406\u5931\u8D25\uFF0C\u5931\u8D25\u7C7B\u578B\u5FC5\u586B
social_import_handle_reason_not_empty=\u793E\u4FDD\u529E\u7406\uFF1A\u4EFB\u4E00\u9669\u79CD\u529E\u7406\u5931\u8D25\uFF0C\u5931\u8D25\u539F\u56E0\u5FC5\u586B
social_import_handle_not_empty=\u793E\u4FDD\u529E\u7406\u5931\u8D25\uFF0C\u5FC5\u987B\u529E\u7406\u5176\u4E2D\u4E00\u4E2A\u9669\u79CD
social.import.handle.not.exits=\u65E0\u529E\u7406\u6743\u9650\u6216\u65E0\u53EF\u9700\u8981\u529E\u7406\u7684\u793E\u4FDD\u6570\u636E
......
/*
* 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.vo.RowIndex;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
/**
* 派单信息记录表
*
* @author huyc
* @date 2023-05-15 15:38:05
*/
@Data
public class SocialImportHandleVo extends RowIndex implements Serializable {
/**
* 员工姓名
*/
@ExcelAttribute(name = "员工姓名" )
@Schema(description = "员工姓名" )
@ExcelProperty("员工姓名" )
private String empName;
/**
* 身份证号
*/
@ExcelAttribute(name = "身份证号",isNotEmpty = true,errorInfo = "身份证不可为空")
@Schema(description = "身份证号" )
@ExcelProperty("身份证号" )
private String empIdcard;
/**
* 养老保险办理状态:0 成功,1失败
*/
@ExcelAttribute(name = "养老保险" ,isDataId = true,readConverterExp = "0=成功,1=失败")
@Schema(description = "养老保险办理状态:0 成功,1失败" )
@ExcelProperty("养老保险" )
private String ylHandleStatus;
/**
* 医疗保险办理状态:0 成功,1失败
*/
@ExcelAttribute(name = "医疗保险" ,isDataId = true,readConverterExp = "0=成功,1=失败")
@Schema(description = "医疗保险办理状态:0 成功,1失败" )
@ExcelProperty("医疗保险" )
private String ybHandleStatus;
/**
* 失业保险办理状态:0 成功,1失败
*/
@ExcelAttribute(name = "失业保险" ,isDataId = true,readConverterExp = "0=成功,1=失败")
@Schema(description = "失业保险办理状态:0 成功,1失败" )
@ExcelProperty("失业保险" )
private String syHandleStatus;
/**
* 工伤保险办理状态:0 成功,1失败
*/
@ExcelAttribute(name = "工伤保险" ,isDataId = true,readConverterExp = "0=成功,1=失败")
@Schema(description = "工伤保险办理状态:0 成功,1失败" )
@ExcelProperty("工伤保险" )
private String gsHandleStatus;
/**
* 生育保险办理状态:0 成功,1失败
*/
@ExcelAttribute(name = "生育保险" ,isDataId = true,readConverterExp = "0=成功,1=失败")
@Schema(description = "生育保险办理状态:0 成功,1失败" )
@ExcelProperty("生育保险" )
private String sjHandleStatus;
/**
* 大病救助办理状态:0 成功,1失败
*/
@ExcelAttribute(name = "大病救助" ,isDataId = true,readConverterExp = "0=成功,1=失败")
@Schema(description = "大病救助办理状态:0 成功,1失败" )
@ExcelProperty("大病救助" )
private String dbHandleStatus;
/**
* 办理意见
*/
@ExcelAttribute(name = "办理意见")
@Schema(description = "办理意见" )
@ExcelProperty("办理意见" )
private String remark;
/**
* 失败类型
*/
@ExcelAttribute(name = "失败类型")
@Schema(description = "失败类型" )
@ExcelProperty("失败类型" )
private String reasonType;
}
/*
* 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.alibaba.excel.annotation.write.style.HeadFontStyle;
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 java.io.Serializable;
import java.math.BigDecimal;
/**
* 缴费库查询字段
* @author huyc
* @date 2023-05-18 17:01:22
*/
@Data
public class TPaymentInfoNewVo extends RowIndex implements Serializable {
/**
* 员工姓名
*/
@ExcelAttribute(name = "员工姓名" )
@Schema(description ="员工姓名")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("员工姓名")
private String empName;
/**
* 身份证号
*/
@ExcelAttribute(name = "身份证号" )
@Schema(description ="身份证号")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("身份证号")
private String empIdcard;
/**
* 客户名称
*/
@ExcelAttribute(name = "客户名称" )
@Schema(description ="客户名称")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("客户名称")
private String unitName;
/**
* 项目名称
*/
@ExcelAttribute(name = "项目名称" )
@Schema(description ="项目名称")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("项目名称")
private String settleDomainName;
/**
* 社保户
*/
@ExcelAttribute(name = "社保户" )
@Schema(description ="社保户")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("社保户")
private String socialHousehold;
/**
* 社保编号
*/
@ExcelAttribute(name = "社保编号" )
@Schema(description ="社保编号")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("社保编号")
private String socialSecurityNo;
/**
* 社保缴纳地
*/
@ExcelAttribute(name = "社保缴纳地" )
@Schema(description ="社保缴纳地")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("社保缴纳地")
private String socialPayAddr;
/**
* 社保缴纳月份
*/
@ExcelAttribute(name = "社保缴纳月份")
@Schema(description ="社保缴纳月份")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("社保缴纳月份")
private String socialPayMonth;
/**
* 社保生成月份
*/
@ExcelAttribute(name = "社保生成月份")
@Schema(description ="社保生成月份")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("社保生成月份")
private String socialCreateMonth;
/**
* 总合计
*/
@ExcelAttribute(name = "总合计" )
@Schema(description ="总合计")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("总合计")
private BigDecimal sumAll;
/**
* 公积金缴纳月份
*/
@ExcelAttribute(name = "公积金缴纳月份")
@Schema(description ="公积金缴纳月份")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("公积金缴纳月份")
private String providentPayMonth;
/**
* 公积金生成月份
*/
@ExcelAttribute(name = "公积金生成月份")
@Schema(description ="公积金生成月份")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("公积金生成月份")
private String providentCreateMonth;
/**
* 公积金户
*/
@ExcelAttribute(name = "公积金户" )
@Schema(description ="公积金户")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("公积金户")
private String providentHousehold;
/**
* 公积金缴纳地
*/
@ExcelAttribute(name = "公积金缴纳地" )
@Schema(description ="公积金缴纳地")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("公积金缴纳地")
private String providentPayAddr;
/**
* 社保合计
*/
@ExcelAttribute(name = "社保合计" )
@Schema(description ="社保合计")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("社保合计")
private BigDecimal socialSum;
/**
* 单位社保合计
*/
@ExcelAttribute(name = "单位社保合计" )
@Schema(description ="单位社保合计")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("单位社保合计")
private BigDecimal unitSocialSum;
/**
* 个人社保合计
*/
@ExcelAttribute(name = "个人社保合计" )
@Schema(description ="个人社保合计")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("个人社保合计")
private BigDecimal socialSecurityPersonalSum;
/**
* 公积金总合计
*/
@ExcelAttribute(name = "公积金总合计" )
@Schema(description ="公积金总合计")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("公积金总合计")
private BigDecimal providentSum;
/**
* 单位社保补缴利息
*/
@ExcelAttribute(name = "单位社保补缴利息" )
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("单位社保补缴利息")
private BigDecimal companyAccrual;
/**
* 个人社保补缴利息
*/
@ExcelAttribute(name = "个人社保补缴利息" )
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("个人社保补缴利息")
private BigDecimal personalAccrual;
/**
* 单位养老基数
*/
@ExcelAttribute(name = "单位养老基数")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("单位养老基数")
private BigDecimal unitPensionSet;
/**
* 单位医疗基数
*/
@ExcelAttribute(name = "单位医疗基数")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("单位医疗基数")
private BigDecimal unitMedicalSet;
/**
* 单位失业基数
*/
@ExcelAttribute(name = "单位失业基数")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("单位失业基数")
private BigDecimal unitUnemploymentSet;
/**
* 单位工伤基数
*/
@ExcelAttribute(name = "单位工伤基数")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("单位工伤基数")
private BigDecimal unitInjurySet;
/**
* 单位生育基数
*/
@ExcelAttribute(name = "单位生育基数")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("单位生育基数")
private BigDecimal unitBirthSet;
/**
* 单位养老金额
*/
@ExcelAttribute(name = "单位养老金额")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("单位养老金额")
private BigDecimal unitPensionMoney;
/**
* 单位医疗金额
*/
@ExcelAttribute(name = "单位医疗金额")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("单位医疗金额")
private BigDecimal unitMedicalMoney;
/**
* 单位失业金额
*/
@ExcelAttribute(name = "单位失业金额")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("单位失业金额")
private BigDecimal unitUnemploymentMoney;
/**
* 单位工伤金额
*/
@ExcelAttribute(name = "单位工伤金额")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("单位工伤金额")
private BigDecimal unitInjuryMoney;
/**
* 单位生育金额
*/
@ExcelAttribute(name = "单位生育金额")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("单位生育金额")
private BigDecimal unitBirthMoney;
/**
* 单位大病金额
*/
@ExcelAttribute(name = "单位大病金额")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("单位大病金额")
private BigDecimal unitBigmailmentMoney;
/**
* 个人养老金额
*/
@ExcelAttribute(name = "个人养老金额")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("个人养老金额")
private BigDecimal personalPensionMoney;
/**
* 个人医疗金额
*/
@ExcelAttribute(name = "个人医疗金额")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("个人医疗金额")
private BigDecimal personalMedicalMoney;
/**
* 个人失业金额
*/
@ExcelAttribute(name = "个人失业金额")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("个人失业金额")
private BigDecimal personalUnemploymentMoney;
/**
* 个人大病金额
*/
@ExcelAttribute(name = "个人大病金额")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("个人大病金额")
private BigDecimal personalBigmailmentMoney;
/**
* 公积金编号
*/
@ExcelAttribute(name = "公积金编号")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("公积金编号")
private String providentNo;
/**
* 单位公积金基数
*/
@ExcelAttribute(name = "单位公积金基数")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("单位公积金基数")
private BigDecimal unitProvidentSet;
/**
* 单位公积金比例
*/
@ExcelAttribute(name = "单位公积金比例")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("单位公积金比例")
private BigDecimal providentPercent;
/**
* 单位公积金费用
*/
@ExcelAttribute(name = "单位公积金费用")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("单位公积金费用")
private BigDecimal unitProvidentSum;
/**
* 个人公积金基数
*/
@ExcelAttribute(name = "个人公积金基数")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("个人公积金基数")
private BigDecimal personalProidentSet;
/**
* 个人公积金费用
*/
@ExcelAttribute(name = "个人公积金费用")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("个人公积金费用")
private BigDecimal personalProvidentSum;
/**
* 分组键
*/
@ExcelAttribute(name = "分组键", isExport = false)
@Schema(description = "分组键")
private String keyGroup;
}
......@@ -503,6 +503,41 @@ public class TDispatchInfoController {
return tDispatchInfoService.addApplyHandle(idList,typeSub,handleStatus,handleRemark,socialType,remark);
}
/**
* 社保批量办理导入
* @author huyc
* @date 2023-05-15 11:38:05
**/
@SneakyThrows
@Operation(description = "社保批量办理导入")
@SysLog("社保批量办理导入")
@PostMapping("/importSocialHandler")
public R<List<ErrorMessage>> importSocialHandler(@RequestBody MultipartFile file){
YifuUser user = SecurityUtils.getUser();
if (Common.isEmpty(user)){
return R.failed(CommonConstants.USER_FAIL);
}
// 获取redis分布式事务锁
String key = CacheConstants.PAYMENT_DISPATCH_BATCH_ADD_IMPORT + CommonConstants.DOWN_LINE_STRING + user.getId();
String requestId;
try {
requestId = RedisDistributedLock.getLock(key,"10");
} catch (Exception e) {
throw new RuntimeException(ResultConstants.NO_GETLOCK_DATA+CommonConstants.DOWN_LINE_STRING+e.getMessage());
}
try {
if (Common.isNotNull(requestId)) {
//主动释放锁
return tDispatchInfoService.importSocialHandler(file.getInputStream());
} else {
return R.failed(ResultConstants.NO_GETLOCK_DATA);
}
}finally {
//主动释放锁
RedisDistributedLock.unlock(key, requestId);
}
}
/**
* @Author fxj
* @Description 导出 社保花名册
......
......@@ -284,8 +284,7 @@ public class TForecastLibraryController {
**/
@Operation(summary = "定时任务推送社保预估明细的数据", description = "定时任务推送社保预估明细的数据")
@SysLog("定时任务推送社保预估明细的数据")
@Inner
@PostMapping("/inner/createForecastInfo")
@PostMapping("/createForecastInfo")
public void createForecastInfo() {
tForecastLibraryService.createForecastInfo();
}
......
......@@ -38,6 +38,7 @@ import com.yifu.cloud.plus.v1.yifu.salary.vo.UpdateSocialFoundVo;
import com.yifu.cloud.plus.v1.yifu.social.entity.TPaymentInfo;
import com.yifu.cloud.plus.v1.yifu.social.service.TPaymentInfoService;
import com.yifu.cloud.plus.v1.yifu.social.vo.ChangeDeptVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TPaymentInfoNewVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TPaymentInfoSearchVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TPaymentInfoVo;
import io.swagger.v3.oas.annotations.Operation;
......@@ -78,6 +79,31 @@ public class TPaymentInfoController {
return new R<>(tPaymentInfoService.getTPaymentInfoPage(page, tPaymentInfo));
}
/**
* 简单分页查询
*
* @param page 分页对象
* @param tPaymentInfo 缴费库
* @return
*/
@Operation(description = "简单分页查询")
@GetMapping("/newPage")
public R<IPage<TPaymentInfoNewVo>> getTPaymentInfoNewPage(Page<TPaymentInfo> page, TPaymentInfoSearchVo tPaymentInfo) {
return new R<>(tPaymentInfoService.getTPaymentInfoNewPage(page, tPaymentInfo));
}
/**
* 实缴查询详情
*
* @param tPaymentInfo
* @return
*/
@Operation(description = "简单分页查询")
@GetMapping("/newPageInfo")
public R<TPaymentInfoNewVo> getTPaymentInfoNewPageInfo(TPaymentInfoSearchVo tPaymentInfo) {
return R.ok(tPaymentInfoService.getTPaymentInfoNewPageInfo(tPaymentInfo));
}
/**
* 通过id查询缴费库
*
......
......@@ -20,7 +20,6 @@ package com.yifu.cloud.plus.v1.yifu.social.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.social.entity.TDispatchInfo;
import com.yifu.cloud.plus.v1.yifu.social.vo.*;
import org.apache.ibatis.annotations.Mapper;
......@@ -103,6 +102,17 @@ public interface TDispatchInfoMapper extends BaseMapper<TDispatchInfo> {
IPage<TDispatchInfo> getTDispatchSocialHandlePage(Page<TDispatchInfo> page,
@Param("tDispatchInfo") SocialHandleSearchVo tDispatchInfo,
@Param("idsStr") List<String> idsStr);
/**
* 社保页面查询
* @Author fxj
* @Date 2019-10-12
* @param tDispatchInfo
* @return
**/
List<TDispatchInfo> getTDispatchSocialHandleNoPage(@Param("tDispatchInfo")SocialHandleSearchVo tDispatchInfo,
@Param("idCards") List<String> idCards,
@Param("idsStr") List<String> idsStr);
/**
* 公积金办理页面查询
* @Author fxj
......
......@@ -46,6 +46,20 @@ public interface TPaymentInfoMapper extends BaseMapper<TPaymentInfo> {
*/
IPage<TPaymentInfo> getTPaymentInfoPage(Page<TPaymentInfo> page, @Param("tPaymentInfo") TPaymentInfoSearchVo tPaymentInfo);
/**
* 缴费库分页查询
* @param tPaymentInfo 缴费库
* @return
*/
IPage<TPaymentInfoNewVo> getTPaymentInfoNewPage(Page<TPaymentInfo> page, @Param("tPaymentInfo") TPaymentInfoSearchVo tPaymentInfo);
/**
* 缴费库查询详情
* @param tPaymentInfo
* @return
*/
TPaymentInfoNewVo getTPaymentInfoNewPageInfo(@Param("tPaymentInfo") TPaymentInfoSearchVo tPaymentInfo);
/**
* 缴费库简单分页查询
* @param searchVo 缴费库
......
......@@ -53,6 +53,8 @@ public interface TDispatchInfoService extends IService<TDispatchInfo> {
R<List<ErrorMessage>> importDiy(InputStream inputStream, String orderId);
R<List<ErrorMessage>> importSocialHandler(InputStream inputStream);
void listExport(HttpServletResponse response, TDispatchInfoSearchVo searchVo);
void listAuditExport(HttpServletResponse response, TDispatchInfoSearchVo searchVo);
......
......@@ -44,6 +44,20 @@ public interface TPaymentInfoService extends IService<TPaymentInfo> {
*/
IPage<TPaymentInfo> getTPaymentInfoPage(Page<TPaymentInfo> page, TPaymentInfoSearchVo tPaymentInfo);
/**
* 缴费库查询
* @param tPaymentInfo 缴费库
* @return
*/
IPage<TPaymentInfoNewVo> getTPaymentInfoNewPage(Page<TPaymentInfo> page, TPaymentInfoSearchVo tPaymentInfo);
/**
* 缴费库查询详情
* @param tPaymentInfo 缴费库
* @return
*/
TPaymentInfoNewVo getTPaymentInfoNewPageInfo(TPaymentInfoSearchVo tPaymentInfo);
/**
* 缴费库批量导入社保
* @param inputStream
......
......@@ -5129,6 +5129,194 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
}
}
/**
* @Author huyc
* @Description 社保批量导入办理
* @Date 15:46 2023/5/15
* @Param
* @return
**/
@Transactional(rollbackFor = Exception.class)
@ShardingTransactionType(TransactionType.BASE)
@Override
public R<List<ErrorMessage>> importSocialHandler(InputStream inputStream) {
YifuUser user = SecurityUtils.getUser();
if (Common.isEmpty(user)){
R.failed(CommonConstants.USER_FAIL);
}
List<ErrorMessage> errorMessageList = new ArrayList<>();
ExcelUtil<SocialImportHandleVo> util1 = new ExcelUtil<>(SocialImportHandleVo.class);
// 写法2:
// 匿名内部类 不用额外写一个DemoDataListener
// 这里 需要指定读用哪个class去读,然后读取第一个sheet 文件流会自动关闭
try {
EasyExcel.read(inputStream, SocialImportHandleVo.class, new ReadListener<SocialImportHandleVo>() {
/**
* 单次缓存的数据量
*/
public static final int BATCH_COUNT = CommonConstants.BATCH_COUNT;
/**
*临时存储
*/
private List<SocialImportHandleVo> cachedDataList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT);
@Override
public void invoke(SocialImportHandleVo data, AnalysisContext context) {
ReadRowHolder readRowHolder = context.readRowHolder();
Integer rowIndex = readRowHolder.getRowIndex();
data.setRowIndex(rowIndex + 1);
ErrorMessage errorMessage = util1.checkEntity(data, data.getRowIndex());
if (Common.isNotNull(errorMessage)) {
errorMessage.setData(data);
errorMessageList.add(errorMessage);
} else {
cachedDataList.add(data);
}
if (cachedDataList.size() >= BATCH_COUNT) {
saveData();
// 存储完成清理 list
cachedDataList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT);
}
}
@Override
public void doAfterAllAnalysed(AnalysisContext context) {
saveData();
}
/**
* 加上存储数据库
*/
private void saveData() {
log.info("{}条数据,开始存储数据库!", cachedDataList.size());
socialImportHandle(cachedDataList, errorMessageList,user);
log.info("存储数据库成功!");
}
}).sheet().doRead();
} catch (Exception e) {
log.error(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR, e);
return R.failed(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR);
}
return this.judgeAllMessage(errorMessageList);
}
/**
* @Author huych
* @Description 社保批量导入办理(1养老 2医疗 3失业 4工伤 5生育 6大病)
* @Date 16:45 2023/5/15
* @Param
* @return
**/
public void socialImportHandle(List<SocialImportHandleVo> excelVOList, List<ErrorMessage> errorMessageList, YifuUser user) {
if (!Common.isNotNull(excelVOList)) {
return;
}
// 个性化校验逻辑
SocialImportHandleVo excel;
SocialHandleSearchVo tDispatchInfo = new SocialHandleSearchVo();
tDispatchInfo.setDeleteFlag(CommonConstants.ZERO_STRING);
menuUtil.setAuthSql(user, tDispatchInfo);
if (Common.isNotNull(tDispatchInfo.getAuthSql()) && tDispatchInfo.getAuthSql().contains(CommonConstants.A_DEPT_ID)) {
tDispatchInfo.setAuthSql(tDispatchInfo.getAuthSql().replace(CommonConstants.A_DEPT_ID, "a.SETTLE_DOMAIN"));
}
tDispatchInfo.setCreateBy(user.getId());
List<TDispatchInfo> dispatchInfos = baseMapper.getTDispatchSocialHandleNoPage(tDispatchInfo, excelVOList.stream()
.map(SocialImportHandleVo::getEmpIdcard).collect(Collectors.toList()),null);
Map<String, TDispatchInfo> dispatchMap = new HashMap<>();
if (Common.isNotNull(dispatchInfos)) {
dispatchMap = dispatchInfos.stream().collect(Collectors.toMap(TDispatchInfo::getEmpIdcard, TDispatchInfo -> TDispatchInfo));
}
TDispatchInfo dispatch;
ErrorMessage errorMessage;
List<ErrorMessage> messageList = new ArrayList<>();
StringBuilder socialSucessType = new StringBuilder();
StringBuilder socialFailureType = new StringBuilder();
for (int i = 0; i < excelVOList.size(); i++) {
excel = excelVOList.get(i);
//身份证加任一险种必填
if (Common.isEmpty(excel.getDbHandleStatus()) && Common.isEmpty(excel.getGsHandleStatus())
&& Common.isEmpty(excel.getSjHandleStatus()) && Common.isEmpty(excel.getSyHandleStatus())
&& Common.isEmpty(excel.getYbHandleStatus()) && Common.isEmpty(excel.getYlHandleStatus())) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.SOCIAL_IMPORT_HANDLE_NOT_EMPY), excel));
continue;
}
// 任一险种办理失败,失败类型必填
if (Common.isEmpty(excel.getReasonType()) && (CommonConstants.ONE_STRING.equals(excel.getDbHandleStatus())
|| CommonConstants.ONE_STRING.equals(excel.getGsHandleStatus()) || CommonConstants.ONE_STRING.equals(excel.getSjHandleStatus())
|| CommonConstants.ONE_STRING.equals(excel.getSyHandleStatus()) || CommonConstants.ONE_STRING.equals(excel.getYbHandleStatus())
|| CommonConstants.ONE_STRING.equals(excel.getYlHandleStatus()))) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.SOCIAL_IMPORT_HANDLE_REASON_NOT_EMPY), excel));
continue;
}
dispatch = dispatchMap.get(excel.getEmpIdcard());
if (Common.isEmpty(dispatch)) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.SOCIAL_IMPORT_HANDLE_NOT_EMPY), excel));
continue;
}
//判断办理的险种
if (CommonConstants.ZERO_STRING.equals(excel.getYlHandleStatus())) {
socialSucessType.append("1,");
} else if (CommonConstants.ONE_STRING.equals(excel.getYlHandleStatus())) {
socialFailureType.append("1,");
}
if (CommonConstants.ZERO_STRING.equals(excel.getYbHandleStatus())) {
socialSucessType.append("2,");
} else if (CommonConstants.ONE_STRING.equals(excel.getYbHandleStatus())) {
socialFailureType.append("2,");
}
if (CommonConstants.ZERO_STRING.equals(excel.getSyHandleStatus())) {
socialSucessType.append("3,");
} else if (CommonConstants.ONE_STRING.equals(excel.getSyHandleStatus())) {
socialFailureType.append("3,");
}
if (CommonConstants.ZERO_STRING.equals(excel.getGsHandleStatus())) {
socialSucessType.append("4,");
} else if (CommonConstants.ONE_STRING.equals(excel.getGsHandleStatus())) {
socialFailureType.append("4,");
}
if (CommonConstants.ZERO_STRING.equals(excel.getSjHandleStatus())) {
socialSucessType.append("5,");
} else if (CommonConstants.ONE_STRING.equals(excel.getSjHandleStatus())) {
socialFailureType.append("5,");
}
if (CommonConstants.ZERO_STRING.equals(excel.getDbHandleStatus())) {
socialSucessType.append("6,");
} else if (CommonConstants.ONE_STRING.equals(excel.getDbHandleStatus())) {
socialFailureType.append("6,");
}
try {
//办理成功处理
if (socialSucessType.length() > 1) {
// 执行数据插入操作 组装
messageList = addBatchApplyHandle(Collections.singletonList(dispatch.getId()), CommonConstants.ZERO_STRING, user
, 0, CommonConstants.ONE_STRING, "", socialSucessType.substring(0, socialSucessType.length() - 1), excel.getRemark());
}
//办理失败处理
if (socialFailureType.length() > 1) {
// 执行数据插入操作 组装
messageList = addBatchApplyHandle(Collections.singletonList(dispatch.getId()), CommonConstants.ZERO_STRING, user
, 1, CommonConstants.TWO_STRING, excel.getReasonType(), socialFailureType.substring(0, socialFailureType.length() - 1), excel.getReasonType() + CommonConstants.COLON_STRING + excel.getRemark());
}
if (Common.isNotNull(messageList)) {
errorMessage = messageList.get(CommonConstants.ZERO_INT);
errorMessage.setData(excel);
} else {
errorMessage = new ErrorMessage(excel.getRowIndex(), CommonConstants.SAVE_SUCCESS, CommonConstants.GREEN, excel);
}
errorMessageList.add(errorMessage);
} catch (Exception e) {
log.error("批量导入办理异常:", e);
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), CommonConstants.SAVE_FAILED, excel));
}
}
}
@Override
public R<Boolean> updateExportSocialFlagById(String id,String status) {
return R.ok(baseMapper.updateExportSocialFlagById(id,status) >= 0);
......
......@@ -149,6 +149,27 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
return baseMapper.getTPaymentInfoPage(page, tPaymentInfo);
}
/**
* 缴费库查询详情
* @param tPaymentInfo
* @return
*/
@Override
public TPaymentInfoNewVo getTPaymentInfoNewPageInfo(TPaymentInfoSearchVo tPaymentInfo) {
return baseMapper.getTPaymentInfoNewPageInfo(tPaymentInfo);
}
/**
* 缴费库分页查询
*
* @param tPaymentInfo 缴费库
* @return
*/
@Override
public IPage<TPaymentInfoNewVo> getTPaymentInfoNewPage(Page<TPaymentInfo> page, TPaymentInfoSearchVo tPaymentInfo) {
return baseMapper.getTPaymentInfoNewPage(page, tPaymentInfo);
}
/**
* 缴费库批量导出
*
......@@ -991,8 +1012,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
}
if (!isTrueAdder) {
errorMessageMap.put(UUID.randomUUID().toString(),new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), infoVo.getSocialHousehold(), infoVo.getProvidentHousehold(), infoVo.getEmpName(), "无对应员工" +
infoVo.getEmpIdcard() + "的社保数据(请查验社保缴纳地)"));
errorMessageMap.put(UUID.randomUUID().toString(),new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), infoVo.getSocialHousehold(), infoVo.getProvidentHousehold(), infoVo.getEmpName(),
"无对应员工(身份证:" + infoVo.getEmpIdcard() + ")" + "的社保数据(请查验社保缴纳地)"));
continue;
}
} else {
......@@ -1727,9 +1748,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
}
if (!isTrueAdder) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), infoVo.getSocialHousehold(), infoVo.getProvidentHousehold(), infoVo.getEmpName(), "无对应员工" + infoVo.getEmpName() +
CommonConstants.DOWN_LINE_STRING + infoVo.getEmpIdcard()
+ "的公积金数据(请查验公积金缴纳地)!"));
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), infoVo.getSocialHousehold(), infoVo.getProvidentHousehold(), infoVo.getEmpName(),
"无对应员工(身份证:" + infoVo.getEmpIdcard() + ")" + "的公积金数据(请查验公积金缴纳地)!"));
continue;
}
} else {
......@@ -1881,6 +1901,9 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
+ paymentInfo.getProvidentCreateMonth().trim()
+ CommonConstants.DOWN_LINE_STRING
+ BigDecimalUtils.safeAdd(paymentInfo.getProvidentSum()).doubleValue(), paymentInfo);
} else {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), infoVo.getSocialHousehold(), infoVo.getProvidentHousehold(), infoVo.getEmpName(),
"无对应员工(身份证:" + infoVo.getEmpIdcard() + ")" + "的公积金数据(请查验公积金缴纳地)!"));
}
}
}
......@@ -2193,11 +2216,11 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
if (socialThreeCheckBase(errorMessageList, infoVo, type)) {
continue;
}
//无对应员工的社保数据
if (socialMap.size() > CommonConstants.ZERO_INT) {
//采用客服导入的地址
areaArray = infoVo.getSocialPayAddr().split(CommonConstants.CENTER_SPLIT_LINE_STRING);
infoVo = initAddressThree(areaArray, areaMap2, infoVo);
//无对应员工的社保数据
if (socialMap.size() > CommonConstants.ZERO_INT) {
if (null == infoVo.getSocialProvince() || null == infoVo.getSocialCity()) {
errorMessageList.put(UUID.randomUUID().toString(),new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), "", "", infoVo.getEmpName(), "社保缴纳地填写错误,请核实后再次尝试!"));
continue;
......@@ -2237,8 +2260,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
}
if (!isTrueAdder) {
errorMessageList.put(UUID.randomUUID().toString(),new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), "", "", infoVo.getEmpName(), "无对应员工" + infoVo.getEmpIdcard() +
"的社保数据(请查验社保缴纳地)"));
errorMessageList.put(UUID.randomUUID().toString(),new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), "", "", infoVo.getEmpName(),
"无对应员工(身份证:" + infoVo.getEmpIdcard() + ")" + "的社保数据(请查验社保缴纳地)"));
continue;
}
} else {
......
......@@ -1065,6 +1065,17 @@
left join t_social_info s on a.SOCIAL_ID = s.id
<include refid="where_getSocialRecordRoster"/>
</select>
<!--tDispatchInfo 社保办理数据查询-->
<select id="getTDispatchSocialHandleNoPage" resultMap="dispatchPageMap">
SELECT
<include refid="Base_Column_List"/>,
a.SOCIAL_HOUSEHOLD_NAME,a.EXPORT_SOCIAL_FLAG
FROM t_dispatch_info a
left join t_social_info s on a.SOCIAL_ID = s.id
<include refid="where_getSocialRecordNoPage"/>
</select>
<!--tDispatchInfo 公积金办理数据查询-->
<select id="getTDispatchFundHandlePage" resultMap="dispatchPageMap">
SELECT
......@@ -1298,6 +1309,114 @@
</where>
</sql>
<sql id="where_getSocialRecordNoPage">
<where>
s.DELETE_FLAG = 0
<if test="idsStr != null and idsStr.size > 0">
AND a.ID in
<foreach item="items" index="index" collection="idsStr" open="(" separator="," close=")">
#{items}
</foreach>
</if>
/** 社保办理状态:0待办理/1已办理2办理失败3已派减4 办理中 5 部分办理失败 派单社保办理状态 0 未办理 1 全部办理成功(原-已办理) 2 全部办理失败(原-办理失败) 3 部分办理成功 4 办理中 **/
/*社保代办理 1.派单审核通过 2.派增(type=0):待办理(social_handle_status='0') or 派减(type=1):已办理完成或部分办理失败 且已派减*/
AND a.social_id is not null
AND a.STATUS = "2"
and (( a.type = '0' AND (s.HANDLE_STATUS = "0" or s.HANDLE_STATUS = "4") ) or ( a.type ='1' AND s.HANDLE_STATUS in ('1','5','6','3','7') and s.REDUCE_CAN = '1'))
and a.SOCIAL_HANDLE_STATUS in ('0','4')
<if test="tDispatchInfo.empTypeList != null ">
AND a.EMP_TYPE IN
<foreach collection="tDispatchInfo.empTypeList" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="tDispatchInfo != null">
<if test="tDispatchInfo.dispatchItems != null and tDispatchInfo.dispatchItems.size >0">
AND
<foreach item="item" index="index" collection="tDispatchInfo.dispatchItems" open="(" separator="or" close=")">
INSTR(a.DISPATCH_ITEM,#{item})
</foreach>
</if>
<if test="tDispatchInfo.type != null and tDispatchInfo.type.trim() != ''">
AND a.TYPE = #{tDispatchInfo.type}
</if>
<if test="tDispatchInfo.socialProvince != null and tDispatchInfo.socialProvince!= null">
AND s.social_province = #{tDispatchInfo.socialProvince}
<if test="tDispatchInfo.socialCity != null and tDispatchInfo.socialCity!= null">
AND s.social_city = #{tDispatchInfo.socialCity}
</if>
<if test="tDispatchInfo.socialTown != null and tDispatchInfo.socialTown!= null">
AND s.social_town = #{tDispatchInfo.socialTown}
</if>
</if>
<if test="tDispatchInfo.empName != null and tDispatchInfo.empName.trim() != ''">
AND a.EMP_NAME like concat('%',#{tDispatchInfo.empName},'%')
</if>
<if test="tDispatchInfo.empIdcard != null and tDispatchInfo.empIdcard.trim() != ''">
AND a.EMP_IDCARD like concat('%',#{tDispatchInfo.empIdcard},'%')
</if>
<if test="tDispatchInfo.status != null and tDispatchInfo.status.trim() != ''">
AND a.STATUS = #{tDispatchInfo.status}
</if>
<if test="tDispatchInfo.settleDomain != null and tDispatchInfo.settleDomain.trim() != ''">
AND a.SETTLE_DOMAIN = #{tDispatchInfo.settleDomain}
</if>
<if test="tDispatchInfo.settleDomainCode != null and tDispatchInfo.settleDomainCode.trim() != ''">
AND a.SETTLE_DOMAIN_CODE = #{tDispatchInfo.settleDomainCode}
</if>
<if test="tDispatchInfo.socialHandleStatus != null and tDispatchInfo.socialHandleStatus.trim() != ''">
AND a.SOCIAL_HANDLE_STATUS = #{tDispatchInfo.socialHandleStatus}
</if>
<if test="tDispatchInfo.createName != null and tDispatchInfo.createName.trim() != ''">
AND a.CREATE_NAME = #{tDispatchInfo.createName}
</if>
<if test="tDispatchInfo.settleDomainName != null and tDispatchInfo.settleDomainName.trim() != ''">
AND a.SETTLE_DOMAIN_NAME like CONCAT(CONCAT(#{tDispatchInfo.settleDomainName}), '%')
</if>
<if test="tDispatchInfo.belongUnitName != null and tDispatchInfo.belongUnitName.trim() != ''">
AND a.BELONG_UNIT_NAME = #{tDispatchInfo.belongUnitName}
</if>
<if test="tDispatchInfo.createTimeEnd != null">
AND a.CREATE_TIME <![CDATA[<=]]> #{tDispatchInfo.createTimeEnd}
</if>
<if test="tDispatchInfo.createTimeStart != null">
AND a.CREATE_TIME <![CDATA[>=]]> #{tDispatchInfo.createTimeStart}
</if>
<if test="tDispatchInfo.auditTimeStart != null">
AND a.AUDIT_TIME <![CDATA[>=]]> #{tDispatchInfo.auditTimeStart}
</if>
<if test="tDispatchInfo.auditTimeEnd != null">
AND a.AUDIT_TIME <![CDATA[<=]]> #{tDispatchInfo.auditTimeEnd}
</if>
<if test="tDispatchInfo.auditUserName != null and tDispatchInfo.auditUserName.trim() != ''">
AND a.AUDIT_USER_NAME like concat('%',#{tDispatchInfo.auditUserName},'%')
</if>
<if test="tDispatchInfo.socialHouseholdName != null and tDispatchInfo.socialHouseholdName.trim() != ''">
AND a.SOCIAL_HOUSEHOLD_NAME like CONCAT(CONCAT(#{tDispatchInfo.socialHouseholdName}), '%')
</if>
<if test="tDispatchInfo.authSql != null and tDispatchInfo.authSql.trim() != ''">
${tDispatchInfo.authSql}
</if>
<if test="tDispatchInfo.exportSocialFlag != null and tDispatchInfo.exportSocialFlag.trim() != ''">
AND a.EXPORT_SOCIAL_FLAG = ${tDispatchInfo.exportSocialFlag}
</if>
</if>
<if test="idCards != null and idCards.size > 0">
AND a.emp_idcard in
<foreach item="items" index="index" collection="idCards" open="(" separator="," close=")">
#{items}
</foreach>
</if>
group by a.id
order by a.APPLY_NO desc
</where>
</sql>
<sql id="where_getFundRecord">
a.DELETE_FLAG = 0
<if test="idsStr != null and idsStr.size > 0">
......
......@@ -251,6 +251,51 @@
<result property="createName" column="CREATE_NAME"/>
<result property="createTime" column="CREATE_TIME"/>
</resultMap>
<resultMap id="tPaymentInfoNewMap" type="com.yifu.cloud.plus.v1.yifu.social.vo.TPaymentInfoNewVo">
<result property="empName" column="EMP_NAME"/>
<result property="empIdcard" column="EMP_IDCARD"/>
<result property="unitName" column="UNIT_NAME"/>
<result property="settleDomainName" column="SETTLE_DOMAIN_NAME"/>
<result property="socialHousehold" column="SOCIAL_HOUSEHOLD"/>
<result property="socialSecurityNo" column="SOCIAL_SECURITY_NO"/>
<result property="socialPayAddr" column="SOCIAL_PAY_ADDR"/>
<result property="socialPayMonth" column="SOCIAL_PAY_MONTH"/>
<result property="socialCreateMonth" column="SOCIAL_CREATE_MONTH"/>
<result property="sumAll" column="SUM_ALL"/>
<result property="providentPayMonth" column="PROVIDENT_PAY_MONTH"/>
<result property="providentCreateMonth" column="PROVIDENT_CREATE_MONTH"/>
<result property="providentHousehold" column="PROVIDENT_HOUSEHOLD"/>
<result property="providentPayAddr" column="PROVIDENT_PAY_ADDR"/>
<result property="socialSum" column="SOCIAL_SUM"/>
<result property="unitSocialSum" column="UNIT_SOCIAL_SUM"/>
<result property="socialSecurityPersonalSum" column="SOCIAL_SECURITY_PERSONAL_SUM"/>
<result property="providentSum" column="PROVIDENT_SUM"/>
<result property="companyAccrual" column="COMPANY_ACCRUAL"/>
<result property="personalAccrual" column="PERSONAL_ACCRUAL"/>
<result property="unitPensionSet" column="UNIT_PENSION_SET"/>
<result property="unitMedicalSet" column="UNIT_MEDICAL_SET"/>
<result property="unitUnemploymentSet" column="UNIT_UNEMPLOYMENT_SET"/>
<result property="unitInjurySet" column="UNIT_INJURY_SET"/>
<result property="unitBirthSet" column="UNIT_BIRTH_SET"/>
<result property="unitPensionMoney" column="UNIT_PENSION_MONEY"/>
<result property="unitMedicalMoney" column="UNIT_MEDICAL_MONEY"/>
<result property="unitUnemploymentMoney" column="UNIT_UNEMPLOYMENT_MONEY"/>
<result property="unitInjuryMoney" column="UNIT_INJURY_MONEY"/>
<result property="unitBirthMoney" column="UNIT_BIRTH_MONEY"/>
<result property="unitBigmailmentMoney" column="UNIT_BIGMAILMENT_MONEY"/>
<result property="personalPensionMoney" column="PERSONAL_PENSION_MONEY"/>
<result property="personalMedicalMoney" column="PERSONAL_MEDICAL_MONEY"/>
<result property="personalUnemploymentMoney" column="PERSONAL_UNEMPLOYMENT_MONEY"/>
<result property="personalBigmailmentMoney" column="PERSONAL_BIGMAILMENT_MONEY"/>
<result property="providentNo" column="PROVIDENT_NO"/>
<result property="unitProvidentSet" column="UNIT_PROVIDENT_SET"/>
<result property="providentPercent" column="PROVIDENT_PERCENT"/>
<result property="unitProvidentSum" column="UNIT_PROVIDENT_SUM"/>
<result property="personalProidentSet" column="PERSONAL_PROIDENT_SET"/>
<result property="personalProvidentSum" column="PERSONAL_PROVIDENT_SUM"/>
<result property="keyGroup" column="keyGroup"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
a.EMP_NAME,
......@@ -906,6 +951,308 @@
ORDER BY a.CREATE_TIME desc
</select>
<!--tPaymentInfo简单分页查询-->
<select id="getTPaymentInfoNewPage" resultMap="tPaymentInfoNewMap">
SELECT
w.keyGroup,
w.EMP_IDCARD,
w.EMP_NAME,
w.UNIT_NAME,
w.SETTLE_DOMAIN_NAME,
w.SOCIAL_HOUSEHOLD,
MAX( w.SOCIAL_SECURITY_NO ) AS SOCIAL_SECURITY_NO,
w.SOCIAL_PAY_ADDR,
w.SOCIAL_PAY_MONTH,
w.SOCIAL_CREATE_MONTH,
SUM( w.PERSONAL_PROVIDENT_SUM) AS PERSONAL_PROVIDENT_SUM,
SUM( w.SUM_ALL ) AS SUM_ALL,
MAX( w.PROVIDENT_PAY_MONTH ) AS PROVIDENT_PAY_MONTH,
MAX( w.PROVIDENT_CREATE_MONTH ) AS PROVIDENT_CREATE_MONTH,
MAX( w.PROVIDENT_HOUSEHOLD ) AS PROVIDENT_HOUSEHOLD,
MAX( w.PROVIDENT_PAY_ADDR ) AS PROVIDENT_PAY_ADDR,
w.SOCIAL_SUM,
w.UNIT_SOCIAL_SUM,
w.SOCIAL_SECURITY_PERSONAL_SUM,
SUM( w.PROVIDENT_SUM ) AS PROVIDENT_SUM,
w.COMPANY_ACCRUAL,
w.PERSONAL_ACCRUAL,
w.UNIT_PENSION_SET,
w.UNIT_MEDICAL_SET,
w.UNIT_UNEMPLOYMENT_SET,
w.UNIT_INJURY_SET,
w.UNIT_BIRTH_SET,
w.UNIT_PENSION_MONEY,
w.UNIT_MEDICAL_MONEY,
w.UNIT_UNEMPLOYMENT_MONEY,
w.UNIT_INJURY_MONEY,
w.UNIT_BIRTH_MONEY,
w.UNIT_BIGMAILMENT_MONEY,
w.PERSONAL_PENSION_MONEY,
w.PERSONAL_MEDICAL_MONEY,
w.PERSONAL_UNEMPLOYMENT_MONEY,
w.PERSONAL_BIGMAILMENT_MONEY,
MAX( w.PROVIDENT_NO ) AS PROVIDENT_NO,
MAX( w.PERSONAL_PROIDENT_SET ) AS PERSONAL_PROIDENT_SET,
SUM( w.UNIT_PROVIDENT_SET ) AS UNIT_PROVIDENT_SET,
SUM( w.PROVIDENT_PERCENT ) AS PROVIDENT_PERCENT,
SUM( w.UNIT_PROVIDENT_SUM ) AS UNIT_PROVIDENT_SUM
FROM (
(SELECT
CONCAT( a.EMP_IDCARD, '_', a.SOCIAL_PAY_MONTH, '_', a.SOCIAL_CREATE_MONTH ) AS keyGroup,
a.EMP_NAME,
a.EMP_IDCARD,
a.UNIT_NAME,
a.SETTLE_DOMAIN_NAME,
a.SOCIAL_HOUSEHOLD,
MAX( a.SOCIAL_SECURITY_NO ) AS SOCIAL_SECURITY_NO,
a.SOCIAL_PAY_ADDR,
a.SOCIAL_PAY_MONTH,
a.SOCIAL_CREATE_MONTH,
a.PERSONAL_PROVIDENT_SUM,
SUM( a.SUM_ALL ) AS SUM_ALL,
a.PROVIDENT_PAY_MONTH,
a.PROVIDENT_CREATE_MONTH,
a.PROVIDENT_HOUSEHOLD,
a.PROVIDENT_PAY_ADDR,
SUM( a.SOCIAL_SUM ) AS SOCIAL_SUM,
SUM( a.UNIT_SOCIAL_SUM ) AS UNIT_SOCIAL_SUM,
SUM( a.SOCIAL_SECURITY_PERSONAL_SUM ) AS SOCIAL_SECURITY_PERSONAL_SUM,
a.PROVIDENT_SUM,
SUM( a.COMPANY_ACCRUAL ) AS COMPANY_ACCRUAL,
SUM( a.PERSONAL_ACCRUAL ) AS PERSONAL_ACCRUAL,
MAX(a.UNIT_PENSION_SET ) AS UNIT_PENSION_SET,
MAX(a.UNIT_MEDICAL_SET ) AS UNIT_MEDICAL_SET,
MAX(a.UNIT_UNEMPLOYMENT_SET ) AS UNIT_UNEMPLOYMENT_SET,
MAX(a.UNIT_INJURY_SET ) AS UNIT_INJURY_SET,
MAX(a.UNIT_BIRTH_SET ) AS UNIT_BIRTH_SET,
SUM( a.UNIT_PENSION_MONEY ) AS UNIT_PENSION_MONEY,
SUM( a.UNIT_MEDICAL_MONEY ) AS UNIT_MEDICAL_MONEY,
SUM( a.UNIT_UNEMPLOYMENT_MONEY ) AS UNIT_UNEMPLOYMENT_MONEY,
SUM( a.UNIT_INJURY_MONEY ) AS UNIT_INJURY_MONEY,
SUM( a.UNIT_BIRTH_MONEY ) AS UNIT_BIRTH_MONEY,
SUM( a.UNIT_BIGMAILMENT_MONEY ) AS UNIT_BIGMAILMENT_MONEY,
SUM( a.PERSONAL_PENSION_MONEY ) AS PERSONAL_PENSION_MONEY,
SUM( a.PERSONAL_MEDICAL_MONEY ) AS PERSONAL_MEDICAL_MONEY,
SUM( a.PERSONAL_UNEMPLOYMENT_MONEY ) AS PERSONAL_UNEMPLOYMENT_MONEY,
SUM( a.PERSONAL_BIGMAILMENT_MONEY ) AS PERSONAL_BIGMAILMENT_MONEY,
a.PROVIDENT_NO,
a.UNIT_PROVIDENT_SET,
a.PROVIDENT_PERCENT,
a.PERSONAL_PROIDENT_SET,
a.UNIT_PROVIDENT_SUM
FROM t_payment_info a
<where>
IFNULL(a.SOCIAL_ID,'1') != '1'
<include refid="tPaymentInfo_export_where"/>
</where>
GROUP BY a.EMP_IDCARD,a.SOCIAL_PAY_MONTH,a.SOCIAL_CREATE_MONTH,a.SETTLE_DOMAIN_CODE
)
union all
(SELECT
CONCAT( a.EMP_IDCARD, '_', a.PROVIDENT_PAY_MONTH, '_', a.PROVIDENT_CREATE_MONTH ) AS keyGroup,
a.EMP_NAME,
a.EMP_IDCARD,
a.UNIT_NAME,
a.SETTLE_DOMAIN_NAME,
a.SOCIAL_HOUSEHOLD,
a.SOCIAL_SECURITY_NO,
a.SOCIAL_PAY_ADDR,
a.SOCIAL_PAY_MONTH,
a.SOCIAL_CREATE_MONTH,
SUM(a.PERSONAL_PROVIDENT_SUM) AS PERSONAL_PROVIDENT_SUM,
SUM( a.SUM_ALL ) AS SUM_ALL,
a.PROVIDENT_PAY_MONTH,
a.PROVIDENT_CREATE_MONTH,
a.PROVIDENT_HOUSEHOLD,
a.PROVIDENT_PAY_ADDR,
a.SOCIAL_SUM,
a.UNIT_SOCIAL_SUM,
a.SOCIAL_SECURITY_PERSONAL_SUM,
SUM( a.PROVIDENT_SUM ) AS PROVIDENT_SUM,
a.COMPANY_ACCRUAL,
a.PERSONAL_ACCRUAL,
a.UNIT_PENSION_SET,
a.UNIT_MEDICAL_SET,
a.UNIT_UNEMPLOYMENT_SET,
a.UNIT_INJURY_SET,
a.UNIT_BIRTH_SET,
a.UNIT_PENSION_MONEY,
a.UNIT_MEDICAL_MONEY,
a.UNIT_UNEMPLOYMENT_MONEY,
a.UNIT_INJURY_MONEY,
a.UNIT_BIRTH_MONEY,
a.UNIT_BIGMAILMENT_MONEY,
a.PERSONAL_PENSION_MONEY,
a.PERSONAL_MEDICAL_MONEY,
a.PERSONAL_UNEMPLOYMENT_MONEY,
a.PERSONAL_BIGMAILMENT_MONEY,
a.PROVIDENT_NO,
a.UNIT_PROVIDENT_SET,
a.PROVIDENT_PERCENT,
a.PERSONAL_PROIDENT_SET,
SUM( a.UNIT_PROVIDENT_SUM ) AS UNIT_PROVIDENT_SUM
FROM t_payment_info a
<where>
IFNULL(a.FUND_ID,'1') != '1'
<include refid="tPaymentInfo_export_where"/>
</where>
GROUP BY a.EMP_IDCARD,a.PROVIDENT_PAY_MONTH,a.PROVIDENT_CREATE_MONTH,a.SETTLE_DOMAIN_CODE
)
) w
GROUP BY w.keyGroup
</select>
<!--tPaymentInfo简单分页查询-->
<select id="getTPaymentInfoNewPageInfo" resultMap="tPaymentInfoNewMap">
SELECT
w.keyGroup,
w.EMP_IDCARD,
w.EMP_NAME,
w.UNIT_NAME,
w.SETTLE_DOMAIN_NAME,
w.SOCIAL_HOUSEHOLD,
MAX( w.SOCIAL_SECURITY_NO ) AS SOCIAL_SECURITY_NO,
w.SOCIAL_PAY_ADDR,
w.SOCIAL_PAY_MONTH,
w.SOCIAL_CREATE_MONTH,
SUM( w.PERSONAL_PROVIDENT_SUM) AS PERSONAL_PROVIDENT_SUM,
SUM( w.SUM_ALL ) AS SUM_ALL,
MAX( w.PROVIDENT_PAY_MONTH ) AS PROVIDENT_PAY_MONTH,
MAX( w.PROVIDENT_CREATE_MONTH ) AS PROVIDENT_CREATE_MONTH,
MAX( w.PROVIDENT_HOUSEHOLD ) AS PROVIDENT_HOUSEHOLD,
MAX( w.PROVIDENT_PAY_ADDR ) AS PROVIDENT_PAY_ADDR,
w.SOCIAL_SUM,
w.UNIT_SOCIAL_SUM,
w.SOCIAL_SECURITY_PERSONAL_SUM,
SUM( w.PROVIDENT_SUM ) AS PROVIDENT_SUM,
w.COMPANY_ACCRUAL,
w.PERSONAL_ACCRUAL,
w.UNIT_PENSION_SET,
w.UNIT_MEDICAL_SET,
w.UNIT_UNEMPLOYMENT_SET,
w.UNIT_INJURY_SET,
w.UNIT_BIRTH_SET,
w.UNIT_PENSION_MONEY,
w.UNIT_MEDICAL_MONEY,
w.UNIT_UNEMPLOYMENT_MONEY,
w.UNIT_INJURY_MONEY,
w.UNIT_BIRTH_MONEY,
w.UNIT_BIGMAILMENT_MONEY,
w.PERSONAL_PENSION_MONEY,
w.PERSONAL_MEDICAL_MONEY,
w.PERSONAL_UNEMPLOYMENT_MONEY,
w.PERSONAL_BIGMAILMENT_MONEY,
MAX( w.PROVIDENT_NO ) AS PROVIDENT_NO,
MAX( w.PERSONAL_PROIDENT_SET ) AS PERSONAL_PROIDENT_SET,
SUM( w.UNIT_PROVIDENT_SET ) AS UNIT_PROVIDENT_SET,
SUM( w.PROVIDENT_PERCENT ) AS PROVIDENT_PERCENT,
SUM( w.UNIT_PROVIDENT_SUM ) AS UNIT_PROVIDENT_SUM
FROM (
(SELECT
CONCAT( a.EMP_IDCARD, '_', a.SOCIAL_PAY_MONTH, '_', a.SOCIAL_CREATE_MONTH ) AS keyGroup,
a.EMP_NAME,
a.EMP_IDCARD,
a.UNIT_NAME,
a.SETTLE_DOMAIN_NAME,
a.SOCIAL_HOUSEHOLD,
MAX( a.SOCIAL_SECURITY_NO ) AS SOCIAL_SECURITY_NO,
a.SOCIAL_PAY_ADDR,
a.SOCIAL_PAY_MONTH,
a.SOCIAL_CREATE_MONTH,
a.PERSONAL_PROVIDENT_SUM,
SUM( a.SUM_ALL ) AS SUM_ALL,
a.PROVIDENT_PAY_MONTH,
a.PROVIDENT_CREATE_MONTH,
a.PROVIDENT_HOUSEHOLD,
a.PROVIDENT_PAY_ADDR,
SUM( a.SOCIAL_SUM ) AS SOCIAL_SUM,
SUM( a.UNIT_SOCIAL_SUM ) AS UNIT_SOCIAL_SUM,
SUM( a.SOCIAL_SECURITY_PERSONAL_SUM ) AS SOCIAL_SECURITY_PERSONAL_SUM,
a.PROVIDENT_SUM,
SUM( a.COMPANY_ACCRUAL ) AS COMPANY_ACCRUAL,
SUM( a.PERSONAL_ACCRUAL ) AS PERSONAL_ACCRUAL,
MAX(a.UNIT_PENSION_SET ) AS UNIT_PENSION_SET,
MAX(a.UNIT_MEDICAL_SET ) AS UNIT_MEDICAL_SET,
MAX(a.UNIT_UNEMPLOYMENT_SET ) AS UNIT_UNEMPLOYMENT_SET,
MAX(a.UNIT_INJURY_SET ) AS UNIT_INJURY_SET,
MAX(a.UNIT_BIRTH_SET ) AS UNIT_BIRTH_SET,
SUM( a.UNIT_PENSION_MONEY ) AS UNIT_PENSION_MONEY,
SUM( a.UNIT_MEDICAL_MONEY ) AS UNIT_MEDICAL_MONEY,
SUM( a.UNIT_UNEMPLOYMENT_MONEY ) AS UNIT_UNEMPLOYMENT_MONEY,
SUM( a.UNIT_INJURY_MONEY ) AS UNIT_INJURY_MONEY,
SUM( a.UNIT_BIRTH_MONEY ) AS UNIT_BIRTH_MONEY,
SUM( a.UNIT_BIGMAILMENT_MONEY ) AS UNIT_BIGMAILMENT_MONEY,
SUM( a.PERSONAL_PENSION_MONEY ) AS PERSONAL_PENSION_MONEY,
SUM( a.PERSONAL_MEDICAL_MONEY ) AS PERSONAL_MEDICAL_MONEY,
SUM( a.PERSONAL_UNEMPLOYMENT_MONEY ) AS PERSONAL_UNEMPLOYMENT_MONEY,
SUM( a.PERSONAL_BIGMAILMENT_MONEY ) AS PERSONAL_BIGMAILMENT_MONEY,
a.PROVIDENT_NO,
a.UNIT_PROVIDENT_SET,
a.PROVIDENT_PERCENT,
a.PERSONAL_PROIDENT_SET,
a.UNIT_PROVIDENT_SUM
FROM t_payment_info a
<where>
IFNULL(a.SOCIAL_ID,'1') != '1'
<include refid="tPaymentInfo_export_where"/>
</where>
GROUP BY a.EMP_IDCARD,a.SOCIAL_PAY_MONTH,a.SOCIAL_CREATE_MONTH,a.SETTLE_DOMAIN_CODE
)
union all
(SELECT
CONCAT( a.EMP_IDCARD, '_', a.PROVIDENT_PAY_MONTH, '_', a.PROVIDENT_CREATE_MONTH ) AS keyGroup,
a.EMP_NAME,
a.EMP_IDCARD,
a.UNIT_NAME,
a.SETTLE_DOMAIN_NAME,
a.SOCIAL_HOUSEHOLD,
a.SOCIAL_SECURITY_NO,
a.SOCIAL_PAY_ADDR,
a.SOCIAL_PAY_MONTH,
a.SOCIAL_CREATE_MONTH,
SUM(a.PERSONAL_PROVIDENT_SUM) AS PERSONAL_PROVIDENT_SUM,
SUM( a.SUM_ALL ) AS SUM_ALL,
a.PROVIDENT_PAY_MONTH,
a.PROVIDENT_CREATE_MONTH,
a.PROVIDENT_HOUSEHOLD,
a.PROVIDENT_PAY_ADDR,
a.SOCIAL_SUM,
a.UNIT_SOCIAL_SUM,
a.SOCIAL_SECURITY_PERSONAL_SUM,
SUM( a.PROVIDENT_SUM ) AS PROVIDENT_SUM,
a.COMPANY_ACCRUAL,
a.PERSONAL_ACCRUAL,
a.UNIT_PENSION_SET,
a.UNIT_MEDICAL_SET,
a.UNIT_UNEMPLOYMENT_SET,
a.UNIT_INJURY_SET,
a.UNIT_BIRTH_SET,
a.UNIT_PENSION_MONEY,
a.UNIT_MEDICAL_MONEY,
a.UNIT_UNEMPLOYMENT_MONEY,
a.UNIT_INJURY_MONEY,
a.UNIT_BIRTH_MONEY,
a.UNIT_BIGMAILMENT_MONEY,
a.PERSONAL_PENSION_MONEY,
a.PERSONAL_MEDICAL_MONEY,
a.PERSONAL_UNEMPLOYMENT_MONEY,
a.PERSONAL_BIGMAILMENT_MONEY,
a.PROVIDENT_NO,
a.UNIT_PROVIDENT_SET,
a.PROVIDENT_PERCENT,
a.PERSONAL_PROIDENT_SET,
SUM( a.UNIT_PROVIDENT_SUM ) AS UNIT_PROVIDENT_SUM
FROM t_payment_info a
<where>
IFNULL(a.FUND_ID,'1') != '1'
<include refid="tPaymentInfo_export_where"/>
</where>
GROUP BY a.EMP_IDCARD,a.PROVIDENT_PAY_MONTH,a.PROVIDENT_CREATE_MONTH,a.SETTLE_DOMAIN_CODE
)
) w
GROUP BY w.keyGroup
</select>
<!--tPaymentInfo不分页查询-->
<select id="getTPaymentInfoNoPage" resultMap="tPaymentInfoBatchMap">
SELECT
......
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