diff --git a/fuintAdmin/src/api/oilConfig/oilTank.js b/fuintAdmin/src/api/oilConfig/oilTank.js
new file mode 100644
index 000000000..b80c46542
--- /dev/null
+++ b/fuintAdmin/src/api/oilConfig/oilTank.js
@@ -0,0 +1,18 @@
+import request from "@/utils/request";
+
+// 查询油罐列表
+export function getTankApi(data) {
+ return request({
+ url: '/business/petrolStationManagement/oilTank/queryByPage',
+ method: 'get',
+ params: data
+ })
+}
+// 新增有关信息
+export function insertTankApi(data) {
+ return request({
+ url: 'business/petrolStationManagement/oilPresetPrices',
+ method: 'post',
+ data: data
+ })
+}
diff --git a/fuintAdmin/src/api/oilPrice.js b/fuintAdmin/src/api/oilPrice.js
index 4e8433b4d..17ae619ce 100644
--- a/fuintAdmin/src/api/oilPrice.js
+++ b/fuintAdmin/src/api/oilPrice.js
@@ -81,4 +81,13 @@ export function insertOilPresePricesApi(data) {
})
}
+export function stopJobApi(data) {
+ console.log("dddddaaaaa",data)
+ return request({
+ url: 'business/petrolStationManagement/oilPresetPrices/stopJob',
+ method: 'post',
+ data: data
+ })
+}
+
diff --git a/fuintAdmin/src/views/oilPrice/index.vue b/fuintAdmin/src/views/oilConfig/oilPrice/index.vue
similarity index 70%
rename from fuintAdmin/src/views/oilPrice/index.vue
rename to fuintAdmin/src/views/oilConfig/oilPrice/index.vue
index bd657d956..256a3ad0e 100644
--- a/fuintAdmin/src/views/oilPrice/index.vue
+++ b/fuintAdmin/src/views/oilConfig/oilPrice/index.vue
@@ -4,7 +4,7 @@
油价配置
- 新增油号
+ 新增油号
@@ -87,8 +87,11 @@
+
+
+
- {{ getStatusText(scope.row.state) }}
+
停止
@@ -115,21 +118,25 @@
-
-
-
-
-
- {{ option.dictLabel }}
-
+
+
+
+
+
-
-
+
+
+
-
+
-
-
+
+
-
-
+
+
+ 元
+
-
-
+
+
+ 元
+
@@ -173,17 +184,21 @@
-
+
点击油品输入的计算单位、可默认元或计价单位(L/m³/kg),页面也可自行切换
-
+
-
-
+
@@ -200,17 +215,23 @@
-
-
-
-
- {{ option.dictLabel }}
-
+
+
+
+
+
+
+
-
+
-
+
-
-
+
+
+ 元
+
-
-
+
+
+ 元
+
-
+
点击油品输入的计算单位、可默认元或计价单位(L/m³/kg),页面也可自行切换
-
+
-
-
+
+
+
-
+
-
-
-
-
+
+
-
+
+ 元
+
-
-
+
+
+ 元
+
-
+
+ 元
+
-
-
+
+
+ 元
+
-
+
+ style="width: 217px"
+ value-format="yyyy-MM-dd HH:mm:ss">
如生效时间与当前时间间隔小于1分钟,当前油价将立即生效
@@ -332,14 +370,59 @@ import {
getOilPresetList,
getOilNameApi,
getAllOilListApi,
- getOilNameListApi, insertOilPresePricesApi
+ getOilNameListApi, insertOilPresePricesApi, stopJobApi
} from "@/api/oilPrice";
export default {
name: 'index',
+ dicts: ['jobState','oil_type','zhzt'],
+
data() {
return {
+ oilPresetPricesRules: {
+ oilType:[
+ { required: true, message: '请选择油品类型', trigger: 'change' }
+ ],
+ presetOilPrices: [
+ {required: true, message: '请输入', trigger: 'blur'},
+ { type: 'number', message: '价格必须为数字值'}
+ ],
+ presetGbPrice: [
+ {required: true, message: '请输入', trigger: 'blur'},
+ { type: 'number', message: '价格必须为数字值'}
+ ],
+ effectiveTime:[
+ { type: 'date', required: true, message: '请选择日期', trigger: 'change' }
+ ],
+ },
+ rules: {
+ oilType:[
+ { required: true, message: '请选择油品类型', trigger: 'change' }
+ ],
+ unit:[
+ { required: true, message: '请选择', trigger: 'change' }
+ ],
+ oilName: [
+ { required: true, message: '请选择', trigger: 'change' }
+ ],
+ oilPrice: [
+ {required: true, message: '请输入', trigger: 'blur'},
+ { type: 'number', message: '价格必须为数字值'}
+ ],
+ gbPrice: [
+ {required: true, message: '请输入', trigger: 'blur'},
+ { type: 'number', message: '价格必须为数字值'}
+ ],
+ receivingUnits: [
+ { required: true, message: '请选择', trigger: 'change' }
+ ],
+ state: [
+ { required: true, message: '请选择', trigger: 'change' }
+ ]
+ },
+
+
oilNumberList: [],
oilNumberList2: [],
@@ -381,14 +464,15 @@ import {
selectOilTypeByPrice: [],
oilPresetPrices: {
oilType:'',
- currentPetrolPrices:'',
- presetOilPrices:'',
- currentGbPrice:'',
- presetGbPrice:'',
+ currentPetrolPrices:null ,
+ presetOilPrices:null ,
+ currentGbPrice:null ,
+ presetGbPrice:null ,
createTime:'',
updateTime:'',
effectiveTime:'',
ifDelete:'',
+ numberId:'',
},
form: {
@@ -447,6 +531,7 @@ import {
const oilList = response.data;
this.AllOilList = oilList
this.oilNumberList = this.oilNumberList2
+
this.oilNumberList.forEach(oilNumber => {
oilList.forEach(oil => {
if (parseInt(oilNumber.oilName) === oil.id) {
@@ -457,13 +542,18 @@ import {
});
});
+
} catch (error) {
// Handle error here if needed
}
},
// 编辑时使用
- async oilTypeMethods() {
+ async oilTypeMethods(data) {
+ if (data == 1) {
+ this.oilNumber = {}
+ }
+
try {
await Promise.all([
this.getOilTypeList("oil_type"),
@@ -477,7 +567,6 @@ import {
dis : true
}
this.receivingUnitList.push(cla1);
-
// 遍历 this.receivingUnitCN 对象的属性并添加到 receivingUnitList
for (const argumentsKey in this.receivingUnitCN) {
const value = this.receivingUnitCN[argumentsKey];
@@ -509,14 +598,13 @@ import {
}
this.receivingUnitList.push(cla);
}
-
- console.log("this.receivingUnitList",this.receivingUnitList)
} catch (error) {
console.error(error);
}
},
// 选择油品类型之后触发
- oilTypeClick() {
+ oilTypeClick(data) {
+ console.log("selectedValue",data)
const selectedValue = this.oilNumber.oilType;
// this.getOilTypeList(selectedValue)
this.getOilName(selectedValue)
@@ -524,26 +612,34 @@ import {
// 打开修改窗口
openOilNumberEdit(item) {
+ console.log("item",item)
this.oilNumber = item
},
// 添加
- async insertOilNumberin(){
+ insertOilNumberin(){
insertOilNumber(this.oilNumber).then( response => {
var list = response.data
+ this.getList();
+
console.log("updateOilNumber",list)
});
- await this.getList();
},
// 修改
async updateOilNumberin(){
- updateOilNumber(data).then( response => {
- var list = response.data
+ this.$refs["form"].validate(valid => {
+ if (valid) {
+ this.dialogFormNumberEdit = false
- console.log("updateOilNumber",list)
- });
- await this.getList();
+ var this_ = this
+ updateOilNumber(this_.oilNumber).then( response => {
+ var list = response.data
+ this.getList();
+ console.log("updateOilNumber",list)
+ });
+ }
+ })
},
// 查询数组字典类型
@@ -593,9 +689,6 @@ import {
}
});
});
- console.log("111111111111111111111111111111",this.oilPresetPricesList)
- console.log("111111111111111111111111111111",)
- console.log("111111111111111111111111111111")
});
},
// 油价预设查询列表
@@ -606,28 +699,36 @@ import {
this_.selectOilTypeByPrice = list
});
},
-
-
// 新增油价预设
addOilPresePrices() {
+ this.oilPresetPrices = {}
// this.selectOilTypeByPrice = this.oilNumberList;
// 油价预设查询列表
this.getOilNameList();
},
- // 添加youjia1 yusheeeeeeeeeeeeeeeeeee
+ // 添加youjia1
insertOilPresePrices(){
- insertOilPresePricesApi(this.oilPresetPrices).then( response => {
- var list = response.data
- console.log("updateOilNumber",list)
+ // console.log(typeof oilPresetPrices.presetOilPrices);
+ console.log("typeof oilPresetPrices.presetOilPrices",this.oilPresetPrices);
+ this.$refs["Priform"].validate(valid => {
+ if (valid) {
+ this.dialogFormPricesAdd = false
+ insertOilPresePricesApi(this.oilPresetPrices).then(response => {
+ var list = response.data
+ this.getOilNameList();
+ });
+ }
});
},
// 更改状态
deleteRow(data1, data2) {
- console.log("data1",data1);
console.log("data2",data2);
+ stopJobApi(data2).then( response => {
+ this.getOilPresetListin();
+ });
},
@@ -639,6 +740,7 @@ import {
if (oil.numberId == parseInt(count)) {
this.oilPresetPrices.currentPetrolPrices = oil.oilPrice;
this.oilPresetPrices.currentGbPrice = oil.gbPrice;
+ this.oilPresetPrices.numberId = oil.numberId;
}
});
}
diff --git a/fuintAdmin/src/views/oilConfig/oilTank/list.vue b/fuintAdmin/src/views/oilConfig/oilTank/list.vue
new file mode 100644
index 000000000..d49087615
--- /dev/null
+++ b/fuintAdmin/src/views/oilConfig/oilTank/list.vue
@@ -0,0 +1,373 @@
+
+
+
+
+
+
+
+
+
+
+ 搜索
+
+
+
+
+
+
+
+
+
+ 新增油罐
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ parseTime(scope.row.updateTime) }}
+
+
+
+
+ 修改
+ 删除
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/controller/OilPresetPricesController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/controller/OilPresetPricesController.java
index fd1f15384..b198b30ed 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/controller/OilPresetPricesController.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/controller/OilPresetPricesController.java
@@ -45,7 +45,7 @@ public class OilPresetPricesController 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 = "1000") Integer pageSize,
OilPresetPrices oilPresetPrices) {
Page page =new Page(pageNo,pageSize);
IPage list = oilPresetPricesService.selectOilPresetPricesList(page,oilPresetPrices);
@@ -102,5 +102,18 @@ public class OilPresetPricesController extends BaseController {
public ResponseObject editStart(Long id){
return getSuccessResult(oilPresetPricesService.editStart(id));
}
+
+
+ /**
+ * 停用定时任务
+ */
+ @PostMapping("stopJob")
+ public ResponseObject stopJob(@RequestBody OilPresetPrices presetPrices){
+ int i = oilPresetPricesService.stopJob(presetPrices);
+ if (i<=0) {
+ return getFailureResult("停止失败");
+ }
+ return getSuccessResult("停止成功");
+ }
}
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/controller/OilTankController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/controller/OilTankController.java
new file mode 100644
index 000000000..3a3b54606
--- /dev/null
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/controller/OilTankController.java
@@ -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.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;
+
+/**
+ * (OilTank)表控制层
+ *
+ * @author makejava
+ * @since 2023-10-16 15:15:06
+ */
+@RestController
+@RequestMapping("business/petrolStationManagement/oilTank")
+public class OilTankController extends BaseController {
+ /**
+ * 服务对象
+ */
+ @Resource
+ private OilTankService oilTankService;
+
+ /**
+ * 分页查询
+ *
+ * @param oilTank 筛选条件
+ * @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);
+ IPage oilTanks = this.oilTankService.queryByPage(page, oilTank);
+ return getSuccessResult(oilTanks);
+ }
+
+
+ /**
+ * 通过主键查询单条数据
+ *
+ * @param id 主键
+ * @return 单条数据
+ */
+ @GetMapping("{id}")
+ public ResponseObject queryById(@PathVariable("id") Integer id) {
+ return getSuccessResult(this.oilTankService.queryById(id));
+ }
+
+ /**
+ * 新增数据
+ *
+ * @param oilTank 实体
+ * @return 新增结果
+ */
+ @PostMapping
+ public ResponseObject add(OilTank oilTank) {
+ return getSuccessResult(this.oilTankService.insert(oilTank));
+ }
+
+ /**
+ * 编辑数据
+ *
+ * @param oilTank 实体
+ * @return 编辑结果
+ */
+ @PutMapping
+ public ResponseObject edit(OilTank oilTank) {
+ return getSuccessResult(this.oilTankService.update(oilTank));
+ }
+
+ /**
+ * 删除数据
+ *
+ * @param id 主键
+ * @return 删除是否成功
+ */
+ @DeleteMapping
+ public ResponseObject deleteById(Integer id) {
+ return getSuccessResult(this.oilTankService.deleteById(id));
+ }
+
+}
+
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/entity/OilPresetPrices.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/entity/OilPresetPrices.java
index 8a03ce422..198d695a3 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/entity/OilPresetPrices.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/entity/OilPresetPrices.java
@@ -18,8 +18,8 @@ import java.util.Date;
@Data
public class OilPresetPrices extends BaseEntity {
- @TableId(value = "number_id", type = IdType.AUTO)
- private Long presetId; // id(主键)
+ @TableId(value = "presetId", type = IdType.AUTO)
+ private Integer presetId; // id(主键)
private Long oilType; // 预设油号 id
private Double currentPetrolPrices; // 当前油站价
private Double presetOilPrices; // 预设油站价
@@ -27,10 +27,11 @@ public class OilPresetPrices extends BaseEntity {
private Double presetGbPrice; // 预设国标价
private String effectiveTime; // 生效时间(时间戳)
private Integer ifDelete; // 是否删除(0未删除|1删除)
- private Integer state; // 状态
+ private String state; // 状态
private Integer numberId; // 状态
private Integer storeId; // 关联的店铺id
+ private Long jobId; // 定时任务id
// /**
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/entity/OilTank.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/entity/OilTank.java
new file mode 100644
index 000000000..39d89c75b
--- /dev/null
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/entity/OilTank.java
@@ -0,0 +1,90 @@
+package com.fuint.business.petrolStationManagement.entity;
+
+import com.fuint.repository.model.base.BaseEntity;
+import lombok.Data;
+
+import java.util.Date;
+import java.io.Serializable;
+
+/**
+ * (OilTank)实体类
+ *
+ * @author makejava
+ * @since 2023-10-16 15:15:18
+ */
+@Data
+public class OilTank extends BaseEntity {
+ private static final long serialVersionUID = 248745823149959397L;
+ /**
+ * 油罐ID
+ */
+ private Integer id;
+ /**
+ * 油罐名称
+ */
+ private String tankName;
+ /**
+ * 油品号
+ */
+ private String oilNumber;
+ /**
+ * 油罐体积
+ */
+ private Double tankVolume;
+ /**
+ * 下限预警
+ */
+ private Double lowerWarning;
+ /**
+ * 油品密度
+ */
+ private Double oilDensity;
+ /**
+ * 存油数量
+ */
+ private Double storedQuantity;
+ /**
+ * 存油总价
+ */
+ private Double totalPrice;
+ /**
+ * 折后单价
+ */
+ private Double discountedPrice;
+ /**
+ * 状态
+ */
+ private String status;
+ /**
+ * 备注信息
+ */
+ private String remarks;
+ /**
+ * 店铺ID
+ */
+ private Integer storeId;
+ /**
+ * 关联油号表ID
+ */
+ private Integer numberId;
+// /**
+// * 创建时间
+// */
+// private Date createTime;
+// /**
+// * 更新时间
+// */
+// private Date updateTime;
+// /**
+// * 创建人
+// */
+// private Integer createBy;
+// /**
+// * 更新人
+// */
+// private Integer updateBy;
+
+
+
+}
+
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/mapper/OilPresetPricesMapper.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/mapper/OilPresetPricesMapper.java
index 2b25a4f1e..f8666193c 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/mapper/OilPresetPricesMapper.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/mapper/OilPresetPricesMapper.java
@@ -46,6 +46,13 @@ public interface OilPresetPricesMapper extends BaseMapper {
*/
public int updateOilPresetPrices(OilPresetPrices presetPrices);
- public int editStart(Integer id, Integer state);
+ public int editStart(@Param("id") Integer id,@Param("state") String state);
+
+ /**
+ * 修改定时任务id
+ * @param presetPrices
+ * @return
+ */
+ public int updateJobId(OilPresetPrices presetPrices);
}
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/mapper/OilTankMapper.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/mapper/OilTankMapper.java
new file mode 100644
index 000000000..ce56099f8
--- /dev/null
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/mapper/OilTankMapper.java
@@ -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.OilPresetPrices;
+import com.fuint.business.petrolStationManagement.entity.OilTank;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.data.domain.Pageable;
+import java.util.List;
+
+/**
+ * (OilTank)表数据库访问层
+ *
+ * @author makejava
+ * @since 2023-10-16 15:15:06
+ */
+public interface OilTankMapper {
+
+ /**
+ * 通过ID查询单条数据
+ *
+ * @param id 主键
+ * @return 实例对象
+ */
+ OilTank queryById(Integer id);
+
+ /**
+ * 查询指定行数据
+ *
+ * @param oilTank 查询条件
+ * @param pageable 分页对象
+ * @return 对象列表
+ */
+ IPage queryAllByLimit(@Param("page")Page page,@Param("oilTank") OilTank oilTank);
+
+ /**
+ * 统计总行数
+ *
+ * @param oilTank 查询条件
+ * @return 总行数
+ */
+ long count(OilTank oilTank);
+
+ /**
+ * 新增数据
+ *
+ * @param oilTank 实例对象
+ * @return 影响行数
+ */
+ int insert(OilTank oilTank);
+
+ /**
+ * 批量新增数据(MyBatis原生foreach方法)
+ *
+ * @param entities List 实例对象列表
+ * @return 影响行数
+ */
+ int insertBatch(@Param("entities") List entities);
+
+ /**
+ * 批量新增或按主键更新数据(MyBatis原生foreach方法)
+ *
+ * @param entities List 实例对象列表
+ * @return 影响行数
+ * @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参
+ */
+ int insertOrUpdateBatch(@Param("entities") List entities);
+
+ /**
+ * 修改数据
+ *
+ * @param oilTank 实例对象
+ * @return 影响行数
+ */
+ int update(OilTank oilTank);
+
+ /**
+ * 通过主键删除数据
+ *
+ * @param id 主键
+ * @return 影响行数
+ */
+ int deleteById(Integer id);
+
+}
+
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/mapper/xml/OilNameMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/mapper/xml/OilNameMapper.xml
index 20830fa17..d920675d3 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/mapper/xml/OilNameMapper.xml
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/mapper/xml/OilNameMapper.xml
@@ -13,12 +13,17 @@
SELECT
NA.id AS id,
NA.oil_name AS oilName,
- dict.dict_label AS oilType
+ NA.oil_type AS oilType
FROM
oil_name NA
- LEFT JOIN (
- SELECT dict_label,dict_value FROM sys_dict_data WHERE dict_type = 'oil_type'
- ) dict ON NA.oil_type = dict.dict_value;
-
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/mapper/xml/OilPresetPricesMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/mapper/xml/OilPresetPricesMapper.xml
index 287913eef..3665a2478 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/mapper/xml/OilPresetPricesMapper.xml
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/mapper/xml/OilPresetPricesMapper.xml
@@ -16,11 +16,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+
+
select preset_id, oil_type, current_petrol_prices, preset_oil_prices, current_gb_price,
- preset_gb_price, create_time, update_time, effective_time, if_delete, state
+ preset_gb_price, create_time, update_time, effective_time, if_delete, state,number_id,job_id
from oil_preset_prices
@@ -29,15 +31,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+
+
-
+
insert into oil_preset_prices
oil_type,
@@ -50,6 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
effective_time,
if_delete,
state,
+ number_id,
#{oilType},
@@ -62,6 +66,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{effectiveTime},
#{ifDelete},
#{state},
+ #{numberId},
@@ -78,15 +83,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
effective_time = #{ifDelete},
effective_time = #{ifDelete},
- where number_id = #{numberId}
+ where preset_id = #{presetId}
delete from oil_preset_prices where preset_id = #{id}
- update oil_preset_prices state = #{oilType} where number_id = #{numberId}
+ update oil_preset_prices set state = #{state} where preset_id = #{id}
+
+
+
+ update oil_preset_prices set job_id = #{jobId} where preset_id = #{presetId}
\ No newline at end of file
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/mapper/xml/OilTankMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/mapper/xml/OilTankMapper.xml
new file mode 100644
index 000000000..179075f87
--- /dev/null
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/mapper/xml/OilTankMapper.xml
@@ -0,0 +1,254 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 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)
+ values
+
+ (#{entity.tankName}, #{entity.oilNumber}, #{entity.tankVolume}, #{entity.lowerWarning}, #{entity.oilDensity}, #{entity.storedQuantity}, #{entity.totalPrice}, #{entity.discountedPrice}, #{entity.status}, #{entity.remarks}, #{entity.storeId}, #{entity.numberId}, #{entity.createTime}, #{entity.updateTime}, #{entity.createBy}, #{entity.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)
+ values
+
+ (#{entity.tankName}, #{entity.oilNumber}, #{entity.tankVolume}, #{entity.lowerWarning}, #{entity.oilDensity}, #{entity.storedQuantity}, #{entity.totalPrice}, #{entity.discountedPrice}, #{entity.status}, #{entity.remarks}, #{entity.storeId}, #{entity.numberId}, #{entity.createTime}, #{entity.updateTime}, #{entity.createBy}, #{entity.updateBy})
+
+ on duplicate key update
+ tank_name = values(tank_name),
+ oil_number = values(oil_number),
+ tank_volume = values(tank_volume),
+ lower_warning = values(lower_warning),
+ oil_density = values(oil_density),
+ stored_quantity = values(stored_quantity),
+ total_price = values(total_price),
+ discounted_price = values(discounted_price),
+ status = values(status),
+ remarks = values(remarks),
+ store_id = values(store_id),
+ number_id = values(number_id),
+ create_time = values(create_time),
+ update_time = values(update_time),
+ create_by = values(create_by),
+ update_by = values(update_by)
+
+
+
+
+ update oil_tank
+
+
+ tank_name = #{tankName},
+
+
+ oil_number = #{oilNumber},
+
+
+ tank_volume = #{tankVolume},
+
+
+ lower_warning = #{lowerWarning},
+
+
+ oil_density = #{oilDensity},
+
+
+ stored_quantity = #{storedQuantity},
+
+
+ total_price = #{totalPrice},
+
+
+ discounted_price = #{discountedPrice},
+
+
+ status = #{status},
+
+
+ remarks = #{remarks},
+
+
+ store_id = #{storeId},
+
+
+ number_id = #{numberId},
+
+
+ create_time = #{createTime},
+
+
+ update_time = #{updateTime},
+
+
+ create_by = #{createBy},
+
+
+ update_by = #{updateBy},
+
+
+ where id = #{id}
+
+
+
+
+ delete from oil_tank where id = #{id}
+
+
+
+
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/service/OilPresetPricesService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/service/OilPresetPricesService.java
index e846db6a3..8dc2b3cb0 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/service/OilPresetPricesService.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/service/OilPresetPricesService.java
@@ -53,5 +53,7 @@ public interface OilPresetPricesService extends IService {
* 定时器设置(定时调整油价)
*/
public void timingAdjustment(Integer id);
+
+ public int stopJob(OilPresetPrices presetPrices);
}
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/service/OilTankService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/service/OilTankService.java
new file mode 100644
index 000000000..b934f38b5
--- /dev/null
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/service/OilTankService.java
@@ -0,0 +1,61 @@
+package com.fuint.business.petrolStationManagement.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.fuint.business.petrolStationManagement.entity.OilPresetPrices;
+import com.fuint.business.petrolStationManagement.entity.OilTank;
+import org.apache.ibatis.annotations.Param;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+
+/**
+ * (OilTank)表服务接口
+ *
+ * @author makejava
+ * @since 2023-10-16 15:15:25
+ */
+public interface OilTankService {
+
+ /**
+ * 通过ID查询单条数据
+ *
+ * @param id 主键
+ * @return 实例对象
+ */
+ OilTank queryById(Integer id);
+
+ /**
+ * 分页查询
+ *
+ * @param oilTank 筛选条件
+ * @param 分页对象
+ * @return 查询结果
+ */
+ IPage queryByPage(@Param("page") Page page,@Param("oilTank") OilTank oilTank);
+
+
+
+ /**
+ * 新增数据
+ *
+ * @param oilTank 实例对象
+ * @return 实例对象
+ */
+ OilTank insert(OilTank oilTank);
+
+ /**
+ * 修改数据
+ *
+ * @param oilTank 实例对象
+ * @return 实例对象
+ */
+ OilTank update(OilTank oilTank);
+
+ /**
+ * 通过主键删除数据
+ *
+ * @param id 主键
+ * @return 是否成功
+ */
+ boolean deleteById(Integer id);
+
+}
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/service/impl/OilPresetPricesServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/service/impl/OilPresetPricesServiceImpl.java
index e90f74032..9c5d0aa0f 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/service/impl/OilPresetPricesServiceImpl.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/service/impl/OilPresetPricesServiceImpl.java
@@ -8,17 +8,17 @@ 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.util.DateUtil;
-import com.fuint.quartz.common.TaskException;
+import com.fuint.common.util.StringUtils;
import com.fuint.quartz.domain.SysJob;
import com.fuint.quartz.service.ISysJobService;
+import com.fuint.quartz.util.BeanUtils;
import org.quartz.SchedulerException;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
-
import javax.annotation.Resource;
-import java.time.Instant;
+import java.text.SimpleDateFormat;
+import java.util.Date;
/**
* (ChainStoreInfo)表服务实现类
@@ -55,33 +55,67 @@ public class OilPresetPricesServiceImpl extends ServiceImpl queryByPage(@Param("page") Page page,@Param("oilTank") OilTank oilTank) {
+// long total = this.oilTankDao.count(oilTank);
+// return new PageImpl<>(this.oilTankDao.queryAllByLimit(oilTank, pageRequest), pageRequest, total);
+ return oilTankDao.queryAllByLimit(page, oilTank);
+ }
+
+ /**
+ * 新增数据
+ *
+ * @param oilTank 实例对象
+ * @return 实例对象
+ */
+ @Override
+ public OilTank insert(OilTank oilTank) {
+ this.oilTankDao.insert(oilTank);
+ return oilTank;
+ }
+
+ /**
+ * 修改数据
+ *
+ * @param oilTank 实例对象
+ * @return 实例对象
+ */
+ @Override
+ public OilTank update(OilTank oilTank) {
+ this.oilTankDao.update(oilTank);
+ return this.queryById(oilTank.getId());
+ }
+
+ /**
+ * 通过主键删除数据
+ *
+ * @param id 主键
+ * @return 是否成功
+ */
+ @Override
+ public boolean deleteById(Integer id) {
+ return this.oilTankDao.deleteById(id) > 0;
+ }
+}
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/task/PresetPrices.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/task/PresetPrices.java
index 844dd6135..aa166d81d 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/task/PresetPrices.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/task/PresetPrices.java
@@ -1,24 +1,29 @@
package com.fuint.business.petrolStationManagement.task;
-import com.baomidou.mybatisplus.core.toolkit.StringUtils;
+import com.fuint.business.petrolStationManagement.service.OilPresetPricesService;
import org.springframework.stereotype.Component;
+import javax.annotation.Resource;
+
/**
* 定时任务调度测试
*
* @author ruoyi
*/
@Component("presetPrices")
-public class PresetPrices
-{
+public class PresetPrices {
// public void ryMultipleParams(String s, Boolean b, Long l, Double d, Integer i)
// {
// System.out.println(StringUtils.format("执行多参方法: 字符串类型{},布尔类型{},长整型{},浮点型{},整形{}", s, b, l, d, i));
// }
+ @Resource
+ private OilPresetPricesService oilPresetPricesService;
public void ryParams(String params)
{
- System.out.println("执行有参方法:" + params);
+ System.out.println("定时任务11111111:" + params);
+
+ oilPresetPricesService.timingAdjustment(Integer.parseInt(params));
}
// public void ryNoParams()