优惠券fix
This commit is contained in:
@@ -142,5 +142,12 @@ public interface IPlayCustomUserInfoService extends IService<PlayCustomUserInfoE
|
||||
|
||||
List<PlayCustomUserInfoEntity> simpleList();
|
||||
|
||||
|
||||
/**
|
||||
* 保存订单信息
|
||||
*
|
||||
* @param entity 订单实体 * @since 2024/7/18 17:13
|
||||
* @author admin
|
||||
**/
|
||||
void saveOrderInfo(PlayOrderInfoEntity entity);
|
||||
}
|
||||
|
||||
@@ -167,7 +167,6 @@ public class PlayOrderInfoEntity extends BaseEntity<PlayOrderInfoEntity> {
|
||||
*/
|
||||
private BigDecimal finalAmount;
|
||||
|
||||
|
||||
/**
|
||||
* 店员预计收入
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.starry.admin.modules.order.module.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @since 2024/7/18 16:36
|
||||
**/
|
||||
@Data
|
||||
public class ClerkEstimatedRevenueVo {
|
||||
|
||||
/**
|
||||
* 收入比例
|
||||
*
|
||||
* @since 2024/7/18 16:37
|
||||
**/
|
||||
private Integer revenueRatio;
|
||||
|
||||
/**
|
||||
* 收入金额
|
||||
*
|
||||
* @since 2024/7/18 16:37
|
||||
**/
|
||||
private BigDecimal revenueAmount;
|
||||
}
|
||||
@@ -70,6 +70,20 @@ public interface IPlayOrderInfoService extends IService<PlayOrderInfoEntity> {
|
||||
void createOrderInfo(String orderId, String orderNo, String orderState, String orderType, String placeType, String rewardType, String firstOrder, String commodityId, String commodityType, BigDecimal commodityPrice, String serviceDuration, String commodityName, String commodityNumber, BigDecimal orderMoney, BigDecimal finalAmount, BigDecimal discountAmount, String purchaserBy, String acceptBy, String weiChatCode, List<String> couponIds, String remark);
|
||||
|
||||
|
||||
/**
|
||||
* 据店员等级和订单金额,获取店员预计收入
|
||||
*
|
||||
* @param clerkId 店员ID
|
||||
* @param croupIds 优惠券ID列表
|
||||
* @param placeType 下单类型(-1:其他类型;0:指定单;1:随机单;2:打赏单)
|
||||
* @param firstOrder 是否是首单【0:不是,1:是】
|
||||
* @param finalAmount 订单支付金额
|
||||
* @return com.starry.admin.modules.order.module.vo.ClerkEstimatedRevenueVo
|
||||
* @author admin
|
||||
* @since 2024/7/18 16:39
|
||||
**/
|
||||
ClerkEstimatedRevenueVo getClerkEstimatedRevenue(String clerkId, List<String> croupIds, String placeType, String firstOrder, BigDecimal finalAmount);
|
||||
|
||||
/**
|
||||
* 根据店员等级和订单金额,获取店员预计收入
|
||||
*
|
||||
@@ -87,22 +101,23 @@ public interface IPlayOrderInfoService extends IService<PlayOrderInfoEntity> {
|
||||
/**
|
||||
* 根据店员等级,获取店员提成比例
|
||||
*
|
||||
* @param clerkId 店员ID
|
||||
* @param placeType 下单类型(-1:其他类型;0:指定单;1:随机单;2:打赏单)
|
||||
* @param firstOrder 是否是首单【0:不是,1:是】
|
||||
* @param clerkId 店员ID
|
||||
* @param placeType 下单类型(-1:其他类型;0:指定单;1:随机单;2:打赏单)
|
||||
* @param firstOrder 是否是首单【0:不是,1:是】
|
||||
* @return math.BigDecimal 店员预计收入
|
||||
* @author admin
|
||||
* @since 2024/6/3 11:12
|
||||
**/
|
||||
Integer getEstimatedRevenueRatio(String clerkId, String placeType, String firstOrder);
|
||||
|
||||
/**
|
||||
* 根据订单结算状态查询订单
|
||||
*
|
||||
* @param clerkId 店员ID
|
||||
* @param clerkId 店员ID
|
||||
* @param orderSettlementState 订单结算状态(0:未结算;1:已结算)
|
||||
* @return List<PlayOrderInfoEntity>
|
||||
*/
|
||||
List<PlayOrderInfoEntity> queryBySettlementOrder(String clerkId,String orderSettlementState);
|
||||
List<PlayOrderInfoEntity> queryBySettlementOrder(String clerkId, String orderSettlementState);
|
||||
|
||||
|
||||
/**
|
||||
@@ -117,10 +132,10 @@ public interface IPlayOrderInfoService extends IService<PlayOrderInfoEntity> {
|
||||
/**
|
||||
* 查询指定店员在一定时间内的订单
|
||||
*
|
||||
* @param clerkId 店员ID
|
||||
* @param startTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
* @param orderStatus 店员状态列表
|
||||
* @param clerkId 店员ID
|
||||
* @param startTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
* @param orderStatus 店员状态列表
|
||||
* @return List<PlayOrderInfoEntity>
|
||||
*/
|
||||
List<PlayOrderInfoEntity> listByTime(String clerkId, String startTime, String endTime, List<String> orderStatus);
|
||||
|
||||
@@ -19,6 +19,8 @@ import com.starry.admin.modules.order.module.entity.*;
|
||||
import com.starry.admin.modules.order.module.vo.*;
|
||||
import com.starry.admin.modules.order.service.*;
|
||||
import com.starry.admin.modules.personnel.service.IPlayPersonnelGroupInfoService;
|
||||
import com.starry.admin.modules.shop.module.vo.PlayCouponDetailsReturnVo;
|
||||
import com.starry.admin.modules.shop.service.IPlayCouponDetailsService;
|
||||
import com.starry.admin.modules.weichat.entity.order.*;
|
||||
import com.starry.admin.utils.SecurityUtils;
|
||||
import com.starry.common.utils.ConvertUtil;
|
||||
@@ -65,6 +67,9 @@ public class PlayOrderInfoServiceImpl extends ServiceImpl<PlayOrderInfoMapper, P
|
||||
@Resource
|
||||
private IPlayOrderRandomInfoService playOrderRandomInfoService;
|
||||
|
||||
@Resource
|
||||
private IPlayCouponDetailsService playCouponDetailsService;
|
||||
|
||||
|
||||
@Override
|
||||
public List<PlayOrderInfoEntity> getTotalOrderInfo(String tenantId) {
|
||||
@@ -105,8 +110,9 @@ public class PlayOrderInfoServiceImpl extends ServiceImpl<PlayOrderInfoMapper, P
|
||||
entity.setUseCoupon(couponIds != null && !couponIds.isEmpty() ? "1" : "0");
|
||||
if (StrUtil.isNotBlank(acceptBy)) {
|
||||
entity.setAcceptBy(acceptBy);
|
||||
entity.setEstimatedRevenue(getEstimatedRevenue(acceptBy, placeType, firstOrder, finalAmount));
|
||||
entity.setEstimatedRevenueRatio(getEstimatedRevenueRatio(acceptBy, placeType, firstOrder));
|
||||
ClerkEstimatedRevenueVo estimatedRevenueVo = getClerkEstimatedRevenue(acceptBy, couponIds, placeType, firstOrder, finalAmount);
|
||||
entity.setEstimatedRevenue(estimatedRevenueVo.getRevenueAmount());
|
||||
entity.setEstimatedRevenueRatio(estimatedRevenueVo.getRevenueRatio());
|
||||
}
|
||||
// 如果订单是打赏单,订单直接完成
|
||||
if ("2".equals(placeType)) {
|
||||
@@ -114,11 +120,81 @@ public class PlayOrderInfoServiceImpl extends ServiceImpl<PlayOrderInfoMapper, P
|
||||
entity.setOrderStartTime(LocalDateTime.now());
|
||||
entity.setOrderEndTime(LocalDateTime.now());
|
||||
}
|
||||
// 修改顾客下单信息
|
||||
userInfoService.saveOrderInfo(entity);
|
||||
// 保存订单
|
||||
this.baseMapper.insert(entity);
|
||||
// 修改优惠券状态
|
||||
playCouponDetailsService.updateCouponUseStateByIds(couponIds, "2");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ClerkEstimatedRevenueVo getClerkEstimatedRevenue(String clerkId, List<String> croupIds, String placeType, String firstOrder, BigDecimal finalAmount) {
|
||||
PlayClerkLevelInfoEntity entity = playClerkUserInfoService.queryLevelCommission(clerkId);
|
||||
ClerkEstimatedRevenueVo estimatedRevenueVo = new ClerkEstimatedRevenueVo();
|
||||
switch (placeType) {
|
||||
case "0": {
|
||||
if ("1".equals(firstOrder)) {
|
||||
estimatedRevenueVo.setRevenueRatio(entity.getFirstRegularRatio());
|
||||
estimatedRevenueVo.setRevenueAmount(finalAmount.multiply(new BigDecimal(entity.getFirstRegularRatio()).divide(new BigDecimal(100), 4, RoundingMode.HALF_UP)).setScale(2, RoundingMode.HALF_UP));
|
||||
} else {
|
||||
estimatedRevenueVo.setRevenueRatio(entity.getNotFirstRegularRatio());
|
||||
estimatedRevenueVo.setRevenueAmount(finalAmount.multiply(new BigDecimal(entity.getNotFirstRegularRatio()).divide(new BigDecimal(100), 4, RoundingMode.HALF_UP)).setScale(2, RoundingMode.HALF_UP));
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "1": {
|
||||
if ("1".equals(firstOrder)) {
|
||||
estimatedRevenueVo.setRevenueRatio(entity.getFirstRandomRadio());
|
||||
estimatedRevenueVo.setRevenueAmount(finalAmount.multiply(new BigDecimal(entity.getFirstRandomRadio()).divide(new BigDecimal(100), 4, RoundingMode.HALF_UP)).setScale(2, RoundingMode.HALF_UP));
|
||||
} else {
|
||||
estimatedRevenueVo.setRevenueRatio(entity.getNotFirstRandomRadio());
|
||||
estimatedRevenueVo.setRevenueAmount(finalAmount.multiply(new BigDecimal(entity.getNotFirstRandomRadio()).divide(new BigDecimal(100), 4, RoundingMode.HALF_UP)).setScale(2, RoundingMode.HALF_UP));
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "2": {
|
||||
if ("1".equals(firstOrder)) {
|
||||
estimatedRevenueVo.setRevenueRatio(entity.getFirstRewardRatio());
|
||||
estimatedRevenueVo.setRevenueAmount(finalAmount.multiply(new BigDecimal(entity.getFirstRewardRatio()).divide(new BigDecimal(100), 4, RoundingMode.HALF_UP)).setScale(2, RoundingMode.HALF_UP));
|
||||
} else {
|
||||
estimatedRevenueVo.setRevenueRatio(entity.getNotFirstRewardRatio());
|
||||
estimatedRevenueVo.setRevenueAmount(finalAmount.multiply(new BigDecimal(entity.getNotFirstRewardRatio()).divide(new BigDecimal(100), 4, RoundingMode.HALF_UP)).setScale(2, RoundingMode.HALF_UP));
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "-1": {
|
||||
log.error("下单类型异常,placeType={}", placeType);
|
||||
estimatedRevenueVo.setRevenueAmount(finalAmount);
|
||||
estimatedRevenueVo.setRevenueRatio(100);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
log.error("下单类型错误,placeType={}", placeType);
|
||||
estimatedRevenueVo.setRevenueAmount(finalAmount);
|
||||
estimatedRevenueVo.setRevenueRatio(100);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// 如果优惠券不由店铺承担,那么店员预计收入减去优惠金额
|
||||
for (String croupId : croupIds) {
|
||||
PlayCouponDetailsReturnVo couponInfo = playCouponDetailsService.selectPlayCouponDetailsById(croupId);
|
||||
if ("0".equals(couponInfo.getAttributionDiscounts())) {
|
||||
BigDecimal revenueAmount = estimatedRevenueVo.getRevenueAmount();
|
||||
if ("0".equals(couponInfo.getDiscountType())) {
|
||||
revenueAmount = revenueAmount.subtract(couponInfo.getDiscountAmount());
|
||||
} else {
|
||||
revenueAmount = revenueAmount.subtract(revenueAmount.subtract(couponInfo.getDiscountAmount()));
|
||||
}
|
||||
log.debug("优惠券ID={},优惠券类型={},优惠金额={},优惠前金额={},优惠前金额={}", croupId, couponInfo.getDiscountType(), couponInfo.getDiscountAmount(), estimatedRevenueVo.getRevenueAmount(), revenueAmount);
|
||||
estimatedRevenueVo.setRevenueAmount(revenueAmount);
|
||||
}
|
||||
}
|
||||
return estimatedRevenueVo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据店员等级和订单金额,获取店员预计收入
|
||||
*
|
||||
@@ -561,8 +637,9 @@ public class PlayOrderInfoServiceImpl extends ServiceImpl<PlayOrderInfoMapper, P
|
||||
PlayOrderInfoEntity entity = new PlayOrderInfoEntity(orderId, OrderConstant.ORDER_STATUS_1);
|
||||
entity.setAcceptBy(acceptBy);
|
||||
entity.setAcceptTime(LocalDateTime.now());
|
||||
entity.setEstimatedRevenue(this.getEstimatedRevenue(acceptBy, orderInfo.getPlaceType(), orderInfo.getFirstOrder(), orderInfo.getFinalAmount()));
|
||||
entity.setEstimatedRevenueRatio(this.getEstimatedRevenueRatio(acceptBy, orderInfo.getPlaceType(), orderInfo.getFirstOrder()));
|
||||
ClerkEstimatedRevenueVo estimatedRevenueVo = this.getClerkEstimatedRevenue(acceptBy, orderInfo.getCouponIds(), orderInfo.getPlaceType(), orderInfo.getFirstOrder(), orderInfo.getFinalAmount());
|
||||
entity.setEstimatedRevenue(estimatedRevenueVo.getRevenueAmount());
|
||||
entity.setEstimatedRevenueRatio(estimatedRevenueVo.getRevenueRatio());
|
||||
this.baseMapper.updateById(entity);
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.starry.admin.modules.order.mapper.PlayOrderRandomInfoMapper;
|
||||
import com.starry.admin.modules.order.module.entity.PlayOrderInfoEntity;
|
||||
import com.starry.admin.modules.order.module.entity.PlayOrderRandomInfoEntity;
|
||||
import com.starry.admin.modules.order.module.vo.ClerkEstimatedRevenueVo;
|
||||
import com.starry.admin.modules.order.service.IPlayOrderInfoService;
|
||||
import com.starry.admin.modules.order.service.IPlayOrderRandomInfoService;
|
||||
import com.starry.admin.modules.weichat.entity.order.PlayClerkRandomOrderDetailReturnVo;
|
||||
@@ -68,8 +69,9 @@ public class PlayOrderRandomInfoServiceImpl extends ServiceImpl<PlayOrderRandomI
|
||||
PlayClerkRandomOrderDetailReturnVo vo = this.baseMapper.selectJoinOne(PlayClerkRandomOrderDetailReturnVo.class, lambdaWrapper);
|
||||
|
||||
PlayOrderInfoEntity orderInfo = playOrderInfoService.selectOrderInfoById(id);
|
||||
vo.setEstimatedRevenue(playOrderInfoService.getEstimatedRevenue(clerkId, orderInfo.getPlaceType(), orderInfo.getFirstOrder(), orderInfo.getFinalAmount()));
|
||||
vo.setEstimatedRevenueRatio(playOrderInfoService.getEstimatedRevenueRatio(clerkId, orderInfo.getPlaceType(), orderInfo.getFirstOrder()));
|
||||
ClerkEstimatedRevenueVo estimatedRevenueVo = playOrderInfoService.getClerkEstimatedRevenue(clerkId, orderInfo.getCouponIds(), orderInfo.getPlaceType(), orderInfo.getFirstOrder(), orderInfo.getFinalAmount());
|
||||
vo.setEstimatedRevenue(estimatedRevenueVo.getRevenueAmount());
|
||||
vo.setEstimatedRevenueRatio(estimatedRevenueVo.getRevenueRatio());
|
||||
return vo;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
package com.starry.admin.modules.shop.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.starry.admin.modules.shop.module.entity.PlayShopArticleInfoEntity;
|
||||
import com.starry.admin.modules.shop.module.vo.PlayShopArticleInfoAddVo;
|
||||
import com.starry.admin.modules.shop.module.vo.PlayShopArticleInfoQueryVo;
|
||||
import com.starry.admin.modules.shop.module.vo.PlayShopArticleInfoUpdateVo;
|
||||
import com.starry.admin.modules.shop.service.IPlayShopArticleInfoService;
|
||||
import com.starry.common.annotation.Log;
|
||||
import com.starry.common.enums.BusinessType;
|
||||
import com.starry.common.result.R;
|
||||
import com.starry.common.utils.ConvertUtil;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 店铺文章信息Controller
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-06-05
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/shop/articleInfo")
|
||||
public class PlayShopArticleInfoController {
|
||||
|
||||
@Resource
|
||||
private IPlayShopArticleInfoService playShopArticleInfoService;
|
||||
|
||||
/**
|
||||
* 查询店铺文章信息列表
|
||||
*/
|
||||
//@PreAuthorize("@customSs.hasPermission('shop:articleInfo:list')")
|
||||
@PostMapping("/listByPage")
|
||||
public R listByPage(@Validated @RequestBody PlayShopArticleInfoQueryVo vo) {
|
||||
IPage<PlayShopArticleInfoEntity> list = playShopArticleInfoService.selectByPage(vo);
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增页轮播列表
|
||||
*/
|
||||
//@PreAuthorize("@customSs.hasPermission('shop:articleInfo:add')")
|
||||
@PostMapping("/create")
|
||||
public R create(@Validated @RequestBody PlayShopArticleInfoAddVo vo) {
|
||||
PlayShopArticleInfoEntity entity = ConvertUtil.entityToVo(vo, PlayShopArticleInfoEntity.class);
|
||||
playShopArticleInfoService.create(entity);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改页轮播状态
|
||||
*/
|
||||
//@PreAuthorize("@customSs.hasPermission('shop:articleInfo:update')")
|
||||
@PostMapping("/handleUpdateState")
|
||||
public R listByPage(@Validated @RequestBody PlayShopArticleInfoUpdateVo vo) {
|
||||
PlayShopArticleInfoEntity entity = ConvertUtil.entityToVo(vo, PlayShopArticleInfoEntity.class);
|
||||
playShopArticleInfoService.update(entity);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除店铺文章信息
|
||||
*/
|
||||
//@PreAuthorize("@customSs.hasPermission('shop:articleInfo:delete')")
|
||||
@Log(title = "店铺文章信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R remove(@PathVariable String[] ids) {
|
||||
return R.ok(playShopArticleInfoService.deleteByIds(ids));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.starry.admin.modules.shop.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.starry.admin.modules.shop.module.entity.PlayShopArticleInfoEntity;
|
||||
|
||||
/**
|
||||
* 店铺文章信息Mapper接口
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-06-05
|
||||
*/
|
||||
public interface PlayShopArticleInfoMapper extends BaseMapper<PlayShopArticleInfoEntity> {
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.starry.admin.modules.shop.module.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.starry.common.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 店铺文章信息
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024/7/18 11:00
|
||||
**/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName(value = "play_shop_article_info", autoResultMap = true)
|
||||
public class PlayShopArticleInfoEntity extends BaseEntity<PlayShopArticleInfoEntity> {
|
||||
/**
|
||||
* UUID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
private String tenantId;
|
||||
|
||||
/**
|
||||
* 文章类型
|
||||
*
|
||||
**/
|
||||
private String articleType;
|
||||
|
||||
|
||||
/**
|
||||
* 文章标题
|
||||
*
|
||||
**/
|
||||
private String articleTitle;
|
||||
|
||||
/**
|
||||
* 文章内容
|
||||
*
|
||||
**/
|
||||
private String articleContent;
|
||||
|
||||
|
||||
/**
|
||||
* 浏览量
|
||||
*
|
||||
**/
|
||||
private Integer visitsNumber;
|
||||
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*
|
||||
**/
|
||||
private Integer sort;
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.starry.admin.modules.shop.module.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 店铺文章信息新增
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024/6/5 上午10:36
|
||||
**/
|
||||
@Data
|
||||
public class PlayShopArticleInfoAddVo {
|
||||
|
||||
/**
|
||||
* 文章类型
|
||||
**/
|
||||
@NotNull(message = "文章类型不能为空")
|
||||
private String articleType;
|
||||
|
||||
/**
|
||||
* 文章标题
|
||||
**/
|
||||
@NotNull(message = "文章标题不能为空")
|
||||
private String articleTitle;
|
||||
|
||||
/**
|
||||
* 文章内容
|
||||
**/
|
||||
@NotNull(message = "文章内容不能为空")
|
||||
private String articleContent;
|
||||
|
||||
/**
|
||||
* 浏览量
|
||||
**/
|
||||
private Integer visitsNumber = 0;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort = 0;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.starry.admin.modules.shop.module.vo;
|
||||
|
||||
import com.starry.common.domain.BasePageEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 店铺文章查询对象
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024/6/5 上午10:36
|
||||
**/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class PlayShopArticleInfoQueryVo extends BasePageEntity {
|
||||
/**
|
||||
* 文章ID
|
||||
**/
|
||||
private String id;
|
||||
/**
|
||||
* 文章类型
|
||||
*/
|
||||
private String articleType;
|
||||
|
||||
|
||||
/**
|
||||
* 文章标题
|
||||
*/
|
||||
private String articleTitle;
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.starry.admin.modules.shop.module.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 店铺文章修改实体
|
||||
* @author admin
|
||||
* @since 2024/6/5 上午10:36
|
||||
**/
|
||||
@Data
|
||||
public class PlayShopArticleInfoUpdateVo {
|
||||
|
||||
@NotNull(message = "ID不能为空")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 文章类型
|
||||
*
|
||||
**/
|
||||
private String articleType;
|
||||
|
||||
/**
|
||||
* 文章标题
|
||||
*
|
||||
**/
|
||||
private String articleTitle;
|
||||
|
||||
/**
|
||||
* 文章内容
|
||||
*
|
||||
**/
|
||||
private String articleContent;
|
||||
|
||||
/**
|
||||
* 浏览量
|
||||
*
|
||||
**/
|
||||
private Integer visitsNumber;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*
|
||||
**/
|
||||
private Integer sort;
|
||||
}
|
||||
@@ -81,6 +81,15 @@ public interface IPlayCouponDetailsService extends IService<PlayCouponDetailsEnt
|
||||
*/
|
||||
boolean update(PlayCouponDetailsEntity playCouponDetails);
|
||||
|
||||
/**
|
||||
* 批量修改优惠券使用状态
|
||||
* 优惠券使用状态(1:未使用;2:已使用;3:已回收)
|
||||
*
|
||||
* @param ids 需要删除的优惠券详情主键集合
|
||||
* @param useState 优惠券使用状态(1 : 未使用 ; 2 : 已使用 ; 3 : 已回收)
|
||||
*/
|
||||
void updateCouponUseStateByIds(List<String> ids, String useState);
|
||||
|
||||
/**
|
||||
* 批量删除优惠券详情
|
||||
*
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.starry.admin.modules.shop.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.starry.admin.modules.shop.module.entity.PlayShopArticleInfoEntity;
|
||||
import com.starry.admin.modules.shop.module.vo.PlayShopArticleInfoQueryVo;
|
||||
|
||||
/**
|
||||
* 店铺文章信息Service接口
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-06-05
|
||||
*/
|
||||
public interface IPlayShopArticleInfoService extends IService<PlayShopArticleInfoEntity> {
|
||||
/**
|
||||
* 查询店铺文章信息
|
||||
*
|
||||
* @param id 店铺文章信息主键
|
||||
* @return 店铺文章信息
|
||||
*/
|
||||
PlayShopArticleInfoEntity selectById(String id);
|
||||
|
||||
|
||||
/**
|
||||
* 查询店铺文章信息列表
|
||||
*
|
||||
* @param vo 店铺文章信息查询对象
|
||||
* @return 店铺文章信息集合
|
||||
*/
|
||||
IPage<PlayShopArticleInfoEntity> selectByPage(PlayShopArticleInfoQueryVo vo);
|
||||
|
||||
|
||||
/**
|
||||
* 新增店铺文章信息
|
||||
*
|
||||
* @param articleInfoEntity 店铺文章信息
|
||||
* @return 结果
|
||||
*/
|
||||
boolean create(PlayShopArticleInfoEntity articleInfoEntity);
|
||||
|
||||
/**
|
||||
* 修改店铺文章信息
|
||||
*
|
||||
* @param articleInfoEntity 店铺文章信息
|
||||
* @return 结果
|
||||
*/
|
||||
boolean update(PlayShopArticleInfoEntity articleInfoEntity);
|
||||
|
||||
/**
|
||||
* 批量删除店铺文章信息
|
||||
*
|
||||
* @param ids 需要删除的店铺文章信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 删除店铺文章信息信息
|
||||
*
|
||||
* @param id 店铺文章信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteById(String id);
|
||||
}
|
||||
@@ -138,6 +138,18 @@ public class PlayCouponDetailsServiceImpl extends ServiceImpl<PlayCouponDetailsM
|
||||
return updateById(playCouponDetails);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void updateCouponUseStateByIds(List<String> ids, String useState) {
|
||||
for (String id : ids) {
|
||||
PlayCouponDetailsEntity entity = new PlayCouponDetailsEntity();
|
||||
entity.setId(id);
|
||||
entity.setUseState(useState);
|
||||
entity.setUseTime(LocalDateTime.now());
|
||||
baseMapper.updateById(entity);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除优惠券详情
|
||||
*
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.starry.admin.modules.shop.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.starry.admin.modules.shop.mapper.PlayShopArticleInfoMapper;
|
||||
import com.starry.admin.modules.shop.mapper.PlayShopCarouselInfoMapper;
|
||||
import com.starry.admin.modules.shop.module.entity.PlayShopArticleInfoEntity;
|
||||
import com.starry.admin.modules.shop.module.vo.PlayShopArticleInfoQueryVo;
|
||||
import com.starry.admin.modules.shop.service.IPlayShopArticleInfoService;
|
||||
import com.starry.common.utils.IdUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 店铺首页轮播Service业务层处理
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-06-05
|
||||
*/
|
||||
@Service
|
||||
public class PlayShopArticleInfoServiceImpl extends ServiceImpl<PlayShopArticleInfoMapper, PlayShopArticleInfoEntity> implements IPlayShopArticleInfoService {
|
||||
@Resource
|
||||
private PlayShopCarouselInfoMapper playCarouselInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询店铺首页轮播
|
||||
*
|
||||
* @param id 店铺首页轮播主键
|
||||
* @return 店铺首页轮播
|
||||
*/
|
||||
@Override
|
||||
public PlayShopArticleInfoEntity selectById(String id) {
|
||||
return this.baseMapper.selectById(id);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IPage<PlayShopArticleInfoEntity> selectByPage(PlayShopArticleInfoQueryVo vo) {
|
||||
LambdaQueryWrapper<PlayShopArticleInfoEntity> lambdaWrapper = new LambdaQueryWrapper<>();
|
||||
if (StrUtil.isNotBlank(vo.getId())) {
|
||||
lambdaWrapper.eq(PlayShopArticleInfoEntity::getId, vo.getId());
|
||||
}
|
||||
if (StrUtil.isNotBlank(vo.getArticleType())) {
|
||||
lambdaWrapper.eq(PlayShopArticleInfoEntity::getArticleType, vo.getArticleType());
|
||||
}
|
||||
if (StrUtil.isNotBlank(vo.getArticleTitle())) {
|
||||
lambdaWrapper.like(PlayShopArticleInfoEntity::getArticleTitle, vo.getArticleTitle());
|
||||
}
|
||||
return this.baseMapper.selectPage(new Page<>(vo.getPageNum(), vo.getPageSize()), lambdaWrapper);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增店铺首页轮播
|
||||
*
|
||||
* @param articleInfoEntity 店铺首页轮播
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean create(PlayShopArticleInfoEntity articleInfoEntity) {
|
||||
if (StrUtil.isBlankIfStr(articleInfoEntity.getId())) {
|
||||
articleInfoEntity.setId(IdUtils.getUuid());
|
||||
}
|
||||
return save(articleInfoEntity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改店铺首页轮播
|
||||
*
|
||||
* @param articleInfoEntity 店铺首页轮播
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean update(PlayShopArticleInfoEntity articleInfoEntity) {
|
||||
return updateById(articleInfoEntity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除店铺首页轮播
|
||||
*
|
||||
* @param ids 需要删除的店铺首页轮播主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteByIds(String[] ids) {
|
||||
return playCarouselInfoMapper.deleteBatchIds(Arrays.asList(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除店铺首页轮播信息
|
||||
*
|
||||
* @param id 店铺首页轮播主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteById(String id) {
|
||||
return playCarouselInfoMapper.deleteById(id);
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,6 @@ import com.starry.admin.common.exception.CustomException;
|
||||
import com.starry.admin.modules.custom.module.entity.PlayCustomUserInfoEntity;
|
||||
import com.starry.admin.modules.play.module.vo.PlayCommodityInfoVo;
|
||||
import com.starry.admin.modules.play.service.IPlayCommodityInfoService;
|
||||
import com.starry.admin.modules.shop.module.entity.PlayCouponDetailsEntity;
|
||||
import com.starry.admin.modules.shop.module.entity.PlayCouponInfoEntity;
|
||||
import com.starry.admin.modules.shop.module.vo.PlayCouponDetailsReturnVo;
|
||||
import com.starry.admin.modules.shop.service.IPlayCouponDetailsService;
|
||||
|
||||
Reference in New Issue
Block a user