两级贯通接口开发

This commit is contained in:
cdf
2024-05-15 10:19:59 +08:00
parent b213b66f46
commit 79248176b7
19 changed files with 479 additions and 112 deletions

View File

@@ -0,0 +1,56 @@
package com.njcn.device.pms.controller.ledgerManger;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.njcn.common.pojo.annotation.OperateInfo;
import com.njcn.common.pojo.enums.common.LogEnum;
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.po.PmsMidLedger;
import com.njcn.device.pms.service.ledgerManger.IPmsMidLedgerService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
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;
import com.njcn.web.controller.BaseController;
import java.util.List;
/**
* <p>
* 变电站-母线数据中间表 前端控制器
* </p>
*
* @author hongawen
* @since 2024-05-14
*/
@RestController
@RequestMapping("pms/pmsMidLedger")
@RequiredArgsConstructor
public class PmsMidLedgerController extends BaseController {
private final IPmsMidLedgerService iPmsMidLedgerService;
/**
* 获取中台电站母线信息
* @author cdf
* @date 2024/5/14
*/
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/getPmsMidLedgerList")
@ApiOperation("获取中台电站母线信息")
@ApiImplicitParam(name = "ids",value = "母线电站编号",required = true)
public HttpResult<List<PmsMidLedger>> getPmsMidLedgerList(@RequestBody List<String> ids){
String methodDescribe = getMethodDescribe("getPmsMidLedgerList");
List<PmsMidLedger> result = iPmsMidLedgerService.list(new LambdaQueryWrapper<PmsMidLedger>().in(PmsMidLedger::getId,ids));
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
}
}

View File

@@ -138,6 +138,16 @@ public class PmsMonitorController extends BaseController {
}
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/getMonitorPage")
@ApiOperation("获取所有主网监测点(或者指定监测点编号查询)")
@ApiImplicitParam(name = "monitorIds",value = "主网监测点编号",required = true)
public HttpResult<Page<Monitor>> getMonitorPage(@RequestBody TerminalQueryParam baseParam) {
String methodDescribe = getMethodDescribe("getMonitorPage");
Page<Monitor> monitor= monitorService.getMonitorPage(baseParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, monitor, methodDescribe);
}
/**
* 根据条件获取所有主网监测点
* @author cdf
@@ -310,6 +320,9 @@ public class PmsMonitorController extends BaseController {
}
public static void main(String[] args) throws IOException {
/*try {
// 创建一个临时文件,前缀为"temp_",后缀为".txt",存储在默认的临时文件夹中

View File

@@ -0,0 +1,16 @@
package com.njcn.device.pms.service.ledgerManger;
import com.njcn.device.pms.pojo.po.PmsMidLedger;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 变电站-母线数据中间表 服务类
* </p>
*
* @author hongawen
* @since 2024-05-14
*/
public interface IPmsMidLedgerService extends IService<PmsMidLedger> {
}

View File

@@ -0,0 +1,21 @@
package com.njcn.device.pms.service.ledgerManger.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.njcn.device.pms.mapper.majornetwork.PmsMidLedgerMapper;
import com.njcn.device.pms.pojo.po.PmsMidLedger;
import com.njcn.device.pms.service.ledgerManger.IPmsMidLedgerService;
import org.springframework.stereotype.Service;
/**
* <p>
* 变电站-母线数据中间表 服务实现类
* </p>
*
* @author hongawen
* @since 2024-05-14
*/
@Service
public class PmsMidLedgerServiceImpl extends ServiceImpl<PmsMidLedgerMapper, PmsMidLedger> implements IPmsMidLedgerService {
}

View File

@@ -82,6 +82,9 @@ public interface IMonitorService extends IService<Monitor> {
List<Monitor> getMonitorList(List<String> monitorIds);
Page<Monitor> getMonitorPage(TerminalQueryParam baseParam);
List<Monitor> getMonitorListByParam(MonitorParam monitorParam);

View File

@@ -292,6 +292,16 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
return monitorList;
}
@Override
public Page<Monitor> getMonitorPage(TerminalQueryParam baseParam) {
LambdaQueryWrapper<Monitor> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(Monitor::getStatus, DataStateEnum.ENABLE.getCode());
lambdaQueryWrapper.in(Monitor::getId, baseParam.getMonitorIds());
Page<Monitor> page = this.page(new Page<>(PageFactory.getPageNum(baseParam),PageFactory.getPageSize(baseParam)),lambdaQueryWrapper);
return page;
}
@Override
public List<Monitor> getMonitorListByParam(MonitorParam monitorParam) {
LambdaQueryWrapper<Monitor> lambdaQueryWrapper = new LambdaQueryWrapper<>();