Commit 2f8e4c13 authored by huyuchen's avatar huyuchen

结算状态同步

parent 404aa084
......@@ -38,6 +38,12 @@
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-insurances-api</artifactId>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-salary-api</artifactId>
......
package com.yifu.cloud.plus.v1.yifu.common.dapr.util;
import com.alibaba.fastjson.JSON;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprSalaryProperties;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpSocialViewVo;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
......@@ -17,5 +20,14 @@ public class SalaryDaprUtil {
@Autowired
private DaprSalaryProperties daprProperties;
/**
* @Author huyc
* @Description 更新结算信息
* @Date 17:38 2022/12/26
* @Param
* @return
**/
public void updateSalarySettleStatus(EkpSocialViewVo infoVo) {
HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/tincome/inner/updateSalarySettleStatus", JSON.toJSONString(infoVo), EkpSocialViewVo.class, SecurityConstants.FROM_IN);
}
}
......@@ -5,6 +5,8 @@ import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprSocialProperties;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpInsuranceViewVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpSocialViewVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.HaveSalaryNoSocialSearchVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.HaveSalaryNoSocialVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TPaymentVo;
......@@ -133,4 +135,26 @@ public class SocialDaprUtils {
public void deleteById(TIncomeDetail infoVo) {
HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/tincomedetail/inner/deleteById", JSON.toJSONString(infoVo), TIncomeDetail.class, SecurityConstants.FROM_IN);
}
/**
* @Author huyc
* @Description 更新结算信息
* @Date 17:38 2022/12/26
* @Param
* @return
**/
public void updateSocialSettleStatus(EkpSocialViewVo infoVo) {
HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/tpaymentinfo/inner/updateSocialSettleStatus", JSON.toJSONString(infoVo), EkpSocialViewVo.class, SecurityConstants.FROM_IN);
}
/**
* @Author huyc
* @Description 更新结算信息
* @Date 17:38 2022/12/26
* @Param
* @return
**/
public void updateIncomeSettleStatus(EkpInsuranceViewVo infoVo) {
HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/tincome/inner/updateIncomeSettleStatus", JSON.toJSONString(infoVo), EkpInsuranceViewVo.class, SecurityConstants.FROM_IN);
}
}
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import lombok.Data;
import java.io.Serializable;
/**
* @Author fxj
* @Date 2022/8/22
* @Description 薪资明细对应参数
* @Version 1.0
*/
@Data
public class EkpInsuranceViewVo implements Serializable {
/**
* 明细id
**/
private String id;
/**
* 收入信息结算状态 0 已结算 1 结算中 2 未结算 3 已冻结
*/
private String incomeSettleFlag;
/**
* 收入信息结算状态 0 已收 1 未收 2 垫付
*/
private String incomeCollectFlag;
/**
* 支出信息结算状态 0 已结算 1 结算中 2 未结算
*/
private String paySettleFlag;
/**
* 支出信息付款状态 0 已付 1 未付
*/
private String payCollectFlag;
}
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import lombok.Data;
import java.io.Serializable;
/**
* @Author fxj
* @Date 2022/8/22
* @Description 薪资明细对应参数
* @Version 1.0
*/
@Data
public class EkpSocialViewVo implements Serializable {
/**
* 明细id
**/
private String id;
/**
* 收入信息结算状态 0 已结算 1 结算中 2 未结算 3 已冻结
*/
private String incomeSettleFlag;
/**
* 收入信息结算状态 0 已收 1 未收 2 垫付
*/
private String incomeCollectFlag;
/**
* 支出信息结算状态 0 已结算 1 结算中 2 未结算
*/
private String paySettleFlag;
/**
* 支出信息付款状态 0 已付 1 未付
*/
private String payCollectFlag;
/**
* 结算单标识 预估 实缴
*/
private String settleFlag;
/**
* 0 收入结算单号 1 支出结算单号
*/
private String payFlag;
}
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import lombok.Data;
import java.io.Serializable;
/**
* @Author huyc
* @Date 2022/12/27
* @Description 结算单号对应参数
* @Version 1.0
*/
@Data
public class EkpStatusParamVo implements Serializable {
/**
* 结算单号
**/
private String settleNo;
/**
* 0 收入结算单号 1 支出结算单号
*/
private String payFlag;
/**
* 结算单类型 0 社保/管理费 1公积金/风险金
*/
private String typeFlag;
}
......@@ -640,4 +640,56 @@ public class TInsuranceDetailController {
tInsuranceDetailService.ekpUpdateInsuranceDept(changeDeptVo);
}
/**
* 更新收款状态--EKP调用接口
* @author hyc
* @param vo
* @return R
*/
@Operation(summary = "更新商险收款状态--EKP调用接口", description = "更新商险收款状态--EKP调用接口")
@SysLog("更新商险收款状态--EKP调用接口")
@PostMapping("/updateInsuranceSettleStatus")
public R updateInsuranceSettleStatus(@RequestBody EkpStatusParamVo vo) {
return tInsuranceDetailService.updateInsuranceSettleStatus(vo);
}
/**
* 更新社保收款状态--EKP调用接口
* @author hyc
* @param vo
* @return R
*/
@Operation(summary = "更新社保收款状态--EKP调用接口", description = "更新社保收款状态--EKP调用接口")
@SysLog("更新社保收款状态--EKP调用接口")
@PostMapping("/updateSocialSettleStatus")
public R updateSocialSettleStatus(@RequestBody EkpStatusParamVo vo) {
return tInsuranceDetailService.updateSocialSettleStatus(vo);
}
/**
* 更新收入收款状态--EKP调用接口
* @author hyc
* @param vo
* @return R
*/
@Operation(summary = "更新收入收款状态--EKP调用接口", description = "更新收入收款状态--EKP调用接口")
@SysLog("更新收入收款状态--EKP调用接口")
@PostMapping("/updateIncomeSettleStatus")
public R updateIncomeSettleStatus(@RequestBody EkpStatusParamVo vo) {
return tInsuranceDetailService.updateIncomeSettleStatus(vo);
}
/**
* 更新薪资收款状态--EKP调用接口
* @author hyc
* @param vo
* @return R
*/
@Operation(summary = "更新薪资收款状态--EKP调用接口", description = "更新薪资收款状态--EKP调用接口")
@SysLog("更新薪资收款状态--EKP调用接口")
@PostMapping("/updateSalarySettleStatus")
public R updateSalarySettleStatus(@RequestBody EkpStatusParamVo vo) {
return tInsuranceDetailService.updateSalarySettleStatus(vo);
}
}
package com.yifu.cloud.plus.v1.yifu.insurances.mapper.ekp;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpInsuranceViewVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpSocialViewVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.SettleVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* @author zhaji
......@@ -18,4 +21,18 @@ public interface EkpSettleMapper {
* @return {@link SettleVo}
*/
SettleVo getSettle(String id);
EkpInsuranceViewVo selectSettleStatusBySettleNo(@Param("settleNo") String settleNo,@Param("payFlag") String payFlag);
EkpSocialViewVo selectSocialViewStatusBySettleNo(@Param("settleNo") String settleNo,@Param("payFlag") String payFlag);
EkpSocialViewVo selectFundViewBySettleNo(@Param("settleNo") String settleNo,@Param("payFlag") String payFlag);
EkpInsuranceViewVo selectFIncomelViewBySettleNo(@Param("settleNo") String settleNo);
EkpInsuranceViewVo selectIncomeViewBySettleNo(@Param("settleNo") String settleNo);
EkpSocialViewVo selectSalarylViewBySettleNo(@Param("settleNo") String settleNo,@Param("payFlag") String payFlag);
}
......@@ -3,6 +3,8 @@ package com.yifu.cloud.plus.v1.yifu.insurances.service.ekp;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceTypeRate;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpInsuranceViewVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpSocialViewVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.SettleVo;
/**
......@@ -20,4 +22,37 @@ public interface EkpSettleService extends IService<TInsuranceTypeRate> {
* @return {@link R}
*/
SettleVo getSettle(String id);
/**
* 根据结算单编号查询商险视图信息
*
*/
EkpInsuranceViewVo selectViewBySettleNo(String settleNo,String payFlag);
/**
* 根据结算单编号查询社保视图信息
*
*/
EkpSocialViewVo selectSocialViewBySettleNo(String settleNo,String payFlag);
/**
* 根据结算单编号查询公积金视图信息
*
*/
EkpSocialViewVo selectFundViewBySettleNo(String settleNo,String payFlag);
/**
* 根据结算单编号查询管理费视图信息
*
*/
EkpInsuranceViewVo selectIncomelViewBySettleNo(String settleNo);
/**
* 根据结算单编号查询风险金视图信息
*
*/
EkpInsuranceViewVo selectFIncomelViewBySettleNo(String settleNo);
/**
* 根据结算单编号查询薪资视图信息
*
*/
EkpSocialViewVo selectSalarylViewBySettleNo(String settleNo,String payFlag);
}
......@@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceTypeRate;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.ekp.EkpSettleMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.ekp.EkpSettleService;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpInsuranceViewVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpSocialViewVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.SettleVo;
import org.springframework.stereotype.Service;
......@@ -28,6 +30,36 @@ public class EkpSettleServiceImpl implements EkpSettleService {
return ekpSettleMapper.getSettle(id);
}
@Override
public EkpInsuranceViewVo selectViewBySettleNo(String settleNo,String payFlag) {
return ekpSettleMapper.selectSettleStatusBySettleNo(settleNo,payFlag);
}
@Override
public EkpSocialViewVo selectSocialViewBySettleNo(String settleNo,String payFlag) {
return ekpSettleMapper.selectSocialViewStatusBySettleNo(settleNo,payFlag);
}
@Override
public EkpSocialViewVo selectFundViewBySettleNo(String settleNo,String payFlag) {
return ekpSettleMapper.selectFundViewBySettleNo(settleNo,payFlag);
}
@Override
public EkpInsuranceViewVo selectFIncomelViewBySettleNo(String settleNo) {
return ekpSettleMapper.selectFIncomelViewBySettleNo(settleNo);
}
@Override
public EkpInsuranceViewVo selectIncomelViewBySettleNo(String settleNo) {
return ekpSettleMapper.selectIncomeViewBySettleNo(settleNo);
}
@Override
public EkpSocialViewVo selectSalarylViewBySettleNo(String settleNo,String payFlag) {
return ekpSettleMapper.selectSalarylViewBySettleNo(settleNo,payFlag);
}
@Override
public boolean saveBatch(Collection<TInsuranceTypeRate> entityList, int batchSize) {
return false;
......
......@@ -408,4 +408,40 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
* @return: void
**/
void ekpUpdateInsuranceDept(ChangeDeptVo changeDeptVo);
/**
* @param vo
* @Description: 更新商险结算状态
* @Author: huyc
* @Date: 2022/12/26 17:56
* @return: R
**/
R updateInsuranceSettleStatus(EkpStatusParamVo vo);
/**
* @param vo
* @Description: 更新社保结算状态
* @Author: huyc
* @Date: 2022/12/26 17:56
* @return: R
**/
R updateSocialSettleStatus(EkpStatusParamVo vo);
/**
* @param vo
* @Description: 更新收入结算状态
* @Author: huyc
* @Date: 2022/12/26 17:56
* @return: R
**/
R updateIncomeSettleStatus(EkpStatusParamVo vo);
/**
* @param vo
* @Description: 更新薪资结算状态
* @Author: huyc
* @Date: 2022/12/26 17:56
* @return: R
**/
R updateSalarySettleStatus(EkpStatusParamVo vo);
}
......@@ -107,6 +107,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
@Resource
private SocialDaprUtils socialDaprUtils;
@Resource
private SalaryDaprUtil salaryDaprUtil;
@Resource
private MenuUtil menuUtil;
@Resource
......@@ -6493,6 +6496,108 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
}
@Override
public R updateInsuranceSettleStatus(EkpStatusParamVo vo) {
if (Common.isEmpty(vo)) {
return R.failed(CommonConstants.PARAM_IS_NOT_ERROR);
}
EkpInsuranceViewVo viewVo;
TInsuranceDetail detail;
try {
//根据结算单号获取明细id和结算状态
String payFlag = CommonConstants.ZERO_STRING.equals(vo.getPayFlag()) ? "0" : "1";
viewVo = ekpSettleService.selectViewBySettleNo(vo.getSettleNo(),payFlag);
if (Common.isNotNull(viewVo)) {
//获取所有的明细id
detail = baseMapper.selectById(viewVo.getId());
if (Common.isNotNull(detail)) {
//判断是收入还是支出结算单号
if (CommonConstants.ZERO_STRING.equals(vo.getPayFlag())) {
detail.setIncomeSettleFlag(viewVo.getIncomeSettleFlag());
detail.setIncomeCollectFlag(viewVo.getIncomeCollectFlag());
}else {
detail.setPaySettleFlag(viewVo.getPaySettleFlag());
detail.setPayCollectFlag(viewVo.getPayCollectFlag());
}
baseMapper.updateById(detail);
}
}
}catch (Exception e) {
log.error("商险结算状态更新异常", e);
return R.failed("商险结算状态更新异常");
}
return R.ok(); }
@Override
public R updateSocialSettleStatus(EkpStatusParamVo vo) {
if (Common.isEmpty(vo)) {
return R.failed(CommonConstants.PARAM_IS_NOT_ERROR);
}
EkpSocialViewVo viewVo;
try {
//根据结算单号获取明细id和结算状态
String payFlag = CommonConstants.ZERO_STRING.equals(vo.getPayFlag()) ? "0" : "1";
if (CommonConstants.ZERO_STRING.equals(vo.getTypeFlag())) {
viewVo = ekpSettleService.selectSocialViewBySettleNo(vo.getSettleNo(),payFlag);
} else {
viewVo = ekpSettleService.selectFundViewBySettleNo(vo.getSettleNo(),payFlag);
}
if (Common.isNotNull(viewVo)) {
viewVo.setPayFlag(vo.getPayFlag());
socialDaprUtils.updateSocialSettleStatus(viewVo);
}
}catch (Exception e) {
log.error("社保结算状态更新异常", e);
return R.failed("社保结算状态更新异常");
}
return R.ok(); }
@Override
public R updateIncomeSettleStatus(EkpStatusParamVo vo) {
if (Common.isEmpty(vo)) {
return R.failed(CommonConstants.PARAM_IS_NOT_ERROR);
}
EkpInsuranceViewVo viewVo;
try {
//根据结算单号获取明细id和结算状态;判断是管理费还是风险金
if (CommonConstants.ZERO_STRING.equals(vo.getTypeFlag())) {
viewVo = ekpSettleService.selectIncomelViewBySettleNo(vo.getSettleNo());
}else {
viewVo = ekpSettleService.selectFIncomelViewBySettleNo(vo.getSettleNo());
}
if (Common.isNotNull(viewVo)) {
socialDaprUtils.updateIncomeSettleStatus(viewVo);
}
}catch (Exception e) {
log.error("收入结算状态更新异常", e);
return R.failed("收入结算状态更新异常");
}
return R.ok(); }
@Override
public R updateSalarySettleStatus(EkpStatusParamVo vo) {
if (Common.isEmpty(vo)) {
return R.failed(CommonConstants.PARAM_IS_NOT_ERROR);
}
EkpSocialViewVo viewVo;
try {
//根据结算单号获取明细id和结算状态
String payFlag = CommonConstants.ZERO_STRING.equals(vo.getPayFlag()) ? "0" : "1";
viewVo = ekpSettleService.selectSalarylViewBySettleNo(vo.getSettleNo(),payFlag);
if (Common.isNotNull(viewVo)) {
viewVo.setPayFlag(vo.getPayFlag());
salaryDaprUtil.updateSalarySettleStatus(viewVo);
}
}catch (Exception e) {
log.error("薪资结算状态更新异常", e);
return R.failed("薪资结算状态更新异常");
}
return R.ok(); }
private Map<String, TSettleDomainSelectVo> getSelectVoMap() {
R<TSettleDomainListVo> settleDomainR = archivesDaprUtil.selectAllSettleDomainSelectVos();
Map<String,TSettleDomainSelectVo> mapSelectVo = null;
......
......@@ -11,10 +11,31 @@
<result property="actualStatus" column="fd_3b05bd5ed0b976" jdbcType="VARCHAR"/>
</resultMap>
<resultMap id="BaseResultStatusMap" type="com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpInsuranceViewVo">
<id property="id" column="detailsId" jdbcType="VARCHAR"/>
<result property="incomeSettleFlag" column="earningStatus" jdbcType="VARCHAR"/>
<result property="incomeCollectFlag" column="receiptStatus" jdbcType="VARCHAR"/>
<result property="paySettleFlag" column="zhichuEarningStatus" jdbcType="VARCHAR"/>
<result property="payCollectFlag" column="payStatus" jdbcType="VARCHAR"/>
</resultMap>
<resultMap id="BaseResultSocialStatusMap" type="com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpSocialViewVo">
<id property="id" column="detailsId" jdbcType="VARCHAR"/>
<result property="incomeSettleFlag" column="earningStatus" jdbcType="VARCHAR"/>
<result property="incomeCollectFlag" column="receiptStatus" jdbcType="VARCHAR"/>
<result property="paySettleFlag" column="zhichuEarningStatus" jdbcType="VARCHAR"/>
<result property="payCollectFlag" column="payStatus" jdbcType="VARCHAR"/>
<result property="settleFlag" column="orderType" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
fd_id,fd_3b05ba46bb042e,fd_3b05ba4808a3ca,fd_3b05bd5ed0b976
</sql>
<sql id="Base_Column_List_Status">
detailsId,earningStatus,receiptStatus,zhichuEarningStatus,payStatus
</sql>
<select id="getSettle" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"></include>
......@@ -23,6 +44,106 @@
where
fd_3b05ba46bb042e = #{id}
</select>
<!-- 根据结算单编码获取视图信息 -->
<select id="selectSettleStatusBySettleNo" resultMap="BaseResultStatusMap">
select
<include refid="Base_Column_List_Status"></include>
from
ekp.view_insurance_info
where
1 = 1
<if test="payFlag != null and payFlag != '' and payFlag == 0">
and earningNo = #{settleNo}
</if>
<if test="payFlag != null and payFlag != '' and payFlag == 1">
and zhichuEarningNo = #{settleNo}
</if>
</select>
<!-- 根据结算单编码获取社保视图信息 -->
<select id="selectSocialViewStatusBySettleNo" resultMap="BaseResultSocialStatusMap">
select
detailsId,
earningStatus,
receiptStatus,
zhichuEarningStatus,
payStatus,
orderType
from
ekp.view_social_info
where
1 = 1
<if test="payFlag != null and payFlag != '' and payFlag == 0">
and earningNo = #{settleNo}
</if>
<if test="payFlag != null and payFlag != '' and payFlag == 1">
and zhichuEarningNo = #{settleNo}
</if>
</select>
<!-- 根据结算单编码获取公积金视图信息 -->
<select id="selectFundViewBySettleNo" resultMap="BaseResultSocialStatusMap">
select
detailsId,
earningStatus,
receiptStatus,
zhichuEarningStatus,
payStatus
from
ekp.view_funds_info
where
1 = 1
<if test="payFlag != null and payFlag != '' and payFlag == 0">
and earningNo = #{settleNo}
</if>
<if test="payFlag != null and payFlag != '' and payFlag == 1">
and zhichuEarningNo = #{settleNo}
</if>
</select>
<!-- 根据结算单编码获取视图信息 -->
<select id="selectFIncomelViewBySettleNo" resultMap="BaseResultStatusMap">
select
detailsId,
earningStatus,
receiptStatus
from
ekp.view_riskfund_info
where
earningNo = #{settleNo}
</select>
<!-- 根据结算单编码获取视图信息 -->
<select id="selectIncomeViewBySettleNo" resultMap="BaseResultStatusMap">
select
detailsId,
earningStatus,
receiptStatus
from
ekp.view_management_info
where
earningNo = #{settleNo}
</select>
<!-- 根据结算单编码获取视图信息 -->
<select id="selectSalarylViewBySettleNo" resultMap="BaseResultSocialStatusMap">
select
detailsId,
earningStatus,
receiptStatus,
zhichuEarningStatus,
payStatus
from
ekp.view_salary_info
where
1 = 1
<if test="payFlag != null and payFlag != '' and payFlag == 0">
and earningNo = #{settleNo}
</if>
<if test="payFlag != null and payFlag != '' and payFlag == 1">
and zhichuEarningNo = #{settleNo}
</if>
</select>
</mapper>
......
......@@ -32,6 +32,7 @@ import com.yifu.cloud.plus.v1.yifu.common.dapr.util.MenuUtil;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpSocialViewVo;
import com.yifu.cloud.plus.v1.yifu.salary.constants.SalaryConstants;
import com.yifu.cloud.plus.v1.yifu.salary.entity.THaveSalaryNosocial;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccount;
......@@ -290,4 +291,17 @@ public class TSalaryAccountController {
public R<List<THaveSalaryNosocial>> getLastMonthTHaveSalaryNosocial(@RequestParam(name = "month") String month){
return new R<>(tSalaryAccountService.getLastMonthTHaveSalaryNosocial(month));
}
/**
* @param viewVo
* @Description: 更新结算信息
* @Author: huyc
* @Date: 2022/8/25
* @return:
**/
@Inner
@PostMapping("/inner/updateSalarySettleStatus")
public void updateSalarySettleStatus(@RequestBody EkpSocialViewVo viewVo) {
tSalaryAccountService.updateSalarySettleStatus(viewVo);
}
}
......@@ -21,6 +21,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpSalaryParamVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpSocialViewVo;
import com.yifu.cloud.plus.v1.yifu.salary.entity.THaveSalaryNosocial;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccount;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryAccountSearchVo;
......@@ -123,4 +124,13 @@ public interface TSalaryAccountService extends IService<TSalaryAccount> {
* @return: void
**/
void backSalaryBySalaryId(String salaryId);
/**
* @param viewVo
* @Description: 更新薪资结算状态
* @Author: huyc
* @Date: 2022/12/26 17:56
* @return: R
**/
void updateSalarySettleStatus(EkpSocialViewVo viewVo);
}
......@@ -28,6 +28,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ExcelUtil;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpSalaryParamVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpSocialViewVo;
import com.yifu.cloud.plus.v1.yifu.salary.entity.THaveSalaryNosocial;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccount;
import com.yifu.cloud.plus.v1.yifu.salary.mapper.TSalaryAccountMapper;
......@@ -35,7 +36,6 @@ import com.yifu.cloud.plus.v1.yifu.salary.service.TSalaryAccountService;
import com.yifu.cloud.plus.v1.yifu.salary.vo.AccountCheckVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryAccountSearchVo;
import lombok.extern.log4j.Log4j2;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;
import javax.servlet.ServletOutputStream;
......@@ -234,4 +234,20 @@ public class TSalaryAccountServiceImpl extends ServiceImpl<TSalaryAccountMapper,
baseMapper.backSalaryBySalaryId(salaryId);
}
@Override
public void updateSalarySettleStatus(EkpSocialViewVo viewVo) {
//根据明细id更新结算状态
TSalaryAccount account = baseMapper.selectById(viewVo.getId());
if (Common.isNotNull(account)) {
if (CommonConstants.ZERO_STRING.equals(viewVo.getPayFlag())) {
account.setIncomeSettleFlag(viewVo.getIncomeSettleFlag());
account.setIncomeCollectFlag(viewVo.getIncomeCollectFlag());
} else {
account.setPaySettleFlag(viewVo.getPaySettleFlag());
account.setPayCollectFlag(viewVo.getPayCollectFlag());
}
baseMapper.updateById(account);
}
}
}
......@@ -27,6 +27,7 @@ import com.yifu.cloud.plus.v1.yifu.common.dapr.util.MenuUtil;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpSocialViewVo;
import com.yifu.cloud.plus.v1.yifu.social.entity.TIncome;
import com.yifu.cloud.plus.v1.yifu.social.entity.TIncomeDetail;
import com.yifu.cloud.plus.v1.yifu.social.service.TIncomeService;
......@@ -220,4 +221,17 @@ public class TIncomeController {
}
return R.ok();
}
/**
* @param viewVo
* @Description: 更新结算信息
* @Author: huyc
* @Date: 2022/8/25
* @return:
**/
@Inner
@PostMapping("/inner/updateIncomeSettleStatus")
public void updateSocialSettleStatus(@RequestBody EkpSocialViewVo viewVo) {
tIncomeService.updateIncomeSettleStatus(viewVo);
}
}
......@@ -23,6 +23,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.ErrorDetailVO;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpSocialViewVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.HaveSalaryNoSocialSearchVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TPaymentBySalaryVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TPaymentVo;
......@@ -445,4 +446,17 @@ public class TPaymentInfoController {
public R<Boolean> batchUpdatePaymentInfo(@RequestBody TPaymentInfoSearchVo searchVo) {
return tPaymentInfoService.batchUpdatePaymentInfo(searchVo);
}
/**
* @param viewVo
* @Description: 更新结算信息
* @Author: huyc
* @Date: 2022/8/25
* @return:
**/
@Inner
@PostMapping("/inner/updateSocialSettleStatus")
public void updateSocialSettleStatus(@RequestBody EkpSocialViewVo viewVo) {
tPaymentInfoService.updateSocialSettleStatus(viewVo);
}
}
......@@ -23,6 +23,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainSelectVo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpSocialViewVo;
import com.yifu.cloud.plus.v1.yifu.social.entity.TIncome;
import com.yifu.cloud.plus.v1.yifu.social.entity.TIncomeDetail;
import com.yifu.cloud.plus.v1.yifu.social.vo.TIncomeSearchVo;
......@@ -90,4 +91,13 @@ public interface TIncomeService extends IService<TIncome> {
**/
void changeIncomeAndDetailDept(Set<String> idSet, TSettleDomainSelectVo dept);
/**
* @param viewVo
* @Description: 更新收入结算状态
* @Author: huyc
* @Date: 2022/12/26 17:56
* @return:
**/
void updateIncomeSettleStatus(EkpSocialViewVo viewVo);
}
......@@ -20,6 +20,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.ErrorDetailVO;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpSocialViewVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TPaymentBySalaryVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TPaymentVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.UpdateSocialFoundVo;
......@@ -168,4 +169,6 @@ public interface TPaymentInfoService extends IService<TPaymentInfo> {
**/
R<String> changeDeptByEkp(ChangeDeptVo changeDeptVo);
void updateSocialSettleStatus(EkpSocialViewVo viewVo);
}
......@@ -34,6 +34,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.ekp.util.EkpIncomeUtil;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpIncomeParamManage;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpIncomeParamRisk;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpSocialViewVo;
import com.yifu.cloud.plus.v1.yifu.social.constants.SocialConstants;
import com.yifu.cloud.plus.v1.yifu.social.entity.TIncome;
import com.yifu.cloud.plus.v1.yifu.social.entity.TIncomeDetail;
......@@ -800,4 +801,15 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
baseMapper.changeIncomeDetailDept(idSet, dept);
}
@Override
public void updateIncomeSettleStatus(EkpSocialViewVo viewVo) {
//根据明细id更新结算状态
TIncome income = baseMapper.selectById(viewVo.getId());
if (Common.isNotNull(income)) {
income.setIncomeSettleFlag(viewVo.getIncomeSettleFlag());
income.setIncomeCollectFlag(viewVo.getIncomeCollectFlag());
baseMapper.updateById(income);
}
}
}
......@@ -45,6 +45,7 @@ import com.yifu.cloud.plus.v1.yifu.common.dapr.util.ArchivesDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.InsuranceDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.UpmsDaprUtils;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpSocialViewVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TPaymentBySalaryVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TPaymentVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.UpdateSocialFoundVo;
......@@ -152,7 +153,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
//获取要导出的列表
List<TPaymentInfoBatchVo> list = new ArrayList<>();
Integer count = baseMapper.selectCountTPaymentInfo(searchVo);
try (ServletOutputStream out = response.getOutputStream()){
try (ServletOutputStream out = response.getOutputStream()) {
response.setContentType(CommonConstants.MULTIPART_FORM_DATA);
response.setCharacterEncoding("utf-8");
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, "UTF-8"));
......@@ -207,7 +208,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
//获取要导出的列表
List<TPaymentInfoExportVo> list = new ArrayList<>();
Integer count = baseMapper.selectCountSumPaymentInfo(searchVo);
try (ServletOutputStream out = response.getOutputStream()){
try (ServletOutputStream out = response.getOutputStream()) {
response.setContentType(CommonConstants.MULTIPART_FORM_DATA);
response.setCharacterEncoding("utf-8");
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, "UTF-8"));
......@@ -305,6 +306,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
return R.ok();
}
/**
* 通过ID获取缴费库 及社保、公积金明细
*
......@@ -462,9 +464,9 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
*/
private void saveData() {
log.info("{}条数据,开始存储数据库!", cachedDataList.size());
importTPaymentSocialInfo(cachedDataList, sumNumKey,importSuccessKey,errorMessageList, user,
rowNumber,pensionMoneyMap, bigMoneyMap,unEmpMoneyMap,birMoneyMap,injuryMoneyMap,
medicalMoneyMap,accrualMoneyMap);
importTPaymentSocialInfo(cachedDataList, sumNumKey, importSuccessKey, errorMessageList, user,
rowNumber, pensionMoneyMap, bigMoneyMap, unEmpMoneyMap, birMoneyMap, injuryMoneyMap,
medicalMoneyMap, accrualMoneyMap);
log.info("存储数据库成功!");
}
}).sheet().doRead();
......@@ -508,7 +510,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
return R.ok();
}
private void importTPaymentSocialInfo(List<TPaymentInfoVo> list, String sumNumKey,String importSuccessKey,
private void importTPaymentSocialInfo(List<TPaymentInfoVo> list, String sumNumKey, String importSuccessKey,
List<ErrorDetailVO> errorMessageList,
YifuUser user, Integer rowNumber,
ConcurrentHashMap<String, BigDecimal> pensionMoneyMap,
......@@ -547,7 +549,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
int residualCapacity = yfSocialImportThreadPoolExecutor.getResidualCapacity();
if (taskSize > residualCapacity) {
errorMessageList.add(new ErrorDetailVO(-1, MsgUtils.getMessage(ErrorCodes.SOCIALINFO_LIST_NUM_LARGE)));
}else {
} else {
// -----------------------------生成paymentInfoMap本段开始--------------------------------
//已存在的档案数据
List<String> monthList = Common.listObjectToStrList(list, ExcelAttributeConstants.SOCIAL_PAY_MONTH).stream().distinct().collect(Collectors.toList());
......@@ -737,37 +739,37 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
}
}
// -----------------------------生成paymentInfoMap本段结束--------------------------------
// -----------------------------生成paymentInfoMap本段结束--------------------------------
// -----------------------------线程池处理list,批量保存社保信息开始--------------------------------
List<TPaymentInfoVo> tempList = new ArrayList<>();
// -----------------------------线程池处理list,批量保存社保信息开始--------------------------------
List<TPaymentInfoVo> tempList = new ArrayList<>();
List<CompletableFuture<List<ErrorDetailVO>>> completableFutureList = new ArrayList<>();
List<CompletableFuture<List<ErrorDetailVO>>> completableFutureList = new ArrayList<>();
// 创建一个数值格式化对象
NumberFormat numberFormat = NumberFormat.getInstance();
// 设置精确到小数点后2位
numberFormat.setMaximumFractionDigits(2);
String maerialRatio = "";
Integer bfInt = (Integer) redisUtil.get(sumNumKey);
if (Common.isNotNull(bfInt)) {
if (rowNumber > bfInt + 1) {
maerialRatio = numberFormat.format(((float) bfInt / (float) rowNumber) * 100);
bfInt = bfInt + 100;
redisUtil.set(sumNumKey, bfInt, 360L);
} else {
maerialRatio = "100";
}
} else {
if (rowNumber >= 100) {
maerialRatio = numberFormat.format(((float) 100 / (float) rowNumber) * 100);
bfInt = 100;
redisUtil.set(sumNumKey, bfInt, 360L);
// 创建一个数值格式化对象
NumberFormat numberFormat = NumberFormat.getInstance();
// 设置精确到小数点后2位
numberFormat.setMaximumFractionDigits(2);
String maerialRatio = "";
Integer bfInt = (Integer) redisUtil.get(sumNumKey);
if (Common.isNotNull(bfInt)) {
if (rowNumber > bfInt + 1) {
maerialRatio = numberFormat.format(((float) bfInt / (float) rowNumber) * 100);
bfInt = bfInt + 100;
redisUtil.set(sumNumKey, bfInt, 360L);
} else {
maerialRatio = "100";
}
} else {
maerialRatio = "100";
if (rowNumber >= 100) {
maerialRatio = numberFormat.format(((float) 100 / (float) rowNumber) * 100);
bfInt = 100;
redisUtil.set(sumNumKey, bfInt, 360L);
} else {
maerialRatio = "100";
}
}
}
redisUtil.set(importSuccessKey, maerialRatio, 360L);
redisUtil.set(importSuccessKey, maerialRatio, 360L);
try {
// 1.list.size()不足partSize,直接执行
......@@ -776,7 +778,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
executeImportSocialList(user, list, areaMap, areaMap2,
paymentInfoPensionMap, paymentInfoBigMap, paymentInfoBirMap,
paymentInfoMedicalMap, paymentInfoUnEmpMap, paymentInfoInjuryMap,
errorMessageList,pensionMoneyMap, bigMoneyMap, unEmpMoneyMap, birMoneyMap,
errorMessageList, pensionMoneyMap, bigMoneyMap, unEmpMoneyMap, birMoneyMap,
injuryMoneyMap, medicalMoneyMap, accrualMoneyMap, paymentInfoaccrualMap
), yfSocialImportThreadPoolExecutor);
completableFutureList.add(listCompletableFuture);
......@@ -791,7 +793,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
executeImportSocialList(user, finalList, areaMap, areaMap2,
paymentInfoPensionMap, paymentInfoBigMap, paymentInfoBirMap,
paymentInfoMedicalMap, paymentInfoUnEmpMap, paymentInfoInjuryMap,
errorMessageList,pensionMoneyMap, bigMoneyMap, unEmpMoneyMap, birMoneyMap,
errorMessageList, pensionMoneyMap, bigMoneyMap, unEmpMoneyMap, birMoneyMap,
injuryMoneyMap, medicalMoneyMap, accrualMoneyMap, paymentInfoaccrualMap
), yfSocialImportThreadPoolExecutor);
completableFutureList.add(listCompletableFuture);
......@@ -807,7 +809,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
executeImportSocialList(user, finalTempList, areaMap, areaMap2,
paymentInfoPensionMap, paymentInfoBigMap, paymentInfoBirMap,
paymentInfoMedicalMap, paymentInfoUnEmpMap, paymentInfoInjuryMap,
errorMessageList,pensionMoneyMap, bigMoneyMap, unEmpMoneyMap, birMoneyMap,
errorMessageList, pensionMoneyMap, bigMoneyMap, unEmpMoneyMap, birMoneyMap,
injuryMoneyMap, medicalMoneyMap, accrualMoneyMap, paymentInfoaccrualMap
), yfSocialImportThreadPoolExecutor);
completableFutureList.add(oneCompletableFuture);
......@@ -835,7 +837,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
executeImportSocialList(user, finalTempList, areaMap, areaMap2,
paymentInfoPensionMap, paymentInfoBigMap, paymentInfoBirMap,
paymentInfoMedicalMap, paymentInfoUnEmpMap, paymentInfoInjuryMap,
errorMessageList,pensionMoneyMap, bigMoneyMap, unEmpMoneyMap, birMoneyMap,
errorMessageList, pensionMoneyMap, bigMoneyMap, unEmpMoneyMap, birMoneyMap,
injuryMoneyMap, medicalMoneyMap, accrualMoneyMap, paymentInfoaccrualMap
), yfSocialImportThreadPoolExecutor);
completableFutureList.add(listCompletableFuture);
......@@ -852,7 +854,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
} while (computeFlag);
} catch (Exception e) {
log.error("社保缴费库数据批量导入异常:" + e);
log.error("社保缴费库数据批量导入异常:" + e);
redisUtil.remove(key);
}
}
......@@ -902,24 +904,24 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
* @return:
*/
private List<ErrorDetailVO> executeImportSocialList(YifuUser user,
List<TPaymentInfoVo> list,
HashMap<String, String> areaMap,
HashMap<String, String> areaMap2,
ConcurrentHashMap<String, TPaymentInfo> paymentInfoPensionMap,
ConcurrentHashMap<String, TPaymentInfo> paymentInfoBigMap,
ConcurrentHashMap<String, TPaymentInfo> paymentInfoBirMap,
ConcurrentHashMap<String, TPaymentInfo> paymentInfoMedicalMap,
ConcurrentHashMap<String, TPaymentInfo> paymentInfoUnEmpMap,
ConcurrentHashMap<String, TPaymentInfo> paymentInfoInjuryMap,
List<ErrorDetailVO> errorMessageList,
ConcurrentHashMap<String, BigDecimal> pensionMoneyMap,
ConcurrentHashMap<String, BigDecimal> bigMoneyMap,
ConcurrentHashMap<String, BigDecimal> unEmpMoneyMap,
ConcurrentHashMap<String, BigDecimal> birMoneyMap,
ConcurrentHashMap<String, BigDecimal> injuryMoneyMap,
ConcurrentHashMap<String, BigDecimal> medicalMoneyMap,
ConcurrentHashMap<String, BigDecimal> accrualMoneyMap,
ConcurrentHashMap<String, TPaymentInfo> paymentInfoaccrualMap) {
List<TPaymentInfoVo> list,
HashMap<String, String> areaMap,
HashMap<String, String> areaMap2,
ConcurrentHashMap<String, TPaymentInfo> paymentInfoPensionMap,
ConcurrentHashMap<String, TPaymentInfo> paymentInfoBigMap,
ConcurrentHashMap<String, TPaymentInfo> paymentInfoBirMap,
ConcurrentHashMap<String, TPaymentInfo> paymentInfoMedicalMap,
ConcurrentHashMap<String, TPaymentInfo> paymentInfoUnEmpMap,
ConcurrentHashMap<String, TPaymentInfo> paymentInfoInjuryMap,
List<ErrorDetailVO> errorMessageList,
ConcurrentHashMap<String, BigDecimal> pensionMoneyMap,
ConcurrentHashMap<String, BigDecimal> bigMoneyMap,
ConcurrentHashMap<String, BigDecimal> unEmpMoneyMap,
ConcurrentHashMap<String, BigDecimal> birMoneyMap,
ConcurrentHashMap<String, BigDecimal> injuryMoneyMap,
ConcurrentHashMap<String, BigDecimal> medicalMoneyMap,
ConcurrentHashMap<String, BigDecimal> accrualMoneyMap,
ConcurrentHashMap<String, TPaymentInfo> paymentInfoaccrualMap) {
if (Common.isNotNull(list)) {
TPaymentInfo paymentInfo;
TSocialFundInfo socialInfo;
......@@ -953,15 +955,15 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
//导入校验
if (!Common.isNotNull(infoVo.getSocialPayMonth())) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), infoVo.getSocialHousehold(), infoVo.getProvidentHousehold(), infoVo.getEmpName(), "社保缴纳月份不可为空!"));
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), infoVo.getSocialHousehold(), infoVo.getProvidentHousehold(), infoVo.getEmpName(), "社保缴纳月份不可为空!"));
continue;
}
if (!Common.isNotNull(infoVo.getSocialCreateMonth())) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), infoVo.getSocialHousehold(), infoVo.getProvidentHousehold(), infoVo.getEmpName(), "社保生成月份不可为空!"));
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), infoVo.getSocialHousehold(), infoVo.getProvidentHousehold(), infoVo.getEmpName(), "社保生成月份不可为空!"));
continue;
}
if (!Common.isNotNull(infoVo.getSocialPayAddr())) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), infoVo.getSocialHousehold(), infoVo.getProvidentHousehold(), infoVo.getEmpName(), "社保缴纳地不可为空!"));
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), infoVo.getSocialHousehold(), infoVo.getProvidentHousehold(), infoVo.getEmpName(), "社保缴纳地不可为空!"));
continue;
}
//无对应员工的社保数据
......@@ -975,11 +977,11 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
? "null" : infoVo.getSocialTown()));
//对身份证与人员姓名的对应关系进行校验
if (socialInfo != null && !socialInfo.getEmpName().equals(infoVo.getEmpName())) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), infoVo.getSocialHousehold(), infoVo.getProvidentHousehold(), infoVo.getEmpName(), "姓名与身份证信息不一致,请核实后再次尝试!"));
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), infoVo.getSocialHousehold(), infoVo.getProvidentHousehold(), infoVo.getEmpName(), "姓名与身份证信息不一致,请核实后再次尝试!"));
continue;
}
if (socialInfo != null && socialInfo.getSocialStartDate() == null) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), infoVo.getSocialHousehold(), infoVo.getProvidentHousehold(), infoVo.getEmpIdcard() , SocialConstants.ERROR_TEMPLATE + "的社保起缴日期为空!"));
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), infoVo.getSocialHousehold(), infoVo.getProvidentHousehold(), infoVo.getEmpIdcard(), SocialConstants.ERROR_TEMPLATE + "的社保起缴日期为空!"));
continue;
}
......@@ -990,12 +992,12 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
.eq(TSocialInfo::getSocialProvince, infoVo.getSocialProvince())
.eq(TSocialInfo::getSocialCity, infoVo.getSocialCity()));
if (!socialist.isEmpty()) {
for (TSocialInfo socialInfo1:socialist) {
for (TSocialInfo socialInfo1 : socialist) {
if ((Common.isEmpty(infoVo.getSocialTown()) || (Common.isNotNull(infoVo.getSocialTown()) &&
infoVo.getSocialTown().equals(socialInfo1.getSocialTown()))) &&
DateUtil.dateToString(socialInfo1.getSocialStartDate(),"yyyyMM").compareTo(infoVo.getSocialPayMonth()) <=0 &&
DateUtil.dateToString(socialInfo1.getSocialStartDate(), "yyyyMM").compareTo(infoVo.getSocialPayMonth()) <= 0 &&
(Common.isEmpty(socialInfo1.getSocialReduceDate()) || (Common.isNotNull(socialInfo1.getSocialReduceDate()) &&
DateUtil.dateToString(socialInfo1.getSocialReduceDate(),"yyyyMM").compareTo(infoVo.getSocialPayMonth()) >=0))) {
DateUtil.dateToString(socialInfo1.getSocialReduceDate(), "yyyyMM").compareTo(infoVo.getSocialPayMonth()) >= 0))) {
isTrueAdder = true;
tSocialInfo = socialInfo1;
break;
......@@ -1014,7 +1016,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
if (pensionMoneyMap.get(exitMoney) != null && BigDecimalUtils.safeMultiply(BigDecimalUtils.safeAdd(
BigDecimalUtils.isNullToZero(infoVo.getUnitPensionMoney()), BigDecimalUtils.isNullToZero(
infoVo.getPersonalPensionMoney())), pensionMoneyMap.get(exitMoney)).compareTo(BigDecimal.ZERO) > 0) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), infoVo.getSocialHousehold(), infoVo.getProvidentHousehold(), infoVo.getEmpName() , SocialConstants.ERROR_TEMPLATE + "的养老缴费数据"));
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), infoVo.getSocialHousehold(), infoVo.getProvidentHousehold(), infoVo.getEmpName(), SocialConstants.ERROR_TEMPLATE + "的养老缴费数据"));
continue;
} else {
pensionMoneyMap.put(exitMoney, BigDecimalUtils.safeAdd(BigDecimalUtils.isNullToZero(infoVo.getUnitPensionMoney()),
......@@ -1025,7 +1027,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
if (accrualMoneyMap.get(exitMoney) != null && BigDecimalUtils.safeMultiply(BigDecimalUtils.safeAdd(
BigDecimalUtils.isNullToZero(infoVo.getPersonalAccrual()), BigDecimalUtils.isNullToZero(
infoVo.getCompanyAccrual())), accrualMoneyMap.get(exitMoney)).compareTo(BigDecimal.ZERO) > 0) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), infoVo.getSocialHousehold(), infoVo.getProvidentHousehold(), infoVo.getEmpName() , SocialConstants.ERROR_TEMPLATE + "的补缴缴费数据"));
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), infoVo.getSocialHousehold(), infoVo.getProvidentHousehold(), infoVo.getEmpName(), SocialConstants.ERROR_TEMPLATE + "的补缴缴费数据"));
continue;
} else {
accrualMoneyMap.put(exitMoney, BigDecimalUtils.safeAdd(
......@@ -1037,7 +1039,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
if (medicalMoneyMap.get(exitMoney) != null && BigDecimalUtils.safeMultiply(BigDecimalUtils.safeAdd(
BigDecimalUtils.isNullToZero(infoVo.getUnitMedicalMoney()), BigDecimalUtils.isNullToZero(
infoVo.getPersonalMedicalMoney())), medicalMoneyMap.get(exitMoney)).compareTo(BigDecimal.ZERO) > 0) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), infoVo.getSocialHousehold(), infoVo.getProvidentHousehold(), infoVo.getEmpName() , SocialConstants.ERROR_TEMPLATE + "的医保缴费数据"));
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), infoVo.getSocialHousehold(), infoVo.getProvidentHousehold(), infoVo.getEmpName(), SocialConstants.ERROR_TEMPLATE + "的医保缴费数据"));
continue;
} else {
medicalMoneyMap.put(exitMoney, BigDecimalUtils.safeAdd(
......@@ -1049,7 +1051,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
if (unEmpMoneyMap.get(exitMoney) != null && BigDecimalUtils.safeMultiply(BigDecimalUtils.safeAdd(
BigDecimalUtils.isNullToZero(infoVo.getUnitUnemploymentMoney()), BigDecimalUtils.isNullToZero(
infoVo.getPersonalUnemploymentMoney())), unEmpMoneyMap.get(exitMoney)).compareTo(BigDecimal.ZERO) > 0) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), infoVo.getSocialHousehold(), infoVo.getProvidentHousehold(), infoVo.getEmpName() , SocialConstants.ERROR_TEMPLATE + "的失业缴费数据"));
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), infoVo.getSocialHousehold(), infoVo.getProvidentHousehold(), infoVo.getEmpName(), SocialConstants.ERROR_TEMPLATE + "的失业缴费数据"));
continue;
} else {
unEmpMoneyMap.put(exitMoney, BigDecimalUtils.safeAdd(
......@@ -1060,7 +1062,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
exitMoney = infoVo.getEmpIdcard().concat(infoVo.getSocialPayMonth().concat(infoVo.getSocialCreateMonth()).concat(SocialConstants.GS));
if (injuryMoneyMap.get(exitMoney) != null && BigDecimalUtils.safeMultiply(BigDecimalUtils.isNullToZero(infoVo.getUnitInjuryMoney()),
injuryMoneyMap.get(exitMoney)).compareTo(BigDecimal.ZERO) > 0) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), infoVo.getSocialHousehold(), infoVo.getProvidentHousehold(), infoVo.getEmpName() , SocialConstants.ERROR_TEMPLATE + "的工伤缴费数据"));
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), infoVo.getSocialHousehold(), infoVo.getProvidentHousehold(), infoVo.getEmpName(), SocialConstants.ERROR_TEMPLATE + "的工伤缴费数据"));
continue;
} else {
injuryMoneyMap.put(exitMoney, BigDecimalUtils.isNullToZero(infoVo.getUnitInjuryMoney()));
......@@ -1069,7 +1071,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
exitMoney = infoVo.getEmpIdcard().concat(infoVo.getSocialPayMonth().concat(infoVo.getSocialCreateMonth()).concat(SocialConstants.BIR));
if (birMoneyMap.get(exitMoney) != null && BigDecimalUtils.safeMultiply(BigDecimalUtils.isNullToZero(infoVo.getUnitBirthMoney()),
birMoneyMap.get(exitMoney)).compareTo(BigDecimal.ZERO) > 0) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), infoVo.getSocialHousehold(), infoVo.getProvidentHousehold(), infoVo.getEmpName() , SocialConstants.ERROR_TEMPLATE + "的生育缴费数据"));
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), infoVo.getSocialHousehold(), infoVo.getProvidentHousehold(), infoVo.getEmpName(), SocialConstants.ERROR_TEMPLATE + "的生育缴费数据"));
continue;
} else {
birMoneyMap.put(exitMoney, BigDecimalUtils.isNullToZero(infoVo.getUnitBirthMoney()));
......@@ -1080,7 +1082,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
BigDecimalUtils.isNullToZero(infoVo.getUnitBigmailmentMoney()),
BigDecimalUtils.isNullToZero(infoVo.getPersonalBigmailmentMoney())),
bigMoneyMap.get(exitMoney)).compareTo(BigDecimal.ZERO) > 0) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), infoVo.getSocialHousehold(), infoVo.getProvidentHousehold(), infoVo.getEmpName() , SocialConstants.ERROR_TEMPLATE + "的医疗救助金缴费数据"));
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), infoVo.getSocialHousehold(), infoVo.getProvidentHousehold(), infoVo.getEmpName(), SocialConstants.ERROR_TEMPLATE + "的医疗救助金缴费数据"));
continue;
} else {
bigMoneyMap.put(exitMoney, BigDecimalUtils.safeAdd(
......@@ -1107,7 +1109,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
BigDecimalUtils.isNullToZero(infoVo.getPersonalPensionMoney())), BigDecimalUtils.safeAdd(
BigDecimalUtils.isNullToZero(paymentInfo.getUnitPensionMoney()),
BigDecimalUtils.isNullToZero(paymentInfo.getPersonalPensionMoney()))).compareTo(BigDecimal.ZERO) > 0))) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), paymentInfo.getSocialHousehold(), paymentInfo.getProvidentHousehold(), infoVo.getEmpName(), "已存在对应员工身份证" + infoVo.getEmpIdcard()
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), paymentInfo.getSocialHousehold(), paymentInfo.getProvidentHousehold(), infoVo.getEmpName(), "已存在对应员工身份证" + infoVo.getEmpIdcard()
+ "的养老缴费数据,请勿重复导入!"));
continue;
}
......@@ -1132,7 +1134,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
BigDecimalUtils.isNullToZero(infoVo.getCompanyAccrual())), BigDecimalUtils.safeAdd(
BigDecimalUtils.isNullToZero(paymentInfo.getPersonalAccrual()),
BigDecimalUtils.isNullToZero(paymentInfo.getCompanyAccrual()))).compareTo(BigDecimal.ZERO) > 0))) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), paymentInfo.getSocialHousehold(), paymentInfo.getProvidentHousehold(), infoVo.getEmpName(), "已存在对应员工身份证" + infoVo.getEmpIdcard()
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), paymentInfo.getSocialHousehold(), paymentInfo.getProvidentHousehold(), infoVo.getEmpName(), "已存在对应员工身份证" + infoVo.getEmpIdcard()
+ "的补缴缴费数据,请勿重复导入!"));
continue;
}
......@@ -1157,7 +1159,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
BigDecimalUtils.isNullToZero(infoVo.getPersonalUnemploymentMoney())), BigDecimalUtils.safeAdd(
BigDecimalUtils.isNullToZero(paymentInfo.getUnitUnemploymentMoney()),
BigDecimalUtils.isNullToZero(paymentInfo.getPersonalUnemploymentMoney()))).compareTo(BigDecimal.ZERO) > 0))) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), paymentInfo.getSocialHousehold(), paymentInfo.getProvidentHousehold(), infoVo.getEmpName(), "已存在对应员工身份证" + infoVo.getEmpIdcard()
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), paymentInfo.getSocialHousehold(), paymentInfo.getProvidentHousehold(), infoVo.getEmpName(), "已存在对应员工身份证" + infoVo.getEmpIdcard()
+ "的失业缴费数据,请勿重复导入!"));
continue;
}
......@@ -1183,7 +1185,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
BigDecimalUtils.isNullToZero(infoVo.getPersonalMedicalMoney())), BigDecimalUtils.safeAdd(
BigDecimalUtils.isNullToZero(paymentInfo.getUnitMedicalMoney()),
BigDecimalUtils.isNullToZero(paymentInfo.getPersonalMedicalMoney()))).compareTo(BigDecimal.ZERO) > 0))) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), paymentInfo.getSocialHousehold(), paymentInfo.getProvidentHousehold(), infoVo.getEmpName(), "已存在对应员工身份证" + infoVo.getEmpIdcard()
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), paymentInfo.getSocialHousehold(), paymentInfo.getProvidentHousehold(), infoVo.getEmpName(), "已存在对应员工身份证" + infoVo.getEmpIdcard()
+ "的医保缴费数据,请勿重复导入!"));
continue;
}
......@@ -1208,7 +1210,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
BigDecimalUtils.isNullToZero(infoVo.getPersonalBigmailmentMoney())), BigDecimalUtils.safeAdd(
BigDecimalUtils.isNullToZero(paymentInfo.getUnitBigmailmentMoney()),
BigDecimalUtils.isNullToZero(paymentInfo.getPersonalBigmailmentMoney()))).compareTo(BigDecimal.ZERO) > 0))) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), paymentInfo.getSocialHousehold(), paymentInfo.getProvidentHousehold(), infoVo.getEmpName(), "已存在对应员工身份证" + infoVo.getEmpIdcard()
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), paymentInfo.getSocialHousehold(), paymentInfo.getProvidentHousehold(), infoVo.getEmpName(), "已存在对应员工身份证" + infoVo.getEmpIdcard()
+ "的医疗救助金缴费数据,请勿重复导入!"));
continue;
}
......@@ -1229,7 +1231,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
if (null != paymentInfo && ((null != paymentInfo.getGsSameFlg() && CommonConstants.ONE_STRING.equals(paymentInfo.getGsSameFlg()))
|| (BigDecimalUtils.safeMultiply(BigDecimalUtils.isNullToZero(infoVo.getUnitInjuryMoney()),
BigDecimalUtils.isNullToZero(paymentInfo.getUnitInjuryMoney())).compareTo(BigDecimal.ZERO) > 0))) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), paymentInfo.getSocialHousehold(), paymentInfo.getProvidentHousehold(), infoVo.getEmpName(), "已存在对应员工身份证" + infoVo.getEmpIdcard()
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), paymentInfo.getSocialHousehold(), paymentInfo.getProvidentHousehold(), infoVo.getEmpName(), "已存在对应员工身份证" + infoVo.getEmpIdcard()
+ "的单位工伤缴费数据,请勿重复导入!"));
continue;
}
......@@ -1250,7 +1252,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
if (null != paymentInfo && ((null != paymentInfo.getBrSameFlg() && CommonConstants.ONE_STRING.equals(paymentInfo.getBrSameFlg()))
|| (BigDecimalUtils.safeMultiply(BigDecimalUtils.isNullToZero(infoVo.getUnitBirthMoney()),
BigDecimalUtils.isNullToZero(paymentInfo.getUnitBirthMoney())).compareTo(BigDecimal.ZERO) > 0))) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), paymentInfo.getSocialHousehold(), paymentInfo.getProvidentHousehold(), infoVo.getEmpName(), "已存在对应员工身份证" + infoVo.getEmpIdcard()
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), paymentInfo.getSocialHousehold(), paymentInfo.getProvidentHousehold(), infoVo.getEmpName(), "已存在对应员工身份证" + infoVo.getEmpIdcard()
+ "的单位生育缴费数据,请勿重复导入!"));
continue;
}
......@@ -1276,7 +1278,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
paymentInfo.setSocialCity(socialInfo.getSocialCity());
paymentInfo.setSocialTown(socialInfo.getSocialTown());
paymentInfo.setSocialHousehold(socialInfo.getSocialHouseholdName());
} else if(Common.isNotNull(tSocialInfo)){
} else if (Common.isNotNull(tSocialInfo)) {
paymentInfo.setEmpId(tSocialInfo.getEmpId());
paymentInfo.setEmpIdcard(tSocialInfo.getEmpIdcard());
paymentInfo.setEmpName(tSocialInfo.getEmpName());
......@@ -1286,11 +1288,12 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
TSettleDomainListVo tSettleDomainListVo = listVo.getData();
if (Common.isNotNull(tSettleDomainListVo) && Common.isNotEmpty(tSettleDomainListVo.getListSelectVO())) {
settleDomainR = tSettleDomainListVo.getListSelectVO();
for (TSettleDomainSelectVo vo :settleDomainR) {
for (TSettleDomainSelectVo vo : settleDomainR) {
paymentInfo.setSettleDomainName(vo.getDepartName());
paymentInfo.setSettleDomainCode(vo.getDepartNo());
paymentInfo.setUnitId(vo.getCustomerId());
paymentInfo.setUnitName(vo.getCustomerName()); }
paymentInfo.setUnitName(vo.getCustomerName());
}
}
}
paymentInfo.setSocialProvince(tSocialInfo.getSocialProvince());
......@@ -1371,9 +1374,9 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
paymentInfo.setSocialId(UUID.randomUUID().toString());
res = insertAndSTimestamp(paymentInfo);
if (res < 0) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), paymentInfo.getSocialHousehold(), paymentInfo.getProvidentHousehold(), infoVo.getEmpName() , CommonConstants.SAVE_FAILED));
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), paymentInfo.getSocialHousehold(), paymentInfo.getProvidentHousehold(), infoVo.getEmpName(), CommonConstants.SAVE_FAILED));
} else {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ONE_INT, infoVo.getEmpIdcard(), paymentInfo.getSocialHousehold(), paymentInfo.getProvidentHousehold(), infoVo.getEmpName() , CommonConstants.SAVE_SUCCESS));
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ONE_INT, infoVo.getEmpIdcard(), paymentInfo.getSocialHousehold(), paymentInfo.getProvidentHousehold(), infoVo.getEmpName(), CommonConstants.SAVE_SUCCESS));
}
}
}
......@@ -1460,8 +1463,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
*/
private void saveData() {
log.info("{}条数据,开始存储数据库!", cachedDataList.size());
importTPaymentSocialHeFei(cachedDataList, errorMessageList, user, type, rowNumber,pensionMoneyMap,
bigMoneyMap,unEmpMoneyMap,injuryMoneyMap,medicalMoneyMap,sumNumKey,importSuccessKey);
importTPaymentSocialHeFei(cachedDataList, errorMessageList, user, type, rowNumber, pensionMoneyMap,
bigMoneyMap, unEmpMoneyMap, injuryMoneyMap, medicalMoneyMap, sumNumKey, importSuccessKey);
log.info("存储数据库成功!");
}
}).sheet().doRead();
......@@ -1598,27 +1601,27 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
//检查数据规范性
if (!Common.isNotNull(infoVo.getEmpIdcard())) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), infoVo.getSocialHousehold(), infoVo.getProvidentHousehold(), infoVo.getEmpName(), CommonConstants.DOWN_LINE_STRING + "员工身份证不可为空!"));
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), infoVo.getSocialHousehold(), infoVo.getProvidentHousehold(), infoVo.getEmpName(), CommonConstants.DOWN_LINE_STRING + "员工身份证不可为空!"));
continue;
}
if (!Common.isNotNull(infoVo.getProvidentPayMonth())) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), infoVo.getSocialHousehold(), infoVo.getProvidentHousehold(), infoVo.getEmpName(), CommonConstants.DOWN_LINE_STRING + "公积金缴纳月份不可为空!"));
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), infoVo.getSocialHousehold(), infoVo.getProvidentHousehold(), infoVo.getEmpName(), CommonConstants.DOWN_LINE_STRING + "公积金缴纳月份不可为空!"));
continue;
}
if (!Common.isNotNull(infoVo.getProvidentCreateMonth())) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), infoVo.getSocialHousehold(), infoVo.getProvidentHousehold(), infoVo.getEmpName(), CommonConstants.DOWN_LINE_STRING + "公积金生成月份不可为空!"));
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), infoVo.getSocialHousehold(), infoVo.getProvidentHousehold(), infoVo.getEmpName(), CommonConstants.DOWN_LINE_STRING + "公积金生成月份不可为空!"));
continue;
}
if (!Common.isNotNull(infoVo.getProvidentPercent())) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), infoVo.getSocialHousehold(), infoVo.getProvidentHousehold(), infoVo.getEmpName(), CommonConstants.DOWN_LINE_STRING + "公积金单边比例不可为空!"));
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), infoVo.getSocialHousehold(), infoVo.getProvidentHousehold(), infoVo.getEmpName(), CommonConstants.DOWN_LINE_STRING + "公积金单边比例不可为空!"));
continue;
}
if (!Common.isNotNull(infoVo.getUnitProvidentSet())) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), infoVo.getSocialHousehold(), infoVo.getProvidentHousehold(), infoVo.getEmpName(), CommonConstants.DOWN_LINE_STRING + "公积金单边基数不可为空!"));
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), infoVo.getSocialHousehold(), infoVo.getProvidentHousehold(), infoVo.getEmpName(), CommonConstants.DOWN_LINE_STRING + "公积金单边基数不可为空!"));
continue;
}
if (!Common.isNotNull(infoVo.getProvidentPayAddr())) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), infoVo.getSocialHousehold(), infoVo.getProvidentHousehold(), infoVo.getEmpName(), CommonConstants.DOWN_LINE_STRING + "公积金缴纳地不可为空!"));
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), infoVo.getSocialHousehold(), infoVo.getProvidentHousehold(), infoVo.getEmpName(), CommonConstants.DOWN_LINE_STRING + "公积金缴纳地不可为空!"));
continue;
}
if (fundMap.size() > CommonConstants.ZERO_INT) {
......@@ -1626,11 +1629,11 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
//对身份证与人员姓名的对应关系进行校验
if (null != fund && !fund.getEmpName().equals(infoVo.getEmpName())) {
errorMessageList.add
(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), fund.getSocialHousehold(), fund.getProvidentHousehold(), infoVo.getEmpName(), "姓名与身份证信息不一致,请核实后再次尝试!"));
(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), fund.getSocialHousehold(), fund.getProvidentHousehold(), infoVo.getEmpName(), "姓名与身份证信息不一致,请核实后再次尝试!"));
continue;
}
areaArray = infoVo.getProvidentPayAddr().split(CommonConstants.CENTER_SPLIT_LINE_STRING);
fund = checkAddress(areaArray, areaMap, fund, areaMap2,infoVo);
fund = checkAddress(areaArray, areaMap, fund, areaMap2, infoVo);
//无对应员工公积金数据
if (null == fund) {
boolean isTrueAdder = false;
......@@ -1639,12 +1642,12 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
.eq(TProvidentFund::getFundProvince, infoVo.getSocialProvince())
.eq(TProvidentFund::getFundCity, infoVo.getSocialCity()));
if (!fundlist.isEmpty()) {
for (TProvidentFund providentFund:fundlist) {
for (TProvidentFund providentFund : fundlist) {
if ((Common.isEmpty(infoVo.getSocialTown()) || (Common.isNotNull(infoVo.getSocialTown()) &&
infoVo.getFundTown().equals(providentFund.getFundTown()))) &&
DateUtil.dateToString(providentFund.getProvidentStart(),"yyyyMM").compareTo(infoVo.getProvidentPayMonth()) <=0 &&
DateUtil.dateToString(providentFund.getProvidentStart(), "yyyyMM").compareTo(infoVo.getProvidentPayMonth()) <= 0 &&
(Common.isEmpty(providentFund.getFundReduceDate()) || (Common.isNotNull(providentFund.getFundReduceDate()) &&
DateUtil.dateToString(providentFund.getFundReduceDate(),"yyyyMM").compareTo(infoVo.getProvidentPayMonth()) >=0))) {
DateUtil.dateToString(providentFund.getFundReduceDate(), "yyyyMM").compareTo(infoVo.getProvidentPayMonth()) >= 0))) {
isTrueAdder = true;
tProvidentFund = providentFund;
break;
......@@ -1676,7 +1679,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
if (null != paymentInfo && BigDecimalUtils.isNullToZero(paymentInfo.getProvidentSum()).compareTo(BigDecimal.ZERO) != 0) {
//允许覆盖,但已核准表或工资结算或已锁定不允许覆盖
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), paymentInfo.getSocialHousehold(), paymentInfo.getProvidentHousehold(), infoVo.getEmpName(), "已存在对应员工身份证" +
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), paymentInfo.getSocialHousehold(), paymentInfo.getProvidentHousehold(), infoVo.getEmpName(), "已存在对应员工身份证" +
infoVo.getEmpName() + CommonConstants.DOWN_LINE_STRING + infoVo.getEmpIdcard()
+ "公积金缴费数据,禁止覆盖!"));
continue;
......@@ -1712,11 +1715,12 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
TSettleDomainListVo tSettleDomainListVo = listVo.getData();
if (Common.isNotNull(tSettleDomainListVo) && Common.isNotEmpty(tSettleDomainListVo.getListSelectVO())) {
settleDomainR = tSettleDomainListVo.getListSelectVO();
for (TSettleDomainSelectVo vo :settleDomainR) {
for (TSettleDomainSelectVo vo : settleDomainR) {
paymentInfo.setSettleDomainName(vo.getDepartName());
paymentInfo.setSettleDomainCode(vo.getDepartNo());
paymentInfo.setUnitId(vo.getCustomerId());
paymentInfo.setUnitName(vo.getCustomerName()); }
paymentInfo.setUnitName(vo.getCustomerName());
}
}
}
paymentInfo.setFundProvince(tProvidentFund.getFundProvince());
......@@ -1763,14 +1767,14 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
paymentInfo.setFundId(UUID.randomUUID().toString());
res = insertAndSTimestamp(paymentInfo);
if (res < 0) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), paymentInfo.getSocialHousehold(), paymentInfo.getProvidentHousehold(), infoVo.getEmpName()
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), paymentInfo.getSocialHousehold(), paymentInfo.getProvidentHousehold(), infoVo.getEmpName()
, CommonConstants.SAVE_FAILED));
continue;
} else {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ONE_INT, infoVo.getEmpIdcard(), paymentInfo.getSocialHousehold(), paymentInfo.getProvidentHousehold(), infoVo.getEmpName()
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ONE_INT, infoVo.getEmpIdcard(), paymentInfo.getSocialHousehold(), paymentInfo.getProvidentHousehold(), infoVo.getEmpName()
, CommonConstants.SAVE_SUCCESS));
}
if (Common.isNotNull(paymentInfo.getId()) && Common.isNotNull(paymentInfo.getFundId())) {
if (Common.isNotNull(paymentInfo.getId()) && Common.isNotNull(paymentInfo.getFundId())) {
paymentInfoMap.put(paymentInfo.getProvidentPayAddr()
+ CommonConstants.DOWN_LINE_STRING
+ paymentInfo.getEmpIdcard().trim()
......@@ -1796,7 +1800,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
ConcurrentHashMap<String, BigDecimal> unEmpMoneyMap,
ConcurrentHashMap<String, BigDecimal> injuryMoneyMap,
ConcurrentHashMap<String, BigDecimal> medicalMoneyMap,
String sumNumKey,String importSuccessKey) {
String sumNumKey, String importSuccessKey) {
HashMap<String, String> areaMap = new HashMap<>();
HashMap<String, String> areaMap2 = new HashMap<>();
......@@ -2000,8 +2004,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
CompletableFuture<List<ErrorDetailVO>> listCompletableFuture = CompletableFuture.supplyAsync(()
-> executeImportSocialListThree(user, list, areaMap, areaMap2,
paymentInfoPensionMap, paymentInfoMedicalMap, paymentInfoUnEmpMap, paymentInfoInjuryMap,
paymentInfoBigMap, type, errorMessageList,pensionMoneyMap, bigMoneyMap,
unEmpMoneyMap,injuryMoneyMap,medicalMoneyMap),
paymentInfoBigMap, type, errorMessageList, pensionMoneyMap, bigMoneyMap,
unEmpMoneyMap, injuryMoneyMap, medicalMoneyMap),
yfSocialImportThreadPoolExecutor);
completableFutureList.add(listCompletableFuture);
}
......@@ -2015,7 +2019,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
-> executeImportSocialListThree(user, finalList, areaMap,
areaMap2, paymentInfoPensionMap, paymentInfoMedicalMap, paymentInfoUnEmpMap,
paymentInfoInjuryMap, paymentInfoBigMap, type,
errorMessageList,pensionMoneyMap, bigMoneyMap,unEmpMoneyMap,injuryMoneyMap,
errorMessageList, pensionMoneyMap, bigMoneyMap, unEmpMoneyMap, injuryMoneyMap,
medicalMoneyMap), yfSocialImportThreadPoolExecutor);
completableFutureList.add(oneCompletableFuture);
lastIdx = 1;
......@@ -2029,8 +2033,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
-> executeImportSocialListThree(user, finalTempList1
, areaMap, areaMap2, paymentInfoPensionMap, paymentInfoMedicalMap,
paymentInfoUnEmpMap, paymentInfoInjuryMap, paymentInfoBigMap, type,
errorMessageList,pensionMoneyMap, bigMoneyMap,unEmpMoneyMap,
injuryMoneyMap,medicalMoneyMap), yfSocialImportThreadPoolExecutor);
errorMessageList, pensionMoneyMap, bigMoneyMap, unEmpMoneyMap,
injuryMoneyMap, medicalMoneyMap), yfSocialImportThreadPoolExecutor);
completableFutureList.add(listCompletableFuture);
tempList = new ArrayList<>();
}
......@@ -2055,8 +2059,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
CompletableFuture<List<ErrorDetailVO>> listCompletableFuture = CompletableFuture.supplyAsync(()
-> executeImportSocialListThree(user, finalTempList, areaMap,
areaMap2, paymentInfoPensionMap, paymentInfoMedicalMap, paymentInfoUnEmpMap,
paymentInfoInjuryMap, paymentInfoBigMap, type, errorMessageList,pensionMoneyMap,
bigMoneyMap,unEmpMoneyMap,injuryMoneyMap,medicalMoneyMap)
paymentInfoInjuryMap, paymentInfoBigMap, type, errorMessageList, pensionMoneyMap,
bigMoneyMap, unEmpMoneyMap, injuryMoneyMap, medicalMoneyMap)
, yfSocialImportThreadPoolExecutor);
completableFutureList.add(listCompletableFuture);
}
......@@ -2080,20 +2084,20 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
private List<ErrorDetailVO> executeImportSocialListThree(YifuUser user,
List<TPaymentHeFeiVo> list,
HashMap<String, String> areaMap,
HashMap<String, String> areaMap2,
ConcurrentHashMap<String, TPaymentInfo> paymentInfoPensionMap,
ConcurrentHashMap<String, TPaymentInfo> paymentInfoMedicalMap,
ConcurrentHashMap<String, TPaymentInfo> paymentInfoUnEmpMap,
ConcurrentHashMap<String, TPaymentInfo> paymentInfoInjuryMap,
ConcurrentHashMap<String, TPaymentInfo> paymentInfoBigMap,
String type, List<ErrorDetailVO> errorMessageList,
ConcurrentHashMap<String, BigDecimal> pensionMoneyMap,
ConcurrentHashMap<String, BigDecimal> bigMoneyMap,
ConcurrentHashMap<String, BigDecimal> unEmpMoneyMap,
ConcurrentHashMap<String, BigDecimal> injuryMoneyMap,
ConcurrentHashMap<String, BigDecimal> medicalMoneyMap) {
List<TPaymentHeFeiVo> list,
HashMap<String, String> areaMap,
HashMap<String, String> areaMap2,
ConcurrentHashMap<String, TPaymentInfo> paymentInfoPensionMap,
ConcurrentHashMap<String, TPaymentInfo> paymentInfoMedicalMap,
ConcurrentHashMap<String, TPaymentInfo> paymentInfoUnEmpMap,
ConcurrentHashMap<String, TPaymentInfo> paymentInfoInjuryMap,
ConcurrentHashMap<String, TPaymentInfo> paymentInfoBigMap,
String type, List<ErrorDetailVO> errorMessageList,
ConcurrentHashMap<String, BigDecimal> pensionMoneyMap,
ConcurrentHashMap<String, BigDecimal> bigMoneyMap,
ConcurrentHashMap<String, BigDecimal> unEmpMoneyMap,
ConcurrentHashMap<String, BigDecimal> injuryMoneyMap,
ConcurrentHashMap<String, BigDecimal> medicalMoneyMap) {
if (Common.isNotNull(list)) {
TPaymentInfo payExists;
TSocialFundInfo socialInfo = null;
......@@ -2141,11 +2145,11 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
//对身份证与人员姓名的对应关系进行校验
if (socialInfo != null && !socialInfo.getEmpName().equals(infoVo.getEmpName())) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), "", "", infoVo.getEmpName(), "姓名与身份证信息不一致,请核实后再次尝试!"));
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), "", "", infoVo.getEmpName(), "姓名与身份证信息不一致,请核实后再次尝试!"));
continue;
}
if (socialInfo != null && socialInfo.getSocialStartDate() == null) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), "", "", infoVo.getEmpName() , SocialConstants.ERROR_TEMPLATE + "的社保起缴日期为空!"));
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), "", "", infoVo.getEmpName(), SocialConstants.ERROR_TEMPLATE + "的社保起缴日期为空!"));
continue;
}
}
......@@ -2156,12 +2160,12 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
.eq(TSocialInfo::getSocialProvince, infoVo.getSocialProvince().toString())
.eq(TSocialInfo::getSocialCity, infoVo.getSocialCity().toString()));
if (!socialist.isEmpty()) {
for (TSocialInfo socialInfo1:socialist) {
for (TSocialInfo socialInfo1 : socialist) {
if ((Common.isEmpty(infoVo.getSocialTown()) || (Common.isNotNull(infoVo.getSocialTown()) &&
infoVo.getSocialTown().toString().equals(socialInfo1.getSocialTown()))) &&
DateUtil.dateToString(socialInfo1.getSocialStartDate(),"yyyyMM").compareTo(infoVo.getSocialPayMonth()) <=0 &&
DateUtil.dateToString(socialInfo1.getSocialStartDate(), "yyyyMM").compareTo(infoVo.getSocialPayMonth()) <= 0 &&
(Common.isEmpty(socialInfo1.getSocialReduceDate()) || (Common.isNotNull(socialInfo1.getSocialReduceDate()) &&
DateUtil.dateToString(socialInfo1.getSocialReduceDate(),"yyyyMM").compareTo(infoVo.getSocialPayMonth()) >=0))) {
DateUtil.dateToString(socialInfo1.getSocialReduceDate(), "yyyyMM").compareTo(infoVo.getSocialPayMonth()) >= 0))) {
isTrueAdder = true;
tSocialInfo = socialInfo1;
break;
......@@ -2182,8 +2186,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
if (pensionMoneyMap.get(exitMoney) != null && BigDecimalUtils.safeMultiply(BigDecimalUtils.safeAdd(
BigDecimalUtils.isNullToZero(infoVo.getPersonalMoney()), BigDecimalUtils.isNullToZero(
infoVo.getUnitMoney())), pensionMoneyMap.get(exitMoney)).compareTo(BigDecimal.ZERO) > 0) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), "", "", SocialConstants.ERROR_TEMPLATE +
infoVo.getEmpName() , SocialConstants.ERROR_TEMPLATE + "的养老缴费数据"));
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), "", "", SocialConstants.ERROR_TEMPLATE +
infoVo.getEmpName(), SocialConstants.ERROR_TEMPLATE + "的养老缴费数据"));
continue;
} else {
pensionMoneyMap.put(exitMoney, BigDecimalUtils.safeAdd(BigDecimalUtils.isNullToZero(infoVo.getPersonalMoney()),
......@@ -2206,7 +2210,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
BigDecimalUtils.isNullToZero(infoVo.getUnitMoney())), BigDecimalUtils.safeAdd(
BigDecimalUtils.isNullToZero(payExists.getUnitPensionMoney()),
BigDecimalUtils.isNullToZero(payExists.getPersonalPensionMoney()))).compareTo(BigDecimal.ZERO) > 0))) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), payExists.getSocialHousehold(), payExists.getProvidentHousehold(), infoVo.getEmpName(), "已存在对应员工身份证" + infoVo.getEmpIdcard()
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), payExists.getSocialHousehold(), payExists.getProvidentHousehold(), infoVo.getEmpName(), "已存在对应员工身份证" + infoVo.getEmpIdcard()
+ "的养老缴费数据,请勿重复导入!"));
continue;
}
......@@ -2219,8 +2223,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
if (unEmpMoneyMap.get(exitMoney) != null && BigDecimalUtils.safeMultiply(BigDecimalUtils.safeAdd(
BigDecimalUtils.isNullToZero(infoVo.getUnitMoney()), BigDecimalUtils.isNullToZero(
infoVo.getPersonalMoney())), unEmpMoneyMap.get(exitMoney)).compareTo(BigDecimal.ZERO) > 0) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), "", "", SocialConstants.ERROR_TEMPLATE +
infoVo.getEmpName() , SocialConstants.ERROR_TEMPLATE + "的失业缴费数据"));
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), "", "", SocialConstants.ERROR_TEMPLATE +
infoVo.getEmpName(), SocialConstants.ERROR_TEMPLATE + "的失业缴费数据"));
continue;
} else {
unEmpMoneyMap.put(exitMoney, BigDecimalUtils.safeAdd(
......@@ -2244,7 +2248,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
BigDecimalUtils.isNullToZero(infoVo.getUnitMoney())), BigDecimalUtils.safeAdd(
BigDecimalUtils.isNullToZero(payExists.getUnitUnemploymentMoney()),
BigDecimalUtils.isNullToZero(payExists.getPersonalUnemploymentMoney()))).compareTo(BigDecimal.ZERO) > 0))) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), payExists.getSocialHousehold(), payExists.getProvidentHousehold(), infoVo.getEmpName(), "已存在对应员工身份证" + infoVo.getEmpIdcard()
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), payExists.getSocialHousehold(), payExists.getProvidentHousehold(), infoVo.getEmpName(), "已存在对应员工身份证" + infoVo.getEmpIdcard()
+ "的失业缴费数据,请勿重复导入!"));
continue;
}
......@@ -2257,8 +2261,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
if (medicalMoneyMap.get(exitMoney) != null && BigDecimalUtils.safeMultiply(BigDecimalUtils.safeAdd(
BigDecimalUtils.isNullToZero(infoVo.getUnitMedicalMoney()), BigDecimalUtils.isNullToZero(
infoVo.getPersonalMedicalMoney())), medicalMoneyMap.get(exitMoney)).compareTo(BigDecimal.ZERO) > 0) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), "", "", SocialConstants.ERROR_TEMPLATE +
infoVo.getEmpName() , SocialConstants.ERROR_TEMPLATE + "的医保缴费数据"));
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), "", "", SocialConstants.ERROR_TEMPLATE +
infoVo.getEmpName(), SocialConstants.ERROR_TEMPLATE + "的医保缴费数据"));
continue;
} else {
medicalMoneyMap.put(exitMoney, BigDecimalUtils.safeAdd(
......@@ -2283,7 +2287,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
BigDecimalUtils.isNullToZero(infoVo.getPersonalMedicalMoney())), BigDecimalUtils.safeAdd(
BigDecimalUtils.isNullToZero(payExists.getUnitMedicalMoney()),
BigDecimalUtils.isNullToZero(payExists.getPersonalMedicalMoney()))).compareTo(BigDecimal.ZERO) > 0))) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), payExists.getSocialHousehold(), payExists.getProvidentHousehold(), infoVo.getEmpName(), "已存在对应员工身份证" + infoVo.getEmpIdcard()
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), payExists.getSocialHousehold(), payExists.getProvidentHousehold(), infoVo.getEmpName(), "已存在对应员工身份证" + infoVo.getEmpIdcard()
+ "的医保缴费数据,请勿重复导入!"));
continue;
}
......@@ -2296,9 +2300,9 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
if (injuryMoneyMap.get(exitMoney) != null && BigDecimalUtils.safeMultiply(BigDecimalUtils.safeAdd(
BigDecimalUtils.isNullToZero(infoVo.getPersonalMoney()),
BigDecimalUtils.isNullToZero(infoVo.getUnitMoney())),
injuryMoneyMap.get(exitMoney)).compareTo(BigDecimal.ZERO) > 0) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), "", "", SocialConstants.ERROR_TEMPLATE +
infoVo.getEmpName() , SocialConstants.ERROR_TEMPLATE + "的工伤缴费数据"));
injuryMoneyMap.get(exitMoney)).compareTo(BigDecimal.ZERO) > 0) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), "", "", SocialConstants.ERROR_TEMPLATE +
infoVo.getEmpName(), SocialConstants.ERROR_TEMPLATE + "的工伤缴费数据"));
continue;
} else {
injuryMoneyMap.put(exitMoney, BigDecimalUtils.safeAdd(
......@@ -2322,7 +2326,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
BigDecimalUtils.isNullToZero(infoVo.getPersonalMoney()),
BigDecimalUtils.isNullToZero(infoVo.getUnitMoney())),
BigDecimalUtils.isNullToZero(payExists.getUnitInjuryMoney())).compareTo(BigDecimal.ZERO) > 0))) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), payExists.getSocialHousehold(), payExists.getProvidentHousehold(), infoVo.getEmpName(), "已存在对应员工身份证" + infoVo.getEmpIdcard()
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), payExists.getSocialHousehold(), payExists.getProvidentHousehold(), infoVo.getEmpName(), "已存在对应员工身份证" + infoVo.getEmpIdcard()
+ "的单位工伤缴费数据,请勿重复导入!"));
continue;
}
......@@ -2336,8 +2340,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
BigDecimalUtils.isNullToZero(infoVo.getUnitBigailmentMoney()),
BigDecimalUtils.isNullToZero(infoVo.getPersonalBigailmentMoney())),
bigMoneyMap.get(exitMoney)).compareTo(BigDecimal.ZERO) > 0) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), "", "", SocialConstants.ERROR_TEMPLATE +
infoVo.getEmpName() , SocialConstants.ERROR_TEMPLATE + "的医疗救助金缴费数据"));
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), "", "", SocialConstants.ERROR_TEMPLATE +
infoVo.getEmpName(), SocialConstants.ERROR_TEMPLATE + "的医疗救助金缴费数据"));
continue;
} else {
bigMoneyMap.put(exitMoney, BigDecimalUtils.safeAdd(
......@@ -2362,7 +2366,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
BigDecimalUtils.isNullToZero(infoVo.getPersonalBigailmentMoney())), BigDecimalUtils.safeAdd(
BigDecimalUtils.isNullToZero(payExists.getUnitBigmailmentMoney()),
BigDecimalUtils.isNullToZero(payExists.getPersonalBigmailmentMoney()))).compareTo(BigDecimal.ZERO) > 0))) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), payExists.getSocialHousehold(), payExists.getProvidentHousehold(), infoVo.getEmpName(), "已存在对应员工身份证" + infoVo.getEmpIdcard()
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), payExists.getSocialHousehold(), payExists.getProvidentHousehold(), infoVo.getEmpName(), "已存在对应员工身份证" + infoVo.getEmpIdcard()
+ "的医疗救助金缴费数据,请勿重复导入!"));
continue;
}
......@@ -2389,7 +2393,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
payExists.setSocialCity(socialInfo.getSocialCity());
payExists.setSocialTown(socialInfo.getSocialTown());
payExists.setSocialHousehold(socialInfo.getSocialHouseholdName());
}else if (Common.isNotNull(tSocialInfo)) {
} else if (Common.isNotNull(tSocialInfo)) {
payExists.setEmpId(tSocialInfo.getEmpId());
payExists.setEmpIdcard(tSocialInfo.getEmpIdcard());
payExists.setEmpName(tSocialInfo.getEmpName());
......@@ -2399,11 +2403,12 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
TSettleDomainListVo tSettleDomainListVo = listVo.getData();
if (Common.isNotNull(tSettleDomainListVo) && Common.isNotEmpty(tSettleDomainListVo.getListSelectVO())) {
settleDomainR = tSettleDomainListVo.getListSelectVO();
for (TSettleDomainSelectVo vo :settleDomainR) {
for (TSettleDomainSelectVo vo : settleDomainR) {
payExists.setSettleDomainName(vo.getDepartName());
payExists.setSettleDomainCode(vo.getDepartNo());
payExists.setUnitId(vo.getCustomerId());
payExists.setUnitName(vo.getCustomerName()); }
payExists.setUnitName(vo.getCustomerName());
}
}
}
payExists.setSocialProvince(tSocialInfo.getSocialProvince());
......@@ -2484,9 +2489,9 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
res = insertAndSTimestamp(payExists);
if (res < 0) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), payExists.getSocialHousehold(), payExists.getProvidentHousehold(), infoVo.getEmpName() , CommonConstants.SAVE_FAILED));
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), payExists.getSocialHousehold(), payExists.getProvidentHousehold(), infoVo.getEmpName(), CommonConstants.SAVE_FAILED));
} else {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ONE_INT, infoVo.getEmpIdcard(), payExists.getSocialHousehold(), payExists.getProvidentHousehold(), infoVo.getEmpName() , CommonConstants.SAVE_SUCCESS));
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ONE_INT, infoVo.getEmpIdcard(), payExists.getSocialHousehold(), payExists.getProvidentHousehold(), infoVo.getEmpName(), CommonConstants.SAVE_SUCCESS));
}
}
}
......@@ -2499,21 +2504,21 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
private boolean socialThreeCheckBase(List<ErrorDetailVO> errorMessageList, TPaymentHeFeiVo
infoVo, String type) {
if (!Common.isNotNull(infoVo.getSocialPayMonth())) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), "", "", infoVo.getEmpName(), "社保缴纳月份不可为空!"));
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), "", "", infoVo.getEmpName(), "社保缴纳月份不可为空!"));
return true;
}
if (!Common.isNotNull(infoVo.getSocialCreateMonth())) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), "", "", infoVo.getEmpName(), "社保生成月份不可为空!"));
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), "", "", infoVo.getEmpName(), "社保生成月份不可为空!"));
return true;
}
if (!Common.isNotNull(infoVo.getSocialPayAddr())) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), "", "", infoVo.getEmpName(), "社保缴纳地不可为空!"));
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), "", "", infoVo.getEmpName(), "社保缴纳地不可为空!"));
return true;
}
if (CommonConstants.ZERO_STRING.equals(type) && !PaymentConstants.PENSION_RISK.equals(infoVo.getRiskType())
&& !PaymentConstants.UNEMPLOYEEMENT_RISK.equals(infoVo.getRiskType())
&& !PaymentConstants.INJURY_RISK.equals(infoVo.getRiskType())) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), "", "", infoVo.getEmpName(), "无相关险种!"));
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), "", "", infoVo.getEmpName(), "无相关险种!"));
return true;
}
return false;
......@@ -2610,6 +2615,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
/**
* 薪资获取缴费库
*
* @Author hgw
* @Date 2022-8-10 18:06:13
**/
......@@ -2667,16 +2673,16 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
.eq(TPaymentInfo::getPushStatus, CommonConstants.ONE_STRING)
.eq(TPaymentInfo::getLockStatus, CommonConstants.ONE_STRING)
.isNotNull(TPaymentInfo::getSocialId));
if (count > 0){
if (count > 0) {
List<TPaymentInfo> unPushs;
int i = (int)Math.ceil((double)count/CommonConstants.TEN_THOUSAND_INT);
Map<String,TSettleDomainSelectVo> mapSelectVo = this.getSelectVoMap();
for (int j=0;j<i;j++){
int i = (int) Math.ceil((double) count / CommonConstants.TEN_THOUSAND_INT);
Map<String, TSettleDomainSelectVo> mapSelectVo = this.getSelectVoMap();
for (int j = 0; j < i; j++) {
unPushs = baseMapper.selectList(Wrappers.<TPaymentInfo>query().lambda()
.eq(TPaymentInfo::getPushStatus, CommonConstants.ONE_STRING)
.eq(TPaymentInfo::getLockStatus, CommonConstants.ONE_STRING)
.isNotNull(TPaymentInfo::getSocialId).last(" limit 0,10000"));
synchronized (this){
synchronized (this) {
if (Common.isNotNull(unPushs)) {
//推送数据封装并推送
doJointSocialTask.asynchronousEkpPaymentSocial(unPushs, mapSelectVo);
......@@ -2698,7 +2704,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
if (count > 0) {
List<TPaymentInfo> unPushInfo;
int i = (int) Math.ceil((double) count / CommonConstants.TEN_THOUSAND_INT);
Map<String,TSettleDomainSelectVo> mapSelectVo = this.getSelectVoMap();
Map<String, TSettleDomainSelectVo> mapSelectVo = this.getSelectVoMap();
for (int j = 0; j < i; j++) {
//获取所有未推送的公积金实缴明细数据
unPushInfo = baseMapper.selectList(Wrappers.<TPaymentInfo>query().lambda()
......@@ -2724,18 +2730,18 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
String key = user.getId() + CommonConstants.DOWN_LINE_STRING + CommonConstants.PAYMENT_SOCIAL_PUSH;
redisUtil.set(key, user.getId(), 36000L);
Map<String,TSettleDomainSelectVo> mapSelectVo = this.getSelectVoMap();
Map<String, TSettleDomainSelectVo> mapSelectVo = this.getSelectVoMap();
//手动推送未推送的社保公积金明细数据
createPaymentSocialInfoReal(user, searchVo,mapSelectVo);
createPaymentFundInfoReal(user, searchVo,mapSelectVo);
createPaymentSocialInfoReal(user, searchVo, mapSelectVo);
createPaymentFundInfoReal(user, searchVo, mapSelectVo);
//推送社保公积金收入数据
String redisKey = String.valueOf(UUID.randomUUID()).replaceAll("-", "") + "_incomePush";
createPaymentInfoIncomeReal(user, searchVo,mapSelectVo,redisKey);
createPaymentFundIncomeReal(user, searchVo,mapSelectVo,redisKey);
createPaymentInfoIncomeReal(user, searchVo, mapSelectVo, redisKey);
createPaymentFundIncomeReal(user, searchVo, mapSelectVo, redisKey);
//推送失败的数据重新推送
if (Common.isNotNull(redisUtil.get(redisKey))) {
List<TIncome> list = (List<TIncome>) redisUtil.get(redisKey);
for (TIncome income:list) {
for (TIncome income : list) {
doJointSocialTask.asynchronousEkpIncomePaymentT(income);
}
redisUtil.remove(redisKey);
......@@ -2758,7 +2764,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
return R.failed("未找到本人创建的未标识确认无误的数据");
} else {
LambdaUpdateWrapper<TPaymentInfo> updateWrapper = new UpdateWrapper<TPaymentInfo>().lambda();
updateWrapper.set(TPaymentInfo::getLockStatus,CommonConstants.ONE_STRING).in(TPaymentInfo::getId,list);
updateWrapper.set(TPaymentInfo::getLockStatus, CommonConstants.ONE_STRING).in(TPaymentInfo::getId, list);
return R.ok(this.update(updateWrapper));
}
}
......@@ -2766,33 +2772,33 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
@Override
public void createPaymentInfoIncome() {
long count = baseMapper.selectCount(Wrappers.<TPaymentInfo>query().lambda()
.eq(TPaymentInfo::getIncomeStatus,CommonConstants.ONE_STRING)
.eq(TPaymentInfo::getLockStatus,CommonConstants.ONE_STRING)
.eq(TPaymentInfo::getIsIncomeStatus,CommonConstants.ZERO_STRING)
.isNotNull(TPaymentInfo::getSocialId));
.eq(TPaymentInfo::getIncomeStatus, CommonConstants.ONE_STRING)
.eq(TPaymentInfo::getLockStatus, CommonConstants.ONE_STRING)
.eq(TPaymentInfo::getIsIncomeStatus, CommonConstants.ZERO_STRING)
.isNotNull(TPaymentInfo::getSocialId));
if (count > 0) {
List<TPaymentInfo> sumList;
int i = (int) Math.ceil((double) count / CommonConstants.TEN_THOUSAND_INT);
Map<String,TSettleDomainSelectVo> mapSelectVo = this.getSelectVoMap();
Map<String, TSettleDomainSelectVo> mapSelectVo = this.getSelectVoMap();
String redisKey = String.valueOf(UUID.randomUUID()).replaceAll("-", "") + "_incomePush";
for (int j = 0; j < i; j++) {
//判断缴费库中社保合计和本次导入合计相加是否为0,为0则不生成收入
sumList = baseMapper.selectList(Wrappers.<TPaymentInfo>query().lambda()
.eq(TPaymentInfo::getIncomeStatus, CommonConstants.ONE_STRING)
.eq(TPaymentInfo::getLockStatus, CommonConstants.ONE_STRING)
.eq(TPaymentInfo::getIsIncomeStatus,CommonConstants.ZERO_STRING)
.eq(TPaymentInfo::getIsIncomeStatus, CommonConstants.ZERO_STRING)
.isNotNull(TPaymentInfo::getSocialId).last(" limit 0,10000"));
synchronized (this) {
if (Common.isNotNull(sumList)) {
//生成收入
createIncomeInfo(sumList, CommonConstants.ONE_STRING,mapSelectVo,redisKey);
createIncomeInfo(sumList, CommonConstants.ONE_STRING, mapSelectVo, redisKey);
}
}
}
//推送失败的数据重新推送
if (Common.isNotNull(redisUtil.get(redisKey))) {
List<TIncome> list = (List<TIncome>) redisUtil.get(redisKey);
for (TIncome income:list) {
for (TIncome income : list) {
doJointSocialTask.asynchronousEkpIncomePaymentT(income);
}
redisUtil.remove(redisKey);
......@@ -2806,32 +2812,32 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
@Override
public void createPaymentFundIncome() {
long count = baseMapper.selectCount(Wrappers.<TPaymentInfo>query().lambda()
.eq(TPaymentInfo::getIncomeStatus,CommonConstants.ONE_STRING)
.eq(TPaymentInfo::getLockStatus,CommonConstants.ONE_STRING)
.eq(TPaymentInfo::getIsIncomeStatus,CommonConstants.ZERO_STRING)
.eq(TPaymentInfo::getIncomeStatus, CommonConstants.ONE_STRING)
.eq(TPaymentInfo::getLockStatus, CommonConstants.ONE_STRING)
.eq(TPaymentInfo::getIsIncomeStatus, CommonConstants.ZERO_STRING)
.isNotNull(TPaymentInfo::getFundId));
if (count > 0) {
List<TPaymentInfo> sumList;
int i = (int) Math.ceil((double) count / CommonConstants.TEN_THOUSAND_INT);
Map<String,TSettleDomainSelectVo> mapSelectVo = this.getSelectVoMap();
Map<String, TSettleDomainSelectVo> mapSelectVo = this.getSelectVoMap();
String redisKey = String.valueOf(UUID.randomUUID()).replaceAll("-", "") + "_incomePush";
for (int j = 0; j < i; j++) {
sumList = baseMapper.selectList(Wrappers.<TPaymentInfo>query().lambda()
.eq(TPaymentInfo::getIncomeStatus, CommonConstants.ONE_STRING)
.eq(TPaymentInfo::getLockStatus, CommonConstants.ONE_STRING)
.eq(TPaymentInfo::getIsIncomeStatus,CommonConstants.ZERO_STRING)
.eq(TPaymentInfo::getIsIncomeStatus, CommonConstants.ZERO_STRING)
.isNotNull(TPaymentInfo::getFundId).last(" limit 0,10000"));
synchronized (this) {
if (Common.isNotNull(sumList)) {
//生成公积金收入
createIncomeInfo(sumList, CommonConstants.TWO_STRING,mapSelectVo,redisKey);
createIncomeInfo(sumList, CommonConstants.TWO_STRING, mapSelectVo, redisKey);
}
}
}
//推送失败的数据重新推送
if (Common.isNotNull(redisUtil.get(redisKey))) {
List<TIncome> list = (List<TIncome>) redisUtil.get(redisKey);
for (TIncome income:list) {
for (TIncome income : list) {
doJointSocialTask.asynchronousEkpIncomePaymentT(income);
}
redisUtil.remove(redisKey);
......@@ -2846,8 +2852,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
public void signPaymentNoIncomeFlag() {
//标识根据项目不需要生成收入的数据
long count = baseMapper.selectCount(Wrappers.<TPaymentInfo>query().lambda()
.eq(TPaymentInfo::getIncomeStatus,CommonConstants.ONE_STRING)
.eq(TPaymentInfo::getLockStatus,CommonConstants.ONE_STRING));
.eq(TPaymentInfo::getIncomeStatus, CommonConstants.ONE_STRING)
.eq(TPaymentInfo::getLockStatus, CommonConstants.ONE_STRING));
if (count > 0) {
List<TPaymentInfo> unPushInfo;
int i = (int) Math.ceil((double) count / CommonConstants.TEN_THOUSAND_INT);
......@@ -2866,11 +2872,11 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
}
public void createPaymentSocialInfoReal(YifuUser user,TPaymentInfoSearchVo searchVo,
Map<String,TSettleDomainSelectVo> mapSelectVo) {
public void createPaymentSocialInfoReal(YifuUser user, TPaymentInfoSearchVo searchVo,
Map<String, TSettleDomainSelectVo> mapSelectVo) {
//获取所有未推送的社保实缴明细数据
searchVo.setLockStatus(CommonConstants.ONE_STRING);
long count = baseMapper.getTPaymentSocialPushCount(searchVo,user.getId());
long count = baseMapper.getTPaymentSocialPushCount(searchVo, user.getId());
if (count > 0) {
List<TPaymentInfo> unPushInfo;
int i = (int) Math.ceil((double) count / CommonConstants.TEN_THOUSAND_INT);
......@@ -2886,11 +2892,11 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
}
public void createPaymentFundInfoReal(YifuUser user,TPaymentInfoSearchVo searchVo,
Map<String,TSettleDomainSelectVo> mapSelectVo) {
public void createPaymentFundInfoReal(YifuUser user, TPaymentInfoSearchVo searchVo,
Map<String, TSettleDomainSelectVo> mapSelectVo) {
//获取所有未推送的公积金实缴明细数据
searchVo.setLockStatus(CommonConstants.ONE_STRING);
long count = baseMapper.getTPaymentFundPushCount(searchVo,user.getId());
long count = baseMapper.getTPaymentFundPushCount(searchVo, user.getId());
if (count > 0) {
List<TPaymentInfo> unPushInfo;
int i = (int) Math.ceil((double) count / CommonConstants.TEN_THOUSAND_INT);
......@@ -2906,10 +2912,10 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
}
public void createPaymentInfoIncomeReal(YifuUser user,TPaymentInfoSearchVo searchVo,
Map<String,TSettleDomainSelectVo> mapSelectVo,String redisKey) {
public void createPaymentInfoIncomeReal(YifuUser user, TPaymentInfoSearchVo searchVo,
Map<String, TSettleDomainSelectVo> mapSelectVo, String redisKey) {
searchVo.setLockStatus(CommonConstants.ONE_STRING);
long count = baseMapper.getTPaymentSocialIncomeCount(searchVo,user.getId());
long count = baseMapper.getTPaymentSocialIncomeCount(searchVo, user.getId());
if (count > 0) {
List<TPaymentInfo> sumList;
int i = (int) Math.ceil((double) count / CommonConstants.TEN_THOUSAND_INT);
......@@ -2918,17 +2924,17 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
synchronized (this) {
if (Common.isNotNull(sumList)) {
//生成收入
createIncomeInfo(sumList, CommonConstants.ONE_STRING,mapSelectVo,redisKey);
createIncomeInfo(sumList, CommonConstants.ONE_STRING, mapSelectVo, redisKey);
}
}
}
}
}
public void createPaymentFundIncomeReal(YifuUser user,TPaymentInfoSearchVo searchVo,
Map<String,TSettleDomainSelectVo> mapSelectVo,String redisKey) {
public void createPaymentFundIncomeReal(YifuUser user, TPaymentInfoSearchVo searchVo,
Map<String, TSettleDomainSelectVo> mapSelectVo, String redisKey) {
searchVo.setLockStatus(CommonConstants.ONE_STRING);
long count = baseMapper.getTPaymentFundIncomeCount(searchVo,user.getId());
long count = baseMapper.getTPaymentFundIncomeCount(searchVo, user.getId());
if (count > 0) {
List<TPaymentInfo> sumList;
int i = (int) Math.ceil((double) count / CommonConstants.TEN_THOUSAND_INT);
......@@ -2937,7 +2943,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
synchronized (this) {
if (Common.isNotNull(sumList)) {
//生成公积金收入
createIncomeInfo(sumList, CommonConstants.TWO_STRING,mapSelectVo,redisKey);
createIncomeInfo(sumList, CommonConstants.TWO_STRING, mapSelectVo, redisKey);
}
}
}
......@@ -2991,128 +2997,128 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
}
}
}catch (Exception e) {
log.error("标识是否需要生成收入异常",e);
} catch (Exception e) {
log.error("标识是否需要生成收入异常", e);
}
}
public void createIncomeInfo(List<TPaymentInfo> updateList, String socialFundFlag,
Map<String,TSettleDomainSelectVo> mapSelectVo,String redisKey) {
Map<String, TSettleDomainSelectVo> mapSelectVo, String redisKey) {
List<TIncomeDetail> exitIncome;
TSettleDomain settleDomain;
try {
for (TPaymentInfo paymentInfo : updateList) {
boolean exitFlag = false;
if (CommonConstants.ONE_STRING.equals(socialFundFlag)) {
exitIncome = detailMapper.selectList(Wrappers.<TIncomeDetail>query().lambda()
.eq(TIncomeDetail::getEmpIdcard, paymentInfo.getEmpIdcard())
.eq(TIncomeDetail::getPayMonth, paymentInfo.getSocialPayMonth())
.eq(TIncomeDetail::getDeptId, paymentInfo.getSettleDomainId())
.eq(TIncomeDetail::getSourceType, CommonConstants.ONE_STRING));
} else {
exitIncome = detailMapper.selectList(Wrappers.<TIncomeDetail>query().lambda()
.eq(TIncomeDetail::getEmpIdcard, paymentInfo.getEmpIdcard())
.eq(TIncomeDetail::getPayMonth, paymentInfo.getProvidentPayMonth())
.eq(TIncomeDetail::getDeptId, paymentInfo.getSettleDomainId())
.eq(TIncomeDetail::getSourceType, CommonConstants.TWO_STRING));
}
if (Common.isNotNull(exitIncome)) {
BigDecimal sumMoney = BigDecimal.ZERO;
for (TIncomeDetail income : exitIncome) {
sumMoney = BigDecimalUtils.safeAdd(income.getMoney(), sumMoney);
if (paymentInfo.getId().equals(income.getSourceId())) {
exitFlag = true;
}
}
if (exitFlag) {
baseMapper.updateBySocialIncomeFlag(paymentInfo.getId());
continue;
}
if (sumMoney.compareTo(BigDecimal.ZERO) > 0) {
exitFlag = true;
}
}
//获取项目信息
if (Common.isNotNull(mapSelectVo)) {
settleDomain = mapSelectVo.get(paymentInfo.getSettleDomainCode());
} else {
settleDomain = null;
}
int isSum = 0;
if (Common.isNotNull(settleDomain)) {
boolean isIncomeFlag = false;
// 含有社保,则计算收入
if (Common.isNotNull(settleDomain.getManageServerItem()) && ((settleDomain.getManageServerItem().contains(CommonConstants.ONE_STRING)
&& CommonConstants.ONE_STRING.equals(socialFundFlag)) || (settleDomain.getManageServerItem().contains(CommonConstants.TWO_STRING)
&& CommonConstants.TWO_STRING.equals(socialFundFlag))) && CommonConstants.ZERO_STRING.equals(settleDomain.getManagementTag())) {
//预估模式
if (CommonConstants.TWO_STRING.equals(settleDomain.getMrSettleType())) {
BigDecimal gMoney;
if (CommonConstants.TWO_STRING.equals(settleDomain.getManagementType())) {
gMoney = settleDomain.getManagementFee();
} else if (CommonConstants.THREE_STRING.equals(settleDomain.getManagementType())) {
gMoney = settleDomain.getManagementFee();
} else {
isSum = 1;
if (CommonConstants.ONE_STRING.equals(socialFundFlag)) {
gMoney = BigDecimalUtils.safeMultiply(paymentInfo.getSocialSum(),
settleDomain.getManagementFee().divide(new BigDecimal("100"),
CommonConstants.FIVE_INT, RoundingMode.HALF_UP));
} else {
gMoney = BigDecimalUtils.safeMultiply(paymentInfo.getProvidentSum(),
settleDomain.getManagementFee().divide(new BigDecimal("100"),
CommonConstants.FIVE_INT, RoundingMode.HALF_UP));
}
}
if (!exitFlag || isSum == 1) {
isIncomeFlag = true;
createIncomeInsurance(paymentInfo, settleDomain, CommonConstants.ONE_STRING,
settleDomain.getManagementFee().toString(), settleDomain.getManagementType(),
gMoney, socialFundFlag,redisKey);
}
}
}
if (Common.isNotNull(settleDomain.getRiskServerItem()) && ((settleDomain.getRiskServerItem().contains(CommonConstants.ONE_STRING)
&& CommonConstants.ONE_STRING.equals(socialFundFlag)) || (settleDomain.getRiskServerItem().contains(CommonConstants.TWO_STRING)
&& CommonConstants.TWO_STRING.equals(socialFundFlag))) && CommonConstants.ZERO_STRING.equals(settleDomain.getRiskFundTag())) {
//预估模式
if (CommonConstants.TWO_STRING.equals(settleDomain.getMrSettleType()) &&
CommonConstants.ZERO_STRING.equals(settleDomain.getRiskFundTag())) {
BigDecimal money;
if (CommonConstants.TWO_STRING.equals(settleDomain.getRiskFundType())) {
money = settleDomain.getRiskFundFee();
} else if (CommonConstants.THREE_STRING.equals(settleDomain.getRiskFundType())) {
money = settleDomain.getRiskFundFee();
} else {
isSum = 2;
if (CommonConstants.ONE_STRING.equals(socialFundFlag)) {
money = BigDecimalUtils.safeMultiply(paymentInfo.getSocialSum(),
settleDomain.getRiskFundFee().divide(new BigDecimal("100"),
CommonConstants.FIVE_INT, RoundingMode.HALF_UP));
} else {
money = BigDecimalUtils.safeMultiply(paymentInfo.getProvidentSum(),
settleDomain.getRiskFundFee().divide(new BigDecimal("100"),
CommonConstants.FIVE_INT, RoundingMode.HALF_UP));
}
}
if (!exitFlag || isSum == 2) {
isIncomeFlag = true;
createIncomeInsurance(paymentInfo, settleDomain, CommonConstants.TWO_STRING,
settleDomain.getRiskFundFee().toString(), settleDomain.getRiskFundType(),
money, socialFundFlag,redisKey);
}
}
}
if (!isIncomeFlag) {
baseMapper.updateBySocialIncomeFlag(paymentInfo.getId());
}
}
}
}catch (Exception e) {
log.error("生成社保收入异常",e);
}
TSettleDomain settleDomain;
try {
for (TPaymentInfo paymentInfo : updateList) {
boolean exitFlag = false;
if (CommonConstants.ONE_STRING.equals(socialFundFlag)) {
exitIncome = detailMapper.selectList(Wrappers.<TIncomeDetail>query().lambda()
.eq(TIncomeDetail::getEmpIdcard, paymentInfo.getEmpIdcard())
.eq(TIncomeDetail::getPayMonth, paymentInfo.getSocialPayMonth())
.eq(TIncomeDetail::getDeptId, paymentInfo.getSettleDomainId())
.eq(TIncomeDetail::getSourceType, CommonConstants.ONE_STRING));
} else {
exitIncome = detailMapper.selectList(Wrappers.<TIncomeDetail>query().lambda()
.eq(TIncomeDetail::getEmpIdcard, paymentInfo.getEmpIdcard())
.eq(TIncomeDetail::getPayMonth, paymentInfo.getProvidentPayMonth())
.eq(TIncomeDetail::getDeptId, paymentInfo.getSettleDomainId())
.eq(TIncomeDetail::getSourceType, CommonConstants.TWO_STRING));
}
if (Common.isNotNull(exitIncome)) {
BigDecimal sumMoney = BigDecimal.ZERO;
for (TIncomeDetail income : exitIncome) {
sumMoney = BigDecimalUtils.safeAdd(income.getMoney(), sumMoney);
if (paymentInfo.getId().equals(income.getSourceId())) {
exitFlag = true;
}
}
if (exitFlag) {
baseMapper.updateBySocialIncomeFlag(paymentInfo.getId());
continue;
}
if (sumMoney.compareTo(BigDecimal.ZERO) > 0) {
exitFlag = true;
}
}
//获取项目信息
if (Common.isNotNull(mapSelectVo)) {
settleDomain = mapSelectVo.get(paymentInfo.getSettleDomainCode());
} else {
settleDomain = null;
}
int isSum = 0;
if (Common.isNotNull(settleDomain)) {
boolean isIncomeFlag = false;
// 含有社保,则计算收入
if (Common.isNotNull(settleDomain.getManageServerItem()) && ((settleDomain.getManageServerItem().contains(CommonConstants.ONE_STRING)
&& CommonConstants.ONE_STRING.equals(socialFundFlag)) || (settleDomain.getManageServerItem().contains(CommonConstants.TWO_STRING)
&& CommonConstants.TWO_STRING.equals(socialFundFlag))) && CommonConstants.ZERO_STRING.equals(settleDomain.getManagementTag())) {
//预估模式
if (CommonConstants.TWO_STRING.equals(settleDomain.getMrSettleType())) {
BigDecimal gMoney;
if (CommonConstants.TWO_STRING.equals(settleDomain.getManagementType())) {
gMoney = settleDomain.getManagementFee();
} else if (CommonConstants.THREE_STRING.equals(settleDomain.getManagementType())) {
gMoney = settleDomain.getManagementFee();
} else {
isSum = 1;
if (CommonConstants.ONE_STRING.equals(socialFundFlag)) {
gMoney = BigDecimalUtils.safeMultiply(paymentInfo.getSocialSum(),
settleDomain.getManagementFee().divide(new BigDecimal("100"),
CommonConstants.FIVE_INT, RoundingMode.HALF_UP));
} else {
gMoney = BigDecimalUtils.safeMultiply(paymentInfo.getProvidentSum(),
settleDomain.getManagementFee().divide(new BigDecimal("100"),
CommonConstants.FIVE_INT, RoundingMode.HALF_UP));
}
}
if (!exitFlag || isSum == 1) {
isIncomeFlag = true;
createIncomeInsurance(paymentInfo, settleDomain, CommonConstants.ONE_STRING,
settleDomain.getManagementFee().toString(), settleDomain.getManagementType(),
gMoney, socialFundFlag, redisKey);
}
}
}
if (Common.isNotNull(settleDomain.getRiskServerItem()) && ((settleDomain.getRiskServerItem().contains(CommonConstants.ONE_STRING)
&& CommonConstants.ONE_STRING.equals(socialFundFlag)) || (settleDomain.getRiskServerItem().contains(CommonConstants.TWO_STRING)
&& CommonConstants.TWO_STRING.equals(socialFundFlag))) && CommonConstants.ZERO_STRING.equals(settleDomain.getRiskFundTag())) {
//预估模式
if (CommonConstants.TWO_STRING.equals(settleDomain.getMrSettleType()) &&
CommonConstants.ZERO_STRING.equals(settleDomain.getRiskFundTag())) {
BigDecimal money;
if (CommonConstants.TWO_STRING.equals(settleDomain.getRiskFundType())) {
money = settleDomain.getRiskFundFee();
} else if (CommonConstants.THREE_STRING.equals(settleDomain.getRiskFundType())) {
money = settleDomain.getRiskFundFee();
} else {
isSum = 2;
if (CommonConstants.ONE_STRING.equals(socialFundFlag)) {
money = BigDecimalUtils.safeMultiply(paymentInfo.getSocialSum(),
settleDomain.getRiskFundFee().divide(new BigDecimal("100"),
CommonConstants.FIVE_INT, RoundingMode.HALF_UP));
} else {
money = BigDecimalUtils.safeMultiply(paymentInfo.getProvidentSum(),
settleDomain.getRiskFundFee().divide(new BigDecimal("100"),
CommonConstants.FIVE_INT, RoundingMode.HALF_UP));
}
}
if (!exitFlag || isSum == 2) {
isIncomeFlag = true;
createIncomeInsurance(paymentInfo, settleDomain, CommonConstants.TWO_STRING,
settleDomain.getRiskFundFee().toString(), settleDomain.getRiskFundType(),
money, socialFundFlag, redisKey);
}
}
}
if (!isIncomeFlag) {
baseMapper.updateBySocialIncomeFlag(paymentInfo.getId());
}
}
}
} catch (Exception e) {
log.error("生成社保收入异常", e);
}
}
public void createIncomeInsurance(TPaymentInfo library, TSettleDomain settleDomain, String feeType,
......@@ -3147,7 +3153,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
detail.setMrSettleType(settleDomain.getMrSettleType());
detail.setId(CommonConstants.NULL);
detail.setRedData(CommonConstants.ZERO_STRING);
incomeService.saveBathDetail(detail,library.getId());
incomeService.saveBathDetail(detail, library.getId());
}
/**
......@@ -3214,7 +3220,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
// 2划转管理费、风险金
if ((changeDeptVo.getGuanlifei() != null && !changeDeptVo.getGuanlifei().isEmpty())
|| (changeDeptVo.getFenxianjin() != null && !changeDeptVo.getFenxianjin().isEmpty())) {
|| (changeDeptVo.getFenxianjin() != null && !changeDeptVo.getFenxianjin().isEmpty())) {
idSet = new HashSet<>();
if (changeDeptVo.getGuanlifei() != null && !changeDeptVo.getGuanlifei().isEmpty()) {
for (ChangeDeptDetailVo vo : changeDeptVo.getGuanlifei()) {
......@@ -3266,6 +3272,40 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
}
@Override
public void updateSocialSettleStatus(EkpSocialViewVo viewVo) {
//判断预估还是实缴
if (viewVo.getSettleFlag().contains(SocialConstants.DIFF_TYPE_THR)) {
//根据明细id更新结算状态
TPaymentInfo paymentInfo = baseMapper.selectById(viewVo.getId());
if (Common.isNotNull(paymentInfo)) {
//判断是收入还是支出结算单号
if (CommonConstants.ZERO_STRING.equals(viewVo.getPayFlag())) {
paymentInfo.setIncomeSettleFlag(viewVo.getIncomeSettleFlag());
paymentInfo.setIncomeCollectFlag(viewVo.getIncomeCollectFlag());
} else {
paymentInfo.setPaySettleFlag(viewVo.getPaySettleFlag());
paymentInfo.setPayCollectFlag(viewVo.getPayCollectFlag());
}
baseMapper.updateById(paymentInfo);
}
} else if(viewVo.getSettleFlag().contains(SocialConstants.DIFF_TYPE_ONE)){
//根据明细id更新结算状态
TForecastLibrary library = tForecastLibraryMapper.selectById(viewVo.getId());
if (Common.isNotNull(library)) {
//判断是收入还是支出结算单号
if (CommonConstants.ZERO_STRING.equals(viewVo.getPayFlag())) {
library.setIncomeSettleFlag(viewVo.getIncomeSettleFlag());
library.setIncomeCollectFlag(viewVo.getIncomeCollectFlag());
} else {
library.setPaySettleFlag(viewVo.getPaySettleFlag());
library.setPayCollectFlag(viewVo.getPayCollectFlag());
}
tForecastLibraryMapper.updateById(library);
}
}
}
/**
* @param idSet
* @Description: 校验是否存在已结算薪资的数据
......@@ -3283,14 +3323,6 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
}
/**
* @Description: 手动推送时筛选数据
* @Author: huyc
**/
public boolean findList(TPaymentInfo t,YifuUser user) {
return CommonConstants.ONE_STRING.equals(t.getLockStatus()) && user.getId().equals(t.getCreateBy());
}
private Map<String, TSettleDomainSelectVo> getSelectVoMap() {
R<TSettleDomainListVo> settleDomainR = archivesDaprUtil.selectAllSettleDomainSelectVos();
Map<String,TSettleDomainSelectVo> mapSelectVo = null;
......
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