Commit 22ffc8e8 authored by 李灿灿's avatar 李灿灿

Merge branch 'develop' into feature-licancan

parents e62320a5 a07eea68
......@@ -80,9 +80,15 @@ public class DeptChangeCheckParam implements Serializable {
private String errorMessage;
/**
* 结算方式
* 新项目结算方式
*/
@Schema(description = "结算方式")
private Integer settleType;
private Integer newSettleType;
/**
* 旧项目结算方式
*/
@Schema(description = "结算方式")
private Integer oldSettleType;
}
......@@ -2340,12 +2340,15 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
Map<String, List<DeptChangeCheckParam>> stringListMap = deptChangeCheck(deptChangeCheckList);
//todo 生成EKP通知,通知ekp变更结算所属项目
List<DeptChangeCheckParam> successList = stringListMap.get("successList");
if(CollectionUtils.isNotEmpty(successList)){
for (DeptChangeCheckParam success : successList) {
Integer newSettleType = success.getNewSettleType();
Integer oldSettleType = success.getOldSettleType();
LambdaUpdateWrapper<TInsuranceDetail> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TInsuranceDetail ::getId,success.getId())
.set(TInsuranceDetail :: getDeptNo,success.getNewDeptNo())
.set(TInsuranceDetail :: getSettleType,success.getSettleType())
.set(TInsuranceDetail :: getSettleType,success.getNewSettleType())
.set(TInsuranceDetail :: getUpdateBy,user.getId())
.set(TInsuranceDetail :: getUpdateTime,LocalDateTime.now());
update(updateWrapper);
......@@ -2806,25 +2809,29 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
errorList.add(param);
continue;
}
//查询结算状态
LambdaQueryWrapper<TInsuranceSettle> insuranceSettleQuery = new LambdaQueryWrapper<>();
insuranceSettleQuery.eq(TInsuranceSettle :: getInsDetailId,insuranceDetail.getId());
TInsuranceSettle insuranceSettle = tInsuranceSettleService.getOne(insuranceSettleQuery);
//当前结算状态为结算中时,不能变更结算月
if (CommonConstants.TWO_STRING.equals(insuranceSettle.getSettleHandleStatus())){
param.setErrorMessage(InsurancesConstants.SETTLE_MONTH_CHANGE_SETTLE_STATUS_TWO_ERROR);
errorList.add(param);
continue;
}
//当前结算状态为已结算时,不能变更结算月
if (CommonConstants.THREE_STRING.equals(insuranceSettle.getSettleHandleStatus())){
param.setErrorMessage(InsurancesConstants.SETTLE_MONTH_CHANGE_SETTLE_STATUS_THREE_ERROR);
errorList.add(param);
continue;
String defaultSettleId = insuranceDetail.getDefaultSettleId();
if(StringUtils.isNotEmpty(defaultSettleId)){
//查询结算状态
LambdaQueryWrapper<TInsuranceSettle> insuranceSettleQuery = new LambdaQueryWrapper<>();
insuranceSettleQuery.eq(TInsuranceSettle :: getInsDetailId,insuranceDetail.getId());
TInsuranceSettle insuranceSettle = tInsuranceSettleService.getOne(insuranceSettleQuery);
if (!Common.isEmpty(insuranceSettle)){
//当前结算状态为结算中时,不能变更结算月
if (CommonConstants.TWO_STRING.equals(insuranceSettle.getSettleHandleStatus())){
param.setErrorMessage(InsurancesConstants.SETTLE_MONTH_CHANGE_SETTLE_STATUS_TWO_ERROR);
errorList.add(param);
continue;
}
//当前结算状态为已结算时,不能变更结算月
if (CommonConstants.THREE_STRING.equals(insuranceSettle.getSettleHandleStatus())){
param.setErrorMessage(InsurancesConstants.SETTLE_MONTH_CHANGE_SETTLE_STATUS_THREE_ERROR);
errorList.add(param);
continue;
}
}
}
Integer reduceHandleStatus = insuranceDetail.getReduceHandleStatus();
//当前保单信息的为已减员时不能不能变更结算月
if( CommonConstants.FOUR_INT == reduceHandleStatus ){
if( CommonConstants.FIVE_INT == insuranceDetail.getBuyHandleStatus() ){
param.setErrorMessage(InsurancesConstants.SETTLE_MONTH_CHANGE_REFUND_STATUS_FOUR_ERROR);
errorList.add(param);
continue;
......@@ -2951,7 +2958,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
errorList.add(param);
continue;
}else {
param.setSettleType(Integer.parseInt(settleType));
param.setNewSettleType(Integer.parseInt(settleType));
}
}
}
......@@ -2988,28 +2995,30 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
errorList.add(param);
continue;
}
Integer reduceHandleStatus = insuranceDetail.getReduceHandleStatus();
//当前保单信息的为已减员时,不能变更结算项目
if( CommonConstants.FOUR_INT == reduceHandleStatus ){
if( CommonConstants.FIVE_INT == insuranceDetail.getBuyHandleStatus() ){
param.setErrorMessage(InsurancesConstants.DEPT_NO_CHANGE_REFUND_STATUS_FOUR_ERROR);
errorList.add(param);
continue;
}
//查询结算状态
LambdaQueryWrapper<TInsuranceSettle> insuranceSettleQuery = new LambdaQueryWrapper<>();
insuranceSettleQuery.eq(TInsuranceSettle :: getInsDetailId,insuranceDetail.getId());
TInsuranceSettle insuranceSettle = tInsuranceSettleService.getOne(insuranceSettleQuery);
//当前结算状态为结算中时,不能变更结算项目
if (CommonConstants.TWO_STRING.equals(insuranceSettle.getSettleHandleStatus())){
param.setErrorMessage(InsurancesConstants.DEPT_NO_CHANGE_SETTLE_STATUS_TWO_ERROR);
errorList.add(param);
continue;
}
//当前结算状态为已结算时,不能变更结算项目
if (CommonConstants.THREE_STRING.equals(insuranceSettle.getSettleHandleStatus())){
param.setErrorMessage(InsurancesConstants.DEPT_NO_CHANGE_SETTLE_STATUS_THREE_ERROR);
errorList.add(param);
continue;
String defaultSettleId = insuranceDetail.getDefaultSettleId();
if (StringUtils.isNotBlank(defaultSettleId)){
//查询结算状态
LambdaQueryWrapper<TInsuranceSettle> insuranceSettleQuery = new LambdaQueryWrapper<>();
insuranceSettleQuery.eq(TInsuranceSettle :: getInsDetailId,insuranceDetail.getId());
TInsuranceSettle insuranceSettle = tInsuranceSettleService.getOne(insuranceSettleQuery);
//当前结算状态为结算中时,不能变更结算项目
if (CommonConstants.TWO_STRING.equals(insuranceSettle.getSettleHandleStatus())){
param.setErrorMessage(InsurancesConstants.DEPT_NO_CHANGE_SETTLE_STATUS_TWO_ERROR);
errorList.add(param);
continue;
}
//当前结算状态为已结算时,不能变更结算项目
if (CommonConstants.THREE_STRING.equals(insuranceSettle.getSettleHandleStatus())){
param.setErrorMessage(InsurancesConstants.DEPT_NO_CHANGE_SETTLE_STATUS_THREE_ERROR);
errorList.add(param);
continue;
}
}
//判断当前数据中是否存在重复数据
param.setId(insuranceDetail.getId());
......
......@@ -32,6 +32,7 @@ import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.math.BigDecimal;
import java.util.List;
import java.util.Set;
/**
* 预估费用
......@@ -157,10 +158,10 @@ public class TForecastLibrary extends BaseEntity {
@ExcelProperty("个人医疗费用")
private BigDecimal personalMedicalFee;
/**
* 个人工伤费用
* 个人失业费用
*/
@ExcelAttribute(name = "个人工伤费用")
@ExcelProperty("个人工伤费用")
@ExcelAttribute(name = "个人失业费用")
@ExcelProperty("个人失业费用")
private BigDecimal personalUnemploymentFee;
/**
* 个人医疗救助金
......@@ -197,70 +198,76 @@ public class TForecastLibrary extends BaseEntity {
@ExcelProperty("公积金生成月份")
private String providentCreateMonth;
/**
* 单位社保金额
* 单位社保合计
*/
@ExcelAttribute(name = "单位社保金额")
@ExcelProperty("单位社保金额")
@ExcelAttribute(name = "单位社保合计")
@ExcelProperty("单位社保合计")
private BigDecimal unitSocialSum;
/**
* 单位公积金金额
* 单位公积金合计
*/
@ExcelAttribute(name = "单位公积金金额")
@ExcelProperty("单位公积金金额")
@ExcelAttribute(name = "单位公积金合计")
@ExcelProperty("单位公积金合计")
private BigDecimal unitFundSum;
/**
* 个人社保金额
* 个人社保合计
*/
@ExcelAttribute(name = "个人社保金额")
@ExcelProperty("个人社保金额")
@ExcelAttribute(name = "个人社保合计")
@ExcelProperty("个人社保合计")
private BigDecimal personalSocialSum;
/**
* 个人公积金金额
* 个人公积金合计
*/
@ExcelAttribute(name = "个人公积金金额")
@ExcelProperty("个人公积金金额")
@ExcelAttribute(name = "个人公积金合计")
@ExcelProperty("个人公积金合计")
private BigDecimal personalFundSum;
/**
* 缴纳地-省
* 费用合计
*/
@ExcelAttribute(name = "缴纳地-省", maxLength = 32)
@Length(max = 32, message = "缴纳地-省不能超过32个字符")
@ExcelProperty("缴纳地-省")
@ExcelAttribute(name = "费用合计")
@ExcelProperty("费用合计")
private BigDecimal sumAll;
/**
* 公积金缴纳地-省
*/
@ExcelAttribute(name = "公积金缴纳地-省", maxLength = 32)
@Length(max = 32, message = "公积金缴纳地-省不能超过32个字符")
@ExcelProperty("公积金缴纳地-省")
private String fundProvince;
/**
* 缴纳地-市
*/
@ExcelAttribute(name = "缴纳地-市", maxLength = 32)
@Length(max = 32, message = "缴纳地-市不能超过32个字符")
@ExcelProperty("缴纳地-市")
@ExcelAttribute(name = "公积金缴纳地-市", maxLength = 32)
@Length(max = 32, message = "公积金缴纳地-市不能超过32个字符")
@ExcelProperty("公积金缴纳地-市")
private String fundCity;
/**
* 缴纳地-县
* 公积金缴纳地-县
*/
@ExcelAttribute(name = "缴纳地-县", maxLength = 32)
@Length(max = 32, message = "缴纳地-县不能超过32个字符")
@ExcelProperty("缴纳地-县")
@ExcelAttribute(name = "公积金缴纳地-县", maxLength = 32)
@Length(max = 32, message = "公积金缴纳地-县不能超过32个字符")
@ExcelProperty("公积金缴纳地-县")
private String fundTown;
/**
* 缴纳地-省
* 社保缴纳地-省
*/
@ExcelAttribute(name = "缴纳地-省", maxLength = 32)
@Length(max = 32, message = "缴纳地-省不能超过32个字符")
@ExcelProperty("缴纳地-省")
@ExcelAttribute(name = "社保缴纳地-省", maxLength = 32)
@Length(max = 32, message = "社保缴纳地-省不能超过32个字符")
@ExcelProperty("社保缴纳地-省")
private String socialProvince;
/**
* 缴纳地-市
* 社保缴纳地-市
*/
@ExcelAttribute(name = "缴纳地-市", maxLength = 32)
@Length(max = 32, message = "缴纳地-市不能超过32个字符")
@ExcelProperty("缴纳地-市")
@ExcelAttribute(name = "社保缴纳地-市", maxLength = 32)
@Length(max = 32, message = "社保缴纳地-市不能超过32个字符")
@ExcelProperty("社保缴纳地-市")
private String socialCity;
/**
* 缴纳地-县
* 社保缴纳地-县
*/
@ExcelAttribute(name = "缴纳地-县", maxLength = 32)
@Length(max = 32, message = "缴纳地-县不能超过32个字符")
@ExcelProperty("缴纳地-县")
@ExcelAttribute(name = "社保缴纳地-县", maxLength = 32)
@Length(max = 32, message = "社保缴纳地-县不能超过32个字符")
@ExcelProperty("社保缴纳地-县")
private String socialTown;
/**
* 单位养老基数
......@@ -421,11 +428,11 @@ public class TForecastLibrary extends BaseEntity {
@ExcelProperty("项目档案id")
private String projectId;
/**
* 单位名称
* 客户名称
*/
@ExcelAttribute(name = "单位名称", maxLength = 50)
@Length(max = 50, message = "单位名称不能超过50个字符")
@ExcelProperty("单位名称")
@ExcelAttribute(name = "客户名称", maxLength = 50)
@Length(max = 50, message = "客户名称不能超过50个字符")
@ExcelProperty("客户名称")
private String unitName;
/**
* 项目名称
......@@ -434,6 +441,13 @@ public class TForecastLibrary extends BaseEntity {
@Length(max = 50, message = "项目名称不能超过50个字符")
@ExcelProperty("项目名称")
private String deptName;
/**
* 项目编码
*/
@ExcelAttribute(name = "项目编码", maxLength = 50)
@Length(max = 50, message = "项目编码不能超过50个字符")
@ExcelProperty("项目编码")
private String deptNo;
/**
* 员工类型(字典值,0外包1派遣2代理)
*/
......@@ -482,10 +496,10 @@ public class TForecastLibrary extends BaseEntity {
@ExcelProperty("公积金户")
private String providentHouseholdName;
/**
* 数据同步:0未同步;1已同步
* 同步状态:0未同步;1已同步
*/
@ExcelAttribute(name = "数据同步:0未同步;1已同步")
@ExcelProperty("数据同步:0未同步;1已同步")
@ExcelAttribute(name = "同步状态:0未同步;1已同步")
@ExcelProperty("同步状态:0未同步;1已同步")
private Integer dataPush;
/**
* 类型:0社保;1公积金
......@@ -511,6 +525,9 @@ public class TForecastLibrary extends BaseEntity {
@TableField(exist = false)
private String createTimeEnd;
@TableField(exist = false)
@Schema(description = "导出的表头的Set")
private Set<String> exportFields;
/**
* 查询数据起
**/
......
/*
* 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.format.DateTimeFormat;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
* 预估费用导出Vo
*
* @author hgw
* @date 2022-7-28 15:20:24
*/
@Data
@Schema(description = "预估费用导出Vo")
public class TForecastLibraryExportVo {
@ExcelProperty("主键")
private String id;
@ExcelAttribute(name = "员工编码", maxLength = 32)
@ExcelProperty("员工编码")
private String empNo;
@ExcelAttribute(name = "员工姓名", maxLength = 32)
@ExcelProperty("员工姓名")
private String empName;
@ExcelAttribute(name = "身份证号", maxLength = 20)
@ExcelProperty("身份证号")
private String empIdcard;
@ExcelAttribute(name = "客户名称", maxLength = 50)
@ExcelProperty("客户名称")
private String unitName;
@ExcelAttribute(name = "项目名称", maxLength = 50)
@ExcelProperty("项目名称")
private String deptName;
@ExcelAttribute(name = "项目编码", maxLength = 50)
@ExcelProperty("项目编码")
private String deptNo;
@ExcelAttribute(name = "单位养老费用")
@ExcelProperty("单位养老费用")
private BigDecimal unitPensionFee;
@ExcelAttribute(name = "单位医疗费用")
@ExcelProperty("单位医疗费用")
private BigDecimal unitMedicalFee;
@ExcelAttribute(name = "单位失业费用")
@ExcelProperty("单位失业费用")
private BigDecimal unitUnemploymentFee;
@ExcelAttribute(name = "单位工伤费用")
@ExcelProperty("单位工伤费用")
private BigDecimal unitWorkInjuryFee;
@ExcelAttribute(name = "单位生育费用")
@ExcelProperty("单位生育费用")
private BigDecimal unitBirthFee;
@ExcelAttribute(name = "单位大病救助")
@ExcelProperty("单位大病救助")
private BigDecimal unitBitailmentFee;
@ExcelAttribute(name = "个人养老费用")
@ExcelProperty("个人养老费用")
private BigDecimal personalPensionFee;
@ExcelAttribute(name = "个人医疗费用")
@ExcelProperty("个人医疗费用")
private BigDecimal personalMedicalFee;
@ExcelAttribute(name = "个人失业费用")
@ExcelProperty("个人失业费用")
private BigDecimal personalUnemploymentFee;
@ExcelAttribute(name = "个人大病费用")
@ExcelProperty("个人大病费用")
private BigDecimal personalBigailmentFee;
@ExcelAttribute(name = "社保缴纳月份", maxLength = 6)
@ExcelProperty("社保缴纳月份")
private String socialPayMonth;
@ExcelAttribute(name = "社保生成月份", maxLength = 6)
@ExcelProperty("社保生成月份")
private String socialCreateMonth;
@ExcelAttribute(name = "公积金缴纳月份", maxLength = 6)
@ExcelProperty("公积金缴纳月份")
private String providentPayMonth;
@ExcelAttribute(name = "公积金生成月份", maxLength = 6)
@ExcelProperty("公积金生成月份")
private String providentCreateMonth;
@ExcelAttribute(name = "单位社保合计")
@ExcelProperty("单位社保合计")
private BigDecimal unitSocialSum;
@ExcelAttribute(name = "单位公积金合计")
@ExcelProperty("单位公积金合计")
private BigDecimal unitFundSum;
@ExcelAttribute(name = "个人社保合计")
@ExcelProperty("个人社保合计")
private BigDecimal personalSocialSum;
@ExcelAttribute(name = "个人公积金合计")
@ExcelProperty("个人公积金合计")
private BigDecimal personalFundSum;
@ExcelAttribute(name = "费用合计")
@ExcelProperty("费用合计")
private BigDecimal sumAll;
@ExcelAttribute(name = "公积金缴纳地-省", isArea = true)
@ExcelProperty("公积金缴纳地-省")
private String fundProvince;
@ExcelAttribute(name = "公积金缴纳地-市", isArea = true, parentField = "fundProvince")
@ExcelProperty("公积金缴纳地-市")
private String fundCity;
@ExcelAttribute(name = "公积金缴纳地-县", isArea = true, parentField = "fundCity")
@ExcelProperty("公积金缴纳地-县")
private String fundTown;
@ExcelAttribute(name = "社保缴纳地-省", isArea = true)
@ExcelProperty("社保缴纳地-省")
private String socialProvince;
@ExcelAttribute(name = "社保缴纳地-市", isArea = true, parentField = "socialProvince")
@ExcelProperty("社保缴纳地-市")
private String socialCity;
@ExcelAttribute(name = "社保缴纳地-县", isArea = true, parentField = "socialCity")
@ExcelProperty("社保缴纳地-县")
private String socialTown;
@ExcelAttribute(name = "单位养老基数")
@ExcelProperty("单位养老基数")
private BigDecimal unitPensionBase;
@ExcelAttribute(name = "单位医疗基数")
@ExcelProperty("单位医疗基数")
private BigDecimal unitMedicalBase;
@ExcelAttribute(name = "单位失业基数")
@ExcelProperty("单位失业基数")
private BigDecimal unitUnemploymentBase;
@ExcelAttribute(name = "单位工伤基数")
@ExcelProperty("单位工伤基数")
private BigDecimal unitInjuryBase;
@ExcelAttribute(name = "单位生育基数")
@ExcelProperty("单位生育基数")
private BigDecimal unitBirthBase;
@ExcelAttribute(name = "个人养老基数")
@ExcelProperty("个人养老基数")
private BigDecimal personalPensionBase;
@ExcelAttribute(name = "个人医疗基数")
@ExcelProperty("个人医疗基数")
private BigDecimal personalMedicalBase;
@ExcelAttribute(name = "个人失业基数")
@ExcelProperty("个人失业基数")
private BigDecimal personalUnemploymentBase;
@ExcelAttribute(name = "个人大病基数")
@ExcelProperty("个人大病基数")
private BigDecimal personalBigailmentBase;
@ExcelAttribute(name = "单位大病基数")
@ExcelProperty("单位大病基数")
private BigDecimal unitBigailmentBase;
@ExcelAttribute(name = "单位养老比例")
@ExcelProperty("单位养老比例")
private BigDecimal unitPersionPro;
@ExcelAttribute(name = "单位医疗比例")
@ExcelProperty("单位医疗比例")
private BigDecimal unitMedicalPro;
@ExcelAttribute(name = "单位失业比例")
@ExcelProperty("单位失业比例")
private BigDecimal unitUnemploymentPro;
@ExcelAttribute(name = "单位工伤比例")
@ExcelProperty("单位工伤比例")
private BigDecimal unitInjuryPro;
@ExcelAttribute(name = "单位生育比例")
@ExcelProperty("单位生育比例")
private BigDecimal unitBirthPro;
@ExcelAttribute(name = "个人养老比例")
@ExcelProperty("个人养老比例")
private BigDecimal personalPersionPro;
@ExcelAttribute(name = "个人医疗比例")
@ExcelProperty("个人医疗比例")
private BigDecimal personalMedicalPro;
@ExcelAttribute(name = "个人失业比例")
@ExcelProperty("个人失业比例")
private BigDecimal personalUnemploymentPro;
@ExcelAttribute(name = "个人大病比例")
@ExcelProperty("个人大病比例")
private BigDecimal personalBigailmentPro;
@ExcelAttribute(name = "单位大病比例")
@ExcelProperty("单位大病比例")
private BigDecimal unitBigailmentPro;
@ExcelAttribute(name = "单位公积金基数")
@ExcelProperty("单位公积金基数")
private BigDecimal unitFundBase;
@ExcelAttribute(name = "个人公积金基数")
@ExcelProperty("个人公积金基数")
private BigDecimal personalFundBase;
@ExcelAttribute(name = "单位公积金比例")
@ExcelProperty("单位公积金比例")
private BigDecimal unitFundProp;
@ExcelAttribute(name = "个人公积金比例")
@ExcelProperty("个人公积金比例")
private BigDecimal personalFundProp;
@ExcelAttribute(name = "同步状态", readConverterExp = "0=未同步,1=已同步")
@ExcelProperty("同步状态:0未同步;1已同步")
private String dataPush;
@DateTimeFormat("yyyy-MM-dd HH:mm:ss")
@ExcelProperty("数据生成时间")
private LocalDateTime createTime;
@ExcelAttribute(name = "数据类型")
@ExcelProperty("数据类型")
private String diffType;
@ExcelAttribute(name = "类型", readConverterExp = "0=社保,1=公积金")
@ExcelProperty("类型")
private Integer dataType;
}
......@@ -16,12 +16,14 @@
*/
package com.yifu.cloud.plus.v1.yifu.social.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.yifu.cloud.plus.v1.yifu.social.entity.TPaymentInfo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Set;
/**
* 缴费库
......@@ -32,28 +34,31 @@ import java.util.List;
@Data
public class TPaymentInfoSearchVo extends TPaymentInfo {
/**
* 多选导出或删除等操作
*/
@Schema(description = "选中ID,id数组")
private List<String> idList;
@Schema(description = "导出的表头的Set")
private Set<String> exportFields;
/**
* 创建时间区间 [开始时间,结束时间]
*/
@Schema(description = "创建时间区间")
private LocalDateTime[] createTimes;
/**
* @Author fxj
* 查询数据起
**/
@Schema(description = "查询limit 开始")
private int limitStart;
/**
* @Author fxj
* 查询数据止
**/
@Schema(description = "查询limit 数据条数")
private int limitEnd;
/**
* 多选导出或删除等操作
*/
@Schema(description = "选中ID,id数组")
private List<String> idList;
/**
* 创建时间区间 [开始时间,结束时间]
*/
@Schema(description = "创建时间区间")
private LocalDateTime[] createTimes;
/**
* @Author fxj
* 查询数据起
**/
@Schema(description = "查询limit 开始")
private int limitStart;
/**
* @Author fxj
* 查询数据止
**/
@Schema(description = "查询limit 数据条数")
private int limitEnd;
}
......@@ -95,9 +95,9 @@ public class TSocialFundHistoryVo extends RowIndex implements Serializable {
@ExcelProperty("单位公积金基数")
private BigDecimal unitFundBase;
@ExcelAttribute(name = "单位公积金比例")
@Schema(description = "单位公积金比例")
@ExcelProperty("单位公积金比例")
@ExcelAttribute(name = "单位公积金比例(公积金单边比例)")
@Schema(description = "单位公积金比例(公积金单边比例)")
@ExcelProperty("单位公积金比例(公积金单边比例)")
private BigDecimal unitFundProp;
@ExcelAttribute(name = "个人公积金基数")
......
......@@ -6,8 +6,6 @@ public class PreDispatchConstants {
public static final String NO_PENSION_AREA_REDUCE = "获取缴纳地数据失败,请检查养老截止城市或公积金截止城市名称是否合规!";
public static final String NO_PENSION_AREA= "请检查派单缴纳地名称是否合规!";
public static final String SOCIAL_START_DATE_ERROR = "社保起缴月份在可补缴月份之前,请确认后操作!";
public static final String NO_SOCIAL_BASE_SET_INFO = "未找到有效的社保基数配置信息(户+缴纳地+起缴时间)!";
......@@ -27,7 +25,6 @@ public class PreDispatchConstants {
"工伤城市","工伤截止时间","生育城市","生育截止时间","失业城市","失业截止时间","公积金城市","公积金截止时间",
"派单分公司","派单客服","小合同名称","合同类型"};
public static final String HAED_ERROR = "请使用标准模板!";
public static final String POSITION = "服务";
public static final String CONTRACT_NAME = "代理社保";
public static final String DISPATCH_TYPE_ERROR = "派单类型有误,0-派增 1-派减!";
......@@ -40,16 +37,10 @@ public class PreDispatchConstants {
public static final String PRESTATUS_ERROR = "‘是否派单’为是且‘预派单状态’为正常未派单才可派单!";
public static final String CITY = "city";
public static final String TOWN = "town";
public static final String SOCIAL_CITY = "social_city";
public static final String SOCIAL_TOWN = "social_town";
public static final String FUND_CITY = "fund_city";
public static final String FUND_TOWN = "fund_town";
public static final String YES_CH = "是";
public static final String NO_CH = "否";
public static final String DATA_CHECK = "数据校验信息:";
public static final String DATA_HANDLE_RESULT = "数据导入结果:";
public static final String DATA_IMPORT_ANALYSIS_ERROR = "数据导入解析失败!";
public static final String IMPORT_PREDISPATCH = "导出预派单";
public static final String NO_SOCIAL_FUND_ADDRESS_ADD = "派增:养老城市和公积金城市不可同时为空,请确认表中有‘养老城市’和‘公积金城市’数据列及数据!";
public static final String NO_SOCIAL_FUND_ADDRESS_REDUCE = "派减:养老城市和公积金城市不可同时为空,请确认表中有‘养老城市’和‘公积金城市’数据列及数据!";
public static final String TEL_NOT_EMPTY = "联系电话1不可为空!";
......
......@@ -66,19 +66,6 @@ public class TForecastLibraryController {
return new R<>(tForecastLibraryService.getTForecastLibraryPage(page, tForecastLibrary));
}
/**
* 不分页查询
*
* @param tForecastLibrary 预估费用
* @return
*/
@Operation(summary = "不分页查询", description = "不分页查询")
@PostMapping("/noPage")
//@PreAuthorize("@pms.hasPermission('social_tforecastlibrary_get')" )
public R<List<TForecastLibrary>> getTForecastLibraryNoPage(@RequestBody TForecastLibrary tForecastLibrary) {
return R.ok(tForecastLibraryService.noPageDiy(tForecastLibrary));
}
/**
* 通过id查询预估费用
*
......@@ -160,9 +147,9 @@ public class TForecastLibraryController {
@SysLog("按缴纳月重新生成")
@PostMapping("/createForecastlibary")
@PreAuthorize("@pms.hasPermission('social_tforecastlibrary_create')")
public R<String> createForecastlibary(@RequestParam String payMonths,
@RequestParam(value = "empIdCard", required = false) String empIdCard,
@RequestParam(value = "settleDomainIds", required = false) String settleDomainIds) {
public R<String> createForecastlibary(@RequestParam String payMonths
, @RequestParam(value = "empIdCard", required = false) String empIdCard
, @RequestParam(value = "settleDomainIds", required = false) String settleDomainIds) {
if (Common.isEmpty(empIdCard) && Common.isEmpty(settleDomainIds)) {
return R.failed("参数有误:身份证或项目ID不可为空!");
}
......
......@@ -94,7 +94,6 @@ public class TPreDispatchInfoController {
*/
@Operation(summary = "通过id查询", description = "通过id查询:hasPermission('social_tpredispatchinfo_get')")
@GetMapping("/{id}" )
@PreAuthorize("@pms.hasPermission('social_tpredispatchinfo_get')" )
public R<TPreDispatchInfo> getById(@PathVariable("id" ) String id) {
return R.ok(tPreDispatchInfoService.getById(id));
}
......
......@@ -21,9 +21,12 @@ 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.social.entity.TForecastLibrary;
import com.yifu.cloud.plus.v1.yifu.social.vo.TForecastLibraryExportVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 预估费用
*
......@@ -39,4 +42,13 @@ public interface TForecastLibraryMapper extends BaseMapper<TForecastLibrary> {
* @return
*/
IPage<TForecastLibrary> getTForecastLibraryPage(Page<TForecastLibrary> page, @Param("tForecastLibrary") TForecastLibrary tForecastLibrary);
/**
* @Description: 导出
* @Author: hgw
* @Date: 2022/7/28 14:52
* @return: java.util.List<com.yifu.cloud.plus.v1.yifu.social.vo.TForecastLibraryVo>
**/
List<TForecastLibraryExportVo> exportLibrary(@Param("tForecastLibrary") TForecastLibrary tForecastLibrary);
}
......@@ -26,7 +26,6 @@ import com.yifu.cloud.plus.v1.yifu.social.entity.TDispatchInfo;
import com.yifu.cloud.plus.v1.yifu.social.vo.*;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import io.seata.spring.annotation.GlobalTransactional;
import org.springframework.web.bind.annotation.RequestBody;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
......@@ -58,6 +57,9 @@ public interface TDispatchInfoService extends IService<TDispatchInfo> {
R<List<ErrorMessage>> importReduceDiy(InputStream inputStream);
@GlobalTransactional
void batchReduceDispatch(List<TDispatchReduceVo> excelVOList, List<ErrorMessage> errorMessageList);
R<Boolean> removeByIdDiy(String id);
DispatchDetailVo getSocialAndFundInfoById(String id);
......
......@@ -45,8 +45,6 @@ public interface TForecastLibraryService extends IService<TForecastLibrary> {
void listExport(HttpServletResponse response, TForecastLibrary searchVo);
List<TForecastLibrary> noPageDiy(TForecastLibrary searchVo);
/**
* @param payMonths 缴纳月
* @param empIdCard 身份证
......
......@@ -1477,7 +1477,9 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
return R.ok(errorMessageList);
}
private void batchReduceDispatch(List<TDispatchReduceVo> excelVOList, List<ErrorMessage> errorMessageList) {
@GlobalTransactional
@Override
public void batchReduceDispatch(List<TDispatchReduceVo> excelVOList, List<ErrorMessage> errorMessageList) {
if (!Common.isNotNull(excelVOList)){
return;
}
......
......@@ -26,7 +26,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import com.yifu.cloud.plus.v1.yifu.social.constants.SocialConstants;
import com.yifu.cloud.plus.v1.yifu.social.entity.SysBaseSetInfo;
import com.yifu.cloud.plus.v1.yifu.social.entity.TAgentConfig;
......@@ -38,6 +37,7 @@ import com.yifu.cloud.plus.v1.yifu.social.mapper.TForecastLibraryMapper;
import com.yifu.cloud.plus.v1.yifu.social.mapper.TSocialFundInfoMapper;
import com.yifu.cloud.plus.v1.yifu.social.service.TForecastLibraryService;
import com.yifu.cloud.plus.v1.yifu.social.util.ServiceUtil;
import com.yifu.cloud.plus.v1.yifu.social.vo.TForecastLibraryExportVo;
import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
......@@ -88,7 +88,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
public void listExport(HttpServletResponse response, TForecastLibrary searchVo) {
String fileName = "预估费用批量导出" + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表
List<TForecastLibrary> list = new ArrayList<>();
List<TForecastLibraryExportVo> list = new ArrayList<>();
long count = noPageCountDiy(searchVo);
ServletOutputStream out = null;
try {
......@@ -98,17 +98,17 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8"));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
//EasyExcel.write(out, TEmpBadRecord.class).sheet("预估费用").doWrite(list)
ExcelWriter excelWriter = EasyExcel.write(out, TForecastLibrary.class).build();
ExcelWriter excelWriter = EasyExcel.write(out, TForecastLibraryExportVo.class).includeColumnFiledNames(searchVo.getExportFields()).build();
int index = 0;
if (count > CommonConstants.ZERO_INT) {
for (int i = 0; i <= count; ) {
// 获取实际记录
searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = noPageDiy(searchVo);
list = exportLibrary(searchVo);
if (Common.isNotNull(list)) {
ExcelUtil<TForecastLibrary> util = new ExcelUtil<>(TForecastLibrary.class);
for (TForecastLibrary vo : list) {
ExcelUtil<TForecastLibraryExportVo> util = new ExcelUtil<>(TForecastLibraryExportVo.class);
for (TForecastLibraryExportVo vo : list) {
util.convertEntity(vo, null, null, null);
}
}
......@@ -144,17 +144,8 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
}
}
@Override
public List<TForecastLibrary> noPageDiy(TForecastLibrary searchVo) {
LambdaQueryWrapper<TForecastLibrary> wrapper = buildQueryWrapper(searchVo);
if (Common.isNotNull(searchVo.getIdList())) {
wrapper.in(TForecastLibrary::getId, searchVo.getIdList());
}
if (searchVo.getLimitStart() >= 0 && searchVo.getLimitEnd() > 0) {
wrapper.last(" limit " + searchVo.getLimitStart() + "," + searchVo.getLimitEnd());
}
wrapper.orderByDesc(BaseEntity::getCreateTime);
return baseMapper.selectList(wrapper);
private List<TForecastLibraryExportVo> exportLibrary(TForecastLibrary searchVo) {
return baseMapper.exportLibrary(searchVo);
}
private Long noPageCountDiy(TForecastLibrary searchVo) {
......@@ -489,6 +480,9 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
lib.setSocialId(tSocialInfo.getId());
lib.setUnitId(tSocialInfo.getUnitId());
lib.setSettleDomainId(tSocialInfo.getSettleDomain());
lib.setUnitName(tSocialInfo.getUnitName());
lib.setDeptName(tSocialInfo.getSettleDomainName());
lib.setDeptNo(tSocialInfo.getSettleDomainCode());
//判断是否允许补缴 是否可补缴 0:是
Integer monthT = this.getOverpayMonth(tSocialInfo);
......@@ -639,6 +633,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
library.setFundCity(null);
library.setFundTown(null);
}
library.setSumAll(BigDecimalUtils.safeAdd(library.getUnitSocialSum(), library.getPersonalSocialSum(), library.getUnitFundSum(), library.getPersonalFundSum()));
return library;
}
......@@ -1135,9 +1130,9 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
socialFund.setPersonalProvidentCardinal(socialSet.getUpperLimit());
}
//单边小数点处理逻辑
if (Common.isNotNull(socialSet.getFundPayPoint())){
socialFund.setUnitFundSum(Common.formatMoneyForFund(BigDecimalUtils.safeMultiply(socialFund.getUnitProvidengCardinal(), socialFund.getUnitProvidentPer(),BigDecimal.valueOf(CommonConstants.ONE_OF_PERCENT.doubleValue())),Integer.valueOf(socialFund.getFundPayPoint())));
socialFund.setPersonalFundSum(Common.formatMoneyForFund(BigDecimalUtils.safeMultiply(socialFund.getPersonalProvidentCardinal(), socialFund.getPersonalProvidentPer(),BigDecimal.valueOf(CommonConstants.ONE_OF_PERCENT.doubleValue())),Integer.valueOf(socialFund.getFundPayPoint())));
if (Common.isNotNull(socialSet.getFundPayPoint())) {
socialFund.setUnitFundSum(Common.formatMoneyForFund(BigDecimalUtils.safeMultiply(socialFund.getUnitProvidengCardinal(), socialFund.getUnitProvidentPer(), BigDecimal.valueOf(CommonConstants.ONE_OF_PERCENT.doubleValue())), Integer.valueOf(socialFund.getFundPayPoint())));
socialFund.setPersonalFundSum(Common.formatMoneyForFund(BigDecimalUtils.safeMultiply(socialFund.getPersonalProvidentCardinal(), socialFund.getPersonalProvidentPer(), BigDecimal.valueOf(CommonConstants.ONE_OF_PERCENT.doubleValue())), Integer.valueOf(socialFund.getFundPayPoint())));
}
}
}
......@@ -1257,6 +1252,9 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
lib.setProvidentId(providentFund.getId());
lib.setUnitId(providentFund.getUnitIdFund());
lib.setSettleDomainId(providentFund.getSettleDomainFund());
lib.setUnitName(providentFund.getUnitName());
lib.setDeptName(providentFund.getSettleDomainName());
lib.setDeptNo(providentFund.getSettleDomainCode());
//判断是否允许补缴 是否可补缴 0:是
Integer monthT = null;
......
......@@ -138,7 +138,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
response.setCharacterEncoding("utf-8");
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8"));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter excelWriter = EasyExcel.write(out, TPaymentInfo.class).build();
ExcelWriter excelWriter = EasyExcel.write(out, TPaymentInfo.class).includeColumnFiledNames(searchVo.getExportFields()).build();;
int index = 0;
if (count > CommonConstants.ZERO_INT) {
for (int i = 0; i <= count; ) {
......
......@@ -36,7 +36,11 @@ import com.yifu.cloud.plus.v1.yifu.insurances.util.ValidityUtil;
import com.yifu.cloud.plus.v1.yifu.social.constants.PreDispatchConstants;
import com.yifu.cloud.plus.v1.yifu.social.entity.*;
import com.yifu.cloud.plus.v1.yifu.social.mapper.*;
import com.yifu.cloud.plus.v1.yifu.social.service.TDispatchInfoService;
import com.yifu.cloud.plus.v1.yifu.social.service.TPreDispatchInfoService;
import com.yifu.cloud.plus.v1.yifu.social.util.ServiceUtil;
import com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchImportVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchReduceVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TPreDispatchExportVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TPreDispatchUpdateVo;
import lombok.RequiredArgsConstructor;
......@@ -79,6 +83,9 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
@Autowired
private TSocialInfoMapper socialInfoMapper;
@Autowired
private TDispatchInfoService dispatchInfoService;
/**
* 预派单记录简单分页查询
*
......@@ -326,12 +333,6 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
}
List<TSettleDomainSelectVo> settleDomainR = null;
R<TSettleDomainListVo> listVo = null;
//项目名称map key:项目id value:项目名称
Map<String, String> settleDomainNameMap = new HashMap<>();
//客户名称map key:客户id value:客户名称
Map<String, String> customerNameMap = new HashMap<>();
//项目客户关系map key:项目id value:客户id
Map<String, String> settleIdAndCustomerIdMap = new HashMap<>();
listVo = archivesDaprUtil.selectAllSettleDomainSelectVos();
if (Common.isNotNull(listVo)) {
TSettleDomainListVo tSettleDomainListVo = listVo.getData();
......@@ -339,8 +340,6 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
settleDomainR = tSettleDomainListVo.getListSelectVO();
}
}
//map数据封装
initSettleDomainMaps(settleDomainR, settleDomainNameMap, customerNameMap, settleIdAndCustomerIdMap);
TPreDispatchInfo preInfo = baseMapper.selectById(id);
if (null == preInfo){
return R.failed(CommonConstants.ERROR_NO_DOMAIN);
......@@ -355,30 +354,57 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
HashMap<String,SysArea> areaMap = new HashMap<>();
HashMap<String,SysArea> areaIdMap = new HashMap<>();
// 派单派增处理
//todo
if (CommonConstants.ZERO_STRING.equals(preInfo.getType())) {
// EmployeeSocialFundImportVo importVo = new EmployeeSocialFundImportVo();
// // 初始化派增的派单数据
// initDispatchAddVo(preInfo, importVo);
// List<EmployeeSocialFundImportVo> importVoList = new ArrayList<>();
// importVoList.add(importVo);
// importVoList.add(importVo);
// // 如果档案地市空 只能用缴纳地封装,如果缴纳地有问题直接返回
// if (null == importVo.getFileCity()) {
// initAreaMap(areaMap, areaIdMap);
// // 处理 档案地市
// errorMessageList = handleFileAddress(1, preInfo, areaMap, areaIdMap, importVo, errorMessageList);
// }
// // 档案地市没问题 开始派单处理
// if (Common.isEmpty(errorMessageList)) {
// errorMessageList = dispatchInfoService.batchSaveEmployeeContractSocialFund(importVoList,
// settleIdAndCustomerIdMap, settleDomainNameMap, customerNameMap, user);
// }
// // 处理派增结果
// errorMessage = handleDispatchAddRes(preInfo, errorMessageList);
// if (null != errorMessage) {
// return errorMessage;
// }
TDispatchImportVo importVo = new TDispatchImportVo();
// 初始化派增的派单数据
initDispatchAddVo(preInfo, importVo);
List<TDispatchImportVo> importVoList = new ArrayList<>();
importVoList.add(importVo);
// 如果档案地市空 只能用缴纳地封装,如果缴纳地有问题直接返回
if (null == importVo.getFileCity()) {
R<AreaVo> areaListR = upmsDaprUtils.getAreaListR();
if (null == areaListR || areaListR.getCode() != CommonConstants.SUCCESS) {
return R.failed(PreDispatchConstants.GET_AREA_INFO);
}
initAreaMap(areaMap, areaIdMap, areaListR);
// 处理 档案地市
errorMessageList = handleFileAddress(1, preInfo, areaMap, areaIdMap, importVo, errorMessageList);
}
// 档案地市没问题 开始派单处理
if (Common.isEmpty(errorMessageList)) {
dispatchInfoService.importTDispatchInfo(importVoList, errorMessageList, user);
}
// 处理派增结果
errorMessage = handleDispatchAddRes(preInfo, errorMessageList);
if (null != errorMessage) {
return errorMessage;
}
}
// 派单派减处理
if (CommonConstants.ONE_STRING.equals(preInfo.getType())){
TDispatchReduceVo dispatchReduceVo = new TDispatchReduceVo();
dispatchReduceVo.setEmpName(preInfo.getEmpName());
dispatchReduceVo.setEmpIdcard(preInfo.getEmpIdcard());
if (Common.isNotNull(preInfo.getLeaveDate())){
dispatchReduceVo.setLeaveDate(preInfo.getLeaveDate());
}
dispatchReduceVo.setReasonType(preInfo.getLeaveReasonAdd());
dispatchReduceVo.setTrustRemark(preInfo.getLeaveReason());
if (Common.isNotNull(preInfo.getPensionEndReduce())) {
dispatchReduceVo.setSocialReduceDate(DateUtil.getFirstDay(preInfo.getPensionEndReduce()));
}
if (Common.isNotNull(preInfo.getFundEndReduce())){
dispatchReduceVo.setFundReduceDate(DateUtil.getFirstDay(preInfo.getFundEndReduce()));
}
List<TDispatchReduceVo> dispatchImportList = new ArrayList<>();
dispatchImportList.add(dispatchReduceVo);
dispatchInfoService.batchReduceDispatch(dispatchImportList, errorMessageList);
// 处理派减结果
errorMessage = handleDispatchAddRes(preInfo,errorMessageList);
if (null != errorMessage){
return errorMessage;
}
}
return R.ok();
}
......@@ -441,9 +467,8 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
// 封装需要派减的社保或公积金信息
initReduceSocialFundInfo(preList, socialMap, fundMap);
// 开始处理派增
List<ErrorMessage> errorMessageList;
List<ErrorMessage> errorMessageList = new ArrayList<>();
List<ErrorMessage> errorMsgList = new ArrayList<>();
TDispatchInfo dispatchInfo;
R<Boolean> res;
HashMap<String, SysArea> areaMap = new HashMap<>();
HashMap<String, SysArea> areaIdMap = new HashMap<>();
......@@ -454,40 +479,28 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
continue;
}
// 派单派增处理
//todo
// batchDispatchAdd(settleDomainNameMap, customerNameMap, settleIdAndCustomerIdMap, user, errorMsgList, i, pre,
// areaMap, areaIdMap);
batchDispatchAdd(settleDomainNameMap, customerNameMap, settleIdAndCustomerIdMap, user, errorMsgList, i, pre,
areaMap, areaIdMap);
// 派单派减处理
if (CommonConstants.ONE_STRING.equals(pre.getType())) {
dispatchInfo = new TDispatchInfo();
dispatchInfo.setEmpName(pre.getEmpName());
dispatchInfo.setEmpIdcard(pre.getEmpIdcard());
dispatchInfo.setEmpType(pre.getEmpTypeAdd());
dispatchInfo.setType(pre.getType());
dispatchInfo.setReduceReason(pre.getLeaveReasonAdd());
dispatchInfo.setReduceRemark(pre.getLeaveReason());
dispatchInfo.setTrustRemark(pre.getLeaveReason());
dispatchInfo.setBelongUnitName(customerNameMap.get(pre.getUnitIdAdd()));
dispatchInfo.setSettleDomainName(settleIdAndCustomerIdMap.get(pre.getDepartIdAdd()));
dispatchInfo.setFileAddr(pre.getPayAddress());
dispatchInfo.setPost(pre.getPositionAdd());
dispatchInfo.setEmpMobile(pre.getTelTwo());
// 处理派减派单时间
dispatchReduce(dispatchInfo, pre);
// 查看是否可以派减社保或公积金
res = handleBatchSocialFundReduce(pre, dispatchInfo, socialMap.get(pre.getEmpIdcard()), fundMap.get(pre.getEmpIdcard()));
if (res != null) {
errorMsgList.add(new ErrorMessage(i, pre.getEmpIdcard() + CommonConstants.COLON_STRING + res.getMsg()));
} else {
List<TDispatchInfo> dispatchImportList = new ArrayList<>();
dispatchImportList.add(dispatchInfo);
//todo
// errorMessageList = dispatchInfoService.batchDispatchReduce(dispatchImportList, settleIdAndCustomerIdMap, user);
// 处理派减结果
// handleDispatchAddRes(pre, errorMessageList);
// 重新组装数据
// resetMessageList(pre, errorMessageList, errorMsgList, i + 1);
TDispatchReduceVo dispatchReduceVo = new TDispatchReduceVo();
dispatchReduceVo.setEmpName(pre.getEmpName());
dispatchReduceVo.setEmpIdcard(pre.getEmpIdcard());
if (null != pre.getLeaveDate()){
dispatchReduceVo.setLeaveDate(pre.getLeaveDate());
}
dispatchReduceVo.setReasonType(pre.getLeaveReasonAdd());
dispatchReduceVo.setTrustRemark(pre.getLeaveReason());
// 处理派减派单时间
dispatchReduce(dispatchReduceVo, pre);
List<TDispatchReduceVo> dispatchImportList = new ArrayList<>();
dispatchImportList.add(dispatchReduceVo);
dispatchInfoService.batchReduceDispatch(dispatchImportList, errorMessageList);
//处理派减结果
handleDispatchAddRes(pre, errorMessageList);
//重新组装数据
resetMessageList(pre, errorMessageList, errorMsgList, i + 1);
}
}
return R.ok(errorMsgList);
......@@ -1048,8 +1061,8 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
* @param selectVo
* @param info
* @return
* @Author fxj
* @Date 2020-12-31
* @Author huyc
* @Date 2022-07-18
**/
private void initBaseInfo(String socialHouse, String fundHouse, TSettleDomainSelectVo selectVo, TPreDispatchInfo info) {
info.setType(CommonConstants.ZERO_STRING);
......@@ -2129,7 +2142,7 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
* @Date 2022-07-18
* @return
**/
private void dispatchReduce(TDispatchInfo dispatchInfo, TPreDispatchInfo pre) {
private void dispatchReduce(TDispatchReduceVo dispatchInfo, TPreDispatchInfo pre) {
if (Common.isNotNull(pre.getPensionEndReduce())) {
dispatchInfo.setSocialReduceDate(DateUtil.getFirstDay(pre.getPensionEndReduce()));
}
......@@ -2141,4 +2154,214 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
}
}
/**
* 初始化派增的派单数据
* @param preInfo
* @param importVo
* @Author huyc
* @Date 2022-07-18
* @return
**/
private void initDispatchAddVo(TPreDispatchInfo preInfo, TDispatchImportVo importVo) {
importVo.setEmpName(preInfo.getEmpName());
importVo.setEmpIdcard(preInfo.getEmpIdcard());
importVo.setEmpType(CommonConstants.TWO_STRING);
importVo.setEmpMobile(preInfo.getTelTwo());
importVo.setCustomerId(preInfo.getUnitIdAdd());
importVo.setCustomerCode(preInfo.getUnitNameAdd());
importVo.setSettleDomainId(preInfo.getDepartIdAdd());
importVo.setIdCardAddress(preInfo.getPayAddress());
importVo.setPost(preInfo.getPositionAdd());
importVo.setWorkingHours(preInfo.getWorkingHoursAdd());
importVo.setEmpNational(CommonConstants.ONE_STRING);
importVo.setEducationName(CommonConstants.FIVE_STRING);
if (null != preInfo.getPensionBase()){
importVo.setRecordBase(preInfo.getPensionBase().toString());
}
// 封装合同信息
initDispatchContractVo(preInfo, importVo);
// 封装社保派单信息
if (Common.isNotNull(preInfo.getSocialHouseAdd()) &&
Common.isNotNull(preInfo.getSocialProvince()) &&
Common.isNotNull(preInfo.getPensionStart())){
importVo.setPensionStart(DateUtil.getFirstDay(preInfo.getPensionStart()));
if (Common.isNotNull(preInfo.getPensionAddress())){
importVo.setSocialHousehold(preInfo.getSocialHouseAdd());
}
SysBaseSetInfo socialBaseSet = getSysBaseSetInfo(preInfo.getSocialProvince(),preInfo.getSocialCity(),
preInfo.getSocialTown(),preInfo.getSocialHouseAdd(),CommonConstants.ZERO_STRING);
// 初始化派单的社保基数
initDispatchSocialBase(preInfo, importVo, socialBaseSet);
}
// 封装公积金派单信息
initDispatchAddFund(preInfo, importVo);
}
private List<ErrorMessage> handleFileAddress(int i, TPreDispatchInfo pre,
HashMap<String, SysArea> areaMap,
HashMap<String, SysArea> areaIdMap,
TDispatchImportVo importVo,
List<ErrorMessage> errorMessageList) {
SysArea area = areaMap.get(pre.getPayAddress());
if (null == area || null == area.getParentId() || 0 == area.getParentId().intValue()){
errorMessageList = new ArrayList<>();
errorMessageList.add(new ErrorMessage(i+1,"缴费地址不存在或缴费地址不可为省!"));
}else {
SysArea areaParent = areaIdMap.get(area.getParentId());
if (null != areaParent && null != areaParent.getParentId() && 0 != areaParent.getParentId().intValue()) {
importVo.setFileProvince(areaParent.getParentId().toString());
importVo.setFileCity(areaParent.getId().toString());
importVo.setFileTown(area.getId().toString());
}else {
importVo.setFileProvince(area.getParentId().toString());
importVo.setFileCity(area.getId().toString());
importVo.setFileTown(null);
}
}
return errorMessageList;
}
/**
* 封装合同信息
* @param preInfo
* @param importVo
* @Author huyc
* @Date 2022-07-18
* @return
**/
private void initDispatchContractVo(TPreDispatchInfo preInfo, TDispatchImportVo importVo) {
if (Common.isNotNull(preInfo.getContractNameAdd())){
importVo.setContractName(CommonConstants.THREE_STRING);
if (Common.isNotNull(preInfo.getContractStartAdd())){
importVo.setContractStart(DateUtil.stringToDate(ServiceUtil.
replaceSeparator(preInfo.getContractStartAdd(),CommonConstants.CENTER_SPLIT_LINE_STRING,
CommonConstants.SLASH_SPLIT_LINE_STRING), DateUtil.ISO_DATE_FORMAT));
}
if (Common.isNotNull(preInfo.getContractEndAdd())){
importVo.setContractEnd(DateUtil.stringToDate(ServiceUtil.
replaceSeparator(preInfo.getContractEndAdd(), CommonConstants.CENTER_SPLIT_LINE_STRING,
CommonConstants.SLASH_SPLIT_LINE_STRING), DateUtil.ISO_DATE_FORMAT));
}
importVo.setContractTerm(CommonConstants.TWO_STRING);
importVo.setContractType(CommonConstants.ONE_STRING);
importVo.setContractSubName(PreDispatchConstants.CONTRACT_NAME);
}
}
/**
* 初始化派单的社保基数
* @Author huyc
* @Date 2022-07-18
* @param preInfo
* @param importVo
* @param socialBaseSet
* @return
**/
private void initDispatchSocialBase(TPreDispatchInfo preInfo, TDispatchImportVo importVo, SysBaseSetInfo socialBaseSet) {
if (Common.isNotNull(preInfo.getSocialProvince())){
importVo.setFileProvince(preInfo.getSocialProvince());
importVo.setIdCardProvince(preInfo.getSocialProvince());
}
if (Common.isNotNull(preInfo.getSocialCity())){
importVo.setFileCity(preInfo.getSocialCity());
importVo.setIdCardCity(preInfo.getSocialCity());
}
if (Common.isNotNull(preInfo.getSocialTown())){
importVo.setFileTown(preInfo.getSocialTown());
importVo.setIdCardTown(preInfo.getSocialTown());
}
if (null != socialBaseSet){
// 最低
if (socialBaseSet.getLowerLimit().compareTo(Common.isBlankToBigDecimalZero(preInfo.getPensionBase())) ==
CommonConstants.ZERO_INT){
importVo.setPaymentType(CommonConstants.ZERO_STRING);
// 最高
}else if (socialBaseSet.getUpperLimit().compareTo(Common.isBlankToBigDecimalZero(preInfo.getPensionBase())) ==
CommonConstants.ZERO_INT){
importVo.setPaymentType(CommonConstants.TWO_STRING);
}else {
importVo.setPaymentType(CommonConstants.ONE_STRING);
}
}else {
importVo.setPaymentType(CommonConstants.ONE_STRING);
}
// 自定义
importVo.setPaymentType(CommonConstants.ONE_STRING);
importVo.setPensionCardinal(preInfo.getPensionBase());
importVo.setMedicalCardinal(preInfo.getPensionBase());
importVo.setUnemploymentCardinal(preInfo.getPensionBase());
importVo.setWorkInjuryCardinal(preInfo.getPensionBase());
importVo.setBirthCardinal(preInfo.getPensionBase());
importVo.setBigailmentCardinal(preInfo.getPensionBase());
}
/**
* 封装公积金派单信息
* @Author huyc
* @Date 2022-07-18
* @param preInfo
* @param importVo
* @return
**/
private void initDispatchAddFund(TPreDispatchInfo preInfo, TDispatchImportVo importVo) {
if (Common.isNotNull(preInfo.getFundStart())){
importVo.setProvidentStart(DateUtil.getFirstDay(preInfo.getFundStart()));
}
if (Common.isNotNull(preInfo.getFundBase())){
importVo.setProvidentCardinal(preInfo.getFundBase());
importVo.setProvidentPer(preInfo.getFundPersonalPer());
}
if (Common.isNotNull(preInfo.getFundAddress())){
importVo.setProvidentHousehold(preInfo.getFundHouseAdd());
}
}
/**
* 批量派单派增处理
* @Author huyc
* @Date 2022-07-18
* @param settleDomainNameMap
* @param customerNameMap
* @param settleIdAndCustomerIdMap
* @param user
* @param errorMsgList
* @param i
* @param pre
* @param areaMap
* @param areaIdMap
* @return
**/
private void batchDispatchAdd(Map<String, String> settleDomainNameMap, Map<String, String> customerNameMap,
Map<String, String> settleIdAndCustomerIdMap, YifuUser user,
List<ErrorMessage> errorMsgList, int i, TPreDispatchInfo pre,
HashMap<String, SysArea> areaMap,
HashMap<String, SysArea> areaIdMap) {
TDispatchImportVo importVo;
List<ErrorMessage> errorMessageList = new ArrayList<>();
if (null != pre && CommonConstants.ZERO_STRING.equals(pre.getType())){
importVo = new TDispatchImportVo();
// 初始化派增的派单数据
initDispatchAddVo(pre, importVo);
List<TDispatchImportVo> importVoList = new ArrayList<>();
importVoList.add(importVo);
// 如果档案地市空 只能用缴纳地封装,如果缴纳地有问题直接返回
if (null == importVo.getFileCity()){
R<AreaVo> areaListR = upmsDaprUtils.getAreaListR();
if (null == areaListR || areaListR.getCode() != CommonConstants.SUCCESS) {
errorMessageList.add(new ErrorMessage(i+1,PreDispatchConstants.GET_AREA_INFO));
}
initAreaMap(areaMap, areaIdMap,areaListR);
// 处理 档案地市
errorMessageList = handleFileAddress(i, pre, areaMap, areaIdMap, importVo, errorMessageList);
}
// 档案地市没问题 开始派单处理
if (Common.isEmpty(errorMessageList)){
dispatchInfoService.importTDispatchInfo(importVoList, errorMessageList, user);
}
// 处理派增结果
handleDispatchAddRes(pre, errorMessageList);
// 重新组装数据
resetMessageList(pre, errorMessageList, errorMsgList, i+1);
}
}
}
......@@ -115,4 +115,16 @@ public class ServiceUtil {
}
return str;
}
public static String replaceSeparator(String string,String str1, String... strn){
if (null != str1) {
string = string.replace(str1,CommonConstants.EMPTY_STRING);
}
if (null != strn) {
for (String str : strn) {
string = string.replace(str,CommonConstants.EMPTY_STRING);
}
}
return string;
}
}
......@@ -51,6 +51,7 @@
<result property="unitFundSum" column="UNIT_FUND_SUM"/>
<result property="personalSocialSum" column="PERSONAL_SOCIAL_SUM"/>
<result property="personalFundSum" column="PERSONAL_FUND_SUM"/>
<result property="sumAll" column="SUM_ALL"/>
<result property="fundProvince" column="FUND_PROVINCE"/>
<result property="fundCity" column="FUND_CITY"/>
<result property="fundTown" column="FUND_TOWN"/>
......@@ -85,6 +86,7 @@
<result property="projectId" column="PROJECT_ID"/>
<result property="unitName" column="UNIT_NAME"/>
<result property="deptName" column="DEPT_NAME"/>
<result property="deptNo" column="DEPT_NO"/>
<result property="empNatrue" column="EMP_NATRUE"/>
<result property="unitInterestFee" column="UNIT_INTEREST_FEE"/>
<result property="personalInterestFee" column="PERSONAL_INTEREST_FEE"/>
......@@ -101,6 +103,69 @@
<result property="updateBy" column="UPDATE_BY"/>
<result property="updateTime" column="UPDATE_TIME"/>
</resultMap>
<!-- 导出 -->
<resultMap id="exportMap" type="com.yifu.cloud.plus.v1.yifu.social.vo.TForecastLibraryExportVo">
<id property="id" column="ID"/>
<result property="empNo" column="EMP_NO"/>
<result property="empName" column="EMP_NAME"/>
<result property="empIdcard" column="EMP_IDCARD"/>
<result property="unitName" column="UNIT_NAME"/>
<result property="deptName" column="DEPT_NAME"/>
<result property="deptNo" column="DEPT_NO"/>
<result property="unitPensionFee" column="UNIT_PENSION_FEE"/>
<result property="unitMedicalFee" column="UNIT_MEDICAL_FEE"/>
<result property="unitUnemploymentFee" column="UNIT_UNEMPLOYMENT_FEE"/>
<result property="unitWorkInjuryFee" column="UNIT_WORK_INJURY_FEE"/>
<result property="unitBirthFee" column="UNIT_BIRTH_FEE"/>
<result property="personalPensionFee" column="PERSONAL_PENSION_FEE"/>
<result property="personalMedicalFee" column="PERSONAL_MEDICAL_FEE"/>
<result property="personalUnemploymentFee" column="PERSONAL_UNEMPLOYMENT_FEE"/>
<result property="personalBigailmentFee" column="PERSONAL_BIGAILMENT_FEE"/>
<result property="unitBitailmentFee" column="UNIT_BITAILMENT_FEE"/>
<result property="socialPayMonth" column="SOCIAL_PAY_MONTH"/>
<result property="socialCreateMonth" column="SOCIAL_CREATE_MONTH"/>
<result property="providentPayMonth" column="PROVIDENT_PAY_MONTH"/>
<result property="providentCreateMonth" column="PROVIDENT_CREATE_MONTH"/>
<result property="unitSocialSum" column="UNIT_SOCIAL_SUM"/>
<result property="unitFundSum" column="UNIT_FUND_SUM"/>
<result property="personalSocialSum" column="PERSONAL_SOCIAL_SUM"/>
<result property="personalFundSum" column="PERSONAL_FUND_SUM"/>
<result property="sumAll" column="SUM_ALL"/>
<result property="fundProvince" column="FUND_PROVINCE"/>
<result property="fundCity" column="FUND_CITY"/>
<result property="fundTown" column="FUND_TOWN"/>
<result property="socialProvince" column="SOCIAL_PROVINCE"/>
<result property="socialCity" column="SOCIAL_CITY"/>
<result property="socialTown" column="SOCIAL_TOWN"/>
<result property="unitPensionBase" column="UNIT_PENSION_BASE"/>
<result property="unitMedicalBase" column="UNIT_MEDICAL_BASE"/>
<result property="unitUnemploymentBase" column="UNIT_UNEMPLOYMENT_BASE"/>
<result property="unitInjuryBase" column="UNIT_INJURY_BASE"/>
<result property="unitBirthBase" column="UNIT_BIRTH_BASE"/>
<result property="personalPensionBase" column="PERSONAL_PENSION_BASE"/>
<result property="personalMedicalBase" column="PERSONAL_MEDICAL_BASE"/>
<result property="personalUnemploymentBase" column="PERSONAL_UNEMPLOYMENT_BASE"/>
<result property="personalBigailmentBase" column="PERSONAL_BIGAILMENT_BASE"/>
<result property="unitBigailmentBase" column="UNIT_BIGAILMENT_BASE"/>
<result property="unitPersionPro" column="UNIT_PERSION_PRO"/>
<result property="unitMedicalPro" column="UNIT_MEDICAL_PRO"/>
<result property="unitUnemploymentPro" column="UNIT_UNEMPLOYMENT_PRO"/>
<result property="unitInjuryPro" column="UNIT_INJURY_PRO"/>
<result property="unitBirthPro" column="UNIT_BIRTH_PRO"/>
<result property="personalPersionPro" column="PERSONAL_PERSION_PRO"/>
<result property="personalMedicalPro" column="PERSONAL_MEDICAL_PRO"/>
<result property="personalUnemploymentPro" column="PERSONAL_UNEMPLOYMENT_PRO"/>
<result property="personalBigailmentPro" column="PERSONAL_BIGAILMENT_PRO"/>
<result property="unitBigailmentPro" column="UNIT_BIGAILMENT_PRO"/>
<result property="unitFundBase" column="UNIT_FUND_BASE"/>
<result property="personalFundBase" column="PERSONAL_FUND_BASE"/>
<result property="unitFundProp" column="UNIT_FUND_PROP"/>
<result property="personalFundProp" column="PERSONAL_FUND_PROP"/>
<result property="dataPush" column="DATA_PUSH"/>
<result property="createTime" column="CREATE_TIME"/>
<result property="diffType" column="DIFF_TYPE"/>
<result property="dataType" column="DATA_TYPE"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
a.EMP_ID,
......@@ -129,6 +194,7 @@
a.UNIT_FUND_SUM,
a.PERSONAL_SOCIAL_SUM,
a.PERSONAL_FUND_SUM,
a.SUM_ALL,
a.FUND_PROVINCE,
a.FUND_CITY,
a.FUND_TOWN,
......@@ -163,6 +229,7 @@
a.PROJECT_ID,
a.UNIT_NAME,
a.DEPT_NAME,
a.DEPT_NO,
a.EMP_NATRUE,
a.UNIT_INTEREST_FEE,
a.PERSONAL_INTEREST_FEE,
......@@ -370,6 +437,9 @@
<if test="tForecastLibrary.deptName != null and tForecastLibrary.deptName.trim() != ''">
AND a.DEPT_NAME = #{tForecastLibrary.deptName}
</if>
<if test="tForecastLibrary.deptNo != null and tForecastLibrary.deptNo.trim() != ''">
AND a.DEPT_NO = #{tForecastLibrary.deptNo}
</if>
<if test="tForecastLibrary.empNatrue != null and tForecastLibrary.empNatrue.trim() != ''">
AND a.EMP_NATRUE = #{tForecastLibrary.empNatrue}
</if>
......@@ -432,5 +502,80 @@
1=1
<include refid="tForecastLibrary_where"/>
</where>
order by a.CREATE_TIME desc
</select>
<!-- 导出 -->
<select id="exportLibrary" resultMap="exportMap">
select
a.ID,
a.EMP_NO,
a.EMP_NAME,
a.EMP_IDCARD,
a.UNIT_NAME,
a.DEPT_NAME,
a.DEPT_NO,
a.UNIT_PENSION_FEE,
a.UNIT_MEDICAL_FEE,
a.UNIT_UNEMPLOYMENT_FEE,
a.UNIT_WORK_INJURY_FEE,
a.UNIT_BIRTH_FEE,
a.UNIT_BITAILMENT_FEE,
a.PERSONAL_PENSION_FEE,
a.PERSONAL_MEDICAL_FEE,
a.PERSONAL_UNEMPLOYMENT_FEE,
a.PERSONAL_BIGAILMENT_FEE,
a.SOCIAL_PAY_MONTH,
a.SOCIAL_CREATE_MONTH,
a.PROVIDENT_PAY_MONTH,
a.PROVIDENT_CREATE_MONTH,
a.UNIT_SOCIAL_SUM,
a.UNIT_FUND_SUM,
a.PERSONAL_SOCIAL_SUM,
a.PERSONAL_FUND_SUM,
a.SUM_ALL,
a.FUND_PROVINCE,
a.FUND_CITY,
a.FUND_TOWN,
a.SOCIAL_PROVINCE,
a.SOCIAL_CITY,
a.SOCIAL_TOWN,
a.UNIT_PENSION_BASE,
a.UNIT_MEDICAL_BASE,
a.UNIT_UNEMPLOYMENT_BASE,
a.UNIT_INJURY_BASE,
a.UNIT_BIRTH_BASE,
a.PERSONAL_PENSION_BASE,
a.PERSONAL_MEDICAL_BASE,
a.PERSONAL_UNEMPLOYMENT_BASE,
a.PERSONAL_BIGAILMENT_BASE,
a.UNIT_BIGAILMENT_BASE,
a.UNIT_PERSION_PRO,
a.UNIT_MEDICAL_PRO,
a.UNIT_UNEMPLOYMENT_PRO,
a.UNIT_INJURY_PRO,
a.UNIT_BIRTH_PRO,
a.PERSONAL_PERSION_PRO,
a.PERSONAL_MEDICAL_PRO,
a.PERSONAL_UNEMPLOYMENT_PRO,
a.PERSONAL_BIGAILMENT_PRO,
a.UNIT_BIGAILMENT_PRO,
a.UNIT_FUND_BASE,
a.PERSONAL_FUND_BASE,
a.UNIT_FUND_PROP,
a.PERSONAL_FUND_PROP,
a.DATA_PUSH,
a.CREATE_TIME,
a.DIFF_TYPE,
a.DATA_TYPE
from t_forecast_library a
<where>
1=1
<include refid="tForecastLibrary_where"/>
</where>
order by a.CREATE_TIME desc
<if test="tForecastLibrary.limitStart != null">
limit #{tForecastLibrary.limitStart},#{tForecastLibrary.limitEnd}
</if>
</select>
</mapper>
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