Compare commits
5 Commits
7410d32241
...
2026-01
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
99ab77dcf0 | ||
|
|
c772c9cd81 | ||
| 996ec87ea8 | |||
|
|
b6eaff3b1e | ||
|
|
56bf5bb7c9 |
@@ -9,8 +9,10 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.advance.enums.AdvanceResponseEnum;
|
||||
import com.njcn.advance.mapper.govern.voltage.SgMachineMapper;
|
||||
import com.njcn.advance.pojo.param.govern.voltage.SgMachineParam;
|
||||
import com.njcn.advance.pojo.param.govern.voltage.SgUserParam;
|
||||
import com.njcn.advance.pojo.po.govern.voltage.SgMachine;
|
||||
import com.njcn.advance.pojo.po.govern.voltage.SgSensitiveUnit;
|
||||
import com.njcn.advance.pojo.po.govern.voltage.SgUser;
|
||||
import com.njcn.advance.pojo.vo.govern.voltage.SgMachineVO;
|
||||
import com.njcn.advance.service.govern.voltage.ISgMachineService;
|
||||
import com.njcn.advance.service.govern.voltage.ISgSensitiveUnitService;
|
||||
@@ -56,12 +58,34 @@ public class SgMachineServiceImpl extends ServiceImpl<SgMachineMapper, SgMachine
|
||||
@Override
|
||||
public String addMachine(SgMachineParam sgMachineParam) {
|
||||
SgMachine sgMachine = new SgMachine();
|
||||
checkMachineName(sgMachineParam, false);
|
||||
|
||||
BeanUtil.copyProperties(sgMachineParam, sgMachine);
|
||||
//默认为正常状态
|
||||
sgMachine.setState(DataStateEnum.ENABLE.getCode());
|
||||
this.save(sgMachine);
|
||||
return sgMachine.getId();
|
||||
}
|
||||
/**
|
||||
* 校验参数,检查是否存在相同名称的业务用户
|
||||
*/
|
||||
private void checkMachineName(SgMachineParam sgMachineParam, boolean isExcludeSelf) {
|
||||
LambdaQueryWrapper<SgMachine> sgUserLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
sgUserLambdaQueryWrapper
|
||||
.eq(SgMachine::getName, sgMachineParam.getName())
|
||||
.eq(SgMachine::getState, DataStateEnum.ENABLE.getCode());
|
||||
//更新的时候,需排除当前记录
|
||||
if (isExcludeSelf) {
|
||||
if (sgMachineParam instanceof SgMachineParam.SgMachineUpdateParam) {
|
||||
sgUserLambdaQueryWrapper.ne(SgMachine::getId, ((SgMachineParam.SgMachineUpdateParam) sgMachineParam).getId());
|
||||
}
|
||||
}
|
||||
int countByAccount = this.count(sgUserLambdaQueryWrapper);
|
||||
//大于等于1个则表示重复
|
||||
if (countByAccount >= 1) {
|
||||
throw new BusinessException(AdvanceResponseEnum.SG_USER_NAME_REPEAT);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新设备
|
||||
@@ -70,6 +94,8 @@ public class SgMachineServiceImpl extends ServiceImpl<SgMachineMapper, SgMachine
|
||||
@Override
|
||||
public boolean updateSgMachine(SgMachineParam.SgMachineUpdateParam updateParam) {
|
||||
SgMachine sgMachine = new SgMachine();
|
||||
checkMachineName(updateParam, true);
|
||||
|
||||
BeanUtil.copyProperties(updateParam, sgMachine);
|
||||
return this.updateById(sgMachine);
|
||||
}
|
||||
|
||||
@@ -2,12 +2,15 @@ package com.njcn.advance.service.govern.voltage.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
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.njcn.advance.enums.AdvanceResponseEnum;
|
||||
import com.njcn.advance.mapper.govern.voltage.SgSensitiveUnitMapper;
|
||||
import com.njcn.advance.pojo.param.govern.voltage.SgMachineParam;
|
||||
import com.njcn.advance.pojo.param.govern.voltage.SgSensitiveUnitParam;
|
||||
import com.njcn.advance.pojo.po.govern.voltage.SgMachine;
|
||||
import com.njcn.advance.pojo.po.govern.voltage.SgSensitiveUnit;
|
||||
import com.njcn.advance.pojo.vo.govern.voltage.SgSensitiveUnitVO;
|
||||
import com.njcn.advance.service.govern.voltage.ISgSensitiveUnitService;
|
||||
@@ -54,12 +57,34 @@ public class SgSensitiveUnitServiceImpl extends ServiceImpl<SgSensitiveUnitMappe
|
||||
@Override
|
||||
public String addSensitiveUnit(SgSensitiveUnitParam sgSensitiveUnitParam) {
|
||||
SgSensitiveUnit sgSensitiveUnit = new SgSensitiveUnit();
|
||||
checkSensitiveUnitName(sgSensitiveUnitParam, false);
|
||||
|
||||
BeanUtil.copyProperties(sgSensitiveUnitParam, sgSensitiveUnit);
|
||||
//默认为正常状态
|
||||
sgSensitiveUnit.setState(DataStateEnum.ENABLE.getCode());
|
||||
this.save(sgSensitiveUnit);
|
||||
return sgSensitiveUnit.getId();
|
||||
}
|
||||
/**
|
||||
* 校验参数,检查是否存在相同名称的业务用户
|
||||
*/
|
||||
private void checkSensitiveUnitName(SgSensitiveUnitParam sgSensitiveUnitParam, boolean isExcludeSelf) {
|
||||
LambdaQueryWrapper<SgSensitiveUnit> sgUserLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
sgUserLambdaQueryWrapper
|
||||
.eq(SgSensitiveUnit::getName, sgSensitiveUnitParam.getName())
|
||||
.eq(SgSensitiveUnit::getState, DataStateEnum.ENABLE.getCode());
|
||||
//更新的时候,需排除当前记录
|
||||
if (isExcludeSelf) {
|
||||
if (sgSensitiveUnitParam instanceof SgSensitiveUnitParam.SgSensitiveUnitUpdateParam) {
|
||||
sgUserLambdaQueryWrapper.ne(SgSensitiveUnit::getId, ((SgSensitiveUnitParam.SgSensitiveUnitUpdateParam) sgSensitiveUnitParam).getId());
|
||||
}
|
||||
}
|
||||
int countByAccount = this.count(sgUserLambdaQueryWrapper);
|
||||
//大于等于1个则表示重复
|
||||
if (countByAccount >= 1) {
|
||||
throw new BusinessException(AdvanceResponseEnum.SG_USER_NAME_REPEAT);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新元器件
|
||||
@@ -69,6 +94,8 @@ public class SgSensitiveUnitServiceImpl extends ServiceImpl<SgSensitiveUnitMappe
|
||||
@Override
|
||||
public boolean updateSgSensitiveUnit(SgSensitiveUnitParam.SgSensitiveUnitUpdateParam updateParam) {
|
||||
SgSensitiveUnit sgSensitiveUnit = new SgSensitiveUnit();
|
||||
checkSensitiveUnitName(updateParam, true);
|
||||
|
||||
BeanUtil.copyProperties(updateParam, sgSensitiveUnit);
|
||||
return this.updateById(sgSensitiveUnit);
|
||||
}
|
||||
|
||||
@@ -512,7 +512,7 @@ public class EventRelevantAnalysisServiceImpl extends ServiceImpl<RmpEventAdvanc
|
||||
lambdaQueryWrapper.like(RmpEventDetailAssPO::getContentDes, baseParam.getSearchValue());
|
||||
}
|
||||
lambdaQueryWrapper.between(RmpEventDetailAssPO::getTimeId, timeV.get(0), timeV.get(1))
|
||||
.orderByAsc(RmpEventDetailAssPO::getTimeId);
|
||||
.orderByDesc(RmpEventDetailAssPO::getTimeId);
|
||||
return rmpEventDetailAssMapper.selectPage(new Page<>(PageFactory.getPageNum(baseParam), PageFactory.getPageSize(baseParam)), lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
|
||||
@@ -81,7 +81,13 @@ public class EventWaveAnalysisServiceImpl implements EventWaveAnalysisService {
|
||||
inputStreamCfg = fileStorageUtil.getFileStream(OssPath.WAVE_DIR + lineDetailDataVO.getIp() + StrUtil.SLASH + rmpEventDetailPO.getWavePath() + GeneralConstant.CFG);
|
||||
inputStreamDat = fileStorageUtil.getFileStream(OssPath.WAVE_DIR + lineDetailDataVO.getIp() + StrUtil.SLASH + rmpEventDetailPO.getWavePath() + GeneralConstant.DAT);
|
||||
} catch (Exception e) {
|
||||
throw new BusinessException("暂降cfg,dat文件缺失,请联系管理员");
|
||||
try {
|
||||
inputStreamCfg = fileStorageUtil.getFileStream(OssPath.WAVE_DIR + lineDetailDataVO.getIp() + StrUtil.SLASH + rmpEventDetailPO.getWavePath() + GeneralConstant.CFG.toLowerCase());
|
||||
inputStreamDat = fileStorageUtil.getFileStream(OssPath.WAVE_DIR + lineDetailDataVO.getIp() + StrUtil.SLASH + rmpEventDetailPO.getWavePath() + GeneralConstant.DAT.toLowerCase());
|
||||
} catch (Exception e1) {
|
||||
|
||||
throw new BusinessException("暂降cfg,dat文件缺失,请联系管理员");
|
||||
}
|
||||
}
|
||||
|
||||
//读取
|
||||
|
||||
@@ -88,7 +88,7 @@ public class BpmSignParam extends BaseEntity implements Serializable {
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("标识key")
|
||||
private String key;
|
||||
private String signKey;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -67,8 +67,8 @@ public class BpmCategoryServiceImpl extends ServiceImpl<BpmCategoryMapper, BpmCa
|
||||
@Override
|
||||
public Page<BpmCategoryVO> getCategoryPage(BpmCategoryParam.BpmCategoryQueryParam bpmCategoryQueryParam) {
|
||||
QueryWrapper<BpmCategoryVO> categoryVOQueryWrapper = new QueryWrapper<>();
|
||||
if (StrUtil.isNotBlank(bpmCategoryQueryParam.getName())) {
|
||||
categoryVOQueryWrapper.like("bpm_category.name", bpmCategoryQueryParam.getName());
|
||||
if (StrUtil.isNotBlank(bpmCategoryQueryParam.getSearchValue())) {
|
||||
categoryVOQueryWrapper.like("bpm_category.name", bpmCategoryQueryParam.getSearchValue());
|
||||
}
|
||||
|
||||
if (StrUtil.isNotBlank(bpmCategoryQueryParam.getCode())) {
|
||||
|
||||
@@ -106,8 +106,8 @@ public class BpmSignServiceImpl extends ServiceImpl<BpmSignMapper, BpmSign> impl
|
||||
bpmSignVOQueryWrapper.like("bpm_sign.name", bpmSignQueryParam.getName());
|
||||
}
|
||||
|
||||
if (StrUtil.isNotBlank(bpmSignQueryParam.getKey())) {
|
||||
bpmSignVOQueryWrapper.like("bpm_sign.signKey", bpmSignQueryParam.getKey());
|
||||
if (StrUtil.isNotBlank(bpmSignQueryParam.getSignKey())) {
|
||||
bpmSignVOQueryWrapper.like("bpm_sign.sign_key", bpmSignQueryParam.getSignKey());
|
||||
}
|
||||
bpmSignVOQueryWrapper.eq("bpm_sign.state", DataStateEnum.ENABLE.getCode());
|
||||
bpmSignVOQueryWrapper.orderByAsc("bpm_sign.sort");
|
||||
|
||||
@@ -258,7 +258,7 @@ public interface PatternRegex {
|
||||
/**
|
||||
* 任意字符,长度在1-20位,常用于名称、编码等常规录入
|
||||
*/
|
||||
String ALL_CHAR_1_20 = "^[-_A-Za-z0-9\\u4e00-\\u9fa5]{1,20}$";
|
||||
String ALL_CHAR_1_20 = "^[-_A-Za-z0-9\\u4e00-\\u9fa5]{1,32}$";
|
||||
|
||||
String SPECIALCHARACTER ="[<>%'%;()&+/\\\\-\\\\\\\\_|@*?#$!,.]|html";
|
||||
|
||||
|
||||
@@ -33,6 +33,8 @@ public class PieGenerator {
|
||||
Option reasonOption = new Option();
|
||||
//取消渲染动画
|
||||
reasonOption.setAnimation(false);
|
||||
String[] colorArr = {"#526ADE", "#00BFF5","#FFBF00","#77DA63","#D5FF6B"};
|
||||
reasonOption.setColor(colorArr);
|
||||
//背景色
|
||||
reasonOption.setBackgroundColor(PicCommonData.PIC_BACK_COLOR);
|
||||
//标题
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
STATUS = 1
|
||||
</select>
|
||||
<select id="sortTransformer" resultType="java.lang.Integer">
|
||||
select IFNULL(max(pqs_transformer.sort),0) from pqs_transformer order by update_time desc
|
||||
select IFNULL(max(pqs_transformer.sort),0) from pqs_transformer
|
||||
<!-- order by update_time desc-->
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -119,7 +119,7 @@ public class PqsTflgployServiceImpl extends ServiceImpl<PqsTflgployMapper, PqsTf
|
||||
}
|
||||
|
||||
private void addList(TflgployParam param, PqsTflgploy tflgploy, boolean save, List<PqsTflgployass> info) {
|
||||
if(save){
|
||||
// if(save){
|
||||
List<String> tfIndexs = param.getTfIndexs();
|
||||
if(CollUtil.isNotEmpty(tfIndexs)){
|
||||
PqsTflgployass ass;
|
||||
@@ -129,7 +129,7 @@ public class PqsTflgployServiceImpl extends ServiceImpl<PqsTflgployMapper, PqsTf
|
||||
ass.setTfIndex(tfIndex);
|
||||
info.add(ass);
|
||||
}
|
||||
}
|
||||
// }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -198,7 +198,7 @@ public class DeviceController extends BaseController {
|
||||
@ApiOperation("修改装置通讯状态及时间")
|
||||
public HttpResult<Boolean> updateDevComFlag(@RequestBody DevComFlagDTO devComFlagDTO) {
|
||||
String methodDescribe = getMethodDescribe("updateDevComFlag");
|
||||
boolean update = iDeviceService.lambdaUpdate().set(Objects.nonNull(devComFlagDTO.getStatus()),Device::getComFlag,devComFlagDTO.getStatus() ).set(Device::getUpdateTime, devComFlagDTO.getDate()).eq(Device::getId, devComFlagDTO.getId()).update();
|
||||
boolean update = iDeviceService.lambdaUpdate().set(Objects.nonNull(devComFlagDTO.getStatus()),Device::getComFlag,devComFlagDTO.getStatus() ).set(Objects.nonNull(devComFlagDTO.getDate()),Device::getUpdateTime, devComFlagDTO.getDate()).eq(Device::getId, devComFlagDTO.getId()).update();
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, update, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ public class TerminalVersionServiceImpl implements TerminalVersionService {
|
||||
|
||||
List<TerminalVersionVO> devList = terminalVersionMapper.getTerminalVersionInfo(terminalMainQueryParam);
|
||||
if(CollectionUtil.isEmpty(devList)){
|
||||
throw new BusinessException(DeviceResponseEnum.DEVICE_EMPTY);
|
||||
return devList;
|
||||
}
|
||||
List<String> subIndexes = devList.stream().map(TerminalVersionVO::getPid).collect(Collectors.toList());
|
||||
List<TerminalVersionVO> subList =terminalVersionMapper.getPqLineGdAndSubList(subIndexes);
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
a.name lineName,
|
||||
c.Time_Interval,
|
||||
d.Scale AS scale,
|
||||
c.Obj_Id obyId,
|
||||
c.Obj_Id objId,
|
||||
c.Big_Obj_Type bigObjType
|
||||
from pq_line a
|
||||
inner join pq_line b on a.pid = b.id
|
||||
|
||||
@@ -1269,7 +1269,8 @@
|
||||
SELECT
|
||||
voltage.id as id,
|
||||
sub.id as pid,
|
||||
concat( sub.NAME, " ", voltage.NAME ) as name,
|
||||
<!-- 兼容国产数据库-->
|
||||
concat( sub.NAME, ' ', voltage.NAME ) as name,
|
||||
voltage.Sort as sort
|
||||
FROM
|
||||
pq_line voltage
|
||||
@@ -1513,14 +1514,14 @@
|
||||
line.id AS lineId,
|
||||
CONCAT(sub.NAME, '_', vo.NAME, '_', line.NAME) AS lineName,
|
||||
CONCAT(
|
||||
IFNULL(CAST(detail.pt1 AS CHAR), 'N/A'),
|
||||
IFNULL(CAST(detail.pt1 AS VARCHAR), 'N/A'),
|
||||
':',
|
||||
IFNULL(CAST(detail.pt2 AS CHAR), 'N/A')
|
||||
IFNULL(CAST(detail.pt2 AS VARCHAR), 'N/A')
|
||||
) AS pt,
|
||||
CONCAT(
|
||||
IFNULL(CAST(detail.ct1 AS CHAR), 'N/A'),
|
||||
IFNULL(CAST(detail.ct1 AS VARCHAR), 'N/A'),
|
||||
':',
|
||||
IFNULL(CAST(detail.ct2 AS CHAR), 'N/A')
|
||||
IFNULL(CAST(detail.ct2 AS VARCHAR), 'N/A')
|
||||
) AS ct,
|
||||
detail.Dev_Capacity AS Dev_Capacity,
|
||||
detail.Short_Capacity AS Short_Capacity,
|
||||
|
||||
@@ -747,8 +747,8 @@ public class ReportServiceImpl implements ReportService {
|
||||
bodyFont.setFontHeightInPoints((short) 9);
|
||||
bodyStyle.setFont(bodyFont);
|
||||
|
||||
sheet2(sheets, cellStyle, bodyStyle, businessParam);
|
||||
sheet3(sheets, cellStyle, bodyStyle, businessParam);
|
||||
sheet2(sheets, cellStyle, bodyStyle, businessParam);
|
||||
sheet4(sheets, cellStyle, bodyStyle, businessParam);
|
||||
sheet5(sheets, cellStyle, bodyStyle, businessParam);
|
||||
sheet6(sheets, cellStyle, bodyStyle, businessParam);
|
||||
@@ -909,7 +909,7 @@ public class ReportServiceImpl implements ReportService {
|
||||
|
||||
public void sheet2(HSSFWorkbook sheets, HSSFCellStyle cellStyle, HSSFCellStyle bodyStyle, DeviceInfoParam.BusinessParam businessParam) {
|
||||
sheets.createSheet("暂态严重度统计");
|
||||
HSSFSheet sheetAt = sheets.getSheetAt(1);
|
||||
HSSFSheet sheetAt = sheets.getSheetAt(2);
|
||||
sheetAt.setColumnWidth(0, 24 * 256);
|
||||
sheetAt.setColumnWidth(1, 24 * 256);
|
||||
sheetAt.setColumnWidth(2, 24 * 256);
|
||||
@@ -1001,7 +1001,7 @@ public class ReportServiceImpl implements ReportService {
|
||||
|
||||
public void sheet3(HSSFWorkbook sheets, HSSFCellStyle cellStyle, HSSFCellStyle bodyStyle, DeviceInfoParam.BusinessParam businessParam) throws TemplateException, IOException {
|
||||
sheets.createSheet("暂态原因统计");
|
||||
HSSFSheet sheetAt = sheets.getSheetAt(2);
|
||||
HSSFSheet sheetAt = sheets.getSheetAt(1);
|
||||
sheetAt.setColumnWidth(0, 40 * 256);
|
||||
sheetAt.setColumnWidth(1, 40 * 256);
|
||||
sheetAt.setColumnWidth(2, 40 * 256);
|
||||
|
||||
Reference in New Issue
Block a user