安全,质量后台代码

This commit is contained in:
马三炮 2026-01-22 08:40:44 +08:00
parent 011500b034
commit ff121b74a4
9 changed files with 533 additions and 34 deletions

View File

@ -0,0 +1,56 @@
package com.securitycontrol.entity.background.vo;
import lombok.Data;
/**
* @author 马三炮
* @date 2026/1/16
*/
@Data
public class SJSafetyThresholdVo {
/**
* 主键
*/
private Integer id;
/**
* 温度最小值
*/
private String wdMin;
/**
* 温度最大值
*/
private String wdMax;
/**
* 湿度最小值
*/
private String sdMin;
/**
* 湿度最大值
*/
private String sdMax;
/**
* 风速最小值
*/
private String speedMin;
/**
* 风速最大值
*/
private String speedMax;
/**
* 空气质量最小值
*/
private String kqzlMin;
/**
* 空气质量最大值
*/
private String kqzlMax;
}

View File

@ -0,0 +1,84 @@
package com.securitycontrol.entity.background.vo;
import lombok.Data;
/**
* @author 马三炮
* @date 2026/1/16
*/
@Data
public class SjNewProjectSafetyVo {
/**
* 主键
*/
private Integer id;
/**
* 工程名称
*/
private String proName;
/**
* 作业计划编号
*/
private String planNum;
/**
* 工作地点
*/
private String workLocation;
/**
* 监测点编号
*/
private String monitorCode;
/**
* 监测点名称
*/
private String monitorName;
/**
* 温度
*/
private String wd;
/**
* 湿度
*/
private String sd;
/**
* 风速
*/
private String speed;
/**
* 空气质量
*/
private String airQuality;
/**
* 是否存在隐患
*/
private String isSafety;
/**
* 分析与改进
*/
private String analysis;
/**
* 球机编码
*/
private String puid;
/**
* 检测时间
*/
private String detectionTime;
/**
* 创建时间
*/
private String createTime;
}

View File

@ -22,22 +22,22 @@ public class SjProjectMassVo {
/**
*检测内容
*/
private String contentInspection;
private String content;
/**
*检测日期
*/
private String inspectionDate;
private String testDay;
/**
*检测结果
*/
private String inspectionResults;
private String testResult;
/**
*质量检测报告
*/
private String inspectionUrl;
private String testReport;
/**
*关键字
@ -53,4 +53,9 @@ public class SjProjectMassVo {
*结束时间
*/
private String endDate;
/**
*创建时间
*/
private String createTime;
}

View File

@ -6,6 +6,8 @@ import com.securitycontrol.common.core.web.domain.AjaxResult;
import com.securitycontrol.common.core.web.page.TableDataInfo;
import com.securitycontrol.common.log.annotation.Log;
import com.securitycontrol.common.log.enums.OperationType;
import com.securitycontrol.entity.background.vo.SJSafetyThresholdVo;
import com.securitycontrol.entity.background.vo.SjNewProjectSafetyVo;
import com.securitycontrol.entity.background.vo.SjProjectSafetyVo;
import com.securitycontrol.entity.background.vo.SjVideoSafetyVo;
@ -135,7 +137,62 @@ public class SjProjectSafetyController extends BaseController {
}
@GetMapping("getSafetyThresholdList")
@Log(title = "安全阈值", menu = "安全阈值->列表", grade = OperationType.QUERY_BUSINESS, details = "列表", type = "业务日志")
public TableDataInfo getSafetyThresholdList(SJSafetyThresholdVo dto) {
startPage();
List<SJSafetyThresholdVo> list = service.getSafetyThresholdList(dto);
return getDataTable(list);
}
@ApiOperation(value = "安全阈值")
@PostMapping("addSafetyThreshold")
@Log(title = "安全阈值", menu = "安全阈值->新增", grade = OperationType.ADD_BUSINESS, details = "新增数据", type = "业务日志")
public AjaxResult addSafetyThreshold(@RequestBody SJSafetyThresholdVo vo) {
return service.addSafetyThreshold(vo);
}
@ApiOperation(value = "安全阈值")
@PostMapping("updateSafetyThreshold")
@Log(title = "安全阈值", menu = "安全阈值->修改", grade = OperationType.ADD_BUSINESS, details = "修改数据", type = "业务日志")
public AjaxResult updateSafetyThreshold(@RequestBody SJSafetyThresholdVo vo) {
return service.updateSafetyThreshold(vo);
}
@ApiOperation(value = "安全阈值")
@PostMapping(value="deleteSafetyThreshold")
@Log(title = "安全阈值", menu = "安全阈值->删除", grade = OperationType.DELETE_BUSINESS, details = "删除数据", type = "业务日志")
public AjaxResult deleteSafetyThreshold(@RequestBody SJSafetyThresholdVo dto){
return service.deleteSafetyThreshold(dto);
}
@ApiOperation(value = "工程安全分析")
@GetMapping("getNewProjectSafetyList")
@Log(title = "工程安全分析", menu = "工程安全分析->列表", grade = OperationType.QUERY_BUSINESS, details = "列表", type = "业务日志")
public TableDataInfo getNewProjectSafetyList(SjNewProjectSafetyVo dto) {
startPage();
List<SjNewProjectSafetyVo> list = service.getNewProjectSafetyList(dto);
return getDataTable(list);
}
@ApiOperation(value = "工程安全分析")
@PostMapping("addNewProjectSafety")
@Log(title = "工程安全分析", menu = "工程安全分析->新增", grade = OperationType.ADD_BUSINESS, details = "新增数据", type = "业务日志")
public AjaxResult addNewProjectSafety(@RequestBody SjNewProjectSafetyVo vo) {
return service.addNewProjectSafety(vo);
}
@ApiOperation(value = "工程安全分析")
@PostMapping("updateNewProjectSafety")
@Log(title = "工程安全分析", menu = "工程安全分析->修改", grade = OperationType.ADD_BUSINESS, details = "修改数据", type = "业务日志")
public AjaxResult updateNewProjectSafety(@RequestBody SjNewProjectSafetyVo vo) {
return service.updateNewProjectSafety(vo);
}
@ApiOperation(value = "工程安全分析")
@PostMapping(value="delNewProjectSafety")
@Log(title = "工程安全分析", menu = "工程安全分析->删除", grade = OperationType.DELETE_BUSINESS, details = "删除数据", type = "业务日志")
public AjaxResult delNewProjectSafety(@RequestBody SjNewProjectSafetyVo dto){
return service.delNewProjectSafety(dto);
}
}

View File

@ -1,8 +1,6 @@
package com.securitycontrol.background.mapper;
import com.securitycontrol.entity.background.vo.SjProjectQualityVo;
import com.securitycontrol.entity.background.vo.SjProjectSafetyVo;
import com.securitycontrol.entity.background.vo.SjVideoSafetyVo;
import com.securitycontrol.entity.background.vo.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -84,4 +82,60 @@ public interface SjProjectSafetyMapper {
* @param list
*/
void addDataList(@Param("list") List<SjProjectSafetyVo> list);
/**
* 安全阈值列表
* @param dto
* @return
*/
List<SJSafetyThresholdVo> getSafetyThresholdList(SJSafetyThresholdVo dto);
/**
* 安全阈值新增
* @param vo
* @return
*/
Integer addSafetyThreshold(SJSafetyThresholdVo vo);
/**
* 修改安全阈值
* @param vo
* @return
*/
Integer updateSafetyThreshold(SJSafetyThresholdVo vo);
/**
* 删除安全阈值
* @param dto
* @return
*/
Integer deleteSafetyThreshold(SJSafetyThresholdVo dto);
/**
*工程安全分析列表
* @param dto
* @return
*/
List<SjNewProjectSafetyVo> getNewProjectSafetyList(SjNewProjectSafetyVo dto);
/**
*新增工程安全分析
* @param vo
* @return
*/
Integer addNewProjectSafety(SjNewProjectSafetyVo vo);
/**
* 修改工程安全分析
* @param vo
* @return
*/
Integer updateNewProjectSafety(SjNewProjectSafetyVo vo);
/**
* 删除工程安全分析
* @param dto
* @return
*/
Integer delNewProjectSafety(SjNewProjectSafetyVo dto);
}

View File

@ -1,9 +1,7 @@
package com.securitycontrol.background.service;
import com.securitycontrol.common.core.web.domain.AjaxResult;
import com.securitycontrol.entity.background.vo.SjProjectQualityVo;
import com.securitycontrol.entity.background.vo.SjProjectSafetyVo;
import com.securitycontrol.entity.background.vo.SjVideoSafetyVo;
import com.securitycontrol.entity.background.vo.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
@ -90,4 +88,60 @@ public interface SjProjectSafetyService {
* @return
*/
AjaxResult importData(MultipartFile file, HttpServletRequest request, HttpServletResponse response);
/**
* 安全阈值列表
* @param dto
* @return
*/
List<SJSafetyThresholdVo> getSafetyThresholdList(SJSafetyThresholdVo dto);
/**
* 安全阈值新增
* @param vo
* @return
*/
AjaxResult addSafetyThreshold(SJSafetyThresholdVo vo);
/**
* 修改安全阈值
* @param vo
* @return
*/
AjaxResult updateSafetyThreshold(SJSafetyThresholdVo vo);
/**
* 删除安全阈值
* @param dto
* @return
*/
AjaxResult deleteSafetyThreshold(SJSafetyThresholdVo dto);
/**
*工程安全分析列表
* @param dto
* @return
*/
List<SjNewProjectSafetyVo> getNewProjectSafetyList(SjNewProjectSafetyVo dto);
/**
*新增工程安全分析
* @param vo
* @return
*/
AjaxResult addNewProjectSafety(SjNewProjectSafetyVo vo);
/**
* 修改工程安全分析
* @param vo
* @return
*/
AjaxResult updateNewProjectSafety(SjNewProjectSafetyVo vo);
/**
* 删除工程安全分析
* @param dto
* @return
*/
AjaxResult delNewProjectSafety(SjNewProjectSafetyVo dto);
}

View File

@ -11,9 +11,7 @@ import com.securitycontrol.common.core.constant.SecurityConstants;
import com.securitycontrol.common.core.domain.Result;
import com.securitycontrol.common.core.utils.ImportExcelUtils;
import com.securitycontrol.common.core.web.domain.AjaxResult;
import com.securitycontrol.entity.background.vo.SjProjectQualityVo;
import com.securitycontrol.entity.background.vo.SjProjectSafetyVo;
import com.securitycontrol.entity.background.vo.SjVideoSafetyVo;
import com.securitycontrol.entity.background.vo.*;
import com.securitycontrol.entity.system.base.vo.ProImportVo;
import com.securitycontrol.entity.system.vo.ResourceFileVo;
import com.securitycontrol.system.api.RemoteFileService;
@ -256,4 +254,142 @@ public class SjProjectSafetyServiceImpl implements SjProjectSafetyService {
}
return AjaxResult.error("导入失败");
}
/**
* 安全阈值列表
* @param dto
* @return
*/
@Override
public List<SJSafetyThresholdVo> getSafetyThresholdList(SJSafetyThresholdVo dto) {
try{
return mapper.getSafetyThresholdList(dto);
}catch (Exception e){
log.error(e.getMessage(),e);
}
return Collections.emptyList();
}
/**
* 安全阈值新增
* @param vo
* @return
*/
@Override
public AjaxResult addSafetyThreshold(SJSafetyThresholdVo vo) {
try{
Integer num=mapper.addSafetyThreshold(vo);
if(num!=null && num>0){
return AjaxResult.success("添加成功");
}
}catch (Exception e){
log.error(e.getMessage(),e);
}
return AjaxResult.error("新增失败,数据长度过长");
}
/**
* 修改安全阈值
* @param vo
* @return
*/
@Override
public AjaxResult updateSafetyThreshold(SJSafetyThresholdVo vo) {
try{
Integer num=mapper.updateSafetyThreshold(vo);
if(num!=null && num>0){
return AjaxResult.success("修改成功");
}
}catch (Exception e){
log.error(e.getMessage(),e);
}
return AjaxResult.error("修改失败,数据长度过长");
}
/**
* 删除安全阈值
* @param dto
* @return
*/
@Override
public AjaxResult deleteSafetyThreshold(SJSafetyThresholdVo dto) {
try{
Integer num=mapper.deleteSafetyThreshold(dto);
if(num!=null && num>0){
return AjaxResult.success("删除成功");
}
}catch (Exception e){
log.error(e.getMessage(),e);
}
return AjaxResult.error("删除失败");
}
/**
*工程安全分析列表
* @param dto
* @return
*/
@Override
public List<SjNewProjectSafetyVo> getNewProjectSafetyList(SjNewProjectSafetyVo dto) {
try{
return mapper.getNewProjectSafetyList(dto);
}catch (Exception e){
log.error(e.getMessage(),e);
}
return Collections.emptyList();
}
/**
*新增工程安全分析
* @param vo
* @return
*/
@Override
public AjaxResult addNewProjectSafety(SjNewProjectSafetyVo vo) {
try{
Integer num=mapper.addNewProjectSafety(vo);
if(num!=null && num>0){
return AjaxResult.success("添加成功");
}
}catch (Exception e){
log.error(e.getMessage(),e);
}
return AjaxResult.error("新增失败,数据长度过长");
}
/**
* 修改工程安全分析
* @param vo
* @return
*/
@Override
public AjaxResult updateNewProjectSafety(SjNewProjectSafetyVo vo) {
try{
Integer num=mapper.updateNewProjectSafety(vo);
if(num!=null && num>0){
return AjaxResult.success("修改成功");
}
}catch (Exception e){
log.error(e.getMessage(),e);
}
return AjaxResult.error("修改失败,数据长度过长");
}
/**
* 删除工程安全分析
* @param dto
* @return
*/
@Override
public AjaxResult delNewProjectSafety(SjNewProjectSafetyVo dto) {
try{
Integer num=mapper.delNewProjectSafety(dto);
if(num!=null && num>0){
return AjaxResult.success("删除成功");
}
}catch (Exception e){
log.error(e.getMessage(),e);
}
return AjaxResult.error("删除失败");
}
}

View File

@ -15,15 +15,15 @@
)
</insert>
<insert id="newAddData">
insert into sj_project_mass(
team_name,content_inspection,inspection_date,
inspection_results,inspection_url
)values (#{teamName},#{contentInspection},#{inspectionDate},#{inspectionResults},#{inspectionUrl})
insert into sj_new_project_quality(
team_name,content,test_day,
test_result,test_report,create_time
)values (#{teamName},#{content},#{testDay},#{testResult},#{testReport},now())
</insert>
<insert id="newUpdateData">
update sj_project_mass set team_name=#{teamName},content_inspection=#{contentInspection},
inspection_date=#{inspectionDate},inspection_results=#{inspectionResults},
inspection_url=#{inspectionUrl}
update sj_new_project_quality set team_name=#{teamName},content=#{content},
test_day=#{testDay},test_result=#{testResult},
test_report=#{testReport}
where id=#{id}
</insert>
<delete id="newDelete">
@ -88,29 +88,29 @@
<select id="getNewList" resultType="com.securitycontrol.entity.background.vo.SjProjectMassVo">
select id,
team_name teamName,
content_inspection contentInspection,
inspection_date inspectionDate,
inspection_results inspectionResults,
inspection_url inspectionUrl
from sj_project_mass
content content,
test_day testDay,
test_result testResult,
test_report testReport
from sj_new_project_quality
<where>
<if test="keyWord!=null and keyWord!=''">
(team_name like concat('%',#{keyWord},'%')
or content_inspection like concat('%',#{keyWord},'%')
or inspection_results like concat('%',#{keyWord},'%'))
or content like concat('%',#{keyWord},'%')
or test_result like concat('%',#{keyWord},'%'))
</if>
<if test="startDate!=null and startDate!='' and endDate!=null and endDate!=''">
and DATE(inspection_date) BETWEEN #{startDate} and #{endDate}
and DATE(test_day) BETWEEN DATE(#{startDate}) and DATE(#{endDate})
</if>
</where>
</select>
<select id="getNewDetails" resultType="com.securitycontrol.entity.background.vo.SjProjectMassVo">
select id,
team_name teamName,
content_inspection contentInspection,
inspection_date inspectionDate,
inspection_results inspectionResults,
inspection_url inspectionUrl
from sj_project_mass where id=#{id}
content content,
test_day testDay,
test_result testResult,
test_report testReport
from sj_new_project_quality where id=#{id}
</select>
</mapper>

View File

@ -19,6 +19,19 @@
(#{item.riskCode},#{item.riskSite},#{item.riskLevel},#{item.controller},#{item.riskController},#{item.startTime},#{item.isXh})
</foreach>
</insert>
<insert id="addSafetyThreshold">
insert into tb_threshold_info(
wd_min, wd_max, sd_min,sd_max,speed_min,speed_max,kqzl_min,kqzl_max
)values (#{wdMin},#{wdMax},#{sdMin},#{sdMax},#{speedMin},#{speedMax},#{kqzlMin},#{kqzlMax})
</insert>
<insert id="addNewProjectSafety">
insert into sj_new_project_safety(
pro_name, plan_num, work_location,monitor_code,monitor_name,wd,sd,speed,air_quality,
is_safety,analysis,puid,detection_time
)values (#{proName},#{planNum},#{workLocation},#{monitorCode},#{monitorName},#{wd},#{sd},
#{speed},#{airQuality},#{isSafety}, #{analysis},#{puid},#{detectionTime})
</insert>
<update id="updateData">
update sj_project_safety set
@ -35,12 +48,31 @@
,name=#{name}
where id=#{id}
</update>
<update id="updateSafetyThreshold">
update tb_threshold_info set
wd_min=#{wdMin}, wd_max=#{wdMax}, sd_min=#{sdMin}, sd_max=#{sdMax},
speed_min=#{speedMin}, speed_max=#{speedMax}, kqzl_min=#{kqzlMin}, kqzl_max=#{kqzlMax}
where id=#{id}
</update>
<update id="updateNewProjectSafety">
update sj_new_project_safety set
pro_name=#{proName}, plan_num=#{planNum}, work_location=#{workLocation}, monitor_code=#{monitorCode},
monitor_name=#{monitorName}, wd=#{wd}, sd=#{sd}, speed=#{speed}, air_quality=#{airQuality},
is_safety=#{isSafety}, analysis=#{analysis},puid=#{puid}, detection_time=#{detectionTime}
where id=#{id}
</update>
<delete id="delete">
delete from sj_project_safety where id=#{id}
</delete>
<delete id="deleteVideo">
delete from sj_video_safety where id=#{id}
</delete>
<delete id="deleteSafetyThreshold">
delete from tb_threshold_info where id=#{id}
</delete>
<delete id="delNewProjectSafety">
delete from sj_new_project_safety where id=#{id}
</delete>
<select id="getList" resultType="com.securitycontrol.entity.background.vo.SjProjectSafetyVo">
select id, risk_code riskCode, risk_site riskSite,
risk_level riskLevel, controller, risk_controller riskController,
@ -84,4 +116,25 @@
where id=#{id}
</select>
</mapper>
<select id="getSafetyThresholdList"
resultType="com.securitycontrol.entity.background.vo.SJSafetyThresholdVo">
select id, wd_min, wd_max, sd_min,sd_max,speed_min,speed_max,kqzl_min,kqzl_max
from tb_threshold_info
</select>
<select id="getNewProjectSafetyList"
resultType="com.securitycontrol.entity.background.vo.SjNewProjectSafetyVo">
select id, pro_name, plan_num, work_location,monitor_code,monitor_name,wd,sd,speed,
air_quality,is_safety,analysis,puid,detection_time,create_time
from sj_new_project_safety
<where>
<if test="workLocation!=null and workLocation!=''">
and work_location = #{workLocation}
</if>
<if test="workLocation!=null and workLocation!=''">
and monitor_code = #{monitorCode}
</if>
</where>
</select>
</mapper>