zhuyifan

fix

......@@ -81,6 +81,6 @@ public class SkuSellQuantity extends Model<OrderDetailDb> implements Serializabl
private Integer updateSource;
@TableLogic
private Integer isDeleted;
private Boolean isDeleted;
}
\ No newline at end of file
......
......@@ -667,7 +667,9 @@ public class OrderGrpcService extends ClientCustomerOrderServiceRpcGrpc.ClientCu
queryWrapper.eq(SkuSellQuantity::getEnterpriseId, request.getEnterpriseId());
queryWrapper.eq(SkuSellQuantity::getStallId, request.getStallId());
final var list = skuSellQuantityService.list(queryWrapper);
if (!list.isEmpty()) {
builder.addAllResponses(ProtoBeanUtil.beanListToProtoList(list, SingleSkuSellQuantityRpcResponse.class));
}
} catch (final Exception e) {
log.error("querySkuSellQuantitiesByStall error;", e);
responseStreamObserver.onError(Status.INTERNAL.withDescription(e.getMessage()).asException());
......@@ -687,7 +689,9 @@ public class OrderGrpcService extends ClientCustomerOrderServiceRpcGrpc.ClientCu
queryWrapper.eq(SkuSellQuantity::getStallId, request.getStallId());
queryWrapper.in(SkuSellQuantity::getSkuId, request.getSkuIdsList());
final var list = skuSellQuantityService.list(queryWrapper);
if (!list.isEmpty()) {
builder.addAllResponses(ProtoBeanUtil.beanListToProtoList(list, SingleSkuSellQuantityRpcResponse.class));
}
} catch (final Exception e) {
log.error("querySkuSellQuantitiesByStallAndSkuIds error;", e);
responseStreamObserver.onError(Status.INTERNAL.withDescription(e.getMessage()).asException());
......
package com.tianting.infoloop.utils;
import cn.hutool.core.date.LocalDateTimeUtil;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.TypeAdapter;
......@@ -11,7 +9,6 @@ import com.google.gson.stream.JsonWriter;
import com.google.protobuf.Message;
import com.google.protobuf.MessageOrBuilder;
import com.google.protobuf.util.JsonFormat;
import com.tianting.infoloop.constants.DateFormatterConstants;
import lombok.SneakyThrows;
import java.io.IOException;
......@@ -19,6 +16,7 @@ import java.lang.reflect.Constructor;
import java.time.Instant;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
......@@ -158,27 +156,10 @@ public class ProtoBeanUtil {
@Override
public LocalDate read(JsonReader in) throws IOException {
return LocalDate.ofInstant(Instant.ofEpochMilli(Long.parseLong(in.nextString())), DateFormatterConstants.CHINA_ZONE);
}
}
)
// .registerTypeAdapter(JsonNode.class, new TypeAdapter<JsonNode>() {
// private final ObjectMapper objectMapper = new ObjectMapper();
// @Override
// public void write(JsonWriter out, JsonNode value) throws IOException {
// if (value!= null) {
// out.value(value.toString());
// } else {
// out.nullValue();
// }
// }
//
// @Override
// public JsonNode read(JsonReader in) throws IOException {
// return objectMapper.readValue(in.nextString(), JsonNode.class);
// }
// })
.create();
return LocalDate.ofInstant(Instant.ofEpochMilli(Long.parseLong(in.nextString())), ZoneId.of("Asia/Shanghai"));
}
}
).create();
return gson;
}
......