施工管控
This commit is contained in:
parent
0e1cb7f1ce
commit
efd38a2e89
|
|
@ -26,6 +26,8 @@ public class BallTreeVo {
|
||||||
private String devIndex;
|
private String devIndex;
|
||||||
/**父ID*/
|
/**父ID*/
|
||||||
private Long parentId;
|
private Long parentId;
|
||||||
|
/**球机在线状态*/
|
||||||
|
private Integer devStatus;
|
||||||
|
|
||||||
private List<BallTreeVo> children = new ArrayList<>();
|
private List<BallTreeVo> children = new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
package com.bonus.common.entity.bracelet.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @className:BallWarnVo
|
||||||
|
* @author:cwchen
|
||||||
|
* @date:2024-08-08-18:06
|
||||||
|
* @version:1.0
|
||||||
|
* @description:告警信息
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class WarnInfoVo {
|
||||||
|
/**设备类型*/
|
||||||
|
private String devTypeName;
|
||||||
|
/**设备名称*/
|
||||||
|
private String devName;
|
||||||
|
/**告警内容*/
|
||||||
|
private String warnContent;
|
||||||
|
/**告警时间*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
private Date warnTime;
|
||||||
|
/**违章识别图片的base64地址*/
|
||||||
|
private String base64Url;
|
||||||
|
/**人员姓名*/
|
||||||
|
private String name;
|
||||||
|
}
|
||||||
|
|
@ -77,9 +77,9 @@ public class ResponseEncryptFilter implements GlobalFilter, Ordered {
|
||||||
return chain.filter(exchange);
|
return chain.filter(exchange);
|
||||||
}
|
}
|
||||||
//是否加密
|
//是否加密
|
||||||
// if(!jaData){
|
if(!jaData){
|
||||||
// return chain.filter(exchange);
|
return chain.filter(exchange);
|
||||||
// }
|
}
|
||||||
// 根据具体业务内容,修改响应体
|
// 根据具体业务内容,修改响应体
|
||||||
return modifyResponseBody(exchange, chain);
|
return modifyResponseBody(exchange, chain);
|
||||||
}
|
}
|
||||||
|
|
@ -122,6 +122,7 @@ public class ResponseEncryptFilter implements GlobalFilter, Ordered {
|
||||||
Object encrypt = map.get(SystemGlobal.KEY_DECRYPT);
|
Object encrypt = map.get(SystemGlobal.KEY_DECRYPT);
|
||||||
Map maps= Maps.newHashMap();
|
Map maps= Maps.newHashMap();
|
||||||
//加密则数据 进行加密
|
//加密则数据 进行加密
|
||||||
|
|
||||||
if(jaData){
|
if(jaData){
|
||||||
responseData = AesCbcUtils.encrypt(JSON.toJSONString(map));
|
responseData = AesCbcUtils.encrypt(JSON.toJSONString(map));
|
||||||
maps.put("data",responseData);
|
maps.put("data",responseData);
|
||||||
|
|
|
||||||
|
|
@ -33,4 +33,15 @@ public class ConsControlController {
|
||||||
return service.getBallDeviceLists(dto);
|
return service.getBallDeviceLists(dto);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 球机违章识别
|
||||||
|
* @param dto
|
||||||
|
* @return AjaxResult
|
||||||
|
* @author cwchen
|
||||||
|
* @date 2024/8/8 17:58
|
||||||
|
*/
|
||||||
|
@GetMapping("getBallWarnLists")
|
||||||
|
public AjaxResult getBallWarnLists(BraceletParamsDto dto){
|
||||||
|
return service.getBallWarnLists(dto);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -94,7 +94,7 @@ public class ExportFileController {
|
||||||
ExportParams exportParams = new ExportParams("人员", "人员", ExcelType.XSSF);
|
ExportParams exportParams = new ExportParams("人员", "人员", ExcelType.XSSF);
|
||||||
exportParams.setStyle(ExcelStyleUtil.class);
|
exportParams.setStyle(ExcelStyleUtil.class);
|
||||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, PersonExportVo.class, personExportVoList);
|
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, PersonExportVo.class, personExportVoList);
|
||||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
response.setContentType("application/vnd.ms-excel");
|
||||||
response.setHeader("content-disposition", "attachment;fileName=" + URLEncoder.encode("人员" + ".xlsx", "UTF-8"));
|
response.setHeader("content-disposition", "attachment;fileName=" + URLEncoder.encode("人员" + ".xlsx", "UTF-8"));
|
||||||
ServletOutputStream outputStream = response.getOutputStream();
|
ServletOutputStream outputStream = response.getOutputStream();
|
||||||
workbook.write(outputStream);
|
workbook.write(outputStream);
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package com.bonus.bracelet.mapper;
|
||||||
|
|
||||||
import com.bonus.common.entity.bracelet.BraceletParamsDto;
|
import com.bonus.common.entity.bracelet.BraceletParamsDto;
|
||||||
import com.bonus.common.entity.bracelet.vo.BallTreeVo;
|
import com.bonus.common.entity.bracelet.vo.BallTreeVo;
|
||||||
|
import com.bonus.common.entity.bracelet.vo.WarnInfoVo;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -23,4 +24,13 @@ public interface ConsControlMapper {
|
||||||
* @date 2024/8/8 11:24
|
* @date 2024/8/8 11:24
|
||||||
*/
|
*/
|
||||||
List<BallTreeVo> getBallDeviceLists(BraceletParamsDto dto);
|
List<BallTreeVo> getBallDeviceLists(BraceletParamsDto dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取球机违章识别内容
|
||||||
|
* @param dto
|
||||||
|
* @return void
|
||||||
|
* @author cwchen
|
||||||
|
* @date 2024/8/8 18:11
|
||||||
|
*/
|
||||||
|
List<WarnInfoVo> getBallWarnLists(BraceletParamsDto dto);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,4 +19,13 @@ public interface IConsControlService {
|
||||||
* @date 2024/8/8 10:09
|
* @date 2024/8/8 10:09
|
||||||
*/
|
*/
|
||||||
AjaxResult getBallDeviceLists(BraceletParamsDto dto);
|
AjaxResult getBallDeviceLists(BraceletParamsDto dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 球机违章识别
|
||||||
|
* @param dto
|
||||||
|
* @return AjaxResult
|
||||||
|
* @author cwchen
|
||||||
|
* @date 2024/8/8 17:58
|
||||||
|
*/
|
||||||
|
AjaxResult getBallWarnLists(BraceletParamsDto dto);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,15 +2,22 @@ package com.bonus.bracelet.service.impl;
|
||||||
|
|
||||||
import com.alibaba.fastjson2.JSON;
|
import com.alibaba.fastjson2.JSON;
|
||||||
import com.alibaba.fastjson2.JSONArray;
|
import com.alibaba.fastjson2.JSONArray;
|
||||||
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
import com.bonus.bracelet.mapper.ConsControlMapper;
|
import com.bonus.bracelet.mapper.ConsControlMapper;
|
||||||
import com.bonus.bracelet.service.IConsControlService;
|
import com.bonus.bracelet.service.IConsControlService;
|
||||||
import com.bonus.common.core.constant.BusinessConstants;
|
import com.bonus.common.core.constant.BusinessConstants;
|
||||||
|
import com.bonus.common.core.constant.HttpStatus;
|
||||||
|
import com.bonus.common.core.constant.SecurityConstants;
|
||||||
|
import com.bonus.common.core.domain.R;
|
||||||
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.common.entity.bracelet.BraceletParamsDto;
|
import com.bonus.common.entity.bracelet.BraceletParamsDto;
|
||||||
import com.bonus.common.core.utils.BuildTreeUtil;
|
import com.bonus.common.core.utils.BuildTreeUtil;
|
||||||
import com.bonus.common.entity.bracelet.vo.BallTreeVo;
|
import com.bonus.common.entity.bracelet.vo.BallTreeVo;
|
||||||
|
import com.bonus.common.entity.bracelet.vo.WarnInfoVo;
|
||||||
|
import com.bonus.system.api.RemoteFileService;
|
||||||
|
import com.bonus.system.api.domain.SysFile;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
|
@ -33,6 +40,9 @@ public class ConsControlServiceImpl implements IConsControlService {
|
||||||
@Resource(name = "ConsControlMapper")
|
@Resource(name = "ConsControlMapper")
|
||||||
private ConsControlMapper mapper;
|
private ConsControlMapper mapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private RemoteFileService remoteFileService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult getBallDeviceLists(BraceletParamsDto dto) {
|
public AjaxResult getBallDeviceLists(BraceletParamsDto dto) {
|
||||||
JSONArray resultTree = new JSONArray();
|
JSONArray resultTree = new JSONArray();
|
||||||
|
|
@ -40,7 +50,7 @@ public class ConsControlServiceImpl implements IConsControlService {
|
||||||
List<BallTreeVo> list = new ArrayList<>();
|
List<BallTreeVo> list = new ArrayList<>();
|
||||||
list = mapper.getBallDeviceLists(dto);
|
list = mapper.getBallDeviceLists(dto);
|
||||||
for (BallTreeVo vo : list) {
|
for (BallTreeVo vo : list) {
|
||||||
//过滤工程数据
|
//忽略工程数据
|
||||||
if (Objects.equals(vo.getParentId(), BusinessConstants.PARENT_ID)) {
|
if (Objects.equals(vo.getParentId(), BusinessConstants.PARENT_ID)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
@ -56,4 +66,41 @@ public class ConsControlServiceImpl implements IConsControlService {
|
||||||
}
|
}
|
||||||
return AjaxResult.success(resultTree);
|
return AjaxResult.success(resultTree);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AjaxResult getBallWarnLists(BraceletParamsDto dto) {
|
||||||
|
List<WarnInfoVo> warnInfoVoList = new ArrayList<>();
|
||||||
|
try {
|
||||||
|
warnInfoVoList = mapper.getBallWarnLists(dto);
|
||||||
|
for (WarnInfoVo vo : warnInfoVoList) {
|
||||||
|
String imgBase64 = getImgBase64(vo.getBase64Url());
|
||||||
|
vo.setBase64Url(imgBase64);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error(e.toString(),e);
|
||||||
|
}
|
||||||
|
return AjaxResult.success(warnInfoVoList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取违章识别图片的base64
|
||||||
|
* @param base64Url
|
||||||
|
* @return String
|
||||||
|
* @author cwchen
|
||||||
|
* @date 2024/8/8 18:36
|
||||||
|
*/
|
||||||
|
public String getImgBase64(String base64Url){
|
||||||
|
try {
|
||||||
|
R<SysFile> result = remoteFileService.getImgBase64(base64Url, SecurityConstants.INNER);
|
||||||
|
if (result != null && result.getCode() == HttpStatus.SUCCESS && result.getData() != null) {
|
||||||
|
String jsonString = JSON.toJSONString(result.getData());
|
||||||
|
JSONObject item = JSON.parseObject(jsonString);
|
||||||
|
String base64 = item.getString("url");
|
||||||
|
return base64;
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error(e.toString(),e);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.bonus.bracelet.mapper.ConsControlMapper">
|
<mapper namespace="com.bonus.bracelet.mapper.ConsControlMapper">
|
||||||
|
|
||||||
<!--获取球机设备列表-->
|
<!--获取球机设备列表 项目部权限-->
|
||||||
<select id="getBallDeviceLists" resultType="com.bonus.common.entity.bracelet.vo.BallTreeVo">
|
<select id="getBallDeviceLists" resultType="com.bonus.common.entity.bracelet.vo.BallTreeVo">
|
||||||
SELECT * FROM (
|
SELECT * FROM (
|
||||||
SELECT tp.id,
|
SELECT tp.id,
|
||||||
|
|
@ -12,7 +12,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
'0' AS devCode,
|
'0' AS devCode,
|
||||||
'0' AS devIndex,
|
'0' AS devIndex,
|
||||||
0 AS parentId,
|
0 AS parentId,
|
||||||
tp.depart_id AS departId
|
tp.depart_id AS departId,
|
||||||
|
0 AS devStatus,
|
||||||
|
tp.create_time AS orderTime
|
||||||
FROM tb_project tp
|
FROM tb_project tp
|
||||||
WHERE tp.del_flag = 0
|
WHERE tp.del_flag = 0
|
||||||
UNION ALL
|
UNION ALL
|
||||||
|
|
@ -22,7 +24,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
td.dev_code AS devCode,
|
td.dev_code AS devCode,
|
||||||
IFNULL(td.dev_index,0) AS devIndex,
|
IFNULL(td.dev_index,0) AS devIndex,
|
||||||
tdu.pro_id AS parentId,
|
tdu.pro_id AS parentId,
|
||||||
tp.depart_id AS departId
|
tp.depart_id AS departId,
|
||||||
|
IFNULL(td.dev_status,0) AS devStatus,
|
||||||
|
tdub.ly_time AS orderTime
|
||||||
FROM tb_dev_use tdu
|
FROM tb_dev_use tdu
|
||||||
LEFT JOIN tb_dev_use_bid tdub ON tdu.id = tdub.id
|
LEFT JOIN tb_dev_use_bid tdub ON tdu.id = tdub.id
|
||||||
LEFT JOIN tb_project tp ON tp.id = tdu.pro_id AND tp.del_flag = 0
|
LEFT JOIN tb_project tp ON tp.id = tdu.pro_id AND tp.del_flag = 0
|
||||||
|
|
@ -36,8 +40,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
a.id = -1
|
a.id = -1
|
||||||
</if>
|
</if>
|
||||||
<if test="roleCode=='depart'">
|
<if test="roleCode=='depart'">
|
||||||
a.departId = #{departId}
|
AND a.departId = #{departId}
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
|
ORDER BY a.orderTime DESC
|
||||||
|
</select>
|
||||||
|
<!--获取球机违章识别内容-获取最新的30条-->
|
||||||
|
<select id="getBallWarnLists" resultType="com.bonus.common.entity.bracelet.vo.WarnInfoVo">
|
||||||
|
SELECT tw.warn_content AS warnContent,
|
||||||
|
tw.warn_time AS warnTime,
|
||||||
|
td.dev_name AS devName,
|
||||||
|
sfs.file_path AS base64Url,
|
||||||
|
tpe.name
|
||||||
|
FROM tb_warn tw
|
||||||
|
LEFT JOIN tb_project tp ON tp.id = tw.pro_id AND tp.del_flag = 0
|
||||||
|
LEFT JOIN tb_device td ON tw.dev_id = td.id AND td.del_flag = 0
|
||||||
|
LEFT JOIN sys_file_source sfs ON tw.id = sfs.source_id AND sfs.source_type = 8 AND sfs.del_flag = 0
|
||||||
|
LEFT JOIN tb_people tpe ON tpe.id = tw.user_id AND tpe.del_flag = 0
|
||||||
|
<where>
|
||||||
|
<if test="roleCode!='administrators' and roleCode!='depart'">
|
||||||
|
a.id = -1
|
||||||
|
</if>
|
||||||
|
<if test="roleCode=='depart'">
|
||||||
|
AND a.departId = #{departId}
|
||||||
|
</if>
|
||||||
|
AND tw.warn_type = 2
|
||||||
|
</where>
|
||||||
|
ORDER BY tw.create_time DESC
|
||||||
|
LIMIT 30
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
Loading…
Reference in New Issue