风险预警提前处置

This commit is contained in:
hayu 2024-12-13 21:40:40 +08:00
parent cddb324419
commit 77e2b17c85
15 changed files with 603 additions and 64 deletions

View File

@ -8,14 +8,11 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
public class ResourcesConfigAdapter extends WebMvcConfigurerAdapter { public class ResourcesConfigAdapter extends WebMvcConfigurerAdapter {
@Override @Override
public void addResourceHandlers(ResourceHandlerRegistry registry) { public void addResourceHandlers(ResourceHandlerRegistry registry) {
String os = System.getProperty("os.name"); // registry.addResourceHandler("/files/**").addResourceLocations("file:/data/ahsbs/file/");
if (os.toLowerCase().startsWith("win")) { // super.addResourceHandlers(registry);
registry.addResourceHandler("/files/**").addResourceLocations("file:D://files/");
super.addResourceHandlers(registry); registry.addResourceHandler("/files/**").addResourceLocations("file:D:\\file\\");
} else { super.addResourceHandlers(registry);
registry.addResourceHandler("/files/**").addResourceLocations("file:/data/ahsbs/file/");
super.addResourceHandlers(registry);
}
} }
} }

View File

@ -14,7 +14,9 @@ import com.securityControl.common.core.web.controller.BaseController;
import com.securityControl.common.core.web.domain.AjaxResult; import com.securityControl.common.core.web.domain.AjaxResult;
import com.securityControl.common.core.web.page.TableDataInfo; import com.securityControl.common.core.web.page.TableDataInfo;
import com.securityControl.common.log.annotation.Log; import com.securityControl.common.log.annotation.Log;
import com.securityControl.common.log.annotation.SysLog;
import com.securityControl.common.log.enums.BusinessType; import com.securityControl.common.log.enums.BusinessType;
import com.securityControl.common.log.enums.OperaType;
import com.securityControl.common.log.enums.OperationType; import com.securityControl.common.log.enums.OperationType;
import com.sercurityControl.proteam.domain.*; import com.sercurityControl.proteam.domain.*;
import com.sercurityControl.proteam.domain.dto.WeathQo; import com.sercurityControl.proteam.domain.dto.WeathQo;
@ -668,6 +670,21 @@ public class HomeController extends BaseController {
return AjaxResult.success(0); return AjaxResult.success(0);
} }
/**
* 获取恶劣天气通知--今日
* @return
*/
@PostMapping("getBadWeatherData")
public AjaxResult getBadWeatherData(String orgId){
try{
String content= homeDataService.getBadWeatherData();
return AjaxResult.success(content);
}catch (Exception e){
log.error(e.toString(), e);
}
return AjaxResult.success(0);
}
/** /**
* 查询杆塔集合 * 查询杆塔集合
* @param * @param

View File

@ -5,7 +5,9 @@ import com.github.pagehelper.PageInfo;
import com.securityControl.common.core.utils.aes.StringHelper; import com.securityControl.common.core.utils.aes.StringHelper;
import com.securityControl.common.core.web.domain.AjaxResult; import com.securityControl.common.core.web.domain.AjaxResult;
import com.securityControl.common.log.annotation.Log; import com.securityControl.common.log.annotation.Log;
import com.securityControl.common.log.annotation.SysLog;
import com.securityControl.common.log.enums.BusinessType; import com.securityControl.common.log.enums.BusinessType;
import com.securityControl.common.log.enums.OperaType;
import com.securityControl.common.log.enums.OperationType; import com.securityControl.common.log.enums.OperationType;
import com.sercurityControl.proteam.dutyTask.domain.RectificationPunishmentEntity; import com.sercurityControl.proteam.dutyTask.domain.RectificationPunishmentEntity;
import com.sercurityControl.proteam.dutyTask.service.RectificationPunishmentService; import com.sercurityControl.proteam.dutyTask.service.RectificationPunishmentService;
@ -53,7 +55,7 @@ public class RectificationPunishmentController extends BaseController {
* @Param limit * @Param limit
*/ */
@PostMapping(value = "getRectificationPunishmentList") @PostMapping(value = "getRectificationPunishmentList")
@Log(title = "纠察处罚管理", menu = "值班任务->纠察处罚管理", businessType = BusinessType.QUERY, details = "纠察处罚管理列表") @SysLog(title = "纠察处罚管理列表", model = "值班任务->纠察处罚管理", operaType = OperaType.QUERY, details = "列表查询",logType = 1)
public Map<String, Object> getRectificationPunishmentList(RectificationPunishmentEntity bean) { public Map<String, Object> getRectificationPunishmentList(RectificationPunishmentEntity bean) {
PageHelper.startPage(Integer.parseInt(bean.getPage()), Integer.parseInt(bean.getLimit())); PageHelper.startPage(Integer.parseInt(bean.getPage()), Integer.parseInt(bean.getLimit()));
Map<String, Object> map = new HashMap<String, Object>(6); Map<String, Object> map = new HashMap<String, Object>(6);
@ -86,7 +88,7 @@ public class RectificationPunishmentController extends BaseController {
*/ */
@PostMapping("delDataById") @PostMapping("delDataById")
@ResponseBody @ResponseBody
@Log(title = "远程人脸抽查", menu = "值班任务->远程人脸抽查", businessType = BusinessType.DELETE, details = "删除远程人脸抽查", grade = OperationType.DELETE_BUSINESS) @SysLog(title = "纠察处罚管理删除", model = "值班任务->纠察处罚管理", operaType = OperaType.DELETE, details = "删除",logType = 1)
public AjaxResult delRemoteFaceById(RectificationPunishmentEntity bean) { public AjaxResult delRemoteFaceById(RectificationPunishmentEntity bean) {
try { try {
service.delRemoteFaceById(bean.getId()); service.delRemoteFaceById(bean.getId());
@ -106,7 +108,7 @@ public class RectificationPunishmentController extends BaseController {
* @Param params * @Param params
*/ */
@PostMapping(value = "addData") @PostMapping(value = "addData")
@Log(title = "远程人脸抽查", menu = "值班任务->远程人脸抽查", businessType = BusinessType.QUERY, details = "新增远程人脸抽查", grade = OperationType.ADD_BUSINESS) @SysLog(title = "纠察处罚管理新增", model = "值班任务->纠察处罚管理", operaType = OperaType.DELETE, details = "新增",logType = 1)
public AjaxResult addData(RectificationPunishmentEntity bean) { public AjaxResult addData(RectificationPunishmentEntity bean) {
try { try {
service.addRemoteFace(bean); service.addRemoteFace(bean);

View File

@ -5,7 +5,9 @@ import com.github.pagehelper.PageInfo;
import com.securityControl.common.core.utils.aes.StringHelper; import com.securityControl.common.core.utils.aes.StringHelper;
import com.securityControl.common.core.web.domain.AjaxResult; import com.securityControl.common.core.web.domain.AjaxResult;
import com.securityControl.common.log.annotation.Log; import com.securityControl.common.log.annotation.Log;
import com.securityControl.common.log.annotation.SysLog;
import com.securityControl.common.log.enums.BusinessType; import com.securityControl.common.log.enums.BusinessType;
import com.securityControl.common.log.enums.OperaType;
import com.securityControl.common.log.enums.OperationType; import com.securityControl.common.log.enums.OperationType;
import com.sercurityControl.proteam.dutyTask.domain.*; import com.sercurityControl.proteam.dutyTask.domain.*;
import com.sercurityControl.proteam.dutyTask.service.RemoteFaceService; import com.sercurityControl.proteam.dutyTask.service.RemoteFaceService;
@ -50,7 +52,7 @@ public class RemoteFaceController extends BaseController {
* @Param limit * @Param limit
*/ */
@PostMapping(value = "getRemoteFaceList") @PostMapping(value = "getRemoteFaceList")
@Log(title = "远程人脸抽查", menu = "值班任务->远程人脸抽查", businessType = BusinessType.QUERY, details = "远程人脸抽查列表") @SysLog(title = "远程人脸抽查列表", model = "值班任务->远程人脸抽查", operaType = OperaType.QUERY, details = "远程人脸抽查列表查询",logType = 1)
public Map<String, Object> getRemoteFaceList(RemoteFaceEntity bean) { public Map<String, Object> getRemoteFaceList(RemoteFaceEntity bean) {
PageHelper.startPage(Integer.parseInt(bean.getPage()), Integer.parseInt(bean.getLimit())); PageHelper.startPage(Integer.parseInt(bean.getPage()), Integer.parseInt(bean.getLimit()));
Map<String, Object> map = new HashMap<String, Object>(6); Map<String, Object> map = new HashMap<String, Object>(6);
@ -78,34 +80,47 @@ public class RemoteFaceController extends BaseController {
//多照片上传 //多照片上传
@RequestMapping(value = "uploadFile", method = RequestMethod.POST) @RequestMapping(value = "uploadFile", method = RequestMethod.POST)
@ResponseBody @ResponseBody
@SysLog(title = "远程人脸抽查照片上传", model = "值班任务->远程人脸抽查", operaType = OperaType.IMPORT, details = "照片上传",logType = 1)
public AjaxRes uploadFile(HttpServletRequest request) throws IllegalStateException, IOException { public AjaxRes uploadFile(HttpServletRequest request) throws IllegalStateException, IOException {
AjaxRes ar = new AjaxRes(); AjaxRes ar = new AjaxRes();
HashMap<String, Object> map = uploadFileSpring(request);
if (map == null) {
return null;
}
List<String> urlStr = new LinkedList<>(); List<String> urlStr = new LinkedList<>();
CommonsMultipartResolver multipartResolver = new CommonsMultipartResolver(); try {
MultipartHttpServletRequest multiReq = multipartResolver.resolveMultipart(request); HashMap<String, Object> map = uploadFileSpring(request);
String idNumber=multiReq.getParameter("idNumber"); if (map == null) {
String proId=multiReq.getParameter("proId");
List<MultipartFile> items = (List<MultipartFile>) map.get("filePath");
for (int i = 0; i < items.size(); i++) {
MultipartFile item = items.get(i);
// 完整路径 IE
String tmpName = item.getOriginalFilename();
if (StringHelper.isEmpty(tmpName)) {
// 根据情况
return null; return null;
} }
String suffix = tmpName.substring(tmpName.lastIndexOf("."));
String fileName = DateTimeHelper.getNowDate().replace("-", "") + "_" + generateShortUuid() + "_salary" + suffix; List<MultipartFile> items = (List<MultipartFile>) map.get("filePath");
String mkdirsName ="photo"; for (int i = 0; i < items.size(); i++) {
MultipartFile item = items.get(i);
// 完整路径 IE
String tmpName = item.getOriginalFilename();
if (StringHelper.isEmpty(tmpName)) {
// 根据情况
return null;
}
String suffix = tmpName.substring(tmpName.lastIndexOf("."));
String fileName = DateTimeHelper.getNowDate().replace("-", "") + "_" + generateShortUuid() + "_salary" + suffix;
String mkdirsName ="photo";
// String imageFiles = upload_path + File.separator + mkdirsName;
// String path = imageFiles + File.separator + com.securityControl.common.core.utils.aes.DateTimeHelper.getYear(new Date()) + File.separator + com.securityControl.common.core.utils.aes.DateTimeHelper.getMonth(new Date()) + File.separator + fileName;
// File file = new File(path);
// //生成文件夹
// if (!file.getParentFile().exists()) {
// file.getParentFile().mkdirs();
// }
// // 存入临时文件
// item.transferTo(file);
// String imgPath = mkdirsName + File.separator + com.securityControl.common.core.utils.aes.DateTimeHelper.getYear(new Date()) + File.separator + com.securityControl.common.core.utils.aes.DateTimeHelper.getMonth(new Date()) + File.separator + fileName;
// urlStr.add(imgPath);
// linux 系统路径 // linux 系统路径
String imageFiles = "/data/ahsbs/file" + mkdirsName + "/"; String imageFiles = "/data/ahsbs/file" + mkdirsName + "/";
String os = System.getProperty("os.name"); String os = System.getProperty("os.name");
if(os.toLowerCase().startsWith("win")){ if(os.toLowerCase().startsWith("win")){
imageFiles="D://files/"+mkdirsName; imageFiles="D://file/"+mkdirsName;
} }
String path=imageFiles+"/"+ DateTimeHelper.getNowYear()+"/"+DateTimeHelper.getNowMonths()+"/"+ DateTimeHelper.getNowDay() +"/"+fileName; String path=imageFiles+"/"+ DateTimeHelper.getNowYear()+"/"+DateTimeHelper.getNowMonths()+"/"+ DateTimeHelper.getNowDay() +"/"+fileName;
File file = new File(path); File file = new File(path);
@ -116,40 +131,22 @@ public class RemoteFaceController extends BaseController {
// 存入临时文件 // 存入临时文件
item.transferTo(file); item.transferTo(file);
try { try {
String imgPath = "files/"+ mkdirsName+"/"+ DateTimeHelper.getNowYear()+"/"+DateTimeHelper.getNowMonths()+"/"+ DateTimeHelper.getNowDay()+"/"+fileName; String imgPath = mkdirsName+"/"+ DateTimeHelper.getNowYear()+"/"+DateTimeHelper.getNowMonths()+"/"+ DateTimeHelper.getNowDay()+"/"+fileName;
urlStr.add(imgPath); urlStr.add(imgPath);
} catch (Exception e) { } catch (Exception e) {
logger.error(e.toString(), e); logger.error(e.toString(), e);
ar.setFailMsg("保存失败"); ar.setFailMsg("保存失败");
} }
}
} catch (Exception e){
logger.error(e.toString(), e);
ar.setFailMsg("保存失败");
} }
ar.setSucceed(urlStr,"上传成功"); ar.setSucceed(urlStr,"上传成功");
return ar; return ar;
} }
//
// private String uploadImages(MultipartFile item) {
// String image = "";
// try {
// String fileName = IDUtils.createID() + ".jpg";
// String mkdirsName = "noticeVio"; // 违章下发
// String imageFiles = upload_path + File.separator + mkdirsName;
// String path = imageFiles + File.separator + DateTimeHelper.getYear(new Date()) + File.separator + DateTimeHelper.getMonth(new Date()) + File.separator + fileName;
// File file = new File(path);
// //生成文件夹
// if (!file.getParentFile().exists()) {
// file.getParentFile().mkdirs();
// }
// // 存入临时文件
// item.transferTo(file);
// image = mkdirsName + File.separator + DateTimeHelper.getYear(new Date()) + File.separator + DateTimeHelper.getMonth(new Date()) + File.separator + fileName;
// return image;
// } catch (Exception e) {
// logger.error(e.toString(), e);
// }
// return image;
// }
/** /**
* @return com.securityControl.common.core.web.domain.AjaxResult * @return com.securityControl.common.core.web.domain.AjaxResult
* @author hay * @author hay
@ -158,7 +155,7 @@ public class RemoteFaceController extends BaseController {
*/ */
@PostMapping("delRemoteFaceById") @PostMapping("delRemoteFaceById")
@ResponseBody @ResponseBody
@Log(title = "远程人脸抽查", menu = "值班任务->远程人脸抽查", businessType = BusinessType.DELETE, details = "删除远程人脸抽查", grade = OperationType.DELETE_BUSINESS) @SysLog(title = "远程人脸抽查删除", model = "值班任务->远程人脸抽查", operaType = OperaType.DELETE, details = "删除",logType = 1)
public AjaxResult delRemoteFaceById(RemoteFaceEntity bean) { public AjaxResult delRemoteFaceById(RemoteFaceEntity bean) {
try { try {
service.delRemoteFaceById(bean.getId()); service.delRemoteFaceById(bean.getId());
@ -178,7 +175,7 @@ public class RemoteFaceController extends BaseController {
* @Param params * @Param params
*/ */
@PostMapping(value = "addRemoteFace") @PostMapping(value = "addRemoteFace")
@Log(title = "远程人脸抽查", menu = "值班任务->远程人脸抽查", businessType = BusinessType.QUERY, details = "新增远程人脸抽查", grade = OperationType.ADD_BUSINESS) @SysLog(title = "远程人脸抽查新增", model = "值班任务->远程人脸抽查", operaType = OperaType.INSERT, details = "新增",logType = 1)
public AjaxResult addRemoteFace(RemoteFaceEntity bean) { public AjaxResult addRemoteFace(RemoteFaceEntity bean) {
try { try {
service.addRemoteFace(bean); service.addRemoteFace(bean);

View File

@ -5,6 +5,7 @@ import com.sercurityControl.proteam.domain.dto.WeathQo;
import com.sercurityControl.proteam.domain.vo.HomeDataVo; import com.sercurityControl.proteam.domain.vo.HomeDataVo;
import com.sercurityControl.proteam.domain.vo.StatEntity; import com.sercurityControl.proteam.domain.vo.StatEntity;
import com.sercurityControl.proteam.domain.vo.WeekPlanVo; import com.sercurityControl.proteam.domain.vo.WeekPlanVo;
import com.sercurityControl.proteam.dutyTask.domain.BadWeatherEntity;
import com.sercurityControl.proteam.dutyTask.domain.TowerVo; import com.sercurityControl.proteam.dutyTask.domain.TowerVo;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -408,4 +409,10 @@ public interface HomeDataMapper {
* @return * @return
*/ */
String getTeamNum(WeekRiskData vo); String getTeamNum(WeekRiskData vo);
/**
* 获取天气预警
* @return
*/
BadWeatherEntity getBadWeatherData();
} }

View File

@ -297,4 +297,10 @@ public interface HomeDataService {
* @return * @return
*/ */
List<WeekRiskData> exportWeekList(WeekRiskData data); List<WeekRiskData> exportWeekList(WeekRiskData data);
/**
* 获取天气数据
* @return
*/
String getBadWeatherData();
} }

View File

@ -15,6 +15,7 @@ import com.sercurityControl.proteam.domain.vo.DutyChildVo;
import com.sercurityControl.proteam.domain.vo.HomeDataVo; import com.sercurityControl.proteam.domain.vo.HomeDataVo;
import com.sercurityControl.proteam.domain.vo.StatEntity; import com.sercurityControl.proteam.domain.vo.StatEntity;
import com.sercurityControl.proteam.domain.vo.WeekPlanVo; import com.sercurityControl.proteam.domain.vo.WeekPlanVo;
import com.sercurityControl.proteam.dutyTask.domain.BadWeatherEntity;
import com.sercurityControl.proteam.dutyTask.domain.DataInfo; import com.sercurityControl.proteam.dutyTask.domain.DataInfo;
import com.sercurityControl.proteam.dutyTask.domain.TodayTaskVo; import com.sercurityControl.proteam.dutyTask.domain.TodayTaskVo;
import com.sercurityControl.proteam.dutyTask.domain.TowerVo; import com.sercurityControl.proteam.dutyTask.domain.TowerVo;
@ -195,6 +196,16 @@ public class HomeDataServiceImpl implements HomeDataService {
return newList; return newList;
} }
@Override
public String getBadWeatherData() {
BadWeatherEntity bean = mapper.getBadWeatherData();
if (bean != null){
return "今日天气:"+bean.getWeather()+",最低温度:"+bean.getMinTemperature()+"℃,最高温度:"+bean.getMaxTemperature()+"℃,预警:"+bean.getWarning();
}else {
return "";
}
}
@Override @Override
public List<RiskMapData> getRiskMap(RiskMapData riskMapData) { public List<RiskMapData> getRiskMap(RiskMapData riskMapData) {
@ -584,12 +595,12 @@ public class HomeDataServiceImpl implements HomeDataService {
*/ */
@Override @Override
public List<TowerVo> getGtList(TowerVo params) { public List<TowerVo> getGtList(TowerVo params) {
try{ // try{
List<TowerVo> list=mapper.getGtList(params); // List<TowerVo> list=mapper.getGtList(params);
return list; // return list;
}catch (Exception e){ // }catch (Exception e){
log.error(e.toString(),e); // log.error(e.toString(),e);
} // }
return new ArrayList<>(); return new ArrayList<>();
} }

View File

@ -0,0 +1,101 @@
package com.sercurityControl.proteam.supplement.controller;
import com.securityControl.common.core.web.domain.AjaxResult;
import com.securityControl.common.log.annotation.Log;
import com.securityControl.common.log.annotation.SysLog;
import com.securityControl.common.log.enums.BusinessType;
import com.securityControl.common.log.enums.OperaType;
import com.securityControl.common.log.enums.OperationType;
import com.sercurityControl.proteam.domain.vo.DeviceVo;
import com.sercurityControl.proteam.dutyTask.controller.TodayTaskController;
import com.sercurityControl.proteam.dutyTask.domain.RemoteFaceEntity;
import com.sercurityControl.proteam.supplement.domain.dto.ParamsDto;
import com.sercurityControl.proteam.supplement.domain.vo.RiskWarningAndEarlyDisposalVo;
import com.sercurityControl.proteam.supplement.service.RiskProService;
import com.sercurityControl.proteam.supplement.service.RiskWarningAndEarlyDisposalService;
import com.sercurityControl.proteam.util.BaseController;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.Map;
/**
* @description 风险预警提前处置
* @author hay
* @date 2024/12/11 10:24
*/
@RestController
@RequestMapping("/pot/riskWarningAndEarlyDisposal/")
@Slf4j
public class RiskWarningAndEarlyDisposalController extends BaseController {
Logger logger = LoggerFactory.getLogger(RiskWarningAndEarlyDisposalController.class);
@Resource(name = "RiskWarningAndEarlyDisposalService")
private RiskWarningAndEarlyDisposalService service;
@ApiOperation(value = "风险预警提前处置-列表")
@PostMapping(value = "getList")
@SysLog(title = "风险预警提前处置", model = "安全风险->风险预警提前处置", operaType = OperaType.QUERY, details = "列表查询",logType = 1)
public Map<String, Object> getList(ParamsDto dto) {
return service.getList(dto);
}
/**
* 新增
*/
@PostMapping(value = "addData")
@SysLog(title = "风险预警提前处置新增", model = "安全风险->风险预警提前处置", operaType = OperaType.INSERT, details = "新增",logType = 1)
public AjaxResult addRemoteFace(RiskWarningAndEarlyDisposalVo bean) {
try {
service.addData(bean);
return AjaxResult.success("success");
} catch (Exception e) {
logger.error("新增风险预警提前处置", e);
return AjaxResult.error("服务异常,请稍后重试");
}
}
/**
* 整改
*/
@PostMapping(value = "updateData")
@SysLog(title = "风险预警提前处置整改", model = "安全风险->风险预警提前处置", operaType = OperaType.UPDATE, details = "整改",logType = 1)
public AjaxResult updateData(RiskWarningAndEarlyDisposalVo bean) {
try {
service.updateData(bean);
return AjaxResult.success("success");
} catch (Exception e) {
logger.error("新增风险预警提前处置", e);
return AjaxResult.error("服务异常,请稍后重试");
}
}
/**
* 查看详情
*
* @param
* @return
*/
@PostMapping("getDetailById")
@SysLog(title = "风险预警提前处置详情", model = "安全风险->风险预警提前处置", operaType = OperaType.QUERY, details = "详情",logType = 1)
public RiskWarningAndEarlyDisposalVo getDetailById(String keyId) {
RiskWarningAndEarlyDisposalVo deviceVo = null;
try {
// String keyId = Aes.aesDecrypt(params);
deviceVo = service.getDetailById(keyId);
return deviceVo;
} catch (Exception e) {
// log.error(e.toString(),e);
}
return deviceVo;
}
}

View File

@ -0,0 +1,115 @@
package com.sercurityControl.proteam.supplement.domain.vo;
import com.securityControl.common.core.annotation.Sensitive;
import com.securityControl.common.core.enums.SensitizedType;
import lombok.Data;
/**
* @author hay
* @description 风险工程排名
* @date 2024/12/11 11:28
*/
@Data
public class RiskWarningAndEarlyDisposalVo {
/**
* id
*/
private String id;
/**
* 工程名称
*/
private String proName;
/**
* 作业票名称
*/
private String ticketName;
/**
* 风险等级
*/
private String riskGrade;
/**
* 编号
*/
private String number;
/**
* 负责人
*/
private String jobLeader;
/**
* 作业部位
*/
private String jobSite;
/**
* 工序
*/
private String jobGx;
/**
* 作业班组
*/
private String workingTeamName;
/**
* 风险成本
*/
private String riskCb;
/**
* 管控措施
*/
private String manageControl;
/**
* 补充措施
*/
private String supplementMeasure;
/**
* 是否是重点工程
*/
private String important;
/**
* 预警时间
*/
private String yjDate;
/**
* 整改期限
*/
private String changeTerm;
/**
* 整改内容
*/
private String changeContent;
/**
* 整改图片地址
*/
private String path;
/**
* 状态
*/
private String status;
/**
* 上传人
*/
private String uploadId;
private int page;
private int limit;
}

View File

@ -0,0 +1,81 @@
package com.sercurityControl.proteam.supplement.mapper;
import com.sercurityControl.proteam.supplement.domain.dto.ParamsDto;
import com.sercurityControl.proteam.supplement.domain.vo.RiskWarningAndEarlyDisposalVo;
import com.sercurityControl.proteam.supplement.domain.vo.RiskRectDetailVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* @description 风险工程排名
* @author hay
* @date 2024/12/11 11:27
*/
@Repository(value = "RiskWarningAndEarlyDisposalMapper")
public interface RiskWarningAndEarlyDisposalMapper {
/**
* 风险整改分析
*
* @param dto
* @return List<RiskWarningAndEarlyDisposalVo>
* @author cwchen
* @date 2024/12/9 17:03
*/
List<RiskWarningAndEarlyDisposalVo> getList(ParamsDto dto);
/**
* 获取整改时间
*
* @param item
* @return List<String>
* @author cwchen
* @date 2024/12/9 17:15
*/
List<String> getRectTime(RiskWarningAndEarlyDisposalVo item);
/**
* 风险整改分析-整改详情
*
* @param dto
* @return RiskRectDetailVo
* @author cwchen
* @date 2024/12/9 18:12
*/
RiskRectDetailVo getRiskRectDetail(ParamsDto dto);
/**
* 查询1.整改内容2.整改照片
* @param id
* @param type
* @return List<String>
* @author cwchen
* @date 2024/12/9 18:26
*/
List<String> getRectImgPath(@Param("id") String id, @Param("type") int type);
/**
* 新增数据
*
* @param bean
* @return int
*/
int addData(RiskWarningAndEarlyDisposalVo bean);
/**
* 数据
*
* @param keyId
* @return int
*/
RiskWarningAndEarlyDisposalVo getDetailById(@Param("id") String keyId);
/**
* 更新数据
*
* @param bean
* @return int
*/
int updateData(RiskWarningAndEarlyDisposalVo bean);
}

View File

@ -0,0 +1,41 @@
package com.sercurityControl.proteam.supplement.service;
import com.sercurityControl.proteam.supplement.domain.dto.ParamsDto;
import com.sercurityControl.proteam.supplement.domain.vo.RiskWarningAndEarlyDisposalVo;
import java.util.Map;
/**
* @description 风险工程排名
* @author hay
* @date 2024/12/11 11:26
*/
public interface RiskWarningAndEarlyDisposalService {
/**
* 风险工程排名
* @param dto
* @return Map<String,Object>
*/
Map<String, Object> getList(ParamsDto dto);
/**
* 新增
* @param bean
* @return int
*/
int addData(RiskWarningAndEarlyDisposalVo bean);
/**
* 查看详情
* @param keyId
* @return
*/
RiskWarningAndEarlyDisposalVo getDetailById(String keyId);
/**
* 修改
* @param bean
* @return int
*/
int updateData(RiskWarningAndEarlyDisposalVo bean);
}

View File

@ -0,0 +1,77 @@
package com.sercurityControl.proteam.supplement.service.impl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.securityControl.common.core.constant.HttpStatus;
import com.securityControl.common.security.utils.SecurityUtils;
import com.sercurityControl.proteam.domain.vo.DeviceVo;
import com.sercurityControl.proteam.supplement.domain.dto.ParamsDto;
import com.sercurityControl.proteam.supplement.domain.vo.RiskWarningAndEarlyDisposalVo;
import com.sercurityControl.proteam.supplement.mapper.RiskProMapper;
import com.sercurityControl.proteam.supplement.mapper.RiskWarningAndEarlyDisposalMapper;
import com.sercurityControl.proteam.supplement.service.RiskProService;
import com.sercurityControl.proteam.supplement.service.RiskWarningAndEarlyDisposalService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @description 风险工程排名
* @author hay
* @date 2024/12/11 11:26
*/
@Slf4j
@Service(value = "RiskWarningAndEarlyDisposalService")
public class RiskWarningAndEarlyDisposalServiceImpl implements RiskWarningAndEarlyDisposalService {
@Resource(name = "RiskWarningAndEarlyDisposalMapper")
private RiskWarningAndEarlyDisposalMapper mapper;
@Override
public Map<String, Object> getList(ParamsDto dto) {
PageHelper.startPage(dto.getPage(), dto.getLimit());
Map<String, Object> map = new HashMap<>(16);
List<RiskWarningAndEarlyDisposalVo> list = null;
try {
list = mapper.getList(dto);
} catch (Exception e) {
log.error(e.toString(),e);
}
PageInfo<RiskWarningAndEarlyDisposalVo> pageInfo = new PageInfo<>(list);
map.put("code", HttpStatus.SUCCESS);
map.put("msg", "获取数据成功");
map.put("count", pageInfo.getTotal());
map.put("curr", dto.getPage());
map.put("limit", dto.getLimit());
map.put("data", pageInfo.getList());
return map;
}
@Override
public int addData(RiskWarningAndEarlyDisposalVo bean) {
String userId = String.valueOf(SecurityUtils.getUserId());
bean.setUploadId(userId);
return mapper.addData(bean);
}
@Override
public RiskWarningAndEarlyDisposalVo getDetailById(String keyId) {
try{
RiskWarningAndEarlyDisposalVo entity=mapper.getDetailById(keyId);
return entity;
}catch (Exception e){
log.error(e.toString(),e);
}
return new RiskWarningAndEarlyDisposalVo();
}
@Override
public int updateData(RiskWarningAndEarlyDisposalVo bean) {
return mapper.updateData(bean);
}
}

View File

@ -34,7 +34,7 @@ public class RectificationPunishmentTaskConfig {
* 定时器 每天0点获取天气 * 定时器 每天0点获取天气
*/ */
// @Scheduled(cron = "秒 分 时 日 月 周 年[可选]") // @Scheduled(cron = "秒 分 时 日 月 周 年[可选]")
@Scheduled(cron = "0 05 18 * * ?") @Scheduled(cron = "0 06 15 * * ?")
public void getWeatherData() { public void getWeatherData() {
//合肥 //合肥
String addressCode="101220101"; String addressCode="101220101";

View File

@ -1372,4 +1372,15 @@
from jj_team_people from jj_team_people
where delete_flag=0 and team_id=#{teamId} where delete_flag=0 and team_id=#{teamId}
</select> </select>
<select id="getBadWeatherData" resultType="com.sercurityControl.proteam.dutyTask.domain.BadWeatherEntity">
SELECT id, date, weather, min_temperature as minTemperature, max_temperature as maxTemperature, warning
FROM
t_bad_weather
WHERE
is_active=1
and `status`=1
AND DATE (date) = CURDATE()
ORDER BY update_time desc
LIMIT 1
</select>
</mapper> </mapper>

View File

@ -0,0 +1,76 @@
<?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.sercurityControl.proteam.supplement.mapper.RiskWarningAndEarlyDisposalMapper">
<insert id="addData">
INSERT INTO t_risk_warning_early_disposal(proName, ticketName, riskGrade, number, jobLeader, jobSite,
jobGx, workingTeamName, riskCb, manageControl,
supplementMeasure, important, yjDate, changeTerm, changeContent,
status, upload_id)
VALUES (#{proName}, #{ticketName}, #{riskGrade}, #{number}, #{jobLeader}, #{jobSite}, #{jobGx},
#{workingTeamName}, #{riskCb}, #{manageControl}, #{supplementMeasure}, #{important}, #{yjDate},
#{changeTerm}, #{changeContent}, #{status}, #{uploadId})
</insert>
<update id="updateData">
update t_risk_warning_early_disposal
set changeContent=#{changeContent},
path=#{path}
WHERE id = #{id}
</update>
<select id="getList" resultType="com.sercurityControl.proteam.supplement.domain.vo.RiskWarningAndEarlyDisposalVo">
SELECT
*
FROM
t_risk_warning_early_disposal
WHERE
is_active=1
<if test="proName!=null and proName!=''">
and proName LIKE CONCAT('%',#{proName},'%')
</if>
<if test="riskLevel!=null and riskLevel!=''">
AND riskGrade = #{riskLevel}
</if>
ORDER BY update_time DESC
</select>
<!--风险整改分析-整改详情-->
<select id="getRiskRectDetail"
resultType="com.sercurityControl.proteam.supplement.domain.vo.RiskRectDetailVo">
SELECT tnv.id,
tnv.ticket_no AS ticketNo,
jjt.ticket_name AS ticketName,
tnv.pro_name AS proName,
tnv.risk_level AS riskLevel,
tnv.child_type AS childType,
jjcmi.work_manage AS workManager,
jjcmi.work_manage_phone AS workManagerPhone,
jjcmi.work_gx AS gx,
jjcmi.work_site AS workSite,
tnv.create_time AS time,
tnv.level_id AS levelId
FROM t_notice_voi tnv
LEFT JOIN jj_class_metting_info jjcmi ON tnv.class_id = jjcmi.class_id
LEFT JOIN jj_ticket jjt ON tnv.ticket_no = jjt.ticket_no
WHERE tnv.id = #{id}
</select>
<!--查询整改内容、整改照片-->
<select id="getRectImgPath" resultType="java.lang.String">
<if test="type == 1">
SELECT rect_explain FROM t_notice_voi_rect WHERE noti_id = #{id} ORDER BY create_time DESC LIMIT 1
</if>
<if test="type == 2">
SELECT image_path
FROM t_notice_voi_photo
WHERE rect_id = (SELECT id FROM t_notice_voi_rect WHERE noti_id = #{id} ORDER BY create_time DESC LIMIT 1)
AND noti_id = #{id} AND image_type IN ('2','3')
</if>
</select>
<select id="getDetailById"
resultType="com.sercurityControl.proteam.supplement.domain.vo.RiskWarningAndEarlyDisposalVo">
SELECT *
FROM t_risk_warning_early_disposal
WHERE is_active = 1
and id = #{id}
</select>
</mapper>