pv终端台帐 部门增加id查询所有子部门

This commit is contained in:
2022-07-28 20:36:19 +08:00
parent 9bcabf659c
commit d23053251f
69 changed files with 1032 additions and 258 deletions

View File

@@ -11,6 +11,7 @@ import com.njcn.common.utils.HttpResultUtil;
import com.njcn.device.pojo.param.pv.DeviceQueryParam;
import com.njcn.device.pojo.param.pv.PvDeviceParam;
import com.njcn.device.pojo.po.pv.PvDevice;
import com.njcn.device.pojo.vo.pv.PvDeviceVO;
import com.njcn.pvdevice.service.IPvDeviceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
@@ -91,9 +92,9 @@ public class PvDeviceController extends BaseController {
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
@ApiOperation("分页查询终端")
@ApiImplicitParam(name = "deviceQueryParam",value = "终端实体",required = true)
public HttpResult<Page<PvDevice>> getPvDeviceList(@RequestBody DeviceQueryParam deviceQueryParam){
public HttpResult<Page<PvDeviceVO>> getPvDeviceList(@RequestBody DeviceQueryParam deviceQueryParam){
String methodDescribe = getMethodDescribe("getPvDeviceList");
Page<PvDevice> page = iPvDeviceService.getPvDeviceList(deviceQueryParam);
Page<PvDeviceVO> page = iPvDeviceService.getPvDeviceList(deviceQueryParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
}
@@ -106,9 +107,9 @@ public class PvDeviceController extends BaseController {
@PostMapping("getAllPvDeviceList")
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
@ApiOperation("查询所有终端")
public HttpResult<List<PvDevice>> getAllPvDeviceList(){
public HttpResult<List<PvDeviceVO>> getAllPvDeviceList(){
String methodDescribe = getMethodDescribe("getAllPvDeviceList");
List<PvDevice> list = iPvDeviceService.getAllPvDeviceList();
List<PvDeviceVO> list = iPvDeviceService.getAllPvDeviceList();
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
}
@@ -137,18 +138,18 @@ public class PvDeviceController extends BaseController {
/**
* 删除终端
* @param id 终端id
* @param ids 终端id
* @author cdf
* @date 2022/7/5
* @return boolean
*/
@DeleteMapping("delPvDevice")
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
@PostMapping("delPvDevice")
@OperateInfo(info = LogEnum.SYSTEM_COMMON,operateType = OperateType.DELETE)
@ApiOperation("删除终端")
@ApiImplicitParam(name = "id",value = "终端id",required = true)
public HttpResult<PvDevice> delPvDevice(@RequestParam("id") String id){
@ApiImplicitParam(name = "ids",value = "终端id",required = true)
public HttpResult<PvDevice> delPvDevice(@RequestBody List<String> ids){
String methodDescribe = getMethodDescribe("delPvDevice");
boolean res = iPvDeviceService.delPvDevice(id);
boolean res = iPvDeviceService.delPvDevice(ids);
if(res){
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
}

View File

@@ -11,6 +11,7 @@ import com.njcn.common.utils.HttpResultUtil;
import com.njcn.device.pojo.param.pv.PvDistributedParam;
import com.njcn.device.pojo.param.pv.DistributedQueryParam;
import com.njcn.device.pojo.po.pv.PvDistributed;
import com.njcn.device.pojo.vo.pv.PvDistributedVO;
import com.njcn.pvdevice.service.IPvDistributedService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
@@ -91,9 +92,9 @@ public class PvDistributedController extends BaseController {
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
@ApiOperation("分页查询分布式光伏台账")
@ApiImplicitParam(name = "distributedQueryParam",value = "分布式光伏台账实体",required = true)
public HttpResult<Page<PvDistributed>> getPvDistributedList(@RequestBody DistributedQueryParam distributedQueryParam){
public HttpResult<Page<PvDistributedVO>> getPvDistributedList(@RequestBody DistributedQueryParam distributedQueryParam){
String methodDescribe = getMethodDescribe("getPvDistributedList");
Page<PvDistributed> page = iPvDistributedService.getPvDistributedList(distributedQueryParam);
Page<PvDistributedVO> page = iPvDistributedService.getPvDistributedList(distributedQueryParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
}
@@ -137,18 +138,18 @@ public class PvDistributedController extends BaseController {
/**
* 删除分布式光伏台账
* @param id 分布式光伏台账id
* @param ids 分布式光伏台账id
* @author cdf
* @date 2022/7/5
* @return boolean
*/
@DeleteMapping("delPvDistributed")
@PostMapping("delPvDistributed")
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
@ApiOperation("删除分布式光伏台账")
@ApiImplicitParam(name = "id",value = "分布式光伏台账id",required = true)
public HttpResult<PvDistributed> delPvDistributed(@RequestParam("id") String id){
@ApiImplicitParam(name = "ids",value = "分布式光伏台账ids",required = true)
public HttpResult<PvDistributed> delPvDistributed(@RequestBody List<String> ids){
String methodDescribe = getMethodDescribe("delPvDistributed");
boolean res = iPvDistributedService.delPvDistributed(id);
boolean res = iPvDistributedService.delPvDistributed(ids);
if(res){
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
}

View File

@@ -138,18 +138,18 @@ public class PvLineDetailController extends BaseController {
/**
* 删除监测点
* @param id 监测点id
* @param ids 监测点id
* @author cdf
* @date 2022/7/5
* @return boolean
*/
@DeleteMapping("delPvLineDetail")
@PostMapping("delPvLineDetail")
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
@ApiOperation("删除监测点")
@ApiImplicitParam(name = "id",value = "监测点id",required = true)
public HttpResult<PvLineDetail> delPvLineDetail(@RequestParam("id") String id){
@ApiImplicitParam(name = "ids",value = "监测点id",required = true)
public HttpResult<PvLineDetail> delPvLineDetail(@RequestBody List<String> ids){
String methodDescribe = getMethodDescribe("delPvLineDetail");
boolean res = iPvLineDetailService.delPvLineDetail(id);
boolean res = iPvLineDetailService.delPvLineDetail(ids);
if(res){
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
}

View File

@@ -11,6 +11,7 @@ import com.njcn.common.utils.HttpResultUtil;
import com.njcn.device.pojo.param.pv.LvUserQueryParam;
import com.njcn.device.pojo.param.pv.PvLvUserParam;
import com.njcn.device.pojo.po.pv.PvLvUser;
import com.njcn.device.pojo.vo.pv.PvLvUserVO;
import com.njcn.pvdevice.service.IPvLvUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
@@ -91,9 +92,9 @@ public class PvLvUserController extends BaseController {
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
@ApiOperation("分页查询低压用户台账")
@ApiImplicitParam(name = "lvUserQueryParam",value = "低压用户台账实体",required = true)
public HttpResult<Page<PvLvUser>> getPvLvUserList(@RequestBody LvUserQueryParam lvUserQueryParam){
public HttpResult<Page<PvLvUserVO>> getPvLvUserList(@RequestBody LvUserQueryParam lvUserQueryParam){
String methodDescribe = getMethodDescribe("getPvLvUserList");
Page<PvLvUser> page = iPvLvUserService.getPvLvUserList(lvUserQueryParam);
Page<PvLvUserVO> page = iPvLvUserService.getPvLvUserList(lvUserQueryParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
}
@@ -137,18 +138,18 @@ public class PvLvUserController extends BaseController {
/**
* 删除低压用户台账
* @param id 低压用户台账id
* @param ids 低压用户台账id
* @author cdf
* @date 2022/7/5
* @return boolean
*/
@DeleteMapping("delPvLvUser")
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
@PostMapping("delPvLvUser")
@OperateInfo(info = LogEnum.SYSTEM_COMMON,operateType = OperateType.DELETE)
@ApiOperation("删除低压用户台账")
@ApiImplicitParam(name = "id",value = "低压用户台账id",required = true)
public HttpResult<PvLvUser> delPvLvUser(@RequestParam("id") String id){
@ApiImplicitParam(name = "ids",value = "低压用户台账id",required = true)
public HttpResult<PvLvUser> delPvLvUser(@RequestBody List<String> ids){
String methodDescribe = getMethodDescribe("delPvLvUser");
boolean res = iPvLvUserService.delPvLvUser(id);
boolean res = iPvLvUserService.delPvLvUser(ids);
if(res){
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
}

View File

@@ -11,6 +11,7 @@ import com.njcn.common.utils.HttpResultUtil;
import com.njcn.device.pojo.param.pv.PvSubAreaParam;
import com.njcn.device.pojo.param.pv.SubAreaQueryParam;
import com.njcn.device.pojo.po.pv.PvSubArea;
import com.njcn.device.pojo.vo.pv.PvSubAreaVO;
import com.njcn.pvdevice.service.IPvSubAreaService;
import com.sun.el.parser.BooleanNode;
import io.swagger.annotations.Api;
@@ -93,9 +94,9 @@ public class PvSubAreaController extends BaseController {
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
@ApiOperation("分页查询台区")
@ApiImplicitParam(name = "subAreaQueryParam",value = "台区实体",required = true)
public HttpResult<Page<PvSubArea>> getPvSubAreaList(@RequestBody SubAreaQueryParam subAreaQueryParam){
public HttpResult<Page<PvSubAreaVO>> getPvSubAreaList(@RequestBody SubAreaQueryParam subAreaQueryParam){
String methodDescribe = getMethodDescribe("getPvSubAreaList");
Page<PvSubArea> page = iPvSubAreaService.getPvSubAreaList(subAreaQueryParam);
Page<PvSubAreaVO> page = iPvSubAreaService.getPvSubAreaList(subAreaQueryParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
}
@@ -139,18 +140,18 @@ public class PvSubAreaController extends BaseController {
/**
* 删除台区
* @param id 台区id
* @param ids 台区ids
* @author cdf
* @date 2022/7/5
* @return boolean
*/
@DeleteMapping("delPvSubArea")
@PostMapping("delPvSubArea")
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
@ApiOperation("删除台区")
@ApiImplicitParam(name = "id",value = "台区id",required = true)
public HttpResult<PvSubArea> delPvSubArea(@RequestParam("id") String id){
@ApiImplicitParam(name = "ids",value = "台区ids",required = true)
public HttpResult<PvSubArea> delPvSubArea(@RequestBody List<String> ids){
String methodDescribe = getMethodDescribe("delPvSubArea");
boolean res = iPvSubAreaService.delPvSubArea(id);
boolean res = iPvSubAreaService.delPvSubArea(ids);
if(res){
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
}

View File

@@ -132,18 +132,18 @@ public class PvSubstationController extends BaseController {
/**
* 删除变电站
* @param id 变电站id
* @param ids 变电站ids
* @author cdf
* @date 2022/7/5
* @return boolean
*/
@DeleteMapping("delPvSubstation")
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
@PostMapping("delPvSubstation")
@OperateInfo(info = LogEnum.SYSTEM_COMMON,operateType = OperateType.DELETE)
@ApiOperation("删除变电站")
@ApiImplicitParam(name = "id",value = "变电站id",required = true)
public HttpResult<PvSubstation> delPvSubstation(@RequestParam("id") String id){
@ApiImplicitParam(name = "ids",value = "变电站ids",required = true)
public HttpResult<PvSubstation> delPvSubstation(@RequestBody List<String> ids){
String methodDescribe = getMethodDescribe("delPvSubstation");
iPvSubstationService.delPvSubstation(id);
iPvSubstationService.delPvSubstation(ids);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
}

View File

@@ -11,6 +11,7 @@ import com.njcn.common.utils.HttpResultUtil;
import com.njcn.device.pojo.param.pv.PvTenVoltageParam;
import com.njcn.device.pojo.param.pv.TenVoltageQueryParam;
import com.njcn.device.pojo.po.pv.PvTenVoltage;
import com.njcn.device.pojo.vo.pv.PvTenVoltageVO;
import com.njcn.pvdevice.service.IPvTenVoltageService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
@@ -21,6 +22,8 @@ import org.springframework.web.bind.annotation.*;
import com.njcn.web.controller.BaseController;
import java.util.List;
/**
* <p>
* 前端控制器
@@ -90,11 +93,25 @@ public class PvTenVoltageController extends BaseController {
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
@ApiOperation("分页查询10kV线路")
@ApiImplicitParam(name = "tenVoltageQueryParam", value = "10kV线路实体", required = true)
public HttpResult<Page<PvTenVoltage>> getPvTenVoltageList(@RequestBody @Validated TenVoltageQueryParam tenVoltageQueryParam) {
public HttpResult<Page<PvTenVoltageVO>> getPvTenVoltageList(@RequestBody @Validated TenVoltageQueryParam tenVoltageQueryParam) {
String methodDescribe = getMethodDescribe("getPvTenVoltageList");
Page<PvTenVoltage> page = iPvTenVoltageService.getPvTenVoltageList(tenVoltageQueryParam);
Page<PvTenVoltageVO> page = iPvTenVoltageService.getPvTenVoltageList(tenVoltageQueryParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
}
/**
* 查询所有10kV线路
* @author cdf
* @date 2022/7/5
* @return List<PvTenVoltage>
*/
@GetMapping("getAllPvTenVoltageList")
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
@ApiOperation("查询所有10kV线路")
public HttpResult<List<PvTenVoltage>> getAllPvTenVoltageList(){
String methodDescribe = getMethodDescribe("getAllPvTenVoltageList");
List<PvTenVoltage> res = iPvTenVoltageService.getAllPvTenVoltageList();
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, res, methodDescribe);
}
@@ -120,18 +137,18 @@ public class PvTenVoltageController extends BaseController {
/**
* 删除10kV线路
*
* @param id 10kV线路id
* @param ids 10kV线路id
* @return boolean
* @author cdf
* @date 2022/7/5
*/
@DeleteMapping("delPvTenVoltage")
@PostMapping("delPvTenVoltage")
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
@ApiOperation("删除10kV线路")
@ApiImplicitParam(name = "id", value = "10kV线路id", required = true)
public HttpResult<PvTenVoltage> delPvTenVoltage(@RequestParam("id") String id) {
@ApiImplicitParam(name = "ids", value = "10kV线路id", required = true)
public HttpResult<PvTenVoltage> delPvTenVoltage(@RequestBody List<String> ids) {
String methodDescribe = getMethodDescribe("delPvTenVoltage");
boolean flag = iPvTenVoltageService.delPvTenVoltage(id);
boolean flag = iPvTenVoltageService.delPvTenVoltage(ids);
if (flag) {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
}

View File

@@ -7,12 +7,14 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil;
import com.njcn.device.pojo.param.pv.PvTerminalBaseQuery;
import com.njcn.device.pojo.vo.pv.DisOrLvVO;
import com.njcn.device.pojo.vo.pv.PvLineAllDetailVO;
import com.njcn.pvdevice.service.PvTerminalBaseService;
import com.njcn.user.pojo.vo.PvTerminalTreeVO;
import com.njcn.web.controller.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
@@ -68,5 +70,23 @@ public class PvTerminalBaseController extends BaseController {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, all, methodDescribe);
}
/**
* 根据userCode 和 userCodeType
* @author cdf
* @date 2022/7/28
*/
@GetMapping("pvDisOrLv")
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@ApiOperation("根据用户编号获取低压分布式详情")
@ApiImplicitParams({
@ApiImplicitParam(name = "userCode", value = "用户编号"),
@ApiImplicitParam(name = "userCodeType", value = "用户编号类型 0.光伏 1.低压"),
})
public HttpResult<DisOrLvVO> pvDisOrLv(@RequestParam("userCode")String userCode,@RequestParam("userCodeType")Integer userCodeType) {
String methodDescribe = getMethodDescribe("pvDisOrLv");
DisOrLvVO all = pvTerminalBaseService.pvDisOrLv(userCode,userCodeType);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, all, methodDescribe);
}
}

View File

@@ -4,8 +4,11 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.njcn.device.pojo.param.pv.DeviceQueryParam;
import com.njcn.device.pojo.po.pv.PvDevice;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.njcn.device.pojo.vo.pv.PvDeviceVO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
* Mapper 接口
@@ -24,7 +27,10 @@ public interface PvDeviceMapper extends BaseMapper<PvDevice> {
* @author cdf
* @date 2022/7/8
*/
Page<PvDevice> getPvDeviceList(Page<PvDevice> page,@Param("deviceQueryParam") DeviceQueryParam deviceQueryParam);
Page<PvDeviceVO> getPvDeviceList(Page<PvDeviceVO> page, @Param("deviceQueryParam") DeviceQueryParam deviceQueryParam);
List<PvDeviceVO> getAllPvDeviceList();
}

View File

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.njcn.device.pojo.param.pv.DistributedQueryParam;
import com.njcn.device.pojo.po.pv.PvDistributed;
import com.njcn.device.pojo.vo.pv.PvDistributedVO;
import org.apache.ibatis.annotations.Param;
/**
@@ -22,6 +23,6 @@ public interface PvDistributedMapper extends BaseMapper<PvDistributed> {
* @author cdf
* @date 2022/7/7
*/
Page<PvDistributed> getPvDistributedList(Page<PvDistributed> page,@Param("distributedQueryParam") DistributedQueryParam distributedQueryParam);
Page<PvDistributedVO> getPvDistributedList(Page<PvDistributedVO> page, @Param("distributedQueryParam") DistributedQueryParam distributedQueryParam);
}

View File

@@ -27,7 +27,7 @@ public interface PvLineDetailMapper extends BaseMapper<PvLineDetail> {
* @date 2022/7/5
* @return Page<PvLineDetail>
*/
Page<PvLineAllDetailVO> getPvLineAllDetailMain(Page<PvLineAllDetailVO> page,@Param("subIds") List<String> subIds, @Param("subAreaIds")List<String> subAreaIds);
Page<PvLineAllDetailVO> getPvLineAllDetailMain(Page<PvLineAllDetailVO> page,@Param("subIds") List<String> subIds, @Param("subAreaIds")List<String> subAreaIds,@Param("type")String type,@Param("lineStatus")Integer lineStatus);
}

View File

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.njcn.device.pojo.param.pv.LvUserQueryParam;
import com.njcn.device.pojo.po.pv.PvLvUser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.njcn.device.pojo.vo.pv.PvLvUserVO;
import org.apache.ibatis.annotations.Param;
/**
@@ -21,6 +22,6 @@ public interface PvLvUserMapper extends BaseMapper<PvLvUser> {
* @author cdf
* @date 2022/7/8
*/
Page<PvLvUser> getPvLvUserList(Page<PvLvUser> page,@Param("lvUserQueryParam") LvUserQueryParam lvUserQueryParam);
Page<PvLvUserVO> getPvLvUserList(Page<PvLvUserVO> page, @Param("lvUserQueryParam") LvUserQueryParam lvUserQueryParam);
}

View File

@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.njcn.device.pojo.param.pv.SubAreaQueryParam;
import com.njcn.device.pojo.po.pv.PvSubArea;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.njcn.device.pojo.vo.pv.DisOrLvVO;
import com.njcn.device.pojo.vo.pv.PvSubAreaVO;
import com.njcn.user.pojo.vo.PvTerminalTreeVO;
import org.apache.ibatis.annotations.Param;
@@ -25,7 +27,7 @@ public interface PvSubAreaMapper extends BaseMapper<PvSubArea> {
* @author cdf
* @date 2022/7/7
*/
Page<PvSubArea> getPvSubAreaList(Page<PvSubArea> page,@Param("subsAreaQueryParam") SubAreaQueryParam subsAreaQueryParam);
Page<PvSubAreaVO> getPvSubAreaList(Page<PvSubAreaVO> page, @Param("subsAreaQueryParam") SubAreaQueryParam subsAreaQueryParam);
/**
* 查询所有台区
@@ -33,4 +35,7 @@ public interface PvSubAreaMapper extends BaseMapper<PvSubArea> {
* @date 2022/7/11
*/
List<PvTerminalTreeVO> getSubAreaTreeList();
DisOrLvVO pvDisOrLv(String userCode, String userCodeType);
}

View File

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.njcn.device.pojo.param.pv.TenVoltageQueryParam;
import com.njcn.device.pojo.po.pv.PvTenVoltage;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.njcn.device.pojo.vo.pv.PvTenVoltageVO;
import org.apache.ibatis.annotations.Param;
/**
@@ -21,6 +22,6 @@ public interface PvTenVoltageMapper extends BaseMapper<PvTenVoltage> {
* @author cdf
* @date 2022/7/7
*/
Page<PvTenVoltage> getPvTenVoltageList(Page<PvTenVoltage> page,@Param("tenVoltageQueryParam") TenVoltageQueryParam tenVoltageQueryParam);
Page<PvTenVoltageVO> getPvTenVoltageList(Page<PvTenVoltageVO> page, @Param("tenVoltageQueryParam") TenVoltageQueryParam tenVoltageQueryParam);
}

View File

@@ -2,15 +2,76 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.njcn.pvdevice.mapper.PvDeviceMapper">
<select id="getPvDeviceList" resultType="PvDevice">
<select id="getPvDeviceList" resultType="PvDeviceVO">
SELECT
dev.id,
dic.NAME manufacturer,
dic2.NAME devType,
dev.manufacturer,
dic.NAME manufacturerName,
dic2.NAME devTypeName,
dev.dev_Type,
dev.type,
dic3.name typeName,
dev.Dev_Code,
dev.name,
dev.ip,
dev.port,
dev.load_time,
dev.dev_status,
dev.communicate_Type,
dev.Series,
dev.Dev_Key,
dev.This_Time_Check,
dev.Next_Time_Check,
dic4.name devGradeName,
dev.dev_grade
FROM
pv_device dev
LEFT JOIN sys_dict_data dic ON dev.manufacturer = dic.id
LEFT JOIN sys_dict_data dic2 ON dev.Dev_Type = dic2.id
LEFT JOIN sys_dict_data dic3 ON dev.type = dic3.id
LEFT JOIN sys_dict_data dic4 ON dev.dev_grade = dic4.id
<where>
<if test="deviceQueryParam.searchValue!=null and deviceQueryParam.searchValue!=''">
and dev.dev_code like CONCAT('%',#{deviceQueryParam.searchValue},'%')
or dev.name like CONCAT('%',#{deviceQueryParam.searchValue},'%')
</if>
<if test="deviceQueryParam.manufacturer!=null and deviceQueryParam.manufacturer.size > 0">
and dev.manufacturer in
<foreach collection="deviceQueryParam.manufacturer" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="deviceQueryParam.type!=null and deviceQueryParam.type.size > 0">
and dev.type in
<foreach collection="deviceQueryParam.type" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
and dev.state = 1
</where>
order by dev.create_time asc
</select>
<select id="getAllPvDeviceList" resultType="PvDeviceVO">
SELECT
dev.id,
dev.manufacturer,
dic.NAME manufacturerName,
dic2.NAME devTypeName,
dev.dev_Type,
dev.type,
dic3.name typeName,
dic3.code typeCode,
dev.Dev_Code,
dev.name,
dev.ip,
dev.port,
dev.load_time,
dev.dev_status,
dev.communicate_Type,
dev.Series,
dev.Dev_Key,
dev.This_Time_Check,
@@ -19,26 +80,7 @@
pv_device dev
LEFT JOIN sys_dict_data dic ON dev.manufacturer = dic.id
LEFT JOIN sys_dict_data dic2 ON dev.Dev_Type = dic2.id
<where>
<if test="deviceQueryParam.searchValue!=null and deviceQueryParam.searchValue!=''">
and dev.dev_code like CONCAT('%',#{deviceQueryParam.searchValue},'%')
</if>
<if test="deviceQueryParam.manufacturer!=null and deviceQueryParam.manufacturer.size > 0">
and dev.manufacturer in
<foreach collection="lvUserQueryParam.manufacturer" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="deviceQueryParam.devType!=null and deviceQueryParam.devType.size > 0">
and dev.dev_Type in
<foreach collection="lvUserQueryParam.devType" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
and dev.state = 1
</where>
order by dev.create_time asc
LEFT JOIN sys_dict_data dic3 ON dev.type = dic3.id
where dev.state = 1
</select>
</mapper>

View File

@@ -2,17 +2,22 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.njcn.pvdevice.mapper.PvDistributedMapper">
<select id="getPvDistributedList" resultType="PvDistributed">
<select id="getPvDistributedList" resultType="PvDistributedVO">
SELECT
dis.id,
dic.NAME scale,
dic.NAME scaleName,
dis.scale,
dis.NAME,
dis.User_Code,
dis.Dev_Code,
dis.Machine_Capacity,
dis.Inte_Type,
dis.Phase,
dis.Energy_Capacity
dis.Energy_Capacity,
dis.code,
dis.Smart_Switch,
dis.install_time,
dis.run_time
FROM
pv_distributed dis
LEFT JOIN sys_dict_data dic ON dis.scale = dic.id

View File

@@ -9,12 +9,21 @@
line.id,
line.NAME,
line.CODE,
line.user_Code,
line.user_Code_type,
line.dev_id,
dev.Dev_Code devName,
dic.NAME type,
dic1.NAME scale,
dev.dev_status lineStatus,
dic.NAME typeName,
line.type,
dic1.NAME scaleName,
line.scale,
line.Substation_Id,
sub.NAME substationName,
v.NAME voltageName,
line.voltage_id,
subArea.NAME subAreaName,
line.sub_area_id,
dis.NAME distributeName,
lv.NAME lvUserName,
line.num,
@@ -27,6 +36,7 @@
line.standard_capacity,
line.deal_capacity,
line.pt_Type,
dic6.name ptTypeName,
line.time_Interval,
dic2.NAME loadType,
dic3.NAME businessType,
@@ -34,11 +44,15 @@
line.Power_Flag,
line.Monitor_Id,
line.Obj_Name,
line.small_name,
line.big_name,
line.Stat_flag,
line.Remark,
line.Tf_Type,
dic4.name tfTypeName,
line.Tf_Code,
line.Ground_Type,
dic5.name groundTypeName,
line.Put_In,
line.Access,
line.Power_Supply
@@ -54,6 +68,9 @@
LEFT JOIN Pv_Lv_User lv ON line.user_code = lv.user_code
LEFT JOIN sys_dict_data dic2 ON line.load_type = dic2.id
LEFT JOIN sys_dict_data dic3 ON line.Business_Type = dic3.id
LEFT JOIN sys_dict_data dic4 ON line.Tf_Type = dic4.id
LEFT JOIN sys_dict_data dic5 ON line.Ground_Type = dic5.id
LEFT JOIN sys_dict_data dic6 ON line.pt_type = dic6.id
where line.state = 1
<if test="subIds!=null and subIds.size!=0">
and line.Substation_Id in
@@ -61,6 +78,12 @@
#{item}
</foreach>
</if>
<if test="type!=null and type!=''">
and line.type = #{type}
</if>
<if test="lineStatus!=null and type!=''">
and dev.dev_status = #{lineStatus}
</if>
</if>
<if test="subIds!=null and subIds.size!=0 and subAreaIds!=null and subAreaIds.size!=0">
@@ -72,13 +95,22 @@
SELECT
line.id,
line.NAME,
line.user_Code,
line.user_Code_type,
line.CODE,
line.dev_id,
dev.Dev_Code devName,
dic.NAME type,
dic1.NAME scale,
dev.dev_status lineStatus,
dic.NAME typeName,
line.type,
dic1.NAME scaleName,
line.scale,
line.Substation_Id,
sub.NAME substationName,
v.NAME voltageName,
line.voltage_id,
subArea.NAME subAreaName,
line.sub_area_id,
dis.NAME distributeName,
lv.NAME lvUserName,
line.num,
@@ -91,6 +123,7 @@
line.standard_capacity,
line.deal_capacity,
line.pt_Type,
dic6.name ptTypeName,
line.time_Interval,
dic2.NAME loadType,
dic3.NAME businessType,
@@ -98,11 +131,15 @@
line.Power_Flag,
line.Monitor_Id,
line.Obj_Name,
line.small_name,
line.big_name,
line.Stat_flag,
line.Remark,
line.Tf_Type,
dic4.name tfTypeName,
line.Tf_Code,
line.Ground_Type,
dic5.name groundTypeName,
line.Put_In,
line.Access,
line.Power_Supply
@@ -118,6 +155,9 @@
LEFT JOIN Pv_Lv_User lv ON line.user_code = lv.user_code
LEFT JOIN sys_dict_data dic2 ON line.load_type = dic2.id
LEFT JOIN sys_dict_data dic3 ON line.Business_Type = dic3.id
LEFT JOIN sys_dict_data dic4 ON line.Tf_Type = dic4.id
LEFT JOIN sys_dict_data dic5 ON line.Ground_Type = dic5.id
LEFT JOIN sys_dict_data dic6 ON line.pt_type = dic6.id
where line.state = 1
<if test="subAreaIds!=null and subAreaIds.size!=0">
and line.Sub_Area_Id in
@@ -125,6 +165,12 @@
#{item}
</foreach>
</if>
<if test="type!=null and type!=''">
and line.type = #{type}
</if>
<if test="lineStatus!=null and type!=''">
and dev.dev_status = #{lineStatus}
</if>
</if>

View File

@@ -2,10 +2,11 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.njcn.pvdevice.mapper.PvLvUserMapper">
<select id="getPvLvUserList" resultType="PvLvUser">
<select id="getPvLvUserList" resultType="PvLvUserVO">
SELECT
lv.id,
dic.NAME scale,
dic.NAME scaleName,
lv.scale,
lv.NAME,
lv.User_Code,
lv.User_Capacity,

View File

@@ -2,11 +2,13 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.njcn.pvdevice.mapper.PvSubAreaMapper">
<select id="getPvSubAreaList" resultType="PvSubArea">
<select id="getPvSubAreaList" resultType="PvSubAreaVO">
SELECT
sub.id,
unit.name unitId,
ten.NAME tenVoltageId,
sub.unit_id,
dept.name unitName,
sub.ten_Voltage_Id,
ten.NAME tenVoltageName,
sub.NAME,
sub.Code,
sub.Cable_Length,
@@ -23,7 +25,7 @@
sub.Power_Power
FROM
pv_sub_area sub
INNER JOIN pv_unit unit ON sub.unit_id = unit.id
INNER JOIN sys_dept dept ON sub.unit_id = dept.id
INNER JOIN pv_ten_voltage ten ON ten.id = sub.Ten_Voltage_Id
<where>
<if test="subsAreaQueryParam.searchValue!=null and subsAreaQueryParam.searchValue!=''">
@@ -51,4 +53,9 @@
<select id="getSubAreaTreeList" resultType="com.njcn.user.pojo.vo.PvTerminalTreeVO">
select id,name,unit_id pid,2 as level from pv_sub_area where state = 1
</select>
<select id="pvDisOrLv" resultType="DisOrLvVO">
</select>
</mapper>

View File

@@ -5,14 +5,16 @@
<select id="getPvSubstationList" resultType="PvSubstationVO">
SELECT
sub.id,
dept.NAME unitId,
dic.NAME scale,
sub.unit_id,
dept.NAME unitName,
dic.NAME scaleName,
sub.scale,
sub.sub_code,
sub.NAME,
sub.Total_Capacity,
sub.Team_Code
FROM
pv_substation sub
LEFT JOIN pv_unit unit ON sub.unit_id = unit.id
LEFT JOIN sys_dict_data dic ON sub.scale = dic.id
LEFT JOIN sys_dept dept ON sub.unit_id = dept.id
<where>

View File

@@ -2,12 +2,16 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.njcn.pvdevice.mapper.PvTenVoltageMapper">
<select id="getPvTenVoltageList" resultType="PvTenVoltage">
<select id="getPvTenVoltageList" resultType="PvTenVoltageVO">
SELECT
ten.id,
dic.NAME scale,
dic2.NAME designScale,
dic.NAME scaleName,
ten.scale,
dic2.NAME designScaleName,
ten.design_scale,
ten.NAME,
ten.dispatch_Id,
ten.code,
ten.Cr_Type,
ten.Dev_Status,
ten.Earthing,
@@ -20,14 +24,21 @@
ten.Run_Load,
ten.Output_Power,
ten.Max_Current,
ten.Put_Into_Date
ten.Put_Into_Date,
ten.pv_Status,
ten.pv_Capacity,
ten.pv_Num
FROM
pv_ten_voltage ten
LEFT JOIN sys_dict_data dic ON ten.scale = dic.id
LEFT JOIN sys_dict_data dic2 ON ten.Design_Scale = dic2.id
<where>
<if test="tenVoltageQueryParam.searchValue!=null and tenVoltageQueryParam.searchValue!=''">
<if test="tenVoltageQueryParam.pvStatus != null">
and ten.pv_status = #{tenVoltageQueryParam.pvStatus}
</if>
<if test="tenVoltageQueryParam.searchValue !=null and tenVoltageQueryParam.searchValue!=''">
and ten.name like CONCAT('%',#{tenVoltageQueryParam.searchValue},'%')
or ten.code like CONCAT('%',#{tenVoltageQueryParam.searchValue},'%')
</if>
<if test="tenVoltageQueryParam.scale!=null and tenVoltageQueryParam.scale.size > 0">
@@ -43,6 +54,7 @@
#{item}
</foreach>
</if>
</where>
order by ten.create_time asc
</select>

View File

@@ -6,6 +6,7 @@ import com.njcn.device.pojo.param.pv.PvDeviceParam;
import com.njcn.device.pojo.po.pv.PvDevice;
import com.baomidou.mybatisplus.extension.service.IService;
import com.njcn.device.pojo.po.pv.PvDevice;
import com.njcn.device.pojo.vo.pv.PvDeviceVO;
import java.util.List;
@@ -41,14 +42,14 @@ public interface IPvDeviceService extends IService<PvDevice> {
/**
* 分页查询分布式台账
* @param DeviceQueryParam 分布式台账实体
* @param deviceQueryParam 分布式台账实体
* @author cdf
* @date 2022/7/5
* @return Page<PvDevice>
*/
Page<PvDevice> getPvDeviceList(DeviceQueryParam deviceQueryParam);
Page<PvDeviceVO> getPvDeviceList(DeviceQueryParam deviceQueryParam);
List<PvDevice> getAllPvDeviceList();
List<PvDeviceVO> getAllPvDeviceList();
/**
@@ -62,11 +63,11 @@ public interface IPvDeviceService extends IService<PvDevice> {
/**
* 删除分布式台账
* @param id 分布式台账id
* @param ids 分布式台账id
* @author cdf
* @date 2022/7/5
* @return boolean
*/
boolean delPvDevice(String id);
boolean delPvDevice(List<String> ids);
}

View File

@@ -7,6 +7,7 @@ import com.njcn.device.pojo.param.pv.PvDistributedParam;
import com.njcn.device.pojo.param.pv.DistributedQueryParam;
import com.njcn.device.pojo.po.pv.PvDistributed;
import com.njcn.device.pojo.po.pv.PvDistributed;
import com.njcn.device.pojo.vo.pv.PvDistributedVO;
import java.util.List;
@@ -47,7 +48,7 @@ public interface IPvDistributedService extends IService<PvDistributed> {
* @date 2022/7/5
* @return Page<PvDistributed>
*/
Page<PvDistributed> getPvDistributedList(DistributedQueryParam distributedQueryParam);
Page<PvDistributedVO> getPvDistributedList(DistributedQueryParam distributedQueryParam);
List<PvDistributed> getAllPvDistributedList();
@@ -63,12 +64,12 @@ public interface IPvDistributedService extends IService<PvDistributed> {
/**
* 删除分布式台账
* @param id 分布式台账id
* @param ids 分布式台账id
* @author cdf
* @date 2022/7/5
* @return boolean
*/
boolean delPvDistributed(String id);
boolean delPvDistributed(List<String> ids);
}

View File

@@ -63,12 +63,12 @@ public interface IPvLineDetailService extends IService<PvLineDetail> {
/**
* 删除监测点
* @param id 监测点id
* @param ids 监测点id
* @author cdf
* @date 2022/7/5
* @return boolean
*/
boolean delPvLineDetail(String id);
boolean delPvLineDetail(List<String> ids);
/**
@@ -79,7 +79,7 @@ public interface IPvLineDetailService extends IService<PvLineDetail> {
* @date 2022/7/5
* @return Page<PvLineDetail>
*/
Page<PvLineAllDetailVO> getPvLineAllDetailMain(Integer pageNum,Integer pageSize,List<String> subIds, List<String> subAreaIds);
Page<PvLineAllDetailVO> getPvLineAllDetailMain(Integer pageNum,Integer pageSize,List<String> subIds, List<String> subAreaIds,String type,Integer lineStatus);

View File

@@ -6,6 +6,7 @@ import com.njcn.device.pojo.param.pv.PvLvUserParam;
import com.njcn.device.pojo.po.pv.PvLvUser;
import com.njcn.device.pojo.po.pv.PvLvUser;
import com.baomidou.mybatisplus.extension.service.IService;
import com.njcn.device.pojo.vo.pv.PvLvUserVO;
import java.util.List;
@@ -46,7 +47,7 @@ public interface IPvLvUserService extends IService<PvLvUser> {
* @date 2022/7/5
* @return Page<PvLvUser>
*/
Page<PvLvUser> getPvLvUserList(LvUserQueryParam lvUserQueryParam);
Page<PvLvUserVO> getPvLvUserList(LvUserQueryParam lvUserQueryParam);
List<PvLvUser> getAllPvLvUserList();
@@ -62,10 +63,10 @@ public interface IPvLvUserService extends IService<PvLvUser> {
/**
* 删除分低压用户台账
* @param id 分低压用户台账id
* @param ids 分低压用户台账id
* @author cdf
* @date 2022/7/5
* @return boolean
*/
boolean delPvLvUser(String id);
boolean delPvLvUser(List<String> ids);
}

View File

@@ -6,6 +6,7 @@ import com.njcn.device.pojo.param.pv.SubAreaQueryParam;
import com.njcn.device.pojo.po.pv.PvSubArea;
import com.baomidou.mybatisplus.extension.service.IService;
import com.njcn.device.pojo.po.pv.PvSubArea;
import com.njcn.device.pojo.vo.pv.PvSubAreaVO;
import java.util.List;
@@ -45,7 +46,7 @@ public interface IPvSubAreaService extends IService<PvSubArea> {
* @date 2022/7/5
* @return Page<PvSubArea>
*/
Page<PvSubArea> getPvSubAreaList(SubAreaQueryParam subAreaQueryParam);
Page<PvSubAreaVO> getPvSubAreaList(SubAreaQueryParam subAreaQueryParam);
List<PvSubArea> getAllPvSubAreaList();
@@ -61,11 +62,11 @@ public interface IPvSubAreaService extends IService<PvSubArea> {
/**
* 删除台区
* @param id 台区id
* @param ids 台区id
* @author cdf
* @date 2022/7/5
* @return boolean
*/
boolean delPvSubArea(String id);
boolean delPvSubArea(List<String> ids);
}

View File

@@ -63,11 +63,11 @@ public interface IPvSubstationService extends IService<PvSubstation> {
/**
* 删除变电站
* @param id 变电站id
* @param ids 变电站id
* @author cdf
* @date 2022/7/5
* @return boolean
*/
boolean delPvSubstation(String id);
boolean delPvSubstation(List<String> ids);
}

View File

@@ -6,6 +6,9 @@ import com.njcn.device.pojo.param.pv.TenVoltageQueryParam;
import com.njcn.device.pojo.po.pv.PvTenVoltage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.njcn.device.pojo.po.pv.PvTenVoltage;
import com.njcn.device.pojo.vo.pv.PvTenVoltageVO;
import java.util.List;
/**
* <p>
@@ -19,8 +22,8 @@ public interface IPvTenVoltageService extends IService<PvTenVoltage> {
/**
* 新增单位
* @param pvTenVoltageParam 单位实体
* 新增10kV线路
* @param pvTenVoltageParam 10kV线路实体
* @author cdf
* @date 2022/7/5
* @return boolean
@@ -28,8 +31,8 @@ public interface IPvTenVoltageService extends IService<PvTenVoltage> {
boolean addTenVoltage(PvTenVoltageParam pvTenVoltageParam);
/**
* 修改单位
* @param updatePvTenVoltageParam 单位实体
* 修改10kV线路
* @param updatePvTenVoltageParam 10kV线路实体
* @author cdf
* @date 2022/7/5
* @return boolean
@@ -38,18 +41,26 @@ public interface IPvTenVoltageService extends IService<PvTenVoltage> {
/**
* 分页查询单位
* @param tenVoltageQueryParam 单位实体
* 分页查询10kV线路
* @param tenVoltageQueryParam 10kV线路实体
* @author cdf
* @date 2022/7/5
* @return Page<PvTenVoltage>
*/
Page<PvTenVoltage> getPvTenVoltageList(TenVoltageQueryParam tenVoltageQueryParam);
Page<PvTenVoltageVO> getPvTenVoltageList(TenVoltageQueryParam tenVoltageQueryParam);
/**
* 分页查询10kV线路
* @author cdf
* @date 2022/7/5
* @return List<PvTenVoltage>
*/
List<PvTenVoltage> getAllPvTenVoltageList();
/**
* 根据单位id查询单位
* @param id 单位id
* 根据10kV线路id查询10kV线路
* @param id 10kV线路id
* @author cdf
* @date 2022/7/5
* @return PvTenVoltage
@@ -57,12 +68,12 @@ public interface IPvTenVoltageService extends IService<PvTenVoltage> {
PvTenVoltage getPvTenVoltageById(String id);
/**
* 删除单位
* @param id 单位id
* 删除10kV线路
* @param ids 10kV线路id
* @author cdf
* @date 2022/7/5
* @return boolean
*/
boolean delPvTenVoltage(String id);
boolean delPvTenVoltage(List<String> ids);
}

View File

@@ -2,6 +2,7 @@ package com.njcn.pvdevice.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.njcn.device.pojo.param.pv.PvTerminalBaseQuery;
import com.njcn.device.pojo.vo.pv.DisOrLvVO;
import com.njcn.device.pojo.vo.pv.PvLineAllDetailVO;
import com.njcn.user.pojo.vo.PvTerminalTreeVO;
@@ -29,4 +30,12 @@ public interface PvTerminalBaseService {
* @date 2022/7/11
*/
Page<PvLineAllDetailVO> lineDetailBySubId(PvTerminalBaseQuery pvTerminalBaseQuery);
/**
*
* @author cdf
* @date 2022/7/28
*/
DisOrLvVO pvDisOrLv(String userCode,Integer userCodeType);
}

View File

@@ -11,6 +11,7 @@ import com.njcn.device.pojo.param.pv.DeviceQueryParam;
import com.njcn.device.pojo.param.pv.PvDeviceParam;
import com.njcn.device.pojo.po.pv.PvDevice;
import com.njcn.device.pojo.po.pv.PvDevice;
import com.njcn.device.pojo.vo.pv.PvDeviceVO;
import com.njcn.pvdevice.mapper.PvDeviceMapper;
import com.njcn.pvdevice.service.IPvDeviceService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -62,14 +63,14 @@ public class PvDeviceServiceImpl extends ServiceImpl<PvDeviceMapper, PvDevice> i
}
@Override
public Page<PvDevice> getPvDeviceList(DeviceQueryParam subsAreaQueryParam) {
Page<PvDevice> page = new Page<>(PageFactory.getPageNum(subsAreaQueryParam), PageFactory.getPageSize(subsAreaQueryParam));
public Page<PvDeviceVO> getPvDeviceList(DeviceQueryParam subsAreaQueryParam) {
Page<PvDeviceVO> page = new Page<>(PageFactory.getPageNum(subsAreaQueryParam), PageFactory.getPageSize(subsAreaQueryParam));
return this.baseMapper.getPvDeviceList(page,subsAreaQueryParam);
}
@Override
public List<PvDevice> getAllPvDeviceList() {
return this.list();
public List<PvDeviceVO> getAllPvDeviceList() {
return this.baseMapper.getAllPvDeviceList();
}
@Override
@@ -78,8 +79,8 @@ public class PvDeviceServiceImpl extends ServiceImpl<PvDeviceMapper, PvDevice> i
}
@Override
public boolean delPvDevice(String id) {
return this.removeById(id);
public boolean delPvDevice(List<String> ids) {
return this.removeByIds(ids);
}
@@ -87,7 +88,21 @@ public class PvDeviceServiceImpl extends ServiceImpl<PvDeviceMapper, PvDevice> i
* 校验单位名称是否重复
*/
private void checkNameAndParam(PvDeviceParam pvDeviceParam, boolean isUpdate) {
LambdaQueryWrapper<PvDevice> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(PvDevice::getName, pvDeviceParam.getName());
if (isUpdate) {
//更新操作
if (pvDeviceParam instanceof PvDeviceParam.UpdatePvDeviceParam) {
lambdaQueryWrapper.ne(PvDevice::getId, ((PvDeviceParam.UpdatePvDeviceParam) pvDeviceParam).getId());
}
}
int countName = this.count(lambdaQueryWrapper);
if (countName > 0) {
throw new BusinessException(PvDeviceResponseEnum.DVE_CODE_REPEAT);
}
lambdaQueryWrapper.clear();
lambdaQueryWrapper.eq(PvDevice::getDevCode, pvDeviceParam.getDevCode());
if (isUpdate) {
//更新操作

View File

@@ -12,6 +12,7 @@ import com.njcn.device.pojo.param.pv.PvDistributedParam;
import com.njcn.device.pojo.param.pv.DistributedQueryParam;
import com.njcn.device.pojo.po.pv.PvDistributed;
import com.njcn.device.pojo.po.pv.PvDistributed;
import com.njcn.device.pojo.vo.pv.PvDistributedVO;
import com.njcn.pvdevice.mapper.PvDistributedMapper;
import com.njcn.pvdevice.service.IPvDistributedService;
import com.njcn.pvdevice.service.IPvSubAreaService;
@@ -60,8 +61,8 @@ public class PvDistributedServiceImpl extends ServiceImpl<PvDistributedMapper, P
}
@Override
public Page<PvDistributed> getPvDistributedList(DistributedQueryParam distributedQueryParam) {
Page<PvDistributed> page = new Page<>(PageFactory.getPageNum(distributedQueryParam),PageFactory.getPageSize(distributedQueryParam));
public Page<PvDistributedVO> getPvDistributedList(DistributedQueryParam distributedQueryParam) {
Page<PvDistributedVO> page = new Page<>(PageFactory.getPageNum(distributedQueryParam),PageFactory.getPageSize(distributedQueryParam));
return this.baseMapper.getPvDistributedList(page,distributedQueryParam);
}
@@ -76,8 +77,8 @@ public class PvDistributedServiceImpl extends ServiceImpl<PvDistributedMapper, P
}
@Override
public boolean delPvDistributed(String id) {
return this.removeById(id);
public boolean delPvDistributed(List<String> ids) {
return this.removeByIds(ids);
}

View File

@@ -23,6 +23,7 @@ import com.njcn.system.pojo.po.DictData;
import com.njcn.system.utils.SystemEnumUtil;
import com.njcn.web.factory.PageFactory;
import lombok.RequiredArgsConstructor;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
@@ -128,16 +129,16 @@ public class PvLineDetailServiceImpl extends ServiceImpl<PvLineDetailMapper, PvL
}
@Override
public boolean delPvLineDetail(String id) {
return this.removeById(id);
public boolean delPvLineDetail(List<String> ids) {
return this.removeByIds(ids);
}
@Override
public Page<PvLineAllDetailVO> getPvLineAllDetailMain(Integer pageNum, Integer pageSize, List<String> subIds, List<String> subAreaIds) {
public Page<PvLineAllDetailVO> getPvLineAllDetailMain(Integer pageNum, Integer pageSize, List<String> subIds, List<String> subAreaIds,String type,Integer lineStatus) {
Page<PvLineAllDetailVO> page = new Page<>(pageNum, pageSize);
return this.baseMapper.getPvLineAllDetailMain(page, subIds, subAreaIds);
return this.baseMapper.getPvLineAllDetailMain(page, subIds, subAreaIds,type,lineStatus);
}
@@ -164,25 +165,18 @@ public class PvLineDetailServiceImpl extends ServiceImpl<PvLineDetailMapper, PvL
throw new BusinessException(PvDeviceResponseEnum.LINE_DEVICE_NO_MATCH);
}*/
/*校验变电站*/
if (StrUtil.isNotBlank(pvLineDetailParam.getSubstationId())) {
if (Objects.isNull(iPvSubstationService.getPvSubstationById(pvLineDetailParam.getSubstationId()))) {
throw new BusinessException(PvDeviceResponseEnum.SUBSTATION_NULL);
}
}
/*校验台区*/
if (StrUtil.isNotBlank(pvLineDetailParam.getSubAreaId())) {
if (Objects.isNull(iPvSubAreaService.getPvSubAreaById(pvLineDetailParam.getSubAreaId()))) {
throw new BusinessException(PvDeviceResponseEnum.SUB_AREA_NULL);
}
}
/*监测点类型*/
if (DicDataEnum.ONE_LINE.getCode().equals(lineType.getCode())) {
/*校验变电站*/
if (StrUtil.isNotBlank(pvLineDetailParam.getSubstationId())) {
if (Objects.isNull(iPvSubstationService.getPvSubstationById(pvLineDetailParam.getSubstationId()))) {
throw new BusinessException(PvDeviceResponseEnum.SUBSTATION_NULL);
}
}else{
throw new BusinessException(PvDeviceResponseEnum.SUBSTATION_EMPTY);
}
//I类监测点
if (StrUtil.hasBlank(pvLineDetailParam.getSubstationId(), pvLineDetailParam.getVoltageId())) {
throw new BusinessException(PvDeviceResponseEnum.ONE_SUB_VOLTAGE_EMPTY);
@@ -192,7 +186,7 @@ public class PvLineDetailServiceImpl extends ServiceImpl<PvLineDetailMapper, PvL
}
/*校验母线*/
if(StrUtil.isBlank(pvLineDetailParam.getVoltageId())){
if (StrUtil.isBlank(pvLineDetailParam.getVoltageId())) {
throw new BusinessException(PvDeviceResponseEnum.VOLTAGE_PARAM_EMPTY);
}
@@ -201,13 +195,11 @@ public class PvLineDetailServiceImpl extends ServiceImpl<PvLineDetailMapper, PvL
}
/*I类监测点终端只能选电能质量监测终端*/
if(!DicDataEnum.DEV_QUALITY.getCode().equals(devType.getCode())){
if (!DicDataEnum.DEV_QUALITY.getCode().equals(devType.getCode())) {
throw new BusinessException(PvDeviceResponseEnum.LINE_DEVICE_NO_MATCH);
}
} else if (DicDataEnum.TWO_LINE.getCode().equals(lineType.getCode())) {
//II类监测点
if (StrUtil.isNotBlank(pvLineDetailParam.getSubstationId()) || StrUtil.isNotBlank(pvLineDetailParam.getVoltageId())) {
@@ -220,12 +212,12 @@ public class PvLineDetailServiceImpl extends ServiceImpl<PvLineDetailMapper, PvL
}
//II III 类监测点所属母线id必须为空
if(StrUtil.isNotBlank(pvLineDetailParam.getVoltageId())){
if (StrUtil.isNotBlank(pvLineDetailParam.getVoltageId())) {
throw new BusinessException(PvDeviceResponseEnum.VOLTAGE_PARAM_EMPTY_MUST);
}
/*II类监测点终端只能选融合终端*/
if(!DicDataEnum.DEV_MIX.getCode().equals(devType.getCode())){
if (DicDataEnum.DEV_QUALITY.getCode().equals(devType.getCode())) {
throw new BusinessException(PvDeviceResponseEnum.LINE_DEVICE_NO_MATCH);
}
@@ -242,24 +234,37 @@ public class PvLineDetailServiceImpl extends ServiceImpl<PvLineDetailMapper, PvL
}
/*III类监测点终端只能选智能电表终端*/
if(!DicDataEnum.DEV_SMART.getCode().equals(devType.getCode())){
if (!DicDataEnum.DEV_QUALITY.getCode().equals(devType.getCode())) {
throw new BusinessException(PvDeviceResponseEnum.LINE_DEVICE_NO_MATCH);
}
}
if (Objects.isNull(dicDataFeignClient.getDicDataById(pvLineDetailParam.getBusinessType()).getData())) {
throw new BusinessException(SystemResponseEnum.BUSINESS_EMPTY);
}
if (StrUtil.isNotBlank(pvLineDetailParam.getScale())) {
if (Objects.isNull(dicDataFeignClient.getDicDataById(pvLineDetailParam.getScale()).getData())) {
throw new BusinessException(SystemResponseEnum.LINE_TYPE_VARIETY_EMPTY);
/*校验台区*/
if (StrUtil.isNotBlank(pvLineDetailParam.getSubAreaId())) {
if (Objects.isNull(iPvSubAreaService.getPvSubAreaById(pvLineDetailParam.getSubAreaId()))) {
throw new BusinessException(PvDeviceResponseEnum.SUB_AREA_NULL);
}
}
if (Objects.isNull(dicDataFeignClient.getDicDataById(pvLineDetailParam.getLoadType()).getData())) {
throw new BusinessException(SystemResponseEnum.INTERFERENCE_EMPTY);
if (StrUtil.isNotBlank(pvLineDetailParam.getBusinessType())) {
if (Objects.isNull(dicDataFeignClient.getDicDataById(pvLineDetailParam.getBusinessType()).getData())) {
throw new BusinessException(SystemResponseEnum.BUSINESS_EMPTY);
}
}
if (StrUtil.isNotBlank(pvLineDetailParam.getScale())) {
if (StrUtil.isNotBlank(pvLineDetailParam.getScale())) {
if (Objects.isNull(dicDataFeignClient.getDicDataById(pvLineDetailParam.getScale()).getData())) {
throw new BusinessException(SystemResponseEnum.LINE_TYPE_VARIETY_EMPTY);
}
}
}
if (StrUtil.isNotBlank(pvLineDetailParam.getLoadType())) {
if (Objects.isNull(dicDataFeignClient.getDicDataById(pvLineDetailParam.getLoadType()).getData())) {
throw new BusinessException(SystemResponseEnum.INTERFERENCE_EMPTY);
}
}

View File

@@ -12,6 +12,7 @@ import com.njcn.device.pojo.param.pv.PvLvUserParam;
import com.njcn.device.pojo.po.pv.PvDistributed;
import com.njcn.device.pojo.po.pv.PvLvUser;
import com.njcn.device.pojo.po.pv.PvLvUser;
import com.njcn.device.pojo.vo.pv.PvLvUserVO;
import com.njcn.pvdevice.mapper.PvLvUserMapper;
import com.njcn.pvdevice.service.IPvLvUserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -60,8 +61,8 @@ public class PvLvUserServiceImpl extends ServiceImpl<PvLvUserMapper, PvLvUser> i
}
@Override
public Page<PvLvUser> getPvLvUserList(LvUserQueryParam lvUserQueryParam) {
Page<PvLvUser> page = new Page<>(PageFactory.getPageNum(lvUserQueryParam),PageFactory.getPageSize(lvUserQueryParam));
public Page<PvLvUserVO> getPvLvUserList(LvUserQueryParam lvUserQueryParam) {
Page<PvLvUserVO> page = new Page<>(PageFactory.getPageNum(lvUserQueryParam),PageFactory.getPageSize(lvUserQueryParam));
return this.baseMapper.getPvLvUserList(page,lvUserQueryParam);
}
@@ -76,8 +77,8 @@ public class PvLvUserServiceImpl extends ServiceImpl<PvLvUserMapper, PvLvUser> i
}
@Override
public boolean delPvLvUser(String id) {
return this.removeById(id);
public boolean delPvLvUser(List<String> ids) {
return this.removeByIds(ids);
}

View File

@@ -9,6 +9,7 @@ import com.njcn.device.pojo.param.pv.PvSubAreaParam;
import com.njcn.device.pojo.param.pv.SubAreaQueryParam;
import com.njcn.device.pojo.po.pv.PvSubArea;
import com.njcn.device.pojo.po.pv.PvSubArea;
import com.njcn.device.pojo.vo.pv.PvSubAreaVO;
import com.njcn.pvdevice.mapper.PvSubAreaMapper;
import com.njcn.pvdevice.service.IPvSubAreaService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -66,8 +67,8 @@ public class PvSubAreaServiceImpl extends ServiceImpl<PvSubAreaMapper, PvSubArea
}
@Override
public Page<PvSubArea> getPvSubAreaList(SubAreaQueryParam subsAreaQueryParam) {
Page<PvSubArea> page = new Page<>(PageFactory.getPageNum(subsAreaQueryParam),PageFactory.getPageSize(subsAreaQueryParam));
public Page<PvSubAreaVO> getPvSubAreaList(SubAreaQueryParam subsAreaQueryParam) {
Page<PvSubAreaVO> page = new Page<>(PageFactory.getPageNum(subsAreaQueryParam),PageFactory.getPageSize(subsAreaQueryParam));
return this.baseMapper.getPvSubAreaList(page,subsAreaQueryParam);
}
@@ -82,8 +83,8 @@ public class PvSubAreaServiceImpl extends ServiceImpl<PvSubAreaMapper, PvSubArea
}
@Override
public boolean delPvSubArea(String id) {
return this.removeById(id);
public boolean delPvSubArea(List<String> ids) {
return this.removeByIds(ids);
}

View File

@@ -1,5 +1,6 @@
package com.njcn.pvdevice.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -30,6 +31,7 @@ import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import java.util.Collection;
import java.util.List;
import java.util.Objects;
@@ -71,6 +73,11 @@ public class PvSubstationServiceImpl extends ServiceImpl<PvSubstationMapper, PvS
@Override
public Page<PvSubstationVO> getPvSubstationList(SubstationQueryParam substationQueryParam) {
Page<PvSubstation> page = new Page<>(PageFactory.getPageNum(substationQueryParam),PageFactory.getPageSize(substationQueryParam));
if(CollUtil.isNotEmpty(substationQueryParam.getUnitId())){
List<String> tem = deptFeignClient.getDepSonIdtByDeptId(substationQueryParam.getUnitId().get(0)).getData();
tem.add(substationQueryParam.getUnitId().get(0));
substationQueryParam.setUnitId(tem);
}
return this.baseMapper.getPvSubstationList(page,substationQueryParam);
}
@@ -85,8 +92,8 @@ public class PvSubstationServiceImpl extends ServiceImpl<PvSubstationMapper, PvS
}
@Override
public boolean delPvSubstation(String id) {
return this.removeById(id);
public boolean delPvSubstation(List<String> ids) {
return this.removeByIds(ids);
}
@@ -111,6 +118,21 @@ public class PvSubstationServiceImpl extends ServiceImpl<PvSubstationMapper, PvS
throw new BusinessException(PvDeviceResponseEnum.SUBSTATION_REPEAT);
}
lambdaQueryWrapper.clear();
lambdaQueryWrapper.eq(PvSubstation::getSubCode, pvSubstationParam.getSubCode());
if (isUpdate) {
//更新操作
if (pvSubstationParam instanceof PvSubstationParam.UpdatePvSubstationParam) {
lambdaQueryWrapper.ne(PvSubstation::getId, ((PvSubstationParam.UpdatePvSubstationParam) pvSubstationParam).getId());
}
}
int countCode = this.count(lambdaQueryWrapper);
if (countCode > 0) {
throw new BusinessException(PvDeviceResponseEnum.SUBSTATION_CODE_REPEAT);
}
DictData dictData = dicDataFeignClient.getDicDataById(pvSubstationParam.getScale()).getData();
if(Objects.isNull(dictData)){
throw new BusinessException(SystemResponseEnum.VOLTAGE_EMPTY);

View File

@@ -10,6 +10,7 @@ import com.njcn.device.pojo.param.pv.PvTenVoltageParam;
import com.njcn.device.pojo.param.pv.TenVoltageQueryParam;
import com.njcn.device.pojo.po.pv.PvTenVoltage;
import com.njcn.device.pojo.po.pv.PvTenVoltage;
import com.njcn.device.pojo.vo.pv.PvTenVoltageVO;
import com.njcn.pvdevice.mapper.PvTenVoltageMapper;
import com.njcn.pvdevice.service.IPvTenVoltageService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -21,6 +22,7 @@ import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Objects;
/**
@@ -56,19 +58,24 @@ public class PvTenVoltageServiceImpl extends ServiceImpl<PvTenVoltageMapper, PvT
}
@Override
public Page<PvTenVoltage> getPvTenVoltageList(TenVoltageQueryParam tenVoltageQueryParam) {
Page<PvTenVoltage> page = new Page<>(PageFactory.getPageNum(tenVoltageQueryParam),PageFactory.getPageSize(tenVoltageQueryParam));
public Page<PvTenVoltageVO> getPvTenVoltageList(TenVoltageQueryParam tenVoltageQueryParam) {
Page<PvTenVoltageVO> page = new Page<>(PageFactory.getPageNum(tenVoltageQueryParam),PageFactory.getPageSize(tenVoltageQueryParam));
return this.baseMapper.getPvTenVoltageList(page,tenVoltageQueryParam);
}
@Override
public List<PvTenVoltage> getAllPvTenVoltageList(){
return this.list();
}
@Override
public PvTenVoltage getPvTenVoltageById(String id) {
return this.getById(id);
}
@Override
public boolean delPvTenVoltage(String id) {
return this.removeById(id);
public boolean delPvTenVoltage(List<String> ids) {
return this.removeByIds(ids);
}

View File

@@ -3,27 +3,34 @@ package com.njcn.pvdevice.service.impl;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.enums.LineBaseEnum;
import com.njcn.device.enums.PvDeviceResponseEnum;
import com.njcn.device.pojo.param.pv.PvTerminalBaseQuery;
import com.njcn.device.pojo.po.pv.PvDistributed;
import com.njcn.device.pojo.po.pv.PvLvUser;
import com.njcn.device.pojo.po.pv.PvSubArea;
import com.njcn.device.pojo.po.pv.PvSubstation;
import com.njcn.device.pojo.vo.pv.DisOrLvVO;
import com.njcn.device.pojo.vo.pv.PvLineAllDetailVO;
import com.njcn.pvdevice.mapper.PvLineDetailMapper;
import com.njcn.pvdevice.mapper.PvSubAreaMapper;
import com.njcn.pvdevice.mapper.PvSubstationMapper;
import com.njcn.pvdevice.mapper.*;
import com.njcn.pvdevice.service.*;
import com.njcn.system.api.DicDataFeignClient;
import com.njcn.user.api.DeptFeignClient;
import com.njcn.user.pojo.vo.PvTerminalTreeVO;
import com.njcn.web.factory.PageFactory;
import com.njcn.web.pojo.param.BaseParam;
import io.swagger.models.auth.In;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* pqs
@@ -35,8 +42,6 @@ import java.util.stream.Collectors;
@RequiredArgsConstructor
public class PvTerminalBaseServiceImpl implements PvTerminalBaseService {
private final IPvUnitService iPvUnitService;
private final IPvSubstationService iPvSubstationService;
private final IPvSubAreaService iPvSubAreaService;
@@ -47,9 +52,9 @@ public class PvTerminalBaseServiceImpl implements PvTerminalBaseService {
private final PvSubAreaMapper pvSubAreaMapper;
private final PvLineDetailMapper pvLineDetailMapper;
private final PvLvUserMapper pvLvUserMapper;
private final DicDataFeignClient dicDataFeignClient;
private final PvDistributedMapper pvDistributedMapper;
private final DeptFeignClient deptFeignClient;
@@ -65,39 +70,64 @@ public class PvTerminalBaseServiceImpl implements PvTerminalBaseService {
@Override
public Page<PvLineAllDetailVO> lineDetailBySubId(PvTerminalBaseQuery pvTerminalBaseQuery) {
List<String> ids = pvTerminalBaseQuery.getId();
String id = pvTerminalBaseQuery.getId();
Integer level = pvTerminalBaseQuery.getLevel();
if(level.equals(LineBaseEnum.PV_UNIT_LEVEL.getCode())){
//点击的是单位节点
List<String> deptIds = deptFeignClient.getDepSonIdtByDeptId(id).getData();
if(CollUtil.isEmpty(deptIds)){
deptIds.add(id);
}
LambdaQueryWrapper<PvSubstation> subQuery= new LambdaQueryWrapper<>();
subQuery.in(PvSubstation::getUnitId,ids);
subQuery.in(PvSubstation::getUnitId,deptIds);
List<PvSubstation> substationList = iPvSubstationService.list(subQuery);
List<String> subIds = substationList.stream().map(PvSubstation::getId).collect(Collectors.toList());
LambdaQueryWrapper<PvSubArea> areaQuery= new LambdaQueryWrapper<>();
areaQuery.in(PvSubArea::getUnitId,ids);
areaQuery.in(PvSubArea::getUnitId,deptIds);
List<PvSubArea> subAreaList = iPvSubAreaService.list(areaQuery);
List<String> subAreaIds = subAreaList.stream().map(PvSubArea::getId).collect(Collectors.toList());
return iPvLineDetailService.getPvLineAllDetailMain(PageFactory.getPageNum(pvTerminalBaseQuery),PageFactory.getPageSize(pvTerminalBaseQuery),subIds,subAreaIds);
if(CollUtil.isEmpty(subAreaIds) && CollUtil.isEmpty(subIds)){
throw new BusinessException(PvDeviceResponseEnum.NO_SUB);
}
return iPvLineDetailService.getPvLineAllDetailMain(PageFactory.getPageNum(pvTerminalBaseQuery),PageFactory.getPageSize(pvTerminalBaseQuery),subIds,subAreaIds,pvTerminalBaseQuery.getType(),pvTerminalBaseQuery.getLineStatus());
}else if(level.equals(LineBaseEnum.PV_SUB_LEVEL.getCode())){
return iPvLineDetailService.getPvLineAllDetailMain(PageFactory.getPageNum(pvTerminalBaseQuery),PageFactory.getPageSize(pvTerminalBaseQuery), ids,null);
return iPvLineDetailService.getPvLineAllDetailMain(PageFactory.getPageNum(pvTerminalBaseQuery),PageFactory.getPageSize(pvTerminalBaseQuery), Stream.of(pvTerminalBaseQuery.getId()).collect(Collectors.toList()), null,pvTerminalBaseQuery.getType(),pvTerminalBaseQuery.getLineStatus());
}else if(level.equals(LineBaseEnum.PV_SUB_AREA_LEVEL.getCode())){
return iPvLineDetailService.getPvLineAllDetailMain(PageFactory.getPageNum(pvTerminalBaseQuery),PageFactory.getPageSize(pvTerminalBaseQuery),null,ids);
return iPvLineDetailService.getPvLineAllDetailMain(PageFactory.getPageNum(pvTerminalBaseQuery),PageFactory.getPageSize(pvTerminalBaseQuery),null,Stream.of(pvTerminalBaseQuery.getId()).collect(Collectors.toList()),pvTerminalBaseQuery.getType(),pvTerminalBaseQuery.getLineStatus());
}
throw new BusinessException(CommonResponseEnum.FAIL);
}
@Override
public DisOrLvVO pvDisOrLv(String userCode, Integer userCodeType){
DisOrLvVO disOrLvVO = new DisOrLvVO();
if(userCodeType == 1){
//低压
LambdaQueryWrapper<PvLvUser> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(PvLvUser::getUserCode,userCode).eq(PvLvUser::getState, DataStateEnum.ENABLE.getCode());
PvLvUser pvLvUser = pvLvUserMapper.selectOne(lambdaQueryWrapper);
if(Objects.nonNull(pvLvUser)){
BeanUtils.copyProperties(pvLvUser,disOrLvVO);
}
/* private void diGui(List<PvTerminalTreeVO> unitTreeList,List<PvTerminalTreeVO> subTreeList,List<PvTerminalTreeVO> subAreaTreeList) {
for (PvTerminalTreeVO unit : unitTreeList) {
if (CollUtil.isNotEmpty(unit.getChildren())) {
diGui(unit.getChildren(),subTreeList,subAreaTreeList);
} else {
unit.setChildren(getChildren(unit, subTreeList));
unit.setChildren(getChildren(unit, subAreaTreeList));
}else {
//分布式
LambdaQueryWrapper<PvDistributed> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(PvDistributed::getUserCode,userCode).eq(PvDistributed::getState, DataStateEnum.ENABLE.getCode());
PvDistributed pvDistributed = pvDistributedMapper.selectOne(lambdaQueryWrapper);
if(Objects.nonNull(pvDistributed)){
BeanUtils.copyProperties(pvDistributed,disOrLvVO);
}
}
}*/
return disOrLvVO;
}
private List<PvTerminalTreeVO> getChildren(PvTerminalTreeVO tem, List<PvTerminalTreeVO> children) {

View File

@@ -17,7 +17,7 @@ import java.util.stream.Stream;
* @version 1.0.0
* @date 2021年12月14日 12:55
*/
public class DeviceTest extends BaseJunitTest {
public class PvDeviceTest extends BaseJunitTest {
@Autowired
private DeptLineService deptLineService;