feat: 增加电站预警提示-设计参数变更
This commit is contained in:
parent
4f92bd6a57
commit
a2156ecc15
@ -0,0 +1,40 @@
|
|||||||
|
package com.yfd.platform.qgc_lygk.along.controller;
|
||||||
|
|
||||||
|
import com.yfd.platform.common.DataSourceRequest;
|
||||||
|
import com.yfd.platform.common.DataSourceResult;
|
||||||
|
import com.yfd.platform.common.utils.UserNameFillHelper;
|
||||||
|
import com.yfd.platform.config.ResponseResult;
|
||||||
|
import com.yfd.platform.qgc_lygk.along.domain.SdChgWarningR;
|
||||||
|
import com.yfd.platform.qgc_lygk.along.service.ISdChgWarningRService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重大变动事前事中事后预警控制器
|
||||||
|
*
|
||||||
|
* @author migration
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/base/engWarning")
|
||||||
|
@Tag(name = "电站预警提示-设计参数变更")
|
||||||
|
public class SdChgWarningRController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ISdChgWarningRService sdChgWarningRService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private UserNameFillHelper userNameFillHelper;
|
||||||
|
|
||||||
|
@PostMapping("/GetKendoList")
|
||||||
|
@Operation(summary = "条件过滤数据列表")
|
||||||
|
public ResponseResult getKendoList(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||||
|
DataSourceResult<SdChgWarningR> result = sdChgWarningRService.getKendoList(dataSourceRequest);
|
||||||
|
userNameFillHelper.fillUserNames(result.getData());
|
||||||
|
return ResponseResult.successData(result);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,100 @@
|
|||||||
|
package com.yfd.platform.qgc_lygk.along.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.yfd.platform.annotation.UserIdField;
|
||||||
|
import com.yfd.platform.annotation.UserNameField;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重大变动事前事中事后预警表
|
||||||
|
*
|
||||||
|
* @author migration
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("SD_CHGWARNING_R")
|
||||||
|
@Schema(description = "重大变动事前事中事后预警表")
|
||||||
|
public class SdChgWarningR implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 主键 */
|
||||||
|
@TableId(type = IdType.ASSIGN_UUID)
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/** 工程stcd */
|
||||||
|
@TableField("STCD")
|
||||||
|
private String stcd;
|
||||||
|
|
||||||
|
/** 阶段类型 */
|
||||||
|
@TableField("STAGE")
|
||||||
|
private String stage;
|
||||||
|
|
||||||
|
/** 异常类型名称 */
|
||||||
|
@TableField("MESSAGENAME")
|
||||||
|
private String messagename;
|
||||||
|
|
||||||
|
/** 对比阶段 */
|
||||||
|
@TableField("CONTRASTPHASE")
|
||||||
|
private String contrastphase;
|
||||||
|
|
||||||
|
/** 当前阶段 */
|
||||||
|
@TableField("CURRENTSTAGE")
|
||||||
|
private String currentstage;
|
||||||
|
|
||||||
|
/** 对比阶段数值 */
|
||||||
|
@TableField("PHASEVALUE")
|
||||||
|
private String phasevalue;
|
||||||
|
|
||||||
|
/** 当前阶段数值 */
|
||||||
|
@TableField("STAGEVALUE")
|
||||||
|
private String stagevalue;
|
||||||
|
|
||||||
|
/** 当前阶段标识 */
|
||||||
|
@TableField("CURRENTSTAGEKEY")
|
||||||
|
private String currentstagekey;
|
||||||
|
|
||||||
|
/** 创建人 */
|
||||||
|
@TableField("RECORD_USER")
|
||||||
|
@UserIdField
|
||||||
|
private String recordUser;
|
||||||
|
|
||||||
|
/** 创建人名称(非数据库字段) */
|
||||||
|
@TableField(exist = false)
|
||||||
|
@UserNameField
|
||||||
|
private String recordUserName;
|
||||||
|
|
||||||
|
/** 创建时间 */
|
||||||
|
@TableField("RECORD_TIME")
|
||||||
|
private Date recordTime;
|
||||||
|
|
||||||
|
/** 更新人 */
|
||||||
|
@TableField("MODIFY_USER")
|
||||||
|
private String modifyUser;
|
||||||
|
|
||||||
|
/** 更新人名称(非数据库字段) */
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String modifyUserName;
|
||||||
|
|
||||||
|
/** 更新时间 */
|
||||||
|
@TableField("MODIFY_TIME")
|
||||||
|
private Date modifyTime;
|
||||||
|
|
||||||
|
/** 是否已删除:0=未删除 1=已删除 */
|
||||||
|
@TableField("IS_DELETED")
|
||||||
|
private Integer isDeleted;
|
||||||
|
|
||||||
|
/** 删除人 */
|
||||||
|
@TableField("DELETE_USER")
|
||||||
|
private String deleteUser;
|
||||||
|
|
||||||
|
/** 删除时间 */
|
||||||
|
@TableField("DELETE_TIME")
|
||||||
|
private Date deleteTime;
|
||||||
|
}
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
package com.yfd.platform.qgc_lygk.along.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.yfd.platform.qgc_lygk.along.domain.SdChgWarningR;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重大变动事前事中事后预警表 Mapper 接口
|
||||||
|
*
|
||||||
|
* @author migration
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface SdChgWarningRMapper extends BaseMapper<SdChgWarningR> {
|
||||||
|
}
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
package com.yfd.platform.qgc_lygk.along.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.yfd.platform.common.DataSourceRequest;
|
||||||
|
import com.yfd.platform.common.DataSourceResult;
|
||||||
|
import com.yfd.platform.qgc_lygk.along.domain.SdChgWarningR;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重大变动事前事中事后预警表 Service 接口
|
||||||
|
*
|
||||||
|
* @author migration
|
||||||
|
*/
|
||||||
|
public interface ISdChgWarningRService extends IService<SdChgWarningR> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 条件过滤数据列表(Kendo 数据源)
|
||||||
|
*/
|
||||||
|
DataSourceResult<SdChgWarningR> getKendoList(DataSourceRequest dataSourceRequest);
|
||||||
|
}
|
||||||
@ -0,0 +1,55 @@
|
|||||||
|
package com.yfd.platform.qgc_lygk.along.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.yfd.platform.common.DataSourceLoadOptionsBase;
|
||||||
|
import com.yfd.platform.common.DataSourceRequest;
|
||||||
|
import com.yfd.platform.common.DataSourceResult;
|
||||||
|
import com.yfd.platform.qgc_lygk.along.domain.SdChgWarningR;
|
||||||
|
import com.yfd.platform.qgc_lygk.along.mapper.SdChgWarningRMapper;
|
||||||
|
import com.yfd.platform.qgc_lygk.along.service.ISdChgWarningRService;
|
||||||
|
import com.yfd.platform.utils.DataSourceRequestUtil;
|
||||||
|
import com.yfd.platform.utils.QgcQueryWrapperUtil;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重大变动事前事中事后预警表 Service 实现类
|
||||||
|
*
|
||||||
|
* @author migration
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class SdChgWarningRServiceImpl extends ServiceImpl<SdChgWarningRMapper, SdChgWarningR> implements ISdChgWarningRService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DataSourceResult<SdChgWarningR> getKendoList(DataSourceRequest dataSourceRequest) {
|
||||||
|
// 1. 构建查询条件
|
||||||
|
QueryWrapper<SdChgWarningR> wrapper = DataSourceRequestUtil.buildQueryWrapper(
|
||||||
|
dataSourceRequest, SdChgWarningR.class);
|
||||||
|
|
||||||
|
// 2. 分页参数处理
|
||||||
|
DataSourceLoadOptionsBase loadOptions = dataSourceRequest == null ? null : dataSourceRequest.toDevRequest();
|
||||||
|
Page<SdChgWarningR> page = loadOptions == null ? null
|
||||||
|
: (Page<SdChgWarningR>) QgcQueryWrapperUtil.buildPage(loadOptions, loadOptions.getSkip(), loadOptions.getTake());
|
||||||
|
|
||||||
|
// 3. 执行查询
|
||||||
|
Page<SdChgWarningR> resultPage;
|
||||||
|
if (page != null) {
|
||||||
|
resultPage = this.page(page, wrapper);
|
||||||
|
} else {
|
||||||
|
List<SdChgWarningR> list = this.list(wrapper);
|
||||||
|
resultPage = new Page<>();
|
||||||
|
resultPage.setRecords(list);
|
||||||
|
resultPage.setTotal(list.size());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 4. 构建结果
|
||||||
|
DataSourceResult<SdChgWarningR> dataSourceResult = new DataSourceResult<>();
|
||||||
|
dataSourceResult.setData(resultPage.getRecords());
|
||||||
|
dataSourceResult.setTotal(resultPage.getTotal());
|
||||||
|
dataSourceResult.setAggregates(new java.util.HashMap<>());
|
||||||
|
return dataSourceResult;
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user