Merge remote-tracking branch 'origin/main'

This commit is contained in:
DESKTOP-369JRHT\12997 2024-10-08 17:58:53 +08:00
commit b5063a59fd
5 changed files with 322 additions and 203 deletions

View File

@ -1,87 +1,90 @@
<template> <template>
<div class="app-conr"> <div class="app-conr">
<div class="tab-box"> <div class="tab-box">
<div class="f-box" v-for="(item,index) in tablist" :key="index" @click="activeindex=index" :class="{ 'active' :activeindex==index}">{{item.name}}</div> <div class="f-box" v-for="(item,index) in tablist" :key="index" @click="activeindex=index"
</div> :class="{ 'active' :activeindex==index}">{{ item.name }}
<div class="cor">
<div class="bai-box" v-if="activeindex == 0">
<div class="qizhi">
<div class="left-icon">i</div>
<div>
<div class="bigsize">每日积分签到</div>
<div class="smallsize">签到规则为连续签到如中途漏签一天将重置从第一天开始</div>
</div> </div>
</div> </div>
<el-form :model="dataForm" ref="dataForm" :rules="rules" size="small" :inline="true" label-width="100px"> <div class="cor">
<el-row :gutter="24"> <div class="bai-box" v-if="activeindex == 0">
<el-col :span="15">
<el-form-item label="签到功能" prop="signInFunction" >
<el-radio-group v-model="dataForm.signInFunction">
<el-radio :label='0'>启用</el-radio>
<el-radio :label='1'>禁用</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :span="15">
<el-form-item label="适用规则" prop="" >
<el-radio-group v-model="dataForm.u">
<el-radio :label='0'>不限制</el-radio>
<el-radio :label='1'>按签到周期</el-radio>
</el-radio-group>
</el-form-item>
<el-select v-model="value" placeholder="请选择">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-col>
</el-row>
<div style="width: 100%; ">
<el-form-item style="width: 24%" v-for="(item,index) in dataForm.pointsObtained" :key="index" :prop="'pointsObtained' + index" :label="item.day"> <div class="qizhi">
<el-input v-model.number="item.integral" placeholder=""> <div class="left-icon">i</div>
<template slot="append">积分</template> <div>
</el-input> <div class="bigsize">每日积分签到</div>
</el-form-item> <div class="smallsize">签到规则为连续签到如中途漏签一天将重置从第一天开始</div>
</div>
</div>
<el-form :model="dataForm" ref="dataForm" :rules="rules" size="small" :inline="true" label-width="100px">
<el-row :gutter="24">
<el-col :span="15">
<el-form-item label="签到功能" prop="signInFunction">
<el-radio-group v-model="dataForm.signInFunction">
<el-radio :label='0'>启用</el-radio>
<el-radio :label='1'>禁用</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :span="15">
<el-form-item label="适用规则" prop="">
<el-radio-group v-model="dataForm.signApplicableRules" @input="applicableRules()">
<el-radio :label='0'>不限制</el-radio>
<el-radio :label='1'>按签到周期</el-radio>
</el-radio-group>
</el-form-item>
<el-select v-model="value" placeholder="请选择" @change="cycle()">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-col>
</el-row>
<div style="width: 100%; ">
<el-form-item style="width: 24%" v-for="(item,index) in dataForm.pointsObtained" :key="index"
:prop="'pointsObtained' + index" :label="item.day">
<el-input v-model.number="item.integral" placeholder="">
<template slot="append">积分</template>
</el-input>
</el-form-item>
</div>
<el-form-item label="签到规则" prop="signInRules">
<el-input :rows="3" style="width: 1600px;" type="textarea" v-model="dataForm.signInRules"></el-input>
</el-form-item>
</el-form>
<div style="width: 1600px; margin-top: 150px; display: flex;justify-content: center ">
<el-button type="primary" @click="submit">保存</el-button>
</div>
</div> </div>
<div class="bai-box" v-else>
<el-form-item label="签到规则" prop="signInRules" > <el-form :model="dataForm" ref="dataForm" :rules="rules" size="small" :inline="true" label-width="100px">
<el-input :rows="3" style="width: 1600px;" type="textarea" v-model="dataForm.signInRules"></el-input> <el-form-item label="积分说明" prop="desc">
<el-input type="textarea" v-model="dataForm.pointsRules" style="width: 1600px"></el-input>
</el-form-item> </el-form-item>
</el-form>
</el-form> <div style="width: 1600px; margin-top: 150px; display: flex;justify-content: center ">
<div style="width: 1600px; margin-top: 150px; display: flex;justify-content: center "> <el-button type="primary" @click="submit">保存</el-button>
<el-button type="primary" @click="submit" >保存</el-button> </div>
</div>
</div> </div>
</div> </div>
<div class="bai-box" v-else>
<el-form :model="dataForm" ref="dataForm" :rules="rules" size="small" :inline="true" label-width="100px">
<el-form-item label="积分说明" prop="desc">
<el-input type="textarea" v-model="dataForm.pointsRules" style="width: 1600px"></el-input>
</el-form-item>
</el-form>
<div style="width: 1600px; margin-top: 150px; display: flex;justify-content: center ">
<el-button type="primary" @click="submit" >保存</el-button>
</div>
</div>
</div>
</div>
</template> </template>
<script> <script>
import {getSettingsApi,updateSettingsApi } from "@/api/integral/settings"; import {getSettingsApi, updateSettingsApi} from "@/api/integral/settings";
import editor from '@/components/Editor/index' import editor from '@/components/Editor/index'
export default { export default {
@ -91,15 +94,15 @@ export default {
data() { data() {
var valiNumberPass = (rule, value, callback) => {// var valiNumberPass = (rule, value, callback) => {//
parseFloat(value).toFixed(2) parseFloat(value).toFixed(2)
let reg = /^[+-]?(0|([1-9]\d*))(\.\d+)?$/g; let reg = /^[+-]?(0|([1-9]\d*))(\.\d+)?$/g;
if (value === '') { if (value === '') {
callback(new Error('请输入内容')); callback(new Error('请输入内容'));
} else if (!reg.test(value)) { } else if (!reg.test(value)) {
callback(new Error('请输入数字')); callback(new Error('请输入数字'));
} else { } else {
callback(); callback();
} }
}; };
return { return {
tablist: [ tablist: [
{ {
@ -114,42 +117,42 @@ export default {
activeName: 'first', activeName: 'first',
rules:{ rules: {
desc: [ desc: [
{ required: true, message: '不能为空', trigger: 'blur' } {required: true, message: '不能为空', trigger: 'blur'}
], ],
refuelPointsRules:[ refuelPointsRules: [
{ required: true, message: '请选择积分规则', trigger: 'change' } {required: true, message: '请选择积分规则', trigger: 'change'}
], ],
refuelSceneType:[ refuelSceneType: [
{ required: true, message: '请选择场景类型', trigger: 'change' } {required: true, message: '请选择场景类型', trigger: 'change'}
], ],
refuelAmountType:[ refuelAmountType: [
{ required: true, message: '请选择金额类型', trigger: 'change' } {required: true, message: '请选择金额类型', trigger: 'change'}
], ],
refuelValueParticipation:[ refuelValueParticipation: [
{ required: true, message: '请选择储值参与', trigger: 'change' } {required: true, message: '请选择储值参与', trigger: 'change'}
], ],
refuelSceneRules:[ refuelSceneRules: [
{ required: true, message: '请选择场景规则', trigger: 'change' } {required: true, message: '请选择场景规则', trigger: 'change'}
], ],
refuelFuelAmount: [ refuelFuelAmount: [
{ required: true, validator:valiNumberPass, trigger: "blur" } {required: true, validator: valiNumberPass, trigger: "blur"}
], ],
refuelPoints: [ refuelPoints: [
{ required: true, message: '输入积分', trigger: "blur" }, {required: true, message: '输入积分', trigger: "blur"},
{ type: 'number', message: '积分必须为数字值'} {type: 'number', message: '积分必须为数字值'}
], ],
// amount:[ // amount:[
// {required: true, // {required: true,
// validator: (rule, value, callback) => this.valiNumberPass(rule, value, callback, 'amount'), // validator: (rule, value, callback) => this.valiNumberPass(rule, value, callback, 'amount'),
// trigger: 'blur' // trigger: 'blur'
// } // }
// ], // ],
rechargeGive:[ rechargeGive: [
{ required: true, message: '输入积分', trigger: "blur" }, {required: true, message: '输入积分', trigger: "blur"},
{ type: 'number', message: '积分必须为数字值'} {type: 'number', message: '积分必须为数字值'}
], ],
// points: [ // points: [
// { required: true} // { required: true}
@ -188,39 +191,43 @@ export default {
signInFunction: 0, signInFunction: 0,
// //
signInRules: '', signInRules: '',
//
signApplicableRules: 0,
//
signInCycle: 0,
// //
pointsObtained: [ pointsObtained: [
{ {
day:'第1天获得', day: '第1天获得',
integral:0, integral: 0,
}, },
{ {
day:'第2天获得', day: '第2天获得',
integral:0, integral: 0,
}, },
{ {
day:'第3天获得', day: '第3天获得',
integral:0, integral: 0,
}, },
{ {
day:'第4天获得', day: '第4天获得',
integral:0, integral: 0,
}, },
{ {
day:'第5天获得', day: '第5天获得',
integral:0, integral: 0,
}, },
{ {
day:'第6天获得', day: '第6天获得',
integral:0, integral: 0,
}, },
{ {
day:'第7天获得', day: '第7天获得',
integral:0, integral: 0,
}, },
{ {
day:'超8天获得', day: '超8天获得',
integral:0, integral: 0,
} }
], ],
@ -229,20 +236,14 @@ export default {
}, },
options: [{ options: [{
value: '选项1', value: 0,
label: '黄金糕' label: '一周'
}, { }, {
value: '选项2', value: 1,
label: '双皮奶' label: '两周'
}, { }, {
value: '选项3', value: 2,
label: '蚵仔煎' label: '一个月'
}, {
value: '选项4',
label: '龙须面'
}, {
value: '选项5',
label: '北京烤鸭'
}], }],
value: '' value: ''
@ -254,53 +255,123 @@ export default {
}, },
methods: { methods: {
handleChildValue(value) { handleChildValue(value) {
console.log("vale",value) console.log("vale", value)
this.dataForm.pointsRules = value this.dataForm.pointsRules = value
}, },
applicableRules() {
if (this.dataForm.signApplicableRules == 0) {
getData() { this.value = '',
let file = this.dataForm this.dataForm.pointsObtained = [
file.pointsObtained = JSON.stringify(file.pointsObtained); {
file.refuelConsumptionAmount = JSON.stringify(file.refuelConsumptionAmount); day: '每天获得',
integral: 0,
getSettingsApi(this.dataForm).then(res=>{ }]
this.dataForm = res.data } else if (this.dataForm.signApplicableRules == 1) {
this.dataForm.pointsObtained = JSON.parse(this.dataForm.pointsObtained) this.value = 0
this.dataForm.refuelConsumptionAmount = JSON.parse(res.data.refuelConsumptionAmount) this.getRules(7)
}) // this.dataForm.pointsObtained=[
}, // {
submit() { // day:'1',
let file = this.dataForm // integral:0,
// console.log() // },
file.pointsObtained = JSON.stringify(file.pointsObtained); // {
file.refuelConsumptionAmount = JSON.stringify(file.refuelConsumptionAmount); // day:'2',
this.dataForm = {} // integral:0,
updateSettingsApi(file).then(res=>{ // },
this.$modal.msgSuccess("添加成功"); // {
this.dataForm = {} // day:'3',
res.data.pointsObtained = JSON.parse(res.data.pointsObtained) // integral:0,
res.data.refuelConsumptionAmount = JSON.parse(res.data.refuelConsumptionAmount) // },
this.dataForm = res.data // {
}).catch(res=>{ // day:'4',
this.$modal.msgSuccess("添加失败"); // integral:0,
// },
}) // {
// this.getData() // day:'5',
// }
}, // ]
cancel() {},
handleClick(tab, event) {
console.log(tab, event);
} }
}, },
cycle() {
valiNumberPass(rule, value, callback, fieldName) { if (this.value == 0) {
this.$nextTick(() => { this.getRules(7)
// value } else if (this.value == 1) {
console.log(`Validating ${fieldName}:`, value); this.getRules(14)
}); } else if (this.value == 2) {
this.getRules(30)
}
}, },
getRules(length){
this.dataForm.pointsObtained = []
for (let i = 0; i < length; i++) {
let obj = {
day: '第' + (i + 1) + '天获得',
integral: 0,
}
this.dataForm.pointsObtained.push(obj)
}
},
getData() {
let file = this.dataForm
file.pointsObtained = JSON.stringify(file.pointsObtained);
file.refuelConsumptionAmount = JSON.stringify(file.refuelConsumptionAmount);
getSettingsApi(this.dataForm).then(res => {
this.dataForm = res.data
this.dataForm.pointsObtained = JSON.parse(this.dataForm.pointsObtained)
this.dataForm.refuelConsumptionAmount = JSON.parse(res.data.refuelConsumptionAmount)
if (this.dataForm.signCycle == 3) {
this.value = ''
}else {
this.value = this.dataForm.signCycle
}
console.log("value", this.value)
console.log("this.dataForm", this.dataForm)
})
},
submit() {
let file = this.dataForm
// console.log()
file.pointsObtained = JSON.stringify(file.pointsObtained);
file.refuelConsumptionAmount = JSON.stringify(file.refuelConsumptionAmount);
file.signCycle = this.value
this.dataForm = {}
if (this.value === '') {
file.signCycle = 3
}
console.log("file", file)
// updateSettingsApi(file).then(res => {
// this.$modal.msgSuccess("");
// this.dataForm = {}
// res.data.pointsObtained = JSON.parse(res.data.pointsObtained)
// res.data.refuelConsumptionAmount = JSON.parse(res.data.refuelConsumptionAmount)
// this.dataForm = res.data
// }).catch(res => {
// this.$modal.msgSuccess("");
//
// })
this.getData()
},
cancel() {
},
handleClick(tab, event) {
console.log(tab, event);
}
}
,
valiNumberPass(rule, value, callback, fieldName)
{
this.$nextTick(() => {
// value
console.log(`Validating ${fieldName}:`, value);
});
}
,
} }
@ -308,29 +379,31 @@ export default {
<style scoped lang="scss"> <style scoped lang="scss">
.app-container{ .app-container {
width: 100%; width: 100%;
height: 100%; height: 100%;
background: #f6f8f9; background: #f6f8f9;
} }
.conten-bottom{
box-sizing: border-box; .conten-bottom {
padding: 20px 20px; box-sizing: border-box;
display: flex; padding: 20px 20px;
flex-wrap: wrap; display: flex;
} flex-wrap: wrap;
.cardbox{ }
margin-right: 20px;
margin-bottom: 20px; .cardbox {
box-sizing: border-box; margin-right: 20px;
padding: 10px; margin-bottom: 20px;
border-radius: 10px; box-sizing: border-box;
width: 23%; padding: 10px;
height: 150px; border-radius: 10px;
background-size:40% 70%; width: 23%;
background-color: #f9f9f9; height: 150px;
border: 1px solid rgb(196, 196, 196) background-size: 40% 70%;
} background-color: #f9f9f9;
border: 1px solid rgb(196, 196, 196)
}
.tab-box { .tab-box {
width: 100%; width: 100%;
@ -363,31 +436,35 @@ export default {
.tabder-box { .tabder-box {
width: 85%; width: 85%;
} }
.cor{
.cor {
box-sizing: border-box; box-sizing: border-box;
padding: 15px; padding: 15px;
background: #f9f9f9; background: #f9f9f9;
} }
.bai-box{
.bai-box {
border-radius: 10px; border-radius: 10px;
background: #fff; background: #fff;
box-sizing: border-box; box-sizing: border-box;
padding: 10px; padding: 10px;
height: 85vh; height: 85vh;
} }
.qizhi{
.qizhi {
width: 100%; width: 100%;
border-radius: 8px; border-radius: 8px;
padding: 20px; padding: 20px;
color: #FF9655; color: #FF9655;
font-size: 16px; font-size: 16px;
background: rgba(255,150,85,0.15); background: rgba(255, 150, 85, 0.15);
align-items: center; align-items: center;
display: flex; display: flex;
margin-bottom: 30px; margin-bottom: 30px;
} }
.left-icon{
.left-icon {
width: 45px; width: 45px;
height: 45px; height: 45px;
border-radius: 50%; border-radius: 50%;
@ -400,7 +477,8 @@ export default {
font-weight: bold; font-weight: bold;
margin-right: 25px; margin-right: 25px;
} }
.bigsize{
.bigsize {
font-size: 24px; font-size: 24px;
margin-bottom: 15px; margin-bottom: 15px;
} }

View File

@ -133,7 +133,7 @@
<!--查询指定行数据--> <!--查询指定行数据-->
<select id="getSettings" resultMap="IntegralSettingsMap"> <select id="getSettings" resultMap="IntegralSettingsMap">
select select
id, refuel_points_rules, refuel_points_function, refuel_scene_type, refuel_amount_type, refuel_value_participation, refuel_scene_rules, refuel_consumption_amount, refuel_points, refuel_fuel_amount, refuel_fuel_volume, recharge_give, invite_give, invite_give_rules, sign_in_function, sign_in_rules, points_obtained, points_rules, store_id, create_by, update_by id, refuel_points_rules, refuel_points_function, refuel_scene_type, refuel_amount_type, refuel_value_participation, refuel_scene_rules, refuel_consumption_amount, refuel_points, refuel_fuel_amount, refuel_fuel_volume, recharge_give, invite_give, invite_give_rules, sign_in_function, sign_in_rules, points_obtained, points_rules, store_id, create_by, update_by, sign_applicable_rules, sign_cycle
from integral_settings from integral_settings
<where> <where>
store_id = #{integralSettings.storeId} store_id = #{integralSettings.storeId}

View File

@ -324,4 +324,15 @@ public class AllOrderInfoController extends BaseController {
IPage<AllOrderInfoUniVo> iPageList = this.allOrderInfoService.queryByPageUni(page, allOrderInfo); IPage<AllOrderInfoUniVo> iPageList = this.allOrderInfoService.queryByPageUni(page, allOrderInfo);
return getSuccessResult(iPageList); return getSuccessResult(iPageList);
} }
/**
* 根据订单号查询小程序
*
* @param orderNo
* @return
*/
@GetMapping("queryByOrderNo")
public ResponseObject queryByOrderNo(String orderNo){
return getSuccessResult(allOrderInfoService.queryByOrderNo(orderNo));
}
} }

View File

@ -164,4 +164,10 @@ public interface AllOrderInfoService {
// 根据订单id 查询订单 并且有且只有一个关联油品订单 // 根据订单id 查询订单 并且有且只有一个关联油品订单
AllOrderActivityVo getOneByOrderId(Integer orderId); AllOrderActivityVo getOneByOrderId(Integer orderId);
/**
* 根据订单号查询小程序
* @param orderNo
* @return
*/
AllOrderInfoUniVo queryByOrderNo(String orderNo);
} }

View File

@ -1,9 +1,11 @@
package com.fuint.business.order.service.impl; package com.fuint.business.order.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.alibaba.excel.EasyExcel; import com.alibaba.excel.EasyExcel;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -85,6 +87,7 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper, All
@Resource @Resource
AllOrderInfoMapper allOrderInfoMapper; AllOrderInfoMapper allOrderInfoMapper;
@Override @Override
public IPage<AllOrderInfoVo> getPageList(Page page, AllOrderInfo allOrderInfo) { public IPage<AllOrderInfoVo> getPageList(Page page, AllOrderInfo allOrderInfo) {
IPage<AllOrderInfoVo> pageList = allOrderInfoMapper.getPageList(page, allOrderInfo); IPage<AllOrderInfoVo> pageList = allOrderInfoMapper.getPageList(page, allOrderInfo);
@ -1682,6 +1685,27 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper, All
return allOrderInfoVo; return allOrderInfoVo;
} }
/**
* 根据订单号查询小程序
*
* @param orderNo
* @return
*/
@Override
public AllOrderInfoUniVo queryByOrderNo(String orderNo) {
AllOrderInfo allOrderInfo = allOrderInfoMapper.selectOne(new LambdaQueryWrapper<AllOrderInfo>()
.eq(AllOrderInfo::getOrderNo, orderNo));
if (ObjectUtil.isNotEmpty(allOrderInfo)) {
AllOrderInfoUniVo allOrderInfoUniVo = new AllOrderInfoUniVo();
BeanUtil.copyProperties(allOrderInfo, allOrderInfoUniVo);
MtStore mtStore = mtStoreMapper.selectOne(new LambdaQueryWrapper<MtStore>()
.eq(MtStore::getId, allOrderInfo.getStoreId()));
allOrderInfoUniVo.setStoreName(mtStore.getName());
return allOrderInfoUniVo;
}
return null;
}
private long dayCount(String beginTimeStr, String endTimeStr) { private long dayCount(String beginTimeStr, String endTimeStr) {
// 将字符串表示的时间转换成 LocalDate 对象 // 将字符串表示的时间转换成 LocalDate 对象