Răsfoiți Sursa

简单优化及bug修复

ximinghao 1 săptămână în urmă
părinte
comite
044953151c

+ 2 - 0
src/main/java/com/skyversation/xjcy/dms/DMSColumnConfig.java

@@ -20,6 +20,7 @@ public class DMSColumnConfig {
     
     @PostConstruct
     public void init() {
+        System.out.println("初始化dms配置");
         JSONObject jsonObject = JSONObject.parseObject(data);
         Map<String,DMSColumn> dmsColumns = new HashMap<>();
         for (String key : jsonObject.keySet()) {
@@ -27,6 +28,7 @@ public class DMSColumnConfig {
             dmsColumns.put(key,new DMSColumn(value.getString("id"),value.getString("modelId")));
         }
         this.dmsColumns = Collections.unmodifiableMap(dmsColumns);
+        System.out.println("从配置读取了"+dmsColumns.size()+"条栏目");
     }
     
     public DMSColumn getDMSColumn(String columnName) {

+ 12 - 7
src/main/java/com/skyversation/xjcy/service/DataCountService.java

@@ -146,7 +146,7 @@ public class DataCountService {
 
         public EnterpriseEconomicCount(List<EnterpriseEconomic> enterpriseEconomicList) {
             for (EnterpriseEconomic enterpriseEconomic : enterpriseEconomicList) {
-                tax = tax.add(Optional.ofNullable(enterpriseEconomic.getCApprovedOutputValue()).orElse(BigDecimal.ZERO));
+                tax = tax.add(Optional.ofNullable(enterpriseEconomic.getCApprovedTax()).orElse(BigDecimal.ZERO));
                 product = product.add(Optional.ofNullable(enterpriseEconomic.getCApprovedOutputValue()).orElse(BigDecimal.ZERO));
                 revenue = revenue.add(Optional.ofNullable(enterpriseEconomic.getCApprovedRevenue()).orElse(BigDecimal.ZERO));
             }
@@ -443,11 +443,6 @@ public class DataCountService {
                 }
 
             }
-            List<String> sortedEnterprise = aliveEnterprise.stream().sorted((a, b) -> {
-                BigDecimal ar = economicCountBy12Month.get(a).revenue;
-                BigDecimal br = economicCountBy12Month.get(b).revenue;
-                return ar.compareTo(br) * -1;
-            }).limit(10).collect(Collectors.toList());
 
             JSONObject parkDataCount = new JSONObject();
             parkDataCount.put("totalTax", allTaxByYtdThisYear);
@@ -463,12 +458,22 @@ public class DataCountService {
             parkDataCount.put("enterPriseIndustry", enterPriceIndustryCount);
 
             JSONArray topRevenue = new JSONArray();
+            List<String> sortedEnterprise = aliveEnterprise.stream().sorted((a, b) -> {
+                BigDecimal ar = economicCountBy12Month.get(a).revenue;
+                BigDecimal br = economicCountBy12Month.get(b).revenue;
+                return ar.compareTo(br) * -1;
+            }).limit(10).collect(Collectors.toList());
             for (String enterPriseCode : sortedEnterprise) {
                 JSONObject outPut = new JSONObject();
                 Enterprise enterPrice = aliveEnterpriseMap.get(enterPriseCode);
+                BigDecimal product = economicCountBy12Month.get(enterPriseCode).product;
                 outPut.put("enterPriceCode", enterPriseCode);
                 outPut.put("enterPriceName", enterPrice.getCEnterpriseName());
-                outPut.put("enterPriceRevenue", economicCountBy12Month.get(enterPriseCode).revenue);
+                if (product.compareTo(BigDecimal.ZERO)==0){
+                    outPut.put("enterPriceRevenue","暂无");
+                }else {
+                    outPut.put("enterPriceRevenue",product);
+                }
                 topRevenue.add(outPut);
             }
 

+ 3 - 1
src/main/resources/application.yml

@@ -3,6 +3,8 @@ server:
   servlet:
     context-path: /xjcy/
 spring:
+  config:
+    import: file:${catalina.base}/conf/apps/xjcy/
   application:
     name: xjcy
   mvc:
@@ -20,7 +22,7 @@ logging:
           web:
             servlet: DEBUG
 app:
-  count-cache-length: ${COUNT_CACHE_LENGTH:5000}
+  count-cache-length: ${COUNT_CACHE_LENGTH:500000}
   execute-startup-tasks: ${EXECUTE_STARTUP_TASKS:false}
   dms:
     #    path: http://127.0.0.1:10081/dms