Merge branch 'main' of http://122.51.230.86:3000/dianliang/oil-station
This commit is contained in:
commit
9e6ca618aa
@ -26,12 +26,9 @@
|
||||
:label="option.realName"
|
||||
:value="option.id"
|
||||
:disabled="queryParams.status === '统一交班'"
|
||||
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item class="flex-container" style="float: right">
|
||||
<el-button type="primary" icon="el-icon-search" :disabled="!isSearch" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
@ -278,8 +275,6 @@
|
||||
<div class="r-size">¥{{ item.paidAmount ? item.paidAmount : '--' }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="for-box">
|
||||
<div class="for-title">
|
||||
<div class="x-"></div>
|
||||
@ -297,8 +292,6 @@
|
||||
<div class="r-size">¥{{ item.paidAmount ? item.paidAmount : '--' }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="for-box">
|
||||
<div class="for-title">
|
||||
<div class="x-"></div>
|
||||
|
@ -10,7 +10,7 @@ export default {
|
||||
return {
|
||||
// 查看详情
|
||||
openSeeDetails:false,
|
||||
// 交易明细
|
||||
// 170px
|
||||
openTransactionDetail:false,
|
||||
// 商品汇总
|
||||
openGoodsSum:false,
|
||||
|
@ -16,6 +16,9 @@ import com.fuint.business.commission.service.StaffCommissionService;
|
||||
import com.fuint.business.integral.entity.IntegralOrders;
|
||||
import com.fuint.business.integral.service.IntegralOrdersService;
|
||||
import com.fuint.business.integral.service.IntegralSettingsService;
|
||||
import com.fuint.business.marketingActivity.activePrice.entity.ActivePriceRecord;
|
||||
import com.fuint.business.marketingActivity.activePrice.service.ActivePriceRecordService;
|
||||
import com.fuint.business.marketingActivity.activePrice.service.ActivePriceService;
|
||||
import com.fuint.business.marketingActivity.activeRecommend.service.ActiveRecommendRecordsService;
|
||||
import com.fuint.business.marketingActivity.cardCoupon.entity.CardCouponUser;
|
||||
import com.fuint.business.marketingActivity.cardCoupon.mapper.CardCouponUserMapper;
|
||||
@ -29,6 +32,9 @@ import com.fuint.business.marketingActivity.cardValue.service.CardValueRecordSer
|
||||
import com.fuint.business.marketingActivity.cardValueOrders.service.CardValueOrdersService;
|
||||
import com.fuint.business.order.entity.*;
|
||||
import com.fuint.business.order.service.*;
|
||||
import com.fuint.business.userGroup.entity.UserDiscountRecord;
|
||||
import com.fuint.business.userGroup.service.IUserDiscountRecordService;
|
||||
import com.fuint.business.userGroup.service.UserDiscountService;
|
||||
import com.fuint.business.userManager.entity.UserBalance;
|
||||
import com.fuint.business.userManager.service.LJUserService;
|
||||
import com.fuint.business.userManager.service.UserBalanceService;
|
||||
@ -70,6 +76,10 @@ public class FyPayServiceImpl implements FyPayService {
|
||||
private ActiveRecommendRecordsService activeRecommendRecordsService;
|
||||
@Autowired
|
||||
private CardCouponUserMapper cardCouponUserMapper;
|
||||
@Autowired
|
||||
private IUserDiscountRecordService userDiscountRecordService;
|
||||
@Autowired
|
||||
private ActivePriceRecordService activePriceRecordService;
|
||||
|
||||
/**
|
||||
* 条码支付
|
||||
@ -189,9 +199,9 @@ public class FyPayServiceImpl implements FyPayService {
|
||||
//响应报文验签
|
||||
Map<String, String> reqMap = Utils.xmlStr2Map(rspXml);
|
||||
String str = reqMap.get("sign");
|
||||
//查询总订单
|
||||
AllOrderInfo allOrderInfo = allOrderInfoService.selectAllOrderInfoByOrderNo(orderNo);
|
||||
if (Utils.verifySign(reqMap, str)) {
|
||||
//查询总订单
|
||||
AllOrderInfo allOrderInfo = allOrderInfoService.selectAllOrderInfoByOrderNo(orderNo);
|
||||
//油品订单
|
||||
OilOrder oilOrder = oilOrderService.selectOilOrderByOrderNo(orderNo);
|
||||
//商品订单
|
||||
@ -437,6 +447,18 @@ public class FyPayServiceImpl implements FyPayService {
|
||||
}
|
||||
//推荐会员充值有礼
|
||||
activeRecommendRecordsService.recommendMembersRechargePolite(allOrderInfo.getStoreId(), allOrderInfo.getUserId(), allOrderInfo.getPayType());
|
||||
}else {
|
||||
//删除会员折扣记录
|
||||
UserDiscountRecord userDiscountRecord = userDiscountRecordService.queryByOrderId(allOrderInfo.getId());
|
||||
if (ObjectUtil.isNotEmpty(userDiscountRecord)) {
|
||||
userDiscountRecordService.delete(userDiscountRecord.getId());
|
||||
}
|
||||
|
||||
//删除分时优惠记录
|
||||
ActivePriceRecord activePriceRecord = activePriceRecordService.queryByOrderId(allOrderInfo.getId());
|
||||
if (ObjectUtil.isNotEmpty(activePriceRecord)) {
|
||||
activePriceRecordService.delete(activePriceRecord.getId());
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
@ -32,6 +32,7 @@
|
||||
FROM
|
||||
active_applet aa LEFT JOIN t_account ta on aa.create_by = ta.acct_id
|
||||
<where>
|
||||
type != '1' and type != '2'
|
||||
<if test="entity.name != null and entity.name != ''">
|
||||
AND aa.name like concat('%', #{entity.name}, '%')
|
||||
</if>
|
||||
|
@ -24,5 +24,29 @@ public interface ActivePriceRecordService extends IService<ActivePriceRecord> {
|
||||
* @return java.util.List<com.fuint.business.marketingActivity.activePrice.entity.ActivePriceRecord>
|
||||
**/
|
||||
List<ActivePriceRecord> selectListByUserIdAndActIds(Integer userId,List<Integer> ruleIdList,List<Integer> actIdList,List<String> actTypeList);
|
||||
|
||||
/**
|
||||
* 根据订单id查询记录
|
||||
* @param orderId
|
||||
* @return
|
||||
*/
|
||||
ActivePriceRecord queryByOrderId(Integer orderId);
|
||||
|
||||
/**
|
||||
* 删除记录
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
int delete (Integer id);
|
||||
|
||||
/**
|
||||
* 新增分时优惠记录
|
||||
* @param actId
|
||||
* @param ruleId
|
||||
* @param orderId
|
||||
* @param disAmount
|
||||
* @return
|
||||
*/
|
||||
int add(Integer userId,Integer actId, Integer ruleId, Integer orderId, Double disAmount);
|
||||
}
|
||||
|
||||
|
@ -1,10 +1,17 @@
|
||||
package com.fuint.business.marketingActivity.activePrice.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fuint.business.marketingActivity.activePrice.entity.ActivePrice;
|
||||
import com.fuint.business.marketingActivity.activePrice.entity.ActivePriceRecord;
|
||||
import com.fuint.business.marketingActivity.activePrice.entity.ActivePriceRule;
|
||||
import com.fuint.business.marketingActivity.activePrice.mapper.ActivePriceMapper;
|
||||
import com.fuint.business.marketingActivity.activePrice.mapper.ActivePriceRecordMapper;
|
||||
import com.fuint.business.marketingActivity.activePrice.mapper.ActivePriceRuleMapper;
|
||||
import com.fuint.business.marketingActivity.activePrice.service.ActivePriceRecordService;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
@ -18,6 +25,11 @@ import java.util.List;
|
||||
@Service("ActivePriceRecordService")
|
||||
public class ActivePriceRecordServiceImpl extends ServiceImpl<ActivePriceRecordMapper, ActivePriceRecord> implements ActivePriceRecordService {
|
||||
|
||||
@Autowired
|
||||
private ActivePriceMapper activePriceMapper;
|
||||
@Autowired
|
||||
private ActivePriceRuleMapper activePriceRuleMapper;
|
||||
|
||||
/**
|
||||
* 根据用户Id和活动ids查询所有参与的记录
|
||||
*
|
||||
@ -44,4 +56,64 @@ public class ActivePriceRecordServiceImpl extends ServiceImpl<ActivePriceRecordM
|
||||
}
|
||||
return this.list(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据订单id查询记录
|
||||
*
|
||||
* @param orderId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ActivePriceRecord queryByOrderId(Integer orderId) {
|
||||
return baseMapper.selectOne(new LambdaQueryWrapper<ActivePriceRecord>()
|
||||
.eq(ActivePriceRecord::getOrderId, orderId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除记录
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int delete(Integer id) {
|
||||
return baseMapper.deleteById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增分时优惠记录
|
||||
*
|
||||
* @param actId
|
||||
* @param ruleId
|
||||
* @param orderId
|
||||
* @param disAmount
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int add(Integer userId,Integer actId, Integer ruleId, Integer orderId, Double disAmount) {
|
||||
//通过活动id查询名称
|
||||
ActivePrice activePrice = activePriceMapper.selectOne(new LambdaQueryWrapper<ActivePrice>()
|
||||
.eq(ActivePrice::getId, actId));
|
||||
if (ObjectUtil.isEmpty(activePrice)) {
|
||||
throw new RuntimeException("未找到该活动");
|
||||
}
|
||||
ActivePriceRecord activePriceRecord = new ActivePriceRecord();
|
||||
activePriceRecord.setActId(actId);
|
||||
activePriceRecord.setRuleId(ruleId);
|
||||
activePriceRecord.setOrderId(orderId);
|
||||
activePriceRecord.setStoreId(activePrice.getStoreId());
|
||||
activePriceRecord.setDisAmount(disAmount);
|
||||
activePriceRecord.setActName(activePrice.getTitle());
|
||||
activePriceRecord.setActType(activePrice.getActiveType());
|
||||
activePriceRecord.setCreateTime(activePrice.getCreateTime());
|
||||
activePriceRecord.setUserId(userId);
|
||||
activePriceRecord.setCreateBy(TokenUtil.getNowAccountInfo().getId().toString());
|
||||
//查询活动规则
|
||||
ActivePriceRule activePriceRule = activePriceRuleMapper.selectOne(new LambdaQueryWrapper<ActivePriceRule>()
|
||||
.eq(ActivePriceRule::getId, ruleId));
|
||||
if (ObjectUtil.isNotEmpty(activePriceRule)) {
|
||||
activePriceRecord.setRuleName(activePriceRule.getRuleName());
|
||||
}
|
||||
return baseMapper.insert(activePriceRecord);
|
||||
}
|
||||
}
|
||||
|
@ -380,8 +380,8 @@ public class ActiveRecommendRecordsServiceImpl extends ServiceImpl<ActiveRecomme
|
||||
}
|
||||
|
||||
//判断优惠券剩余数量是否足够 如果不够剩多少领多少
|
||||
if ((cardCoupon.getTfTotal() - cardCoupon.getGiftCardTotal()) < giftCardTotal) {
|
||||
giftCardTotal = cardCoupon.getTfTotal() - cardCoupon.getGiftCardTotal();
|
||||
if ((cardCoupon.getTfTotal() - cardCoupon.getTfGetNum()) < giftCardTotal) {
|
||||
giftCardTotal = cardCoupon.getTfTotal() - cardCoupon.getTfGetNum();
|
||||
}
|
||||
|
||||
//将优惠券添加到用户优惠券表
|
||||
|
@ -223,6 +223,15 @@ public class CardCouponController extends BaseController {
|
||||
return getSuccessResult(cardCouponService.sendCoupon(cardCouponUser));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户领取优惠券
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("userGetCoupon")
|
||||
public ResponseObject userGetCoupon(@RequestBody Integer couponId){
|
||||
return getSuccessResult(cardCouponService.userGetCoupon(couponId));
|
||||
}
|
||||
|
||||
// @GetMapping("getCouponOne")
|
||||
// public ResponseObject getCouponOne(Integer id) {
|
||||
// return getSuccessResult(cardCouponService.getCouponOne(id));
|
||||
|
@ -31,6 +31,13 @@ public interface CardCouponService extends IService<CardCoupon> {
|
||||
int sendCoupon(CardCouponUser cardCouponUser);
|
||||
|
||||
CardCoupon selectOneBuId(Integer id);
|
||||
|
||||
/**
|
||||
* 用户领取卡券
|
||||
* @param couponId
|
||||
* @return
|
||||
*/
|
||||
int userGetCoupon(Integer couponId);
|
||||
/**
|
||||
* 卡券详情(小程序)
|
||||
* @param id
|
||||
|
@ -21,6 +21,8 @@ import com.fuint.business.petrolStationManagement.entity.OilName;
|
||||
import com.fuint.business.petrolStationManagement.mapper.OilNameMapper;
|
||||
import com.fuint.business.store.entity.MtStore;
|
||||
import com.fuint.business.store.mapper.MtStoreMapper;
|
||||
import com.fuint.business.userManager.entity.UserBalance;
|
||||
import com.fuint.business.userManager.mapper.UserBalanceMapper;
|
||||
import com.fuint.business.userManager.service.LJUserService;
|
||||
import com.fuint.business.userManager.vo.LJUserVo;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
@ -46,6 +48,8 @@ public class CardCouponServiceImpl extends ServiceImpl<CardCouponMapper, CardCou
|
||||
private CardCouponUserMapper cardCouponUserMapper;
|
||||
@Autowired
|
||||
private LJUserService userService;
|
||||
@Autowired
|
||||
private UserBalanceMapper userBalanceMapper;
|
||||
@Override
|
||||
public IPage<CardCoupon> pageVo(Page page, CardCoupon cardCoupon) {
|
||||
return baseMapper.pageVo( page, cardCoupon);
|
||||
@ -90,6 +94,10 @@ public class CardCouponServiceImpl extends ServiceImpl<CardCouponMapper, CardCou
|
||||
List<CardCouponUniVo> cardCouponUniVos1 = baseMapper.selectByStoreIdCount(cardCouponUniVo1);
|
||||
Map<Integer, Integer> cardCouponMap = cardCouponUniVos1.stream().collect(Collectors.toMap(CardCouponUniVo::getId, CardCouponUniVo::getCount));
|
||||
|
||||
//查询用户的会员等级
|
||||
UserBalance userBalance = userBalanceMapper.selectOne(new LambdaQueryWrapper<UserBalance>()
|
||||
.eq(UserBalance::getMtUserId, nowAccountInfo.getId()));
|
||||
|
||||
|
||||
//存放最终可领取的优惠券id集合
|
||||
List<Integer> ids = new ArrayList<>();
|
||||
@ -99,6 +107,11 @@ public class CardCouponServiceImpl extends ServiceImpl<CardCouponMapper, CardCou
|
||||
if (ObjectUtil.isNotEmpty(coupon.getTfGetNum())){
|
||||
getNum = coupon.getTfGetNum();
|
||||
}
|
||||
//判断当前用户是否符合会员等级
|
||||
String[] split = coupon.getMembershipLevel().split(",");
|
||||
if (!Arrays.asList(split).contains(userBalance.getGradeId().toString())) {
|
||||
continue;
|
||||
}
|
||||
//查询该优惠券是否已到达限制数量
|
||||
if ((getNum < coupon.getTfTotal())) {
|
||||
Integer count = 0;
|
||||
@ -147,6 +160,70 @@ public class CardCouponServiceImpl extends ServiceImpl<CardCouponMapper, CardCou
|
||||
return baseMapper.selectById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户领取卡券
|
||||
*
|
||||
* @param couponId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int userGetCoupon(Integer couponId) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
//查询优惠券信息
|
||||
CardCoupon cardCoupon = baseMapper.selectOne(new LambdaQueryWrapper<CardCoupon>()
|
||||
.eq(CardCoupon::getId, couponId));
|
||||
|
||||
//判断优惠券是否在线
|
||||
if (cardCoupon.getStatus().equals("0")) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
//判断是否有库存
|
||||
int count = cardCoupon.getTfTotal() - (cardCoupon.getTfGetNum() == null ? 0 : cardCoupon.getTfGetNum());
|
||||
if (count == 0) {
|
||||
return 0;
|
||||
}
|
||||
//判断用户是否已经领取上限
|
||||
Integer getCount = cardCouponUserMapper.selectCount(new LambdaQueryWrapper<CardCouponUser>()
|
||||
.eq(CardCouponUser::getMtUserId, nowAccountInfo.getId())
|
||||
.eq(CardCouponUser::getCardCouponId, couponId));
|
||||
if (getCount >= (cardCoupon.getGetNumLimit() == null ? 0 : cardCoupon.getGetNumLimit())) {
|
||||
return 3;
|
||||
}
|
||||
Integer validityDay = 0;
|
||||
//优惠券的有效期
|
||||
Date effectiveDateStart = new Date();
|
||||
Date effectiveDateEnd = new Date();
|
||||
if (cardCoupon.getTimeType().equals("1")) {
|
||||
validityDay = cardCoupon.getValidityDay();
|
||||
DateTime now = DateUtil.date();
|
||||
effectiveDateStart = now;
|
||||
effectiveDateEnd = DateUtil.offsetDay(now, validityDay);
|
||||
}else {
|
||||
effectiveDateStart = cardCoupon.getEffectiveDateStart();
|
||||
effectiveDateEnd = cardCoupon.getEffectiveDateEnd();
|
||||
}
|
||||
|
||||
//添加到用户优惠券表
|
||||
CardCouponUser cardCouponUser = new CardCouponUser();
|
||||
cardCouponUser.setStatus("0");
|
||||
cardCouponUser.setChainStoreId(cardCoupon.getChainStorId());
|
||||
cardCouponUser.setStoreId(cardCoupon.getStoreId());
|
||||
cardCouponUser.setMtUserId(nowAccountInfo.getId());
|
||||
cardCouponUser.setFromType("6");
|
||||
cardCouponUser.setCardCouponId(cardCoupon.getId());
|
||||
cardCouponUser.setStartTime(effectiveDateStart);
|
||||
cardCouponUser.setEndTime(effectiveDateEnd);
|
||||
cardCouponUser.setCreateTime(new Date());
|
||||
cardCouponUser.setCreateBy(TokenUtil.getNowAccountInfo().getId().toString());
|
||||
cardCouponUserMapper.insert(cardCouponUser);
|
||||
|
||||
//更新优惠券表
|
||||
if (cardCoupon.getTfGetNum() == null) cardCoupon.setTfGetNum(0);
|
||||
cardCoupon.setTfGetNum(cardCoupon.getTfGetNum() + 1);
|
||||
return baseMapper.updateById(cardCoupon);
|
||||
}
|
||||
|
||||
/**
|
||||
* 卡券详情(小程序)
|
||||
*
|
||||
|
@ -0,0 +1,20 @@
|
||||
package com.fuint.business.userGroup.controller;
|
||||
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 会员折扣记录表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author dianliang
|
||||
* @since 2024-10-11
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/user-discount-record")
|
||||
public class UserDiscountRecordController {
|
||||
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
package com.fuint.business.userGroup.entity;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.time.LocalDateTime;
|
||||
import java.io.Serializable;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 会员折扣记录表
|
||||
* </p>
|
||||
*
|
||||
* @author dianliang
|
||||
* @since 2024-10-11
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@TableName("user_discount_record")
|
||||
@ApiModel(value="UserDiscountRecord对象", description="会员折扣记录表")
|
||||
public class UserDiscountRecord implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "id")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "会员折扣活动id")
|
||||
private Integer userDiscountId;
|
||||
|
||||
@ApiModelProperty(value = "用户id")
|
||||
private Integer userId;
|
||||
|
||||
@ApiModelProperty(value = "店铺id")
|
||||
private Integer storeId;
|
||||
|
||||
@ApiModelProperty(value = "订单id")
|
||||
private Integer orderId;
|
||||
|
||||
@ApiModelProperty(value = "优惠金额(元)")
|
||||
private BigDecimal disAmount;
|
||||
|
||||
@ApiModelProperty(value = "创建者")
|
||||
private String createBy;
|
||||
|
||||
@ApiModelProperty(value = "更新者")
|
||||
private String updateBy;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package com.fuint.business.userGroup.mapper;
|
||||
|
||||
import com.fuint.business.userGroup.entity.UserDiscountRecord;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 会员折扣记录表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author dianliang
|
||||
* @since 2024-10-11
|
||||
*/
|
||||
public interface UserDiscountRecordMapper extends BaseMapper<UserDiscountRecord> {
|
||||
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
package com.fuint.business.userGroup.service;
|
||||
|
||||
import com.fuint.business.userGroup.entity.UserDiscountRecord;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 会员折扣记录表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author dianliang
|
||||
* @since 2024-10-11
|
||||
*/
|
||||
public interface IUserDiscountRecordService extends IService<UserDiscountRecord> {
|
||||
|
||||
/**
|
||||
* 新增会员折扣记录
|
||||
* @return
|
||||
*/
|
||||
int add(UserDiscountRecord userDiscountRecord);
|
||||
|
||||
/**
|
||||
* 删除会员折扣记录
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
int delete(Integer id);
|
||||
|
||||
/**
|
||||
* 根据订单ID获取会员折扣记录
|
||||
* @param orderId
|
||||
* @return
|
||||
*/
|
||||
UserDiscountRecord queryByOrderId(Integer orderId);
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
package com.fuint.business.userGroup.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.fuint.business.userGroup.entity.UserDiscountRecord;
|
||||
import com.fuint.business.userGroup.mapper.UserDiscountRecordMapper;
|
||||
import com.fuint.business.userGroup.service.IUserDiscountRecordService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 会员折扣记录表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author dianliang
|
||||
* @since 2024-10-11
|
||||
*/
|
||||
@Service
|
||||
public class UserDiscountRecordServiceImpl extends ServiceImpl<UserDiscountRecordMapper, UserDiscountRecord> implements IUserDiscountRecordService {
|
||||
|
||||
/**
|
||||
* 新增会员折扣记录
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int add(UserDiscountRecord userDiscountRecord) {
|
||||
return baseMapper.insert(userDiscountRecord);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除会员折扣记录
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int delete(Integer id) {
|
||||
return baseMapper.deleteById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据订单ID获取会员折扣记录
|
||||
*
|
||||
* @param orderId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public UserDiscountRecord queryByOrderId(Integer orderId) {
|
||||
return baseMapper.selectOne(new LambdaQueryWrapper<UserDiscountRecord>()
|
||||
.eq(UserDiscountRecord::getOrderId, orderId));
|
||||
}
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.fuint.business.userGroup.mapper.UserDiscountRecordMapper">
|
||||
|
||||
</mapper>
|
@ -100,7 +100,7 @@
|
||||
<div>{{orderSummary.sumnum}}</div>
|
||||
</div>
|
||||
<div class="xxing"></div>
|
||||
<div style="overflow: auto; height: 35vh;scrollbar-width: none; ">
|
||||
<div style="overflow: auto; height: 32vh;scrollbar-width: none; ">
|
||||
<div class="for-box">
|
||||
<div class="for-title">
|
||||
<div class="x-"></div>
|
||||
|
@ -488,14 +488,7 @@
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="归还方式" prop="payType">
|
||||
<!-- <el-radio-group v-model="form2.payType"-->
|
||||
<!-- @click="returnMethod">-->
|
||||
<!-- <el-radio v-for="item in payList"-->
|
||||
<!-- :key="item.dictValue"-->
|
||||
<!-- :value="item.dictValue"-->
|
||||
<!-- :label="item.dictValue" border>{{ item.dictLabel }}</el-radio>-->
|
||||
<!-- </el-radio-group>-->
|
||||
<el-radio v-model="payType" v-for="item in payList"
|
||||
<el-radio style="margin-left: 0px;margin-bottom: 10px" v-model="payType" v-for="item in payList"
|
||||
:key="item.dictValue" :value="item.dictValue"
|
||||
v-if="item.dictValue!='APPLET_CODE'"
|
||||
:label="item.dictValue"
|
||||
|
@ -375,9 +375,10 @@ export default {
|
||||
margin: 0px auto;
|
||||
border-radius: 8px;
|
||||
box-sizing: border-box;
|
||||
padding: 0px 15px;
|
||||
padding: 15px;
|
||||
border-bottom: 1px solid #eceff1;
|
||||
padding-bottom: 0px;
|
||||
height: 64px;
|
||||
|
||||
}
|
||||
.cont_box{
|
||||
|
@ -181,23 +181,23 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button style="color: #fe8c4a" size="mini"
|
||||
<div style="color: #fe8c4a" size="mini"
|
||||
@click="getOrdersInfo(scope.row.id)"
|
||||
type="text" plain round>详情
|
||||
</el-button>
|
||||
</div>
|
||||
<!-- <el-button style="color: #fe8c4a" size="mini"-->
|
||||
<!-- @click="getOrdersInfo2(scope.row.id)"-->
|
||||
<!-- type="text" plain round>详情2-->
|
||||
<!-- </el-button>-->
|
||||
<el-button style="color: #fe8c4a" size="mini"
|
||||
<div style="color: #fe8c4a" size="mini"
|
||||
@click="patchwork(scope.row)"
|
||||
type="text" plain round>补打小票
|
||||
</el-button>
|
||||
<el-button style="color: #fe8c4a" size="mini"
|
||||
</div>
|
||||
<div style="color: #fe8c4a" size="mini"
|
||||
v-if="scope.row.status === 'paid'"
|
||||
@click="refHandleRefund(scope.row.id)"
|
||||
type="text" plain round>退款
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
@ -173,10 +173,10 @@
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<!-- <el-button size="mini" type="text" icon="el-icon-edit">更多操作</el-button>-->
|
||||
<el-button style="width: 60px" size="mini"
|
||||
<div style="width: 60px;color: #ff8c4b;margin: 0 auto"
|
||||
@click="patchwork(scope.row)"
|
||||
type="primary" plain round>补打
|
||||
</el-button>
|
||||
</div>
|
||||
<!-- <el-button style="width: 60px" size="mini"-->
|
||||
<!-- @click="handleRefund(scope.row.id)"-->
|
||||
<!-- type="danger" plain round>退款</el-button>-->
|
||||
|
@ -2,8 +2,9 @@
|
||||
<view class="centenr">
|
||||
<view class="Candywrapper">
|
||||
<view class="bai-bs">
|
||||
<view class="">
|
||||
<image :src="couponInfo.backgroundImage" v-if="couponInfo.backgroundImage" style="width: 60px; height: 60px; "></image>
|
||||
<view class="">
|
||||
<image :src="couponInfo.backgroundImage" v-if="couponInfo.backgroundImage"
|
||||
style="width: 60px; height: 60px; "></image>
|
||||
<image src="../../static/logo.png" v-else style="width: 60px; height: 60px; "></image>
|
||||
</view>
|
||||
<view class="rr-box">
|
||||
@ -15,7 +16,9 @@
|
||||
<view class="red-size" v-if="couponInfo.type==3">折扣券</view>
|
||||
<view class="red-size" v-if="couponInfo.type==4">油品立减券</view>
|
||||
<view class="red-size" v-if="couponInfo.type==5">单品代金券</view>
|
||||
<view class="red-size">剩余{{ couponInfo.tfGetNum ? (couponInfo.tfTotal - couponInfo.tfGetNum) : couponInfo.tfTotal}}张</view>
|
||||
<view class="red-size">
|
||||
剩余{{ couponInfo.tfGetNum ? (couponInfo.tfTotal - couponInfo.tfGetNum) : couponInfo.tfTotal}}张
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -27,7 +30,9 @@
|
||||
<view class="si_">2、每日限领{{couponInfo.dayGetLimit || 0}}张</view>
|
||||
<view class="si_">核销说明:</view>
|
||||
<view class="si_" style="display: flex;" v-for="(item,index) in couponInfo.hxList" :key="index">
|
||||
<view style="width: 6px;height: 6px;border-radius: 50%;margin-right: 5px;background-color: #FF9655;margin-top: 6px;"></view>
|
||||
<view
|
||||
style="width: 6px;height: 6px;border-radius: 50%;margin-right: 5px;background-color: #FF9655;margin-top: 6px;">
|
||||
</view>
|
||||
<view>{{item}}</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -47,7 +52,7 @@
|
||||
</view>
|
||||
<view class="bottom-box">
|
||||
<view class="or-num">免费</view>
|
||||
<view class="anniu">立即领取</view>
|
||||
<view class="anniu" @click="getCardCoupon()">立即领取</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@ -92,7 +97,7 @@
|
||||
longitude: lon,
|
||||
name: this.store.name,
|
||||
address: this.store.address,
|
||||
|
||||
|
||||
success: function() {
|
||||
console.log('success');
|
||||
},
|
||||
@ -109,7 +114,7 @@
|
||||
type: 'gcj02', // 使用国测局坐标系
|
||||
success: function(res) {
|
||||
if (_this.longitude == "" && _this.latitude == "") {
|
||||
|
||||
|
||||
_this.longitude = res.longitude;
|
||||
_this.latitude = res.latitude
|
||||
}
|
||||
@ -123,14 +128,14 @@
|
||||
"lat": _this.latitude,
|
||||
"storeId": storeId,
|
||||
"isLogin": _this.AppToken ? "0" : "1", // 0为登录
|
||||
|
||||
|
||||
},
|
||||
}).then((response) => {
|
||||
if (response.data.store) {
|
||||
_this.distance = (Math.ceil(response.data.distance))
|
||||
.toFixed(1)
|
||||
_this.store = response.data.store
|
||||
|
||||
|
||||
_this.lon = _this.store.longitude
|
||||
_this.lat = _this.store.latitude
|
||||
console.log(_this.store, 129);
|
||||
@ -140,7 +145,7 @@
|
||||
icon: "none"
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
}).catch(err => {})
|
||||
},
|
||||
fail: function(err) {
|
||||
@ -148,6 +153,38 @@
|
||||
}
|
||||
});
|
||||
},
|
||||
//领取优惠券
|
||||
getCardCoupon() {
|
||||
request({
|
||||
url: '/cardCoupon/userGetCoupon',
|
||||
method: 'post',
|
||||
data: this.couponInfo.id
|
||||
}).then(res => {
|
||||
if (res.code == 200) {
|
||||
if (res.data == 2) {
|
||||
uni.showToast({
|
||||
title: "优惠券已下线",
|
||||
icon: "none"
|
||||
})
|
||||
} else if (res.data == 0) {
|
||||
uni.showToast({
|
||||
title: "优惠券剩余不足",
|
||||
icon: "none"
|
||||
})
|
||||
} else if (res.data == 3) {
|
||||
uni.showToast({
|
||||
title: "你已领取上限",
|
||||
icon: "none"
|
||||
})
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: "领取成功",
|
||||
icon: "none"
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
getInfo() {
|
||||
request({
|
||||
url: '/cardCoupon/' + this.certificateId,
|
||||
|
@ -111,6 +111,7 @@
|
||||
this.integral = res.data.pointsChange
|
||||
this.show = true
|
||||
this.getList()
|
||||
this.getIsSignIn()
|
||||
}
|
||||
})
|
||||
this.getList()
|
||||
|
Loading…
Reference in New Issue
Block a user