فهرست منبع

金融服务获取数据再通过轮询传输到ERP

hejq 8 سال پیش
والد
کامیت
a6bd220df3

+ 101 - 0
src/main/java/com/uas/erp/schedular/financeservice/domain/AccountInfo.java

@@ -0,0 +1,101 @@
+package com.uas.erp.schedular.financeservice.domain;
+
+/**
+ * 财务数据表
+ */
+public class AccountInfo {
+
+    /**
+     * ID
+     */
+    private Long id;
+
+    /**
+     * 企业uu
+     * @return
+     */
+    private Long enuu;
+
+    /**
+     *财务类型情况
+     */
+    private String ai_kind;
+
+
+    /**
+     * 买方名称
+     */
+    private String ai_cuname;
+
+    /**
+     *金额
+     */
+    private String ai_amount;
+
+    /**
+     * 占比
+     */
+    private Double ai_rate;
+
+    /**
+     * 账龄
+     */
+    private Long ai_paydays;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getEnuu() {
+        return enuu;
+    }
+
+    public void setEnuu(Long enuu) {
+        this.enuu = enuu;
+    }
+
+    public String getAi_kind() {
+        return ai_kind;
+    }
+
+    public void setAi_kind(String ai_kind) {
+        this.ai_kind = ai_kind;
+    }
+
+    public String getAi_cuname() {
+        return ai_cuname;
+    }
+
+    public void setAi_cuname(String ai_cuname) {
+        this.ai_cuname = ai_cuname;
+    }
+
+    public String getAi_amount() {
+        return ai_amount;
+    }
+
+    public void setAi_amount(String ai_amount) {
+        this.ai_amount = ai_amount;
+    }
+
+    public Double getAi_rate() {
+        return ai_rate;
+    }
+
+    public void setAi_rate(Double ai_rate) {
+        this.ai_rate = ai_rate;
+    }
+
+    public Long getAi_paydays() {
+        return ai_paydays;
+    }
+
+    public void setAi_paydays(Long ai_paydays) {
+        this.ai_paydays = ai_paydays;
+    }
+
+}

+ 114 - 0
src/main/java/com/uas/erp/schedular/financeservice/domain/AssociateCompanyInfo.java

@@ -0,0 +1,114 @@
+package com.uas.erp.schedular.financeservice.domain;
+
+/**
+ * 关联企业
+ * created by shicr on 2017/12/18
+ **/
+public class AssociateCompanyInfo {
+
+    /**
+     * ID
+     */
+    private Long id;
+
+    /**
+     * 企业uu
+     * @return
+     */
+    private Long enuu;
+
+    /**
+     *关联方企业名称
+     */
+    private String cud_name;
+
+    /**
+     * 关联关系
+     */
+    private String cud_association;
+
+    /**
+     * 法人代表
+     */
+    private String cud_legalperson;
+
+    /**
+     * 法人代表股权(占比%)
+     */
+    private Double cud_ratio;
+
+    /**
+     * 主营业务
+     */
+    private String cud_product;
+
+    /**
+     * 注册资本(万元)
+     */
+    private Double cud_amount;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getCud_name() {
+        return cud_name;
+    }
+
+    public void setCud_name(String cud_name) {
+        this.cud_name = cud_name;
+    }
+
+    public String getCud_association() {
+        return cud_association;
+    }
+
+    public void setCud_association(String cud_association) {
+        this.cud_association = cud_association;
+    }
+
+    public String getCud_legalperson() {
+        return cud_legalperson;
+    }
+
+    public void setCud_legalperson(String cud_legalperson) {
+        this.cud_legalperson = cud_legalperson;
+    }
+
+    public Double getCud_ratio() {
+        return cud_ratio;
+    }
+
+    public void setCud_ratio(Double cud_ratio) {
+        this.cud_ratio = cud_ratio;
+    }
+
+    public String getCud_product() {
+        return cud_product;
+    }
+
+    public void setCud_product(String cud_product) {
+        this.cud_product = cud_product;
+    }
+
+    public Double getCud_amount() {
+        return cud_amount;
+    }
+
+    public void setCud_amount(Double cud_amount) {
+        this.cud_amount = cud_amount;
+    }
+
+    public Long getEnuu() {
+        return enuu;
+    }
+
+    public void setEnuu(Long enuu) {
+        this.enuu = enuu;
+    }
+
+}

+ 62 - 0
src/main/java/com/uas/erp/schedular/financeservice/domain/BusinessConditionInfo.java

@@ -0,0 +1,62 @@
+package com.uas.erp.schedular.financeservice.domain;
+
+
+/**
+ * 情况描述
+ */
+public class BusinessConditionInfo {
+
+    /**
+     * ID
+     */
+    private Long id;
+
+    /**
+     * 企业uu
+     * @return
+     */
+    private Long enuu;
+
+    /**
+     * 经营情况简述
+     */
+    private String bc_bcremark;
+
+    /**
+     *贸易流程简述
+     * @return
+     */
+    private String bc_sweaterprocess;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getEnuu() {
+        return enuu;
+    }
+
+    public void setEnuu(Long enuu) {
+        this.enuu = enuu;
+    }
+
+    public String getBc_bcremark() {
+        return bc_bcremark;
+    }
+
+    public void setBc_bcremark(String bc_bcremark) {
+        this.bc_bcremark = bc_bcremark;
+    }
+
+    public String getBc_sweaterprocess() {
+        return bc_sweaterprocess;
+    }
+
+    public void setBc_sweaterprocess(String bc_sweaterprocess) {
+        this.bc_sweaterprocess = bc_sweaterprocess;
+    }
+}

+ 87 - 0
src/main/java/com/uas/erp/schedular/financeservice/domain/ChangesInstructionInfo.java

@@ -0,0 +1,87 @@
+package com.uas.erp.schedular.financeservice.domain;
+
+
+/**
+ * 变更内容
+ */
+public class ChangesInstructionInfo {
+
+    /**
+     * ID
+     */
+    private Long id;
+
+    /**
+     * 优软账号
+     */
+    private Long enuu;
+
+    /**
+     * 变更科目
+     */
+    private String cd_type;
+
+    /**
+     * 变更时间
+     */
+    private String cs_date;
+
+    /**
+     * 变更前内容
+     */
+    private String cs_before;
+
+    /**
+     * 变更后内容
+     */
+    private String cs_after;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getEnuu() {
+        return enuu;
+    }
+
+    public void setEnuu(Long enuu) {
+        this.enuu = enuu;
+    }
+
+    public String getCd_type() {
+        return cd_type;
+    }
+
+    public void setCd_type(String cd_type) {
+        this.cd_type = cd_type;
+    }
+
+    public String getCs_date() {
+        return cs_date;
+    }
+
+    public void setCs_date(String cs_date) {
+        this.cs_date = cs_date;
+    }
+
+    public String getCs_before() {
+        return cs_before;
+    }
+
+    public void setCs_before(String cs_before) {
+        this.cs_before = cs_before;
+    }
+
+    public String getCs_after() {
+        return cs_after;
+    }
+
+    public void setCs_after(String cs_after) {
+        this.cs_after = cs_after;
+    }
+
+}

+ 445 - 0
src/main/java/com/uas/erp/schedular/financeservice/domain/CustInfo.java

@@ -0,0 +1,445 @@
+package com.uas.erp.schedular.financeservice.domain;
+
+import java.util.List;
+
+/**
+ * Created by hejq on 2017-12-21.
+ */
+public class CustInfo {
+
+    /**
+     * ID
+     */
+    private Long id;
+
+    /**
+     * 公司中文名
+     */
+    private String cu_name;
+
+    /**
+     * 公司英文名
+     */
+    private String cu_engname;
+
+    /**
+     * 公司类型
+     */
+    private String cu_enterptype;
+
+    /**
+     * 成立时间
+     */
+    private String cu_licensedate;
+
+    /**
+     * 证件类型
+     */
+    private String cu_paperstype;
+
+    /**
+     * 证件类型
+     */
+    private String cu_institutype;
+
+    /**
+     * 证件号码
+     */
+    private String cu_paperscode;
+
+    /**
+     * 证件到期日
+     */
+    private String cu_ctfduedate;
+
+    /**
+     * 营业执照号
+     */
+    private String cu_businesscode;
+
+    /**
+     * 国标行业分类
+     */
+    private String cu_nastdinducls;
+
+    /**
+     * 注册资本币种
+     */
+    private String cu_capcurrency;
+
+    /**
+     * 注册资本
+     */
+    private Double cu_regcapital;
+
+    /**
+     * 实缴资本
+     */
+    private Double cu_paidincapital;
+    /**
+     * 公司注册地
+     */
+    private String cu_redaddcode;
+    /**
+     * 办公地址
+     */
+    private String cu_officeaddcode;
+
+    /**
+     * 经营范围
+     */
+    private String cu_businsscope;
+
+    /**
+     * 其他情况说明
+     */
+    private String cu_others;
+
+    /**
+     * 企业uu
+     *
+     * @return
+     */
+    private Long cu_enuu;
+
+    /**
+     * 最高权力机构
+     *
+     * @return
+     */
+    private String cu_highestauthority;
+
+    /**
+     * 员工人数
+     *
+     * @return
+     */
+    private Long cu_employeesum;
+
+    /**
+     * 部门设置概况
+     *
+     * @return
+     */
+    private String cu_departsituation;
+
+    /**
+     * 财务数据表
+     */
+    private List<AccountInfo> accountInfoList;
+
+    /**
+     * 关联企业
+     */
+    private List<AssociateCompanyInfo> associateCompanies;
+
+    /**
+     * 情况描述
+     */
+    private BusinessConditionInfo businessCondition;
+
+    /**
+     * 变更内容
+     */
+    private List<ChangesInstructionInfo> changesInstructions;
+
+    /**
+     * 管理层信息
+     */
+    private List<CustomerExcutiveInfo> customerExcutives;
+
+    /**
+     * 财务情况说明
+     */
+    private List<FinanceConditionInfo> financeConditions;
+
+    /**
+     * 金融服务申请数据
+     */
+    private List<FinancingApply> financingApplies;
+
+    /**
+     * 买方客户资料
+     */
+    private List<PurcCustInfo> mfCustInfos;
+
+    /**
+     * 经营情况表
+     */
+    private List<ProductMixInfo> productMixes;
+
+    /**
+     * 股东信息表
+     */
+    private List<ShareholdersInfo> shareholders;
+
+    /**
+     * 供应商客户
+     */
+    private List<UpdowncastInfo> updowncasts;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getCu_name() {
+        return cu_name;
+    }
+
+    public void setCu_name(String cu_name) {
+        this.cu_name = cu_name;
+    }
+
+    public String getCu_engname() {
+        return cu_engname;
+    }
+
+    public void setCu_engname(String cu_engname) {
+        this.cu_engname = cu_engname;
+    }
+
+    public String getCu_enterptype() {
+        return cu_enterptype;
+    }
+
+    public void setCu_enterptype(String cu_enterptype) {
+        this.cu_enterptype = cu_enterptype;
+    }
+
+    public String getCu_licensedate() {
+        return cu_licensedate;
+    }
+
+    public void setCu_licensedate(String cu_licensedate) {
+        this.cu_licensedate = cu_licensedate;
+    }
+
+    public String getCu_paperstype() {
+        return cu_paperstype;
+    }
+
+    public void setCu_paperstype(String cu_paperstype) {
+        this.cu_paperstype = cu_paperstype;
+    }
+
+    public String getCu_institutype() {
+        return cu_institutype;
+    }
+
+    public void setCu_institutype(String cu_institutype) {
+        this.cu_institutype = cu_institutype;
+    }
+
+    public String getCu_paperscode() {
+        return cu_paperscode;
+    }
+
+    public void setCu_paperscode(String cu_paperscode) {
+        this.cu_paperscode = cu_paperscode;
+    }
+
+    public String getCu_ctfduedate() {
+        return cu_ctfduedate;
+    }
+
+    public void setCu_ctfduedate(String cu_ctfduedate) {
+        this.cu_ctfduedate = cu_ctfduedate;
+    }
+
+    public String getCu_businesscode() {
+        return cu_businesscode;
+    }
+
+    public void setCu_businesscode(String cu_businesscode) {
+        this.cu_businesscode = cu_businesscode;
+    }
+
+    public String getCu_nastdinducls() {
+        return cu_nastdinducls;
+    }
+
+    public void setCu_nastdinducls(String cu_nastdinducls) {
+        this.cu_nastdinducls = cu_nastdinducls;
+    }
+
+    public String getCu_capcurrency() {
+        return cu_capcurrency;
+    }
+
+    public void setCu_capcurrency(String cu_capcurrency) {
+        this.cu_capcurrency = cu_capcurrency;
+    }
+
+    public Double getCu_regcapital() {
+        return cu_regcapital;
+    }
+
+    public void setCu_regcapital(Double cu_regcapital) {
+        this.cu_regcapital = cu_regcapital;
+    }
+
+    public Double getCu_paidincapital() {
+        return cu_paidincapital;
+    }
+
+    public void setCu_paidincapital(Double cu_paidincapital) {
+        this.cu_paidincapital = cu_paidincapital;
+    }
+
+    public String getCu_redaddcode() {
+        return cu_redaddcode;
+    }
+
+    public void setCu_redaddcode(String cu_redaddcode) {
+        this.cu_redaddcode = cu_redaddcode;
+    }
+
+    public String getCu_officeaddcode() {
+        return cu_officeaddcode;
+    }
+
+    public void setCu_officeaddcode(String cu_officeaddcode) {
+        this.cu_officeaddcode = cu_officeaddcode;
+    }
+
+    public String getCu_businsscope() {
+        return cu_businsscope;
+    }
+
+    public void setCu_businsscope(String cu_businsscope) {
+        this.cu_businsscope = cu_businsscope;
+    }
+
+    public String getCu_others() {
+        return cu_others;
+    }
+
+    public void setCu_others(String cu_others) {
+        this.cu_others = cu_others;
+    }
+
+    public Long getCu_enuu() {
+        return cu_enuu;
+    }
+
+    public void setCu_enuu(Long cu_enuu) {
+        this.cu_enuu = cu_enuu;
+    }
+
+    public String getCu_highestauthority() {
+        return cu_highestauthority;
+    }
+
+    public void setCu_highestauthority(String cu_highestauthority) {
+        this.cu_highestauthority = cu_highestauthority;
+    }
+
+    public Long getCu_employeesum() {
+        return cu_employeesum;
+    }
+
+    public void setCu_employeesum(Long cu_employeesum) {
+        this.cu_employeesum = cu_employeesum;
+    }
+
+    public String getCu_departsituation() {
+        return cu_departsituation;
+    }
+
+    public void setCu_departsituation(String cu_departsituation) {
+        this.cu_departsituation = cu_departsituation;
+    }
+
+    public List<AccountInfo> getAccountInfoList() {
+        return accountInfoList;
+    }
+
+    public void setAccountInfoList(List<AccountInfo> accountInfoList) {
+        this.accountInfoList = accountInfoList;
+    }
+
+    public List<AssociateCompanyInfo> getAssociateCompanies() {
+        return associateCompanies;
+    }
+
+    public void setAssociateCompanies(List<AssociateCompanyInfo> associateCompanies) {
+        this.associateCompanies = associateCompanies;
+    }
+
+    public BusinessConditionInfo getBusinessCondition() {
+        return businessCondition;
+    }
+
+    public void setBusinessCondition(BusinessConditionInfo businessCondition) {
+        this.businessCondition = businessCondition;
+    }
+
+    public List<ChangesInstructionInfo> getChangesInstructions() {
+        return changesInstructions;
+    }
+
+    public void setChangesInstructions(List<ChangesInstructionInfo> changesInstructions) {
+        this.changesInstructions = changesInstructions;
+    }
+
+    public List<CustomerExcutiveInfo> getCustomerExcutives() {
+        return customerExcutives;
+    }
+
+    public void setCustomerExcutives(List<CustomerExcutiveInfo> customerExcutives) {
+        this.customerExcutives = customerExcutives;
+    }
+
+    public List<FinanceConditionInfo> getFinanceConditions() {
+        return financeConditions;
+    }
+
+    public void setFinanceConditions(List<FinanceConditionInfo> financeConditions) {
+        this.financeConditions = financeConditions;
+    }
+
+    public List<FinancingApply> getFinancingApplies() {
+        return financingApplies;
+    }
+
+    public void setFinancingApplies(List<FinancingApply> financingApplies) {
+        this.financingApplies = financingApplies;
+    }
+
+    public List<PurcCustInfo> getMfCustInfos() {
+        return mfCustInfos;
+    }
+
+    public void setMfCustInfos(List<PurcCustInfo> mfCustInfos) {
+        this.mfCustInfos = mfCustInfos;
+    }
+
+    public List<ProductMixInfo> getProductMixes() {
+        return productMixes;
+    }
+
+    public void setProductMixes(List<ProductMixInfo> productMixes) {
+        this.productMixes = productMixes;
+    }
+
+    public List<ShareholdersInfo> getShareholders() {
+        return shareholders;
+    }
+
+    public void setShareholders(List<ShareholdersInfo> shareholders) {
+        this.shareholders = shareholders;
+    }
+
+    public List<UpdowncastInfo> getUpdowncasts() {
+        return updowncasts;
+    }
+
+    public void setUpdowncasts(List<UpdowncastInfo> updowncasts) {
+        this.updowncasts = updowncasts;
+    }
+
+}

+ 168 - 0
src/main/java/com/uas/erp/schedular/financeservice/domain/CustomerExcutiveInfo.java

@@ -0,0 +1,168 @@
+package com.uas.erp.schedular.financeservice.domain;
+
+/**
+ * 管理层信息
+ */
+public class CustomerExcutiveInfo {
+
+    /**
+     * ID
+     */
+    private Long id;
+
+    /**
+     * 企业uu
+     * @return
+     */
+    private Long enuu;
+
+    /**
+     * 高管姓名
+     */
+    private String ce_name;
+
+    /**
+     *性别
+     */
+    private String ce_sex;
+
+    /**
+     *证件类型
+     */
+    private String ce_paperstype;
+
+    /**
+     *证件号码
+     */
+    private String ce_paperscode;
+
+
+    /**
+     *学历
+     */
+    private String ce_education;
+
+    /**
+     * 职务
+     */
+    private String ce_position;
+
+    /**
+     *担任该职务时间
+     */
+    private String ce_stwkfpo;
+
+    /**
+     * 从事本行业时间
+     */
+    private short ce_workeyears;
+
+    /**
+     *住所
+     */
+    private String ce_nowaddress;
+
+    /**
+     *工作简介
+     */
+    private String ce_woekexper;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getEnuu() {
+        return enuu;
+    }
+
+    public void setEnuu(Long enuu) {
+        this.enuu = enuu;
+    }
+
+    public String getCe_name() {
+        return ce_name;
+    }
+
+    public void setCe_name(String ce_name) {
+        this.ce_name = ce_name;
+    }
+
+    public String getCe_sex() {
+        return ce_sex;
+    }
+
+    public void setCe_sex(String ce_sex) {
+        this.ce_sex = ce_sex;
+    }
+
+    public String getCe_paperstype() {
+        return ce_paperstype;
+    }
+
+    public void setCe_paperstype(String ce_paperstype) {
+        this.ce_paperstype = ce_paperstype;
+    }
+
+    public String getCe_paperscode() {
+        return ce_paperscode;
+    }
+
+    public void setCe_paperscode(String ce_paperscode) {
+        this.ce_paperscode = ce_paperscode;
+    }
+
+    public String getCe_education() {
+        return ce_education;
+    }
+
+    public void setCe_education(String ce_education) {
+        this.ce_education = ce_education;
+    }
+
+    public String getCe_position() {
+        return ce_position;
+    }
+
+    public void setCe_position(String ce_position) {
+        this.ce_position = ce_position;
+    }
+
+    public String getCe_stwkfpo() {
+        return ce_stwkfpo;
+    }
+
+    public void setCe_stwkfpo(String ce_stwkfpo) {
+        this.ce_stwkfpo = ce_stwkfpo;
+    }
+
+    public short getCe_workeyears() {
+        return ce_workeyears;
+    }
+
+    public void setCe_workeyears(short ce_workeyears) {
+        this.ce_workeyears = ce_workeyears;
+    }
+
+    public String getCe_nowaddress() {
+        return ce_nowaddress;
+    }
+
+    public void setCe_nowaddress(String ce_nowaddress) {
+        this.ce_nowaddress = ce_nowaddress;
+    }
+
+    public String getCe_woekexper() {
+        return ce_woekexper;
+    }
+
+    public void setCe_woekexper(String ce_woekexper) {
+        this.ce_woekexper = ce_woekexper;
+    }
+
+}
+
+

+ 323 - 0
src/main/java/com/uas/erp/schedular/financeservice/domain/CustomerInfo.java

@@ -0,0 +1,323 @@
+package com.uas.erp.schedular.financeservice.domain;
+
+/**
+ * Created by hejq on 2017-12-22.
+ */
+public class CustomerInfo {
+
+    /**
+     * ID
+     */
+    private Long id;
+
+    /**
+     * 公司中文名
+     */
+    private String cu_name;
+
+    /**
+     * 公司英文名
+     */
+    private String cu_engname;
+
+    /**
+     * 公司类型
+     */
+    private String cu_enterptype;
+
+    /**
+     * 成立时间
+     */
+    private String cu_licensedate;
+
+    /**
+     * 证件类型
+     */
+    private String cu_paperstype;
+
+    /**
+     * 证件类型
+     */
+    private String cu_institutype;
+
+    /**
+     * 证件号码
+     */
+    private String cu_paperscode;
+
+    /**
+     * 证件到期日
+     */
+    private String cu_ctfduedate;
+
+    /**
+     * 营业执照号
+     */
+    private String cu_businesscode;
+
+    /**
+     * 国标行业分类
+     */
+    private String cu_nastdinducls;
+
+    /**
+     * 注册资本币种
+     */
+    private String cu_capcurrency;
+
+    /**
+     * 注册资本
+     */
+    private Double cu_regcapital;
+
+    /**
+     * 实缴资本
+     */
+    private Double cu_paidincapital;
+    /**
+     * 公司注册地
+     */
+    private String cu_redaddcode;
+    /**
+     * 办公地址
+     */
+    private String cu_officeaddcode;
+
+    /**
+     * 经营范围
+     */
+    private String cu_businsscope;
+
+    /**
+     * 其他情况说明
+     */
+    private String cu_others;
+
+    /**
+     * 企业uu
+     *
+     * @return
+     */
+    private Long cu_enuu;
+
+    /**
+     * 最高权力机构
+     *
+     * @return
+     */
+    private String cu_highestauthority;
+
+    /**
+     * 员工人数
+     *
+     * @return
+     */
+    private Long cu_employeesum;
+
+    /**
+     * 部门设置概况
+     *
+     * @return
+     */
+    private String cu_departsituation;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getCu_name() {
+        return cu_name;
+    }
+
+    public void setCu_name(String cu_name) {
+        this.cu_name = cu_name;
+    }
+
+    public String getCu_engname() {
+        return cu_engname;
+    }
+
+    public void setCu_engname(String cu_engname) {
+        this.cu_engname = cu_engname;
+    }
+
+    public String getCu_enterptype() {
+        return cu_enterptype;
+    }
+
+    public void setCu_enterptype(String cu_enterptype) {
+        this.cu_enterptype = cu_enterptype;
+    }
+
+    public String getCu_licensedate() {
+        return cu_licensedate;
+    }
+
+    public void setCu_licensedate(String cu_licensedate) {
+        this.cu_licensedate = cu_licensedate;
+    }
+
+    public String getCu_paperstype() {
+        return cu_paperstype;
+    }
+
+    public void setCu_paperstype(String cu_paperstype) {
+        this.cu_paperstype = cu_paperstype;
+    }
+
+    public String getCu_institutype() {
+        return cu_institutype;
+    }
+
+    public void setCu_institutype(String cu_institutype) {
+        this.cu_institutype = cu_institutype;
+    }
+
+    public String getCu_paperscode() {
+        return cu_paperscode;
+    }
+
+    public void setCu_paperscode(String cu_paperscode) {
+        this.cu_paperscode = cu_paperscode;
+    }
+
+    public String getCu_ctfduedate() {
+        return cu_ctfduedate;
+    }
+
+    public void setCu_ctfduedate(String cu_ctfduedate) {
+        this.cu_ctfduedate = cu_ctfduedate;
+    }
+
+    public String getCu_businesscode() {
+        return cu_businesscode;
+    }
+
+    public void setCu_businesscode(String cu_businesscode) {
+        this.cu_businesscode = cu_businesscode;
+    }
+
+    public String getCu_nastdinducls() {
+        return cu_nastdinducls;
+    }
+
+    public void setCu_nastdinducls(String cu_nastdinducls) {
+        this.cu_nastdinducls = cu_nastdinducls;
+    }
+
+    public String getCu_capcurrency() {
+        return cu_capcurrency;
+    }
+
+    public void setCu_capcurrency(String cu_capcurrency) {
+        this.cu_capcurrency = cu_capcurrency;
+    }
+
+    public Double getCu_regcapital() {
+        return cu_regcapital;
+    }
+
+    public void setCu_regcapital(Double cu_regcapital) {
+        this.cu_regcapital = cu_regcapital;
+    }
+
+    public Double getCu_paidincapital() {
+        return cu_paidincapital;
+    }
+
+    public void setCu_paidincapital(Double cu_paidincapital) {
+        this.cu_paidincapital = cu_paidincapital;
+    }
+
+    public String getCu_redaddcode() {
+        return cu_redaddcode;
+    }
+
+    public void setCu_redaddcode(String cu_redaddcode) {
+        this.cu_redaddcode = cu_redaddcode;
+    }
+
+    public String getCu_officeaddcode() {
+        return cu_officeaddcode;
+    }
+
+    public void setCu_officeaddcode(String cu_officeaddcode) {
+        this.cu_officeaddcode = cu_officeaddcode;
+    }
+
+    public String getCu_businsscope() {
+        return cu_businsscope;
+    }
+
+    public void setCu_businsscope(String cu_businsscope) {
+        this.cu_businsscope = cu_businsscope;
+    }
+
+    public String getCu_others() {
+        return cu_others;
+    }
+
+    public void setCu_others(String cu_others) {
+        this.cu_others = cu_others;
+    }
+
+    public Long getCu_enuu() {
+        return cu_enuu;
+    }
+
+    public void setCu_enuu(Long cu_enuu) {
+        this.cu_enuu = cu_enuu;
+    }
+
+    public String getCu_highestauthority() {
+        return cu_highestauthority;
+    }
+
+    public void setCu_highestauthority(String cu_highestauthority) {
+        this.cu_highestauthority = cu_highestauthority;
+    }
+
+    public Long getCu_employeesum() {
+        return cu_employeesum;
+    }
+
+    public void setCu_employeesum(Long cu_employeesum) {
+        this.cu_employeesum = cu_employeesum;
+    }
+
+    public String getCu_departsituation() {
+        return cu_departsituation;
+    }
+
+    public void setCu_departsituation(String cu_departsituation) {
+        this.cu_departsituation = cu_departsituation;
+    }
+
+    public CustomerInfo(CustInfo info) {
+        this.cu_businesscode = info.getCu_businesscode();
+        this.cu_businsscope = info.getCu_businsscope();
+        this.cu_capcurrency = info.getCu_capcurrency();
+        this.cu_ctfduedate = info.getCu_ctfduedate();
+        this.cu_departsituation = info.getCu_departsituation();
+        this.cu_employeesum = info.getCu_employeesum();
+        this.cu_engname = info.getCu_engname();
+        this.cu_enterptype = info.getCu_enterptype();
+        this.cu_highestauthority = info.getCu_highestauthority();
+        this.cu_institutype = info.getCu_institutype();
+        this.cu_licensedate = info.getCu_licensedate();
+        this.cu_name = info.getCu_name();
+        this.cu_nastdinducls = info.getCu_nastdinducls();
+        this.cu_officeaddcode = info.getCu_officeaddcode();
+        this.cu_others = info.getCu_others();
+        this.cu_paidincapital = info.getCu_paidincapital();
+        this.cu_enuu = info.getCu_enuu();
+        this.id = info.getId();
+    }
+
+    public CustomerInfo() {
+    }
+}

+ 100 - 0
src/main/java/com/uas/erp/schedular/financeservice/domain/FinanceConditionInfo.java

@@ -0,0 +1,100 @@
+package com.uas.erp.schedular.financeservice.domain;
+
+/**
+ * 财务情况说明
+ */
+public class FinanceConditionInfo {
+
+    /**
+     * ID
+     */
+    private Long id;
+
+    /**
+     * 企业uu
+     * @return
+     */
+    private Long enuu;
+
+    /**
+     *账龄<=3个月
+     */
+    private Double fc_agingamount1;
+
+    /**
+     * 3个月<帐龄≤6个月
+     */
+    private Double fc_agingamount2;
+
+    /**
+     * 6个月<帐龄<=1年
+     */
+    private Double fc_agingamount4;
+
+    /**
+     * 帐龄>1年
+     */
+    private Double fc_agingamount3;
+
+    /**
+     * 其他应收账款说明
+     */
+    private String fc_otharremark;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getEnuu() {
+        return enuu;
+    }
+
+    public void setEnuu(Long enuu) {
+        this.enuu = enuu;
+    }
+
+    public Double getFc_agingamount1() {
+        return fc_agingamount1;
+    }
+
+    public void setFc_agingamount1(Double fc_agingamount1) {
+        this.fc_agingamount1 = fc_agingamount1;
+    }
+
+    public Double getFc_agingamount2() {
+        return fc_agingamount2;
+    }
+
+    public void setFc_agingamount2(Double fc_agingamount2) {
+        this.fc_agingamount2 = fc_agingamount2;
+    }
+
+    public Double getFc_agingamount4() {
+        return fc_agingamount4;
+    }
+
+    public void setFc_agingamount4(Double fc_agingamount4) {
+        this.fc_agingamount4 = fc_agingamount4;
+    }
+
+    public Double getFc_agingamount3() {
+        return fc_agingamount3;
+    }
+
+    public void setFc_agingamount3(Double fc_agingamount3) {
+        this.fc_agingamount3 = fc_agingamount3;
+    }
+
+    public String getFc_otharremark() {
+        return fc_otharremark;
+    }
+
+    public void setFc_otharremark(String fc_otharremark) {
+        this.fc_otharremark = fc_otharremark;
+    }
+
+}

+ 167 - 0
src/main/java/com/uas/erp/schedular/financeservice/domain/FinancingApply.java

@@ -0,0 +1,167 @@
+package com.uas.erp.schedular.financeservice.domain;
+
+/**
+ * 金融服务申请数据
+ * 
+ * @author hejq
+ * @time 创建时间:2017年11月24日
+ */
+public class FinancingApply {
+
+	/**
+	 * ID
+	 */
+	private Long id;
+
+	/**
+	 * 企业uu
+	 * @return
+	 */
+	private Long enuu;
+
+	/**
+	 * 联系人
+	 */
+	private String fa_contact;
+
+	/**
+	 * 联系方式1
+	 */
+	private String fa_telphone;
+	
+	/**
+	 * 联系方式2
+	 */
+	private String fa_phone;
+	
+	/**
+	 * 申请金额
+	 */
+	private Long fa_appamount;
+	
+	/**
+	 * 申请人
+	 */
+	private String fa_applyman;
+	
+	/**
+	 * 申请日期
+	 */
+	private String fa_applydate;
+	
+	/**
+	 * 申请得分
+	 */
+	private Double fa_score;
+	
+	/**
+	 * 融资申请单号
+	 */
+	private String fa_busincode;
+	
+	/**
+	 * 保理公司名称
+	 */
+	private String fa_facorpname;
+	
+	/**
+	 * 保理公司
+	 */
+	private String fa_facorpcode;
+
+	public Long getId() {
+		return id;
+	}
+
+	public void setId(Long id) {
+		this.id = id;
+	}
+
+	public Long getEnuu() {
+		return enuu;
+	}
+
+	public void setEnuu(Long enuu) {
+		this.enuu = enuu;
+	}
+
+	public String getFa_contact() {
+		return fa_contact;
+	}
+
+	public void setFa_contact(String fa_contact) {
+		this.fa_contact = fa_contact;
+	}
+
+	public String getFa_telphone() {
+		return fa_telphone;
+	}
+
+	public void setFa_telphone(String fa_telphone) {
+		this.fa_telphone = fa_telphone;
+	}
+
+	public String getFa_phone() {
+		return fa_phone;
+	}
+
+	public void setFa_phone(String fa_phone) {
+		this.fa_phone = fa_phone;
+	}
+
+	public Long getFa_appamount() {
+		return fa_appamount;
+	}
+
+	public void setFa_appamount(Long fa_appamount) {
+		this.fa_appamount = fa_appamount;
+	}
+
+	public String getFa_applyman() {
+		return fa_applyman;
+	}
+
+	public void setFa_applyman(String fa_applyman) {
+		this.fa_applyman = fa_applyman;
+	}
+
+	public String getFa_applydate() {
+		return fa_applydate;
+	}
+
+	public void setFa_applydate(String fa_applydate) {
+		this.fa_applydate = fa_applydate;
+	}
+
+	public Double getFa_score() {
+		return fa_score;
+	}
+
+	public void setFa_score(Double fa_score) {
+		this.fa_score = fa_score;
+	}
+
+	public String getFa_busincode() {
+		return fa_busincode;
+	}
+
+	public void setFa_busincode(String fa_busincode) {
+		this.fa_busincode = fa_busincode;
+	}
+
+	public String getFa_facorpname() {
+		return fa_facorpname;
+	}
+
+	public void setFa_facorpname(String fa_facorpname) {
+		this.fa_facorpname = fa_facorpname;
+	}
+
+	public String getFa_facorpcode() {
+		return fa_facorpcode;
+	}
+
+	public void setFa_facorpcode(String fa_facorpcode) {
+		this.fa_facorpcode = fa_facorpcode;
+	}
+}

+ 101 - 0
src/main/java/com/uas/erp/schedular/financeservice/domain/ProductMixInfo.java

@@ -0,0 +1,101 @@
+package com.uas.erp.schedular.financeservice.domain;
+
+
+/**
+ * 经营情况表
+ */
+public class ProductMixInfo {
+
+    /**
+     * ID
+     */
+    private Long id;
+
+    /**
+     * 企业UU
+     * @return
+     */
+    private Long enuu;
+
+    /**
+     *产品/服务种类
+     */
+    private String pm_kind;
+
+    /**
+     *今年营业收入
+     */
+    private Double pm_tannualrevenue;
+
+    /**
+     * 占今年总收入比例
+     */
+    private Double pm_tratio;
+
+    /**
+     * 上年营业收入
+     */
+    private Double pm_annualrevenue;
+
+    /**
+     * 占总收入比例
+     */
+    private Double pm_ratio;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getEnuu() {
+        return enuu;
+    }
+
+    public void setEnuu(Long enuu) {
+        this.enuu = enuu;
+    }
+
+    public String getPm_kind() {
+        return pm_kind;
+    }
+
+    public void setPm_kind(String pm_kind) {
+        this.pm_kind = pm_kind;
+    }
+
+    public Double getPm_tannualrevenue() {
+        return pm_tannualrevenue;
+    }
+
+    public void setPm_tannualrevenue(Double pm_tannualrevenue) {
+        this.pm_tannualrevenue = pm_tannualrevenue;
+    }
+
+    public Double getPm_tratio() {
+        return pm_tratio;
+    }
+
+    public void setPm_tratio(Double pm_tratio) {
+        this.pm_tratio = pm_tratio;
+    }
+
+    public Double getPm_annualrevenue() {
+        return pm_annualrevenue;
+    }
+
+    public void setPm_annualrevenue(Double pm_annualrevenue) {
+        this.pm_annualrevenue = pm_annualrevenue;
+    }
+
+    public Double getPm_ratio() {
+        return pm_ratio;
+    }
+
+    public void setPm_ratio(Double pm_ratio) {
+        this.pm_ratio = pm_ratio;
+    }
+
+}

+ 246 - 0
src/main/java/com/uas/erp/schedular/financeservice/domain/PurcCustInfo.java

@@ -0,0 +1,246 @@
+package com.uas.erp.schedular.financeservice.domain;
+
+
+/**
+ * 买方客户资料
+ */
+public class PurcCustInfo {
+
+    /**
+     * ID
+     */
+    private Long id;
+
+    /**
+     * 企业uu
+     * @return
+     */
+    private Long enuu;
+
+    /**
+     * 买方名称
+     */
+    private String mf_custname;
+
+    /**
+     * 额度申请
+     */
+    private Double mf_credit;
+
+    /**
+     * 法人代表
+     */
+    private String mf_legrep;
+
+
+    /**
+     * 注册资本(万元)
+     */
+    private Double mf_regcapital;
+
+    /**
+     * 经营地址
+     */
+    private String mf_addr;
+
+    /**
+     * 成立时间
+     */
+    private String mf_estabtime;
+
+    /**
+     *联系人
+     */
+    private String mf_contact;
+
+    /**
+     *联系电话
+     */
+    private String mf_contactnum;
+
+    /**
+     *传真
+     */
+    private String mf_fax;
+
+
+    /**
+     * 电子邮箱
+     */
+    private String mf_email;
+
+    /**
+     * 结算开户行
+     */
+    private String mf_balancebank;
+
+    /**
+     * 银行账户
+     */
+    private String mf_bankaccount;
+
+    /**
+     * 交易产品
+     */
+    private String mf_tradprod;
+
+    /**
+     * 付款条件
+     */
+    private String mf_payterm;
+
+    /**
+     * 股东占比(%)
+     */
+    private Double mf_shareholder;
+
+    /**
+     * 经营范围
+     */
+    private String mf_businsscope;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getEnuu() {
+        return enuu;
+    }
+
+    public void setEnuu(Long enuu) {
+        this.enuu = enuu;
+    }
+
+    public String getMf_custname() {
+        return mf_custname;
+    }
+
+    public void setMf_custname(String mf_custname) {
+        this.mf_custname = mf_custname;
+    }
+
+    public Double getMf_credit() {
+        return mf_credit;
+    }
+
+    public void setMf_credit(Double mf_credit) {
+        this.mf_credit = mf_credit;
+    }
+
+    public String getMf_legrep() {
+        return mf_legrep;
+    }
+
+    public void setMf_legrep(String mf_legrep) {
+        this.mf_legrep = mf_legrep;
+    }
+
+    public Double getMf_regcapital() {
+        return mf_regcapital;
+    }
+
+    public void setMf_regcapital(Double mf_regcapital) {
+        this.mf_regcapital = mf_regcapital;
+    }
+
+    public String getMf_addr() {
+        return mf_addr;
+    }
+
+    public void setMf_addr(String mf_addr) {
+        this.mf_addr = mf_addr;
+    }
+
+    public String getMf_estabtime() {
+        return mf_estabtime;
+    }
+
+    public void setMf_estabtime(String mf_estabtime) {
+        this.mf_estabtime = mf_estabtime;
+    }
+
+    public String getMf_contact() {
+        return mf_contact;
+    }
+
+    public void setMf_contact(String mf_contact) {
+        this.mf_contact = mf_contact;
+    }
+
+    public String getMf_contactnum() {
+        return mf_contactnum;
+    }
+
+    public void setMf_contactnum(String mf_contactnum) {
+        this.mf_contactnum = mf_contactnum;
+    }
+
+    public String getMf_fax() {
+        return mf_fax;
+    }
+
+    public void setMf_fax(String mf_fax) {
+        this.mf_fax = mf_fax;
+    }
+
+    public String getMf_email() {
+        return mf_email;
+    }
+
+    public void setMf_email(String mf_email) {
+        this.mf_email = mf_email;
+    }
+
+    public String getMf_balancebank() {
+        return mf_balancebank;
+    }
+
+    public void setMf_balancebank(String mf_balancebank) {
+        this.mf_balancebank = mf_balancebank;
+    }
+
+    public String getMf_bankaccount() {
+        return mf_bankaccount;
+    }
+
+    public void setMf_bankaccount(String mf_bankaccount) {
+        this.mf_bankaccount = mf_bankaccount;
+    }
+
+    public String getMf_tradprod() {
+        return mf_tradprod;
+    }
+
+    public void setMf_tradprod(String mf_tradprod) {
+        this.mf_tradprod = mf_tradprod;
+    }
+
+    public String getMf_payterm() {
+        return mf_payterm;
+    }
+
+    public void setMf_payterm(String mf_payterm) {
+        this.mf_payterm = mf_payterm;
+    }
+
+    public Double getMf_shareholder() {
+        return mf_shareholder;
+    }
+
+    public void setMf_shareholder(Double mf_shareholder) {
+        this.mf_shareholder = mf_shareholder;
+    }
+
+    public String getMf_businsscope() {
+        return mf_businsscope;
+    }
+
+    public void setMf_businsscope(String mf_businsscope) {
+        this.mf_businsscope = mf_businsscope;
+    }
+
+}

+ 101 - 0
src/main/java/com/uas/erp/schedular/financeservice/domain/ShareholdersInfo.java

@@ -0,0 +1,101 @@
+package com.uas.erp.schedular.financeservice.domain;
+
+
+/**
+ * 股东信息表
+ */
+public class ShareholdersInfo {
+
+    /**
+     * ID
+     */
+    private Long id;
+
+    /**
+     * 股东名称
+     */
+    private String cs_name;
+
+    /**
+     * 证件类型
+     */
+    private String cs_paperstype;
+
+    /**
+     * 证件号码
+     */
+    private String cs_paperscode;
+
+    /**
+     * 出资比例(%)
+     */
+    private Double cs_investratio;
+
+    /**
+     *实际投资金额
+     */
+    private Double cs_investamount;
+
+    /**
+     * 企业UU
+     * @return
+     */
+    private Long enuu;
+
+    public String getCs_name() {
+        return cs_name;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public void setCs_name(String cs_name) {
+        this.cs_name = cs_name;
+    }
+
+    public String getCs_paperstype() {
+        return cs_paperstype;
+    }
+
+    public void setCs_paperstype(String cs_paperstype) {
+        this.cs_paperstype = cs_paperstype;
+    }
+
+    public String getCs_paperscode() {
+        return cs_paperscode;
+    }
+
+    public void setCs_paperscode(String cs_paperscode) {
+        this.cs_paperscode = cs_paperscode;
+    }
+
+    public Double getCs_investratio() {
+        return cs_investratio;
+    }
+
+    public void setCs_investratio(Double cs_investratio) {
+        this.cs_investratio = cs_investratio;
+    }
+
+    public Double getCs_investamount() {
+        return cs_investamount;
+    }
+
+    public void setCs_investamount(Double cs_investamount) {
+        this.cs_investamount = cs_investamount;
+    }
+
+    public Long getEnuu() {
+        return enuu;
+    }
+
+    public void setEnuu(Long enuu) {
+        this.enuu = enuu;
+    }
+
+}

+ 114 - 0
src/main/java/com/uas/erp/schedular/financeservice/domain/UpdowncastInfo.java

@@ -0,0 +1,114 @@
+package com.uas.erp.schedular.financeservice.domain;
+
+/**
+ * 供应商客户
+ *
+ **/
+public class UpdowncastInfo {
+
+    /**
+     * ID
+     */
+    private Long id;
+
+    /**
+     * 名称
+     */
+    private String udc_name;
+
+    /**
+     * 企业uu
+     * @return
+     */
+    private Long enuu;
+
+    /**
+     * 产品
+     */
+    private String udc_product;
+
+    /**
+     * 上年交易额
+     */
+    private Double udc_lastyear;
+
+    /**
+     * 今年交易额
+     */
+    private Double udc_thisyear;
+
+    /**
+     * 结账方式及日期
+     */
+    private String udc_payment;
+
+    /**
+     * 合作年限
+     */
+    private Short udc_cooperationyears;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getEnuu() {
+        return enuu;
+    }
+
+    public void setEnuu(Long enuu) {
+        this.enuu = enuu;
+    }
+
+    public String getUdc_name() {
+        return udc_name;
+    }
+
+    public void setUdc_name(String udc_name) {
+        this.udc_name = udc_name;
+    }
+
+    public String getUdc_product() {
+        return udc_product;
+    }
+
+    public void setUdc_product(String udc_product) {
+        this.udc_product = udc_product;
+    }
+
+    public Double getUdc_lastyear() {
+        return udc_lastyear;
+    }
+
+    public void setUdc_lastyear(Double udc_lastyear) {
+        this.udc_lastyear = udc_lastyear;
+    }
+
+    public Double getUdc_thisyear() {
+        return udc_thisyear;
+    }
+
+    public void setUdc_thisyear(Double udc_thisyear) {
+        this.udc_thisyear = udc_thisyear;
+    }
+
+    public String getUdc_payment() {
+        return udc_payment;
+    }
+
+    public void setUdc_payment(String udc_payment) {
+        this.udc_payment = udc_payment;
+    }
+
+    public Short getUdc_cooperationyears() {
+        return udc_cooperationyears;
+    }
+
+    public void setUdc_cooperationyears(Short udc_cooperationyears) {
+        this.udc_cooperationyears = udc_cooperationyears;
+    }
+
+}

+ 330 - 0
src/main/java/com/uas/erp/schedular/financeservice/task/AbstractTask.java

@@ -0,0 +1,330 @@
+package com.uas.erp.schedular.financeservice.task;
+
+import com.alibaba.fastjson.JSON;
+import com.uas.erp.schedular.agent.v1.AbstractAgent;
+import com.uas.erp.schedular.b2b.domain.Attach;
+import com.uas.erp.schedular.b2b.domain.KeyEntity;
+import com.uas.erp.schedular.b2b.domain.Prod;
+import com.uas.erp.schedular.core.Constant;
+import com.uas.erp.schedular.database.RestJdbcTemplate;
+import com.uas.erp.schedular.entity.Master;
+import com.uas.erp.schedular.service.SettingService;
+import com.uas.erp.schedular.util.CollectionUtil;
+import com.uas.erp.schedular.util.ContextHolder;
+import com.uas.erp.schedular.util.DateUtil;
+import com.uas.erp.schedular.util.HmacUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.util.CollectionUtils;
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
+import org.springframework.util.StringUtils;
+import org.springframework.web.client.RestTemplate;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URI;
+import java.net.URLEncoder;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * Created by Pro1 on 2017/7/26.
+ */
+public class AbstractTask extends AbstractAgent {
+
+    // 数据传输单次大小限制
+    protected static final int DATA_SIZE_LIMIT = 500;
+
+    @Autowired
+    private RestTemplate restTemplate;
+
+    @Autowired
+    protected RestJdbcTemplate jdbcTemplate;
+
+    @Autowired
+    protected SettingService settingService;
+
+    protected Logger logger = LoggerFactory.getLogger(this.getClass());
+
+    /**
+     * 按账套环境,使用不同接口地址
+     * @return
+     */
+    private String getApiDomain() {
+//        String key = "test".equals(ContextHolder.getMaster().getMa_env()) ? "api.finance.service.test.url" : "api.finance.service.url";
+//        return settingService.getValue(key);
+        return "http://localhost:8001";
+    }
+
+    /**
+     * UAS系统外网地址
+     * @return
+     */
+    private String getUASUrl() {
+        return settingService.getValue("api.uas.outer.url");
+    }
+
+    /**
+     * URI加身份签名
+     * @param url
+     * @param vars
+     * @return
+     */
+    private String getURI(String url, Object... vars) {
+        Master master = ContextHolder.getMaster();
+        master = new Master();
+        master.setMa_user("UAS");
+        master.setMa_uu(10041166L);
+        master.setMa_accesssecret("2c1ea0898633796fe050007f01002ea6");
+        master.setMa_env("test");
+        if (null == master.getMa_uu() || StringUtils.isEmpty(master.getMa_accesssecret())) {
+            throw new RuntimeException("未设置企业UU和私钥");
+        }
+        StringBuffer accessUrl = new StringBuffer(url);
+        accessUrl.append(url.contains("?") ? "&" : "?");
+        // 身份ID
+        accessUrl.append("access_id=").append(master.getMa_uu());
+        // 时间戳
+        accessUrl.append("&_timestamp=").append(System.currentTimeMillis());
+        URI uri = restTemplate.getUriTemplateHandler().expand(getApiDomain() + accessUrl.toString(), vars);
+        url = uri.toString();
+        // 签名
+        return url + "&_signature=" + HmacUtils.encode(url, master.getMa_accesssecret());
+    }
+
+    protected <T> T getForObject(String url, Class<T> objectClass, Object... vars) {
+        return restTemplate.getForObject(getURI(url, vars), objectClass);
+    }
+
+    protected <T> List<T> getForList(String url, Class<T> objectClass, Object... vars) {
+        String resultStr = restTemplate.getForObject(getURI(url, vars), String.class);
+        return JSON.parseArray(resultStr, objectClass);
+    }
+
+    /**
+     * b2b当前版本的接口只支持以form-data方式提交,requestBody方式暂不支持
+     * @param url
+     * @param vars
+     */
+    protected void post(String url, MultiValueMap<String, String> vars) {
+        HttpHeaders headers = new HttpHeaders();
+        headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
+        HttpEntity<MultiValueMap<String, String>> request = new HttpEntity<>(vars, headers);
+        restTemplate.postForLocation(getURI(url), request);
+    }
+
+    protected ResponseEntity postForEntity(String url, MultiValueMap<String, String> vars) {
+        HttpHeaders headers = new HttpHeaders();
+        headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
+        HttpEntity<MultiValueMap<String, String>> request = new HttpEntity<>(vars, headers);
+        return restTemplate.postForEntity(getURI(url), request, String.class);
+    }
+
+    protected <T> List<T> postForList(String url, Class<T> objectClass, MultiValueMap<String, String> vars) {
+        ResponseEntity<String> resultEntity = postForEntity(url, vars);
+        return JSON.parseArray(resultEntity.getBody(), objectClass);
+    }
+
+    /**
+     * 封装成平台接口数据格式
+     * @param data
+     * @return
+     */
+    protected static MultiValueMap<String, String> dataWrap(Object data) {
+        MultiValueMap<String, String> map = new LinkedMultiValueMap<>();
+        String dataStr = null;
+        Class<?> cls = data.getClass();
+        if (cls.isAssignableFrom(String.class) || cls.isAssignableFrom(Number.class) ||
+                cls.isAssignableFrom(Character.class)) {
+            dataStr = data.toString();
+        } else {
+            dataStr = JSON.toJSONString(data);
+        }
+        try {
+            dataStr = URLEncoder.encode(dataStr, "UTF-8");
+        } catch (UnsupportedEncodingException e) {
+
+        }
+        map.set("data", dataStr);
+        return map;
+    }
+
+    /**
+     * 数据上传工具,封装了处理前、后置、错误处理方法
+     * @param <T>
+     */
+    protected abstract class AbstractHandler<T> {
+
+        private List<T> data;
+
+        public AbstractHandler(List<T> data) {
+            this.data = data;
+        }
+
+        /**
+         * onHandler方法前执行
+         */
+        protected void onBefore(){
+
+        }
+
+        protected abstract ResponseEntity onHandler(List<T> data);
+
+        /**
+         * onHandler方法执行成功后执行
+         */
+        protected void onSuccess(){
+
+        }
+
+        /**
+         * onHandler方法执行失败后执行
+         */
+        protected void onError(String message){
+            throw new RuntimeException(message);
+        }
+
+        /**
+         * 所有方法执行完成后执行
+         */
+        protected void onAfter(){
+
+        }
+
+        public void run() {
+            String errMsg = null;
+            onBefore();
+            try {
+                ResponseEntity response = onHandler(data);
+                if (!response.getStatusCode().is2xxSuccessful()) {
+                    errMsg = String.valueOf(response.getBody());
+                }
+            } catch (Exception e) {
+                errMsg = e.getMessage();
+            }
+            try {
+                if (null == errMsg) {
+                    onSuccess();
+                } else {
+                    onError(errMsg);
+                }
+            } finally {
+                onAfter();
+            }
+        }
+    }
+
+    /**
+     * POST方式处理工具
+     * @param <T>
+     */
+    protected class AbstractPostHandler<T> extends AbstractHandler<T> {
+        private String postUri;
+
+        public AbstractPostHandler(String postUri, List<T> data) {
+            super(data);
+            this.postUri = postUri;
+        }
+
+        @Override
+        protected ResponseEntity onHandler(List<T> data) {
+            return postForEntity(postUri, dataWrap(data));
+        }
+    }
+
+    /**
+     * 基于状态控制的处理工具
+     * @param <T>
+     */
+    protected abstract class AbstractStatusBasedHandler<T extends KeyEntity> extends AbstractPostHandler<T> {
+
+        private String idStr;
+        private String tableName;
+        private String idColumn;
+        private String statusColumn;
+
+        public AbstractStatusBasedHandler(String tableName, String idColumn, String statusColumn, String postUri, List<T> data) {
+            super(postUri, data);
+            this.idStr = CollectionUtil.getKeyString(data);
+            this.tableName = tableName;
+            this.idColumn = idColumn;
+            this.statusColumn = statusColumn;
+        }
+
+        @Override
+        protected void onBefore() {
+            jdbcTemplate.execute(String.format("update %s set %s='上传中' where %s in (%s)", tableName, statusColumn, idColumn, idStr));
+        }
+
+        @Override
+        protected void onSuccess() {
+            jdbcTemplate.execute(String.format("update %s set %s='已上传' where %s in (%s)", tableName, statusColumn, idColumn, idStr));
+        }
+
+        @Override
+        protected void onError(String message) {
+            jdbcTemplate.execute(String.format("update %s set %s='待上传' where %s in (%s) and %s='上传中'", tableName, statusColumn, idColumn, idStr, statusColumn));
+            super.onError(message);
+        }
+    }
+
+    /**
+     * 基于状态控制的处理工具
+     * @param <T>
+     */
+    protected class StatusBasedHandler<T extends KeyEntity> extends AbstractStatusBasedHandler<T> {
+
+        public StatusBasedHandler(String tableName, String idColumn, String statusColumn, String postUri, List<T> data) {
+            super(tableName, idColumn, statusColumn, postUri, data);
+        }
+    }
+
+    /**
+     * 处理物料上传的工具
+     */
+    protected final class ProductHandler extends StatusBasedHandler<Prod>{
+
+        public ProductHandler(List<Prod> data) {
+            super("product", "pr_id", "PR_SENDSTATUS", "/erp/product", data);
+        }
+    }
+
+    /**
+     * 查找附件
+     * @param attachIds 附件ID
+     * @return
+     */
+    protected List<Attach> getAttachs(String[] attachIds) {
+        String erpUrl = getUASUrl();
+        List<Attach> attaches = jdbcTemplate.queryForBeanList("select fp_id, fp_size, fp_name from filepath where fp_id in ("
+                + StringUtils.arrayToDelimitedString(attachIds, ",") + ")", Attach.class);
+        if (!CollectionUtils.isEmpty(attaches)) {
+            for (Attach attach : attaches) {
+                attach.setFp_url(erpUrl + Attach.DOWN_FILE_ACTION + attach.getFp_id());
+            }
+        }
+        return attaches;
+    }
+
+    /**
+     * 创建消息
+     *
+     * @param caller
+     * @param sourceIds
+     * @param type
+     */
+    protected void createMessage(String caller, String sourceIds, String type) {
+        Integer mid = jdbcTemplate.getInt("select max(mm_id) from MESSAGEMODEL left join MESSAGEROLE on mm_id=mr_mmid where MR_ISUSED=-1 AND MM_ISUSED=-1 and mm_caller=? and MM_OPERATE='b2b' AND MM_ACTION=?",
+                caller, type);
+        if (null != mid) {
+            jdbcTemplate.execute("{call SP_CREATEINFO(?,'ADMIN',?,?)}",
+                    mid, sourceIds, DateUtil.parseDateToOracleString(Constant.YMD_HMS, new Date()));
+        }
+    }
+
+}

+ 77 - 0
src/main/java/com/uas/erp/schedular/financeservice/task/CustomerInfoTask.java

@@ -0,0 +1,77 @@
+package com.uas.erp.schedular.financeservice.task;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.uas.api.crypto.util.FlexJsonUtils;
+import com.uas.erp.schedular.financeservice.domain.AccountInfo;
+import com.uas.erp.schedular.financeservice.domain.CustInfo;
+import com.uas.erp.schedular.financeservice.domain.CustomerInfo;
+import com.uas.erp.schedular.task.support.Method;
+import com.uas.erp.schedular.task.support.Role;
+import com.uas.erp.schedular.task.support.TaskMapping;
+import com.uas.erp.schedular.util.ContextHolder;
+import org.springframework.stereotype.Component;
+import org.springframework.ui.ModelMap;
+import org.springframework.util.CollectionUtils;
+import org.springframework.util.StringUtils;
+import java.util.List;
+
+/**
+ * Created by hejq on 2017-12-21.
+ */
+@Component
+@TaskMapping(title = "金融服务", role = Role.SELLER)
+public class CustomerInfoTask extends AbstractTask {
+
+    @TaskMapping(title = "申请企业从金融平台下载客户的申请数据", fixedDelay = 60000, method = Method.DOWNLOAD)
+    public void downloadFinance() {
+       String jsonStr = getForObject("/erp/customerInfo", String.class);
+        if (!StringUtils.isEmpty(jsonStr)) {
+            JSONObject jsonObject = JSONObject.parseObject(jsonStr);
+            String size = jsonObject.getString("size");
+            ContextHolder.setDataSize(null != size ? Integer.valueOf(size) : 0);
+            saveCustInfo(jsonObject.getString("custInfos"));
+            // TODO notice++
+            // 回执
+            onSaleDownSuccess(jsonObject.getString("idStr"));
+        }
+    }
+
+    /**
+     * 将下载的数据的idStr传回金融平台进行更新操作
+     *
+     * @param idStr
+     */
+    private void onSaleDownSuccess(String idStr) {
+        if(!StringUtils.isEmpty(idStr))
+            post("/erp/customerInfo/back", dataWrap(idStr));
+    }
+
+    /**
+     * 下载的数据传输到ERP做处理,这边不做处理
+     *
+     * @param custInfos
+     */
+    private void saveCustInfo(String custInfos) {
+        if(!StringUtils.isEmpty(custInfos)) {
+            List<CustInfo> infos = FlexJsonUtils.fromJsonArray(custInfos, CustInfo.class);
+            if(!CollectionUtils.isEmpty(infos)) {
+                for(CustInfo info : infos) {
+                    CustomerInfo customer = new CustomerInfo(info);
+                    String url = "/openapi/applicant/financingApply.action";
+                    postForEntity(url, new ModelMap("customer", JSON.toJSONString(customer))
+                            .addAttribute("accountList",JSON.toJSONString(info.getAccountInfoList()))
+                            .addAttribute("associateCompany", JSON.toJSONString(info.getAssociateCompanies()))
+                            .addAttribute("businessCondition", JSON.toJSONString(info.getBusinessCondition()))
+                            .addAttribute("customerExcutive", JSON.toJSONString(info.getCustomerExcutives()))
+                            .addAttribute("financeCondition", JSON.toJSONString(info.getFinanceConditions()))
+                            .addAttribute("mfCust", JSON.toJSONString(info.getMfCustInfos()))
+                            .addAttribute("financingApply", JSON.toJSONString(info.getFinancingApplies()))
+                            .addAttribute("prouductMixe", JSON.toJSONString(info.getProductMixes()))
+                            .addAttribute("updowncast", JSON.toJSONString(info.getUpdowncasts()))
+                            .addAttribute("shareholders", JSON.toJSONString(info.getShareholders()))
+                            .addAttribute("changeInstruction", JSON.toJSONString(info.getChangesInstructions())));
+                }
+            }
+        }
+    }
+}