返回值 排序

This commit is contained in:
2025-12-19 10:39:49 +08:00
parent c512d49bd0
commit 6c6b513086
5 changed files with 30 additions and 14 deletions

View File

@@ -3,7 +3,7 @@ package com.czg.constants;
import com.czg.account.entity.ShopInfo;
/**
* 店铺开关枚举
* 店铺 开关枚举
*
* @author ww
*/

View File

@@ -2,11 +2,11 @@ package com.czg.service.market.service.impl;
import cn.hutool.core.util.StrUtil;
import com.czg.BaseQueryParam;
import com.czg.account.entity.ShopInfo;
import com.czg.account.service.ShopInfoService;
import com.czg.market.entity.MkPointsConfig;
import com.czg.market.entity.MkPointsGoods;
import com.czg.market.entity.MkPointsUser;
import com.czg.market.entity.ShopCoupon;
import com.czg.market.service.MkPointsConfigService;
import com.czg.market.service.MkPointsGoodsService;
import com.czg.market.service.MkPointsUserService;
import com.czg.market.service.ShopCouponService;
@@ -17,7 +17,6 @@ import com.github.pagehelper.PageInfo;
import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import jakarta.annotation.Resource;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;
import java.util.HashMap;
@@ -32,15 +31,19 @@ import java.util.Map;
*/
@Service
public class MkPointsGoodsServiceImpl extends ServiceImpl<MkPointsGoodsMapper, MkPointsGoods> implements MkPointsGoodsService {
@Resource
private MkPointsConfigService mkPointsConfigService;
@Resource
private MkPointsUserService pointsUserService;
@Resource
private ShopCouponService shopCouponService;
@DubboReference
private ShopInfoService shopInfoService;
@Override
public Page<MkPointsGoods> getPointsGoodsPage(BaseQueryParam param, Long shopId) {
boolean exists = mkPointsConfigService.exists(query().eq(MkPointsConfig::getShopId, shopId).eq(MkPointsConfig::getEnablePointsMall, 1));
if (!exists) {
return new Page<>();
}
Page<MkPointsGoods> page = page(Page.of(param.getPage(), param.getSize()),
query()
.eq(MkPointsGoods::getShopId, shopId)
@@ -62,8 +65,11 @@ public class MkPointsGoodsServiceImpl extends ServiceImpl<MkPointsGoodsMapper, M
@Override
public Map<String, Object> getPointsGoodsPageByUser(Integer page, Integer size, Long shopId, String goodsCategory, Long userId) {
// shopInfoService.checkSwitch(shopId, )
Map<String, Object> result = new HashMap<>(2);
boolean exists = mkPointsConfigService.exists(query().eq(MkPointsConfig::getShopId, shopId).eq(MkPointsConfig::getEnablePointsMall, 1));
if (!exists) {
return result;
}
MkPointsUser pointsUser = pointsUserService.getPointsUser(shopId, null, userId);
PageHelper.startPage(page, size);
List<MkPointsGoods> list = mapper.getPointsGoodsPageByUser(shopId, userId, StrUtil.trim(goodsCategory));

View File

@@ -48,7 +48,8 @@ public class UserHomeServiceImpl implements UserHomeService {
ShopInfo shopInfo = shopInfoService.getById(shopId);
if (shopInfo != null) {
userHomeDataVo.setGroup(shopInfo.getIsGroupBuy());
// userHomeDataVo.setGroup(shopInfo.getIsGroupBuy());
userHomeDataVo.setGroup(1);
}
// 用户信息
@@ -62,7 +63,8 @@ public class UserHomeServiceImpl implements UserHomeService {
// 积分商城
MkPointsConfig pointsConfig = mkPointsConfigService.getById(shopId);
if (pointsConfig != null) {
userHomeDataVo.setPointsMall(pointsConfig.getEnablePointsMall());
// userHomeDataVo.setPointsMall(pointsConfig.getEnablePointsMall());
userHomeDataVo.setPointsMall(1);
}
// 分销

View File

@@ -114,9 +114,9 @@ public class GbOrderServiceImpl extends ServiceImpl<GbOrderMapper, GbOrder> impl
AssertUtil.isNull(gbOrderDetail, "记录不存在");
} else {
gbOrderDetail = mapper.getDetailByGroupNo(mainIdByShopId, shopId, groupOrderNo, StpKit.USER.getLoginIdAsLong());
gbOrderDetail.setGroupOrderNo(groupOrderNo);
gbOrderDetail.setShopId(shopId);
}
gbOrderDetail.setGroupOrderNo(groupOrderNo);
gbOrderDetail.setShopId(shopId);
List<GbOrderUserVO> users = mapper.getGbOrderDetailUsers(mainIdByShopId, shopId, gbOrderDetail.getGroupOrderNo());
gbOrderDetail.setUsers(users);
return gbOrderDetail;

View File

@@ -72,13 +72,21 @@
<if test="param.verifyStartTime != null and param.verifyEndTime != null ">
and detail.verify_time BETWEEN #{param.verifyStartTime} and #{param.verifyEndTime}
</if>
order by detail.create_time desc
order by
<if test="param.status != null">
<if test="param.status == '退款'">
`status` desc,
</if>
</if>
detail.create_time desc
</select>
<select id="getDetailByDetailId" resultType="com.czg.order.vo.GbOrderDetailVO">
SELECT
detail.* ,`order`.ware_json as wareJson,`order`.group_end_time as groupEndTime,`order`.group_people_num as groupPeopleNum,`order`.ware_group_price as wareGroupPrice,
`order`.ware_original_price as wareOriginalPrice,`user`.nick_name as userName,`user`.phone as userPhone,shop.shop_name as shopName,shop.address as shopAddress
detail.* ,`order`.ware_id as wareId,`order`.ware_json as wareJson,`order`.group_end_time as groupEndTime,
`order`.group_people_num as groupPeopleNum,`order`.ware_group_price as wareGroupPrice,
`order`.ware_original_price as wareOriginalPrice,`order`.status as wareGroupStatus,
`user`.nick_name as userName,`user`.phone as userPhone,shop.shop_name as shopName,shop.address as shopAddress
FROM
`gb_order_detail` detail
LEFT JOIN gb_order `order` on detail.group_order_no = `order`.group_order_no and `order`.shop_id = #{shopId}