bug修改
This commit is contained in:
parent
a3ed2f8b2d
commit
3f857268a6
@ -340,7 +340,8 @@ import {cleanTankApi} from "@/api/oilConfig/oilTank";
|
|||||||
}
|
}
|
||||||
.cardboxb{
|
.cardboxb{
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 50px;
|
/*width: 50px;*/
|
||||||
|
width: auto;
|
||||||
height: 20px;
|
height: 20px;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@ -349,6 +350,7 @@ import {cleanTankApi} from "@/api/oilConfig/oilTank";
|
|||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
left: 0px;
|
left: 0px;
|
||||||
bottom: 0px;
|
bottom: 0px;
|
||||||
|
padding-right: 5px;
|
||||||
background: #409eff;
|
background: #409eff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,23 +44,27 @@
|
|||||||
<el-table-column
|
<el-table-column
|
||||||
prop="presetId"
|
prop="presetId"
|
||||||
label="任务id"
|
label="任务id"
|
||||||
|
align="center"
|
||||||
width="100">
|
width="100">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<!-- prop="presetGbPrice"-->
|
<!-- prop="presetGbPrice"-->
|
||||||
|
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="oilNameT"
|
prop="oilNameT"
|
||||||
|
align="center"
|
||||||
label="预设油号"
|
label="预设油号"
|
||||||
>
|
>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="当前数据" style="width: 100%">
|
<el-table-column label="当前数据" style="width: 100%">
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="currentPetrolPrices"
|
prop="currentPetrolPrices"
|
||||||
|
align="center"
|
||||||
label="油站价"
|
label="油站价"
|
||||||
>
|
>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="presetOilPrices"
|
prop="presetOilPrices"
|
||||||
|
align="center"
|
||||||
label="国标价"
|
label="国标价"
|
||||||
>
|
>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@ -68,17 +72,20 @@
|
|||||||
<el-table-column label="预设新数据" style="width: 100%">
|
<el-table-column label="预设新数据" style="width: 100%">
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="currentPetrolPrices"
|
prop="currentPetrolPrices"
|
||||||
|
align="center"
|
||||||
label="油站价"
|
label="油站价"
|
||||||
>
|
>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="presetGbPrice"
|
prop="presetGbPrice"
|
||||||
|
align="center"
|
||||||
label="国标价"
|
label="国标价"
|
||||||
>
|
>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="effectiveTime"
|
prop="effectiveTime"
|
||||||
|
align="center"
|
||||||
label="预设时间"
|
label="预设时间"
|
||||||
>
|
>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@ -87,30 +94,33 @@
|
|||||||
<!-- label="处理状态"-->
|
<!-- label="处理状态"-->
|
||||||
<!-- >-->
|
<!-- >-->
|
||||||
|
|
||||||
<el-table-column label="状态">
|
<el-table-column label="状态" align="center">
|
||||||
<!-- <template slot-scope="scope">-->
|
|
||||||
<!-- {{ getStatusText(scope.row.state) }}-->
|
|
||||||
<!-- </template>-->
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<dict-tag :options="dict.type.jobState" :value="scope.row.state"/>
|
<!-- <dict-tag :options="dict.type.jobState" :value="scope.row.state"/>-->
|
||||||
|
<el-tag v-if="scope.row.state == 'occur'" type="success">已生效</el-tag>
|
||||||
|
<el-tag v-else-if="scope.row.state == 'wait'">等待中</el-tag>
|
||||||
|
<el-tag v-else type="info">已失效</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="createTime"
|
prop="createTime"
|
||||||
|
align="center"
|
||||||
label="创建时间"
|
label="创建时间"
|
||||||
>
|
>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
fixed="right"
|
fixed="right"
|
||||||
|
align="center"
|
||||||
label="操作"
|
label="操作"
|
||||||
width="120">
|
width="120">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button v-if="scope.row.state == 'wait'"
|
||||||
@click.native.prevent="deleteRow(scope.$index, scope.row)"
|
@click.native.prevent="deleteRow(scope.$index, scope.row)"
|
||||||
type="text"
|
type="text"
|
||||||
size="small">
|
size="small">
|
||||||
停止
|
停止
|
||||||
</el-button>
|
</el-button>
|
||||||
|
<span v-else> -- </span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
@ -336,6 +346,8 @@
|
|||||||
type="datetime"
|
type="datetime"
|
||||||
placeholder="选择日期时间"
|
placeholder="选择日期时间"
|
||||||
style="width: 217px"
|
style="width: 217px"
|
||||||
|
:default-value="defaultDateTime"
|
||||||
|
:picker-options="pickerOptions"
|
||||||
value-format="yyyy-MM-dd HH:mm:ss">
|
value-format="yyyy-MM-dd HH:mm:ss">
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -383,7 +395,13 @@ import {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
||||||
|
defaultDateTime: new Date(), // 默认时间
|
||||||
|
pickerOptions: {
|
||||||
|
disabledDate(time) {
|
||||||
|
// 限制选择范围为当前时间之后
|
||||||
|
return time.getTime() < Date.now();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
oilPresetPricesRules: {
|
oilPresetPricesRules: {
|
||||||
numberId:[
|
numberId:[
|
||||||
@ -472,7 +490,8 @@ import {
|
|||||||
presetGbPrice:null ,
|
presetGbPrice:null ,
|
||||||
createTime:'',
|
createTime:'',
|
||||||
updateTime:'',
|
updateTime:'',
|
||||||
effectiveTime:null,
|
// effectiveTime:new date(),
|
||||||
|
effectiveTime:'',
|
||||||
ifDelete:'',
|
ifDelete:'',
|
||||||
numberId:'',
|
numberId:'',
|
||||||
},
|
},
|
||||||
|
@ -150,7 +150,17 @@
|
|||||||
:value="option.id"
|
:value="option.id"
|
||||||
></el-option>
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
|
<!-- :title="'该油罐总容量'+tankVolume+unit+',可用约'+canUseVolume+unit+ '-- 可用约'+canUseT+'吨'"-->
|
||||||
|
|
||||||
|
<el-alert
|
||||||
|
v-if="orderForm.tankId"
|
||||||
|
style="height: 25px;line-height: 16px;"
|
||||||
|
:title='tTitle'
|
||||||
|
type="warning"
|
||||||
|
:closable="false">
|
||||||
|
</el-alert>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="24">
|
<el-row :gutter="24">
|
||||||
@ -170,7 +180,7 @@
|
|||||||
<el-row :gutter="24">
|
<el-row :gutter="24">
|
||||||
<el-col :span="22">
|
<el-col :span="22">
|
||||||
<el-form-item label="油品密度" prop="productDensity">
|
<el-form-item label="油品密度" prop="productDensity">
|
||||||
<el-input v-model.number="orderForm.productDensity" placeholder="请输入油品密度" >
|
<el-input v-model="orderForm.productDensity" placeholder="请输入油品密度" >
|
||||||
<template slot="append">g/ml</template>
|
<template slot="append">g/ml</template>
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -179,7 +189,7 @@
|
|||||||
<el-row :gutter="24">
|
<el-row :gutter="24">
|
||||||
<el-col :span="22">
|
<el-col :span="22">
|
||||||
<el-form-item label="采购吨数" prop="purchaseWeight">
|
<el-form-item label="采购吨数" prop="purchaseWeight">
|
||||||
<el-input v-model.number="orderForm.purchaseWeight" placeholder="请输入采购吨数" >
|
<el-input v-model="orderForm.purchaseWeight" placeholder="请输入采购吨数" @input="inputPurchaseWeight()">
|
||||||
<template slot="append">吨</template>
|
<template slot="append">吨</template>
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -188,7 +198,7 @@
|
|||||||
<el-row :gutter="24">
|
<el-row :gutter="24">
|
||||||
<el-col :span="22">
|
<el-col :span="22">
|
||||||
<el-form-item label="采购单价" prop="purchasePrice">
|
<el-form-item label="采购单价" prop="purchasePrice">
|
||||||
<el-input v-model.number="orderForm.purchasePrice" placeholder="请输入采购单价" >
|
<el-input v-model="orderForm.purchasePrice" placeholder="请输入采购单价" >
|
||||||
<template slot="append">元/吨</template>
|
<template slot="append">元/吨</template>
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -222,7 +232,18 @@ import {getAuditPremApi} from "@/api/oilConfig/staff";
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "purchaseOrder",
|
name: "purchaseOrder",
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
|
var valiNumberPass = (rule, value, callback) => {//包含小数的数字
|
||||||
|
let reg = /^[+-]?(0|([1-9]\d*))(\.\d{1,2})?$/;
|
||||||
|
if (value === '') {
|
||||||
|
callback(new Error('请输入内容'));
|
||||||
|
} else if (!reg.test(value)) {
|
||||||
|
callback(new Error('请输入数字,最多保留两位小数'));
|
||||||
|
} else {
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
};
|
||||||
return {
|
return {
|
||||||
orderList:[],
|
orderList:[],
|
||||||
orderForm:{
|
orderForm:{
|
||||||
@ -240,6 +261,16 @@ export default {
|
|||||||
preInboundInventory: null,
|
preInboundInventory: null,
|
||||||
discountedPrice: null
|
discountedPrice: null
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 油罐文字提示
|
||||||
|
tankVolume: 0, // 总升数
|
||||||
|
nowVolume: 0, // 现有升数
|
||||||
|
canUseVolume: 0,// 可用升数
|
||||||
|
canUseT: 0,//吨数计算
|
||||||
|
unit:'L',//单位
|
||||||
|
// tTitle:'',
|
||||||
|
|
||||||
|
|
||||||
purchaseId: null,
|
purchaseId: null,
|
||||||
numberInput: false,
|
numberInput: false,
|
||||||
|
|
||||||
@ -289,17 +320,13 @@ export default {
|
|||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
productDensity: [
|
productDensity: [
|
||||||
{required: true, message: "密度不能为空", trigger: "blur"},
|
{ required: true, validator:valiNumberPass, trigger: "blur" }
|
||||||
{ type: 'number', message: '价格必须为数字值'}
|
|
||||||
],
|
],
|
||||||
purchaseWeight: [
|
purchaseWeight: [
|
||||||
{required: true, message: "重量不能为空", trigger: "blur"},
|
{ required: true, validator:valiNumberPass, trigger: "blur" },
|
||||||
{ type: 'number', message: '价格必须为数字值'}
|
|
||||||
],
|
],
|
||||||
purchasePrice: [
|
purchasePrice: [
|
||||||
{required: true, message: "价格不能为空", trigger: "blur"},
|
{ required: true, validator:valiNumberPass, trigger: "blur" }
|
||||||
{ type: 'number', message: '价格必须为数字值'}
|
|
||||||
|
|
||||||
],
|
],
|
||||||
numberId: [
|
numberId: [
|
||||||
{required: true, message: "请选择采购油品", trigger: "blur"}
|
{required: true, message: "请选择采购油品", trigger: "blur"}
|
||||||
@ -377,12 +404,17 @@ export default {
|
|||||||
await this.getList();
|
await this.getList();
|
||||||
|
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
tTitle() {
|
||||||
|
// return "该油罐总容量"+this.tankVolume+' '+this.unit+",可用约" + this.canUseVolume+' '+this.unit +"-- 可用约"+this.canUseT+"吨"
|
||||||
|
return "油罐总容量"+this.tankVolume+' '+this.unit+"-- 可用约"+this.canUseT+"吨"
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getList(){
|
getList(){
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
getPurchaseOrderApi(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
getPurchaseOrderApi(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
||||||
this.orderList = response.data.records;
|
this.orderList = response.data.records;
|
||||||
console.log("this.tankList",this.orderList)
|
|
||||||
this.total = response.data.total;
|
this.total = response.data.total;
|
||||||
// 总数计算
|
// 总数计算
|
||||||
this.sumMethod(response.data.records);
|
this.sumMethod(response.data.records);
|
||||||
@ -465,6 +497,8 @@ export default {
|
|||||||
"tankId": this.orderForm.tankId,
|
"tankId": this.orderForm.tankId,
|
||||||
"tankName": tankName.tankName,
|
"tankName": tankName.tankName,
|
||||||
"totalAmount": this.orderForm.totalAmount,
|
"totalAmount": this.orderForm.totalAmount,
|
||||||
|
"canUseT": this.canUseT,
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -497,7 +531,11 @@ export default {
|
|||||||
},
|
},
|
||||||
// 改变数字时
|
// 改变数字时
|
||||||
change(data) {
|
change(data) {
|
||||||
console.log()
|
|
||||||
|
if (data.purchaseWeight > data.canUseT) {
|
||||||
|
this.$message('不能超过油罐储存的最大值!');
|
||||||
|
data.purchaseWeight = data.canUseT
|
||||||
|
}
|
||||||
// 密度计算
|
// 密度计算
|
||||||
data.purchaseVolume = new BigNumber(data.purchaseWeight).times(1000).dividedBy(data.productDensity).toFixed(2);
|
data.purchaseVolume = new BigNumber(data.purchaseWeight).times(1000).dividedBy(data.productDensity).toFixed(2);
|
||||||
// 计算小计价格
|
// 计算小计价格
|
||||||
@ -532,9 +570,57 @@ export default {
|
|||||||
this.tankList.forEach(su=>{
|
this.tankList.forEach(su=>{
|
||||||
if (data == su.id) {
|
if (data == su.id) {
|
||||||
this.orderForm.productDensity = su.oilDensity
|
this.orderForm.productDensity = su.oilDensity
|
||||||
|
console.log("su",su)
|
||||||
|
this.tankVolume = su.tankVolume
|
||||||
|
this.nowVolume = su.storedQuantity
|
||||||
|
this.unit = su.unit
|
||||||
|
this.densityCalculations();
|
||||||
|
// tankVolume:'0', // 总升数
|
||||||
|
// nowVolume:'0', // 现有升数
|
||||||
|
// canUseVolume:'0',// 可用升数
|
||||||
|
// canUseT:'0',//吨数计算
|
||||||
|
// unit:'L',//单位
|
||||||
|
//
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
// 根据升数计算密度
|
||||||
|
densityCalculations() {
|
||||||
|
this.canUseVolume = this.tankVolume - this.nowVolume
|
||||||
|
// 定义油的体积和密度
|
||||||
|
const volumeLiters = new BigNumber(this.canUseVolume); // 体积,单位:升
|
||||||
|
const densityGramsPerML = new BigNumber(this.orderForm.productDensity); // 密度,单位:克/毫升
|
||||||
|
|
||||||
|
|
||||||
|
// 计算油的质量(吨)
|
||||||
|
const massTons = volumeLiters.times(densityGramsPerML).times(1e-3).toFixed(2);
|
||||||
|
this.canUseT = massTons; // 将结果转换为数字类型并赋值给属性
|
||||||
|
// console.log("canUseT",this.tankVolume)
|
||||||
|
|
||||||
|
},
|
||||||
|
inputPurchaseWeight() {
|
||||||
|
if (!this.orderForm.purchaseWeight) {
|
||||||
|
this.orderForm.purchaseWeight = ''
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!this.canUseT) {
|
||||||
|
this.$message('请先选择油罐!');
|
||||||
|
this.orderForm.purchaseWeight = ''
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const purchaseWeight = parseFloat(this.orderForm.purchaseWeight);
|
||||||
|
const canUseT = parseFloat(this.canUseT);
|
||||||
|
console.log("purchaseWeight",purchaseWeight)
|
||||||
|
if (canUseT<=0) {
|
||||||
|
this.$message('已无可用吨数!');
|
||||||
|
this.orderForm.purchaseWeight = ''
|
||||||
|
return
|
||||||
|
}else if (purchaseWeight>canUseT) {
|
||||||
|
this.orderForm.purchaseWeight = canUseT
|
||||||
|
}
|
||||||
|
},
|
||||||
// 查询所有的油品
|
// 查询所有的油品
|
||||||
getOilNameList() {
|
getOilNameList() {
|
||||||
let this_=this
|
let this_=this
|
||||||
@ -556,7 +642,6 @@ export default {
|
|||||||
this.suppliersList = response.data;
|
this.suppliersList = response.data;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
// 刷新订单编号
|
// 刷新订单编号
|
||||||
refresh() {
|
refresh() {
|
||||||
var timestamp = new Date().getTime();
|
var timestamp = new Date().getTime();
|
||||||
@ -709,7 +794,6 @@ export default {
|
|||||||
this.voidFlag=true
|
this.voidFlag=true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// 判断权限
|
// 判断权限
|
||||||
async judgmentPermissions(data) {
|
async judgmentPermissions(data) {
|
||||||
let fil ={
|
let fil ={
|
||||||
@ -719,7 +803,6 @@ export default {
|
|||||||
return res.data
|
return res.data
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
// 保存并审核
|
// 保存并审核
|
||||||
async audit(){
|
async audit(){
|
||||||
// 保存
|
// 保存
|
||||||
@ -822,7 +905,6 @@ export default {
|
|||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 页面跳转
|
// 页面跳转
|
||||||
goToAbout() {
|
goToAbout() {
|
||||||
this.$router.push('/oilConfig/oilPurchase/list');
|
this.$router.push('/oilConfig/oilPurchase/list');
|
||||||
|
@ -26,8 +26,8 @@
|
|||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="状态" v-model="queryParams.status" prop="status" clearable>
|
<el-form-item label-width="120px" label="库存统计状态" v-model="queryParams.inventoryStatistics" prop="inventoryStatistics" clearable>
|
||||||
<el-select v-model="queryParams.status" placeholder="" style="width:100%">
|
<el-select v-model="queryParams.inventoryStatistics" placeholder="" style="width:100%">
|
||||||
<el-option label="全部" value=""></el-option>
|
<el-option label="全部" value=""></el-option>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in dict.type.zhzt"
|
v-for="dict in dict.type.zhzt"
|
||||||
@ -198,7 +198,8 @@ export default {
|
|||||||
// 查询参数
|
// 查询参数
|
||||||
queryParams: {
|
queryParams: {
|
||||||
numberId:'',
|
numberId:'',
|
||||||
status:'',
|
status:'启用',
|
||||||
|
inventoryStatistics:'',
|
||||||
tankName: '',
|
tankName: '',
|
||||||
page:null,
|
page:null,
|
||||||
pageSize:null
|
pageSize:null
|
||||||
@ -289,7 +290,8 @@ export default {
|
|||||||
// 查询参数
|
// 查询参数
|
||||||
this.queryParams= {
|
this.queryParams= {
|
||||||
numberId:'',
|
numberId:'',
|
||||||
status:'',
|
status:'启用',
|
||||||
|
inventoryStatistics:'',
|
||||||
tankName: '',
|
tankName: '',
|
||||||
page:null,
|
page:null,
|
||||||
pageSize:null
|
pageSize:null
|
||||||
|
@ -11,7 +11,7 @@ VUE_APP_BASE_API = '/dev-api'
|
|||||||
VUE_APP_PUBLIC_PATH = '/'
|
VUE_APP_PUBLIC_PATH = '/'
|
||||||
|
|
||||||
# 后端接口地址
|
# 后端接口地址
|
||||||
VUE_APP_SERVER_URL = 'http://192.168.0.121:8080/'
|
VUE_APP_SERVER_URL = 'http://192.168.0.178:8008/'
|
||||||
|
|
||||||
# cp端地址
|
# cp端地址
|
||||||
VUE_PC_SERVER_URL = 'http://192.168.0.178:82/'
|
VUE_PC_SERVER_URL = 'http://192.168.0.178:82/'
|
||||||
|
@ -47,7 +47,8 @@ Vue.prototype.addDateRange = addDateRange
|
|||||||
Vue.prototype.getName = getName
|
Vue.prototype.getName = getName
|
||||||
Vue.prototype.download = download
|
Vue.prototype.download = download
|
||||||
Vue.prototype.handleTree = handleTree
|
Vue.prototype.handleTree = handleTree
|
||||||
Vue.prototype.pcUrl = 'http://192.168.0.121:82/'
|
// Vue.prototype.pcUrl = 'http://192.168.0.121:82/'
|
||||||
|
Vue.prototype.pcUrl = 'http://192.168.0.178:82/'
|
||||||
|
|
||||||
// 全局组件挂载
|
// 全局组件挂载
|
||||||
Vue.component('DictTag', DictTag)
|
Vue.component('DictTag', DictTag)
|
||||||
|
@ -63,7 +63,8 @@
|
|||||||
<div class="box-wrap">
|
<div class="box-wrap">
|
||||||
<div class="zong-box" v-for="(items,index) in item.storeList" :key="index" >
|
<div class="zong-box" v-for="(items,index) in item.storeList" :key="index" >
|
||||||
<div class="pur-box" @click="godetails(items.id)">
|
<div class="pur-box" @click="godetails(items.id)">
|
||||||
<el-tag type="success">{{items.status=='qy'?'启用':'禁用'}}</el-tag>
|
<el-tag type="success" v-if="items.status=='qy'">启用</el-tag>
|
||||||
|
<el-tag type="danger" v-else>禁用</el-tag>
|
||||||
<div class="disper-box">
|
<div class="disper-box">
|
||||||
<div class="box-img">
|
<div class="box-img">
|
||||||
<img v-if="items.logo" :src="imagePath + items.logo" style="width: 96px;height: 96px">
|
<img v-if="items.logo" :src="imagePath + items.logo" style="width: 96px;height: 96px">
|
||||||
|
@ -165,12 +165,16 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="10">
|
<el-col :span="10">
|
||||||
<el-form-item label="油站状态" prop="status" :label-width="formLabelWidth">
|
<el-form-item label="油站状态" prop="status" :label-width="formLabelWidth">
|
||||||
|
<el-tooltip class="item" effect="dark" content="油站状态在组织架构中设置" placement="top-start">
|
||||||
|
|
||||||
<el-switch
|
<el-switch
|
||||||
|
disabled
|
||||||
v-model="from.status"
|
v-model="from.status"
|
||||||
@change="getswitch"
|
@change="getswitch"
|
||||||
active-value="qy"
|
active-value="qy"
|
||||||
inactive-value="jy"
|
inactive-value="jy"
|
||||||
></el-switch>
|
></el-switch>
|
||||||
|
</el-tooltip>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -448,7 +452,7 @@
|
|||||||
|
|
||||||
|
|
||||||
enterThePetrolStation() {
|
enterThePetrolStation() {
|
||||||
if (this.from.status == 'jy') {
|
if (this.from.status === 'jy') {
|
||||||
this.$message('该油站已被禁用');
|
this.$message('该油站已被禁用');
|
||||||
|
|
||||||
return
|
return
|
||||||
|
@ -21,6 +21,13 @@ public interface OilPresetPricesMapper extends BaseMapper<OilPresetPrices> {
|
|||||||
*/
|
*/
|
||||||
public IPage<OilPresetPrices> selectOilPresetPricesList(Page page, @Param("presetPrices") OilPresetPrices presetPrices);
|
public IPage<OilPresetPrices> selectOilPresetPricesList(Page page, @Param("presetPrices") OilPresetPrices presetPrices);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将过期等待任务全部标为已失效
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int editWaitByTime();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据id查询员工信息
|
* 根据id查询员工信息
|
||||||
* @param id
|
* @param id
|
||||||
|
@ -100,5 +100,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<update id="updateJobId">
|
<update id="updateJobId">
|
||||||
update oil_preset_prices set job_id = #{jobId} where preset_id = #{presetId}
|
update oil_preset_prices set job_id = #{jobId} where preset_id = #{presetId}
|
||||||
</update>
|
</update>
|
||||||
|
<update id="editWaitByTime">
|
||||||
|
update oil_preset_prices set state = 'lose' where state = 'wait' and effective_time < now()
|
||||||
|
</update>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
@ -43,9 +43,19 @@ public class OilPresetPricesServiceImpl extends ServiceImpl<OilPresetPricesMappe
|
|||||||
public IPage<OilPresetPrices> selectOilPresetPricesList(Page page, OilPresetPrices presetPrices) {
|
public IPage<OilPresetPrices> selectOilPresetPricesList(Page page, OilPresetPrices presetPrices) {
|
||||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||||
presetPrices.setStoreId(nowAccountInfo.getStoreId());
|
presetPrices.setStoreId(nowAccountInfo.getStoreId());
|
||||||
|
editWaitByTime();
|
||||||
|
|
||||||
return baseMapper.selectOilPresetPricesList(page, presetPrices);
|
return baseMapper.selectOilPresetPricesList(page, presetPrices);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将过期等待任务全部标为已失效
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public boolean editWaitByTime() {
|
||||||
|
return baseMapper.editWaitByTime()>0;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public OilPresetPrices selectOilPresetPricesById(Integer id) {
|
public OilPresetPrices selectOilPresetPricesById(Integer id) {
|
||||||
return baseMapper.selectOilPresetPricesById(id);
|
return baseMapper.selectOilPresetPricesById(id);
|
||||||
@ -66,8 +76,6 @@ public class OilPresetPricesServiceImpl extends ServiceImpl<OilPresetPricesMappe
|
|||||||
presetPrices.setState("wait");
|
presetPrices.setState("wait");
|
||||||
baseMapper.insertOilPresetPrices(presetPrices);
|
baseMapper.insertOilPresetPrices(presetPrices);
|
||||||
|
|
||||||
// AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
|
||||||
// System.out.println("nowAccountInfo"+nowAccountInfo);
|
|
||||||
String coreTime = changeCore(presetPrices.getEffectiveTime());
|
String coreTime = changeCore(presetPrices.getEffectiveTime());
|
||||||
// 创建定时任务
|
// 创建定时任务
|
||||||
SysJob sysJob = new SysJob();
|
SysJob sysJob = new SysJob();
|
||||||
@ -152,6 +160,7 @@ public class OilPresetPricesServiceImpl extends ServiceImpl<OilPresetPricesMappe
|
|||||||
oilNumber.setOilPrice(oilPresetPrices.getPresetOilPrices());
|
oilNumber.setOilPrice(oilPresetPrices.getPresetOilPrices());
|
||||||
oilNumber.setGbPrice(oilPresetPrices.getPresetGbPrice());
|
oilNumber.setGbPrice(oilPresetPrices.getPresetGbPrice());
|
||||||
oilNumberMapper.updateOilNumber(oilNumber);
|
oilNumberMapper.updateOilNumber(oilNumber);
|
||||||
|
editWaitByTime();
|
||||||
// 将状态调整为开始
|
// 将状态调整为开始
|
||||||
baseMapper.editStart(id, "occur");
|
baseMapper.editStart(id, "occur");
|
||||||
|
|
||||||
|
@ -84,7 +84,9 @@ public class OilTankServiceImpl implements OilTankService {
|
|||||||
oilTank.setCreateBy(nowAccountInfo.getStaffId().toString());
|
oilTank.setCreateBy(nowAccountInfo.getStaffId().toString());
|
||||||
this.oilTankDao.insert(oilTank);
|
this.oilTankDao.insert(oilTank);
|
||||||
|
|
||||||
// 添加到库存跟踪 (初始化时)
|
|
||||||
|
if ("启用".equals(oilTank.getInventoryStatistics())) {
|
||||||
|
// 添加到库存跟踪 (初始化时) -- 当启用库存统计时
|
||||||
OilTracking oilTracking = new OilTracking();
|
OilTracking oilTracking = new OilTracking();
|
||||||
oilTracking.setStoreId(nowAccountInfo.getStoreId());
|
oilTracking.setStoreId(nowAccountInfo.getStoreId());
|
||||||
oilTracking.setCreateBy(nowAccountInfo.getStaffId().toString());
|
oilTracking.setCreateBy(nowAccountInfo.getStaffId().toString());
|
||||||
@ -93,6 +95,8 @@ public class OilTankServiceImpl implements OilTankService {
|
|||||||
oilTracking.setTankId(oilTank.getId());
|
oilTracking.setTankId(oilTank.getId());
|
||||||
oilTracking.setOrderNumber("-");
|
oilTracking.setOrderNumber("-");
|
||||||
oilTrackingMapper.insert(oilTracking);
|
oilTrackingMapper.insert(oilTracking);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return oilTank;
|
return oilTank;
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
inner join sys_dept sd on sd.dept_id = csi.contract_dept_id
|
inner join sys_dept sd on sd.dept_id = csi.contract_dept_id
|
||||||
inner join mt_store ms on ms.chain_store_id = csi.id
|
inner join mt_store ms on ms.chain_store_id = csi.id
|
||||||
where sd.ancestors like concat(#{ownDeptStr},'%')
|
where sd.ancestors like concat(#{ownDeptStr},'%')
|
||||||
|
and csi.status = 'qy'
|
||||||
<if test="chainStoreInfo.storeName !=null and chainStoreInfo.storeName !=''">
|
<if test="chainStoreInfo.storeName !=null and chainStoreInfo.storeName !=''">
|
||||||
and (csi.store_name like concat('%',#{chainStoreInfo.storeName},'%') or ms.name like concat('%',#{chainStoreInfo.storeName},'%'))
|
and (csi.store_name like concat('%',#{chainStoreInfo.storeName},'%') or ms.name like concat('%',#{chainStoreInfo.storeName},'%'))
|
||||||
</if>
|
</if>
|
||||||
|
@ -403,8 +403,8 @@ public class StoreServiceImpl extends ServiceImpl<MtStoreMapper, MtStore> implem
|
|||||||
res.put(flag,false);
|
res.put(flag,false);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
// if (redisTemplate.hasKey(flag)) {
|
if (redisTemplate.hasKey(flag)) {
|
||||||
if (true) {
|
// if (true) {
|
||||||
// 找到站长的
|
// 找到站长的
|
||||||
Map<String, Object> param = new HashMap();
|
Map<String, Object> param = new HashMap();
|
||||||
|
|
||||||
@ -445,13 +445,8 @@ public class StoreServiceImpl extends ServiceImpl<MtStoreMapper, MtStore> implem
|
|||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
// mtStoreMapper.getAccountByRole(12);
|
|
||||||
// 生成token
|
|
||||||
|
|
||||||
// 返回token
|
redisTemplate.delete(flag);
|
||||||
|
|
||||||
|
|
||||||
// redisTemplate.delete(flag);
|
|
||||||
return res;
|
return res;
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
@ -128,6 +128,7 @@ public class LJStoreServiceImpl extends ServiceImpl<LJStoreMapper, LJStore> impl
|
|||||||
// 查询店铺列表信息
|
// 查询店铺列表信息
|
||||||
QueryWrapper queryWrapper = new QueryWrapper<>();
|
QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.eq("status","qy");
|
queryWrapper.eq("status","qy");
|
||||||
|
queryWrapper.eq("if_delete","0");
|
||||||
queryWrapper.eq("chain_store_id",chainStoreId);
|
queryWrapper.eq("chain_store_id",chainStoreId);
|
||||||
List<LJStore> list = baseMapper.selectList(queryWrapper);
|
List<LJStore> list = baseMapper.selectList(queryWrapper);
|
||||||
double earthRadius = 6371; // 地球半径,单位为公里
|
double earthRadius = 6371; // 地球半径,单位为公里
|
||||||
|
@ -94,9 +94,9 @@ public class QRCodeServiceImpl extends ServiceImpl<QRCodeMapper, QRCode> impleme
|
|||||||
if (ObjectUtil.isEmpty(qrCode1)){
|
if (ObjectUtil.isEmpty(qrCode1)){
|
||||||
qrCode.setStoreId(store.getId());
|
qrCode.setStoreId(store.getId());
|
||||||
qrCode.setChainStoreId(store.getChainStoreId());
|
qrCode.setChainStoreId(store.getChainStoreId());
|
||||||
// 带有店铺id 跳转首页
|
// 带有店铺id 跳转首页
|
||||||
qrCode.setCollection("https://www.tuofeng.cc/oilIndex?storeId="+store.getChainStoreId());
|
qrCode.setCollection("https://www.tuofeng.cc/oilIndex?storeId="+store.getChainStoreId());
|
||||||
// 带有店铺id 跳转一键加油页面
|
// 带有店铺id 跳转一键加油页面
|
||||||
qrCode.setPayment("https://www.tuofeng.cc/oilRefuel?storeId="+store.getChainStoreId());
|
qrCode.setPayment("https://www.tuofeng.cc/oilRefuel?storeId="+store.getChainStoreId());
|
||||||
row = baseMapper.insert(qrCode);
|
row = baseMapper.insert(qrCode);
|
||||||
IndexBanner indexBanner = new IndexBanner();
|
IndexBanner indexBanner = new IndexBanner();
|
||||||
|
@ -85,26 +85,6 @@ public class SysDeptController extends BaseController
|
|||||||
return getFailureResult("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在");
|
return getFailureResult("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在");
|
||||||
}
|
}
|
||||||
int row = deptService.insertDept(dept);
|
int row = deptService.insertDept(dept);
|
||||||
SysDept sysDept = deptService.selectSysDeptByName(dept.getDeptName());
|
|
||||||
if (ObjectUtil.isNotEmpty(sysDept)){
|
|
||||||
LJStore store = storeService.selectStoreByDeptId(sysDept.getDeptId());
|
|
||||||
QRCode qrCode = new QRCode();
|
|
||||||
iqrCodeService.insertQRCode(qrCode,store.getId());
|
|
||||||
LJUserGrade userGrade = new LJUserGrade();
|
|
||||||
userGrade.setStoreId(store.getId());
|
|
||||||
userGrade.setGrade(1);
|
|
||||||
userGrade.setName("普通会员");
|
|
||||||
userGrade.setStatus("qy");
|
|
||||||
userGrade.setGrowthValue(1);
|
|
||||||
userGrade.setPreferential("自定义优惠");
|
|
||||||
userGrade.setGasolineDiscount("无优惠");
|
|
||||||
userGrade.setGasolineRule("[{\"gasolineRule1\":1,\"gasolineRule2\":1,\"gasolineRule3\":1}]");
|
|
||||||
userGrade.setDieselDiscount("无优惠");
|
|
||||||
userGrade.setDieselRule("[{\"dieselRule1\":1,\"dieselRule2\":1,\"dieselRule3\":1}]");
|
|
||||||
userGrade.setNaturalGasDiscount("无优惠");
|
|
||||||
userGrade.setNaturalGasRule("[{\"naturalGas1\":1,\"naturalGas2\":1,\"naturalGas3\":1}]");
|
|
||||||
userGradeService.insertUserGrade(userGrade,store.getId());
|
|
||||||
}
|
|
||||||
return getSuccessResult(row);
|
return getSuccessResult(row);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -115,6 +95,7 @@ public class SysDeptController extends BaseController
|
|||||||
public ResponseObject edit(@Validated @RequestBody SysDept dept)
|
public ResponseObject edit(@Validated @RequestBody SysDept dept)
|
||||||
{
|
{
|
||||||
Long deptId = dept.getDeptId();
|
Long deptId = dept.getDeptId();
|
||||||
|
Long parentId = dept.getParentId();
|
||||||
if (!deptService.checkDeptNameUnique(dept))
|
if (!deptService.checkDeptNameUnique(dept))
|
||||||
{
|
{
|
||||||
return getFailureResult("修改部门'" + dept.getDeptName() + "'失败,部门名称已存在");
|
return getFailureResult("修改部门'" + dept.getDeptName() + "'失败,部门名称已存在");
|
||||||
@ -127,6 +108,9 @@ public class SysDeptController extends BaseController
|
|||||||
{
|
{
|
||||||
return getFailureResult("该部门包含未停用的子部门!");
|
return getFailureResult("该部门包含未停用的子部门!");
|
||||||
}
|
}
|
||||||
|
else if (StringUtils.equals(UserConstants.DEPT_NORMAL, dept.getStatus()) && deptService.selectStatusByParentId(parentId) > 0) {
|
||||||
|
return getFailureResult("该部门的父级部门未启用!");
|
||||||
|
}
|
||||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||||
dept.setCreateBy(nowAccountInfo.getId().toString());
|
dept.setCreateBy(nowAccountInfo.getId().toString());
|
||||||
return getSuccessResult(deptService.updateDept(dept));
|
return getSuccessResult(deptService.updateDept(dept));
|
||||||
|
@ -54,6 +54,9 @@ public interface SysDeptMapper extends BaseMapper<SysDept>
|
|||||||
*/
|
*/
|
||||||
public int selectNormalChildrenDeptById(Long deptId);
|
public int selectNormalChildrenDeptById(Long deptId);
|
||||||
|
|
||||||
|
|
||||||
|
int selectStatusByParentId(Long parentId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否存在子节点
|
* 是否存在子节点
|
||||||
*
|
*
|
||||||
|
@ -64,7 +64,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectNormalChildrenDeptById" parameterType="Long" resultType="int">
|
<select id="selectNormalChildrenDeptById" parameterType="Long" resultType="int">
|
||||||
select count(*) from sys_dept where status = 'jy' and find_in_set(#{deptId}, ancestors)
|
select count(*) from sys_dept where status = 'qy' and find_in_set(#{deptId}, ancestors) and if_delete = 0
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectStatusByParentId" resultType="java.lang.Integer">
|
||||||
|
select count(*) from sys_dept where status = 'jy' and dept_id= #{parentId} and if_delete = 0
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="checkDeptNameUnique" resultType="com.fuint.system.dept.entity.SysDept">
|
<select id="checkDeptNameUnique" resultType="com.fuint.system.dept.entity.SysDept">
|
||||||
@ -87,7 +91,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</foreach>
|
</foreach>
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<update id="updateDeptStatusNormal" parameterType="Long">
|
<update id="updateDeptStatusNormal" parameterType="String">
|
||||||
update sys_dept set status = 'jy' where ancestors like concat(#{ancestor},'%')
|
update sys_dept set status = 'jy' where ancestors like concat(#{ancestor},'%')
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
@ -99,6 +103,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<update id="updateStatusByTurnoverTime" >
|
<update id="updateStatusByTurnoverTime" >
|
||||||
update sys_dept set status = 'jy' where turnover_time > NOW() and turnoverType = 2
|
update sys_dept set status = 'jy' where turnover_time > NOW() and turnoverType = 2
|
||||||
</update>
|
</update>
|
||||||
|
@ -63,6 +63,12 @@ public interface ISysDeptService extends IService<SysDept>
|
|||||||
*/
|
*/
|
||||||
public int selectNormalChildrenDeptById(Long deptId);
|
public int selectNormalChildrenDeptById(Long deptId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询是否有父级部门未启用
|
||||||
|
* @param parentId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int selectStatusByParentId(Long parentId);
|
||||||
/**
|
/**
|
||||||
* 是否存在部门子节点
|
* 是否存在部门子节点
|
||||||
*
|
*
|
||||||
|
@ -9,12 +9,19 @@ import com.fuint.business.store.entity.ChainStoreInfo;
|
|||||||
import com.fuint.business.store.entity.MtStore;
|
import com.fuint.business.store.entity.MtStore;
|
||||||
import com.fuint.business.store.service.ChainStoreInfoService;
|
import com.fuint.business.store.service.ChainStoreInfoService;
|
||||||
import com.fuint.business.store.service.StoreService;
|
import com.fuint.business.store.service.StoreService;
|
||||||
|
import com.fuint.business.storeInformation.entity.LJStore;
|
||||||
|
import com.fuint.business.storeInformation.entity.QRCode;
|
||||||
|
import com.fuint.business.storeInformation.service.ILJStoreService;
|
||||||
|
import com.fuint.business.storeInformation.service.IQRCodeService;
|
||||||
|
import com.fuint.business.userManager.entity.LJUserGrade;
|
||||||
|
import com.fuint.business.userManager.service.LJUserGradeService;
|
||||||
import com.fuint.common.constant.UserConstants;
|
import com.fuint.common.constant.UserConstants;
|
||||||
import com.fuint.common.domain.TreeSelect;
|
import com.fuint.common.domain.TreeSelect;
|
||||||
import com.fuint.common.dto.AccountInfo;
|
import com.fuint.common.dto.AccountInfo;
|
||||||
import com.fuint.common.util.Convert;
|
import com.fuint.common.util.Convert;
|
||||||
import com.fuint.common.util.StringUtils;
|
import com.fuint.common.util.StringUtils;
|
||||||
import com.fuint.common.util.TokenUtil;
|
import com.fuint.common.util.TokenUtil;
|
||||||
|
import com.fuint.framework.exception.BusinessCheckException;
|
||||||
import com.fuint.system.dept.entity.SysDept;
|
import com.fuint.system.dept.entity.SysDept;
|
||||||
import com.fuint.system.dept.mapper.SysDeptMapper;
|
import com.fuint.system.dept.mapper.SysDeptMapper;
|
||||||
import com.fuint.system.dept.service.ISysDeptService;
|
import com.fuint.system.dept.service.ISysDeptService;
|
||||||
@ -26,6 +33,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.concurrent.ExecutionException;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -140,6 +148,16 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper,SysDept> imple
|
|||||||
return baseMapper.selectNormalChildrenDeptById(deptId);
|
return baseMapper.selectNormalChildrenDeptById(deptId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询是否有父级部门未启用
|
||||||
|
* @param parentId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int selectStatusByParentId(Long parentId) {
|
||||||
|
return baseMapper.selectStatusByParentId(parentId);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否存在子节点
|
* 是否存在子节点
|
||||||
*
|
*
|
||||||
@ -192,7 +210,10 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper,SysDept> imple
|
|||||||
return baseMapper.selectOne(queryWrapper);
|
return baseMapper.selectOne(queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IQRCodeService iqrCodeService;
|
||||||
|
@Autowired
|
||||||
|
private LJUserGradeService userGradeService;
|
||||||
/**
|
/**
|
||||||
* 新增保存部门信息
|
* 新增保存部门信息
|
||||||
*
|
*
|
||||||
@ -228,6 +249,25 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper,SysDept> imple
|
|||||||
store.setChainStoreId(chainStoreInfo.getId());
|
store.setChainStoreId(chainStoreInfo.getId());
|
||||||
store.setContractDeptId(dept.getDeptId());
|
store.setContractDeptId(dept.getDeptId());
|
||||||
storeService.save(store);
|
storeService.save(store);
|
||||||
|
|
||||||
|
|
||||||
|
QRCode qrCode = new QRCode();
|
||||||
|
iqrCodeService.insertQRCode(qrCode,store.getId());
|
||||||
|
LJUserGrade userGrade = new LJUserGrade();
|
||||||
|
userGrade.setStoreId(store.getId());
|
||||||
|
userGrade.setGrade(1);
|
||||||
|
userGrade.setName("普通会员");
|
||||||
|
userGrade.setStatus("qy");
|
||||||
|
userGrade.setGrowthValue(1);
|
||||||
|
userGrade.setPreferential("自定义优惠");
|
||||||
|
userGrade.setGasolineDiscount("无优惠");
|
||||||
|
userGrade.setGasolineRule("[{\"gasolineRule1\":1,\"gasolineRule2\":1,\"gasolineRule3\":1}]");
|
||||||
|
userGrade.setDieselDiscount("无优惠");
|
||||||
|
userGrade.setDieselRule("[{\"dieselRule1\":1,\"dieselRule2\":1,\"dieselRule3\":1}]");
|
||||||
|
userGrade.setNaturalGasDiscount("无优惠");
|
||||||
|
userGrade.setNaturalGasRule("[{\"naturalGas1\":1,\"naturalGas2\":1,\"naturalGas3\":1}]");
|
||||||
|
userGradeService.insertUserGrade(userGrade,store.getId());
|
||||||
|
|
||||||
}else {
|
}else {
|
||||||
throw new Exception("数据有误,请联系管理员");
|
throw new Exception("数据有误,请联系管理员");
|
||||||
}
|
}
|
||||||
@ -269,6 +309,7 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper,SysDept> imple
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional
|
||||||
public int updateDept(SysDept dept)
|
public int updateDept(SysDept dept)
|
||||||
{
|
{
|
||||||
SysDept newParentDept = baseMapper.selectDeptById(dept.getParentId());
|
SysDept newParentDept = baseMapper.selectDeptById(dept.getParentId());
|
||||||
@ -285,12 +326,17 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper,SysDept> imple
|
|||||||
queryWrapper.eq(ChainStoreInfo::getContractDeptId,dept.getDeptId());
|
queryWrapper.eq(ChainStoreInfo::getContractDeptId,dept.getDeptId());
|
||||||
ChainStoreInfo chainStoreInfo = chainStoreService.getOne(queryWrapper);
|
ChainStoreInfo chainStoreInfo = chainStoreService.getOne(queryWrapper);
|
||||||
chainStoreInfo.setStoreName(dept.getDeptName());
|
chainStoreInfo.setStoreName(dept.getDeptName());
|
||||||
|
chainStoreInfo.setStatus(dept.getStatus());
|
||||||
chainStoreService.updateById(chainStoreInfo);
|
chainStoreService.updateById(chainStoreInfo);
|
||||||
}else if (dept.getDeptType().equals("3")){
|
}else if (dept.getDeptType().equals("3")){
|
||||||
LambdaQueryWrapper<MtStore> queryWrapper =new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<MtStore> queryWrapper =new LambdaQueryWrapper<>();
|
||||||
queryWrapper.eq(MtStore::getContractDeptId,dept.getDeptId());
|
queryWrapper.eq(MtStore::getContractDeptId,dept.getDeptId());
|
||||||
MtStore store = storeService.getOne(queryWrapper);
|
MtStore store = storeService.getOne(queryWrapper);
|
||||||
|
if (ObjectUtil.isEmpty(store)) {
|
||||||
|
throw new RuntimeException("该油站不存在!");
|
||||||
|
}
|
||||||
store.setName(dept.getDeptName());
|
store.setName(dept.getDeptName());
|
||||||
|
store.setStatus(dept.getStatus());
|
||||||
storeService.updateById(store);
|
storeService.updateById(store);
|
||||||
}
|
}
|
||||||
int result = baseMapper.updateById(dept);
|
int result = baseMapper.updateById(dept);
|
||||||
@ -309,7 +355,9 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper,SysDept> imple
|
|||||||
*/
|
*/
|
||||||
private void updateParentDeptStatusNormal(SysDept dept)
|
private void updateParentDeptStatusNormal(SysDept dept)
|
||||||
{
|
{
|
||||||
baseMapper.updateDeptStatusNormal(dept.getAncestors());
|
StringBuilder stringBuilder = new StringBuilder();
|
||||||
|
stringBuilder.append(dept.getAncestors()).append(",").append(dept.getDeptId());
|
||||||
|
baseMapper.updateDeptStatusNormal(stringBuilder.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
server.port=8008
|
server.port=8008
|
||||||
env.profile=dev
|
env.profile=dev
|
||||||
#env.properties.path=D:/workspaces/oilSystem/fuintBackend/configure/
|
#env.properties.path=D:/workspaces/oilSystem/fuintBackend/configure/
|
||||||
env.properties.path=D:/oil/oil/oilSystem/fuintBackend/configure/
|
env.properties.path=D:/code/oilSystem/fuintBackend/configure/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Binary file not shown.
@ -70,8 +70,8 @@
|
|||||||
<view class="dred"> <text class="xred">¥</text> {{oilInfo.oilPrice}}</view>
|
<view class="dred"> <text class="xred">¥</text> {{oilInfo.oilPrice}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="c-box-box3">
|
<view class="c-box-box3">
|
||||||
<view class="xblck">国际价</view>
|
<view class="xblck">国标价</view>
|
||||||
<view class="dblck"> <text class="xblck">¥</text> {{oilInfo.oilPrice}}</view>
|
<view class="dblck"> <text class="xblck">¥</text> {{oilInfo.gbPrice}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user