scr vor 8 Jahren
Ursprung
Commit
e94c7b8d7c

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

@@ -84,7 +84,7 @@ public class CustInfo {
     /**
      * 办公地址
      */
-    private String cu_officeaddcode;
+    private String cu_officeadd;
 
     /**
      * 经营范围
@@ -294,12 +294,12 @@ public class CustInfo {
         this.cu_redaddcode = cu_redaddcode;
     }
 
-    public String getCu_officeaddcode() {
-        return cu_officeaddcode;
+    public String getCu_officeadd() {
+        return cu_officeadd;
     }
 
-    public void setCu_officeaddcode(String cu_officeaddcode) {
-        this.cu_officeaddcode = cu_officeaddcode;
+    public void setCu_officeadd(String cu_officeadd) {
+        this.cu_officeadd = cu_officeadd;
     }
 
     public String getCu_businsscope() {

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

@@ -318,7 +318,7 @@ public class CustomerInfo {
             this.cu_regcapital = info.getCu_regcapital();
             this.cu_paidincapital = info.getCu_paidincapital();
             this.cu_redaddcode = info.getCu_redaddcode();
-            this.cu_officeadd = info.getCu_businesscode();
+            this.cu_officeadd = info.getCu_officeadd();
             this.cu_businsscope = info.getCu_businsscope();
             this.cu_others = info.getCu_others();
             this.cu_enuu = info.getCu_enuu();

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

@@ -0,0 +1,91 @@
+package com.uas.erp.test;
+
+import com.alibaba.fastjson.JSONObject;
+import com.uas.api.crypto.util.FlexJsonUtils;
+import com.uas.erp.schedular.UasSchedulingApplication;
+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.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+import org.springframework.ui.ModelMap;
+import org.springframework.util.CollectionUtils;
+import org.springframework.util.StringUtils;
+
+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("YITOA_BL");
+        master.setMa_uu(10046945L);
+        master.setMa_accesssecret("600d3f07955ba67fe050007f01002db2");
+        master.setMa_env("test");
+        master.setMa_name("YITOA_BL");
+        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);
+        System.out.println("applies"+applies);
+        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;
+
+                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))
+                );
+            }
+        }
+        String idStr = jsonObject.getString("idStr");
+        if (!StringUtils.isEmpty(idStr)) {
+            post("/erp/finance/back", dataWrap(idStr));
+        }
+    }
+
+}