1.台账:台账审核和变压器台账

2.配网:稳态指标和暂态指标部分接口
3.指标分类,修改变电站名称异常bug
This commit is contained in:
wurui
2023-02-24 15:37:17 +08:00
parent 065454db0c
commit 17b075f548
23 changed files with 281 additions and 104 deletions

View File

@@ -24,6 +24,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.njcn.web.controller.BaseController;
import java.util.List;
import java.util.Objects;
/**
@@ -47,9 +48,9 @@ public class MonitorAuditController extends BaseController {
@PostMapping("/getAllMonitorAuditList")
@ApiOperation("分页获取台账审核")
@ApiImplicitParam(name = "baseParam", required = true)
public HttpResult<Page<MonitorAudit>> getAllMonitorAuditList(@RequestBody MonitorAuditParam baseParam) {
public HttpResult<List<MonitorAudit>> getAllMonitorAuditList(@RequestBody MonitorAuditParam baseParam) {
String methodDescribe = getMethodDescribe("getAllMonitorAuditList");
Page<MonitorAudit> monitor = monitorAuditService.getAllMonitorAuditList(baseParam);
List<MonitorAudit> monitor = monitorAuditService.getAllMonitorAuditList(baseParam);
if (Objects.isNull(monitor)) {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.NO_DATA, null, methodDescribe);
} else {

View File

@@ -9,7 +9,7 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil;
import com.njcn.device.pms.pojo.param.MonitorAuditParam;
import com.njcn.device.pms.pojo.param.MonitorStatus;
import com.njcn.device.pms.pojo.param.TransformerParam;
import com.njcn.device.pms.pojo.po.Transformer;
import com.njcn.device.pms.service.majornetwork.ITransformerService;
import io.swagger.annotations.Api;
@@ -24,6 +24,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.njcn.web.controller.BaseController;
import java.util.List;
import java.util.Objects;
/**
@@ -57,18 +58,47 @@ public class TransformerController extends BaseController {
}
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.UPDATE)
@PostMapping("/updateStatus")
@ApiOperation("修改变压器台账数据状态")
@ApiImplicitParam(name = "monitorParam", value = "修改台账审核数据状态", required = true)
public HttpResult<Boolean> updateStatus(@RequestBody @Validated MonitorStatus.Status monitorParam) {
String methodDescribe = getMethodDescribe("updateStatus");
boolean result = transformerService.updateStatus(monitorParam);
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD)
@PostMapping("/addTransformer")
@ApiOperation("添加变压器台账信息")
@ApiImplicitParam(name = "param", value = "添加变压器台账信息", required = true)
public HttpResult<Boolean> addTransformer(@RequestBody @Validated TransformerParam param) {
String methodDescribe = getMethodDescribe("addTransformer");
boolean result = transformerService.addTransformer(param);
if (result) {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
}
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.UPDATE)
@PostMapping("/updateTransformer")
@ApiOperation("修改变压器台账信息")
@ApiImplicitParam(name = "param", value = "修改变压器台账数据", required = true)
public HttpResult<Boolean> updateTransformer(@RequestBody @Validated TransformerParam param) {
String methodDescribe = getMethodDescribe("updateTransformer");
boolean result = transformerService.updateTransformer(param);
if (result) {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
}
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.DELETE)
@PostMapping("/delTransformer")
@ApiOperation("删除变压器台账信息")
@ApiImplicitParam(name = "ids", value = "删除变电站台账id", required = true)
public HttpResult<Boolean> delTransformer(@RequestBody List<String> ids) {
String methodDescribe = getMethodDescribe("delTransformer");
boolean result = transformerService.delTransformer(ids);
if (result) {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
}
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
}
}

View File

@@ -1,11 +1,12 @@
package com.njcn.device.pms.service.majornetwork;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.njcn.device.pms.pojo.param.MonitorAuditParam;
import com.njcn.device.pms.pojo.param.MonitorStatus;
import com.njcn.device.pms.pojo.po.MonitorAudit;
import java.util.List;
/**
* <p>
* 台账审核服务类
@@ -22,7 +23,7 @@ public interface IMonitorAuditService extends IService<MonitorAudit> {
* @param baseParam
* @return
*/
Page<MonitorAudit> getAllMonitorAuditList(MonitorAuditParam baseParam);
List<MonitorAudit> getAllMonitorAuditList(MonitorAuditParam baseParam);
/***
* 添加台账审核

View File

@@ -7,6 +7,8 @@ import com.njcn.device.pms.pojo.param.MonitorStatus;
import com.njcn.device.pms.pojo.param.TransformerParam;
import com.njcn.device.pms.pojo.po.Transformer;
import java.util.List;
/**
* <p>
* 变压器台账 服务类
@@ -43,6 +45,15 @@ public interface ITransformerService extends IService<Transformer> {
*/
boolean updateTransformer(TransformerParam param);
/***
* 删除变压器信息
* @author wr
* @date 2023-02-23 17:21
* @param ids
* @return boolean
*/
boolean delTransformer(List<String> ids);
/**
* 修改变压器台账数据状态
*

View File

@@ -14,6 +14,8 @@ import com.njcn.device.pms.service.majornetwork.IMonitorAuditService;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* <p>
* 台账审核 服务实现类
@@ -26,7 +28,7 @@ import org.springframework.stereotype.Service;
public class MonitorAuditServiceImpl extends ServiceImpl<MonitorAuditMapper, MonitorAudit> implements IMonitorAuditService {
@Override
public Page<MonitorAudit> getAllMonitorAuditList(MonitorAuditParam baseParam) {
public List<MonitorAudit> getAllMonitorAuditList(MonitorAuditParam baseParam) {
LambdaQueryWrapper<MonitorAudit> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper
.like(StrUtil.isNotBlank(baseParam.getSubmitName()), MonitorAudit::getAuditName, baseParam.getSubmitName())
@@ -37,7 +39,7 @@ public class MonitorAuditServiceImpl extends ServiceImpl<MonitorAuditMapper, Mon
.le(StringUtils.isNotBlank(baseParam.getSearchEndTime()), MonitorAudit::getCreateTime, baseParam.getSearchEndTime())
.orderByAsc(MonitorAudit::getStatus);
;
return this.page(new Page<>(baseParam.getPageNum(), baseParam.getPageSize()), lambdaQueryWrapper);
return this.list(lambdaQueryWrapper);
}
@Override

View File

@@ -109,6 +109,9 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
.like(StringUtils.isNotBlank(pmsMonitorParam.getPowerrName()), Monitor::getPowerrName, pmsMonitorParam.getPowerrName())
.eq(Objects.nonNull(pmsMonitorParam.getIsSpecialMonitor()), Monitor::getIsSpecialMonitor, pmsMonitorParam.getIsSpecialMonitor())
.eq(StringUtils.isNotBlank(pmsMonitorParam.getMonitorType()), Monitor::getMonitorType, pmsMonitorParam.getMonitorType())
.in(CollUtil.isNotEmpty(pmsMonitorParam.getMonitorTags()), Monitor::getMonitorTag, pmsMonitorParam.getMonitorTags())
.eq(StringUtils.isNotBlank(pmsMonitorParam.getMonitorState()), Monitor::getMonitorState, pmsMonitorParam.getMonitorState())
.eq(StringUtils.isNotBlank(pmsMonitorParam.getMonitorTag()), Monitor::getMonitorTag, pmsMonitorParam.getMonitorTag());

View File

@@ -1,6 +1,8 @@
package com.njcn.device.pms.service.majornetwork.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
@@ -15,6 +17,8 @@ import com.njcn.device.pms.pojo.po.Transformer;
import com.njcn.device.pms.service.majornetwork.ITransformerService;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* <p>
* 变压器台账 服务实现类
@@ -32,14 +36,20 @@ public class TransformerServiceImpl extends ServiceImpl<TransformerMapper, Trans
lambdaQueryWrapper
.like(StrUtil.isNotBlank(baseParam.getSubmitName()), Transformer::getName, baseParam.getSubmitName())
.eq(baseParam.getStatus() != null, Transformer::getType, baseParam.getStatus())
.eq(Transformer::getStatus, DataStateEnum.ENABLE.getCode())
;
return this.page(new Page<>(baseParam.getPageNum(), baseParam.getPageSize()), lambdaQueryWrapper);
.eq(Transformer::getStatus, DataStateEnum.ENABLE.getCode());
return this.page(new Page<>(baseParam.getPageNum(), baseParam.getPageSize()),lambdaQueryWrapper);
}
@Override
public boolean addTransformer(TransformerParam param) {
int count = this.count(new LambdaQueryWrapper<Transformer>()
.eq(Transformer::getName, param.getName())
.eq(Transformer::getStatus, DataStateEnum.ENABLE.getCode())
);
Assert.isTrue(count == 0 , "变压器名称重复,请重新编写变压器名称");
Transformer transformer = BeanUtil.copyProperties(param, Transformer.class);
transformer.setStatus(1);
return this.save(transformer);
}
@@ -49,6 +59,12 @@ public class TransformerServiceImpl extends ServiceImpl<TransformerMapper, Trans
return this.updateById(transformer);
}
@Override
public boolean delTransformer(List<String> ids) {
Assert.isTrue(CollectionUtil.isNotEmpty(ids) , "删除变压器id为空");
return this.removeByIds(ids);
}
@Override
public boolean updateStatus(MonitorStatus.Status monitorParam) {
LambdaUpdateWrapper<Transformer> update = new LambdaUpdateWrapper<>();
@@ -56,4 +72,5 @@ public class TransformerServiceImpl extends ServiceImpl<TransformerMapper, Trans
.in(Transformer::getId, monitorParam.getId());
return this.update(update);
}
}