修改定版bug
This commit is contained in:
@@ -9,8 +9,10 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||||||
import com.njcn.advance.enums.AdvanceResponseEnum;
|
import com.njcn.advance.enums.AdvanceResponseEnum;
|
||||||
import com.njcn.advance.mapper.govern.voltage.SgMachineMapper;
|
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.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.SgMachine;
|
||||||
import com.njcn.advance.pojo.po.govern.voltage.SgSensitiveUnit;
|
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.pojo.vo.govern.voltage.SgMachineVO;
|
||||||
import com.njcn.advance.service.govern.voltage.ISgMachineService;
|
import com.njcn.advance.service.govern.voltage.ISgMachineService;
|
||||||
import com.njcn.advance.service.govern.voltage.ISgSensitiveUnitService;
|
import com.njcn.advance.service.govern.voltage.ISgSensitiveUnitService;
|
||||||
@@ -56,12 +58,34 @@ public class SgMachineServiceImpl extends ServiceImpl<SgMachineMapper, SgMachine
|
|||||||
@Override
|
@Override
|
||||||
public String addMachine(SgMachineParam sgMachineParam) {
|
public String addMachine(SgMachineParam sgMachineParam) {
|
||||||
SgMachine sgMachine = new SgMachine();
|
SgMachine sgMachine = new SgMachine();
|
||||||
|
checkMachineName(sgMachineParam, false);
|
||||||
|
|
||||||
BeanUtil.copyProperties(sgMachineParam, sgMachine);
|
BeanUtil.copyProperties(sgMachineParam, sgMachine);
|
||||||
//默认为正常状态
|
//默认为正常状态
|
||||||
sgMachine.setState(DataStateEnum.ENABLE.getCode());
|
sgMachine.setState(DataStateEnum.ENABLE.getCode());
|
||||||
this.save(sgMachine);
|
this.save(sgMachine);
|
||||||
return sgMachine.getId();
|
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
|
@Override
|
||||||
public boolean updateSgMachine(SgMachineParam.SgMachineUpdateParam updateParam) {
|
public boolean updateSgMachine(SgMachineParam.SgMachineUpdateParam updateParam) {
|
||||||
SgMachine sgMachine = new SgMachine();
|
SgMachine sgMachine = new SgMachine();
|
||||||
|
checkMachineName(updateParam, true);
|
||||||
|
|
||||||
BeanUtil.copyProperties(updateParam, sgMachine);
|
BeanUtil.copyProperties(updateParam, sgMachine);
|
||||||
return this.updateById(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.bean.BeanUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
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.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.njcn.advance.enums.AdvanceResponseEnum;
|
import com.njcn.advance.enums.AdvanceResponseEnum;
|
||||||
import com.njcn.advance.mapper.govern.voltage.SgSensitiveUnitMapper;
|
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.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.po.govern.voltage.SgSensitiveUnit;
|
||||||
import com.njcn.advance.pojo.vo.govern.voltage.SgSensitiveUnitVO;
|
import com.njcn.advance.pojo.vo.govern.voltage.SgSensitiveUnitVO;
|
||||||
import com.njcn.advance.service.govern.voltage.ISgSensitiveUnitService;
|
import com.njcn.advance.service.govern.voltage.ISgSensitiveUnitService;
|
||||||
@@ -54,12 +57,34 @@ public class SgSensitiveUnitServiceImpl extends ServiceImpl<SgSensitiveUnitMappe
|
|||||||
@Override
|
@Override
|
||||||
public String addSensitiveUnit(SgSensitiveUnitParam sgSensitiveUnitParam) {
|
public String addSensitiveUnit(SgSensitiveUnitParam sgSensitiveUnitParam) {
|
||||||
SgSensitiveUnit sgSensitiveUnit = new SgSensitiveUnit();
|
SgSensitiveUnit sgSensitiveUnit = new SgSensitiveUnit();
|
||||||
|
checkSensitiveUnitName(sgSensitiveUnitParam, false);
|
||||||
|
|
||||||
BeanUtil.copyProperties(sgSensitiveUnitParam, sgSensitiveUnit);
|
BeanUtil.copyProperties(sgSensitiveUnitParam, sgSensitiveUnit);
|
||||||
//默认为正常状态
|
//默认为正常状态
|
||||||
sgSensitiveUnit.setState(DataStateEnum.ENABLE.getCode());
|
sgSensitiveUnit.setState(DataStateEnum.ENABLE.getCode());
|
||||||
this.save(sgSensitiveUnit);
|
this.save(sgSensitiveUnit);
|
||||||
return sgSensitiveUnit.getId();
|
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
|
@Override
|
||||||
public boolean updateSgSensitiveUnit(SgSensitiveUnitParam.SgSensitiveUnitUpdateParam updateParam) {
|
public boolean updateSgSensitiveUnit(SgSensitiveUnitParam.SgSensitiveUnitUpdateParam updateParam) {
|
||||||
SgSensitiveUnit sgSensitiveUnit = new SgSensitiveUnit();
|
SgSensitiveUnit sgSensitiveUnit = new SgSensitiveUnit();
|
||||||
|
checkSensitiveUnitName(updateParam, true);
|
||||||
|
|
||||||
BeanUtil.copyProperties(updateParam, sgSensitiveUnit);
|
BeanUtil.copyProperties(updateParam, sgSensitiveUnit);
|
||||||
return this.updateById(sgSensitiveUnit);
|
return this.updateById(sgSensitiveUnit);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ public class BpmSignParam extends BaseEntity implements Serializable {
|
|||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
@ApiModelProperty("标识key")
|
@ApiModelProperty("标识key")
|
||||||
private String key;
|
private String signKey;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -67,8 +67,8 @@ public class BpmCategoryServiceImpl extends ServiceImpl<BpmCategoryMapper, BpmCa
|
|||||||
@Override
|
@Override
|
||||||
public Page<BpmCategoryVO> getCategoryPage(BpmCategoryParam.BpmCategoryQueryParam bpmCategoryQueryParam) {
|
public Page<BpmCategoryVO> getCategoryPage(BpmCategoryParam.BpmCategoryQueryParam bpmCategoryQueryParam) {
|
||||||
QueryWrapper<BpmCategoryVO> categoryVOQueryWrapper = new QueryWrapper<>();
|
QueryWrapper<BpmCategoryVO> categoryVOQueryWrapper = new QueryWrapper<>();
|
||||||
if (StrUtil.isNotBlank(bpmCategoryQueryParam.getName())) {
|
if (StrUtil.isNotBlank(bpmCategoryQueryParam.getSearchValue())) {
|
||||||
categoryVOQueryWrapper.like("bpm_category.name", bpmCategoryQueryParam.getName());
|
categoryVOQueryWrapper.like("bpm_category.name", bpmCategoryQueryParam.getSearchValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (StrUtil.isNotBlank(bpmCategoryQueryParam.getCode())) {
|
if (StrUtil.isNotBlank(bpmCategoryQueryParam.getCode())) {
|
||||||
|
|||||||
@@ -106,8 +106,8 @@ public class BpmSignServiceImpl extends ServiceImpl<BpmSignMapper, BpmSign> impl
|
|||||||
bpmSignVOQueryWrapper.like("bpm_sign.name", bpmSignQueryParam.getName());
|
bpmSignVOQueryWrapper.like("bpm_sign.name", bpmSignQueryParam.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (StrUtil.isNotBlank(bpmSignQueryParam.getKey())) {
|
if (StrUtil.isNotBlank(bpmSignQueryParam.getSignKey())) {
|
||||||
bpmSignVOQueryWrapper.like("bpm_sign.signKey", bpmSignQueryParam.getKey());
|
bpmSignVOQueryWrapper.like("bpm_sign.sign_key", bpmSignQueryParam.getSignKey());
|
||||||
}
|
}
|
||||||
bpmSignVOQueryWrapper.eq("bpm_sign.state", DataStateEnum.ENABLE.getCode());
|
bpmSignVOQueryWrapper.eq("bpm_sign.state", DataStateEnum.ENABLE.getCode());
|
||||||
bpmSignVOQueryWrapper.orderByAsc("bpm_sign.sort");
|
bpmSignVOQueryWrapper.orderByAsc("bpm_sign.sort");
|
||||||
|
|||||||
@@ -33,6 +33,8 @@ public class PieGenerator {
|
|||||||
Option reasonOption = new Option();
|
Option reasonOption = new Option();
|
||||||
//取消渲染动画
|
//取消渲染动画
|
||||||
reasonOption.setAnimation(false);
|
reasonOption.setAnimation(false);
|
||||||
|
String[] colorArr = {"#526ADE", "#00BFF5","#FFBF00","#77DA63","#D5FF6B"};
|
||||||
|
reasonOption.setColor(colorArr);
|
||||||
//背景色
|
//背景色
|
||||||
reasonOption.setBackgroundColor(PicCommonData.PIC_BACK_COLOR);
|
reasonOption.setBackgroundColor(PicCommonData.PIC_BACK_COLOR);
|
||||||
//标题
|
//标题
|
||||||
|
|||||||
@@ -747,8 +747,8 @@ public class ReportServiceImpl implements ReportService {
|
|||||||
bodyFont.setFontHeightInPoints((short) 9);
|
bodyFont.setFontHeightInPoints((short) 9);
|
||||||
bodyStyle.setFont(bodyFont);
|
bodyStyle.setFont(bodyFont);
|
||||||
|
|
||||||
sheet2(sheets, cellStyle, bodyStyle, businessParam);
|
|
||||||
sheet3(sheets, cellStyle, bodyStyle, businessParam);
|
sheet3(sheets, cellStyle, bodyStyle, businessParam);
|
||||||
|
sheet2(sheets, cellStyle, bodyStyle, businessParam);
|
||||||
sheet4(sheets, cellStyle, bodyStyle, businessParam);
|
sheet4(sheets, cellStyle, bodyStyle, businessParam);
|
||||||
sheet5(sheets, cellStyle, bodyStyle, businessParam);
|
sheet5(sheets, cellStyle, bodyStyle, businessParam);
|
||||||
sheet6(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) {
|
public void sheet2(HSSFWorkbook sheets, HSSFCellStyle cellStyle, HSSFCellStyle bodyStyle, DeviceInfoParam.BusinessParam businessParam) {
|
||||||
sheets.createSheet("暂态严重度统计");
|
sheets.createSheet("暂态严重度统计");
|
||||||
HSSFSheet sheetAt = sheets.getSheetAt(1);
|
HSSFSheet sheetAt = sheets.getSheetAt(2);
|
||||||
sheetAt.setColumnWidth(0, 24 * 256);
|
sheetAt.setColumnWidth(0, 24 * 256);
|
||||||
sheetAt.setColumnWidth(1, 24 * 256);
|
sheetAt.setColumnWidth(1, 24 * 256);
|
||||||
sheetAt.setColumnWidth(2, 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 {
|
public void sheet3(HSSFWorkbook sheets, HSSFCellStyle cellStyle, HSSFCellStyle bodyStyle, DeviceInfoParam.BusinessParam businessParam) throws TemplateException, IOException {
|
||||||
sheets.createSheet("暂态原因统计");
|
sheets.createSheet("暂态原因统计");
|
||||||
HSSFSheet sheetAt = sheets.getSheetAt(2);
|
HSSFSheet sheetAt = sheets.getSheetAt(1);
|
||||||
sheetAt.setColumnWidth(0, 40 * 256);
|
sheetAt.setColumnWidth(0, 40 * 256);
|
||||||
sheetAt.setColumnWidth(1, 40 * 256);
|
sheetAt.setColumnWidth(1, 40 * 256);
|
||||||
sheetAt.setColumnWidth(2, 40 * 256);
|
sheetAt.setColumnWidth(2, 40 * 256);
|
||||||
|
|||||||
Reference in New Issue
Block a user