|
|
@@ -6,6 +6,7 @@ import com.skyversation.xjcy.bean.*;
|
|
|
import com.skyversation.xjcy.dms.DMSQuery;
|
|
|
import com.skyversation.xjcy.dms.DMSService;
|
|
|
import com.skyversation.xjcy.enums.EnterpriseLevel;
|
|
|
+import com.skyversation.xjcy.oauth.LoginService;
|
|
|
import com.skyversation.xjcy.util.SpecialisationStringCollector;
|
|
|
import com.skyversation.xjcy.util.TimeUtil;
|
|
|
import lombok.NoArgsConstructor;
|
|
|
@@ -55,6 +56,8 @@ public class DataCountService {
|
|
|
private final AtomicLong lastStartTime = new AtomicLong(0);
|
|
|
|
|
|
private final AtomicBoolean running = new AtomicBoolean(false);
|
|
|
+ @Resource
|
|
|
+ private LoginService loginService;
|
|
|
|
|
|
@PostConstruct
|
|
|
public void tryCount() {
|
|
|
@@ -113,22 +116,15 @@ public class DataCountService {
|
|
|
buildMap = new LinkedMultiValueMap<>();
|
|
|
allPark = new ArrayList<>();
|
|
|
|
|
|
- String token;
|
|
|
- try {
|
|
|
- token = dmsService.loginForToken();
|
|
|
- } catch (Exception e) {
|
|
|
- throw new RuntimeException(e);
|
|
|
- }
|
|
|
-
|
|
|
LocalDate now = LocalDate.now();
|
|
|
|
|
|
- //统一查询所有需要的数据避免处理时间太长token过期,数据量大不了所以不做流式
|
|
|
- List<IndustrialPark> allIndustrialPark = dmsService.query(token, DMSQuery.INDUSTRIAL_PARK, IndustrialPark.class, now);
|
|
|
- List<Enterprise> allEnterprise = dmsService.query(token, DMSQuery.ENTERPRISE, Enterprise.class, now);
|
|
|
- List<EnterpriseEconomic> inDateEnterpriseEconomic = dmsService.query(token, DMSQuery.ECONOMIC_ALL_INDEED, EnterpriseEconomic.class, now);
|
|
|
- List<Order> allOrder = dmsService.query(token, DMSQuery.ORDER, Order.class, now);
|
|
|
- List<LeaseDetail> lastLeaseDetail = dmsService.query(token, DMSQuery.LAST_LEASE_DETAIL, LeaseDetail.class, now);
|
|
|
- List<LeaseDetail> lastYearLease = dmsService.query(token, DMSQuery.LAST_YEAR_LEASE_DETAIL, LeaseDetail.class, now);
|
|
|
+ //数据量大不了所以不做流式
|
|
|
+ List<IndustrialPark> allIndustrialPark = dmsService.query(loginService.getToken(), DMSQuery.INDUSTRIAL_PARK, IndustrialPark.class, now);
|
|
|
+ List<Enterprise> allEnterprise = dmsService.query(loginService.getToken(), DMSQuery.ENTERPRISE, Enterprise.class, now);
|
|
|
+ List<EnterpriseEconomic> inDateEnterpriseEconomic = dmsService.query(loginService.getToken(), DMSQuery.ECONOMIC_ALL_INDEED, EnterpriseEconomic.class, now);
|
|
|
+ List<Order> allOrder = dmsService.query(loginService.getToken(), DMSQuery.ORDER, Order.class, now);
|
|
|
+ List<LeaseDetail> lastLeaseDetail = dmsService.query(loginService.getToken(), DMSQuery.LAST_LEASE_DETAIL, LeaseDetail.class, now);
|
|
|
+ List<LeaseDetail> lastYearLease = dmsService.query(loginService.getToken(), DMSQuery.LAST_YEAR_LEASE_DETAIL, LeaseDetail.class, now);
|
|
|
//处理一下拿到的数据,建一建索引
|
|
|
Map<String, List<EnterpriseEconomic>> enterpriseEconomicMap = new HashMap<>();
|
|
|
inDateEnterpriseEconomic.forEach(e -> {
|