feat: 新增预警&AI智能监测装置管理
This commit is contained in:
parent
35dfd82e8d
commit
3afbf3d33a
@ -0,0 +1,60 @@
|
||||
package com.yfd.platform.qgc_base.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.config.ResponseResult;
|
||||
import com.yfd.platform.qgc_base.domain.MsWarnRuleB;
|
||||
import com.yfd.platform.qgc_base.domain.SdEngInfoBHOperateRequest;
|
||||
import com.yfd.platform.qgc_base.service.IMsWarnRuleBService;
|
||||
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.*;
|
||||
|
||||
/**
|
||||
* 预警规则配置管理
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/base/warnRule")
|
||||
@Tag(name = "预警规则配置管理")
|
||||
public class MsWarnRuleBController {
|
||||
|
||||
@Resource
|
||||
private IMsWarnRuleBService service;
|
||||
|
||||
@Resource
|
||||
private ObjectMapper objectMapper;
|
||||
|
||||
@PostMapping("/page")
|
||||
@Operation(summary = "分页查询")
|
||||
public ResponseResult queryPageList(@RequestBody DataSourceRequest request) {
|
||||
Page<MsWarnRuleB> page = service.queryPageList(request);
|
||||
return ResponseResult.successData(page);
|
||||
}
|
||||
|
||||
@PostMapping("/add")
|
||||
@Operation(summary = "新增")
|
||||
public ResponseResult add(@RequestBody SdEngInfoBHOperateRequest request) {
|
||||
MsWarnRuleB entity = request == null || request.getEngInfo() == null ? null
|
||||
: objectMapper.convertValue(request.getEngInfo(), MsWarnRuleB.class);
|
||||
boolean result = service.add(entity, request == null ? null : request.getSource());
|
||||
return result ? ResponseResult.success("新增成功") : ResponseResult.error("新增失败");
|
||||
}
|
||||
|
||||
@PostMapping("/update")
|
||||
@Operation(summary = "修改")
|
||||
public ResponseResult update(@RequestBody SdEngInfoBHOperateRequest request) {
|
||||
MsWarnRuleB entity = request == null || request.getEngInfo() == null ? null
|
||||
: objectMapper.convertValue(request.getEngInfo(), MsWarnRuleB.class);
|
||||
boolean result = service.update(entity, request == null ? null : request.getSource());
|
||||
return result ? ResponseResult.success("修改成功") : ResponseResult.error("修改失败");
|
||||
}
|
||||
|
||||
@PostMapping("/delete")
|
||||
@Operation(summary = "删除")
|
||||
public ResponseResult delete(@RequestBody SdEngInfoBHOperateRequest request) {
|
||||
boolean result = service.delete(request == null ? null : request.getIds(), request == null ? null : request.getSource());
|
||||
return result ? ResponseResult.success("删除成功") : ResponseResult.error("删除失败");
|
||||
}
|
||||
}
|
||||
@ -14,7 +14,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/base/aibox")
|
||||
@Tag(name = "AI智能监测装置管理")
|
||||
@Tag(name = "AI边缘计算盒子管理")
|
||||
public class SdAiboxBHController {
|
||||
|
||||
@Resource
|
||||
|
||||
@ -0,0 +1,60 @@
|
||||
package com.yfd.platform.qgc_base.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.config.ResponseResult;
|
||||
import com.yfd.platform.qgc_base.domain.SdAimonitorBH;
|
||||
import com.yfd.platform.qgc_base.domain.SdEngInfoBHOperateRequest;
|
||||
import com.yfd.platform.qgc_base.service.ISdAimonitorBHService;
|
||||
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.*;
|
||||
|
||||
/**
|
||||
* AI智能监测装置管理
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/base/aimonitor")
|
||||
@Tag(name = "AI智能监测装置管理")
|
||||
public class SdAimonitorBHController {
|
||||
|
||||
@Resource
|
||||
private ISdAimonitorBHService service;
|
||||
|
||||
@Resource
|
||||
private ObjectMapper objectMapper;
|
||||
|
||||
@PostMapping("/page")
|
||||
@Operation(summary = "分页查询")
|
||||
public ResponseResult queryPageList(@RequestBody DataSourceRequest request) {
|
||||
Page<SdAimonitorBH> page = service.queryPageList(request);
|
||||
return ResponseResult.successData(page);
|
||||
}
|
||||
|
||||
@PostMapping("/add")
|
||||
@Operation(summary = "新增")
|
||||
public ResponseResult add(@RequestBody SdEngInfoBHOperateRequest request) {
|
||||
SdAimonitorBH entity = request == null || request.getEngInfo() == null ? null
|
||||
: objectMapper.convertValue(request.getEngInfo(), SdAimonitorBH.class);
|
||||
boolean result = service.add(entity, request == null ? null : request.getSource());
|
||||
return result ? ResponseResult.success("新增成功") : ResponseResult.error("新增失败");
|
||||
}
|
||||
|
||||
@PostMapping("/update")
|
||||
@Operation(summary = "修改")
|
||||
public ResponseResult update(@RequestBody SdEngInfoBHOperateRequest request) {
|
||||
SdAimonitorBH entity = request == null || request.getEngInfo() == null ? null
|
||||
: objectMapper.convertValue(request.getEngInfo(), SdAimonitorBH.class);
|
||||
boolean result = service.update(entity, request == null ? null : request.getSource());
|
||||
return result ? ResponseResult.success("修改成功") : ResponseResult.error("修改失败");
|
||||
}
|
||||
|
||||
@PostMapping("/delete")
|
||||
@Operation(summary = "删除")
|
||||
public ResponseResult delete(@RequestBody SdEngInfoBHOperateRequest request) {
|
||||
boolean result = service.delete(request == null ? null : request.getIds(), request == null ? null : request.getSource());
|
||||
return result ? ResponseResult.success("删除成功") : ResponseResult.error("删除失败");
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,85 @@
|
||||
package com.yfd.platform.qgc_base.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 预警规则配置基础表
|
||||
*
|
||||
* @author migration
|
||||
*/
|
||||
@Data
|
||||
@TableName("MS_WARN_RULE_B")
|
||||
public class MsWarnRuleB implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.ASSIGN_UUID)
|
||||
private String id;
|
||||
|
||||
/** 预警规则类型:WQLVL=水质预警 EQMN=电站生态流量(环保部) EQMNMWR=电站生态流量(水利部) RSVRFSR=水位预警 */
|
||||
@TableField("RULE_TYPE")
|
||||
private String ruleType;
|
||||
|
||||
/** 预警规则名称 */
|
||||
@TableField("RULE_NAME")
|
||||
private String ruleName;
|
||||
|
||||
/** 规则编码 global=全局规则 common=通用告警规则 custom=自定义告警规则 */
|
||||
@TableField("RULE_CODE")
|
||||
private String ruleCode;
|
||||
|
||||
/** 自定义规则时,标识规则所属测站 */
|
||||
@TableField("STCD")
|
||||
private String stcd;
|
||||
|
||||
/** 备注 */
|
||||
@TableField("DESCRIPTION")
|
||||
private String description;
|
||||
|
||||
/** 是否展示告警等级 0=不展示 1=展示 */
|
||||
@TableField("IS_SHOW")
|
||||
private Integer isShow;
|
||||
|
||||
/** 隔离ID */
|
||||
@TableField("ISOLATE_ID")
|
||||
private String isolateId;
|
||||
|
||||
/** 数据来源 */
|
||||
@TableField("VLSR")
|
||||
private String vlsr;
|
||||
|
||||
/** 数据来源时间 */
|
||||
@TableField("VLSR_TM")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date vlsrTm;
|
||||
|
||||
// ---------- 审计字段 ----------
|
||||
|
||||
@TableField("RECORD_USER")
|
||||
private String recordUser;
|
||||
|
||||
@TableField("RECORD_TIME")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date recordTime;
|
||||
|
||||
@TableField("MODIFY_USER")
|
||||
private String modifyUser;
|
||||
|
||||
@TableField("MODIFY_TIME")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date modifyTime;
|
||||
|
||||
@TableField("IS_DELETED")
|
||||
private Integer isDeleted;
|
||||
|
||||
@TableField("DELETE_USER")
|
||||
private String deleteUser;
|
||||
|
||||
@TableField("DELETE_TIME")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date deleteTime;
|
||||
}
|
||||
@ -0,0 +1,171 @@
|
||||
package com.yfd.platform.qgc_base.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* AI智能监测装置基本属性表
|
||||
*
|
||||
* @author migration
|
||||
*/
|
||||
@Data
|
||||
@TableName("SD_AIMONITOR_B_H")
|
||||
public class SdAimonitorBH implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.INPUT)
|
||||
private String stcd;
|
||||
|
||||
private String stnm;
|
||||
|
||||
private String sttp;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String sttpName;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date tm;
|
||||
|
||||
private BigDecimal lgtd;
|
||||
|
||||
private BigDecimal lttd;
|
||||
|
||||
private BigDecimal elev;
|
||||
|
||||
private String stlc;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date jcdt;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date wddt;
|
||||
|
||||
@TableField("BLDSTT_CODE")
|
||||
private Integer bldsttCode;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String bldsttCodeName;
|
||||
|
||||
private Integer usfl;
|
||||
|
||||
private Integer dtin;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String dtinName;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@TableField("DTIN_TM")
|
||||
private Date dtinTm;
|
||||
|
||||
private Integer mway;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String mwayName;
|
||||
|
||||
@TableField("STINDX")
|
||||
private String stindx;
|
||||
|
||||
@TableField("ORDER_INDEX")
|
||||
private Integer orderIndex;
|
||||
|
||||
private String rstcd;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String ennm;
|
||||
|
||||
@TableField("BASE_ID")
|
||||
private String baseId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String baseName;
|
||||
|
||||
private String hbrvcd;
|
||||
|
||||
private String rvcd;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String rvnm;
|
||||
|
||||
private String introduce;
|
||||
|
||||
private String logo;
|
||||
|
||||
private String inffile;
|
||||
|
||||
private Integer dtfrqcy;
|
||||
|
||||
private String remark;
|
||||
|
||||
private String vlsr;
|
||||
|
||||
@TableField("VLSR_TM")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date vlsrTm;
|
||||
|
||||
/** 服务对象 */
|
||||
@TableField("FWDX")
|
||||
private String fwdx;
|
||||
|
||||
/** 供电方式 */
|
||||
@TableField("GDFS")
|
||||
private String gdfs;
|
||||
|
||||
/** AI盒子配置 */
|
||||
@TableField("AIPZ")
|
||||
private String aipz;
|
||||
|
||||
/** 模型版本 */
|
||||
@TableField("MXBB")
|
||||
private String mxbb;
|
||||
|
||||
/** IP地址 */
|
||||
@TableField("IPADDR")
|
||||
private String ipaddr;
|
||||
|
||||
/** SIM卡信息 */
|
||||
@TableField("SIMINFO")
|
||||
private String siminfo;
|
||||
|
||||
/** 用途 */
|
||||
@TableField("PURPOSE")
|
||||
private String purpose;
|
||||
|
||||
/** 观察方式 */
|
||||
@TableField("OBSERVE")
|
||||
private String observe;
|
||||
|
||||
/** 地形裁剪范围 */
|
||||
@TableField("BOX")
|
||||
private String box;
|
||||
|
||||
// ---------- 审计字段 ----------
|
||||
|
||||
@TableField("RECORD_USER")
|
||||
private String recordUser;
|
||||
|
||||
@TableField("RECORD_TIME")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date recordTime;
|
||||
|
||||
@TableField("MODIFY_USER")
|
||||
private String modifyUser;
|
||||
|
||||
@TableField("MODIFY_TIME")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date modifyTime;
|
||||
|
||||
@TableField("IS_DELETED")
|
||||
private Integer isDeleted;
|
||||
|
||||
@TableField("DELETE_USER")
|
||||
private String deleteUser;
|
||||
|
||||
@TableField("DELETE_TIME")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date deleteTime;
|
||||
}
|
||||
@ -0,0 +1,7 @@
|
||||
package com.yfd.platform.qgc_base.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yfd.platform.qgc_base.domain.MsWarnRuleB;
|
||||
|
||||
public interface MsWarnRuleBMapper extends BaseMapper<MsWarnRuleB> {
|
||||
}
|
||||
@ -0,0 +1,7 @@
|
||||
package com.yfd.platform.qgc_base.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yfd.platform.qgc_base.domain.SdAimonitorBH;
|
||||
|
||||
public interface SdAimonitorBHMapper extends BaseMapper<SdAimonitorBH> {
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package com.yfd.platform.qgc_base.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.qgc_base.domain.MsWarnRuleB;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 预警规则配置 Service 接口
|
||||
*/
|
||||
public interface IMsWarnRuleBService extends IService<MsWarnRuleB> {
|
||||
Page<MsWarnRuleB> queryPageList(DataSourceRequest request);
|
||||
boolean add(MsWarnRuleB entity, String source);
|
||||
boolean update(MsWarnRuleB entity, String source);
|
||||
boolean delete(List<String> ids, String source);
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package com.yfd.platform.qgc_base.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.qgc_base.domain.SdAimonitorBH;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* AI智能监测装置 Service 接口
|
||||
*/
|
||||
public interface ISdAimonitorBHService extends IService<SdAimonitorBH> {
|
||||
Page<SdAimonitorBH> queryPageList(DataSourceRequest request);
|
||||
boolean add(SdAimonitorBH entity, String source);
|
||||
boolean update(SdAimonitorBH entity, String source);
|
||||
boolean delete(List<String> stcds, String source);
|
||||
}
|
||||
@ -0,0 +1,76 @@
|
||||
package com.yfd.platform.qgc_base.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.qgc_base.domain.MsWarnRuleB;
|
||||
import com.yfd.platform.qgc_base.mapper.MsWarnRuleBMapper;
|
||||
import com.yfd.platform.qgc_base.service.IMsOperationLogService;
|
||||
import com.yfd.platform.qgc_base.service.IMsWarnRuleBService;
|
||||
import com.yfd.platform.utils.DataSourceRequestUtil;
|
||||
import com.yfd.platform.utils.SecurityUtils;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 预警规则配置 Service 实现类
|
||||
*/
|
||||
@Service
|
||||
public class MsWarnRuleBServiceImpl extends ServiceImpl<MsWarnRuleBMapper, MsWarnRuleB> implements IMsWarnRuleBService {
|
||||
|
||||
private static final String TABLE_NAME = "MS_WARN_RULE_B";
|
||||
|
||||
@Resource
|
||||
private IMsOperationLogService msOperationLogService;
|
||||
|
||||
@Override
|
||||
public Page<MsWarnRuleB> queryPageList(DataSourceRequest request) {
|
||||
return DataSourceRequestUtil.executeQuery(request, MsWarnRuleB.class, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean add(MsWarnRuleB entity, String source) {
|
||||
boolean result = this.save(entity);
|
||||
if (result) {
|
||||
msOperationLogService.recordAddDetailLog(TABLE_NAME, entity, source);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean update(MsWarnRuleB entity, String source) {
|
||||
MsWarnRuleB before = this.getById(entity.getId());
|
||||
boolean result = this.updateById(entity);
|
||||
if (result && before != null) {
|
||||
msOperationLogService.recordModifyDetailLog(TABLE_NAME, before, entity, source);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean delete(List<String> ids, String source) {
|
||||
if (ids == null || ids.isEmpty()) return false;
|
||||
int count = 0;
|
||||
for (String id : ids) {
|
||||
LambdaUpdateWrapper<MsWarnRuleB> wrapper = new LambdaUpdateWrapper<>();
|
||||
wrapper.eq(MsWarnRuleB::getId, id);
|
||||
wrapper.set(MsWarnRuleB::getIsDeleted, 1);
|
||||
wrapper.set(MsWarnRuleB::getDeleteUser, SecurityUtils.getCurrentUsername());
|
||||
wrapper.set(MsWarnRuleB::getDeleteTime, new Date());
|
||||
if (this.update(wrapper)) {
|
||||
MsWarnRuleB entity = this.getById(id);
|
||||
msOperationLogService.recordDeleteDetailLog(TABLE_NAME, entity, source);
|
||||
count++;
|
||||
}
|
||||
}
|
||||
return count > 0;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,97 @@
|
||||
package com.yfd.platform.qgc_base.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.qgc_base.domain.SdAimonitorBH;
|
||||
import com.yfd.platform.qgc_base.mapper.SdAimonitorBHMapper;
|
||||
import com.yfd.platform.qgc_base.service.IMsOperationLogService;
|
||||
import com.yfd.platform.qgc_base.service.ISdAimonitorBHService;
|
||||
import com.yfd.platform.utils.CodeToNameMetadataBo;
|
||||
import com.yfd.platform.utils.DataSourceRequestUtil;
|
||||
import com.yfd.platform.utils.DictCodeToNameConverter;
|
||||
import com.yfd.platform.utils.SecurityUtils;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* AI智能监测装置 Service 实现类
|
||||
*/
|
||||
@Service
|
||||
public class SdAimonitorBHServiceImpl extends ServiceImpl<SdAimonitorBHMapper, SdAimonitorBH> implements ISdAimonitorBHService {
|
||||
|
||||
private static final String TABLE_NAME = "SD_AIMONITOR_B_H";
|
||||
|
||||
@Resource
|
||||
private IMsOperationLogService msOperationLogService;
|
||||
|
||||
@Resource
|
||||
private DictCodeToNameConverter dictCodeToNameConverter;
|
||||
|
||||
private static final List<CodeToNameMetadataBo> CODE_TO_NAME_META_LIST = new ArrayList<>();
|
||||
|
||||
static {
|
||||
CODE_TO_NAME_META_LIST.add(CodeToNameMetadataBo.builder().codeProperty("dtin").modifyProperty("dtinName").dictType("STATIC").dictSource("DTIN").build());
|
||||
CODE_TO_NAME_META_LIST.add(CodeToNameMetadataBo.builder().codeProperty("mway").modifyProperty("mwayName").dictType("STATIC").dictSource("MWAY").build());
|
||||
CODE_TO_NAME_META_LIST.add(CodeToNameMetadataBo.builder().codeProperty("bldsttCode").modifyProperty("bldsttCodeName").dictType("STATIC").dictSource("BLDSTT_CODE").build());
|
||||
CODE_TO_NAME_META_LIST.add(CodeToNameMetadataBo.builder().codeProperty("sttp").modifyProperty("sttpName").dictType("DYNAMIC").dictSource("SD_STTP_B").codeColumn("STTP_CODE").nameColumn("STTP_NAME").filter("NVL(IS_DELETED, 0) = 0 ").build());
|
||||
CODE_TO_NAME_META_LIST.add(CodeToNameMetadataBo.builder().codeProperty("baseId").modifyProperty("baseName").dictType("DYNAMIC").dictSource("SD_HYDROBASE").codeColumn("BASEID").nameColumn("BASENAME").filter("NVL(IS_DELETED, 0) = 0 ").build());
|
||||
CODE_TO_NAME_META_LIST.add(CodeToNameMetadataBo.builder().codeProperty("rstcd").modifyProperty("ennm").dictType("DYNAMIC").dictSource("SD_ENGINFO_B_H").codeColumn("STCD").nameColumn("ENNM").filter("NVL(IS_DELETED, 0) = 0 ").build());
|
||||
CODE_TO_NAME_META_LIST.add(CodeToNameMetadataBo.builder().codeProperty("rvcd").modifyProperty("rvnm").dictType("DYNAMIC").dictSource("V_SD_RVCD_DIC_TREE").codeColumn("RVCD").nameColumn("RVNM").build());
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<SdAimonitorBH> queryPageList(DataSourceRequest request) {
|
||||
Page<SdAimonitorBH> page = DataSourceRequestUtil.executeQuery(request, SdAimonitorBH.class, this);
|
||||
dictCodeToNameConverter.convertCodeToName(page, CODE_TO_NAME_META_LIST);
|
||||
return page;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean add(SdAimonitorBH entity, String source) {
|
||||
boolean result = this.save(entity);
|
||||
if (result) {
|
||||
msOperationLogService.recordAddDetailLog(TABLE_NAME, entity, source);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean update(SdAimonitorBH entity, String source) {
|
||||
SdAimonitorBH before = this.getById(entity.getStcd());
|
||||
boolean result = this.updateById(entity);
|
||||
if (result && before != null) {
|
||||
msOperationLogService.recordModifyDetailLog(TABLE_NAME, before, entity, source);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean delete(List<String> stcds, String source) {
|
||||
if (stcds == null || stcds.isEmpty()) return false;
|
||||
int count = 0;
|
||||
for (String stcd : stcds) {
|
||||
LambdaUpdateWrapper<SdAimonitorBH> wrapper = new LambdaUpdateWrapper<>();
|
||||
wrapper.eq(SdAimonitorBH::getStcd, stcd);
|
||||
wrapper.set(SdAimonitorBH::getIsDeleted, 1);
|
||||
wrapper.set(SdAimonitorBH::getDeleteUser, SecurityUtils.getCurrentUsername());
|
||||
wrapper.set(SdAimonitorBH::getDeleteTime, new Date());
|
||||
if (this.update(wrapper)) {
|
||||
SdAimonitorBH entity = this.getById(stcd);
|
||||
msOperationLogService.recordDeleteDetailLog(TABLE_NAME, entity, source);
|
||||
count++;
|
||||
}
|
||||
}
|
||||
return count > 0;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user