From f19b2df0c0c089ef3219b24985fe098e2f91033e Mon Sep 17 00:00:00 2001
From: tuqin <tuqin@tuqin.cn>
Date: 星期三, 21 十月 2026 17:40:17 +0800
Subject: [PATCH] revert(基础数据): 撤掉油库信息/储罐信息模块(客户确认不需要,非本分支原有功能)
---
/dev/null | 123 -----------------------------------------
1 files changed, 0 insertions(+), 123 deletions(-)
diff --git a/src/main/java/com/ruoyi/basic/controller/OilDepotController.java b/src/main/java/com/ruoyi/basic/controller/OilDepotController.java
deleted file mode 100644
index b1cbeae..0000000
--- a/src/main/java/com/ruoyi/basic/controller/OilDepotController.java
+++ /dev/null
@@ -1,85 +0,0 @@
-package com.ruoyi.basic.controller;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.ruoyi.basic.pojo.OilDepot;
-import com.ruoyi.basic.service.IOilDepotService;
-import com.ruoyi.framework.aspectj.lang.annotation.Log;
-import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
-import com.ruoyi.framework.web.domain.R;
-import lombok.AllArgsConstructor;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * 娌瑰簱淇℃伅Controller
- *
- * @author ruoyi
- * @date 2026-09-10
- */
-@RestController
-@RequestMapping("/basic/oilDepot")
-@AllArgsConstructor
-public class OilDepotController {
- private IOilDepotService oilDepotService;
-
- /**
- * 鍒嗛〉鏌ヨ娌瑰簱淇℃伅鍒楄〃
- */
- @GetMapping("/list")
- public R list(Page<OilDepot> page, OilDepot oilDepot) {
- IPage<OilDepot> result = oilDepotService.selectOilDepotList(page, oilDepot);
- return R.ok(result);
- }
-
- /**
- * 鏌ヨ鍏ㄩ儴娌瑰簱淇℃伅锛堜緵涓嬫媺閫夋嫨锛�
- */
- @GetMapping("/all")
- public R all() {
- return R.ok(oilDepotService.selectAll());
- }
-
- /**
- * 鑾峰彇娌瑰簱淇℃伅璇︾粏淇℃伅
- */
- @GetMapping(value = "/{id}")
- public R getInfo(@PathVariable("id") Long id) {
- return R.ok(oilDepotService.selectOilDepotById(id));
- }
-
- /**
- * 鏂板娌瑰簱淇℃伅
- */
- @Log(title = "娌瑰簱淇℃伅", businessType = BusinessType.INSERT)
- @PostMapping("/add")
- public R add(@RequestBody OilDepot oilDepot) {
- return R.ok(oilDepotService.insertOilDepot(oilDepot));
- }
-
- /**
- * 淇敼娌瑰簱淇℃伅
- */
- @Log(title = "娌瑰簱淇℃伅", businessType = BusinessType.UPDATE)
- @PostMapping("/update")
- public R edit(@RequestBody OilDepot oilDepot) {
- return R.ok(oilDepotService.updateOilDepot(oilDepot));
- }
-
- /**
- * 鍒犻櫎娌瑰簱淇℃伅
- */
- @Log(title = "娌瑰簱淇℃伅", businessType = BusinessType.DELETE)
- @DeleteMapping("/del")
- public R remove(@RequestBody Long[] ids) {
- if (ids == null || ids.length == 0) {
- return R.fail("璇蜂紶鍏ヨ鍒犻櫎鐨処D");
- }
- return R.ok(oilDepotService.deleteOilDepotByIds(ids));
- }
-}
diff --git a/src/main/java/com/ruoyi/basic/controller/TankInfoController.java b/src/main/java/com/ruoyi/basic/controller/TankInfoController.java
deleted file mode 100644
index 3bf6ae6..0000000
--- a/src/main/java/com/ruoyi/basic/controller/TankInfoController.java
+++ /dev/null
@@ -1,85 +0,0 @@
-package com.ruoyi.basic.controller;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.ruoyi.basic.pojo.TankInfo;
-import com.ruoyi.basic.service.ITankInfoService;
-import com.ruoyi.framework.aspectj.lang.annotation.Log;
-import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
-import com.ruoyi.framework.web.domain.R;
-import lombok.AllArgsConstructor;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * 鍌ㄧ綈淇℃伅Controller
- *
- * @author ruoyi
- * @date 2026-09-10
- */
-@RestController
-@RequestMapping("/basic/tankInfo")
-@AllArgsConstructor
-public class TankInfoController {
- private ITankInfoService tankInfoService;
-
- /**
- * 鍒嗛〉鏌ヨ鍌ㄧ綈淇℃伅鍒楄〃
- */
- @GetMapping("/list")
- public R list(Page<TankInfo> page, TankInfo tankInfo) {
- IPage<TankInfo> result = tankInfoService.selectTankInfoList(page, tankInfo);
- return R.ok(result);
- }
-
- /**
- * 鏌ヨ鍏ㄩ儴鍌ㄧ綈淇℃伅锛堜緵涓嬫媺閫夋嫨锛�
- */
- @GetMapping("/all")
- public R all() {
- return R.ok(tankInfoService.selectAll());
- }
-
- /**
- * 鑾峰彇鍌ㄧ綈淇℃伅璇︾粏淇℃伅
- */
- @GetMapping(value = "/{id}")
- public R getInfo(@PathVariable("id") Long id) {
- return R.ok(tankInfoService.selectTankInfoById(id));
- }
-
- /**
- * 鏂板鍌ㄧ綈淇℃伅
- */
- @Log(title = "鍌ㄧ綈淇℃伅", businessType = BusinessType.INSERT)
- @PostMapping("/add")
- public R add(@RequestBody TankInfo tankInfo) {
- return R.ok(tankInfoService.insertTankInfo(tankInfo));
- }
-
- /**
- * 淇敼鍌ㄧ綈淇℃伅
- */
- @Log(title = "鍌ㄧ綈淇℃伅", businessType = BusinessType.UPDATE)
- @PostMapping("/update")
- public R edit(@RequestBody TankInfo tankInfo) {
- return R.ok(tankInfoService.updateTankInfo(tankInfo));
- }
-
- /**
- * 鍒犻櫎鍌ㄧ綈淇℃伅
- */
- @Log(title = "鍌ㄧ綈淇℃伅", businessType = BusinessType.DELETE)
- @DeleteMapping("/del")
- public R remove(@RequestBody Long[] ids) {
- if (ids == null || ids.length == 0) {
- return R.fail("璇蜂紶鍏ヨ鍒犻櫎鐨処D");
- }
- return R.ok(tankInfoService.deleteTankInfoByIds(ids));
- }
-}
diff --git a/src/main/java/com/ruoyi/basic/enums/TankUsageTypeEnum.java b/src/main/java/com/ruoyi/basic/enums/TankUsageTypeEnum.java
deleted file mode 100644
index a520280..0000000
--- a/src/main/java/com/ruoyi/basic/enums/TankUsageTypeEnum.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package com.ruoyi.basic.enums;
-
-import com.ruoyi.common.enums.BaseEnum;
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-
-/**
- * 鍌ㄧ綈鐢ㄩ�旀灇涓撅紝瀵瑰簲 tank_info.usage_type
- */
-@Getter
-@AllArgsConstructor
-public enum TankUsageTypeEnum implements BaseEnum<Integer> {
-
- LEASE(1, "绉熻祦"),
- SELF_USE(2, "鑷敤");
-
- private final Integer value;
- private final String label;
-
- @Override
- public Integer getCode() {
- return value;
- }
-
- @Override
- public String getValue() {
- return label;
- }
-}
diff --git a/src/main/java/com/ruoyi/basic/mapper/OilDepotMapper.java b/src/main/java/com/ruoyi/basic/mapper/OilDepotMapper.java
deleted file mode 100644
index 04b3060..0000000
--- a/src/main/java/com/ruoyi/basic/mapper/OilDepotMapper.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package com.ruoyi.basic.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.ruoyi.basic.pojo.OilDepot;
-import org.apache.ibatis.annotations.Mapper;
-
-/**
- * 娌瑰簱淇℃伅Mapper鎺ュ彛
- *
- * @author ruoyi
- * @date 2026-09-10
- */
-@Mapper
-public interface OilDepotMapper extends BaseMapper<OilDepot> {
-}
diff --git a/src/main/java/com/ruoyi/basic/mapper/TankInfoMapper.java b/src/main/java/com/ruoyi/basic/mapper/TankInfoMapper.java
deleted file mode 100644
index 00d2498..0000000
--- a/src/main/java/com/ruoyi/basic/mapper/TankInfoMapper.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package com.ruoyi.basic.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.ruoyi.basic.pojo.TankInfo;
-import org.apache.ibatis.annotations.Mapper;
-
-/**
- * 鍌ㄧ綈淇℃伅Mapper鎺ュ彛
- *
- * @author ruoyi
- * @date 2026-09-10
- */
-@Mapper
-public interface TankInfoMapper extends BaseMapper<TankInfo> {
-}
diff --git a/src/main/java/com/ruoyi/basic/pojo/OilDepot.java b/src/main/java/com/ruoyi/basic/pojo/OilDepot.java
deleted file mode 100644
index 5538807..0000000
--- a/src/main/java/com/ruoyi/basic/pojo/OilDepot.java
+++ /dev/null
@@ -1,93 +0,0 @@
-package com.ruoyi.basic.pojo;
-
-import com.baomidou.mybatisplus.annotation.FieldFill;
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.fasterxml.jackson.annotation.JsonFormat;
-import lombok.Data;
-
-import java.io.Serializable;
-import java.time.LocalDate;
-import java.time.LocalDateTime;
-
-/**
- * 娌瑰簱淇℃伅瀵硅薄 oil_depot
- *
- * @author ruoyi
- * @date 2026-09-10
- */
-@TableName(value = "oil_depot")
-@Data
-public class OilDepot implements Serializable {
- private static final long serialVersionUID = 1L;
-
- /**
- * 娌瑰簱id
- */
- @TableId(type = IdType.AUTO)
- private Long id;
-
- /**
- * 娌瑰簱鍚嶇О
- */
- private String depotName;
-
- /**
- * 璐熻矗浜�
- */
- private String chargePerson;
-
- /**
- * 鑱旂郴鐢佃瘽
- */
- private String phone;
-
- /**
- * 鍚敤鏃ユ湡
- */
- @JsonFormat(pattern = "yyyy-MM-dd")
- private LocalDate enableDate;
-
- /**
- * 鎵�灞炲叕鍙�
- */
- private String company;
-
- /**
- * 鍒涘缓鏃堕棿
- */
- @TableField(fill = FieldFill.INSERT)
- private LocalDateTime createTime;
-
- /**
- * 鍒涘缓浜�
- */
- @TableField(fill = FieldFill.INSERT)
- private Long createUser;
-
- /**
- * 鏇存柊鏃堕棿
- */
- @TableField(fill = FieldFill.INSERT_UPDATE)
- private LocalDateTime updateTime;
-
- /**
- * 鏇存柊浜�
- */
- @TableField(fill = FieldFill.INSERT_UPDATE)
- private Long updateUser;
-
- /**
- * 绉熸埛id
- */
- @TableField(fill = FieldFill.INSERT)
- private Long tenantId;
-
- /**
- * 閮ㄩ棬id
- */
- @TableField(fill = FieldFill.INSERT)
- private Long deptId;
-}
diff --git a/src/main/java/com/ruoyi/basic/pojo/TankInfo.java b/src/main/java/com/ruoyi/basic/pojo/TankInfo.java
deleted file mode 100644
index 78730ac..0000000
--- a/src/main/java/com/ruoyi/basic/pojo/TankInfo.java
+++ /dev/null
@@ -1,106 +0,0 @@
-package com.ruoyi.basic.pojo;
-
-import com.baomidou.mybatisplus.annotation.FieldFill;
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import lombok.Data;
-
-import java.io.Serializable;
-import java.math.BigDecimal;
-import java.time.LocalDateTime;
-
-/**
- * 鍌ㄧ綈淇℃伅瀵硅薄 tank_info
- *
- * @author ruoyi
- * @date 2026-09-10
- */
-@TableName(value = "tank_info")
-@Data
-public class TankInfo implements Serializable {
- private static final long serialVersionUID = 1L;
-
- /**
- * 鍌ㄧ綈id
- */
- @TableId(type = IdType.AUTO)
- private Long id;
-
- /**
- * 鍌ㄧ綈鍙�
- */
- private String tankNo;
-
- /**
- * 澶х被
- */
- private String category;
-
- /**
- * 娌瑰搧
- */
- private String oilProduct;
-
- /**
- * 缃愬
- */
- private BigDecimal capacity;
-
- /**
- * 搴撳瓨浣欓噺(m3)
- */
- private BigDecimal remaining;
-
- /**
- * 鏄惁鍚敤 1鍚敤 0鏈惎鐢�
- */
- private Integer isEnabled;
-
- /**
- * 鐢ㄩ�� 1绉熻祦 2鑷敤锛屽惎鐢ㄥ悗鎵嶉渶瑕侀��
- */
- private Integer usageType;
-
- /**
- * 绉熷淇℃伅锛屼粎鐢ㄩ��=绉熻祦鏃跺~鍐�
- */
- private String tenantInfo;
-
- /**
- * 鍒涘缓鏃堕棿
- */
- @TableField(fill = FieldFill.INSERT)
- private LocalDateTime createTime;
-
- /**
- * 鍒涘缓浜�
- */
- @TableField(fill = FieldFill.INSERT)
- private Long createUser;
-
- /**
- * 鏇存柊鏃堕棿
- */
- @TableField(fill = FieldFill.INSERT_UPDATE)
- private LocalDateTime updateTime;
-
- /**
- * 鏇存柊浜�
- */
- @TableField(fill = FieldFill.INSERT_UPDATE)
- private Long updateUser;
-
- /**
- * 绉熸埛id
- */
- @TableField(fill = FieldFill.INSERT)
- private Long tenantId;
-
- /**
- * 閮ㄩ棬id
- */
- @TableField(fill = FieldFill.INSERT)
- private Long deptId;
-}
diff --git a/src/main/java/com/ruoyi/basic/service/IOilDepotService.java b/src/main/java/com/ruoyi/basic/service/IOilDepotService.java
deleted file mode 100644
index 7830556..0000000
--- a/src/main/java/com/ruoyi/basic/service/IOilDepotService.java
+++ /dev/null
@@ -1,65 +0,0 @@
-package com.ruoyi.basic.service;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.ruoyi.basic.pojo.OilDepot;
-
-import java.util.List;
-
-/**
- * 娌瑰簱淇℃伅Service鎺ュ彛
- *
- * @author ruoyi
- * @date 2026-09-10
- */
-public interface IOilDepotService extends IService<OilDepot> {
-
- /**
- * 鍒嗛〉鏌ヨ娌瑰簱淇℃伅鍒楄〃
- *
- * @param page 鍒嗛〉鍙傛暟
- * @param oilDepot 鏌ヨ鏉′欢
- * @return 娌瑰簱淇℃伅闆嗗悎
- */
- IPage<OilDepot> selectOilDepotList(Page<OilDepot> page, OilDepot oilDepot);
-
- /**
- * 鏌ヨ鍏ㄩ儴娌瑰簱淇℃伅锛堜緵涓嬫媺閫夋嫨锛�
- *
- * @return 娌瑰簱淇℃伅闆嗗悎
- */
- List<OilDepot> selectAll();
-
- /**
- * 鏌ヨ娌瑰簱淇℃伅
- *
- * @param id 娌瑰簱淇℃伅涓婚敭
- * @return 娌瑰簱淇℃伅
- */
- OilDepot selectOilDepotById(Long id);
-
- /**
- * 鏂板娌瑰簱淇℃伅
- *
- * @param oilDepot 娌瑰簱淇℃伅
- * @return 缁撴灉
- */
- boolean insertOilDepot(OilDepot oilDepot);
-
- /**
- * 淇敼娌瑰簱淇℃伅
- *
- * @param oilDepot 娌瑰簱淇℃伅
- * @return 缁撴灉
- */
- boolean updateOilDepot(OilDepot oilDepot);
-
- /**
- * 鎵归噺鍒犻櫎娌瑰簱淇℃伅
- *
- * @param ids 闇�瑕佸垹闄ょ殑娌瑰簱淇℃伅涓婚敭闆嗗悎
- * @return 缁撴灉
- */
- boolean deleteOilDepotByIds(Long[] ids);
-}
diff --git a/src/main/java/com/ruoyi/basic/service/ITankInfoService.java b/src/main/java/com/ruoyi/basic/service/ITankInfoService.java
deleted file mode 100644
index 7835e4a..0000000
--- a/src/main/java/com/ruoyi/basic/service/ITankInfoService.java
+++ /dev/null
@@ -1,65 +0,0 @@
-package com.ruoyi.basic.service;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.ruoyi.basic.pojo.TankInfo;
-
-import java.util.List;
-
-/**
- * 鍌ㄧ綈淇℃伅Service鎺ュ彛
- *
- * @author ruoyi
- * @date 2026-09-10
- */
-public interface ITankInfoService extends IService<TankInfo> {
-
- /**
- * 鍒嗛〉鏌ヨ鍌ㄧ綈淇℃伅鍒楄〃
- *
- * @param page 鍒嗛〉鍙傛暟
- * @param tankInfo 鏌ヨ鏉′欢
- * @return 鍌ㄧ綈淇℃伅闆嗗悎
- */
- IPage<TankInfo> selectTankInfoList(Page<TankInfo> page, TankInfo tankInfo);
-
- /**
- * 鏌ヨ鍏ㄩ儴鍌ㄧ綈淇℃伅锛堜緵涓嬫媺閫夋嫨锛�
- *
- * @return 鍌ㄧ綈淇℃伅闆嗗悎
- */
- List<TankInfo> selectAll();
-
- /**
- * 鏌ヨ鍌ㄧ綈淇℃伅
- *
- * @param id 鍌ㄧ綈淇℃伅涓婚敭
- * @return 鍌ㄧ綈淇℃伅
- */
- TankInfo selectTankInfoById(Long id);
-
- /**
- * 鏂板鍌ㄧ綈淇℃伅
- *
- * @param tankInfo 鍌ㄧ綈淇℃伅
- * @return 缁撴灉
- */
- boolean insertTankInfo(TankInfo tankInfo);
-
- /**
- * 淇敼鍌ㄧ綈淇℃伅
- *
- * @param tankInfo 鍌ㄧ綈淇℃伅
- * @return 缁撴灉
- */
- boolean updateTankInfo(TankInfo tankInfo);
-
- /**
- * 鎵归噺鍒犻櫎鍌ㄧ綈淇℃伅
- *
- * @param ids 闇�瑕佸垹闄ょ殑鍌ㄧ綈淇℃伅涓婚敭闆嗗悎
- * @return 缁撴灉
- */
- boolean deleteTankInfoByIds(Long[] ids);
-}
diff --git a/src/main/java/com/ruoyi/basic/service/impl/OilDepotServiceImpl.java b/src/main/java/com/ruoyi/basic/service/impl/OilDepotServiceImpl.java
deleted file mode 100644
index 8d15c7d..0000000
--- a/src/main/java/com/ruoyi/basic/service/impl/OilDepotServiceImpl.java
+++ /dev/null
@@ -1,59 +0,0 @@
-package com.ruoyi.basic.service.impl;
-
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.ruoyi.basic.mapper.OilDepotMapper;
-import com.ruoyi.basic.pojo.OilDepot;
-import com.ruoyi.basic.service.IOilDepotService;
-import com.ruoyi.common.utils.StringUtils;
-import org.springframework.stereotype.Service;
-
-import java.util.List;
-
-/**
- * 娌瑰簱淇℃伅Service涓氬姟灞傚鐞�
- *
- * @author ruoyi
- * @date 2026-09-10
- */
-@Service
-public class OilDepotServiceImpl extends ServiceImpl<OilDepotMapper, OilDepot> implements IOilDepotService {
-
- @Override
- public IPage<OilDepot> selectOilDepotList(Page<OilDepot> page, OilDepot oilDepot) {
- LambdaQueryWrapper<OilDepot> queryWrapper = new LambdaQueryWrapper<>();
- queryWrapper.like(StringUtils.isNotBlank(oilDepot.getDepotName()), OilDepot::getDepotName, oilDepot.getDepotName())
- .like(StringUtils.isNotBlank(oilDepot.getCompany()), OilDepot::getCompany, oilDepot.getCompany())
- .orderByAsc(OilDepot::getId);
- return this.page(page, queryWrapper);
- }
-
- @Override
- public List<OilDepot> selectAll() {
- LambdaQueryWrapper<OilDepot> queryWrapper = new LambdaQueryWrapper<>();
- queryWrapper.orderByAsc(OilDepot::getId);
- return this.list(queryWrapper);
- }
-
- @Override
- public OilDepot selectOilDepotById(Long id) {
- return this.getById(id);
- }
-
- @Override
- public boolean insertOilDepot(OilDepot oilDepot) {
- return this.save(oilDepot);
- }
-
- @Override
- public boolean updateOilDepot(OilDepot oilDepot) {
- return this.updateById(oilDepot);
- }
-
- @Override
- public boolean deleteOilDepotByIds(Long[] ids) {
- return this.removeByIds(List.of(ids));
- }
-}
diff --git a/src/main/java/com/ruoyi/basic/service/impl/TankInfoServiceImpl.java b/src/main/java/com/ruoyi/basic/service/impl/TankInfoServiceImpl.java
deleted file mode 100644
index ece224e..0000000
--- a/src/main/java/com/ruoyi/basic/service/impl/TankInfoServiceImpl.java
+++ /dev/null
@@ -1,123 +0,0 @@
-package com.ruoyi.basic.service.impl;
-
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.ruoyi.basic.enums.TankUsageTypeEnum;
-import com.ruoyi.basic.mapper.TankInfoMapper;
-import com.ruoyi.basic.pojo.TankInfo;
-import com.ruoyi.basic.service.ITankInfoService;
-import com.ruoyi.common.exception.ServiceException;
-import com.ruoyi.common.utils.StringUtils;
-import org.springframework.stereotype.Service;
-
-import java.util.List;
-
-/**
- * 鍌ㄧ綈淇℃伅Service涓氬姟灞傚鐞�
- *
- * @author ruoyi
- * @date 2026-09-10
- */
-@Service
-public class TankInfoServiceImpl extends ServiceImpl<TankInfoMapper, TankInfo> implements ITankInfoService {
-
- /**
- * 鏄惁鍚敤锛氬惎鐢ㄣ�備笌 tank_info.is_enabled 鐨勯粯璁ゅ�间竴鑷�
- */
- private static final Integer TANK_ENABLED = 1;
-
- @Override
- public IPage<TankInfo> selectTankInfoList(Page<TankInfo> page, TankInfo tankInfo) {
- LambdaQueryWrapper<TankInfo> queryWrapper = new LambdaQueryWrapper<>();
- queryWrapper.like(StringUtils.isNotBlank(tankInfo.getTankNo()), TankInfo::getTankNo, tankInfo.getTankNo())
- .like(StringUtils.isNotBlank(tankInfo.getCategory()), TankInfo::getCategory, tankInfo.getCategory())
- .eq(tankInfo.getIsEnabled() != null, TankInfo::getIsEnabled, tankInfo.getIsEnabled())
- .eq(tankInfo.getUsageType() != null, TankInfo::getUsageType, tankInfo.getUsageType())
- .orderByAsc(TankInfo::getId);
- return this.page(page, queryWrapper);
- }
-
- /**
- * 涓嬫媺鐢細鍙繑鍥炲凡鍚敤鐨勫偍缃愩�傛湭鍚敤琛ㄧず杩樻病鎶曠敤锛屼笉搴旇鍏ュ簱绛変笟鍔¢�変腑
- */
- @Override
- public List<TankInfo> selectAll() {
- LambdaQueryWrapper<TankInfo> queryWrapper = new LambdaQueryWrapper<>();
- queryWrapper.eq(TankInfo::getIsEnabled, TANK_ENABLED)
- .orderByAsc(TankInfo::getId);
- return this.list(queryWrapper);
- }
-
- @Override
- public TankInfo selectTankInfoById(Long id) {
- return this.getById(id);
- }
-
- @Override
- public boolean insertTankInfo(TankInfo tankInfo) {
- normalizeUsage(tankInfo);
- return this.save(tankInfo);
- }
-
- @Override
- public boolean updateTankInfo(TankInfo tankInfo) {
- if (tankInfo.getId() == null) {
- throw new ServiceException("缂哄皯鍌ㄧ綈id");
- }
- normalizeUsage(tankInfo);
- boolean updated = this.updateById(tankInfo);
- if (updated) {
- // usageType / tenantInfo 鏄厑璁歌娓呯┖鐨勶紝鑰� updateById 榛樿璺宠繃 null 瀛楁锛團ieldStrategy.NOT_NULL锛夛紝
- // 娓呯┖鍔ㄤ綔鏍规湰鍐欎笉杩涘簱锛屾墍浠ヨ繖涓ゅ垪鍗曠嫭琛ヤ竴鏉℃洿鏂�
- updated = this.update(Wrappers.<TankInfo>lambdaUpdate()
- .eq(TankInfo::getId, tankInfo.getId())
- .set(TankInfo::getUsageType, tankInfo.getUsageType())
- .set(TankInfo::getTenantInfo, tankInfo.getTenantInfo()));
- }
- return updated;
- }
-
- /**
- * 褰掍竴鍖栥�屾槸鍚﹀惎鐢� / 鐢ㄩ�� / 绉熷淇℃伅銆嶄笁鑰呯殑鍏崇郴锛�
- * <ul>
- * <li>鏈惎鐢細鐢ㄩ�斾笌绉熷淇℃伅涓�寰嬫竻绌� 鈥斺�� 鍚敤涔嬪悗鎵嶈皥绉熻祦/鑷敤</li>
- * <li>鍚敤 + 绉熻祦锛氱瀹俊鎭繀濉�</li>
- * <li>鍚敤 + 鑷敤锛氱瀹俊鎭竻绌�</li>
- * <li>鍚敤 + 鐢ㄩ�斾负绌猴細瑙嗕负鏈�夋嫨锛屾棦涓嶆牎楠屼篃涓嶆竻绌恒�傝縼绉诲悗鐨勫瓨閲忓偍缃愬氨鏄繖涓姸鎬侊紝
- * 杩欐牱鑰佸墠绔笉鏀逛篃涓嶄細琚嫤锛屾洿涓嶄細鎶婂凡鏈夌殑绉熷淇℃伅鎶规帀</li>
- * </ul>
- */
- private void normalizeUsage(TankInfo tankInfo) {
- if (tankInfo.getIsEnabled() == null) {
- tankInfo.setIsEnabled(TANK_ENABLED);
- }
- if (!TANK_ENABLED.equals(tankInfo.getIsEnabled())) {
- tankInfo.setUsageType(null);
- tankInfo.setTenantInfo(null);
- return;
- }
- Integer usageType = tankInfo.getUsageType();
- if (usageType == null) {
- return;
- }
- if (TankUsageTypeEnum.LEASE.getCode().equals(usageType)) {
- if (StringUtils.isBlank(tankInfo.getTenantInfo())) {
- throw new ServiceException("绉熻祦鐨勫偍缃愬繀椤诲~鍐欑瀹俊鎭�");
- }
- return;
- }
- if (TankUsageTypeEnum.SELF_USE.getCode().equals(usageType)) {
- tankInfo.setTenantInfo(null);
- return;
- }
- throw new ServiceException("鍌ㄧ綈鐢ㄩ�斿彧鑳芥槸绉熻祦鎴栬嚜鐢�");
- }
-
- @Override
- public boolean deleteTankInfoByIds(Long[] ids) {
- return this.removeByIds(List.of(ids));
- }
-}
--
Gitblit v1.9.3