修改定版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.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);
|
||||
}
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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);
|
||||
//标题
|
||||
|
||||
@@ -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