| | |
| | | import com.ruoyi.system.api.service.RemoteConfigService; |
| | | import com.ruoyi.system.api.service.RemoteGoodsService; |
| | | import com.ruoyi.system.api.service.RemoteShopService; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | |
| | | |
| | | @Resource |
| | | private CouponRelGoodsService couponRelGoodsService; |
| | | |
| | | |
| | | @Resource |
| | | private CouponMapper couponMapper; |
| | | |
| | | |
| | | @Resource |
| | | private RemoteGoodsService remoteGoodsService; |
| | | |
| | | |
| | | @Resource |
| | | private CouponTotalService couponTotalService; |
| | | |
| | | |
| | | @Lazy |
| | | @Resource |
| | | private MemberService memberService; |
| | | |
| | | |
| | | @Lazy |
| | | @Resource |
| | | private MemberCouponService memberCouponService; |
| | | |
| | | |
| | | @Resource |
| | | private RemoteActivityService remoteActivityService; |
| | | |
| | | |
| | | @Resource |
| | | private MemberCouponRecordService memberCouponRecordService; |
| | | |
| | | |
| | | @Resource |
| | | private RemoteShopService remoteShopService; |
| | | |
| | |
| | | * @return void |
| | | */ |
| | | @Override |
| | | public void editMgtCoupon(MgtCouponEditDto mgtCouponEditDto){ |
| | | public void editMgtCoupon(MgtCouponEditDto mgtCouponEditDto){ |
| | | //编辑优惠券 |
| | | Coupon coupon; |
| | | CouponTotal couponTotal; |
| | |
| | | public void deleteMgtCoupon(MgtBaseGetDto mgtBaseGetDto){ |
| | | Coupon coupon = this.getById(mgtBaseGetDto.getId()); |
| | | CouponTotal couponTotal = couponTotalService.getById(mgtBaseGetDto.getId()); |
| | | if(couponTotal.getSendCount()!=null&&couponTotal.getSendCount()>0){ |
| | | throw new ServiceException(AppErrorConstant.COUPON_SENT_DEL); |
| | | } |
| | | // if(couponTotal.getSendCount()!=null&&couponTotal.getSendCount()>0){ |
| | | // throw new ServiceException(AppErrorConstant.COUPON_SENT_DEL); |
| | | // } |
| | | coupon.setCouponStatus(-1); |
| | | coupon.setDelFlag(1); |
| | | coupon.setUpdateUserId(mgtBaseGetDto.getUserId()); |
| | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | String useLimit = ""; |
| | | for(MgtCouponAuditPageVo mgtCouponAuditPageVo : mgtCouponAuditPageVoList){ |
| | | useLimit = null; |
| | | //处理使用限制 |
| | | String couponType = mgtCouponAuditPageVo.getCouponType(); |
| | | if(couponType.equals("满减")){ |
| | | BigDecimal moneyThreshold = mgtCouponAuditPageVo.getMoneyThreshold(); |
| | | BigDecimal discountMoney = mgtCouponAuditPageVo.getDiscountMoney(); |
| | | useLimit = "满" + moneyThreshold.toString() + "减" + discountMoney.toString() + "元"; |
| | | } |
| | | if(couponType.equals("折扣")){ |
| | | BigDecimal discountPercent = mgtCouponAuditPageVo.getDiscountPercent(); |
| | | useLimit = discountPercent.toString() + "折"; |
| | | } |
| | | if(couponType.equals("代金")){ |
| | | BigDecimal discountMoney = mgtCouponAuditPageVo.getDiscountMoney(); |
| | | useLimit = discountMoney.toString(); |
| | | } |
| | | mgtCouponAuditPageVo.setUseLimit(useLimit); |
| | | } |
| | | return mgtCouponAuditPageVoList; |
| | | } |
| | |
| | | CouponTotal couponTotal; |
| | | if(StringUtils.isNotBlank(merCouponEditDto.getCouponId())){ |
| | | coupon = this.getById(merCouponEditDto.getCouponId()); |
| | | if(coupon.getAuditStatus()!=3){ |
| | | throw new ServiceException(AppErrorConstant.COUPON_AUDIT_EDIT); |
| | | } |
| | | // if(coupon.getAuditStatus()!=3){ |
| | | // throw new ServiceException(AppErrorConstant.COUPON_AUDIT_EDIT); |
| | | // } |
| | | couponRelUserService.deleteCouponRelByCouponId(coupon.getCouponId()); |
| | | couponRelGoodsService.deleteCouponRelByCouponId(coupon.getCouponId()); |
| | | coupon.setCouponStatus(1); |
| | |
| | | Coupon coupon; |
| | | List<MemberCoupon> memberCouponList = new ArrayList<>(); |
| | | MemberCoupon memberCoupon; |
| | | String memberCouponId; |
| | | |
| | | // 遍历生日礼物发送DTO列表 |
| | | for(BirthdayGiftSendDto birthdayGiftSendDto : giftSendDtoList){ |
| | |
| | | // 根据优惠券数量生成会员优惠券列表 |
| | | for(int i=0;i<birthdayGiftSendDto.getCouponNumber();i++){ |
| | | memberCoupon = new MemberCoupon(); |
| | | //TODO |
| | | memberCouponId = IdUtils.simpleUUID(); |
| | | //memberCoupon.setId(memberCouponId); |
| | | memberCoupon.setDelFlag(0); |
| | | memberCoupon.setCouponId(couponId); |
| | | memberCoupon.setUserId(userId); |
| | |
| | | } |
| | | //生成用户优惠券 |
| | | MemberCoupon memberCoupon = new MemberCoupon(); |
| | | //String memberCouponId = IdUtils.simpleUUID(); |
| | | //memberCoupon.setId(memberCouponId); |
| | | memberCoupon.setDelFlag(0); |
| | | memberCoupon.setCouponId(couponId); |
| | | memberCoupon.setUserId(userId); |
| | |
| | | metAuditCouponTotalVo.setRefuseTotal(refuseTotal); |
| | | return metAuditCouponTotalVo; |
| | | } |
| | | |
| | | @Override |
| | | public void endImmediately(MgtBaseGetDto mgtBaseGetDto) { |
| | | |
| | | } |
| | | } |