|
@@ -1,5 +1,6 @@
|
|
|
package com.zswl.cloud.springBtach.server.core.publish;
|
|
|
|
|
|
+import com.github.microservice.auth.client.content.ResultContent;
|
|
|
import com.github.microservice.productcenter.client.model.LocationModel;
|
|
|
import com.github.microservice.productcenter.client.model.ProductPushModel;
|
|
|
import com.github.microservice.productcenter.client.model.ProductTriggerTaskModel;
|
|
@@ -9,19 +10,20 @@ import com.github.microservice.productcenter.client.service.ProductPushService;
|
|
|
import com.github.microservice.productcenter.client.stream.ProductCenterStream;
|
|
|
import com.github.microservice.productcenter.client.type.ProductType;
|
|
|
import com.github.microservice.productcenter.client.type.RegionType;
|
|
|
+import com.xiaoju.open.oil.interfaces.domain.StorePriceInfo;
|
|
|
import com.zswl.cloud.springBatch.client.model.dfy.Ticket.request.ScenicListRequest;
|
|
|
import com.zswl.cloud.springBatch.client.model.dfy.Ticket.response.ScenicListResponse;
|
|
|
+import com.zswl.cloud.springBatch.client.model.xiaoju.QueryApiStorePriceRequest;
|
|
|
import com.zswl.cloud.springBtach.server.core.api.dfy.TicketApi;
|
|
|
import com.zswl.cloud.springBtach.server.core.dao.XiaoJuStoreDao;
|
|
|
import com.zswl.cloud.springBtach.server.core.domain.XiaoJuStore;
|
|
|
+import com.zswl.cloud.springBtach.server.core.service.impl.XiaoJuServiceImpl;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
-import java.util.Collection;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
-import java.util.Set;
|
|
|
+import java.util.*;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
@Slf4j
|
|
|
@Component
|
|
@@ -31,6 +33,9 @@ public class PetrolStationPublish implements ProductPublish {
|
|
|
@Autowired
|
|
|
XiaoJuStoreDao xiaoJuStoreDao;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ XiaoJuServiceImpl xiaoJuService;
|
|
|
+
|
|
|
@Autowired
|
|
|
private ProductCenterStream productCenterStream;
|
|
|
|
|
@@ -60,7 +65,10 @@ public class PetrolStationPublish implements ProductPublish {
|
|
|
String name = region.getName();
|
|
|
|
|
|
xiaoJuStoreDao.findByCityNameContains(name).forEach(it -> {
|
|
|
+
|
|
|
try {
|
|
|
+ List<Integer> collect = it.getItemInfoList().stream().map(itemPriceInfo -> itemPriceInfo.getVipPrice()).collect(Collectors.toList());
|
|
|
+ Integer min = Collections.min(collect);
|
|
|
LocationModel locationModel = new LocationModel();
|
|
|
locationModel.setLongitude(it.getLon());
|
|
|
locationModel.setLatitude(it.getLat());
|
|
@@ -72,10 +80,12 @@ public class PetrolStationPublish implements ProductPublish {
|
|
|
.cover(it.getPicList().stream().toArray(String[]::new))
|
|
|
.title(it.getStoreName())
|
|
|
.address(it.getAddress())
|
|
|
+ .salePrice(Long.valueOf(min))
|
|
|
.meta(Map.of("store", it))
|
|
|
.locationPoint(locationModel)
|
|
|
.build()));
|
|
|
} catch (Exception e) {
|
|
|
+ log.info("错误店铺:{}", it);
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
|