mirror of
https://github.com/weizhiqiang1995/erp-pro.git
synced 2025-02-19 12:56:05 +08:00
Merge branch 'company_server' of https://gitee.com/doc_wei01/skyeye into company_server
This commit is contained in:
commit
c7bb8790cc
3 changed files with 2 additions and 13 deletions
skyeye-shop/shop-store/src/main/java/com/skyeye/coupon/service
|
@ -25,6 +25,4 @@ public interface CouponService extends SkyeyeBusinessService<Coupon> {
|
||||||
void queryCouponListByState(InputObject inputObject, OutputObject outputObject);
|
void queryCouponListByState(InputObject inputObject, OutputObject outputObject);
|
||||||
|
|
||||||
void queryCouponListByMaterialId(InputObject inputObject, OutputObject outputObject);
|
void queryCouponListByMaterialId(InputObject inputObject, OutputObject outputObject);
|
||||||
|
|
||||||
Integer getUseCount(String couponId);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -274,15 +274,6 @@ public class CouponServiceImpl extends SkyeyeBusinessServiceImpl<CouponDao, Coup
|
||||||
outputObject.settotal(list.size());
|
outputObject.settotal(list.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Integer getUseCount(String couponId) {
|
|
||||||
Coupon coupon = selectById(couponId);
|
|
||||||
if (ObjUtil.isEmpty(coupon)) {
|
|
||||||
throw new CustomException("优惠券不存在");
|
|
||||||
}
|
|
||||||
return coupon.getUseCount();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setDrawState(List<Coupon> list) {
|
private void setDrawState(List<Coupon> list) {
|
||||||
if (CollectionUtil.isEmpty(list)) return;
|
if (CollectionUtil.isEmpty(list)) return;
|
||||||
List<String> couponIdList = list.stream().map(Coupon::getId).collect(Collectors.toList());
|
List<String> couponIdList = list.stream().map(Coupon::getId).collect(Collectors.toList());
|
||||||
|
|
|
@ -142,10 +142,10 @@ public class CouponUseServiceImpl extends SkyeyeBusinessServiceImpl<CouponUseDao
|
||||||
public void createPostpose(CouponUse couponUse, String userId) {
|
public void createPostpose(CouponUse couponUse, String userId) {
|
||||||
// 更新优惠券领取数量
|
// 更新优惠券领取数量
|
||||||
couponService.updateTakeCount(couponUse.getCouponId(), couponUse.getCouponMation().getTakeCount() + 1);
|
couponService.updateTakeCount(couponUse.getCouponId(), couponUse.getCouponMation().getTakeCount() + 1);
|
||||||
Integer useCount = couponService.getUseCount(couponUse.getCouponId());
|
|
||||||
couponUse.setUsageCount(useCount);
|
|
||||||
// 新增优惠券可使用的商品信息
|
// 新增优惠券可使用的商品信息
|
||||||
couponUseMaterialService.createEntity(couponUse.getCouponUseMaterialList(), userId);
|
couponUseMaterialService.createEntity(couponUse.getCouponUseMaterialList(), userId);
|
||||||
|
Coupon coupon = couponService.selectById(couponUse.getCouponId());
|
||||||
|
couponUse.setUsageCount(coupon.getUseCount());
|
||||||
// 定时任务
|
// 定时任务
|
||||||
Coupon couponMation = couponUse.getCouponMation();
|
Coupon couponMation = couponUse.getCouponMation();
|
||||||
if (Objects.equals(couponMation.getValidityType(), CouponValidityType.TERM.getKey())) {
|
if (Objects.equals(couponMation.getValidityType(), CouponValidityType.TERM.getKey())) {
|
||||||
|
|
Loading…
Reference in a new issue