增加业务报表备注功能,可以根据业务设计开发,目前电表报表与收益报表均有备注列可以修改
This commit is contained in:
@ -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()));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -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<String> 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<String> getBizKey2List()
|
||||||
|
{
|
||||||
|
return bizKey2List;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBizKey2List(List<String> bizKey2List)
|
||||||
|
{
|
||||||
|
this.bizKey2List = bizKey2List;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -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<SingleBatteryMonitorImportFailureVo> 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<SingleBatteryMonitorImportFailureVo> getFailureDetails() {
|
||||||
|
return failureDetails;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFailureDetails(List<SingleBatteryMonitorImportFailureVo> failureDetails) {
|
||||||
|
this.failureDetails = failureDetails;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -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<SysBizRemark> selectByBizKey2List(@Param("bizType") String bizType,
|
||||||
|
@Param("bizKey1") String bizKey1,
|
||||||
|
@Param("bizKey2List") List<String> bizKey2List);
|
||||||
|
|
||||||
|
int insertSysBizRemark(SysBizRemark bizRemark);
|
||||||
|
|
||||||
|
int updateSysBizRemark(SysBizRemark bizRemark);
|
||||||
|
}
|
||||||
@ -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<String, String> getRemarkMap(String bizType, String bizKey1, List<String> bizKey2List);
|
||||||
|
|
||||||
|
int saveRemark(BizRemarkSaveRequest request, String username);
|
||||||
|
}
|
||||||
@ -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<String, String> getRemarkMap(String bizType, String bizKey1, List<String> bizKey2List)
|
||||||
|
{
|
||||||
|
if (StringUtils.isAnyBlank(bizType, bizKey1) || bizKey2List == null || bizKey2List.isEmpty())
|
||||||
|
{
|
||||||
|
return Collections.emptyMap();
|
||||||
|
}
|
||||||
|
List<SysBizRemark> remarkList = sysBizRemarkMapper.selectByBizKey2List(bizType, bizKey1, bizKey2List);
|
||||||
|
Map<String, String> 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user