Merge remote-tracking branch 'origin/prod' into prod

This commit is contained in:
张松
2025-10-10 14:42:45 +08:00
7 changed files with 35 additions and 11 deletions

View File

@@ -26,6 +26,7 @@ import com.czg.market.vo.UserCouponVO;
import com.czg.service.market.mapper.MkShopCouponRecordMapper;
import com.czg.service.market.mapper.ShopCouponMapper;
import com.czg.utils.AssertUtil;
import com.czg.utils.CzgStrUtils;
import com.czg.utils.PageUtil;
import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.core.query.QueryWrapper;
@@ -102,6 +103,7 @@ public class MkShopCouponRecordServiceImpl extends ServiceImpl<MkShopCouponRecor
recordQueryWrapper.eq(MkShopCouponRecord::getShopId, mkShopCouponRecordDTO.getShopId())
.eq(MkShopCouponRecord::getIsDel, 0)
.eq(MkShopCouponRecord::getStatus, mkShopCouponRecordDTO.getStatus())
.eq(MkShopCouponRecord::getSource, CzgStrUtils.getStrOrNull(mkShopCouponRecordDTO.getSource()))
.orderBy(MkShopCouponRecord::getCreateTime).desc();
if (StrUtil.isNotBlank(startTime) && StrUtil.isNotBlank(endTime)) {
recordQueryWrapper.between(MkShopCouponRecord::getCreateTime, startTime, endTime);

View File

@@ -327,23 +327,23 @@ public class ShopCouponServiceImpl extends ServiceImpl<ShopCouponMapper, ShopCou
JSONObject couponJson = coupons.get(tbUserCouponVo.getCouponId());
tbUserCouponVo.setUseRestrictions(couponJson.getString("useRestrictions"));
tbUserCouponVo.setUse(couponJson.getBoolean("isUse"));
if (tbUserCouponVo.getType() == 1 || tbUserCouponVo.getType() == 2 || tbUserCouponVo.getType() == 4 || tbUserCouponVo.getType() == 6) {
if (tbUserCouponVo.getType() == 1 || tbUserCouponVo.getType() == 2 || tbUserCouponVo.getType() == 3
|| tbUserCouponVo.getType() == 4 || tbUserCouponVo.getType() == 6) {
if (StrUtil.isNotBlank(tbUserCouponVo.getFoods()) && !",".equals(tbUserCouponVo.getFoods())) {
List<Long> couponFoodIds = Arrays.stream(tbUserCouponVo.getFoods().split(",")).map(Long::parseLong).toList();
if (CollUtil.isNotEmpty(couponFoodIds)) {
List<Product> list = productService.list(new QueryWrapper()
.in(Product::getId, couponFoodIds).eq(Product::getIsDel, 0));
log.info("优惠券商品列表:{}", list);
// log.info("优惠券商品列表:{}", list);
if (CollUtil.isEmpty(list)) {
continue;
}
if (tbUserCouponVo.getType() == 2) {
tbUserCouponVo.setUseFoods(JSON.parseObject(JSON.toJSONString(list), new TypeReference<>() {
}));
} else {
if (tbUserCouponVo.getType() == 1 || tbUserCouponVo.getType() == 3) {
tbUserCouponVo.setThresholdFoods(JSON.parseObject(JSON.toJSONString(list), new TypeReference<>() {
}));
} else {
tbUserCouponVo.setUseFoods(JSON.parseObject(JSON.toJSONString(list), new TypeReference<>() {
}));
}
String foods = list.stream().map(Product::getName).collect(Collectors.joining(","));
tbUserCouponVo.setFoods(foods);

View File

@@ -12,6 +12,8 @@ import com.mybatisflex.spring.service.impl.ServiceImpl;
import com.czg.market.entity.MemberLevelConfig;
import com.czg.market.service.MemberLevelConfigService;
import jakarta.annotation.Resource;
import org.apache.dubbo.config.annotation.DubboReference;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
@@ -23,7 +25,7 @@ import java.util.List;
* @author zs
* @since 2025-09-10
*/
@Service
@DubboService
public class TbMemberLevelConfigServiceImpl extends ServiceImpl<TbMemberLevelConfigMapper, MemberLevelConfig> implements MemberLevelConfigService{
@Resource
private ShopCouponService shopCouponService;