Commit 2f8e4c13 authored by huyuchen's avatar huyuchen

结算状态同步

parent 404aa084
......@@ -37,6 +37,12 @@
<artifactId>yifu-social-api</artifactId>
<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>
......
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());
......@@ -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);
......@@ -979,7 +981,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
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(
......@@ -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();
......@@ -1630,7 +1633,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
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;
......@@ -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());
......@@ -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);
}
......@@ -2145,7 +2149,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
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;
......@@ -2183,7 +2187,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
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 + "的养老缴费数据"));
infoVo.getEmpName(), SocialConstants.ERROR_TEMPLATE + "的养老缴费数据"));
continue;
} else {
pensionMoneyMap.put(exitMoney, BigDecimalUtils.safeAdd(BigDecimalUtils.isNullToZero(infoVo.getPersonalMoney()),
......@@ -2220,7 +2224,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
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 + "的失业缴费数据"));
infoVo.getEmpName(), SocialConstants.ERROR_TEMPLATE + "的失业缴费数据"));
continue;
} else {
unEmpMoneyMap.put(exitMoney, BigDecimalUtils.safeAdd(
......@@ -2258,7 +2262,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
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 + "的医保缴费数据"));
infoVo.getEmpName(), SocialConstants.ERROR_TEMPLATE + "的医保缴费数据"));
continue;
} else {
medicalMoneyMap.put(exitMoney, BigDecimalUtils.safeAdd(
......@@ -2298,7 +2302,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
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 + "的工伤缴费数据"));
infoVo.getEmpName(), SocialConstants.ERROR_TEMPLATE + "的工伤缴费数据"));
continue;
} else {
injuryMoneyMap.put(exitMoney, BigDecimalUtils.safeAdd(
......@@ -2337,7 +2341,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
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 + "的医疗救助金缴费数据"));
infoVo.getEmpName(), SocialConstants.ERROR_TEMPLATE + "的医疗救助金缴费数据"));
continue;
} else {
bigMoneyMap.put(exitMoney, BigDecimalUtils.safeAdd(
......@@ -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));
}
}
}
......@@ -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)
.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,13 +2997,13 @@ 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 {
......@@ -3070,7 +3076,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
isIncomeFlag = true;
createIncomeInsurance(paymentInfo, settleDomain, CommonConstants.ONE_STRING,
settleDomain.getManagementFee().toString(), settleDomain.getManagementType(),
gMoney, socialFundFlag,redisKey);
gMoney, socialFundFlag, redisKey);
}
}
}
......@@ -3101,7 +3107,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
isIncomeFlag = true;
createIncomeInsurance(paymentInfo, settleDomain, CommonConstants.TWO_STRING,
settleDomain.getRiskFundFee().toString(), settleDomain.getRiskFundType(),
money, socialFundFlag,redisKey);
money, socialFundFlag, redisKey);
}
}
}
......@@ -3110,8 +3116,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
}
}
}catch (Exception e) {
log.error("生成社保收入异常",e);
} catch (Exception e) {
log.error("生成社保收入异常", e);
}
}
......@@ -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());
}
/**
......@@ -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