|
|
@@ -2,18 +2,14 @@ package com.dderp.business.service;
|
|
|
|
|
|
import com.dderp.business.dao.StoreDao;
|
|
|
import com.dderp.common.api.NoSqlKeysService;
|
|
|
-import com.dderp.common.api.PlatformService;
|
|
|
import com.dderp.common.api.SortBuilderExecutor;
|
|
|
import com.dderp.common.api.StoreService;
|
|
|
import com.dderp.common.base.BaseService;
|
|
|
import com.dderp.common.datas.ESKeys;
|
|
|
-import com.dderp.common.datas.business.PlatformType;
|
|
|
-import com.dderp.common.entity.platform.PlatformInfo;
|
|
|
import com.dderp.common.entity.site.ERPTokenUser;
|
|
|
import com.dderp.common.entity.store.*;
|
|
|
import com.dderp.common.tool.ERPUtils;
|
|
|
import com.dySweetFishPlugin.elasticsearch.ESClient;
|
|
|
-import com.dySweetFishPlugin.sql.RMapUtils;
|
|
|
import com.dySweetFishPlugin.sql.TableIdService;
|
|
|
import com.dySweetFishPlugin.sql.dao.TunaService;
|
|
|
import com.sweetfish.convert.json.JsonConvert;
|
|
|
@@ -24,11 +20,9 @@ import com.sweetfish.util.AnyValue;
|
|
|
import com.sweetfish.util.AutoLoad;
|
|
|
import com.sweetfish.util.ResourceType;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
-import org.apache.lucene.search.join.ScoreMode;
|
|
|
import org.elasticsearch.action.DocWriteResponse;
|
|
|
import org.elasticsearch.action.bulk.BulkRequestBuilder;
|
|
|
import org.elasticsearch.action.bulk.BulkResponse;
|
|
|
-import org.elasticsearch.action.index.IndexRequestBuilder;
|
|
|
import org.elasticsearch.action.index.IndexResponse;
|
|
|
import org.elasticsearch.action.support.WriteRequest;
|
|
|
import org.elasticsearch.action.update.UpdateRequest;
|
|
|
@@ -37,14 +31,12 @@ import org.elasticsearch.index.query.BoolQueryBuilder;
|
|
|
import org.elasticsearch.index.query.Operator;
|
|
|
import org.elasticsearch.index.query.QueryBuilders;
|
|
|
import org.elasticsearch.index.reindex.DeleteByQueryAction;
|
|
|
-import org.elasticsearch.join.query.JoinQueryBuilders;
|
|
|
import org.elasticsearch.search.sort.SortBuilders;
|
|
|
import org.elasticsearch.search.sort.SortOrder;
|
|
|
import org.rex.RMap;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.io.IOException;
|
|
|
-import java.math.BigDecimal;
|
|
|
import java.util.*;
|
|
|
import java.util.concurrent.ExecutionException;
|
|
|
import java.util.stream.Collectors;
|
|
|
@@ -353,7 +345,7 @@ public class StoreServiceImpl extends BaseService implements StoreService {
|
|
|
);
|
|
|
|
|
|
if (readInvoice) {
|
|
|
- StoreInvoiceInfo storeInvoiceInfo = this.getStoreInvoiceInfo(idStore,supplierCode);
|
|
|
+ StoreInvoiceInfo storeInvoiceInfo = this.getStoreInvoiceInfo(idStore, supplierCode);
|
|
|
storeInfo.setInvoiceInfo(storeInvoiceInfo);
|
|
|
}
|
|
|
|
|
|
@@ -362,12 +354,12 @@ public class StoreServiceImpl extends BaseService implements StoreService {
|
|
|
}
|
|
|
|
|
|
if (readPlatform) {
|
|
|
- List<StorePlatform> platformList = searchESList(esClient,jsonConvert,StorePlatform.class,
|
|
|
+ List<StorePlatform> platformList = searchESList(esClient, jsonConvert, StorePlatform.class,
|
|
|
null,
|
|
|
((sd) -> {
|
|
|
BoolQueryBuilder qb = QueryBuilders.boolQuery();
|
|
|
qb = qb.must(QueryBuilders.typeQuery(ESKeys.ES_DELIVER_STORE_PLATFORM_TYPE))
|
|
|
- .must(QueryBuilders.termQuery("idStore",idStore));
|
|
|
+ .must(QueryBuilders.termQuery("idStore", idStore));
|
|
|
|
|
|
return qb;
|
|
|
}),
|
|
|
@@ -614,15 +606,29 @@ public class StoreServiceImpl extends BaseService implements StoreService {
|
|
|
|
|
|
|
|
|
@Override
|
|
|
- public StorePlatform getStoreStorePlatformInfo(long id, long supplierCode) {
|
|
|
+ public StorePlatform getStorePlatformInfo(long id, long supplierCode) {
|
|
|
return this.getESOneInfo(esClient, jsonConvert, StorePlatform.class,
|
|
|
String.valueOf(id),
|
|
|
- keysService.getESKey(ESKeys.ES_DELIVER_PLATFORM_INFO_INDEX, supplierCode),
|
|
|
+ keysService.getESKey(ESKeys.ES_DELIVER_STORE_PLATFORM_INDEX, supplierCode),
|
|
|
ESKeys.ES_DELIVER_STORE_PLATFORM_TYPE,
|
|
|
null);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ public StorePlatform getStorePlatformByInvokeInfo(String platformStoreId, String platformCode, long supplierCode) {
|
|
|
+ return this.getESOneInfo(esClient, jsonConvert, StorePlatform.class,
|
|
|
+ (a) -> {
|
|
|
+ BoolQueryBuilder qb = QueryBuilders.boolQuery().must(QueryBuilders.typeQuery(ESKeys.ES_DELIVER_STORE_PLATFORM_TYPE));
|
|
|
+ qb.must(QueryBuilders.termQuery("platformStoreId.raw", platformStoreId))
|
|
|
+ .must(QueryBuilders.termQuery("platformCode.raw", platformCode));
|
|
|
+
|
|
|
+ return qb;
|
|
|
+ },
|
|
|
+ keysService.getESKey(ESKeys.ES_DELIVER_STORE_PLATFORM_INDEX, supplierCode),
|
|
|
+ null);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
public RetResult<StorePlatform> addStorePlatform(StorePlatform storePlatform, ERPTokenUser currentUser, String dataSourceId, long supplierCode) {
|
|
|
StorePlatform esInfo = this.getESOneInfo(esClient, jsonConvert,
|
|
|
StorePlatform.class,
|
|
|
@@ -675,7 +681,7 @@ public class StoreServiceImpl extends BaseService implements StoreService {
|
|
|
|
|
|
@Override
|
|
|
public RetResult<StorePlatform> configStorePlatform(StorePlatform storePlatform, ERPTokenUser currentUser, String dataSourceId, long supplierCode) {
|
|
|
- StorePlatform esInfo = this.getStoreStorePlatformInfo(storePlatform.getId(), supplierCode);
|
|
|
+ StorePlatform esInfo = this.getStorePlatformInfo(storePlatform.getId(), supplierCode);
|
|
|
if (esInfo == null) {
|
|
|
return RetResult.<StorePlatform>errorT().retinfo("未找到此开通平台");
|
|
|
}
|