车辆位置,极值,位置等重要数据数据
This commit is contained in:
parent
6b6be61716
commit
257bc96045
50
README.md
50
README.md
@ -42,53 +42,3 @@
|
||||
16. 缓存监控:对系统的缓存信息查询,命令统计等。
|
||||
17. 在线构建器:拖动表单元素生成相应的HTML代码。
|
||||
18. 连接池监视:监视当前系统数据库连接池状态,可进行分析SQL找出系统性能瓶颈。
|
||||
|
||||
## 在线体验
|
||||
|
||||
- admin/admin123
|
||||
- 陆陆续续收到一些打赏,为了更好的体验已用于演示服务器升级。谢谢各位小伙伴。
|
||||
|
||||
演示地址:http://vue.ruoyi.vip
|
||||
文档地址:http://doc.ruoyi.vip
|
||||
|
||||
## 演示图
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td><img src="https://oscimg.oschina.net/oscnet/cd1f90be5f2684f4560c9519c0f2a232ee8.jpg"/></td>
|
||||
<td><img src="https://oscimg.oschina.net/oscnet/1cbcf0e6f257c7d3a063c0e3f2ff989e4b3.jpg"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="https://oscimg.oschina.net/oscnet/up-8074972883b5ba0622e13246738ebba237a.png"/></td>
|
||||
<td><img src="https://oscimg.oschina.net/oscnet/up-9f88719cdfca9af2e58b352a20e23d43b12.png"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="https://oscimg.oschina.net/oscnet/up-39bf2584ec3a529b0d5a3b70d15c9b37646.png"/></td>
|
||||
<td><img src="https://oscimg.oschina.net/oscnet/up-936ec82d1f4872e1bc980927654b6007307.png"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="https://oscimg.oschina.net/oscnet/up-b2d62ceb95d2dd9b3fbe157bb70d26001e9.png"/></td>
|
||||
<td><img src="https://oscimg.oschina.net/oscnet/up-d67451d308b7a79ad6819723396f7c3d77a.png"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="https://oscimg.oschina.net/oscnet/5e8c387724954459291aafd5eb52b456f53.jpg"/></td>
|
||||
<td><img src="https://oscimg.oschina.net/oscnet/644e78da53c2e92a95dfda4f76e6d117c4b.jpg"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="https://oscimg.oschina.net/oscnet/up-8370a0d02977eebf6dbf854c8450293c937.png"/></td>
|
||||
<td><img src="https://oscimg.oschina.net/oscnet/up-49003ed83f60f633e7153609a53a2b644f7.png"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="https://oscimg.oschina.net/oscnet/up-d4fe726319ece268d4746602c39cffc0621.png"/></td>
|
||||
<td><img src="https://oscimg.oschina.net/oscnet/up-c195234bbcd30be6927f037a6755e6ab69c.png"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="https://oscimg.oschina.net/oscnet/b6115bc8c31de52951982e509930b20684a.jpg"/></td>
|
||||
<td><img src="https://oscimg.oschina.net/oscnet/up-5e4daac0bb59612c5038448acbcef235e3a.png"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
## 若依前后端分离交流群
|
||||
|
||||
QQ群: [](https://jq.qq.com/?_wv=1027&k=5bVB1og) [](https://jq.qq.com/?_wv=1027&k=5eiA4DH) [](https://jq.qq.com/?_wv=1027&k=5AxMKlC) [](https://jq.qq.com/?_wv=1027&k=51G72yr) [](https://jq.qq.com/?_wv=1027&k=VvjN2nvu) [](https://jq.qq.com/?_wv=1027&k=5vYAqA05) [](https://jq.qq.com/?_wv=1027&k=kOIINEb5) [](https://jq.qq.com/?_wv=1027&k=UKtX5jhs) [](https://jq.qq.com/?_wv=1027&k=EI9an8lJ) [](https://jq.qq.com/?_wv=1027&k=SWCtLnMz) [](https://jq.qq.com/?_wv=1027&k=96Dkdq0k) [](https://jq.qq.com/?_wv=1027&k=0fsNiYZt) [](https://jq.qq.com/?_wv=1027&k=7xw4xUG1) [](https://jq.qq.com/?_wv=1027&k=eCx8eyoJ) [](https://jq.qq.com/?_wv=1027&k=SpyH2875) [](https://jq.qq.com/?_wv=1027&k=tKEt51dz) [](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=0vBbSb0ztbBgVtn3kJS-Q4HUNYwip89G&authKey=8irq5PhutrZmWIvsUsklBxhj57l%2F1nOZqjzigkXZVoZE451GG4JHPOqW7AW6cf0T&noverify=0&group_code=143961921) [](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=ZFAPAbp09S2ltvwrJzp7wGlbopsc0rwi&authKey=HB2cxpxP2yspk%2Bo3WKTBfktRCccVkU26cgi5B16u0KcAYrVu7sBaE7XSEqmMdFQp&noverify=0&group_code=174951577) [](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=Fn2aF5IHpwsy8j6VlalNJK6qbwFLFHat&authKey=uyIT%2B97x2AXj3odyXpsSpVaPMC%2Bidw0LxG5MAtEqlrcBcWJUA%2FeS43rsF1Tg7IRJ&noverify=0&group_code=161281055) [](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=XIzkm_mV2xTsUtFxo63bmicYoDBA6Ifm&authKey=dDW%2F4qsmw3x9govoZY9w%2FoWAoC4wbHqGal%2BbqLzoS6VBarU8EBptIgPKN%2FviyC8j&noverify=0&group_code=138988063) [](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=DkugnCg68PevlycJSKSwjhFqfIgrWWwR&authKey=pR1Pa5lPIeGF%2FFtIk6d%2FGB5qFi0EdvyErtpQXULzo03zbhopBHLWcuqdpwY241R%2F&noverify=0&group_code=151450850) [](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=F58bgRa-Dp-rsQJThiJqIYv8t4-lWfXh&authKey=UmUs4CVG5OPA1whvsa4uSespOvyd8%2FAr9olEGaWAfdLmfKQk%2FVBp2YU3u2xXXt76&noverify=0&group_code=224622315) [](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=Nxb2EQ5qozWa218Wbs7zgBnjLSNk_tVT&authKey=obBKXj6SBKgrFTJZx0AqQnIYbNOvBB2kmgwWvGhzxR67RoRr84%2Bus5OadzMcdJl5&noverify=0&group_code=287842588) [](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=numtK1M_I4eVd2Gvg8qtbuL8JgX42qNh&authKey=giV9XWMaFZTY%2FqPlmWbkB9g3fi0Ev5CwEtT9Tgei0oUlFFCQLDp4ozWRiVIzubIm&noverify=0&group_code=187944233) [](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=G6r5KGCaa3pqdbUSXNIgYloyb8e0_L0D&authKey=4w8tF1eGW7%2FedWn%2FHAypQksdrML%2BDHolQSx7094Agm7Luakj9EbfPnSTxSi2T1LQ&noverify=0&group_code=228578329) [](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=GsOo-OLz53J8y_9TPoO6XXSGNRTgbFxA&authKey=R7Uy%2Feq%2BZsoKNqHvRKhiXpypW7DAogoWapOawUGHokJSBIBIre2%2FoiAZeZBSLuBc&noverify=0&group_code=191164766) [](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=PmYavuzsOthVqfdAPbo4uAeIbu7Ttjgc&authKey=p52l8%2FXa4PS1JcEmS3VccKSwOPJUZ1ZfQ69MEKzbrooNUljRtlKjvsXf04bxNp3G&noverify=0&group_code=174569686) 点击按钮入群。
|
||||
6
pom.xml
6
pom.xml
@ -104,7 +104,7 @@
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<scope>runtime</scope>
|
||||
<!-- <scope>runtime</scope>-->
|
||||
</dependency>
|
||||
|
||||
<!-- pagehelper 分页插件 -->
|
||||
@ -298,8 +298,8 @@
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>14</source>
|
||||
<target>14</target>
|
||||
<source>16</source>
|
||||
<target>16</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
||||
@ -0,0 +1,104 @@
|
||||
package com.evobms.project.bms.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.evobms.framework.aspectj.lang.annotation.Log;
|
||||
import com.evobms.framework.aspectj.lang.enums.BusinessType;
|
||||
import com.evobms.project.bms.domain.BmsChargeDetail;
|
||||
import com.evobms.project.bms.service.IBmsChargeDetailService;
|
||||
import com.evobms.framework.web.controller.BaseController;
|
||||
import com.evobms.framework.web.domain.AjaxResult;
|
||||
import com.evobms.common.utils.poi.ExcelUtil;
|
||||
import com.evobms.framework.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* BMS充电过程详细数据Controller
|
||||
*
|
||||
* @author tzy
|
||||
* @date 2026-02-23
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/bms/chargedetail/data")
|
||||
public class BmsChargeDetailController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IBmsChargeDetailService bmsChargeDetailService;
|
||||
|
||||
/**
|
||||
* 查询BMS充电过程详细数据列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bms:data:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(BmsChargeDetail bmsChargeDetail)
|
||||
{
|
||||
startPage();
|
||||
List<BmsChargeDetail> list = bmsChargeDetailService.selectBmsChargeDetailList(bmsChargeDetail);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出BMS充电过程详细数据列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bms:data:export')")
|
||||
@Log(title = "BMS充电过程详细数据", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BmsChargeDetail bmsChargeDetail)
|
||||
{
|
||||
List<BmsChargeDetail> list = bmsChargeDetailService.selectBmsChargeDetailList(bmsChargeDetail);
|
||||
ExcelUtil<BmsChargeDetail> util = new ExcelUtil<BmsChargeDetail>(BmsChargeDetail.class);
|
||||
util.exportExcel(response, list, "BMS充电过程详细数据数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取BMS充电过程详细数据详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bms:data:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(bmsChargeDetailService.selectBmsChargeDetailById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增BMS充电过程详细数据
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bms:data:add')")
|
||||
@Log(title = "BMS充电过程详细数据", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BmsChargeDetail bmsChargeDetail)
|
||||
{
|
||||
return toAjax(bmsChargeDetailService.insertBmsChargeDetail(bmsChargeDetail));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改BMS充电过程详细数据
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bms:data:edit')")
|
||||
@Log(title = "BMS充电过程详细数据", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BmsChargeDetail bmsChargeDetail)
|
||||
{
|
||||
return toAjax(bmsChargeDetailService.updateBmsChargeDetail(bmsChargeDetail));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除BMS充电过程详细数据
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bms:data:remove')")
|
||||
@Log(title = "BMS充电过程详细数据", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(bmsChargeDetailService.deleteBmsChargeDetailByIds(ids));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,104 @@
|
||||
package com.evobms.project.bms.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.evobms.framework.aspectj.lang.annotation.Log;
|
||||
import com.evobms.framework.aspectj.lang.enums.BusinessType;
|
||||
import com.evobms.project.bms.domain.BmsChargeTemperature;
|
||||
import com.evobms.project.bms.service.IBmsChargeTemperatureService;
|
||||
import com.evobms.framework.web.controller.BaseController;
|
||||
import com.evobms.framework.web.domain.AjaxResult;
|
||||
import com.evobms.common.utils.poi.ExcelUtil;
|
||||
import com.evobms.framework.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* BMS充电座温度数据Controller
|
||||
*
|
||||
* @author tzy
|
||||
* @date 2026-02-23
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/bms/chargetemperature/data")
|
||||
public class BmsChargeTemperatureController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IBmsChargeTemperatureService bmsChargeTemperatureService;
|
||||
|
||||
/**
|
||||
* 查询BMS充电座温度数据列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bms:data:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(BmsChargeTemperature bmsChargeTemperature)
|
||||
{
|
||||
startPage();
|
||||
List<BmsChargeTemperature> list = bmsChargeTemperatureService.selectBmsChargeTemperatureList(bmsChargeTemperature);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出BMS充电座温度数据列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bms:data:export')")
|
||||
@Log(title = "BMS充电座温度数据", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BmsChargeTemperature bmsChargeTemperature)
|
||||
{
|
||||
List<BmsChargeTemperature> list = bmsChargeTemperatureService.selectBmsChargeTemperatureList(bmsChargeTemperature);
|
||||
ExcelUtil<BmsChargeTemperature> util = new ExcelUtil<BmsChargeTemperature>(BmsChargeTemperature.class);
|
||||
util.exportExcel(response, list, "BMS充电座温度数据数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取BMS充电座温度数据详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bms:data:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(bmsChargeTemperatureService.selectBmsChargeTemperatureById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增BMS充电座温度数据
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bms:data:add')")
|
||||
@Log(title = "BMS充电座温度数据", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BmsChargeTemperature bmsChargeTemperature)
|
||||
{
|
||||
return toAjax(bmsChargeTemperatureService.insertBmsChargeTemperature(bmsChargeTemperature));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改BMS充电座温度数据
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bms:data:edit')")
|
||||
@Log(title = "BMS充电座温度数据", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BmsChargeTemperature bmsChargeTemperature)
|
||||
{
|
||||
return toAjax(bmsChargeTemperatureService.updateBmsChargeTemperature(bmsChargeTemperature));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除BMS充电座温度数据
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bms:data:remove')")
|
||||
@Log(title = "BMS充电座温度数据", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(bmsChargeTemperatureService.deleteBmsChargeTemperatureByIds(ids));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,104 @@
|
||||
package com.evobms.project.bms.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.evobms.framework.aspectj.lang.annotation.Log;
|
||||
import com.evobms.framework.aspectj.lang.enums.BusinessType;
|
||||
import com.evobms.project.bms.domain.BmsRuntimeData;
|
||||
import com.evobms.project.bms.service.IBmsRuntimeDataService;
|
||||
import com.evobms.framework.web.controller.BaseController;
|
||||
import com.evobms.framework.web.domain.AjaxResult;
|
||||
import com.evobms.common.utils.poi.ExcelUtil;
|
||||
import com.evobms.framework.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* BMS实时运行数据Controller
|
||||
*
|
||||
* @author tzy
|
||||
* @date 2026-02-23
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/bms/runtime/data")
|
||||
public class BmsRuntimeDataController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IBmsRuntimeDataService bmsRuntimeDataService;
|
||||
|
||||
/**
|
||||
* 查询BMS实时运行数据列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bms:data:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(BmsRuntimeData bmsRuntimeData)
|
||||
{
|
||||
startPage();
|
||||
List<BmsRuntimeData> list = bmsRuntimeDataService.selectBmsRuntimeDataList(bmsRuntimeData);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出BMS实时运行数据列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bms:data:export')")
|
||||
@Log(title = "BMS实时运行数据", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BmsRuntimeData bmsRuntimeData)
|
||||
{
|
||||
List<BmsRuntimeData> list = bmsRuntimeDataService.selectBmsRuntimeDataList(bmsRuntimeData);
|
||||
ExcelUtil<BmsRuntimeData> util = new ExcelUtil<BmsRuntimeData>(BmsRuntimeData.class);
|
||||
util.exportExcel(response, list, "BMS实时运行数据数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取BMS实时运行数据详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bms:data:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(bmsRuntimeDataService.selectBmsRuntimeDataById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增BMS实时运行数据
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bms:data:add')")
|
||||
@Log(title = "BMS实时运行数据", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BmsRuntimeData bmsRuntimeData)
|
||||
{
|
||||
return toAjax(bmsRuntimeDataService.insertBmsRuntimeData(bmsRuntimeData));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改BMS实时运行数据
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bms:data:edit')")
|
||||
@Log(title = "BMS实时运行数据", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BmsRuntimeData bmsRuntimeData)
|
||||
{
|
||||
return toAjax(bmsRuntimeDataService.updateBmsRuntimeData(bmsRuntimeData));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除BMS实时运行数据
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bms:data:remove')")
|
||||
@Log(title = "BMS实时运行数据", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(bmsRuntimeDataService.deleteBmsRuntimeDataByIds(ids));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,104 @@
|
||||
package com.evobms.project.bms.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.evobms.framework.aspectj.lang.annotation.Log;
|
||||
import com.evobms.framework.aspectj.lang.enums.BusinessType;
|
||||
import com.evobms.project.bms.domain.BmsSopData;
|
||||
import com.evobms.project.bms.service.IBmsSopDataService;
|
||||
import com.evobms.framework.web.controller.BaseController;
|
||||
import com.evobms.framework.web.domain.AjaxResult;
|
||||
import com.evobms.common.utils.poi.ExcelUtil;
|
||||
import com.evobms.framework.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* BMS功率能力(SOP)数据Controller
|
||||
*
|
||||
* @author tzy
|
||||
* @date 2026-02-23
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/bms/sop/data")
|
||||
public class BmsSopDataController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IBmsSopDataService bmsSopDataService;
|
||||
|
||||
/**
|
||||
* 查询BMS功率能力(SOP)数据列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bms:data:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(BmsSopData bmsSopData)
|
||||
{
|
||||
startPage();
|
||||
List<BmsSopData> list = bmsSopDataService.selectBmsSopDataList(bmsSopData);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出BMS功率能力(SOP)数据列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bms:data:export')")
|
||||
@Log(title = "BMS功率能力(SOP)数据", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BmsSopData bmsSopData)
|
||||
{
|
||||
List<BmsSopData> list = bmsSopDataService.selectBmsSopDataList(bmsSopData);
|
||||
ExcelUtil<BmsSopData> util = new ExcelUtil<BmsSopData>(BmsSopData.class);
|
||||
util.exportExcel(response, list, "BMS功率能力(SOP)数据数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取BMS功率能力(SOP)数据详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bms:data:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(bmsSopDataService.selectBmsSopDataById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增BMS功率能力(SOP)数据
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bms:data:add')")
|
||||
@Log(title = "BMS功率能力(SOP)数据", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BmsSopData bmsSopData)
|
||||
{
|
||||
return toAjax(bmsSopDataService.insertBmsSopData(bmsSopData));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改BMS功率能力(SOP)数据
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bms:data:edit')")
|
||||
@Log(title = "BMS功率能力(SOP)数据", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BmsSopData bmsSopData)
|
||||
{
|
||||
return toAjax(bmsSopDataService.updateBmsSopData(bmsSopData));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除BMS功率能力(SOP)数据
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bms:data:remove')")
|
||||
@Log(title = "BMS功率能力(SOP)数据", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(bmsSopDataService.deleteBmsSopDataByIds(ids));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,104 @@
|
||||
package com.evobms.project.bms.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.evobms.framework.aspectj.lang.annotation.Log;
|
||||
import com.evobms.framework.aspectj.lang.enums.BusinessType;
|
||||
import com.evobms.project.bms.domain.BmsSystemStatus;
|
||||
import com.evobms.project.bms.service.IBmsSystemStatusService;
|
||||
import com.evobms.framework.web.controller.BaseController;
|
||||
import com.evobms.framework.web.domain.AjaxResult;
|
||||
import com.evobms.common.utils.poi.ExcelUtil;
|
||||
import com.evobms.framework.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* BMS系统状态数据Controller
|
||||
*
|
||||
* @author tzy
|
||||
* @date 2026-02-23
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/bms/systemstatus/data")
|
||||
public class BmsSystemStatusController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IBmsSystemStatusService bmsSystemStatusService;
|
||||
|
||||
/**
|
||||
* 查询BMS系统状态数据列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bms:data:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(BmsSystemStatus bmsSystemStatus)
|
||||
{
|
||||
startPage();
|
||||
List<BmsSystemStatus> list = bmsSystemStatusService.selectBmsSystemStatusList(bmsSystemStatus);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出BMS系统状态数据列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bms:data:export')")
|
||||
@Log(title = "BMS系统状态数据", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BmsSystemStatus bmsSystemStatus)
|
||||
{
|
||||
List<BmsSystemStatus> list = bmsSystemStatusService.selectBmsSystemStatusList(bmsSystemStatus);
|
||||
ExcelUtil<BmsSystemStatus> util = new ExcelUtil<BmsSystemStatus>(BmsSystemStatus.class);
|
||||
util.exportExcel(response, list, "BMS系统状态数据数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取BMS系统状态数据详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bms:data:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(bmsSystemStatusService.selectBmsSystemStatusById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增BMS系统状态数据
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bms:data:add')")
|
||||
@Log(title = "BMS系统状态数据", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BmsSystemStatus bmsSystemStatus)
|
||||
{
|
||||
return toAjax(bmsSystemStatusService.insertBmsSystemStatus(bmsSystemStatus));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改BMS系统状态数据
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bms:data:edit')")
|
||||
@Log(title = "BMS系统状态数据", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BmsSystemStatus bmsSystemStatus)
|
||||
{
|
||||
return toAjax(bmsSystemStatusService.updateBmsSystemStatus(bmsSystemStatus));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除BMS系统状态数据
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bms:data:remove')")
|
||||
@Log(title = "BMS系统状态数据", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(bmsSystemStatusService.deleteBmsSystemStatusByIds(ids));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,104 @@
|
||||
package com.evobms.project.bms.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.evobms.framework.aspectj.lang.annotation.Log;
|
||||
import com.evobms.framework.aspectj.lang.enums.BusinessType;
|
||||
import com.evobms.project.bms.domain.BmsVoltageChannelData;
|
||||
import com.evobms.project.bms.service.IBmsVoltageChannelDataService;
|
||||
import com.evobms.framework.web.controller.BaseController;
|
||||
import com.evobms.framework.web.domain.AjaxResult;
|
||||
import com.evobms.common.utils.poi.ExcelUtil;
|
||||
import com.evobms.framework.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* BMS电压通道数据Controller
|
||||
*
|
||||
* @author tzy
|
||||
* @date 2026-02-23
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/bms/voltagechannel/data")
|
||||
public class BmsVoltageChannelDataController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IBmsVoltageChannelDataService bmsVoltageChannelDataService;
|
||||
|
||||
/**
|
||||
* 查询BMS电压通道数据列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bms:data:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(BmsVoltageChannelData bmsVoltageChannelData)
|
||||
{
|
||||
startPage();
|
||||
List<BmsVoltageChannelData> list = bmsVoltageChannelDataService.selectBmsVoltageChannelDataList(bmsVoltageChannelData);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出BMS电压通道数据列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bms:data:export')")
|
||||
@Log(title = "BMS电压通道数据", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BmsVoltageChannelData bmsVoltageChannelData)
|
||||
{
|
||||
List<BmsVoltageChannelData> list = bmsVoltageChannelDataService.selectBmsVoltageChannelDataList(bmsVoltageChannelData);
|
||||
ExcelUtil<BmsVoltageChannelData> util = new ExcelUtil<BmsVoltageChannelData>(BmsVoltageChannelData.class);
|
||||
util.exportExcel(response, list, "BMS电压通道数据数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取BMS电压通道数据详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bms:data:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(bmsVoltageChannelDataService.selectBmsVoltageChannelDataById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增BMS电压通道数据
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bms:data:add')")
|
||||
@Log(title = "BMS电压通道数据", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BmsVoltageChannelData bmsVoltageChannelData)
|
||||
{
|
||||
return toAjax(bmsVoltageChannelDataService.insertBmsVoltageChannelData(bmsVoltageChannelData));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改BMS电压通道数据
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bms:data:edit')")
|
||||
@Log(title = "BMS电压通道数据", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BmsVoltageChannelData bmsVoltageChannelData)
|
||||
{
|
||||
return toAjax(bmsVoltageChannelDataService.updateBmsVoltageChannelData(bmsVoltageChannelData));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除BMS电压通道数据
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bms:data:remove')")
|
||||
@Log(title = "BMS电压通道数据", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(bmsVoltageChannelDataService.deleteBmsVoltageChannelDataByIds(ids));
|
||||
}
|
||||
}
|
||||
@ -2,48 +2,68 @@ package com.evobms.project.bms.controller;
|
||||
|
||||
import org.eclipse.paho.client.mqttv3.*;
|
||||
import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
@ConditionalOnProperty(name = "mqtt.enabled", havingValue = "true")
|
||||
public class GBT32960MqttReceiver {
|
||||
private static final String BROKER = "tcp://localhost:1883";
|
||||
private static final String CLIENT_ID = "evobms-client";
|
||||
private static final String TOPIC = "/bbox/EVO0002/#";
|
||||
private static final String DEVICE_SN = "EVO0002";
|
||||
@Value("${mqtt.host}")
|
||||
private String broker;
|
||||
@Value("${mqtt.clientId}")
|
||||
private String clientId;
|
||||
@Value("${mqtt.username:}")
|
||||
private String username;
|
||||
@Value("${mqtt.password:}")
|
||||
private String password;
|
||||
@Value("${mqtt.connectionTimeout:30}")
|
||||
private int connectionTimeout;
|
||||
@Value("${mqtt.keepAliveInterval:60}")
|
||||
private int keepAliveInterval;
|
||||
@Value("${mqtt.automaticReconnect:true}")
|
||||
private boolean automaticReconnect;
|
||||
@Value("${mqtt.cleanSession:true}")
|
||||
private boolean cleanSession;
|
||||
@Value("${mqtt.subscribeTopic:/bbox/+/#}")
|
||||
private String subscribeTopic;
|
||||
|
||||
@Bean
|
||||
public void initMQtt() throws MqttException {
|
||||
MqttClient client = new MqttClient(BROKER, CLIENT_ID, new MemoryPersistence());
|
||||
public void initMQtt() {
|
||||
try {
|
||||
MqttClient client = new MqttClient(broker, clientId, new MemoryPersistence());
|
||||
|
||||
MqttConnectOptions options = new MqttConnectOptions();
|
||||
options.setCleanSession(true);
|
||||
options.setCleanSession(cleanSession);
|
||||
options.setAutomaticReconnect(automaticReconnect);
|
||||
options.setConnectionTimeout(connectionTimeout);
|
||||
options.setKeepAliveInterval(keepAliveInterval);
|
||||
if (username != null && !username.isEmpty()) {
|
||||
options.setUserName(username);
|
||||
}
|
||||
if (password != null && !password.isEmpty()) {
|
||||
options.setPassword(password.toCharArray());
|
||||
}
|
||||
|
||||
client.setCallback(new MqttCallback() {
|
||||
@Override
|
||||
public void connectionLost(Throwable cause) {
|
||||
System.out.println("MQTT连接断开: " + cause.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void messageArrived(String topic, MqttMessage message) {
|
||||
System.out.println("\n收到MQTT消息,主题: " + topic);
|
||||
System.out.println("QoS: " + message.getQos());
|
||||
|
||||
// 直接处理字节数组
|
||||
byte[] payload = message.getPayload();
|
||||
// GBT32960FullDecoder.parseGBT32960Data(payload, DEVICE_SN);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deliveryComplete(IMqttDeliveryToken token) {
|
||||
// 发布完成回调
|
||||
}
|
||||
});
|
||||
|
||||
client.connect(options);
|
||||
client.subscribe(TOPIC);
|
||||
System.out.println("已成功连接到MQTT Broker并订阅主题: " + TOPIC);
|
||||
client.subscribe(subscribeTopic);
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -48,7 +48,6 @@ public class MqttPublishController {
|
||||
if (mqttService == null) {
|
||||
return AjaxResult.error("MQTT服务未启用");
|
||||
}
|
||||
|
||||
mqttService.sendMessage(topic, message);
|
||||
log.info("发布消息成功 -> 主题: {}, 内容: {}", topic, message);
|
||||
return AjaxResult.success("消息发布成功", "主题: " + topic + ", 内容: " + message);
|
||||
|
||||
@ -38,9 +38,7 @@ public class MqttTestController {
|
||||
public Map<String, Object> testHandleDeviceData(
|
||||
@RequestParam String topic,
|
||||
@RequestParam byte[] payload) {
|
||||
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
|
||||
try {
|
||||
// 调用handleDeviceData方法
|
||||
mqttService.handleDeviceData(topic, payload);
|
||||
@ -50,14 +48,12 @@ public class MqttTestController {
|
||||
result.put("message", "消息处理成功");
|
||||
result.put("topic", topic);
|
||||
result.put("payload", payload);
|
||||
|
||||
// 解析主题获取设备编号(模拟方法内部逻辑)
|
||||
String[] topicParts = topic.split("/");
|
||||
if (topicParts.length >= 3) {
|
||||
String deviceCode = topicParts[1];
|
||||
result.put("extractedDeviceCode", deviceCode);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("测试处理设备数据发生错误: {}", e.getMessage(), e);
|
||||
result.put("success", false);
|
||||
@ -70,7 +66,6 @@ public class MqttTestController {
|
||||
|
||||
/**
|
||||
* 生成测试数据
|
||||
*
|
||||
* @return 测试用的JSON数据
|
||||
*/
|
||||
@GetMapping("/generateTestData")
|
||||
|
||||
@ -1,75 +1,87 @@
|
||||
package com.evobms.project.bms.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.github.xiaoymin.knife4j.annotations.Ignore;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.evobms.framework.aspectj.lang.annotation.Excel;
|
||||
import com.evobms.framework.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* BMS充电过程详细数据对象 bms_charge_detail
|
||||
*
|
||||
* @author tzy
|
||||
* @date 2026-02-23
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@ApiModel(description = "BMS充电过程详细数据")
|
||||
public class BmsChargeDetail extends BaseEntity {
|
||||
public class BmsChargeDetail extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("主键ID")
|
||||
/** 主键ID */
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("设备ID")
|
||||
/** 设备ID */
|
||||
@Excel(name = "设备ID")
|
||||
private String deviceId;
|
||||
|
||||
@ApiModelProperty("数据时间戳")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "数据时间戳", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
/** 数据时间戳 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "数据时间戳", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date timestamp;
|
||||
|
||||
@ApiModelProperty("慢充电流(A)")
|
||||
/** 慢充电流(A) */
|
||||
@Excel(name = "慢充电流(A)")
|
||||
private java.math.BigDecimal acChargeCurrent;
|
||||
private BigDecimal acChargeCurrent;
|
||||
|
||||
@ApiModelProperty("慢充电压(V)")
|
||||
/** 慢充电压(V) */
|
||||
@Excel(name = "慢充电压(V)")
|
||||
private java.math.BigDecimal acChargeVoltage;
|
||||
private BigDecimal acChargeVoltage;
|
||||
|
||||
@ApiModelProperty("快充电流(A)")
|
||||
/** 快充电流(A) */
|
||||
@Excel(name = "快充电流(A)")
|
||||
private java.math.BigDecimal dcChargeCurrent;
|
||||
private BigDecimal dcChargeCurrent;
|
||||
|
||||
@ApiModelProperty("快充电压(V)")
|
||||
/** 快充电压(V) */
|
||||
@Excel(name = "快充电压(V)")
|
||||
private java.math.BigDecimal dcChargeVoltage;
|
||||
private BigDecimal dcChargeVoltage;
|
||||
|
||||
@ApiModelProperty("充电时长(min)")
|
||||
/** 充电时长(min) */
|
||||
@Excel(name = "充电时长(min)")
|
||||
private Integer chargeTime;
|
||||
private Long chargeTime;
|
||||
|
||||
@ApiModelProperty("慢充停止码")
|
||||
/** 慢充停止码 */
|
||||
@Excel(name = "慢充停止码")
|
||||
private Integer acStopCode;
|
||||
|
||||
@ApiModelProperty("快充停止码")
|
||||
/** 快充停止码 */
|
||||
@Excel(name = "快充停止码")
|
||||
private Integer dcStopCode;
|
||||
|
||||
@ApiModelProperty("慢充CP值")
|
||||
/** 慢充CP值 */
|
||||
@Excel(name = "慢充CP值")
|
||||
private Integer acCpValue;
|
||||
|
||||
@ApiModelProperty("慢充枪阻值")
|
||||
/** 慢充枪阻值 */
|
||||
@Excel(name = "慢充枪阻值")
|
||||
private Integer acGunResistance;
|
||||
|
||||
@ApiModelProperty("充电阶段")
|
||||
/** 充电阶段 */
|
||||
@Excel(name = "充电阶段")
|
||||
private Integer chargingStage;
|
||||
|
||||
@ApiModelProperty("慢充阶段")
|
||||
/** 慢充阶段 */
|
||||
@Excel(name = "慢充阶段")
|
||||
private Integer acStage;
|
||||
|
||||
@ApiModelProperty("快充阶段")
|
||||
/** 快充阶段 */
|
||||
@Excel(name = "快充阶段")
|
||||
private Integer dcStage;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,47 @@
|
||||
package com.evobms.project.bms.domain;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.evobms.framework.aspectj.lang.annotation.Excel;
|
||||
import com.evobms.framework.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* BMS充电座温度数据对象 bms_charge_temperature
|
||||
*
|
||||
* @author tzy
|
||||
* @date 2026-02-23
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class BmsChargeTemperature extends BaseEntity
|
||||
{
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
private Long id;
|
||||
|
||||
/** 设备ID */
|
||||
@Excel(name = "设备ID")
|
||||
private String deviceId;
|
||||
|
||||
/** 数据时间戳 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "数据时间戳", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date timestap;
|
||||
|
||||
/** 温度编号(1-8) */
|
||||
@Excel(name = "温度编号(1-8)")
|
||||
private Integer tempIndex;
|
||||
|
||||
/** 温度(℃) */
|
||||
@Excel(name = "温度(℃)")
|
||||
private BigDecimal temperature;
|
||||
|
||||
}
|
||||
@ -0,0 +1,77 @@
|
||||
package com.evobms.project.bms.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.evobms.framework.aspectj.lang.annotation.Excel;
|
||||
import com.evobms.framework.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* BMS实时运行数据对象 bms_runtime_data
|
||||
*
|
||||
* @author tzy
|
||||
* @date 2026-02-23
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class BmsRuntimeData extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
private Long id;
|
||||
|
||||
/** 设备ID */
|
||||
@Excel(name = "设备ID")
|
||||
private String deviceId;
|
||||
|
||||
/** 数据时间戳 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "数据时间戳", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date timestap;
|
||||
|
||||
/** 车速(km/h) */
|
||||
@Excel(name = "车速(km/h)")
|
||||
private BigDecimal vehicleSpeed;
|
||||
|
||||
/** 总里程(km) */
|
||||
@Excel(name = "总里程(km)")
|
||||
private Long mileage;
|
||||
|
||||
/** 系统电压(V) */
|
||||
@Excel(name = "系统电压(V)")
|
||||
private BigDecimal systemVoltage;
|
||||
|
||||
/** 系统电流(A) */
|
||||
@Excel(name = "系统电流(A)")
|
||||
private BigDecimal systemCurrent;
|
||||
|
||||
/** 绝缘电阻(KΩ) */
|
||||
@Excel(name = "绝缘电阻(KΩ)")
|
||||
private Long insulationResistance;
|
||||
|
||||
/** 最大SOC(%) */
|
||||
@Excel(name = "最大SOC(%)")
|
||||
private BigDecimal socMax;
|
||||
|
||||
/** 最小SOC(%) */
|
||||
@Excel(name = "最小SOC(%)")
|
||||
private BigDecimal socMin;
|
||||
|
||||
/** GPV电压(V) */
|
||||
@Excel(name = "GPV电压(V)")
|
||||
private BigDecimal gpvVoltage;
|
||||
|
||||
/** 行车阶段 */
|
||||
@Excel(name = "行车阶段")
|
||||
private Integer runStatus;
|
||||
|
||||
/** 行车上电阶段 */
|
||||
@Excel(name = "行车上电阶段")
|
||||
private Integer powerStatus;
|
||||
|
||||
}
|
||||
@ -2,66 +2,86 @@ package com.evobms.project.bms.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.evobms.framework.aspectj.lang.annotation.Excel;
|
||||
import com.evobms.framework.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* BMS功率能力(SOP)数据对象 bms_sop_data
|
||||
*
|
||||
* @author tzy
|
||||
* @date 2026-02-23
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(description = "BMS功率能力(SOP)数据")
|
||||
public class BmsSopData extends BaseEntity {
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class BmsSopData extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("主键ID")
|
||||
/** 主键ID */
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("设备ID")
|
||||
/** 设备ID */
|
||||
@Excel(name = "设备ID")
|
||||
private String deviceId;
|
||||
|
||||
@ApiModelProperty("数据时间戳")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "数据时间戳", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date timestamp;
|
||||
/** 数据时间戳 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "数据时间戳", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date timestap;
|
||||
|
||||
@ApiModelProperty("10秒放电SOP(A)")
|
||||
/** 10秒放电SOP(A) */
|
||||
@Excel(name = "10秒放电SOP(A)")
|
||||
private Integer dischargeSop10s;
|
||||
private Long dischargeSop10s;
|
||||
|
||||
@ApiModelProperty("30秒放电SOP(A)")
|
||||
/** 30秒放电SOP(A) */
|
||||
@Excel(name = "30秒放电SOP(A)")
|
||||
private Integer dischargeSop30s;
|
||||
private Long dischargeSop30s;
|
||||
|
||||
@ApiModelProperty("60秒放电SOP(A)")
|
||||
/** 60秒放电SOP(A) */
|
||||
@Excel(name = "60秒放电SOP(A)")
|
||||
private Integer dischargeSop60s;
|
||||
private Long dischargeSop60s;
|
||||
|
||||
@ApiModelProperty("持续放电SOP(A)")
|
||||
/** 持续放电SOP(A) */
|
||||
@Excel(name = "持续放电SOP(A)")
|
||||
private Integer dischargeSopContinuous;
|
||||
private Long dischargeSopContinuous;
|
||||
|
||||
@ApiModelProperty("10秒回馈SOP(A)")
|
||||
/** 放电融合SOP(A) */
|
||||
@Excel(name = "放电融合SOP(A)")
|
||||
private Long dischargeSopTotal;
|
||||
|
||||
/** 10秒回馈SOP(A) */
|
||||
@Excel(name = "10秒回馈SOP(A)")
|
||||
private Integer regenSop10s;
|
||||
private Long regenSop10s;
|
||||
|
||||
@ApiModelProperty("30秒回馈SOP(A)")
|
||||
/** 30秒回馈SOP(A) */
|
||||
@Excel(name = "30秒回馈SOP(A)")
|
||||
private Integer regenSop30s;
|
||||
private Long regenSop30s;
|
||||
|
||||
@ApiModelProperty("60秒回馈SOP(A)")
|
||||
/** 60秒回馈SOP(A) */
|
||||
@Excel(name = "60秒回馈SOP(A)")
|
||||
private Integer regenSop60s;
|
||||
private Long regenSop60s;
|
||||
|
||||
@ApiModelProperty("持续回馈SOP(A)")
|
||||
/** 持续回馈SOP(A) */
|
||||
@Excel(name = "持续回馈SOP(A)")
|
||||
private Integer regenSopContinuous;
|
||||
private Long regenSopContinuous;
|
||||
|
||||
@ApiModelProperty("充电SOP(A)")
|
||||
/** 回馈融合SOP(A) */
|
||||
@Excel(name = "回馈融合SOP(A)")
|
||||
private Long regenSopTotal;
|
||||
|
||||
/** 充电SOP(A) */
|
||||
@Excel(name = "充电SOP(A)")
|
||||
private Integer chargeSop;
|
||||
private Long chargeSop;
|
||||
|
||||
@ApiModelProperty("慢充SOP(A)")
|
||||
/** 慢充SOP(A) */
|
||||
@Excel(name = "慢充SOP(A)")
|
||||
private Integer acChargeSop;
|
||||
private Long acChargeSop;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -1,59 +1,61 @@
|
||||
package com.evobms.project.bms.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.evobms.framework.aspectj.lang.annotation.Excel;
|
||||
import com.evobms.framework.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* BMS系统状态数据对象 bms_system_status
|
||||
*
|
||||
* @author tzy
|
||||
* @date 2026-02-23
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@ApiModel(description = "BMS系统状态数据")
|
||||
public class BmsSystemStatus extends BaseEntity {
|
||||
public class BmsSystemStatus extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("主键ID")
|
||||
/** 主键ID */
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("设备ID")
|
||||
/** 设备ID */
|
||||
@Excel(name = "设备ID")
|
||||
private String deviceId;
|
||||
|
||||
@ApiModelProperty("数据时间戳")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "数据时间戳", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date timestamp;
|
||||
/** 数据时间戳 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "数据时间戳", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date timestap;
|
||||
|
||||
@ApiModelProperty("继电器状态")
|
||||
/** 继电器状态 */
|
||||
@Excel(name = "继电器状态")
|
||||
private Integer relayStatus;
|
||||
private Long relayStatus;
|
||||
|
||||
@ApiModelProperty("ON/A+/CC状态")
|
||||
/** ON/A+/CC状态 */
|
||||
@Excel(name = "ON/A+/CC状态")
|
||||
private Integer onaaccStatus;
|
||||
private Long onaaccStatus;
|
||||
|
||||
@ApiModelProperty("系统复位次数")
|
||||
/** 系统复位次数 */
|
||||
@Excel(name = "系统复位次数")
|
||||
private Integer resetCount;
|
||||
private Long resetCount;
|
||||
|
||||
@ApiModelProperty("电池循环次数")
|
||||
/** 电池循环次数 */
|
||||
@Excel(name = "电池循环次数")
|
||||
private Integer cycleCount;
|
||||
private Long cycleCount;
|
||||
|
||||
@ApiModelProperty("2.5V采样电压(V)")
|
||||
/** 2.5V采样电压(V) */
|
||||
@Excel(name = "2.5V采样电压(V)")
|
||||
private java.math.BigDecimal sample25v;
|
||||
private BigDecimal sample25v;
|
||||
|
||||
@ApiModelProperty("5V采样电压(V)")
|
||||
/** 5V采样电压(V) */
|
||||
@Excel(name = "5V采样电压(V)")
|
||||
private java.math.BigDecimal sample5v;
|
||||
private BigDecimal sample5v;
|
||||
|
||||
@ApiModelProperty("单体数量")
|
||||
@Excel(name = "单体数量")
|
||||
private Integer cellCount;
|
||||
|
||||
@ApiModelProperty("温度探头数量")
|
||||
@Excel(name = "温度探头数量")
|
||||
private Integer tempSensorCount;
|
||||
}
|
||||
|
||||
@ -0,0 +1,49 @@
|
||||
package com.evobms.project.bms.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.evobms.framework.aspectj.lang.annotation.Excel;
|
||||
import com.evobms.framework.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* BMS电压通道数据对象 bms_voltage_channel_data
|
||||
*
|
||||
* @author tzy
|
||||
* @date 2026-02-23
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class BmsVoltageChannelData extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
private Long id;
|
||||
|
||||
/** 设备ID */
|
||||
@Excel(name = "设备ID")
|
||||
private String deviceId;
|
||||
|
||||
/** 数据时间戳 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "数据时间戳", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date timestap;
|
||||
|
||||
/** 通道类型(RTP/RTN) */
|
||||
@Excel(name = "通道类型(RTP/RTN)")
|
||||
private String channelType;
|
||||
|
||||
/** 通道编号 */
|
||||
@Excel(name = "通道编号")
|
||||
private Integer channelIndex;
|
||||
|
||||
/** 电压(V) */
|
||||
@Excel(name = "电压(V)")
|
||||
private BigDecimal voltage;
|
||||
|
||||
}
|
||||
@ -1,9 +1,61 @@
|
||||
package com.evobms.project.bms.mapper;
|
||||
|
||||
import com.evobms.project.bms.domain.BmsChargeDetail;
|
||||
import java.util.List;
|
||||
import com.evobms.project.bms.domain.BmsChargeDetail;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
public interface BmsChargeDetailMapper {
|
||||
int insertBmsChargeDetail(BmsChargeDetail data);
|
||||
List<BmsChargeDetail> selectBmsChargeDetailList(BmsChargeDetail filter);
|
||||
/**
|
||||
* BMS充电过程详细数据Mapper接口
|
||||
*
|
||||
* @author tzy
|
||||
* @date 2026-02-23
|
||||
*/
|
||||
public interface BmsChargeDetailMapper extends BaseMapper<BmsChargeDetail> {
|
||||
/**
|
||||
* 查询BMS充电过程详细数据
|
||||
*
|
||||
* @param id BMS充电过程详细数据主键
|
||||
* @return BMS充电过程详细数据
|
||||
*/
|
||||
public BmsChargeDetail selectBmsChargeDetailById(Long id);
|
||||
|
||||
/**
|
||||
* 查询BMS充电过程详细数据列表
|
||||
*
|
||||
* @param bmsChargeDetail BMS充电过程详细数据
|
||||
* @return BMS充电过程详细数据集合
|
||||
*/
|
||||
public List<BmsChargeDetail> selectBmsChargeDetailList(BmsChargeDetail bmsChargeDetail);
|
||||
|
||||
/**
|
||||
* 新增BMS充电过程详细数据
|
||||
*
|
||||
* @param bmsChargeDetail BMS充电过程详细数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBmsChargeDetail(BmsChargeDetail bmsChargeDetail);
|
||||
|
||||
/**
|
||||
* 修改BMS充电过程详细数据
|
||||
*
|
||||
* @param bmsChargeDetail BMS充电过程详细数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBmsChargeDetail(BmsChargeDetail bmsChargeDetail);
|
||||
|
||||
/**
|
||||
* 删除BMS充电过程详细数据
|
||||
*
|
||||
* @param id BMS充电过程详细数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBmsChargeDetailById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除BMS充电过程详细数据
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBmsChargeDetailByIds(Long[] ids);
|
||||
}
|
||||
|
||||
@ -0,0 +1,61 @@
|
||||
package com.evobms.project.bms.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.evobms.project.bms.domain.BmsChargeTemperature;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* BMS充电座温度数据Mapper接口
|
||||
*
|
||||
* @author tzy
|
||||
* @date 2026-02-23
|
||||
*/
|
||||
public interface BmsChargeTemperatureMapper extends BaseMapper<BmsChargeTemperature> {
|
||||
/**
|
||||
* 查询BMS充电座温度数据
|
||||
*
|
||||
* @param id BMS充电座温度数据主键
|
||||
* @return BMS充电座温度数据
|
||||
*/
|
||||
public BmsChargeTemperature selectBmsChargeTemperatureById(Long id);
|
||||
|
||||
/**
|
||||
* 查询BMS充电座温度数据列表
|
||||
*
|
||||
* @param bmsChargeTemperature BMS充电座温度数据
|
||||
* @return BMS充电座温度数据集合
|
||||
*/
|
||||
public List<BmsChargeTemperature> selectBmsChargeTemperatureList(BmsChargeTemperature bmsChargeTemperature);
|
||||
|
||||
/**
|
||||
* 新增BMS充电座温度数据
|
||||
*
|
||||
* @param bmsChargeTemperature BMS充电座温度数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBmsChargeTemperature(BmsChargeTemperature bmsChargeTemperature);
|
||||
|
||||
/**
|
||||
* 修改BMS充电座温度数据
|
||||
*
|
||||
* @param bmsChargeTemperature BMS充电座温度数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBmsChargeTemperature(BmsChargeTemperature bmsChargeTemperature);
|
||||
|
||||
/**
|
||||
* 删除BMS充电座温度数据
|
||||
*
|
||||
* @param id BMS充电座温度数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBmsChargeTemperatureById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除BMS充电座温度数据
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBmsChargeTemperatureByIds(Long[] ids);
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
package com.evobms.project.bms.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.evobms.project.bms.domain.BmsRuntimeData;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* BMS实时运行数据Mapper接口
|
||||
*
|
||||
* @author tzy
|
||||
* @date 2026-02-23
|
||||
*/
|
||||
public interface BmsRuntimeDataMapper extends BaseMapper<BmsRuntimeData> {
|
||||
/**
|
||||
* 查询BMS实时运行数据
|
||||
*
|
||||
* @param id BMS实时运行数据主键
|
||||
* @return BMS实时运行数据
|
||||
*/
|
||||
public BmsRuntimeData selectBmsRuntimeDataById(Long id);
|
||||
|
||||
/**
|
||||
* 查询BMS实时运行数据列表
|
||||
*
|
||||
* @param bmsRuntimeData BMS实时运行数据
|
||||
* @return BMS实时运行数据集合
|
||||
*/
|
||||
public List<BmsRuntimeData> selectBmsRuntimeDataList(BmsRuntimeData bmsRuntimeData);
|
||||
|
||||
/**
|
||||
* 新增BMS实时运行数据
|
||||
*
|
||||
* @param bmsRuntimeData BMS实时运行数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBmsRuntimeData(BmsRuntimeData bmsRuntimeData);
|
||||
|
||||
/**
|
||||
* 修改BMS实时运行数据
|
||||
*
|
||||
* @param bmsRuntimeData BMS实时运行数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBmsRuntimeData(BmsRuntimeData bmsRuntimeData);
|
||||
|
||||
/**
|
||||
* 删除BMS实时运行数据
|
||||
*
|
||||
* @param id BMS实时运行数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBmsRuntimeDataById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除BMS实时运行数据
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBmsRuntimeDataByIds(Long[] ids);
|
||||
}
|
||||
@ -1,9 +1,61 @@
|
||||
package com.evobms.project.bms.mapper;
|
||||
|
||||
import com.evobms.project.bms.domain.BmsSopData;
|
||||
import java.util.List;
|
||||
import com.evobms.project.bms.domain.BmsSopData;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
public interface BmsSopDataMapper {
|
||||
int insertBmsSopData(BmsSopData data);
|
||||
List<BmsSopData> selectBmsSopDataList(BmsSopData filter);
|
||||
/**
|
||||
* BMS功率能力(SOP)数据Mapper接口
|
||||
*
|
||||
* @author tzy
|
||||
* @date 2026-02-23
|
||||
*/
|
||||
public interface BmsSopDataMapper extends BaseMapper<BmsSopData> {
|
||||
/**
|
||||
* 查询BMS功率能力(SOP)数据
|
||||
*
|
||||
* @param id BMS功率能力(SOP)数据主键
|
||||
* @return BMS功率能力(SOP)数据
|
||||
*/
|
||||
public BmsSopData selectBmsSopDataById(Long id);
|
||||
|
||||
/**
|
||||
* 查询BMS功率能力(SOP)数据列表
|
||||
*
|
||||
* @param bmsSopData BMS功率能力(SOP)数据
|
||||
* @return BMS功率能力(SOP)数据集合
|
||||
*/
|
||||
public List<BmsSopData> selectBmsSopDataList(BmsSopData bmsSopData);
|
||||
|
||||
/**
|
||||
* 新增BMS功率能力(SOP)数据
|
||||
*
|
||||
* @param bmsSopData BMS功率能力(SOP)数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBmsSopData(BmsSopData bmsSopData);
|
||||
|
||||
/**
|
||||
* 修改BMS功率能力(SOP)数据
|
||||
*
|
||||
* @param bmsSopData BMS功率能力(SOP)数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBmsSopData(BmsSopData bmsSopData);
|
||||
|
||||
/**
|
||||
* 删除BMS功率能力(SOP)数据
|
||||
*
|
||||
* @param id BMS功率能力(SOP)数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBmsSopDataById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除BMS功率能力(SOP)数据
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBmsSopDataByIds(Long[] ids);
|
||||
}
|
||||
|
||||
@ -1,9 +1,61 @@
|
||||
package com.evobms.project.bms.mapper;
|
||||
|
||||
import com.evobms.project.bms.domain.BmsSystemStatus;
|
||||
import java.util.List;
|
||||
import com.evobms.project.bms.domain.BmsSystemStatus;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
public interface BmsSystemStatusMapper {
|
||||
int insertBmsSystemStatus(BmsSystemStatus data);
|
||||
List<BmsSystemStatus> selectBmsSystemStatusList(BmsSystemStatus filter);
|
||||
/**
|
||||
* BMS系统状态数据Mapper接口
|
||||
*
|
||||
* @author tzy
|
||||
* @date 2026-02-23
|
||||
*/
|
||||
public interface BmsSystemStatusMapper extends BaseMapper<BmsSystemStatus> {
|
||||
/**
|
||||
* 查询BMS系统状态数据
|
||||
*
|
||||
* @param id BMS系统状态数据主键
|
||||
* @return BMS系统状态数据
|
||||
*/
|
||||
public BmsSystemStatus selectBmsSystemStatusById(Long id);
|
||||
|
||||
/**
|
||||
* 查询BMS系统状态数据列表
|
||||
*
|
||||
* @param bmsSystemStatus BMS系统状态数据
|
||||
* @return BMS系统状态数据集合
|
||||
*/
|
||||
public List<BmsSystemStatus> selectBmsSystemStatusList(BmsSystemStatus bmsSystemStatus);
|
||||
|
||||
/**
|
||||
* 新增BMS系统状态数据
|
||||
*
|
||||
* @param bmsSystemStatus BMS系统状态数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBmsSystemStatus(BmsSystemStatus bmsSystemStatus);
|
||||
|
||||
/**
|
||||
* 修改BMS系统状态数据
|
||||
*
|
||||
* @param bmsSystemStatus BMS系统状态数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBmsSystemStatus(BmsSystemStatus bmsSystemStatus);
|
||||
|
||||
/**
|
||||
* 删除BMS系统状态数据
|
||||
*
|
||||
* @param id BMS系统状态数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBmsSystemStatusById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除BMS系统状态数据
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBmsSystemStatusByIds(Long[] ids);
|
||||
}
|
||||
|
||||
@ -0,0 +1,61 @@
|
||||
package com.evobms.project.bms.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.evobms.project.bms.domain.BmsVoltageChannelData;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* BMS电压通道数据Mapper接口
|
||||
*
|
||||
* @author tzy
|
||||
* @date 2026-02-23
|
||||
*/
|
||||
public interface BmsVoltageChannelDataMapper extends BaseMapper<BmsVoltageChannelData> {
|
||||
/**
|
||||
* 查询BMS电压通道数据
|
||||
*
|
||||
* @param id BMS电压通道数据主键
|
||||
* @return BMS电压通道数据
|
||||
*/
|
||||
public BmsVoltageChannelData selectBmsVoltageChannelDataById(Long id);
|
||||
|
||||
/**
|
||||
* 查询BMS电压通道数据列表
|
||||
*
|
||||
* @param bmsVoltageChannelData BMS电压通道数据
|
||||
* @return BMS电压通道数据集合
|
||||
*/
|
||||
public List<BmsVoltageChannelData> selectBmsVoltageChannelDataList(BmsVoltageChannelData bmsVoltageChannelData);
|
||||
|
||||
/**
|
||||
* 新增BMS电压通道数据
|
||||
*
|
||||
* @param bmsVoltageChannelData BMS电压通道数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBmsVoltageChannelData(BmsVoltageChannelData bmsVoltageChannelData);
|
||||
|
||||
/**
|
||||
* 修改BMS电压通道数据
|
||||
*
|
||||
* @param bmsVoltageChannelData BMS电压通道数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBmsVoltageChannelData(BmsVoltageChannelData bmsVoltageChannelData);
|
||||
|
||||
/**
|
||||
* 删除BMS电压通道数据
|
||||
*
|
||||
* @param id BMS电压通道数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBmsVoltageChannelDataById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除BMS电压通道数据
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBmsVoltageChannelDataByIds(Long[] ids);
|
||||
}
|
||||
@ -1,7 +1,61 @@
|
||||
package com.evobms.project.bms.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.evobms.project.bms.domain.BmsChargeDetail;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
public interface IBmsChargeDetailService {
|
||||
int insertBmsChargeDetail(BmsChargeDetail data);
|
||||
/**
|
||||
* BMS充电过程详细数据Service接口
|
||||
*
|
||||
* @author tzy
|
||||
* @date 2026-02-23
|
||||
*/
|
||||
public interface IBmsChargeDetailService extends IService<BmsChargeDetail> {
|
||||
/**
|
||||
* 查询BMS充电过程详细数据
|
||||
*
|
||||
* @param id BMS充电过程详细数据主键
|
||||
* @return BMS充电过程详细数据
|
||||
*/
|
||||
public BmsChargeDetail selectBmsChargeDetailById(Long id);
|
||||
|
||||
/**
|
||||
* 查询BMS充电过程详细数据列表
|
||||
*
|
||||
* @param bmsChargeDetail BMS充电过程详细数据
|
||||
* @return BMS充电过程详细数据集合
|
||||
*/
|
||||
public List<BmsChargeDetail> selectBmsChargeDetailList(BmsChargeDetail bmsChargeDetail);
|
||||
|
||||
/**
|
||||
* 新增BMS充电过程详细数据
|
||||
*
|
||||
* @param bmsChargeDetail BMS充电过程详细数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBmsChargeDetail(BmsChargeDetail bmsChargeDetail);
|
||||
|
||||
/**
|
||||
* 修改BMS充电过程详细数据
|
||||
*
|
||||
* @param bmsChargeDetail BMS充电过程详细数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBmsChargeDetail(BmsChargeDetail bmsChargeDetail);
|
||||
|
||||
/**
|
||||
* 批量删除BMS充电过程详细数据
|
||||
*
|
||||
* @param ids 需要删除的BMS充电过程详细数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBmsChargeDetailByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除BMS充电过程详细数据信息
|
||||
*
|
||||
* @param id BMS充电过程详细数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBmsChargeDetailById(Long id);
|
||||
}
|
||||
|
||||
@ -0,0 +1,61 @@
|
||||
package com.evobms.project.bms.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.evobms.project.bms.domain.BmsChargeTemperature;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* BMS充电座温度数据Service接口
|
||||
*
|
||||
* @author tzy
|
||||
* @date 2026-02-23
|
||||
*/
|
||||
public interface IBmsChargeTemperatureService extends IService<BmsChargeTemperature> {
|
||||
/**
|
||||
* 查询BMS充电座温度数据
|
||||
*
|
||||
* @param id BMS充电座温度数据主键
|
||||
* @return BMS充电座温度数据
|
||||
*/
|
||||
public BmsChargeTemperature selectBmsChargeTemperatureById(Long id);
|
||||
|
||||
/**
|
||||
* 查询BMS充电座温度数据列表
|
||||
*
|
||||
* @param bmsChargeTemperature BMS充电座温度数据
|
||||
* @return BMS充电座温度数据集合
|
||||
*/
|
||||
public List<BmsChargeTemperature> selectBmsChargeTemperatureList(BmsChargeTemperature bmsChargeTemperature);
|
||||
|
||||
/**
|
||||
* 新增BMS充电座温度数据
|
||||
*
|
||||
* @param bmsChargeTemperature BMS充电座温度数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBmsChargeTemperature(BmsChargeTemperature bmsChargeTemperature);
|
||||
|
||||
/**
|
||||
* 修改BMS充电座温度数据
|
||||
*
|
||||
* @param bmsChargeTemperature BMS充电座温度数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBmsChargeTemperature(BmsChargeTemperature bmsChargeTemperature);
|
||||
|
||||
/**
|
||||
* 批量删除BMS充电座温度数据
|
||||
*
|
||||
* @param ids 需要删除的BMS充电座温度数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBmsChargeTemperatureByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除BMS充电座温度数据信息
|
||||
*
|
||||
* @param id BMS充电座温度数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBmsChargeTemperatureById(Long id);
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
package com.evobms.project.bms.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.evobms.project.bms.domain.BmsRuntimeData;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* BMS实时运行数据Service接口
|
||||
*
|
||||
* @author tzy
|
||||
* @date 2026-02-23
|
||||
*/
|
||||
public interface IBmsRuntimeDataService extends IService<BmsRuntimeData> {
|
||||
/**
|
||||
* 查询BMS实时运行数据
|
||||
*
|
||||
* @param id BMS实时运行数据主键
|
||||
* @return BMS实时运行数据
|
||||
*/
|
||||
public BmsRuntimeData selectBmsRuntimeDataById(Long id);
|
||||
|
||||
/**
|
||||
* 查询BMS实时运行数据列表
|
||||
*
|
||||
* @param bmsRuntimeData BMS实时运行数据
|
||||
* @return BMS实时运行数据集合
|
||||
*/
|
||||
public List<BmsRuntimeData> selectBmsRuntimeDataList(BmsRuntimeData bmsRuntimeData);
|
||||
|
||||
/**
|
||||
* 新增BMS实时运行数据
|
||||
*
|
||||
* @param bmsRuntimeData BMS实时运行数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBmsRuntimeData(BmsRuntimeData bmsRuntimeData);
|
||||
|
||||
/**
|
||||
* 修改BMS实时运行数据
|
||||
*
|
||||
* @param bmsRuntimeData BMS实时运行数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBmsRuntimeData(BmsRuntimeData bmsRuntimeData);
|
||||
|
||||
/**
|
||||
* 批量删除BMS实时运行数据
|
||||
*
|
||||
* @param ids 需要删除的BMS实时运行数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBmsRuntimeDataByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除BMS实时运行数据信息
|
||||
*
|
||||
* @param id BMS实时运行数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBmsRuntimeDataById(Long id);
|
||||
}
|
||||
@ -1,7 +1,61 @@
|
||||
package com.evobms.project.bms.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.evobms.project.bms.domain.BmsSopData;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
public interface IBmsSopDataService {
|
||||
int insertBmsSopData(BmsSopData data);
|
||||
/**
|
||||
* BMS功率能力(SOP)数据Service接口
|
||||
*
|
||||
* @author tzy
|
||||
* @date 2026-02-23
|
||||
*/
|
||||
public interface IBmsSopDataService extends IService<BmsSopData> {
|
||||
/**
|
||||
* 查询BMS功率能力(SOP)数据
|
||||
*
|
||||
* @param id BMS功率能力(SOP)数据主键
|
||||
* @return BMS功率能力(SOP)数据
|
||||
*/
|
||||
public BmsSopData selectBmsSopDataById(Long id);
|
||||
|
||||
/**
|
||||
* 查询BMS功率能力(SOP)数据列表
|
||||
*
|
||||
* @param bmsSopData BMS功率能力(SOP)数据
|
||||
* @return BMS功率能力(SOP)数据集合
|
||||
*/
|
||||
public List<BmsSopData> selectBmsSopDataList(BmsSopData bmsSopData);
|
||||
|
||||
/**
|
||||
* 新增BMS功率能力(SOP)数据
|
||||
*
|
||||
* @param bmsSopData BMS功率能力(SOP)数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBmsSopData(BmsSopData bmsSopData);
|
||||
|
||||
/**
|
||||
* 修改BMS功率能力(SOP)数据
|
||||
*
|
||||
* @param bmsSopData BMS功率能力(SOP)数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBmsSopData(BmsSopData bmsSopData);
|
||||
|
||||
/**
|
||||
* 批量删除BMS功率能力(SOP)数据
|
||||
*
|
||||
* @param ids 需要删除的BMS功率能力(SOP)数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBmsSopDataByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除BMS功率能力(SOP)数据信息
|
||||
*
|
||||
* @param id BMS功率能力(SOP)数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBmsSopDataById(Long id);
|
||||
}
|
||||
|
||||
@ -1,7 +1,61 @@
|
||||
package com.evobms.project.bms.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.evobms.project.bms.domain.BmsSystemStatus;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
public interface IBmsSystemStatusService {
|
||||
int insertBmsSystemStatus(BmsSystemStatus data);
|
||||
/**
|
||||
* BMS系统状态数据Service接口
|
||||
*
|
||||
* @author tzy
|
||||
* @date 2026-02-23
|
||||
*/
|
||||
public interface IBmsSystemStatusService extends IService<BmsSystemStatus> {
|
||||
/**
|
||||
* 查询BMS系统状态数据
|
||||
*
|
||||
* @param id BMS系统状态数据主键
|
||||
* @return BMS系统状态数据
|
||||
*/
|
||||
public BmsSystemStatus selectBmsSystemStatusById(Long id);
|
||||
|
||||
/**
|
||||
* 查询BMS系统状态数据列表
|
||||
*
|
||||
* @param bmsSystemStatus BMS系统状态数据
|
||||
* @return BMS系统状态数据集合
|
||||
*/
|
||||
public List<BmsSystemStatus> selectBmsSystemStatusList(BmsSystemStatus bmsSystemStatus);
|
||||
|
||||
/**
|
||||
* 新增BMS系统状态数据
|
||||
*
|
||||
* @param bmsSystemStatus BMS系统状态数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBmsSystemStatus(BmsSystemStatus bmsSystemStatus);
|
||||
|
||||
/**
|
||||
* 修改BMS系统状态数据
|
||||
*
|
||||
* @param bmsSystemStatus BMS系统状态数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBmsSystemStatus(BmsSystemStatus bmsSystemStatus);
|
||||
|
||||
/**
|
||||
* 批量删除BMS系统状态数据
|
||||
*
|
||||
* @param ids 需要删除的BMS系统状态数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBmsSystemStatusByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除BMS系统状态数据信息
|
||||
*
|
||||
* @param id BMS系统状态数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBmsSystemStatusById(Long id);
|
||||
}
|
||||
|
||||
@ -0,0 +1,61 @@
|
||||
package com.evobms.project.bms.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.evobms.project.bms.domain.BmsVoltageChannelData;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* BMS电压通道数据Service接口
|
||||
*
|
||||
* @author tzy
|
||||
* @date 2026-02-23
|
||||
*/
|
||||
public interface IBmsVoltageChannelDataService extends IService<BmsVoltageChannelData> {
|
||||
/**
|
||||
* 查询BMS电压通道数据
|
||||
*
|
||||
* @param id BMS电压通道数据主键
|
||||
* @return BMS电压通道数据
|
||||
*/
|
||||
public BmsVoltageChannelData selectBmsVoltageChannelDataById(Long id);
|
||||
|
||||
/**
|
||||
* 查询BMS电压通道数据列表
|
||||
*
|
||||
* @param bmsVoltageChannelData BMS电压通道数据
|
||||
* @return BMS电压通道数据集合
|
||||
*/
|
||||
public List<BmsVoltageChannelData> selectBmsVoltageChannelDataList(BmsVoltageChannelData bmsVoltageChannelData);
|
||||
|
||||
/**
|
||||
* 新增BMS电压通道数据
|
||||
*
|
||||
* @param bmsVoltageChannelData BMS电压通道数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBmsVoltageChannelData(BmsVoltageChannelData bmsVoltageChannelData);
|
||||
|
||||
/**
|
||||
* 修改BMS电压通道数据
|
||||
*
|
||||
* @param bmsVoltageChannelData BMS电压通道数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBmsVoltageChannelData(BmsVoltageChannelData bmsVoltageChannelData);
|
||||
|
||||
/**
|
||||
* 批量删除BMS电压通道数据
|
||||
*
|
||||
* @param ids 需要删除的BMS电压通道数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBmsVoltageChannelDataByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除BMS电压通道数据信息
|
||||
*
|
||||
* @param id BMS电压通道数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBmsVoltageChannelDataById(Long id);
|
||||
}
|
||||
@ -3,38 +3,39 @@ package com.evobms.project.bms.service;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.evobms.common.utils.DateUtils;
|
||||
import com.evobms.project.battery.domain.ExtremeValues;
|
||||
import com.evobms.project.battery.domain.SubsystemVoltage;
|
||||
import com.evobms.project.battery.domain.SubsystemTemperature;
|
||||
import com.evobms.project.battery.domain.SubsystemVoltage;
|
||||
import com.evobms.project.battery.service.IExtremeValuesService;
|
||||
import com.evobms.project.battery.service.ISubsystemVoltageService;
|
||||
import com.evobms.project.battery.service.ISubsystemTemperatureService;
|
||||
import com.evobms.project.battery.service.ISubsystemVoltageService;
|
||||
import com.evobms.project.bms.domain.*;
|
||||
import com.evobms.project.bms.mapper.BmsVoltageChannelDataMapper;
|
||||
import com.evobms.project.summary.domain.ChargeDischargeSummary;
|
||||
import com.evobms.project.summary.service.IChargeDischargeSummaryService;
|
||||
import com.evobms.project.system.domain.BmsDevices;
|
||||
import com.evobms.project.system.mapper.BmsDevicesMapper;
|
||||
import com.evobms.project.system.service.IBmsDevicesService;
|
||||
import com.evobms.project.vehicledata.domain.VehicleData;
|
||||
import com.evobms.project.vehicledata.domain.VehicleLocation;
|
||||
import com.evobms.project.vehicledata.service.IVehicleDataService;
|
||||
import com.evobms.project.vehicledata.service.IVehicleLocationService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.integration.support.MessageBuilder;
|
||||
import org.springframework.messaging.MessageChannel;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
import java.math.BigDecimal;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.GeneralSecurityException;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.evobms.project.system.service.IBmsDevicesService;
|
||||
import com.evobms.project.system.domain.BmsDevices;
|
||||
|
||||
import static com.evobms.project.bms.controller.GBT32960FullDecoder.parseGBT32960Data;
|
||||
|
||||
/**
|
||||
@ -47,30 +48,37 @@ import static com.evobms.project.bms.controller.GBT32960FullDecoder.parseGBT3296
|
||||
@ConditionalOnProperty(name = "mqtt.enabled", havingValue = "true")
|
||||
public class MqttService {
|
||||
private static final Logger log = LoggerFactory.getLogger(MqttService.class);
|
||||
|
||||
@Autowired
|
||||
private MessageChannel mqttOutboundChannel;
|
||||
|
||||
@Autowired
|
||||
private IBmsDevicesService bmsDevicesService;
|
||||
|
||||
@Autowired
|
||||
private IVehicleDataService vehicleDataService;
|
||||
|
||||
@Autowired
|
||||
private IVehicleLocationService vehicleLocationService;
|
||||
|
||||
@Autowired
|
||||
private IExtremeValuesService extremeValuesService;
|
||||
|
||||
@Autowired
|
||||
private ISubsystemVoltageService subsystemVoltageService;
|
||||
|
||||
@Autowired
|
||||
private ISubsystemTemperatureService subsystemTemperatureService;
|
||||
|
||||
@Autowired
|
||||
private IChargeDischargeSummaryService chargeDischargeSummaryService;
|
||||
@Autowired
|
||||
private IBmsChargeDetailService bmsChargeDetailService;
|
||||
@Autowired
|
||||
private IBmsRuntimeDataService bmsRuntimeDataService;
|
||||
@Autowired
|
||||
private IBmsSopDataService bmsSopDataService;
|
||||
@Autowired
|
||||
private IBmsSystemStatusService bmsSystemStatusService;
|
||||
@Autowired
|
||||
private IBmsChargeTemperatureService bmsChargeTemperatureService;
|
||||
@Autowired
|
||||
private BmsVoltageChannelDataMapper bmsVoltageChannelDataMapper;
|
||||
@Autowired
|
||||
private IBmsVoltageChannelDataService bmsVoltageChannelDataService;
|
||||
|
||||
@Autowired
|
||||
private BmsDevicesMapper bmsDevicesMapper;
|
||||
|
||||
@ -83,34 +91,6 @@ public class MqttService {
|
||||
@Value("${mqtt.dataHeaderLength:12}")
|
||||
private int dataHeaderLength;
|
||||
|
||||
/**
|
||||
* 发送MQTT消息
|
||||
*
|
||||
* @param topic 主题
|
||||
* @param payload 消息内容
|
||||
*/
|
||||
public void sendMessage(String topic, String payload) {
|
||||
log.info("发送MQTT消息 -> 主题: {}, QOS: {}, 载荷: {}", topic, defaultQos, payload);
|
||||
mqttOutboundChannel.send(MessageBuilder.withPayload(payload)
|
||||
.setHeader("mqtt_topic", topic)
|
||||
.setHeader("mqtt_qos", defaultQos)
|
||||
.build());
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送MQTT字节消息
|
||||
*
|
||||
* @param topic 主题
|
||||
* @param payload 原始字节
|
||||
*/
|
||||
public void sendMessageBytes(String topic, byte[] payload) {
|
||||
log.info("发送MQTT字节消息 -> 主题: {}, QOS: {}, 长度: {}, HEX: {}", topic, defaultQos, payload.length, toHex(payload));
|
||||
mqttOutboundChannel.send(MessageBuilder.withPayload(payload)
|
||||
.setHeader("mqtt_topic", topic)
|
||||
.setHeader("mqtt_qos", defaultQos)
|
||||
.build());
|
||||
}
|
||||
|
||||
private static String toHex(byte[] bytes) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (byte b : bytes) {
|
||||
@ -164,6 +144,28 @@ public class MqttService {
|
||||
return cipher.doFinal(plaintext);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送MQTT消息
|
||||
*
|
||||
* @param topic 主题
|
||||
* @param payload 消息内容
|
||||
*/
|
||||
public void sendMessage(String topic, String payload) {
|
||||
log.info("发送MQTT消息 -> 主题: {}, QOS: {}, 载荷: {}", topic, defaultQos, payload);
|
||||
mqttOutboundChannel.send(MessageBuilder.withPayload(payload).setHeader("mqtt_topic", topic).setHeader("mqtt_qos", defaultQos).build());
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送MQTT字节消息
|
||||
*
|
||||
* @param topic 主题
|
||||
* @param payload 原始字节
|
||||
*/
|
||||
public void sendMessageBytes(String topic, byte[] payload) {
|
||||
log.info("发送MQTT字节消息 -> 主题: {}, QOS: {}, 长度: {}, HEX: {}", topic, defaultQos, payload.length, toHex(payload));
|
||||
mqttOutboundChannel.send(MessageBuilder.withPayload(payload).setHeader("mqtt_topic", topic).setHeader("mqtt_qos", defaultQos).build());
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送设备控制命令
|
||||
*
|
||||
@ -184,6 +186,7 @@ public class MqttService {
|
||||
|
||||
/**
|
||||
* 处理接收到的设备数据
|
||||
*
|
||||
* @param topic 主题
|
||||
* @param message 消息内容
|
||||
*/
|
||||
@ -222,6 +225,7 @@ public class MqttService {
|
||||
|
||||
/**
|
||||
* 逐字段解析数据字符串 - 直接解析十六进制数据
|
||||
*
|
||||
* @param data 十六进制数据字符串
|
||||
* @param deviceSn 设备SN码
|
||||
*/
|
||||
@ -352,8 +356,7 @@ public class MqttService {
|
||||
|
||||
// 索引32: 充电状态
|
||||
byte chargeStatus = message[startIndex + 2];
|
||||
log.info("设备 {} - 充电状态: 0x{} ({})", deviceSn,
|
||||
String.format("%02X", chargeStatus), getChargeStatusDescription(chargeStatus));
|
||||
log.info("设备 {} - 充电状态: 0x{} ({})", deviceSn, String.format("%02X", chargeStatus), getChargeStatusDescription(chargeStatus));
|
||||
|
||||
// 索引40-41: 总电压 (0.1V)
|
||||
int totalVoltage = ((message[startIndex + 10] & 0xFF) << 8) | (message[startIndex + 11] & 0xFF);
|
||||
@ -406,16 +409,10 @@ public class MqttService {
|
||||
// 转成十六进制字符串,例如 "00", "01"
|
||||
String locationStatusHex = String.format("%02X", locationStatus);
|
||||
// 索引53-56: 经度 (0.000001°)
|
||||
long longitude = ((message[startIndex + 2] & 0xFFL) << 24) |
|
||||
((message[startIndex + 3] & 0xFFL) << 16) |
|
||||
((message[startIndex + 4] & 0xFFL) << 8) |
|
||||
(message[startIndex + 5] & 0xFFL);
|
||||
long longitude = ((message[startIndex + 2] & 0xFFL) << 24) | ((message[startIndex + 3] & 0xFFL) << 16) | ((message[startIndex + 4] & 0xFFL) << 8) | (message[startIndex + 5] & 0xFFL);
|
||||
|
||||
// 索引57-60: 纬度 (0.000001°)
|
||||
long latitude = ((message[startIndex + 6] & 0xFFL) << 24) |
|
||||
((message[startIndex + 7] & 0xFFL) << 16) |
|
||||
((message[startIndex + 8] & 0xFFL) << 8) |
|
||||
(message[startIndex + 9] & 0xFFL);
|
||||
long latitude = ((message[startIndex + 6] & 0xFFL) << 24) | ((message[startIndex + 7] & 0xFFL) << 16) | ((message[startIndex + 8] & 0xFFL) << 8) | (message[startIndex + 9] & 0xFFL);
|
||||
|
||||
if (longitude != 0 || latitude != 0) {
|
||||
double lon = longitude / 1000000.0;
|
||||
@ -525,8 +522,7 @@ public class MqttService {
|
||||
int storageCurrent = ((message[startIndex + 5] & 0xFF) << 8) | (message[startIndex + 6] & 0xFF);
|
||||
double storageCurrentValue = (storageCurrent - 10000) * 0.1;
|
||||
|
||||
log.info("设备 {} - 储能装置: 子系统{}/{}, 电压{}V, 电流{}A", deviceSn,
|
||||
subsystemNum, subsystemCount, storageVoltageValue, storageCurrentValue);
|
||||
log.info("设备 {} - 储能装置: 子系统{}/{}, 电压{}V, 电流{}A", deviceSn, subsystemNum, subsystemCount, storageVoltageValue, storageCurrentValue);
|
||||
|
||||
// 索引83-84: 单体电压总数
|
||||
int totalCellCount = ((message[startIndex + 7] & 0xFF) << 8) | (message[startIndex + 8] & 0xFF);
|
||||
@ -535,8 +531,7 @@ public class MqttService {
|
||||
// 索引87: 本帧电芯总数
|
||||
int frameCellCount = message[startIndex + 11] & 0xFF;
|
||||
|
||||
log.info("设备 {} - 电芯信息: 总数{}个, 本帧{}-{}", deviceSn,
|
||||
totalCellCount, startCellIndex, startCellIndex + frameCellCount - 1);
|
||||
log.info("设备 {} - 电芯信息: 总数{}个, 本帧{}-{}", deviceSn, totalCellCount, startCellIndex, startCellIndex + frameCellCount - 1);
|
||||
|
||||
// 索引88开始: 单体电压数据 (每个电芯2字节)
|
||||
int voltageDataStart = startIndex + 12;
|
||||
@ -603,8 +598,7 @@ public class MqttService {
|
||||
// 索引451-452: 单体温度总数
|
||||
int totalTempCount = ((message[startIndex + 3] & 0xFF) << 8) | (message[startIndex + 4] & 0xFF);
|
||||
|
||||
log.info("设备 {} - 温度探头: 子系统{}/{}, 总数{}个", deviceSn,
|
||||
subsystemNum, subsystemCount, totalTempCount);
|
||||
log.info("设备 {} - 温度探头: 子系统{}/{}, 总数{}个", deviceSn, subsystemNum, subsystemCount, totalTempCount);
|
||||
|
||||
// 索引453开始: 单体温度数据 (每个探头1字节)
|
||||
int tempDataStart = startIndex + 5;
|
||||
@ -662,7 +656,7 @@ public class MqttService {
|
||||
long dischargeEnergy = ((message[startIndex + 3] & 0xFFL) << 24) | ((message[startIndex + 4] & 0xFFL) << 16) | ((message[startIndex + 5] & 0xFFL) << 8) | (message[startIndex + 6] & 0xFFL);
|
||||
|
||||
// 索引550-553: 累计充电电量 (0.1kWh)
|
||||
long chargeEnergy = ((message[startIndex + 7] & 0xFFL) << 24) |((message[startIndex + 8] & 0xFFL) << 16) | ((message[startIndex + 9] & 0xFFL) << 8) | (message[startIndex + 10] & 0xFFL);
|
||||
long chargeEnergy = ((message[startIndex + 7] & 0xFFL) << 24) | ((message[startIndex + 8] & 0xFFL) << 16) | ((message[startIndex + 9] & 0xFFL) << 8) | (message[startIndex + 10] & 0xFFL);
|
||||
|
||||
double dischargeKwh = dischargeEnergy * 0.1;
|
||||
double chargeKwh = chargeEnergy * 0.1;
|
||||
@ -699,8 +693,7 @@ public class MqttService {
|
||||
int maxTemp = temperatures.stream().mapToInt(v -> v).max().orElse(0);
|
||||
double avgTemp = temperatures.stream().mapToInt(v -> v).average().orElse(0);
|
||||
|
||||
log.info("设备 {} - 温度统计: 最小值{}°C, 最大值{}°C, 平均值{}°C",
|
||||
deviceSn, minTemp, maxTemp, avgTemp);
|
||||
log.info("设备 {} - 温度统计: 最小值{}°C, 最大值{}°C, 平均值{}°C", deviceSn, minTemp, maxTemp, avgTemp);
|
||||
}
|
||||
|
||||
|
||||
@ -724,8 +717,7 @@ public class MqttService {
|
||||
List<Double> voltages = new ArrayList<>();
|
||||
|
||||
for (int i = 0; i < cellCount; i++) {
|
||||
int voltage = ((message[startIndex + i * 2] & 0xFF) << 8) |
|
||||
(message[startIndex + i * 2 + 1] & 0xFF);
|
||||
int voltage = ((message[startIndex + i * 2] & 0xFF) << 8) | (message[startIndex + i * 2 + 1] & 0xFF);
|
||||
double voltageValue = voltage * 0.001; // mV转V
|
||||
voltages.add(voltageValue);
|
||||
|
||||
@ -783,12 +775,7 @@ public class MqttService {
|
||||
* 检查时间有效性
|
||||
*/
|
||||
private boolean isValidTime(int year, int month, int day, int hour, int minute, int second) {
|
||||
return year >= 2000 && year <= 2100 &&
|
||||
month >= 1 && month <= 12 &&
|
||||
day >= 1 && day <= 31 &&
|
||||
hour >= 0 && hour <= 23 &&
|
||||
minute >= 0 && minute <= 59 &&
|
||||
second >= 0 && second <= 59;
|
||||
return year >= 2000 && year <= 2100 && month >= 1 && month <= 12 && day >= 1 && day <= 31 && hour >= 0 && hour <= 23 && minute >= 0 && minute <= 59 && second >= 0 && second <= 59;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -798,8 +785,7 @@ public class MqttService {
|
||||
int len = hex.length();
|
||||
byte[] data = new byte[len / 2];
|
||||
for (int i = 0; i < len; i += 2) {
|
||||
data[i / 2] = (byte) ((Character.digit(hex.charAt(i), 16) << 4)
|
||||
+ Character.digit(hex.charAt(i + 1), 16));
|
||||
data[i / 2] = (byte) ((Character.digit(hex.charAt(i), 16) << 4) + Character.digit(hex.charAt(i + 1), 16));
|
||||
}
|
||||
return data;
|
||||
}
|
||||
@ -884,8 +870,7 @@ public class MqttService {
|
||||
vehicleLocationService.insertVehicleLocation(ve);
|
||||
}
|
||||
|
||||
private void saveExtremeData(String deviceSn, int maxVoltageSubsystemNo, int maxVoltageBatteryNo, double maxVoltageValue, int minVoltageSubsystemNo, int minVoltageBatteryNo, double minVoltageValue, int maxTempSubsystemNo,
|
||||
int maxTempProbeNo, int maxTempValue, int minTempSubsystemNo, int minTempProbeNo, int minTempValue, Date frameTime) {
|
||||
private void saveExtremeData(String deviceSn, int maxVoltageSubsystemNo, int maxVoltageBatteryNo, double maxVoltageValue, int minVoltageSubsystemNo, int minVoltageBatteryNo, double minVoltageValue, int maxTempSubsystemNo, int maxTempProbeNo, int maxTempValue, int minTempSubsystemNo, int minTempProbeNo, int minTempValue, Date frameTime) {
|
||||
ExtremeValues ex = new ExtremeValues();
|
||||
ex.setDeviceId(deviceSn);
|
||||
ex.setTimestamp(frameTime);
|
||||
@ -950,93 +935,190 @@ public class MqttService {
|
||||
*/
|
||||
private void parseExtendedDataAtIndex(byte[] message, int startIndex, String deviceSn, Date frameTime) {
|
||||
try {
|
||||
int base = startIndex;
|
||||
int need = (716 - 530 + 1);
|
||||
if (message.length < base + need) {
|
||||
if (message.length < startIndex + need) {
|
||||
log.warn("设备 {}: 扩展数据索引越界", deviceSn);
|
||||
return;
|
||||
}
|
||||
// 系统计数/绝缘/车速/总压
|
||||
long resetCount = ((message[base + 0] & 0xFFL) << 24) | ((message[base + 1] & 0xFFL) << 16) | ((message[base + 2] & 0xFFL) << 8) | (message[base + 3] & 0xFFL); // 复位次数(u32)
|
||||
int insulationVal = ((message[base + 4] & 0xFF) << 8) | (message[base + 5] & 0xFF); // 绝缘值(单位KΩ)
|
||||
int carSpdRaw = ((message[base + 6] & 0xFF) << 8) | (message[base + 7] & 0xFF); // 车速原始(×0.1km/h)
|
||||
long resetCount = ((message[startIndex] & 0xFFL) << 24) | ((message[startIndex + 1] & 0xFFL) << 16) | ((message[startIndex + 2] & 0xFFL) << 8) | (message[startIndex + 3] & 0xFFL); // 复位次数(u32)
|
||||
int insulationVal = ((message[startIndex + 4] & 0xFF) << 8) | (message[startIndex + 5] & 0xFF); // 绝缘值(单位KΩ)
|
||||
int carSpdRaw = ((message[startIndex + 6] & 0xFF) << 8) | (message[startIndex + 7] & 0xFF); // 车速原始(×0.1km/h)
|
||||
double carSpd = carSpdRaw * 0.1;
|
||||
int gpvRaw = ((message[base + 8] & 0xFF) << 8) | (message[base + 9] & 0xFF); // GPV(×0.1V)
|
||||
int gpvRaw = ((message[startIndex + 8] & 0xFF) << 8) | (message[startIndex + 9] & 0xFF); // GPV(×0.1V)
|
||||
double gpv = gpvRaw * 0.1;
|
||||
// RTP1..7(×0.1V)
|
||||
double rtp1 = (((message[base + 10] & 0xFF) << 8) | (message[base + 11] & 0xFF)) * 0.1;
|
||||
double rtp2 = (((message[base + 12] & 0xFF) << 8) | (message[base + 13] & 0xFF)) * 0.1;
|
||||
double rtp3 = (((message[base + 14] & 0xFF) << 8) | (message[base + 15] & 0xFF)) * 0.1;
|
||||
double rtp4 = (((message[base + 16] & 0xFF) << 8) | (message[base + 17] & 0xFF)) * 0.1;
|
||||
double rtp5 = (((message[base + 18] & 0xFF) << 8) | (message[base + 19] & 0xFF)) * 0.1;
|
||||
double rtp6 = (((message[base + 20] & 0xFF) << 8) | (message[base + 21] & 0xFF)) * 0.1;
|
||||
double rtp7 = (((message[base + 22] & 0xFF) << 8) | (message[base + 23] & 0xFF)) * 0.1;
|
||||
double rtp1 = (((message[startIndex + 10] & 0xFF) << 8) | (message[startIndex + 11] & 0xFF)) * 0.1;
|
||||
double rtp2 = (((message[startIndex + 12] & 0xFF) << 8) | (message[startIndex + 13] & 0xFF)) * 0.1;
|
||||
double rtp3 = (((message[startIndex + 14] & 0xFF) << 8) | (message[startIndex + 15] & 0xFF)) * 0.1;
|
||||
double rtp4 = (((message[startIndex + 16] & 0xFF) << 8) | (message[startIndex + 17] & 0xFF)) * 0.1;
|
||||
double rtp5 = (((message[startIndex + 18] & 0xFF) << 8) | (message[startIndex + 19] & 0xFF)) * 0.1;
|
||||
double rtp6 = (((message[startIndex + 20] & 0xFF) << 8) | (message[startIndex + 21] & 0xFF)) * 0.1;
|
||||
double rtp7 = (((message[startIndex + 22] & 0xFF) << 8) | (message[startIndex + 23] & 0xFF)) * 0.1;
|
||||
// RTN探针序号
|
||||
int rtn1 = message[base + 24] & 0xFF; // RTN1
|
||||
int rtn2 = message[base + 25] & 0xFF; // RTN2
|
||||
int rtn3 = message[base + 26] & 0xFF; // RTN3
|
||||
int rtn4 = message[base + 27] & 0xFF; // RTN4
|
||||
double realSocMax = (((message[base + 28] & 0xFF) << 8) | (message[base + 29] & 0xFF)) * 0.1; // RealSOC最大(×0.1%)
|
||||
double realSocMin = (((message[base + 30] & 0xFF) << 8) | (message[base + 31] & 0xFF)) * 0.1; // RealSOC最小(×0.1%)
|
||||
int rtn1 = message[startIndex + 24] & 0xFF; // RTN1
|
||||
int rtn2 = message[startIndex + 25] & 0xFF; // RTN2
|
||||
int rtn3 = message[startIndex + 26] & 0xFF; // RTN3
|
||||
int rtn4 = message[startIndex + 27] & 0xFF; // RTN4
|
||||
double realSocMax = (((message[startIndex + 28] & 0xFF) << 8) | (message[startIndex + 29] & 0xFF)) * 0.1; // RealSOC最大(×0.1%)
|
||||
double realSocMin = (((message[startIndex + 30] & 0xFF) << 8) | (message[startIndex + 31] & 0xFF)) * 0.1; // RealSOC最小(×0.1%)
|
||||
// 充电座温度(℃,需减40)
|
||||
int chgBs1Tmp = (message[base + 32] & 0xFF) - 40;
|
||||
int chgBs2Tmp = (message[base + 33] & 0xFF) - 40;
|
||||
int chgBs3Tmp = (message[base + 34] & 0xFF) - 40;
|
||||
int chgBs4Tmp = (message[base + 35] & 0xFF) - 40;
|
||||
int chgBs5Tmp = (message[base + 36] & 0xFF) - 40;
|
||||
int chgBs6Tmp = (message[base + 37] & 0xFF) - 40;
|
||||
int chgBs7Tmp = (message[base + 38] & 0xFF) - 40;
|
||||
int chgBs8Tmp = (message[base + 39] & 0xFF) - 40;
|
||||
int chgBs1Tmp = (message[startIndex + 32] & 0xFF) - 40;
|
||||
int chgBs2Tmp = (message[startIndex + 33] & 0xFF) - 40;
|
||||
int chgBs3Tmp = (message[startIndex + 34] & 0xFF) - 40;
|
||||
int chgBs4Tmp = (message[startIndex + 35] & 0xFF) - 40;
|
||||
int chgBs5Tmp = (message[startIndex + 36] & 0xFF) - 40;
|
||||
int chgBs6Tmp = (message[startIndex + 37] & 0xFF) - 40;
|
||||
int chgBs7Tmp = (message[startIndex + 38] & 0xFF) - 40;
|
||||
int chgBs8Tmp = (message[startIndex + 39] & 0xFF) - 40;
|
||||
// 慢充/快充电流电压(×0.1)
|
||||
double tChgCur = (((message[base + 40] & 0xFF) << 8) | (message[base + 41] & 0xFF)) * 0.1; // 慢充电流(A)
|
||||
double tChgVol = (((message[base + 42] & 0xFF) << 8) | (message[base + 43] & 0xFF)) * 0.1; // 慢充电压(V)
|
||||
double fChgCur = (((message[base + 44] & 0xFF) << 8) | (message[base + 45] & 0xFF)) * 0.1; // 快充电流(A)
|
||||
double fChgVol = (((message[base + 46] & 0xFF) << 8) | (message[base + 47] & 0xFF)) * 0.1; // 快充电压(V)
|
||||
double tChgCur = (((message[startIndex + 40] & 0xFF) << 8) | (message[startIndex + 41] & 0xFF)) * 0.1; // 慢充电流(A)
|
||||
double tChgVol = (((message[startIndex + 42] & 0xFF) << 8) | (message[startIndex + 43] & 0xFF)) * 0.1; // 慢充电压(V)
|
||||
double fChgCur = (((message[startIndex + 44] & 0xFF) << 8) | (message[startIndex + 45] & 0xFF)) * 0.1; // 快充电流(A)
|
||||
double fChgVol = (((message[startIndex + 46] & 0xFF) << 8) | (message[startIndex + 47] & 0xFF)) * 0.1; // 快充电压(V)
|
||||
// 放电/回馈SOP能力(A)
|
||||
int disSop10 = ((message[base + 48] & 0xFF) << 8) | (message[base + 49] & 0xFF);
|
||||
int disSop30 = ((message[base + 50] & 0xFF) << 8) | (message[base + 51] & 0xFF);
|
||||
int disSop60 = ((message[base + 52] & 0xFF) << 8) | (message[base + 53] & 0xFF);
|
||||
int disSopCont = ((message[base + 54] & 0xFF) << 8) | (message[base + 55] & 0xFF);
|
||||
int regSop10 = ((message[base + 56] & 0xFF) << 8) | (message[base + 57] & 0xFF);
|
||||
int regSop30 = ((message[base + 58] & 0xFF) << 8) | (message[base + 59] & 0xFF);
|
||||
int regSop60 = ((message[base + 60] & 0xFF) << 8) | (message[base + 61] & 0xFF);
|
||||
int regSopCont = ((message[base + 62] & 0xFF) << 8) | (message[base + 63] & 0xFF);
|
||||
int disSopTol = ((message[base + 64] & 0xFF) << 8) | (message[base + 65] & 0xFF);
|
||||
int regSopTol = ((message[base + 66] & 0xFF) << 8) | (message[base + 67] & 0xFF);
|
||||
long disSop10 = ((message[startIndex + 48] & 0xFF) << 8) | (message[startIndex + 49] & 0xFF);
|
||||
long disSop30 = ((message[startIndex + 50] & 0xFF) << 8) | (message[startIndex + 51] & 0xFF);
|
||||
long disSop60 = ((message[startIndex + 52] & 0xFF) << 8) | (message[startIndex + 53] & 0xFF);
|
||||
long disSopCont = ((message[startIndex + 54] & 0xFF) << 8) | (message[startIndex + 55] & 0xFF);
|
||||
long regSop10 = ((message[startIndex + 56] & 0xFF) << 8) | (message[startIndex + 57] & 0xFF);
|
||||
long regSop30 = ((message[startIndex + 58] & 0xFF) << 8) | (message[startIndex + 59] & 0xFF);
|
||||
long regSop60 = ((message[startIndex + 60] & 0xFF) << 8) | (message[startIndex + 61] & 0xFF);
|
||||
long regSopCont = ((message[startIndex + 62] & 0xFF) << 8) | (message[startIndex + 63] & 0xFF);
|
||||
long disSopTol = ((message[startIndex + 64] & 0xFF) << 8) | (message[startIndex + 65] & 0xFF);
|
||||
long regSopTol = ((message[startIndex + 66] & 0xFF) << 8) | (message[startIndex + 67] & 0xFF);
|
||||
// 版本与编码
|
||||
int hwVer = ((message[base + 68] & 0xFF) << 8) | (message[base + 69] & 0xFF); // 硬件版本
|
||||
int swVer = ((message[base + 70] & 0xFF) << 8) | (message[base + 71] & 0xFF); // 软件版本
|
||||
String bmsCode = readAsciiRange(message, 602, 28, base); // BMS编码(28字节ASCII)
|
||||
String vin = readAsciiRange(message, 629, 21, base); // VIN码(21字节ASCII)
|
||||
int hwVer = ((message[startIndex + 68] & 0xFF) << 8) | (message[startIndex + 69] & 0xFF); // 硬件版本
|
||||
int swVer = ((message[startIndex + 70] & 0xFF) << 8) | (message[startIndex + 71] & 0xFF); // 软件版本
|
||||
String bmsCode = readAsciiRange(message, 602, 28, startIndex); // BMS编码(28字节ASCII)
|
||||
String vin = readAsciiRange(message, 629, 21, startIndex); // VIN码(21字节ASCII)
|
||||
// 系统状态
|
||||
int sysVolRaw = ((message[base + (649 - 530)] & 0xFF) << 8) | (message[base + (650 - 530)] & 0xFF); // 系统电压(×0.1V)
|
||||
int sysCurRaw = ((message[base + (651 - 530)] & 0xFF) << 8) | (message[base + (652 - 530)] & 0xFF); // 系统电流(×0.1A)
|
||||
int sysVolRaw = ((message[startIndex + (649 - 530)] & 0xFF) << 8) | (message[startIndex + (650 - 530)] & 0xFF); // 系统电压(×0.1V)
|
||||
int sysCurRaw = ((message[startIndex + (651 - 530)] & 0xFF) << 8) | (message[startIndex + (652 - 530)] & 0xFF); // 系统电流(×0.1A)
|
||||
double sysVol = sysVolRaw * 0.1;
|
||||
double sysCur = sysCurRaw * 0.1;
|
||||
int cellCount = ((message[base + (653 - 530)] & 0xFF) << 8) | (message[base + (654 - 530)] & 0xFF);
|
||||
int tempSensorCount = ((message[base + (655 - 530)] & 0xFF) << 8) | (message[base + (656 - 530)] & 0xFF);
|
||||
int relayStatus = ((message[base + (657 - 530)] & 0xFF) << 8) | (message[base + (658 - 530)] & 0xFF);
|
||||
int onaaccStatus = ((message[base + (659 - 530)] & 0xFF) << 8) | (message[base + (660 - 530)] & 0xFF);
|
||||
int acStopCode = message[base + (661 - 530)] & 0xFF;
|
||||
int dcStopCode = message[base + (662 - 530)] & 0xFF;
|
||||
int cycleCount = ((message[base + (663 - 530)] & 0xFF) << 8) | (message[base + (664 - 530)] & 0xFF);
|
||||
long devId = ((message[base + (665 - 530)] & 0xFFL) << 24) | ((message[base + (666 - 530)] & 0xFFL) << 16) | ((message[base + (667 - 530)] & 0xFFL) << 8) | (message[base + (668 - 530)] & 0xFFL);
|
||||
String clientCode = readAsciiRange(message, 669, 28, base); // 客户编码(28字节ASCII)
|
||||
double samp25v = (((message[base + (696 - 530)] & 0xFF) << 8) | (message[base + (697 - 530)] & 0xFF)) * 0.001; // 2.5V采样(×0.001V)
|
||||
double samp5v = (((message[base + (698 - 530)] & 0xFF) << 8) | (message[base + (699 - 530)] & 0xFF)) * 0.001; // 5V采样(×0.001V)
|
||||
int chargeSop = ((message[base + (700 - 530)] & 0xFF) << 8) | (message[base + (701 - 530)] & 0xFF); // 充电SOP(A)
|
||||
int acChargeSop = ((message[base + (702 - 530)] & 0xFF) << 8) | (message[base + (703 - 530)] & 0xFF); // 慢充SOP(A)
|
||||
int cellCount = ((message[startIndex + (653 - 530)] & 0xFF) << 8) | (message[startIndex + (654 - 530)] & 0xFF);
|
||||
int tempSensorCount = ((message[startIndex + (655 - 530)] & 0xFF) << 8) | (message[startIndex + (656 - 530)] & 0xFF);
|
||||
int relayStatus = ((message[startIndex + (657 - 530)] & 0xFF) << 8) | (message[startIndex + (658 - 530)] & 0xFF);
|
||||
int onaaccStatus = ((message[startIndex + (659 - 530)] & 0xFF) << 8) | (message[startIndex + (660 - 530)] & 0xFF);
|
||||
int acStopCode = message[startIndex + (661 - 530)] & 0xFF;
|
||||
int dcStopCode = message[startIndex + (662 - 530)] & 0xFF;
|
||||
int cycleCount = ((message[startIndex + (663 - 530)] & 0xFF) << 8) | (message[startIndex + (664 - 530)] & 0xFF);
|
||||
long devId = ((message[startIndex + (665 - 530)] & 0xFFL) << 24) | ((message[startIndex + (666 - 530)] & 0xFFL) << 16) | ((message[startIndex + (667 - 530)] & 0xFFL) << 8) | (message[startIndex + (668 - 530)] & 0xFFL);
|
||||
String clientCode = readAsciiRange(message, 669, 28, startIndex); // 客户编码(28字节ASCII)
|
||||
double samp25v = (((message[startIndex + (696 - 530)] & 0xFF) << 8) | (message[startIndex + (697 - 530)] & 0xFF)) * 0.001; // 2.5V采样(×0.001V)
|
||||
double samp5v = (((message[startIndex + (698 - 530)] & 0xFF) << 8) | (message[startIndex + (699 - 530)] & 0xFF)) * 0.001; // 5V采样(×0.001V)
|
||||
long chargeSop = ((message[startIndex + (700 - 530)] & 0xFF) << 8) | (message[startIndex + (701 - 530)] & 0xFF); // 充电SOP(A)
|
||||
long acChargeSop = ((message[startIndex + (702 - 530)] & 0xFF) << 8) | (message[startIndex + (703 - 530)] & 0xFF); // 慢充SOP(A)
|
||||
// 运行阶段/充电阶段/时间与里程
|
||||
int runSts = message[base + (704 - 530)] & 0xFF; // 行车阶段
|
||||
int runPwrSts = message[base + (705 - 530)] & 0xFF; // 行车上电阶段
|
||||
int tChgCp = message[base + (706 - 530)] & 0xFF; // 慢充CP值
|
||||
int tChgR = message[base + (707 - 530)] & 0xFF; // 慢充枪阻值
|
||||
int tChgSts = message[base + (708 - 530)] & 0xFF; // 慢充阶段
|
||||
int fChgSts2 = message[base + (709 - 530)] & 0xFF; // 快充阶段
|
||||
int chgSts = message[base + (710 - 530)] & 0xFF; // 充电阶段
|
||||
int chgTime = ((message[base + (711 - 530)] & 0xFF) << 8) | (message[base + (712 - 530)] & 0xFF); // 充电时长(min)
|
||||
long mileage = ((message[base + (713 - 530)] & 0xFFL) << 24) | ((message[base + (714 - 530)] & 0xFFL) << 16) | ((message[base + (715 - 530)] & 0xFFL) << 8) | (message[base + (716 - 530)] & 0xFFL); // 里程(u32)
|
||||
log.info("设备 {} 扩展数据: resetCount={}, insulationValKOhm={}, carSpeedKmH={}, GPV0_1V={}, RTPs(V)=[{},{},{},{},{},{},{}], RTNs=[{},{},{},{}], realSOCMax0_1={}, realSOCMin0_1={}, chargeSeatTempsC=[{},{},{},{},{},{},{},{}]", deviceSn, resetCount, insulationVal, carSpd, gpv, rtp1, rtp2, rtp3, rtp4, rtp5, rtp6, rtp7, rtn1, rtn2, rtn3, rtn4, realSocMax, realSocMin, chgBs1Tmp, chgBs2Tmp, chgBs3Tmp, chgBs4Tmp, chgBs5Tmp, chgBs6Tmp, chgBs7Tmp, chgBs8Tmp);
|
||||
int runSts = message[startIndex + (704 - 530)] & 0xFF; // 行车阶段
|
||||
int runPwrSts = message[startIndex + (705 - 530)] & 0xFF; // 行车上电阶段
|
||||
int tChgCp = message[startIndex + (706 - 530)] & 0xFF; // 慢充CP值
|
||||
int tChgR = message[startIndex + (707 - 530)] & 0xFF; // 慢充枪阻值
|
||||
int tChgSts = message[startIndex + (708 - 530)] & 0xFF; // 慢充阶段
|
||||
int fChgSts2 = message[startIndex + (709 - 530)] & 0xFF; // 快充阶段
|
||||
int chgSts = message[startIndex + (710 - 530)] & 0xFF; // 充电阶段
|
||||
long chgTime = ((message[startIndex + (711 - 530)] & 0xFF) << 8) | (message[startIndex + (712 - 530)] & 0xFF); // 充电时长(min)
|
||||
long mileage = ((message[startIndex + (713 - 530)] & 0xFFL) << 24) | ((message[startIndex + (714 - 530)] & 0xFFL) << 16) | ((message[startIndex + (715 - 530)] & 0xFFL) << 8) | (message[startIndex + (716 - 530)] & 0xFFL); // 里程(u32)
|
||||
BmsChargeDetail bmsChargeDetail = new BmsChargeDetail();
|
||||
bmsChargeDetail.setDeviceId(deviceSn);
|
||||
bmsChargeDetail.setTimestamp(frameTime);
|
||||
bmsChargeDetail.setAcChargeCurrent(BigDecimal.valueOf(tChgCur));
|
||||
bmsChargeDetail.setAcChargeVoltage(BigDecimal.valueOf(tChgVol));
|
||||
bmsChargeDetail.setDcChargeCurrent(BigDecimal.valueOf(fChgCur));
|
||||
bmsChargeDetail.setDcChargeVoltage(BigDecimal.valueOf(fChgVol));
|
||||
bmsChargeDetail.setChargeTime(chgTime);
|
||||
bmsChargeDetail.setAcStopCode(acStopCode);
|
||||
bmsChargeDetail.setDcStopCode(dcStopCode);
|
||||
bmsChargeDetail.setAcCpValue(tChgCp);
|
||||
bmsChargeDetail.setAcGunResistance(tChgR);
|
||||
bmsChargeDetail.setChargingStage(chgSts);
|
||||
bmsChargeDetail.setAcStage(tChgSts);
|
||||
bmsChargeDetail.setDcStage(fChgSts2);
|
||||
bmsChargeDetail.setCreateTime(new Date());
|
||||
bmsChargeDetail.setCreateBy(deviceSn);
|
||||
bmsChargeDetailService.insertBmsChargeDetail(bmsChargeDetail);
|
||||
|
||||
BmsRuntimeData rd = new BmsRuntimeData();
|
||||
rd.setDeviceId(deviceSn);
|
||||
rd.setTimestap(frameTime);
|
||||
rd.setVehicleSpeed(BigDecimal.valueOf(carSpd));
|
||||
rd.setMileage(mileage);
|
||||
rd.setSystemVoltage(BigDecimal.valueOf(sysVol));
|
||||
rd.setSystemCurrent(BigDecimal.valueOf(sysCur));
|
||||
rd.setInsulationResistance((long) insulationVal);
|
||||
rd.setSocMax(BigDecimal.valueOf(realSocMax));
|
||||
rd.setSocMin(BigDecimal.valueOf(realSocMin));
|
||||
rd.setGpvVoltage(BigDecimal.valueOf(gpv));
|
||||
rd.setRunStatus(runSts);
|
||||
rd.setPowerStatus(runPwrSts);
|
||||
rd.setCreateTime(new Date());
|
||||
rd.setCreateBy(deviceSn);
|
||||
bmsRuntimeDataService.insertBmsRuntimeData(rd);
|
||||
|
||||
BmsSopData sop = new BmsSopData();
|
||||
sop.setDeviceId(deviceSn);
|
||||
sop.setTimestap(frameTime);
|
||||
sop.setDischargeSop10s(disSop10);
|
||||
sop.setDischargeSop30s(disSop30);
|
||||
sop.setDischargeSop60s(disSop60);
|
||||
sop.setDischargeSopContinuous(disSopCont);
|
||||
sop.setRegenSop10s(regSop10);
|
||||
sop.setRegenSop30s(regSop30);
|
||||
sop.setRegenSop60s(regSop60);
|
||||
sop.setRegenSopContinuous(regSopCont);
|
||||
sop.setChargeSop(chargeSop);
|
||||
sop.setAcChargeSop(acChargeSop);
|
||||
sop.setCreateTime(new Date());
|
||||
sop.setCreateBy(deviceSn);
|
||||
bmsSopDataService.insertBmsSopData(sop);
|
||||
|
||||
BmsSystemStatus ss = new BmsSystemStatus();
|
||||
ss.setDeviceId(deviceSn);
|
||||
ss.setTimestap(frameTime);
|
||||
ss.setRelayStatus((long) relayStatus);
|
||||
ss.setOnaaccStatus((long) onaaccStatus);
|
||||
ss.setResetCount(resetCount);
|
||||
ss.setCycleCount((long) cycleCount);
|
||||
ss.setSample25v(BigDecimal.valueOf(samp25v));
|
||||
ss.setSample5v(BigDecimal.valueOf(samp5v));
|
||||
/*ss.setCellCount(cellCount);
|
||||
ss.setTempSensorCount(tempSensorCount);*/
|
||||
ss.setCreateTime(new Date());
|
||||
ss.setCreateBy(deviceSn);
|
||||
bmsSystemStatusService.insertBmsSystemStatus(ss);
|
||||
|
||||
int[] chargeTemps = {chgBs1Tmp, chgBs2Tmp, chgBs3Tmp, chgBs4Tmp, chgBs5Tmp, chgBs6Tmp, chgBs7Tmp, chgBs8Tmp};
|
||||
List<BmsChargeTemperature> chargeTempsList = new ArrayList<>();
|
||||
for (int i = 0; i < chargeTemps.length; i++) {
|
||||
BmsChargeTemperature ct = new BmsChargeTemperature();
|
||||
ct.setDeviceId(deviceSn);
|
||||
ct.setTimestap(frameTime);
|
||||
ct.setTempIndex(i + 1);
|
||||
ct.setTemperature(BigDecimal.valueOf(chargeTemps[i]));
|
||||
ct.setCreateTime(new Date());
|
||||
ct.setCreateBy(deviceSn);
|
||||
chargeTempsList.add(ct);
|
||||
}
|
||||
bmsChargeTemperatureService.saveBatch(chargeTempsList);
|
||||
|
||||
double[] rtpVals = {rtp1, rtp2, rtp3, rtp4, rtp5, rtp6, rtp7};
|
||||
List<BmsVoltageChannelData> channels = new ArrayList<>();
|
||||
for (int i = 0; i < rtpVals.length; i++) {
|
||||
BmsVoltageChannelData ch = new BmsVoltageChannelData();
|
||||
ch.setDeviceId(deviceSn);
|
||||
ch.setTimestap(frameTime);
|
||||
ch.setChannelType("RTP");
|
||||
ch.setChannelIndex(i + 1);
|
||||
ch.setVoltage(BigDecimal.valueOf(rtpVals[i]));
|
||||
ch.setCreateTime(new Date());
|
||||
ch.setCreateBy(deviceSn);
|
||||
channels.add(ch);
|
||||
}
|
||||
if (!channels.isEmpty()) {
|
||||
bmsVoltageChannelDataService.saveBatch(channels);
|
||||
}
|
||||
|
||||
log.info("设备 {} 充电详情: tChgCurA={}, tChgVolV={}, fChgCurA={}, fChgVolV={}, disSOP(A)=[{},{},{},{}], regSOP(A)=[{},{},{},{}], disSopTolA={}, regSopTolA={}", deviceSn, tChgCur, tChgVol, fChgCur, fChgVol, disSop10, disSop30, disSop60, disSopCont, regSop10, regSop30, regSop60, regSopCont, disSopTol, regSopTol);
|
||||
log.info("设备 {} 版本与编码: hwVer={}, swVer={}, BMSCode='{}', VIN='{}', clientCode='{}', devId={}", deviceSn, hwVer, swVer, bmsCode, vin, clientCode, devId);
|
||||
log.info("设备 {} 系统状态: sysVolV={}, sysCurA={}, cellCount={}, tempSensorCount={}, relayStatus={}, onaaccStatus={}, acStopCode={}, dcStopCode={}, cycleCount={}, samp25V={}, samp5V={}, chargeSopA={}, acChargeSopA={}", deviceSn, sysVol, sysCur, cellCount, tempSensorCount, relayStatus, onaaccStatus, acStopCode, dcStopCode, cycleCount, samp25v, samp5v, chargeSop, acChargeSop);
|
||||
@ -1048,6 +1130,7 @@ public class MqttService {
|
||||
|
||||
/**
|
||||
* 读取 ASCII 字符串
|
||||
*
|
||||
* @param startAbs BatteryData 绝对索引(例如 602 对应 BMS编码起始)
|
||||
* @param len 字节长度
|
||||
* @param base 530 的映射起点(message 中的 startIndex)
|
||||
|
||||
@ -1,18 +1,97 @@
|
||||
package com.evobms.project.bms.service.impl;
|
||||
|
||||
import com.evobms.project.bms.domain.BmsChargeDetail;
|
||||
import com.evobms.project.bms.mapper.BmsChargeDetailMapper;
|
||||
import com.evobms.project.bms.service.IBmsChargeDetailService;
|
||||
import java.util.List;
|
||||
import com.evobms.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.evobms.project.bms.mapper.BmsChargeDetailMapper;
|
||||
import com.evobms.project.bms.domain.BmsChargeDetail;
|
||||
import com.evobms.project.bms.service.IBmsChargeDetailService;
|
||||
|
||||
/**
|
||||
* BMS充电过程详细数据Service业务层处理
|
||||
*
|
||||
* @author tzy
|
||||
* @date 2026-02-23
|
||||
*/
|
||||
@Service
|
||||
public class BmsChargeDetailServiceImpl implements IBmsChargeDetailService {
|
||||
public class BmsChargeDetailServiceImpl extends ServiceImpl<BmsChargeDetailMapper, BmsChargeDetail> implements IBmsChargeDetailService
|
||||
{
|
||||
@Autowired
|
||||
private BmsChargeDetailMapper mapper;
|
||||
private BmsChargeDetailMapper bmsChargeDetailMapper;
|
||||
|
||||
/**
|
||||
* 查询BMS充电过程详细数据
|
||||
*
|
||||
* @param id BMS充电过程详细数据主键
|
||||
* @return BMS充电过程详细数据
|
||||
*/
|
||||
@Override
|
||||
public int insertBmsChargeDetail(BmsChargeDetail data) {
|
||||
return mapper.insertBmsChargeDetail(data);
|
||||
public BmsChargeDetail selectBmsChargeDetailById(Long id)
|
||||
{
|
||||
return bmsChargeDetailMapper.selectBmsChargeDetailById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询BMS充电过程详细数据列表
|
||||
*
|
||||
* @param bmsChargeDetail BMS充电过程详细数据
|
||||
* @return BMS充电过程详细数据
|
||||
*/
|
||||
@Override
|
||||
public List<BmsChargeDetail> selectBmsChargeDetailList(BmsChargeDetail bmsChargeDetail)
|
||||
{
|
||||
return bmsChargeDetailMapper.selectBmsChargeDetailList(bmsChargeDetail);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增BMS充电过程详细数据
|
||||
*
|
||||
* @param bmsChargeDetail BMS充电过程详细数据
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBmsChargeDetail(BmsChargeDetail bmsChargeDetail)
|
||||
{
|
||||
bmsChargeDetail.setCreateTime(DateUtils.getNowDate());
|
||||
return bmsChargeDetailMapper.insertBmsChargeDetail(bmsChargeDetail);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改BMS充电过程详细数据
|
||||
*
|
||||
* @param bmsChargeDetail BMS充电过程详细数据
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBmsChargeDetail(BmsChargeDetail bmsChargeDetail)
|
||||
{
|
||||
bmsChargeDetail.setUpdateTime(DateUtils.getNowDate());
|
||||
return bmsChargeDetailMapper.updateBmsChargeDetail(bmsChargeDetail);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除BMS充电过程详细数据
|
||||
*
|
||||
* @param ids 需要删除的BMS充电过程详细数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBmsChargeDetailByIds(Long[] ids)
|
||||
{
|
||||
return bmsChargeDetailMapper.deleteBmsChargeDetailByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除BMS充电过程详细数据信息
|
||||
*
|
||||
* @param id BMS充电过程详细数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBmsChargeDetailById(Long id)
|
||||
{
|
||||
return bmsChargeDetailMapper.deleteBmsChargeDetailById(id);
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,97 @@
|
||||
package com.evobms.project.bms.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.evobms.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.evobms.project.bms.mapper.BmsChargeTemperatureMapper;
|
||||
import com.evobms.project.bms.domain.BmsChargeTemperature;
|
||||
import com.evobms.project.bms.service.IBmsChargeTemperatureService;
|
||||
|
||||
/**
|
||||
* BMS充电座温度数据Service业务层处理
|
||||
*
|
||||
* @author tzy
|
||||
* @date 2026-02-23
|
||||
*/
|
||||
@Service
|
||||
public class BmsChargeTemperatureServiceImpl extends ServiceImpl<BmsChargeTemperatureMapper, BmsChargeTemperature> implements IBmsChargeTemperatureService
|
||||
{
|
||||
@Autowired
|
||||
private BmsChargeTemperatureMapper bmsChargeTemperatureMapper;
|
||||
|
||||
/**
|
||||
* 查询BMS充电座温度数据
|
||||
*
|
||||
* @param id BMS充电座温度数据主键
|
||||
* @return BMS充电座温度数据
|
||||
*/
|
||||
@Override
|
||||
public BmsChargeTemperature selectBmsChargeTemperatureById(Long id)
|
||||
{
|
||||
return bmsChargeTemperatureMapper.selectBmsChargeTemperatureById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询BMS充电座温度数据列表
|
||||
*
|
||||
* @param bmsChargeTemperature BMS充电座温度数据
|
||||
* @return BMS充电座温度数据
|
||||
*/
|
||||
@Override
|
||||
public List<BmsChargeTemperature> selectBmsChargeTemperatureList(BmsChargeTemperature bmsChargeTemperature)
|
||||
{
|
||||
return bmsChargeTemperatureMapper.selectBmsChargeTemperatureList(bmsChargeTemperature);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增BMS充电座温度数据
|
||||
*
|
||||
* @param bmsChargeTemperature BMS充电座温度数据
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBmsChargeTemperature(BmsChargeTemperature bmsChargeTemperature)
|
||||
{
|
||||
bmsChargeTemperature.setCreateTime(DateUtils.getNowDate());
|
||||
return bmsChargeTemperatureMapper.insertBmsChargeTemperature(bmsChargeTemperature);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改BMS充电座温度数据
|
||||
*
|
||||
* @param bmsChargeTemperature BMS充电座温度数据
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBmsChargeTemperature(BmsChargeTemperature bmsChargeTemperature)
|
||||
{
|
||||
bmsChargeTemperature.setUpdateTime(DateUtils.getNowDate());
|
||||
return bmsChargeTemperatureMapper.updateBmsChargeTemperature(bmsChargeTemperature);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除BMS充电座温度数据
|
||||
*
|
||||
* @param ids 需要删除的BMS充电座温度数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBmsChargeTemperatureByIds(Long[] ids)
|
||||
{
|
||||
return bmsChargeTemperatureMapper.deleteBmsChargeTemperatureByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除BMS充电座温度数据信息
|
||||
*
|
||||
* @param id BMS充电座温度数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBmsChargeTemperatureById(Long id)
|
||||
{
|
||||
return bmsChargeTemperatureMapper.deleteBmsChargeTemperatureById(id);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,97 @@
|
||||
package com.evobms.project.bms.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.evobms.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.evobms.project.bms.mapper.BmsRuntimeDataMapper;
|
||||
import com.evobms.project.bms.domain.BmsRuntimeData;
|
||||
import com.evobms.project.bms.service.IBmsRuntimeDataService;
|
||||
|
||||
/**
|
||||
* BMS实时运行数据Service业务层处理
|
||||
*
|
||||
* @author tzy
|
||||
* @date 2026-02-23
|
||||
*/
|
||||
@Service
|
||||
public class BmsRuntimeDataServiceImpl extends ServiceImpl<BmsRuntimeDataMapper, BmsRuntimeData> implements IBmsRuntimeDataService
|
||||
{
|
||||
@Autowired
|
||||
private BmsRuntimeDataMapper bmsRuntimeDataMapper;
|
||||
|
||||
/**
|
||||
* 查询BMS实时运行数据
|
||||
*
|
||||
* @param id BMS实时运行数据主键
|
||||
* @return BMS实时运行数据
|
||||
*/
|
||||
@Override
|
||||
public BmsRuntimeData selectBmsRuntimeDataById(Long id)
|
||||
{
|
||||
return bmsRuntimeDataMapper.selectBmsRuntimeDataById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询BMS实时运行数据列表
|
||||
*
|
||||
* @param bmsRuntimeData BMS实时运行数据
|
||||
* @return BMS实时运行数据
|
||||
*/
|
||||
@Override
|
||||
public List<BmsRuntimeData> selectBmsRuntimeDataList(BmsRuntimeData bmsRuntimeData)
|
||||
{
|
||||
return bmsRuntimeDataMapper.selectBmsRuntimeDataList(bmsRuntimeData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增BMS实时运行数据
|
||||
*
|
||||
* @param bmsRuntimeData BMS实时运行数据
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBmsRuntimeData(BmsRuntimeData bmsRuntimeData)
|
||||
{
|
||||
bmsRuntimeData.setCreateTime(DateUtils.getNowDate());
|
||||
return bmsRuntimeDataMapper.insertBmsRuntimeData(bmsRuntimeData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改BMS实时运行数据
|
||||
*
|
||||
* @param bmsRuntimeData BMS实时运行数据
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBmsRuntimeData(BmsRuntimeData bmsRuntimeData)
|
||||
{
|
||||
bmsRuntimeData.setUpdateTime(DateUtils.getNowDate());
|
||||
return bmsRuntimeDataMapper.updateBmsRuntimeData(bmsRuntimeData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除BMS实时运行数据
|
||||
*
|
||||
* @param ids 需要删除的BMS实时运行数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBmsRuntimeDataByIds(Long[] ids)
|
||||
{
|
||||
return bmsRuntimeDataMapper.deleteBmsRuntimeDataByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除BMS实时运行数据信息
|
||||
*
|
||||
* @param id BMS实时运行数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBmsRuntimeDataById(Long id)
|
||||
{
|
||||
return bmsRuntimeDataMapper.deleteBmsRuntimeDataById(id);
|
||||
}
|
||||
}
|
||||
@ -1,18 +1,97 @@
|
||||
package com.evobms.project.bms.service.impl;
|
||||
|
||||
import com.evobms.project.bms.domain.BmsSopData;
|
||||
import com.evobms.project.bms.mapper.BmsSopDataMapper;
|
||||
import com.evobms.project.bms.service.IBmsSopDataService;
|
||||
import java.util.List;
|
||||
import com.evobms.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.evobms.project.bms.mapper.BmsSopDataMapper;
|
||||
import com.evobms.project.bms.domain.BmsSopData;
|
||||
import com.evobms.project.bms.service.IBmsSopDataService;
|
||||
|
||||
/**
|
||||
* BMS功率能力(SOP)数据Service业务层处理
|
||||
*
|
||||
* @author tzy
|
||||
* @date 2026-02-23
|
||||
*/
|
||||
@Service
|
||||
public class BmsSopDataServiceImpl implements IBmsSopDataService {
|
||||
public class BmsSopDataServiceImpl extends ServiceImpl<BmsSopDataMapper, BmsSopData> implements IBmsSopDataService
|
||||
{
|
||||
@Autowired
|
||||
private BmsSopDataMapper mapper;
|
||||
private BmsSopDataMapper bmsSopDataMapper;
|
||||
|
||||
/**
|
||||
* 查询BMS功率能力(SOP)数据
|
||||
*
|
||||
* @param id BMS功率能力(SOP)数据主键
|
||||
* @return BMS功率能力(SOP)数据
|
||||
*/
|
||||
@Override
|
||||
public int insertBmsSopData(BmsSopData data) {
|
||||
return mapper.insertBmsSopData(data);
|
||||
public BmsSopData selectBmsSopDataById(Long id)
|
||||
{
|
||||
return bmsSopDataMapper.selectBmsSopDataById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询BMS功率能力(SOP)数据列表
|
||||
*
|
||||
* @param bmsSopData BMS功率能力(SOP)数据
|
||||
* @return BMS功率能力(SOP)数据
|
||||
*/
|
||||
@Override
|
||||
public List<BmsSopData> selectBmsSopDataList(BmsSopData bmsSopData)
|
||||
{
|
||||
return bmsSopDataMapper.selectBmsSopDataList(bmsSopData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增BMS功率能力(SOP)数据
|
||||
*
|
||||
* @param bmsSopData BMS功率能力(SOP)数据
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBmsSopData(BmsSopData bmsSopData)
|
||||
{
|
||||
bmsSopData.setCreateTime(DateUtils.getNowDate());
|
||||
return bmsSopDataMapper.insertBmsSopData(bmsSopData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改BMS功率能力(SOP)数据
|
||||
*
|
||||
* @param bmsSopData BMS功率能力(SOP)数据
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBmsSopData(BmsSopData bmsSopData)
|
||||
{
|
||||
bmsSopData.setUpdateTime(DateUtils.getNowDate());
|
||||
return bmsSopDataMapper.updateBmsSopData(bmsSopData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除BMS功率能力(SOP)数据
|
||||
*
|
||||
* @param ids 需要删除的BMS功率能力(SOP)数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBmsSopDataByIds(Long[] ids)
|
||||
{
|
||||
return bmsSopDataMapper.deleteBmsSopDataByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除BMS功率能力(SOP)数据信息
|
||||
*
|
||||
* @param id BMS功率能力(SOP)数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBmsSopDataById(Long id)
|
||||
{
|
||||
return bmsSopDataMapper.deleteBmsSopDataById(id);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,18 +1,97 @@
|
||||
package com.evobms.project.bms.service.impl;
|
||||
|
||||
import com.evobms.project.bms.domain.BmsSystemStatus;
|
||||
import com.evobms.project.bms.mapper.BmsSystemStatusMapper;
|
||||
import com.evobms.project.bms.service.IBmsSystemStatusService;
|
||||
import java.util.List;
|
||||
import com.evobms.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.evobms.project.bms.mapper.BmsSystemStatusMapper;
|
||||
import com.evobms.project.bms.domain.BmsSystemStatus;
|
||||
import com.evobms.project.bms.service.IBmsSystemStatusService;
|
||||
|
||||
/**
|
||||
* BMS系统状态数据Service业务层处理
|
||||
*
|
||||
* @author tzy
|
||||
* @date 2026-02-23
|
||||
*/
|
||||
@Service
|
||||
public class BmsSystemStatusServiceImpl implements IBmsSystemStatusService {
|
||||
public class BmsSystemStatusServiceImpl extends ServiceImpl<BmsSystemStatusMapper, BmsSystemStatus> implements IBmsSystemStatusService
|
||||
{
|
||||
@Autowired
|
||||
private BmsSystemStatusMapper mapper;
|
||||
private BmsSystemStatusMapper bmsSystemStatusMapper;
|
||||
|
||||
/**
|
||||
* 查询BMS系统状态数据
|
||||
*
|
||||
* @param id BMS系统状态数据主键
|
||||
* @return BMS系统状态数据
|
||||
*/
|
||||
@Override
|
||||
public int insertBmsSystemStatus(BmsSystemStatus data) {
|
||||
return mapper.insertBmsSystemStatus(data);
|
||||
public BmsSystemStatus selectBmsSystemStatusById(Long id)
|
||||
{
|
||||
return bmsSystemStatusMapper.selectBmsSystemStatusById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询BMS系统状态数据列表
|
||||
*
|
||||
* @param bmsSystemStatus BMS系统状态数据
|
||||
* @return BMS系统状态数据
|
||||
*/
|
||||
@Override
|
||||
public List<BmsSystemStatus> selectBmsSystemStatusList(BmsSystemStatus bmsSystemStatus)
|
||||
{
|
||||
return bmsSystemStatusMapper.selectBmsSystemStatusList(bmsSystemStatus);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增BMS系统状态数据
|
||||
*
|
||||
* @param bmsSystemStatus BMS系统状态数据
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBmsSystemStatus(BmsSystemStatus bmsSystemStatus)
|
||||
{
|
||||
bmsSystemStatus.setCreateTime(DateUtils.getNowDate());
|
||||
return bmsSystemStatusMapper.insertBmsSystemStatus(bmsSystemStatus);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改BMS系统状态数据
|
||||
*
|
||||
* @param bmsSystemStatus BMS系统状态数据
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBmsSystemStatus(BmsSystemStatus bmsSystemStatus)
|
||||
{
|
||||
bmsSystemStatus.setUpdateTime(DateUtils.getNowDate());
|
||||
return bmsSystemStatusMapper.updateBmsSystemStatus(bmsSystemStatus);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除BMS系统状态数据
|
||||
*
|
||||
* @param ids 需要删除的BMS系统状态数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBmsSystemStatusByIds(Long[] ids)
|
||||
{
|
||||
return bmsSystemStatusMapper.deleteBmsSystemStatusByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除BMS系统状态数据信息
|
||||
*
|
||||
* @param id BMS系统状态数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBmsSystemStatusById(Long id)
|
||||
{
|
||||
return bmsSystemStatusMapper.deleteBmsSystemStatusById(id);
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,97 @@
|
||||
package com.evobms.project.bms.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.evobms.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.evobms.project.bms.mapper.BmsVoltageChannelDataMapper;
|
||||
import com.evobms.project.bms.domain.BmsVoltageChannelData;
|
||||
import com.evobms.project.bms.service.IBmsVoltageChannelDataService;
|
||||
|
||||
/**
|
||||
* BMS电压通道数据Service业务层处理
|
||||
*
|
||||
* @author tzy
|
||||
* @date 2026-02-23
|
||||
*/
|
||||
@Service
|
||||
public class BmsVoltageChannelDataServiceImpl extends ServiceImpl<BmsVoltageChannelDataMapper, BmsVoltageChannelData> implements IBmsVoltageChannelDataService
|
||||
{
|
||||
@Autowired
|
||||
private BmsVoltageChannelDataMapper bmsVoltageChannelDataMapper;
|
||||
|
||||
/**
|
||||
* 查询BMS电压通道数据
|
||||
*
|
||||
* @param id BMS电压通道数据主键
|
||||
* @return BMS电压通道数据
|
||||
*/
|
||||
@Override
|
||||
public BmsVoltageChannelData selectBmsVoltageChannelDataById(Long id)
|
||||
{
|
||||
return bmsVoltageChannelDataMapper.selectBmsVoltageChannelDataById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询BMS电压通道数据列表
|
||||
*
|
||||
* @param bmsVoltageChannelData BMS电压通道数据
|
||||
* @return BMS电压通道数据
|
||||
*/
|
||||
@Override
|
||||
public List<BmsVoltageChannelData> selectBmsVoltageChannelDataList(BmsVoltageChannelData bmsVoltageChannelData)
|
||||
{
|
||||
return bmsVoltageChannelDataMapper.selectBmsVoltageChannelDataList(bmsVoltageChannelData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增BMS电压通道数据
|
||||
*
|
||||
* @param bmsVoltageChannelData BMS电压通道数据
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBmsVoltageChannelData(BmsVoltageChannelData bmsVoltageChannelData)
|
||||
{
|
||||
bmsVoltageChannelData.setCreateTime(DateUtils.getNowDate());
|
||||
return bmsVoltageChannelDataMapper.insertBmsVoltageChannelData(bmsVoltageChannelData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改BMS电压通道数据
|
||||
*
|
||||
* @param bmsVoltageChannelData BMS电压通道数据
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBmsVoltageChannelData(BmsVoltageChannelData bmsVoltageChannelData)
|
||||
{
|
||||
bmsVoltageChannelData.setUpdateTime(DateUtils.getNowDate());
|
||||
return bmsVoltageChannelDataMapper.updateBmsVoltageChannelData(bmsVoltageChannelData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除BMS电压通道数据
|
||||
*
|
||||
* @param ids 需要删除的BMS电压通道数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBmsVoltageChannelDataByIds(Long[] ids)
|
||||
{
|
||||
return bmsVoltageChannelDataMapper.deleteBmsVoltageChannelDataByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除BMS电压通道数据信息
|
||||
*
|
||||
* @param id BMS电压通道数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBmsVoltageChannelDataById(Long id)
|
||||
{
|
||||
return bmsVoltageChannelDataMapper.deleteBmsVoltageChannelDataById(id);
|
||||
}
|
||||
}
|
||||
@ -22,6 +22,24 @@ import com.evobms.common.utils.poi.ExcelUtil;
|
||||
import com.evobms.framework.web.page.TableDataInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.evobms.project.vehicledata.dto.DeviceRealtimeDTO;
|
||||
import com.evobms.project.vehicledata.dto.NameValueDTO;
|
||||
import com.evobms.project.vehicledata.dto.DeviceRealtimeDTO.SystemStatusSection;
|
||||
import com.evobms.project.vehicledata.dto.DeviceRealtimeDTO.RunStatusSection;
|
||||
import com.evobms.project.vehicledata.dto.DeviceRealtimeDTO.ChargeSection;
|
||||
import com.evobms.project.vehicledata.dto.DeviceRealtimeDTO.StatisticsSection;
|
||||
import com.evobms.project.vehicledata.dto.LineSeriesDTO;
|
||||
import com.evobms.project.vehicledata.dto.TimePointDTO;
|
||||
import com.evobms.project.vehicledata.service.IVehicleDataService;
|
||||
import com.evobms.project.vehicledata.domain.VehicleData;
|
||||
import com.evobms.project.battery.service.IExtremeValuesService;
|
||||
import com.evobms.project.battery.domain.ExtremeValues;
|
||||
import com.evobms.project.bms.service.*;
|
||||
import com.evobms.project.bms.domain.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* BBOX管理Controller
|
||||
@ -75,6 +93,167 @@ public class BmsDevicesController extends BaseController
|
||||
return success(bmsDevicesService.selectBmsDevicesById(id));
|
||||
}
|
||||
|
||||
@Autowired private IVehicleDataService vehicleDataService;
|
||||
@Autowired private IExtremeValuesService extremeValuesService;
|
||||
@Autowired private IBmsSystemStatusService bmsSystemStatusService;
|
||||
@Autowired private IBmsChargeDetailService bmsChargeDetailService;
|
||||
@Autowired private IBmsChargeTemperatureService bmsChargeTemperatureService;
|
||||
@Autowired private IBmsVoltageChannelDataService bmsVoltageChannelDataService;
|
||||
@Autowired private IBmsSopDataService bmsSopDataService;
|
||||
|
||||
@GetMapping("/realtime/{deviceId}")
|
||||
@ApiOperation("设备实时数据")
|
||||
public AjaxResult realtime(@PathVariable("deviceId") String deviceId) {
|
||||
DeviceRealtimeDTO dto = new DeviceRealtimeDTO();
|
||||
dto.setDeviceId(deviceId);
|
||||
VehicleData vd = vehicleDataService.selectLatestByDeviceId(deviceId);
|
||||
ExtremeValues ev = extremeValuesService.selectLatestByDeviceId(deviceId);
|
||||
SystemStatusSection sys = new SystemStatusSection();
|
||||
if (vd != null) {
|
||||
sys.setTotalVoltage(vd.getTotalVoltage());
|
||||
sys.setTotalCurrent(vd.getTotalCurrent());
|
||||
sys.setSoc(vd.getSoc());
|
||||
}
|
||||
if (ev != null) {
|
||||
sys.setMaxCellVoltage(ev.getMaxVoltageValue());
|
||||
sys.setMaxCellPos(ev.getMaxVoltageSubsystemNo() == null || ev.getMaxVoltageBatteryNo() == null ? null :
|
||||
ev.getMaxVoltageSubsystemNo() + "-" + ev.getMaxVoltageBatteryNo());
|
||||
sys.setMinCellVoltage(ev.getMinVoltageValue());
|
||||
sys.setMinCellPos(ev.getMinVoltageSubsystemNo() == null || ev.getMinVoltageBatteryNo() == null ? null :
|
||||
ev.getMinVoltageSubsystemNo() + "-" + ev.getMinVoltageBatteryNo());
|
||||
sys.setMaxTemp(ev.getMaxTempValue());
|
||||
sys.setMaxTempPos(ev.getMaxTempSubsystemNo() == null || ev.getMaxTempProbeNo() == null ? null :
|
||||
ev.getMaxTempSubsystemNo() + "-" + ev.getMaxTempProbeNo());
|
||||
sys.setMinTemp(ev.getMinTempValue());
|
||||
sys.setMinTempPos(ev.getMinTempSubsystemNo() == null || ev.getMinTempProbeNo() == null ? null :
|
||||
ev.getMinTempSubsystemNo() + "-" + ev.getMinTempProbeNo());
|
||||
}
|
||||
dto.setSystemStatus(sys);
|
||||
|
||||
RunStatusSection run = new RunStatusSection();
|
||||
if (vd != null) {
|
||||
run.setChargingStatus(vd.getChargingStatus());
|
||||
}
|
||||
BmsSystemStatus ss = bmsSystemStatusService.lambdaQuery()
|
||||
.eq(BmsSystemStatus::getDeviceId, deviceId)
|
||||
.orderByDesc(BmsSystemStatus::getCreateTime).last("limit 1").one();
|
||||
if (ss != null) {
|
||||
run.setRelayStatus(ss.getRelayStatus());
|
||||
run.setOnaaccStatus(ss.getOnaaccStatus());
|
||||
run.setResetCount(ss.getResetCount());
|
||||
run.setCycleCount(ss.getCycleCount());
|
||||
run.setSample25v(ss.getSample25v());
|
||||
run.setSample5v(ss.getSample5v());
|
||||
}
|
||||
dto.setRunStatus(run);
|
||||
|
||||
ChargeSection chg = new ChargeSection();
|
||||
BmsChargeDetail cd = bmsChargeDetailService.lambdaQuery()
|
||||
.eq(BmsChargeDetail::getDeviceId, deviceId)
|
||||
.orderByDesc(BmsChargeDetail::getCreateTime).last("limit 1").one();
|
||||
if (cd != null) {
|
||||
chg.setAcChargeCurrent(cd.getAcChargeCurrent());
|
||||
chg.setAcChargeVoltage(cd.getAcChargeVoltage());
|
||||
chg.setDcChargeCurrent(cd.getDcChargeCurrent());
|
||||
chg.setDcChargeVoltage(cd.getDcChargeVoltage());
|
||||
chg.setChargeTime(cd.getChargeTime());
|
||||
chg.setAcStopCode(cd.getAcStopCode());
|
||||
chg.setDcStopCode(cd.getDcStopCode());
|
||||
chg.setAcCpValue(cd.getAcCpValue());
|
||||
chg.setAcGunResistance(cd.getAcGunResistance());
|
||||
chg.setChargingStage(cd.getChargingStage());
|
||||
chg.setAcStage(cd.getAcStage());
|
||||
chg.setDcStage(cd.getDcStage());
|
||||
}
|
||||
dto.setCharge(chg);
|
||||
|
||||
StatisticsSection stat = new StatisticsSection();
|
||||
if (ss != null) {
|
||||
stat.setCycleCount(ss.getCycleCount());
|
||||
}
|
||||
stat.setTotalRunHours(0L);
|
||||
stat.setTotalChargeHours(0L);
|
||||
stat.setTotalDischargeHours(0L);
|
||||
dto.setStatistics(stat);
|
||||
|
||||
List<BmsChargeTemperature> temps = bmsChargeTemperatureService.lambdaQuery()
|
||||
.eq(BmsChargeTemperature::getDeviceId, deviceId)
|
||||
.orderByDesc(BmsChargeTemperature::getCreateTime).last("limit 8").list();
|
||||
List<NameValueDTO> tempItems = new ArrayList<>();
|
||||
if (temps != null) {
|
||||
String ts = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
|
||||
for (BmsChargeTemperature t : temps) {
|
||||
NameValueDTO nv = new NameValueDTO();
|
||||
nv.setName("T" + t.getTempIndex());
|
||||
nv.setValue(t.getTemperature() == null ? 0 : t.getTemperature().longValue());
|
||||
nv.setCreateTime(ts);
|
||||
tempItems.add(nv);
|
||||
}
|
||||
}
|
||||
dto.setTemperatures(tempItems);
|
||||
|
||||
List<BmsVoltageChannelData> chs = bmsVoltageChannelDataService.lambdaQuery()
|
||||
.eq(BmsVoltageChannelData::getDeviceId, deviceId)
|
||||
.orderByDesc(BmsVoltageChannelData::getCreateTime).last("limit 16").list();
|
||||
List<NameValueDTO> voltItems = new ArrayList<>();
|
||||
if (chs != null) {
|
||||
String ts = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
|
||||
for (BmsVoltageChannelData c : chs) {
|
||||
NameValueDTO nv = new NameValueDTO();
|
||||
nv.setName((c.getChannelType() == null ? "CH" : c.getChannelType()) + "-" + c.getChannelIndex());
|
||||
nv.setValue(c.getVoltage() == null ? 0 : c.getVoltage().longValue());
|
||||
nv.setCreateTime(ts);
|
||||
voltItems.add(nv);
|
||||
}
|
||||
}
|
||||
dto.setVoltages(voltItems);
|
||||
|
||||
dto.setFaults(new ArrayList<>());
|
||||
// 折线图:最近24小时(按createTime过滤),默认RTP-1与T1
|
||||
Date now = new Date();
|
||||
Date begin = new Date(now.getTime() - 24L * 3600_000L);
|
||||
List<BmsVoltageChannelData> vtrend = bmsVoltageChannelDataService.lambdaQuery()
|
||||
.eq(BmsVoltageChannelData::getDeviceId, deviceId)
|
||||
.eq(BmsVoltageChannelData::getChannelType, "RTP")
|
||||
.eq(BmsVoltageChannelData::getChannelIndex, 1)
|
||||
.ge(BmsVoltageChannelData::getCreateTime, begin)
|
||||
.le(BmsVoltageChannelData::getCreateTime, now)
|
||||
.orderByAsc(BmsVoltageChannelData::getCreateTime)
|
||||
.list();
|
||||
java.text.SimpleDateFormat f = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
List<TimePointDTO> vpoints = new ArrayList<>();
|
||||
for (BmsVoltageChannelData it : vtrend) {
|
||||
TimePointDTO p = new TimePointDTO();
|
||||
p.setTime(it.getCreateTime() == null ? null : f.format(it.getCreateTime()));
|
||||
p.setValue(it.getVoltage());
|
||||
vpoints.add(p);
|
||||
}
|
||||
LineSeriesDTO vseries = new LineSeriesDTO();
|
||||
vseries.setName("RTP-1");
|
||||
vseries.setPoints(vpoints);
|
||||
dto.setVoltageTrend(java.util.Collections.singletonList(vseries));
|
||||
|
||||
List<BmsChargeTemperature> ttrend = bmsChargeTemperatureService.lambdaQuery()
|
||||
.eq(BmsChargeTemperature::getDeviceId, deviceId)
|
||||
.eq(BmsChargeTemperature::getTempIndex, 1)
|
||||
.ge(BmsChargeTemperature::getCreateTime, begin)
|
||||
.le(BmsChargeTemperature::getCreateTime, now)
|
||||
.orderByAsc(BmsChargeTemperature::getCreateTime)
|
||||
.list();
|
||||
List<TimePointDTO> tpoints = new ArrayList<>();
|
||||
for (BmsChargeTemperature it : ttrend) {
|
||||
TimePointDTO p = new TimePointDTO();
|
||||
p.setTime(it.getCreateTime() == null ? null : f.format(it.getCreateTime()));
|
||||
p.setValue(it.getTemperature());
|
||||
tpoints.add(p);
|
||||
}
|
||||
LineSeriesDTO tseries = new LineSeriesDTO();
|
||||
tseries.setName("T1");
|
||||
tseries.setPoints(tpoints);
|
||||
dto.setTemperatureTrend(java.util.Collections.singletonList(tseries));
|
||||
return success(dto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增BBOX管理
|
||||
*/
|
||||
|
||||
@ -1,43 +1,46 @@
|
||||
package com.evobms.project.vehicledata.controller;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.evobms.framework.web.domain.R;
|
||||
import com.evobms.project.battery.domain.ExtremeValues;
|
||||
import com.evobms.project.battery.domain.SubsystemTemperature;
|
||||
import com.evobms.project.battery.domain.SubsystemVoltage;
|
||||
import com.evobms.project.battery.service.IExtremeValuesService;
|
||||
import com.evobms.project.battery.service.ISubsystemTemperatureService;
|
||||
import com.evobms.project.battery.service.ISubsystemVoltageService;
|
||||
import com.evobms.project.system.domain.BmsDevices;
|
||||
import com.evobms.project.system.mapper.BmsDevicesMapper;
|
||||
import com.evobms.project.vehicledata.domain.HomeDashboardDTO;
|
||||
import org.apache.ibatis.annotations.Result;
|
||||
import com.evobms.project.vehicledata.domain.VehicleData;
|
||||
import com.evobms.project.vehicledata.domain.VehicleLocation;
|
||||
import com.evobms.project.vehicledata.dto.*;
|
||||
import com.evobms.project.vehicledata.service.IVehicleDataService;
|
||||
import com.evobms.project.vehicledata.service.IVehicleLocationService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.evobms.project.vehicledata.service.IVehicleDataService;
|
||||
import com.evobms.project.vehicledata.service.IVehicleLocationService;
|
||||
import com.evobms.project.vehicledata.domain.VehicleData;
|
||||
import com.evobms.project.vehicledata.domain.VehicleLocation;
|
||||
import com.evobms.project.vehicledata.dto.ChartDataPoint;
|
||||
import com.evobms.project.battery.service.ISubsystemVoltageService;
|
||||
import com.evobms.project.battery.service.ISubsystemTemperatureService;
|
||||
import com.evobms.project.battery.domain.SubsystemVoltage;
|
||||
import com.evobms.project.battery.domain.SubsystemTemperature;
|
||||
import com.evobms.project.battery.service.IExtremeValuesService;
|
||||
import com.evobms.project.battery.domain.ExtremeValues;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* 图标组件Controller
|
||||
* 首页数据Controller
|
||||
*
|
||||
* @author 田志阳
|
||||
* @date 2025-11-15
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "图表组件")
|
||||
@Api(tags = "首页数据统计")
|
||||
public class BatteryChartController {
|
||||
|
||||
@Autowired
|
||||
@ -55,45 +58,37 @@ public class BatteryChartController {
|
||||
@Autowired
|
||||
private IExtremeValuesService extremeValuesService;
|
||||
|
||||
@Autowired
|
||||
private BmsDevicesMapper bmsDevicesMapper;
|
||||
|
||||
// 图表数据:按最近 hours 小时返回整车电压/电流/SOC 的时间序列
|
||||
@GetMapping("/battery-data/{deviceId}/chart")
|
||||
@ApiOperation(value = "整车电压电流SOC时间序列", notes = "按最近hours小时返回时间序列")
|
||||
public List<ChartDataPoint> getChartData(
|
||||
@ApiParam(value = "设备ID", required = true) @PathVariable("deviceId") String deviceId,
|
||||
@ApiParam(value = "最近多少小时的数据", defaultValue = "24") @RequestParam(value = "hours", required = false, defaultValue = "24") int hours) {
|
||||
@ApiOperation(value = "-整车电压电流SOC时间序列", notes = "按最近hours小时返回时间序列")
|
||||
public List<ChartDataPoint> getChartData(@ApiParam(value = "设备ID", required = true) @PathVariable("deviceId") String deviceId, @ApiParam(value = "最近多少小时的数据", defaultValue = "24") @RequestParam(value = "hours", required = false, defaultValue = "24") int hours) {
|
||||
long millis = System.currentTimeMillis() - (long) hours * 3600_000L;
|
||||
Date startTime = new Date(millis);
|
||||
List<VehicleData> rows = vehicleDataService.selectByDeviceAndStartTime(deviceId, startTime);
|
||||
return rows.stream().map(v -> new ChartDataPoint(
|
||||
v.getTimestamp(),
|
||||
v.getTotalVoltage() == null ? 0 : v.getTotalVoltage().doubleValue(),
|
||||
v.getTotalCurrent() == null ? 0 : v.getTotalCurrent().doubleValue(),
|
||||
v.getSoc() == null ? 0 : v.getSoc()
|
||||
)).collect(Collectors.toList());
|
||||
return rows.stream().map(v -> new ChartDataPoint(v.getTimestamp(), v.getTotalVoltage() == null ? 0 : v.getTotalVoltage().doubleValue(), v.getTotalCurrent() == null ? 0 : v.getTotalCurrent().doubleValue(), v.getSoc() == null ? 0 : v.getSoc())).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
// 整车最新:返回 deviceId 最新的一条整车数据
|
||||
@GetMapping("/vehicle-data/{deviceId}/latest")
|
||||
@ApiOperation(value = "整车最新数据", notes = "返回指定设备最新整车数据")
|
||||
@ApiOperation(value = "-整车最新数据", notes = "返回指定设备最新整车数据")
|
||||
public VehicleData latestVehicleData(@ApiParam(value = "设备ID", required = true) @PathVariable("deviceId") String deviceId) {
|
||||
return vehicleDataService.selectLatestByDeviceId(deviceId);
|
||||
}
|
||||
|
||||
// 位置最新:返回 deviceId 最新的一条位置数据
|
||||
@GetMapping("/vehicle-location/{deviceId}/latest")
|
||||
@ApiOperation(value = "车辆最新位置", notes = "返回指定设备最新位置数据")
|
||||
@ApiOperation(value = "-车辆最新位置", notes = "返回指定设备最新位置数据")
|
||||
public VehicleLocation latestVehicleLocation(@ApiParam(value = "设备ID", required = true) @PathVariable("deviceId") String deviceId) {
|
||||
return vehicleLocationService.selectLatestByDeviceId(deviceId);
|
||||
}
|
||||
|
||||
// 位置轨迹:按时间范围返回位置列表,start/end 为毫秒时间戳,可选 limit 限制条数
|
||||
@GetMapping("/vehicle-location/{deviceId}")
|
||||
@ApiOperation(value = "车辆位置轨迹", notes = "按时间范围返回位置列表")
|
||||
public List<VehicleLocation> locationRange(
|
||||
@ApiParam(value = "设备ID", required = true) @PathVariable("deviceId") String deviceId,
|
||||
@ApiParam(value = "开始时间戳(毫秒)", required = true) @RequestParam("start") long startMillis,
|
||||
@ApiParam(value = "结束时间戳(毫秒)", required = true) @RequestParam("end") long endMillis,
|
||||
@ApiParam(value = "限制返回条数") @RequestParam(value = "limit", required = false) Integer limit) {
|
||||
@ApiOperation(value = "-车辆位置轨迹", notes = "按时间范围返回位置列表")
|
||||
public List<VehicleLocation> locationRange(@ApiParam(value = "设备ID", required = true) @PathVariable("deviceId") String deviceId, @ApiParam(value = "开始时间戳(毫秒)", required = true) @RequestParam("start") long startMillis, @ApiParam(value = "结束时间戳(毫秒)", required = true) @RequestParam("end") long endMillis, @ApiParam(value = "限制返回条数") @RequestParam(value = "limit", required = false) Integer limit) {
|
||||
Date start = new Date(startMillis);
|
||||
Date end = new Date(endMillis);
|
||||
return vehicleLocationService.selectByDeviceAndRange(deviceId, start, end, limit);
|
||||
@ -101,27 +96,21 @@ public class BatteryChartController {
|
||||
|
||||
// 子系统最新帧(电压):返回指定子系统号最新的一帧电压数据
|
||||
@GetMapping("/subsystem-voltage/{deviceId}/{subsystemNo}/latest")
|
||||
@ApiOperation(value = "子系统最新电压帧", notes = "返回指定子系统最新电压数据")
|
||||
public SubsystemVoltage latestVoltage(
|
||||
@ApiParam(value = "设备ID", required = true) @PathVariable("deviceId") String deviceId,
|
||||
@ApiParam(value = "子系统号", required = true) @PathVariable("subsystemNo") Integer subsystemNo) {
|
||||
@ApiOperation(value = "-子系统最新电压帧", notes = "返回指定子系统最新电压数据")
|
||||
public SubsystemVoltage latestVoltage(@ApiParam(value = "设备ID", required = true) @PathVariable("deviceId") String deviceId, @ApiParam(value = "子系统号", required = true) @PathVariable("subsystemNo") Integer subsystemNo) {
|
||||
return subsystemVoltageService.selectLatestByDeviceAndSubsystem(deviceId, subsystemNo);
|
||||
}
|
||||
|
||||
// 子系统最新帧(温度):返回指定子系统号最新的一帧温度数据
|
||||
@GetMapping("/subsystem-temperature/{deviceId}/{subsystemNo}/latest")
|
||||
@ApiOperation(value = "子系统最新温度帧", notes = "返回指定子系统最新温度数据")
|
||||
public SubsystemTemperature latestTemperature(
|
||||
@ApiParam(value = "设备ID", required = true) @PathVariable("deviceId") String deviceId,
|
||||
@ApiParam(value = "子系统号", required = true) @PathVariable("subsystemNo") Integer subsystemNo) {
|
||||
@ApiOperation(value = "-子系统最新温度帧", notes = "返回指定子系统最新温度数据")
|
||||
public SubsystemTemperature latestTemperature(@ApiParam(value = "设备ID", required = true) @PathVariable("deviceId") String deviceId, @ApiParam(value = "子系统号", required = true) @PathVariable("subsystemNo") Integer subsystemNo) {
|
||||
return subsystemTemperatureService.selectLatestByDeviceAndSubsystem(deviceId, subsystemNo);
|
||||
}
|
||||
|
||||
@GetMapping("/extreme-values/{deviceId}/latest")
|
||||
@ApiOperation(value = "极值最新数据", notes = "返回指定设备极值数据,支持before筛选")
|
||||
public ExtremeValues latestExtremeValues(
|
||||
@ApiParam(value = "设备ID", required = true) @PathVariable("deviceId") String deviceId,
|
||||
@ApiParam(value = "筛选指定时间之前的数据(yyyy-MM-dd HH:mm:ss 或 毫秒时间戳)") @RequestParam(value = "before", required = false) String before) {
|
||||
@ApiOperation(value = "-极值最新数据", notes = "返回指定设备极值数据,支持before筛选")
|
||||
public ExtremeValues latestExtremeValues(@ApiParam(value = "设备ID", required = true) @PathVariable("deviceId") String deviceId, @ApiParam(value = "筛选指定时间之前的数据(yyyy-MM-dd HH:mm:ss 或 毫秒时间戳)") @RequestParam(value = "before", required = false) String before) {
|
||||
if (before == null || before.isEmpty()) {
|
||||
return extremeValuesService.selectLatestByDeviceId(deviceId);
|
||||
}
|
||||
@ -137,12 +126,351 @@ public class BatteryChartController {
|
||||
}
|
||||
return extremeValuesService.selectLatestByDeviceIdBefore(deviceId, beforeTime);
|
||||
}
|
||||
|
||||
@GetMapping("/api/dashboard/home")
|
||||
@ApiOperation(value = "首页所有分布数据", notes = "获取首页大屏的分布统计数据")
|
||||
public R<HomeDashboardDTO> home(){
|
||||
@ApiOperation(value = "-首页所有分布数据", notes = "获取首页大屏的分布统计数据")
|
||||
public R<HomeDashboardDTO> home() {
|
||||
HomeDashboardDTO dto = vehicleDataService.getHomeDashboard();
|
||||
return R.ok(dto);
|
||||
}
|
||||
|
||||
/* @GetMapping("/monitor/dashboard/summary")
|
||||
@ApiOperation(value = "首页卡片统计", notes = "返回项目数、设备数、在线数、故障数")
|
||||
public R<DashboardSummaryDTO> summary() {
|
||||
long deviceCount = bmsDevicesMapper.selectCount(null);
|
||||
long onlineCount = bmsDevicesMapper.selectCount(new QueryWrapper<BmsDevices>().eq("status", "online"));
|
||||
long projectCount = 22L;
|
||||
long faultCount = 12L;
|
||||
DashboardSummaryDTO dto = new DashboardSummaryDTO();
|
||||
dto.setProjectCount(projectCount);
|
||||
dto.setDeviceCount(deviceCount);
|
||||
dto.setOnlineCount(onlineCount);
|
||||
dto.setFaultCount(faultCount);
|
||||
return R.ok(dto);
|
||||
}*/
|
||||
|
||||
/* @GetMapping("/monitor/dashboard/soc-distribution")
|
||||
@ApiOperation(value = "设备SOC分布", notes = "按每台设备最新SOC值统计")
|
||||
public R<List<NameValueDTO>> socDistribution(@ApiParam(value = "分桶边界,逗号分隔,例:0,20,40,60,80,100") @RequestParam(value = "bins", required = false, defaultValue = "0,20,40,60,80,100") String bins, @ApiParam(value = "是否包含离线设备", defaultValue = "false") @RequestParam(value = "includeOffline", required = false, defaultValue = "false") boolean includeOffline) {
|
||||
List<Integer> edges = Stream.of(bins.split(",")).map(String::trim).filter(s -> !s.isEmpty()).map(Integer::parseInt).sorted().toList();
|
||||
if (edges.size() < 2) {
|
||||
return R.ok(new ArrayList<>());
|
||||
}
|
||||
long[] counts = new long[edges.size() - 1];
|
||||
QueryWrapper<BmsDevices> qw = new QueryWrapper<>();
|
||||
if (!includeOffline) {
|
||||
//查询在线设备
|
||||
qw.eq("status", "online");
|
||||
}
|
||||
List<BmsDevices> devices = bmsDevicesMapper.selectList(qw);
|
||||
|
||||
for (BmsDevices d : devices) {
|
||||
String deviceId = d.getDeviceId();
|
||||
if (deviceId == null || deviceId.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
VehicleData latest = vehicleDataService.selectLatestByDeviceId(deviceId);
|
||||
Integer soc = latest == null ? null : latest.getSoc();
|
||||
//过滤
|
||||
if (soc == null || soc < 0 || soc > 100) {
|
||||
continue;
|
||||
}
|
||||
for (int i = 0; i < counts.length; i++) {
|
||||
int min = edges.get(i);
|
||||
int max = edges.get(i + 1);
|
||||
boolean isLast = (i == counts.length - 1);
|
||||
boolean inRange = isLast ? (soc >= min && soc <= max) : (soc >= min && soc < max);
|
||||
if (inRange) {
|
||||
counts[i]++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
List<NameValueDTO> items = new ArrayList<>(counts.length);
|
||||
String ts = Instant.now().toString();
|
||||
for (int i = 0; i < counts.length; i++) {
|
||||
int min = edges.get(i);
|
||||
int max = edges.get(i + 1);
|
||||
NameValueDTO nv = new NameValueDTO();
|
||||
nv.setName(min + "-" + max + "%");
|
||||
nv.setValue(counts[i]);
|
||||
nv.setCreateTime(ts);
|
||||
items.add(nv);
|
||||
}
|
||||
|
||||
return R.ok(items);
|
||||
}
|
||||
*/
|
||||
@GetMapping("/monitor/dashboard/overview")
|
||||
@ApiOperation(value = "首页概览聚合", notes = "返回基础统计、SOC分布、日充放电趋势")
|
||||
public R<DashboardOverviewDTO> overview(@ApiParam(value = "SOC分桶,默认 0,20,40,60,80,100") @RequestParam(value = "bins", required = false, defaultValue = "0,20,40,60,80,100") String bins, @ApiParam(value = "趋势统计天数", defaultValue = "7") @RequestParam(value = "days", required = false, defaultValue = "7") int days, @ApiParam(value = "运行时长档位(小时)", defaultValue = "10,50,100,150,200,250,300") @RequestParam(value = "runtimeBins", required = false, defaultValue = "10,50,100,150,200,250,300") String runtimeBins) {
|
||||
DashboardOverviewDTO out = new DashboardOverviewDTO();
|
||||
// summary
|
||||
long deviceCount = bmsDevicesMapper.selectCount(null);
|
||||
long onlineCount = bmsDevicesMapper.selectCount(new QueryWrapper<BmsDevices>().eq("status", "online"));
|
||||
long projectCount = 22L;
|
||||
long faultCount = 12L;
|
||||
DashboardSummaryDTO s = new DashboardSummaryDTO();
|
||||
s.setProjectCount(projectCount);
|
||||
s.setDeviceCount(deviceCount);
|
||||
s.setOnlineCount(onlineCount);
|
||||
s.setFaultCount(faultCount);
|
||||
out.setSummary(s);
|
||||
// soc distribution
|
||||
List<Integer> edges = Stream.of(bins.split(",")).map(String::trim).filter(x -> !x.isEmpty()).map(Integer::parseInt).sorted().toList();
|
||||
long[] counts = new long[Math.max(0, edges.size() - 1)];
|
||||
if (counts.length > 0) {
|
||||
List<BmsDevices> devices = bmsDevicesMapper.selectList(new QueryWrapper<BmsDevices>().eq("status", "online"));
|
||||
for (BmsDevices d : devices) {
|
||||
String did = d.getDeviceId();
|
||||
if (did == null || did.isEmpty()) continue;
|
||||
VehicleData latest = vehicleDataService.selectLatestByDeviceId(did);
|
||||
Integer soc = latest == null ? null : latest.getSoc();
|
||||
if (soc == null || soc < 0 || soc > 100) continue;
|
||||
for (int i = 0; i < counts.length; i++) {
|
||||
int min = edges.get(i), max = edges.get(i + 1);
|
||||
boolean last = i == counts.length - 1;
|
||||
boolean in = last ? soc >= min && soc <= max : soc >= min && soc < max;
|
||||
if (in) {
|
||||
counts[i]++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
String ts = Instant.now().toString();
|
||||
List<NameValueDTO> pie = new ArrayList<>();
|
||||
for (int i = 0; i < counts.length; i++) {
|
||||
int min = edges.get(i), max = edges.get(i + 1);
|
||||
NameValueDTO nv = new NameValueDTO();
|
||||
nv.setName(min + "-" + max + "%");
|
||||
nv.setValue(counts[i]);
|
||||
nv.setCreateTime(ts);
|
||||
pie.add(nv);
|
||||
}
|
||||
out.setSocDistribution(pie);
|
||||
// trend (simple heuristic by VehicleData records)
|
||||
int safeDays = Math.max(1, Math.min(31, days));
|
||||
Date endTime = new Date();
|
||||
Date startTime = Date.from(Instant.ofEpochMilli(endTime.getTime()).minusSeconds(safeDays * 86400L));
|
||||
// 复用 selectVehicleDataList 进行时间范围查询
|
||||
VehicleData q = new VehicleData();
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("beginTime", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(startTime));
|
||||
params.put("endTime", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(endTime));
|
||||
q.setParams(params);
|
||||
List<VehicleData> all = vehicleDataService.selectVehicleDataList(q);
|
||||
all.sort((a, b) -> {
|
||||
if (a.getDeviceId() == null)
|
||||
return -1;
|
||||
if (b.getDeviceId() == null)
|
||||
return 1;
|
||||
int c = a.getDeviceId().compareTo(b.getDeviceId());
|
||||
if (c != 0) return c;
|
||||
return a.getTimestamp().compareTo(b.getTimestamp());
|
||||
});
|
||||
Map<String, DashboardTrendItemDTO> byDate = new HashMap<>();
|
||||
SimpleDateFormat dayFmt = new SimpleDateFormat("yyyy-MM-dd");
|
||||
// 初始化天数
|
||||
LocalDate today = LocalDate.now();
|
||||
for (int i = safeDays - 1; i >= 0; i--) {
|
||||
LocalDate d = today.minusDays(i);
|
||||
DashboardTrendItemDTO item = new DashboardTrendItemDTO();
|
||||
item.setDate(d.toString());
|
||||
item.setChargeDuration(0);
|
||||
item.setDischargeDuration(0);
|
||||
byDate.put(d.toString(), item);
|
||||
}
|
||||
// 累加相邻样本间隔(秒)
|
||||
for (int i = 0; i < all.size() - 1; i++) {
|
||||
VehicleData cur = all.get(i);
|
||||
VehicleData nex = all.get(i + 1);
|
||||
if (cur.getDeviceId() == null || !cur.getDeviceId().equals(nex.getDeviceId())) continue;
|
||||
if (cur.getTimestamp() == null || nex.getTimestamp() == null) continue;
|
||||
long delta = (nex.getTimestamp().getTime() - cur.getTimestamp().getTime()) / 1000L;
|
||||
if (delta <= 0 || delta > 6 * 3600) continue; // 限制单段不超过6小时
|
||||
String key = dayFmt.format(cur.getTimestamp());
|
||||
DashboardTrendItemDTO item = byDate.get(key);
|
||||
if (item == null) continue;
|
||||
Integer st = cur.getChargingStatus();
|
||||
if (st != null && (st == 1 || st == 2)) {
|
||||
item.setChargeDuration(item.getChargeDuration() + delta);
|
||||
} else if (st != null && st == 3) {
|
||||
item.setDischargeDuration(item.getDischargeDuration() + delta);
|
||||
}
|
||||
}
|
||||
List<DashboardTrendItemDTO> trend = byDate.values().stream().sorted(java.util.Comparator.comparing(DashboardTrendItemDTO::getDate)).collect(Collectors.toList());
|
||||
out.setTrend(trend);
|
||||
// runtime summary + distribution
|
||||
long sumChargeSec = trend.stream().mapToLong(DashboardTrendItemDTO::getChargeDuration).sum();
|
||||
long sumDischargeSec = trend.stream().mapToLong(DashboardTrendItemDTO::getDischargeDuration).sum();
|
||||
RuntimeSummaryDTO rsum = new RuntimeSummaryDTO();
|
||||
rsum.setTotalChargeHours(sumChargeSec / 3600);
|
||||
rsum.setTotalDischargeHours(sumDischargeSec / 3600);
|
||||
rsum.setTotalRunHours((sumChargeSec + sumDischargeSec) / 3600);
|
||||
rsum.setTotalChargeEnergyKWh(0);
|
||||
rsum.setTotalDischargeEnergyKWh(0);
|
||||
rsum.setTotalChargeCapacityAh(0);
|
||||
rsum.setTotalDischargeCapacityAh(0);
|
||||
out.setRuntimeSummary(rsum);
|
||||
// 每设备运行小时(近 days),按 chargingStatus in (1,2,3) 累加
|
||||
Map<String, Long> runSecByDevice = new HashMap<>();
|
||||
for (int i = 0; i < all.size() - 1; i++) {
|
||||
VehicleData cur = all.get(i);
|
||||
VehicleData nex = all.get(i + 1);
|
||||
if (cur.getDeviceId() == null || !cur.getDeviceId().equals(nex.getDeviceId())) continue;
|
||||
if (cur.getTimestamp() == null || nex.getTimestamp() == null) continue;
|
||||
long delta = (nex.getTimestamp().getTime() - cur.getTimestamp().getTime()) / 1000L;
|
||||
if (delta <= 0 || delta > 6 * 3600) continue;
|
||||
Integer st = cur.getChargingStatus();
|
||||
if (st != null && (st == 1 || st == 2 || st == 3)) {
|
||||
runSecByDevice.merge(cur.getDeviceId(), delta, Long::sum);
|
||||
}
|
||||
}
|
||||
List<Integer> hb = Stream.of(runtimeBins.split(",")).map(String::trim).filter(x -> !x.isEmpty()).map(Integer::parseInt).sorted().toList();
|
||||
long[] hCounts = new long[Math.max(0, hb.size() - 1)];
|
||||
for (Map.Entry<String, Long> e : runSecByDevice.entrySet()) {
|
||||
long hours = e.getValue() / 3600;
|
||||
for (int i = 0; i < hCounts.length; i++) {
|
||||
int min = hb.get(i), max = hb.get(i + 1);
|
||||
boolean last = i == hCounts.length - 1;
|
||||
boolean in = last ? hours >= min && hours <= max : hours >= min && hours < max;
|
||||
if (in) { hCounts[i]++; break; }
|
||||
}
|
||||
}
|
||||
List<NameValueDTO> runtimeDist = new ArrayList<>();
|
||||
String now = Instant.now().toString();
|
||||
for (int i = 0; i < hCounts.length; i++) {
|
||||
int min = hb.get(i), max = hb.get(i + 1);
|
||||
NameValueDTO nv = new NameValueDTO();
|
||||
nv.setName(min + "h");
|
||||
nv.setValue(hCounts[i]);
|
||||
nv.setCreateTime(now);
|
||||
runtimeDist.add(nv);
|
||||
}
|
||||
out.setRuntimeDuration(runtimeDist);
|
||||
return R.ok(out);
|
||||
}
|
||||
|
||||
@GetMapping("/monitor/device/latest-locations")
|
||||
@ApiOperation(value = "所有设备最新位置", notes = "返回每个设备的设备对象与其最新位置")
|
||||
public R<List<DeviceLatestLocationDTO>> latestLocations(@ApiParam(value = "是否仅包含在线设备", defaultValue = "false") @RequestParam(value = "onlineOnly", required = false, defaultValue = "false") boolean onlineOnly) {
|
||||
QueryWrapper<BmsDevices> qw = new QueryWrapper<>();
|
||||
if (onlineOnly) {
|
||||
qw.eq("status", "online");
|
||||
}
|
||||
List<BmsDevices> devices = bmsDevicesMapper.selectList(qw);
|
||||
SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
List<DeviceLatestLocationDTO> result = new ArrayList<>(devices.size());
|
||||
for (BmsDevices d : devices) {
|
||||
String did = d.getDeviceId();
|
||||
VehicleLocation loc = did == null ? null : vehicleLocationService.selectLatestByDeviceId(did);
|
||||
TrackPointDTO p = null;
|
||||
if (loc != null) {
|
||||
p = new TrackPointDTO();
|
||||
p.setTimestamp(loc.getTimestamp() == null ? null : fmt.format(loc.getTimestamp()));
|
||||
p.setLongitude(loc.getLongitude() == null ? null : loc.getLongitude().doubleValue());
|
||||
p.setLatitude(loc.getLatitude() == null ? null : loc.getLatitude().doubleValue());
|
||||
p.setPositioningStatus(loc.getPositioningStatus());
|
||||
}
|
||||
DeviceLatestLocationDTO dto = new DeviceLatestLocationDTO();
|
||||
dto.setDevice(d);
|
||||
dto.setLocation(p);
|
||||
result.add(dto);
|
||||
}
|
||||
return R.ok(result);
|
||||
}
|
||||
|
||||
@GetMapping("/monitor/device/{deviceId}/track")
|
||||
@ApiOperation(value = "设备轨迹", notes = "返回指定时间范围内的轨迹")
|
||||
public R<DeviceTrackDTO> deviceTrack(@ApiParam(value = "设备ID", required = true) @PathVariable("deviceId") String deviceId, @ApiParam(value = "开始时间戳(毫秒)", required = true) @RequestParam("start") long startMillis, @ApiParam(value = "结束时间戳(毫秒)", required = true) @RequestParam("end") long endMillis, @ApiParam(value = "限制返回条数", defaultValue = "1000") @RequestParam(value = "limit", required = false, defaultValue = "1000") Integer limit, @ApiParam(value = "是否包含无效定位", defaultValue = "false") @RequestParam(value = "includeInvalid", required = false, defaultValue = "false") boolean includeInvalid) {
|
||||
Date start = new Date(startMillis);
|
||||
Date end = new Date(endMillis);
|
||||
//查询车辆位置信息
|
||||
List<VehicleLocation> rows = vehicleLocationService.selectByDeviceAndRange(deviceId, start, end, limit);
|
||||
|
||||
SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
//位置列表按 timestamp 升序排序,空时间的记录排在最后。
|
||||
List<TrackPointDTO> list = rows.stream()
|
||||
.filter(v -> includeInvalid || (v.getPositioningStatus() != null && v.getPositioningStatus() == 1))
|
||||
.sorted((a, b) -> {
|
||||
Date ta = a.getTimestamp(), tb = b.getTimestamp();
|
||||
if (ta == null && tb == null) return 0;
|
||||
if (ta == null) return 1;
|
||||
if (tb == null) return -1;
|
||||
return ta.compareTo(tb);
|
||||
})
|
||||
.map(v -> {
|
||||
TrackPointDTO p = new TrackPointDTO();
|
||||
p.setTimestamp(v.getTimestamp() == null ? null : fmt.format(v.getTimestamp()));
|
||||
p.setLongitude(v.getLongitude() == null ? null : v.getLongitude().doubleValue());
|
||||
p.setLatitude(v.getLatitude() == null ? null : v.getLatitude().doubleValue());
|
||||
p.setPositioningStatus(v.getPositioningStatus());
|
||||
return p;
|
||||
}).collect(Collectors.toList());
|
||||
DeviceTrackDTO dto = new DeviceTrackDTO();
|
||||
dto.setDeviceId(deviceId);
|
||||
// 基本设备信息
|
||||
BmsDevices dev = bmsDevicesMapper.selectOne(new QueryWrapper<BmsDevices>().eq("device_id", deviceId));
|
||||
if (dev != null) {
|
||||
dto.setDeviceName(dev.getDeviceName());
|
||||
dto.setDeviceSn(dev.getDeviceSn());
|
||||
dto.setDeviceType(dev.getDeviceType());
|
||||
dto.setStatus(dev.getStatus());
|
||||
dto.setFirmwareVersion(dev.getFirmwareVersion());
|
||||
dto.setLastOnline(dev.getLastOnline() == null ? null : fmt.format(dev.getLastOnline()));
|
||||
}
|
||||
// 运行时指标(取最新整车数据)
|
||||
VehicleData latest = vehicleDataService.selectLatestByDeviceId(deviceId);
|
||||
if (latest != null) {
|
||||
dto.setVehicleSpeed(latest.getVehicleSpeed());
|
||||
dto.setTotalMileage(latest.getTotalMileage());
|
||||
dto.setTotalVoltage(latest.getTotalVoltage());
|
||||
dto.setTotalCurrent(latest.getTotalCurrent());
|
||||
dto.setSoc(latest.getSoc());
|
||||
}
|
||||
dto.setTrackList(list);
|
||||
return R.ok(dto);
|
||||
}
|
||||
|
||||
@GetMapping("/monitor/device/{deviceId}/detail")
|
||||
@ApiOperation(value = "设备详细信息", notes = "聚合设备、整车、位置等信息")
|
||||
public R<DeviceDetailDTO> deviceDetail(@ApiParam(value = "设备ID", required = true) @PathVariable("deviceId") String deviceId) {
|
||||
SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
DeviceDetailDTO out = new DeviceDetailDTO();
|
||||
out.setDeviceId(deviceId);
|
||||
BmsDevices dev = bmsDevicesMapper.selectOne(new QueryWrapper<BmsDevices>().eq("device_id", deviceId));
|
||||
if (dev != null) {
|
||||
out.setDeviceName(dev.getDeviceName());
|
||||
out.setDeviceSn(dev.getDeviceSn());
|
||||
out.setDeviceType(dev.getDeviceType());
|
||||
out.setStatus(dev.getStatus());
|
||||
out.setFirmwareVersion(dev.getFirmwareVersion());
|
||||
out.setLastOnline(dev.getLastOnline() == null ? null : fmt.format(dev.getLastOnline()));
|
||||
}
|
||||
VehicleData v = vehicleDataService.selectLatestByDeviceId(deviceId);
|
||||
if (v != null) {
|
||||
out.setTotalVoltage(v.getTotalVoltage());
|
||||
out.setTotalCurrent(v.getTotalCurrent());
|
||||
out.setSoc(v.getSoc());
|
||||
out.setVehicleStatus(v.getVehicleStatus());
|
||||
out.setChargingStatus(v.getChargingStatus());
|
||||
out.setOperationMode(v.getOperationMode());
|
||||
out.setDcdcStatus(v.getDcdcStatus());
|
||||
out.setGearPosition(v.getGearPosition());
|
||||
out.setInsulationResistance(v.getInsulationResistance());
|
||||
}
|
||||
VehicleLocation loc = vehicleLocationService.selectLatestByDeviceId(deviceId);
|
||||
if (loc != null) {
|
||||
out.setLongitude(loc.getLongitude() == null ? null : loc.getLongitude().doubleValue());
|
||||
out.setLatitude(loc.getLatitude() == null ? null : loc.getLatitude().doubleValue());
|
||||
out.setLocationTime(loc.getTimestamp() == null ? null : fmt.format(loc.getTimestamp()));
|
||||
out.setPositioningStatus(loc.getPositioningStatus());
|
||||
}
|
||||
out.setLastMaintenanceTime(null);
|
||||
out.setLastUpgradeTime(null);
|
||||
return R.ok(out);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,8 @@
|
||||
package com.evobms.project.vehicledata.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class FrontPageDTO {
|
||||
|
||||
}
|
||||
@ -6,7 +6,7 @@ spring:
|
||||
druid:
|
||||
# 主库数据源
|
||||
master:
|
||||
url: jdbc:mysql://192.168.5.121:3306/evo_bms1?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
url: jdbc:mysql://192.168.5.121:3306/evo_bms1?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=Asia/Shanghai
|
||||
username: root
|
||||
password: root
|
||||
# 从库数据源
|
||||
|
||||
@ -79,7 +79,7 @@ spring:
|
||||
# 端口,默认为6379
|
||||
port: 6379
|
||||
# 数据库索引
|
||||
database: 0
|
||||
database: 12
|
||||
# 密码
|
||||
password:
|
||||
# 连接超时时间
|
||||
|
||||
@ -29,7 +29,7 @@
|
||||
insert into bms_charge_detail
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="deviceId != null and deviceId != ''">device_id,</if>
|
||||
<if test="timestamp != null">timestamp,</if>
|
||||
<if test="timestamp != null">`timestamp`,</if>
|
||||
<if test="acChargeCurrent != null">ac_charge_current,</if>
|
||||
<if test="acChargeVoltage != null">ac_charge_voltage,</if>
|
||||
<if test="dcChargeCurrent != null">dc_charge_current,</if>
|
||||
|
||||
@ -0,0 +1,87 @@
|
||||
<?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.evobms.project.bms.mapper.BmsChargeTemperatureMapper">
|
||||
|
||||
<resultMap type="BmsChargeTemperature" id="BmsChargeTemperatureResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="deviceId" column="device_id" />
|
||||
<result property="timestap" column="timestap" />
|
||||
<result property="tempIndex" column="temp_index" />
|
||||
<result property="temperature" column="temperature" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBmsChargeTemperatureVo">
|
||||
select id, device_id, timestap, temp_index, temperature, create_by, update_by, create_time, update_time from bms_charge_temperature
|
||||
</sql>
|
||||
|
||||
<select id="selectBmsChargeTemperatureList" parameterType="BmsChargeTemperature" resultMap="BmsChargeTemperatureResult">
|
||||
<include refid="selectBmsChargeTemperatureVo"/>
|
||||
<where>
|
||||
<if test="deviceId != null and deviceId != ''"> and device_id = #{deviceId}</if>
|
||||
<if test="timestap != null "> and timestap = #{timestap}</if>
|
||||
<if test="tempIndex != null "> and temp_index = #{tempIndex}</if>
|
||||
<if test="temperature != null "> and temperature = #{temperature}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectBmsChargeTemperatureById" parameterType="Long" resultMap="BmsChargeTemperatureResult">
|
||||
<include refid="selectBmsChargeTemperatureVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertBmsChargeTemperature" parameterType="BmsChargeTemperature" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into bms_charge_temperature
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="deviceId != null and deviceId != ''">device_id,</if>
|
||||
<if test="timestap != null">timestap,</if>
|
||||
<if test="tempIndex != null">temp_index,</if>
|
||||
<if test="temperature != null">temperature,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="deviceId != null and deviceId != ''">#{deviceId},</if>
|
||||
<if test="timestap != null">#{timestap},</if>
|
||||
<if test="tempIndex != null">#{tempIndex},</if>
|
||||
<if test="temperature != null">#{temperature},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateBmsChargeTemperature" parameterType="BmsChargeTemperature">
|
||||
update bms_charge_temperature
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="deviceId != null and deviceId != ''">device_id = #{deviceId},</if>
|
||||
<if test="timestap != null">timestap = #{timestap},</if>
|
||||
<if test="tempIndex != null">temp_index = #{tempIndex},</if>
|
||||
<if test="temperature != null">temperature = #{temperature},</if>
|
||||
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteBmsChargeTemperatureById" parameterType="Long">
|
||||
delete from bms_charge_temperature where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBmsChargeTemperatureByIds" parameterType="String">
|
||||
delete from bms_charge_temperature where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
127
src/main/resources/mybatis/bms/BmsRuntimeDataMapper.xml
Normal file
127
src/main/resources/mybatis/bms/BmsRuntimeDataMapper.xml
Normal file
@ -0,0 +1,127 @@
|
||||
<?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.evobms.project.bms.mapper.BmsRuntimeDataMapper">
|
||||
|
||||
<resultMap type="BmsRuntimeData" id="BmsRuntimeDataResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="deviceId" column="device_id" />
|
||||
<result property="timestamp" column="timestap" />
|
||||
<result property="vehicleSpeed" column="vehicle_speed" />
|
||||
<result property="mileage" column="mileage" />
|
||||
<result property="systemVoltage" column="system_voltage" />
|
||||
<result property="systemCurrent" column="system_current" />
|
||||
<result property="insulationResistance" column="insulation_resistance" />
|
||||
<result property="socMax" column="soc_max" />
|
||||
<result property="socMin" column="soc_min" />
|
||||
<result property="gpvVoltage" column="gpv_voltage" />
|
||||
<result property="runStatus" column="run_status" />
|
||||
<result property="powerStatus" column="power_status" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBmsRuntimeDataVo">
|
||||
select id, device_id, timestap, vehicle_speed, mileage, system_voltage, system_current, insulation_resistance, soc_max, soc_min, gpv_voltage, run_status, power_status, create_by, update_by, create_time, update_time from bms_runtime_data
|
||||
</sql>
|
||||
|
||||
<select id="selectBmsRuntimeDataList" parameterType="BmsRuntimeData" resultMap="BmsRuntimeDataResult">
|
||||
<include refid="selectBmsRuntimeDataVo"/>
|
||||
<where>
|
||||
<if test="deviceId != null and deviceId != ''"> and device_id = #{deviceId}</if>
|
||||
<if test="timestap != null "> and timestap = #{timestap}</if>
|
||||
<if test="vehicleSpeed != null "> and vehicle_speed = #{vehicleSpeed}</if>
|
||||
<if test="mileage != null "> and mileage = #{mileage}</if>
|
||||
<if test="systemVoltage != null "> and system_voltage = #{systemVoltage}</if>
|
||||
<if test="systemCurrent != null "> and system_current = #{systemCurrent}</if>
|
||||
<if test="insulationResistance != null "> and insulation_resistance = #{insulationResistance}</if>
|
||||
<if test="socMax != null "> and soc_max = #{socMax}</if>
|
||||
<if test="socMin != null "> and soc_min = #{socMin}</if>
|
||||
<if test="gpvVoltage != null "> and gpv_voltage = #{gpvVoltage}</if>
|
||||
<if test="runStatus != null "> and run_status = #{runStatus}</if>
|
||||
<if test="powerStatus != null "> and power_status = #{powerStatus}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectBmsRuntimeDataById" parameterType="Long" resultMap="BmsRuntimeDataResult">
|
||||
<include refid="selectBmsRuntimeDataVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertBmsRuntimeData" parameterType="BmsRuntimeData" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into bms_runtime_data
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="deviceId != null and deviceId != ''">device_id,</if>
|
||||
<if test="timestap != null">timestap,</if>
|
||||
<if test="vehicleSpeed != null">vehicle_speed,</if>
|
||||
<if test="mileage != null">mileage,</if>
|
||||
<if test="systemVoltage != null">system_voltage,</if>
|
||||
<if test="systemCurrent != null">system_current,</if>
|
||||
<if test="insulationResistance != null">insulation_resistance,</if>
|
||||
<if test="socMax != null">soc_max,</if>
|
||||
<if test="socMin != null">soc_min,</if>
|
||||
<if test="gpvVoltage != null">gpv_voltage,</if>
|
||||
<if test="runStatus != null">run_status,</if>
|
||||
<if test="powerStatus != null">power_status,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="deviceId != null and deviceId != ''">#{deviceId},</if>
|
||||
<if test="timestap != null">#{timestap},</if>
|
||||
<if test="vehicleSpeed != null">#{vehicleSpeed},</if>
|
||||
<if test="mileage != null">#{mileage},</if>
|
||||
<if test="systemVoltage != null">#{systemVoltage},</if>
|
||||
<if test="systemCurrent != null">#{systemCurrent},</if>
|
||||
<if test="insulationResistance != null">#{insulationResistance},</if>
|
||||
<if test="socMax != null">#{socMax},</if>
|
||||
<if test="socMin != null">#{socMin},</if>
|
||||
<if test="gpvVoltage != null">#{gpvVoltage},</if>
|
||||
<if test="runStatus != null">#{runStatus},</if>
|
||||
<if test="powerStatus != null">#{powerStatus},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateBmsRuntimeData" parameterType="BmsRuntimeData">
|
||||
update bms_runtime_data
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="deviceId != null and deviceId != ''">device_id = #{deviceId},</if>
|
||||
<if test="timestap != null">timestap = #{timestap},</if>
|
||||
<if test="vehicleSpeed != null">vehicle_speed = #{vehicleSpeed},</if>
|
||||
<if test="mileage != null">mileage = #{mileage},</if>
|
||||
<if test="systemVoltage != null">system_voltage = #{systemVoltage},</if>
|
||||
<if test="systemCurrent != null">system_current = #{systemCurrent},</if>
|
||||
<if test="insulationResistance != null">insulation_resistance = #{insulationResistance},</if>
|
||||
<if test="socMax != null">soc_max = #{socMax},</if>
|
||||
<if test="socMin != null">soc_min = #{socMin},</if>
|
||||
<if test="gpvVoltage != null">gpv_voltage = #{gpvVoltage},</if>
|
||||
<if test="runStatus != null">run_status = #{runStatus},</if>
|
||||
<if test="powerStatus != null">power_status = #{powerStatus},</if>
|
||||
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteBmsRuntimeDataById" parameterType="Long">
|
||||
delete from bms_runtime_data where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBmsRuntimeDataByIds" parameterType="String">
|
||||
delete from bms_runtime_data where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@ -0,0 +1,92 @@
|
||||
<?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.evobms.project.bms.mapper.BmsVoltageChannelDataMapper">
|
||||
|
||||
<resultMap type="BmsVoltageChannelData" id="BmsVoltageChannelDataResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="deviceId" column="device_id" />
|
||||
<result property="timestap" column="timestap" />
|
||||
<result property="channelType" column="channel_type" />
|
||||
<result property="channelIndex" column="channel_index" />
|
||||
<result property="voltage" column="voltage" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBmsVoltageChannelDataVo">
|
||||
select id, device_id, timestap, channel_type, channel_index, voltage, create_by, update_by, create_time, update_time from bms_voltage_channel_data
|
||||
</sql>
|
||||
|
||||
<select id="selectBmsVoltageChannelDataList" parameterType="BmsVoltageChannelData" resultMap="BmsVoltageChannelDataResult">
|
||||
<include refid="selectBmsVoltageChannelDataVo"/>
|
||||
<where>
|
||||
<if test="deviceId != null and deviceId != ''"> and device_id = #{deviceId}</if>
|
||||
<if test="timestap != null "> and timestap = #{timestap}</if>
|
||||
<if test="channelType != null and channelType != ''"> and channel_type = #{channelType}</if>
|
||||
<if test="channelIndex != null "> and channel_index = #{channelIndex}</if>
|
||||
<if test="voltage != null "> and voltage = #{voltage}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectBmsVoltageChannelDataById" parameterType="Long" resultMap="BmsVoltageChannelDataResult">
|
||||
<include refid="selectBmsVoltageChannelDataVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertBmsVoltageChannelData" parameterType="BmsVoltageChannelData" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into bms_voltage_channel_data
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="deviceId != null and deviceId != ''">device_id,</if>
|
||||
<if test="timestap != null">timestap,</if>
|
||||
<if test="channelType != null and channelType != ''">channel_type,</if>
|
||||
<if test="channelIndex != null">channel_index,</if>
|
||||
<if test="voltage != null">voltage,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="deviceId != null and deviceId != ''">#{deviceId},</if>
|
||||
<if test="timestap != null">#{timestap},</if>
|
||||
<if test="channelType != null and channelType != ''">#{channelType},</if>
|
||||
<if test="channelIndex != null">#{channelIndex},</if>
|
||||
<if test="voltage != null">#{voltage},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateBmsVoltageChannelData" parameterType="BmsVoltageChannelData">
|
||||
update bms_voltage_channel_data
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="deviceId != null and deviceId != ''">device_id = #{deviceId},</if>
|
||||
<if test="timestap != null">timestap = #{timestap},</if>
|
||||
<if test="channelType != null and channelType != ''">channel_type = #{channelType},</if>
|
||||
<if test="channelIndex != null">channel_index = #{channelIndex},</if>
|
||||
<if test="voltage != null">voltage = #{voltage},</if>
|
||||
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteBmsVoltageChannelDataById" parameterType="Long">
|
||||
delete from bms_voltage_channel_data where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBmsVoltageChannelDataByIds" parameterType="String">
|
||||
delete from bms_voltage_channel_data where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue
Block a user