1.修改变压器代码
2.优化策略,策略添加和修改的验证
This commit is contained in:
@@ -55,6 +55,7 @@ public enum PmsDeviceResponseEnum {
|
|||||||
DIS_MONITOR_BIND_FIND("A00353","配网监测点存在绑定该装置关系,请先解除绑定关系"),
|
DIS_MONITOR_BIND_FIND("A00353","配网监测点存在绑定该装置关系,请先解除绑定关系"),
|
||||||
TERMINAL_BIND_FIND("A00354","装置管理存在绑定该电站关系,请先解除绑定关系"),
|
TERMINAL_BIND_FIND("A00354","装置管理存在绑定该电站关系,请先解除绑定关系"),
|
||||||
WIRE_BIND_FIND("A00355","线路台账存在绑定该电站关系,请先解除绑定关系"),
|
WIRE_BIND_FIND("A00355","线路台账存在绑定该电站关系,请先解除绑定关系"),
|
||||||
|
TRANSFORMER_ID_REPEAT("A00355","变压器编号重复"),
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
package com.njcn.device.pms.pojo.param;
|
package com.njcn.device.pms.pojo.param;
|
||||||
|
|
||||||
|
import com.njcn.db.bo.BaseEntity;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <功能描述>
|
* <功能描述>
|
||||||
*
|
*
|
||||||
@@ -10,36 +14,45 @@ import lombok.Data;
|
|||||||
* @createTime: 2023-02-22
|
* @createTime: 2023-02-22
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class TransformerParam {
|
public class TransformerParam extends BaseEntity {
|
||||||
|
|
||||||
@ApiModelProperty(value = "变压器id")
|
@ApiModelProperty(value = "变压器id")
|
||||||
|
@NotBlank(message = "变压器编号不能为空")
|
||||||
private String id;
|
private String id;
|
||||||
|
|
||||||
@ApiModelProperty(value = "变压器名称")
|
@ApiModelProperty(value = "变压器名称")
|
||||||
|
@NotBlank(message = "变压器名称不能为空")
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
@ApiModelProperty(value = "变电站ID")
|
@ApiModelProperty(value = "变电站ID")
|
||||||
|
@NotBlank(message = "变电站编号不能为空")
|
||||||
private String powerId;
|
private String powerId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "变电站名称")
|
@ApiModelProperty(value = "变电站名称")
|
||||||
|
@NotBlank(message = "变电站名称不能为空")
|
||||||
private String powerName;
|
private String powerName;
|
||||||
|
|
||||||
@ApiModelProperty(value = "所属部门id")
|
@ApiModelProperty(value = "所属部门id")
|
||||||
|
@NotBlank(message = "部门编号不能为空")
|
||||||
private String orgId;
|
private String orgId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "所属部门名称")
|
@ApiModelProperty(value = "所属部门名称")
|
||||||
|
@NotBlank(message = "部门名称不能为空")
|
||||||
private String orgName;
|
private String orgName;
|
||||||
|
|
||||||
@ApiModelProperty(value = "变压器类型")
|
@ApiModelProperty(value = "变压器类型")
|
||||||
|
@NotBlank(message = "变压器类型不能为空")
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
@ApiModelProperty(value = "装机容量")
|
@ApiModelProperty(value = "装机容量")
|
||||||
private Float iCapacity;
|
private Float iCapacity;
|
||||||
|
|
||||||
@ApiModelProperty(value = "额定容量")
|
@ApiModelProperty(value = "额定容量")
|
||||||
|
@NotNull(message = "额定容量不能为空")
|
||||||
private Float rCapacity;
|
private Float rCapacity;
|
||||||
|
|
||||||
@ApiModelProperty(value = "额定电压(字典)")
|
@ApiModelProperty(value = "额定电压(字典)")
|
||||||
|
@NotBlank(message = "额定电压不能为空")
|
||||||
private String voltage;
|
private String voltage;
|
||||||
|
|
||||||
@ApiModelProperty(value = "额定功率")
|
@ApiModelProperty(value = "额定功率")
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
package com.njcn.device.pms.pojo.po;
|
package com.njcn.device.pms.pojo.po;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
import com.njcn.db.bo.BaseEntity;
|
import com.njcn.db.bo.BaseEntity;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
@@ -65,6 +62,7 @@ public class Transformer extends BaseEntity {
|
|||||||
|
|
||||||
@ApiModelProperty(value = "数据状态:0-删除;1-正常; ")
|
@ApiModelProperty(value = "数据状态:0-删除;1-正常; ")
|
||||||
@TableField("Status")
|
@TableField("Status")
|
||||||
|
@TableLogic(value="1",delval="0")
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import java.util.List;
|
|||||||
public interface PowerClientMapper extends BaseMapper<PowerClient> {
|
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> {
|
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}
|
#{item}
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
|
<if test="id !=null and id!='' ">
|
||||||
|
and pms_power_client.id like CONCAT(CONCAT('%', #{id}), '%')
|
||||||
|
</if>
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -24,5 +24,8 @@
|
|||||||
#{item}
|
#{item}
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
|
<if test="id !=null and id!='' ">
|
||||||
|
and pms_power_generation_user.id like CONCAT(CONCAT('%', #{id}), '%')
|
||||||
|
</if>
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -54,11 +54,12 @@ public interface ITransformerService extends IService<Transformer> {
|
|||||||
*/
|
*/
|
||||||
boolean delTransformer(List<String> ids);
|
boolean delTransformer(List<String> ids);
|
||||||
|
|
||||||
/**
|
/***
|
||||||
* 修改变压器台账数据状态
|
* 修改变压器台账数据状态
|
||||||
*
|
* @author wr
|
||||||
|
* @date 2023-03-24 15:01
|
||||||
* @param monitorParam
|
* @param monitorParam
|
||||||
* @return
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
boolean updateStatus(MonitorStatus.Status monitorParam);
|
boolean updateStatus(MonitorStatus.Status monitorParam);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ public class PowerClientServiceImpl extends ServiceImpl<PowerClientMapper, Power
|
|||||||
if(StrUtil.isNotBlank(powerClientParam.getOrgId())){
|
if(StrUtil.isNotBlank(powerClientParam.getOrgId())){
|
||||||
deptCodes = deptFeignClient.getDepSonSelfCodetByDeptId(powerClientParam.getOrgId()).getData();
|
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())){
|
if(StrUtil.isNotBlank(powerDistributionareaParam.getOrgId())){
|
||||||
deptIds = deptFeignClient.getDepSonSelfCodetByDeptId(powerDistributionareaParam.getOrgId()).getData();
|
deptIds = deptFeignClient.getDepSonSelfCodetByDeptId(powerDistributionareaParam.getOrgId()).getData();
|
||||||
}
|
}
|
||||||
return this.baseMapper.getPowerGenerationUserSelect(deptIds);
|
return this.baseMapper.getPowerGenerationUserSelect(deptIds,powerDistributionareaParam.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -3,18 +3,25 @@ package com.njcn.device.pms.service.majornetwork.impl;
|
|||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import cn.hutool.core.lang.Assert;
|
import cn.hutool.core.lang.Assert;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
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.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
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.common.pojo.enums.common.DataStateEnum;
|
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.mapper.majornetwork.TransformerMapper;
|
||||||
import com.njcn.device.pms.pojo.param.MonitorAuditParam;
|
import com.njcn.device.pms.pojo.param.MonitorAuditParam;
|
||||||
import com.njcn.device.pms.pojo.param.MonitorStatus;
|
import com.njcn.device.pms.pojo.param.MonitorStatus;
|
||||||
import com.njcn.device.pms.pojo.param.TransformerParam;
|
import com.njcn.device.pms.pojo.param.TransformerParam;
|
||||||
import com.njcn.device.pms.pojo.po.Transformer;
|
import com.njcn.device.pms.pojo.po.Transformer;
|
||||||
import com.njcn.device.pms.service.majornetwork.ITransformerService;
|
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 org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -28,8 +35,11 @@ import java.util.List;
|
|||||||
* @since 2023-02-20
|
* @since 2023-02-20
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
public class TransformerServiceImpl extends ServiceImpl<TransformerMapper, Transformer> implements ITransformerService {
|
public class TransformerServiceImpl extends ServiceImpl<TransformerMapper, Transformer> implements ITransformerService {
|
||||||
|
|
||||||
|
private final DeptFeignClient deptFeignClient;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<Transformer> getAllTransformerList(MonitorAuditParam baseParam) {
|
public Page<Transformer> getAllTransformerList(MonitorAuditParam baseParam) {
|
||||||
LambdaQueryWrapper<Transformer> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<Transformer> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
@@ -43,11 +53,13 @@ public class TransformerServiceImpl extends ServiceImpl<TransformerMapper, Trans
|
|||||||
@Override
|
@Override
|
||||||
public boolean addTransformer(TransformerParam param) {
|
public boolean addTransformer(TransformerParam param) {
|
||||||
int count = this.count(new LambdaQueryWrapper<Transformer>()
|
int count = this.count(new LambdaQueryWrapper<Transformer>()
|
||||||
.eq(Transformer::getName, param.getName())
|
.eq(Transformer::getId, param.getId())
|
||||||
.eq(Transformer::getStatus, DataStateEnum.ENABLE.getCode())
|
.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 transformer = BeanUtil.copyProperties(param, Transformer.class);
|
||||||
transformer.setStatus(1);
|
transformer.setStatus(1);
|
||||||
return this.save(transformer);
|
return this.save(transformer);
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ public enum ProcessResponseEnum {
|
|||||||
QUERY_IS_EMPTY("A00554","当前未查询到当前策略信息,无法删除!"),
|
QUERY_IS_EMPTY("A00554","当前未查询到当前策略信息,无法删除!"),
|
||||||
ENABLED_CANNOT_BE_DELETED("A00555","策略为启用状态不能删除!"),
|
ENABLED_CANNOT_BE_DELETED("A00555","策略为启用状态不能删除!"),
|
||||||
THERE_IS_ONLY_ONE_STRATEGY("A00556","各个策略等级,通用策略只能有一条!"),
|
THERE_IS_ONLY_ONE_STRATEGY("A00556","各个策略等级,通用策略只能有一条!"),
|
||||||
|
TERMINAL_ID_REPEAT("A00351","终端编号已存在"),
|
||||||
;
|
;
|
||||||
|
|
||||||
private final String code;
|
private final String code;
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ public class TerminalParam {
|
|||||||
private String installPlace;
|
private String installPlace;
|
||||||
|
|
||||||
@ApiModelProperty(value = "检测时间")
|
@ApiModelProperty(value = "检测时间")
|
||||||
private String inspectionTime;
|
private LocalDate inspectionTime;
|
||||||
|
|
||||||
@ApiModelProperty(value = "送检单位")
|
@ApiModelProperty(value = "送检单位")
|
||||||
private String inspectionUnit;
|
private String inspectionUnit;
|
||||||
@@ -129,7 +129,7 @@ public class TerminalParam {
|
|||||||
private String installPlace;
|
private String installPlace;
|
||||||
|
|
||||||
@ApiModelProperty(value = "检测时间")
|
@ApiModelProperty(value = "检测时间")
|
||||||
private String inspectionTime;
|
private LocalDate inspectionTime;
|
||||||
|
|
||||||
@ApiModelProperty(value = "送检单位")
|
@ApiModelProperty(value = "送检单位")
|
||||||
private String inspectionUnit;
|
private String inspectionUnit;
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import com.njcn.oss.enums.OssResponseEnum;
|
|||||||
import com.njcn.oss.utils.FileStorageUtil;
|
import com.njcn.oss.utils.FileStorageUtil;
|
||||||
import com.njcn.poi.excel.ExcelUtil;
|
import com.njcn.poi.excel.ExcelUtil;
|
||||||
import com.njcn.poi.util.PoiUtil;
|
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.dto.excel.TerminalExcel;
|
||||||
import com.njcn.process.pojo.param.TerminalParam;
|
import com.njcn.process.pojo.param.TerminalParam;
|
||||||
import com.njcn.process.pojo.po.PmsTerminalDetection;
|
import com.njcn.process.pojo.po.PmsTerminalDetection;
|
||||||
@@ -115,19 +116,26 @@ public class PmsTerminalDetectionServiceImpl extends ServiceImpl<PmsTerminalDete
|
|||||||
if (ObjectUtil.isNull(data)) {
|
if (ObjectUtil.isNull(data)) {
|
||||||
throw new BusinessException(CommonResponseEnum.NO_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())
|
.eq(PmsTerminalDetection::getId, param.getId())
|
||||||
.or(wrapper ->
|
.or(wrapper ->
|
||||||
wrapper.eq(PmsTerminalDetection::getName, param.getName())
|
wrapper.eq(PmsTerminalDetection::getName, param.getName())
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
if (count > 0) {
|
if (CollectionUtil.isNotEmpty(list)) {
|
||||||
throw new BusinessException(PmsDeviceResponseEnum.MODEL_NAME_REPEAT, "或终端编号已存在");
|
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);
|
PmsTerminalDetection detection = BeanUtil.copyProperties(param, PmsTerminalDetection.class);
|
||||||
detection.setOriginalName(detection.getId() + "-原始数据报告.docx");
|
detection.setOriginalName(detection.getId() + "-原始数据报告.docx");
|
||||||
detection.setOrgNo(data.getCode());
|
detection.setOrgNo(data.getCode());
|
||||||
detection.setOrgName(data.getName());
|
detection.setOrgName(data.getName());
|
||||||
|
|
||||||
|
LocalDate inspectionTime = param.getInspectionTime();
|
||||||
|
detection.setNextInspectionTime(inspectionTime.plusYears(5));
|
||||||
detection.setTestResults(0);
|
detection.setTestResults(0);
|
||||||
detection.setStatus(1);
|
detection.setStatus(1);
|
||||||
return this.save(detection);
|
return this.save(detection);
|
||||||
@@ -160,17 +168,21 @@ public class PmsTerminalDetectionServiceImpl extends ServiceImpl<PmsTerminalDete
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean updateTerminal(TerminalParam.TerminalUpdateParam param) {
|
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())
|
.ne(PmsTerminalDetection::getId, param.getId())
|
||||||
.and(wrapper ->
|
.and(wrapper ->
|
||||||
wrapper.eq(PmsTerminalDetection::getName, param.getName())
|
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);
|
throw new BusinessException(PmsDeviceResponseEnum.MODEL_NAME_REPEAT);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
PmsTerminalDetection detection = BeanUtil.copyProperties(param, PmsTerminalDetection.class);
|
PmsTerminalDetection detection = BeanUtil.copyProperties(param, PmsTerminalDetection.class);
|
||||||
|
LocalDate inspectionTime = param.getInspectionTime();
|
||||||
|
detection.setNextInspectionTime(inspectionTime.plusYears(5));
|
||||||
boolean b = this.updateById(detection);
|
boolean b = this.updateById(detection);
|
||||||
if (b) {
|
if (b) {
|
||||||
PmsTerminalDetection cc = this.getOne(new LambdaQueryWrapper<PmsTerminalDetection>()
|
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);
|
String path = fileStorageUtil.uploadMultipart(files[i], OssPath.TEST_REPORT);
|
||||||
detection.setInspectionReport(path);
|
detection.setInspectionReport(path);
|
||||||
detection.setNextInspectionTime(LocalDate.parse(nextInspectionTime));
|
detection.setInspectionTime(LocalDate.parse(nextInspectionTime));
|
||||||
|
detection.setNextInspectionTime(LocalDate.parse(nextInspectionTime).plusYears(5));
|
||||||
detection.setInspectionName(originalFilename);
|
detection.setInspectionName(originalFilename);
|
||||||
detection.setId(terminalIds);
|
detection.setId(terminalIds);
|
||||||
data.add(detection);
|
data.add(detection);
|
||||||
@@ -424,6 +437,8 @@ public class PmsTerminalDetectionServiceImpl extends ServiceImpl<PmsTerminalDete
|
|||||||
detection = BeanUtil.copyProperties(terminalExcel, PmsTerminalDetection.class);
|
detection = BeanUtil.copyProperties(terminalExcel, PmsTerminalDetection.class);
|
||||||
detection.setOrgNo(deptList.get(0).getCode());
|
detection.setOrgNo(deptList.get(0).getCode());
|
||||||
detection.setOrgName(deptList.get(0).getName());
|
detection.setOrgName(deptList.get(0).getName());
|
||||||
|
LocalDate inspectionTime = detection.getInspectionTime();
|
||||||
|
detection.setNextInspectionTime(inspectionTime.plusYears(5));
|
||||||
detection.setTestResults(0);
|
detection.setTestResults(0);
|
||||||
detection.setStatus(1);
|
detection.setStatus(1);
|
||||||
pmsTerminalDetections.add(detection);
|
pmsTerminalDetections.add(detection);
|
||||||
@@ -452,5 +467,4 @@ public class PmsTerminalDetectionServiceImpl extends ServiceImpl<PmsTerminalDete
|
|||||||
msg.setMsg(content);
|
msg.setMsg(content);
|
||||||
terminalExcelMsg.add(msg);
|
terminalExcelMsg.add(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.IntStream;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
|
|||||||
Reference in New Issue
Block a user