Ver código fonte

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/main/java/com/uas/erp/schedular/diymall/task/DiymallApplyTask.java
#	src/main/resources/init/setting.json
huangct 8 anos atrás
pai
commit
d784232418
25 arquivos alterados com 2595 adições e 285 exclusões
  1. 6 2
      src/main/java/com/uas/erp/schedular/agent/v1/AbstractAgent.java
  2. 104 0
      src/main/java/com/uas/erp/schedular/finance/domain/AccountInfo.java
  3. 41 75
      src/main/java/com/uas/erp/schedular/finance/domain/Apply.java
  4. 193 0
      src/main/java/com/uas/erp/schedular/finance/domain/ApplyInfo.java
  5. 115 0
      src/main/java/com/uas/erp/schedular/finance/domain/AssociateCompanyInfo.java
  6. 91 0
      src/main/java/com/uas/erp/schedular/finance/domain/Attach.java
  7. 66 0
      src/main/java/com/uas/erp/schedular/finance/domain/BusinessConditionInfo.java
  8. 89 0
      src/main/java/com/uas/erp/schedular/finance/domain/ChangesInstructionInfo.java
  9. 444 0
      src/main/java/com/uas/erp/schedular/finance/domain/CustInfo.java
  10. 172 0
      src/main/java/com/uas/erp/schedular/finance/domain/CustomerExcutiveInfo.java
  11. 330 0
      src/main/java/com/uas/erp/schedular/finance/domain/CustomerInfo.java
  12. 104 0
      src/main/java/com/uas/erp/schedular/finance/domain/FinanceConditionInfo.java
  13. 104 0
      src/main/java/com/uas/erp/schedular/finance/domain/ProductMixInfo.java
  14. 247 0
      src/main/java/com/uas/erp/schedular/finance/domain/PurcCustInfo.java
  15. 104 0
      src/main/java/com/uas/erp/schedular/finance/domain/ShareholdersInfo.java
  16. 117 0
      src/main/java/com/uas/erp/schedular/finance/domain/UpdowncastInfo.java
  17. 2 0
      src/main/java/com/uas/erp/schedular/finance/task/AbstractTask.java
  18. 96 0
      src/main/java/com/uas/erp/schedular/finance/task/ApplyInfoTask.java
  19. 0 131
      src/main/java/com/uas/erp/schedular/finance/task/FinancingApplyTask.java
  20. 1 1
      src/main/java/com/uas/erp/schedular/task/support/MasterTaskRunner.java
  21. 70 64
      src/main/resources/database/template/deputyOrder.xml
  22. 6 8
      src/main/resources/init/setting.json
  23. 5 0
      src/main/resources/logback.xml
  24. 84 0
      src/test/java/com/uas/erp/test/ConnectToFinanceTest.java
  25. 4 4
      src/test/java/com/uas/erp/test/XmlTest.java

+ 6 - 2
src/main/java/com/uas/erp/schedular/agent/v1/AbstractAgent.java

@@ -12,6 +12,8 @@ import org.springframework.http.HttpEntity;
 import org.springframework.http.HttpHeaders;
 import org.springframework.http.MediaType;
 import org.springframework.util.Assert;
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
 import org.springframework.web.client.RestTemplate;
 
 import java.util.Map;
@@ -49,11 +51,13 @@ public class AbstractAgent {
         return url + "&_signature=" + HmacUtils.encode(url);
     }
 
-    protected boolean postForEntity(String url, Map<String, Object> vars) {
+    public boolean postForEntity(String url, Map<String, Object> vars) {
         HttpHeaders headers = new HttpHeaders();
         headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
         headers.add("referer", getSignature());
-        HttpEntity<Map<String, Object>> request = new HttpEntity<>(vars, headers);
+        MultiValueMap<String, Object> formData = new LinkedMultiValueMap<>();
+        formData.setAll(vars);
+        HttpEntity<MultiValueMap<String, Object>> request = new HttpEntity<>(formData, headers);
         String returnStr = restTemplate.postForEntity(getUASUrl() + url, request, String.class).getBody();
         ResultWrap<String> wrap = JSON.parseObject(returnStr, new TypeReference<ResultWrap<String>>(){});
         return wrap.isSuccess();

+ 104 - 0
src/main/java/com/uas/erp/schedular/finance/domain/AccountInfo.java

@@ -0,0 +1,104 @@
+package com.uas.erp.schedular.finance.domain;
+
+/**
+ * created by shicr on 2017/12/20
+ * 财务数据表
+ **/
+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;
+    }
+
+    public AccountInfo() {
+
+    }
+}

+ 41 - 75
src/main/java/com/uas/erp/schedular/finance/domain/FinancingApply.java → src/main/java/com/uas/erp/schedular/finance/domain/Apply.java

@@ -1,12 +1,7 @@
 package com.uas.erp.schedular.finance.domain;
 
-import com.uas.erp.schedular.b2b.domain.KeyEntity;
-import com.uas.erp.schedular.core.Constant;
-import com.uas.erp.schedular.util.DateUtil;
-import com.uas.erp.schedular.util.NumberUtil;
-import com.uas.erp.schedular.util.StringUtil;
-
-import java.util.Date;
+import java.io.Serializable;
+import java.util.List;
 
 /**
  * 金融服务申请数据
@@ -14,17 +9,20 @@ import java.util.Date;
  * @author hejq
  * @time 创建时间:2017年11月24日
  */
-public class FinancingApply extends KeyEntity {
-	
+public class Apply implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
 	/**
 	 * ID
 	 */
-	private Long fa_id;
-	
+	private Long id;
+
 	/**
-	 * 企业名称
+	 * 企业uu
+	 * @return
 	 */
-	private String fa_enname;
+	private Long enuu;
 
 	/**
 	 * 联系人
@@ -32,12 +30,12 @@ public class FinancingApply extends KeyEntity {
 	private String fa_contact;
 
 	/**
-	 * 联系电话(座机)
+	 * 联系方式1
 	 */
 	private String fa_telphone;
 	
 	/**
-	 * 联系电话(手机)
+	 * 联系方式2
 	 */
 	private String fa_phone;
 	
@@ -54,7 +52,7 @@ public class FinancingApply extends KeyEntity {
 	/**
 	 * 申请日期
 	 */
-	private Date fa_applydate;
+	private String fa_applydate;
 	
 	/**
 	 * 申请得分
@@ -75,29 +73,32 @@ public class FinancingApply extends KeyEntity {
 	 * 保理公司
 	 */
 	private String fa_facorpcode;
-	
+
 	/**
-	 * 金融項目裡面的id
+     * 客户信息表
 	 */
-	private Long fa_finid;
-	
-	private Integer fa_hasErp;
+	private CustInfo customerInfo;
+
+	/**
+	 * 附件表
+	 * @return
+	 */
+	private List<Attach> attachList;
 
-	public Long getFa_id() {
-		return fa_id;
-		
+	public Long getId() {
+		return id;
 	}
 
-	public void setFa_id(Long fa_id) {
-		this.fa_id = fa_id;
+	public void setId(Long id) {
+		this.id = id;
 	}
 
-	public String getFa_enname() {
-		return fa_enname;
+	public Long getEnuu() {
+		return enuu;
 	}
 
-	public void setFa_enname(String fa_enname) {
-		this.fa_enname = fa_enname;
+	public void setEnuu(Long enuu) {
+		this.enuu = enuu;
 	}
 
 	public String getFa_contact() {
@@ -141,10 +142,10 @@ public class FinancingApply extends KeyEntity {
 	}
 
 	public String getFa_applydate() {
-		return fa_applydate==null?null: DateUtil.format(fa_applydate, Constant.YMD_HMS);
+		return fa_applydate;
 	}
 
-	public void setFa_applydate(Date fa_applydate) {
+	public void setFa_applydate(String fa_applydate) {
 		this.fa_applydate = fa_applydate;
 	}
 
@@ -180,54 +181,19 @@ public class FinancingApply extends KeyEntity {
 		this.fa_facorpcode = fa_facorpcode;
 	}
 
-	public Long getFa_finid() {
-		return fa_finid;
-	}
-
-	public void setFa_finid(Long fa_finid) {
-		this.fa_finid = fa_finid;
-	}
-
-	@Override
-	public Object getKey() {
-		return this.fa_id;
+	public CustInfo getCustomerInfo() {
+		return customerInfo;
 	}
 
-	public Integer getFa_hasErp() {
-		return fa_hasErp;
+	public void setCustomerInfo(CustInfo customerInfo) {
+		this.customerInfo = customerInfo;
 	}
 
-	public void setFa_hasErp(Integer fa_hasErp) {
-		this.fa_hasErp = fa_hasErp;
+	public List<Attach> getAttachList() {
+		return attachList;
 	}
 
-	public String toSqlString(int primaryKey) {
-		return "insert into financingapply (fa_id,fa_enname,fa_contact,fa_telphone,fa_phone,fa_appamount,fa_applyman,fa_applydate,fa_score,fa_busincode,fa_facorpname,fa_facorpcode,fa_finid) values ("
-				+ primaryKey
-				+ ",'"
-				+ StringUtil.nvl(fa_enname, "")
-				+ "', '"
-				+ StringUtil.nvl(fa_contact, "")
-				+ "', '"
-				+ StringUtil.nvl(fa_telphone, "")
-				+ "','"
-				+ StringUtil.nvl(fa_phone, "")
-				+ "', "
-				+ NumberUtil.nvl(fa_appamount, 0)
-				+ ", '"
-				+  StringUtil.nvl(fa_applyman, "")
-				+ "', "
-				+ DateUtil.parseDateToOracleString(null, fa_applydate)
-				+ ", "
-				+ fa_score
-				+ ", '"
-				+ fa_busincode
-				+ "', '"
-				+ fa_facorpname
-				+ "', '"
-				+ fa_facorpcode
-				+ "', "
-				+ fa_finid
-				+ ")";
+	public void setAttachList(List<Attach> attachList) {
+		this.attachList = attachList;
 	}
 }

+ 193 - 0
src/main/java/com/uas/erp/schedular/finance/domain/ApplyInfo.java

@@ -0,0 +1,193 @@
+package com.uas.erp.schedular.finance.domain;
+
+import java.io.Serializable;
+
+/**
+ * created by shicr on 2017/12/26
+ **/
+public class ApplyInfo implements Serializable{
+
+    private static final long serialVersionUID = 1L;
+    /**
+     * 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;
+
+    /**
+     * 客户信息表
+     */
+    private CustInfo customerInfo;
+
+    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;
+    }
+
+    public ApplyInfo(Apply apply) {
+        if (apply != null) {
+            this.id = apply.getId();
+            this.enuu = apply.getEnuu();
+            this.fa_contact = apply.getFa_contact();
+            this.fa_telphone = apply.getFa_telphone();
+            this.fa_phone = apply.getFa_phone();
+            this.fa_appamount = apply.getFa_appamount();
+            this.fa_applyman = apply.getFa_applyman();
+            this.fa_applydate = apply.getFa_applydate();
+            this.fa_score = apply.getFa_score();
+            this.fa_busincode = apply.getFa_busincode();
+            this.fa_facorpname = apply.getFa_facorpname();
+            this.fa_facorpcode = apply.getFa_facorpcode();
+        }
+    }
+
+    public ApplyInfo () {
+
+    }
+}

+ 115 - 0
src/main/java/com/uas/erp/schedular/finance/domain/AssociateCompanyInfo.java

@@ -0,0 +1,115 @@
+package com.uas.erp.schedular.finance.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;
+    }
+
+}

+ 91 - 0
src/main/java/com/uas/erp/schedular/finance/domain/Attach.java

@@ -0,0 +1,91 @@
+package com.uas.erp.schedular.finance.domain;
+
+
+import javax.persistence.*;
+import java.io.Serializable;
+
+/**
+ * created by shicr on 2017/12/25
+ **/
+public class Attach implements Serializable{
+
+    private static final long serialVersionUID = 1L;
+
+    private Long id;
+
+    /**
+     * 附件名
+     */
+    private String name;
+
+    /**
+     * 附件路径
+     */
+    @Column(name="path")
+    private String path;
+
+    /**
+     * 文件大小
+     */
+    private Long size;
+
+    /**
+     *文件所属类别
+     */
+    private String type;
+
+    /**
+     * 附件所属的金融单据
+     */
+    private Long applyId;
+
+
+    public Long getApplyId() {
+        return applyId;
+    }
+
+    public void setApplyId(Long applyId) {
+        this.applyId = applyId;
+    }
+
+    public Long getSize() {
+        return size;
+    }
+
+    public void setSize(Long size) {
+        this.size = size;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getPath() {
+        return path;
+    }
+
+    public void setPath(String path) {
+        this.path = path;
+    }
+
+}

+ 66 - 0
src/main/java/com/uas/erp/schedular/finance/domain/BusinessConditionInfo.java

@@ -0,0 +1,66 @@
+package com.uas.erp.schedular.finance.domain;
+
+/**
+ * created by shicr on 2017/12/20
+ * 情况描述
+ **/
+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;
+    }
+
+    public BusinessConditionInfo() {
+
+    }
+}

+ 89 - 0
src/main/java/com/uas/erp/schedular/finance/domain/ChangesInstructionInfo.java

@@ -0,0 +1,89 @@
+package com.uas.erp.schedular.finance.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;
+    }
+
+    public ChangesInstructionInfo() {
+
+    }
+}

+ 444 - 0
src/main/java/com/uas/erp/schedular/finance/domain/CustInfo.java

@@ -0,0 +1,444 @@
+package com.uas.erp.schedular.finance.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_employeesnum;
+
+    /**
+     * 部门设置概况
+     *
+     * @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 Apply financingApply;
+
+    /**
+     * 买方客户资料
+     */
+    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_employeesnum() {
+        return cu_employeesnum;
+    }
+
+    public void setCu_employeesnum(Long cu_employeesnum) {
+        this.cu_employeesnum = cu_employeesnum;
+    }
+
+    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 Apply getFinancingApply() {
+        return financingApply;
+    }
+
+    public void setFinancingApply(Apply financingApply) {
+        this.financingApply = financingApply;
+    }
+
+    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;
+    }
+}

+ 172 - 0
src/main/java/com/uas/erp/schedular/finance/domain/CustomerExcutiveInfo.java

@@ -0,0 +1,172 @@
+package com.uas.erp.schedular.finance.domain;
+
+/**
+ * created by shicr on 2017/12/20
+ * 管理层信息
+ **/
+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;
+    }
+
+    public CustomerExcutiveInfo() {
+
+    }
+}
+
+

+ 330 - 0
src/main/java/com/uas/erp/schedular/finance/domain/CustomerInfo.java

@@ -0,0 +1,330 @@
+package com.uas.erp.schedular.finance.domain;
+
+/**
+ * created by shicr on 2017/12/26
+ **/
+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_employeesnum;
+
+    /**
+     * 部门设置概况
+     *
+     * @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_employeesnum() {
+        return cu_employeesnum;
+    }
+
+    public void setCu_employeesnum(Long cu_employeesnum) {
+        this.cu_employeesnum = cu_employeesnum;
+    }
+
+    public String getCu_departsituation() {
+        return cu_departsituation;
+    }
+
+    public void setCu_departsituation(String cu_departsituation) {
+        this.cu_departsituation = cu_departsituation;
+    }
+
+    public CustomerInfo () {
+
+    }
+
+    public CustomerInfo (CustInfo info) {
+        if(info!=null) {
+            this.id = info.getId();
+            this.cu_name = info.getCu_name();
+            this.cu_engname = info.getCu_engname();
+            this.cu_enterptype = info.getCu_enterptype();
+            this.cu_licensedate = info.getCu_licensedate();
+            this.cu_paperstype = info.getCu_paperstype();
+            this.cu_institutype = info.getCu_institutype();
+            this.cu_paperscode = info.getCu_paperscode();
+            this.cu_ctfduedate = info.getCu_ctfduedate();
+            this.cu_businesscode = info.getCu_businesscode();
+            this.cu_nastdinducls = info.getCu_nastdinducls();
+            this.cu_capcurrency = info.getCu_capcurrency();
+            this.cu_regcapital = info.getCu_regcapital();
+            this.cu_paidincapital = info.getCu_paidincapital();
+            this.cu_redaddcode = info.getCu_redaddcode();
+            this.cu_officeaddcode = info.getCu_officeaddcode();
+            this.cu_businsscope = info.getCu_businsscope();
+            this.cu_others = info.getCu_others();
+            this.cu_enuu = info.getCu_enuu();
+            this.cu_highestauthority = info.getCu_highestauthority();
+            this.cu_employeesnum = info.getCu_employeesnum();
+            this.cu_departsituation = info.getCu_departsituation();
+        }
+    }
+}

+ 104 - 0
src/main/java/com/uas/erp/schedular/finance/domain/FinanceConditionInfo.java

@@ -0,0 +1,104 @@
+package com.uas.erp.schedular.finance.domain;
+
+/**
+ * created by shicr on 2017/12/20
+ * 财务情况说明
+ **/
+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;
+    }
+
+    public FinanceConditionInfo() {
+
+    }
+}

+ 104 - 0
src/main/java/com/uas/erp/schedular/finance/domain/ProductMixInfo.java

@@ -0,0 +1,104 @@
+package com.uas.erp.schedular.finance.domain;
+
+/**
+ * created by shicr on 2017/12/20
+ * 经营情况表
+ **/
+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;
+    }
+
+    public ProductMixInfo() {
+
+    }
+}

+ 247 - 0
src/main/java/com/uas/erp/schedular/finance/domain/PurcCustInfo.java

@@ -0,0 +1,247 @@
+package com.uas.erp.schedular.finance.domain;
+
+/**
+ * created by shicr on 2017/12/20
+ * 买方客户资料
+ **/
+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;
+    }
+
+    public PurcCustInfo() {
+
+    }
+}

+ 104 - 0
src/main/java/com/uas/erp/schedular/finance/domain/ShareholdersInfo.java

@@ -0,0 +1,104 @@
+package com.uas.erp.schedular.finance.domain;
+
+/**
+ * 股东信息表
+ * created by shicr on 2017/12/18
+ **/
+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;
+    }
+
+    public ShareholdersInfo() {
+
+    }
+}

+ 117 - 0
src/main/java/com/uas/erp/schedular/finance/domain/UpdowncastInfo.java

@@ -0,0 +1,117 @@
+package com.uas.erp.schedular.finance.domain;
+
+/**
+ * 供应商客户
+ * created by shicr on 2017/12/20
+ **/
+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;
+    }
+
+    public UpdowncastInfo() {
+
+    }
+}

+ 2 - 0
src/main/java/com/uas/erp/schedular/finance/task/AbstractTask.java

@@ -76,6 +76,7 @@ public class AbstractTask extends AbstractAgent {
      */
     private String getURI(String url, Object... vars) {
         Master master = ContextHolder.getMaster();
+        logger.info("master信息:" + JSON.toJSONString(master));
         if (null == master.getMa_uu() || StringUtils.isEmpty(master.getMa_accesssecret())) {
             throw new RuntimeException("未设置企业UU和私钥");
         }
@@ -88,6 +89,7 @@ public class AbstractTask extends AbstractAgent {
         URI uri = restTemplate.getUriTemplateHandler().expand(getApiDomain() + accessUrl.toString(), vars);
         url = uri.toString();
         // 签名
+        logger.info("向" + url + "发起数据请求");
         return url + "&_signature=" + HmacUtils.encode(url, master.getMa_accesssecret());
     }
 

+ 96 - 0
src/main/java/com/uas/erp/schedular/finance/task/ApplyInfoTask.java

@@ -0,0 +1,96 @@
+package com.uas.erp.schedular.finance.task;
+import com.alibaba.fastjson.JSONObject;
+import com.uas.api.crypto.util.FlexJsonUtils;
+import com.uas.erp.schedular.finance.domain.*;
+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 ApplyInfoTask extends AbstractTask {
+
+    @TaskMapping(title = "申请企业从金融平台下载客户的申请数据", fixedDelay = 60000, method = Method.DOWNLOAD)
+    public void downloadFinance() {
+        String jsonStr = getForObject("/erp/finance", String.class);
+        if (!StringUtils.isEmpty(jsonStr)) {
+            JSONObject jsonObject = JSONObject.parseObject(jsonStr);
+            String size = jsonObject.getString("size");
+            ContextHolder.setDataSize(null != size ? Integer.valueOf(size) : 0);
+            saveApplyInfo(jsonObject.getString("apply"));
+            // TODO notice++
+            // 回执
+            onSaleDownSuccess(jsonObject.getString("idStr"));
+        }
+    }
+
+    /**
+     * 将下载的数据的idStr传回金融平台进行更新操作
+     *
+     * @param idStr 返回更新下载状态的idStr
+     */
+    private void onSaleDownSuccess(String idStr) {
+        if(!StringUtils.isEmpty(idStr))
+            post("/erp/finance/back", dataWrap(idStr));
+    }
+
+    /**
+     * 下载的数据传输到ERP做处理,这边不做处理
+     *
+     * @param apply 关于apply的json
+     */
+    private void saveApplyInfo(String apply) {
+        List<Apply> applies = FlexJsonUtils.fromJsonArray(apply, Apply.class);
+        if (!CollectionUtils.isEmpty(applies)) {
+            for (Apply apply1 : applies) {
+                String url = "/openapi/applicant/financingApply.action";
+
+                List<AssociateCompanyInfo> companyInfos = apply1.getCustomerInfo() != null ? apply1.getCustomerInfo().getAssociateCompanies() : null;
+
+                List<CustomerExcutiveInfo> customerExcutiveInfos = apply1.getCustomerInfo() != null ? apply1.getCustomerInfo().getCustomerExcutives() : null;
+
+                BusinessConditionInfo conditionInfos = apply1.getCustomerInfo() != null ? apply1.getCustomerInfo().getBusinessCondition() : null;
+
+                List<FinanceConditionInfo> conditionInfo = apply1.getCustomerInfo() != null ? apply1.getCustomerInfo().getFinanceConditions() : null;
+
+                List<ProductMixInfo> productMixInfos = apply1.getCustomerInfo() != null ? apply1.getCustomerInfo().getProductMixes() : null;
+
+                List<PurcCustInfo> purcCustInfos = apply1.getCustomerInfo() != null ? apply1.getCustomerInfo().getMfCustInfos() : null;
+
+                List<UpdowncastInfo> updowncastInfos = apply1.getCustomerInfo() != null ? apply1.getCustomerInfo().getUpdowncasts() : null;
+
+                List<ShareholdersInfo> shareholdersInfos = apply1.getCustomerInfo() != null ? apply1.getCustomerInfo().getShareholders() : null;
+
+                List<ChangesInstructionInfo> changesInstructionInfos = apply1.getCustomerInfo() != null ? apply1.getCustomerInfo().getChangesInstructions() : null;
+
+                List<AccountInfo> accountInfos = apply1.getCustomerInfo() != null ? apply1.getCustomerInfo().getAccountInfoList() : null;
+
+                postForEntity(url, new ModelMap("customer", FlexJsonUtils.toJsonDeep(new CustomerInfo(apply1.getCustomerInfo())))
+                        .addAttribute("apply", FlexJsonUtils.toJsonDeep(new ApplyInfo(apply1)))
+                        .addAttribute("associateCompany", FlexJsonUtils.toJsonDeep(companyInfos))
+                        .addAttribute("businessCondition", FlexJsonUtils.toJsonDeep(conditionInfos))
+                        .addAttribute("customerExcutive", FlexJsonUtils.toJsonDeep(customerExcutiveInfos))
+                        .addAttribute("financeCondition", FlexJsonUtils.toJsonDeep(conditionInfo))
+                        .addAttribute("mfCust", FlexJsonUtils.toJsonDeep(purcCustInfos))
+                        .addAttribute("attaches", FlexJsonUtils.toJsonDeep(apply1.getAttachList()))
+                        .addAttribute("prouductMixe", FlexJsonUtils.toJsonDeep(productMixInfos))
+                        .addAttribute("updowncast", FlexJsonUtils.toJsonDeep(updowncastInfos))
+                        .addAttribute("shareholders", FlexJsonUtils.toJsonDeep(shareholdersInfos))
+                        .addAttribute("changeInstruction", FlexJsonUtils.toJsonDeep(changesInstructionInfos))
+                        .addAttribute("accountList", FlexJsonUtils.toJsonDeep(accountInfos))
+                );
+            }
+        }
+    }
+}

+ 0 - 131
src/main/java/com/uas/erp/schedular/finance/task/FinancingApplyTask.java

@@ -1,131 +0,0 @@
-package com.uas.erp.schedular.finance.task;
-
-import com.alibaba.fastjson.JSON;
-import com.uas.erp.schedular.finance.domain.FinancingApply;
-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.CollectionUtil;
-import com.uas.erp.schedular.util.ContextHolder;
-import org.springframework.stereotype.Component;
-import org.springframework.ui.ModelMap;
-import org.springframework.util.CollectionUtils;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * Created by Pro1 on 2017/8/4.
- */
-@Component
-@TaskMapping(title = "金融服务", role = Role.SELLER)
-public class FinancingApplyTask extends AbstractTask {
-
-    @TaskMapping(title = "申请企业从金融平台下载客户的申请数据", fixedDelay = 60000, method = Method.DOWNLOAD)
-    public void downloadFinance() {
-        List<FinancingApply> finances = getForList("/erp/down/loan/unload", FinancingApply.class);
-        if (!CollectionUtils.isEmpty(finances)) {
-            ContextHolder.setDataSize(finances.size());
-            saveFinanceDown(finances);
-            // TODO notice++
-            // 回执
-            onSaleDownSuccess(finances);
-        }
-    }
-
-    /**
-     * 保存financeDown
-     *
-     * @param finances
-     */
-    private void saveFinanceDown(List<FinancingApply> finances) {
-        List<String> sqls = new ArrayList<>();
-        List<Long> idList = new ArrayList<Long>();
-        for (FinancingApply fina : finances) {
-            int count = jdbcTemplate.count("from financingapply where fa_finid=?", fina.getFa_finid());
-            if (count == 0) {
-                int finaId = jdbcTemplate.generate("financingapply_seq");
-                idList.add(Long.valueOf(finaId));
-	            if (null != fina.getFa_facorpcode()) {
-		            String corpname =jdbcTemplate.getString("select fc_name from FINANCECORPORATION where fc_code = ?",String.class, fina.getFa_facorpcode());
-		            fina.setFa_facorpname(corpname);
-	            }
-	            String sql = fina.toSqlString(finaId);
-                sqls.add(sql);
-            }
-        }
-        if (sqls.size() > 0) {
-            jdbcTemplate.batchExecute(sqls);
-        }
-    }
-
-    /**
-     * FinancingApply,修改金融平台的申请订单为已下载
-     *
-     * @param finances
-     */
-    private void onSaleDownSuccess(List<FinancingApply> finances) {
-        String idStr = CollectionUtil.getKeyString(finances, new CollectionUtil.KeyIterator<FinancingApply>() {
-            @Override
-            public Object getKey(FinancingApply obj) {
-                return obj.getFa_finid();
-            }
-        });
-        post("/erp/down/loan/back", dataWrap(idStr));
-    }
-
-
-	@TaskMapping(title = "保理公司从金融平台下载已申请的数据", fixedDelay = 60000, method = Method.DOWNLOAD)
-	public void downloadFinanceInfo() {
-		List<FinancingApply> finances = getForList("/erp/loan/unload", FinancingApply.class);
-		if (!CollectionUtils.isEmpty(finances)) {
-			ContextHolder.setDataSize(finances.size());
-			saveFinanceInfoDown(finances);
-			// TODO notice++
-			// 回执
-			onFinanceInfoDownSuccess(finances);
-		}
-	}
-
-	/**
-	 * 保理公司保存下载的数据
-	 *
-	 * @param finances
-	 */
-	private void saveFinanceInfoDown(List<FinancingApply> finances) {
-    	if(!CollectionUtils.isEmpty(finances)) {
-		    for(FinancingApply fina : finances) {
-			    int count = jdbcTemplate.count("from CUSTOMERQUOTA where CQ_FINID=?", fina.getFa_finid());
-			    if(count == 0) {
-				    Map<String, Object> Apply = new HashMap<String,Object>();
-				    Apply.put("fa_enname", fina.getFa_enname());
-				    Apply.put("fa_contact", fina.getFa_contact());
-				    Apply.put("fa_applyman", fina.getFa_applyman());
-				    Apply.put("fa_applydate", fina.getFa_applydate());
-				    Apply.put("fa_appamount", fina.getFa_appamount());
-				    Apply.put("fa_hasErp", fina.getFa_hasErp());
-				    Apply.put("fa_finid", fina.getFa_finid());
-				    String url = "/openapi/applicant/assessFinancingApply.action";
-				    postForEntity(url, new ModelMap("FinancingApply", JSON.toJSONString(Apply)).addAttribute("isB2B", true));
-			    }
-		    }
-	    }
-	}
-
-	/**
-	 * 保理公司数据保存后,返回id更新下载状态
-	 *
-	 * @param finances
-	 */
-	private void onFinanceInfoDownSuccess(List<FinancingApply> finances) {
-		String idStr = CollectionUtil.getKeyString(finances, new CollectionUtil.KeyIterator<FinancingApply>() {
-			@Override
-			public Object getKey(FinancingApply obj) {
-				return obj.getFa_finid();
-			}
-		});
-		post("/erp/loan/back", dataWrap(idStr));
-	}
-}

+ 1 - 1
src/main/java/com/uas/erp/schedular/task/support/MasterTaskRunner.java

@@ -14,7 +14,7 @@ import java.lang.reflect.Method;
 /**
  * Created by Pro1 on 2017/7/31.
  */
-public class MasterTaskRunner implements Runnable{
+public class MasterTaskRunner implements Runnable {
 
     private String beanName;
     private Object bean;

+ 70 - 64
src/main/resources/database/template/deputyOrder.xml

@@ -6,84 +6,90 @@
         v_sale sale%rowtype;
         v_sd_id number;
         v_pr_code varchar2(64);
-        v_vendcode varchar2(64);
+        v_vecode varchar2(64);
+        v_vendor vendor%rowtype;
+        v_ve_count number;
     </declare>
     <body>
         <iterator loop="orders" var="order">
             <block>
                 begin
-                    select * into v_customer from customer where cu_uu=${order.enuu};
+                select * into v_customer from customer where cu_uu=${order.enuu};
                 exception when no_data_found then
                 RAISE_APPLICATION_ERROR(-20010, '客户['||${order.enuu}||']不存在');
                 end;
                 begin
-                    select * into v_employee from employee where em_code=v_customer.cu_sellercode;
-                    exception when no_data_found then null;
+                select * into v_employee from employee where em_code=v_customer.cu_sellercode;
+                exception when no_data_found then null;
                 end;
                 begin
-                    select ve_code into v_vendcode from vendor where ve_name=${order.tervendor};
-                end;
+                v_vecode := '';
+                select count(1) into v_ve_count from vendor where ve_name=${order.tervendor};
+                if v_ve_count > 0 then
+                    select * into v_vendor from vendor where ve_name=${order.tervendor};
+                    v_vecode := v_vendor.ve_code;
+                end if;
                 begin
-                    select * into v_sale from sale where sa_code=${order.salecode};
-                    exception when no_data_found then null;
+                select * into v_sale from sale where sa_code=${order.salecode};
+                exception when no_data_found then null;
                 end;
                 if v_sale.sa_id is null or ${order.statuscode} = 222 then
-                    if v_sale.sa_id is null then
-                        v_sale.sa_id := sale_seq.nextval;
-                    else
-                        delete from saledetail where sd_said=v_sale.sa_id;
-                        delete from sale where sa_id=v_sale.sa_id;
-                    end if;
-                    v_sale.sa_code := ${order.salecode};
-                    v_sale.sa_pocode := ${order.salepocode};
-                    v_sale.sa_date := ${order.entrydate};
-                    v_sale.sa_kind := '代采订单';
-                    v_sale.sa_custcode := v_customer.cu_code;
-                    v_sale.sa_custname := v_customer.cu_name;
-                    v_sale.sa_currency := ${order.currency};
-                    v_sale.sa_apcustcode := v_customer.cu_code;
-                    v_sale.sa_apcustname := v_customer.cu_name;
-                    v_sale.sa_shcustcode := v_customer.cu_code;
-                    v_sale.sa_shcustname := v_customer.cu_name;
-                    v_sale.sa_paymentscode := v_customer.cu_paymentscode;
-                    v_sale.sa_payments := v_customer.cu_payments;
-                    v_sale.sa_toplace := v_customer.cu_add1;
-                    v_sale.sa_fromcode := ${order.code};
-                    v_sale.sa_sellercode := v_customer.cu_sellercode;
-                    v_sale.sa_departmentcode := v_employee.em_departmentcode;
-                    v_sale.sa_departmentname := v_employee.em_depart;
-                    v_sale.sa_recorder := '系统';
-                    v_sale.sa_recorddate := sysdate;
-                    v_sale.sa_statuscode := 'ENTERING';
-                    v_sale.sa_status := '在录入';
-                    v_sale.sa_vendcode := v_vendcode;
-                    v_sale.sa_vendname := ${order.tervendor};
-                    v_sale.sa_a20_user := ${order.madealdate};
-                    v_sale.sa_a19_user := ${order.madealcode};
-                    v_sale.sa_a18_user := ${order.vendtel};
-                    v_sale.sa_a17_user := ${order.venduser};
-                    v_sale.sa_a14_user := ${order.shipdate};
-                    v_sale.sa_a16_user := ${order.deliverymethod};
-                    v_sale.sa_a15_user := ${order.pickupmethod};
-                    v_sale.sa_a11_user := ${order.tervendaddress};
-                    v_sale.sa_a9_user := ${order.companyname};
-                    v_sale.sa_a10_user := ${order.requirepaydate};
-                    v_sale.sa_a8_user := ${order.bankname};
-                    v_sale.sa_a6_user := ${order.bankaccount};
-                    v_sale.sa_a7_user := ${order.bankaddress};
-                    v_sale.sa_a5_user := ${order.bankcode};
-                    v_sale.sa_a4_user := ${order.otherdata};
-                    v_sale.sa_a3_user := ${order.legalrepresent};
-                    v_sale.sa_a24_user := ${order.deliverydate};
-                    v_sale.sa_a22_user := ${order.paydate};
-                    v_sale.sa_payername := ${order.paycomname};
-                    v_sale.sa_payeraddress := ${order.paycomaddress};
-                    v_sale.sa_a13_user := ${order.riskmethod};
-                    v_sale.sa_a12_user := ${order.taxpaymentmethod};
-                    v_sale.sa_a2_user := ${order.enfax};
-                    v_sale.sa_a25_user := ${order.paycomaddress};
-                    v_sale.sa_a10_user_2 := ${order.actualpaydate};
-                    insert into sale values v_sale;
+                if v_sale.sa_id is null then
+                v_sale.sa_id := sale_seq.nextval;
+                else
+                delete from saledetail where sd_said=v_sale.sa_id;
+                delete from sale where sa_id=v_sale.sa_id;
+                end if;
+                v_sale.sa_code := ${order.salecode};
+                v_sale.sa_pocode := ${order.salepocode};
+                v_sale.sa_date := ${order.entrydate};
+                v_sale.sa_kind := '代采订单';
+                v_sale.sa_custcode := v_customer.cu_code;
+                v_sale.sa_custname := v_customer.cu_name;
+                v_sale.sa_currency := ${order.currency};
+                v_sale.sa_apcustcode := v_customer.cu_code;
+                v_sale.sa_apcustname := v_customer.cu_name;
+                v_sale.sa_shcustcode := v_customer.cu_code;
+                v_sale.sa_shcustname := v_customer.cu_name;
+                v_sale.sa_paymentscode := v_customer.cu_paymentscode;
+                v_sale.sa_payments := v_customer.cu_payments;
+                v_sale.sa_toplace := v_customer.cu_add1;
+                v_sale.sa_fromcode := ${order.code};
+                v_sale.sa_sellercode := v_customer.cu_sellercode;
+                v_sale.sa_departmentcode := v_employee.em_departmentcode;
+                v_sale.sa_departmentname := v_employee.em_depart;
+                v_sale.sa_recorder := '系统';
+                v_sale.sa_recorddate := sysdate;
+                v_sale.sa_statuscode := 'ENTERING';
+                v_sale.sa_status := '在录入';
+                v_sale.sa_vendcode := v_vecode;
+                v_sale.sa_vendname := ${order.tervendor};
+                v_sale.sa_a20_user := ${order.madealdate};
+                v_sale.sa_a19_user := ${order.madealcode};
+                v_sale.sa_a18_user := ${order.vendtel};
+                v_sale.sa_a17_user := ${order.venduser};
+                v_sale.sa_a14_user := ${order.shipdate};
+                v_sale.sa_a16_user := ${order.deliverymethod};
+                v_sale.sa_a15_user := ${order.pickupmethod};
+                v_sale.sa_a11_user := ${order.tervendaddress};
+                v_sale.sa_a9_user := ${order.companyname};
+                v_sale.sa_a10_user := ${order.requirepaydate};
+                v_sale.sa_a8_user := ${order.bankname};
+                v_sale.sa_a6_user := ${order.bankaccount};
+                v_sale.sa_a7_user := ${order.bankaddress};
+                v_sale.sa_a5_user := ${order.bankcode};
+                v_sale.sa_a4_user := ${order.otherdata};
+                v_sale.sa_a3_user := ${order.legalrepresent};
+                v_sale.sa_a24_user := ${order.deliverydate};
+                v_sale.sa_a22_user := ${order.paydate};
+                v_sale.sa_payername := ${order.paycomname};
+                v_sale.sa_payeraddress := ${order.paycomaddress};
+                v_sale.sa_a13_user := ${order.riskmethod};
+                v_sale.sa_a12_user := ${order.taxpaymentmethod};
+                v_sale.sa_a2_user := ${order.enfax};
+                v_sale.sa_a25_user := ${order.paycomaddress};
+                v_sale.sa_a10_user_2 := ${order.actualpaydate};
+                insert into sale values v_sale;
             </block>
             <iterator loop="order.deputyOrderItems" var="item">
                 v_sd_id := saledetail_seq.nextval;

+ 6 - 8
src/main/resources/init/setting.json

@@ -20,17 +20,15 @@
 },{
   "key": "api.finance.test.url",
   "description": "金融保理平台测试接口地址",
-  "value": "http://10.10.100.178:23000"
+  "value": "http://localhost:8081"
 },{
   "key": "api.finance.url",
   "description": "金融保理平台正式接口地址",
-  "value": "http://10.10.100.178:23000"
+  "value": "http://finance.ubtob.com"
 },{
-  "key": "api.diymall.test.url",
-  "description": "定制商城本地测试接口地址",
-  "value": "http://10.10.100.23:20215"
+  "key": "api.finance.service.test.url",
+  "description": "金融保理平台测试接口地址(已删除)"
 },{
-  "key": "api.diymall.url",
-  "description": "定制商城正式接口地址",
-  "value": "http://10.10.100.23:20215"
+  "key": "api.finance.service.url",
+  "description": "金融保理平台正式接口地址(已删除)"
 }]

+ 5 - 0
src/main/resources/logback.xml

@@ -41,4 +41,9 @@
     <root level="DEBUG">
         <appender-ref ref="ROLLING" />
     </root>
+
+    <root level="INFO">
+        <appender-ref ref="ROLLING" />
+        <appender-ref ref="STDOUT" />
+    </root>
 </configuration>

+ 84 - 0
src/test/java/com/uas/erp/test/ConnectToFinanceTest.java

@@ -0,0 +1,84 @@
+package com.uas.erp.test;
+
+import com.alibaba.fastjson.JSONObject;
+import com.uas.api.crypto.util.FlexJsonUtils;
+import com.uas.erp.schedular.entity.Master;
+import com.uas.erp.schedular.finance.domain.*;
+import com.uas.erp.schedular.finance.task.AbstractTask;
+import com.uas.erp.schedular.util.ContextHolder;
+import org.springframework.ui.ModelMap;
+import org.springframework.util.CollectionUtils;
+
+import java.util.List;
+
+
+/**
+ * 从金融平台获取数据再连接ERP的测试
+ * <p>
+ * Created by hejq on 2017-12-22.
+ */
+//@RunWith(SpringJUnit4ClassRunner.class)
+//@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE, classes = UasSchedulingApplication.class)
+public class ConnectToFinanceTest extends AbstractTask {
+
+//    @Test
+    public void testConnect() {
+        Master master = new Master();
+        master.setMa_user("UAS_TEST");
+        master.setMa_uu(10046597L);
+        master.setMa_accesssecret("60ed5581d63aa728e050007f0100453f");
+        master.setMa_env("test");
+        master.setMa_name("UAS_TEST");
+        ContextHolder.setMaster(master);
+        String jsonStr = getForObject("/erp/finance", String.class);
+        JSONObject jsonObject = JSONObject.parseObject(jsonStr);
+        String size = jsonObject.getString("size");
+        String apply = jsonObject.getString("apply");
+        List<Apply> applies = FlexJsonUtils.fromJsonArray(apply, Apply.class);
+
+        if (!CollectionUtils.isEmpty(applies)) {
+            for (Apply apply1 : applies) {
+                String url = "/openapi/applicant/financingApply.action";
+
+                List<AssociateCompanyInfo> companyInfos = apply1.getCustomerInfo() != null ? apply1.getCustomerInfo().getAssociateCompanies() : null;
+
+                List<CustomerExcutiveInfo> customerExcutiveInfos = apply1.getCustomerInfo() != null ? apply1.getCustomerInfo().getCustomerExcutives() : null;
+
+                BusinessConditionInfo conditionInfos = apply1.getCustomerInfo() != null ? apply1.getCustomerInfo().getBusinessCondition() : null;
+
+                List<FinanceConditionInfo> conditionInfo = apply1.getCustomerInfo() != null ? apply1.getCustomerInfo().getFinanceConditions() : null;
+
+                List<ProductMixInfo> productMixInfos = apply1.getCustomerInfo() != null ? apply1.getCustomerInfo().getProductMixes() : null;
+
+                List<PurcCustInfo> purcCustInfos = apply1.getCustomerInfo() != null ? apply1.getCustomerInfo().getMfCustInfos() : null;
+
+                List<UpdowncastInfo> updowncastInfos = apply1.getCustomerInfo() != null ? apply1.getCustomerInfo().getUpdowncasts() : null;
+
+                List<ShareholdersInfo> shareholdersInfos = apply1.getCustomerInfo() != null ? apply1.getCustomerInfo().getShareholders() : null;
+
+                List<ChangesInstructionInfo> changesInstructionInfos = apply1.getCustomerInfo() != null ? apply1.getCustomerInfo().getChangesInstructions() : null;
+
+                List<AccountInfo> accountInfos = apply1.getCustomerInfo() != null ? apply1.getCustomerInfo().getAccountInfoList() : null;
+
+                System.out.println(FlexJsonUtils.toJsonDeep(new ApplyInfo(apply1)));
+
+                System.out.println(FlexJsonUtils.toJsonDeep(apply1.getAttachList()));
+
+                postForEntity(url, new ModelMap("customer", FlexJsonUtils.toJsonDeep(new CustomerInfo(apply1.getCustomerInfo())))
+                        .addAttribute("apply", FlexJsonUtils.toJsonDeep(new ApplyInfo(apply1)))
+                        .addAttribute("associateCompany", FlexJsonUtils.toJsonDeep(companyInfos))
+                        .addAttribute("businessCondition", FlexJsonUtils.toJsonDeep(conditionInfos))
+                        .addAttribute("customerExcutive", FlexJsonUtils.toJsonDeep(customerExcutiveInfos))
+                        .addAttribute("financeCondition", FlexJsonUtils.toJsonDeep(conditionInfo))
+                        .addAttribute("mfCust", FlexJsonUtils.toJsonDeep(purcCustInfos))
+                        .addAttribute("attaches", FlexJsonUtils.toJsonDeep(apply1.getAttachList()))
+                        .addAttribute("prouductMixe", FlexJsonUtils.toJsonDeep(productMixInfos))
+                        .addAttribute("updowncast", FlexJsonUtils.toJsonDeep(updowncastInfos))
+                        .addAttribute("shareholders", FlexJsonUtils.toJsonDeep(shareholdersInfos))
+                        .addAttribute("changeInstruction", FlexJsonUtils.toJsonDeep(changesInstructionInfos))
+                        .addAttribute("accountList", FlexJsonUtils.toJsonDeep(accountInfos))
+                );
+            }
+        }
+    }
+}

+ 4 - 4
src/test/java/com/uas/erp/test/XmlTest.java

@@ -19,12 +19,12 @@ public class XmlTest {
 
 //    @Test
     public void parseXml() throws Exception{
-        String xmlStr = FileCopyUtils.copyToString(new FileReader("C:\\Users\\Pro1\\MicroServiceGit\\uas2.0\\uas-schedular\\src\\main\\resources\\database\\template\\deputyOrder.xml"));
+        String xmlStr = FileCopyUtils.copyToString(new FileReader("E:\\file\\test\\deputyOrder.xml"));
         Map<String, Object> model = new HashMap<>();
-        model.put("orders", getOrders(10));
+        model.put("orders", getOrders(2));
         long start = System.currentTimeMillis();
         String str = SqlTemplate.fromXml(xmlStr, model);
-        StreamUtils.copy(str, Charset.defaultCharset(), new FileOutputStream("C:\\Users\\Pro1\\MicroServiceGit\\uas2.0\\uas-schedular\\src\\test\\deputyOrder.sql"));
+        StreamUtils.copy(str, Charset.defaultCharset(), new FileOutputStream("E:\\file\\test\\deputyOrder.sql"));
         System.out.println("used: " + (System.currentTimeMillis() - start));
     }
 
@@ -42,7 +42,7 @@ public class XmlTest {
             order.setMadealcode("M000" + i);
             order.setMadealdate(new Date());
             List<DeputyOrderItem> items = new ArrayList<>();
-            for (int j = 0; j < 10; j++) {
+            for (int j = 0; j < 2; j++) {
                 DeputyOrderItem item = new DeputyOrderItem();
                 item.setProdname("测试物料" + i + "-" + j);
                 item.setProdcode("P-" + i + "-" + j);