# Conflicts:
#	fuintCashierWeb/src/api/newHome/newHome.js
This commit is contained in:
Vinjor 2024-09-22 17:32:26 +08:00
commit f7f711e3f2
27 changed files with 757 additions and 95 deletions

124
.idea/uiDesigner.xml Normal file
View File

@ -0,0 +1,124 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Palette2">
<group name="Swing">
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
</item>
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
</item>
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.svg" removable="false" auto-create-binding="false" can-attach-label="true">
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
</item>
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
<initial-values>
<property name="text" value="Button" />
</initial-values>
</item>
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="RadioButton" />
</initial-values>
</item>
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="CheckBox" />
</initial-values>
</item>
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
<initial-values>
<property name="text" value="Label" />
</initial-values>
</item>
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
</item>
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
</item>
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
<preferred-size width="-1" height="20" />
</default-constraints>
</item>
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
</item>
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
</item>
</group>
</component>
</project>

View File

@ -276,19 +276,17 @@
</el-form-item>
</div>
<div>
<el-form-item label="赠送电子券" :label-width="formLabelWidth" prop="activeStatus">
<el-radio-group v-model="form.isonline" @input="changeIsOnline">
<el-radio label="0">不赠送</el-radio>
<el-radio label="1">赠送</el-radio>
</el-radio-group>
<el-form-item label="赠送优惠券" :label-width="formLabelWidth" >
<!-- <el-radio-group v-model="form.isonline" @input="changeIsOnline">-->
<!-- <el-radio label="0">不赠送</el-radio>-->
<!-- <el-radio label="1">赠送</el-radio>-->
<!-- </el-radio-group>-->
<el-button type="primary" style="margin-left: 30px" size="mini" @click="getlistFavorable()" >添加</el-button>
</el-form-item>
</div>
</el-form>
<!-- 赠送卡券-->
<!-- 选择优惠券-->
<div class="xh-box" >
<div style="margin: 10px 0px">
<el-table
:data="youhuiquanlist"
@ -355,6 +353,7 @@
</div>
</div>
<div class="box-popup">
<div class="dis-bit">附加特权</div>
<el-input

View File

@ -15,9 +15,42 @@
</resultMap>
<resultMap id="ActivePriceRuleAndOilMap" type="com.fuint.business.marketingActivity.activePrice.vo.ActivePriceRuleRespVO">
<id column="id" property="id"/>
<result column="store_id" property="storeId"/>
<result column="active_id" property="activeId"/>
<result column="rule_name" property="ruleName"/>
<result column="payment_type" property="paymentType"/>
<result column="level_id" property="levelId"/>
<result column="babel_ids" property="babelIds"/>
<result column="active_start_time" property="activeStartTime"/>
<result column="active_end_time" property="activeEndTime"/>
<result column="consume_type" property="consumeType"/>
<result column="money_min" property="moneyMin"/>
<result column="money_max" property="moneyMax"/>
<result column="liter_min" property="literMin"/>
<result column="liter_max" property="literMax"/>
<result column="dis_max" property="disMax"/>
<result column="time_type" property="timeType"/>
<result column="time_slots" property="timeSlots"/>
<result column="day_start_time" property="dayStartTime"/>
<result column="day_end_time" property="dayEndTime"/>
<result column="day_limit_num" property="dayLimitNum"/>
<result column="limit_num" property="limitNum"/>
<result column="status" property="status"/>
<result column="active_type" property="activeType"/>
<result column="activeTitle" property="activeTitle"/>
<result column="activeCategory" property="activeCategory"/>
<result column="activeDisValue" property="activeDisValue"/>
<collection property="oilList"
ofType="com.fuint.business.marketingActivity.activePrice.entity.ActivePriceOil" columnPrefix="oil_">
<id column="id" property="id"/>
<result column="store_id" property="storeId"/>
<result column="active_id" property="activeId"/>
<result column="oil_id" property="oilId"/>
<result column="oil_type" property="oilType"/>
<result column="oil_name" property="oilName"/>
<result column="type" property="type"/>
<result column="oil_price" property="oilPrice"/>
<result column="price" property="price"/>
</collection>
</resultMap>
<select id="pageActivePriceRule" resultType="com.fuint.business.marketingActivity.activePrice.vo.ActivePriceRuleRespVO">

View File

@ -3,9 +3,39 @@
<mapper namespace="com.fuint.business.marketingActivity.activePrice.mapper.ActiveSubPriceMapper">
<resultMap id="ActivePriceRuleMap" type="com.fuint.business.marketingActivity.activePrice.vo.ActiveSubPriceRespVO">
<id column="id" property="id"/>
<result column="store_id" property="storeId"/>
<result column="active_name" property="activeName"/>
<result column="time_type" property="timeType"/>
<result column="time_slots" property="timeSlots"/>
<result column="time_apply_start" property="timeApplyStart"/>
<result column="time_apply_end" property="timeApplyEnd"/>
<result column="payment_type" property="paymentType"/>
<result column="active_time_type" property="activeTimeType"/>
<result column="active_start_time" property="activeStartTime"/>
<result column="active_end_time" property="activeEndTime"/>
<result column="offer_type" property="offerType"/>
<result column="active_type" property="activeType"/>
<result column="apply_oil_type" property="applyOilType"/>
<result column="apply_oil" property="applyOil"/>
<result column="active_manner" property="activeManner"/>
<result column="level_id" property="levelId"/>
<result column="babel_ids" property="babelIds"/>
<result column="day_limit_num" property="dayLimitNum"/>
<result column="month_limit_num" property="monthLimitNum"/>
<result column="limit_num" property="limitNum"/>
<result column="isonline" property="isonline"/>
<collection property="ruleList"
ofType="com.fuint.business.marketingActivity.activePrice.entity.ActiveSubPriceRule" columnPrefix="rule_">
<id column="id" property="id"/>
<result column="store_id" property="storeId"/>
<result column="active_id" property="activeId"/>
<result column="active_manner" property="activeManner"/>
<result column="full" property="full"/>
<result column="sub" property="sub"/>
<result column="random_front" property="randomFront"/>
<result column="random_after" property="randomAfter"/>
<result column="max_preferential" property="maxPreferential"/>
<result column="enjoy_discount" property="enjoyDiscount"/>
</collection>
</resultMap>
<select id="selectActiveByStoreId" resultMap="ActivePriceRuleMap">

View File

@ -0,0 +1,92 @@
package com.fuint.business.marketingActivity.cardCoupon.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.api.ApiController;
import com.baomidou.mybatisplus.extension.api.R;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.marketingActivity.cardCoupon.entity.CardCouponUser;
import com.fuint.business.marketingActivity.cardCoupon.service.CardCouponUserService;
import com.fuint.framework.web.BaseController;
import com.fuint.framework.web.ResponseObject;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.io.Serializable;
import java.util.List;
import static org.springframework.boot.actuate.autoconfigure.cloudfoundry.SecurityResponse.success;
/**
* 用户优惠卷表2024(CardCouponUser)表控制层
*
* @author makejava
* @since 2024-09-22 15:14:30
*/
@RestController
@RequestMapping("cardCouponUser")
public class CardCouponUserController extends BaseController {
/**
* 服务对象
*/
@Resource
private CardCouponUserService cardCouponUserService;
/**
* 分页查询所有数据
*
* @param page 分页对象
* @param cardCouponUser 查询实体
* @return 所有数据
*/
@GetMapping
public ResponseObject selectAll(Page<CardCouponUser> page, CardCouponUser cardCouponUser) {
return getSuccessResult(this.cardCouponUserService.page(page, new QueryWrapper<>(cardCouponUser)));
}
/**
* 通过主键查询单条数据
*
* @param id 主键
* @return 单条数据
*/
@GetMapping("{id}")
public ResponseObject selectOne(@PathVariable Serializable id) {
return getSuccessResult(this.cardCouponUserService.getById(id));
}
/**
* 新增数据
*
* @param cardCouponUser 实体对象
* @return 新增结果
*/
@PostMapping
public ResponseObject insert(@RequestBody CardCouponUser cardCouponUser) {
return getSuccessResult(this.cardCouponUserService.save(cardCouponUser));
}
/**
* 修改数据
*
* @param cardCouponUser 实体对象
* @return 修改结果
*/
@PutMapping
public ResponseObject update(@RequestBody CardCouponUser cardCouponUser) {
return getSuccessResult(this.cardCouponUserService.updateById(cardCouponUser));
}
/**
* 删除数据
*
* @param idList 主键结合
* @return 删除结果
*/
@DeleteMapping
public ResponseObject delete(@RequestParam("idList") List<Long> idList) {
return getSuccessResult(this.cardCouponUserService.removeByIds(idList));
}
}

View File

@ -4,6 +4,7 @@ import java.time.LocalTime;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
@ -130,6 +131,9 @@ public class CardCoupon extends Model<CardCoupon> {
private String updateBy;
//更新时间
private Date updateTime;
//当次获取数量
@TableField(exist = false)
private Integer giftCardToatl;
}

View File

@ -0,0 +1,55 @@
package com.fuint.business.marketingActivity.cardCoupon.entity;
import java.util.Date;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;
import java.io.Serializable;
/**
* 用户优惠卷表2024(CardCouponUser)表实体类
*
* @author makejava
* @since 2024-09-22 15:14:30
*/
@Data
public class CardCouponUser extends Model<CardCouponUser> {
//主键id
private Integer id;
//所属连锁店id
private Integer chainStoreId;
//所属店铺id
private Integer storeId;
//会员id
private Integer mtUserId;
//会员手机号码
private String mobile;
//来源类型 1储值卡2囤油卡....
private String fromType;
//活动id
private Integer activeId;
//优惠券id
private Integer cardCouponId;
//有效期开始时间
private Date startTime;
//有效期结束时间
private Date endTime;
//0未使用1已核销
private String status;
//使用时间
private Date useTime;
//订单总表all order 的主键
private Integer orderId;
//创建者
private String createBy;
//创建时间
private Date createTime;
//更新者
private String updateBy;
//更新时间
private Date updateTime;
}

View File

@ -0,0 +1,15 @@
package com.fuint.business.marketingActivity.cardCoupon.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.fuint.business.marketingActivity.cardCoupon.entity.CardCouponUser;
/**
* 用户优惠卷表2024(CardCouponUser)表数据库访问层
*
* @author makejava
* @since 2024-09-22 15:14:30
*/
public interface CardCouponUserMapper extends BaseMapper<CardCouponUser> {
}

View File

@ -0,0 +1,22 @@
package com.fuint.business.marketingActivity.cardCoupon.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.fuint.business.marketingActivity.cardCoupon.entity.CardCouponUser;
/**
* 用户优惠卷表2024(CardCouponUser)表服务接口
*
* @author makejava
* @since 2024-09-22 15:14:30
*/
public interface CardCouponUserService extends IService<CardCouponUser> {
/**
* 判断用户是否还能领取该优惠卷
* @param couponId 优惠卷id
* @param userId 用户主键
* @return true false 不能
*/
boolean userCanGet(Integer couponId,Integer userId);
}

View File

@ -0,0 +1,60 @@
package com.fuint.business.marketingActivity.cardCoupon.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.marketingActivity.cardCoupon.entity.CardCoupon;
import com.fuint.business.marketingActivity.cardCoupon.mapper.CardCouponUserMapper;
import com.fuint.business.marketingActivity.cardCoupon.entity.CardCouponUser;
import com.fuint.business.marketingActivity.cardCoupon.service.CardCouponService;
import com.fuint.business.marketingActivity.cardCoupon.service.CardCouponUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* 用户优惠卷表2024(CardCouponUser)表服务实现类
*
* @author makejava
* @since 2024-09-22 15:14:30
*/
@Service("cardCouponUserService")
public class CardCouponUserServiceImpl extends ServiceImpl<CardCouponUserMapper, CardCouponUser> implements CardCouponUserService {
@Autowired
private CardCouponService cardCouponService;
/**
* 判断用户是否还能领取该优惠卷
* @param couponId 优惠卷id
* @param userId 用户主键
* @return true false 不能
*/
@Override
public boolean userCanGet(Integer couponId, Integer userId) {
CardCoupon cardCoupon = cardCouponService.getById(couponId);
if (cardCoupon.getTfTotal()<=cardCoupon.getTfTotal()){
//领取数量大于策略中的送出总量
return false;
}
String nowDate = DateUtil.format(new Date(), "yyyy-MM-dd");
LambdaQueryWrapper<CardCouponUser> queryWrapper =new LambdaQueryWrapper<>();
queryWrapper.eq(CardCouponUser::getCardCouponId,couponId).eq(CardCouponUser::getMtUserId,userId);
List<CardCouponUser> list = this.list(queryWrapper);
if (CollectionUtil.isEmpty(list)){
list =new ArrayList<>();
}
if (list.size()>=cardCoupon.getGetNumLimit()){
//当前用户领取已到达上限
return false;
}
//获取当日获取数量
long count = list.stream().filter(it -> {
return DateUtil.format(it.getCreateTime(), "yyyy-MM-dd").equals(nowDate);
}).count();
return count < cardCoupon.getDayGetLimit();
}
}

View File

@ -69,6 +69,17 @@ public class CardValueController extends BaseController {
return getSuccessResult(this.cardValueService.selectAllApplet(cardValue));
}
/**
* 查询本站会员充值卡列表
* @param cardValue
* @return
*/
@GetMapping("cardValueList")
public ResponseObject cardValueList(@Param("cardValue") CardValue cardValue) {
return getSuccessResult(this.cardValueService.cardValueList(cardValue));
}
/**
* 通过主键查询单条数据
*
@ -90,7 +101,16 @@ public class CardValueController extends BaseController {
public ResponseObject selectById(@PathVariable Serializable id) {
return getSuccessResult(this.cardValueService.getOneById(id));
}
/**
* 获取使用时的详细信息
*
* @param cardValueId 主键
* @return 单条数据
*/
@GetMapping("/getCoupons")
public ResponseObject getCoupons(@RequestParam("userId") Integer userId,@RequestParam("cardValueId") Integer cardValueId) {
return getSuccessResult(this.cardValueService.getCoupons(userId,cardValueId));
}
/**
* 新增数据
*

View File

@ -3,12 +3,15 @@ package com.fuint.business.marketingActivity.cardValue.entity;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fuint.business.marketingActivity.cardCoupon.entity.CardCoupon;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 储值卡表(CardValue)表实体类
@ -87,6 +90,8 @@ public class CardValue extends Model<CardValue> {
//20240821追加字段
//活动名称
private String activeName;
@TableField(exist = false)
private List<CardCoupon> cardCoupons;
}

View File

@ -1,7 +1,11 @@
package com.fuint.business.marketingActivity.cardValue.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.fuint.business.marketingActivity.cardCoupon.entity.CardCoupon;
import com.fuint.business.marketingActivity.cardValue.entity.CardValueChild;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 储值卡子表(CardValueChild)表数据库访问层
@ -10,5 +14,6 @@ import com.fuint.business.marketingActivity.cardValue.entity.CardValueChild;
* @since 2023-11-20 17:50:59
*/
public interface CardValueChildMapper extends BaseMapper<CardValueChild> {
List<CardCoupon> getByCardId(@Param("cardValueId") Integer cardValueId);
}

View File

@ -0,0 +1,16 @@
<?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.marketingActivity.cardValue.mapper.CardValueChildMapper">
<select id="getByCardId" resultType="com.fuint.business.marketingActivity.cardCoupon.entity.CardCoupon">
SELECT
cc.*,cvc.gift_card_total as giftCardToatl
FROM
card_value_child cvc
INNER JOIN card_coupon cc on cvc.vouchers_id = cc.id
where cvc.card_value_id = #{cardValueId} and cc.tf_total <![CDATA[ >]]> cc.tf_get_num
</select>
</mapper>

View File

@ -1,8 +1,11 @@
package com.fuint.business.marketingActivity.cardValue.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.fuint.business.marketingActivity.cardCoupon.entity.CardCoupon;
import com.fuint.business.marketingActivity.cardValue.entity.CardValueChild;
import java.util.List;
/**
* 储值卡子表(CardValueChild)表服务接口
*
@ -10,5 +13,5 @@ import com.fuint.business.marketingActivity.cardValue.entity.CardValueChild;
* @since 2023-11-20 17:51:06
*/
public interface CardValueChildService extends IService<CardValueChild> {
List<CardCoupon> getByCardId(Integer cardValueId);
}

View File

@ -3,6 +3,7 @@ package com.fuint.business.marketingActivity.cardValue.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.fuint.business.marketingActivity.cardCoupon.entity.CardCoupon;
import com.fuint.business.marketingActivity.cardValue.dto.CardValueDTO;
import com.fuint.business.marketingActivity.cardValue.entity.CardValue;
import com.fuint.business.marketingActivity.cardValue.vo.CardValueAppletVO;
@ -43,6 +44,7 @@ public interface CardValueService extends IService<CardValue> {
* @return
*/
CardValueVO getOneById(Serializable id);
List<CardCoupon> getCoupons(Integer userId,Integer cardValueId);
/**
* 新增数据
@ -66,6 +68,8 @@ public interface CardValueService extends IService<CardValue> {
*/
List<CardValueAppletVO> selectAllApplet(CardValue cardValue);
List<CardValue> cardValueList (CardValue cardValue);
/**
* 删除数据
* @param id

View File

@ -1,11 +1,14 @@
package com.fuint.business.marketingActivity.cardValue.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.marketingActivity.cardCoupon.entity.CardCoupon;
import com.fuint.business.marketingActivity.cardValue.entity.CardValueChild;
import com.fuint.business.marketingActivity.cardValue.mapper.CardValueChildMapper;
import com.fuint.business.marketingActivity.cardValue.service.CardValueChildService;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 储值卡子表(CardValueChild)表服务实现类
*
@ -15,5 +18,9 @@ import org.springframework.stereotype.Service;
@Service("cardValueChildService")
public class CardValueChildServiceImpl extends ServiceImpl<CardValueChildMapper, CardValueChild> implements CardValueChildService {
@Override
public List<CardCoupon> getByCardId(Integer cardValueId) {
return baseMapper.getByCardId(cardValueId);
}
}

View File

@ -1,5 +1,6 @@
package com.fuint.business.marketingActivity.cardValue.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@ -15,6 +16,9 @@ import com.fuint.business.marketingActivity.activeConsumption.vo.ActiveConsumpti
import com.fuint.business.marketingActivity.activeDiscount.entity.ActiveDiscount;
import com.fuint.business.marketingActivity.activeDiscount.entity.ActiveDiscountChild;
import com.fuint.business.marketingActivity.activeDiscount.vo.ActiveDiscountVO;
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.cardExchange.entity.CardExchange;
import com.fuint.business.marketingActivity.cardExchange.mapper.CardExchangeMapper;
import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorable;
@ -33,6 +37,7 @@ import com.fuint.business.member.service.ILJStaffService;
import com.fuint.business.store.service.StoreService;
import com.fuint.business.storeInformation.service.ILJStoreService;
import com.fuint.business.userManager.service.LJUserGradeService;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.service.StaffService;
import com.fuint.common.util.TokenUtil;
import com.fuint.repository.mapper.MtStaffMapper;
@ -86,6 +91,8 @@ public class CardValueServiceImpl extends ServiceImpl<CardValueMapper, CardValue
@Autowired
private ILJStaffService staffService;
@Autowired
private CardCouponUserService cardCouponUserService;
/**
* 分页查询所有数据
* @param page
@ -313,6 +320,16 @@ public class CardValueServiceImpl extends ServiceImpl<CardValueMapper, CardValue
return cardValueVO;
}
@Override
public List<CardCoupon> getCoupons(Integer userId,Integer cardValueId) {
List<CardCoupon> cardCoupons = cardValueChildService.getByCardId(cardValueId);
//过滤
return cardCoupons.stream().filter(it -> {
return cardCouponUserService.userCanGet(it.getId(), userId);
}).collect(Collectors.toList());
}
/**
* 新增数据
* @param cardValueDTO
@ -525,6 +542,19 @@ public class CardValueServiceImpl extends ServiceImpl<CardValueMapper, CardValue
}).collect(Collectors.toList());
}
@Override
public List<CardValue> cardValueList(CardValue cardValue) {
//获取当前登录用户
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
String nowTime = DateUtil.format(new Date(), "yyyy-MM-dd")+"00:00:00";
LambdaQueryWrapper<CardValue> queryWrapper =new LambdaQueryWrapper<>();
queryWrapper.eq(CardValue::getStoreId,nowAccountInfo.getStoreId()).eq(CardValue::getIsonline,"0").eq(CardValue::getActiveStatus,"1").and(it->{
return it.eq(CardValue::getActiveTime,"1").or().eq(CardValue::getActiveTime,"2")
.ge(CardValue::getStartTime,nowTime).le(CardValue::getEndTime,nowTime);
}).orderByAsc(CardValue::getRechargeBalance);
return this.list(queryWrapper);
}
/**
* 删除数据
* @param id

View File

@ -160,13 +160,13 @@
select zong.*, o2.oil_name
FROM (SELECT o1.*,
o2.oil_name as oil_name_id,
o2.oil_name as oilNameId,
o2.oil_type as oilType,
o2.oil_price as oilPrice
FROM oil_gun o1
LEFT JOIN oil_number o2 ON o1.number_id = o2.number_id
LEFT JOIN oil_number o2 ON o1.number_id = o2.number_id
WHERE o1.store_id = #{storeId} and o1.status = '启用' ) as zong
LEFT JOIN oil_name as o2 on zong.oil_name_id = o2.id
LEFT JOIN oil_name as o2 on zong.oilNameId = o2.id
</select>

View File

@ -20,5 +20,6 @@ public class OilCashRegisterVo extends OilGun {
* 关联表 挂牌价
*/
private BigDecimal oilPrice;
private Integer oilNameId;
}

View File

@ -32,8 +32,8 @@ public class PayCenterController extends BaseController {
* @param request
* @return com.fuint.framework.web.ResponseObject
**/
@GetMapping("/getActivityAndCoupon")
public ResponseObject getActivityAndCoupon(Map<String,String> map,HttpServletRequest request) throws Exception {
@PostMapping("/getActivityAndCoupon")
public ResponseObject getActivityAndCoupon(@RequestBody Map<String,String> map,HttpServletRequest request) throws Exception {
logger.info("收银台获取可用优惠券和可以参加的优惠活动参数:{}", map);
return getSuccessResult("查询成功",payCenterService.getActivityAndCoupon(map));
}

View File

@ -105,8 +105,8 @@ public class PayCenterServiceImpl implements PayCenterService {
actList.addAll(this.getLijianAct(nowDate,userId,gradeId,storeId,labelIdList,oilAmount,oilLiter,oilId));
//2.3 查可参加的折扣营销会员折扣
actList.addAll(this.getZhekouAct(nowDate,gradeId,storeId,oilAmount));
/*3.查询所有可用的优惠券 TODO 需要等待优惠券表修改完以后再处理 */
List<CouponVO> couponList = new ArrayList<>();
/*3.查询所有可用的优惠券 */
List<CouponVO> couponList = this.getCouponList(userId,storeId,oilAmount,orderAmount,nowDate);
rtnObj.put("activity",actList);
rtnObj.put("coupon",couponList);
return rtnObj;
@ -279,4 +279,19 @@ public class PayCenterServiceImpl implements PayCenterService {
}
return rtnList;
}
/**
* 获取当前会员可以使用的优惠券
* @author vinjor-M
* @date 11:46 2024/9/22
* @param userId 用户Id
* @param storeId 店铺id
* @param oilAmount 当前加油金额
* @param orderAmount 订单总金额
* @param nowDate 结算那一刻的时间
* @return java.util.List<com.fuint.pay.vo.CouponVO>
**/
public List<CouponVO> getCouponList(Integer userId,Integer storeId,Double oilAmount,Double orderAmount,Date nowDate){
}
}

View File

@ -16,10 +16,23 @@ export function cashRegisterGoodsList() {
})
}
export function cardValueList() {
return request({
url: '/business/marketingActivity/cardValue/cardValueList',
method: 'get',
})
}
export function getCoupons(param) {
return request({
url: '/business/marketingActivity/cardValue/getCoupons',
method: 'get',
params:param
})
}
export function getActivityAndCoupon(data) {
return request({
url: '/pay/paycenter/getActivityAndCoupon',
method: 'get',
params: data
method: 'post',
data: data
})
}

View File

@ -403,7 +403,7 @@
width="910px"
center
>
<memberRecharge></memberRecharge>
<memberRecharge :userId="chooseVipUser.id" ref="rechargeRef"></memberRecharge>
<span slot="footer" class="dialog-footer">
<el-button @click="memberRecharge = false"> </el-button>
<el-button type="primary" @click="memberRecharge = false">确认充值</el-button>
@ -436,7 +436,7 @@ import refuelingAmount from './newHomeComponents/refuelingAmount.vue'
import { cashRegisterList, cashRegisterGoodsList,getActivityAndCoupon } from '@/api/newHome/newHome.js'
import {QRCodeByStoreId} from "@/api/staff/qrcode";
import {userListByPhone} from "@/api/cashier/user";
import Vue from 'vue';
import { VueClipboard } from 'vue-clipboard2';
export default {
@ -578,6 +578,8 @@ export default {
handler(newValue, oldValue) {
console.log('油枪发生拜年话', newValue);
this.refuelingAmount = false
//
this.getActivityAndCoupon()
}
},
//
@ -642,10 +644,23 @@ export default {
*/
getActivityAndCoupon(){
//
let dataObj = {userId:"",oil:"",oilAmount:"",orderAmount:"",oilLiter:""}
getActivityAndCoupon(dataObj).then(res => {
})
if(this.oilGunClearing!='' && this.oilGunClearing.hasOwnProperty("oilNameId") && this.chooseVipUser.hasOwnProperty("id")){
//
let oilLiter = (this.oilGunClearing.amount / this.oilGunClearing.oilPrice).toFixed(2)
let orderAmount = this.oilGunClearing.amount+this.getGoodsNum
//
let dataObj = {
userId: this.chooseVipUser.id,
oilId: this.oilGunClearing.oilNameId,
oilPrice:this.oilGunClearing.oilPrice,
oilAmount: this.oilGunClearing.amount,
orderAmount: orderAmount,
oilLiter: oilLiter
}
getActivityAndCoupon(dataObj).then(res => {
console.log("返回结果",res)
})
}
},
copyToClipboard(textToCopy) {
@ -865,6 +880,10 @@ export default {
},
addMemberRecharge() {
this.memberRecharge = true
this.$nextTick(res=>{
this.$refs.rechargeRef.getCardValueList();
})
},
changeBox() {
this.boxShow = !this.boxShow

View File

@ -1,7 +1,15 @@
<script >
import {cardValueList,getCoupons} from "@/api/newHome/newHome";
import {number} from "echarts/lib/export";
export default {
props: {
userId: number
},
data() {
return {
youhuiquanlist:[],
selectCard:{},
tabList:[
{
name:'电子储值卡',
@ -16,10 +24,6 @@ export default {
num:2
}
],
kangList:[
"充值5000元赠送500元",
"充值10000元赠送1500元"
],
tabIndex:0,
kIndex:0,
ruleForm: {
@ -42,15 +46,38 @@ export default {
price:[
{ required: true, message: '充值金额', trigger: 'change' }
],
}
},
cardList:[]
}
},
methods:{
setindex(index){
selectTab(index){
this.tabIndex = index
},
setIndex(index){
chooseActive(data,index){
this.kIndex = index
this.selectCard = data
console.log(this.selectCard)
},
getCardValueList(){
let that = this
cardValueList().then(res=>{
this.kIndex = 0
this.cardList = res.data
if (this.cardList&&this.cardList.length>0) {
console.log(70707)
that.getCouponList(this.cardList[0].id);
}
})
},
getCouponList(cardValueId){
console.log({userId:this.userId,cardValueId:cardValueId},72)
getCoupons({userId:this.userId,cardValueId:cardValueId}).then(res=>{
console.log(res,72)
})
}
}
}
@ -59,7 +86,7 @@ export default {
<template>
<div>
<div class="top-dd">
<div class="tab-dv" v-for="(item,index) in tabList" :key="index" :class="{ 'active' :tabIndex==index}" @click="setindex(index)" >
<div class="tab-dv" v-for="(item,index) in tabList" :key="index" :class="{ 'active' :tabIndex==index}" @click="selectTab(index)" >
{{item.name}}
</div>
</div>
@ -68,32 +95,104 @@ export default {
<el-form-item label="充值金额" prop="price" >
</el-form-item>
<div class="d-s">
<div class="k_kang" v-for="(item,index) in kangList" :key="index" @click="setIndex(index)" >
{{item}}
<div class="k_kang" v-for="(item,index) in cardList" :key="index" @click="chooseActive(item,index)" >
{{item.activeName}}
<img src="../imgs/r-j.png" class="p-img" v-if="kIndex == index" >
</div>
</div>
<el-form-item label="自定义充值本金" prop="region" >
<el-input v-model="ruleForm.text4" style="width: 330px">
<el-form-item label="充值本金" prop="region" >
<el-input v-model="selectCard.rechargeBalance" style="width: 330px">
<template slot="append"></template>
</el-input>
</el-form-item>
<div style="display: flex">
<el-form-item label="赠送金额" prop="text">
<el-input v-model="ruleForm.text1" style="width: 150px">
<el-input v-model="selectCard.giftBalance" style="width: 150px">
<template slot="append"></template>
</el-input>
</el-form-item>
<el-form-item label="赠送积分" prop="text">
<el-input v-model="ruleForm.text2" style="width: 150px">
<el-input v-model="selectCard.points" style="width: 150px">
<template slot="append">积分</template>
</el-input>
</el-form-item>
<el-form-item label="赠送成长值" prop="text">
<el-input v-model="ruleForm.text3" style="width: 150px">
<el-input v-model="selectCard.growthValue" style="width: 150px">
<template slot="append">成长值</template>
</el-input>
</el-form-item>
</div>
<el-form-item label="赠送优惠券" >
<el-button type="primary" style="margin-left: 30px" size="mini" @click="getlistFavorable()" >添加</el-button>
</el-form-item>
<!-- 选择优惠券-->
<div class="xh-box" >
<div style="margin: 10px 0px">
<el-table
:data="youhuiquanlist"
border
style="width: 100%">
<el-table-column
prop="giftCardName"
label="卡券名称"
width="0">
</el-table-column>
<el-table-column
prop="giftCardType"
label="券类型"
width="80">
<template slot-scope="scope">
<span v-if="scope.row.giftCardType == 0" >油品券</span>
<span v-if="scope.row.giftCardType == 1" >商品券</span>
<span v-if="scope.row.giftCardType == 2" >通用券</span>
</template>
</el-table-column>
<el-table-column
prop="date"
label="券详情"
width="80">
<template slot-scope="scope">
<span>{{scope.row.giftCardDetail}}</span>
</template>
</el-table-column>
<el-table-column
prop="instruction"
label="使用说明"
width="0">
</el-table-column>
<el-table-column
prop="date"
label="有效期(天)">
<template slot-scope="scope">
<span v-if="scope.row.timeType == 0" > {{scope.row.validityZero}} </span>
<span v-if="scope.row.timeType == 1" > {{scope.row.validityOne}} </span>
<span v-if="scope.row.timeType == 2" > {{scope.row.validityTwo}} </span>
</template>
</el-table-column>
<el-table-column
prop="date"
label="数量"
width="240">
<template slot-scope="scope">
<el-input-number v-model="scope.row.giftCardTotal" controls-position="right" :min="1" :max="9999"></el-input-number>
</template>
</el-table-column>
<el-table-column
prop="address"
label="操作">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
@click="deletedata(scope.row)"
>删除</el-button>
</template>
</el-table-column>
</el-table>
</div>
</div>
<el-form-item label="提成员工" prop="region" >
<el-select v-model="ruleForm.region" placeholder="请选择提成员工" style="width: 330px">

View File

@ -135,8 +135,8 @@
{
"path": "myPointsOrder/myPointsOrder",
"style": {
"navigationBarTitleText": "我的订单",
"navigationStyle": "custom"
"navigationBarTitleText": "我的订单"
}
},
{

View File

@ -1,25 +1,28 @@
<template>
<view class="content">
<view class="container">
<view class="my-header">
<view class="my-icons" @click="goback"> <uni-icons type="left" size="16"></uni-icons> </view>
<view class="my-text">我的订单</view>
<view class="my-icons"></view>
</view>
<!-- 顶部区域 -->
<view class="tap-box">
<view class="box-tap" :class="{ 'act' :actinput == index }" v-for="(item,index) in taplist" :key="index"
@click="getindex(index)">
<view class="">{{item.title }}</view>
<view class="gang" v-if="actinput == index"></view>
<!-- <view class="gang" v-if="actinput == index"></view> -->
</view>
</view>
<u-empty text="积分订单" v-if="orderList.length == 0" icon="http://cdn.uviewui.com/uview/empty/list.png">
</u-empty>
<view class="box_f">
<view class="box_top">
<view class="">订单号xxxxxxxxxxxxxxxxxxxx</view>
<view class="">未使用</view>
</view>
<view class="box_cont"></view>
</view>
<view class="goods-box" v-for="(item,index) in orderList" :key="item.id" @click="orderDetails(item)">
<!-- <view class="goods-box" v-for="(item,index) in orderList" :key="item.id" @click="orderDetails(item)">
<view class="goods-top">
<view class="goods-img">
<image :src="baseUrl+item.coverImage" mode="aspectFit"></image>
@ -42,17 +45,8 @@
<text>确认收货</text>
</view>
</view>
<!-- <view class="goods-bottom" v-if="actinput == 2 ">
<view class="sh-anniu" @click="refund()">
<text>点击退款</text>
</view>
</view> -->
<!-- <view class="goods-bottom" v-if="actinput == 3 ">
<view class="sh-anniu" @click="payment()">
<text>去付款</text>
</view>
</view> -->
</view>
</view> -->
<u-empty v-if="arrList.length == 0" mode="list" icon="http://cdn.uviewui.com/uview/empty/list.png">
</u-empty>
@ -81,17 +75,12 @@
title: '全部'
},
{
title: '待收货'
title: '未使用'
},
{
title: '已完成'
},
// {
// title: '退'
// },
// {
// title: ''
// },
],
@ -103,7 +92,7 @@
},
onShow() {
this.getIntegralOrderList()
// this.getIntegralOrderList()
},
methods: {
getindex(index) {
@ -185,56 +174,41 @@
.container {
width: 100%;
height: 100%;
height: 100vh;
box-sizing: border-box;
padding-top: 88px;
background: #f4f5f6;
}
.my-header {
width: 100%;
height: 88px;
background: #ffffff;
display: flex;
align-items: center;
justify-content: space-between;
color: #000;
box-sizing: border-box;
padding: 0px 15px;
padding-top: 40px;
.my-icons {
width: 20px;
}
position: fixed;
top: 0px;
}
.tap-box {
width: 100%;
height: 50px;
height: 30px;
display: flex;
align-items: center;
justify-content: space-around;
background-color: #ffffff;
}
.box-tap {
width: 20%;
width: 15%;
text-align: center;
height: 100%;
border-bottom: 2px solid transparent;
}
.act {
color: #2979ff;
color: #FA6400;
border-bottom: 2px solid #FA6400 !important;
font-weight: bold;
}
.gang {
width: 25px;
height: 5px;
background-color: #2979ff;
background-color: #FA6400;
border-radius: 8px;
margin: 2px auto;
}
@ -313,7 +287,24 @@
box-sizing: border-box;
padding: 5px 10px;
border-radius: 50px;
border: 1px solid #2979ff;
color: #2979ff;
border: 1px solid #FA6400;
color: #FA6400;
}
.box_f {
width: 95%;
border-radius: 8px;
background: #ffffff;
margin: 15px auto;
}
.box_top {
width: 100%;
box-sizing: border-box;
padding: 10px;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 14px;
}
</style>