diff --git a/yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/response/order/StoreOrderDetailInfoResponse.java b/yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/response/order/StoreOrderDetailInfoResponse.java index b8663a3c1..931d07b87 100644 --- a/yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/response/order/StoreOrderDetailInfoResponse.java +++ b/yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/response/order/StoreOrderDetailInfoResponse.java @@ -1,9 +1,11 @@ package cn.iocoder.yudao.module.shop.response.order; +import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; +import org.springframework.format.annotation.DateTimeFormat; import java.io.Serializable; import java.math.BigDecimal; @@ -85,6 +87,8 @@ public class StoreOrderDetailInfoResponse implements Serializable { private String payType; @Schema(description = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date createTime; @Schema(description = "订单状态(0:待发货;1:待收货;2:已收货,待评价;3:已完成;)") diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/RechargeGearServiceImpl.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/RechargeGearServiceImpl.java index a184481e6..7ce76a52e 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/RechargeGearServiceImpl.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/RechargeGearServiceImpl.java @@ -107,21 +107,16 @@ public class RechargeGearServiceImpl implements RechargeGearService { List rechargeGearDOS = rechargeGearMapper.selectList(Wrappers.lambdaQuery() .eq(RechargeGearDO::getDeleted, 0)); List rechargeGearRespVOS = RechargeGearConvert.INSTANCE.convertList(rechargeGearDOS); - RechargeOrderDO orderDO = orderMapper.selectOne(Wrappers.lambdaQuery().eq(RechargeOrderDO::getUid, loginUser.getId()) - .eq(RechargeOrderDO::getPaid,1) - .last("LIMIT 1")); - if (Objects.nonNull(orderDO)) { - List infoDOS = phoneRecordMapper.selectList(Wrappers.lambdaQuery().eq(PhoneRecordDO::getRechargeOrderId, orderDO.getId())); - Map> collect = infoDOS.stream().collect(Collectors.groupingBy(PhoneRecordDO::getRechargeGearId)); - rechargeGearRespVOS.forEach(vo -> { - List infoDOS1 = collect.get(vo.getId()); - if (!CollectionUtils.isEmpty(infoDOS1)) { - vo.setIsExist("1"); - } else { - vo.setIsExist("0"); - } - }); - } + List infoDOS = phoneRecordMapper.selectList(Wrappers.lambdaQuery().eq(PhoneRecordDO::getUserId, loginUser.getId())); + Map> collect = infoDOS.stream().collect(Collectors.groupingBy(PhoneRecordDO::getRechargeGearId)); + rechargeGearRespVOS.forEach(vo -> { + List infoDOS1 = collect.get(vo.getId()); + if (!CollectionUtils.isEmpty(infoDOS1)) { + vo.setIsExist("1"); + } else { + vo.setIsExist("0"); + } + }); return rechargeGearRespVOS; } @@ -130,21 +125,16 @@ public class RechargeGearServiceImpl implements RechargeGearService { List rechargeGearDOS = rechargeGearMapper.selectList(Wrappers.lambdaQuery() .eq(RechargeGearDO::getDeleted, 0)); List rechargeGearRespVOS = RechargeGearConvert.INSTANCE.convertList(rechargeGearDOS); - RechargeOrderDO orderDO = orderMapper.selectOne(Wrappers.lambdaQuery().eq(RechargeOrderDO::getUserPhone, phone) - .eq(RechargeOrderDO::getPaid,1) - .last("LIMIT 1")); - if (Objects.nonNull(orderDO)) { - List infoDOS = phoneRecordMapper.selectList(Wrappers.lambdaQuery().eq(PhoneRecordDO::getRechargeOrderId, orderDO.getId())); - Map> collect = infoDOS.stream().collect(Collectors.groupingBy(PhoneRecordDO::getRechargeGearId)); - rechargeGearRespVOS.forEach(vo -> { - List infoDOS1 = collect.get(vo.getId()); - if (!CollectionUtils.isEmpty(infoDOS1)) { - vo.setIsExist("1"); - } else { - vo.setIsExist("0"); - } - }); - } + List infoDOS = phoneRecordMapper.selectList(Wrappers.lambdaQuery().eq(PhoneRecordDO::getPhone, phone)); + Map> collect = infoDOS.stream().collect(Collectors.groupingBy(PhoneRecordDO::getRechargeGearId)); + rechargeGearRespVOS.forEach(vo -> { + List infoDOS1 = collect.get(vo.getId()); + if (!CollectionUtils.isEmpty(infoDOS1)) { + vo.setIsExist("1"); + } else { + vo.setIsExist("0"); + } + }); return rechargeGearRespVOS; }