From 5460aadf6c1173fc9b75d4e92997bcce629cbdee Mon Sep 17 00:00:00 2001 From: xiaoyang <17515057146@163.com> Date: Tue, 14 Apr 2026 16:11:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=9A=E5=8A=A1=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8=E5=A4=87=E6=B3=A8=E5=8A=9F=E8=83=BD=EF=BC=8C=E5=8F=AF?= =?UTF-8?q?=E4=BB=A5=E6=A0=B9=E6=8D=AE=E4=B8=9A=E5=8A=A1=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=BC=80=E5=8F=91=EF=BC=8C=E7=9B=AE=E5=89=8D=E7=94=B5=E8=A1=A8?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8=E4=B8=8E=E6=94=B6=E7=9B=8A=E6=8A=A5=E8=A1=A8?= =?UTF-8?q?=E5=9D=87=E6=9C=89=E5=A4=87=E6=B3=A8=E5=88=97=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/SysBizRemarkController.java | 32 +++++ .../com/xzzn/ems/domain/SysBizRemark.java | 68 +++++++++++ .../domain/vo/BizRemarkBatchGetRequest.java | 42 +++++++ .../ems/domain/vo/BizRemarkSaveRequest.java | 52 ++++++++ .../SingleBatteryMonitorImportFailureVo.java | 59 +++++++++ .../SingleBatteryMonitorImportResultVo.java | 98 +++++++++++++++ .../vo/SingleBatteryMonitorImportRowVo.java | 115 ++++++++++++++++++ .../xzzn/ems/mapper/SysBizRemarkMapper.java | 21 ++++ .../ems/service/ISysBizRemarkService.java | 13 ++ .../service/impl/SysBizRemarkServiceImpl.java | 69 +++++++++++ 10 files changed, 569 insertions(+) create mode 100644 ems-admin/src/main/java/com/xzzn/web/controller/system/SysBizRemarkController.java create mode 100644 ems-system/src/main/java/com/xzzn/ems/domain/SysBizRemark.java create mode 100644 ems-system/src/main/java/com/xzzn/ems/domain/vo/BizRemarkBatchGetRequest.java create mode 100644 ems-system/src/main/java/com/xzzn/ems/domain/vo/BizRemarkSaveRequest.java create mode 100644 ems-system/src/main/java/com/xzzn/ems/domain/vo/SingleBatteryMonitorImportFailureVo.java create mode 100644 ems-system/src/main/java/com/xzzn/ems/domain/vo/SingleBatteryMonitorImportResultVo.java create mode 100644 ems-system/src/main/java/com/xzzn/ems/domain/vo/SingleBatteryMonitorImportRowVo.java create mode 100644 ems-system/src/main/java/com/xzzn/ems/mapper/SysBizRemarkMapper.java create mode 100644 ems-system/src/main/java/com/xzzn/ems/service/ISysBizRemarkService.java create mode 100644 ems-system/src/main/java/com/xzzn/ems/service/impl/SysBizRemarkServiceImpl.java diff --git a/ems-admin/src/main/java/com/xzzn/web/controller/system/SysBizRemarkController.java b/ems-admin/src/main/java/com/xzzn/web/controller/system/SysBizRemarkController.java new file mode 100644 index 0000000..3254290 --- /dev/null +++ b/ems-admin/src/main/java/com/xzzn/web/controller/system/SysBizRemarkController.java @@ -0,0 +1,32 @@ +package com.xzzn.web.controller.system; + +import com.xzzn.common.core.controller.BaseController; +import com.xzzn.common.core.domain.AjaxResult; +import com.xzzn.ems.domain.vo.BizRemarkBatchGetRequest; +import com.xzzn.ems.domain.vo.BizRemarkSaveRequest; +import com.xzzn.ems.service.ISysBizRemarkService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/system/bizRemark") +public class SysBizRemarkController extends BaseController +{ + @Autowired + private ISysBizRemarkService sysBizRemarkService; + + @PostMapping("/batchGet") + public AjaxResult batchGet(@RequestBody BizRemarkBatchGetRequest request) + { + return success(sysBizRemarkService.getRemarkMap(request.getBizType(), request.getBizKey1(), request.getBizKey2List())); + } + + @PostMapping("/save") + public AjaxResult save(@RequestBody BizRemarkSaveRequest request) + { + return toAjax(sysBizRemarkService.saveRemark(request, getUsername())); + } +} diff --git a/ems-system/src/main/java/com/xzzn/ems/domain/SysBizRemark.java b/ems-system/src/main/java/com/xzzn/ems/domain/SysBizRemark.java new file mode 100644 index 0000000..289294b --- /dev/null +++ b/ems-system/src/main/java/com/xzzn/ems/domain/SysBizRemark.java @@ -0,0 +1,68 @@ +package com.xzzn.ems.domain; + +import com.xzzn.common.core.domain.BaseEntity; + +public class SysBizRemark extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + private Long id; + + private String bizType; + + private String bizKey1; + + private String bizKey2; + + private String delFlag; + + public Long getId() + { + return id; + } + + public void setId(Long id) + { + this.id = id; + } + + public String getBizType() + { + return bizType; + } + + public void setBizType(String bizType) + { + this.bizType = bizType; + } + + public String getBizKey1() + { + return bizKey1; + } + + public void setBizKey1(String bizKey1) + { + this.bizKey1 = bizKey1; + } + + public String getBizKey2() + { + return bizKey2; + } + + public void setBizKey2(String bizKey2) + { + this.bizKey2 = bizKey2; + } + + public String getDelFlag() + { + return delFlag; + } + + public void setDelFlag(String delFlag) + { + this.delFlag = delFlag; + } +} diff --git a/ems-system/src/main/java/com/xzzn/ems/domain/vo/BizRemarkBatchGetRequest.java b/ems-system/src/main/java/com/xzzn/ems/domain/vo/BizRemarkBatchGetRequest.java new file mode 100644 index 0000000..411f1fa --- /dev/null +++ b/ems-system/src/main/java/com/xzzn/ems/domain/vo/BizRemarkBatchGetRequest.java @@ -0,0 +1,42 @@ +package com.xzzn.ems.domain.vo; + +import java.util.List; + +public class BizRemarkBatchGetRequest +{ + private String bizType; + + private String bizKey1; + + private List bizKey2List; + + public String getBizType() + { + return bizType; + } + + public void setBizType(String bizType) + { + this.bizType = bizType; + } + + public String getBizKey1() + { + return bizKey1; + } + + public void setBizKey1(String bizKey1) + { + this.bizKey1 = bizKey1; + } + + public List getBizKey2List() + { + return bizKey2List; + } + + public void setBizKey2List(List bizKey2List) + { + this.bizKey2List = bizKey2List; + } +} diff --git a/ems-system/src/main/java/com/xzzn/ems/domain/vo/BizRemarkSaveRequest.java b/ems-system/src/main/java/com/xzzn/ems/domain/vo/BizRemarkSaveRequest.java new file mode 100644 index 0000000..3345d7a --- /dev/null +++ b/ems-system/src/main/java/com/xzzn/ems/domain/vo/BizRemarkSaveRequest.java @@ -0,0 +1,52 @@ +package com.xzzn.ems.domain.vo; + +public class BizRemarkSaveRequest +{ + private String bizType; + + private String bizKey1; + + private String bizKey2; + + private String remark; + + public String getBizType() + { + return bizType; + } + + public void setBizType(String bizType) + { + this.bizType = bizType; + } + + public String getBizKey1() + { + return bizKey1; + } + + public void setBizKey1(String bizKey1) + { + this.bizKey1 = bizKey1; + } + + public String getBizKey2() + { + return bizKey2; + } + + public void setBizKey2(String bizKey2) + { + this.bizKey2 = bizKey2; + } + + public String getRemark() + { + return remark; + } + + public void setRemark(String remark) + { + this.remark = remark; + } +} diff --git a/ems-system/src/main/java/com/xzzn/ems/domain/vo/SingleBatteryMonitorImportFailureVo.java b/ems-system/src/main/java/com/xzzn/ems/domain/vo/SingleBatteryMonitorImportFailureVo.java new file mode 100644 index 0000000..a089b18 --- /dev/null +++ b/ems-system/src/main/java/com/xzzn/ems/domain/vo/SingleBatteryMonitorImportFailureVo.java @@ -0,0 +1,59 @@ +package com.xzzn.ems.domain.vo; + +public class SingleBatteryMonitorImportFailureVo { + + private Integer rowNum; + private String siteId; + private String stackDeviceId; + private String clusterDeviceId; + private String batteryDeviceId; + private String errorMessage; + + public Integer getRowNum() { + return rowNum; + } + + public void setRowNum(Integer rowNum) { + this.rowNum = rowNum; + } + + public String getSiteId() { + return siteId; + } + + public void setSiteId(String siteId) { + this.siteId = siteId; + } + + public String getStackDeviceId() { + return stackDeviceId; + } + + public void setStackDeviceId(String stackDeviceId) { + this.stackDeviceId = stackDeviceId; + } + + public String getClusterDeviceId() { + return clusterDeviceId; + } + + public void setClusterDeviceId(String clusterDeviceId) { + this.clusterDeviceId = clusterDeviceId; + } + + public String getBatteryDeviceId() { + return batteryDeviceId; + } + + public void setBatteryDeviceId(String batteryDeviceId) { + this.batteryDeviceId = batteryDeviceId; + } + + public String getErrorMessage() { + return errorMessage; + } + + public void setErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + } +} diff --git a/ems-system/src/main/java/com/xzzn/ems/domain/vo/SingleBatteryMonitorImportResultVo.java b/ems-system/src/main/java/com/xzzn/ems/domain/vo/SingleBatteryMonitorImportResultVo.java new file mode 100644 index 0000000..280f099 --- /dev/null +++ b/ems-system/src/main/java/com/xzzn/ems/domain/vo/SingleBatteryMonitorImportResultVo.java @@ -0,0 +1,98 @@ +package com.xzzn.ems.domain.vo; + +import java.util.ArrayList; +import java.util.List; + +public class SingleBatteryMonitorImportResultVo { + + private Boolean committed; + private Integer totalRows; + private Integer successRows; + private Integer failureRows; + private Integer insertedBatteryCount; + private Integer updatedBatteryCount; + private Integer insertedMappingCount; + private Integer updatedMappingCount; + private String message; + private List failureDetails = new ArrayList<>(); + + public Boolean getCommitted() { + return committed; + } + + public void setCommitted(Boolean committed) { + this.committed = committed; + } + + public Integer getTotalRows() { + return totalRows; + } + + public void setTotalRows(Integer totalRows) { + this.totalRows = totalRows; + } + + public Integer getSuccessRows() { + return successRows; + } + + public void setSuccessRows(Integer successRows) { + this.successRows = successRows; + } + + public Integer getFailureRows() { + return failureRows; + } + + public void setFailureRows(Integer failureRows) { + this.failureRows = failureRows; + } + + public Integer getInsertedBatteryCount() { + return insertedBatteryCount; + } + + public void setInsertedBatteryCount(Integer insertedBatteryCount) { + this.insertedBatteryCount = insertedBatteryCount; + } + + public Integer getUpdatedBatteryCount() { + return updatedBatteryCount; + } + + public void setUpdatedBatteryCount(Integer updatedBatteryCount) { + this.updatedBatteryCount = updatedBatteryCount; + } + + public Integer getInsertedMappingCount() { + return insertedMappingCount; + } + + public void setInsertedMappingCount(Integer insertedMappingCount) { + this.insertedMappingCount = insertedMappingCount; + } + + public Integer getUpdatedMappingCount() { + return updatedMappingCount; + } + + public void setUpdatedMappingCount(Integer updatedMappingCount) { + this.updatedMappingCount = updatedMappingCount; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public List getFailureDetails() { + return failureDetails; + } + + public void setFailureDetails(List failureDetails) { + this.failureDetails = failureDetails; + } +} diff --git a/ems-system/src/main/java/com/xzzn/ems/domain/vo/SingleBatteryMonitorImportRowVo.java b/ems-system/src/main/java/com/xzzn/ems/domain/vo/SingleBatteryMonitorImportRowVo.java new file mode 100644 index 0000000..46321ff --- /dev/null +++ b/ems-system/src/main/java/com/xzzn/ems/domain/vo/SingleBatteryMonitorImportRowVo.java @@ -0,0 +1,115 @@ +package com.xzzn.ems.domain.vo; + +import com.xzzn.common.annotation.Excel; + +public class SingleBatteryMonitorImportRowVo { + + private Integer rowNum; + + @Excel(name = "站点ID") + private String siteId; + + @Excel(name = "电池堆编号") + private String stackDeviceId; + + @Excel(name = "电池簇编号") + private String clusterDeviceId; + + @Excel(name = "单体编号") + private String batteryDeviceId; + + @Excel(name = "单体名称") + private String batteryDeviceName; + + @Excel(name = "电压点位ID") + private String voltagePointId; + + @Excel(name = "温度点位ID") + private String temperaturePointId; + + @Excel(name = "SOC点位ID") + private String socPointId; + + @Excel(name = "SOH点位ID") + private String sohPointId; + + public Integer getRowNum() { + return rowNum; + } + + public void setRowNum(Integer rowNum) { + this.rowNum = rowNum; + } + + public String getSiteId() { + return siteId; + } + + public void setSiteId(String siteId) { + this.siteId = siteId; + } + + public String getStackDeviceId() { + return stackDeviceId; + } + + public void setStackDeviceId(String stackDeviceId) { + this.stackDeviceId = stackDeviceId; + } + + public String getClusterDeviceId() { + return clusterDeviceId; + } + + public void setClusterDeviceId(String clusterDeviceId) { + this.clusterDeviceId = clusterDeviceId; + } + + public String getBatteryDeviceId() { + return batteryDeviceId; + } + + public void setBatteryDeviceId(String batteryDeviceId) { + this.batteryDeviceId = batteryDeviceId; + } + + public String getBatteryDeviceName() { + return batteryDeviceName; + } + + public void setBatteryDeviceName(String batteryDeviceName) { + this.batteryDeviceName = batteryDeviceName; + } + + public String getVoltagePointId() { + return voltagePointId; + } + + public void setVoltagePointId(String voltagePointId) { + this.voltagePointId = voltagePointId; + } + + public String getTemperaturePointId() { + return temperaturePointId; + } + + public void setTemperaturePointId(String temperaturePointId) { + this.temperaturePointId = temperaturePointId; + } + + public String getSocPointId() { + return socPointId; + } + + public void setSocPointId(String socPointId) { + this.socPointId = socPointId; + } + + public String getSohPointId() { + return sohPointId; + } + + public void setSohPointId(String sohPointId) { + this.sohPointId = sohPointId; + } +} diff --git a/ems-system/src/main/java/com/xzzn/ems/mapper/SysBizRemarkMapper.java b/ems-system/src/main/java/com/xzzn/ems/mapper/SysBizRemarkMapper.java new file mode 100644 index 0000000..11c8e24 --- /dev/null +++ b/ems-system/src/main/java/com/xzzn/ems/mapper/SysBizRemarkMapper.java @@ -0,0 +1,21 @@ +package com.xzzn.ems.mapper; + +import com.xzzn.ems.domain.SysBizRemark; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +public interface SysBizRemarkMapper +{ + SysBizRemark selectByBizKeys(@Param("bizType") String bizType, + @Param("bizKey1") String bizKey1, + @Param("bizKey2") String bizKey2); + + List selectByBizKey2List(@Param("bizType") String bizType, + @Param("bizKey1") String bizKey1, + @Param("bizKey2List") List bizKey2List); + + int insertSysBizRemark(SysBizRemark bizRemark); + + int updateSysBizRemark(SysBizRemark bizRemark); +} diff --git a/ems-system/src/main/java/com/xzzn/ems/service/ISysBizRemarkService.java b/ems-system/src/main/java/com/xzzn/ems/service/ISysBizRemarkService.java new file mode 100644 index 0000000..7ed4e22 --- /dev/null +++ b/ems-system/src/main/java/com/xzzn/ems/service/ISysBizRemarkService.java @@ -0,0 +1,13 @@ +package com.xzzn.ems.service; + +import com.xzzn.ems.domain.vo.BizRemarkSaveRequest; + +import java.util.List; +import java.util.Map; + +public interface ISysBizRemarkService +{ + Map getRemarkMap(String bizType, String bizKey1, List bizKey2List); + + int saveRemark(BizRemarkSaveRequest request, String username); +} diff --git a/ems-system/src/main/java/com/xzzn/ems/service/impl/SysBizRemarkServiceImpl.java b/ems-system/src/main/java/com/xzzn/ems/service/impl/SysBizRemarkServiceImpl.java new file mode 100644 index 0000000..3d4209c --- /dev/null +++ b/ems-system/src/main/java/com/xzzn/ems/service/impl/SysBizRemarkServiceImpl.java @@ -0,0 +1,69 @@ +package com.xzzn.ems.service.impl; + +import com.xzzn.common.utils.DateUtils; +import com.xzzn.common.utils.StringUtils; +import com.xzzn.ems.domain.SysBizRemark; +import com.xzzn.ems.domain.vo.BizRemarkSaveRequest; +import com.xzzn.ems.mapper.SysBizRemarkMapper; +import com.xzzn.ems.service.ISysBizRemarkService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +@Service +public class SysBizRemarkServiceImpl implements ISysBizRemarkService +{ + @Autowired + private SysBizRemarkMapper sysBizRemarkMapper; + + @Override + public Map getRemarkMap(String bizType, String bizKey1, List bizKey2List) + { + if (StringUtils.isAnyBlank(bizType, bizKey1) || bizKey2List == null || bizKey2List.isEmpty()) + { + return Collections.emptyMap(); + } + List remarkList = sysBizRemarkMapper.selectByBizKey2List(bizType, bizKey1, bizKey2List); + Map result = new LinkedHashMap<>(); + for (SysBizRemark item : remarkList) + { + result.put(item.getBizKey2(), StringUtils.nvl(item.getRemark(), "")); + } + return result; + } + + @Override + public int saveRemark(BizRemarkSaveRequest request, String username) + { + if (request == null || StringUtils.isAnyBlank(request.getBizType(), request.getBizKey1(), request.getBizKey2())) + { + return 0; + } + + SysBizRemark existed = sysBizRemarkMapper.selectByBizKeys(request.getBizType(), request.getBizKey1(), request.getBizKey2()); + if (existed == null) + { + SysBizRemark bizRemark = new SysBizRemark(); + bizRemark.setBizType(request.getBizType()); + bizRemark.setBizKey1(request.getBizKey1()); + bizRemark.setBizKey2(request.getBizKey2()); + bizRemark.setRemark(StringUtils.nvl(request.getRemark(), "")); + bizRemark.setCreateBy(username); + bizRemark.setUpdateBy(username); + bizRemark.setCreateTime(DateUtils.getNowDate()); + bizRemark.setUpdateTime(DateUtils.getNowDate()); + bizRemark.setDelFlag("0"); + return sysBizRemarkMapper.insertSysBizRemark(bizRemark); + } + + existed.setRemark(StringUtils.nvl(request.getRemark(), "")); + existed.setUpdateBy(username); + existed.setUpdateTime(DateUtils.getNowDate()); + existed.setDelFlag("0"); + return sysBizRemarkMapper.updateSysBizRemark(existed); + } +}