pms台账bug提交
This commit is contained in:
@@ -0,0 +1,163 @@
|
||||
package com.njcn.device.pms.pojo.vo;
|
||||
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* pqs
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2023/2/22
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class PowerClientVO extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 用户编号
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 用户名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 组织机构名称
|
||||
*/
|
||||
private String orgName;
|
||||
|
||||
/**
|
||||
* 组织机构ID(外键)
|
||||
*/
|
||||
private String orgId;
|
||||
|
||||
/**
|
||||
* 运维单位名称
|
||||
*/
|
||||
private String operationName;
|
||||
|
||||
/**
|
||||
* 运维单位ID(外键)
|
||||
*/
|
||||
private String operationId;
|
||||
|
||||
/**
|
||||
* 用户分类(字典)
|
||||
*/
|
||||
private String userType;
|
||||
|
||||
/**
|
||||
* 行业分类(字典)
|
||||
*/
|
||||
private String industryType;
|
||||
|
||||
/**
|
||||
* 用电类别(字典)
|
||||
*/
|
||||
private String electricityType;
|
||||
|
||||
/**
|
||||
* 合同容量
|
||||
*/
|
||||
private Float contractCapacity;
|
||||
|
||||
/**
|
||||
* 运行容量
|
||||
*/
|
||||
private Float operatingCapacity;
|
||||
|
||||
/**
|
||||
* 生产班次(字典)
|
||||
*/
|
||||
private String productionShift;
|
||||
|
||||
/**
|
||||
* 负荷性质(字典)
|
||||
*/
|
||||
private String loadNature;
|
||||
|
||||
/**
|
||||
* 供电电压(字典)
|
||||
*/
|
||||
private String voltageLevel;
|
||||
|
||||
/**
|
||||
* 高耗能行业类别(字典)
|
||||
*/
|
||||
private String highIndustryType;
|
||||
|
||||
/**
|
||||
* 送电日期
|
||||
*/
|
||||
private LocalDate powerTransmissionDate;
|
||||
|
||||
/**
|
||||
* 重要性等级(字典)
|
||||
*/
|
||||
private String importanceLevel;
|
||||
|
||||
/**
|
||||
* 用电客户状态(字典)
|
||||
*/
|
||||
private String eccStat;
|
||||
|
||||
/**
|
||||
* 是否敏感用户:0-否;1:是;
|
||||
*/
|
||||
private Integer ifSensitiveUser;
|
||||
|
||||
/**
|
||||
* 是否影响电能质量:0-否;1:是;
|
||||
*/
|
||||
private Integer ifPowerQuality;
|
||||
|
||||
/**
|
||||
* 是否重要客户:0-否;1:是;
|
||||
*/
|
||||
private Integer ifKeyCustomers;
|
||||
|
||||
/**
|
||||
* 敏感用户类别(字典)
|
||||
*/
|
||||
private String sensitiveType;
|
||||
|
||||
/**
|
||||
* 供电变电站(外键)
|
||||
*/
|
||||
private String powerStationId;
|
||||
|
||||
/**
|
||||
* 供电线路(外键)
|
||||
*/
|
||||
private String lineId;
|
||||
|
||||
/**
|
||||
* 供电台区(外键)
|
||||
*/
|
||||
private String platformId;
|
||||
|
||||
/**
|
||||
* 供电台区名称
|
||||
*/
|
||||
private String platformName;
|
||||
|
||||
/**
|
||||
* 用户标签
|
||||
*/
|
||||
private String userTag;
|
||||
|
||||
/**
|
||||
* 是否是上送国网监测点,0-否 1-是
|
||||
*/
|
||||
private Integer isUpToGrid;
|
||||
|
||||
/**
|
||||
* 数据状态:0-删除;1-正常;
|
||||
*/
|
||||
private Integer status;
|
||||
}
|
||||
@@ -26,6 +26,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -98,7 +99,11 @@ public class PmsDistributionMonitorController extends BaseController {
|
||||
public HttpResult<DistributionMonitor> getDistributionMonitorById(@RequestParam("monitorSort") String monitorSort,@RequestParam("id") String id){
|
||||
String methodDescribe = getMethodDescribe("getDistributionMonitorById");
|
||||
DistributionMonitor res = iDistributionMonitorService.getDistributionMonitorById(monitorSort,id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, res, methodDescribe);
|
||||
if(Objects.isNull(res)){
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
}else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, res, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.device.pms.pojo.param.PowerClientParam;
|
||||
import com.njcn.device.pms.pojo.param.PowerUserParam;
|
||||
import com.njcn.device.pms.pojo.po.PowerClient;
|
||||
import com.njcn.device.pms.pojo.vo.PowerClientVO;
|
||||
import com.njcn.device.pms.service.majornetwork.IPowerClientService;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -100,9 +101,9 @@ public class PmsPowerClientController extends BaseController {
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getPowerClientList")
|
||||
@ApiOperation("获取用电用户列表")
|
||||
public HttpResult<List<PowerClient>> getPowerClientList(@RequestBody PowerClientParam powerClientParam) {
|
||||
public HttpResult<List<PowerClientVO>> getPowerClientList(@RequestBody PowerClientParam powerClientParam) {
|
||||
String methodDescribe = getMethodDescribe("getPowerClientList");
|
||||
List<PowerClient> result = iPowerClientService.getPowerClientList(powerClientParam);
|
||||
List<PowerClientVO> result = iPowerClientService.getPowerClientList(powerClientParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,10 @@ package com.njcn.device.pms.mapper.majornetwork;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.device.pms.pojo.po.PowerClient;
|
||||
import com.njcn.device.pms.pojo.vo.PowerClientVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -13,4 +17,7 @@ import com.njcn.device.pms.pojo.po.PowerClient;
|
||||
*/
|
||||
public interface PowerClientMapper extends BaseMapper<PowerClient> {
|
||||
|
||||
|
||||
List<PowerClientVO> getPowerClientSelect(@Param("orgIds") List<String> orgIds);
|
||||
|
||||
}
|
||||
|
||||
@@ -3,4 +3,25 @@
|
||||
<mapper namespace="com.njcn.device.pms.mapper.majornetwork.PowerClientMapper">
|
||||
|
||||
|
||||
<select id="getPowerClientSelect" resultType="com.njcn.device.pms.pojo.vo.PowerClientVO">
|
||||
select
|
||||
pms_power_client.id,
|
||||
pms_power_client.name,
|
||||
pms_power_client.org_name,
|
||||
pms_power_client.org_id,
|
||||
pms_power_distributionarea.id platformId,
|
||||
pms_power_distributionarea.name platformName
|
||||
|
||||
from pms_power_client pms_power_client
|
||||
left join pms_power_distributionarea pms_power_distributionarea on pms_power_client.Platform_Id =
|
||||
pms_power_distributionarea.id
|
||||
where pms_power_client.status = 1
|
||||
and pms_power_distributionarea.status = 1
|
||||
<if test="orgIds!=null and orgIds.size!=0">
|
||||
and pms_power_client.org_id in
|
||||
<foreach collection="orgIds" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.njcn.device.pms.pojo.param.PowerClientParam;
|
||||
import com.njcn.device.pms.pojo.param.PowerUserParam;
|
||||
import com.njcn.device.pms.pojo.po.PowerClient;
|
||||
import com.njcn.device.pms.pojo.po.PowerClient;
|
||||
import com.njcn.device.pms.pojo.vo.PowerClientVO;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
|
||||
import java.util.List;
|
||||
@@ -62,7 +63,7 @@ public interface IPowerClientService extends IService<PowerClient> {
|
||||
* @date 2022/10/25
|
||||
* @return boolean
|
||||
*/
|
||||
List<PowerClient> getPowerClientList(PowerClientParam powerClientParam);
|
||||
List<PowerClientVO> getPowerClientList(PowerClientParam powerClientParam);
|
||||
|
||||
/**
|
||||
* 查询用电用户列表
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.njcn.device.pms.pojo.param.PowerGenerationUserParam;
|
||||
import com.njcn.device.pms.pojo.param.PowerUserParam;
|
||||
import com.njcn.device.pms.pojo.po.PowerClient;
|
||||
import com.njcn.device.pms.pojo.po.PowerGenerationUser;
|
||||
import com.njcn.device.pms.pojo.vo.PowerClientVO;
|
||||
import com.njcn.device.pms.service.majornetwork.IPowerClientService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.user.api.DeptFeignClient;
|
||||
@@ -22,6 +23,7 @@ import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@@ -77,15 +79,12 @@ public class PowerClientServiceImpl extends ServiceImpl<PowerClientMapper, Power
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PowerClient> getPowerClientList(PowerClientParam powerClientParam) {
|
||||
LambdaQueryWrapper<PowerClient> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
public List<PowerClientVO> getPowerClientList(PowerClientParam powerClientParam) {
|
||||
List<String> deptCodes = new ArrayList<>();
|
||||
if(StrUtil.isNotBlank(powerClientParam.getOrgId())){
|
||||
List<String> deptIds = deptFeignClient.getDepSonSelfCodetByDeptId(powerClientParam.getOrgId()).getData();
|
||||
lambdaQueryWrapper.eq(PowerClient::getOrgId,deptIds).eq(PowerClient::getStatus,DataStateEnum.ENABLE.getCode());
|
||||
deptCodes = deptFeignClient.getDepSonSelfCodetByDeptId(powerClientParam.getOrgId()).getData();
|
||||
}
|
||||
lambdaQueryWrapper.select(PowerClient::getId,PowerClient::getName,PowerClient::getOrgId,PowerClient::getOrgName);
|
||||
lambdaQueryWrapper.orderByDesc(PowerClient::getCreateTime).eq(PowerClient::getStatus, DataStateEnum.ENABLE.getCode());
|
||||
return this.list(lambdaQueryWrapper);
|
||||
return this.baseMapper.getPowerClientSelect(deptCodes);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user