Commit 5f68f462 authored by Java-刘 彧阳's avatar Java-刘 彧阳

资金方给财务同步消息的SDK

parent 034dec2f
quantgroup-fs-sdk
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<resourceExtensions />
<wildcardResourcePatterns>
<entry name="!?*.java" />
<entry name="!?*.form" />
<entry name="!?*.class" />
<entry name="!?*.groovy" />
<entry name="!?*.scala" />
<entry name="!?*.flex" />
<entry name="!?*.kt" />
<entry name="!?*.clj" />
<entry name="!?*.aj" />
</wildcardResourcePatterns>
<annotationProcessing>
<profile default="true" name="Default" enabled="false">
<processorPath useClasspath="true" />
</profile>
<profile default="false" name="Maven default annotation processors profile" enabled="true">
<sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<processorPath useClasspath="true" />
<module name="quantgroup-fs-sdk" />
</profile>
</annotationProcessing>
<bytecodeTargetLevel>
<module name="quantgroup-fs-sdk" target="1.8" />
</bytecodeTargetLevel>
</component>
</project>
\ No newline at end of file
<component name="CopyrightManager">
<settings default="" />
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="file://$PROJECT_DIR$" charset="UTF-8" />
</component>
</project>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: com.google.code.gson:gson:2.3.1">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/com/google/code/gson/gson/2.3.1/gson-2.3.1.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/com/google/code/gson/gson/2.3.1/gson-2.3.1-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/com/google/code/gson/gson/2.3.1/gson-2.3.1-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: com.rabbitmq:amqp-client:3.6.2">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/com/rabbitmq/amqp-client/3.6.2/amqp-client-3.6.2.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/com/rabbitmq/amqp-client/3.6.2/amqp-client-3.6.2-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/com/rabbitmq/amqp-client/3.6.2/amqp-client-3.6.2-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.apache.commons:commons-pool2:2.4.2">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/apache/commons/commons-pool2/2.4.2/commons-pool2-2.4.2.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/apache/commons/commons-pool2/2.4.2/commons-pool2-2.4.2-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/apache/commons/commons-pool2/2.4.2/commons-pool2-2.4.2-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="EntryPointsManager">
<entry_points version="2.0" />
</component>
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
<option value="$PROJECT_DIR$/pom.xml" />
</list>
</option>
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
<OptionsSetting value="true" id="Add" />
<OptionsSetting value="true" id="Remove" />
<OptionsSetting value="true" id="Checkout" />
<OptionsSetting value="true" id="Update" />
<OptionsSetting value="true" id="Status" />
<OptionsSetting value="true" id="Edit" />
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/classes" />
</component>
<component name="masterDetails">
<states>
<state key="ProjectJDKs.UI">
<settings>
<last-edited>1.8</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
</states>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/quantgroup-fs-sdk.iml" filepath="$PROJECT_DIR$/quantgroup-fs-sdk.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>
\ No newline at end of file
......@@ -19,6 +19,10 @@ public class LoanInfo {
private String fundingCorpName; // 资金方名称
private Long realFundingCorpId; //实际资金方id
private String realFundingCorpName; //实际资金方名称
private Long pushLoanTime; //量化派推送给资金方的时间
private Long userId; //放款的客户的id
......@@ -37,12 +41,8 @@ public class LoanInfo {
private Integer contractTerm; //还款分期总数(共多少期还款)
private List<RepayPlan> repayPlans; //对应的还款计划
private MsgType msgType; //消息类型
private String source;
public Long getLoanId() {
return loanId;
}
......@@ -75,6 +75,22 @@ public class LoanInfo {
this.fundingCorpName = fundingCorpName;
}
public Long getRealFundingCorpId() {
return realFundingCorpId;
}
public void setRealFundingCorpId(Long realFundingCorpId) {
this.realFundingCorpId = realFundingCorpId;
}
public String getRealFundingCorpName() {
return realFundingCorpName;
}
public void setRealFundingCorpName(String realFundingCorpName) {
this.realFundingCorpName = realFundingCorpName;
}
public Long getPushLoanTime() {
return pushLoanTime;
}
......@@ -147,14 +163,6 @@ public class LoanInfo {
this.contractTerm = contractTerm;
}
public List<RepayPlan> getRepayPlans() {
return repayPlans;
}
public void setRepayPlans(List<RepayPlan> repayPlans) {
this.repayPlans = repayPlans;
}
public MsgType getMsgType() {
return msgType;
}
......@@ -162,12 +170,4 @@ public class LoanInfo {
public void setMsgType(MsgType msgType) {
this.msgType = msgType;
}
public String getSource() {
return source;
}
public void setSource(String source) {
this.source = source;
}
}
......@@ -5,12 +5,6 @@ import com.rabbitmq.client.AMQP;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.ConfirmListener;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.net.SocketException;
import java.util.Collections;
import java.util.Enumeration;
/**
* Created by ocean on 2016/7/25.
*/
......@@ -22,7 +16,6 @@ public class LoanInfoSender {
private static final Gson GSON = new Gson();
private String source;
private static final AMQP.BasicProperties PROPERTIES = new AMQP.BasicProperties.Builder().
contentType("text/plain").contentEncoding("utf8").
......@@ -36,34 +29,10 @@ public class LoanInfoSender {
PropertyHolder propertyHolder = new PropertyHolder();
exchangeName = propertyHolder.getProperty("fs.rabbitmq.exchange-name");
channelPool = new ChannelPool(confirmListener);
boolean needBreak = false;
try {
Enumeration<NetworkInterface> enumeration = NetworkInterface.getNetworkInterfaces();
while (enumeration.hasMoreElements()) {
NetworkInterface networkInterface = enumeration.nextElement();
Enumeration<InetAddress> inetAddresses = networkInterface.getInetAddresses();
for (InetAddress inetAddress : Collections.list(inetAddresses)) {
if (inetAddress.isSiteLocalAddress() && inetAddress.getHostAddress() != null && !inetAddress.getHostAddress().startsWith("127")) {
this.source = inetAddress.getHostAddress();
needBreak = true;
break;
}
}
if (needBreak) {
break;
}
}
} catch (SocketException e) {
this.source = "unknown source";
}
if (null == source) {
source = "unknown source";
}
}
/**
* 发送放款信息到MQ
* 发送推送资金方放款相关信息到MQ
* @param message
* @throws Exception
*/
......@@ -71,7 +40,6 @@ public class LoanInfoSender {
if (message == null ) {
return;
}
message.setSource(source);
String messageStr = GSON.toJson(message);
Channel channel = null;
try {
......
package cn.quantgroup.fs;
import java.math.BigDecimal;
/**
* Created by ocean on 2016/7/26.
*/
public class RepayPlan {
private Long repayMentPlanId; //对应还款计划id
private Integer termNo; //当前第几期数
private Long deadLine; //本期还款期限
private BigDecimal principal; //本期应还本金
private BigDecimal interest; //本期应还利息
private BigDecimal serviceFeePerTerm; //(量化派)服务费
private BigDecimal fundingCorpServiceFee; //(资金方)服务费
private BigDecimal requiredRepayment; //应还合计
public Long getRepayMentPlanId() {
return repayMentPlanId;
}
public void setRepayMentPlanId(Long repayMentPlanId) {
this.repayMentPlanId = repayMentPlanId;
}
public Integer getTermNo() {
return termNo;
}
public void setTermNo(Integer termNo) {
this.termNo = termNo;
}
public Long getDeadLine() {
return deadLine;
}
public void setDeadLine(Long deadLine) {
this.deadLine = deadLine;
}
public BigDecimal getPrincipal() {
return principal;
}
public void setPrincipal(BigDecimal principal) {
this.principal = principal;
}
public BigDecimal getInterest() {
return interest;
}
public void setInterest(BigDecimal interest) {
this.interest = interest;
}
public BigDecimal getServiceFeePerTerm() {
return serviceFeePerTerm;
}
public void setServiceFeePerTerm(BigDecimal serviceFeePerTerm) {
this.serviceFeePerTerm = serviceFeePerTerm;
}
public BigDecimal getFundingCorpServiceFee() {
return fundingCorpServiceFee;
}
public void setFundingCorpServiceFee(BigDecimal fundingCorpServiceFee) {
this.fundingCorpServiceFee = fundingCorpServiceFee;
}
public BigDecimal getRequiredRepayment() {
return requiredRepayment;
}
public void setRequiredRepayment(BigDecimal requiredRepayment) {
this.requiredRepayment = requiredRepayment;
}
}
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