代码检查提示

This commit is contained in:
2025-12-11 09:31:34 +08:00
parent 0cea08afd2
commit 4344704dd9
3 changed files with 8 additions and 5 deletions

View File

@@ -74,7 +74,7 @@ public class MkPointsGoodsRecordServiceImpl extends ServiceImpl<MkPointsGoodsRec
if (record == null) {
throw new CzgException("未找到该兑换码");
}
if (!record.getStatus().equals("待核销") && !record.getStatus().equals("退款中")) {
if (!"待核销".equals(record.getStatus()) && !"退款中".equals(record.getStatus())) {
throw new CzgException("核销失败,该商品不可核销");
}
MkPointsGoodsRecord upRecord = new MkPointsGoodsRecord();

View File

@@ -50,7 +50,7 @@ public class MkPointsGoodsServiceImpl extends ServiceImpl<MkPointsGoodsMapper, M
.orderBy(MkPointsGoods::getId, false)
);
page.getRecords().forEach(goods -> {
if (goods.getGoodsCategory().equals("优惠券")) {
if ("优惠券".equals(goods.getGoodsCategory())) {
ShopCoupon one = shopCouponService.getOne(query().eq(ShopCoupon::getId, goods.getCouponId())
.eq(ShopCoupon::getShopId, shopId)
.eq(ShopCoupon::getStatus, 1)
@@ -68,7 +68,7 @@ public class MkPointsGoodsServiceImpl extends ServiceImpl<MkPointsGoodsMapper, M
PageHelper.startPage(page, size);
List<MkPointsGoods> list = mapper.getPointsGoodsPageByUser(shopId, userId, StrUtil.trim(goodsCategory));
list.forEach(goods -> {
if (goods.getGoodsCategory().equals("优惠券")) {
if ("优惠券".equals(goods.getGoodsCategory())) {
ShopCoupon one = shopCouponService.getOne(query().eq(ShopCoupon::getId, goods.getCouponId())
.eq(ShopCoupon::getShopId, shopId)
.eq(ShopCoupon::getStatus, 1)
@@ -110,7 +110,7 @@ public class MkPointsGoodsServiceImpl extends ServiceImpl<MkPointsGoodsMapper, M
if (record1 == null) {
throw new CzgException("取消失败,订单不存在");
}
if (!record1.getStatus().equals("退款中")) {
if (!"退款中".equals(record1.getStatus())) {
throw new CzgException("取消失败,订单不处于退款中");
}
MkPointsGoodsRecord record = new MkPointsGoodsRecord();

View File

@@ -31,6 +31,9 @@ import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Map;
/**
* @author ww
*/
@Slf4j
@Service
public class PointsGoodPayServiceImpl implements PointsGoodPayService {
@@ -146,7 +149,7 @@ public class PointsGoodPayServiceImpl implements PointsGoodPayService {
goods = goodsService.getById(record.getPointsGoodsId());
}
record.setIsDel(0);
if (goods.getGoodsCategory().equals("优惠券")) {
if ("优惠券".equals(goods.getGoodsCategory())) {
record.setStatus("已完成");
record.setCheckoutTime(LocalDateTime.now());
goodsRecordService.save(record);