审核
This commit is contained in:
parent
7e2c047e4d
commit
b3d5f153c9
@ -117,3 +117,31 @@ export function disposeBatchApi(data) {
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 审核
|
||||
export function auditInventoryApi(data) {
|
||||
return request({
|
||||
url: 'business/petrolStationManagement/oilInventoryOrder/audit',
|
||||
method: 'get',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
||||
// 入库
|
||||
export function storageInventoryApi(data) {
|
||||
return request({
|
||||
url: 'business/petrolStationManagement/oilInventoryOrder/storage',
|
||||
method: 'get',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
||||
// 作废
|
||||
export function abolitionInventoryApi(data) {
|
||||
return request({
|
||||
url: 'business/petrolStationManagement/oilInventoryOrder/abolition',
|
||||
method: 'get',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
@ -66,3 +66,31 @@ export function editPurchuseApi(data) {
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 审核
|
||||
export function auditApi(data) {
|
||||
return request({
|
||||
url: 'business/petrolStationManagement/oilPurchaseOrder/audit',
|
||||
method: 'get',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
||||
// 入库
|
||||
export function storageApi(data) {
|
||||
return request({
|
||||
url: 'business/petrolStationManagement/oilPurchaseOrder/storage',
|
||||
method: 'get',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
||||
// 作废
|
||||
export function abolitionApi(data) {
|
||||
return request({
|
||||
url: 'business/petrolStationManagement/oilPurchaseOrder/abolition',
|
||||
method: 'get',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
10
fuintAdmin/src/api/oilConfig/staff.js
Normal file
10
fuintAdmin/src/api/oilConfig/staff.js
Normal file
@ -0,0 +1,10 @@
|
||||
import request from "@/utils/request";
|
||||
|
||||
//
|
||||
export function getAuditPremApi(data) {
|
||||
return request({
|
||||
url: '/business/member/staff/auditPrem',
|
||||
method: 'get',
|
||||
params: data
|
||||
})
|
||||
}
|
@ -82,7 +82,6 @@ export function insertOilPresePricesApi(data) {
|
||||
}
|
||||
|
||||
export function stopJobApi(data) {
|
||||
console.log("dddddaaaaa",data)
|
||||
return request({
|
||||
url: 'business/petrolStationManagement/oilPresetPrices/stopJob',
|
||||
method: 'post',
|
||||
|
@ -236,14 +236,13 @@ import {cleanTankApi} from "@/api/oilConfig/oilTank";
|
||||
if (response.code == 200) {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.dialogVisible = false;
|
||||
this.getList();
|
||||
// this.getList();
|
||||
}else {
|
||||
|
||||
}
|
||||
|
||||
}).catch(reason => {
|
||||
console.log("reason",reason)
|
||||
this.dialogVisible = true;
|
||||
// this.dialogVisible = true;
|
||||
|
||||
});
|
||||
} else {
|
||||
@ -251,7 +250,7 @@ import {cleanTankApi} from "@/api/oilConfig/oilTank";
|
||||
if (response.code == 200) {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.dialogVisible = false;
|
||||
this.getList();
|
||||
// this.getList();
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -259,8 +258,11 @@ import {cleanTankApi} from "@/api/oilConfig/oilTank";
|
||||
this.dialogVisible = false
|
||||
} else {
|
||||
console.log('error submit!!');
|
||||
|
||||
return false;
|
||||
}
|
||||
this.getList();
|
||||
|
||||
});
|
||||
},
|
||||
chooseName() {
|
||||
@ -329,7 +331,7 @@ import {cleanTankApi} from "@/api/oilConfig/oilTank";
|
||||
padding: 10px;
|
||||
border-radius: 4px;
|
||||
width: 19%;
|
||||
background: url(../../assets/images/jybjj.png) center no-repeat;
|
||||
background: url(../../../assets/images/jybjj.png) center no-repeat;
|
||||
background-size:40% 70%;
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
@ -342,7 +344,7 @@ import {cleanTankApi} from "@/api/oilConfig/oilTank";
|
||||
padding: 10px;
|
||||
border-radius: 4px;
|
||||
width: 19%;
|
||||
background: url(../../assets/images/jybjj.png) center no-repeat;
|
||||
background: url(../../../assets/images/jybjj.png) center no-repeat;
|
||||
background-size:40% 70%;
|
||||
background-color: #ecf5ff;
|
||||
color: #409eff !important;
|
@ -84,12 +84,12 @@
|
||||
icon="el-icon-edit"
|
||||
@click="dispose(scope.row)"
|
||||
>处理单据</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-copy-document"
|
||||
@click="handleDel(scope.row.id)"
|
||||
>删除</el-button>
|
||||
<!-- <el-button-->
|
||||
<!-- size="mini"-->
|
||||
<!-- type="text"-->
|
||||
<!-- icon="el-icon-copy-document"-->
|
||||
<!-- @click="handleDel(scope.row.id)"-->
|
||||
<!-- >删除</el-button>-->
|
||||
<!-- v-hasPermi="['']"-->
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -122,9 +122,6 @@ export default {
|
||||
return {
|
||||
inventoryList: [],
|
||||
|
||||
|
||||
|
||||
|
||||
purchaseList: [],
|
||||
|
||||
suppliersList: [],
|
||||
@ -186,7 +183,9 @@ export default {
|
||||
path: '/oilInventory/order',
|
||||
query: {
|
||||
inventoryId: data.id,
|
||||
inventoryNo: data.inventoryNumber
|
||||
inventoryNo: data.inventoryNumber,
|
||||
inventoryDate: data.inventoryTime,
|
||||
state: data.status
|
||||
}
|
||||
});
|
||||
},
|
||||
|
@ -52,9 +52,10 @@
|
||||
</div>
|
||||
</div>
|
||||
<div style="height: 100%; width: 30%; display: flex; align-items: center; justify-content: flex-end;">
|
||||
<el-button type="primary" :disabled="saveFlag" @click="saveInventory()">保存</el-button>
|
||||
<el-button type="success" :disabled="auditFlag" >保存并审核</el-button>
|
||||
<el-button type="warning" :disabled="voidFlag">作废</el-button>
|
||||
<el-button type="primary" v-if="state=='await'" :disabled="saveFlag" @click="saveInventory()">保存</el-button>
|
||||
<el-button type="success" v-if="state=='await'" :disabled="auditFlag" @click="audit">保存并审核</el-button>
|
||||
<el-button type="success" v-if="state=='ysh'" :disabled="auditFlag" @click="storage">盘点并处理库存</el-button>
|
||||
<el-button type="warning" v-if="state!='yzf' || state!='qrts'":disabled="voidFlag" @click="abolition()">作废</el-button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@ -109,13 +110,13 @@
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.page"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
<!-- <pagination-->
|
||||
<!-- v-show="total>0"-->
|
||||
<!-- :total="total"-->
|
||||
<!-- :page.sync="queryParams.page"-->
|
||||
<!-- :limit.sync="queryParams.pageSize"-->
|
||||
<!-- @pagination="getList"-->
|
||||
<!-- />-->
|
||||
</el-card>
|
||||
|
||||
<!-- 添加采购油品-->
|
||||
@ -178,27 +179,30 @@
|
||||
import {
|
||||
getSuppliersListApi2,
|
||||
} from "@/api/oilConfig/oilSuppliers";
|
||||
import {
|
||||
editPurchuseApi,
|
||||
insertPurchaseApi,
|
||||
insertPurchaseOrderApi,
|
||||
updatePurchaseOrderApi,
|
||||
updatePurchaseApi
|
||||
} from "@/api/oilConfig/oilPurchase";
|
||||
// import {
|
||||
// editPurchuseApi,
|
||||
// insertPurchaseApi,
|
||||
// insertPurchaseOrderApi,
|
||||
// updatePurchaseOrderApi,
|
||||
// updatePurchaseApi, storageApi, abolitionApi, auditApi
|
||||
// } from "@/api/oilConfig/oilPurchase";
|
||||
|
||||
import {
|
||||
editInventoryApi,
|
||||
getInventoryOrderApi,
|
||||
insertInventoryApi,
|
||||
auditInventoryApi,
|
||||
storageInventoryApi,
|
||||
insertInventoryOrderApi,
|
||||
updateInventoryOrderApi,
|
||||
updateInventoryApi,
|
||||
selectList2Api,
|
||||
insertBatchInventoryOrderApi, getInventoryByIdApi, disposeBatchApi, delInventoryOrderApi
|
||||
insertBatchInventoryOrderApi, getInventoryByIdApi, disposeBatchApi, delInventoryOrderApi, abolitionInventoryApi
|
||||
} from "@/api/oilConfig/oilInventory";
|
||||
import {getOilNameListApi} from "@/api/oilPrice";
|
||||
import {selectTankByNumberApi} from "@/api/oilConfig/oilGuns";
|
||||
import {BigNumber} from "bignumber.js";
|
||||
import {getAuditPremApi} from "@/api/oilConfig/staff";
|
||||
|
||||
export default {
|
||||
name: "orderOrder",
|
||||
@ -231,7 +235,7 @@ export default {
|
||||
purchaseOrderNumber: null, // 进货单号
|
||||
incomingTime: '', //进货时间
|
||||
|
||||
|
||||
state: 'await',
|
||||
|
||||
|
||||
numberOfTanks: 0, // 油罐数量
|
||||
@ -260,9 +264,10 @@ export default {
|
||||
numberList:[],
|
||||
suppliersList:[],
|
||||
|
||||
saveFlag:true,
|
||||
auditFlag:true,
|
||||
voidFlag:true,
|
||||
saveFlag:false,
|
||||
auditFlag:false,
|
||||
voidFlag:false,
|
||||
storageFlag:true,
|
||||
|
||||
|
||||
// 弹出框标题
|
||||
@ -277,7 +282,7 @@ export default {
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
supplierId: '',
|
||||
purchaseId: null,
|
||||
inventoryId: null,
|
||||
page:null,
|
||||
pageSize:null
|
||||
},
|
||||
@ -310,8 +315,13 @@ export default {
|
||||
// this.queryParams.purchaseId = -parseInt(new Date().getTime())% 100000000;
|
||||
// this.purchaseId = -parseInt(new Date().getTime()) % 100000000;
|
||||
// }
|
||||
this.state = this.$route.query.state;
|
||||
|
||||
if ( this.state == null) {
|
||||
this.state = 'await'
|
||||
}
|
||||
this.inventoryNo.inventoryNo = this.$route.query.inventoryNo;
|
||||
this.inventoryNo.inventoryDate = this.$route.query.inventoryDate;
|
||||
|
||||
this.queryParams.inventoryId = this.$route.query.inventoryId;
|
||||
this.inventoryId = this.$route.query.inventoryId;
|
||||
@ -322,6 +332,7 @@ export default {
|
||||
}
|
||||
|
||||
await this.getList();
|
||||
this.JudgmentButton();
|
||||
|
||||
},
|
||||
methods: {
|
||||
@ -395,6 +406,8 @@ export default {
|
||||
getTankList() {
|
||||
selectList2Api(this.tankForm).then(response => {
|
||||
this.tankList = response.data
|
||||
console.log("this.tankList",this.tankList)
|
||||
|
||||
})
|
||||
},
|
||||
|
||||
@ -421,6 +434,7 @@ export default {
|
||||
// oilInventoryOrder.push(now)
|
||||
// })
|
||||
|
||||
console.log("this.multipleSelection",this.multipleSelection)
|
||||
this.multipleSelection.forEach(mul=>{
|
||||
let now = {
|
||||
tankId: mul.id,
|
||||
@ -437,7 +451,7 @@ export default {
|
||||
this_.open = false
|
||||
this.numberOfTanks = this.numberOfTanks+1
|
||||
|
||||
|
||||
this_.sumMethod(this_.orderList);
|
||||
|
||||
// this_.orderList
|
||||
|
||||
@ -555,13 +569,29 @@ export default {
|
||||
|
||||
// 保存订单信息
|
||||
saveInventory(){
|
||||
|
||||
|
||||
let this_ = this
|
||||
if (this_.inventoryNo.inventoryNo == null){
|
||||
this.$modal.msgSuccess("请先填写盘点号");
|
||||
return -1;
|
||||
}
|
||||
if (this_.inventoryNo.inventoryDate == null){
|
||||
this.$modal.msgSuccess("请先填写时间");
|
||||
return -1;
|
||||
}
|
||||
if ( this_.orderList <= 0){
|
||||
this.$modal.msgSuccess("请先选择至少一个油罐");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
let inventoryForm = {
|
||||
inventoryNumber : this_.inventoryNo.inventoryNo,
|
||||
inventoryTime : this_.inventoryNo.inventoryDate,
|
||||
inventoryVolume : this_.inventoryVolume,
|
||||
stockDifference : this_.stockDifference,
|
||||
profitLossAmount : this_.profitLossAmount
|
||||
inventoryVolume : parseFloat(this_.inventoryVolume),
|
||||
stockDifference : parseFloat(this_.stockDifference),
|
||||
profitLossAmount : parseFloat(this_.profitLossAmount)
|
||||
}
|
||||
// 处理列表
|
||||
let oilInventoryOrderList = []
|
||||
@ -580,11 +610,12 @@ export default {
|
||||
inventoryId: this_.inventoryId,
|
||||
tankId: ord.tankId,
|
||||
numberId: ord.numberId,
|
||||
currentAveragePrice: ord.discountedPrice,
|
||||
currentInventoryVolume: ord.storedQuantity,
|
||||
currentAveragePrice: ord.currentAveragePrice,
|
||||
currentInventoryVolume: ord.currentInventoryVolume,
|
||||
profitLossAmount: ord.profitLossAmount,
|
||||
stockDifference: ord.stockDifference,
|
||||
inventoryVolume: ord.inventoryVolume
|
||||
|
||||
}
|
||||
oilInventoryOrderList.push(now)
|
||||
})
|
||||
@ -592,13 +623,20 @@ export default {
|
||||
disposeBatchApi(oilInventoryOrderList).then(response=> {
|
||||
// 保存成功
|
||||
this.$modal.msgSuccess("保存成功");
|
||||
this.getList()
|
||||
|
||||
})
|
||||
})
|
||||
} else {
|
||||
// 新增
|
||||
console.log("this_.orderList",inventoryForm)
|
||||
|
||||
insertInventoryApi(inventoryForm).then(response=>{
|
||||
// disList.inventoryId= response.data.id
|
||||
this_.inventoryId = response.data.id
|
||||
this_.state = response.data.status
|
||||
this_.inventoryNo.inventoryNo = response.data.inventoryNumber,
|
||||
this_.inventoryNo.inventoryDate = response.data.inventoryTime,
|
||||
|
||||
this_.orderList.forEach(ord=>{
|
||||
let now = {
|
||||
@ -606,8 +644,8 @@ export default {
|
||||
inventoryId: response.data.id,
|
||||
tankId: ord.tankId,
|
||||
numberId: ord.numberId,
|
||||
currentAveragePrice: ord.discountedPrice,
|
||||
currentInventoryVolume: ord.storedQuantity,
|
||||
currentAveragePrice: ord.currentAveragePrice,
|
||||
currentInventoryVolume: ord.currentInventoryVolume,
|
||||
profitLossAmount: ord.profitLossAmount,
|
||||
stockDifference: ord.stockDifference,
|
||||
inventoryVolume: ord.inventoryVolume
|
||||
@ -618,29 +656,31 @@ export default {
|
||||
disposeBatchApi(oilInventoryOrderList).then(response=> {
|
||||
// 保存成功
|
||||
this.$modal.msgSuccess("保存成功");
|
||||
|
||||
this.getList()
|
||||
|
||||
// 新增列表之后重新刷新
|
||||
this.$router.push({ path: '/oilInventory/order', query: {
|
||||
inventoryId: this_.inventoryId,
|
||||
inventoryNo: this_.inventoryNo.inventoryNo,
|
||||
inventoryDate: this_.inventoryNo.inventoryDate,
|
||||
state: this_.status
|
||||
} });
|
||||
})
|
||||
|
||||
})
|
||||
// 新增列表之后重新刷新
|
||||
this.$router.push({ path: '/oilInventory/order', query: { inventoryId: response.data.id } });
|
||||
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
// 判断是否可以保存
|
||||
saveJudgment(){
|
||||
if (this.inventoryNo.inventoryNo != null && this.inventoryNo.inventoryDate != null && this.orderList.length > 0) {
|
||||
this.saveFlag = false;
|
||||
}
|
||||
// if (this.inventoryNo.inventoryNo != null && this.inventoryNo.inventoryDate != null && this.orderList.length > 0) {
|
||||
// this.saveFlag = false;
|
||||
// }
|
||||
},
|
||||
|
||||
// 保存并审核
|
||||
// saveInventory(){
|
||||
//
|
||||
// },
|
||||
// // 作废
|
||||
// saveInventory(){
|
||||
//
|
||||
// },
|
||||
// 作废
|
||||
// 页面跳转
|
||||
goToAbout() {
|
||||
this.$router.push('/oilConfig/oilInventory/list');
|
||||
@ -651,6 +691,84 @@ export default {
|
||||
this.getList();
|
||||
},
|
||||
|
||||
// 判断按钮是否可用
|
||||
async JudgmentButton(){
|
||||
let judgmentPermissions1 = await this.judgmentPermissions("盘点审核");
|
||||
if (judgmentPermissions1 > 0){
|
||||
this.auditFlag=false,
|
||||
this.voidFlag=false
|
||||
}
|
||||
let judgmentPermissions2 = await this.judgmentPermissions("盘点入库");
|
||||
if (judgmentPermissions2 > 0){
|
||||
this.storageFlag = false
|
||||
}
|
||||
},
|
||||
|
||||
// 判断权限
|
||||
async judgmentPermissions(data) {
|
||||
let fil ={
|
||||
auditPrem:data
|
||||
}
|
||||
return await getAuditPremApi(fil).then(res => {
|
||||
return res.data
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
// 保存并审核
|
||||
audit(){
|
||||
// 保存
|
||||
let number = this.saveInventory();
|
||||
if (number != -1) {
|
||||
// 审核
|
||||
let fil ={
|
||||
id: this.inventoryId
|
||||
}
|
||||
console.log(" id: this.purchaseId",fil)
|
||||
auditInventoryApi(fil).then(res => {
|
||||
this.state = 'ysh'
|
||||
this.$modal.msgWarning("审核成功");
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
// 入库
|
||||
storage() {
|
||||
let this_ = this;
|
||||
if (this_.inventoryNo.inventoryNo == null) {
|
||||
this.$modal.msgWarning("请先选择进货单号");
|
||||
return;
|
||||
}else if (this_.inventoryNo.inventoryDate==null) {
|
||||
this.$modal.msgWarning("请先选择进货时间");
|
||||
return;
|
||||
}
|
||||
// 审核
|
||||
let fil ={
|
||||
id: this.purchaseId
|
||||
}
|
||||
storageInventoryApi(fil).then(res => {
|
||||
this.state = 'qrts'
|
||||
this.$modal.msgWarning("入库成功");
|
||||
})
|
||||
|
||||
},
|
||||
// 作废
|
||||
abolition(){
|
||||
if (this.purchaseId < 0) {
|
||||
this.$modal.msgWarning("数据未保存,不可废弃");
|
||||
return;
|
||||
}
|
||||
// 审核
|
||||
let fil ={
|
||||
id: this.purchaseId
|
||||
}
|
||||
abolitionInventoryApi(fil).then(res => {
|
||||
this.state = 'yzf'
|
||||
this.$modal.msgWarning("审核成功");
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -119,7 +119,7 @@
|
||||
</el-card>
|
||||
|
||||
<el-dialog title="添加" :visible.sync="dialogFormVisible" >
|
||||
<el-form :model="oilNumber" :rules="rules">
|
||||
<el-form ref="oilNumberF" :model="oilNumber" :rules="rules">
|
||||
<el-form-item label="油品类型" prop="oilType">
|
||||
<el-radio-group v-model="oilNumber.oilType" @change="oilTypeClick(oilNumber)">
|
||||
<el-radio
|
||||
@ -162,12 +162,10 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!-- -->
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="油品单价" prop="oilPrice">
|
||||
<el-input v-model.number="oilNumber.oilPrice" style="width: 217px"
|
||||
>
|
||||
<el-input v-model.number="oilNumber.oilPrice" style="width: 217px">
|
||||
<template slot="append">元</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
@ -180,17 +178,13 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
|
||||
|
||||
|
||||
<el-form-item label="收款单位" prop="receivingUnits">
|
||||
<el-radio-group v-model="oilNumber.receivingUnits">
|
||||
<el-radio label="元" ></el-radio>
|
||||
<el-radio label="计价单位"></el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<div class="hui-seiz">点击油品输入的计算单位、可默认元或计价单位(L/m³/kg),页面也可自行切换</div>
|
||||
<div class="hui-seiz">点击油品输入的计算单位、可默认元或计价单位(L/m³/kg),页面也可自行切换</div>
|
||||
<el-form-item label="状态" prop="state">
|
||||
<el-radio-group v-model="oilNumber.state">
|
||||
<el-radio
|
||||
@ -210,7 +204,7 @@
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogFormVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="dialogFormVisible = false,insertOilNumberin()">确 定</el-button>
|
||||
<el-button type="primary" @click="insertOilNumberin()">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
@ -232,7 +226,7 @@
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="油品名称" prop="oilName">
|
||||
<el-select v-model="oilNumber.oilName" style="width: 217px" placeholder="请选择油品名称">
|
||||
<el-select v-model="oilNumber.oilNameT" style="width: 217px" placeholder="请选择油品名称" @change="changeOilName">
|
||||
<el-option
|
||||
v-for="option in oilNameList"
|
||||
:key="option.id"
|
||||
@ -307,9 +301,9 @@
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog title="添加预设" :visible.sync="dialogFormPricesAdd" width="450px">
|
||||
<el-form ref="Priform" :model="oilPresetPrices" label-width="100px" :rules="oilPresetPricesRules">
|
||||
<el-form-item label="预设油号" prop="oilType">
|
||||
<el-select v-model="oilPresetPrices.oilType" placeholder="请选择油号" @change="oilTypeClickByPrice()">
|
||||
<el-form ref="priForm" :model="oilPresetPrices" label-width="100px" :rules="oilPresetPricesRules">
|
||||
<el-form-item label="预设油号" prop="numberId">
|
||||
<el-select v-model="oilPresetPrices.numberId" placeholder="请选择油号" @change="oilTypeClickByPrice()">
|
||||
<el-option
|
||||
v-for="option in selectOilTypeByPrice"
|
||||
:key="option.numberId"
|
||||
@ -380,7 +374,7 @@ import {
|
||||
data() {
|
||||
return {
|
||||
oilPresetPricesRules: {
|
||||
oilType:[
|
||||
numberId:[
|
||||
{ required: true, message: '请选择油品类型', trigger: 'change' }
|
||||
],
|
||||
presetOilPrices: [
|
||||
@ -392,7 +386,7 @@ import {
|
||||
{ type: 'number', message: '价格必须为数字值'}
|
||||
],
|
||||
effectiveTime:[
|
||||
{ type: 'date', required: true, message: '请选择日期', trigger: 'change' }
|
||||
{ required: true, message: '请选择日期', trigger: 'change' }
|
||||
],
|
||||
},
|
||||
rules: {
|
||||
@ -469,7 +463,7 @@ import {
|
||||
presetGbPrice:null ,
|
||||
createTime:'',
|
||||
updateTime:'',
|
||||
effectiveTime:'',
|
||||
effectiveTime:null,
|
||||
ifDelete:'',
|
||||
numberId:'',
|
||||
},
|
||||
@ -611,31 +605,52 @@ import {
|
||||
|
||||
// 打开修改窗口
|
||||
openOilNumberEdit(item) {
|
||||
|
||||
console.log("item",item)
|
||||
this.oilNumber = {}
|
||||
this.oilNumber = item
|
||||
this.oilTypeClick(item)
|
||||
},
|
||||
|
||||
// 添加
|
||||
insertOilNumberin(){
|
||||
insertOilNumber(this.oilNumber).then( response => {
|
||||
var list = response.data
|
||||
this.getList();
|
||||
this.$refs["oilNumberF"].validate(valid => {
|
||||
if (valid) {
|
||||
insertOilNumber(this.oilNumber).then( response => {
|
||||
var list = response.data
|
||||
if (list == 0) {
|
||||
this.$modal.msgWarning("有重复油号");
|
||||
}else if(list > 0){
|
||||
this.$modal.msgSuccess("新增油号成功");
|
||||
this.dialogFormVisible = false,
|
||||
this.getList();
|
||||
}
|
||||
|
||||
console.log("updateOilNumber",list)
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
console.log("updateOilNumber",list)
|
||||
});
|
||||
},
|
||||
|
||||
// 修改
|
||||
async updateOilNumberin(){
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
this.dialogFormNumberEdit = false
|
||||
|
||||
var this_ = this
|
||||
updateOilNumber(this_.oilNumber).then( response => {
|
||||
var list = response.data
|
||||
this.getList();
|
||||
console.log("updateOilNumber",list)
|
||||
if ( list < 0) {
|
||||
this.$modal.msgWarning("油品重复");
|
||||
} else {
|
||||
this.getList();
|
||||
this.dialogFormNumberEdit = false
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
}
|
||||
|
||||
}).catch(res=>{
|
||||
this.$modal.msgError("修改失败");
|
||||
});
|
||||
}
|
||||
})
|
||||
@ -683,11 +698,12 @@ import {
|
||||
|
||||
this.oilPresetPricesList.forEach(oilNumber => {
|
||||
this.AllOilList.forEach(oil => {
|
||||
if (parseInt(oilNumber.oilType) === oil.id) {
|
||||
oilNumber.oilNameT = oil.oilName;
|
||||
if (parseInt(oilNumber.oilType) == oil.id) {
|
||||
oilNumber.oilNameT = oil.oilType+' '+oil.oilName;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
},
|
||||
// 油价预设查询列表
|
||||
@ -710,12 +726,14 @@ import {
|
||||
insertOilPresePrices(){
|
||||
// console.log(typeof oilPresetPrices.presetOilPrices);
|
||||
console.log("typeof oilPresetPrices.presetOilPrices",this.oilPresetPrices);
|
||||
this.$refs["Priform"].validate(valid => {
|
||||
|
||||
this.$refs["priForm"].validate(valid => {
|
||||
if (valid) {
|
||||
this.dialogFormPricesAdd = false
|
||||
insertOilPresePricesApi(this.oilPresetPrices).then(response => {
|
||||
var list = response.data
|
||||
this.getOilNameList();
|
||||
this.getAllOilList();
|
||||
});
|
||||
}
|
||||
});
|
||||
@ -723,8 +741,8 @@ import {
|
||||
|
||||
// 更改状态
|
||||
deleteRow(data1, data2) {
|
||||
console.log("data2",data2);
|
||||
stopJobApi(data2).then( response => {
|
||||
this.$modal.msgSuccess("停止成功");
|
||||
this.getOilPresetListin();
|
||||
|
||||
});
|
||||
@ -733,15 +751,19 @@ import {
|
||||
|
||||
// 新增油价预设
|
||||
oilTypeClickByPrice() {
|
||||
var count = this.oilPresetPrices.oilType;
|
||||
|
||||
var count = this.oilPresetPrices.numberId;
|
||||
console.log("this.selectOilTypeByPrice",this.selectOilTypeByPrice)
|
||||
this.selectOilTypeByPrice.forEach((oil) => {
|
||||
if (oil.numberId == parseInt(count)) {
|
||||
this.oilPresetPrices.currentPetrolPrices = oil.oilPrice;
|
||||
this.oilPresetPrices.currentGbPrice = oil.gbPrice;
|
||||
this.oilPresetPrices.numberId = oil.numberId;
|
||||
this.oilPresetPrices.oilType = oil.id;
|
||||
}
|
||||
});
|
||||
},
|
||||
changeOilName() {
|
||||
this.oilNumber.oilName = this.oilNumber.oilNameT
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -750,7 +772,7 @@ import {
|
||||
<style scoped>
|
||||
.app-container{
|
||||
width: 100%;
|
||||
|
||||
height: 100%;
|
||||
background: #f6f8f9;
|
||||
}
|
||||
.top-box{
|
||||
|
@ -85,7 +85,6 @@
|
||||
<el-table-column label="制单日期" align="center" prop="createdAt" width="200">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createdAt) }}</span>
|
||||
Missing import statement
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
@ -96,12 +95,12 @@
|
||||
icon="el-icon-edit"
|
||||
@click="dispose(scope.row)"
|
||||
>处理单据</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-copy-document"
|
||||
@click="handleDel(scope.row.id)"
|
||||
>删除</el-button>
|
||||
<!-- <el-button-->
|
||||
<!-- size="mini"-->
|
||||
<!-- type="text"-->
|
||||
<!-- icon="el-icon-copy-document"-->
|
||||
<!-- @click="handleDel(scope.row.id)"-->
|
||||
<!-- >删除</el-button>-->
|
||||
<!-- v-hasPermi="['']"-->
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -123,7 +122,8 @@
|
||||
<script>
|
||||
import {getPurchaseApi, getPurchaseOrderApi} from "@/api/oilConfig/oilPurchase";
|
||||
import {getSuppliersListApi2} from "@/api/oilConfig/oilSuppliers";
|
||||
import {getName,parseTime} from "@/utils/fuint";
|
||||
import {getName,parseTime} from "../../../utils/fuint";
|
||||
|
||||
|
||||
export default {
|
||||
name: "list",
|
||||
@ -191,7 +191,8 @@ export default {
|
||||
path: '/oilPurchase/purchaseOrder',
|
||||
query: {
|
||||
purchaseId: data.id,
|
||||
purchaseNo: data.purchaseNo
|
||||
purchaseNo: data.purchaseNo,
|
||||
state: data.status
|
||||
}
|
||||
});
|
||||
},
|
||||
|
@ -43,9 +43,10 @@
|
||||
</div>
|
||||
</div>
|
||||
<div style="height: 100%; width: 30%; display: flex; align-items: center; justify-content: flex-end;">
|
||||
<el-button type="primary" :disabled="saveFlag" @click="savePurchase()">保存</el-button>
|
||||
<el-button type="success" :disabled="auditFlag" >保存并审核</el-button>
|
||||
<el-button type="warning" :disabled="voidFlag">作废</el-button>
|
||||
<el-button type="primary" v-if="state=='await'" :disabled="saveFlag" @click="savePurchase()">保存</el-button>
|
||||
<el-button type="success" v-if="state=='await'" :disabled="auditFlag" @click="audit">保存并审核</el-button>
|
||||
<el-button type="success" v-if="state=='ysh'" :disabled="storageFlag" @click="storage">收货并入库</el-button>
|
||||
<el-button type="warning" v-if="state!='yzf' || state!='qrts'" :disabled="voidFlag" @click="abolition()">作废</el-button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@ -166,7 +167,7 @@
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="22">
|
||||
<el-form-item label="油品密度" prop="productDensity">
|
||||
<el-input v-model="orderForm.productDensity" placeholder="请输入油品密度" >
|
||||
<el-input v-model.number="orderForm.productDensity" placeholder="请输入油品密度" >
|
||||
<template slot="append">g/ml</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
@ -175,7 +176,7 @@
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="22">
|
||||
<el-form-item label="采购吨数" prop="purchaseWeight">
|
||||
<el-input v-model="orderForm.purchaseWeight" placeholder="请输入采购吨数" >
|
||||
<el-input v-model.number="orderForm.purchaseWeight" placeholder="请输入采购吨数" >
|
||||
<template slot="append">吨</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
@ -213,11 +214,12 @@ import {
|
||||
insertPurchaseApi,
|
||||
insertPurchaseOrderApi,
|
||||
updatePurchaseOrderApi,
|
||||
updatePurchaseApi
|
||||
updatePurchaseApi, auditApi, abolitionApi, storageApi
|
||||
} from "@/api/oilConfig/oilPurchase";
|
||||
import {getOilNameListApi} from "@/api/oilPrice";
|
||||
import {selectTankByNumberApi} from "@/api/oilConfig/oilGuns";
|
||||
import {BigNumber} from "bignumber.js";
|
||||
import {getAuditPremApi} from "@/api/oilConfig/staff";
|
||||
|
||||
export default {
|
||||
name: "purchaseOrder",
|
||||
@ -256,10 +258,11 @@ export default {
|
||||
tankList:[],
|
||||
suppliersList:[],
|
||||
|
||||
saveFlag:true,
|
||||
saveFlag:false,
|
||||
auditFlag:true,
|
||||
voidFlag:true,
|
||||
|
||||
storageFlag:true,
|
||||
state:'',
|
||||
|
||||
// 弹出框标题
|
||||
title:'',
|
||||
@ -282,16 +285,35 @@ export default {
|
||||
// 默认排序
|
||||
defaultSort: {prop: 'createTime', order: 'descending'},
|
||||
// 表单校验
|
||||
rules: {
|
||||
supplierName: [
|
||||
{ required: true, message: "供应商名称不能为空", trigger: "blur" },
|
||||
],
|
||||
},
|
||||
|
||||
purchaseForm: {
|
||||
purchaseNo: null,
|
||||
purchaseDate: null
|
||||
},
|
||||
|
||||
// 表单校验
|
||||
rules: {
|
||||
productDensity: [
|
||||
{required: true, message: "不能为空", trigger: "blur"},
|
||||
],
|
||||
purchaseWeight: [
|
||||
{required: true, message: "不能为空", trigger: "blur"},
|
||||
],
|
||||
purchasePrice: [
|
||||
{required: true, message: "不能为空", trigger: "blur"},
|
||||
],
|
||||
numberId: [
|
||||
{required: true, message: "请选择", trigger: "blur"}
|
||||
],
|
||||
tankId: [
|
||||
{required: true, message: "请选择", trigger: "blur"}
|
||||
] ,
|
||||
supplierId: [
|
||||
{required: true, message: "请选择", trigger: "blur"}
|
||||
]
|
||||
},
|
||||
|
||||
|
||||
form: {
|
||||
id: "", // ID(标识)
|
||||
productDensity: "", // 产品密度
|
||||
@ -310,22 +332,30 @@ export default {
|
||||
},
|
||||
|
||||
async created() {
|
||||
console.log("yourParamKey",this.$route.query.purchaseId)
|
||||
this.queryParams.purchaseId = this.$route.query.purchaseId;
|
||||
this.purchaseId = this.$route.query.purchaseId;
|
||||
console.log("yourParamKey2",this.$route.query.purchaseId)
|
||||
|
||||
if (this.$route.query.purchaseId == null) {
|
||||
|
||||
|
||||
if (this.$route.query.purchaseId != null) {
|
||||
this.queryParams.purchaseId = this.$route.query.purchaseId;
|
||||
this.purchaseId = this.$route.query.purchaseId;
|
||||
this.state = this.$route.query.state;
|
||||
}else if (this.$route.query.purchaseId == null && this.purchaseId>0) {
|
||||
|
||||
}else {
|
||||
this.queryParams.purchaseId = -parseInt(new Date().getTime())% 100000000;
|
||||
this.purchaseId = -parseInt(new Date().getTime()) % 100000000;
|
||||
}
|
||||
if ( this.state == null) {
|
||||
this.state = 'await'
|
||||
}
|
||||
|
||||
this.purchaseForm.purchaseNo = this.$route.query.purchaseNo;
|
||||
|
||||
if (this.purchaseForm.purchaseNo == null) {
|
||||
this.refresh();
|
||||
}
|
||||
console.log("yourParamKey3",this.$route.query.purchaseId)
|
||||
|
||||
await this.JudgmentButton();
|
||||
await this.getList();
|
||||
|
||||
},
|
||||
@ -369,7 +399,7 @@ export default {
|
||||
insertPurchaseOrderApi(this.orderForm).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.saveJudgment()
|
||||
// this.saveJudgment()
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
@ -463,6 +493,14 @@ export default {
|
||||
},
|
||||
// 保存订单信息
|
||||
savePurchase(){
|
||||
if (this.purchaseForm.purchaseNo == null) {
|
||||
this.$modal.msgWarning("请先选择进货单号");
|
||||
return -1;
|
||||
}else if (this.purchaseForm.purchaseDate==null) {
|
||||
this.$modal.msgWarning("请先选择进货时间");
|
||||
return -1;
|
||||
}
|
||||
|
||||
let from = {
|
||||
purchaseNo : this.purchaseForm.purchaseNo,
|
||||
purchaseDate : this.purchaseForm.purchaseDate,
|
||||
@ -477,12 +515,20 @@ export default {
|
||||
purchaseId:response.data.id,
|
||||
id:this.queryParams.purchaseId
|
||||
}
|
||||
console.log("oilPurchase",oilPurchase)
|
||||
this.queryParams.purchaseId = response.data.id,
|
||||
this.purchaseId = response.data.id,
|
||||
this.purchaseNo = response.data.purchaseNo,
|
||||
this.state = response.data.status,
|
||||
//todo 优化 将这些代码加到后台中完成并进行事务管理
|
||||
editPurchuseApi(oilPurchase).then(response => {
|
||||
this.$router.push({ path: '/oilPurchase/purchaseOrder', query: { purchaseId: oilPurchase.purchaseId } });
|
||||
editPurchuseApi(oilPurchase).then(response2 => {
|
||||
this.$router.push({ path: '/oilPurchase/purchaseOrder', query: {
|
||||
purchaseId: oilPurchase.purchaseId,
|
||||
purchaseNo: response.data.purchaseNo,
|
||||
state: response.data.status
|
||||
}
|
||||
});
|
||||
})
|
||||
// this.getList();
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
from.id = this.queryParams.purchaseId
|
||||
@ -493,20 +539,89 @@ export default {
|
||||
},
|
||||
// 判断是否可以保存
|
||||
saveJudgment(){
|
||||
if (this.purchaseForm.purchaseNo != null && this.purchaseForm.purchaseDate != null && this.orderList.length > 0) {
|
||||
this.saveFlag = false;
|
||||
// if (this.purchaseForm.purchaseNo != null && this.purchaseForm.purchaseDate != null && this.orderList.length > 0) {
|
||||
// this.saveFlag = false;
|
||||
// }
|
||||
},
|
||||
// 判断按钮是否可用
|
||||
async JudgmentButton(){
|
||||
let judgmentPermissions1 = await this.judgmentPermissions("进油审核");
|
||||
if (judgmentPermissions1 > 0){
|
||||
this.auditFlag=false,
|
||||
this.voidFlag=false
|
||||
}
|
||||
let judgmentPermissions2 = await this.judgmentPermissions("进油入库");
|
||||
if (judgmentPermissions2 > 0){
|
||||
this.storageFlag = false
|
||||
}
|
||||
},
|
||||
|
||||
// 判断权限
|
||||
async judgmentPermissions(data) {
|
||||
let fil ={
|
||||
auditPrem:data
|
||||
}
|
||||
return await getAuditPremApi(fil).then(res => {
|
||||
return res.data
|
||||
});
|
||||
},
|
||||
|
||||
// 保存并审核
|
||||
// savePurchase(){
|
||||
//
|
||||
// },
|
||||
// // 作废
|
||||
// savePurchase(){
|
||||
//
|
||||
// },
|
||||
audit(){
|
||||
// 保存
|
||||
let number = this.savePurchase();
|
||||
if (number != -1) {
|
||||
// 审核
|
||||
let fil ={
|
||||
id: this.purchaseId
|
||||
}
|
||||
console.log(" id: this.purchaseId",fil)
|
||||
auditApi(fil).then(res => {
|
||||
this.state = 'ysh'
|
||||
|
||||
this.$modal.msgWarning("审核成功");
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
// 入库
|
||||
storage() {
|
||||
if (this.purchaseForm.purchaseNo == null) {
|
||||
this.$modal.msgWarning("请先选择进货单号");
|
||||
return;
|
||||
}else if (this.purchaseForm.purchaseDate==null) {
|
||||
this.$modal.msgWarning("请先选择进货时间");
|
||||
return;
|
||||
}
|
||||
// 审核
|
||||
let fil ={
|
||||
id: this.purchaseId
|
||||
}
|
||||
storageApi(fil).then(res => {
|
||||
this.state = 'qrts'
|
||||
this.$modal.msgWarning("入库成功");
|
||||
})
|
||||
|
||||
},
|
||||
// 作废
|
||||
abolition(){
|
||||
if (this.purchaseId < 0) {
|
||||
this.$modal.msgWarning("数据未保存,不可废弃");
|
||||
return;
|
||||
}
|
||||
// 审核
|
||||
let fil ={
|
||||
id: this.purchaseId
|
||||
}
|
||||
abolitionApi(fil).then(res => {
|
||||
this.state = 'yzf'
|
||||
this.$modal.msgWarning("审核成功");
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
// 页面跳转
|
||||
goToAbout() {
|
||||
this.$router.push('/oilConfig/oilPurchase/list');
|
||||
|
@ -1,5 +1,5 @@
|
||||
# 数据库配置
|
||||
spring.datasource.url=jdbc:mysql://192.168.1.4:3306/fuint-db?useUnicode=true&characterEncoding=UTF8&useSSL=false
|
||||
spring.datasource.url=jdbc:mysql://192.168.1.5:3306/fuint-db?useUnicode=true&characterEncoding=UTF8&useSSL=false&allowMultiQueries=true
|
||||
spring.datasource.username=root
|
||||
spring.datasource.password=qqzcy@1014
|
||||
|
||||
|
@ -72,4 +72,14 @@ public class LJStaffController extends BaseController {
|
||||
public ResponseObject edit(@Validated @RequestBody LJStaff staff){
|
||||
return getSuccessResult(mtStaffService.updateStaff(staff));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询权限
|
||||
* @param auditPrem
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("auditPrem")
|
||||
public ResponseObject auditPrem(String auditPrem) {
|
||||
return getSuccessResult(mtStaffService.auditPrem(auditPrem));
|
||||
}
|
||||
}
|
||||
|
@ -58,4 +58,10 @@ public interface LJStaffMapper extends BaseMapper<LJStaff> {
|
||||
LJStaff queryStaffByMobile(@Param("mobile") String mobile);
|
||||
|
||||
LJStaff queryStaffByUserId(@Param("userId") Integer userId);
|
||||
|
||||
/**
|
||||
* 查询员工权限
|
||||
*/
|
||||
int auditPrem(@Param("id")Integer id,@Param("auditPrem") String auditPrem);
|
||||
|
||||
}
|
||||
|
@ -150,4 +150,9 @@
|
||||
<select id="queryStaffByUserId" resultType="com.fuint.business.member.entity.LJStaff">
|
||||
select * from mt_staff t where t.USER_ID = #{userId} and t.AUDITED_STATUS != 'D'
|
||||
</select>
|
||||
<select id="auditPrem" resultType="java.lang.Integer">
|
||||
select count(*)
|
||||
from mt_staff
|
||||
where id = #{id} and audit_prem like concat('%', #{auditPrem}, '%')
|
||||
</select>
|
||||
</mapper>
|
||||
|
@ -48,4 +48,6 @@ public interface ILJStaffService extends IService<LJStaff> {
|
||||
* @return
|
||||
*/
|
||||
public int updateStaff(LJStaff staff);
|
||||
|
||||
public int auditPrem(String auditPrem);
|
||||
}
|
||||
|
@ -86,4 +86,11 @@ public class LJStaffServiceImpl extends ServiceImpl<LJStaffMapper, LJStaff> impl
|
||||
int row = baseMapper.updateById(staff);
|
||||
return row;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int auditPrem(String auditPrem) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
int row = baseMapper.auditPrem(nowAccountInfo.getStaffId(),auditPrem);
|
||||
return row;
|
||||
}
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ public class OilInventoryController extends BaseController {
|
||||
* @return 新增结果
|
||||
*/
|
||||
@PostMapping
|
||||
public ResponseObject add(OilInventory oilInventory) {
|
||||
public ResponseObject add(@RequestBody OilInventory oilInventory) {
|
||||
return getSuccessResult(this.oilInventoryService.insert(oilInventory));
|
||||
}
|
||||
|
||||
@ -83,7 +83,7 @@ public class OilInventoryController extends BaseController {
|
||||
* @return 编辑结果
|
||||
*/
|
||||
@PutMapping
|
||||
public ResponseObject edit(OilInventory oilInventory) {
|
||||
public ResponseObject edit(@RequestBody OilInventory oilInventory) {
|
||||
return getSuccessResult(this.oilInventoryService.update(oilInventory));
|
||||
}
|
||||
|
||||
|
@ -120,5 +120,26 @@ public class OilInventoryOrderController extends BaseController {
|
||||
return getSuccessResult(this.oilInventoryOrderService.deleteById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 盘点审核
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("audit")
|
||||
public ResponseObject audit(Integer id) {
|
||||
return getSuccessResult(this.oilInventoryOrderService.audit(id));
|
||||
}
|
||||
|
||||
@GetMapping("abolition")
|
||||
public ResponseObject abolition(Integer id) {
|
||||
return getSuccessResult(this.oilInventoryOrderService.abolition(id));
|
||||
}
|
||||
|
||||
@GetMapping("storage")
|
||||
public ResponseObject storage(Integer id) {
|
||||
return getSuccessResult(this.oilInventoryOrderService.storage(id));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -44,7 +44,7 @@ public class OilNumberController extends BaseController {
|
||||
@ApiOperation("查询所有油号")
|
||||
@GetMapping("getList")
|
||||
public ResponseObject selectAll(@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize,
|
||||
@RequestParam(value = "pageSize",defaultValue = "10000") Integer pageSize,
|
||||
OilNumber oilNumber) {
|
||||
Page page =new Page(pageNo,pageSize);
|
||||
IPage<OilNumber> list = oilPresetPricesService.selectOilNumberList(page,oilNumber);
|
||||
|
@ -105,6 +105,7 @@ public class OilPurchaseController extends BaseController {
|
||||
oilPurchase.setCreateBy(nowAccountInfo.getStaffId().toString());
|
||||
oilPurchase.setCreator(nowAccountInfo.getStaffId().toString());
|
||||
|
||||
oilPurchase.setStatus("await");
|
||||
// 获取当前时间
|
||||
// Date currentDate = new Date();
|
||||
oilPurchase.setCreatedAt(new Date());
|
||||
@ -113,7 +114,6 @@ public class OilPurchaseController extends BaseController {
|
||||
//
|
||||
// // 使用SimpleDateFormat格式化日期时间
|
||||
// String formattedDate = dateFormat.format(currentDate);
|
||||
//todo 找到并存储审核人
|
||||
return getSuccessResult(this.oilPurchaseService.insert(oilPurchase));
|
||||
}
|
||||
|
||||
|
@ -105,5 +105,26 @@ public class OilPurchaseOrderController extends BaseController {
|
||||
return getSuccessResult(this.oilPurchaseOrderService.deleteById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 进油审核
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("audit")
|
||||
public ResponseObject audit(Integer id) {
|
||||
return getSuccessResult(this.oilPurchaseOrderService.audit(id));
|
||||
}
|
||||
|
||||
@GetMapping("abolition")
|
||||
public ResponseObject abolition(Integer id) {
|
||||
return getSuccessResult(this.oilPurchaseOrderService.abolition(id));
|
||||
}
|
||||
|
||||
@GetMapping("storage")
|
||||
public ResponseObject storage(Integer id) {
|
||||
return getSuccessResult(this.oilPurchaseOrderService.storage(id));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -35,6 +35,8 @@ public class OilNumber extends BaseEntity {
|
||||
private String unit; //
|
||||
private Integer storeId; //
|
||||
private Double oilDensity; //油品密度
|
||||
public Integer id; //id(主键)
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -99,5 +99,8 @@ public interface OilInventoryOrderMapper {
|
||||
|
||||
int delOrder(Integer inventoryId);
|
||||
|
||||
int editStateById(@Param("id") Integer id,@Param("status") String status);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -55,6 +55,5 @@ public interface OilNumberMapper extends BaseMapper<OilNumber> {
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -93,6 +93,13 @@ public interface OilPurchaseOrderMapper {
|
||||
*/
|
||||
int deleteById(Integer id);
|
||||
|
||||
/**
|
||||
* 修改状态
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
int editStateById(@Param("id") Integer id,@Param("status") String status);
|
||||
|
||||
|
||||
/**
|
||||
* 根据油罐查找对应的所有的订单(已完成)
|
||||
|
@ -88,5 +88,11 @@ public interface OilTankMapper {
|
||||
|
||||
int cleanData(Integer id);
|
||||
|
||||
/**
|
||||
* 修改累加
|
||||
*/
|
||||
int accumulate(OilTank oilTank);
|
||||
|
||||
int accumulate2(OilTank oilTank);
|
||||
}
|
||||
|
||||
|
@ -143,7 +143,7 @@
|
||||
<!--新增所有列-->
|
||||
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into oil_gun(gun_name, tank_id, status, store_id, create_time, update_time, create_by, update_by, number_id)
|
||||
values (#{gunName}, #{tankId}, #{status}, #{storeId}, #{createTime}, #{updateTime}, #{createBy}, #{updateBy}, #{numberId})
|
||||
values (#{gunName}, #{tankId}, #{status}, #{storeId}, #{createTime}, #{createTime}, #{createBy}, #{updateBy}, #{numberId})
|
||||
</insert>
|
||||
|
||||
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
@ -191,7 +191,7 @@
|
||||
create_time = #{createTime},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime},
|
||||
update_time = NOW(),
|
||||
</if>
|
||||
<if test="createBy != null">
|
||||
create_by = #{createBy},
|
||||
|
@ -161,7 +161,7 @@
|
||||
<!--新增所有列-->
|
||||
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into oil_inventory(inventory_number, inventory_time, inventory_volume, stock_difference, profit_loss_amount, creator, reviewer, order_time, status, store_id, create_time, update_time, create_by, update_by)
|
||||
values (#{inventoryNumber}, #{inventoryTime}, #{inventoryVolume}, #{stockDifference}, #{profitLossAmount}, #{creator}, #{reviewer}, #{orderTime}, #{status}, #{storeId}, #{createTime}, #{updateTime}, #{createBy}, #{updateBy})
|
||||
values (#{inventoryNumber}, #{inventoryTime}, #{inventoryVolume}, #{stockDifference}, #{profitLossAmount}, #{creator}, #{reviewer}, #{createTime}, #{status}, #{storeId}, #{createTime}, #{createTime}, #{createBy}, #{updateBy})
|
||||
</insert>
|
||||
|
||||
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
|
@ -143,6 +143,9 @@
|
||||
LEFT JOIN oil_tank ot ON ot.id = oi.tank_id
|
||||
LEFT JOIN oil_number n ON oi.number_id = n.number_id
|
||||
LEFT JOIN oil_name onn ON n.oil_name = onn.id
|
||||
where
|
||||
oi.store_id = #{oilInventoryOrder.storeId}
|
||||
and oi.inventory_id = #{oilInventoryOrder.inventoryId}
|
||||
</select>
|
||||
|
||||
|
||||
@ -225,9 +228,6 @@
|
||||
<if test="storeId != null">
|
||||
store_id = #{storeId},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime},
|
||||
</if>
|
||||
@ -272,12 +272,6 @@
|
||||
<if test="user.storeId != null">
|
||||
store_id = #{user.storeId},
|
||||
</if>
|
||||
<if test="user.createTime != null">
|
||||
create_time = #{user.createTime},
|
||||
</if>
|
||||
<if test="user.createBy != null">
|
||||
create_by = #{user.createBy},
|
||||
</if>
|
||||
<if test="user.updateBy != null">
|
||||
update_by = #{user.updateBy},
|
||||
</if>
|
||||
@ -297,5 +291,11 @@
|
||||
delete from oil_inventory_order where inventory_id = #{inventoryId}
|
||||
</delete>
|
||||
|
||||
<update id="editStateById">
|
||||
update oil_inventory set
|
||||
status = #{status}
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
||||
|
@ -28,6 +28,7 @@
|
||||
|
||||
<select id="selectOilNumberList" resultMap="OilNumberResult">
|
||||
<include refid="selectOilNumber"></include>
|
||||
where store_id = #{oilNumber.storeId}
|
||||
</select>
|
||||
|
||||
<!-- select-->
|
||||
@ -50,13 +51,14 @@
|
||||
<if test="gbPrice != null">gb_price,</if>
|
||||
<if test="receivingUnits != null">receiving_units,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="createTime != null">update_time,</if>
|
||||
<if test="state != null">state,</if>
|
||||
<if test="sort != null">sort,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="ifDelete != null">if_delete,</if>
|
||||
<if test="unit != null">unit,</if>
|
||||
<if test="storeId != null">store_id,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides="," >
|
||||
<if test=" oilType != null">#{oilType },</if>
|
||||
@ -64,14 +66,15 @@
|
||||
<if test=" oilPrice != null">#{oilPrice },</if>
|
||||
<if test=" gbPrice != null">#{gbPrice },</if>
|
||||
<if test=" receivingUnits != null">#{receivingUnits},</if>
|
||||
<if test=" createTime != null">#{createTime },</if>
|
||||
<if test=" updateTime != null">#{updateTime },</if>
|
||||
<if test=" createTime != null">#{createTime},</if>
|
||||
<if test=" createTime != null">#{createTime},</if>
|
||||
<if test=" state != null">#{state },</if>
|
||||
<if test=" sort != null">#{sort },</if>
|
||||
<if test=" remark != null">#{remark },</if>
|
||||
<if test=" ifDelete != null">#{ifDelete },</if>
|
||||
<if test=" unit != null">#{unit},</if>
|
||||
<if test=" storeId != null">#{storeId},</if>
|
||||
<if test=" createBy != null">#{createBy},</if>
|
||||
</trim>
|
||||
|
||||
</insert>
|
||||
@ -83,12 +86,13 @@
|
||||
<if test=" oilPrice != null and oilPrice != ''" >oil_price= #{oilPrice},</if>
|
||||
<if test=" gbPrice != null and gbPrice != ''">gb_price= #{gbPrice},</if>
|
||||
<if test=" receivingUnits != null and receivingUnits != ''">receiving_units= #{receivingUnits},</if>
|
||||
<if test=" createTime != null">create_time= #{createTime},</if>
|
||||
<if test=" updateTime != null">update_time= #{updateTime},</if>
|
||||
<if test=" state != null and state != ''"> state = #{state},</if>
|
||||
<if test=" sort != null and sort != ''">sort= #{sort},</if>
|
||||
<if test=" remark != null and remark != ''">remark= #{remark},</if>
|
||||
<if test=" updateBy != null and updateBy != ''">update_by= #{updateBy},</if>
|
||||
<if test=" unit != null and unit != ''">unit= #{unit},</if>
|
||||
update_time= NOW()
|
||||
|
||||
</set>
|
||||
where number_id = #{numberId}
|
||||
</update>
|
||||
@ -97,7 +101,7 @@
|
||||
</delete>
|
||||
|
||||
<select id="getOilName" resultType="com.fuint.business.petrolStationManagement.entity.OilNumber">
|
||||
select onm.number_id numberId,name.oil_name oilName, name.oil_type oilType,onm.oil_price oilPrice ,onm.gb_price gbPrice, name.oil_density oilDensity,onm.unit unit
|
||||
select name.id id, onm.number_id numberId,name.oil_name oilName, name.oil_type oilType,onm.oil_price oilPrice ,onm.gb_price gbPrice, name.oil_density oilDensity,onm.unit unit
|
||||
from oil_number onm
|
||||
left join oil_name name on onm.oil_name = name.id
|
||||
<where>
|
||||
@ -106,15 +110,17 @@
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="selectOilNameByStore" resultType="com.fuint.business.petrolStationManagement.entity.OilNumber">
|
||||
<select id="selectOilNameByStore" resultType="java.lang.Integer">
|
||||
select count(*)
|
||||
from oil_number
|
||||
WHERE store_id = #{storeId}
|
||||
and
|
||||
oil_name = #{oilName}
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<!-- oilType-->
|
||||
<!-- oilName-->
|
||||
<!-- oilPrice-->
|
||||
|
@ -49,11 +49,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test=" currentGbPrice != null">current_gb_price,</if>
|
||||
<if test=" presetGbPrice != null">preset_gb_price,</if>
|
||||
<if test=" createTime != null">create_time,</if>
|
||||
<if test=" updateTime != null">update_time,</if>
|
||||
<if test=" createTime != null">update_time,</if>
|
||||
<if test=" effectiveTime != null">effective_time,</if>
|
||||
<if test=" ifDelete != null">if_delete,</if>
|
||||
<if test=" state != null">state,</if>
|
||||
<if test=" numberId != null">number_id,</if>
|
||||
<if test=" storeId != null">store_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides="," >
|
||||
<if test=" oilType != null">#{oilType},</if>
|
||||
@ -62,11 +63,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test=" currentGbPrice != null">#{currentGbPrice},</if>
|
||||
<if test=" presetGbPrice != null">#{presetGbPrice},</if>
|
||||
<if test=" createTime != null">#{createTime},</if>
|
||||
<if test=" updateTime != null">#{updateTime},</if>
|
||||
<if test=" createTime != null">#{createTime},</if>
|
||||
<if test=" effectiveTime != null">#{effectiveTime},</if>
|
||||
<if test=" ifDelete != null">#{ifDelete},</if>
|
||||
<if test=" state != null">#{state},</if>
|
||||
<if test=" numberId != null">#{numberId},</if>
|
||||
<if test=" storeId != null">#{storeId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateOilPresetPrices">
|
||||
@ -76,8 +78,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test=" currentPetrolPrices != null"> oil_type = #{currentPetrolPrices},</if>
|
||||
<if test=" presetOilPrices != null"> current_petrol_prices = #{presetOilPrices},</if>
|
||||
<if test=" currentGbPrice != null"> preset_oil_prices = #{currentGbPrice},</if>
|
||||
<if test=" presetGbPrice != null"> current_gb_price = #{presetGbPrice},</if>
|
||||
<if test=" createTime != null"> preset_gb_price = #{createTime},</if>
|
||||
<if test=" presetGbPrice != null"> presetGbPrice = #{presetGbPrice},</if>
|
||||
<if test=" updateTime != null"> create_time = #{updateTime},</if>
|
||||
<if test=" effectiveTime != null"> update_time = #{effectiveTime},</if>
|
||||
<if test=" ifDelete != null"> effective_time = #{ifDelete},</if>
|
||||
|
@ -134,6 +134,7 @@
|
||||
opo.total_amount totalAmount,
|
||||
opo.purchase_volume purchaseVolume,
|
||||
opo.discounted_price discountedPrice,
|
||||
opo.tank_id tankId ,
|
||||
onn.oil_type oilType,
|
||||
onn.oil_name oilName,
|
||||
os.supplier_name supplierName,
|
||||
@ -147,6 +148,11 @@
|
||||
LEFT JOIN oil_name onn ON onn.id = o.oil_name
|
||||
LEFT JOIN oil_tank ot ON ot.id = opo.tank_id
|
||||
LEFT JOIN oil_suppliers os ON os.id = opo.supplier_id
|
||||
<where>
|
||||
<if test="purchaseId != null">
|
||||
opo.purchase_id = #{purchaseId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!--新增所有列-->
|
||||
@ -225,6 +231,12 @@
|
||||
where purchase_id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="editStateById">
|
||||
update oil_purchase set
|
||||
status = #{status}
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<!--删除-->
|
||||
<delete id="delPurchuse">
|
||||
delete from oil_purchase_order where purchase_id < 0 and create_time < DATE_SUB(NOW(), INTERVAL 1 DAY);
|
||||
|
@ -218,7 +218,7 @@
|
||||
<!--新增所有列-->
|
||||
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into oil_tank(tank_name, oil_number, tank_volume, lower_warning, oil_density, stored_quantity, total_price, discounted_price, status, remarks, store_id, number_id, create_time, update_time, create_by, update_by,inventory_Statistics,unit)
|
||||
values (#{tankName}, #{oilNumber}, #{tankVolume}, #{lowerWarning}, #{oilDensity}, #{storedQuantity}, #{totalPrice}, #{discountedPrice}, #{status}, #{remarks}, #{storeId}, #{numberId}, #{createTime}, #{updateTime}, #{createBy}, #{updateBy}, #{inventoryStatistics},#{unit})
|
||||
values (#{tankName}, #{oilNumber}, #{tankVolume}, #{lowerWarning}, #{oilDensity}, #{storedQuantity}, #{totalPrice}, #{discountedPrice}, #{status}, #{remarks}, #{storeId}, #{numberId}, #{createTime}, #{createTime}, #{createBy}, #{updateBy}, #{inventoryStatistics},#{unit})
|
||||
</insert>
|
||||
|
||||
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
@ -321,8 +321,21 @@
|
||||
<update id="cleanData">
|
||||
update oil_tank set stored_quantity = 0.00 ,total_price = 0.00, discounted_price = 0.00 where id = #{id}
|
||||
</update>
|
||||
<update id="accumulate">
|
||||
update oil_tank set
|
||||
stored_quantity = stored_quantity + #{storedQuantity} ,
|
||||
total_price = total_price + #{totalPrice},
|
||||
discounted_price = #{discountedPrice}
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
|
||||
<update id="accumulate2">
|
||||
update oil_tank set
|
||||
stored_quantity = #{storedQuantity} ,
|
||||
total_price = #{totalPrice},
|
||||
discounted_price = #{discountedPrice}
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
@ -75,4 +75,8 @@ public interface OilInventoryOrderService {
|
||||
*/
|
||||
boolean deleteById(Integer id);
|
||||
|
||||
boolean audit(Integer id);
|
||||
boolean abolition(Integer id);
|
||||
boolean storage(Integer id);
|
||||
|
||||
}
|
||||
|
@ -6,6 +6,8 @@ import com.fuint.business.petrolStationManagement.entity.OilPurchaseOrder;
|
||||
import com.fuint.business.petrolStationManagement.vo.OilPurchaseOrderVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* (OilPurchaseOrder)表服务接口
|
||||
@ -35,6 +37,8 @@ public interface OilPurchaseOrderService {
|
||||
|
||||
IPage<OilPurchaseOrderVO> getList(@Param("page") Page page, OilPurchaseOrder oilPurchaseOrder);
|
||||
|
||||
|
||||
List<OilPurchaseOrderVO> getAllList (OilPurchaseOrder oilPurchaseOrder);
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
@ -60,4 +64,8 @@ public interface OilPurchaseOrderService {
|
||||
*/
|
||||
boolean deleteById(Integer id);
|
||||
|
||||
boolean audit(Integer id);
|
||||
boolean abolition(Integer id);
|
||||
boolean storage(Integer id);
|
||||
|
||||
}
|
||||
|
@ -2,12 +2,14 @@ package com.fuint.business.petrolStationManagement.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.petrolStationManagement.entity.OilInventoryOrder;
|
||||
import com.fuint.business.petrolStationManagement.entity.OilPurchaseOrder;
|
||||
import com.fuint.business.petrolStationManagement.mapper.OilInventoryOrderMapper;
|
||||
import com.fuint.business.petrolStationManagement.mapper.OilPurchaseOrderMapper;
|
||||
import com.fuint.business.member.service.ILJStaffService;
|
||||
import com.fuint.business.petrolStationManagement.entity.*;
|
||||
import com.fuint.business.petrolStationManagement.mapper.*;
|
||||
import com.fuint.business.petrolStationManagement.service.OilInventoryOrderService;
|
||||
import com.fuint.business.petrolStationManagement.vo.OilInventoryOrderVO;
|
||||
import com.fuint.business.petrolStationManagement.vo.OilPurchaseOrderVO;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@ -28,6 +30,12 @@ public class OilInventoryOrderServiceImpl implements OilInventoryOrderService {
|
||||
private OilInventoryOrderMapper oilInventoryOrderDao;
|
||||
@Resource
|
||||
private OilPurchaseOrderMapper oilPurchaseOrderMapper;
|
||||
|
||||
@Resource
|
||||
private OilInventoryMapper oilInventoryMapper;
|
||||
|
||||
@Resource
|
||||
private ILJStaffService iljStaffService;
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
@ -53,6 +61,9 @@ public class OilInventoryOrderServiceImpl implements OilInventoryOrderService {
|
||||
|
||||
@Override
|
||||
public IPage<OilInventoryOrderVO> getListPage(@Param("page") Page page, @Param("oilInventoryOrder") OilInventoryOrder oilInventoryOrder) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
oilInventoryOrder.setStoreId(nowAccountInfo.getStoreId());
|
||||
|
||||
OilInventoryOrderMapper oilInventoryOrderDao = this.oilInventoryOrderDao;
|
||||
|
||||
IPage<OilInventoryOrderVO> listPage = oilInventoryOrderDao.getListPage(page, oilInventoryOrder);
|
||||
@ -120,14 +131,17 @@ public class OilInventoryOrderServiceImpl implements OilInventoryOrderService {
|
||||
|
||||
@Override
|
||||
public int disposeBatch(List<OilInventoryOrder> oilInventoryOrder) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
|
||||
List<OilInventoryOrder> insInventory = new ArrayList<>();
|
||||
List<OilInventoryOrder> updateInventory = new ArrayList<>();
|
||||
if (oilInventoryOrder.size()>0) {
|
||||
for (OilInventoryOrder inventoryOrder : oilInventoryOrder) {
|
||||
if (inventoryOrder.getId() != null) {
|
||||
|
||||
updateInventory.add(inventoryOrder);
|
||||
}else {
|
||||
inventoryOrder.setStoreId(nowAccountInfo.getStoreId());
|
||||
inventoryOrder.setUpdateBy(nowAccountInfo.getStaffId().toString());
|
||||
insInventory.add(inventoryOrder);
|
||||
}
|
||||
}
|
||||
@ -165,4 +179,83 @@ public class OilInventoryOrderServiceImpl implements OilInventoryOrderService {
|
||||
public boolean deleteById(Integer id) {
|
||||
return this.oilInventoryOrderDao.deleteById(id) > 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public boolean audit(Integer id) {
|
||||
String oilIntake = "盘点审核";
|
||||
int audit = iljStaffService.auditPrem(oilIntake);
|
||||
if (audit>0) {
|
||||
// 根据id修改状态
|
||||
String status = "ysh";
|
||||
oilInventoryOrderDao.editStateById(id,status);
|
||||
// 增加审核人
|
||||
boolean edit = edit(id);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean abolition(Integer id) {
|
||||
String oilIntake = "盘点废止";
|
||||
int audit = iljStaffService.auditPrem(oilIntake);
|
||||
if (audit>0) {
|
||||
String status = "yzf";
|
||||
oilInventoryOrderDao.editStateById(id,status);
|
||||
boolean edit = edit(id);
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Resource
|
||||
OilTankMapper oilTankMapper;
|
||||
|
||||
@Override
|
||||
public boolean storage(Integer id) {
|
||||
String oilIntake = "盘点入库";
|
||||
int audit = iljStaffService.auditPrem(oilIntake);
|
||||
if (audit>0) {
|
||||
// 1.查询所有的数据
|
||||
OilInventoryOrder oilInventoryOrder = new OilInventoryOrder();
|
||||
oilInventoryOrder.setInventoryId(id);
|
||||
List<OilInventoryOrderVO> allList = oilInventoryOrderDao.getAllList(oilInventoryOrder);
|
||||
for (OilInventoryOrderVO oilInventoryOrderVO : allList) {
|
||||
OilTank oilTank = new OilTank();
|
||||
oilTank.setId(oilInventoryOrderVO.getTankId());
|
||||
oilTank.setStoredQuantity(oilInventoryOrderVO.getInventoryVolume());
|
||||
BigDecimal bigDecimal = new BigDecimal(oilInventoryOrderVO.getInventoryVolume());
|
||||
BigDecimal bigDecimal2 = new BigDecimal(oilInventoryOrderVO.getCurrentAveragePrice());
|
||||
bigDecimal.multiply(bigDecimal2);
|
||||
|
||||
oilTank.setTotalPrice(bigDecimal.doubleValue());
|
||||
oilTank.setDiscountedPrice(oilInventoryOrderVO.getCurrentAveragePrice());
|
||||
oilTankMapper.accumulate2(oilTank);
|
||||
}
|
||||
|
||||
// 2.将数据填充到油罐里面
|
||||
String status = "qrts";
|
||||
|
||||
boolean edit = edit(id);
|
||||
int i = oilInventoryOrderDao.editStateById(id, status);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// 修改审核人
|
||||
private boolean edit(Integer id){
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
|
||||
OilInventory oilPurchase = new OilInventory();
|
||||
oilPurchase.setReviewer(nowAccountInfo.getStaffId().toString());
|
||||
oilPurchase.setId(id);
|
||||
int update = oilInventoryMapper.update(oilPurchase);
|
||||
return update>0;
|
||||
}
|
||||
}
|
||||
|
@ -104,6 +104,11 @@ public class OilInventoryServiceImpl implements OilInventoryService {
|
||||
*/
|
||||
@Override
|
||||
public OilInventory insert(OilInventory oilInventory) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
|
||||
oilInventory.setStoreId(nowAccountInfo.getStoreId());
|
||||
oilInventory.setCreator(nowAccountInfo.getStaffId().toString());
|
||||
oilInventory.setStatus("await");
|
||||
this.oilInventoryDao.insert(oilInventory);
|
||||
return oilInventory;
|
||||
}
|
||||
|
@ -27,6 +27,8 @@ public class OilNumberServiceImpl extends ServiceImpl<OilNumberMapper, OilNumber
|
||||
|
||||
@Override
|
||||
public IPage<OilNumber> selectOilNumberList(Page page, OilNumber oilNumber) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
oilNumber.setStoreId(nowAccountInfo.getStoreId());
|
||||
return baseMapper.selectOilNumberList(page,oilNumber);
|
||||
}
|
||||
|
||||
@ -44,9 +46,10 @@ public class OilNumberServiceImpl extends ServiceImpl<OilNumberMapper, OilNumber
|
||||
public int insertOilNumber(OilNumber oilNumber) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
oilNumber.setStoreId(nowAccountInfo.getStoreId());
|
||||
// todo 根据id查询这个店铺是否加过该型号的油
|
||||
oilNumber.setCreateBy(nowAccountInfo.getStaffId().toString());
|
||||
// 根据id查询这个店铺是否加过该型号的油
|
||||
int i = baseMapper.selectOilNameByStore(oilNumber);
|
||||
if ( i<= 0) {
|
||||
if ( i> 0) {
|
||||
return 0;
|
||||
}
|
||||
return baseMapper.insertOilNumber(oilNumber);
|
||||
@ -54,6 +57,14 @@ public class OilNumberServiceImpl extends ServiceImpl<OilNumberMapper, OilNumber
|
||||
|
||||
@Override
|
||||
public int updateOilNumber(OilNumber oilNumber) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
oilNumber.setUpdateBy(nowAccountInfo.getStaffId().toString());
|
||||
|
||||
int i = baseMapper.selectOilNameByStore(oilNumber);
|
||||
if ( i> 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return baseMapper.updateOilNumber(oilNumber);
|
||||
}
|
||||
|
||||
|
@ -8,7 +8,9 @@ import com.fuint.business.petrolStationManagement.entity.OilPresetPrices;
|
||||
import com.fuint.business.petrolStationManagement.mapper.OilNumberMapper;
|
||||
import com.fuint.business.petrolStationManagement.mapper.OilPresetPricesMapper;
|
||||
import com.fuint.business.petrolStationManagement.service.OilPresetPricesService;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
import com.fuint.common.util.StringUtils;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
import com.fuint.quartz.domain.SysJob;
|
||||
import com.fuint.quartz.service.ISysJobService;
|
||||
import com.fuint.quartz.util.BeanUtils;
|
||||
@ -55,6 +57,10 @@ public class OilPresetPricesServiceImpl extends ServiceImpl<OilPresetPricesMappe
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int insertOilPresetPrices(OilPresetPrices presetPrices) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
presetPrices.setStoreId(nowAccountInfo.getStoreId());
|
||||
presetPrices.setCreateBy(nowAccountInfo.getStaffId().toString());
|
||||
|
||||
presetPrices.setState("wait");
|
||||
baseMapper.insertOilPresetPrices(presetPrices);
|
||||
|
||||
|
@ -2,10 +2,17 @@ package com.fuint.business.petrolStationManagement.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.member.service.ILJStaffService;
|
||||
import com.fuint.business.member.service.impl.LJStaffServiceImpl;
|
||||
import com.fuint.business.petrolStationManagement.entity.OilPurchase;
|
||||
import com.fuint.business.petrolStationManagement.entity.OilPurchaseOrder;
|
||||
import com.fuint.business.petrolStationManagement.entity.OilTank;
|
||||
import com.fuint.business.petrolStationManagement.mapper.OilPurchaseMapper;
|
||||
import com.fuint.business.petrolStationManagement.mapper.OilPurchaseOrderMapper;
|
||||
import com.fuint.business.petrolStationManagement.mapper.OilTankMapper;
|
||||
import com.fuint.business.petrolStationManagement.service.OilPurchaseOrderService;
|
||||
import com.fuint.business.petrolStationManagement.vo.OilPurchaseOrderVO;
|
||||
import com.fuint.business.petrolStationManagement.vo.OilTankVO;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@ -14,6 +21,7 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (OilPurchaseOrder)表服务实现类
|
||||
@ -26,6 +34,12 @@ public class OilPurchaseOrderServiceImpl implements OilPurchaseOrderService {
|
||||
@Resource
|
||||
private OilPurchaseOrderMapper oilPurchaseOrderDao;
|
||||
|
||||
@Resource
|
||||
private OilPurchaseMapper oilPurchaseDao;
|
||||
|
||||
@Resource
|
||||
private ILJStaffService iljStaffService;
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
@ -58,6 +72,14 @@ public class OilPurchaseOrderServiceImpl implements OilPurchaseOrderService {
|
||||
return oilPurchaseOrderDao.getList(page, oilPurchaseOrder);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OilPurchaseOrderVO> getAllList(OilPurchaseOrder oilPurchaseOrder) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
oilPurchaseOrder.setStoreId(nowAccountInfo.getStoreId());
|
||||
return oilPurchaseOrderDao.getAllList(oilPurchaseOrder);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
@ -104,4 +126,79 @@ public class OilPurchaseOrderServiceImpl implements OilPurchaseOrderService {
|
||||
public boolean deleteById(Integer id) {
|
||||
return this.oilPurchaseOrderDao.deleteById(id) > 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public boolean audit(Integer id) {
|
||||
String oilIntake = "进油审核";
|
||||
int audit = iljStaffService.auditPrem(oilIntake);
|
||||
if (audit>0) {
|
||||
// 根据id修改状态
|
||||
String status = "ysh";
|
||||
oilPurchaseOrderDao.editStateById(id,status);
|
||||
// 增加审核人
|
||||
boolean edit = edit(id);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean abolition(Integer id) {
|
||||
String oilIntake = "进油废止";
|
||||
int audit = iljStaffService.auditPrem(oilIntake);
|
||||
if (audit>0) {
|
||||
String status = "yzf";
|
||||
oilPurchaseOrderDao.editStateById(id,status);
|
||||
boolean edit = edit(id);
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Resource
|
||||
OilTankMapper oilTankMapper;
|
||||
|
||||
@Override
|
||||
public boolean storage(Integer id) {
|
||||
String oilIntake = "进油入库";
|
||||
int audit = iljStaffService.auditPrem(oilIntake);
|
||||
if (audit>0) {
|
||||
// 1.查询所有的数据
|
||||
OilPurchaseOrder oilPurchase = new OilPurchaseOrder();
|
||||
oilPurchase.setPurchaseId(id);
|
||||
List<OilPurchaseOrderVO> allList = oilPurchaseOrderDao.getAllList(oilPurchase);
|
||||
for (OilPurchaseOrderVO oilPurchaseOrderVO : allList) {
|
||||
OilTank oilTank = new OilTank();
|
||||
oilTank.setId(oilPurchaseOrderVO.getTankId());
|
||||
oilTank.setStoredQuantity(oilPurchaseOrderVO.getPurchaseVolume());
|
||||
oilTank.setTotalPrice(oilPurchaseOrderVO.getTotalAmount());
|
||||
oilTank.setDiscountedPrice(oilPurchaseOrderVO.getPurchasePrice());
|
||||
oilTankMapper.accumulate(oilTank);
|
||||
}
|
||||
|
||||
// 2.将数据填充到油罐里面
|
||||
String status = "qrts";
|
||||
|
||||
boolean edit = edit(id);
|
||||
int i = oilPurchaseOrderDao.editStateById(id, status);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// 修改审核人
|
||||
private boolean edit(Integer id){
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
|
||||
OilPurchase oilPurchase = new OilPurchase();
|
||||
oilPurchase.setReviewer(nowAccountInfo.getStaffId().toString());
|
||||
oilPurchase.setId(id);
|
||||
int update = oilPurchaseDao.update(oilPurchase);
|
||||
return update>0;
|
||||
}
|
||||
}
|
||||
|
@ -61,6 +61,7 @@ public class OilTankServiceImpl implements OilTankService {
|
||||
|
||||
@Override
|
||||
public List<OilTank> selectList2(OilTank oilTank) {
|
||||
// 计算均进价
|
||||
return oilTankDao.selectList(oilTank);
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,13 @@
|
||||
package com.fuint.business.petrolStationManagement.vo;
|
||||
|
||||
import com.fuint.business.petrolStationManagement.entity.OilGun;
|
||||
import com.fuint.business.petrolStationManagement.entity.OilTank;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class OilTankVO extends OilTank {
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user