优惠卷列表 添加 店铺名称
This commit is contained in:
@@ -33,7 +33,7 @@ public interface TbActivateInRecordMapper {
|
|||||||
List<TbActivateInRecord> queryAll(TbActivateInRecord tbActivateInRecord);
|
List<TbActivateInRecord> queryAll(TbActivateInRecord tbActivateInRecord);
|
||||||
|
|
||||||
List<TbProduct> queryByVipIdAndShopId(@Param("vipUserId") Integer vipUserId, @Param("shopId") Integer shopId);
|
List<TbProduct> queryByVipIdAndShopId(@Param("vipUserId") Integer vipUserId, @Param("shopId") Integer shopId);
|
||||||
List<UserCouponVo> queryVipPro(@Param("vipUserId") Integer vipUserId, @Param("shopId") Integer shopId);
|
List<UserCouponVo> queryVipPro(@Param("vipUserId") Integer vipUserId, @Param("shopId") Integer shopId,@Param("shopName")String shopName);
|
||||||
int queryByVipIdAndShopIdAndProId(@Param("vipUserId") Integer vipUserId, @Param("shopId") Integer shopId,@Param("productId") Integer productId);
|
int queryByVipIdAndShopIdAndProId(@Param("vipUserId") Integer vipUserId, @Param("shopId") Integer shopId,@Param("productId") Integer productId);
|
||||||
List<TbActivateInRecord> queryAllByVipIdAndShopIdAndProId(@Param("vipUserId") Integer vipUserId, @Param("shopId") Integer shopId,@Param("productId") Integer productId);
|
List<TbActivateInRecord> queryAllByVipIdAndShopIdAndProId(@Param("vipUserId") Integer vipUserId, @Param("shopId") Integer shopId,@Param("productId") Integer productId);
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ public interface TbActivateOutRecordMapper {
|
|||||||
*/
|
*/
|
||||||
List<TbActivateOutRecord> queryAll(TbActivateOutRecord tbActivateOutRecord);
|
List<TbActivateOutRecord> queryAll(TbActivateOutRecord tbActivateOutRecord);
|
||||||
|
|
||||||
List<UserCouponVo> queryVipPro(@Param("vipUserId") Integer vipUserId, @Param("shopId") Integer shopId);
|
List<UserCouponVo> queryVipPro(@Param("vipUserId") Integer vipUserId, @Param("shopId") Integer shopId, @Param("shopName") String shopName);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ public class UserCouponVo {
|
|||||||
* 卷描述
|
* 卷描述
|
||||||
*/
|
*/
|
||||||
private String detail;
|
private String detail;
|
||||||
|
private String shopName;
|
||||||
/**
|
/**
|
||||||
* 优惠金额
|
* 优惠金额
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
package com.chaozhanggui.system.cashierservice.service.impl;
|
package com.chaozhanggui.system.cashierservice.service.impl;
|
||||||
|
|
||||||
import com.chaozhanggui.system.cashierservice.dao.TbActivateInRecordMapper;
|
import com.chaozhanggui.system.cashierservice.dao.*;
|
||||||
import com.chaozhanggui.system.cashierservice.dao.TbActivateOutRecordMapper;
|
import com.chaozhanggui.system.cashierservice.entity.TbShopInfo;
|
||||||
import com.chaozhanggui.system.cashierservice.dao.TbShopUserMapper;
|
|
||||||
import com.chaozhanggui.system.cashierservice.dao.TbUserCouponsMapper;
|
|
||||||
import com.chaozhanggui.system.cashierservice.entity.dto.UserCouponDto;
|
import com.chaozhanggui.system.cashierservice.entity.dto.UserCouponDto;
|
||||||
import com.chaozhanggui.system.cashierservice.entity.vo.ShopUserListVo;
|
import com.chaozhanggui.system.cashierservice.entity.vo.ShopUserListVo;
|
||||||
import com.chaozhanggui.system.cashierservice.entity.vo.UserCouponVo;
|
import com.chaozhanggui.system.cashierservice.entity.vo.UserCouponVo;
|
||||||
@@ -36,6 +34,8 @@ public class TbUserCouponsServiceImpl implements TbUserCouponsService {
|
|||||||
private TbActivateOutRecordMapper outRecordMapper;
|
private TbActivateOutRecordMapper outRecordMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private TbShopUserMapper tbShopUserMapper;
|
private TbShopUserMapper tbShopUserMapper;
|
||||||
|
@Autowired
|
||||||
|
private TbShopInfoMapper tbShopInfoMapper;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -52,12 +52,13 @@ public class TbUserCouponsServiceImpl implements TbUserCouponsService {
|
|||||||
List<ShopUserListVo> tbShopUsers = tbShopUserMapper.selectByUserId(couponDto.getUserId().toString(), couponDto.getShopId()==null?null:couponDto.getShopId().toString());
|
List<ShopUserListVo> tbShopUsers = tbShopUserMapper.selectByUserId(couponDto.getUserId().toString(), couponDto.getShopId()==null?null:couponDto.getShopId().toString());
|
||||||
if (!CollectionUtils.isEmpty(tbShopUsers)) {
|
if (!CollectionUtils.isEmpty(tbShopUsers)) {
|
||||||
tbShopUsers.forEach(s -> {
|
tbShopUsers.forEach(s -> {
|
||||||
|
TbShopInfo shopInfo = tbShopInfoMapper.selectByPrimaryKey(s.getShopId().intValue());
|
||||||
if (couponDto.getStatus()==null || (couponDto.getStatus() != null && couponDto.getStatus() == 0)) {
|
if (couponDto.getStatus()==null || (couponDto.getStatus() != null && couponDto.getStatus() == 0)) {
|
||||||
List<UserCouponVo> unuseCoupon = inRecordMapper.queryVipPro(s.getMemberId().intValue(), s.getShopId().intValue());
|
List<UserCouponVo> unuseCoupon = inRecordMapper.queryVipPro(s.getMemberId().intValue(), s.getShopId().intValue(),shopInfo.getShopName());
|
||||||
result.addAll(unuseCoupon);
|
result.addAll(unuseCoupon);
|
||||||
}
|
}
|
||||||
if (couponDto.getStatus()==null || (couponDto.getStatus() != null && couponDto.getStatus() == 1)) {
|
if (couponDto.getStatus()==null || (couponDto.getStatus() != null && couponDto.getStatus() == 1)) {
|
||||||
List<UserCouponVo> useCoupon = outRecordMapper.queryVipPro(s.getMemberId().intValue(), s.getShopId().intValue());
|
List<UserCouponVo> useCoupon = outRecordMapper.queryVipPro(s.getMemberId().intValue(), s.getShopId().intValue(),shopInfo.getShopName());
|
||||||
result.addAll(useCoupon);
|
result.addAll(useCoupon);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -43,6 +43,10 @@
|
|||||||
SELECT tb_product.name as detail,
|
SELECT tb_product.name as detail,
|
||||||
0 as status,
|
0 as status,
|
||||||
sum(tb_activate_in_record.over_num) as num,
|
sum(tb_activate_in_record.over_num) as num,
|
||||||
|
<choose>
|
||||||
|
<when test="shopName != null and shopName != ''">#{shopName}</when>
|
||||||
|
<otherwise>''</otherwise>
|
||||||
|
</choose> AS shopName,
|
||||||
2 as type
|
2 as type
|
||||||
FROM tb_activate_in_record
|
FROM tb_activate_in_record
|
||||||
LEFT JOIN tb_product ON tb_activate_in_record.pro_id = tb_product.id
|
LEFT JOIN tb_product ON tb_activate_in_record.pro_id = tb_product.id
|
||||||
|
|||||||
@@ -32,6 +32,11 @@
|
|||||||
SELECT tb_product.NAME AS detail,
|
SELECT tb_product.NAME AS detail,
|
||||||
1 AS status,
|
1 AS status,
|
||||||
tb_activate_out_record.use_num AS num,
|
tb_activate_out_record.use_num AS num,
|
||||||
|
<choose>
|
||||||
|
<when test="shopName != null and shopName != ''">#{shopName}</when>
|
||||||
|
<otherwise>''</otherwise>
|
||||||
|
</choose>
|
||||||
|
AS shopName,
|
||||||
2 AS type
|
2 AS type
|
||||||
FROM tb_activate_out_record
|
FROM tb_activate_out_record
|
||||||
LEFT JOIN tb_product ON tb_activate_out_record.pro_id = tb_product.id
|
LEFT JOIN tb_product ON tb_activate_out_record.pro_id = tb_product.id
|
||||||
|
|||||||
Reference in New Issue
Block a user