Commit 69a24780 authored by hongguangwu's avatar hongguangwu

工资拉取-社保公积金

parent 784ef949
...@@ -68,6 +68,12 @@ public class MSalaryEstimate { ...@@ -68,6 +68,12 @@ public class MSalaryEstimate {
@NotBlank(message = "类型:0:社保;1:公积金;不能为空") @NotBlank(message = "类型:0:社保;1:公积金;不能为空")
@ExcelProperty("类型:0:社保;1:公积金;") @ExcelProperty("类型:0:社保;1:公积金;")
private Integer isSocial; private Integer isSocial;
/**
* 来源类型:0:缴费库;1:预估库;
*/
@ExcelAttribute(name = "来源类型:0:缴费库;1:预估库;", isNotEmpty = true, errorInfo = "来源类型:0:缴费库;1:预估库;不能为空")
@ExcelProperty("来源类型:0:缴费库;1:预估库;")
private Integer type;
/** /**
* 类型:0:正常扣缴;1:无工资人员; * 类型:0:正常扣缴;1:无工资人员;
*/ */
......
...@@ -747,23 +747,23 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper, ...@@ -747,23 +747,23 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
} }
} }
if (!socialList.isEmpty()) { if (!socialList.isEmpty()) {
//更新社保状态为-结算 //更新社保状态为-结算
HttpDaprUtil.invokeMethodPost(archivesProperties.getAppUrl(), archivesProperties.getAppId() HttpDaprUtil.invokeMethodPost(socialProperties.getAppUrl(), socialProperties.getAppId()
, "/tpaymentinfo/inner/updatePaymentSocialStatusToSettle", socialList, TDepartSettlementInfo.class, SecurityConstants.FROM_IN); , "/tpaymentinfo/inner/updatePaymentSocialStatusToSettle", socialList, TDepartSettlementInfo.class, SecurityConstants.FROM_IN);
} }
if (!fundList.isEmpty()) { if (!fundList.isEmpty()) {
//更新公积金状态为-结算 //更新公积金状态为-结算
HttpDaprUtil.invokeMethodPost(archivesProperties.getAppUrl(), archivesProperties.getAppId() HttpDaprUtil.invokeMethodPost(socialProperties.getAppUrl(), socialProperties.getAppId()
, "/tpaymentinfo/inner/updatePaymentFundStatusToSettle", fundList, TDepartSettlementInfo.class, SecurityConstants.FROM_IN); , "/tpaymentinfo/inner/updatePaymentFundStatusToSettle", fundList, TDepartSettlementInfo.class, SecurityConstants.FROM_IN);
} }
if (!forecastSocialList.isEmpty()) { if (!forecastSocialList.isEmpty()) {
//更新社保状态为-结算 //更新社保状态为-结算
HttpDaprUtil.invokeMethodPost(archivesProperties.getAppUrl(), archivesProperties.getAppId() HttpDaprUtil.invokeMethodPost(socialProperties.getAppUrl(), socialProperties.getAppId()
, "/tforecastlibrary/inner/updateForecastSocialStatusToSettle", forecastSocialList, TDepartSettlementInfo.class, SecurityConstants.FROM_IN); , "/tforecastlibrary/inner/updateForecastSocialStatusToSettle", forecastSocialList, TDepartSettlementInfo.class, SecurityConstants.FROM_IN);
} }
if (!forecastFundList.isEmpty()) { if (!forecastFundList.isEmpty()) {
//更新公积金状态为-结算 //更新公积金状态为-结算
HttpDaprUtil.invokeMethodPost(archivesProperties.getAppUrl(), archivesProperties.getAppId() HttpDaprUtil.invokeMethodPost(socialProperties.getAppUrl(), socialProperties.getAppId()
, "/tforecastlibrary/inner/updateForecastFundStatusToSettle", forecastFundList, TDepartSettlementInfo.class, SecurityConstants.FROM_IN); , "/tforecastlibrary/inner/updateForecastFundStatusToSettle", forecastFundList, TDepartSettlementInfo.class, SecurityConstants.FROM_IN);
} }
//保存工资表 //保存工资表
...@@ -772,10 +772,6 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper, ...@@ -772,10 +772,6 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
// 获取上一个工资条顺序,复制: // 获取上一个工资条顺序,复制:
tSalaryStandardSetService.copyLastSetByDeptId(salary.getId(), dept.getId(), String.valueOf(user.getId())); tSalaryStandardSetService.copyLastSetByDeptId(salary.getId(), dept.getId(), String.valueOf(user.getId()));
// 保存后,修改结算预警统计中的结算状态
List<String> deptIdList = new ArrayList<>();
deptIdList.add(dept.getId());
salaryDetailVo.setSalary(salary); salaryDetailVo.setSalary(salary);
MSalaryEstimate se; MSalaryEstimate se;
...@@ -787,6 +783,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper, ...@@ -787,6 +783,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
se.setEstimateId(estId); se.setEstimateId(estId);
se.setIsSocial(SalaryConstants.IS_SOCIAL_ZERO); se.setIsSocial(SalaryConstants.IS_SOCIAL_ZERO);
se.setIsNoSalary(SalaryConstants.NOT_IS_NO_SALARY_ZERO); se.setIsNoSalary(SalaryConstants.NOT_IS_NO_SALARY_ZERO);
se.setType(CommonConstants.ZERO_INT);
mSalaryEstimateService.save(se); mSalaryEstimateService.save(se);
} }
} }
...@@ -797,6 +794,29 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper, ...@@ -797,6 +794,29 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
se.setEstimateId(estId); se.setEstimateId(estId);
se.setIsSocial(SalaryConstants.IS_FUND_ONE); se.setIsSocial(SalaryConstants.IS_FUND_ONE);
se.setIsNoSalary(SalaryConstants.NOT_IS_NO_SALARY_ZERO); se.setIsNoSalary(SalaryConstants.NOT_IS_NO_SALARY_ZERO);
se.setType(CommonConstants.ZERO_INT);
mSalaryEstimateService.save(se);
}
}
if (!forecastSocialList.isEmpty()) {
for (String estId : forecastSocialList) {
se = new MSalaryEstimate();
se.setSalaryId(salary.getId());
se.setEstimateId(estId);
se.setIsSocial(SalaryConstants.IS_SOCIAL_ZERO);
se.setIsNoSalary(SalaryConstants.NOT_IS_NO_SALARY_ZERO);
se.setType(CommonConstants.ONE_INT);
mSalaryEstimateService.save(se);
}
}
if (!forecastFundList.isEmpty()) {
for (String estId : forecastFundList) {
se = new MSalaryEstimate();
se.setSalaryId(salary.getId());
se.setEstimateId(estId);
se.setIsSocial(SalaryConstants.IS_FUND_ONE);
se.setIsNoSalary(SalaryConstants.NOT_IS_NO_SALARY_ZERO);
se.setType(CommonConstants.ONE_INT);
mSalaryEstimateService.save(se); mSalaryEstimateService.save(se);
} }
} }
......
...@@ -28,9 +28,14 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; ...@@ -28,9 +28,14 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TDepartSettlementInfo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*; import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser; import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprArchivesProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprSocialProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils; import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.salary.constants.SalaryConstants; import com.yifu.cloud.plus.v1.yifu.salary.constants.SalaryConstants;
import com.yifu.cloud.plus.v1.yifu.salary.entity.*; import com.yifu.cloud.plus.v1.yifu.salary.entity.*;
...@@ -41,6 +46,7 @@ import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryStandardSearchVo; ...@@ -41,6 +46,7 @@ import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryStandardSearchVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryStandardVo; import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryStandardVo;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.servlet.ServletOutputStream; import javax.servlet.ServletOutputStream;
...@@ -60,6 +66,7 @@ import java.util.*; ...@@ -60,6 +66,7 @@ import java.util.*;
*/ */
@Log4j2 @Log4j2
@Service @Service
@EnableConfigurationProperties({DaprSocialProperties.class})
public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMapper, TSalaryStandard> implements TSalaryStandardService { public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMapper, TSalaryStandard> implements TSalaryStandardService {
@Autowired @Autowired
...@@ -72,8 +79,7 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe ...@@ -72,8 +79,7 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe
private MSalaryEstimateService mSalaryEstimateService; private MSalaryEstimateService mSalaryEstimateService;
@Autowired @Autowired
private MSalaryPaymentResService salaryPaymentResService; private DaprSocialProperties socialProperties;
/** /**
* 标准薪酬工资表简单分页查询 * 标准薪酬工资表简单分页查询
* *
...@@ -311,51 +317,64 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe ...@@ -311,51 +317,64 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe
MSalaryEstimate salaryEstimate = new MSalaryEstimate(); MSalaryEstimate salaryEstimate = new MSalaryEstimate();
salaryEstimate.setSalaryId(id); salaryEstimate.setSalaryId(id);
salaryEstimate.setIsSocial(SalaryConstants.IS_SOCIAL_ZERO); salaryEstimate.setIsSocial(SalaryConstants.IS_SOCIAL_ZERO);
salaryEstimate.setType(CommonConstants.ZERO_INT);
QueryWrapper<MSalaryEstimate> salaryEstimateQueryWrapper = new QueryWrapper<>(); QueryWrapper<MSalaryEstimate> salaryEstimateQueryWrapper = new QueryWrapper<>();
salaryEstimateQueryWrapper.setEntity(salaryEstimate); salaryEstimateQueryWrapper.setEntity(salaryEstimate);
//社保 //缴费库社保
List<MSalaryEstimate> socialList = mSalaryEstimateService.list(salaryEstimateQueryWrapper); List<MSalaryEstimate> socialList = mSalaryEstimateService.list(salaryEstimateQueryWrapper);
salaryEstimate.setIsSocial(SalaryConstants.IS_FUND_ONE); salaryEstimate.setIsSocial(SalaryConstants.IS_FUND_ONE);
salaryEstimateQueryWrapper.setEntity(salaryEstimate); salaryEstimateQueryWrapper.setEntity(salaryEstimate);
//公积金 //缴费库公积金
List<MSalaryEstimate> fundList = mSalaryEstimateService.list(salaryEstimateQueryWrapper); List<MSalaryEstimate> fundList = mSalaryEstimateService.list(salaryEstimateQueryWrapper);
if ((socialList != null && !socialList.isEmpty())
|| (fundList != null && !fundList.isEmpty())) { salaryEstimate.setType(CommonConstants.ONE_INT);
MSalaryPaymentRes res; salaryEstimateQueryWrapper.setEntity(salaryEstimate);
Map<String, MSalaryPaymentRes> saveResMap = new HashMap<>(); //缴费库公积金
if (socialList != null && !socialList.isEmpty()) { List<MSalaryEstimate> forecastFundList = mSalaryEstimateService.list(salaryEstimateQueryWrapper);
for (MSalaryEstimate est : socialList) {
res = saveResMap.get(est.getEstimateId()); salaryEstimate.setIsSocial(SalaryConstants.IS_SOCIAL_ZERO);
if (res == null) { salaryEstimateQueryWrapper.setEntity(salaryEstimate);
res = new MSalaryPaymentRes(); //缴费库公积金
res.setId(est.getEstimateId()); List<MSalaryEstimate> forecastSocialList = mSalaryEstimateService.list(salaryEstimateQueryWrapper);
res.setDeptId(deptId);
} List<String> stringList;
res.setSalarySocialFlag(CommonConstants.ZERO_STRING); if (socialList != null && !socialList.isEmpty()) {
saveResMap.put(est.getEstimateId(), res); stringList = new ArrayList<>();
} for (MSalaryEstimate s : socialList) {
stringList.add(s.getEstimateId());
}
//更新社保状态为-待结算
HttpDaprUtil.invokeMethodPost(socialProperties.getAppUrl(), socialProperties.getAppId()
, "/tpaymentinfo/inner/updatePaymentSocialStatusToNoSettle", stringList, TDepartSettlementInfo.class, SecurityConstants.FROM_IN);
}
if (fundList != null && !fundList.isEmpty()) {
stringList = new ArrayList<>();
for (MSalaryEstimate s : fundList) {
stringList.add(s.getEstimateId());
} }
if (fundList != null && !fundList.isEmpty()) { //更新公积金状态为-待结算
for (MSalaryEstimate est : fundList) { HttpDaprUtil.invokeMethodPost(socialProperties.getAppUrl(), socialProperties.getAppId()
res = saveResMap.get(est.getEstimateId()); , "/tpaymentinfo/inner/updatePaymentFundStatusToNoSettle", stringList, TDepartSettlementInfo.class, SecurityConstants.FROM_IN);
if (res == null) { }
res = new MSalaryPaymentRes(); if (forecastSocialList != null && !forecastSocialList.isEmpty()) {
res.setId(est.getEstimateId()); stringList = new ArrayList<>();
res.setDeptId(deptId); for (MSalaryEstimate s : forecastSocialList) {
} stringList.add(s.getEstimateId());
res.setSalaryFundFlag(CommonConstants.ZERO_STRING);
saveResMap.put(est.getEstimateId(), res);
}
} }
// 开始更新res //更新社保状态为-待结算
if (!saveResMap.isEmpty()) { HttpDaprUtil.invokeMethodPost(socialProperties.getAppUrl(), socialProperties.getAppId()
Iterator<MSalaryPaymentRes> iter = saveResMap.values().iterator(); , "/tforecastlibrary/inner/updateForecastSocialStatusToNoSettle", stringList, TDepartSettlementInfo.class, SecurityConstants.FROM_IN);
while (iter.hasNext()) { }
res = iter.next(); if (forecastFundList != null && !forecastFundList.isEmpty()) {
salaryPaymentResService.saveOrUpdate(res); stringList = new ArrayList<>();
} for (MSalaryEstimate s : forecastFundList) {
stringList.add(s.getEstimateId());
} }
//更新公积金状态为-待结算
HttpDaprUtil.invokeMethodPost(socialProperties.getAppUrl(), socialProperties.getAppId()
, "/tforecastlibrary/inner/updateForecastFundStatusToNoSettle", stringList, TDepartSettlementInfo.class, SecurityConstants.FROM_IN);
} }
} }
} }
//6:删除工资表 //6:删除工资表
......
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