Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -34,7 +34,7 @@ import java.util.stream.Stream;
|
||||
@Slf4j
|
||||
public class XssRequestWrapper extends HttpServletRequestWrapper {
|
||||
|
||||
private final static String[] WHITE_PARAMETER_NAME = {"password", "mxContent", "docContent", "bgImage"};
|
||||
private final static String[] WHITE_PARAMETER_NAME = {"password", "mxContent", "docContent", "bgImage","fileContent"};
|
||||
|
||||
|
||||
public XssRequestWrapper(HttpServletRequest request) {
|
||||
|
||||
@@ -55,6 +55,7 @@ public enum PmsDeviceResponseEnum {
|
||||
DIS_MONITOR_BIND_FIND("A00353","配网监测点存在绑定该装置关系,请先解除绑定关系"),
|
||||
TERMINAL_BIND_FIND("A00354","装置管理存在绑定该电站关系,请先解除绑定关系"),
|
||||
WIRE_BIND_FIND("A00355","线路台账存在绑定该电站关系,请先解除绑定关系"),
|
||||
TRANSFORMER_ID_REPEAT("A00355","变压器编号重复"),
|
||||
;
|
||||
|
||||
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
package com.njcn.device.pms.pojo.param;
|
||||
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* <功能描述>
|
||||
*
|
||||
@@ -10,36 +14,45 @@ import lombok.Data;
|
||||
* @createTime: 2023-02-22
|
||||
*/
|
||||
@Data
|
||||
public class TransformerParam {
|
||||
public class TransformerParam extends BaseEntity {
|
||||
|
||||
@ApiModelProperty(value = "变压器id")
|
||||
@NotBlank(message = "变压器编号不能为空")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "变压器名称")
|
||||
@NotBlank(message = "变压器名称不能为空")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "变电站ID")
|
||||
@NotBlank(message = "变电站编号不能为空")
|
||||
private String powerId;
|
||||
|
||||
@ApiModelProperty(value = "变电站名称")
|
||||
@NotBlank(message = "变电站名称不能为空")
|
||||
private String powerName;
|
||||
|
||||
@ApiModelProperty(value = "所属部门id")
|
||||
@NotBlank(message = "部门编号不能为空")
|
||||
private String orgId;
|
||||
|
||||
@ApiModelProperty(value = "所属部门名称")
|
||||
@NotBlank(message = "部门名称不能为空")
|
||||
private String orgName;
|
||||
|
||||
@ApiModelProperty(value = "变压器类型")
|
||||
@NotBlank(message = "变压器类型不能为空")
|
||||
private String type;
|
||||
|
||||
@ApiModelProperty(value = "装机容量")
|
||||
private Float iCapacity;
|
||||
|
||||
@ApiModelProperty(value = "额定容量")
|
||||
@NotNull(message = "额定容量不能为空")
|
||||
private Float rCapacity;
|
||||
|
||||
@ApiModelProperty(value = "额定电压(字典)")
|
||||
@NotBlank(message = "额定电压不能为空")
|
||||
private String voltage;
|
||||
|
||||
@ApiModelProperty(value = "额定功率")
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
package com.njcn.device.pms.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@@ -65,6 +62,7 @@ public class Transformer extends BaseEntity {
|
||||
|
||||
@ApiModelProperty(value = "数据状态:0-删除;1-正常; ")
|
||||
@TableField("Status")
|
||||
@TableLogic(value="1",delval="0")
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ import java.util.List;
|
||||
public interface PowerClientMapper extends BaseMapper<PowerClient> {
|
||||
|
||||
|
||||
List<PowerClientVO> getPowerClientSelect(@Param("orgIds") List<String> orgIds);
|
||||
List<PowerClientVO> getPowerClientSelect(@Param("orgIds") List<String> orgIds,
|
||||
@Param("id") String id);
|
||||
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ import java.util.List;
|
||||
public interface PowerGenerationUserMapper extends BaseMapper<PowerGenerationUser> {
|
||||
|
||||
|
||||
List<PowerGenerationUserVO> getPowerGenerationUserSelect(@Param("orgIds") List<String> orgIds);
|
||||
List<PowerGenerationUserVO> getPowerGenerationUserSelect(@Param("orgIds") List<String> orgIds,
|
||||
@Param("id") String id);
|
||||
|
||||
}
|
||||
|
||||
@@ -23,5 +23,8 @@
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="id !=null and id!='' ">
|
||||
and pms_power_client.id like CONCAT(CONCAT('%', #{id}), '%')
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -24,5 +24,8 @@
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="id !=null and id!='' ">
|
||||
and pms_power_generation_user.id like CONCAT(CONCAT('%', #{id}), '%')
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -54,11 +54,12 @@ public interface ITransformerService extends IService<Transformer> {
|
||||
*/
|
||||
boolean delTransformer(List<String> ids);
|
||||
|
||||
/**
|
||||
/***
|
||||
* 修改变压器台账数据状态
|
||||
*
|
||||
* @author wr
|
||||
* @date 2023-03-24 15:01
|
||||
* @param monitorParam
|
||||
* @return
|
||||
* @return boolean
|
||||
*/
|
||||
boolean updateStatus(MonitorStatus.Status monitorParam);
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ public class PowerClientServiceImpl extends ServiceImpl<PowerClientMapper, Power
|
||||
if(StrUtil.isNotBlank(powerClientParam.getOrgId())){
|
||||
deptCodes = deptFeignClient.getDepSonSelfCodetByDeptId(powerClientParam.getOrgId()).getData();
|
||||
}
|
||||
return this.baseMapper.getPowerClientSelect(deptCodes);
|
||||
return this.baseMapper.getPowerClientSelect(deptCodes,powerClientParam.getId());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ public class PowerGenerationUserServiceImpl extends ServiceImpl<PowerGenerationU
|
||||
if(StrUtil.isNotBlank(powerDistributionareaParam.getOrgId())){
|
||||
deptIds = deptFeignClient.getDepSonSelfCodetByDeptId(powerDistributionareaParam.getOrgId()).getData();
|
||||
}
|
||||
return this.baseMapper.getPowerGenerationUserSelect(deptIds);
|
||||
return this.baseMapper.getPowerGenerationUserSelect(deptIds,powerDistributionareaParam.getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -3,18 +3,25 @@ package com.njcn.device.pms.service.majornetwork.impl;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
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.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.device.pms.enums.PmsDeviceResponseEnum;
|
||||
import com.njcn.device.pms.mapper.majornetwork.TransformerMapper;
|
||||
import com.njcn.device.pms.pojo.param.MonitorAuditParam;
|
||||
import com.njcn.device.pms.pojo.param.MonitorStatus;
|
||||
import com.njcn.device.pms.pojo.param.TransformerParam;
|
||||
import com.njcn.device.pms.pojo.po.Transformer;
|
||||
import com.njcn.device.pms.service.majornetwork.ITransformerService;
|
||||
import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.user.pojo.po.Dept;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
@@ -28,8 +35,11 @@ import java.util.List;
|
||||
* @since 2023-02-20
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class TransformerServiceImpl extends ServiceImpl<TransformerMapper, Transformer> implements ITransformerService {
|
||||
|
||||
private final DeptFeignClient deptFeignClient;
|
||||
|
||||
@Override
|
||||
public Page<Transformer> getAllTransformerList(MonitorAuditParam baseParam) {
|
||||
LambdaQueryWrapper<Transformer> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
@@ -43,11 +53,13 @@ public class TransformerServiceImpl extends ServiceImpl<TransformerMapper, Trans
|
||||
@Override
|
||||
public boolean addTransformer(TransformerParam param) {
|
||||
int count = this.count(new LambdaQueryWrapper<Transformer>()
|
||||
.eq(Transformer::getName, param.getName())
|
||||
.eq(Transformer::getId, param.getId())
|
||||
.eq(Transformer::getStatus, DataStateEnum.ENABLE.getCode())
|
||||
|
||||
);
|
||||
Assert.isTrue(count == 0 , "变压器名称重复,请重新编写变压器名称");
|
||||
if(count>0){
|
||||
throw new BusinessException(PmsDeviceResponseEnum.TRANSFORMER_ID_REPEAT);
|
||||
}
|
||||
Transformer transformer = BeanUtil.copyProperties(param, Transformer.class);
|
||||
transformer.setStatus(1);
|
||||
return this.save(transformer);
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.njcn.device.pq.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.device.pq.utils.COverlimit;
|
||||
import com.njcn.device.biz.utils.COverlimit;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,301 +0,0 @@
|
||||
package com.njcn.device.pq.utils;
|
||||
|
||||
|
||||
public class COverlimit {
|
||||
|
||||
private static int MAX_SCALE_NO = 9;
|
||||
private static int MAXOVERLIMITNUM = 55+16;//WW 2017-08-10 overlimit增加电压偏差的下偏差值,原来个数是53 WW2017-11-29 54->53 新增负序电流 间谐波电压含有率
|
||||
private static float[] fULimit = {
|
||||
2.0f,1.6f,0.8f,10.0f,
|
||||
// 3.0f,2.4f,1.2f,10.0f,
|
||||
3.0f,2.4f,1.2f,10.0f,
|
||||
4.0f,3.2f,1.6f,7.0f,
|
||||
4.0f,3.2f,1.6f,7.0f,
|
||||
5.0f, 4.0f, 2.0f,7.0f,
|
||||
3.0f,2.4f,1.2f,10.0f,
|
||||
};
|
||||
private static float[] fUDevL_Limit = {-3, -7, -10};
|
||||
|
||||
private static float[] fILimit = {
|
||||
12.0f, 9.6f, 6.0f, 9.6f, 4.0f, 6.8f, 3.0f, 3.2f, 2.4f, 4.3f, 2.0f, 3.7f, 1.7f, 1.9f, 1.5f, 2.8f, 1.3f, 2.5f, 1.2f, 1.4f, 1.1f, 2.1f, 1.0f, 1.9f,
|
||||
// 16.0f,13.0f,8.1f,13.0f,5.4f,9.3f,4.1f,4.3f,3.3f,5.9f,2.7f,5.0f,2.3f,2.6f,2.0f,3.8f,1.8f,3.4f,1.6f,1.9f,1.5f,2.8f,1.4f,2.6f,
|
||||
15.0f, 12.0f, 7.7f, 12.0f, 5.1f, 8.8f, 3.8f, 4.1f, 3.1f, 5.6f, 2.6f, 4.7f, 2.2f, 2.5f, 1.9f, 3.6f, 1.7f, 3.2f, 1.5f, 1.8f, 1.4f, 2.7f, 1.3f, 2.5f,
|
||||
26.0f, 20.0f, 13.0f, 20.0f, 8.5f, 15.0f, 6.4f, 6.8f, 5.1f, 9.3f, 4.3f, 7.9f, 3.7f, 4.1f, 3.2f, 6.0f, 2.8f, 5.4f, 2.6f, 2.9f, 2.3f, 4.5f, 2.1f, 4.1f,
|
||||
43.0f, 34.0f, 21.0f, 34.0f, 14.0f, 24.0f, 11.0f, 11.0f, 8.5f, 16.0f, 7.1f, 13.0f, 6.1f, 6.8f, 5.3f, 10.0f, 4.7f, 9.0f, 4.3f, 4.9f, 3.9f, 7.4f, 3.6f, 6.8f,
|
||||
78.0f, 62.0f, 39.0f, 62.0f, 26.0f, 44.0f, 19.0f, 21.0f, 16.0f, 28.0f, 13.0f, 24.0f, 11.0f, 12.0f, 9.7f, 18.0f, 8.6f, 16.0f, 7.8f, 8.9f, 7.1f, 14.0f, 6.5f, 12.0f,
|
||||
};
|
||||
|
||||
private static float[] fILimitCoe = {
|
||||
2.0f, 1.1f, 2.0f, 1.2f, 2.0f, 1.4f, 2.0f, 2.0f, 2.0f, 1.8f, 2.0f, 1.9f, 2.0f, 2.0f, 2.0f, 2.0f, 2.0f, 2.0f, 2.0f, 2.0f, 2.0f, 2.0f, 2.0f, 2.0f
|
||||
};
|
||||
|
||||
//间谐波含有率
|
||||
private static float[] InharmLimit1 = {
|
||||
0.16f, 0.16f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f
|
||||
};
|
||||
private static float[] InharmLimit2 = {
|
||||
0.2f, 0.2f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f
|
||||
};
|
||||
|
||||
private static float GetVoltageLimit(int nHarm, int iScaleSelect)//谐波含有率
|
||||
{
|
||||
if (nHarm < 0) {
|
||||
return 0.0f;
|
||||
}
|
||||
if (iScaleSelect >= MAX_SCALE_NO) {
|
||||
return 0.0f;
|
||||
}
|
||||
switch (iScaleSelect) {
|
||||
case 6:
|
||||
iScaleSelect = 4;
|
||||
break;
|
||||
case 7:
|
||||
iScaleSelect = 2;
|
||||
break;
|
||||
case 8:
|
||||
iScaleSelect = 0;
|
||||
break;
|
||||
}
|
||||
if (iScaleSelect < 2) {
|
||||
iScaleSelect = 0;
|
||||
}
|
||||
else {
|
||||
iScaleSelect--;
|
||||
}
|
||||
int nSelect = iScaleSelect * 4 + 1;
|
||||
if (nHarm % 2 == 0) {
|
||||
nSelect = iScaleSelect * 4 + 2;
|
||||
}
|
||||
|
||||
return fULimit[nSelect];
|
||||
}
|
||||
|
||||
private static float GetVoltageJBLimit(int iScaleSelect)//谐波畸变率
|
||||
{
|
||||
if (iScaleSelect >= MAX_SCALE_NO)
|
||||
return 0.0f;
|
||||
switch (iScaleSelect) {
|
||||
case 6:
|
||||
iScaleSelect = 4;
|
||||
break;
|
||||
case 7:
|
||||
iScaleSelect = 2;
|
||||
break;
|
||||
case 8:
|
||||
iScaleSelect = 0;
|
||||
break;
|
||||
}
|
||||
if (iScaleSelect < 2) {
|
||||
iScaleSelect = 0;
|
||||
}
|
||||
else {
|
||||
iScaleSelect--;
|
||||
}
|
||||
int nSelect = iScaleSelect * 4;
|
||||
return fULimit[nSelect];
|
||||
}
|
||||
|
||||
private static float GetVoltageDevationLimit(int iScaleSelect)//电压偏差
|
||||
{
|
||||
if (iScaleSelect >= MAX_SCALE_NO) {
|
||||
return 0.0f;
|
||||
}
|
||||
switch (iScaleSelect) {
|
||||
case 6:
|
||||
iScaleSelect = 4;
|
||||
break;
|
||||
case 7:
|
||||
iScaleSelect = 2;
|
||||
break;
|
||||
case 8:
|
||||
iScaleSelect = 0;
|
||||
break;
|
||||
}
|
||||
if (iScaleSelect < 2) {
|
||||
iScaleSelect = 0;
|
||||
}
|
||||
else {
|
||||
iScaleSelect--;
|
||||
}
|
||||
int nSelect = iScaleSelect * 4 + 3;
|
||||
return fULimit[nSelect];
|
||||
}
|
||||
|
||||
private static float GetVoltageDevationLimit_L(int iScaleSelect)//电压偏差负数
|
||||
{
|
||||
if (iScaleSelect >= MAX_SCALE_NO) {
|
||||
return 0.0f;
|
||||
}
|
||||
int nReturn = 0;
|
||||
if (iScaleSelect == 3 || iScaleSelect == 4 || iScaleSelect == 5 || iScaleSelect == 6) {
|
||||
nReturn = 1;
|
||||
}
|
||||
else if (iScaleSelect == -1) {
|
||||
nReturn = 2;
|
||||
}
|
||||
return fUDevL_Limit[nReturn];
|
||||
}
|
||||
|
||||
private static float GetCurrentLimit(int nHarm, int iScaleSelect, float fDLRL, float fJZRL, float fXYRL, float fSBRL) {
|
||||
if (nHarm < 0) {
|
||||
return 0.0f;
|
||||
}
|
||||
if (iScaleSelect >= MAX_SCALE_NO) {
|
||||
return 0.0f;
|
||||
}
|
||||
switch (iScaleSelect) {
|
||||
case 6:
|
||||
iScaleSelect = 4;
|
||||
break;
|
||||
case 7:
|
||||
iScaleSelect = 2;
|
||||
break;
|
||||
case 8:
|
||||
iScaleSelect = 0;
|
||||
break;
|
||||
}
|
||||
if (iScaleSelect < 2) {
|
||||
iScaleSelect = 0;
|
||||
}
|
||||
else {
|
||||
iScaleSelect--;
|
||||
}
|
||||
int nBaseSelect = nHarm + iScaleSelect * 24;
|
||||
float fRealLimit = fDLRL / fJZRL * fILimit[nBaseSelect];
|
||||
fRealLimit = fRealLimit * (float) Math.pow(fXYRL / fSBRL, 1.0f / fILimitCoe[nHarm]);
|
||||
return fRealLimit;
|
||||
}
|
||||
|
||||
public static float GetFCurrentLimit(String strScale, float fDLRL){
|
||||
float uL = 0.0f;
|
||||
switch (strScale) {
|
||||
case "0.38kV":
|
||||
uL = 0.4f;
|
||||
break;
|
||||
case "6kV":
|
||||
uL = 6.3f;
|
||||
break;
|
||||
case "10kV":
|
||||
uL = 10.5f;
|
||||
break;
|
||||
case "20kV":
|
||||
uL = 21.0f;
|
||||
break;
|
||||
case "35kV":
|
||||
uL = 36.5f;
|
||||
break;
|
||||
case "66kV":
|
||||
uL = 69.0f;
|
||||
break;
|
||||
case "110kV":
|
||||
uL = 115.0f;
|
||||
break;
|
||||
case "220kV":
|
||||
uL = 230.0f;
|
||||
break;
|
||||
case "330kV":
|
||||
uL = 345.0f;
|
||||
break;
|
||||
default:
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
return 2.6f/100 * fDLRL * 1000 / ((float)Math.sqrt(3) * uL);
|
||||
}
|
||||
|
||||
public static float GetInHarm(int i, int iScaleSelect){
|
||||
if(iScaleSelect == 5){
|
||||
return InharmLimit1[i];
|
||||
}else{
|
||||
return InharmLimit2[i];
|
||||
}
|
||||
}
|
||||
|
||||
public static int TransStringScaleToInt(String strScale) {
|
||||
if (strScale.equals("110kV")) {
|
||||
return 1;
|
||||
}
|
||||
else if (strScale.equals("35kV") || strScale.equals("66kV")) {
|
||||
return 2;
|
||||
}
|
||||
else if (strScale.equals("10kV")) {
|
||||
return 3;
|
||||
}
|
||||
else if (strScale.equals("6kV")) {
|
||||
return 4;
|
||||
}
|
||||
else if (strScale.equals("0.38kV")) {
|
||||
return 5;
|
||||
}
|
||||
else if (strScale.equals("20kV")) {
|
||||
return 6;
|
||||
}
|
||||
else if (strScale.equals("220kV")) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static float[] GetOverLimit(String strScale, float fDLRL, float fJZRL, float fXYRL, float fSBRL) {
|
||||
int i = 0;
|
||||
|
||||
int nScale = TransStringScaleToInt(strScale);
|
||||
|
||||
float[] fLimit = new float[COverlimit.MAXOVERLIMITNUM];
|
||||
//频率偏差
|
||||
fLimit[0] = 0.2f;
|
||||
//电压偏差
|
||||
fLimit[1] = GetVoltageDevationLimit(nScale);
|
||||
//电压不平衡
|
||||
fLimit[2] = 2.0f;
|
||||
//闪变
|
||||
if (nScale < 2) {
|
||||
fLimit[3] = 1.0f;
|
||||
}
|
||||
else {
|
||||
fLimit[3] = 0.8f;
|
||||
}
|
||||
//畸变率
|
||||
fLimit[4] = GetVoltageJBLimit(nScale);
|
||||
//24谐波电压幅值
|
||||
for (i = 0; i < 24; i++) {
|
||||
fLimit[5 + i] = GetVoltageLimit(i, nScale);
|
||||
}
|
||||
//24谐波电流幅值
|
||||
for (i = 0; i < 24; i++) {
|
||||
fLimit[5 + 24 + i] = GetCurrentLimit(i, nScale, fDLRL, fJZRL, fXYRL, fSBRL);
|
||||
}
|
||||
/****************************
|
||||
* Modify by yexb 20181015
|
||||
*此项为电压下偏差
|
||||
* 增加则MAXOVERLIMITNUM的值为54
|
||||
* 不增加则MAXOVERLIMITNUM的值为53
|
||||
***************************/
|
||||
fLimit[COverlimit.MAXOVERLIMITNUM-2-16] = GetVoltageDevationLimit_L(nScale);
|
||||
|
||||
//负序电流
|
||||
fLimit[COverlimit.MAXOVERLIMITNUM-1-16] = GetFCurrentLimit(strScale,fDLRL);
|
||||
|
||||
//间谐波电压含有率
|
||||
for (i = 0; i < 16; i++) {
|
||||
fLimit[55 + i] = GetInHarm(i, nScale);
|
||||
}
|
||||
|
||||
return fLimit;
|
||||
}
|
||||
|
||||
/* public void addOverLimit(String lineId, String scaTmp) {
|
||||
Overlimit overlimit = new Overlimit();
|
||||
LineDetail tmp = lineDetailMapper.selectById(lineId);
|
||||
float fDLRL = tmp.getShortCapacity();
|
||||
float fJZRL = tmp.getStandardCapacity();
|
||||
float fXYRL = tmp.getDealCapacity();
|
||||
float fSBRL = tmp.getDevCapacity();
|
||||
|
||||
float[] fLimit = COverlimit.GetOverLimit(scaTmp, fDLRL, fJZRL, fXYRL, fSBRL);
|
||||
|
||||
|
||||
overLimitMapper.insert(overlimit);
|
||||
}*/
|
||||
}
|
||||
@@ -74,7 +74,7 @@ public class StatisticsOfTransientIndicatorssServiceImpl implements StatisticsOf
|
||||
@Override
|
||||
public List<RStatOrgVO> getRStatOrg(UniversalFrontEndParam param) {
|
||||
//获取所有子部门信息
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData();
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDepSonDetailByDeptId(param.getId()).getData();
|
||||
if (CollectionUtil.isEmpty(deptDTOList)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ public enum ProcessResponseEnum {
|
||||
QUERY_IS_EMPTY("A00554","当前未查询到当前策略信息,无法删除!"),
|
||||
ENABLED_CANNOT_BE_DELETED("A00555","策略为启用状态不能删除!"),
|
||||
THERE_IS_ONLY_ONE_STRATEGY("A00556","各个策略等级,通用策略只能有一条!"),
|
||||
TERMINAL_ID_REPEAT("A00351","终端编号已存在"),
|
||||
;
|
||||
|
||||
private final String code;
|
||||
|
||||
@@ -89,7 +89,7 @@ public class TerminalParam {
|
||||
private String installPlace;
|
||||
|
||||
@ApiModelProperty(value = "检测时间")
|
||||
private String inspectionTime;
|
||||
private LocalDate inspectionTime;
|
||||
|
||||
@ApiModelProperty(value = "送检单位")
|
||||
private String inspectionUnit;
|
||||
@@ -129,7 +129,7 @@ public class TerminalParam {
|
||||
private String installPlace;
|
||||
|
||||
@ApiModelProperty(value = "检测时间")
|
||||
private String inspectionTime;
|
||||
private LocalDate inspectionTime;
|
||||
|
||||
@ApiModelProperty(value = "送检单位")
|
||||
private String inspectionUnit;
|
||||
|
||||
@@ -20,6 +20,7 @@ import com.njcn.oss.enums.OssResponseEnum;
|
||||
import com.njcn.oss.utils.FileStorageUtil;
|
||||
import com.njcn.poi.excel.ExcelUtil;
|
||||
import com.njcn.poi.util.PoiUtil;
|
||||
import com.njcn.process.enums.ProcessResponseEnum;
|
||||
import com.njcn.process.pojo.dto.excel.TerminalExcel;
|
||||
import com.njcn.process.pojo.param.TerminalParam;
|
||||
import com.njcn.process.pojo.po.PmsTerminalDetection;
|
||||
@@ -115,19 +116,26 @@ public class PmsTerminalDetectionServiceImpl extends ServiceImpl<PmsTerminalDete
|
||||
if (ObjectUtil.isNull(data)) {
|
||||
throw new BusinessException(CommonResponseEnum.NO_DATA, "部门不存在");
|
||||
}
|
||||
int count = this.count(new LambdaQueryWrapper<PmsTerminalDetection>()
|
||||
List<PmsTerminalDetection> list = this.list(new LambdaQueryWrapper<PmsTerminalDetection>()
|
||||
.eq(PmsTerminalDetection::getId, param.getId())
|
||||
.or(wrapper ->
|
||||
wrapper.eq(PmsTerminalDetection::getName, param.getName())
|
||||
)
|
||||
);
|
||||
if (count > 0) {
|
||||
throw new BusinessException(PmsDeviceResponseEnum.MODEL_NAME_REPEAT, "或终端编号已存在");
|
||||
if (CollectionUtil.isNotEmpty(list)) {
|
||||
List<String> collect = list.stream().map(PmsTerminalDetection::getName).collect(Collectors.toList());
|
||||
if(collect.contains(param.getName())){
|
||||
throw new BusinessException(PmsDeviceResponseEnum.MODEL_NAME_REPEAT);
|
||||
}
|
||||
throw new BusinessException(ProcessResponseEnum.TERMINAL_ID_REPEAT);
|
||||
}
|
||||
PmsTerminalDetection detection = BeanUtil.copyProperties(param, PmsTerminalDetection.class);
|
||||
detection.setOriginalName(detection.getId() + "-原始数据报告.docx");
|
||||
detection.setOrgNo(data.getCode());
|
||||
detection.setOrgName(data.getName());
|
||||
|
||||
LocalDate inspectionTime = param.getInspectionTime();
|
||||
detection.setNextInspectionTime(inspectionTime.plusYears(5));
|
||||
detection.setTestResults(0);
|
||||
detection.setStatus(1);
|
||||
return this.save(detection);
|
||||
@@ -160,17 +168,21 @@ public class PmsTerminalDetectionServiceImpl extends ServiceImpl<PmsTerminalDete
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean updateTerminal(TerminalParam.TerminalUpdateParam param) {
|
||||
PmsTerminalDetection one = this.getOne(new LambdaQueryWrapper<PmsTerminalDetection>()
|
||||
List<PmsTerminalDetection> list = this.list(new LambdaQueryWrapper<PmsTerminalDetection>()
|
||||
.ne(PmsTerminalDetection::getId, param.getId())
|
||||
.and(wrapper ->
|
||||
wrapper.eq(PmsTerminalDetection::getName, param.getName())
|
||||
)
|
||||
|
||||
);
|
||||
if (ObjectUtil.isNotNull(one)) {
|
||||
if (CollectionUtil.isNotEmpty(list)) {
|
||||
List<String> collect = list.stream().map(PmsTerminalDetection::getName).collect(Collectors.toList());
|
||||
if(collect.contains(param.getName())){
|
||||
throw new BusinessException(PmsDeviceResponseEnum.MODEL_NAME_REPEAT);
|
||||
}
|
||||
}
|
||||
PmsTerminalDetection detection = BeanUtil.copyProperties(param, PmsTerminalDetection.class);
|
||||
LocalDate inspectionTime = param.getInspectionTime();
|
||||
detection.setNextInspectionTime(inspectionTime.plusYears(5));
|
||||
boolean b = this.updateById(detection);
|
||||
if (b) {
|
||||
PmsTerminalDetection cc = this.getOne(new LambdaQueryWrapper<PmsTerminalDetection>()
|
||||
@@ -243,7 +255,8 @@ public class PmsTerminalDetectionServiceImpl extends ServiceImpl<PmsTerminalDete
|
||||
//文件上传的地址
|
||||
String path = fileStorageUtil.uploadMultipart(files[i], OssPath.TEST_REPORT);
|
||||
detection.setInspectionReport(path);
|
||||
detection.setNextInspectionTime(LocalDate.parse(nextInspectionTime));
|
||||
detection.setInspectionTime(LocalDate.parse(nextInspectionTime));
|
||||
detection.setNextInspectionTime(LocalDate.parse(nextInspectionTime).plusYears(5));
|
||||
detection.setInspectionName(originalFilename);
|
||||
detection.setId(terminalIds);
|
||||
data.add(detection);
|
||||
@@ -424,6 +437,8 @@ public class PmsTerminalDetectionServiceImpl extends ServiceImpl<PmsTerminalDete
|
||||
detection = BeanUtil.copyProperties(terminalExcel, PmsTerminalDetection.class);
|
||||
detection.setOrgNo(deptList.get(0).getCode());
|
||||
detection.setOrgName(deptList.get(0).getName());
|
||||
LocalDate inspectionTime = detection.getInspectionTime();
|
||||
detection.setNextInspectionTime(inspectionTime.plusYears(5));
|
||||
detection.setTestResults(0);
|
||||
detection.setStatus(1);
|
||||
pmsTerminalDetections.add(detection);
|
||||
@@ -452,5 +467,4 @@ public class PmsTerminalDetectionServiceImpl extends ServiceImpl<PmsTerminalDete
|
||||
msg.setMsg(content);
|
||||
terminalExcelMsg.add(msg);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -34,7 +34,6 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
||||
@@ -160,6 +160,27 @@ public enum DicDataEnum {
|
||||
DY_10KV("交流10kV","10kV"),
|
||||
DY_35KV("交流35kV","35kV"),
|
||||
DY_110KV("交流110kV","110kV"),
|
||||
/**
|
||||
* 电压等级
|
||||
* @author cdf
|
||||
* @date 2023/3/24
|
||||
*/
|
||||
|
||||
KV038("0.38kV","0.38kV"),
|
||||
V380("380V","380V"),
|
||||
KV04("0.4kV","0.4kV"),
|
||||
V400("400V","400V"),
|
||||
KV6("6kV","6kV"),
|
||||
KV10("10kV","10kV"),
|
||||
KV20("20kV","20kV"),
|
||||
KV35("35kV","35kV"),
|
||||
KV66("66kV","66kV"),
|
||||
KV110("110kV","110kV"),
|
||||
KV220("220kV","220kV"),
|
||||
KV330("330kV","330kV"),
|
||||
KV500("500kV","500kV"),
|
||||
KV750("750kV","750kV"),
|
||||
KV1000("1000kV","1000kV"),
|
||||
|
||||
/**
|
||||
* 计划采取实施
|
||||
|
||||
@@ -450,6 +450,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
||||
*/
|
||||
private void judgeIp(@NotNull User user, UserStrategy userStrategy) {
|
||||
String ipSection = user.getLimitIpStart() + "-" + user.getLimitIpEnd();
|
||||
log.error("用户实际ip:"+RequestUtil.getRealIp());
|
||||
log.error("用户限制ip:"+ipSection);
|
||||
if (RequestUtil.getRealIp().equalsIgnoreCase(LogInfo.UNKNOWN_IP)) {
|
||||
//feign接口可能获取的IP是空的
|
||||
throw new BusinessException(UserResponseEnum.INVALID_IP);
|
||||
|
||||
Reference in New Issue
Block a user