施工管控
This commit is contained in:
parent
35497fd30b
commit
8de597406d
|
|
@ -1,8 +1,12 @@
|
|||
package com.bonus.bracelet.controller;
|
||||
|
||||
import com.bonus.bracelet.service.IConsControlService;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.core.web.page.TableDataInfo;
|
||||
import com.bonus.common.entity.bracelet.BraceletParamsDto;
|
||||
import com.bonus.common.entity.bracelet.vo.EquipmentReqVo;
|
||||
import com.bonus.common.entity.bracelet.vo.WarnInfoVo;
|
||||
import com.bonus.common.log.annotation.SysLog;
|
||||
import com.bonus.common.log.enums.OperaType;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
|
@ -11,6 +15,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @className:ConsControlController
|
||||
|
|
@ -22,7 +27,7 @@ import javax.annotation.Resource;
|
|||
@RestController
|
||||
@RequestMapping("/consControl/")
|
||||
@Slf4j
|
||||
public class ConsControlController {
|
||||
public class ConsControlController extends BaseController {
|
||||
|
||||
@Resource(name = "IConsControlService")
|
||||
private IConsControlService service;
|
||||
|
|
@ -41,7 +46,23 @@ public class ConsControlController {
|
|||
* @date 2024/8/8 17:58
|
||||
*/
|
||||
@GetMapping("getBallWarnLists")
|
||||
public AjaxResult getBallWarnLists(BraceletParamsDto dto){
|
||||
return service.getBallWarnLists(dto);
|
||||
public TableDataInfo getBallWarnLists(BraceletParamsDto dto){
|
||||
startPage();
|
||||
List<WarnInfoVo> list = service.getBallWarnLists(dto);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 预警信息
|
||||
* @param dto
|
||||
* @return AjaxResult
|
||||
* @author cwchen
|
||||
* @date 2024/8/9 9:42
|
||||
*/
|
||||
@GetMapping("getWarnLists")
|
||||
public TableDataInfo getWarnLists(BraceletParamsDto dto){
|
||||
startPage();
|
||||
List<WarnInfoVo> list = service.getWarnLists(dto);
|
||||
return getDataTable(list);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,4 +33,13 @@ public interface ConsControlMapper {
|
|||
* @date 2024/8/8 18:11
|
||||
*/
|
||||
List<WarnInfoVo> getBallWarnLists(BraceletParamsDto dto);
|
||||
|
||||
/**
|
||||
* 预警信息
|
||||
* @param dto
|
||||
* @return List<WarnInfoVo>
|
||||
* @author cwchen
|
||||
* @date 2024/8/9 9:45
|
||||
*/
|
||||
List<WarnInfoVo> getWarnLists(BraceletParamsDto dto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,9 @@ package com.bonus.bracelet.service;
|
|||
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.entity.bracelet.BraceletParamsDto;
|
||||
import com.bonus.common.entity.bracelet.vo.WarnInfoVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @className:IConsControlService
|
||||
|
|
@ -23,9 +26,18 @@ public interface IConsControlService {
|
|||
/**
|
||||
* 球机违章识别
|
||||
* @param dto
|
||||
* @return AjaxResult
|
||||
* @return List<WarnInfoVo>
|
||||
* @author cwchen
|
||||
* @date 2024/8/8 17:58
|
||||
*/
|
||||
AjaxResult getBallWarnLists(BraceletParamsDto dto);
|
||||
List<WarnInfoVo> getBallWarnLists(BraceletParamsDto dto);
|
||||
|
||||
/**
|
||||
* 预警信息
|
||||
* @param dto
|
||||
* @return List<WarnInfoVo>
|
||||
* @author cwchen
|
||||
* @date 2024/8/9 9:44
|
||||
*/
|
||||
List<WarnInfoVo> getWarnLists(BraceletParamsDto dto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ public class ConsControlServiceImpl implements IConsControlService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult getBallWarnLists(BraceletParamsDto dto) {
|
||||
public List<WarnInfoVo> getBallWarnLists(BraceletParamsDto dto) {
|
||||
List<WarnInfoVo> warnInfoVoList = new ArrayList<>();
|
||||
try {
|
||||
warnInfoVoList = mapper.getBallWarnLists(dto);
|
||||
|
|
@ -79,7 +79,7 @@ public class ConsControlServiceImpl implements IConsControlService {
|
|||
} catch (Exception e) {
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return AjaxResult.success(warnInfoVoList);
|
||||
return warnInfoVoList;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -103,4 +103,15 @@ public class ConsControlServiceImpl implements IConsControlService {
|
|||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WarnInfoVo> getWarnLists(BraceletParamsDto dto) {
|
||||
List<WarnInfoVo> warnInfoVoList = new ArrayList<>();
|
||||
try {
|
||||
warnInfoVoList = mapper.getWarnLists(dto);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return warnInfoVoList;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,22 +51,47 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
tw.warn_time AS warnTime,
|
||||
td.dev_name AS devName,
|
||||
sfs.file_path AS base64Url,
|
||||
tpe.name
|
||||
tpe.name,
|
||||
sdd.dict_label AS devTypeName,
|
||||
tp.depart_id AS departId
|
||||
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
|
||||
LEFT JOIN sys_dict_data sdd ON td.dev_type = sdd.dict_value AND sdd.dict_type = 'sys_device_type'
|
||||
<where>
|
||||
<if test="roleCode!='administrators' and roleCode!='depart'">
|
||||
a.id = -1
|
||||
tp.depart_id = -1
|
||||
</if>
|
||||
<if test="roleCode=='depart'">
|
||||
AND a.departId = #{departId}
|
||||
AND tp.depart_id = #{departId}
|
||||
</if>
|
||||
AND tp.depart_id IS NOT NULL
|
||||
AND tw.warn_type = 2
|
||||
</where>
|
||||
ORDER BY tw.create_time DESC
|
||||
LIMIT 30
|
||||
</select>
|
||||
<!--预警信息-->
|
||||
<select id="getWarnLists" resultType="com.bonus.common.entity.bracelet.vo.WarnInfoVo">
|
||||
SELECT tw.warn_content AS warnContent,
|
||||
tw.warn_time AS warnTime,
|
||||
td.dev_name AS devName,
|
||||
sdd.dict_label AS devTypeName,
|
||||
tp.depart_id AS departId
|
||||
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_dict_data sdd ON td.dev_type = sdd.dict_value AND sdd.dict_type = 'sys_device_type'
|
||||
<where>
|
||||
<if test="roleCode!='administrators' and roleCode!='depart'">
|
||||
tp.depart_id = -1
|
||||
</if>
|
||||
<if test="roleCode=='depart'">
|
||||
AND tp.depart_id = #{departId}
|
||||
</if>
|
||||
AND tp.depart_id IS NOT NULL
|
||||
</where>
|
||||
ORDER BY tw.create_time DESC
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue