油罐 油枪

This commit is contained in:
DESKTOP-369JRHT\12997 2023-10-17 18:44:33 +08:00
parent 3d4dd71360
commit ee68993784
39 changed files with 2596 additions and 143 deletions

3
.gitignore vendored
View File

@ -4,6 +4,9 @@ bin-release/
[Oo]bj/
[Bb]in/
.idea
# Other files and folders
.settings/

View File

@ -0,0 +1,34 @@
import request from "@/utils/request";
// 查询油罐列表
export function getGunApi(data) {
return request({
url: '/business/petrolStationManagement/oilGun/selectByNumberTGUn',
method: 'get',
params: data
})
}
// 新增有关信息
export function insertGunApi(data) {
return request({
url: 'business/petrolStationManagement/oilGun',
method: 'post',
data: data
})
}
// 修改有关信息
export function updateGunApi(data) {
return request({
url: 'business/petrolStationManagement/oilGun',
method: 'put',
data: data
})
}
// 根据油号查询油罐
export function selectTankByNumberApi(data) {
return request({
url: 'business/petrolStationManagement/oilTank/selectList',
method: 'put',
data: data
})
}

View File

@ -11,8 +11,26 @@ export function getTankApi(data) {
// 新增有关信息
export function insertTankApi(data) {
return request({
url: 'business/petrolStationManagement/oilPresetPrices',
url: 'business/petrolStationManagement/oilTank',
method: 'post',
data: data
})
}
// 修改有关信息
export function updateTankApi(data) {
return request({
url: 'business/petrolStationManagement/oilTank',
method: 'put',
data: data
})
}
// 初始化信息
export function cleanTankApi(data) {
return request({
url: 'business/petrolStationManagement/oilTank/cleanTank',
method: 'get',
params: data
})
}

View File

@ -2,23 +2,40 @@
<div class="app-container">
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>卡片名称</span>
<span>油枪管理</span>
</div>
<div class="conten-box" v-for="(item,index) in 3" :key="index">
<div class="conten-top">
<div>汽油 92#</div>
<div class="conten-box" v-for="(item,index) in gunList" :key="index">
<!-- <div class="conten-top">-->
<!-- <div>{{item.oilType}} {{item.oilName}}</div>-->
<!-- <div>-->
<!-- <el-button-->
<!-- type="primary"-->
<!-- icon="el-icon-plus"-->
<!-- @click="gunAdd"-->
<!-- >新增油枪</el-button>-->
<!-- </div>-->
<!-- </div>-->
<div class="conten-top" style="display: flex; justify-content: space-between;">
<div>{{item.oilType}} {{item.oilName}}</div>
<div>
<el-button
type="primary"
icon="el-icon-plus"
@click="gunAdd()"
>新增油枪</el-button>
</div>
</div>
<div class="conten-bottom">
<div class="cardbox" :class="{ 'act-cardbox': item.type == 1 }" v-for="(item,index) in list" :key="index">
<div class="cardbox-top" :class="{ 'actcolor':item.type == 1 }">
<div class="cardbox" :class="{ 'act-cardbox': item.status == '正常' }" v-for="(item,index) in item.oilGunList" :key="index">
<div class="cardbox-top" :class="{ 'actcolor':item.status == '正常' }">
<div>92号油罐</div>
<div style="cursor: pointer" ><i class="el-icon-edit" @click="dialogVisible = true"></i> <i class="el-icon-delete"></i></div>
</div>
<div class="cardbox-title">
<div>{{index+1 || '0'}}号枪</div>
</div>
<div class="cardbox-bottom" :class="{ 'actcolor':item.type == 1 }">
<div class="cardbox-bottom" :class="{ 'actcolor':item.status == '正常' }">
<div>ID:778</div>
</div>
<div class="cardboxb" v-if="item.xb== 'you' ">
@ -34,25 +51,26 @@
:visible.sync="dialogVisible"
width="30%"
:before-close="handleClose">
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
<el-form-item label="油枪名称" prop="name">
<el-form :model="gunForm" :rules="rules" ref="gunForm" label-width="100px" class="demo-ruleForm">
<el-form-item label="油枪名称" prop="gunName">
<el-input placeholder="请输入内容"v-model="ruleForm.name" class="input-with-select">
<el-select v-model="ruleForm.select" slot="append" placeholder="选择油枪">
<el-option label="选项一" value="1"></el-option>
<el-option label="选项二" value="2"></el-option>
<el-option label="选项三" value="3"></el-option>
<el-input placeholder="请输入内容"v-model="gunForm.gunName" class="input-with-select">
<el-select v-model="gunForm.select" slot="append" placeholder="选择油枪" @change="chooseName">
<el-option
v-for="option in 50"
:key="option"
:label="option + '号枪'"
:value="option + '号枪'"
></el-option>
</el-select>
</el-input>
</el-form-item>
<el-form-item label="油机枪号" prop="name">
<el-input v-model="ruleForm.name"></el-input>
<el-input v-model="gunForm.oilMachineGunNumber"></el-input>
<div style="font-size: 12px;color: #999999">油机连接模式下 绑定油机系统中的枪号信息与当前枪号绑定</div>
</el-form-item>
<el-form-item label="所属油罐" prop="region">
<el-select v-model="ruleForm.region" placeholder="请选择活动区域">
<el-select v-model="gunForm.region" placeholder="请选择活动区域">
<el-option label="油罐一" value="shanghai"></el-option>
<el-option label="油罐二" value="beijing"></el-option>
</el-select>
@ -61,9 +79,13 @@
<el-form-item label="状态" prop="resource">
<el-radio-group v-model="ruleForm.resource">
<el-radio label="启用"></el-radio>
<el-radio label="禁用"></el-radio>
<el-radio-group v-model="gunForm.resource">
<el-radio
v-for="dict in dict.type.zhzt"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-radio-group>
</el-form-item>
@ -85,8 +107,12 @@
</template>
<script>
import {getGunApi, insertGunApi, updateGunApi,selectTankByNumberApi} from "@/api/oilConfig/oilGuns";
export default {
name: 'oilqiang',
dicts: ['zhzt'],
data(){
return{
dialogVisible: false,
@ -100,6 +126,23 @@
{type:1,xb:'you'},
{type:1,xb:'you'},
],
tankList: [],
gunList: [],
gunForm: {
id: '',
gunName: '',
tankId: '',
status: '',
storeId: '',
createTime: '',
updateTime: '',
createBy: '',
updateBy: '',
numberId: '',
oilMachineGunNumber: '',
select: ''
},
ruleForm: {
name: '',
region: '',
@ -137,17 +180,70 @@
}
}
},
async created() {
let this_ = this
await this_.getList()
},
methods:{
submitForm(formName) {
this.$refs[formName].validate((valid) => {
getList() {
getGunApi().then(response => {
this.gunList = response.data;
console.log("this.tankList",this.gunList)
})
},
//
gunAdd(){
let this_ = this;
this_.dialogVisible = true;
this_.gunForm = {} //
this_.selectTankByNumberApi()
},
gunEdit() {
let this_ = this;
this_.dialogVisible = true;
this_.selectTankByNumberApi()
},
submitForm() {
this.$refs["gunForm"].validate((valid) => {
if (valid) {
alert('submit!');
if (!this.gunForm.id) {
insertGunApi(this.gunForm).then(response => {
this.$modal.msgSuccess("新增成功");
this.dialogVisible = false;
this.getList();
});
} else {
updateGunApi(this.gunForm).then(response => {
this.$modal.msgSuccess("修改成功");
this.dialogVisible = false;
this.getList();
});
}
} else {
console.log('error submit!!');
return false;
}
});
},
chooseName() {
var this_ = this
this_.gunForm.gunName = this_.gunForm.select
},
handleClose(){
},
//
selectTankByNumberApi(data) {
let fil = {
numberId : data
}
selectTankByNumberApi(fil).then(response => {
this.tankList = response.data;
});
}
}
}
</script>

View File

@ -315,7 +315,6 @@
:key="option.numberId"
:label="option.oilType +' '+option.oilName"
:value="option.numberId"
></el-option>
</el-select>
</el-form-item>

View File

@ -44,7 +44,6 @@
<el-table-column label="下限预警" align="center" prop="lowerWarning"/>
<el-table-column label="油品密度" align="center" prop="oilDensity"/>
</el-table-column>
<el-table-column label="油品密度" align="center" prop="specialPrem"/>
<el-table-column label="存油数量" align="center" prop="storedQuantity"/>
<el-table-column label="存油总价 " align="center" prop="totalPrice"/>
<el-table-column label="折后单价" align="center" prop="discountedPrice"/>
@ -66,10 +65,10 @@
<el-button
size="mini"
type="text"
icon="el-icon-delete"
icon="el-icon-copy-document"
v-hasPermi="['staff:list']"
@click="handleDelete(scope.row)"
>删除</el-button>
@click="handleClean(scope.row)"
>初始化</el-button>
</template>
</el-table-column>
</el-table>
@ -94,8 +93,12 @@
</el-col>
<el-col :span="8">
<el-form-item label="油品号" prop="oilNumber">
<el-select v-model="tankForm.oilNumber" placeholder="请选择角色" style="width:100%">
<el-select v-model="tankForm.numberId" placeholder="请选择油品号" style="width:100%" @change="chooseOilNumber()">
<el-option
v-for="option in selectOilTypeByPrice"
:key="option.numberId"
:label="option.oilType +' '+option.oilName"
:value="option.numberId"
></el-option>
</el-select>
</el-form-item>
@ -104,41 +107,53 @@
<el-row :gutter="24">
<el-col :span="8">
<el-form-item label="油罐体积" prop="tankVolume">
<el-input v-model="tankForm.tankVolume" placeholder="请输入登录密码" maxlength="30"/>
<el-input v-model="tankForm.tankVolume" placeholder="请输入油罐体积" maxlength="30">
<template slot="append">{{tankForm.unit}}</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="下限预警" prop="lowerWarning">
<el-input v-model="tankForm.lowerWarning" placeholder="请输入登录密码" maxlength="30"/>
<el-input v-model="tankForm.lowerWarning" placeholder="小于预警值将进行提示" maxlength="30">
<template slot="append">{{tankForm.unit}}</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="油品密度" prop="password">
<el-input v-model="tankForm.oilDensity" placeholder="请输入油品密度" maxlength="30"/>
<el-input v-model="tankForm.oilDensity" placeholder="请输入油品密度" maxlength="30">
<template slot="append">g/ml</template>
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :span="8">
<el-form-item label="存油数量" prop="storedQuantity">
<el-input v-model="tankForm.storedQuantity" placeholder="请输入存油数量" maxlength="30"/>
<el-input v-model.number="tankForm.storedQuantity" placeholder="请输入存油数量" maxlength="30" @input="changePrice() " :disabled="disableInput">
<template slot="append">{{tankForm.unit}}</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="存油总价" prop="totalPrice">
<el-input v-model="tankForm.totalPrice" placeholder="请输入存油总价" maxlength="30"/>
<el-form-item label="存油总价" prop="totalPrice" >
<el-input v-model.number="tankForm.totalPrice" placeholder="请输入存油总价" maxlength="30" @input="changePrice()" :disabled="disableInput">
<template slot="append"></template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="折合单价" prop="discountedPrice">
<el-input v-model="tankForm.discountedPrice" placeholder="请输入折合单价" maxlength="30"/>
<el-input v-model.number="tankForm.discountedPrice" placeholder="请输入折合单价" maxlength="30" :disabled="disableInput">
<template slot="append"></template>
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :span="8">
<el-form-item label="油罐状态" prop="status">
<el-radio-group v-model="form.status">
<el-radio-group v-model="tankForm.status">
<el-radio
v-for="dict in dict.type.zhzt"
:key="dict.value"
@ -149,8 +164,8 @@
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="库存统计">
<el-radio-group v-model="form.status">
<el-form-item label="库存统计" prop="inventoryStatistics">
<el-radio-group v-model="tankForm.inventoryStatistics">
<el-radio
v-for="dict in dict.type.zhzt"
:key="dict.value"
@ -164,7 +179,7 @@
<el-row :gutter="24">
<el-col :span="24">
<el-form-item label="备注信息">
<el-input type="textarea" v-model="form.remarks"></el-input>
<el-input type="textarea" v-model="tankForm.remarks"></el-input>
</el-form-item>
</el-col>
@ -182,23 +197,20 @@
</template>
<script>
import {getTankApi,insertTankApi} from "@/api/oilConfig/oilTank";
import {cleanTankApi, getTankApi, insertTankApi, updateTankApi} from "@/api/oilConfig/oilTank";
import {getName,parseTime} from "../../../utils/fuint";
import {addStaff, updateStaff} from "@/api/staff/staff";
import {getOilNameListApi} from "@/api/oilPrice";
import { BigNumber } from 'bignumber.js';
export default {
dicts: ['ywqx','write_off','special_prem','display','zhzt','transaction','time_frame','handover','handover_quit',
'jbjl','official','notice','special_prem','role'],
dicts: ['zhzt'],
data() {
return {
//
form: {
id:'', category:'', userId:'', mobile:'', realName:'', wechat:'', merchantId:'', storeId:'', auditedStatus:'',
auditedTime:'', description:'', isRefuel:'yc', handoverMode:'dqmdtyjb', handoverPrem:'yqx', handoverOut:'jbtc', record:'qbjl',
merchantStatus:'qy',screen:'qy', posPrem:'', appletPrem:'', notice:'advice_jy', oilGunId:'', timeFrame:'bx', refund:'yqx',
transaction:'qbjy', writeOff:'',specialPrem:'', official:'', status:'qy',pos:'jy',role:''
},
// form :{},
//
title:'',
tankList: [], //
@ -212,7 +224,10 @@ export default {
storedQuantity: null,
totalPrice: null,
discountedPrice: null,
// status: '',
// inventoryStatistics: '',
status: '',
inventoryStatistics: '',
remarks: '',
storeId: null,
numberId: null,
@ -220,7 +235,9 @@ export default {
updateTime: null,
createBy: '',
updateBy: '',
unit:''
},
disableInput: false, //
//
open: false,
//
@ -231,6 +248,9 @@ export default {
page:null,
pageSize:null
},
unit: 'L',
//
selectOilTypeByPrice: [],
//
showSearch: true,
//
@ -239,64 +259,36 @@ export default {
defaultSort: {prop: 'createTime', order: 'descending'},
//
rules: {
realName: [
{ required: true, message: "姓名不能为空", trigger: "blur" },
{ min: 2, max: 30, message: '姓名长度必须介于 2 和 20 之间', trigger: 'blur' }
tankName: [
{ required: true, message: "油罐名称不能为空", trigger: "blur" },
],
mobile: [
{ required: true, message: "手机号不能为空", trigger: "blur" },
{ min: 11, max: 20, message: '手机号长度必须11', trigger: 'blur' }
oilNumber: [
{ required: true, message: '请选择油品类型', trigger: 'change' }
],
role: [
{ required: true, message: "请选择员工角色", trigger: "blur" }
tankVolume: [
{ required: true, message: "油罐体积不能为空", trigger: "blur" },
],
isRefuel: [
{ required: true, message: "请选择加油状态", trigger: "blur" }
lowerWarning: [
{ required: true, message: "下线预警不能为空", trigger: "blur" },
],
pos: [
{ required: true, message: "请选择员状态", trigger: "blur" }
oilDensity: [
{ required: true, message: "油品密度不能为空", trigger: "blur" },
],
transaction: [
storedQuantity: [
{ required: true, message: "存油数量不能为空", trigger: "blur" },
],
totalPrice: [
{ required: true, message: "存油总价不能为空", trigger: "blur" },
],
discountedPrice: [
{ required: true, message: "折合单价不能为空", trigger: "blur" },
],
status: [
{ required: true, message: "请选择", trigger: "blur" }
],
notice: [
inventoryStatistics: [
{ required: true, message: "请选择", trigger: "blur" }
],
timeFrame: [
{ required: true, message: "请选择", trigger: "blur" }
],
handoverMode: [
{ required: true, message: "请选择", trigger: "blur" }
],
handoverPrem: [
{ required: true, message: "请选择", trigger: "blur" }
],
handoverOut: [
{ required: true, message: "请选择", trigger: "blur" }
],
record: [
{ required: true, message: "请选择", trigger: "blur" }
],
merchantStatus: [
{ required: true, message: "请选择", trigger: "blur" }
],
screen: [
{ required: true, message: "请选择", trigger: "blur" }
],
tankName: [],
oilNumber: [],
tankVolume: [],
lowerWarning: [],
oilDensity: [],
storedQuantity: [],
totalPrice: [],
discountedPrice: [],
status: []
]
}
}
},
@ -310,6 +302,7 @@ export default {
this.loading = true;
getTankApi(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
this.tankList = response.data.records;
console.log("this.tankList",this.tankList)
this.total = response.data.total;
// response.data.records.forEach(item=>{
// this.categoryOptions.push(item.category)
@ -320,17 +313,19 @@ export default {
//
submitForm: function() {
this.$refs["form"].validate(valid => {
if (valid) {
if (!this.form.id) {
this.form.posPrem = JSON.stringify(this.form.posPrem);
this.form.appletPrem = JSON.stringify(this.form.appletPrem);
addStaff(this.form).then(response => {
if (!this.tankForm.id) {
console.log("this.tankFormthis.tankForm33333",this.tankForm)
insertTankApi(this.tankForm).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
} else {
updateStaff(this.form).then(response => {
updateTankApi(this.tankForm).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
@ -338,6 +333,43 @@ export default {
}
}
});
},
//
handleUpdate(data) {
console.log("datadata",data)
this.disableInput = true
let this_ = this
this_.tankForm = data
this_.open = true;
this_.title = "修改油罐";
this.getOilNameList() //
},
//
handleClean(data) {
this.$confirm('此操作将初始化油罐库存信息,请谨慎操作!是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
cleanTankApi(data).then(response => {
this.$message({
type: 'success',
message: '初始化成功!'
});
this.getList();
});
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
});
});
},
//
cancel() {
@ -353,11 +385,48 @@ export default {
tankAdd() {
//
let this_ = this
this_.tankList = {}
this_.open = true;
this_.title = "新增员工";
this_.tankForm = {}
this.tankForm.status= "启用",
this.tankForm.inventoryStatistics= "启用",
this_.disableInput = false
}
this_.open = true;
this_.title = "新增油罐";
this.getOilNameList() //
},
//
chooseOilNumber() {
let this_ = this;
this_.selectOilTypeByPrice.forEach(oilType=>{
if (oilType.numberId == this_.tankForm.numberId) {
this.tankForm.oilDensity = oilType.oilDensity
this.tankForm.oilNumber = oilType.oilType +" "+oilType.oilName
console.log("oilTypeoilType",oilType)
this.tankForm.unit = oilType.unit
}
})
},
changePrice() {
var this_=this
console.log("nonono",this_.tankForm)
if (this_.tankForm.totalPrice != null && this_.tankForm.storedQuantity != null) {
console.log("进入")
// this_.tankForm.discountedPrice =
var totalPrice = BigNumber(this_.tankForm.totalPrice);
var storedQuantity = BigNumber(this_.tankForm.storedQuantity);
this_.tankForm.discountedPrice = totalPrice.dividedBy(storedQuantity).toNumber();
}
},
getOilNameList() {
var this_=this
getOilNameListApi().then( response => {
var list = response.data
this_.selectOilTypeByPrice = list
});
},
},
};

View File

@ -0,0 +1,102 @@
package com.fuint.business.petrolStationManagement.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.petrolStationManagement.entity.OilGun;
import com.fuint.business.petrolStationManagement.service.OilGunService;
import com.fuint.business.petrolStationManagement.vo.OilGunVO;
import com.fuint.framework.web.BaseController;
import com.fuint.framework.web.ResponseObject;
import org.apache.ibatis.annotations.Param;
import org.springframework.data.domain.PageRequest;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* 油枪表(OilGun)表控制层
*
* @author makejava
* @since 2023-10-17 13:10:45
*/
@RestController
@RequestMapping("business/petrolStationManagement/oilGun")
public class OilGunController extends BaseController {
/**
* 服务对象
*/
@Resource
private OilGunService oilGunService;
/**
* 分页查询
*
* @param oilGun 筛选条件
* @param
* @return 查询结果
*/
@GetMapping("queryByPage")
public ResponseObject queryByPage(@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize",defaultValue = "10000") Integer pageSize,
@Param("oilGun") OilGun oilGun) {
Page page = new Page(pageNo, pageSize);
IPage<OilGun> oilGuns = this.oilGunService.queryByPage(page, oilGun);
return getSuccessResult(oilGuns);
}
@GetMapping("selectByNumberTGUn")
public ResponseObject selectByNumberTGUn(OilGun oilGun) {
List<OilGunVO> oilGunVOS = this.oilGunService.selectByNumberTGUn(oilGun);
return getSuccessResult(oilGunVOS);
}
/**
* 通过主键查询单条数据
*
* @param id 主键
* @return 单条数据
*/
@GetMapping("{id}")
public ResponseObject queryById(@PathVariable("id") Integer id) {
return getSuccessResult(this.oilGunService.queryById(id));
}
/**
* 新增数据
*
* @param oilGun 实体
* @return 新增结果
*/
@PostMapping
public ResponseObject add(OilGun oilGun) {
return getSuccessResult(this.oilGunService.insert(oilGun));
}
/**
* 编辑数据
*
* @param oilGun 实体
* @return 编辑结果
*/
@PutMapping
public ResponseObject edit(OilGun oilGun) {
return getSuccessResult(this.oilGunService.update(oilGun));
}
/**
* 删除数据
*
* @param id 主键
* @return 删除是否成功
*/
@DeleteMapping
public ResponseObject deleteById(Integer id) {
return getSuccessResult(this.oilGunService.deleteById(id));
}
}

View File

@ -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 = "10000") Integer pageSize,
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize,
OilNumber oilNumber) {
Page page =new Page(pageNo,pageSize);
IPage<OilNumber> list = oilPresetPricesService.selectOilNumberList(page,oilNumber);
@ -95,15 +95,6 @@ public class OilNumberController extends BaseController {
return getSuccessResult(oilPresetPricesService.deleteOilNumberById(id));
}
/**
* 关联油的类型
*/
// @GetMapping("")
// public ResponseObject getOilDic(){
//// return getSuccessResult(this.oilPresetPricesService.deleteOilNumberById());
// }
/**
* 查询一个加油站所有的油品类型
*/

View File

@ -0,0 +1,94 @@
package com.fuint.business.petrolStationManagement.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.petrolStationManagement.entity.OilPurchase;
import com.fuint.business.petrolStationManagement.entity.OilTank;
import com.fuint.business.petrolStationManagement.service.OilPurchaseService;
import com.fuint.framework.web.BaseController;
import com.fuint.framework.web.ResponseObject;
import org.apache.ibatis.annotations.Param;
import org.springframework.data.domain.PageRequest;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
/**
* 进油表(OilPurchase)表控制层
*
* @author makejava
* @since 2023-10-17 16:09:42
*/
@RestController
@RequestMapping("business/petrolStationManagement/oilPurchase")
public class OilPurchaseController extends BaseController {
/**
* 服务对象
*/
@Resource
private OilPurchaseService oilPurchaseService;
/**
* 分页查询
*
* @param oilPurchase 筛选条件
* @param pageRequest 分页对象
* @return 查询结果
*/
@GetMapping("queryByPage")
public ResponseObject queryByPage(@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize",defaultValue = "1000") Integer pageSize,
@Param("oilPurchase") OilPurchase oilPurchase) {
Page page =new Page(pageNo,pageSize);
IPage<OilPurchase> oilTanks = this.oilPurchaseService.queryByPage(page, oilPurchase);
return getSuccessResult(oilTanks);
}
/**
* 通过主键查询单条数据
*
* @param id 主键
* @return 单条数据
*/
@GetMapping("{id}")
public ResponseObject queryById(@PathVariable("id") Integer id) {
return getSuccessResult(this.oilPurchaseService.queryById(id));
}
/**
* 新增数据
*
* @param oilPurchase 实体
* @return 新增结果
*/
@PostMapping
public ResponseObject add(OilPurchase oilPurchase) {
return getSuccessResult(this.oilPurchaseService.insert(oilPurchase));
}
/**
* 编辑数据
*
* @param oilPurchase 实体
* @return 编辑结果
*/
@PutMapping
public ResponseObject edit(OilPurchase oilPurchase) {
return getSuccessResult(this.oilPurchaseService.update(oilPurchase));
}
/**
* 删除数据
*
* @param id 主键
* @return 删除是否成功
*/
@DeleteMapping
public ResponseObject deleteById(Integer id) {
return getSuccessResult(this.oilPurchaseService.deleteById(id));
}
}

View File

@ -0,0 +1,91 @@
package com.fuint.business.petrolStationManagement.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.petrolStationManagement.entity.OilSuppliers;
import com.fuint.business.petrolStationManagement.service.OilSuppliersService;
import com.fuint.framework.web.BaseController;
import com.fuint.framework.web.ResponseObject;
import org.apache.ibatis.annotations.Param;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
/**
* 供应商信息(OilSuppliers)表控制层
*
* @author makejava
* @since 2023-10-17 16:42:28
*/
@RestController
@RequestMapping("oilSuppliers")
public class OilSuppliersController extends BaseController {
/**
* 服务对象
*/
@Resource
private OilSuppliersService oilSuppliersService;
/**
* 分页查询
*
* @param oilSuppliers 筛选条件
* @param pageNo
* @return 查询结果
*/
@GetMapping("queryByPage")
public ResponseObject queryByPage(@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize",defaultValue = "1000") Integer pageSize,
@Param("oilSuppliers") OilSuppliers oilSuppliers) {
Page page =new Page(pageNo,pageSize);
IPage<OilSuppliers> oilTanks = this.oilSuppliersService.queryByPage(page, oilSuppliers);
return getSuccessResult(oilTanks);
}
/**
* 通过主键查询单条数据
*
* @param id 主键
* @return 单条数据
*/
@GetMapping("{id}")
public ResponseEntity<OilSuppliers> queryById(@PathVariable("id") Integer id) {
return ResponseEntity.ok(this.oilSuppliersService.queryById(id));
}
/**
* 新增数据
*
* @param oilSuppliers 实体
* @return 新增结果
*/
@PostMapping
public ResponseEntity<OilSuppliers> add(OilSuppliers oilSuppliers) {
return ResponseEntity.ok(this.oilSuppliersService.insert(oilSuppliers));
}
/**
* 编辑数据
*
* @param oilSuppliers 实体
* @return 编辑结果
*/
@PutMapping
public ResponseEntity<OilSuppliers> edit(OilSuppliers oilSuppliers) {
return ResponseEntity.ok(this.oilSuppliersService.update(oilSuppliers));
}
/**
* 删除数据
*
* @param id 主键
* @return 删除是否成功
*/
@DeleteMapping
public ResponseEntity<Boolean> deleteById(Integer id) {
return ResponseEntity.ok(this.oilSuppliersService.deleteById(id));
}
}

View File

@ -2,14 +2,12 @@ package com.fuint.business.petrolStationManagement.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.petrolStationManagement.entity.OilPresetPrices;
import com.fuint.business.petrolStationManagement.entity.OilTank;
import com.fuint.business.petrolStationManagement.service.OilTankService;
import com.fuint.framework.web.BaseController;
import com.fuint.framework.web.ResponseObject;
import org.apache.ibatis.annotations.Param;
import org.springframework.data.domain.PageRequest;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@ -33,18 +31,23 @@ public class OilTankController extends BaseController {
* 分页查询
*
* @param oilTank 筛选条件
* @param 分页对象
* @param
* @return 查询结果
*/
@GetMapping("queryByPage")
public ResponseObject queryByPage(@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize",defaultValue = "1000") Integer pageSize,
@Param("oilTank") OilTank oilTank) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page page =new Page(pageNo,pageSize);
Page page =new Page(pageNo,pageSize);
IPage<OilTank> oilTanks = this.oilTankService.queryByPage(page, oilTank);
return getSuccessResult(oilTanks);
}
@GetMapping("selectList")
public ResponseObject selectList(OilTank oilTank) {
return getSuccessResult(this.oilTankService.selectList(oilTank));
}
/**
* 通过主键查询单条数据
@ -64,7 +67,7 @@ public class OilTankController extends BaseController {
* @return 新增结果
*/
@PostMapping
public ResponseObject add(OilTank oilTank) {
public ResponseObject add(@RequestBody OilTank oilTank) {
return getSuccessResult(this.oilTankService.insert(oilTank));
}
@ -75,7 +78,7 @@ public class OilTankController extends BaseController {
* @return 编辑结果
*/
@PutMapping
public ResponseObject edit(OilTank oilTank) {
public ResponseObject edit(@RequestBody OilTank oilTank) {
return getSuccessResult(this.oilTankService.update(oilTank));
}
@ -90,5 +93,15 @@ public class OilTankController extends BaseController {
return getSuccessResult(this.oilTankService.deleteById(id));
}
/**
* 清除数据
* @param id
* @return
*/
@GetMapping("cleanTank")
public ResponseObject cleanData(Integer id) {
return getSuccessResult(this.oilTankService.cleanData(id));
}
}

View File

@ -0,0 +1,46 @@
package com.fuint.business.petrolStationManagement.entity;
import com.fuint.repository.model.base.BaseEntity;
import lombok.Data;
import java.util.Date;
import java.io.Serializable;
/**
* 油枪表(OilGun)实体类
*
* @author makejava
* @since 2023-10-17 13:10:45
*/
@Data
public class OilGun extends BaseEntity {
private static final long serialVersionUID = 329820033531972513L;
/**
* 油枪ID
*/
private Integer id;
/**
* 油枪名称
*/
private String gunName;
/**
* 所属油罐ID
*/
private Integer tankId;
/**
* 状态
*/
private String status;
/**
* 连锁店id
*/
private Integer storeId;
/**
* 油号名称
*/
private Integer numberId;
}

View File

@ -23,6 +23,7 @@ public class OilName extends BaseEntity {
private String oilType; // 油品类型
private String oilName; //油品名称
private Double oilPrice; //油品单价
private Double oilDensity; //油品密度
private String state; // 状态 启用或禁用0禁用1启用
private String sort; //排序
private String remark; //

View File

@ -34,5 +34,7 @@ public class OilNumber extends BaseEntity {
private String ifDelete; //
private String unit; //
private Integer storeId; //
private Double oilDensity; //油品密度
}

View File

@ -0,0 +1,221 @@
package com.fuint.business.petrolStationManagement.entity;
import java.util.Date;
import java.io.Serializable;
/**
* 进油表(OilPurchase)实体类
*
* @author makejava
* @since 2023-10-17 16:09:46
*/
public class OilPurchase implements Serializable {
private static final long serialVersionUID = 205114404529546520L;
/**
* 进油ID
*/
private Integer id;
/**
* 进货单号
*/
private String purchaseNo;
/**
* 进货时间
*/
private Date purchaseDate;
/**
* 采购油品
*/
private String oilType;
/**
* 供应商
*/
private String supplier;
/**
* 油品密度
*/
private Double density;
/**
* 采购吨数
*/
private Double purchaseQuantity;
/**
* 采购单价
*/
private Double unitPrice;
/**
* 制单人
*/
private String creator;
/**
* 审核人
*/
private String reviewer;
/**
* 制单时间
*/
private Date createdAt;
/**
* 状态
*/
private String status;
/**
* 店铺ID
*/
private Integer storeId;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
/**
* 创建人
*/
private Integer createBy;
/**
* 更新人
*/
private Integer updateBy;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getPurchaseNo() {
return purchaseNo;
}
public void setPurchaseNo(String purchaseNo) {
this.purchaseNo = purchaseNo;
}
public Date getPurchaseDate() {
return purchaseDate;
}
public void setPurchaseDate(Date purchaseDate) {
this.purchaseDate = purchaseDate;
}
public String getOilType() {
return oilType;
}
public void setOilType(String oilType) {
this.oilType = oilType;
}
public String getSupplier() {
return supplier;
}
public void setSupplier(String supplier) {
this.supplier = supplier;
}
public Double getDensity() {
return density;
}
public void setDensity(Double density) {
this.density = density;
}
public Double getPurchaseQuantity() {
return purchaseQuantity;
}
public void setPurchaseQuantity(Double purchaseQuantity) {
this.purchaseQuantity = purchaseQuantity;
}
public Double getUnitPrice() {
return unitPrice;
}
public void setUnitPrice(Double unitPrice) {
this.unitPrice = unitPrice;
}
public String getCreator() {
return creator;
}
public void setCreator(String creator) {
this.creator = creator;
}
public String getReviewer() {
return reviewer;
}
public void setReviewer(String reviewer) {
this.reviewer = reviewer;
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public Integer getStoreId() {
return storeId;
}
public void setStoreId(Integer storeId) {
this.storeId = storeId;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Integer getCreateBy() {
return createBy;
}
public void setCreateBy(Integer createBy) {
this.createBy = createBy;
}
public Integer getUpdateBy() {
return updateBy;
}
public void setUpdateBy(Integer updateBy) {
this.updateBy = updateBy;
}
}

View File

@ -0,0 +1,137 @@
package com.fuint.business.petrolStationManagement.entity;
import java.util.Date;
import java.io.Serializable;
/**
* 供应商信息(OilSuppliers)实体类
*
* @author makejava
* @since 2023-10-17 16:42:28
*/
public class OilSuppliers implements Serializable {
private static final long serialVersionUID = 424975286266609004L;
/**
* 供应商ID
*/
private Integer id;
/**
* 供应商名称
*/
private String supplierName;
/**
* 联系人
*/
private String contactPerson;
/**
* 联系电话
*/
private String contactPhone;
/**
* 联系地址
*/
private String contactAddress;
/**
* 备注信息
*/
private String remarks;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
/**
* 创建人
*/
private Integer createBy;
/**
* 更新人
*/
private Integer updateBy;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getSupplierName() {
return supplierName;
}
public void setSupplierName(String supplierName) {
this.supplierName = supplierName;
}
public String getContactPerson() {
return contactPerson;
}
public void setContactPerson(String contactPerson) {
this.contactPerson = contactPerson;
}
public String getContactPhone() {
return contactPhone;
}
public void setContactPhone(String contactPhone) {
this.contactPhone = contactPhone;
}
public String getContactAddress() {
return contactAddress;
}
public void setContactAddress(String contactAddress) {
this.contactAddress = contactAddress;
}
public String getRemarks() {
return remarks;
}
public void setRemarks(String remarks) {
this.remarks = remarks;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Integer getCreateBy() {
return createBy;
}
public void setCreateBy(Integer createBy) {
this.createBy = createBy;
}
public Integer getUpdateBy() {
return updateBy;
}
public void setUpdateBy(Integer updateBy) {
this.updateBy = updateBy;
}
}

View File

@ -55,10 +55,18 @@ public class OilTank extends BaseEntity {
* 状态
*/
private String status;
/**
* 库存统计
*/
private String inventoryStatistics;
/**
* 备注信息
*/
private String remarks;
/**
* 单位
*/
private String unit;
/**
* 店铺ID
*/

View File

@ -0,0 +1,94 @@
package com.fuint.business.petrolStationManagement.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.petrolStationManagement.entity.OilGun;
import com.fuint.business.petrolStationManagement.vo.OilGunVO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 油枪表(OilGun)表数据库访问层
*
* @author makejava
* @since 2023-10-17 13:10:45
*/
public interface OilGunMapper {
/**
* 通过ID查询单条数据
*
* @param id 主键
* @return 实例对象
*/
OilGun queryById(Integer id);
/**
* 查询指定行数据
*
* @param oilGun 查询条件
* @param pageable 分页对象
* @return 对象列表
*/
// List<OilGun> queryAllByLimit(OilGun oilGun, @Param("pageable") Pageable pageable);
IPage<OilGun> queryAllByLimit(@Param("page") Page page, @Param("oilGun") OilGun oilGun);
List<OilGun> getAllList(@Param("oilGun") OilGun oilGun);
List<OilGunVO> getOilName(@Param("storeId") Integer storeId);
/**
* 统计总行数
*
* @param oilGun 查询条件
* @return 总行数
*/
long count(OilGun oilGun);
/**
* 新增数据
*
* @param oilGun 实例对象
* @return 影响行数
*/
int insert(OilGun oilGun);
/**
* 批量新增数据MyBatis原生foreach方法
*
* @param entities List<OilGun> 实例对象列表
* @return 影响行数
*/
int insertBatch(@Param("entities") List<OilGun> entities);
/**
* 批量新增或按主键更新数据MyBatis原生foreach方法
*
* @param entities List<OilGun> 实例对象列表
* @return 影响行数
* @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常请自行校验入参
*/
int insertOrUpdateBatch(@Param("entities") List<OilGun> entities);
/**
* 修改数据
*
* @param oilGun 实例对象
* @return 影响行数
*/
int update(OilGun oilGun);
/**
* 通过主键删除数据
*
* @param id 主键
* @return 影响行数
*/
int deleteById(Integer id);
}

View File

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.petrolStationManagement.entity.OilNumber;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -47,10 +48,10 @@ public interface OilNumberMapper extends BaseMapper<OilNumber> {
*/
public int updateOilNumber(OilNumber oilNumber);
public List<OilNumber> getOilName();
public List<OilNumber> getOilName(Integer storeId);
// 根据店铺和油号查询是否存在重复
public OilNumber selectOilNameByStore(OilNumber oilNumber);
public int selectOilNameByStore(OilNumber oilNumber);

View File

@ -0,0 +1,86 @@
package com.fuint.business.petrolStationManagement.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.petrolStationManagement.entity.OilPurchase;
import com.fuint.business.petrolStationManagement.entity.OilTank;
import org.apache.ibatis.annotations.Param;
import org.springframework.data.domain.Pageable;
import java.util.List;
/**
* 进油表(OilPurchase)表数据库访问层
*
* @author makejava
* @since 2023-10-17 16:09:43
*/
public interface OilPurchaseMapper {
/**
* 通过ID查询单条数据
*
* @param id 主键
* @return 实例对象
*/
OilPurchase queryById(Integer id);
/**
* 查询指定行数据
*
* @param oilPurchase 查询条件
* @param pageable 分页对象
* @return 对象列表
*/
IPage<OilPurchase> queryAllByLimit(@Param("page") Page page, @Param("oilTank") OilPurchase oilPurchase);
/**
* 统计总行数
*
* @param oilPurchase 查询条件
* @return 总行数
*/
long count(OilPurchase oilPurchase);
/**
* 新增数据
*
* @param oilPurchase 实例对象
* @return 影响行数
*/
int insert(OilPurchase oilPurchase);
/**
* 批量新增数据MyBatis原生foreach方法
*
* @param entities List<OilPurchase> 实例对象列表
* @return 影响行数
*/
int insertBatch(@Param("entities") List<OilPurchase> entities);
/**
* 批量新增或按主键更新数据MyBatis原生foreach方法
*
* @param entities List<OilPurchase> 实例对象列表
* @return 影响行数
* @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常请自行校验入参
*/
int insertOrUpdateBatch(@Param("entities") List<OilPurchase> entities);
/**
* 修改数据
*
* @param oilPurchase 实例对象
* @return 影响行数
*/
int update(OilPurchase oilPurchase);
/**
* 通过主键删除数据
*
* @param id 主键
* @return 影响行数
*/
int deleteById(Integer id);
}

View File

@ -0,0 +1,83 @@
package com.fuint.business.petrolStationManagement.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.petrolStationManagement.entity.OilSuppliers;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 供应商信息(OilSuppliers)表数据库访问层
*
* @author makejava
* @since 2023-10-17 16:42:28
*/
public interface OilSuppliersMapper {
/**
* 通过ID查询单条数据
*
* @param id 主键
* @return 实例对象
*/
OilSuppliers queryById(Integer id);
/**
* 查询指定行数据
*
* @param oilSuppliers 查询条件
* @return 对象列表
*/
IPage<OilSuppliers> queryAllByLimit(@Param("page") Page page, @Param("oilTank") OilSuppliers oilSuppliers);
/**
* 统计总行数
*
* @param oilSuppliers 查询条件
* @return 总行数
*/
long count(OilSuppliers oilSuppliers);
/**
* 新增数据
*
* @param oilSuppliers 实例对象
* @return 影响行数
*/
int insert(OilSuppliers oilSuppliers);
/**
* 批量新增数据MyBatis原生foreach方法
*
* @param entities List<OilSuppliers> 实例对象列表
* @return 影响行数
*/
int insertBatch(@Param("entities") List<OilSuppliers> entities);
/**
* 批量新增或按主键更新数据MyBatis原生foreach方法
*
* @param entities List<OilSuppliers> 实例对象列表
* @return 影响行数
* @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常请自行校验入参
*/
int insertOrUpdateBatch(@Param("entities") List<OilSuppliers> entities);
/**
* 修改数据
*
* @param oilSuppliers 实例对象
* @return 影响行数
*/
int update(OilSuppliers oilSuppliers);
/**
* 通过主键删除数据
*
* @param id 主键
* @return 影响行数
*/
int deleteById(Integer id);
}

View File

@ -33,6 +33,7 @@ public interface OilTankMapper {
*/
IPage<OilTank> queryAllByLimit(@Param("page")Page page,@Param("oilTank") OilTank oilTank);
List<OilTank> selectList(OilTank oilTank);
/**
* 统计总行数
*
@ -82,5 +83,7 @@ public interface OilTankMapper {
*/
int deleteById(Integer id);
int cleanData(Integer id);
}

View File

@ -0,0 +1,210 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.fuint.business.petrolStationManagement.mapper.OilGunMapper">
<resultMap type="com.fuint.business.petrolStationManagement.entity.OilGun" id="OilGunMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="gunName" column="gun_name" jdbcType="VARCHAR"/>
<result property="tankId" column="tank_id" jdbcType="INTEGER"/>
<result property="status" column="status" jdbcType="VARCHAR"/>
<result property="storeId" column="store_id" jdbcType="INTEGER"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
<result property="createBy" column="create_by" jdbcType="INTEGER"/>
<result property="updateBy" column="update_by" jdbcType="INTEGER"/>
<result property="numberId" column="number_id" jdbcType="INTEGER"/>
</resultMap>
<!--查询单个-->
<select id="queryById" resultMap="OilGunMap">
select
id, gun_name, tank_id, status, store_id, create_time, update_time, create_by, update_by
from oil_gun
where id = #{id}
</select>
<!--查询指定行数据-->
<select id="queryAllByLimit" resultMap="OilGunMap">
select
id, gun_name, tank_id, status, store_id, create_time, update_time, create_by, update_by
from oil_gun
<where>
<if test="id != null">
and id = #{id}
</if>
<if test="gunName != null and gunName != ''">
and gun_name = #{gunName}
</if>
<if test="tankId != null">
and tank_id = #{tankId}
</if>
<if test="status != null and status != ''">
and status = #{status}
</if>
<if test="storeId != null">
and store_id = #{storeId}
</if>
<if test="createTime != null">
and create_time = #{createTime}
</if>
<if test="updateTime != null">
and update_time = #{updateTime}
</if>
<if test="createBy != null">
and create_by = #{createBy}
</if>
<if test="updateBy != null">
and update_by = #{updateBy}
</if>
</where>
</select>
<!--统计总行数-->
<select id="count" resultType="java.lang.Long">
select count(1)
from oil_gun
<where>
<if test="id != null">
and id = #{id}
</if>
<if test="gunName != null and gunName != ''">
and gun_name = #{gunName}
</if>
<if test="tankId != null">
and tank_id = #{tankId}
</if>
<if test="status != null and status != ''">
and status = #{status}
</if>
<if test="storeId != null">
and store_id = #{storeId}
</if>
<if test="createTime != null">
and create_time = #{createTime}
</if>
<if test="updateTime != null">
and update_time = #{updateTime}
</if>
<if test="createBy != null">
and create_by = #{createBy}
</if>
<if test="updateBy != null">
and update_by = #{updateBy}
</if>
</where>
</select>
<select id="getAllList" resultMap="OilGunMap">
select
id, gun_name, tank_id, status, store_id, create_time, update_time, create_by, update_by, number_id
from oil_gun
<where>
<if test="oilGun.id != null">
and id = #{oilGun.id}
</if>
<if test="oilGun.gunName != null and oilGun.gunName != ''">
and gun_name = #{oilGun.gunName}
</if>
<if test="oilGun.tankId != null">
and tank_id = #{oilGun.tankId}
</if>
<if test="oilGun.status != null and oilGun.status != ''">
and status = #{oilGun.status}
</if>
<if test="oilGun.storeId != null">
and store_id = #{oilGun.storeId}
</if>
<if test="oilGun.createTime != null">
and create_time = #{oilGun.createTime}
</if>
<if test="oilGun.updateTime != null">
and update_time = #{oilGun.updateTime}
</if>
<if test="oilGun.createBy != null">
and create_by = #{oilGun.createBy}
</if>
<if test="oilGun.updateBy != null">
and update_by = #{oilGun.updateBy}
</if>
</where>
</select>
<select id="getOilName" resultType="com.fuint.business.petrolStationManagement.vo.OilGunVO">
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
from oil_number onm
left join oil_name name on onm.oil_name = name.id
<where>
<if test="storeId != null">
onm.store_id = #{storeId}
</if>
</where>
</select>
<!--新增所有列-->
<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)
values (#{gunName}, #{tankId}, #{status}, #{storeId}, #{createTime}, #{updateTime}, #{createBy}, #{updateBy})
</insert>
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
insert into oil_gun(gun_name, tank_id, status, store_id, create_time, update_time, create_by, update_by)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.gunName}, #{entity.tankId}, #{entity.status}, #{entity.storeId}, #{entity.createTime}, #{entity.updateTime}, #{entity.createBy}, #{entity.updateBy})
</foreach>
</insert>
<insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
insert into oil_gun(gun_name, tank_id, status, store_id, create_time, update_time, create_by, update_by)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.gunName}, #{entity.tankId}, #{entity.status}, #{entity.storeId}, #{entity.createTime}, #{entity.updateTime}, #{entity.createBy}, #{entity.updateBy})
</foreach>
on duplicate key update
gun_name = values(gun_name),
tank_id = values(tank_id),
status = values(status),
store_id = values(store_id),
create_time = values(create_time),
update_time = values(update_time),
create_by = values(create_by),
update_by = values(update_by)
</insert>
<!--通过主键修改数据-->
<update id="update">
update oil_gun
<set>
<if test="gunName != null and gunName != ''">
gun_name = #{gunName},
</if>
<if test="tankId != null">
tank_id = #{tankId},
</if>
<if test="status != null and status != ''">
status = #{status},
</if>
<if test="storeId != null">
store_id = #{storeId},
</if>
<if test="createTime != null">
create_time = #{createTime},
</if>
<if test="updateTime != null">
update_time = #{updateTime},
</if>
<if test="createBy != null">
create_by = #{createBy},
</if>
<if test="updateBy != null">
update_by = #{updateBy},
</if>
</set>
where id = #{id}
</update>
<!--通过主键删除-->
<delete id="deleteById">
delete from oil_gun where id = #{id}
</delete>
</mapper>

View File

@ -13,7 +13,8 @@
SELECT
NA.id AS id,
NA.oil_name AS oilName,
NA.oil_type AS oilType
NA.oil_type AS oilType,
NA.oil_density AS oilDensity
FROM
oil_name NA
</select>

View File

@ -18,10 +18,11 @@
<result property="remark" column="remark" />
<result property="ifDelete" column="if_delete" />
<result property="unit" column="unit"/>
<result property="storeId" column="store_id"/>
</resultMap>
<sql id="selectOilNumber">
select `number_id`,`oil_type`,oil_name,oil_price,gb_price,receiving_units,create_time,update_time,`state`,sort,remark,if_delete,unit
select `number_id`,`oil_type`,oil_name,oil_price,gb_price,receiving_units,create_time,update_time,`state`,sort,remark,if_delete,unit, store_id
from oil_number
</sql>
@ -55,6 +56,7 @@
<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>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test=" oilType != null">#{oilType },</if>
@ -69,6 +71,7 @@
<if test=" remark != null">#{remark },</if>
<if test=" ifDelete != null">#{ifDelete },</if>
<if test=" unit != null">#{unit},</if>
<if test=" storeId != null">#{storeId},</if>
</trim>
</insert>
@ -94,13 +97,17 @@
</delete>
<select id="getOilName" resultType="com.fuint.business.petrolStationManagement.entity.OilNumber">
select onm.number_id numberId,name.oil_name oilName, dict.dict_label oilType,onm.oil_price oilPrice ,onm.gb_price gbPrice
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
from oil_number onm
left join oil_name name on onm.oil_name = name.id
left join (select dict_label,dict_value from sys_dict_data where dict_type = 'oil_type') dict on name.oil_type = dict.dict_value
<where>
<if test="storeId != null">
onm.store_id = #{storeId}
</if>
</where>
</select>
<select id="selectOilNameByStore" resultType="com.fuint.business.petrolStationManagement.entity.OilNumber">
select number_id numberId
select count(*)
from oil_number
WHERE store_id = #{storeId}
oil_name = #{oilName}

View File

@ -0,0 +1,253 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.fuint.business.petrolStationManagement.mapper.OilPurchaseMapper">
<resultMap type="com.fuint.business.petrolStationManagement.entity.OilPurchase" id="OilPurchaseMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="purchaseNo" column="purchase_no" jdbcType="VARCHAR"/>
<result property="purchaseDate" column="purchase_date" jdbcType="TIMESTAMP"/>
<result property="oilType" column="oil_type" jdbcType="VARCHAR"/>
<result property="supplier" column="supplier" jdbcType="VARCHAR"/>
<result property="density" column="density" jdbcType="NUMERIC"/>
<result property="purchaseQuantity" column="purchase_quantity" jdbcType="NUMERIC"/>
<result property="unitPrice" column="unit_price" jdbcType="NUMERIC"/>
<result property="creator" column="creator" jdbcType="VARCHAR"/>
<result property="reviewer" column="reviewer" jdbcType="VARCHAR"/>
<result property="createdAt" column="created_at" jdbcType="TIMESTAMP"/>
<result property="status" column="status" jdbcType="VARCHAR"/>
<result property="storeId" column="store_id" jdbcType="INTEGER"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
<result property="createBy" column="create_by" jdbcType="INTEGER"/>
<result property="updateBy" column="update_by" jdbcType="INTEGER"/>
</resultMap>
<!--查询单个-->
<select id="queryById" resultMap="OilPurchaseMap">
select
id, purchase_no, purchase_date, oil_type, supplier, density, purchase_quantity, unit_price, creator, reviewer, created_at, status, store_id, create_time, update_time, create_by, update_by
from oil_purchase
where id = #{id}
</select>
<!--查询指定行数据-->
<select id="queryAllByLimit" resultMap="OilPurchaseMap">
select
id, purchase_no, purchase_date, oil_type, supplier, density, purchase_quantity, unit_price, creator, reviewer, created_at, status, store_id, create_time, update_time, create_by, update_by
from oil_purchase
<where>
<if test="id != null">
and id = #{id}
</if>
<if test="purchaseNo != null and purchaseNo != ''">
and purchase_no = #{purchaseNo}
</if>
<if test="purchaseDate != null">
and purchase_date = #{purchaseDate}
</if>
<if test="oilType != null and oilType != ''">
and oil_type = #{oilType}
</if>
<if test="supplier != null and supplier != ''">
and supplier = #{supplier}
</if>
<if test="density != null">
and density = #{density}
</if>
<if test="purchaseQuantity != null">
and purchase_quantity = #{purchaseQuantity}
</if>
<if test="unitPrice != null">
and unit_price = #{unitPrice}
</if>
<if test="creator != null and creator != ''">
and creator = #{creator}
</if>
<if test="reviewer != null and reviewer != ''">
and reviewer = #{reviewer}
</if>
<if test="createdAt != null">
and created_at = #{createdAt}
</if>
<if test="status != null and status != ''">
and status = #{status}
</if>
<if test="storeId != null">
and store_id = #{storeId}
</if>
<if test="createTime != null">
and create_time = #{createTime}
</if>
<if test="updateTime != null">
and update_time = #{updateTime}
</if>
<if test="createBy != null">
and create_by = #{createBy}
</if>
<if test="updateBy != null">
and update_by = #{updateBy}
</if>
</where>
</select>
<!--统计总行数-->
<select id="count" resultType="java.lang.Long">
select count(1)
from oil_purchase
<where>
<if test="id != null">
and id = #{id}
</if>
<if test="purchaseNo != null and purchaseNo != ''">
and purchase_no = #{purchaseNo}
</if>
<if test="purchaseDate != null">
and purchase_date = #{purchaseDate}
</if>
<if test="oilType != null and oilType != ''">
and oil_type = #{oilType}
</if>
<if test="supplier != null and supplier != ''">
and supplier = #{supplier}
</if>
<if test="density != null">
and density = #{density}
</if>
<if test="purchaseQuantity != null">
and purchase_quantity = #{purchaseQuantity}
</if>
<if test="unitPrice != null">
and unit_price = #{unitPrice}
</if>
<if test="creator != null and creator != ''">
and creator = #{creator}
</if>
<if test="reviewer != null and reviewer != ''">
and reviewer = #{reviewer}
</if>
<if test="createdAt != null">
and created_at = #{createdAt}
</if>
<if test="status != null and status != ''">
and status = #{status}
</if>
<if test="storeId != null">
and store_id = #{storeId}
</if>
<if test="createTime != null">
and create_time = #{createTime}
</if>
<if test="updateTime != null">
and update_time = #{updateTime}
</if>
<if test="createBy != null">
and create_by = #{createBy}
</if>
<if test="updateBy != null">
and update_by = #{updateBy}
</if>
</where>
</select>
<!--新增所有列-->
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
insert into oil_purchase(purchase_no, purchase_date, oil_type, supplier, density, purchase_quantity, unit_price, creator, reviewer, created_at, status, store_id, create_time, update_time, create_by, update_by)
values (#{purchaseNo}, #{purchaseDate}, #{oilType}, #{supplier}, #{density}, #{purchaseQuantity}, #{unitPrice}, #{creator}, #{reviewer}, #{createdAt}, #{status}, #{storeId}, #{createTime}, #{updateTime}, #{createBy}, #{updateBy})
</insert>
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
insert into oil_purchase(purchase_no, purchase_date, oil_type, supplier, density, purchase_quantity, unit_price, creator, reviewer, created_at, status, store_id, create_time, update_time, create_by, update_by)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.purchaseNo}, #{entity.purchaseDate}, #{entity.oilType}, #{entity.supplier}, #{entity.density}, #{entity.purchaseQuantity}, #{entity.unitPrice}, #{entity.creator}, #{entity.reviewer}, #{entity.createdAt}, #{entity.status}, #{entity.storeId}, #{entity.createTime}, #{entity.updateTime}, #{entity.createBy}, #{entity.updateBy})
</foreach>
</insert>
<insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
insert into oil_purchase(purchase_no, purchase_date, oil_type, supplier, density, purchase_quantity, unit_price, creator, reviewer, created_at, status, store_id, create_time, update_time, create_by, update_by)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.purchaseNo}, #{entity.purchaseDate}, #{entity.oilType}, #{entity.supplier}, #{entity.density}, #{entity.purchaseQuantity}, #{entity.unitPrice}, #{entity.creator}, #{entity.reviewer}, #{entity.createdAt}, #{entity.status}, #{entity.storeId}, #{entity.createTime}, #{entity.updateTime}, #{entity.createBy}, #{entity.updateBy})
</foreach>
on duplicate key update
purchase_no = values(purchase_no),
purchase_date = values(purchase_date),
oil_type = values(oil_type),
supplier = values(supplier),
density = values(density),
purchase_quantity = values(purchase_quantity),
unit_price = values(unit_price),
creator = values(creator),
reviewer = values(reviewer),
created_at = values(created_at),
status = values(status),
store_id = values(store_id),
create_time = values(create_time),
update_time = values(update_time),
create_by = values(create_by),
update_by = values(update_by)
</insert>
<!--通过主键修改数据-->
<update id="update">
update oil_purchase
<set>
<if test="purchaseNo != null and purchaseNo != ''">
purchase_no = #{purchaseNo},
</if>
<if test="purchaseDate != null">
purchase_date = #{purchaseDate},
</if>
<if test="oilType != null and oilType != ''">
oil_type = #{oilType},
</if>
<if test="supplier != null and supplier != ''">
supplier = #{supplier},
</if>
<if test="density != null">
density = #{density},
</if>
<if test="purchaseQuantity != null">
purchase_quantity = #{purchaseQuantity},
</if>
<if test="unitPrice != null">
unit_price = #{unitPrice},
</if>
<if test="creator != null and creator != ''">
creator = #{creator},
</if>
<if test="reviewer != null and reviewer != ''">
reviewer = #{reviewer},
</if>
<if test="createdAt != null">
created_at = #{createdAt},
</if>
<if test="status != null and status != ''">
status = #{status},
</if>
<if test="storeId != null">
store_id = #{storeId},
</if>
<if test="createTime != null">
create_time = #{createTime},
</if>
<if test="updateTime != null">
update_time = #{updateTime},
</if>
<if test="createBy != null">
create_by = #{createBy},
</if>
<if test="updateBy != null">
update_by = #{updateBy},
</if>
</set>
where id = #{id}
</update>
<!--通过主键删除-->
<delete id="deleteById">
delete from oil_purchase where id = #{id}
</delete>
</mapper>

View File

@ -0,0 +1,176 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.fuint.business.petrolStationManagement.mapper.OilSuppliersMapper">
<resultMap type="com.fuint.business.petrolStationManagement.entity.OilSuppliers" id="OilSuppliersMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="supplierName" column="supplier_name" jdbcType="VARCHAR"/>
<result property="contactPerson" column="contact_person" jdbcType="VARCHAR"/>
<result property="contactPhone" column="contact_phone" jdbcType="VARCHAR"/>
<result property="contactAddress" column="contact_address" jdbcType="VARCHAR"/>
<result property="remarks" column="remarks" jdbcType="VARCHAR"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
<result property="createBy" column="create_by" jdbcType="INTEGER"/>
<result property="updateBy" column="update_by" jdbcType="INTEGER"/>
</resultMap>
<!--查询单个-->
<select id="queryById" resultMap="OilSuppliersMap">
select
id, supplier_name, contact_person, contact_phone, contact_address, remarks, create_time, update_time, create_by, update_by
from oil_suppliers
where id = #{id}
</select>
<!--查询指定行数据-->
<select id="queryAllByLimit" resultMap="OilSuppliersMap">
select
id, supplier_name, contact_person, contact_phone, contact_address, remarks, create_time, update_time, create_by, update_by
from oil_suppliers
<where>
<if test="id != null">
and id = #{id}
</if>
<if test="supplierName != null and supplierName != ''">
and supplier_name = #{supplierName}
</if>
<if test="contactPerson != null and contactPerson != ''">
and contact_person = #{contactPerson}
</if>
<if test="contactPhone != null and contactPhone != ''">
and contact_phone = #{contactPhone}
</if>
<if test="contactAddress != null and contactAddress != ''">
and contact_address = #{contactAddress}
</if>
<if test="remarks != null and remarks != ''">
and remarks = #{remarks}
</if>
<if test="createTime != null">
and create_time = #{createTime}
</if>
<if test="updateTime != null">
and update_time = #{updateTime}
</if>
<if test="createBy != null">
and create_by = #{createBy}
</if>
<if test="updateBy != null">
and update_by = #{updateBy}
</if>
</where>
</select>
<!--统计总行数-->
<select id="count" resultType="java.lang.Long">
select count(1)
from oil_suppliers
<where>
<if test="id != null">
and id = #{id}
</if>
<if test="supplierName != null and supplierName != ''">
and supplier_name = #{supplierName}
</if>
<if test="contactPerson != null and contactPerson != ''">
and contact_person = #{contactPerson}
</if>
<if test="contactPhone != null and contactPhone != ''">
and contact_phone = #{contactPhone}
</if>
<if test="contactAddress != null and contactAddress != ''">
and contact_address = #{contactAddress}
</if>
<if test="remarks != null and remarks != ''">
and remarks = #{remarks}
</if>
<if test="createTime != null">
and create_time = #{createTime}
</if>
<if test="updateTime != null">
and update_time = #{updateTime}
</if>
<if test="createBy != null">
and create_by = #{createBy}
</if>
<if test="updateBy != null">
and update_by = #{updateBy}
</if>
</where>
</select>
<!--新增所有列-->
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
insert into oil_suppliers(supplier_name, contact_person, contact_phone, contact_address, remarks, create_time, update_time, create_by, update_by)
values (#{supplierName}, #{contactPerson}, #{contactPhone}, #{contactAddress}, #{remarks}, #{createTime}, #{updateTime}, #{createBy}, #{updateBy})
</insert>
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
insert into oil_suppliers(supplier_name, contact_person, contact_phone, contact_address, remarks, create_time, update_time, create_by, update_by)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.supplierName}, #{entity.contactPerson}, #{entity.contactPhone}, #{entity.contactAddress}, #{entity.remarks}, #{entity.createTime}, #{entity.updateTime}, #{entity.createBy}, #{entity.updateBy})
</foreach>
</insert>
<insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
insert into oil_suppliers(supplier_name, contact_person, contact_phone, contact_address, remarks, create_time, update_time, create_by, update_by)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.supplierName}, #{entity.contactPerson}, #{entity.contactPhone}, #{entity.contactAddress}, #{entity.remarks}, #{entity.createTime}, #{entity.updateTime}, #{entity.createBy}, #{entity.updateBy})
</foreach>
on duplicate key update
supplier_name = values(supplier_name),
contact_person = values(contact_person),
contact_phone = values(contact_phone),
contact_address = values(contact_address),
remarks = values(remarks),
create_time = values(create_time),
update_time = values(update_time),
create_by = values(create_by),
update_by = values(update_by)
</insert>
<!--通过主键修改数据-->
<update id="update">
update oil_suppliers
<set>
<if test="supplierName != null and supplierName != ''">
supplier_name = #{supplierName},
</if>
<if test="contactPerson != null and contactPerson != ''">
contact_person = #{contactPerson},
</if>
<if test="contactPhone != null and contactPhone != ''">
contact_phone = #{contactPhone},
</if>
<if test="contactAddress != null and contactAddress != ''">
contact_address = #{contactAddress},
</if>
<if test="remarks != null and remarks != ''">
remarks = #{remarks},
</if>
<if test="createTime != null">
create_time = #{createTime},
</if>
<if test="updateTime != null">
update_time = #{updateTime},
</if>
<if test="createBy != null">
create_by = #{createBy},
</if>
<if test="updateBy != null">
update_by = #{updateBy},
</if>
</set>
where id = #{id}
</update>
<!--通过主键删除-->
<delete id="deleteById">
delete from oil_suppliers where id = #{id}
</delete>
</mapper>

View File

@ -13,7 +13,9 @@
<result property="totalPrice" column="total_price" jdbcType="NUMERIC"/>
<result property="discountedPrice" column="discounted_price" jdbcType="NUMERIC"/>
<result property="status" column="status" jdbcType="VARCHAR"/>
<result property="inventoryStatistics" column="inventory_statistics" jdbcType="VARCHAR"/>
<result property="remarks" column="remarks" jdbcType="VARCHAR"/>
<result property="unit" column="unit" jdbcType="VARCHAR"/>
<result property="storeId" column="store_id" jdbcType="INTEGER"/>
<result property="numberId" column="number_id" jdbcType="INTEGER"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
@ -25,7 +27,7 @@
<!--查询单个-->
<select id="queryById" resultMap="OilTankMap">
select
id, 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
id, 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
from oil_tank
where id = #{id}
</select>
@ -33,14 +35,14 @@
<!--查询指定行数据-->
<select id="queryAllByLimit" resultMap="OilTankMap">
select
id, 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
id, 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
from oil_tank
<where>
<if test="oilTank.id != null">
and id = #{oilTank.id}
</if>
<if test="oilTank.tankName != null and oilTank.tankName != ''">
and tank_name = #{oilTank.tankName}
and tank_name LIKE CONCAT('%', #{oilTank.tankName}, '%')
</if>
<if test="oilTank.oilNumber != null and oilTank.oilNumber != ''">
and oil_number = #{oilTank.oilNumber}
@ -89,7 +91,67 @@
</if>
</where>
</select>
<!-- &#45;&#45; limit #{pageable.offset}, #{pageable.pageSize}-->
<select id="selectList" resultType="com.fuint.business.petrolStationManagement.entity.OilTank">
select
id, 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
from oil_tank
<where>
<if test="oilTank.id != null">
and id = #{oilTank.id}
</if>
<if test="oilTank.tankName != null and oilTank.tankName != ''">
and tank_name LIKE CONCAT('%', #{oilTank.tankName}, '%')
</if>
<if test="oilTank.oilNumber != null and oilTank.oilNumber != ''">
and oil_number = #{oilTank.oilNumber}
</if>
<if test="oilTank.tankVolume != null">
and tank_volume = #{oilTank.tankVolume}
</if>
<if test="oilTank.lowerWarning != null">
and lower_warning = #{oilTank.lowerWarning}
</if>
<if test="oilTank.oilDensity != null">
and oil_density = #{oilTank.oilDensity}
</if>
<if test="oilTank.storedQuantity != null">
and stored_quantity = #{oilTank.storedQuantity}
</if>
<if test="oilTank.totalPrice != null">
and total_price = #{oilTank.otalPrice}
</if>
<if test="oilTank.discountedPrice != null">
and discounted_price = #{oilTank.discountedPrice}
</if>
<if test="oilTank.status != null and oilTank.status != ''">
and status = #{oilTank.status}
</if>
<if test="oilTank.remarks != null and oilTank.remarks != ''">
and remarks = #{oilTank.remarks}
</if>
<if test="oilTank.storeId != null">
and store_id = #{oilTank.storeId}
</if>
<if test="oilTank.numberId != null">
and number_id = #{oilTank.numberId}
</if>
<if test="oilTank.createTime != null">
and create_time = #{oilTank.createTime}
</if>
<if test="oilTank.updateTime != null">
and update_time = #{oilTank.updateTime}
</if>
<if test="oilTank.createBy != null">
and create_by = #{oilTank.createBy}
</if>
<if test="oilTank.updateBy != null">
and update_by = #{oilTank.updateBy}
</if>
</where>
</select>
<!-- &#45;&#45; limit #{pageable.offset}, #{pageable.pageSize}-->
<!---->
<!--统计总行数-->
<select id="count" resultType="java.lang.Long">
@ -126,6 +188,9 @@
<if test="status != null and status != ''">
and status = #{status}
</if>
<if test="inventoryStatistics != null and inventoryStatistics != ''">
and inventory_statistics = #{inventoryStatistics}
</if>
<if test="remarks != null and remarks != ''">
and remarks = #{remarks}
</if>
@ -152,8 +217,8 @@
<!--新增所有列-->
<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)
values (#{tankName}, #{oilNumber}, #{tankVolume}, #{lowerWarning}, #{oilDensity}, #{storedQuantity}, #{totalPrice}, #{discountedPrice}, #{status}, #{remarks}, #{storeId}, #{numberId}, #{createTime}, #{updateTime}, #{createBy}, #{updateBy})
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})
</insert>
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
@ -220,6 +285,9 @@
<if test="status != null and status != ''">
status = #{status},
</if>
<if test="inventoryStatistics != null and inventoryStatistics != ''">
inventory_statistics = #{inventoryStatistics},
</if>
<if test="remarks != null and remarks != ''">
remarks = #{remarks},
</if>
@ -250,5 +318,12 @@
delete from oil_tank where id = #{id}
</delete>
<update id="cleanData">
update oil_tank set stored_quantity = 0.00 ,total_price = 0.00, discounted_price = 0.00 where id = #{id}
</update>
</mapper>

View File

@ -0,0 +1,64 @@
package com.fuint.business.petrolStationManagement.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.petrolStationManagement.entity.OilGun;
import com.fuint.business.petrolStationManagement.entity.OilTank;
import com.fuint.business.petrolStationManagement.vo.OilGunVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.data.domain.PageRequest;
import java.util.List;
/**
* 油枪表(OilGun)表服务接口
*
* @author makejava
* @since 2023-10-17 13:10:45
*/
public interface OilGunService {
/**
* 通过ID查询单条数据
*
* @param id 主键
* @return 实例对象
*/
OilGun queryById(Integer id);
/**
* 分页查询
*
* @param oilGun 筛选条件
* @param 分页对象
* @return 查询结果
*/
// Page<OilGun> queryByPage(OilGun oilGun, PageRequest pageRequest);
IPage<OilGun> queryByPage(@Param("page") Page page, @Param("oilGun") OilGun oilGun);
List<OilGunVO> selectByNumberTGUn(OilGun oilGun);
/**
* 新增数据
*
* @param oilGun 实例对象
* @return 实例对象
*/
OilGun insert(OilGun oilGun);
/**
* 修改数据
*
* @param oilGun 实例对象
* @return 实例对象
*/
OilGun update(OilGun oilGun);
/**
* 通过主键删除数据
*
* @param id 主键
* @return 是否成功
*/
boolean deleteById(Integer id);
}

View File

@ -0,0 +1,60 @@
package com.fuint.business.petrolStationManagement.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.petrolStationManagement.entity.OilPurchase;
import com.fuint.business.petrolStationManagement.entity.OilTank;
import org.apache.ibatis.annotations.Param;
import org.springframework.data.domain.PageRequest;
/**
* 进油表(OilPurchase)表服务接口
*
* @author makejava
* @since 2023-10-17 16:09:50
*/
public interface OilPurchaseService {
/**
* 通过ID查询单条数据
*
* @param id 主键
* @return 实例对象
*/
OilPurchase queryById(Integer id);
/**
* 分页查询
*
* @param oilPurchase 筛选条件
* @param page 分页对象
* @return 查询结果
*/
IPage<OilPurchase> queryByPage(@Param("page") Page page, @Param("oilTank") OilPurchase oilPurchase);
/**
* 新增数据
*
* @param oilPurchase 实例对象
* @return 实例对象
*/
OilPurchase insert(OilPurchase oilPurchase);
/**
* 修改数据
*
* @param oilPurchase 实例对象
* @return 实例对象
*/
OilPurchase update(OilPurchase oilPurchase);
/**
* 通过主键删除数据
*
* @param id 主键
* @return 是否成功
*/
boolean deleteById(Integer id);
}

View File

@ -0,0 +1,59 @@
package com.fuint.business.petrolStationManagement.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.petrolStationManagement.entity.OilSuppliers;
import org.apache.ibatis.annotations.Param;
/**
* 供应商信息(OilSuppliers)表服务接口
*
* @author makejava
* @since 2023-10-17 16:42:33
*/
public interface OilSuppliersService {
/**
* 通过ID查询单条数据
*
* @param id 主键
* @return 实例对象
*/
OilSuppliers queryById(Integer id);
/**
* 分页查询
*
* @param oilSuppliers 筛选条件
* @param page 分页对象
* @return 查询结果
*/
IPage<OilSuppliers> queryByPage(@Param("page") Page page, @Param("oilSuppliers") OilSuppliers oilSuppliers);
/**
* 新增数据
*
* @param oilSuppliers 实例对象
* @return 实例对象
*/
OilSuppliers insert(OilSuppliers oilSuppliers);
/**
* 修改数据
*
* @param oilSuppliers 实例对象
* @return 实例对象
*/
OilSuppliers update(OilSuppliers oilSuppliers);
/**
* 通过主键删除数据
*
* @param id 主键
* @return 是否成功
*/
boolean deleteById(Integer id);
}

View File

@ -7,6 +7,8 @@ import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List;
/**
* (OilTank)表服务接口
*
@ -33,6 +35,7 @@ public interface OilTankService {
IPage<OilTank> queryByPage(@Param("page") Page page,@Param("oilTank") OilTank oilTank);
List<OilTank> selectList(OilTank oilTank);
/**
* 新增数据
@ -58,4 +61,6 @@ public interface OilTankService {
*/
boolean deleteById(Integer id);
boolean cleanData(Integer id);
}

View File

@ -0,0 +1,117 @@
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.OilGun;
import com.fuint.business.petrolStationManagement.entity.OilNumber;
import com.fuint.business.petrolStationManagement.mapper.OilGunMapper;
import com.fuint.business.petrolStationManagement.mapper.OilNumberMapper;
import com.fuint.business.petrolStationManagement.service.OilGunService;
import com.fuint.business.petrolStationManagement.vo.OilGunVO;
import com.fuint.business.petrolStationManagement.vo.OilNumberVO;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil;
import com.fuint.quartz.util.BeanUtils;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
/**
* 油枪表(OilGun)表服务实现类
*
* @author makejava
* @since 2023-10-17 13:10:45
*/
@Service("oilGunService")
public class OilGunServiceImpl implements OilGunService {
@Resource
private OilGunMapper oilGunDao;
@Resource
private OilNumberMapper oilNumberMapper;
/**
* 通过ID查询单条数据
*
* @param id 主键
* @return 实例对象
*/
@Override
public OilGun queryById(Integer id) {
return this.oilGunDao.queryById(id);
}
/**
* 分页查询
*
* @param oilGun 筛选条件
* @return 查询结果
*/
@Override
public IPage<OilGun> queryByPage(@Param("page") Page page, @Param("oilGun") OilGun oilGun) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
oilGun.setStoreId(nowAccountInfo.getStoreId());
return oilGunDao.queryAllByLimit(page, oilGun);
}
@Override
public List<OilGunVO> selectByNumberTGUn(OilGun oilGun) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
oilGun.setStoreId(nowAccountInfo.getStoreId());
// 根据店铺id查询所有油类
List<OilGunVO> oilName = oilGunDao.getOilName(nowAccountInfo.getStoreId());
// 根据店铺id查询所有油枪
List<OilGun> allList = oilGunDao.getAllList(oilGun);
for (OilGunVO oilNumber : oilName) {
List<OilGun> oilGunList = new ArrayList<>();
for (OilGun gun : allList) {
if (oilNumber.getNumberId().equals(gun.getNumberId())) {
oilGunList.add(gun);
}
}
oilNumber.setOilGunList(oilGunList);
}
return oilName;
}
/**
* 新增数据
*
* @param oilGun 实例对象
* @return 实例对象
*/
@Override
public OilGun insert(OilGun oilGun) {
this.oilGunDao.insert(oilGun);
return oilGun;
}
/**
* 修改数据
*
* @param oilGun 实例对象
* @return 实例对象
*/
@Override
public OilGun update(OilGun oilGun) {
this.oilGunDao.update(oilGun);
return this.queryById(oilGun.getId());
}
/**
* 通过主键删除数据
*
* @param id 主键
* @return 是否成功
*/
@Override
public boolean deleteById(Integer id) {
return this.oilGunDao.deleteById(id) > 0;
}
}

View File

@ -8,6 +8,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.petrolStationManagement.entity.OilNumber;
import com.fuint.business.petrolStationManagement.mapper.OilNumberMapper;
import com.fuint.business.petrolStationManagement.service.OilNumberService;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil;
import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
@ -40,8 +42,13 @@ public class OilNumberServiceImpl extends ServiceImpl<OilNumberMapper, OilNumber
@Override
public int insertOilNumber(OilNumber oilNumber) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
oilNumber.setStoreId(nowAccountInfo.getStoreId());
// todo 根据id查询这个店铺是否加过该型号的油
// baseMapper.selectOilNameByStore(oilNumber);
int i = baseMapper.selectOilNameByStore(oilNumber);
if ( i<= 0) {
return 0;
}
return baseMapper.insertOilNumber(oilNumber);
}
@ -52,7 +59,8 @@ public class OilNumberServiceImpl extends ServiceImpl<OilNumberMapper, OilNumber
@Override
public List<OilNumber> getOilName() {
return baseMapper.getOilName();
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
return baseMapper.getOilName(nowAccountInfo.getStoreId());
}
@Override

View File

@ -0,0 +1,84 @@
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.OilPurchase;
import com.fuint.business.petrolStationManagement.entity.OilTank;
import com.fuint.business.petrolStationManagement.mapper.OilPurchaseMapper;
import com.fuint.business.petrolStationManagement.service.OilPurchaseService;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.PageRequest;
import javax.annotation.Resource;
/**
* 进油表(OilPurchase)表服务实现类
*
* @author makejava
* @since 2023-10-17 16:09:52
*/
@Service("oilPurchaseService")
public class OilPurchaseServiceImpl implements OilPurchaseService {
@Resource
private OilPurchaseMapper oilPurchaseDao;
/**
* 通过ID查询单条数据
*
* @param id 主键
* @return 实例对象
*/
@Override
public OilPurchase queryById(Integer id) {
return this.oilPurchaseDao.queryById(id);
}
/**
* 分页查询
*
* @param oilPurchase 筛选条件
* @param
* @return 查询结果
*/
@Override
public IPage<OilPurchase> queryByPage(@Param("page") Page page, @Param("OilPurchase") OilPurchase oilPurchase) {
return oilPurchaseDao.queryAllByLimit(page, oilPurchase);
}
/**
* 新增数据
*
* @param oilPurchase 实例对象
* @return 实例对象
*/
@Override
public OilPurchase insert(OilPurchase oilPurchase) {
this.oilPurchaseDao.insert(oilPurchase);
return oilPurchase;
}
/**
* 修改数据
*
* @param oilPurchase 实例对象
* @return 实例对象
*/
@Override
public OilPurchase update(OilPurchase oilPurchase) {
this.oilPurchaseDao.update(oilPurchase);
return this.queryById(oilPurchase.getId());
}
/**
* 通过主键删除数据
*
* @param id 主键
* @return 是否成功
*/
@Override
public boolean deleteById(Integer id) {
return this.oilPurchaseDao.deleteById(id) > 0;
}
}

View File

@ -0,0 +1,81 @@
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.OilSuppliers;
import com.fuint.business.petrolStationManagement.mapper.OilSuppliersMapper;
import com.fuint.business.petrolStationManagement.service.OilSuppliersService;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
/**
* 供应商信息(OilSuppliers)表服务实现类
*
* @author makejava
* @since 2023-10-17 16:42:33
*/
@Service("oilSuppliersService")
public class OilSuppliersServiceImpl implements OilSuppliersService {
@Resource
private OilSuppliersMapper oilSuppliersDao;
/**
* 通过ID查询单条数据
*
* @param id 主键
* @return 实例对象
*/
@Override
public OilSuppliers queryById(Integer id) {
return this.oilSuppliersDao.queryById(id);
}
/**
* 分页查询
*
* @param oilSuppliers 筛选条件
* @return 查询结果
*/
@Override
public IPage<OilSuppliers> queryByPage(@Param("page") Page page, @Param("oilSuppliers") OilSuppliers oilSuppliers) {
return oilSuppliersDao.queryAllByLimit(page, oilSuppliers);
}
/**
* 新增数据
*
* @param oilSuppliers 实例对象
* @return 实例对象
*/
@Override
public OilSuppliers insert(OilSuppliers oilSuppliers) {
this.oilSuppliersDao.insert(oilSuppliers);
return oilSuppliers;
}
/**
* 修改数据
*
* @param oilSuppliers 实例对象
* @return 实例对象
*/
@Override
public OilSuppliers update(OilSuppliers oilSuppliers) {
this.oilSuppliersDao.update(oilSuppliers);
return this.queryById(oilSuppliers.getId());
}
/**
* 通过主键删除数据
*
* @param id 主键
* @return 是否成功
*/
@Override
public boolean deleteById(Integer id) {
return this.oilSuppliersDao.deleteById(id) > 0;
}
}

View File

@ -4,12 +4,15 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.petrolStationManagement.entity.OilTank;
import com.fuint.business.petrolStationManagement.mapper.OilTankMapper;
import com.fuint.business.petrolStationManagement.service.OilTankService;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import javax.annotation.Resource;
import java.util.List;
/**
* (OilTank)表服务实现类
@ -47,6 +50,11 @@ public class OilTankServiceImpl implements OilTankService {
return oilTankDao.queryAllByLimit(page, oilTank);
}
@Override
public List<OilTank> selectList(OilTank oilTank) {
return null;
}
/**
* 新增数据
*
@ -55,6 +63,8 @@ public class OilTankServiceImpl implements OilTankService {
*/
@Override
public OilTank insert(OilTank oilTank) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
oilTank.setStoreId(nowAccountInfo.getStoreId());
this.oilTankDao.insert(oilTank);
return oilTank;
}
@ -81,4 +91,14 @@ public class OilTankServiceImpl implements OilTankService {
public boolean deleteById(Integer id) {
return this.oilTankDao.deleteById(id) > 0;
}
/**
* 初始化
* @param id
* @return
*/
@Override
public boolean cleanData(Integer id) {
return this.oilTankDao.cleanData(id) > 0;
}
}

View File

@ -0,0 +1,27 @@
package com.fuint.business.petrolStationManagement.vo;
import com.fuint.business.petrolStationManagement.entity.OilGun;
import lombok.Data;
import java.util.List;
@Data
public class OilGunVO extends OilGun {
private List<OilGun> oilGunList;
private OilGun oilGun;
public Integer numberId; //id主键)
private String oilType; // 油品类型
private String oilName; //油品名称
private Double oilPrice; //油品单价
private Double gbPrice; //国标价格
private String receivingUnits; //收款单位
private String state; // 状态 启用或禁用
private String sort; //排序
private String remark; //
private String ifDelete; //
private String unit; //
private Integer storeId; //
private Double oilDensity; //油品密度
}

View File

@ -0,0 +1,14 @@
package com.fuint.business.petrolStationManagement.vo;
import com.fuint.business.petrolStationManagement.entity.OilGun;
import com.fuint.business.petrolStationManagement.entity.OilNumber;
import lombok.Data;
import java.util.List;
@Data
public class OilNumberVO extends OilNumber {
List<OilGun> oilGunList;
}