|
|
@@ -1,12 +1,9 @@
|
|
|
package com.uas.credit.controller;
|
|
|
|
|
|
-import com.uas.credit.model.*;
|
|
|
-import com.uas.credit.model.abnormalinfo.AbnormalRoot;
|
|
|
-import com.uas.credit.model.corpcreditinfo.EncreditinfoRoot;
|
|
|
-import com.uas.credit.model.corpriskinfo.EnRiskInfoRoot;
|
|
|
-import com.uas.credit.model.debtinfo.EndeptinfoRoot;
|
|
|
-import com.uas.credit.model.personCorporation.PersonCorporationRoot;
|
|
|
-import com.uas.credit.model.personal.PoliceCheckRoot;
|
|
|
+import com.uas.credit.model.EnterpriseJson;
|
|
|
+import com.uas.credit.model.EnterpriseQuery;
|
|
|
+import com.uas.credit.model.PersonJson;
|
|
|
+import com.uas.credit.model.PersonQuery;
|
|
|
import com.uas.credit.service.*;
|
|
|
import com.uas.credit.util.FlexJsonUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
@@ -14,6 +11,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import java.util.Date;
|
|
|
+
|
|
|
/**
|
|
|
* UAS查询入口
|
|
|
* created by shicr on 2018/6/6
|
|
|
@@ -50,50 +49,49 @@ public class ErpQueryController {
|
|
|
* ERP对企业进行查询
|
|
|
*/
|
|
|
@RequestMapping(value = "/queryEn", method = RequestMethod.POST)
|
|
|
- public EnterpriseQueryResult queryEn(String data) {
|
|
|
+ public EnterpriseJson queryEn(String data) {
|
|
|
EnterpriseQuery erpQuery = FlexJsonUtils.fromJson(data, EnterpriseQuery.class);
|
|
|
- EnterpriseQueryResult enQuery = new EnterpriseQueryResult();
|
|
|
+
|
|
|
+ EnterpriseJson enterpriseJson = enterpriseJsonService.findByCreateTime(new Date());
|
|
|
+ if (enterpriseJson != null && enterpriseJson.getEndept() != null) {
|
|
|
+ return enterpriseJson;
|
|
|
+ }
|
|
|
if (erpQuery != null) {
|
|
|
// 查询企业债务信息
|
|
|
- EndeptinfoRoot endeptinfoRoot = enterpriseDeptService.queryAndSave(erpQuery);
|
|
|
+ String endeptinfoRoot = enterpriseDeptService.queryEnterpriseDept(erpQuery);
|
|
|
// 查询企业经营异常信息
|
|
|
- AbnormalRoot abnormalRoot = enexceptionService.queryAndSave(erpQuery);
|
|
|
+ String abnormalRoot = enexceptionService.queryEnexception(erpQuery);
|
|
|
// 查询企业信用信息
|
|
|
- EncreditinfoRoot encreditinfoRoot = creditInfoService.queryAndSave(erpQuery);
|
|
|
+ String encreditinfoRoot = creditInfoService.queryEnCreditInfo(erpQuery);
|
|
|
// 查询企业风险信息
|
|
|
- EnRiskInfoRoot enRiskInfoRoot = enRiskInfoService.queryAndSave(erpQuery);
|
|
|
- enQuery.setEndept(endeptinfoRoot);
|
|
|
- enQuery.setEnexception(abnormalRoot);
|
|
|
- enQuery.setEnrisk(enRiskInfoRoot);
|
|
|
- enQuery.setEncredit(encreditinfoRoot);
|
|
|
-
|
|
|
- // 将调用接口返回数据保存到数据库
|
|
|
- String json = FlexJsonUtils.toJson(enQuery);
|
|
|
- EnterpriseJson enterpriseJson = new EnterpriseJson(json);
|
|
|
+ String enRiskInfoRoot = enRiskInfoService.queryEnRiskInfo(erpQuery);
|
|
|
+ enterpriseJson = new EnterpriseJson(endeptinfoRoot, abnormalRoot, encreditinfoRoot, enRiskInfoRoot);
|
|
|
+
|
|
|
enterpriseJsonService.save(enterpriseJson);
|
|
|
}
|
|
|
- return enQuery;
|
|
|
+ return enterpriseJson;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* erp对个人进行查询
|
|
|
*/
|
|
|
@RequestMapping(value = "/queryPe", method = RequestMethod.POST)
|
|
|
- public PersonQueryResult queryPerson(String data) {
|
|
|
+ public PersonJson queryPerson(String data) {
|
|
|
PersonQuery erpQuery = FlexJsonUtils.fromJson(data, PersonQuery.class);
|
|
|
- PersonQueryResult result = new PersonQueryResult();
|
|
|
+ PersonJson personJson = personJsonService.findByCreateTime(new Date());
|
|
|
+ if (personJson != null && personJson.getPnidentity() != null) {
|
|
|
+ return personJson;
|
|
|
+ }
|
|
|
if (erpQuery != null) {
|
|
|
// 查询个人身份信息
|
|
|
- PoliceCheckRoot policeCheckRoot = personalService.queryAndSave(erpQuery);
|
|
|
+ String policeCheckRoot = personalService.queryPoliceCheck(erpQuery);
|
|
|
// 查询个人股东信息
|
|
|
- PersonCorporationRoot personCorporationRoot = personCorporationService.queryAndSave(erpQuery);
|
|
|
- result.setPnidentity(policeCheckRoot);
|
|
|
- result.setPnshareholder(personCorporationRoot);
|
|
|
+ String personCorporationRoot = personCorporationService.queryPersonCorporation(erpQuery);
|
|
|
+
|
|
|
|
|
|
- String json = FlexJsonUtils.toJson(result);
|
|
|
- PersonJson personJson = new PersonJson(json);
|
|
|
+ personJson = new PersonJson(policeCheckRoot, personCorporationRoot);
|
|
|
personJsonService.save(personJson);
|
|
|
}
|
|
|
- return result;
|
|
|
+ return personJson;
|
|
|
}
|
|
|
}
|