首页大屏地图
This commit is contained in:
parent
601f69adb7
commit
4a263ebb1c
|
|
@ -94,5 +94,28 @@ public class TbBdDeviceRecordController extends BaseController {
|
||||||
return tbBdDeviceRecordService.deleteByPrimaryKey(id);
|
return tbBdDeviceRecordService.deleteByPrimaryKey(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据工程id查询杆塔
|
||||||
|
* @param tbBdDeviceVo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/getPowerList")
|
||||||
|
public TableDataInfo getPowerList(TbBdDeviceVo tbBdDeviceVo) {
|
||||||
|
List<TbBdDeviceVo> list = tbBdDeviceRecordService.getPowerList(tbBdDeviceVo);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id修改绑定的杆塔
|
||||||
|
* @param record
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/updatePowerId")
|
||||||
|
public AjaxResult updatePowerId(@RequestBody @NotNull(message = "参数不能为空") @Valid TbBdDeviceRecord record) {
|
||||||
|
return toAjax(tbBdDeviceRecordService.updatePowerId(record));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -95,5 +95,17 @@ public class TbBdDeviceRecord implements Serializable {
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private Date auditTime;
|
private Date auditTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 杆塔id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="杆塔id")
|
||||||
|
private Long powerId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 杆塔名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="杆塔名称")
|
||||||
|
private Long powerName;
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
}
|
}
|
||||||
|
|
@ -52,4 +52,8 @@ public interface TbBdDeviceRecordMapper {
|
||||||
int deleteById(Long id);
|
int deleteById(Long id);
|
||||||
|
|
||||||
int queryByDeviceId(Long id);
|
int queryByDeviceId(Long id);
|
||||||
|
|
||||||
|
List<TbBdDeviceVo> getPowerList(TbBdDeviceVo tbBdDeviceVo);
|
||||||
|
|
||||||
|
int updatePowerId(TbBdDeviceRecord record);
|
||||||
}
|
}
|
||||||
|
|
@ -40,4 +40,8 @@ public interface TbBdDeviceRecordService{
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<TbBdDeviceVo> getDeviceList(TbBdDeviceVo tbBdDeviceVo);
|
List<TbBdDeviceVo> getDeviceList(TbBdDeviceVo tbBdDeviceVo);
|
||||||
|
|
||||||
|
List<TbBdDeviceVo> getPowerList(TbBdDeviceVo tbBdDeviceVo);
|
||||||
|
|
||||||
|
int updatePowerId(TbBdDeviceRecord record);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -91,5 +91,15 @@ public class TbBdDeviceRecordServiceImpl implements TbBdDeviceRecordService{
|
||||||
return deviceList;
|
return deviceList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<TbBdDeviceVo> getPowerList(TbBdDeviceVo tbBdDeviceVo) {
|
||||||
|
return tbBdDeviceRecordMapper.getPowerList(tbBdDeviceVo);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int updatePowerId(TbBdDeviceRecord record) {
|
||||||
|
return tbBdDeviceRecordMapper.updatePowerId(record);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -74,5 +74,27 @@ public class TbBdDeviceVo {
|
||||||
@ApiModelProperty(value="负责人电话-sm4加密")
|
@ApiModelProperty(value="负责人电话-sm4加密")
|
||||||
private String devUserPhone;
|
private String devUserPhone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 杆塔id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="杆塔id")
|
||||||
|
private String powerId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 杆塔名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="杆塔名称")
|
||||||
|
private String powerName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目类型
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="项目类型")
|
||||||
|
private String proType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目类型
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="绑定id")
|
||||||
|
private String bindId;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.bonus.screen.controller;
|
package com.bonus.screen.controller;
|
||||||
|
|
||||||
|
import com.bonus.base.domain.TbBdDeviceRecord;
|
||||||
import com.bonus.base.domain.TbDevice;
|
import com.bonus.base.domain.TbDevice;
|
||||||
import com.bonus.base.service.TbUserPostService;
|
import com.bonus.base.service.TbUserPostService;
|
||||||
import com.bonus.common.core.web.controller.BaseController;
|
import com.bonus.common.core.web.controller.BaseController;
|
||||||
|
|
@ -12,6 +13,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -142,6 +145,16 @@ public class ProjectViewTwoController extends BaseController {
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据工程id获取大屏首页地图工程信息
|
||||||
|
* @param record
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/getProjectAndDeviceById")
|
||||||
|
public AjaxResult getProjectAndDeviceById(DeviceNumByProjectVo record) {
|
||||||
|
return success(projectViewService.getProjectAndDeviceById(record));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// /**
|
// /**
|
||||||
// * 感知设备数量
|
// * 感知设备数量
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
package com.bonus.screen.mapper;
|
||||||
|
|
||||||
|
import com.bonus.screen.vo.DeviceNumByProjectVo;
|
||||||
|
import com.bonus.screen.vo.UserPost;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface DeviceNumByProjectMapper {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据工程id获取大屏首页地图工程信息
|
||||||
|
* @param record
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
DeviceNumByProjectVo getProjectAndDeviceById(DeviceNumByProjectVo record);
|
||||||
|
}
|
||||||
|
|
@ -12,6 +12,7 @@ import com.bonus.base.mapper.TbTeamMapper;
|
||||||
import com.bonus.common.core.utils.StringUtils;
|
import com.bonus.common.core.utils.StringUtils;
|
||||||
import com.bonus.common.core.utils.encryption.Sm4Utils;
|
import com.bonus.common.core.utils.encryption.Sm4Utils;
|
||||||
import com.bonus.common.core.web.domain.AjaxResult;
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
|
import com.bonus.screen.mapper.DeviceNumByProjectMapper;
|
||||||
import com.bonus.screen.mapper.TbDeviceDataRecord;
|
import com.bonus.screen.mapper.TbDeviceDataRecord;
|
||||||
import com.bonus.screen.mapper.TeamRecordMapper;
|
import com.bonus.screen.mapper.TeamRecordMapper;
|
||||||
import com.bonus.screen.mapper.UserPostMapper;
|
import com.bonus.screen.mapper.UserPostMapper;
|
||||||
|
|
@ -50,6 +51,9 @@ public class ProjectViewServiceImpl {
|
||||||
@Autowired
|
@Autowired
|
||||||
private UserPostMapper userPost;
|
private UserPostMapper userPost;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private DeviceNumByProjectMapper deviceNumByProjectMapper;
|
||||||
|
|
||||||
public ProjectViewVo getProjectView() {
|
public ProjectViewVo getProjectView() {
|
||||||
return tbProjectMapper.getProjectView(
|
return tbProjectMapper.getProjectView(
|
||||||
ProjectTypeEnum.PROJECT_TYPE_POWER.getCode(),
|
ProjectTypeEnum.PROJECT_TYPE_POWER.getCode(),
|
||||||
|
|
@ -267,4 +271,12 @@ public class ProjectViewServiceImpl {
|
||||||
});
|
});
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据工程id获取大屏首页地图工程信息
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public DeviceNumByProjectVo getProjectAndDeviceById(DeviceNumByProjectVo record) {
|
||||||
|
return deviceNumByProjectMapper.getProjectAndDeviceById(record);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,52 @@
|
||||||
|
package com.bonus.screen.vo;
|
||||||
|
|
||||||
|
import com.bonus.common.core.annotation.Excel;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@ApiModel(description="设备表,边代记录表")
|
||||||
|
@Data
|
||||||
|
public class DeviceNumByProjectVo implements Serializable {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工程id
|
||||||
|
*/
|
||||||
|
private Long proId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工程名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="工程名称")
|
||||||
|
private String proName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 感知设备类型数
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="感知设备类型数")
|
||||||
|
private Integer devTypeNum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 感知设备数量
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="感知设备数量")
|
||||||
|
private Integer devNum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备正常数量
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="设备正常数量")
|
||||||
|
private Integer successNum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备异常数量
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="设备异常数量")
|
||||||
|
private Integer errorNum;
|
||||||
|
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
}
|
||||||
|
|
@ -15,31 +15,31 @@ public class TeamRecordNum implements Serializable {
|
||||||
/**
|
/**
|
||||||
* 施工班组数
|
* 施工班组数
|
||||||
*/
|
*/
|
||||||
@Excel(name = "施工班组数")
|
@ApiModelProperty(value="施工班组数")
|
||||||
private Integer teamNum;
|
private Integer teamNum;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 施工人员数
|
* 施工人员数
|
||||||
*/
|
*/
|
||||||
@Excel(name = "施工人员数")
|
@ApiModelProperty(value="施工人员数")
|
||||||
private Integer peopleNum;
|
private Integer peopleNum;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 班组骨干
|
* 班组骨干
|
||||||
*/
|
*/
|
||||||
@Excel(name = "班组骨干")
|
@ApiModelProperty(value="班组骨干")
|
||||||
private Integer teamMaster;
|
private Integer teamMaster;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 一般作业
|
* 一般作业
|
||||||
*/
|
*/
|
||||||
@Excel(name = "一般作业")
|
@ApiModelProperty(value="一般作业")
|
||||||
private Integer teamSame;
|
private Integer teamSame;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 特种作业
|
* 特种作业
|
||||||
*/
|
*/
|
||||||
@Excel(name = "特种作业")
|
@ApiModelProperty(value="特种作业")
|
||||||
private Integer teamSpecial;
|
private Integer teamSpecial;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -190,6 +190,12 @@
|
||||||
where record_id = #{id}
|
where record_id = #{id}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<update id="updatePowerId">
|
||||||
|
update tb_bd_device_record
|
||||||
|
set power_id = #{powerId}
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
<delete id="deleteByPrimaryKeyIn">
|
<delete id="deleteByPrimaryKeyIn">
|
||||||
<!--@mbg.generated-->
|
<!--@mbg.generated-->
|
||||||
delete from tb_bd_device_record where id in
|
delete from tb_bd_device_record where id in
|
||||||
|
|
@ -229,6 +235,8 @@
|
||||||
b.depart_id as departId,
|
b.depart_id as departId,
|
||||||
b.depart_name as departName,
|
b.depart_name as departName,
|
||||||
b.pro_id as proId,
|
b.pro_id as proId,
|
||||||
|
tp.pro_type as proType,
|
||||||
|
a.power_id as bindId,
|
||||||
b.pro_name as proName,
|
b.pro_name as proName,
|
||||||
a.area_name as areaName,
|
a.area_name as areaName,
|
||||||
a.dev_name as devName,
|
a.dev_name as devName,
|
||||||
|
|
@ -236,7 +244,9 @@
|
||||||
a.dev_user as devUser,
|
a.dev_user as devUser,
|
||||||
a.dev_user_phone as devUserPhone
|
a.dev_user_phone as devUserPhone
|
||||||
from tb_bd_device_record a
|
from tb_bd_device_record a
|
||||||
|
|
||||||
left join tb_bd_record b on a.record_id = b.id and b.del_flag = '0'
|
left join tb_bd_record b on a.record_id = b.id and b.del_flag = '0'
|
||||||
|
left join tb_project tp on b.pro_id = tp.id
|
||||||
where
|
where
|
||||||
b.audit_status = 1
|
b.audit_status = 1
|
||||||
<if test="proName != null and proName != ''">
|
<if test="proName != null and proName != ''">
|
||||||
|
|
@ -271,4 +281,17 @@
|
||||||
select count(1) from tb_device
|
select count(1) from tb_device
|
||||||
where del_flag = 0 and bd_id = #{id}
|
where del_flag = 0 and bd_id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getPowerList" resultType="com.bonus.base.vo.TbBdDeviceVo">
|
||||||
|
SELECT
|
||||||
|
bp.id as powerId,
|
||||||
|
bp.gt_name as powerName,
|
||||||
|
bd.power_id as bindId
|
||||||
|
FROM
|
||||||
|
tb_bd_device_record bd
|
||||||
|
|
||||||
|
LEFT JOIN tb_pro_power bp on bd.pro_id = bp.pro_id
|
||||||
|
WHERE bd.id = #{id} and bp.del_flag = 0
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.bonus.screen.mapper.DeviceNumByProjectMapper">
|
||||||
|
|
||||||
|
<!-- 根据工程id获取大屏首页地图工程信息 -->
|
||||||
|
<select id="getProjectAndDeviceById" resultType="com.bonus.screen.vo.DeviceNumByProjectVo">
|
||||||
|
select
|
||||||
|
tp.id as proId,
|
||||||
|
tp.pro_name as proName,
|
||||||
|
count(distinct td.dev_type) as devTypeNum,
|
||||||
|
count(td.id) as devNum,
|
||||||
|
count(case when td.dev_warn = 0 then 1 end) as successNum,
|
||||||
|
count(case when td.dev_warn = 1 then 1 end) as errorNum
|
||||||
|
from tb_project tp
|
||||||
|
left join tb_bd_device_record tbdr on tp.id = tbdr.pro_id
|
||||||
|
left join tb_device td on tbdr.record_id = td.bd_id and td.del_flag = 0
|
||||||
|
where td.dev_status = 0 and tp.del_flag = 0
|
||||||
|
<if test="proId != null and proId != ''">
|
||||||
|
and tp.id = #{proId}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
|
|
||||||
Loading…
Reference in New Issue