Commit a2f9af11 authored by hongguangwu's avatar hongguangwu

收入推送1

parent ab6b4db5
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 fxj
* @Description 薪资明细对接
* @Date 11:57 2022/8/22
* @Param
* @return
**/
@Data
@Component
@PropertySource("classpath:ekpIncomeConfig.properties")
@ConfigurationProperties(value = "income", ignoreInvalidFields = false)
public class EkpIncomeProperties {
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.EkpIncomeProperties;
import com.yifu.cloud.plus.v1.yifu.ekp.constant.EkpConstants;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpIncomeParam;
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 hgw
* @Date 2022-8-31 12:00:07
* @Description
* @Version 1.0
*/
@Log4j2
@EnableConfigurationProperties(EkpIncomeProperties.class)
public class EkpIncomeUtil {
@Autowired
private EkpIncomeProperties ekpProperties;
public String sendToEKP(EkpIncomeParam 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());
MultiValueMap<String, Object> wholeForm = new LinkedMultiValueMap<>();
wholeForm.add("docSubject", ekpProperties.getDocSubject());
wholeForm.add("docCreator", "{\"LoginName\":\"admin\"}");
wholeForm.add("docStatus", ekpProperties.getDocStatus());
wholeForm.add("fdModelId", ekpProperties.getFdModelId());
wholeForm.add("fdFlowId", ekpProperties.getFdFlowId());
wholeForm.add("formValues", formValues);
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<>(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 hgw
* @Date 2022-8-31 12:02:06
* @Description 收入明细对应参数
* @Version 1.0
*/
@Data
public class EkpIncomeParam implements Serializable {
/**
* 项目编码
**/
private String fd_3adfedf98ccba2;
/**
* 项目名称
**/
private String fd_3adfedf9d2bf1c;
/**
* 单号
**/
private String fd_3adfedfa4410aa;
/**
* 客户编码
**/
private String fd_3adfedfacd65d6;
/**
* 客户名称
**/
private String fd_3adfedfb174068;
/**
* 姓名
**/
private String fd_3adfedfb5a68a2;
/**
* 身份证号
**/
private String fd_3adfedfb8f76d4;
/**
* 手机号
**/
private String fd_3adfedfbd23ab8;
/**
* 银行卡号
**/
private String fd_3adfedfcb17f1e;
/**
* 开户行
**/
private String fd_3adfedfc453cc4;
/**
* 工资月份
**/
private String fd_3adfee063acff0;
/**
* 结算月份
**/
private String fd_3adfee0690737c;
/**
* 是否薪资扣税
**/
private String fd_3adfee01668666;
/**
* 社保优先级
**/
private String fd_3adfedfed8bb28;
/**
* 公积金优先级
**/
private String fd_3adfedff3a7430;
/**
* 是否自有员工
**/
private String fd_3adfee0009d070;
/**
* 年终奖扣税方案
**/
private String fd_3adfee01dea2fa;
/**
* 应发工资
**/
private String fd_3adfee12cb8840;
/**
* 个人代扣
**/
private String fd_3adfee1374ed7a;
/**
* 单位社保
**/
private String fd_3adfee1e2b2f78;
/**
* 个人社保
**/
private String fd_3adfee1e88723e;
/**
* 单位公积金
**/
private String fd_3adfee1ee24680;
/**
* 个人公积金
**/
private String fd_3adfee1f32fa24;
/**
* 个税
**/
private String fd_3adfee1f901c46;
/**
* 企业年金单位
**/
private String fd_3adfee1ff1ca6a;
/**
* 企业年金个人
**/
private String fd_3adfee203f86b2;
/**
* 实发合计
**/
private String fd_3adfee20fe5ba4;
/**
* 应收
**/
private String fd_3adfee21802434;
/**
* 收入结算状态
**/
private String fd_3adfee4ba5ad36;
/**
* 收款状态
**/
private String fd_3adfee4c0c59ee;
/**
* 收入结算单号
**/
private String fd_3adfee5dd14866;
/**
* 收款单号
**/
private String fd_3adfee5e3d1638;
/**
* 代扣费用应支出
**/
private String fd_3adfeeb34ea0ea;
/**
* 代扣费用结算状态
**/
private String fd_3adfeededfb5a6;
/**
* 代扣费用付款状态
**/
private String fd_3adfeed3a20598;
/**
* 代扣费用结算单号
**/
private String fd_3aea30866d0c30;
/**
* 代扣费用付款单号
**/
private String fd_3aea309696d32e;
/**
* 个税应支出
**/
private String fd_3adfeec6db8766;
/**
* 个税结算状态
**/
private String fd_3adfeef8ef38fc;
/**
* 个税付款状态
**/
private String fd_3adfeedd08222c;
/**
* 个税支出结算单号
**/
private String fd_3aeadede4cea84;
/**
* 个税支出付款单号
**/
private String fd_3aeadee1cf1266;
/**
* 实发合计应支出
**/
private String fd_3adfeec730ec44;
/**
* 工资实发结算状态
**/
private String fd_3adfeef9440ab2;
/**
* 实发合计付款状态
**/
private String fd_3adfeedd5f3cb2;
/**
* 实发结算单号
**/
private String fd_3aeadf17522642;
/**
* 实发付款单号
**/
private String fd_3aeadf17b7d03a;
/**
* 企业年金单位应支出
**/
private String fd_3adfeec782070a;
/**
* 企业年金单位应结算状态
**/
private String fd_3adfeef9b9fb3e;
/**
* 企业年金单位付款状态
**/
private String fd_3adfeeddacf6d4;
/**
* 年金单位结算单号
**/
private String fd_3aeadf182ef6a2;
/**
* 年金单位付款单号
**/
private String fd_3aeadf1892fdb2;
/**
* 企业年金个人应支出
**/
private String fd_3adfeec7ccdd1c;
/**
* 企业年金个人结算状态
**/
private String fd_3adfeefa1eba32;
/**
* 企业年金个人付款状态
**/
private String fd_3adfeede08d430;
/**
* 年金个人结算单号
**/
private String fd_3aeadf191c62a0;
/**
* 年金个人付款单号
**/
private String fd_3aeadf1992544c;
/**
* 暂停发
**/
private String fd_3af9d49d165e90;
/**
* 税务主体
**/
private String fd_3afab1895feea2;
}
ekp.url=http://119.96.227.251:8080/api/sys-modeling/appModelRestService/addModel
ekp.fdModelId=181d7633ff8bc797276d0d3a54e80ad6
ekp.fdFlowId=182b40249c1bc940d7226b941c7a4183
ekp.docStatus=20
ekp.LoginName=admin
ekp.docSubject=\u6536\u5165\u660E\u7EC6\u6570\u636E\u63A5\u53E3
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