|
|
@@ -1,9 +1,11 @@
|
|
|
package com.uas.credit.controller;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
+import com.fasterxml.jackson.databind.annotation.JsonAppend;
|
|
|
+import com.uas.credit.model.EnterpriseQuery;
|
|
|
import com.uas.credit.model.ErpQuery;
|
|
|
-import com.uas.credit.service.EnterpriseService;
|
|
|
-import com.uas.credit.service.PersonalService;
|
|
|
+import com.uas.credit.model.PersonQuery;
|
|
|
+import com.uas.credit.service.*;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.ui.ModelMap;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
@@ -19,63 +21,77 @@ import java.net.URLDecoder;
|
|
|
* created by shicr on 2018/6/6
|
|
|
**/
|
|
|
@RestController
|
|
|
-@RequestMapping(value = "erpquery")
|
|
|
+@RequestMapping(value = "/erpquery")
|
|
|
public class ErpQueryController {
|
|
|
|
|
|
- private static String ENTERPRISE_DEPT = "22118";
|
|
|
-
|
|
|
- private static String ENTERPRISE_RISK = "22527";
|
|
|
-
|
|
|
- private static String ENTERPRISE_CREDIT = "95013";
|
|
|
-
|
|
|
- private static String ENTERPRISE_EXCEPTION = "22117";
|
|
|
+ @Autowired
|
|
|
+ private EnCreditInfoService creditInfoService;
|
|
|
|
|
|
- private static String PERSONAL_IDENTITY = "10602";
|
|
|
+ @Autowired
|
|
|
+ private EnexceptionService enexceptionService;
|
|
|
|
|
|
- private static String PERSONAL_SHAREHOLDER = "96002";
|
|
|
+ @Autowired
|
|
|
+ private EnRiskInfoService enRiskInfoService;
|
|
|
|
|
|
@Autowired
|
|
|
- private EnterpriseService enterpriseService;
|
|
|
+ private EnterpriseDeptService enterpriseDeptService;
|
|
|
|
|
|
@Autowired
|
|
|
private PersonalService personalService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private PersonCorporationService personCorporationService;
|
|
|
+
|
|
|
/**
|
|
|
- * ERP对企业或个人进行查询
|
|
|
+ * ERP对企业进行查询
|
|
|
*/
|
|
|
- @RequestMapping(value = "/erp/query",method = RequestMethod.GET)
|
|
|
- public ModelMap queryCredit(String json) {
|
|
|
+ @RequestMapping(value = "/queryEn",method = RequestMethod.GET)
|
|
|
+ public ModelMap queryEn(String json) {
|
|
|
ModelMap modelMap = new ModelMap();
|
|
|
- ErpQuery erpQuery = new ErpQuery();
|
|
|
+ EnterpriseQuery erpQuery = new EnterpriseQuery();
|
|
|
try {
|
|
|
String query = URLDecoder.decode(json, "utf-8");
|
|
|
- erpQuery = JSON.parseObject(query, ErpQuery.class);
|
|
|
+ erpQuery = JSON.parseObject(query, EnterpriseQuery.class);
|
|
|
} catch (UnsupportedEncodingException e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
if (erpQuery != null) {
|
|
|
- //查询企业
|
|
|
- if (erpQuery.getQueryType() == 0) {
|
|
|
//查询企业债务信息
|
|
|
- String Endept = enterpriseService.requestApi(PyConfig.HOST,PyConfig.PATH_UNZIP,ENTERPRISE_DEPT, "101");
|
|
|
+ String Endept = enterpriseDeptService.queryAndSave(erpQuery);
|
|
|
//查询企业经营异常信息
|
|
|
- String Enexception = enterpriseService.requestApi(PyConfig.HOST,PyConfig.PATH_UNZIP,ENTERPRISE_EXCEPTION, "");
|
|
|
+ String Enexception = enexceptionService.queryAndSave(erpQuery);
|
|
|
//查询企业信用信息
|
|
|
- String Encredit = enterpriseService.requestApi(PyConfig.HOST,PyConfig.PATH_UNZIP,ENTERPRISE_CREDIT, "");
|
|
|
+ String Encredit = creditInfoService.queryAndSave(erpQuery);
|
|
|
//查询企业风险信息
|
|
|
- String Enrisk = enterpriseService.requestApi(PyConfig.HOST,PyConfig.PATH_UNZIP,ENTERPRISE_RISK, "");
|
|
|
+ String Enrisk = enRiskInfoService.queryAndSave(erpQuery);
|
|
|
modelMap.put("Endept", Endept);
|
|
|
modelMap.put("Enexception", Enexception);
|
|
|
modelMap.put("Enrisk", Enrisk);
|
|
|
modelMap.put("Encredit", Encredit);
|
|
|
- } else if(erpQuery.getQueryType() == 1) {
|
|
|
- //查询个人身份信息
|
|
|
- String Pnidentity = personalService.getQueryCondition(PERSONAL_IDENTITY,"");
|
|
|
- //查询个人股东信息
|
|
|
- String Pnshareholder = personalService.getQueryCondition(PERSONAL_SHAREHOLDER,"");
|
|
|
- modelMap.put("Pnidentity",Pnidentity);
|
|
|
- modelMap.put("Pnshareholder",Pnshareholder);
|
|
|
- }
|
|
|
+ }
|
|
|
+ return modelMap;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * erp对个人进行查询
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/queryPe",method = RequestMethod.GET)
|
|
|
+ public ModelMap queryPerson(String json) {
|
|
|
+ ModelMap modelMap = new ModelMap();
|
|
|
+ PersonQuery erpQuery = new PersonQuery();
|
|
|
+ try {
|
|
|
+ String query = URLDecoder.decode(json, "utf-8");
|
|
|
+ erpQuery = JSON.parseObject(query, PersonQuery.class);
|
|
|
+ } catch (UnsupportedEncodingException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ if(erpQuery != null){
|
|
|
+ //查询个人身份信息
|
|
|
+ String Pnidentity = personalService.queryAndSave(erpQuery);
|
|
|
+ //查询个人股东信息
|
|
|
+ String Pnshareholder = personCorporationService.queryAndSave(erpQuery);
|
|
|
+ modelMap.put("Pnidentity",Pnidentity);
|
|
|
+ modelMap.put("Pnshareholder",Pnshareholder);
|
|
|
}
|
|
|
return modelMap;
|
|
|
}
|