From 1d69c4b7da499b1d80b47fda9b275a795a8a7063 Mon Sep 17 00:00:00 2001
From: aijinhui <aijinhui>
Date: 星期三, 18 十月 2023 11:45:03 +0800
Subject: [PATCH] 实体类
---
ard-work/src/main/java/com/ruoyi/oil/domain/ArdOilWall.java | 2
ard-work/src/main/java/com/ruoyi/statistical/domain/ArdPumpStatus.java | 2
ard-work/src/main/java/com/ruoyi/oil/controller/OilWallController.java | 24 +++++-------
ard-work/src/main/java/com/ruoyi/oil/service/impl/OilWallServiceImpl.java | 17 ++++----
ard-work/src/main/java/com/ruoyi/oil/mapper/OilWallMapper.java | 4 +-
ard-work/src/main/java/com/ruoyi/sy/controller/ArdSyCarLockController.java | 6 ---
ard-work/src/main/java/com/ruoyi/oil/service/OilWallService.java | 10 ++--
ard-work/src/main/java/com/ruoyi/statistical/mapper/PumpStatusMapper.java | 4 +-
ard-work/src/main/java/com/ruoyi/statistical/service/impl/StatisticalServiceImpl.java | 35 ++++++++---------
9 files changed, 46 insertions(+), 58 deletions(-)
diff --git a/ard-work/src/main/java/com/ruoyi/oil/controller/OilWallController.java b/ard-work/src/main/java/com/ruoyi/oil/controller/OilWallController.java
index fc2cabe..98d2346 100644
--- a/ard-work/src/main/java/com/ruoyi/oil/controller/OilWallController.java
+++ b/ard-work/src/main/java/com/ruoyi/oil/controller/OilWallController.java
@@ -1,21 +1,17 @@
package com.ruoyi.oil.controller;
-import com.ruoyi.common.annotation.Log;
-import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.uuid.UUID;
-import com.ruoyi.oil.domain.OilWall;
+import com.ruoyi.oil.domain.ArdOilWall;
import com.ruoyi.oil.param.OilWallParam;
import com.ruoyi.oil.service.OilWallService;
import com.ruoyi.utils.result.Results;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
-import java.util.logging.SimpleFormatter;
/**
* @author Administrator
@@ -30,11 +26,11 @@
@PostMapping("/add")
@ApiOperation("娣诲姞鐢靛瓙鍥存爮")
- public Results add(@RequestBody OilWall oilWall){
- oilWall.setId(String.valueOf(UUID.randomUUID()));
- oilWall.setCreateBy(SecurityUtils.getUsername());
- oilWall.setCreateTime(new Date());
- return Results.succeed("鎴愬姛娣诲姞"+oilWallService.addOilWall(oilWall)+"鏉℃暟鎹�");
+ public Results add(@RequestBody ArdOilWall ardOilWall){
+ ardOilWall.setId(String.valueOf(UUID.randomUUID()));
+ ardOilWall.setCreateBy(SecurityUtils.getUsername());
+ ardOilWall.setCreateTime(new Date());
+ return Results.succeed("鎴愬姛娣诲姞"+oilWallService.addOilWall(ardOilWall)+"鏉℃暟鎹�");
}
@DeleteMapping("/del")
@@ -45,10 +41,10 @@
@PutMapping("/upd")
@ApiOperation("淇敼鐢靛瓙鍥存爮")
- public Results upd(@RequestBody OilWall oilWall){
- oilWall.setUpdateBy(SecurityUtils.getUsername());
- oilWall.setUpdateTime(new Date());
- return Results.succeed("鎴愬姛淇敼"+oilWallService.updOilWall(oilWall)+"鏉℃暟鎹�");
+ public Results upd(@RequestBody ArdOilWall ardOilWall){
+ ardOilWall.setUpdateBy(SecurityUtils.getUsername());
+ ardOilWall.setUpdateTime(new Date());
+ return Results.succeed("鎴愬姛淇敼"+oilWallService.updOilWall(ardOilWall)+"鏉℃暟鎹�");
}
@GetMapping("/one")
diff --git a/ard-work/src/main/java/com/ruoyi/oil/domain/OilWall.java b/ard-work/src/main/java/com/ruoyi/oil/domain/ArdOilWall.java
similarity index 97%
rename from ard-work/src/main/java/com/ruoyi/oil/domain/OilWall.java
rename to ard-work/src/main/java/com/ruoyi/oil/domain/ArdOilWall.java
index 3873426..fb23a1a 100644
--- a/ard-work/src/main/java/com/ruoyi/oil/domain/OilWall.java
+++ b/ard-work/src/main/java/com/ruoyi/oil/domain/ArdOilWall.java
@@ -12,7 +12,7 @@
* @author Administrator
*/
@Data
-public class OilWall{
+public class ArdOilWall {
private String id;
private String name;
private String coord;
diff --git a/ard-work/src/main/java/com/ruoyi/oil/mapper/OilWallMapper.java b/ard-work/src/main/java/com/ruoyi/oil/mapper/OilWallMapper.java
index 63184dd..8142ab7 100644
--- a/ard-work/src/main/java/com/ruoyi/oil/mapper/OilWallMapper.java
+++ b/ard-work/src/main/java/com/ruoyi/oil/mapper/OilWallMapper.java
@@ -1,10 +1,10 @@
package com.ruoyi.oil.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.ruoyi.oil.domain.OilWall;
+import com.ruoyi.oil.domain.ArdOilWall;
/**
* @author Administrator
*/
-public interface OilWallMapper extends BaseMapper<OilWall> {
+public interface OilWallMapper extends BaseMapper<ArdOilWall> {
}
diff --git a/ard-work/src/main/java/com/ruoyi/oil/service/OilWallService.java b/ard-work/src/main/java/com/ruoyi/oil/service/OilWallService.java
index 2f848e0..fb8d27b 100644
--- a/ard-work/src/main/java/com/ruoyi/oil/service/OilWallService.java
+++ b/ard-work/src/main/java/com/ruoyi/oil/service/OilWallService.java
@@ -1,7 +1,7 @@
package com.ruoyi.oil.service;
-import com.ruoyi.oil.domain.OilWall;
+import com.ruoyi.oil.domain.ArdOilWall;
import com.ruoyi.oil.param.OilWallParam;
import java.util.List;
@@ -10,9 +10,9 @@
* @author Administrator
*/
public interface OilWallService {
- int addOilWall(OilWall oilWall);
+ int addOilWall(ArdOilWall ardOilWall);
int delOilWall(String id);
- int updOilWall(OilWall oilWall);
- OilWall one(String id);
- List<OilWall> query(OilWallParam oilWallParam);
+ int updOilWall(ArdOilWall ardOilWall);
+ ArdOilWall one(String id);
+ List<ArdOilWall> query(OilWallParam oilWallParam);
}
diff --git a/ard-work/src/main/java/com/ruoyi/oil/service/impl/OilWallServiceImpl.java b/ard-work/src/main/java/com/ruoyi/oil/service/impl/OilWallServiceImpl.java
index 62ba905..56e5269 100644
--- a/ard-work/src/main/java/com/ruoyi/oil/service/impl/OilWallServiceImpl.java
+++ b/ard-work/src/main/java/com/ruoyi/oil/service/impl/OilWallServiceImpl.java
@@ -1,11 +1,10 @@
package com.ruoyi.oil.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.ruoyi.oil.domain.ArdOilWall;
import com.ruoyi.oil.mapper.OilWallMapper;
import com.ruoyi.oil.service.OilWallService;
-import com.ruoyi.oil.domain.OilWall;
import com.ruoyi.oil.param.OilWallParam;
-import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -21,8 +20,8 @@
private OilWallMapper oilWallMapper;
@Override
- public int addOilWall(OilWall oilWall) {
- return oilWallMapper.insert(oilWall);
+ public int addOilWall(ArdOilWall ardOilWall) {
+ return oilWallMapper.insert(ardOilWall);
}
@Override
@@ -31,18 +30,18 @@
}
@Override
- public int updOilWall(OilWall oilWall) {
- return oilWallMapper.updateById(oilWall);
+ public int updOilWall(ArdOilWall ardOilWall) {
+ return oilWallMapper.updateById(ardOilWall);
}
@Override
- public OilWall one(String id) {
+ public ArdOilWall one(String id) {
return oilWallMapper.selectById(id);
}
@Override
- public List<OilWall> query(OilWallParam oilWallParam) {
- QueryWrapper<OilWall> queryWrapper = new QueryWrapper<>();
+ public List<ArdOilWall> query(OilWallParam oilWallParam) {
+ QueryWrapper<ArdOilWall> queryWrapper = new QueryWrapper<>();
queryWrapper.like(oilWallParam.getName()!=null,"name",oilWallParam.getName())
.eq(oilWallParam.getType()!=null,"type",oilWallParam.getType());
return oilWallMapper.selectList(queryWrapper);
diff --git a/ard-work/src/main/java/com/ruoyi/statistical/domain/PumpStatus.java b/ard-work/src/main/java/com/ruoyi/statistical/domain/ArdPumpStatus.java
similarity index 90%
rename from ard-work/src/main/java/com/ruoyi/statistical/domain/PumpStatus.java
rename to ard-work/src/main/java/com/ruoyi/statistical/domain/ArdPumpStatus.java
index 6c5e76f..bf6b50a 100644
--- a/ard-work/src/main/java/com/ruoyi/statistical/domain/PumpStatus.java
+++ b/ard-work/src/main/java/com/ruoyi/statistical/domain/ArdPumpStatus.java
@@ -7,7 +7,7 @@
* @author Administrator
*/
@Data
-public class PumpStatus {
+public class ArdPumpStatus {
private Integer targetId;
private String name;
private String alarmType;
diff --git a/ard-work/src/main/java/com/ruoyi/statistical/mapper/PumpStatusMapper.java b/ard-work/src/main/java/com/ruoyi/statistical/mapper/PumpStatusMapper.java
index 9050027..ddbc007 100644
--- a/ard-work/src/main/java/com/ruoyi/statistical/mapper/PumpStatusMapper.java
+++ b/ard-work/src/main/java/com/ruoyi/statistical/mapper/PumpStatusMapper.java
@@ -2,10 +2,10 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.ruoyi.statistical.domain.PumpStatus;
+import com.ruoyi.statistical.domain.ArdPumpStatus;
/**
* @author Administrator
*/
-public interface PumpStatusMapper extends BaseMapper<PumpStatus> {
+public interface PumpStatusMapper extends BaseMapper<ArdPumpStatus> {
}
diff --git a/ard-work/src/main/java/com/ruoyi/statistical/service/impl/StatisticalServiceImpl.java b/ard-work/src/main/java/com/ruoyi/statistical/service/impl/StatisticalServiceImpl.java
index f5b13e3..8dff69e 100644
--- a/ard-work/src/main/java/com/ruoyi/statistical/service/impl/StatisticalServiceImpl.java
+++ b/ard-work/src/main/java/com/ruoyi/statistical/service/impl/StatisticalServiceImpl.java
@@ -1,7 +1,6 @@
package com.ruoyi.statistical.service.impl;
import com.alibaba.fastjson.JSONObject;
-import com.alibaba.fastjson2.JSONArray;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruoyi.alarm.access.mapper.ArdAlarmAccessMapper;
import com.ruoyi.alarm.apponekey.mapper.ArdAlarmApponekeyMapper;
@@ -22,7 +21,7 @@
import com.ruoyi.device.camera.mapper.ArdCamerasMapper;
import com.ruoyi.device.radar.domain.ArdEquipRadar;
import com.ruoyi.device.radar.mapper.ArdEquipRadarMapper;
-import com.ruoyi.statistical.domain.PumpStatus;
+import com.ruoyi.statistical.domain.ArdPumpStatus;
import com.ruoyi.statistical.mapper.PumpStatusMapper;
import com.ruoyi.statistical.param.ESParam;
import com.ruoyi.statistical.param.Para;
@@ -381,14 +380,14 @@
@Override
public List<TenVo> pump() {
List<TenVo> list = new ArrayList<>();
- QueryWrapper<PumpStatus> queryWrapper = new QueryWrapper<>();
+ QueryWrapper<ArdPumpStatus> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("alarm_type","杩愯");
int y = pumpStatusMapper.selectCount(queryWrapper);
TenVo tenVo = new TenVo();
tenVo.setName("杩愯");
tenVo.setValue(y);
list.add(tenVo);
- QueryWrapper<PumpStatus> queryWrapper1 = new QueryWrapper<>();
+ QueryWrapper<ArdPumpStatus> queryWrapper1 = new QueryWrapper<>();
queryWrapper1.eq("alarm_type","鍋滄満");
int t = pumpStatusMapper.selectCount(queryWrapper1);
TenVo tenVo1 = new TenVo();
@@ -406,22 +405,22 @@
if(list.size()>0){
for (int i = 0; i < list.size(); i++) {
JSONObject j = list.get(i);
- QueryWrapper<PumpStatus> queryWrapper = new QueryWrapper<>();
+ QueryWrapper<ArdPumpStatus> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("target_id",j.getInteger("targetId")).eq("name",j.getString("name"));
- PumpStatus pumpStatus1 = pumpStatusMapper.selectOne(queryWrapper);
- if(pumpStatus1==null){
- PumpStatus pumpStatus = new PumpStatus();
- pumpStatus.setTargetId(j.getInteger("targetId"));
- pumpStatus.setName(j.getString("name"));
+ ArdPumpStatus ardPumpStatus1 = pumpStatusMapper.selectOne(queryWrapper);
+ if(ardPumpStatus1 ==null){
+ ArdPumpStatus ardPumpStatus = new ArdPumpStatus();
+ ardPumpStatus.setTargetId(j.getInteger("targetId"));
+ ardPumpStatus.setName(j.getString("name"));
if(j.containsKey("alarmType")){
- pumpStatus.setAlarmType(j.getString("alarmType"));
+ ardPumpStatus.setAlarmType(j.getString("alarmType"));
}else if(j.containsKey("alarm")){
- pumpStatus.setAlarmType(j.getString("alarm"));
+ ardPumpStatus.setAlarmType(j.getString("alarm"));
}
- pumpStatus.setAlarmTime(alarmTime);
- pumpStatusMapper.insert(pumpStatus);
+ ardPumpStatus.setAlarmTime(alarmTime);
+ pumpStatusMapper.insert(ardPumpStatus);
}else {
- String alarmType = pumpStatus1.getAlarmType();
+ String alarmType = ardPumpStatus1.getAlarmType();
Boolean bo = false;
if(j.containsKey("alarmType")){
if(alarmType.equals(j.getString("alarmType"))){
@@ -433,9 +432,9 @@
}
}
if(!bo){
- pumpStatus1.setAlarmType(j.getString("alarmType"));
- pumpStatus1.setAlarmTime(alarmTime);
- pumpStatusMapper.updateById(pumpStatus1);
+ ardPumpStatus1.setAlarmType(j.getString("alarmType"));
+ ardPumpStatus1.setAlarmTime(alarmTime);
+ pumpStatusMapper.updateById(ardPumpStatus1);
}
}
}
diff --git a/ard-work/src/main/java/com/ruoyi/sy/controller/ArdSyCarLockController.java b/ard-work/src/main/java/com/ruoyi/sy/controller/ArdSyCarLockController.java
index 0dea38e..74027fb 100644
--- a/ard-work/src/main/java/com/ruoyi/sy/controller/ArdSyCarLockController.java
+++ b/ard-work/src/main/java/com/ruoyi/sy/controller/ArdSyCarLockController.java
@@ -1,15 +1,9 @@
package com.ruoyi.sy.controller;
-import com.ruoyi.common.utils.SecurityUtils;
-import com.ruoyi.common.utils.uuid.UUID;
-import com.ruoyi.oil.domain.OilWall;
-import com.ruoyi.oil.param.OilWallParam;
import com.ruoyi.utils.result.Results;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
-
-import java.util.Date;
@RestController
@RequestMapping("syLock")
--
Gitblit v1.9.3