Commit 98d10d13 authored by huyuchen's avatar huyuchen

社保公积金推送接口

parent fd5b7b0c
......@@ -297,6 +297,8 @@ public interface CommonConstants {
String SEX_MAN = "1";
String SEX_WONMAN = "2";
String SALARY_ISFLAG = "已结算";
String SALARY_UNFLAG = "未结算";
// 是否
String IS_FALSE = "否";
......
package com.yifu.cloud.plus.v1.yifu.ekp.config;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;
/**
* @Author huyc
* @Description 公积金明细对接
* @Date 11:57 2022/8/29
* @Param
* @return
**/
@Data
@Component
@PropertySource("classpath:ekpFundConfig.properties")
@ConfigurationProperties(value = "ekpfund", ignoreInvalidFields = false)
public class EkpFundProperties {
String url;
String fdModelId;
String fdFlowId;
String docStatus;
String LoginName;
String docSubject;
}
package com.yifu.cloud.plus.v1.yifu.ekp.config;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;
/**
* @Author huyc
* @Description 社保明细对接
* @Date 11:57 2022/8/29
* @Param
* @return
**/
@Data
@Component
@PropertySource("classpath:ekpSocialConfig.properties")
@ConfigurationProperties(value = "ekpsocial", ignoreInvalidFields = false)
public class EkpSocialProperties {
String url;
String fdModelId;
String fdFlowId;
String docStatus;
String LoginName;
String docSubject;
}
package com.yifu.cloud.plus.v1.yifu.ekp.util;
import cn.hutool.json.JSONObject;
import com.yifu.cloud.plus.v1.yifu.ekp.config.EkpFundProperties;
import com.yifu.cloud.plus.v1.yifu.ekp.constant.EkpConstants;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpPushFundParam;
import io.micrometer.core.instrument.util.StringUtils;
import lombok.extern.log4j.Log4j2;
import org.codehaus.jackson.map.ObjectMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.http.*;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestTemplate;
/**
* @Author huyc
* @Date 2022/8/29
* @Description
* @Version 1.0
*/
@Log4j2
@EnableConfigurationProperties(EkpFundProperties.class)
public class EkpFundUtil {
@Autowired
private EkpFundProperties ekpProperties;
public String sendToEKP(EkpPushFundParam param){
log.info("推送EKP开始--公积金明细数据");
RestTemplate yourRestTemplate = new RestTemplate();
try{
String formValues = new ObjectMapper().writeValueAsString(param);
//指向EKP的接口url
//把ModelingAppModelParameterAddForm转换成MultiValueMap
JSONObject loginName = new JSONObject();
loginName.append("LoginName",ekpProperties.getLoginName());
String loginData = new ObjectMapper().writeValueAsString(loginName);
MultiValueMap<String,Object> wholeForm = new LinkedMultiValueMap<>();
//wholeForm.add("docSubject", new String(docSubject.getBytes("UTF-8"),"ISO-8859-1") );
wholeForm.add("docSubject",ekpProperties.getDocSubject());
wholeForm.add("docCreator", "{\"LoginName\":\"admin\"}");
//wholeForm.add("docCreator", loginData);
wholeForm.add("docStatus", ekpProperties.getDocStatus());
wholeForm.add("fdModelId", ekpProperties.getFdModelId());
wholeForm.add("fdFlowId", ekpProperties.getFdFlowId());
//wholeForm.add("formValues", new String(formValues.getBytes("UTF-8"),"ISO-8859-1"));
wholeForm.add("formValues", formValues);
//wholeForm.add("formValues", new String("{\"fd_3adfe6af71a1cc\":\"王五\", \"fd_3adfe658c6229e\":\"2019-03-26\", \"fd_3adfe6592b4158\":\"这里内容\"}".getBytes("UTF-8"),"ISO-8859-1") );
System.out.println("wholeForm:"+wholeForm);
HttpHeaders headers = new HttpHeaders();
//如果EKP对该接口启用了Basic认证,那么客户端需要加入
//addAuth(headers,"yourAccount"+":"+"yourPassword");是VO,则使用APPLICATION_JSON
headers.setContentType(MediaType.MULTIPART_FORM_DATA);
//必须设置上传类型,如果入参是字符串,使用MediaType.TEXT_PLAIN;如果
HttpEntity<MultiValueMap<String,Object>> entity = new HttpEntity<MultiValueMap<String,Object>>(wholeForm,headers);
//有返回值的情况 VO可以替换成具体的JavaBean
ResponseEntity<String> obj = yourRestTemplate.exchange(ekpProperties.getUrl(), HttpMethod.POST, entity, String.class);
String body = obj.getBody();
if (StringUtils.isBlank(body)){
log.error(EkpConstants.SEND_FAILED);
return null;
}else{
log.info(EkpConstants.SEND_SUCCESS+body);
return body;
}
}catch (Exception e){
log.info(e.getMessage());
return null;
}
}
}
package com.yifu.cloud.plus.v1.yifu.ekp.util;
import cn.hutool.json.JSONObject;
import com.yifu.cloud.plus.v1.yifu.ekp.config.EkpSocialProperties;
import com.yifu.cloud.plus.v1.yifu.ekp.constant.EkpConstants;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpPushSocialParam;
import io.micrometer.core.instrument.util.StringUtils;
import lombok.extern.log4j.Log4j2;
import org.codehaus.jackson.map.ObjectMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.http.*;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestTemplate;
/**
* @Author huyc
* @Date 2022/8/29
* @Description
* @Version 1.0
*/
@Log4j2
@EnableConfigurationProperties(EkpSocialProperties.class)
public class EkpSocialUtil {
@Autowired
private EkpSocialProperties ekpProperties;
public String sendToEKP(EkpPushSocialParam param){
log.info("推送EKP开始--社保明细数据");
RestTemplate yourRestTemplate = new RestTemplate();
try{
String formValues = new ObjectMapper().writeValueAsString(param);
//指向EKP的接口url
//把ModelingAppModelParameterAddForm转换成MultiValueMap
JSONObject loginName = new JSONObject();
loginName.append("LoginName",ekpProperties.getLoginName());
String loginData = new ObjectMapper().writeValueAsString(loginName);
MultiValueMap<String,Object> wholeForm = new LinkedMultiValueMap<>();
//wholeForm.add("docSubject", new String(docSubject.getBytes("UTF-8"),"ISO-8859-1") );
wholeForm.add("docSubject",ekpProperties.getDocSubject());
wholeForm.add("docCreator", "{\"LoginName\":\"admin\"}");
//wholeForm.add("docCreator", loginData);
wholeForm.add("docStatus", ekpProperties.getDocStatus());
wholeForm.add("fdModelId", ekpProperties.getFdModelId());
wholeForm.add("fdFlowId", ekpProperties.getFdFlowId());
//wholeForm.add("formValues", new String(formValues.getBytes("UTF-8"),"ISO-8859-1"));
wholeForm.add("formValues", formValues);
//wholeForm.add("formValues", new String("{\"fd_3adfe6af71a1cc\":\"王五\", \"fd_3adfe658c6229e\":\"2019-03-26\", \"fd_3adfe6592b4158\":\"这里内容\"}".getBytes("UTF-8"),"ISO-8859-1") );
System.out.println("wholeForm:"+wholeForm);
HttpHeaders headers = new HttpHeaders();
//如果EKP对该接口启用了Basic认证,那么客户端需要加入
//addAuth(headers,"yourAccount"+":"+"yourPassword");是VO,则使用APPLICATION_JSON
headers.setContentType(MediaType.MULTIPART_FORM_DATA);
//必须设置上传类型,如果入参是字符串,使用MediaType.TEXT_PLAIN;如果
HttpEntity<MultiValueMap<String,Object>> entity = new HttpEntity<MultiValueMap<String,Object>>(wholeForm,headers);
//有返回值的情况 VO可以替换成具体的JavaBean
ResponseEntity<String> obj = yourRestTemplate.exchange(ekpProperties.getUrl(), HttpMethod.POST, entity, String.class);
String body = obj.getBody();
if (StringUtils.isBlank(body)){
log.error(EkpConstants.SEND_FAILED);
return null;
}else{
log.info(EkpConstants.SEND_SUCCESS+body);
return body;
}
}catch (Exception e){
log.info(e.getMessage());
return null;
}
}
}
package com.yifu.cloud.plus.v1.yifu.ekp.vo;
import lombok.Data;
import java.io.Serializable;
/**
* @Author hyc
* @Date 2022/8/26
* @Description 公积金明细对应参数
* @Version 1.0
*/
@Data
public class EkpPushFundParam implements Serializable {
/**
* 订单类型
**/
private String fd_3add9dd7833db8;
/**
* 与工资合并结算
**/
private String fd_3add9e1a670144;
/**
* 是否有预估
**/
private String fd_3add9de0be85e4;
/**
* 项目编码
**/
private String fd_3adfe8c70d3fd4;
/**
* 项目名称
**/
private String fd_3adfe8c8468e54;
/**
* 单号
**/
private String fd_3adfe95c169c48;
/**
* 客户编码
**/
private String fd_3adfe8c73cb5a4;
/**
* 客户名称
**/
private String fd_3adfe8c81a0e42;
/**
* 公积金账户
**/
private String fd_3aeafa8cc144bc;
/**
* 姓名
**/
private String fd_3adfe8c79989d4;
/**
* 身份证号
**/
private String fd_3adfe8c7e4cf7a;
/**
* 生成月份
**/
private String fd_3adfe8cb96c41e;
/**
* 缴纳月份
**/
private String fd_3adfe8cf632700;
/**
* 结算月份
**/
private String fd_3adfe8cff746bc;
/**
* 预估单位代缴
**/
private String fd_3adfeb4e8064a8;
/**
* 预估个人代缴
**/
private String fd_3adfeb52a4d2e2;
/**
* 单位代缴
**/
private String fd_3adfeb52fbe966;
/**
* 个人代缴
**/
private String fd_3adfeb5366dd82;
/**
* 单位差异
**/
private String fd_3adfeb53c70f72;
/**
* 个人差异
**/
private String fd_3adfeb5413fb44;
/**
* 应收
**/
private String fd_3adfeb7b624f06;
/**
* 结算状态
**/
private String fd_3add9ea428879a;
/**
* 收款状态
**/
private String fd_3add9eaeed2560;
/**
* 结算单号
**/
private String fd_3adfeb830523b6;
/**
* 收款单号
**/
private String fd_3adfeb8489e6c2;
/**
* 应支出
**/
private String fd_3adfeb7bd97464;
/**
* 支出结算状态
**/
private String fd_3add9edfbc6f7e;
/**
* 付款状态
**/
private String fd_3add9eed23894a;
/**
* 支出缴纳单号
**/
private String fd_3adfeb83a704c8;
/**
* 付款单号
**/
private String fd_3adfeb84175f28;
/**
* 我司到款单位
**/
private String fd_3b019a2e9bfdd6;
}
\ No newline at end of file
package com.yifu.cloud.plus.v1.yifu.ekp.vo;
import lombok.Data;
import java.io.Serializable;
/**
* @Author hyc
* @Date 2022/8/26
* @Description 社保明细对应参数
* @Version 1.0
*/
@Data
public class EkpPushSocialParam implements Serializable {
/**
* 订单类型
**/
private String fd_3add9dd7833db8;
/**
* 与工资合并结算
**/
private String fd_3add9e1a670144;
/**
* 是否有预估
**/
private String fd_3add9de0be85e4;
/**
* 项目编码
**/
private String fd_3adfe8c70d3fd4;
/**
* 项目名称
**/
private String fd_3adfe8c8468e54;
/**
* 单号
**/
private String fd_3adfe95c169c48;
/**
* 客户编码
**/
private String fd_3adfe8c73cb5a4;
/**
* 客户名称
**/
private String fd_3adfe8c81a0e42;
/**
* 社保户
**/
private String fd_3aeafa25916e82;
/**
* 姓名
**/
private String fd_3adfe8c79989d4;
/**
* 身份证号
**/
private String fd_3adfe8c7e4cf7a;
/**
* 生成月份
**/
private String fd_3adfe8cb96c41e;
/**
* 缴纳月份
**/
private String fd_3adfe8cf632700;
/**
* 结算月份
**/
private String fd_3adfe8cff746bc;
/**
* 预估单位合计
**/
private String fd_3adfeb4e8064a8;
/**
* 预估个人合计
**/
private String fd_3adfeb52a4d2e2;
/**
* 单位差异
**/
private String fd_3adfeb53c70f72;
/**
* 个人差异
**/
private String fd_3adfeb5413fb44;
/**
* 应收
**/
private String fd_3adfeb7b624f06;
/**
* 结算状态
**/
private String fd_3add9ea428879a;
/**
* 收款状态
**/
private String fd_3add9eaeed2560;
/**
* 结算单号
**/
private String fd_3adfeb830523b6;
/**
* 收款单号
**/
private String fd_3adfeb8489e6c2;
/**
* 应支出
**/
private String fd_3adfeb7bd97464;
/**
* 支出结算状态
**/
private String fd_3add9edfbc6f7e;
/**
* 付款状态
**/
private String fd_3add9eed23894a;
/**
* 支出缴纳单号
**/
private String fd_3adfeb83a704c8;
/**
* 实缴单位生育
**/
private String fd_3af9ee3afb34c2;
/**
* 付款单号
**/
private String fd_3adfeb84175f28;
/**
* 预估单位养老
**/
private String fd_3af9ec80a9de7a;
/**
* 实缴个人合计
**/
private String fd_3af9ee3cb6d4fa;
/**
* 预估合计
**/
private String fd_3af9ed7e813b86;
/**
* 实缴单位合计
**/
private String fd_3af9ee3c0bf286;
/**
* 实缴个人补缴利息
**/
private String fd_3af9ee3d634946;
/**
* 实缴单位医疗
**/
private String fd_3af9ee39dea6a8;
/**
* 预估单位失业
**/
private String fd_3af9eba5f6e19e;
/**
* 预估个人补缴利息
**/
private String fd_3af9ebbecc4aa8;
/**
* 实缴单位养老
**/
private String fd_3af9ee3938170a;
/**
* 预估单位生育
**/
private String fd_3af9eba71c0138;
/**
* 预估单位大病救助
**/
private String fd_3af9eba863c0ee;
/**
* 实缴个人失业
**/
private String fd_3af9ee3db44d96;
/**
* 实缴单位补缴利息
**/
private String fd_3af9ee3b5ddae8;
/**
* 实缴单位大病救助
**/
private String fd_3af9ee3ba76f54;
/**
* 实缴单位工伤
**/
private String fd_3af9ee3aa9c84a;
/**
* 实缴合计
**/
private String fd_3af9ee3c6bfc74;
/**
* 预估单位补缴利息
**/
private String fd_3af9eba7c3da5e;
/**
* 预估单位医疗
**/
private String fd_3af9eba5899c90;
/**
* 预估个人养老
**/
private String fd_3af9ebbd791662;
/**
* 预估个人大病救助
**/
private String fd_3af9ebbf3e8be2;
/**
* 预估个人医疗
**/
private String fd_3af9ebbdd9797e;
/**
* 实缴个人医疗
**/
private String fd_3af9ee3e066d48;
/**
* 实缴单位失业
**/
private String fd_3af9ee3a46b7e6;
/**
* 预估个人失业
**/
private String fd_3af9ebbe29ce1c;
/**
* 实缴个人养老
**/
private String fd_3af9ee3e513962;
/**
* 实缴个人大病救助
**/
private String fd_3af9ee3d0ba3b6;
/**
* 预估单位工伤
**/
private String fd_3af9eba684f592;
/**
* 我司到款单位
**/
private String fd_3b01953871b8be;
}
\ No newline at end of file
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
com.yifu.cloud.plus.v1.yifu.ekp.util.EkpSalaryUtil
\ No newline at end of file
com.yifu.cloud.plus.v1.yifu.ekp.util.EkpSalaryUtil,\
com.yifu.cloud.plus.v1.yifu.ekp.util.EkpSocialUtil,\
com.yifu.cloud.plus.v1.yifu.ekp.util.EkpFundUtil
\ No newline at end of file
ekpfund.url=http://119.96.227.251:8080/api/sys-modeling/appModelRestService/addModel
ekpfund.fdModelId=181d741547a691aa68b16149a40de901
ekpfund.fdFlowId=18290af372be55308327273487abf72a
ekpfund.docStatus=20
ekpfund.LoginName=admin
ekpfund.docSubject=\u516C\u79EF\u91D1\u660E\u7EC6\u6570\u636E\u63A5\u53E3
ekpsocial.url=http://119.96.227.251:8080/api/sys-modeling/appModelRestService/addModel
ekpsocial.fdModelId=181d741547a69ba9dbc12377948e98fd
ekpsocial.fdFlowId=18233028fe91511376b00f74b3a8f3a7
ekpsocial.docStatus=20
ekpsocial.LoginName=admin
ekpsocial.docSubject=\u793E\u4FDD\u660E\u7EC6\u6570\u636E\u63A5\u53E3
......@@ -50,4 +50,52 @@ public class SocialTask {
log.info("------------每月定时生成下月预估库数据-定时任务结束------------");
}
/**
* @Description: 定时生成社保预估明细的数据
* @Author: huyc
* @Date: 2022/8/30
* @return: void
**/
public void createForecastInfo() {
log.info("------------定时生成社保预估明细的数据-定时任务开始------------");
HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/tforecastlibrary/inner/createForecastInfo","", Object.class, SecurityConstants.FROM_IN);
log.info("------------定时生成社保预估明细的数据-定时任务结束------------");
}
/**
* @Description: 定时生成公积金预估明细的数据
* @Author: huyc
* @Date: 2022/8/30
* @return: void
**/
public void createForecastFundInfo() {
log.info("------------定时生成公积金预估明细的数据-定时任务开始------------");
HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/tforecastlibrary/inner/createForecastFundInfo","", Object.class, SecurityConstants.FROM_IN);
log.info("------------定时生成公积金预估明细的数据-定时任务结束------------");
}
/**
* @Description: 定时生成社保缴费库明细的数据
* @Author: huyc
* @Date: 2022/8/30
* @return: void
**/
public void createPaymentSocialInfo() {
log.info("------------定时生成社保缴费库明细的数据-定时任务开始------------");
HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/tpaymentinfo/inner/createPaymentSocialInfo","", Object.class, SecurityConstants.FROM_IN);
log.info("------------定时生成社保缴费库明细的数据-定时任务结束------------");
}
/**
* @Description: 定时生成公积金缴费库明细的数据
* @Author: huyc
* @Date: 2022/8/30
* @return: void
**/
public void createPaymentFundInfo() {
log.info("------------定时生成公积金缴费库明细的数据-定时任务开始------------");
HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/tpaymentinfo/inner/createPaymentFundInfo","", Object.class, SecurityConstants.FROM_IN);
log.info("------------定时生成公积金缴费库明细的数据-定时任务结束------------");
}
}
......@@ -154,6 +154,8 @@ public class TStatisticsDeclarerServiceImpl extends ServiceImpl<TStatisticsDecla
tStatisticsDeclarer.setIsDeclare(isDeclare);
if (Common.isNotNull(undeclareReason)) {
tStatisticsDeclarer.setUndeclareReason(undeclareReason);
}else {
tStatisticsDeclarer.setUndeclareReason(CommonConstants.EMPTY_STRING);
}
baseMapper.updateById(tStatisticsDeclarer);
return R.ok();
......@@ -283,6 +285,8 @@ public class TStatisticsDeclarerServiceImpl extends ServiceImpl<TStatisticsDecla
tStatisticsDeclarer.setIsDeclare(excel.getIsDeclare());
if (Common.isNotNull(excel.getUndeclareReason())) {
tStatisticsDeclarer.setUndeclareReason(excel.getUndeclareReason());
}else {
tStatisticsDeclarer.setUndeclareReason(CommonConstants.EMPTY_STRING);
}
baseMapper.updateById(tStatisticsDeclarer);
}
......
......@@ -370,7 +370,7 @@ public class TPaymentInfo extends BaseEntity {
private String financeBillId;
/**
* 财务账单ID
* 推送状态
*/
@ExcelAttribute(name = "推送状态 0已推送 1未推送" )
@Schema(description ="推送状态 0已推送 1未推送")
......
package com.yifu.cloud.plus.v1.yifu.social.vo;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
/**
* @Author hyc
* @Date 2022/8/29
* @Description 社保公积金明细对应参数
* @Version 1.0
*/
@Data
public class EkpSocialFundParam implements Serializable {
private static final long serialVersionUID = -2689686777914935788L;
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@Schema(description = "主键")
private String id;
/**
* 订单类型
**/
@Schema(description = "单据类型 (1、预估单 2、实缴单)")
private String settleType;
/**
* 与工资合并结算
**/
@Schema(description = "主键")
private String fd_3add9e1a670144;
/**
* 是否有预估
**/
private String fd_3add9de0be85e4;
/**
* 项目编码
*/
@Schema(description = "项目编码")
private String deptNo;
/**
* 项目名称
*/
@Schema(description = "项目名称")
private String deptName;
/**
* 客户名称
*/
@Schema(description = "客户名称")
private String customerName;
/**
* 客户编码
*/
@Schema(description = "客户编码")
private String customerCode;
/**
* 员工姓名
*/
@Schema(description = "员工姓名")
private String empName;
/**
* 员工身份证号
*/
@Schema(description = "员工身份证号")
private String empIdcardNo;
/**
* 单号
**/
@Schema(description = "单号" )
private String fd_3adfe95c169c48;
/**
* 社保户
**/
@Schema(description = "社保户id" )
private String socialHousehold;
/**
* 生成月份
**/
private String createMonth;
/**
* 缴纳月份
**/
private String payMonth;
/**
* 结算月份
**/
private String settleMonth;
/**
* 预估单位合计
**/
private String unitSum;
/**
* 预估个人合计
**/
private String personalSum;
/**
* 单位差异
**/
private String fd_3adfeb53c70f72;
/**
* 个人差异
**/
private String fd_3adfeb5413fb44;
/**
* 应收
**/
private String fd_3adfeb7b624f06;
/**
* 结算状态
**/
private String settleType1;
/**
* 收款状态
**/
private String Type;
/**
* 结算单号
**/
private String fd_3adfeb830523b6;
/**
* 收款单号
**/
private String fd_3adfeb8489e6c2;
/**
* 应支出
**/
private String fd_3adfeb7bd97464;
/**
* 支出结算状态
**/
private String fd_3add9edfbc6f7e;
/**
* 付款状态
**/
private String fd_3add9eed23894a;
/**
* 支出缴纳单号
**/
private String fd_3adfeb83a704c8;
/**
* 实缴单位生育
**/
private String fd_3af9ee3afb34c2;
/**
* 付款单号
**/
private String fd_3adfeb84175f28;
/**
* 预估单位养老
**/
private String fd_3af9ec80a9de7a;
/**
* 实缴个人合计
**/
private String fd_3af9ee3cb6d4fa;
/**
* 预估合计
**/
private String fd_3af9ed7e813b86;
/**
* 实缴单位合计
**/
private String fd_3af9ee3c0bf286;
/**
* 实缴个人补缴利息
**/
private String fd_3af9ee3d634946;
/**
* 实缴单位医疗
**/
private String fd_3af9ee39dea6a8;
/**
* 预估单位失业
**/
private String fd_3af9eba5f6e19e;
/**
* 预估个人补缴利息
**/
private String fd_3af9ebbecc4aa8;
/**
* 实缴单位养老
**/
private String fd_3af9ee3938170a;
/**
* 预估单位生育
**/
private String fd_3af9eba71c0138;
/**
* 预估单位大病救助
**/
private String fd_3af9eba863c0ee;
/**
* 实缴个人失业
**/
private String fd_3af9ee3db44d96;
/**
* 实缴单位补缴利息
**/
private String fd_3af9ee3b5ddae8;
/**
* 实缴单位大病救助
**/
private String fd_3af9ee3ba76f54;
/**
* 实缴单位工伤
**/
private String fd_3af9ee3aa9c84a;
/**
* 实缴合计
**/
private String fd_3af9ee3c6bfc74;
/**
* 预估单位补缴利息
**/
private String fd_3af9eba7c3da5e;
/**
* 预估单位医疗
**/
private String fd_3af9eba5899c90;
/**
* 预估个人养老
**/
private String fd_3af9ebbd791662;
/**
* 预估个人大病救助
**/
private String fd_3af9ebbf3e8be2;
/**
* 预估个人医疗
**/
private String fd_3af9ebbdd9797e;
/**
* 实缴个人医疗
**/
private String fd_3af9ee3e066d48;
/**
* 实缴单位失业
**/
private String fd_3af9ee3a46b7e6;
/**
* 预估个人失业
**/
private String fd_3af9ebbe29ce1c;
/**
* 实缴个人养老
**/
private String fd_3af9ee3e513962;
/**
* 实缴个人大病救助
**/
private String fd_3af9ee3d0ba3b6;
/**
* 预估单位工伤
**/
private String fd_3af9eba684f592;
/**
* 我司到款单位
**/
private String fd_3b01953871b8be;
}
\ No newline at end of file
......@@ -93,6 +93,11 @@
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-common-core</artifactId>
</dependency>
<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-common-ekp</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
<build>
......
......@@ -10,6 +10,7 @@ public class SocialConstants {
public static final String SOCIAL_SET_ERROR = "社保补缴配置有误!";
public static final String EMP_NAME_ERROR = "员工姓名错误!";
public static final String DIFF_TYPE_ONE = "预估";
public static final String DIFF_TYPE_THR = "实缴";
public static final String DIFF_TYPE_TWO = "差额";
public static final String YL = "养老";
......
......@@ -261,4 +261,32 @@ public class TForecastLibraryController {
tForecastLibraryService.updateForSocialAndFound(list);
}
/**
* @Description: 定时任务推送社保预估明细的数据
* @Author: huyc
* @Date: 2022/8/30
* @return: void
**/
@Operation(summary = "定时任务推送社保预估明细的数据", description = "定时任务推送社保预估明细的数据")
@SysLog("定时任务推送社保预估明细的数据")
@Inner
@PostMapping("/inner/createForecastInfo")
public void createForecastInfo() {
tForecastLibraryService.createForecastInfo();
}
/**
* @Description: 定时任务推送社保预估明细的数据
* @Author: huyc
* @Date: 2022/8/30
* @return: void
**/
@Operation(summary = "定时生成公积金预估明细的数据", description = "定时生成公积金预估明细的数据")
@SysLog("定时生成公积金预估明细的数据")
@Inner
@PostMapping("/inner/createForecastFundInfo")
public void createForecastFundInfo() {
tForecastLibraryService.createForecastFundInfo();
}
}
......@@ -311,4 +311,32 @@ public class TPaymentInfoController {
public void updatePaymentSocialAndFound(@RequestBody UpdateSocialFoundVo list) {
tPaymentInfoService.updatePaymentSocialAndFound(list);
}
/**
* @Description: 定时任务推送社保缴费库明细的数据
* @Author: huyc
* @Date: 2022/8/30
* @return: void
**/
@Operation(summary = "定时任务推送社保缴费库明细的数据", description = "定时任务推送社保缴费库明细的数据")
@SysLog("定时任务推送社保缴费库明细的数据")
@Inner
@PostMapping("/inner/createPaymentSocialInfo")
public void createPaymentSocialInfo() {
tPaymentInfoService.createPaymentSocialInfo();
}
/**
* @Description: 定时任务推送公积金缴费库明细的数据
* @Author: huyc
* @Date: 2022/8/30
* @return: void
**/
@Operation(summary = "定时任务推送公积金缴费库明细的数据", description = "定时任务推送公积金缴费库明细的数据")
@SysLog("定时任务推送公积金缴费库明细的数据")
@Inner
@PostMapping("/inner/createPaymentFundInfo")
public void createPaymentFundInfo() {
tPaymentInfoService.createPaymentFundInfo();
}
}
......@@ -69,4 +69,12 @@ public interface TForecastLibraryMapper extends BaseMapper<TForecastLibrary> {
void updateForSocialAndFound(@Param("infoVo") UpdateSocialFoundVo infoVo);
/**
* 更新社保结算状态
* @Author huyc
* @Date 2022-8-30
* @param idList
* @return
**/
int updatePushStatus(@Param("idList") List<String> idList);
}
......@@ -117,4 +117,13 @@ public interface TPaymentInfoMapper extends BaseMapper<TPaymentInfo> {
void updatePaymentSocialAndFound(@Param("infoVo") UpdateSocialFoundVo infoVo);
/**
* 更新社保推送
* @Author huyc
* @Date 2022-8-30
* @param idList
* @return
**/
int updatePushStatus(@Param("idList") List<String> idList);
}
......@@ -125,4 +125,7 @@ public interface TForecastLibraryService extends IService<TForecastLibrary> {
void updateForSocialAndFound(UpdateSocialFoundVo list);
void createForecastInfo();
void createForecastFundInfo();
}
......@@ -131,5 +131,6 @@ public interface TPaymentInfoService extends IService<TPaymentInfo> {
void updatePaymentSocialAndFound(UpdateSocialFoundVo list);
void createPaymentSocialInfo();
void createPaymentFundInfo();
}
......@@ -25,11 +25,15 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractInfo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
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.ekp.util.EkpFundUtil;
import com.yifu.cloud.plus.v1.yifu.ekp.util.EkpSocialUtil;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpPushFundParam;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpPushSocialParam;
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;
......@@ -74,6 +78,10 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
private final SysBaseSetInfoMapper sysBaseSetInfoMapper;
private final EkpFundUtil ekpFundUtil;
private final EkpSocialUtil ekpSocialUtil;
/**
* 预估费用简单分页查询
*
......@@ -2142,4 +2150,348 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
}
}
@Override
public void createForecastInfo() {
//获取所有未推送的社保预估明细数据
List<TForecastLibrary> unPushInfo = baseMapper.selectList(Wrappers.<TForecastLibrary>query().lambda()
.eq(TForecastLibrary::getDataPush, CommonConstants.ZERO_INT)
.eq(TForecastLibrary::getDataType, CommonConstants.ZERO_INT));
if (Common.isNotNull(unPushInfo)) {
//推送数据封装并推送
List<String> pushList = initEkpPushSocialParam(unPushInfo);
//更新推送状态
if (Common.isNotNull(pushList)) {
baseMapper.updatePushStatus(pushList);
}
}
}
@Override
public void createForecastFundInfo() {
//获取所有未推送的公积金预估明细数据
List<TForecastLibrary> unPushInfo = baseMapper.selectList(Wrappers.<TForecastLibrary>query().lambda()
.eq(TForecastLibrary::getDataPush, CommonConstants.ZERO_INT)
.eq(TForecastLibrary::getDataType, CommonConstants.ONE_INT));
if (Common.isNotNull(unPushInfo)) {
//推送数据封装并推送
List<String> pushList = initEkpPushFundParam(unPushInfo);
//更新推送状态
if (Common.isNotNull(pushList)) {
baseMapper.updatePushStatus(pushList);
}
}
}
public List<String> initEkpPushSocialParam(List<TForecastLibrary> unPushInfo) {
List<String> pushList = new ArrayList<>();
for (TForecastLibrary library:unPushInfo) {
EkpPushSocialParam socialParam = new EkpPushSocialParam();
//员工姓名
socialParam.setFd_3adfe8c79989d4(library.getEmpName());
//员工身份证
socialParam.setFd_3adfe8c7e4cf7a(library.getEmpIdcard());
//单位养老金额
if (Common.isNotNull(library.getUnitPensionFee())) {
socialParam.setFd_3af9ec80a9de7a(library.getUnitPensionFee().toString());
} else {
socialParam.setFd_3af9ec80a9de7a(CommonConstants.EMPTY_STRING);
}
//单位医疗金额
if (Common.isNotNull(library.getUnitMedicalFee())) {
socialParam.setFd_3af9eba5899c90(library.getUnitMedicalFee().toString());
} else {
socialParam.setFd_3af9eba5899c90(CommonConstants.EMPTY_STRING);
}
//单位工伤金额
if (Common.isNotNull(library.getUnitWorkInjuryFee())) {
socialParam.setFd_3af9eba684f592(library.getUnitWorkInjuryFee().toString());
} else {
socialParam.setFd_3af9eba684f592(CommonConstants.EMPTY_STRING);
}
//单位失业金额
if (Common.isNotNull(library.getUnitUnemploymentFee())) {
socialParam.setFd_3af9eba5f6e19e(library.getUnitUnemploymentFee().toString());
} else {
socialParam.setFd_3af9eba5f6e19e(CommonConstants.EMPTY_STRING);
}
//单位生育金额
if (Common.isNotNull(library.getUnitBirthFee())) {
socialParam.setFd_3af9eba71c0138(library.getUnitBirthFee().toString());
} else {
socialParam.setFd_3af9eba71c0138(CommonConstants.EMPTY_STRING);
}
//单位大病金额
if (Common.isNotNull(library.getUnitBitailmentFee())) {
socialParam.setFd_3af9eba863c0ee(library.getUnitBitailmentFee().toString());
} else {
socialParam.setFd_3af9eba863c0ee(CommonConstants.EMPTY_STRING);
}
//个人养老金额
if (Common.isNotNull(library.getPersonalPensionFee())) {
socialParam.setFd_3af9ebbd791662(library.getPersonalPensionFee().toString());
} else {
socialParam.setFd_3af9ebbd791662(CommonConstants.EMPTY_STRING);
}
//个人医疗金额
if (Common.isNotNull(library.getPersonalMedicalFee())) {
socialParam.setFd_3af9ebbdd9797e(library.getPersonalMedicalFee().toString());
} else {
socialParam.setFd_3af9ebbdd9797e(CommonConstants.EMPTY_STRING);
}
//单位社保合计
if (Common.isNotNull(library.getUnitSocialSum())) {
socialParam.setFd_3adfeb4e8064a8(library.getUnitSocialSum().toString());
} else {
socialParam.setFd_3adfeb4e8064a8(CommonConstants.EMPTY_STRING);
}
//个人社保合计
if (Common.isNotNull(library.getPersonalSocialSum())) {
socialParam.setFd_3adfeb52a4d2e2(library.getPersonalSocialSum().toString());
} else {
socialParam.setFd_3adfeb52a4d2e2(CommonConstants.EMPTY_STRING);
}
//预估个人大病救助
if (Common.isNotNull(library.getPersonalBigailmentFee())) {
socialParam.setFd_3af9ebbf3e8be2(library.getPersonalBigailmentFee().toString());
} else {
socialParam.setFd_3af9ebbf3e8be2(CommonConstants.EMPTY_STRING);
}
//预估个人失业
if (Common.isNotNull(library.getPersonalUnemploymentFee())) {
socialParam.setFd_3af9ebbe29ce1c(library.getPersonalUnemploymentFee().toString());
} else {
socialParam.setFd_3af9ebbe29ce1c(CommonConstants.EMPTY_STRING);
}
//结算状态
if (Common.isNotNull(library.getSalarySocialFlag())) {
if (CommonConstants.ONE_STRING.equals(library.getSalarySocialFlag())) {
socialParam.setFd_3add9ea428879a(CommonConstants.SALARY_ISFLAG);
} else {
socialParam.setFd_3add9ea428879a(CommonConstants.SALARY_UNFLAG);
}
} else {
socialParam.setFd_3add9ea428879a(CommonConstants.EMPTY_STRING);
}
//社保缴纳月份
if (Common.isNotNull(library.getSocialPayMonth())) {
socialParam.setFd_3adfe8cf632700(library.getSocialPayMonth());
} else {
socialParam.setFd_3adfe8cf632700(CommonConstants.EMPTY_STRING);
}
//社保生成月份
if (Common.isNotNull(library.getSocialCreateMonth())) {
socialParam.setFd_3adfe8cb96c41e(library.getSocialCreateMonth());
} else {
socialParam.setFd_3adfe8cb96c41e(CommonConstants.EMPTY_STRING);
}
//订单类型
socialParam.setFd_3add9dd7833db8(SocialConstants.DIFF_TYPE_ONE);
//是否有预估
socialParam.setFd_3add9de0be85e4(CommonConstants.IS_TRUE);
//与工资合并结算
socialParam.setFd_3add9e1a670144(CommonConstants.EMPTY_STRING);
//项目编码
socialParam.setFd_3adfe8c70d3fd4(library.getDeptNo());
//项目名称
socialParam.setFd_3adfe8c8468e54(library.getDeptName());
//单号
socialParam.setFd_3adfe95c169c48(CommonConstants.EMPTY_STRING);
//客户编码
socialParam.setFd_3adfe8c73cb5a4(CommonConstants.EMPTY_STRING);
//客户名称
socialParam.setFd_3adfe8c81a0e42(library.getUnitName());
//社保户
if (Common.isNotNull(library.getSocialHouseholdName())) {
socialParam.setFd_3aeafa25916e82(library.getSocialHouseholdName());
} else {
socialParam.setFd_3aeafa25916e82(CommonConstants.EMPTY_STRING);
}
//结算月份
socialParam.setFd_3adfe8cff746bc(CommonConstants.EMPTY_STRING);
//单位差异
socialParam.setFd_3adfeb53c70f72(CommonConstants.EMPTY_STRING);
//个人差异
socialParam.setFd_3adfeb5413fb44(CommonConstants.EMPTY_STRING);
//应收
socialParam.setFd_3adfeb7b624f06(CommonConstants.EMPTY_STRING);
//收款状态
socialParam.setFd_3add9eaeed2560(CommonConstants.EMPTY_STRING);
//结算单号
socialParam.setFd_3adfeb830523b6(CommonConstants.EMPTY_STRING);
//收款单号
socialParam.setFd_3adfeb8489e6c2(CommonConstants.EMPTY_STRING);
//应支出
socialParam.setFd_3adfeb7bd97464(CommonConstants.EMPTY_STRING);
//支出结算状态
socialParam.setFd_3add9edfbc6f7e(CommonConstants.EMPTY_STRING);
//付款状态
socialParam.setFd_3add9eed23894a(CommonConstants.EMPTY_STRING);
//支出缴纳单号
socialParam.setFd_3adfeb83a704c8(CommonConstants.EMPTY_STRING);
//实缴单位生育
socialParam.setFd_3af9ee3afb34c2(CommonConstants.EMPTY_STRING);
//付款单号
socialParam.setFd_3adfeb84175f28(CommonConstants.EMPTY_STRING);
//实缴个人合计
socialParam.setFd_3af9ee3cb6d4fa(CommonConstants.EMPTY_STRING);
//预估合计
if (Common.isNotNull(library.getSumAll())) {
socialParam.setFd_3af9ed7e813b86(library.getSumAll().toString());
} else {
socialParam.setFd_3af9ed7e813b86(CommonConstants.EMPTY_STRING);
}
//实缴单位合计
socialParam.setFd_3af9ee3c0bf286(CommonConstants.EMPTY_STRING);
//实缴个人补缴利息
socialParam.setFd_3af9ee3d634946(CommonConstants.EMPTY_STRING);
//实缴单位医疗
socialParam.setFd_3af9ee39dea6a8(CommonConstants.EMPTY_STRING);
//预估个人补缴利息
if (Common.isNotNull(library.getPersonalInterestFee())) {
socialParam.setFd_3af9ebbecc4aa8(library.getPersonalInterestFee().toString());
} else {
socialParam.setFd_3af9ebbecc4aa8(CommonConstants.EMPTY_STRING);
}
//预估单位补缴利息
if (Common.isNotNull(library.getUnitInterestFee())) {
socialParam.setFd_3af9eba7c3da5e(library.getUnitInterestFee().toString());
} else {
socialParam.setFd_3af9eba7c3da5e(CommonConstants.EMPTY_STRING);
}
//实缴单位养老
socialParam.setFd_3af9ee3938170a(CommonConstants.EMPTY_STRING);
//实缴个人失业
socialParam.setFd_3af9ee3db44d96(CommonConstants.EMPTY_STRING);
//实缴单位补缴利息
socialParam.setFd_3af9ee3b5ddae8(CommonConstants.EMPTY_STRING);
//实缴单位大病救助
socialParam.setFd_3af9ee3ba76f54(CommonConstants.EMPTY_STRING);
//实缴单位工伤
socialParam.setFd_3af9ee3aa9c84a(CommonConstants.EMPTY_STRING);
//实缴合计
socialParam.setFd_3af9ee3c6bfc74(CommonConstants.EMPTY_STRING);
//实缴个人医疗
socialParam.setFd_3af9ee3e066d48(CommonConstants.EMPTY_STRING);
//实缴单位失业
socialParam.setFd_3af9ee3a46b7e6(CommonConstants.EMPTY_STRING);
//实缴个人养老
socialParam.setFd_3af9ee3e513962(CommonConstants.EMPTY_STRING);
//实缴个人大病救助
socialParam.setFd_3af9ee3d0ba3b6(CommonConstants.EMPTY_STRING);
//我司到款单位
socialParam.setFd_3b01953871b8be(CommonConstants.EMPTY_STRING);
String body = ekpSocialUtil.sendToEKP(socialParam);
if (Common.isNotNull(body)) {
//更新推送状态为已推送的列表
pushList.add(library.getId());
}
}
return pushList;
}
public List<String> initEkpPushFundParam(List<TForecastLibrary> unPushInfo) {
List<String> pushList = new ArrayList<>();
for (TForecastLibrary library:unPushInfo) {
EkpPushFundParam fundParam = new EkpPushFundParam();
//员工姓名
fundParam.setFd_3adfe8c79989d4(library.getEmpName());
//员工身份证
fundParam.setFd_3adfe8c7e4cf7a(library.getEmpIdcard());
//预估单位代缴
if (Common.isNotNull(library.getUnitSocialSum())) {
fundParam.setFd_3adfeb4e8064a8(library.getUnitSocialSum().toString());
} else {
fundParam.setFd_3adfeb4e8064a8(CommonConstants.EMPTY_STRING);
}
//预估个人代缴
if (Common.isNotNull(library.getPersonalSocialSum())) {
fundParam.setFd_3adfeb52a4d2e2(library.getPersonalSocialSum().toString());
} else {
fundParam.setFd_3adfeb52a4d2e2(CommonConstants.EMPTY_STRING);
}
//缴纳月份
if (Common.isNotNull(library.getSocialPayMonth())) {
fundParam.setFd_3adfe8cf632700(library.getSocialPayMonth());
} else {
fundParam.setFd_3adfe8cf632700(CommonConstants.EMPTY_STRING);
}
//生成月份
if (Common.isNotNull(library.getSocialCreateMonth())) {
fundParam.setFd_3adfe8cb96c41e(library.getSocialCreateMonth());
} else {
fundParam.setFd_3adfe8cb96c41e(CommonConstants.EMPTY_STRING);
}
//结算状态
if (Common.isNotNull(library.getSalaryFundFlag())) {
if (CommonConstants.ONE_STRING.equals(library.getSalaryFundFlag())) {
fundParam.setFd_3add9ea428879a(CommonConstants.SALARY_ISFLAG);
} else {
fundParam.setFd_3add9ea428879a(CommonConstants.SALARY_UNFLAG);
}
} else {
fundParam.setFd_3add9ea428879a(CommonConstants.EMPTY_STRING);
}
//订单类型
fundParam.setFd_3add9dd7833db8(SocialConstants.DIFF_TYPE_ONE);
//是否有预估
fundParam.setFd_3add9de0be85e4(CommonConstants.IS_TRUE);
//与工资合并结算
fundParam.setFd_3add9e1a670144(CommonConstants.EMPTY_STRING);
//项目编码
fundParam.setFd_3adfe8c70d3fd4(library.getDeptNo());
//项目名称
fundParam.setFd_3adfe8c8468e54(library.getDeptName());
//单号
fundParam.setFd_3adfe95c169c48(CommonConstants.EMPTY_STRING);
//客户编码
fundParam.setFd_3adfe8c73cb5a4(CommonConstants.EMPTY_STRING);
//单位代缴
fundParam.setFd_3adfeb52fbe966(CommonConstants.EMPTY_STRING);
//个人代缴
fundParam.setFd_3adfeb5366dd82(CommonConstants.EMPTY_STRING);
//客户名称
fundParam.setFd_3adfe8c81a0e42(library.getUnitName());
//公积金账户
if (Common.isNotNull(library.getProvidentHouseholdName())) {
fundParam.setFd_3aeafa8cc144bc(library.getProvidentHouseholdName());
} else {
fundParam.setFd_3aeafa8cc144bc(CommonConstants.EMPTY_STRING);
}
//结算月份
fundParam.setFd_3adfe8cff746bc(CommonConstants.EMPTY_STRING);
//单位差异
fundParam.setFd_3adfeb53c70f72(CommonConstants.EMPTY_STRING);
//个人差异
fundParam.setFd_3adfeb5413fb44(CommonConstants.EMPTY_STRING);
//应收
fundParam.setFd_3adfeb7b624f06(CommonConstants.EMPTY_STRING);
//收款状态
fundParam.setFd_3add9eaeed2560(CommonConstants.EMPTY_STRING);
//结算单号
fundParam.setFd_3adfeb830523b6(CommonConstants.EMPTY_STRING);
//收款单号
fundParam.setFd_3adfeb8489e6c2(CommonConstants.EMPTY_STRING);
//应支出
fundParam.setFd_3adfeb7bd97464(CommonConstants.EMPTY_STRING);
//支出结算状态
fundParam.setFd_3add9edfbc6f7e(CommonConstants.EMPTY_STRING);
//付款状态
fundParam.setFd_3add9eed23894a(CommonConstants.EMPTY_STRING);
//支出缴纳单号
fundParam.setFd_3adfeb83a704c8(CommonConstants.EMPTY_STRING);
//付款单号
fundParam.setFd_3adfeb84175f28(CommonConstants.EMPTY_STRING);
//我司到款单位
fundParam.setFd_3b019a2e9bfdd6(CommonConstants.EMPTY_STRING);
String body = ekpFundUtil.sendToEKP(fundParam);
if (Common.isNotNull(body)) {
//更新推送状态为已推送的列表
pushList.add(library.getId());
}
}
return pushList;
}
}
......@@ -27,6 +27,10 @@ import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.ArchivesDaprUtil;
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.ekp.util.EkpFundUtil;
import com.yifu.cloud.plus.v1.yifu.ekp.util.EkpSocialUtil;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpPushFundParam;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpPushSocialParam;
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;
......@@ -111,6 +115,12 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
@Autowired
private SysHouseHoldInfoMapper sysHouseHoldInfoMapper;
@Autowired
private EkpFundUtil ekpFundUtil;
@Autowired
private EkpSocialUtil ekpSocialUtil;
/**
* 缴费库简单分页查询
*
......@@ -2207,4 +2217,348 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
}
@Override
public void createPaymentSocialInfo() {
//获取所有未推送的社保预估明细数据
List<TPaymentInfo> unPushInfo = baseMapper.selectList(Wrappers.<TPaymentInfo>query().lambda()
.eq(TPaymentInfo::getPushStatus, CommonConstants.ONE_STRING)
.isNotNull(TPaymentInfo::getSocialId));
if (Common.isNotNull(unPushInfo)) {
//推送数据封装并推送
List<String> pushList = initEkpPushSocialParam(unPushInfo);
//更新推送状态
if (Common.isNotNull(pushList)) {
baseMapper.updatePushStatus(pushList);
}
}
}
@Override
public void createPaymentFundInfo() {
//获取所有未推送的社保预估明细数据
List<TPaymentInfo> unPushInfo = baseMapper.selectList(Wrappers.<TPaymentInfo>query().lambda()
.eq(TPaymentInfo::getPushStatus, CommonConstants.ONE_STRING)
.isNotNull(TPaymentInfo::getFundId));
if (Common.isNotNull(unPushInfo)) {
//推送数据封装并推送
List<String> pushList = initEkpPushFundParam(unPushInfo);
//更新推送状态
if (Common.isNotNull(pushList)) {
baseMapper.updatePushStatus(pushList);
}
}
}
public List<String> initEkpPushSocialParam(List<TPaymentInfo> unPushInfo) {
List<String> pushList = new ArrayList<>();
for (TPaymentInfo library:unPushInfo) {
EkpPushSocialParam socialParam = new EkpPushSocialParam();
//员工姓名
socialParam.setFd_3adfe8c79989d4(library.getEmpName());
//员工身份证
socialParam.setFd_3adfe8c7e4cf7a(library.getEmpIdcard());
//单位养老金额
socialParam.setFd_3af9ec80a9de7a(CommonConstants.EMPTY_STRING);
//单位医疗金额
socialParam.setFd_3af9eba5899c90(CommonConstants.EMPTY_STRING);
//单位工伤金额
socialParam.setFd_3af9eba684f592(CommonConstants.EMPTY_STRING);
//单位失业金额
socialParam.setFd_3af9eba5f6e19e(CommonConstants.EMPTY_STRING);
//单位生育金额
socialParam.setFd_3af9eba71c0138(CommonConstants.EMPTY_STRING);
//单位大病金额
socialParam.setFd_3af9eba863c0ee(CommonConstants.EMPTY_STRING);
//预估个人养老
socialParam.setFd_3af9ebbd791662(CommonConstants.EMPTY_STRING);
//预估个人医疗
socialParam.setFd_3af9ebbdd9797e(CommonConstants.EMPTY_STRING);
//预估单位合计
socialParam.setFd_3adfeb4e8064a8(CommonConstants.EMPTY_STRING);
//个人社保合计
socialParam.setFd_3adfeb52a4d2e2(CommonConstants.EMPTY_STRING);
//预估个人大病救助
socialParam.setFd_3af9ebbf3e8be2(CommonConstants.EMPTY_STRING);
//预估个人失业
socialParam.setFd_3af9ebbe29ce1c(CommonConstants.EMPTY_STRING);
//结算状态
if (Common.isNotNull(library.getSalarySocialFlag())) {
if (CommonConstants.ONE_STRING.equals(library.getSalarySocialFlag())) {
socialParam.setFd_3add9ea428879a(CommonConstants.SALARY_ISFLAG);
} else {
socialParam.setFd_3add9ea428879a(CommonConstants.SALARY_UNFLAG);
}
} else {
socialParam.setFd_3add9ea428879a(CommonConstants.EMPTY_STRING);
}
//社保缴纳月份
if (Common.isNotNull(library.getSocialPayMonth())) {
socialParam.setFd_3adfe8cf632700(library.getSocialPayMonth());
} else {
socialParam.setFd_3adfe8cf632700(CommonConstants.EMPTY_STRING);
}
//社保生成月份
if (Common.isNotNull(library.getSocialCreateMonth())) {
socialParam.setFd_3adfe8cb96c41e(library.getSocialCreateMonth());
} else {
socialParam.setFd_3adfe8cb96c41e(CommonConstants.EMPTY_STRING);
}
//订单类型
socialParam.setFd_3add9dd7833db8(SocialConstants.DIFF_TYPE_THR);
//是否有预估
socialParam.setFd_3add9de0be85e4(CommonConstants.EMPTY_STRING);
//与工资合并结算
socialParam.setFd_3add9e1a670144(CommonConstants.EMPTY_STRING);
//项目编码
socialParam.setFd_3adfe8c70d3fd4(library.getSettleDomainCode());
//项目名称
socialParam.setFd_3adfe8c8468e54(library.getSettleDomainName());
//单号
socialParam.setFd_3adfe95c169c48(CommonConstants.EMPTY_STRING);
//客户编码
socialParam.setFd_3adfe8c73cb5a4(CommonConstants.EMPTY_STRING);
//客户名称
socialParam.setFd_3adfe8c81a0e42(library.getUnitName());
//社保户
if (Common.isNotNull(library.getSocialHousehold())) {
socialParam.setFd_3aeafa25916e82(library.getSocialHousehold());
} else {
socialParam.setFd_3aeafa25916e82(CommonConstants.EMPTY_STRING);
}
//结算月份
socialParam.setFd_3adfe8cff746bc(CommonConstants.EMPTY_STRING);
//单位差异
socialParam.setFd_3adfeb53c70f72(CommonConstants.EMPTY_STRING);
//个人差异
socialParam.setFd_3adfeb5413fb44(CommonConstants.EMPTY_STRING);
//应收
socialParam.setFd_3adfeb7b624f06(CommonConstants.EMPTY_STRING);
//收款状态
socialParam.setFd_3add9eaeed2560(CommonConstants.EMPTY_STRING);
//结算单号
socialParam.setFd_3adfeb830523b6(CommonConstants.EMPTY_STRING);
//收款单号
socialParam.setFd_3adfeb8489e6c2(CommonConstants.EMPTY_STRING);
//应支出
socialParam.setFd_3adfeb7bd97464(CommonConstants.EMPTY_STRING);
//支出结算状态
socialParam.setFd_3add9edfbc6f7e(CommonConstants.EMPTY_STRING);
//付款状态
socialParam.setFd_3add9eed23894a(CommonConstants.EMPTY_STRING);
//支出缴纳单号
socialParam.setFd_3adfeb83a704c8(CommonConstants.EMPTY_STRING);
//实缴单位生育
if (Common.isNotNull(library.getUnitBirthMoney())) {
socialParam.setFd_3af9ee3afb34c2(library.getUnitBirthMoney().toString());
} else {
socialParam.setFd_3af9ee3afb34c2(CommonConstants.EMPTY_STRING);
}
//付款单号
socialParam.setFd_3adfeb84175f28(CommonConstants.EMPTY_STRING);
//实缴个人合计
if (Common.isNotNull(library.getSocialSecurityPersonalSum())) {
socialParam.setFd_3af9ee3cb6d4fa(library.getSocialSecurityPersonalSum().toString());
} else {
socialParam.setFd_3af9ee3cb6d4fa(CommonConstants.EMPTY_STRING);
}
//预估合计
socialParam.setFd_3af9ed7e813b86(CommonConstants.EMPTY_STRING);
//实缴单位合计
if (Common.isNotNull(library.getUnitSocialSum())) {
socialParam.setFd_3af9ee3c0bf286(library.getUnitSocialSum().toString());
} else {
socialParam.setFd_3af9ee3c0bf286(CommonConstants.EMPTY_STRING);
}
//实缴个人补缴利息
if (Common.isNotNull(library.getPersonalAccrual())) {
socialParam.setFd_3af9ee3d634946(library.getPersonalAccrual().toString());
} else {
socialParam.setFd_3af9ee3d634946(CommonConstants.EMPTY_STRING);
}
//实缴单位医疗
if (Common.isNotNull(library.getUnitMedicalMoney())) {
socialParam.setFd_3af9ee39dea6a8(library.getUnitMedicalMoney().toString());
} else {
socialParam.setFd_3af9ee39dea6a8(CommonConstants.EMPTY_STRING);
}
//预估个人补缴利息
socialParam.setFd_3af9ebbecc4aa8(CommonConstants.EMPTY_STRING);
//预估单位补缴利息
socialParam.setFd_3af9eba7c3da5e(CommonConstants.EMPTY_STRING);
//实缴单位养老
if (Common.isNotNull(library.getUnitPensionMoney())) {
socialParam.setFd_3af9ee3938170a(library.getUnitPensionMoney().toString());
} else {
socialParam.setFd_3af9ee3938170a(CommonConstants.EMPTY_STRING);
}
//实缴个人失业
if (Common.isNotNull(library.getPersonalUnemploymentMoney())) {
socialParam.setFd_3af9ee3db44d96(library.getPersonalUnemploymentMoney().toString());
} else {
socialParam.setFd_3af9ee3db44d96(CommonConstants.EMPTY_STRING);
}
//实缴单位补缴利息
if (Common.isNotNull(library.getCompanyAccrual())) {
socialParam.setFd_3af9ee3b5ddae8(library.getCompanyAccrual().toString());
} else {
socialParam.setFd_3af9ee3b5ddae8(CommonConstants.EMPTY_STRING);
}
//实缴单位大病救助
if (Common.isNotNull(library.getUnitBigmailmentMoney())) {
socialParam.setFd_3af9ee3ba76f54(library.getUnitBigmailmentMoney().toString());
} else {
socialParam.setFd_3af9ee3ba76f54(CommonConstants.EMPTY_STRING);
}
//实缴单位工伤
if (Common.isNotNull(library.getUnitInjuryMoney())) {
socialParam.setFd_3af9ee3aa9c84a(library.getUnitInjuryMoney().toString());
} else {
socialParam.setFd_3af9ee3aa9c84a(CommonConstants.EMPTY_STRING);
}
//实缴合计
if (Common.isNotNull(library.getSumAll())) {
socialParam.setFd_3af9ee3c6bfc74(library.getSumAll().toString());
} else {
socialParam.setFd_3af9ee3c6bfc74(CommonConstants.EMPTY_STRING);
}
//实缴个人医疗
if (Common.isNotNull(library.getPersonalMedicalMoney())) {
socialParam.setFd_3af9ee3e066d48(library.getPersonalMedicalMoney().toString());
} else {
socialParam.setFd_3af9ee3e066d48(CommonConstants.EMPTY_STRING);
}
//实缴单位失业
if (Common.isNotNull(library.getUnitUnemploymentMoney())) {
socialParam.setFd_3af9ee3a46b7e6(library.getUnitUnemploymentMoney().toString());
} else {
socialParam.setFd_3af9ee3a46b7e6(CommonConstants.EMPTY_STRING);
}
//实缴个人养老
if (Common.isNotNull(library.getPersonalPensionMoney())) {
socialParam.setFd_3af9ee3e513962(library.getPersonalPensionMoney().toString());
} else {
socialParam.setFd_3af9ee3e513962(CommonConstants.EMPTY_STRING);
}
//实缴个人大病救助
if (Common.isNotNull(library.getPersonalBigmailmentMoney())) {
socialParam.setFd_3af9ee3d0ba3b6(library.getPersonalBigmailmentMoney().toString());
} else {
socialParam.setFd_3af9ee3d0ba3b6(CommonConstants.EMPTY_STRING);
}
//我司到款单位
socialParam.setFd_3b01953871b8be(CommonConstants.EMPTY_STRING);
String body = ekpSocialUtil.sendToEKP(socialParam);
if (Common.isNotNull(body)) {
//更新推送状态为已推送的列表
pushList.add(library.getId());
}
}
return pushList;
}
public List<String> initEkpPushFundParam(List<TPaymentInfo> unPushInfo) {
List<String> pushList = new ArrayList<>();
for (TPaymentInfo library:unPushInfo) {
EkpPushFundParam fundParam = new EkpPushFundParam();
//员工姓名
fundParam.setFd_3adfe8c79989d4(library.getEmpName());
//员工身份证
fundParam.setFd_3adfe8c7e4cf7a(library.getEmpIdcard());
//预估单位代缴
fundParam.setFd_3adfeb4e8064a8(CommonConstants.EMPTY_STRING);
//预估个人代缴
fundParam.setFd_3adfeb52a4d2e2(CommonConstants.EMPTY_STRING);
//缴纳月份
if (Common.isNotNull(library.getProvidentPayMonth())) {
fundParam.setFd_3adfe8cf632700(library.getProvidentPayMonth());
} else {
fundParam.setFd_3adfe8cf632700(CommonConstants.EMPTY_STRING);
}
//生成月份
if (Common.isNotNull(library.getProvidentCreateMonth())) {
fundParam.setFd_3adfe8cb96c41e(library.getProvidentCreateMonth());
} else {
fundParam.setFd_3adfe8cb96c41e(CommonConstants.EMPTY_STRING);
}
//结算状态
if (Common.isNotNull(library.getSalaryFundFlag())) {
if (CommonConstants.ONE_STRING.equals(library.getSalaryFundFlag())) {
fundParam.setFd_3add9ea428879a(CommonConstants.SALARY_ISFLAG);
} else {
fundParam.setFd_3add9ea428879a(CommonConstants.SALARY_UNFLAG);
}
} else {
fundParam.setFd_3add9ea428879a(CommonConstants.EMPTY_STRING);
}
//订单类型
fundParam.setFd_3add9dd7833db8(SocialConstants.DIFF_TYPE_THR);
//是否有预估
fundParam.setFd_3add9de0be85e4(CommonConstants.EMPTY_STRING);
//与工资合并结算
fundParam.setFd_3add9e1a670144(CommonConstants.EMPTY_STRING);
//项目编码
fundParam.setFd_3adfe8c70d3fd4(library.getSettleDomainCode());
//项目名称
fundParam.setFd_3adfe8c8468e54(library.getSettleDomainName());
//单号
fundParam.setFd_3adfe95c169c48(CommonConstants.EMPTY_STRING);
//客户编码
fundParam.setFd_3adfe8c73cb5a4(CommonConstants.EMPTY_STRING);
//单位代缴
if (Common.isNotNull(library.getUnitProvidentSum())) {
fundParam.setFd_3adfeb52fbe966(library.getUnitProvidentSum().toString());
} else {
fundParam.setFd_3adfeb52fbe966(CommonConstants.EMPTY_STRING);
}
//个人代缴
if (Common.isNotNull(library.getPersonalProvidentSum())) {
fundParam.setFd_3adfeb5366dd82(library.getPersonalProvidentSum().toString());
} else {
fundParam.setFd_3adfeb5366dd82(CommonConstants.EMPTY_STRING);
}
//客户名称
fundParam.setFd_3adfe8c81a0e42(library.getUnitName());
//公积金账户
if (Common.isNotNull(library.getProvidentHousehold())) {
fundParam.setFd_3aeafa8cc144bc(library.getProvidentHousehold());
} else {
fundParam.setFd_3aeafa8cc144bc(CommonConstants.EMPTY_STRING);
}
//结算月份
fundParam.setFd_3adfe8cff746bc(CommonConstants.EMPTY_STRING);
//单位差异
fundParam.setFd_3adfeb53c70f72(CommonConstants.EMPTY_STRING);
//个人差异
fundParam.setFd_3adfeb5413fb44(CommonConstants.EMPTY_STRING);
//应收
fundParam.setFd_3adfeb7b624f06(CommonConstants.EMPTY_STRING);
//收款状态
fundParam.setFd_3add9eaeed2560(CommonConstants.EMPTY_STRING);
//结算单号
fundParam.setFd_3adfeb830523b6(CommonConstants.EMPTY_STRING);
//收款单号
fundParam.setFd_3adfeb8489e6c2(CommonConstants.EMPTY_STRING);
//应支出
fundParam.setFd_3adfeb7bd97464(CommonConstants.EMPTY_STRING);
//支出结算状态
fundParam.setFd_3add9edfbc6f7e(CommonConstants.EMPTY_STRING);
//付款状态
fundParam.setFd_3add9eed23894a(CommonConstants.EMPTY_STRING);
//支出缴纳单号
fundParam.setFd_3adfeb83a704c8(CommonConstants.EMPTY_STRING);
//付款单号
fundParam.setFd_3adfeb84175f28(CommonConstants.EMPTY_STRING);
//我司到款单位
fundParam.setFd_3b019a2e9bfdd6(CommonConstants.EMPTY_STRING);
String body = ekpFundUtil.sendToEKP(fundParam);
if (Common.isNotNull(body)) {
//更新推送状态为已推送的列表
pushList.add(library.getId());
}
}
return pushList;
}
}
......@@ -674,4 +674,14 @@
or (SALARY_FUND_FLAG = '0' and PROVIDENT_CREATE_MONTH >= #{infoVo.socialCreateMonth})
</update>
<!-- 更改预估社保推送状态 -->
<update id="updatePushStatus">
update t_forecast_library set DATA_PUSH = 1
where
ID in
<foreach item="item" index="index" collection="idList" open="(" separator="," close=")">
#{item}
</foreach>
</update>
</mapper>
......@@ -1103,4 +1103,15 @@
and (SOCIAL_CREATE_MONTH >= #{infoVo.socialCreateMonth} or PROVIDENT_CREATE_MONTH >= #{infoVo.socialCreateMonth})
</update>
<!-- 更改社保推送结算状态 -->
<update id="updatePushStatus">
update t_payment_info
set PUSH_STATUS = 0
where
ID in
<foreach item="item" index="index" collection="idList" open="(" separator="," close=")">
#{item}
</foreach>
</update>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment