This commit is contained in:
zhaohengkun 2024-09-26 14:48:58 +08:00
commit 1ee96d674e
53 changed files with 1801 additions and 259 deletions

View File

@ -124,3 +124,14 @@
.el-pagination.is-background .el-pager li:hover{
color: #FF9655 !important;/*hover时候的文字颜色*/
}
/* 修改选中状态的背景色 */
.el-radio .el-radio__input.is-checked .el-radio__inner {
background-color: #FF9655; /* 你想要的任何颜色 */
border-color: #FF9655;
}
/* 修改选中状态的文字颜色 */
.el-radio .el-radio__input.is-checked+ .el-radio__label {
color: #FF9655 !important; /* 文字颜色 */
}

View File

@ -647,7 +647,7 @@
<!-- 添加或修改对话框 -->
<el-dialog :title="title" :visible.sync="open2" append-to-body width="42%">
<el-form ref="form2" :model="form2" :rules="rules" label-width="120px">
<el-form ref="form2" :model="form2" :rules="rules" label-width="120px">
<el-form-item label="会员等级" prop="gradeId">
<el-select v-model="form2.gradeId" placeholder="请选择会员等级" style="width: 100%">
@ -677,30 +677,25 @@
</el-form-item>
<el-form-item label="节假日是否通用" prop="holidayIsUse">
<div class="d-s">
<div class="icon-type" v-for="(item,index) in useTypeList" :key="index"
:class="{ 'acvtive' : index === tindex1 }" @click="Typeindex1(index)">
<img src="../../assets/images/wx.png" style="width: 20px;height: 20px" v-if="index != tindex1">
<img src="../../assets/images/xz.png" style="width: 20px;height: 20px" v-if="index == tindex1">
{{ item }}
</div>
</div>
<el-radio-group v-model="form2.holidayIsUse">
<el-radio :label="'0'">可用</el-radio>
<el-radio :label="'1'">不可用</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="适用日期" prop="suitDateType">
<div class="d-s">
<div class="icon-type" v-for="(item,index) in dateTypeList" :key="index"
:class="{ 'acvtive' : index === tindex2 }" @click="Typeindex2(index)">
<img src="../../assets/images/wx.png" style="width: 20px;height: 20px" v-if="index != tindex1">
<img src="../../assets/images/xz.png" style="width: 20px;height: 20px" v-if="index == tindex1">
{{ item }}
</div>
<el-radio-group v-model="form2.suitDateType">
<el-radio :label="'0'">永久</el-radio>
<el-radio :label="'1'">自定义</el-radio>
</el-radio-group>
<el-date-picker
v-model="form2.suitDateFront"
style="width: 160px"
style="width: 160px;margin-left: 10px;"
type="date"
placeholder="开始日期">
</el-date-picker>
<div style="margin: 0 10px;"></div>
<el-date-picker
v-model="form2.suitDateAfter"
style="width: 160px"
@ -709,19 +704,25 @@
</el-date-picker>
</div>
</el-form-item>
<el-form-item label="适用时间段" prop="suitTimeSlotType">
<div>
<div class="icon-type" v-for="(item,index) in weekMonthTypeList" :key="index"
:class="{ 'acvtive' : index === tindex3 }" @click="Typeindex3(index)">
<img src="../../assets/images/wx.png" style="width: 20px;height: 20px" v-if="index != tindex3">
<img src="../../assets/images/xz.png" style="width: 20px;height: 20px" v-if="index == tindex3">
{{ item }}
<el-checkbox-group v-model="weekDay" v-if="item=='每周'" style="margin-left: 20px" :disabled="tindex3!=0">
<el-checkbox v-for="(item,index) in weekList" :key="index" :label="item"></el-checkbox>
</el-checkbox-group>
<el-select v-model="monthDay" placeholder="请选择每月固定日期" multiple v-if="item=='每月'"
:disabled="tindex3!=1"
style="margin-left: 20px">
<el-form-item label="时间段设置" prop="availableOrUn">
<el-radio-group v-model="form2.availableOrUn">
<el-radio :label="'0'">适用时间段</el-radio>
<el-radio :label="'1'">不可用时间段</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item v-if="form2.availableOrUn == '0'" label="适用时间段" prop="suitTimeSlotType">
<div style="width: 100px;margin-top: 10px">
<el-radio-group v-model="form2.suitTimeSlotType">
<div style="display: flex; width: 500px;margin-bottom: 15px;">
<el-radio :label="'1'">每周</el-radio>
<el-checkbox-group v-model="weekDay" style="margin-left: 20px" :disabled="form2.suitTimeSlotType!='1'">
<el-checkbox v-for="(item,index) in weekList" :key="index" :label="item"></el-checkbox>
</el-checkbox-group>
</div>
<el-radio :label="'2'">每月
<el-select :disabled="form2.suitTimeSlotType!='2'" v-model="monthDay" placeholder="请选择每月固定日期" multiple style="margin-left: 20px">
<el-option
v-for="item in 31"
:key="item.value"
@ -729,7 +730,8 @@
:value="item">
</el-option>
</el-select>
</div>
</el-radio>
</el-radio-group>
</div>
<div style="margin-top: 20px">
<el-form-item label="时间段" prop="suitTimeSlotFront" label-width="70px">
@ -749,28 +751,25 @@
</el-form-item>
</div>
</el-form-item>
<el-form-item label="指定不可用日期" prop="noUseTimeType">
<el-form-item v-else label="不适用时间段" prop="noUseTimeType">
<div>
<div class="icon-type" v-for="(item,index) in weekMonthTypeList" :key="index"
:class="{ 'acvtive' : index === tindex4 }" @click="Typeindex4(index)">
<img src="../../assets/images/wx.png" style="width: 20px;height: 20px" v-if="index != tindex4">
<img src="../../assets/images/xz.png" style="width: 20px;height: 20px" v-if="index == tindex4">
{{ item }}
<el-checkbox-group v-model="weekDay1" :disabled="tindex4!=0" v-if="item=='每周'"
style="margin-left: 20px">
<el-checkbox v-for="(item,index) in weekList" :key="index" :label="item"></el-checkbox>
</el-checkbox-group>
<el-select v-model="monthDay1" placeholder="请选择每月固定日期" multiple v-if="item=='每月'"
:disabled="tindex4!=1"
style="margin-left: 20px">
<el-option
v-for="item in 31"
:key="item"
:label="item+'日'"
:value="item+''">
</el-option>
</el-select>
</div>
<el-radio-group v-model="form2.noUseTimeType">
<el-radio :label="'1'">每周
<el-checkbox-group v-model="weekDay1" style="margin-left: 20px" :disabled="form2.noUseTimeType!='1'">
<el-checkbox v-for="(item,index) in weekList" :key="index" :label="item"></el-checkbox>
</el-checkbox-group>
</el-radio>
<el-radio :label="'2'">每月
<el-select :disabled="form2.noUseTimeType!='2'" v-model="monthDay1" placeholder="请选择每月固定日期" multiple style="margin-left: 20px">
<el-option
v-for="item in 31"
:key="item.value"
:label="item+'日'"
:value="item">
</el-option>
</el-select>
</el-radio>
</el-radio-group>
</div>
<div style="margin-top: 20px">
<el-form-item label="时间段" prop="noUseTimeFront" label-width="70px">
@ -1107,7 +1106,9 @@ export default {
catchTypeList: [],
//
open: false,
form2: {},
form2: {
availableOrUn:'0'
},
open2: false,
gradeList: [],
@ -1178,6 +1179,9 @@ export default {
total2: 0,
//
rules: {
availableOrUn:[
{required: true, message: "不能为空", trigger: "blur"},
],
grade: [
{required: true, message: "升降顺序不能为空", trigger: "blur"},
{pattern: /^[0-9]{1,10}$/, message: `必须正整数`, trigger: 'blur'}
@ -1244,14 +1248,17 @@ export default {
suitTimeSlotType: [
{required: true, message: "请选择适用时间段", trigger: "blur"},
],
noUseTimeType: [
{required: true, message: "请选择不适用时间段", trigger: "blur"},
],
suitTimeSlotFront: [
{required: true, message: "请选择适用时间段", trigger: "blur"},
],
noUseDate: [
{required: true, message: "请选择指定不可用日期", trigger: "blur"},
{required: true, message: "请选择不适用时间段", trigger: "blur"},
],
noUseTimeFront: [
{required: true, message: "请选择指定不可用日期", trigger: "blur"},
{required: true, message: "请选择不适用时间段", trigger: "blur"},
],
}
};
@ -1374,10 +1381,11 @@ export default {
handleAdd2() {
this.form2 = {
usePaymentWay: [],
holidayIsUse: 0,
suitDateType: 0,
suitTimeSlotType: 0,
noUseTimeType: 0,
holidayIsUse: '0',
suitDateType: '0',
suitTimeSlotType: '0',
noUseTimeType: '0',
availableOrUn:'0'
}
this.weekDay = []
this.monthDay = []

View File

@ -0,0 +1,41 @@
package com.fuint.business.fleet.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.fleet.service.IFleetLinesChangeService;
import com.fuint.business.fleet.vo.FleetLinesChangeVo;
import com.fuint.business.order.dto.CardBalanceChangeDto;
import com.fuint.business.order.vo.CardBalanceChangeVo;
import com.fuint.framework.web.BaseController;
import com.fuint.framework.web.ResponseObject;
import io.lettuce.core.dynamic.annotation.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestParam;
/**
* <p>
* 车队额度变化表 前端控制器
* </p>
*
* @author dianliang
* @since 2024-09-25
*/
@Controller
@RequestMapping("/fleet-lines-change")
public class FleetLinesChangeController extends BaseController {
@Autowired
private IFleetLinesChangeService fleetLinesChangeService;
public ResponseObject queryByPageUni(@RequestParam(value = "page",defaultValue = "1") Integer page,
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize,
@Param("integralDetail") FleetLinesChangeVo fleetLinesChangeVo) {
Page page1 = new Page(page, pageSize);
IPage<FleetLinesChangeVo> iPageList = fleetLinesChangeService.queryByPageUni(page1, fleetLinesChangeVo);
return getSuccessResult(iPageList);
}
}

View File

@ -0,0 +1,70 @@
package com.fuint.business.fleet.entity;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableId;
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-09-25
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("fleet_lines_change")
@ApiModel(value="FleetLinesChange对象", description="车队额度变化表")
public class FleetLinesChange implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键")
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "车队id")
private Integer fleetId;
@ApiModelProperty(value = "店铺id")
private Integer storeId;
@ApiModelProperty(value = "调整类型0增加、1扣除")
private String adjustType;
@ApiModelProperty(value = "调整额度")
private BigDecimal adjustLimit;
@ApiModelProperty(value = "创建人")
private String createBy;
@ApiModelProperty(value = "创建时间")
private LocalDateTime createTime;
@ApiModelProperty(value = "更新人")
private String updateBy;
@ApiModelProperty(value = "更新时间")
private LocalDateTime updateTime;
@ApiModelProperty(value = "剩余额度")
private BigDecimal remainingCreditLimit;
@ApiModelProperty(value = "被调整额度的用户id")
private Integer userId;
@ApiModelProperty(value = "订单id")
private Integer orderId;
}

View File

@ -0,0 +1,20 @@
package com.fuint.business.fleet.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.fleet.entity.FleetLinesChange;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.fuint.business.fleet.vo.FleetLinesChangeVo;
/**
* <p>
* 车队额度变化表 Mapper 接口
* </p>
*
* @author dianliang
* @since 2024-09-25
*/
public interface FleetLinesChangeMapper extends BaseMapper<FleetLinesChange> {
IPage<FleetLinesChangeVo> queryAllByLimit(Page page1, FleetLinesChangeVo fleetLinesChangeVo);
}

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.fleet.mapper.FleetLinesChangeMapper">
</mapper>

View File

@ -6,6 +6,8 @@ import com.fuint.business.fleet.entity.FleetInfo;
import com.fuint.business.fleet.vo.FleetInfoUniVo;
import com.fuint.business.fleet.vo.FleetInfoVo;
import java.util.List;
/**
* 车队信息(FleetInfo)表服务接口
*
@ -65,7 +67,7 @@ public interface FleetInfoService {
* @param storeId
* @return
*/
FleetInfoUniVo queryByStoreId(Integer storeId);
List<FleetInfoUniVo> queryByStoreId(Integer storeId);
/**
* 新增车队信息(小程序)

View File

@ -0,0 +1,20 @@
package com.fuint.business.fleet.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.fleet.entity.FleetLinesChange;
import com.baomidou.mybatisplus.extension.service.IService;
import com.fuint.business.fleet.vo.FleetLinesChangeVo;
/**
* <p>
* 车队额度变化表 服务类
* </p>
*
* @author dianliang
* @since 2024-09-25
*/
public interface IFleetLinesChangeService extends IService<FleetLinesChange> {
IPage<FleetLinesChangeVo> queryByPageUni(Page page1, FleetLinesChangeVo fleetLinesChangeVo);
}

View File

@ -1,6 +1,7 @@
package com.fuint.business.fleet.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@ -35,9 +36,11 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.Random;
import java.util.stream.Collectors;
/**
@ -219,22 +222,29 @@ public class FleetInfoServiceImpl extends ServiceImpl<FleetInfoMapper,FleetInfo>
* @return
*/
@Override
public FleetInfoUniVo queryByStoreId(Integer storeId) {
public List<FleetInfoUniVo> queryByStoreId(Integer storeId) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
FleetInfo fleetInfo = baseMapper.selectOne(new LambdaQueryWrapper<FleetInfo>()
.eq(FleetInfo::getStoreId, storeId)
.eq(FleetInfo::getUserId, nowAccountInfo.getId())
.last("limit 1"));
if (ObjectUtil.isEmpty(fleetInfo)) {
throw new RuntimeException("该会员未绑定车队");
//查询当前登录人的车队信息
List<FleetMember> fleetMembers = fleetMemberMapper.selectList(new LambdaQueryWrapper<FleetMember>()
.eq(FleetMember::getStoreId, storeId)
.eq(FleetMember::getUserId, nowAccountInfo.getId()));
//获取所在车队的id集合
List<Integer> fleetIds = fleetMembers.stream().map(FleetMember::getFleetId).collect(Collectors.toList());
if (CollUtil.isEmpty(fleetIds)) {
throw new RuntimeException("未绑定车队");
}
// FleetInfo fleetInfo = baseMapper.selectById(fleetMember.getFleetId());
FleetInfoUniVo fleetInfoUniVo = BeanUtil.copyProperties(fleetInfo, FleetInfoUniVo.class);
fleetInfoUniVo.setStoreName(mtStoreMapper.selectById(storeId).getName());
return fleetInfoUniVo;
List<FleetInfo> fleetInfos = baseMapper.selectList(new LambdaQueryWrapper<FleetInfo>()
.eq(FleetInfo::getStoreId, storeId)
.in(FleetInfo::getId, fleetIds));
List<FleetInfoUniVo> fleetInfoUniVos = new ArrayList<>();
for (FleetInfo fleetInfo : fleetInfos) {
FleetInfoUniVo fleetInfoUniVo = BeanUtil.copyProperties(fleetInfo, FleetInfoUniVo.class);
fleetInfoUniVo.setStoreName(mtStoreMapper.selectById(storeId).getName());
fleetInfoUniVos.add(fleetInfoUniVo);
}
return fleetInfoUniVos;
}
/**

View File

@ -0,0 +1,42 @@
package com.fuint.business.fleet.service.impl;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.fleet.entity.FleetLinesChange;
import com.fuint.business.fleet.mapper.FleetLinesChangeMapper;
import com.fuint.business.fleet.service.IFleetLinesChangeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.fleet.vo.FleetLinesChangeVo;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* <p>
* 车队额度变化表 服务实现类
* </p>
*
* @author dianliang
* @since 2024-09-25
*/
@Service
public class FleetLinesChangeServiceImpl extends ServiceImpl<FleetLinesChangeMapper, FleetLinesChange> implements IFleetLinesChangeService {
@Autowired
private FleetLinesChangeMapper fleetLinesChangeMapper;
@Override
public IPage<FleetLinesChangeVo> queryByPageUni(Page page1, FleetLinesChangeVo fleetLinesChangeVo) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
fleetLinesChangeVo.setUserId(nowAccountInfo.getId());
if (ObjectUtil.isNotEmpty(fleetLinesChangeVo.getStartTime())) {
DateTime parse = DateUtil.parse(fleetLinesChangeVo.getStartTime(), "yyyy-MM");
fleetLinesChangeVo.setStartTime(DateUtil.beginOfMonth(parse).toString());
fleetLinesChangeVo.setEndTime(DateUtil.endOfMonth(parse).toString());
}
return this.baseMapper.queryAllByLimit(page1, fleetLinesChangeVo);
}
}

View File

@ -0,0 +1,23 @@
package com.fuint.business.fleet.vo;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fuint.business.fleet.entity.FleetLinesChange;
import lombok.Data;
@Data
public class FleetLinesChangeVo extends FleetLinesChange {
/**
* 用户名称
*/
private String userName;
/**
* 操作人名称
*/
private String creatName;
@JsonIgnore
private String startTime;
@JsonIgnore
private String endTime;
}

View File

@ -128,5 +128,15 @@ public class IntegralGift extends BaseEntity {
*/
private Integer storeId;
/**
* 兑换说明
*/
private String exchangeInstructions;
/**
* 使用须知
*/
private String useInstructions;
}

View File

@ -148,7 +148,7 @@ public class CardCouponController extends BaseController {
public ResponseObject selectAllByPageAndStoreId(@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize, @Param("cardCoupon") CardCoupon cardCoupon) {
Page page = new Page(pageNo, pageSize);
return getSuccessResult(this.cardCouponService.pageVo(page, cardCoupon));
return getSuccessResult(this.cardCouponService.selectAllByPageAndStoreId(page, cardCoupon));
}
}

View File

@ -66,6 +66,8 @@ public class CardCoupon extends Model<CardCoupon> {
private Integer zkStartAmount;
//折扣卷满多少元的终
private Integer zkEndAmount;
//折扣最大优惠金额
private Double zkMaxAmount;
//适用会员等级 可多选
private String membershipLevel;
//生效日期类型1.领取后多少天内有效 2指定具体使用日期

View File

@ -4,9 +4,12 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.marketingActivity.cardCoupon.entity.CardCoupon;
import com.fuint.business.marketingActivity.cardCoupon.vo.CardCouponUniVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 油站优惠卷表2024(CardCoupon)表数据库访问层
*
@ -17,5 +20,6 @@ import org.apache.ibatis.annotations.Param;
public interface CardCouponMapper extends BaseMapper<CardCoupon> {
IPage<CardCoupon> pageVo(Page page, @Param("cardCoupon") CardCoupon cardCoupon);
IPage<CardCouponUniVo> selectAllByPageAndStoreId(Page page, @Param("cardCoupon")CardCoupon cardCoupon);
}

View File

@ -27,5 +27,44 @@
</where>
order by cc.create_time desc
</select>
<select id="selectAllByPageAndStoreId"
resultType="com.fuint.business.marketingActivity.cardCoupon.vo.CardCouponUniVo">
SELECT
cc.*,
mt.NAME AS typeName,
CASE
cc.type
WHEN 1 THEN
'代金券'
WHEN 2 THEN
'兑换券'
WHEN 3 THEN
'折扣券'
WHEN 4 THEN
'油品立减券'
WHEN 5 THEN
'单品代金券'
END AS statusName
FROM
card_coupon cc
LEFT JOIN mt_store mt ON mt.id = cc.store_id
<where>
<if test="cardCoupon.storeId!=null and cardCoupon.storeId!=''">
and cc.store_id = #{cardCoupon.storeId}
</if>
<if test="cardCoupon.name!=null and cardCoupon.name!=''">
and cc.name like concat('%',#{cardCoupon.name},'%')
</if>
<if test="cardCoupon.status!=null and cardCoupon.status!=''">
and cc.status = #{cardCoupon.status}
</if>
<if test="cardCoupon.type!=null and cardCoupon.type!=''">
and cc.type = #{cardCoupon.type}
</if>
<if test="cardCoupon.putType!=null and cardCoupon.putType!=''">
and cc.put_type = #{cardCoupon.putType}
</if>
</where>
</select>
</mapper>

View File

@ -8,7 +8,7 @@
main.mt_user_id AS mtUserId
FROM
card_coupon_user main
LEFT JOIN card_coupon cc ON main.card_coupon_id = cc.id
INNER JOIN card_coupon cc ON main.card_coupon_id = cc.id
WHERE
main.store_id = #{storeId}
AND main.mt_user_id = #{userId}

View File

@ -20,5 +20,7 @@ public interface CardCouponService extends IService<CardCoupon> {
* @return
*/
int isOnLine(Integer id);
IPage selectAllByPageAndStoreId(Page page, CardCoupon cardCoupon);
}

View File

@ -44,5 +44,15 @@ public interface CardCouponUserService extends IService<CardCouponUser> {
* @return
*/
IPage<CardCouponUserVo> queryPage(Page page,CardCouponUserVo cardCouponUserVo);
/**
* 查某用户某些优惠券的使用记录
* @author vinjor-M
* @date 17:31 2024/9/25
* @param userId 用户id
* @param couponIdList 优惠券idList
* @return java.util.List<com.fuint.business.marketingActivity.cardCoupon.entity.CardCouponUser>
**/
List<CardCouponUser> selectListByUsed(Integer userId,List<Integer> couponIdList);
}

View File

@ -1,14 +1,26 @@
package com.fuint.business.marketingActivity.cardCoupon.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ObjectUtil;
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.fuint.business.marketingActivity.cardCoupon.entity.CardCoupon;
import com.fuint.business.marketingActivity.cardCoupon.mapper.CardCouponMapper;
import com.fuint.business.marketingActivity.cardCoupon.service.CardCouponService;
import com.fuint.business.marketingActivity.cardCoupon.vo.CardCouponUniVo;
import com.fuint.business.marketingActivity.cardCoupon.vo.CardCouponVO;
import com.fuint.business.store.entity.MtStore;
import com.fuint.business.store.mapper.MtStoreMapper;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
* 油站优惠卷表2024(CardCoupon)表服务实现类
*
@ -18,6 +30,8 @@ import org.springframework.stereotype.Service;
@Service("cardCouponService")
public class CardCouponServiceImpl extends ServiceImpl<CardCouponMapper, CardCoupon> implements CardCouponService {
@Autowired
private MtStoreMapper mtStoreMapper;
@Override
public IPage<CardCoupon> pageVo(Page page, CardCoupon cardCoupon) {
return baseMapper.pageVo( page, cardCoupon);
@ -32,5 +46,27 @@ public class CardCouponServiceImpl extends ServiceImpl<CardCouponMapper, CardCou
cardCoupon.setStatus(cardCoupon.getStatus().equals("0") ? "1" : "0");
return baseMapper.updateById(cardCoupon);
}
@Override
public IPage selectAllByPageAndStoreId(Page page, CardCoupon cardCoupon) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
//首先查询该店铺所有的优惠券
cardCoupon.setPutType("2");
cardCoupon.setStatus("1");
IPage<CardCouponUniVo> cardCouponUniVos = baseMapper.selectAllByPageAndStoreId(page, cardCoupon);
List<CardCouponUniVo> cardCouponVos = new ArrayList<>();
//循环店铺优惠券
for (CardCouponUniVo coupon : cardCouponUniVos.getRecords()) {
//查询该优惠券是否已到达限制数量
if (coupon.getTfGetNum() < coupon.getTfTotal()){
CardCouponUniVo cardCouponUniVo = BeanUtil.copyProperties(coupon, CardCouponUniVo.class);
//计算领取的比例
double scale = (coupon.getTfGetNum() * 1.0 / coupon.getTfTotal()) * 100;
cardCouponUniVo.setScale(scale + "%");
}
}
return cardCouponUniVos;
}
}

View File

@ -145,5 +145,24 @@ public class CardCouponUserServiceImpl extends ServiceImpl<CardCouponUserMapper,
}
return cardCouponUserVoIPage;
}
/**
* 查某用户某些优惠券的使用记录
*
* @param userId 用户id
* @param couponIdList 优惠券idList
* @return java.util.List<com.fuint.business.marketingActivity.cardCoupon.entity.CardCouponUser>
* @author vinjor-M
* @date 17:31 2024/9/25
**/
@Override
public List<CardCouponUser> selectListByUsed(Integer userId, List<Integer> couponIdList) {
LambdaQueryWrapper<CardCouponUser> queryWrapper = new LambdaQueryWrapper<CardCouponUser>()
.eq(CardCouponUser::getMtUserId,userId)
.in(CardCouponUser::getCardCouponId,couponIdList)
//已核销的
.eq(CardCouponUser::getStatus,"1");
return this.list(queryWrapper);
}
}

View File

@ -0,0 +1,14 @@
package com.fuint.business.marketingActivity.cardCoupon.vo;
import com.fuint.business.marketingActivity.cardCoupon.entity.CardCoupon;
import lombok.Data;
@Data
public class CardCouponUniVo extends CardCoupon {
//店铺名称
private String storeName;
//已领取比例
private String scale;
//兑换券类型
private String typeName;
}

View File

@ -1,5 +1,6 @@
package com.fuint.business.marketingActivity.cardGift.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
@ -12,6 +13,9 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.marketingActivity.cardGift.mapper.CardGiftMapper;
import com.fuint.business.marketingActivity.cardGift.entity.CardGift;
import com.fuint.business.marketingActivity.cardGift.service.CardGiftService;
import com.fuint.business.marketingActivity.cardGift.vo.CardGiftVo;
import com.fuint.business.marketingActivity.cardGiftActive.entity.CardGiftActive;
import com.fuint.business.marketingActivity.cardGiftActive.mapper.CardGiftActiveMapper;
import com.fuint.business.member.entity.LJStaff;
import com.fuint.business.member.service.ILJStaffService;
import com.fuint.business.oilDepotConfiguration.entity.OilDepotConfig;
@ -30,6 +34,7 @@ import com.fuint.common.util.TokenUtil;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
@ -64,6 +69,8 @@ public class CardGiftServiceImpl extends ServiceImpl<CardGiftMapper, CardGift> i
private LJUserService ljUserService;
@Resource
private ILJStaffService ljStaffService;
@Autowired
private CardGiftActiveMapper cardGiftActiveMapper;
/**
* 新增数据
@ -246,7 +253,23 @@ public class CardGiftServiceImpl extends ServiceImpl<CardGiftMapper, CardGift> i
LambdaQueryWrapper<CardGift> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(CardGift::getUserId,userId);
queryWrapper.orderByDesc(CardGift::getUpdateTime);
return page(page,queryWrapper);
IPage page1 = page(page, queryWrapper);
List<CardGiftVo> cardGiftVos = new ArrayList<>();
for (Object record : page1.getRecords()) {
CardGiftVo cardGiftVo = BeanUtil.copyProperties(record, CardGiftVo.class);
CardGiftActive cardGiftActive = cardGiftActiveMapper.selectOne(new LambdaQueryWrapper<CardGiftActive>()
.eq(CardGiftActive::getId, cardGiftVo.getActiveId())
.last("limit 1"));
if (ObjectUtils.isNotEmpty(cardGiftActive)) {
cardGiftVo.setActiveName(cardGiftActive.getActiveName());
}
cardGiftVos.add(cardGiftVo);
}
page1.setRecords(cardGiftVos);
//查询兑换记录的活动名称
return page1;
}
/**

View File

@ -0,0 +1,9 @@
package com.fuint.business.marketingActivity.cardGift.vo;
import com.fuint.business.marketingActivity.cardGift.entity.CardGift;
import lombok.Data;
@Data
public class CardGiftVo extends CardGift {
private String activeName;
}

View File

@ -11,6 +11,9 @@
<if test="growthValueChange.userId != null and growthValueChange.userId != ''">
and gvc.user_id = #{growthValueChange.userId}
</if>
<if test="growthValueChange.fromType != null and growthValueChange.fromType != ''">
and gvc.from_type = #{growthValueChange.fromType}
</if>
<if test="growthValueChange.startTime != null and growthValueChange.startTime != ''">
and gvc.create_time between #{growthValueChange.startTime} and #{growthValueChange.endTime}
</if>

View File

@ -89,6 +89,7 @@ public class MtUserExpressAddressController extends BaseController {
/**
* 查询默认快递地址
*/
@GetMapping("getDefault")
public ResponseObject getDefault() {
return getSuccessResult(this.mtUserExpressAddressService.getDefault());
}

View File

@ -1,5 +1,6 @@
package com.fuint.business.userManager.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.userManager.entity.MtUserExpressAddress;
@ -14,7 +15,7 @@ import java.util.List;
* @author makejava
* @since 2023-11-09 09:31:12
*/
public interface MtUserExpressAddressMapper {
public interface MtUserExpressAddressMapper extends BaseMapper<MtUserExpressAddress> {
/**
* 通过ID查询单条数据

View File

@ -1,8 +1,10 @@
package com.fuint.business.userManager.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
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.fuint.business.userManager.entity.MtUserExpressAddress;
import com.fuint.business.userManager.mapper.MtUserExpressAddressMapper;
import com.fuint.business.userManager.service.MtUserExpressAddressService;
@ -21,7 +23,7 @@ import java.util.List;
* @since 2023-11-09 09:31:33
*/
@Service("mtUserExpressAddressService")
public class MtUserExpressAddressServiceImpl implements MtUserExpressAddressService {
public class MtUserExpressAddressServiceImpl extends ServiceImpl<MtUserExpressAddressMapper,MtUserExpressAddress> implements MtUserExpressAddressService {
@Resource
private MtUserExpressAddressMapper mtUserExpressAddressMapper;
@ -101,8 +103,10 @@ public class MtUserExpressAddressServiceImpl implements MtUserExpressAddressServ
@Override
public MtUserExpressAddress getDefault() {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
return null;
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("user_id", nowAccountInfo.getId());
queryWrapper.eq("if_default", "1");
return baseMapper.selectOne(queryWrapper);
}
@Override

View File

@ -3,6 +3,8 @@ package com.fuint.pay.service.impl;
import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONObject;
import com.fuint.business.marketingActivity.activePrice.entity.ActivePriceRecord;
import com.fuint.business.marketingActivity.activePrice.entity.ActivePriceRule;
@ -13,6 +15,8 @@ import com.fuint.business.marketingActivity.activePrice.service.ActivePriceServi
import com.fuint.business.marketingActivity.activePrice.service.ActiveSubPriceService;
import com.fuint.business.marketingActivity.activePrice.vo.ActivePriceRuleRespVO;
import com.fuint.business.marketingActivity.activePrice.vo.ActiveSubPriceRespVO;
import com.fuint.business.marketingActivity.cardCoupon.entity.CardCoupon;
import com.fuint.business.marketingActivity.cardCoupon.entity.CardCouponUser;
import com.fuint.business.marketingActivity.cardCoupon.service.CardCouponUserService;
import com.fuint.business.marketingActivity.cardCoupon.vo.CardCouponVO;
import com.fuint.business.userGroup.entity.UserDiscount;
@ -27,6 +31,7 @@ import com.fuint.pay.service.PayCenterService;
import com.fuint.pay.util.CheckUtil;
import com.fuint.pay.vo.ActivityVO;
import com.fuint.pay.vo.CouponVO;
import com.fuint.pay.vo.GoodsVO;
import com.google.common.collect.ImmutableList;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -166,11 +171,13 @@ public class PayCenterServiceImpl implements PayCenterService {
List<String> actTypeList = Arrays.asList("1,2".split(StrUtil.COMMA));
List<ActivePriceRecord> recordAllList = activePriceRecordService.selectListByUserIdAndActIds(userId,
filteredList.stream().map(ActivePriceRuleRespVO::getId).collect(Collectors.toList()),null,actTypeList);
filteredList = filteredList.stream()
//过滤掉超过每日参加次数限制的
.filter(rule -> checkUtil.checkUseNum(rule.getId(),rule.getDayLimitNum(),nowDate,recordAllList, "day"))
//过滤掉超过累计参加次数限制的
.filter(rule -> checkUtil.checkUseNum(rule.getId(),rule.getLimitNum(),null,recordAllList,null)).collect(Collectors.toList());
if(!recordAllList.isEmpty()){
filteredList = filteredList.stream()
//过滤掉超过每日参加次数限制的
.filter(rule -> checkUtil.checkUseNum(rule.getId(),rule.getDayLimitNum(),nowDate,recordAllList, "day"))
//过滤掉超过累计参加次数限制的
.filter(rule -> checkUtil.checkUseNum(rule.getId(),rule.getLimitNum(),null,recordAllList,null)).collect(Collectors.toList());
}
/*4.得到用户最终可以参加的活动,计算优惠金额并转换成统一的对象*/
List<ActivityVO> rtnList = new ArrayList<>();
if(!filteredList.isEmpty()){
@ -227,13 +234,15 @@ public class PayCenterServiceImpl implements PayCenterService {
List<String> actTypeList = Arrays.asList("3".split(StrUtil.COMMA));
List<ActivePriceRecord> recordAllList = activePriceRecordService.selectListByUserIdAndActIds(userId,
null,filteredList.stream().map(ActiveSubPriceRespVO::getId).collect(Collectors.toList()),actTypeList);
filteredList = filteredList.stream()
//过滤掉超过每日参加次数限制的
.filter(rule -> checkUtil.checkUseNum(rule.getId(),rule.getDayLimitNum(),nowDate,recordAllList,"day"))
//过滤掉超过每月参加次数限制的
.filter(rule -> checkUtil.checkUseNum(rule.getId(),rule.getMonthLimitNum(),nowDate,recordAllList,"month"))
//过滤掉超过累计参加次数限制的
.filter(rule -> checkUtil.checkUseNum(rule.getId(),rule.getLimitNum(),null,recordAllList,null)).collect(Collectors.toList());
if(!recordAllList.isEmpty()){
filteredList = filteredList.stream()
//过滤掉超过每日参加次数限制的
.filter(rule -> checkUtil.checkUseNum(rule.getId(),rule.getDayLimitNum(),nowDate,recordAllList,"day"))
//过滤掉超过每月参加次数限制的
.filter(rule -> checkUtil.checkUseNum(rule.getId(),rule.getMonthLimitNum(),nowDate,recordAllList,"month"))
//过滤掉超过累计参加次数限制的
.filter(rule -> checkUtil.checkUseNum(rule.getId(),rule.getLimitNum(),null,recordAllList,null)).collect(Collectors.toList());
}
/*4.得到用户最终可以参加的活动,计算优惠金额并转换成统一的对象*/
List<ActivityVO> rtnList = new ArrayList<>();
if(!filteredList.isEmpty()){
@ -350,26 +359,58 @@ public class PayCenterServiceImpl implements PayCenterService {
Integer storeId = nowAccountInfo.getStoreId();
int userId = Integer.parseInt(map.get("userId"));
//油号id
Integer oilId = Integer.valueOf(map.get("oilId"));
//油单价
Double oilPrice = Double.valueOf(map.get("oilPrice"));
Integer oilId = Integer.valueOf(map.getOrDefault("oilId","99999"));
//加油金额不含商品金额
Double oilAmount = Double.valueOf(map.get("oilAmount"));
//订单总额含商品金额
Double orderAmount = Double.valueOf(map.get("orderAmount"));
Double oilAmount = Double.valueOf(map.getOrDefault("oilAmount","0"));
//油升数
Double oilLiter = Double.valueOf(map.get("oilLiter"));
Double oilLiter = Double.valueOf(map.getOrDefault("oilLiter","0"));
//选择的商品
List<GoodsVO> goodsList = new ArrayList<>();
String goodsStr = map.getOrDefault("goods","");
if(StringUtils.isNotEmpty(goodsStr)){
JSONArray goodsArray = JSONUtil.parseArray(map.get("goods"));
goodsList = goodsArray.toList(GoodsVO.class);
}
/*1.先查满足条件的所有生效中的优惠券*/
List<CardCouponVO> couponVOList = cardCouponUserService.selectAllList(storeId, userId, nowDate);
/*2.进行初步过滤,这里只过滤优惠券硬性的限制*/
List<GoodsVO> finalGoodsList = goodsList;
List<CardCouponVO> filteredList = couponVOList.stream()
//当前时间在 适用时间段内 或者 当前时间不在 不适用时间段内的
.filter(rule -> this.checkTimeCouponPrex(rule,nowDate)).collect(Collectors.toList());
// //是否满足最低消费金额
// .filter(rule-> rule.getConsumeAmount() <=oilAmount)
// //适用当前支付方式的
// .filter(rule-> rule.getUsePaymentWay().contains(payWay))
.filter(rule -> this.checkTimeCouponPrex(rule,nowDate))
//如果是油品券需要过滤出当前油品可用的
.filter(rule -> checkUtil.checkOilCoupon(rule,oilId))
//如果是油品券需要过滤出达到满减条件的
.filter(rule -> checkUtil.checkMaxCoupon(rule,oilAmount,oilLiter))
//如果是单品立减券需要过滤出当前选择的商品可用且满足最低消费金额的
.filter(rule-> checkUtil.checkGoodsCoupon(rule, finalGoodsList)).collect(Collectors.toList());
if(filteredList.isEmpty()){
return new ArrayList<>();
}
/*3.再次过滤,这里过滤掉用户已经超出参加次数限制的*/
List<Integer> filteredCoupIdList = filteredList.stream().map(CardCoupon::getId).collect(Collectors.toList());
//查出本用户这些优惠券的使用记录
List<CardCouponUser> usedList = cardCouponUserService.selectListByUsed(userId,filteredCoupIdList);
if(!usedList.isEmpty()){
//过滤
filteredList = filteredList.stream()
//过滤掉使用次数限制的
.filter(rule->checkUtil.checkUseNumCoupon(rule.getId(),rule.getLimitTotalDay(), rule.getLimitTotalNum(), nowDate,usedList)).collect(Collectors.toList());
}
/*4.得到用户最终可以使用的优惠券,计算优惠金额并转换成统一的对象*/
List<CouponVO> rtnList = new ArrayList<>();
if(!filteredList.isEmpty()){
for(CardCouponVO rule:filteredList){
CouponVO couponVO = new CouponVO();
couponVO.setId(rule.getDataId());
couponVO.setCouponId(rule.getId());
couponVO.setName(rule.getName());
couponVO.setUseWithOther(rule.getUseWithOther());
//计算优惠金额
couponVO.setDisAmount(checkUtil.computeDisAmountCoupon(rule,oilAmount,oilLiter));
rtnList.add(couponVO);
}
}
return rtnList;
}

View File

@ -8,14 +8,18 @@ import com.fuint.business.marketingActivity.activePrice.entity.ActivePriceRecord
import com.fuint.business.marketingActivity.activePrice.entity.ActiveSubPriceRule;
import com.fuint.business.marketingActivity.activePrice.vo.ActivePriceRuleRespVO;
import com.fuint.business.marketingActivity.activePrice.vo.ActiveSubPriceRespVO;
import com.fuint.business.marketingActivity.cardCoupon.entity.CardCouponUser;
import com.fuint.business.marketingActivity.cardCoupon.vo.CardCouponVO;
import com.fuint.business.userGroup.entity.UserDiscount;
import com.fuint.common.util.StringUtils;
import com.fuint.pay.vo.GoodsVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.util.*;
import java.util.stream.Collectors;
@ -234,6 +238,127 @@ public class CheckUtil {
}
}
}
/**
* 判断当前加油的油号是否符合优惠券预设的油号----优惠券专用
* @author vinjor-M
* @date 14:42 2024/9/21
* @param couponVO 优惠券对象
* @param oilId 当前加油选择的油号id
* @return java.lang.Boolean
**/
public Boolean checkOilCoupon(CardCouponVO couponVO, Integer oilId){
//代金券折扣券油品立减券才需要判断油品是否满足
List<String> couponTypeList = Arrays.asList("1","3","4");
if(couponTypeList.contains(couponVO.getType())){
if("1".equals(couponVO.getOilLimit())){
//不限制油品符合
return true;
}else{
//限制油品
if(StringUtils.isNotEmpty(couponVO.getOilNumber())){
List<String> oilIdList = Arrays.asList(couponVO.getOilNumber().split(StrUtil.COMMA));
return oilIdList.contains(oilId.toString());
}else{
//没有配置可用油号不满足
return false;
}
}
}else{
//其他券不需要判断油品
return true;
}
}
/**
* 判断当前加油金额或者加油升数是否达到满减条件----优惠券专用
* @author vinjor-M
* @date 14:42 2024/9/21
* @param couponVO 优惠券对象
* @param oilAmount 加油金额
* @param oilLiter 加油升数
* @return java.lang.Boolean
**/
public Boolean checkMaxCoupon(CardCouponVO couponVO, Double oilAmount,Double oilLiter){
//代金券折扣券油品立减券才需要判断加油升数加油金额是否达到满减条件
List<String> couponTypeList = Arrays.asList("1","3","4");
if(couponTypeList.contains(couponVO.getType())){
Double thisValue;
if("1".equals(couponVO.getUseType())){
//加油金额
thisValue = oilAmount;
}else if("2".equals(couponVO.getUseType())){
//加油升数
thisValue = oilLiter;
}else {
//超出预设值范围不满足
return false;
}
if("1".equals(couponVO.getType())){
//代金券
return checkMaxCouponChild(null,couponVO.getReachAmount(),thisValue);
}else if("3".equals(couponVO.getType())){
//折扣券
return checkMaxCouponChild(couponVO.getZkStartAmount().doubleValue(),couponVO.getZkEndAmount().doubleValue(),thisValue);
}else if("4".equals(couponVO.getType())){
//油品立减券
return checkMaxCouponChild(null,couponVO.getReachAmount(),thisValue);
}else{
//超出预设值范围不可用
return false;
}
}else{
//其他券不需要判断默认满足
return true;
}
}
/**
* 判断加油金额或者加油升数是否符合某区间范围
* @author vinjor-M
* @date 16:45 2024/9/25
* @param min 最小值可能为null
* @param max 最大值一定有值
* @param thisValue 加油金额或加油升数一定有值
* @return java.lang.Boolean
**/
public Boolean checkMaxCouponChild(Double min,Double max,Double thisValue){
if(null==min){
return thisValue>=max;
}else {
return isBetween(thisValue,min,max);
}
}
/**
* 判断当前订单选择的商品是否满足优惠券的使用规则----优惠券专用
* @author vinjor-M
* @date 14:42 2024/9/21
* @param couponVO 优惠券对象
* @param goodsList 选择的商品列表
* @return java.lang.Boolean
**/
public Boolean checkGoodsCoupon(CardCouponVO couponVO, List<GoodsVO> goodsList){
if("5".equals(couponVO.getType()) || goodsList.isEmpty()){
//单品立减券
if(StringUtils.isNotEmpty(couponVO.getProductIds())){
//限制使用的商品id
List<String> ruleGoodsList = Arrays.asList(couponVO.getProductIds().split(StrUtil.COMMA));
//过滤出符合条件的本订单的商品
List<GoodsVO> filteredList = goodsList.stream().filter(goods->ruleGoodsList.contains(goods.getId())).collect(Collectors.toList());
//计算符合条件的商品订单总金额
double orderAmount =0.0;
if(!filteredList.isEmpty()){
orderAmount = filteredList.stream().mapToDouble(GoodsVO::getAmount).sum();
}
return orderAmount>=couponVO.getReachAmount();
}else{
//未设置可用商品不符合
return false;
}
}else{
//其他券或者本订单未选择商品不需要判断商品
return true;
}
}
/**
@ -279,6 +404,55 @@ public class CheckUtil {
return maxNum>nowNum;
}
/**
* 判断当前优惠券每多少天使用了多少次 是否满足优惠券设置的限制条件
* @author vinjor-M
* @date 14:51 2024/9/21
* @param coupId 优惠券id
* @param dayNum 多少天内
* @param maxNum 最大次数限制
* @param nowDate 结算日期
* @param recordAllList 所有使用记录
* @return java.lang.Boolean
**/
public Boolean checkUseNumCoupon(Integer coupId, Integer dayNum, Integer maxNum, Date nowDate, List<CardCouponUser> recordAllList){
if(0==dayNum){
//每多少天 设置为0代表不显示
return true;
}
int nowNum = 0;
//开始时间是结算时间 向前推 dayNum
LocalDateTime startTime = DateUtil.offsetDay(nowDate,-3).toLocalDateTime();
//结束时间为结算的时间
LocalDateTime endTime = DateUtil.date(nowDate).toLocalDateTime();
//优惠券使用时间过滤出近 dayNum 天内使用的次数
nowNum = (int) recordAllList.stream()
.filter(item->item.getCardCouponId().equals(coupId))
.filter(item->checkDateTimeIsIn(item.getUseTime(),startTime,endTime))
.count();
return maxNum>nowNum;
}
/**
* 判断一个时间是否在一个时间区间内
* @author vinjor-M
* @date 18:09 2024/9/25
* @param useDate 使用时间
* @param startTime 时间区间起始
* @param endTime 时间区间结束
* @return java.lang.Boolean
**/
private Boolean checkDateTimeIsIn(Date useDate,LocalDateTime startTime,LocalDateTime endTime){
LocalDateTime userDateTime = DateUtil.date(useDate).toLocalDateTime();
if(userDateTime.isAfter(startTime) && userDateTime.isBefore(endTime)){
return true;
}else if(userDateTime.equals(startTime ) || userDateTime.equals(endTime)){
return true;
}else{
return false;
}
}
/**
* 根据活动优惠规则计算优惠金额四舍五入保留2位小数--分时优惠和限时特价使用
* @author vinjor-M
@ -399,6 +573,48 @@ public class CheckUtil {
return Double.valueOf(df.format(disAmount));
}
/**
* 根据优惠券优惠规则计算优惠金额四舍五入保留2位小数--优惠券专用
* @author vinjor-M
* @date 16:35 2024/9/21
* @param coupon 优惠券
* @param oilAmount 加油总价
* @param oilLiter 加油升数
* @return java.lang.Double
**/
public Double computeDisAmountCoupon(CardCouponVO coupon, Double oilAmount, Double oilLiter){
//默认优惠后总价等于原来的总价
Double newOilAmount = oilAmount;
//优惠金额
Double disAmount = 0.0;
DecimalFormat df = new DecimalFormat("#.00");
try {
//1 按加油金额否则 按加油升数
Double thisValue = "1".equals(coupon.getUseType())?oilAmount:oilLiter;
if("1".equals(coupon.getType())){
//代金券-直接拿优惠金额
disAmount = coupon.getReduceAmount();
}else if("3".equals(coupon.getType())){
//折扣券打折
newOilAmount = newOilAmount*coupon.getZkData();
disAmount = oilAmount - newOilAmount;
if(disAmount>coupon.getZkMaxAmount()){
//超出折扣最大优惠金额
disAmount = coupon.getZkMaxAmount();
}
}else if("4".equals(coupon.getType())){
//油品立减券每满多少升减多少钱
//计算能除尽多少次就减多少次
int thisInt = (int) (thisValue / coupon.getLjOilNum());
//计算优惠金额
disAmount = thisInt * coupon.getLjOilAmount();
}
}catch (Exception e){
log.error("优惠券优惠金额计算失败:"+e.getMessage(),e);
}
return Double.valueOf(df.format(disAmount));
}
/**
* 从一个日期里面获取时间00:00格式
* @author vinjor-M
@ -512,7 +728,7 @@ public class CheckUtil {
* @return boolean
**/
private static boolean isBetween(double value, double min, double max) {
return value > min && value < max;
return value >= min && value <= max;
}
/**

View File

@ -11,8 +11,14 @@ import java.io.Serializable;
**/
@Data
public class CouponVO implements Serializable {
/** 优惠券id */
/** 优惠券和用户关联表的id */
private Integer id;
/** 优惠券id */
private Integer couponId;
/** 优惠券名称 */
private String name;
/**是否可与其他优惠一起使用1可以0不可以*/
private String useWithOther;
/** 优惠金额 */
private Double disAmount;
}

View File

@ -0,0 +1,20 @@
package com.fuint.pay.vo;
import lombok.Data;
/**
* 订单选择的商品
* @author vinjor-M
* @date 14:42 2024/9/25
**/
@Data
public class GoodsVO {
/** 商品id */
private String id;
/** 商品数量 */
private Integer num;
/** 商品单价 */
private Double price;
/** 总金额 */
private Double amount;
}

View File

@ -1,7 +1,7 @@
# \u57FA\u672C\u914D\u7F6E
server.port=8080
env.profile=dev
env.properties.path=D:/workspaces/oil-stations/fuintBackend/configure/
env.properties.path=D:/my_project/oil-station/fuintBackend/configure/
#env.properties.path=F:/work/oilSystem/fuintBackend/configure/
#env.properties.path=D:/oil/new-oil/oilSystem/fuintBackend/configure/
#env.properties.path=D:/work/oilSystem/fuintBackend/configure/

View File

@ -1 +1 @@
mvn install:install-file -Dfile=D:\Code\yuzhan\oil-station\fuintBackend\lib\yly_sdk_2.2.jar -DgroupId=yly_sdk -DartifactId=yly_sdk -Dversion=2.2 -Dpackaging=jar
mvn install:install-file -Dfile=D:\Code\yuzhan\oil-station\fuintBackend\lib\yly_sdk_2.2.jar -DgroupId=yly_sdk -DartifactId=yly_sdk -Dversion=2.2 -Dpackaging=jar

View File

@ -65,7 +65,7 @@
<div class="d-b">
<el-checkbox v-model="checkAll">活动优惠 <i class="el-icon-arrow-down"></i></el-checkbox>
<div class="or_num">-0.00</div>
<div class="or_num"></div>
</div>
<!-- 下拉列表插入-->
<div v-if="checkAll == true">
@ -83,22 +83,19 @@
<div class="d-b">
<el-checkbox v-model="checkAll">优惠券 <i class="el-icon-arrow-down"></i></el-checkbox>
<div class="or_num">-0.00</div>
<div class="or_num"></div>
</div>
<!-- 下拉列表插入-->
<div v-if="checkAll == true">
<div class="x-d-b">
<el-checkbox v-model="checkAll1">优惠券1</el-checkbox>
<div class="or_num">-0.00</div>
<div v-if="couponList.length>0">
<el-radio-group style="width: 100%" v-model="chooseAct">
<div class="x-d-b" v-for="(item,index) in activityList">
<el-radio :label="item.id">{{null==item.ruleName?item.actName:item.ruleName}}<div class="or_num">-{{item.disAmount}}</div></el-radio>
</div>
</el-radio-group>
</div>
<div class="x-d-b">
<el-checkbox v-model="checkAll2">优惠券2</el-checkbox>
<div class="or_num">-0.00</div>
</div>
<div class="x-d-b">
<el-checkbox v-model="checkAll3">优惠券3</el-checkbox>
<div class="or_num">-0.00</div>
<div v-if="couponList.length==0">
暂无可用优惠券
</div>
</div>
@ -433,6 +430,7 @@
{{ payForm.realyPayBills }}
</div>
<!-- <div style="text-align: center;margin-bottom: 10px">赠送金额</div> -->
<div v-if="payForm.paymentType !== 'CASH' ">
<div>
<el-input v-model="payForm.authCode"
@ -544,8 +542,12 @@ export default {
},
//
activityList:[],
//
couponList:[],
// actId_ruleId
chooseAct:"",
//
chooseCoupon:"",
//--
payWay: "ALIPAY",
//
@ -553,7 +555,12 @@ export default {
//
oilLiter:0,
openConfirm:false,
//
isPay:false,
isPaySuccess:false,
isAwait: false,
rechargeBalCard:false,
isQuery:true,
loading:false,
//
collectionImg: '',
@ -655,6 +662,17 @@ export default {
}
},
watch: {
orderAmount: {
handler(newVal) {
console.log("订单总金额发生变化", newVal);
//
this.getActivity()
//
this.getCoupon()
},
deep: true,
immediate: true,
},
//
oilGunClearing: {
immediate: true,
@ -667,8 +685,6 @@ export default {
this.orderAmount = this.getGoodsNum
}
this.refuelingAmount = false
//
this.getActivity()
}
},
//
@ -994,21 +1010,38 @@ export default {
*/
getCoupon(){
//
if(this.oilGunClearing!='' && this.oilGunClearing.hasOwnProperty("oilNameId") && this.chooseVipUser.hasOwnProperty("id")){
//
let oilLiter = (this.oilGunClearing.amount / this.oilGunClearing.oilPrice).toFixed(2)
//
if(this.chooseVipUser.hasOwnProperty("id") && (this.goodsList.length>0 || (this.oilGunClearing!='' && this.oilGunClearing.hasOwnProperty("oilNameId")))){
//
let dataObj = {
userId: this.chooseVipUser.id,
oilId: this.oilGunClearing.oilNameId,
oilPrice:this.oilGunClearing.oilPrice,
oilAmount: this.oilGunClearing.amount,
orderAmount: this.orderAmount,
oilLiter: oilLiter
userId: this.chooseVipUser.id
}
if(this.oilGunClearing!='' && this.oilGunClearing.hasOwnProperty("oilNameId")){
//
dataObj['oilId'] = this.oilGunClearing.oilNameId
dataObj['oilAmount'] = this.oilGunClearing.amount
dataObj['oilLiter'] = this.oilLiter
}
if(this.goodsList.length>0){
let goodsArray = []
for (let i = 0; i < this.goodsList.length; i++) {
let thisGoods = this.goodsList[i]
let goods = {
id: thisGoods.id,
num:thisGoods.num,
price:thisGoods.retailPrice,
amount:thisGoods.retailPrice * thisGoods.num
}
goodsArray.push(goods)
dataObj['goods'] = JSON.stringify(goodsArray)
}
console.log(dataObj)
}
getCouponList(dataObj).then(res => {
console.log("返回结果",res)
console.log("返回的可用的优惠券",res)
this.couponList = res.data
})
}else{
this.couponList=[]
}
},
copyToClipboard(textToCopy) {

View File

@ -269,6 +269,12 @@
"navigationStyle": "custom"
}
},
{
"path": "Coupons/details",
"style": {
"navigationBarTitleText": "卡券详情"
}
},
{
@ -278,6 +284,14 @@
}
},
{
"path": "growthValue/index",
"style": {
"navigationBarTitleText": "成长值明细"
}
},
{
"path": "VIP/vip",
"style": {

View File

@ -120,7 +120,7 @@
车牌管理
</view>
</view>
<view class="centenr-sx">
<view class="centenr-sx" @click="goCZZ()">
<view class="centenr-img">
<image src="@/static/icon/icon/newmy8.png"></image>
</view>
@ -383,6 +383,11 @@
url: '/pagesMy/licensePlate/index'
})
},
goCZZ() {
uni.navigateTo({
url: '/pagesMy/growthValue/index'
})
},
goFleet() {
uni.navigateTo({
url: '/pagesMy/fleetInfo/index'

View File

@ -8,7 +8,7 @@
</view>
<!-- 顶部区域 -->
<view class="box-xianze" v-for="(item,index) in dataList" :key="index">
<view class="">
<view class="" @click="choose(item)">
<view style="display: flex;align-items: center;margin-bottom: 5px;">
<view class="">{{item.name || '--'}}</view>
<view style="margin: 0 10px;" v-if="item.sex==0"> 先生</view>
@ -97,7 +97,6 @@
if (item.ifDefault == 1) {
item.checked = true
}
this.$set(item, 'checked', item.checked); //
})
console.log(res, this.dataList, 98);
this.$forceUpdate()

View File

@ -34,18 +34,18 @@
<view class="hui-time">
<view style="color: #FC1708; font-size: 14px;">
<span
v-if="item.exchangeMethod == '积分' || item.exchangeMethod == '积分+金额' || item.exchangeMethod == '积分+加钱购'">{{item.exchangePoints}}</span>
v-if="item.exchangeMethod == '积分' || item.exchangeMethod == '积分+金额' || item.exchangeMethod == '积分+加钱购'">{{item.exchangePoints}}积分</span>
<span v-if="item.exchangeMethod == '积分+金额'">+</span>
<span
v-if="item.exchangeMethod == '金额' || item.exchangeMethod == '积分+金额'">{{item.exchangeAmount}}</span>
<span>积分</span>
<!-- <span>积分</span> -->
</view>
</view>
<view style="display: flex;align-items: center;justify-content: space-between;">
<view class="hui_">
3.5
{{item.market || 0}}
</view>
<view class="anniux">
<text v-if="!item.remainingInventory || item.remainingInventory==0"
@ -109,7 +109,7 @@
methods: {
transferIndex(index, categoryId) {
this.qhindex = index
if (categoryId == undefined || categoryId == null) {
if (!categoryId) {
this.query.categoryId = ''
} else {
this.query.categoryId = categoryId
@ -139,7 +139,9 @@
}).then((res) => {
if (res.code == 200) {
this.integralGiftList = res.data.records
console.log(this.integralGiftList,142);
console.log(res.data, 142);
}else{
this.integralGiftList = []
}
})
},

View File

@ -3,13 +3,15 @@
<view class="Candywrapper">
<view class="bai-bs">
<view class="">
<image src="../../static/logo.png" style="width: 60px; height: 60px; "></image>
<image v-if="giftInfo.coverImage" :src="baseUrl+giftInfo.coverImage" mode="aspectFit"
style="width: 60px; height: 60px; "></image>
<image v-else src="../../static/logo.png" style="width: 60px; height: 60px; "></image>
</view>
<view class="rr-box">
<view class="title_">虚拟物品</view>
<view style="font-size: 12px;color: #666666;">300ml瓶装</view>
<view class="title_">{{giftInfo.giftName}}</view>
<view style="font-size: 12px;color: #666666;">{{giftInfo.goodsName || ''}}</view>
<view style="width: 100%;display: flex;justify-content: space-between; ">
<view class="red-size">兑换券</view>
<view class="red-size">{{giftInfo.giftType}}</view>
<view class="red-size">剩余3张</view>
</view>
</view>
@ -20,48 +22,152 @@
</view>
<view class="bai-box">
<view class="title_">兑换内容</view>
<view class="si_">本兑换券为一次性使用券持有人凭此券可在指定兑换
点免费兑换一瓶可口可乐经典口味瓶装饮料规格为
300毫升此券仅限兑换同等价值商品不找零
兑换现金不可与其他优惠活动同时使用</view>
<view class="si_">{{giftInfo.exchangeInstructions || '--'}}</view>
</view>
<view class="bai-box">
<view class="title_">使用须知</view>
<view class="si_">有效期领取后3天内有效</view>
<view class="si_">{{giftInfo.useInstructions || '--'}}</view>
</view>
<view class="bai-box">
<view class="title_">兑换方式</view>
<view class="si_">门店自提</view>
<view class="si_">{{giftInfo.exchangeMethod || '--'}}</view>
</view>
<view class="bai-box">
<view style="width: 100%; display: flex;align-items: center;justify-content: space-between; ">
<view class="title_">适用门店</view>
<view class="d-s" style="font-size: 14px;color: #FF2828;">
<view class="d-s" style="font-size: 14px;color: #FF2828;" @click="goGoGo()">
<image src="../../static/icon/reddh.png" style="width: 18px; height: 18px; "></image>
导航
</view>
</view>
<view class="si">中建锦绣广场二期站</view>
<view class="si">山东省济南市槐荫区 | 3.0km</view>
<view class="si">{{store.name}}</view>
<view class="si">{{store.address}} | {{distance}}km</view>
</view>
</view>
<view class="bottom-box">
<view class="or-num">100积分</view>
<view class="or-num">
<span v-if="giftInfo.exchangeMethod == '积分' || giftInfo.exchangeMethod == '积分+金额'
|| giftInfo.exchangeMethod == '积分+加钱购'">{{giftInfo.exchangePoints}}积分</span>
<span v-if="giftInfo.exchangeMethod == '积分+金额'">+</span>
<span
v-if="giftInfo.exchangeMethod == '金额' || giftInfo.exchangeMethod == '积分+金额'">{{giftInfo.exchangeAmount}}</span>
</view>
<view class="anniu">立即兑换</view>
</view>
</view>
</template>
<script>
import config from '@/config'
import request from '../../utils/request'
export default {
data() {
return {
value: 0
baseUrl: config.baseUrl,
value: 0,
giftId: '',
giftInfo: {},
AppToken: uni.getStorageSync("App-Token"),
//
longitude: "",
//
latitude: "",
//
lon: "",
//
lat: "",
//
store: {
name: "测试油站",
description: "济南分店",
address: "济南槐荫区"
},
distance: 0,
}
},
onLoad(e) {
this.giftId = e.giftId
this.getInfo()
this.getAddress(uni.getStorageSync("storeId"))
},
methods: {
goGoGo() {
let lat = Number(this.lat)
let lon = Number(this.lon)
uni.openLocation({
latitude: lat,
longitude: lon,
name: this.store.name,
address: this.store.address,
success: function() {
console.log('success');
},
complete: function(res) {
console.log(res);
}
});
},
//
getAddress(storeId) {
let _this = this;
uni.getLocation({
// 使wgs84 使gcj02
type: 'gcj02', // 使
success: function(res) {
if (_this.longitude == "" && _this.latitude == "") {
_this.longitude = res.longitude;
_this.latitude = res.latitude
}
console.log('经度: ' + _this.longitude);
console.log('纬度: ' + _this.latitude);
request({
url: 'business/storeInformation/store/recentlyStore',
method: 'post',
data: {
"lon": _this.longitude,
"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);
} else {
uni.showToast({
title: "当前店铺已关闭!!!",
icon: "none"
})
}
}).catch(err => {})
},
fail: function(err) {
console.log('获取位置信息失败: ' + err.errMsg);
}
});
},
getInfo() {
request({
url: '/business/integral/integralGift/' + this.giftId,
method: 'get',
}).then(res => {
if (res.code == 200) {
this.giftInfo = res.data
}
})
},
valChange(e) {
console.log('当前值为: ' + e.value)
}
@ -155,4 +261,4 @@
display: flex;
align-items: center;
}
</style>
</style>

View File

@ -6,18 +6,22 @@
<view class="">积分余额</view>
<view class="d-s">{{cardBalance.points || 0}}<u-icon name="arrow-right"></u-icon> </view>
</view>
<view class="f-box" v-for="(item,index) in 3" :key="index" @click="goDetails()">
<view class="f-top">中建锦绣二期站可用</view>
<view class="f-box" v-for="(item,index) in integralGiftList" :key="index" @click="goDetails(item)">
<view class="f-top">{{item.storeName}}可用</view>
<view class="f-bs">
<image src="../../static/logo.png" style="width: 60px; height: 60px; "></image>
<image v-if="item.coverImage" :src="baseUrl+item.coverImage" mode="aspectFit"
style="width: 60px; height: 60px; "></image>
<image v-else src="../../static/logo.png" style="width: 60px; height: 60px; "></image>
<view class="r-box">
<view class="">
<view class="m_">虚拟</view>
<view class="p_">300ml瓶装</view>
<view class="q_">兑换券</view>
<view class="m_">{{item.giftName}}</view>
<view class="p_" >{{item.goodsName || ''}}</view>
<view class="q_">{{item.giftType}}</view>
</view>
<view class="">
<view class="an_">100积分</view>
<view class="an_">
{{item.exchangePoints}}积分
</view>
<u-line-progress :percentage="50" :showText="false" height="6"
activeColor="#FA6400"></u-line-progress>
<view class="hui_">券已领70%</view>
@ -26,15 +30,21 @@
</view>
</view>
</view>
<u-empty v-if="integralGiftList.length == 0" style="margin: 5px auto;" mode="data"
icon="http://cdn.uviewui.com/uview/empty/data.png">
</u-empty>
</view>
</view>
</template>
<script>
import config from '@/config'
import request from '../../utils/request'
export default {
data() {
return {
baseUrl: config.baseUrl,
query: {
chainStoreId: '',
couponType: '',
@ -43,13 +53,66 @@
pageSize: 10
},
cardBalance: {},
queryParam: {
storeId: uni.getStorageSync('storeId'),
status: '启用',
categoryId: '',
giftName: '',
deliveryMethod: '',
page: 1,
pageSize: 30
},
integralGiftList: [],
total: 0
}
},
onPullDownRefresh() {
//
this.queryParam = {
storeId: uni.getStorageSync('storeId'),
status: '启用',
categoryId: '',
giftName: '',
deliveryMethod: '',
page: 1,
pageSize: 30
}
this.getIntegralGiftList()
uni.stopPullDownRefresh()
},
onReachBottom() {
//
if (this.queryParam.page >= this.total) {
uni.showToast({
title: '没有下一页数据',
icon: 'none'
})
} else {
this.queryParam.page++
this.getIntegralGiftList()
}
},
onShow() {
this.query.chainStoreId = uni.getStorageSync('chainStoreId');
this.getUserBalance()
this.getIntegralGiftList()
},
methods: {
//
getIntegralGiftList() {
request({
url: 'business/integral/integralGift/queryByPageByStoreId',
method: 'get',
params: this.queryParam
}).then((res) => {
if (res.code == 200) {
this.integralGiftList = res.data.records
this.total = res.data.total
console.log(res, 100);
}
})
},
//
getUserBalance() {
request({
@ -67,9 +130,9 @@
url: '/pagesMy/integral/integral'
})
},
goDetails() {
goDetails(data) {
uni.navigateTo({
url: '/pagesHome/PointsRedemption/details'
url: '/pagesHome/PointsRedemption/details?giftId='+data.id
})
}
}

View File

@ -8,7 +8,7 @@
<view class="box-order" v-for="(item,index) in list" :key="index">
<view class="or-box-top">
<view class="chengg">国庆节礼品卡</view>
<view class="chengg">{{item.activeName || "暂无"}}</view>
</view>
@ -17,11 +17,12 @@
<view class="xbai">卡号{{item.number || "暂无"}}</view>
</view>
<view class="but-box">
<view class="xbai">有效期{{item.updateTime || "暂无"}}</view>
<view class="xbai">密码{{item.number || "暂无"}}</view>
<view class="xbai">有效期{{item.effectiveTimeStart || '暂无'}} - {{item.effectiveTimeEnd || ''}}
</view>
<view class="xbai">密码{{item.cardPassword || "暂无"}}</view>
</view>
<view class="potions_">
<view class="potions_" v-if="item.useStatus==1">
<image src="../../static/imgs/ydh.png" style="width: 45px; height: 45px; "></image>
</view>
@ -33,7 +34,7 @@
<u-loadmore :status="status" v-if="show == true" />
<view class="but-sub">礼品卡兑换</view>
<view class="but-sub" @click="goExchange()">礼品卡兑换</view>
</view>
</view>
</template>
@ -50,15 +51,12 @@
totalDetail: '',
show: false,
list: [{
name: '2'
}],
list: [],
query: {
mtUserId: '',
userId: '',
storeId: '',
recordName: '',
pageNo: 1,
pageSize: 10
pageSize: 1000
},
tapList: [{
text: "全部"
@ -80,23 +78,24 @@
},
onShow() {
this.query.userId = uni.getStorageSync("userId")
this.query.storeId = uni.getStorageSync("storeId")
this.getGiftRecords()
},
onReachBottom() {
this.show = true
if (this.list.length >= this.totalDetail) {
uni.showToast({
title: '没有下一页数据',
icon: 'none'
})
this.status = "nomore"
} else {
this.query.pageNo++
this.getAllOrderList()
}
},
methods: {
goExchange() {
uni.navigateTo({
url: '/pagesHome/giftExchange/index'
})
},
goback() {
uni.navigateBack()
},
@ -106,23 +105,13 @@
url: '/business/marketingActivity/cardGift/selectAllRecords',
method: 'get',
}).then(res => {
console.log(res)
console.log(res, 111)
if (res.code == 200) {
this.list = res.data.records
this.totalDetail = res.data.total
}
})
},
/*getGiftRecords() {
request({
url: '/business/marketingActivity/cardGift/selectAllRecords',
method: 'get',
}).then(res => {
console.log(res)
if (res.code == 200) {
this.list = res.data.records
}
})
},*/
}
}

View File

@ -2,7 +2,7 @@
<view class="centenr">
<view class="Candywrapper">
<view class="f-box" v-for="(item,index) in 3" :key="index" @click="goDetails()">
<view class="f-box" v-for="(item,index) in list" :key="index" @click="goDetails()">
<view class="f-top">中建锦绣二期站可用</view>
<view class="f-bs">
<image src="../../static/logo.png" style="width: 60px; height: 60px; "></image>
@ -27,13 +27,49 @@
</template>
<script>
import request from '../../utils/request';
export default {
data() {
return {
list: [],
total: 0,
queryParams: {
storeId: '',
useStatus: 0,
pageNo: 1,
pageSize: 30
}
}
},
onPullDownRefresh() {
//
uni.stopPullDownRefresh()
},
onReachBottom() {
//
if (this.list.length >= this.totalPage) {} else {
this.queryParams.pageNo++
this.getList()
}
},
onShow() {
this.queryParams.storeId = uni.getStorageSync("storeId")
this.getList()
},
methods: {
getList() {
request({
url: 'business/marketingActivity/cardFavorable/appletList',
method: 'get',
params: this.queryParams
}).then(res => {
console.log(res,66);
if (res.code == 200) {
this.list = res.data.records
this.total = res.data.total
}
})
},
goIntegral() {
uni.navigateTo({
url: '/pagesMy/integral/integral'
@ -141,4 +177,4 @@
font-size: 10px;
color: #666666;
}
</style>
</style>

View File

@ -3,7 +3,7 @@
<view class="container">
<view class="box-hang">
<view class=""><span style="color: red;">*</span>卡类型</view>
<view class="dis">
<view style="color: #333333;">
<text>储值卡</text>
</view>
</view>
@ -11,23 +11,23 @@
<view class="box-hang">
<view class=""><span style="color: red;">*</span>卡号</view>
<view class="dis">
<input v-model="value" style="text-align: right;" placeholder="请输入"></input>
<input v-model="queryParam.number" style="text-align: right;" placeholder="请输入"></input>
</view>
</view>
<view class="box-hang">
<view class=""><span style="color: red;">*</span>卡密码</view>
<view class="dis">
<input v-model="value" style="text-align: right;" placeholder="请输入"></input>
<input v-model="queryParam.cardPassword" style="text-align: right;" placeholder="请输入"></input>
</view>
</view>
<view class="box-hang">
<view class=""><span style="color: red;">*</span>礼品卡金额</view>
<view class="dis">
<input v-model="value" style="text-align: right;" placeholder="--"></input>
{{giftAmount}}
</view>
</view>
<view class="but-sub">兑换</view>
<view class="but-sub" @click="show=!show">兑换</view>
<u-modal :show="show" :title="title" :content='content' :showCancelButton='true' @confirm="confirm"
@cancel="cancel" confirmColor="#FA6400"></u-modal>
@ -49,7 +49,13 @@
value: "",
show: false,
title: "温馨提示",
content: '礼品卡已兑换成功,请在礼品卡兑换记录中查看!'
content: '礼品卡已兑换成功,请在礼品卡兑换记录中查看!',
giftAmount: 0,
queryParam: {
number: '',
cardPassword: '',
storeId: '',
}
}
},
onLoad() {
@ -73,11 +79,53 @@
},
methods: {
goExchange() {
request({
url: 'business/marketingActivity/cardGift/exchange',
method: 'get',
params: this.queryParam
}).then(res => {
console.log(res, 89)
if (res.code == 200) {
this.content = '礼品卡已兑换成功,请在礼品卡兑换记录中查看!'
} else {
this.content = '礼品卡兑换失败。'
}
this.show = !this.show
})
},
getGiftInfo() {
this.queryParam.storeId = uni.getStorageSync('storeId')
request({
url: '/business/marketingActivity/cardGift/getCardAmount',
method: 'get',
params: this.queryParam
}).then(res => {
console.log(res, 89)
if (res.code == 200) {
this.giftAmount = res.data
} else {
this.giftAmount = 0
}
})
},
cancel() {
this.show = false
this.queryParam = {
number: '',
cardPassword: '',
storeId: '',
}
this.giftAmount = 0
},
confirm() {
this.show = false
this.queryParam = {
number: '',
cardPassword: '',
storeId: '',
}
this.giftAmount = 0
},
goback() {
uni.navigateBack()
@ -132,7 +180,7 @@
}
.dis {
color: #a69999;
color: #999999;
}
.box-end {

View File

@ -12,13 +12,20 @@
</view>
<view class="bai-box">
<view class="box-title">{{goodsInfo.giftName}}</view>
<view class="price_num">100积分</view>
<view class="price_num">
<span
v-if="goodsInfo.exchangeMethod == '积分' || goodsInfo.exchangeMethod == '积分+金额' || goodsInfo.exchangeMethod == '积分+加钱购'">{{goodsInfo.exchangePoints}}积分</span>
<span v-if="goodsInfo.exchangeMethod == '积分+金额'">+</span>
<span
v-if="goodsInfo.exchangeMethod == '金额' || goodsInfo.exchangeMethod == '积分+金额'">{{goodsInfo.exchangeAmount}}</span>
</view>
<view class="dt-box">
<view class="hui_">
3.5
{{goodsInfo.market}}
</view>
<view class="or_size">
门店自提
<view class="or_size" v-if="goodsInfo.deliveryMethod">
{{JSON.parse(goodsInfo.deliveryMethod)}}
</view>
</view>
</view>
@ -64,6 +71,7 @@
}
})
uni.$emit('un')
console.log(this.goodsInfo,67);
},
methods: {

View File

@ -13,16 +13,16 @@
<view class="gang" v-if="qhindex == index"></view>
</view>
</scroll-view> -->
<view class="box-bai" v-if="qhindex == 0" @click="goAddress()">
<view class="box-bai" v-if="qhindex == 0" @click="goAdd()">
<view class="dis">
<view class="boximg">
<image src="../../static/imgs/telicon.png"
style="width: 30px; height: 30px;margin-right: 10px; "></image>
</view>
<view style="display: flex;align-items: center;">
<view class="">收货人姓名</view>
<view class="">{{addrInfo.name || '--'}}</view>
<view class="hui-time">
13583028521
{{addrInfo.mobile || '--'}}
</view>
</view>
@ -132,7 +132,7 @@
allAmout: 0,
orderInfo: {},
addrInfo: {
address: ''
name:''
},
appltType: uni.getStorageSync("appltType"),
shippingType: '',
@ -145,7 +145,7 @@
{
text: '快递配送'
}
]
],
}
},
@ -168,32 +168,31 @@
},
onShow() {
uni.$on('chooseAddr', (data) => {
this.addrInfo = data
})
uni.$emit('unChooseAddr')
//
if (!this.addrInfo.address) {
this.getAddr()
if (!this.addrInfo.name ) {
//
this.getAddress()
}
console.log(this.addrInfo,181);
this.transferIndex(0)
// storeId
this.getInfoByStoreId()
//
this.getUserInfoList()
},
methods: {
goAddress(){
uni.navigateTo({
url:'/pagesHome/Address/Address'
getAddress() {
request({
url: "/business/userManager/mtUserExpressAddress/getDefault",
method: 'get',
}).then((res) => {
this.addrInfo = res.data
})
},
//
@ -721,6 +720,7 @@
.hui-time {
font-size: 14px;
color: #666666;
margin-left: 10px;
}
.dis-box {

View File

@ -0,0 +1,151 @@
<template>
<view class="centenr">
<view class="Candywrapper">
<view class="bai-bs">
<view class="">
<image src="../../static/logo.png" style="width: 60px; height: 60px; "></image>
</view>
<view class="rr-box">
<view class="title_">50元优惠券</view>
<view style="font-size: 12px;color: #666666;">最低消费500元</view>
<view style="width: 100%;display: flex;justify-content: space-between; ">
<view class="red-size">兑换券</view>
<view class="red-size">剩余3张</view>
</view>
</view>
</view>
<view class="bai-box">
<view class="title_">使用须知</view>
<view class="si_">消费条件订单金额满300元可用</view>
<view class="si_">有效期领取后10天内有效</view>
<view class="si_">领取说明</view>
<view class="si_"> 1每人限领10张 2每日</view>
<view class="si_">核销说明</view>
<view class="si_" style="display: flex;align-items: center;">
<view style="width: 6px;height: 6px;background: #FF9655;margin-right: 5px;border-radius: 50%;"></view>
以下模块可用一键加油扫码买单
</view>
</view>
<view class="bai-box">
<view style="width: 100%; display: flex;align-items: center;justify-content: space-between; ">
<view class="title_">适用门店</view>
<view class="d-s" style="font-size: 14px;color: #FF2828;">
<image src="../../static/icon/reddh.png" style="width: 18px; height: 18px; "></image>
导航
</view>
</view>
<view class="si">中建锦绣广场二期站</view>
<view class="si">山东省济南市槐荫区 | 3.0km</view>
</view>
</view>
<view class="bottom-box">
<view class="or-num">免费</view>
<view class="anniu">立即领取</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
value: 0
}
},
methods: {
valChange(e) {
console.log('当前值为: ' + e.value)
}
}
}
</script>
<style scoped lang="scss">
.centenr {
width: 100%;
height: 100vh;
background: #F9F9F9;
}
.Candywrapper {
background: #F9F9F9;
box-sizing: border-box;
padding: 10px;
}
.bottom-box {
width: 100%;
background: #fff;
box-sizing: border-box;
padding: 15px 10px;
display: flex;
align-items: center;
justify-content: space-between;
position: fixed;
left: 0px;
bottom: 0px;
}
.or-num {
font-weight: 600;
font-size: 20px;
color: #FA6400;
}
.bai-box {
background-color: #fff;
box-sizing: border-box;
padding: 10px;
width: 100%;
margin: 10px auto;
}
.bai-bs {
background-color: #fff;
box-sizing: border-box;
padding: 10px;
width: 100%;
margin: 10px auto;
display: flex;
align-items: center;
justify-content: space-between;
}
.title_ {
font-weight: 600;
font-size: 16px;
margin-bottom: 5px;
}
.anniu {
width: 90px;
height: 30px;
background: #FA6400;
border-radius: 50px;
display: flex;
align-items: center;
justify-content: center;
color: #fff;
}
.rr-box {
width: 80%;
}
.red-size {
font-size: 12px;
color: #E02020;
}
.si_ {
font-size: 14px;
color: #333333;
}
.d-s {
display: flex;
align-items: center;
}
</style>

View File

@ -4,7 +4,7 @@
<view class="box-hang">
<view class=""><span style="color: red;">*</span>车队名称</view>
<view class="dis">
<input v-model="value" style="text-align: right;"></input>
<input v-model="fleetInfo.fleetName" style="text-align: right;" placeholder="请输入"></input>
</view>
</view>
<view class="box-hang">
@ -32,15 +32,15 @@
<image style="width: 24px;height: 24px;margin-left: 5px;" src="@/static/my/fleetRemove.png"></image>
</view>
</view>
<view class="box-end">
<view class="box-end" @click="show = !show">
<image style="width: 15px;height: 15px;margin-right: 5px;margin-top: 6px;"
src="@/static/my/fleetAdd.png" @click="show = !show"></image>
src="@/static/my/fleetAdd.png"></image>
<text>添加管理员</text>
</view>
<view class="but-sub">保存</view>
<u-picker :show="show" :columns="columns" @cancel="cancel" @confirm="confirm"></u-picker>
<u-picker :show="show" :columns="columns" @cancel="cancel" @confirm="confirm" keyName="realName"></u-picker>
</view>
</view>
@ -59,13 +59,14 @@
value: "xxxxxx",
value1: true,
show: false,
columns: [
['管理员', '小王', '小李']
],
columns: [],
//
staffList: [],
fleetInfo:{},
}
},
onLoad() {
onShow() {
this.getStaffList(uni.getStorageSync("storeId"))
},
onPullDownRefresh() {
//
@ -73,12 +74,7 @@
},
onReachBottom() {
//
if (this.pageNo >= this.totalPage) {
uni.showToast({
title: '没有下一页数据',
icon: 'none'
})
} else {
if (this.pageNo >= this.totalPage) {} else {
this.pageNo++
}
@ -88,6 +84,18 @@
},
methods: {
//
getStaffList(storeId) {
this.columns = []
let _this = this;
request({
url: "business/member/staff/queryList1/" + storeId,
method: 'get',
}).then((res) => {
_this.staffList = res.data
_this.columns.push(_this.staffList)
})
},
cancel() {
this.show = false
},

View File

@ -0,0 +1,293 @@
<template>
<view class="centenr">
<view class="Candywrapper">
<view class="card_box" style="background: url('../../static/imgs/czz.png') no-repeat;background-size: 100% 100%;">
<view style="margin: 13px 0px;">当前成长值</view>
<view class="r-num">{{cardBalance.growthValue || 0}}</view>
</view>
<view class="tab-bs">
<view class="w_box" @click="show1 = true">类型筛选 <u-icon name="arrow-down-fill"></u-icon> </view>
<view class="w_box" @click="show = true">全部时间 <u-icon name="arrow-down-fill"></u-icon> </view>
</view>
<view class="bai_box" v-for="(item,index) in list" :key="index">
<view class="left-img">
<image src="../../static/icon/hyxf.png" mode="" v-if="item.changeType==1"></image>
<image src="../../static/icon/jfdh.png" mode="" v-else></image>
</view>
<view style="width: 85%;">
<view class="right-box">
<view class="l-text">{{item.fromType}}</view>
<view class="r-text" v-if="item.changeType==1">{{item.growthValue}}</view>
<view class="r-text" v-else-if="item.changeType==0">-{{item.growthValue}}</view>
<view class="r-text" v-else>0</view>
</view>
<view class="right-box">
<view class="">会员积分</view>
<view class="">余额{{item.afterTheChange || 0}}</view>
</view>
<view class="right-box">
<view class="">{{item.storeName}}</view>
<view class="">{{item.createTime}}</view>
</view>
</view>
</view>
<view v-if="!list || list.length==0">
<u-empty mode="list" icon="http://cdn.uviewui.com/uview/empty/list.png">
</u-empty>
</view>
<!-- <view class="bai_box">
<view class="left-img">
<image src="../../static/icon/hycz.png" mode=""></image>
</view>
<view style="width: 85%;">
<view class="right-box">
<view class="l-text">会员消费</view>
<view class="r-text">-199.00</view>
</view>
<view class="right-box">
<view class="">储值卡</view>
<view class="">余额123456.98</view>
</view>
<view class="right-box">
<view class="">中建锦绣二期站</view>
<view class="">2024-09-09 16:45:09</view>
</view>
</view>
</view>
<view class="bai_box">
<view class="left-img">
<image src="../../static/icon/jfdh.png" mode=""></image>
</view>
<view style="width: 85%;">
<view class="right-box">
<view class="l-text">会员消费</view>
<view class="r-text">-199.00</view>
</view>
<view class="right-box">
<view class="">储值卡</view>
<view class="">余额123456.98</view>
</view>
<view class="right-box">
<view class="">中建锦绣二期站</view>
<view class="">2024-09-09 16:45:09</view>
</view>
</view>
</view> -->
<u-datetime-picker :show="show" v-model="value1" mode="year-month" @cancel="cancel1" @confirm="confirm1"></u-datetime-picker>
<u-picker :show="show1" :columns="columns" @cancel="cancel" @confirm="confirm"></u-picker>
</view>
</view>
</template>
<script>
import request from '../../utils/request'
export default {
data() {
return {
query: {
chainStoreId: '',
couponType: '',
useStatus: 0,
pageNo: 1,
pageSize: 10
},
cardBalance: {},
show: false,
show1: false,
value1: Number(new Date()),
columns: [
['全部类型', '消费有礼', '充值有礼', '开卡有礼', '邀请有礼', '生日有礼']
],
queryParams: {
pageNo: 1,
pageSize: 30,
fromType: "",
storeId: uni.getStorageSync("storeId"),
startTime: ""
},
list: [],
total: 0
}
},
onShow() {
this.query.chainStoreId = uni.getStorageSync('chainStoreId');
this.getUserBalance()
this.getList()
},
onPullDownRefresh() {
console.log("刷新");
this.list = []
this.queryParams = {
pageNo: 1,
pageSize: 30,
fromType: "",
storeId: uni.getStorageSync("storeId"),
startTime: ""
}
this.getList()
},
onReachBottom() {
//
if (this.list.length < this.total) {
this.queryParams.pageNo++
this.getList()
}
},
methods: {
//
getUserBalance() {
request({
url: '/business/userManager/user/getUserBalanceApplet',
method: 'get',
params: this.query
}).then(res => {
if (res.code == 200) {
this.cardBalance = res.data
}
})
},
getList() {
request({
url: '/business/growthValueChange/queryByPageUni',
method: 'get',
params: this.queryParams
}).then(res => {
console.log(res,156);
if (res.code == 200) {
this.list = res.data.records
this.total = res.data.total
}
})
},
confirm(e) {
this.queryParams.pageNo = 1
if (e.value[0] == '全部类型') {
this.queryParams.fromType = ""
} else {
this.queryParams.fromType = e.value[0]
}
this.getList()
this.show1 = false
},
cancel() {
this.show1 = false
},
timestampToString(timestamp) {
// Date
const date = new Date(timestamp);
// 使toLocaleDateStringtoLocaleTimeString
const dateString = date.toLocaleDateString()
const timeString = date.toLocaleTimeString();
//
return date.getFullYear() + '-' + (date.getMonth() + 1);
},
confirm1(e) {
this.queryParams.startTime = this.timestampToString(e.value)
this.queryParams.pageNo = 1
this.getList()
this.show = false
},
cancel1() {
this.show = false
}
}
}
</script>
<style scoped lang="scss">
.centenr {
width: 100%;
height: 100vh;
background: #F9F9F9;
}
.Candywrapper {
background: #F9F9F9;
box-sizing: border-box;
padding: 10px;
}
.card_box {
width: 100%;
height: 90px;
box-sizing: border-box;
padding: 10px;
color: #fff;
font-size: 14px;
}
.r-size {
width: 100%;
display: flex;
align-items: center;
justify-content: flex-end;
}
.r-num {
font-weight: 600;
font-size: 20px;
color: #FFFFFF;
}
.tab-bs {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
background: #fff;
margin: 15px auto;
}
.w_box {
width: 50%;
display: flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
padding: 15px;
}
.bai_box {
width: 100%;
box-sizing: border-box;
padding: 15px 10px;
background: #fff;
display: flex;
align-items: center;
justify-content: space-between;
}
.left-img {
margin-right: 10px;
image {
width: 40px;
height: 40px;
}
}
.right-box {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 12px;
color: #666666;
}
.l-text {
font-size: 16px;
color: #333333;
margin-bottom: 5px;
font-weight: bold;
}
.r-text {
font-size: 16px;
color: #333333;
margin-bottom: 5px;
font-weight: bold;
}
</style>

View File

@ -4,16 +4,17 @@
<view class="box-left">请输入车牌号</view>
<view class="box-hang" >
<input type="text" @click="show = !show" v-model="value" placeholder="鲁" class="box-input" />
<input type="text" @click="show = !show" v-model="value" placeholder="A" class="box-input" />
<input type="text" @click="show = !show" v-model="value" placeholder="请输入车牌号" class="box-car" />
<view class="box-hang">
<input type="text" @click="upShow(1)" v-model="value" placeholder="鲁" class="box-input" />
<input type="text" @click="upShow(2)" v-model="value1" placeholder="A" class="box-input" />
<input type="text" @click="upShow(3)" v-model="value2" placeholder="请输入车牌号" class="box-car" />
</view>
<view class="but-sub">保存</view>
<view class="but-sub" @click="submitCar()">保存</view>
<u-keyboard ref="uKeyboard" mode="car" @change="valChange" @backspace="backspace" :show="show"
@confirm="confirm1" @cancel="cancel1"></u-keyboard>
@confirm="confirm1" @cancel="cancel1" :overlay="false"></u-keyboard>
</view>
</view>
@ -26,11 +27,16 @@
return {
title: '',
List: [],
showIndex: 1,
pageNo: 1,
pageSize: 10,
totalPage: '',
value: '',
value1: '',
value2: '',
show: false,
show1: false,
show2: false,
}
},
onLoad() {},
@ -47,14 +53,51 @@
components: {
},
watch() {
},
methods: {
//
submitCar() {
let carNo = this.value + this.value1 + this.value2
let storeId = uni.getStorageSync("storeId")
request({
url: '/business/userManager/userCarNo',
method: 'post',
data: {
storeId: storeId,
carNo: carNo
},
}).then(res => {
if (res.code == 200) {
uni.navigateBack()
}
})
},
upShow(num) {
this.showIndex = num
this.show = true
},
// (退)
valChange(val) {
// value+=
this.value += val;
console.log(this.value);
this.ifChange(val)
},
ifChange(val) {
if (this.showIndex == 1) {
this.value = val;
}
if (this.showIndex == 2) {
this.value1 = val;
}
if (this.showIndex == 3) {
this.value2 += val;
}
},
// 退
backspace() {
// value

View File

@ -11,9 +11,9 @@
</view>
<view v-if="type==1">
<view class="box-hang" style="margin-top: 8px;">
<view class="box-left">鲁A 659KG</view>
<view class="dis" @click="show=!show">
<view class="box-hang" style="margin-top: 8px;" v-for="(item,index) in list">
<view class="box-left">{{item.carNo || '暂无'}}</view>
<view class="dis" @click="goDelete(item.id)">
解绑
</view>
</view>
@ -34,7 +34,7 @@
data() {
return {
title: '',
List: [],
list: [],
pageNo: 1,
pageSize: 10,
totalPage: '',
@ -42,7 +42,9 @@
type: 1,
show: false,
title: "温馨提示",
content: '确定解绑?'
content: '确定解绑?',
// id
carNoId:'',
}
},
onLoad() {},
@ -56,14 +58,35 @@
this.pageNo++
}
},
onShow() {
this.getCarNo()
},
components: {
},
methods: {
goAdd(){
goDelete(id){
this.carNoId = id
this.show = !this.show
},
getCarNo() {
request({
url: '/business/userManager/userCarNo',
method: 'get',
}).then(res => {
if (res.code == 200) {
this.list = res.data
if (this.list.length>0){
this.type = 1
}else{
this.type = 0
}
}
})
},
goAdd() {
uni.navigateTo({
url:"/pagesMy/licensePlate/addCar"
url: "/pagesMy/licensePlate/addCar"
})
},
cancel1() {
@ -71,6 +94,15 @@
},
confirm1() {
this.show = false
request({
url: '/business/userManager/userCarNo/'+this.carNoId,
method: 'delete',
}).then(res => {
if (res.code == 200){
this.carNoId = ''
this.getCarNo()
}
})
},
goback() {
uni.navigateBack()

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB