新能源场站高低电压穿越融合台账业务
This commit is contained in:
@@ -96,8 +96,8 @@ public enum DeviceResponseEnum {
|
||||
SAME_ALARM_STRATEGY("A0361","当前等级策略已存在"),
|
||||
LINE_GRADE_INDEX_ERR("A0362","异常等级索引"),
|
||||
LINE_GRADE_LESS("A0363","监测点等级策略缺失"),
|
||||
FLOW_UPDATE("A0364","默认类型必须存在一个")
|
||||
|
||||
FLOW_UPDATE("A0364","默认类型必须存在一个"),
|
||||
NEWSTATION_IS_BIND_LINE("A0365","已绑定监测点")
|
||||
|
||||
|
||||
;
|
||||
|
||||
@@ -180,6 +180,11 @@ public class LineDetail{
|
||||
*/
|
||||
private Integer runFlag;
|
||||
|
||||
/**
|
||||
* 新能源场站信息ID
|
||||
*/
|
||||
private String newStationId;
|
||||
|
||||
/**
|
||||
* 通讯状态
|
||||
*/
|
||||
|
||||
@@ -68,7 +68,7 @@ public class NewStationController extends BaseController {
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.QUERY)
|
||||
@DeleteMapping("/selectDown")
|
||||
@GetMapping("/selectDown")
|
||||
@ApiOperation("获取新能源场站高低电压穿越信息下拉框(用于监测点维护界面)")
|
||||
public HttpResult<List<Map>> selectDown(@RequestParam(name = "name",required = false) String name) {
|
||||
String methodDescribe = getMethodDescribe("selectDown");
|
||||
|
||||
@@ -62,4 +62,9 @@ public interface LineDetailMapper extends BaseMapper<LineDetail> {
|
||||
* @return 结果
|
||||
*/
|
||||
List<LineDetail> getLineDetailByIds(@Param("ids") List<String> Ids);
|
||||
|
||||
/**
|
||||
* 判断该新能源场站信息是否绑定了测点ID
|
||||
*/
|
||||
Integer checkExistsLineByNewStationId(@Param("newStationId") String newStationId);
|
||||
}
|
||||
|
||||
@@ -96,4 +96,9 @@
|
||||
set run_flag = #{runFlag}
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<select id="checkExistsLineByNewStationId" resultType="int">
|
||||
select count(1) from pq_line pl inner join pq_line_detail pld
|
||||
on pl.id = pld.id and pl.State = 1 and pld.New_Station_Id = #{newStationId}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -4,6 +4,9 @@ import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.device.biz.enums.DeviceResponseEnum;
|
||||
import com.njcn.device.pq.mapper.LineDetailMapper;
|
||||
import com.njcn.device.pq.mapper.NewStationMapper;
|
||||
import com.njcn.device.pq.pojo.param.NewStationQueryParam;
|
||||
import com.njcn.device.pq.pojo.po.NewStation;
|
||||
@@ -27,6 +30,8 @@ import java.util.Map;
|
||||
@RequiredArgsConstructor
|
||||
public class NewStationServiceImpl extends ServiceImpl<NewStationMapper, NewStation> implements INewStationService {
|
||||
|
||||
private final LineDetailMapper lineDetailMapper;
|
||||
|
||||
@Override
|
||||
public Page<NewStation> queryPage(NewStationQueryParam newStationQueryParam) {
|
||||
Page<NewStation> returnpage = new Page<> (newStationQueryParam.getPageNum(),newStationQueryParam.getPageSize());
|
||||
@@ -51,9 +56,19 @@ public class NewStationServiceImpl extends ServiceImpl<NewStationMapper, NewStat
|
||||
|
||||
@Override
|
||||
public Boolean delNewStation(String ids) {
|
||||
List<String> listIds = Arrays.asList(ids.split(","));
|
||||
//判断该新能源场站信息是否绑定了测点ID
|
||||
for(String id : listIds){
|
||||
if(lineDetailMapper.checkExistsLineByNewStationId(id)!=0){
|
||||
LambdaUpdateWrapper<NewStation> queryWrapper = new LambdaUpdateWrapper<>();
|
||||
queryWrapper.eq(NewStation::getId,id);
|
||||
NewStation newStation = this.baseMapper.selectOne(queryWrapper);
|
||||
throw new BusinessException(newStation == null?"":newStation.getName()+DeviceResponseEnum.NEWSTATION_IS_BIND_LINE.getMessage());
|
||||
}
|
||||
}
|
||||
LambdaUpdateWrapper<NewStation> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
|
||||
lambdaUpdateWrapper.set(NewStation::getState,0)
|
||||
.in(NewStation::getId, Arrays.asList(ids.split(",")));
|
||||
.in(NewStation::getId, listIds);
|
||||
boolean update = this.update(lambdaUpdateWrapper);
|
||||
return update;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user