1.pms台账功能调整
This commit is contained in:
@@ -11,9 +11,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.device.pms.enums.PmsDeviceResponseEnum;
|
||||
import com.njcn.device.pms.mapper.majornetwork.PmsGeneratrixWireMapper;
|
||||
import com.njcn.device.pms.mapper.majornetwork.PmsMidLedgerMapper;
|
||||
import com.njcn.device.pms.mapper.majornetwork.StatationStatMapper;
|
||||
import com.njcn.device.pms.mapper.majornetwork.*;
|
||||
import com.njcn.device.pms.mapper.majornetwork.PmsMidLedgerMapper;
|
||||
import com.njcn.device.pms.pojo.dto.GeneratrixAndPowerStationDTO;
|
||||
import com.njcn.device.pms.pojo.dto.GeneratrixAndPowerStationSonDTO;
|
||||
@@ -23,16 +21,19 @@ import com.njcn.device.pms.pojo.param.GeneratrixWireParam;
|
||||
import com.njcn.device.pms.pojo.param.PmsBaseParam;
|
||||
import com.njcn.device.pms.pojo.param.PmsGeneratrixParam;
|
||||
import com.njcn.device.pms.pojo.po.GeneratrixWire;
|
||||
import com.njcn.device.pms.pojo.po.Monitor;
|
||||
import com.njcn.device.pms.pojo.po.PmsMidLedger;
|
||||
import com.njcn.device.pms.pojo.po.StatationStat;
|
||||
import com.njcn.device.pms.service.majornetwork.IGeneratrixWireService;
|
||||
import com.njcn.device.pms.service.majornetwork.IStatationStatService;
|
||||
import com.njcn.event.pojo.po.PmsMonitorPO;
|
||||
import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.web.factory.PageFactory;
|
||||
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.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -57,6 +58,8 @@ public class GeneratrixWireImpl extends ServiceImpl<PmsGeneratrixWireMapper, Gen
|
||||
|
||||
private final StatationStatMapper statationStatMapper;
|
||||
|
||||
private final MonitorMapper monitorMapper;
|
||||
|
||||
@Override
|
||||
public boolean addGeneratrixWire(GeneratrixWireParam generatrixWireParam) {
|
||||
checkName(generatrixWireParam, false);
|
||||
@@ -68,12 +71,22 @@ public class GeneratrixWireImpl extends ServiceImpl<PmsGeneratrixWireMapper, Gen
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean updateGeneratrixWire(GeneratrixWireParam generatrixWireParam) {
|
||||
checkName(generatrixWireParam, true);
|
||||
GeneratrixWire generatrixWireVa = this.getById(generatrixWireParam.getId());
|
||||
if (Objects.isNull(generatrixWireVa)) {
|
||||
throw new BusinessException(PmsDeviceResponseEnum.VOLTAGE_EMPTY);
|
||||
}
|
||||
|
||||
if(!generatrixWireParam.getName().equals(generatrixWireVa.getName())){
|
||||
//名称变更需要同步修改其他台账表的母线测点名称
|
||||
LambdaUpdateWrapper<Monitor> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
|
||||
lambdaUpdateWrapper.set(Monitor::getLineName,generatrixWireParam.getName())
|
||||
.eq(Monitor::getLineId,generatrixWireVa.getId());
|
||||
monitorMapper.update(null,lambdaUpdateWrapper);
|
||||
}
|
||||
|
||||
GeneratrixWire generatrixWire = new GeneratrixWire();
|
||||
BeanUtils.copyProperties(generatrixWireParam, generatrixWire);
|
||||
return this.updateById(generatrixWire);
|
||||
|
||||
@@ -661,7 +661,7 @@
|
||||
AND B.Scale = C.Id
|
||||
</select>
|
||||
|
||||
<select id="getLineInfo" resultType="PollutionLineDTO">
|
||||
<select id="getLineInfo" resultType="com.njcn.device.biz.pojo.dto.PollutionLineDTO">
|
||||
SELECT
|
||||
A.Id,
|
||||
A.Name,
|
||||
|
||||
Reference in New Issue
Block a user