接口联调
This commit is contained in:
parent
36dee732c0
commit
d271eac591
|
|
@ -13,9 +13,9 @@ import lombok.Getter;
|
|||
@AllArgsConstructor
|
||||
public enum ProjectTypeEnum {
|
||||
|
||||
PROJECT_TYPE_LINE(108, "线路工程"),
|
||||
PROJECT_TYPE_POWER(1, "变电工程"),
|
||||
|
||||
PROJECT_TYPE_POWER(109, "变电工程");
|
||||
PROJECT_TYPE_LINE(2, "线路工程");
|
||||
|
||||
private final Integer code;
|
||||
|
||||
|
|
|
|||
|
|
@ -36,11 +36,17 @@ public class TbProDepart implements Serializable {
|
|||
*/
|
||||
private Long dictCode;
|
||||
|
||||
/**
|
||||
* 项目部类型(字典表)
|
||||
*/
|
||||
private Integer departType;
|
||||
|
||||
/**
|
||||
* 项目部类型(字典表)
|
||||
*/
|
||||
@Excel(name = "项目部类型")
|
||||
private String departType;
|
||||
private String departTypeName;
|
||||
|
||||
/**
|
||||
* 地区(区域表 type==0)
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.base.mapper;
|
||||
|
||||
import com.bonus.base.domain.TbProPower;
|
||||
import com.bonus.base.domain.TbProject;
|
||||
import com.bonus.base.vo.TbProjectVo;
|
||||
import com.bonus.screen.vo.ProjectAreaGroupVo;
|
||||
|
|
@ -84,5 +85,7 @@ public interface TbProjectMapper {
|
|||
* @param areaId 区域ID
|
||||
*/
|
||||
List<ProjectAreaGroupVo> getProjectListGroupAreaByTypeCode(@Param("projectTypeCode") Integer projectTypeCode, @Param("areaId") Integer areaId);
|
||||
|
||||
List<TbProPower> getProPowerListByProId(Integer projectId);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,15 @@
|
|||
package com.bonus.screen.service.impl;
|
||||
|
||||
import com.alibaba.nacos.common.utils.CollectionUtils;
|
||||
import com.bonus.base.config.DeviceTypeEnum;
|
||||
import com.bonus.base.config.ProjectTypeEnum;
|
||||
import com.bonus.base.domain.TbProPower;
|
||||
import com.bonus.base.mapper.TbDeviceMapper;
|
||||
import com.bonus.base.mapper.TbProDepartMapper;
|
||||
import com.bonus.base.mapper.TbProjectMapper;
|
||||
import com.bonus.base.mapper.TbTeamMapper;
|
||||
import com.bonus.base.vo.TbDeviceVo;
|
||||
import com.bonus.base.vo.TbProjectVo;
|
||||
import com.bonus.common.core.utils.StringUtils;
|
||||
import com.bonus.common.core.utils.encryption.Sm4Utils;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
|
|
@ -95,6 +99,18 @@ public class ProjectViewServiceImpl {
|
|||
}
|
||||
}
|
||||
List<ProjectAreaGroupVo> projectAreaGroupVoList = tbProjectMapper.getProjectListGroupAreaByTypeCode(projectTypeCode, areaId);
|
||||
if (CollectionUtils.isNotEmpty(projectAreaGroupVoList)) {
|
||||
for (ProjectAreaGroupVo record : projectAreaGroupVoList) {
|
||||
//获取工程id
|
||||
if (record.getProjectId() != null) {
|
||||
// 获取工程信息
|
||||
List<TbProPower> powerList = tbProjectMapper.getProPowerListByProId(record.getProjectId());
|
||||
if (CollectionUtils.isNotEmpty(powerList)) {
|
||||
record.setProPowerList(powerList);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return AjaxResult.success(projectAreaGroupVoList);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,25 +19,25 @@ public class DeviceWarnRecordVo implements Serializable {
|
|||
|
||||
|
||||
@ApiModelProperty(value = "设备编号")
|
||||
private String deviceCode;
|
||||
private String devCode;
|
||||
|
||||
@ApiModelProperty(value = "设备名称")
|
||||
private String deviceName;
|
||||
private String devName;
|
||||
|
||||
@ApiModelProperty(value = "设备状态")
|
||||
private Integer deviceStatus;
|
||||
private Integer devStatus;
|
||||
|
||||
@ApiModelProperty(value = "设备状态名称")
|
||||
private String deviceStatusName;
|
||||
private String devStatusName;
|
||||
|
||||
@ApiModelProperty(value = "设备类型Code")
|
||||
private String deviceTypeCode;
|
||||
private String devTypeCode;
|
||||
|
||||
@ApiModelProperty(value = "设备类型名称")
|
||||
private String deviceTypeName;
|
||||
private String devTypeName;
|
||||
|
||||
@ApiModelProperty(value = "工程名称")
|
||||
private String projectName;
|
||||
private String proName;
|
||||
|
||||
@ApiModelProperty(value = "边缘代理设备名称")
|
||||
private String bdDeviceName;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.screen.vo;
|
||||
|
||||
import com.bonus.base.domain.TbProPower;
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
|
@ -52,4 +53,9 @@ public class ProjectAreaGroupVo implements Serializable {
|
|||
*/
|
||||
private String proStatus;
|
||||
|
||||
/**
|
||||
* 杆塔信息集合
|
||||
*/
|
||||
private List<TbProPower> proPowerList;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -237,7 +237,8 @@
|
|||
a.dev_user_phone as devUserPhone
|
||||
from tb_bd_device_record a
|
||||
left join tb_bd_record b on a.record_id = b.id and b.del_flag = '0'
|
||||
where 1=1
|
||||
where
|
||||
b.audit_status = 1
|
||||
<if test="proName != null and proName != ''">
|
||||
and b.pro_name like concat('%',#{proName},'%')
|
||||
</if>
|
||||
|
|
|
|||
|
|
@ -312,21 +312,21 @@
|
|||
|
||||
<select id="getDeviceModelDetailsPage" resultType="com.bonus.screen.vo.DeviceWarnRecordVo">
|
||||
SELECT
|
||||
td.dev_name as deviceName,
|
||||
td.dev_code AS deviceCode,
|
||||
td.dev_type AS deviceTypeName,
|
||||
td.dev_name as devName,
|
||||
td.dev_code AS devCode,
|
||||
td.dev_type AS devTypeName,
|
||||
CASE WHEN td.dev_status = 0 THEN '离线'
|
||||
WHEN td.dev_status = 1 THEN '在线'
|
||||
ELSE '未知状态' END deviceStatusName,
|
||||
tp.pro_name AS projectName,
|
||||
ELSE '未知状态' END devStatusName,
|
||||
tp.pro_name AS proName,
|
||||
tbdr.dev_name AS bdDeviceName,
|
||||
tbdr.dev_user AS devUserName
|
||||
FROM tb_device td
|
||||
LEFT JOIN tb_bd_device_record tbdr ON tbdr.id = td.bd_id
|
||||
LEFT JOIN tb_project tp ON tbdr.pro_id = tp.id
|
||||
WHERE td.del_flag = 0
|
||||
<if test="deviceTypeCode != null">
|
||||
and td.dev_type = #{deviceTypeCode}
|
||||
<if test="devTypeCode != null">
|
||||
and td.dev_type = #{devTypeCode}
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
<select id="queryByPage" resultType="com.bonus.base.domain.TbProDepart">
|
||||
select
|
||||
tpd.id as id,
|
||||
tpd.depart_name as departName, sda.dict_label as departType, sda.dict_code as dictCode, tpd.area_id as areaId,
|
||||
tpd.depart_name as departName, tpd.depart_type as departType, sda.dict_label as departTypeName, sda.dict_code as dictCode, tpd.area_id as areaId,
|
||||
ta.area_name as areaName, tpd.head_user as headUser,
|
||||
tpd.head_user_phone as headUserPhone, tpd.remarks as remarks, tpd.create_time as createTime, tpd.create_user as
|
||||
createUser,
|
||||
|
|
@ -124,13 +124,13 @@
|
|||
<if test="areaId != null">
|
||||
area_id = #{areaId},
|
||||
</if>
|
||||
<if test="headUser != null and headUser != ''">
|
||||
<if test="headUser != null">
|
||||
head_user = #{headUser},
|
||||
</if>
|
||||
<if test="headUserPhone != null and headUserPhone != ''">
|
||||
<if test="headUserPhone != null">
|
||||
head_user_phone = #{headUserPhone},
|
||||
</if>
|
||||
<if test="remarks != null and remarks != ''">
|
||||
<if test="remarks != null">
|
||||
remarks = #{remarks},
|
||||
</if>
|
||||
update_time = NOW(),
|
||||
|
|
|
|||
|
|
@ -206,5 +206,15 @@
|
|||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="getProPowerListByProId" resultType="com.bonus.base.domain.TbProPower">
|
||||
select id as id,
|
||||
pro_id as proId,
|
||||
gt_name as gtName,
|
||||
lon as lon,
|
||||
lat as lat
|
||||
from tb_pro_power
|
||||
where pro_id = #{proId}
|
||||
and del_flag = 0
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
|
|
|
|||
|
|
@ -5,20 +5,20 @@
|
|||
<select id="getDeviceWarnRecord" resultType="com.bonus.screen.vo.DeviceWarnRecordVo">
|
||||
SELECT
|
||||
tddr.id,
|
||||
tddr.dev_name AS deviceName,
|
||||
tddr.dev_name AS devName,
|
||||
tddr.create_time AS warnTime,
|
||||
tddr.attribute_name AS warnType,
|
||||
tddr.attribute_val AS warnValue,
|
||||
tddr.dev_json AS warnContent,
|
||||
tp.pro_name AS projectName,
|
||||
td.dev_code AS deviceCode
|
||||
tp.pro_name AS proName,
|
||||
td.dev_code AS devCode
|
||||
FROM tb_dev_data_record tddr
|
||||
LEFT JOIN tb_device td ON tddr.dev_id = td.id
|
||||
LEFT JOIN tb_bd_device_record tbdr ON td.dev_code = tbdr.dev_code
|
||||
LEFT JOIN tb_project tp ON tbdr.pro_id = tp.id
|
||||
WHERE tddr.is_warn = 1
|
||||
<if test="projectName != null and projectName != ''">
|
||||
and tp.pro_name like concat('%',#{projectName},'%')
|
||||
<if test="proName != null and proName != ''">
|
||||
and tp.pro_name like concat('%',#{proName},'%')
|
||||
</if>
|
||||
GROUP BY tddr.id
|
||||
</select>
|
||||
|
|
|
|||
Loading…
Reference in New Issue