Showing
3 changed files
with
10 additions
and
25 deletions
| ... | @@ -81,6 +81,6 @@ public class SkuSellQuantity extends Model<OrderDetailDb> implements Serializabl | ... | @@ -81,6 +81,6 @@ public class SkuSellQuantity extends Model<OrderDetailDb> implements Serializabl |
| 81 | private Integer updateSource; | 81 | private Integer updateSource; |
| 82 | 82 | ||
| 83 | @TableLogic | 83 | @TableLogic |
| 84 | - private Integer isDeleted; | 84 | + private Boolean isDeleted; |
| 85 | 85 | ||
| 86 | } | 86 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -667,7 +667,9 @@ public class OrderGrpcService extends ClientCustomerOrderServiceRpcGrpc.ClientCu | ... | @@ -667,7 +667,9 @@ public class OrderGrpcService extends ClientCustomerOrderServiceRpcGrpc.ClientCu |
| 667 | queryWrapper.eq(SkuSellQuantity::getEnterpriseId, request.getEnterpriseId()); | 667 | queryWrapper.eq(SkuSellQuantity::getEnterpriseId, request.getEnterpriseId()); |
| 668 | queryWrapper.eq(SkuSellQuantity::getStallId, request.getStallId()); | 668 | queryWrapper.eq(SkuSellQuantity::getStallId, request.getStallId()); |
| 669 | final var list = skuSellQuantityService.list(queryWrapper); | 669 | final var list = skuSellQuantityService.list(queryWrapper); |
| 670 | + if (!list.isEmpty()) { | ||
| 670 | builder.addAllResponses(ProtoBeanUtil.beanListToProtoList(list, SingleSkuSellQuantityRpcResponse.class)); | 671 | builder.addAllResponses(ProtoBeanUtil.beanListToProtoList(list, SingleSkuSellQuantityRpcResponse.class)); |
| 672 | + } | ||
| 671 | } catch (final Exception e) { | 673 | } catch (final Exception e) { |
| 672 | log.error("querySkuSellQuantitiesByStall error;", e); | 674 | log.error("querySkuSellQuantitiesByStall error;", e); |
| 673 | responseStreamObserver.onError(Status.INTERNAL.withDescription(e.getMessage()).asException()); | 675 | responseStreamObserver.onError(Status.INTERNAL.withDescription(e.getMessage()).asException()); |
| ... | @@ -687,7 +689,9 @@ public class OrderGrpcService extends ClientCustomerOrderServiceRpcGrpc.ClientCu | ... | @@ -687,7 +689,9 @@ public class OrderGrpcService extends ClientCustomerOrderServiceRpcGrpc.ClientCu |
| 687 | queryWrapper.eq(SkuSellQuantity::getStallId, request.getStallId()); | 689 | queryWrapper.eq(SkuSellQuantity::getStallId, request.getStallId()); |
| 688 | queryWrapper.in(SkuSellQuantity::getSkuId, request.getSkuIdsList()); | 690 | queryWrapper.in(SkuSellQuantity::getSkuId, request.getSkuIdsList()); |
| 689 | final var list = skuSellQuantityService.list(queryWrapper); | 691 | final var list = skuSellQuantityService.list(queryWrapper); |
| 692 | + if (!list.isEmpty()) { | ||
| 690 | builder.addAllResponses(ProtoBeanUtil.beanListToProtoList(list, SingleSkuSellQuantityRpcResponse.class)); | 693 | builder.addAllResponses(ProtoBeanUtil.beanListToProtoList(list, SingleSkuSellQuantityRpcResponse.class)); |
| 694 | + } | ||
| 691 | } catch (final Exception e) { | 695 | } catch (final Exception e) { |
| 692 | log.error("querySkuSellQuantitiesByStallAndSkuIds error;", e); | 696 | log.error("querySkuSellQuantitiesByStallAndSkuIds error;", e); |
| 693 | responseStreamObserver.onError(Status.INTERNAL.withDescription(e.getMessage()).asException()); | 697 | responseStreamObserver.onError(Status.INTERNAL.withDescription(e.getMessage()).asException()); | ... | ... |
| 1 | package com.tianting.infoloop.utils; | 1 | package com.tianting.infoloop.utils; |
| 2 | 2 | ||
| 3 | import cn.hutool.core.date.LocalDateTimeUtil; | 3 | import cn.hutool.core.date.LocalDateTimeUtil; |
| 4 | -import com.fasterxml.jackson.databind.JsonNode; | ||
| 5 | -import com.fasterxml.jackson.databind.ObjectMapper; | ||
| 6 | import com.google.gson.Gson; | 4 | import com.google.gson.Gson; |
| 7 | import com.google.gson.GsonBuilder; | 5 | import com.google.gson.GsonBuilder; |
| 8 | import com.google.gson.TypeAdapter; | 6 | import com.google.gson.TypeAdapter; |
| ... | @@ -11,7 +9,6 @@ import com.google.gson.stream.JsonWriter; | ... | @@ -11,7 +9,6 @@ import com.google.gson.stream.JsonWriter; |
| 11 | import com.google.protobuf.Message; | 9 | import com.google.protobuf.Message; |
| 12 | import com.google.protobuf.MessageOrBuilder; | 10 | import com.google.protobuf.MessageOrBuilder; |
| 13 | import com.google.protobuf.util.JsonFormat; | 11 | import com.google.protobuf.util.JsonFormat; |
| 14 | -import com.tianting.infoloop.constants.DateFormatterConstants; | ||
| 15 | import lombok.SneakyThrows; | 12 | import lombok.SneakyThrows; |
| 16 | 13 | ||
| 17 | import java.io.IOException; | 14 | import java.io.IOException; |
| ... | @@ -19,6 +16,7 @@ import java.lang.reflect.Constructor; | ... | @@ -19,6 +16,7 @@ import java.lang.reflect.Constructor; |
| 19 | import java.time.Instant; | 16 | import java.time.Instant; |
| 20 | import java.time.LocalDate; | 17 | import java.time.LocalDate; |
| 21 | import java.time.LocalDateTime; | 18 | import java.time.LocalDateTime; |
| 19 | +import java.time.ZoneId; | ||
| 22 | import java.util.ArrayList; | 20 | import java.util.ArrayList; |
| 23 | import java.util.Collection; | 21 | import java.util.Collection; |
| 24 | import java.util.List; | 22 | import java.util.List; |
| ... | @@ -158,27 +156,10 @@ public class ProtoBeanUtil { | ... | @@ -158,27 +156,10 @@ public class ProtoBeanUtil { |
| 158 | 156 | ||
| 159 | @Override | 157 | @Override |
| 160 | public LocalDate read(JsonReader in) throws IOException { | 158 | public LocalDate read(JsonReader in) throws IOException { |
| 161 | - return LocalDate.ofInstant(Instant.ofEpochMilli(Long.parseLong(in.nextString())), DateFormatterConstants.CHINA_ZONE); | 159 | + return LocalDate.ofInstant(Instant.ofEpochMilli(Long.parseLong(in.nextString())), ZoneId.of("Asia/Shanghai")); |
| 162 | - } | 160 | + } |
| 163 | - } | 161 | + } |
| 164 | - ) | 162 | + ).create(); |
| 165 | -// .registerTypeAdapter(JsonNode.class, new TypeAdapter<JsonNode>() { | ||
| 166 | -// private final ObjectMapper objectMapper = new ObjectMapper(); | ||
| 167 | -// @Override | ||
| 168 | -// public void write(JsonWriter out, JsonNode value) throws IOException { | ||
| 169 | -// if (value!= null) { | ||
| 170 | -// out.value(value.toString()); | ||
| 171 | -// } else { | ||
| 172 | -// out.nullValue(); | ||
| 173 | -// } | ||
| 174 | -// } | ||
| 175 | -// | ||
| 176 | -// @Override | ||
| 177 | -// public JsonNode read(JsonReader in) throws IOException { | ||
| 178 | -// return objectMapper.readValue(in.nextString(), JsonNode.class); | ||
| 179 | -// } | ||
| 180 | -// }) | ||
| 181 | - .create(); | ||
| 182 | return gson; | 163 | return gson; |
| 183 | } | 164 | } |
| 184 | 165 | ... | ... |
-
Please register or login to post a comment