空白字符问题

This commit is contained in:
2025-12-10 16:02:49 +08:00
parent 6ff5436128
commit fd2c2a488a
5 changed files with 20 additions and 9 deletions

View File

@@ -1,5 +1,6 @@
package com.czg.controller.user;
import com.czg.account.entity.ShopInfo;
import com.czg.account.vo.PointsShopListVO;
import com.czg.market.entity.MkPointsConfig;
import com.czg.market.entity.MkPointsUser;
@@ -51,8 +52,8 @@ public class UPointsController {
/**
* 获取用户积分 包括配置信息
* {
* "pointsConfig": 配置信息,
* "pointsUser": 用户积分信息
* "pointsConfig": 配置信息,
* "pointsUser": 用户积分信息
* }
*/
@GetMapping("userPoints")
@@ -84,6 +85,9 @@ public class UPointsController {
@RequestParam(required = false, defaultValue = "10") Integer size,
@RequestParam Long id) {
return CzgResult.success(pointsUserRecordService.page(Page.of(page, size),
QueryWrapper.create().eq(MkPointsUserRecord::getMkPointsUserId, id).orderBy(MkPointsUserRecord::getCreateTime, false)));
QueryWrapper.create().select().select(ShopInfo::getShopName)
.eq(MkPointsUserRecord::getMkPointsUserId, id)
.leftJoin(ShopInfo.class).on(ShopInfo::getId, MkPointsUserRecord::getShopId)
.orderBy(MkPointsUserRecord::getCreateTime, false)));
}
}

View File

@@ -40,11 +40,15 @@ public class MkPointsUserRecord implements Serializable {
* 积分用户Id
*/
private Long mkPointsUserId;
private Long shopId;
private Long shopUserId;
/**
* 摘要信息(如:兑换某个商品/消费多少钱/充值多少钱/新会员赠送积分等)
*/
private String content;
@Column(ignore = true)
private String shopName;
/**
* 订单编号

View File

@@ -63,7 +63,7 @@ public class MkPointsGoodsServiceImpl extends ServiceImpl<MkPointsGoodsMapper, M
Map<String, Object> result = new HashMap<>(2);
MkPointsUser pointsUser = pointsUserService.getPointsUser(shopId, null, userId);
PageHelper.startPage(page, size);
List<MkPointsGoods> list = mapper.getPointsGoodsPageByUser(shopId, userId, goodsCategory);
List<MkPointsGoods> list = mapper.getPointsGoodsPageByUser(shopId, userId, goodsCategory.trim());
result.put("pointsGoods", PageUtil.convert(new PageInfo<>(list)));
result.put("pointsUser", pointsUser == null ? "" : pointsUser);
return result;

View File

@@ -135,6 +135,8 @@ public class MkPointsUserServiceImpl extends ServiceImpl<MkPointsUserMapper, MkP
saveOrUpdate(pointsUser);
MkPointsUserRecord record = MkPointsUserRecord.builder()
.mkPointsUserId(pointsUser.getId())
.shopId(pointsUser.getShopId())
.shopUserId(pointsUser.getShopUserId())
.floatType(floatType.getValue())
.floatPoints(points)
.sourceId(sourceId.toString())

View File

@@ -7,14 +7,15 @@
<select id="getPointsGoodsPageByUser" resultType="com.czg.market.entity.MkPointsGoods">
select goods.*, count(record.id) as boughtCount
from mk_points_goods goods
left join mk_points_goods_record record
on record.points_goods_id = goods.id and record.user_id = #{userId} and record.status != '已退款'
left join mk_points_goods_record record
on record.points_goods_id = goods.id and record.user_id = #{userId} and record.status != '已退款'
where goods.shop_id = #{shopId}
and goods.del_flag = 0
and goods.status = 1
<if test="goodsCategory != null and goodsCategory !=''">
and goods.del_flag = 0
and goods.status = 1
<if test="goodsCategory != null and goodsCategory !=''">
and goods.goods_category = #{goodsCategory}
</if>
HAVING goods.id IS NOT NULL
order by goods.sort desc, goods.id desc
</select>
</mapper>