gongfuzhu il y a 9 mois
Parent
commit
7a2dfcfbc2

+ 10 - 1
SpringBatchServiceServer/src/main/java/com/zswl/cloud/springBtach/server/core/publish/CinemaPublish.java

@@ -77,13 +77,22 @@ public class CinemaPublish implements ProductPublish {
                 String names = entry.get("name").toString();
                 BigDecimal lng = (BigDecimal) entry.get("lng");
                 BigDecimal lat = (BigDecimal) entry.get("lat");
+                String address = entry.get("address").toString();
+                BigDecimal bigDecimal = new BigDecimal(entry.get("sellPrice").toString());
+                Long sellPrice = bigDecimal.multiply(BigDecimal.valueOf(100)).longValue();
+                LocationModel locationModel = new LocationModel();
+                locationModel.setLongitude(lng.doubleValue());
+                locationModel.setLatitude(lat.doubleValue());
+
                 productCenterStream.send(List.of(
                         ProductPushModel.builder()
                                 .regionCode(productTriggerTask.getRegion().getCode())
                                 .pid(cinemaCode)
                                 .productType(ProductType.Cinema)
                                 .title(names)
-                                .locationPoint(LocationModel.builder().longitude(lng.doubleValue()).latitude(lat.doubleValue()).build())
+                                .address(address)
+                                .salePrice(sellPrice)
+                                .locationPoint(locationModel)
                                 .meta(Map.of("cinemas", entry))
                                 .build()
                 ));

+ 1 - 1
SpringBatchServiceServer/src/main/java/com/zswl/cloud/springBtach/server/core/publish/ComingMoviePublish.java

@@ -89,7 +89,7 @@ public class ComingMoviePublish implements ProductPublish {
                         .cover(new String[]{posterUrl})
                         .title(movieName)
                         .meta(Map.of("movies", entry))
-//                        .expireTimeSecond(60 * 60 * 24)
+                        .expireTimeSecond(60 * 60 * 24)
                         .build()));
             } catch (Exception e) {
                 e.printStackTrace();

+ 6 - 0
SpringBatchServiceServer/src/main/java/com/zswl/cloud/springBtach/server/core/publish/HotelPublish.java

@@ -104,12 +104,18 @@ public class HotelPublish implements ProductPublish {
                             String chineseName = it.getChineseName();
                             String picture = it.getPicture();
                             BigDecimal price = it.getPrice();
+                            Double latitude = it.getLatitude();
+                            Double longitude = it.getLongitude();
+                            LocationModel locationModel = new LocationModel();
+                            locationModel.setLatitude(latitude);
+                            locationModel.setLongitude(longitude);
                             productCenterStream.send(List.of(ProductPushModel.builder()
                                     .regionCode(productTriggerTask.getRegion().getCode())
                                     .pid(hotelId)
                                     .productType(ProductType.Hotel)
                                     .cover(new String[]{picture})
                                     .salePrice(price.longValue())
+                                    .locationPoint(locationModel)
                                     .title(chineseName)
                                     .meta(Map.of("hotel", it))
 //                            .expireTimeSecond(60 * 60 * 24)

+ 3 - 4
SpringBatchServiceServer/src/main/java/com/zswl/cloud/springBtach/server/core/publish/TicketPublish.java

@@ -1,5 +1,6 @@
 package com.zswl.cloud.springBtach.server.core.publish;
 
+import cn.hutool.core.util.ObjectUtil;
 import com.github.microservice.productcenter.client.model.LocationModel;
 import com.github.microservice.productcenter.client.model.ProductPushModel;
 import com.github.microservice.productcenter.client.model.ProductTriggerTaskModel;
@@ -20,7 +21,6 @@ import java.util.Collection;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
-import java.util.stream.Collectors;
 
 @Slf4j
 @Component
@@ -67,16 +67,15 @@ public class TicketPublish implements ProductPublish {
 
             List<ScenicListResponse.rows> rows = scenicListResponse.getData().getRows();
 
-            if (rows.isEmpty()) {
+            if (ObjectUtil.isEmpty(rows)) {
                 return;
             }
             rows.forEach(it -> {
 
                 try {
-                    System.out.println(it);
                     LocationModel locationModel = new LocationModel();
                     String glocation = it.getGlocation();
-                    if (!glocation.isEmpty()) {
+                    if (ObjectUtil.isNotEmpty(glocation)) {
                         String[] split = glocation.split(",");
 
                         locationModel.setLatitude(Double.parseDouble(split[0]));