充值可用店铺列表

This commit is contained in:
张松
2025-09-28 17:57:43 +08:00
parent c34a1d1f88
commit a12b87d47e
5 changed files with 57 additions and 6 deletions

View File

@@ -1,6 +1,7 @@
package com.czg.controller.user;
import com.czg.market.service.MkShopRechargeService;
import com.czg.market.vo.MkShopRechargeShopListVO;
import com.czg.market.vo.MkShopRechargeVO;
import com.czg.market.vo.RechargeListVO;
import com.czg.resp.CzgResult;
@@ -34,7 +35,16 @@ public class URechargeController {
}
/**
* 储值列表
* 可用店铺列表
* @param shopId 店铺id
*/
@GetMapping("/config/shopList")
public CzgResult<List<MkShopRechargeShopListVO>> shopList(@RequestParam Long shopId, @RequestParam(required = false) String shopName) {
return CzgResult.success(shopRechargeService.shopList(shopId, shopName));
}
/**
* 充值列表
*/
@GetMapping("/list")
public CzgResult<List<RechargeListVO>> getList() {

View File

@@ -2,6 +2,7 @@ package com.czg.market.service;
import com.czg.enums.ShopUserFlowBizEnum;
import com.czg.market.dto.MkShopRechargeDTO;
import com.czg.market.vo.MkShopRechargeShopListVO;
import com.czg.market.vo.MkShopRechargeVO;
import com.czg.market.vo.RechargeListVO;
import com.mybatisflex.core.service.IService;
@@ -31,4 +32,5 @@ public interface MkShopRechargeService extends IService<MkShopRecharge> {
List<RechargeListVO> getList(long loginIdAsLong);
List<MkShopRechargeShopListVO> shopList(Long shopId, String shopName);
}

View File

@@ -0,0 +1,17 @@
package com.czg.market.vo;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;
@Data
public class MkShopRechargeShopListVO implements Serializable {
private static final long serialVersionUID = 1L;
private String shopName;
private Long id;
private String logo;
}

View File

@@ -20,10 +20,7 @@ import com.czg.market.entity.ShopCoupon;
import com.czg.market.service.MkShopCouponRecordService;
import com.czg.market.service.MkShopRechargeDetailService;
import com.czg.market.service.ShopCouponService;
import com.czg.market.vo.CouponInfoVO;
import com.czg.market.vo.MkShopRechargeDetailVO;
import com.czg.market.vo.MkShopRechargeVO;
import com.czg.market.vo.RechargeListVO;
import com.czg.market.vo.*;
import com.czg.order.entity.OrderInfo;
import com.czg.service.market.enums.OrderStatusEnums;
import com.czg.utils.AssertUtil;
@@ -214,4 +211,29 @@ public class MkShopRechargeServiceImpl extends ServiceImpl<MkShopRechargeMapper,
});
return rechargeListVOS;
}
@Override
public List<MkShopRechargeShopListVO> shopList(Long shopId, String shopName) {
Long mainShopId = shopInfoService.getMainIdByShopId(shopId);
MkShopRechargeVO rechargeVO = detail(shopId);
List<Long> shopIdList = rechargeVO.getShopIdList();
QueryWrapper queryWrapper = new QueryWrapper().like(ShopInfo::getShopName, shopName);
if ("all".equals(rechargeVO.getUseType())) {
queryWrapper.and(q -> {
q.eq(ShopInfo::getMainId, mainShopId).or(q1 -> {
q1.eq(ShopInfo::getId, mainShopId);
});
});
}else {
shopIdList.add(shopId);
queryWrapper.in(ShopInfo::getId, shopIdList);
}
return shopInfoService.list(queryWrapper)
.stream()
.map(shop -> BeanUtil.copyProperties(shop, MkShopRechargeShopListVO.class))
.toList();
}
}

View File

@@ -824,7 +824,7 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
}
if (StrUtil.isNotBlank(payment.getTradeNumber())) {
log.info("订单处理过payment id{}", payment.getId());
return;
// return;
}
payment.setTradeNumber(czgCallBackDto.getPayOrderId());
payment.setRespJson(resultJson.toString());