1.pms台账功能调整
This commit is contained in:
@@ -86,49 +86,49 @@ public class PowerClientParam {
|
||||
* 合同容量
|
||||
*/
|
||||
@ApiModelProperty(value = "合同容量",required = true)
|
||||
@NotNull(message = "合同容量不可为空")
|
||||
//@NotNull(message = "合同容量不可为空")
|
||||
private Float contractCapacity;
|
||||
|
||||
/**
|
||||
* 运行容量
|
||||
*/
|
||||
@ApiModelProperty(value = "运行容量",required = true)
|
||||
@NotNull(message = "运行容量不可为空")
|
||||
//@NotNull(message = "运行容量不可为空")
|
||||
private Float operatingCapacity;
|
||||
|
||||
/**
|
||||
* 生产班次(字典)
|
||||
*/
|
||||
@ApiModelProperty(value = "生产班次(字典)",required = true)
|
||||
@NotBlank(message = "生产班次不可为空")
|
||||
//@NotBlank(message = "生产班次不可为空")
|
||||
private String productionShift;
|
||||
|
||||
/**
|
||||
* 负荷性质(字典)
|
||||
*/
|
||||
@ApiModelProperty(value = "负荷性质(字典)",required = true)
|
||||
@NotBlank(message = "负荷性质不可为空")
|
||||
//@NotBlank(message = "负荷性质不可为空")
|
||||
private String loadNature;
|
||||
|
||||
/**
|
||||
* 供电电压(字典)
|
||||
*/
|
||||
@ApiModelProperty(value = "供电电压(字典)",required = true)
|
||||
@NotBlank(message = "供电电压不可为空")
|
||||
//@NotBlank(message = "供电电压不可为空")
|
||||
private String voltageLevel;
|
||||
|
||||
/**
|
||||
* 高耗能行业类别(字典)
|
||||
*/
|
||||
@ApiModelProperty(value = "高耗能行业类别(字典)",required = true)
|
||||
@NotBlank(message = "高耗能行业类别不可为空")
|
||||
//@NotBlank(message = "高耗能行业类别不可为空")
|
||||
private String highIndustryType;
|
||||
|
||||
/**
|
||||
* 送电日期
|
||||
*/
|
||||
@ApiModelProperty(value = "送电日期",required = true)
|
||||
@NotNull(message = "送电日期不可为空")
|
||||
//@NotNull(message = "送电日期不可为空")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDate powerTransmissionDate;
|
||||
|
||||
@@ -136,42 +136,42 @@ public class PowerClientParam {
|
||||
* 重要性等级(字典)
|
||||
*/
|
||||
@ApiModelProperty(value = "重要性等级",required = true)
|
||||
@NotBlank(message = "重要性等级不可为空")
|
||||
//@NotBlank(message = "重要性等级不可为空")
|
||||
private String importanceLevel;
|
||||
|
||||
/**
|
||||
* 用电客户状态(字典)
|
||||
*/
|
||||
@ApiModelProperty(value = "用电客户状态",required = true)
|
||||
@NotBlank(message = "用电客户状态不可为空")
|
||||
//@NotBlank(message = "用电客户状态不可为空")
|
||||
private String eccStat;
|
||||
|
||||
/**
|
||||
* 是否敏感用户:0-否;1:是;
|
||||
*/
|
||||
@ApiModelProperty(value = "是否敏感用户",required = true)
|
||||
@NotNull(message = "用户编号不可为空")
|
||||
//@NotNull(message = "用户编号不可为空")
|
||||
private Integer ifSensitiveUser;
|
||||
|
||||
/**
|
||||
* 是否影响电能质量:0-否;1:是;
|
||||
*/
|
||||
@ApiModelProperty(value = "是否影响电能质量:0-否;1:是;",required = true)
|
||||
@NotNull(message = "是否影响电能质量不可为空")
|
||||
//@NotNull(message = "是否影响电能质量不可为空")
|
||||
private Integer ifPowerQuality;
|
||||
|
||||
/**
|
||||
* 是否重要客户:0-否;1:是;
|
||||
*/
|
||||
@ApiModelProperty(value = "是否重要客户:0-否;1:是;",required = true)
|
||||
@NotNull(message = "是否重要客户不可为空")
|
||||
//@NotNull(message = "是否重要客户不可为空")
|
||||
private Integer ifKeyCustomers;
|
||||
|
||||
/**
|
||||
* 敏感用户类别(字典)
|
||||
*/
|
||||
@ApiModelProperty(value = "敏感用户类别",required = true)
|
||||
@NotBlank(message = "敏感用户类别不可为空")
|
||||
//@NotBlank(message = "敏感用户类别不可为空")
|
||||
private String sensitiveType;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.njcn.device.pms.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldStrategy;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import lombok.Data;
|
||||
@@ -70,66 +72,79 @@ public class PowerClient extends BaseEntity {
|
||||
/**
|
||||
* 合同容量
|
||||
*/
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private Float contractCapacity;
|
||||
|
||||
/**
|
||||
* 运行容量
|
||||
*/
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private Float operatingCapacity;
|
||||
|
||||
/**
|
||||
* 生产班次(字典)
|
||||
*/
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private String productionShift;
|
||||
|
||||
/**
|
||||
* 负荷性质(字典)
|
||||
*/
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private String loadNature;
|
||||
|
||||
/**
|
||||
* 供电电压(字典)
|
||||
*/
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private String voltageLevel;
|
||||
|
||||
/**
|
||||
* 高耗能行业类别(字典)
|
||||
*/
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private String highIndustryType;
|
||||
|
||||
/**
|
||||
* 送电日期
|
||||
*/
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private LocalDate powerTransmissionDate;
|
||||
|
||||
/**
|
||||
* 重要性等级(字典)
|
||||
*/
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private String importanceLevel;
|
||||
|
||||
/**
|
||||
* 用电客户状态(字典)
|
||||
*/
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private String eccStat;
|
||||
|
||||
/**
|
||||
* 是否敏感用户:0-否;1:是;
|
||||
*/
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private Integer ifSensitiveUser;
|
||||
|
||||
/**
|
||||
* 是否影响电能质量:0-否;1:是;
|
||||
*/
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private Integer ifPowerQuality;
|
||||
|
||||
/**
|
||||
* 是否重要客户:0-否;1:是;
|
||||
*/
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private Integer ifKeyCustomers;
|
||||
|
||||
/**
|
||||
* 敏感用户类别(字典)
|
||||
*/
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private String sensitiveType;
|
||||
|
||||
/**
|
||||
@@ -150,6 +165,7 @@ public class PowerClient extends BaseEntity {
|
||||
/**
|
||||
* 用户标签
|
||||
*/
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private String userTag;
|
||||
|
||||
/**
|
||||
|
||||
@@ -40,6 +40,7 @@ import com.njcn.web.pojo.param.BaseParam;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
@@ -119,6 +120,7 @@ public class StatationStatServiceImpl extends ServiceImpl<StatationStatMapper, S
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean updateStatationStat(StatationStatParam statationStatParam) {
|
||||
//校验同一单位下不能出现同名电站
|
||||
LambdaQueryWrapper<StatationStat> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
@@ -130,10 +132,13 @@ public class StatationStatServiceImpl extends ServiceImpl<StatationStatMapper, S
|
||||
throw new BusinessException(PmsDeviceResponseEnum.DEPT_STATION_REPEAT);
|
||||
}
|
||||
|
||||
StatationStat res = this.getById(statationStatParam.getPowerId());
|
||||
|
||||
StatationStat statationStat = new StatationStat();
|
||||
BeanUtils.copyProperties(statationStatParam, statationStat);
|
||||
this.updateById(statationStat);
|
||||
|
||||
if(!res.getPowerName().equals(statationStatParam.getPowerName())) {
|
||||
//修改单位名称时候要确保其他台账中的电站名同时修改
|
||||
LambdaQueryWrapper<Monitor> monitorLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
monitorLambdaQueryWrapper.eq(Monitor::getStatus, DataStateEnum.ENABLE.getCode()).eq(Monitor::getPowerrId, statationStat.getPowerId());
|
||||
@@ -149,6 +154,11 @@ public class StatationStatServiceImpl extends ServiceImpl<StatationStatMapper, S
|
||||
}).collect(Collectors.toList());
|
||||
iMonitorService.updateBatchById(monitorListP);
|
||||
}
|
||||
|
||||
LambdaUpdateWrapper<GeneratrixWire> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
|
||||
lambdaUpdateWrapper.set(GeneratrixWire::getStationName,statationStatParam.getPowerName())
|
||||
.eq(GeneratrixWire::getStationId,statationStatParam.getPowerId());
|
||||
pmsGeneratrixWireMapper.update(null,lambdaUpdateWrapper);
|
||||
//台区
|
||||
LambdaQueryWrapper<PowerDistributionarea> powerDistributionareaLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
powerDistributionareaLambdaQueryWrapper.eq(PowerDistributionarea::getStatus, DataStateEnum.ENABLE.getCode()).eq(PowerDistributionarea::getPowerStationId, statationStat.getPowerId());
|
||||
@@ -176,6 +186,7 @@ public class StatationStatServiceImpl extends ServiceImpl<StatationStatMapper, S
|
||||
terminalMapper.updateById(pmsTerminalP);
|
||||
});
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user