囤油锁价

This commit is contained in:
齐天大圣 2024-05-11 13:53:47 +08:00
parent 29e40a4132
commit d4b8578e73
10 changed files with 361 additions and 20 deletions

View File

@ -48,6 +48,7 @@ public class CardValueRecord extends Model<CardValueRecord> {
private Double rechargeBalance; private Double rechargeBalance;
//储值卡赠送金额 //储值卡赠送金额
private Double giftBalance; private Double giftBalance;
private Double lockupPrice;
//积分 //积分
private Integer points; private Integer points;
//成长值 //成长值

View File

@ -76,7 +76,7 @@
create_time createTime, chain_store_id chainStoreId, store_id storeId,pay_status payStatus,update_time expireTime FROM card_value_record create_time createTime, chain_store_id chainStoreId, store_id storeId,pay_status payStatus,update_time expireTime FROM card_value_record
UNION UNION
SELECT '囤油卡' AS recordName,payment_type paymentType,mt_user_id mtUserId, recharge_balance rechargeBalance, SELECT '囤油卡' AS recordName,payment_type paymentType,mt_user_id mtUserId, recharge_balance rechargeBalance,
income_litres obtain,oil_name oilName,type, create_time createTime, chain_store_id chainStoreId, lockup_price obtain,oil_name oilName,type, create_time createTime, chain_store_id chainStoreId,
store_id storeId,pay_status payStatus,expire_time expireTime FROM card_fuel_record store_id storeId,pay_status payStatus,expire_time expireTime FROM card_fuel_record
UNION UNION
SELECT '储值卡' AS recordName, SELECT '储值卡' AS recordName,

View File

@ -0,0 +1,92 @@
package com.fuint.business.marketingActivity.favorableRecords.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.marketingActivity.cardValueOrders.entity.CardValueOrders;
import com.fuint.business.marketingActivity.favorableRecords.entity.FavorableRecords;
import com.fuint.business.marketingActivity.favorableRecords.service.FavorableRecordsService;
import com.fuint.framework.web.BaseController;
import com.fuint.framework.web.ResponseObject;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.io.Serializable;
import java.util.List;
/**
* 优惠记录表(FavorableRecords)表控制层
*
* @author makejava
* @since 2024-05-11 11:19:34
*/
@RestController
@RequestMapping("business/marketingActivity/favorableRecords")
public class FavorableRecordsController extends BaseController {
/**
* 服务对象
*/
@Resource
private FavorableRecordsService favorableRecordsService;
/**
* 分页查询所有数据
* @param pageNo
* @param pageSize
* @param favorableRecords
* @return
*/
@GetMapping
public ResponseObject selectAll(@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize,
@Param("cardValueOrders") FavorableRecords favorableRecords) {
Page page = new Page(pageNo, pageSize);
return getSuccessResult(this.favorableRecordsService.selectList(page, favorableRecords));
}
/**
* 通过主键查询单条数据
*
* @param id 主键
* @return 单条数据
*/
@GetMapping("{id}")
public ResponseObject selectOne(@PathVariable Serializable id) {
return getSuccessResult(this.favorableRecordsService.getById(id));
}
/**
* 新增数据
*
* @param favorableRecords 实体对象
* @return 新增结果
*/
@PostMapping
public ResponseObject insert(@RequestBody FavorableRecords favorableRecords) {
return getSuccessResult(this.favorableRecordsService.insert(favorableRecords));
}
/**
* 修改数据
*
* @param favorableRecords 实体对象
* @return 修改结果
*/
@PutMapping
public ResponseObject update(@RequestBody FavorableRecords favorableRecords) {
return getSuccessResult(this.favorableRecordsService.updateById(favorableRecords));
}
/**
* 删除数据
*
* @param idList 主键结合
* @return 删除结果
*/
@DeleteMapping
public ResponseObject delete(@RequestParam("idList") List<Long> idList) {
return getSuccessResult(this.favorableRecordsService.removeByIds(idList));
}
}

View File

@ -0,0 +1,140 @@
package com.fuint.business.marketingActivity.favorableRecords.entity;
import java.util.Date;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;
import java.io.Serializable;
/**
* 优惠记录表(FavorableRecords)表实体类
*
* @author makejava
* @since 2024-05-11 11:19:34
*/
@SuppressWarnings("serial")
@Data
public class FavorableRecords extends Model<FavorableRecords> {
//主键id
private Integer id;
//所属连锁店id
private Integer chainStoreId;
//所属店铺id
private Integer storeId;
//优惠类型
private String favType;
//优惠来源
private String favFrom;
//优惠金额
private Double favMoney;
//消费类型
private String favConsumptionType;
//创建者
private String createBy;
//创建时间
private Date createTime;
//更新者
private String updateBy;
//更新时间
private Date updateTime;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getChainStoreId() {
return chainStoreId;
}
public void setChainStoreId(Integer chainStoreId) {
this.chainStoreId = chainStoreId;
}
public Integer getStoreId() {
return storeId;
}
public void setStoreId(Integer storeId) {
this.storeId = storeId;
}
public String getFavType() {
return favType;
}
public void setFavType(String favType) {
this.favType = favType;
}
public String getFavFrom() {
return favFrom;
}
public void setFavFrom(String favFrom) {
this.favFrom = favFrom;
}
public Double getFavMoney() {
return favMoney;
}
public void setFavMoney(Double favMoney) {
this.favMoney = favMoney;
}
public String getFavConsumptionType() {
return favConsumptionType;
}
public void setFavConsumptionType(String favConsumptionType) {
this.favConsumptionType = favConsumptionType;
}
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public String getUpdateBy() {
return updateBy;
}
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
/**
* 获取主键值
*
* @return 主键值
*/
@Override
protected Serializable pkVal() {
return this.id;
}
}

View File

@ -0,0 +1,15 @@
package com.fuint.business.marketingActivity.favorableRecords.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.fuint.business.marketingActivity.favorableRecords.entity.FavorableRecords;
/**
* 优惠记录表(FavorableRecords)表数据库访问层
*
* @author makejava
* @since 2024-05-11 11:19:34
*/
public interface FavorableRecordsMapper extends BaseMapper<FavorableRecords> {
}

View File

@ -0,0 +1,20 @@
package com.fuint.business.marketingActivity.favorableRecords.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.favorableRecords.entity.FavorableRecords;
/**
* 优惠记录表(FavorableRecords)表服务接口
*
* @author makejava
* @since 2024-05-11 11:19:34
*/
public interface FavorableRecordsService extends IService<FavorableRecords> {
boolean insert(FavorableRecords favorableRecords);
IPage selectList(Page page, FavorableRecords favorableRecords);
}

View File

@ -0,0 +1,44 @@
package com.fuint.business.marketingActivity.favorableRecords.service.impl;
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.favorableRecords.mapper.FavorableRecordsMapper;
import com.fuint.business.marketingActivity.favorableRecords.entity.FavorableRecords;
import com.fuint.business.marketingActivity.favorableRecords.service.FavorableRecordsService;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil;
import org.springframework.stereotype.Service;
/**
* 优惠记录表(FavorableRecords)表服务实现类
*
* @author makejava
* @since 2024-05-11 11:19:34
*/
@Service("favorableRecordsService")
public class FavorableRecordsServiceImpl extends ServiceImpl<FavorableRecordsMapper, FavorableRecords> implements FavorableRecordsService {
@Override
public boolean insert(FavorableRecords favorableRecords) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
favorableRecords.setStoreId(nowAccountInfo.getStoreId());
favorableRecords.setChainStoreId(nowAccountInfo.getChainStoreId());
return save(favorableRecords);
}
@Override
public IPage selectList(Page page, FavorableRecords favorableRecords) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
LambdaQueryWrapper<FavorableRecords> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(FavorableRecords::getStoreId, nowAccountInfo.getStoreId());
queryWrapper.eq(FavorableRecords::getChainStoreId, nowAccountInfo.getChainStoreId());
queryWrapper.eq(FavorableRecords::getFavFrom, favorableRecords.getFavFrom());
queryWrapper.eq(FavorableRecords::getFavType, favorableRecords.getFavType());
queryWrapper.eq(FavorableRecords::getFavConsumptionType, favorableRecords.getFavConsumptionType());
IPage page1 = page(page, queryWrapper);
return page1;
}
}

View File

@ -31,8 +31,8 @@
</view> </view>
<text style="color: #999999;">|</text> <text style="color: #999999;">|</text>
<view class="jg-box" @click="goOil()"> <view class="jg-box" @click="goOil()">
<view class="jg-box-title">囤油升</view> <view class="jg-box-title">锁价次</view>
<view class="jg-box-nmb">{{refuelMoney[0].refuelMoney || 0 }}L</view> <view class="jg-box-nmb">{{countList.length || 0 }}</view>
</view> </view>
<text style="color: #999999;">|</text> <text style="color: #999999;">|</text>
@ -175,6 +175,15 @@
pageNo: 1, pageNo: 1,
pageSize: 10 pageSize: 10
}, },
querys: {
mtUserId: '',
storeId: '',
chainStoreId: '',
recordName: '囤油卡',
pageNo: 1,
pageSize: 100
},
countList: [],
myPoints: 0, myPoints: 0,
cardsList: [], cardsList: [],
refuelMoney: [], refuelMoney: [],
@ -196,11 +205,31 @@
this.getUser() this.getUser()
this.query.storeId = uni.getStorageSync("storeId") this.query.storeId = uni.getStorageSync("storeId")
this.query.chainStoreId = uni.getStorageSync('chainStoreId') this.query.chainStoreId = uni.getStorageSync('chainStoreId')
this.querys.storeId = uni.getStorageSync("storeId")
this.querys.chainStoreId = uni.getStorageSync('chainStoreId')
this.getUserBalance(); this.getUserBalance();
this.getGiftRecords(); this.getGiftRecords();
this.getStore(uni.getStorageSync("storeId")); this.getStore(uni.getStorageSync("storeId"));
this.getAllOrderList();
}, },
methods: { methods: {
//
getAllOrderList() {
request({
url: 'business/marketingActivity/cardValueRecord/selectAllRecord',
method: 'get',
params: this.querys
}).then((res) => {
if (res.code == 200) {
this.countList = res.data.records
this.totalDetail = res.data.total
this.show = false
uni.hideLoading();
}
})
},
// //
getStore(id) { getStore(id) {
let _this = this; let _this = this;

View File

@ -31,8 +31,8 @@
<view class="reds">{{item.obtain}}</view> <view class="reds">{{item.obtain}}</view>
</view> </view>
<view class="but-box" v-else> <view class="but-box" v-else>
<view class="huis">所得升数</view> <view class="huis">锁价单价</view>
<view class="reds">{{item.obtain}}L</view> <view class="reds">{{item.obtain}}/L</view>
</view> </view>
<view class="but-box"> <view class="but-box">
<view class="huis">订单时间</view> <view class="huis">订单时间</view>

View File

@ -36,7 +36,7 @@
</view> </view>
<view class="y-bt"> <view class="y-bt">
<view class="sizehui">油品名称</view> <view class="sizehui">油品名称</view>
<view class="sizehei">{{item.type}}</view> <view class="sizehei">{{item.type}}:{{item.oilName}}</view>
</view> </view>
<!-- <view class="y-bt"> <!-- <view class="y-bt">
<view class="sizehui">油品名称</view> <view class="sizehui">油品名称</view>
@ -47,8 +47,8 @@
<view class="sizehei">{{item.rechargeBalance}}</view> <view class="sizehei">{{item.rechargeBalance}}</view>
</view> </view>
<view class="y-bt"> <view class="y-bt">
<view class="sizehui">所得升数</view> <view class="sizehui">锁价单价</view>
<view class="sizehong">{{item.obtain}}L</view> <view class="sizehong">{{item.obtain}}/L</view>
</view> </view>
<view class="y-bt"> <view class="y-bt">
<view class="sizehui">订单时间</view> <view class="sizehui">订单时间</view>