更新10.11

This commit is contained in:
许允枞 2024-10-11 14:00:03 +08:00
parent 70fa9bfe1e
commit 9a0095d202
10 changed files with 309 additions and 2 deletions

View File

@ -16,6 +16,9 @@ import com.fuint.business.commission.service.StaffCommissionService;
import com.fuint.business.integral.entity.IntegralOrders; import com.fuint.business.integral.entity.IntegralOrders;
import com.fuint.business.integral.service.IntegralOrdersService; import com.fuint.business.integral.service.IntegralOrdersService;
import com.fuint.business.integral.service.IntegralSettingsService; 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.activeRecommend.service.ActiveRecommendRecordsService;
import com.fuint.business.marketingActivity.cardCoupon.entity.CardCouponUser; import com.fuint.business.marketingActivity.cardCoupon.entity.CardCouponUser;
import com.fuint.business.marketingActivity.cardCoupon.mapper.CardCouponUserMapper; 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.marketingActivity.cardValueOrders.service.CardValueOrdersService;
import com.fuint.business.order.entity.*; import com.fuint.business.order.entity.*;
import com.fuint.business.order.service.*; 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.entity.UserBalance;
import com.fuint.business.userManager.service.LJUserService; import com.fuint.business.userManager.service.LJUserService;
import com.fuint.business.userManager.service.UserBalanceService; import com.fuint.business.userManager.service.UserBalanceService;
@ -70,6 +76,10 @@ public class FyPayServiceImpl implements FyPayService {
private ActiveRecommendRecordsService activeRecommendRecordsService; private ActiveRecommendRecordsService activeRecommendRecordsService;
@Autowired @Autowired
private CardCouponUserMapper cardCouponUserMapper; 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); Map<String, String> reqMap = Utils.xmlStr2Map(rspXml);
String str = reqMap.get("sign"); String str = reqMap.get("sign");
//查询总订单
AllOrderInfo allOrderInfo = allOrderInfoService.selectAllOrderInfoByOrderNo(orderNo);
if (Utils.verifySign(reqMap, str)) { if (Utils.verifySign(reqMap, str)) {
//查询总订单
AllOrderInfo allOrderInfo = allOrderInfoService.selectAllOrderInfoByOrderNo(orderNo);
//油品订单 //油品订单
OilOrder oilOrder = oilOrderService.selectOilOrderByOrderNo(orderNo); OilOrder oilOrder = oilOrderService.selectOilOrderByOrderNo(orderNo);
//商品订单 //商品订单
@ -437,6 +447,18 @@ public class FyPayServiceImpl implements FyPayService {
} }
//推荐会员充值有礼 //推荐会员充值有礼
activeRecommendRecordsService.recommendMembersRechargePolite(allOrderInfo.getStoreId(), allOrderInfo.getUserId(), allOrderInfo.getPayType()); 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) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();

View File

@ -24,5 +24,29 @@ public interface ActivePriceRecordService extends IService<ActivePriceRecord> {
* @return java.util.List<com.fuint.business.marketingActivity.activePrice.entity.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); 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);
} }

View File

@ -1,10 +1,16 @@
package com.fuint.business.marketingActivity.activePrice.service.impl; 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.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 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.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.ActivePriceRecordMapper;
import com.fuint.business.marketingActivity.activePrice.mapper.ActivePriceRuleMapper;
import com.fuint.business.marketingActivity.activePrice.service.ActivePriceRecordService; import com.fuint.business.marketingActivity.activePrice.service.ActivePriceRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List; import java.util.List;
@ -18,6 +24,11 @@ import java.util.List;
@Service("ActivePriceRecordService") @Service("ActivePriceRecordService")
public class ActivePriceRecordServiceImpl extends ServiceImpl<ActivePriceRecordMapper, ActivePriceRecord> implements ActivePriceRecordService { public class ActivePriceRecordServiceImpl extends ServiceImpl<ActivePriceRecordMapper, ActivePriceRecord> implements ActivePriceRecordService {
@Autowired
private ActivePriceMapper activePriceMapper;
@Autowired
private ActivePriceRuleMapper activePriceRuleMapper;
/** /**
* 根据用户Id和活动ids查询所有参与的记录 * 根据用户Id和活动ids查询所有参与的记录
* *
@ -44,4 +55,61 @@ public class ActivePriceRecordServiceImpl extends ServiceImpl<ActivePriceRecordM
} }
return this.list(lambdaQueryWrapper); 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());
//查询活动规则
ActivePriceRule activePriceRule = activePriceRuleMapper.selectOne(new LambdaQueryWrapper<ActivePriceRule>()
.eq(ActivePriceRule::getId, ruleId));
if (ObjectUtil.isNotEmpty(activePriceRule)) {
activePriceRecord.setRuleName(activePriceRule.getRuleName());
}
return baseMapper.insert(activePriceRecord);
}
} }

View File

@ -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 {
}

View File

@ -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;
}

View File

@ -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> {
}

View File

@ -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);
}

View File

@ -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));
}
}

View File

@ -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>

View File

@ -111,6 +111,7 @@
this.integral = res.data.pointsChange this.integral = res.data.pointsChange
this.show = true this.show = true
this.getList() this.getList()
this.getIsSignIn()
} }
}) })
this.getList() this.getList()