fix: 修改档次信息

pull/2/head
tangqian 2023-05-23 11:23:15 +08:00
parent d84b6869f5
commit aa88423153
2 changed files with 24 additions and 30 deletions

View File

@ -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已完成")

View File

@ -107,21 +107,16 @@ public class RechargeGearServiceImpl implements RechargeGearService {
List<RechargeGearDO> rechargeGearDOS = rechargeGearMapper.selectList(Wrappers.<RechargeGearDO>lambdaQuery()
.eq(RechargeGearDO::getDeleted, 0));
List<RechargeGearRespVO> rechargeGearRespVOS = RechargeGearConvert.INSTANCE.convertList(rechargeGearDOS);
RechargeOrderDO orderDO = orderMapper.selectOne(Wrappers.<RechargeOrderDO>lambdaQuery().eq(RechargeOrderDO::getUid, loginUser.getId())
.eq(RechargeOrderDO::getPaid,1)
.last("LIMIT 1"));
if (Objects.nonNull(orderDO)) {
List<PhoneRecordDO> infoDOS = phoneRecordMapper.selectList(Wrappers.<PhoneRecordDO>lambdaQuery().eq(PhoneRecordDO::getRechargeOrderId, orderDO.getId()));
Map<Long, List<PhoneRecordDO>> collect = infoDOS.stream().collect(Collectors.groupingBy(PhoneRecordDO::getRechargeGearId));
rechargeGearRespVOS.forEach(vo -> {
List<PhoneRecordDO> infoDOS1 = collect.get(vo.getId());
if (!CollectionUtils.isEmpty(infoDOS1)) {
vo.setIsExist("1");
} else {
vo.setIsExist("0");
}
});
}
List<PhoneRecordDO> infoDOS = phoneRecordMapper.selectList(Wrappers.<PhoneRecordDO>lambdaQuery().eq(PhoneRecordDO::getUserId, loginUser.getId()));
Map<Long, List<PhoneRecordDO>> collect = infoDOS.stream().collect(Collectors.groupingBy(PhoneRecordDO::getRechargeGearId));
rechargeGearRespVOS.forEach(vo -> {
List<PhoneRecordDO> 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<RechargeGearDO> rechargeGearDOS = rechargeGearMapper.selectList(Wrappers.<RechargeGearDO>lambdaQuery()
.eq(RechargeGearDO::getDeleted, 0));
List<RechargeGearRespVO> rechargeGearRespVOS = RechargeGearConvert.INSTANCE.convertList(rechargeGearDOS);
RechargeOrderDO orderDO = orderMapper.selectOne(Wrappers.<RechargeOrderDO>lambdaQuery().eq(RechargeOrderDO::getUserPhone, phone)
.eq(RechargeOrderDO::getPaid,1)
.last("LIMIT 1"));
if (Objects.nonNull(orderDO)) {
List<PhoneRecordDO> infoDOS = phoneRecordMapper.selectList(Wrappers.<PhoneRecordDO>lambdaQuery().eq(PhoneRecordDO::getRechargeOrderId, orderDO.getId()));
Map<Long, List<PhoneRecordDO>> collect = infoDOS.stream().collect(Collectors.groupingBy(PhoneRecordDO::getRechargeGearId));
rechargeGearRespVOS.forEach(vo -> {
List<PhoneRecordDO> infoDOS1 = collect.get(vo.getId());
if (!CollectionUtils.isEmpty(infoDOS1)) {
vo.setIsExist("1");
} else {
vo.setIsExist("0");
}
});
}
List<PhoneRecordDO> infoDOS = phoneRecordMapper.selectList(Wrappers.<PhoneRecordDO>lambdaQuery().eq(PhoneRecordDO::getPhone, phone));
Map<Long, List<PhoneRecordDO>> collect = infoDOS.stream().collect(Collectors.groupingBy(PhoneRecordDO::getRechargeGearId));
rechargeGearRespVOS.forEach(vo -> {
List<PhoneRecordDO> infoDOS1 = collect.get(vo.getId());
if (!CollectionUtils.isEmpty(infoDOS1)) {
vo.setIsExist("1");
} else {
vo.setIsExist("0");
}
});
return rechargeGearRespVOS;
}