Commit c4e4631b authored by fangxinjiang's avatar fangxinjiang

Merge remote-tracking branch 'origin/develop' into develop

parents 6d1e122b 3b9f5414
...@@ -46,7 +46,7 @@ spec: # 资源规范字段 ...@@ -46,7 +46,7 @@ spec: # 资源规范字段
- name: yifu-insurances # 容器的名字 - name: yifu-insurances # 容器的名字
image: localhost:5000/qas-mvp/yifu-insurances-biz:1.0.0 #临时地址 image: localhost:5000/qas-mvp/yifu-insurances-biz:1.0.0 #临时地址
# image: 192.168.1.110:5500/qas-mvp/yifu-insurances-biz:1.0.0 # 容器镜像地址 # image: 192.168.1.110:5500/qas-mvp/yifu-insurances-biz:1.0.0 # 容器镜像地址
imagePullPolicy: IfNotPresent # 每次Pod启动拉取镜像策略,三个选择 Always、Never、IfNotPresent imagePullPolicy: Always # 每次Pod启动拉取镜像策略,三个选择 Always、Never、IfNotPresent
# Always,每次都检查;Never,每次都不检查(不管本地是否有);IfNotPresent,如果本地有就不检查,如果没有就拉取(手动测试时, # Always,每次都检查;Never,每次都不检查(不管本地是否有);IfNotPresent,如果本地有就不检查,如果没有就拉取(手动测试时,
# 已经打好镜像存在docker容器中时,使用存在不检查级别, # 已经打好镜像存在docker容器中时,使用存在不检查级别,
# 默认为每次都检查,然后会进行拉取新镜像,因镜像仓库不存在,导致部署失败) # 默认为每次都检查,然后会进行拉取新镜像,因镜像仓库不存在,导致部署失败)
......
...@@ -588,10 +588,10 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -588,10 +588,10 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
//档案柜存在就自动归档 //档案柜存在就自动归档
if (Common.isNotNull(tEmployeeContractInfo.getAttaList())) { if (Common.isNotNull(tEmployeeContractInfo.getAttaList())) {
this.updateFileMainId(tEmployeeContractInfo); this.updateFileMainId(tEmployeeContractInfo);
this.setFileInfo(tEmployeeContractInfo.getId(), "添加附件"); this.setFileInfo(tEmployeeContractInfo.getId(), "");
tEmployeeContractInfo.setIsFile(CommonConstants.ZERO_STRING); tEmployeeContractInfo.setIsFile(CommonConstants.ZERO_STRING);
} else { } else {
this.setFileInfo(tEmployeeContractInfo.getId(), "清空附件"); this.setFileInfo(tEmployeeContractInfo.getId(), "");
tEmployeeContractInfo.setIsFile(CommonConstants.ONE_STRING); tEmployeeContractInfo.setIsFile(CommonConstants.ONE_STRING);
} }
this.updateById(tEmployeeContractInfo); this.updateById(tEmployeeContractInfo);
......
...@@ -110,28 +110,28 @@ public class TSalaryAccount { ...@@ -110,28 +110,28 @@ public class TSalaryAccount {
@ExcelProperty("开户行总行") @ExcelProperty("开户行总行")
private String bankName; private String bankName;
/** /**
* 结算部门id * 项目id
*/ */
@ExcelAttribute(name = "结算部门id", isNotEmpty = true, errorInfo = "结算部门id不能为空", maxLength = 32) @ExcelAttribute(name = "项目id", isNotEmpty = true, errorInfo = "项目id不能为空", maxLength = 32)
@NotBlank(message = "结算部门id不能为空") @NotBlank(message = "项目id不能为空")
@Length(max = 32, message = "结算部门id不能超过32个字符") @Length(max = 32, message = "项目id不能超过32个字符")
@ExcelProperty("结算部门id") @ExcelProperty("项目id")
private String deptId; private String deptId;
/** /**
* 结算部门no * 项目no
*/ */
@ExcelAttribute(name = "结算部门no", isNotEmpty = true, errorInfo = "结算部门no不能为空", maxLength = 50) @ExcelAttribute(name = "项目编码", isNotEmpty = true, errorInfo = "项目no不能为空", maxLength = 50)
@NotBlank(message = "结算部门no不能为空") @NotBlank(message = "项目编码不能为空")
@Length(max = 50, message = "结算部门no不能超过50个字符") @Length(max = 50, message = "项目编码不能超过50个字符")
@ExcelProperty("结算部门no") @ExcelProperty("项目编码")
private String deptNo; private String deptNo;
/** /**
* 结算部门name * 项目name
*/ */
@ExcelAttribute(name = "结算部门name", isNotEmpty = true, errorInfo = "结算部门name不能为空", maxLength = 50) @ExcelAttribute(name = "项目名称", isNotEmpty = true, errorInfo = "项目name不能为空", maxLength = 50)
@NotBlank(message = "结算部门name不能为空") @NotBlank(message = "项目名称不能为空")
@Length(max = 50, message = "结算部门name不能超过50个字符") @Length(max = 50, message = "项目名称不能超过50个字符")
@ExcelProperty("结算部门name") @ExcelProperty("项目名称")
private String deptName; private String deptName;
/** /**
* 工资发放方式(0现金/1银行)/2线下 * 工资发放方式(0现金/1银行)/2线下
......
...@@ -210,27 +210,27 @@ public class SalaryAccountUtil implements Serializable { ...@@ -210,27 +210,27 @@ public class SalaryAccountUtil implements Serializable {
} }
field = fieldsMap.get(scs.getJavaFiedName()); field = fieldsMap.get(scs.getJavaFiedName());
if (field == null) { if (field == null) {
sai = new TSalaryAccountItemVo();
sai.setCnName(dbFiedName);
sai.setJavaFiedName(scs.getJavaFiedName());
if (scs.getIsTax() != null) {
sai.setIsTax(scs.getIsTax());
} else {
sai.setIsTax(CommonConstants.ZERO_INT);
}
try { try {
cellValueBig = new BigDecimal(cellValueStr); cellValueBig = new BigDecimal(cellValueStr);
cellValueBig = cellValueBig.setScale(2, BigDecimal.ROUND_HALF_UP); //四舍五入 cellValueBig = cellValueBig.setScale(2, BigDecimal.ROUND_HALF_UP); //四舍五入
if (cellValueBig.toString().length() > 11) { if (cellValueBig.toString().length() > 11) {
error = "第" + (i + 2) + "行金额太大了,请检查一下:" + cellValueBig; sai.setTextValue(cellValueBig.toString());
errorList.add(new ErrorMessage((i + 2), error));
break;
}
sai = new TSalaryAccountItemVo();
sai.setCnName(dbFiedName);
sai.setJavaFiedName(scs.getJavaFiedName());
sai.setSalaryMoney(cellValueBig);
if (scs.getIsTax() != null) {
sai.setIsTax(scs.getIsTax());
} else { } else {
sai.setIsTax(CommonConstants.ZERO_INT); sai.setSalaryMoney(cellValueBig);
} }
saiList.add(sai);
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
sai.setTextValue(cellValueStr);
//非数字,不保存 //非数字,不保存
} }
saiList.add(sai);
} else { } else {
attr = field.getAnnotation(ExcelAttribute.class); attr = field.getAnnotation(ExcelAttribute.class);
error = validateUtil(cellValueStr, attr, (i + 2)); error = validateUtil(cellValueStr, attr, (i + 2));
......
...@@ -1043,4 +1043,9 @@ public class TSocialFundInfo extends BaseEntity { ...@@ -1043,4 +1043,9 @@ public class TSocialFundInfo extends BaseEntity {
// 执行月份,整体调基使用的 // 执行月份,整体调基使用的
@TableField(exist = false) @TableField(exist = false)
private String doMonth; private String doMonth;
// 基数配置,户调基使用的
@TableField(exist = false)
private SysBaseSetInfo socialSetInfo;
@TableField(exist = false)
private SysBaseSetInfo fundSetInfo;
} }
...@@ -459,7 +459,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -459,7 +459,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
private void initSocialLibary(String diffType, String payMonth, Map<String, TForecastLibrary> saveLibraryMap private void initSocialLibary(String diffType, String payMonth, Map<String, TForecastLibrary> saveLibraryMap
, TSocialFundInfo tSocialInfo, boolean isReduceFund, HashMap<String, TAgentConfig> agentConfigMap , TSocialFundInfo tSocialInfo, boolean isReduceFund, HashMap<String, TAgentConfig> agentConfigMap
, String sfMapKey, TForecastLibrary historyLibrary) { , String sfMapKey, TForecastLibrary historyLibrary, boolean isOnly) {
TForecastLibrary lib = new TForecastLibrary(); TForecastLibrary lib = new TForecastLibrary();
lib.setDataPush(CommonConstants.ZERO_INT); lib.setDataPush(CommonConstants.ZERO_INT);
lib.setSocialHousehold(tSocialInfo.getSocialHousehold()); lib.setSocialHousehold(tSocialInfo.getSocialHousehold());
...@@ -495,7 +495,8 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -495,7 +495,8 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
} else { } else {
isReduceSocial = false; isReduceSocial = false;
} }
lib = initForecastLibrary(lib, tSocialInfo, null, monthT, isReduceFund, isReduceSocial, agentConfigMap, historyLibrary); lib = initForecastLibrary(lib, tSocialInfo, null, monthT, isReduceFund, isReduceSocial, agentConfigMap
, historyLibrary, isOnly);
saveLibraryMap.put(sfMapKey, lib); saveLibraryMap.put(sfMapKey, lib);
} }
...@@ -522,7 +523,8 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -522,7 +523,8 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
// historyLibrary_历史比例(暂时未用到) // historyLibrary_历史比例(暂时未用到)
private TForecastLibrary initForecastLibrary(TForecastLibrary library private TForecastLibrary initForecastLibrary(TForecastLibrary library
, TSocialFundInfo socialInfo, TSocialFundInfo fund, Integer month, boolean isReduceFund , TSocialFundInfo socialInfo, TSocialFundInfo fund, Integer month, boolean isReduceFund
, boolean isReduceSocial, HashMap<String, TAgentConfig> agentConfigMap, TForecastLibrary historyLibrary) { , boolean isReduceSocial, HashMap<String, TAgentConfig> agentConfigMap
, TForecastLibrary historyLibrary, boolean isOnly) {
if (null != socialInfo && !isReduceSocial) { if (null != socialInfo && !isReduceSocial) {
library.setSocialId(socialInfo.getId()); library.setSocialId(socialInfo.getId());
library.setUnitBitailmentFee(BigDecimal.ZERO); library.setUnitBitailmentFee(BigDecimal.ZERO);
...@@ -535,12 +537,17 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -535,12 +537,17 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
TAgentConfig configPersonal = getAgentConfig(agentConfigMap, socialInfo, library.getSocialPayMonth(), CommonConstants.ONE_STRING); TAgentConfig configPersonal = getAgentConfig(agentConfigMap, socialInfo, library.getSocialPayMonth(), CommonConstants.ONE_STRING);
// 基数配置 // 基数配置
SysBaseSetInfo sysBaseSetInfo = this.getSysBaseSetInfo(CommonConstants.ZERO_STRING, socialInfo.getSocialHousehold() SysBaseSetInfo sysBaseSetInfo;
, library.getSocialPayMonth(), socialInfo.getSocialProvince(), socialInfo.getSocialCity(), socialInfo.getSocialTown()); if (isOnly) {
sysBaseSetInfo = socialInfo.getSocialSetInfo();
} else {
sysBaseSetInfo = this.getSysBaseSetInfo(CommonConstants.ZERO_STRING, socialInfo.getSocialHousehold()
, library.getSocialPayMonth(), socialInfo.getSocialProvince(), socialInfo.getSocialCity(), socialInfo.getSocialTown());
}
// 初始化大病: // 初始化大病:
this.initLibraryBigMoneyBySocial(library, socialInfo, sysBaseSetInfo); this.initLibraryBigMoneyBySocial(library, socialInfo, sysBaseSetInfo);
initUnitAndPersonalLibrary(library, socialInfo, sysBaseSetInfo, historyLibrary); initUnitAndPersonalLibrary(library, socialInfo, sysBaseSetInfo, historyLibrary, isOnly);
if (null != configAll || null != configUnit || null != configPersonal) { if (null != configAll || null != configUnit || null != configPersonal) {
if (null != configPersonal) { if (null != configPersonal) {
initPersonalLibByConfig(library, configPersonal); initPersonalLibByConfig(library, configPersonal);
...@@ -771,13 +778,13 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -771,13 +778,13 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
* @Date 2020-08-03 * @Date 2020-08-03
**/ **/
private void initUnitAndPersonalLibrary(TForecastLibrary library, TSocialFundInfo socialInfo private void initUnitAndPersonalLibrary(TForecastLibrary library, TSocialFundInfo socialInfo
, SysBaseSetInfo sysBaseSetInfo, TForecastLibrary historyLibrary) { , SysBaseSetInfo sysBaseSetInfo, TForecastLibrary historyLibrary, boolean isOnly) {
initLibrayOfPersonal(library, socialInfo, sysBaseSetInfo, historyLibrary); initLibrayOfPersonal(library, socialInfo, sysBaseSetInfo, historyLibrary, isOnly);
initLibraryOfUnit(library, socialInfo, sysBaseSetInfo, historyLibrary); initLibraryOfUnit(library, socialInfo, sysBaseSetInfo, historyLibrary, isOnly);
} }
private void initLibrayOfPersonal(TForecastLibrary library, TSocialFundInfo socialInfo private void initLibrayOfPersonal(TForecastLibrary library, TSocialFundInfo socialInfo
, SysBaseSetInfo sysBaseSetInfo, TForecastLibrary historyLibrary) { , SysBaseSetInfo sysBaseSetInfo, TForecastLibrary historyLibrary, boolean isOnly) {
// 个人养老基数 // 个人养老基数
BigDecimal personalPersionBase; BigDecimal personalPersionBase;
// 个人医疗基数 // 个人医疗基数
...@@ -831,7 +838,18 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -831,7 +838,18 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
personalUnemploymentMoney = BigDecimalUtils.safeMultiply(personalUnemploymentBase, personalUnemploymentPro, personalUnemploymentMoney = BigDecimalUtils.safeMultiply(personalUnemploymentBase, personalUnemploymentPro,
CommonConstants.ONE_OF_PERCENT); CommonConstants.ONE_OF_PERCENT);
if (library.getSocialPayMonth() != null) { // 户调基不看起缴时间
if (isOnly) {
library.setPersonalPensionBase(personalPersionBase);
library.setPersonalPersionPro(personalPersionPro);
library.setPersonalPensionFee(personalPersionMoney);
library.setPersonalMedicalBase(personalMedicalBase);
library.setPersonalMedicalPro(personalMedicalPro);
library.setPersonalMedicalFee(personalMedicalMoney);
library.setPersonalUnemploymentBase(personalUnemploymentBase);
library.setPersonalUnemploymentPro(personalUnemploymentPro);
library.setPersonalUnemploymentFee(personalUnemploymentMoney);
} else if (library.getSocialPayMonth() != null) {
int libraryPayMonth = Integer.parseInt(library.getSocialPayMonth()); int libraryPayMonth = Integer.parseInt(library.getSocialPayMonth());
if (socialInfo.getPensionStart() != null && libraryPayMonth >= DateUtil.formatDateInt(socialInfo.getPensionStart())) { if (socialInfo.getPensionStart() != null && libraryPayMonth >= DateUtil.formatDateInt(socialInfo.getPensionStart())) {
library.setPersonalPensionBase(personalPersionBase); library.setPersonalPensionBase(personalPersionBase);
...@@ -854,7 +872,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -854,7 +872,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
} }
private void initLibraryOfUnit(TForecastLibrary library, TSocialFundInfo socialInfo private void initLibraryOfUnit(TForecastLibrary library, TSocialFundInfo socialInfo
, SysBaseSetInfo sysBaseSetInfo, TForecastLibrary historyLibrary) { , SysBaseSetInfo sysBaseSetInfo, TForecastLibrary historyLibrary, boolean isOnly) {
// 单位养老基数 // 单位养老基数
BigDecimal unitPersionBase; BigDecimal unitPersionBase;
// 单位医疗基数 // 单位医疗基数
...@@ -938,7 +956,24 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -938,7 +956,24 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
unitBirthMoney = BigDecimalUtils.safeMultiply(unitBirthBase, unitBirthPro, unitBirthMoney = BigDecimalUtils.safeMultiply(unitBirthBase, unitBirthPro,
CommonConstants.ONE_OF_PERCENT); CommonConstants.ONE_OF_PERCENT);
if (library.getSocialPayMonth() != null) { // 户调基不看起缴时间
if (isOnly) {
library.setUnitPensionBase(unitPersionBase);
library.setUnitPersionPro(unitPersionPro);
library.setUnitPensionFee(unitPersionMoney);
library.setUnitMedicalBase(unitMedicalBase);
library.setUnitMedicalPro(unitMedicalPro);
library.setUnitMedicalFee(unitMedicalMoney);
library.setUnitUnemploymentBase(unitUnemploymentBase);
library.setUnitUnemploymentPro(unitUnemploymentPro);
library.setUnitUnemploymentFee(unitUnemploymentMoney);
library.setUnitInjuryBase(unitInjuryBase);
library.setUnitInjuryPro(unitInjuryPro);
library.setUnitWorkInjuryFee(unitInjuryMoney);
library.setUnitBirthBase(unitBirthBase);
library.setUnitBirthPro(unitBirthPro);
library.setUnitBirthFee(unitBirthMoney);
} else if (library.getSocialPayMonth() != null) {
int libraryPayMonth = Integer.parseInt(library.getSocialPayMonth()); int libraryPayMonth = Integer.parseInt(library.getSocialPayMonth());
if (socialInfo.getPensionStart() != null && libraryPayMonth >= DateUtil.formatDateInt(socialInfo.getPensionStart())) { if (socialInfo.getPensionStart() != null && libraryPayMonth >= DateUtil.formatDateInt(socialInfo.getPensionStart())) {
library.setUnitPensionBase(unitPersionBase); library.setUnitPensionBase(unitPersionBase);
...@@ -1256,7 +1291,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -1256,7 +1291,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
**/ **/
private void initFundLibary(String diffType, String payMonth, Map<String, TForecastLibrary> saveLibraryMap private void initFundLibary(String diffType, String payMonth, Map<String, TForecastLibrary> saveLibraryMap
, TSocialFundInfo providentFund, boolean isReduceSocial, String mapKeyStr , TSocialFundInfo providentFund, boolean isReduceSocial, String mapKeyStr
, TForecastLibrary historyLibrary) { , TForecastLibrary historyLibrary, boolean isOnly) {
TForecastLibrary lib = new TForecastLibrary(); TForecastLibrary lib = new TForecastLibrary();
lib.setDataPush(CommonConstants.ZERO_INT); lib.setDataPush(CommonConstants.ZERO_INT);
lib.setProvidentHousehold(providentFund.getProvidentHousehold()); lib.setProvidentHousehold(providentFund.getProvidentHousehold());
...@@ -1301,7 +1336,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -1301,7 +1336,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
} else { } else {
isReduceFund = false; isReduceFund = false;
} }
lib = initForecastLibrary(lib, null, providentFund, monthT, isReduceFund, isReduceSocial, null, historyLibrary); lib = initForecastLibrary(lib, null, providentFund, monthT, isReduceFund, isReduceSocial, null, historyLibrary, isOnly);
saveLibraryMap.put(mapKeyStr, lib); saveLibraryMap.put(mapKeyStr, lib);
} }
...@@ -1448,6 +1483,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -1448,6 +1483,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
} }
this.changeSocialInfoByBase(socialFundInfo, sysBaseSetInfo); this.changeSocialInfoByBase(socialFundInfo, sysBaseSetInfo);
socialFundInfo.setDoMonth(sysBaseSetInfo.getDoMonth()); socialFundInfo.setDoMonth(sysBaseSetInfo.getDoMonth());
socialFundInfo.setSocialSetInfo(sysBaseSetInfo);
socialFundInfoMap.put(socialFundInfo.getId(), socialFundInfo); socialFundInfoMap.put(socialFundInfo.getId(), socialFundInfo);
} }
} }
...@@ -1461,6 +1497,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -1461,6 +1497,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
for (TSocialFundInfo socialFundInfo : socialFundInfoList) { for (TSocialFundInfo socialFundInfo : socialFundInfoList) {
this.changeFundInfoByBase(socialFundInfo, sysBaseSetInfo); this.changeFundInfoByBase(socialFundInfo, sysBaseSetInfo);
socialFundInfo.setDoMonth(sysBaseSetInfo.getDoMonth()); socialFundInfo.setDoMonth(sysBaseSetInfo.getDoMonth());
socialFundInfo.setFundSetInfo(sysBaseSetInfo);
socialFundInfoMap.put(socialFundInfo.getId(), socialFundInfo); socialFundInfoMap.put(socialFundInfo.getId(), socialFundInfo);
} }
} }
...@@ -1468,7 +1505,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -1468,7 +1505,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
sysBaseSetInfoMapper.updateById(sysBaseSetInfo); sysBaseSetInfoMapper.updateById(sysBaseSetInfo);
} }
for (TSocialFundInfo socialFundInfo : socialFundInfoMap.values()) { for (TSocialFundInfo socialFundInfo : socialFundInfoMap.values()) {
this.updateForecastLibaryCore(socialFundInfo, socialFundInfo.getDoMonth(), true); this.updateForecastLibaryCore(socialFundInfo, socialFundInfo.getDoMonth(), true, false);
socialFundInfoMapper.updateById(socialFundInfo); socialFundInfoMapper.updateById(socialFundInfo);
} }
} }
...@@ -1483,7 +1520,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -1483,7 +1520,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
**/ **/
@Override @Override
public R<String> updateToneForecastLibary(TSocialFundInfo socialFundInfo, String doMonth) { public R<String> updateToneForecastLibary(TSocialFundInfo socialFundInfo, String doMonth) {
return this.updateForecastLibaryCore(socialFundInfo, doMonth, false); return this.updateForecastLibaryCore(socialFundInfo, doMonth, false, false);
} }
/** /**
...@@ -1495,7 +1532,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -1495,7 +1532,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
**/ **/
@Override @Override
public R<String> updateForecastLibaryByDispatch(TSocialFundInfo socialFundInfo) { public R<String> updateForecastLibaryByDispatch(TSocialFundInfo socialFundInfo) {
return this.updateForecastLibaryCore(socialFundInfo, null, false); return this.updateForecastLibaryCore(socialFundInfo, null, false, true);
} }
/** /**
...@@ -1615,6 +1652,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -1615,6 +1652,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
} }
/** /**
* @param isDispatch 是否是派单,是:区分社保数据与公积金数据
* @param isOnly 是否仅更新传过来的社保公积金,true:是(同时,true时,是户调基,要判断断缴) * @param isOnly 是否仅更新传过来的社保公积金,true:是(同时,true时,是户调基,要判断断缴)
* @param socialFundInfo * @param socialFundInfo
* @Description: 根据社保公积金信息表更新预估库 * @Description: 根据社保公积金信息表更新预估库
...@@ -1622,7 +1660,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -1622,7 +1660,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
* @Date: 2022/7/26 19:01 * @Date: 2022/7/26 19:01
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String> * @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/ **/
private R<String> updateForecastLibaryCore(TSocialFundInfo socialFundInfo, String doMonth, boolean isOnly) { private R<String> updateForecastLibaryCore(TSocialFundInfo socialFundInfo, String doMonth, boolean isOnly, boolean isDispatch) {
String empIdCard = socialFundInfo.getEmpIdcard(); String empIdCard = socialFundInfo.getEmpIdcard();
//定义未推送的按条件查询得到的预估数据 //定义未推送的按条件查询得到的预估数据
List<TForecastLibrary> librarySocialList = null; List<TForecastLibrary> librarySocialList = null;
...@@ -1670,26 +1708,78 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -1670,26 +1708,78 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
} }
//查询出所有对应条件的预估数、社保数据、公积金数据据用于重新生成 //查询出所有对应条件的预估数、社保数据、公积金数据据用于重新生成
if (Common.isNotNull(empIdCard)) { if (Common.isNotNull(empIdCard)) {
librarySocialList = baseMapper.selectList(Wrappers.<TForecastLibrary>query().lambda() if (isDispatch) {
.eq(TForecastLibrary::getEmpIdcard, empIdCard) if (socialFundInfo.getSocialStartDate() != null) {
.eq(TForecastLibrary::getDataType, CommonConstants.ZERO_INT) payMonthList = new ArrayList<>();
.in(TForecastLibrary::getSocialPayMonth, payMonthList) // 获取最小的起缴月
.eq(TForecastLibrary::getDataPush, CommonConstants.ZERO_INT)); Date minStartDate = this.getMinSocialDate(socialFundInfo);
librarySocialListTemp = baseMapper.selectList(Wrappers.<TForecastLibrary>query().lambda() // 再计算月份
.eq(TForecastLibrary::getEmpIdcard, empIdCard) monthDiff = DateUtil.getMonthDiff(minStartDate, new Date()) + 2;
.eq(TForecastLibrary::getDataType, CommonConstants.ZERO_INT) if (monthDiff <= 0) {
.in(TForecastLibrary::getSocialPayMonth, payMonthList) return R.failed("派单同步预估库,社保起缴月份无法生成,monthDiff=" + monthDiff);
.eq(TForecastLibrary::getDataPush, CommonConstants.ONE_INT)); }
libraryFundList = baseMapper.selectList(Wrappers.<TForecastLibrary>query().lambda() for (int i = 0; i < monthDiff; i++) {
.eq(TForecastLibrary::getEmpIdcard, empIdCard) payMonthList.add(DateUtil.addMonth(1 - i));
.eq(TForecastLibrary::getDataType, CommonConstants.ONE_INT) }
.in(TForecastLibrary::getProvidentPayMonth, payMonthList) librarySocialList = baseMapper.selectList(Wrappers.<TForecastLibrary>query().lambda()
.eq(TForecastLibrary::getDataPush, CommonConstants.ZERO_INT)); .eq(TForecastLibrary::getEmpIdcard, empIdCard)
libraryFundListTemp = baseMapper.selectList(Wrappers.<TForecastLibrary>query().lambda() .eq(TForecastLibrary::getDataType, CommonConstants.ZERO_INT)
.eq(TForecastLibrary::getEmpIdcard, empIdCard) .in(TForecastLibrary::getSocialPayMonth, payMonthList)
.eq(TForecastLibrary::getDataType, CommonConstants.ONE_INT) .eq(TForecastLibrary::getDataPush, CommonConstants.ZERO_INT));
.in(TForecastLibrary::getProvidentPayMonth, payMonthList) librarySocialListTemp = baseMapper.selectList(Wrappers.<TForecastLibrary>query().lambda()
.eq(TForecastLibrary::getDataPush, CommonConstants.ONE_INT)); .eq(TForecastLibrary::getEmpIdcard, empIdCard)
.eq(TForecastLibrary::getDataType, CommonConstants.ZERO_INT)
.in(TForecastLibrary::getSocialPayMonth, payMonthList)
.eq(TForecastLibrary::getDataPush, CommonConstants.ONE_INT));
}
} else {
librarySocialList = baseMapper.selectList(Wrappers.<TForecastLibrary>query().lambda()
.eq(TForecastLibrary::getEmpIdcard, empIdCard)
.eq(TForecastLibrary::getDataType, CommonConstants.ZERO_INT)
.in(TForecastLibrary::getSocialPayMonth, payMonthList)
.eq(TForecastLibrary::getDataPush, CommonConstants.ZERO_INT));
librarySocialListTemp = baseMapper.selectList(Wrappers.<TForecastLibrary>query().lambda()
.eq(TForecastLibrary::getEmpIdcard, empIdCard)
.eq(TForecastLibrary::getDataType, CommonConstants.ZERO_INT)
.in(TForecastLibrary::getSocialPayMonth, payMonthList)
.eq(TForecastLibrary::getDataPush, CommonConstants.ONE_INT));
}
if (isDispatch) {
if (socialFundInfo.getProvidentStart() != null) {
payMonthList = new ArrayList<>();
// 获取最小的起缴月
Date minStartDate = socialFundInfo.getProvidentStart();
// 再计算月份
monthDiff = DateUtil.getMonthDiff(minStartDate, new Date()) + 2;
if (monthDiff <= 0) {
return R.failed("派单同步预估库,公积金起缴月份无法生成,monthDiff=" + monthDiff);
}
for (int i = 0; i < monthDiff; i++) {
payMonthList.add(DateUtil.addMonth(1 - i));
}
libraryFundList = baseMapper.selectList(Wrappers.<TForecastLibrary>query().lambda()
.eq(TForecastLibrary::getEmpIdcard, empIdCard)
.eq(TForecastLibrary::getDataType, CommonConstants.ONE_INT)
.in(TForecastLibrary::getProvidentPayMonth, payMonthList)
.eq(TForecastLibrary::getDataPush, CommonConstants.ZERO_INT));
libraryFundListTemp = baseMapper.selectList(Wrappers.<TForecastLibrary>query().lambda()
.eq(TForecastLibrary::getEmpIdcard, empIdCard)
.eq(TForecastLibrary::getDataType, CommonConstants.ONE_INT)
.in(TForecastLibrary::getProvidentPayMonth, payMonthList)
.eq(TForecastLibrary::getDataPush, CommonConstants.ONE_INT));
}
} else {
libraryFundList = baseMapper.selectList(Wrappers.<TForecastLibrary>query().lambda()
.eq(TForecastLibrary::getEmpIdcard, empIdCard)
.eq(TForecastLibrary::getDataType, CommonConstants.ONE_INT)
.in(TForecastLibrary::getProvidentPayMonth, payMonthList)
.eq(TForecastLibrary::getDataPush, CommonConstants.ZERO_INT));
libraryFundListTemp = baseMapper.selectList(Wrappers.<TForecastLibrary>query().lambda()
.eq(TForecastLibrary::getEmpIdcard, empIdCard)
.eq(TForecastLibrary::getDataType, CommonConstants.ONE_INT)
.in(TForecastLibrary::getProvidentPayMonth, payMonthList)
.eq(TForecastLibrary::getDataPush, CommonConstants.ONE_INT));
}
if (isOnly) { if (isOnly) {
if (Common.isNotNull(socialFundInfo.getSocialId())) { if (Common.isNotNull(socialFundInfo.getSocialId())) {
socialInfoList = new ArrayList<>(); socialInfoList = new ArrayList<>();
...@@ -1872,7 +1962,8 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -1872,7 +1962,8 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
historyLibrary = socialHistoryMap.get(sfMapKey); historyLibrary = socialHistoryMap.get(sfMapKey);
if (historyLibrary != null) { if (historyLibrary != null) {
// 初始化社保 // 初始化社保
initSocialLibary(diffType, payMonth, saveLibraryMap, tSocialInfo, isReduceFund, agentConfigHashMap, sfMapKey, historyLibrary); initSocialLibary(diffType, payMonth, saveLibraryMap, tSocialInfo, isReduceFund
, agentConfigHashMap, sfMapKey, historyLibrary, isOnly);
if (null != tForecastLibrary) { if (null != tForecastLibrary) {
newForecastLibrary = saveLibraryMap.get(sfMapKey); newForecastLibrary = saveLibraryMap.get(sfMapKey);
if (null != newForecastLibrary) { if (null != newForecastLibrary) {
...@@ -1893,7 +1984,8 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -1893,7 +1984,8 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
} else { } else {
historyLibrary = socialHistoryMap.get(sfMapKey); historyLibrary = socialHistoryMap.get(sfMapKey);
// 初始化社保 // 初始化社保
initSocialLibary(diffType, payMonth, saveLibraryMap, tSocialInfo, isReduceFund, agentConfigHashMap, sfMapKey, historyLibrary); initSocialLibary(diffType, payMonth, saveLibraryMap, tSocialInfo, isReduceFund
, agentConfigHashMap, sfMapKey, historyLibrary, isOnly);
if (null != tForecastLibrary) { if (null != tForecastLibrary) {
newForecastLibrary = saveLibraryMap.get(sfMapKey); newForecastLibrary = saveLibraryMap.get(sfMapKey);
if (null != newForecastLibrary) { if (null != newForecastLibrary) {
...@@ -1924,7 +2016,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -1924,7 +2016,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
historyLibrary = fundHistoryMap.get(sfMapKey); historyLibrary = fundHistoryMap.get(sfMapKey);
if (historyLibrary != null) { if (historyLibrary != null) {
// 初始化公积金 // 初始化公积金
initFundLibary(diffType, payMonth, saveLibraryMap, providentFund, isReduceSocial, sfMapKey, historyLibrary); initFundLibary(diffType, payMonth, saveLibraryMap, providentFund, isReduceSocial, sfMapKey, historyLibrary, isOnly);
if (null != tForecastLibrary) { if (null != tForecastLibrary) {
newForecastLibrary = saveLibraryMap.get(sfMapKey); newForecastLibrary = saveLibraryMap.get(sfMapKey);
if (null != newForecastLibrary) { if (null != newForecastLibrary) {
...@@ -1946,7 +2038,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -1946,7 +2038,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
} else { } else {
historyLibrary = fundHistoryMap.get(sfMapKey); historyLibrary = fundHistoryMap.get(sfMapKey);
// 初始化公积金 // 初始化公积金
initFundLibary(diffType, payMonth, saveLibraryMap, providentFund, isReduceSocial, sfMapKey, historyLibrary); initFundLibary(diffType, payMonth, saveLibraryMap, providentFund, isReduceSocial, sfMapKey, historyLibrary, isOnly);
if (null != tForecastLibrary) { if (null != tForecastLibrary) {
newForecastLibrary = saveLibraryMap.get(sfMapKey); newForecastLibrary = saveLibraryMap.get(sfMapKey);
if (null != newForecastLibrary) { if (null != newForecastLibrary) {
......
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