Преглед изворни кода

ExpressGeoServiceImpl服务初始化

jlutt@163.com пре 2 година
родитељ
комит
d15375d0ac

+ 7 - 0
conf/application-ddWebOne.xml

@@ -39,6 +39,8 @@
             <property name="bookEndYear" value="2030"/>
             <property name="bookSplitKind" value="1"/>
 
+            <property name="riderGeoShards" value="4" />
+
             <property name="webSocketServerName" value="dws"/>
 
             <!--分厂维护服务地址-->
@@ -284,6 +286,11 @@
                 <master value="true"/>
                 <isUseScriptService value="true"/>
             </service>
+
+            <service value="com.dderp.business.service.flycat.ExpressGeoServiceImpl" groups="DELIVER_SERVICE_REMOTE">
+                <master value="true"/>
+                <isUseScriptService value="true"/>
+            </service>
         </services>
     </server>
 </application>

+ 13 - 4
conf/sqlroot/com/dderp/business/dao/PlatformDao.dql

@@ -92,9 +92,18 @@ values
 #{updatetimelong} );
 
 -- [updatePlatformRequire]
-update $table$ set requireName = #{requirename},valueType = #{valuetype},updateBy = #{updateby},
-updateTime = #{updatetime},updateTimeLong = #{updatetimelong} where id = #{id};
+update $table$ set
+requireCode = #{requirecode},
+requireName = #{requirename},
+updateBy = #{updateby},
+updateTime = #{updatetime},
+updateTimeLong = #{updatetimelong}
+where id = #{id};
 
 -- [voidPlatformRequire]
-update $table$ set voidFlag = #{voidflag},updateBy = #{updateby},
-updateTime = #{updatetime},updateTimeLong = #{updatetimelong} where id = #{id};
+update $table$ set
+voidFlag = #{voidflag},
+updateBy = #{updateby},
+updateTime = #{updatetime},
+updateTimeLong = #{updatetimelong}
+where id = #{id};

+ 1 - 0
ddBusiness/src/main/java/com/dderp/business/service/PlatformServiceImpl.java

@@ -249,6 +249,7 @@ public class PlatformServiceImpl extends BaseService implements PlatformService
         if (esInfo == null)
             return RetResult.<PlatformRequire>errorT().retinfo("平台接入需求档案不存在");
 
+        esInfo.setRequireCode(platformRequire.getRequireCode());
         esInfo.setRequireName(platformRequire.getRequireName());
         esInfo.setValueType(platformRequire.getValueType());
 

+ 0 - 1
ddBusiness/src/main/java/com/dderp/business/service/SupplierInitImpl.java

@@ -72,7 +72,6 @@ import java.util.stream.Stream;
 @ResourceType(SupplierInitService.class)
 @Priority(7999)
 public class SupplierInitImpl extends BaseService implements SupplierInitService {
-    private static class Invalid{}
 
     @Resource
     ESClient esClient;

+ 9 - 0
ddBusiness/src/main/java/com/dderp/business/service/flycat/ExpressGeoServiceImpl.java

@@ -2,6 +2,7 @@ package com.dderp.business.service.flycat;
 
 import com.dderp.common.api.NoSqlKeysService;
 import com.dderp.common.api.PlatformService;
+import com.dderp.common.api.SupplierInitService;
 import com.dderp.common.api.flycat.ExpressGeoService;
 import com.dderp.common.api.flycat.ExpressOutService;
 import com.dderp.common.base.BaseService;
@@ -10,6 +11,7 @@ import com.dderp.common.entity.base.InvokeCallParams;
 import com.dderp.common.entity.base.InvokeCallResult;
 import com.dderp.common.entity.geo.RiderGeoInfo;
 import com.dderp.common.entity.platform.PlatformInfo;
+import com.dderp.common.entity.system.KeyValuePair;
 import com.dderp.common.tool.ERPUtils;
 import com.dySweetFishPlugin.redis.RedisService;
 import com.dySweetFishPlugin.tool.lang.ThreadFactoryWithNamePrefix;
@@ -54,6 +56,9 @@ public class ExpressGeoServiceImpl extends BaseService implements ExpressGeoServ
     @Resource
     ExpressOutService expressOutService;
 
+    @Resource
+    SupplierInitService supplierService;
+
     private final List<ScheduledThreadPoolExecutor> scheduleScanThreadList = new ArrayList<>();
 
     private ExecutorService riderWorkExecutor;
@@ -96,6 +101,10 @@ public class ExpressGeoServiceImpl extends BaseService implements ExpressGeoServ
     @Override
     public void start(AnyValue config) {
         super.start(config);
+
+        //本来想放在supplierInitImpl中启动初始化,但代码侵入有些多,暂时先放在自己的服务中初始化
+        List<KeyValuePair> dataItemList = supplierService.getDataBaseItemList();
+        dataItemList.forEach((x) -> initScanThread(x.getKey(), Long.parseLong(x.getValue())));
     }
 
     public void initScanThread(String dataSourceId, long supplierCode) {