工作填报
This commit is contained in:
parent
7f34b4fe2f
commit
3003569c1f
|
|
@ -0,0 +1,30 @@
|
|||
package com.securitycontrol.entity.screen.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @className:WorkReportVo
|
||||
* @author:cwchen
|
||||
* @date:2025-05-16-9:17
|
||||
* @version:1.0
|
||||
* @description:工作完成情况填报-vo
|
||||
*/
|
||||
@Data
|
||||
public class WorkReportVo {
|
||||
|
||||
private String id;
|
||||
|
||||
private String workContent;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
|
||||
private Date workDate;
|
||||
|
||||
private String completionStatus;
|
||||
|
||||
private String fillStatus;
|
||||
|
||||
private Date fillTime = new Date();
|
||||
}
|
||||
|
|
@ -66,7 +66,7 @@ public class ParamSecureHandler implements AsyncHandlerInterceptor {
|
|||
public static String[] SC_URL= new String[]{"/app/index/","/largeScreen/accessMge/",
|
||||
"/largeScreen/alarmMge/","/largeScreen/constructionQuality/","/largeScreen/operatingEnvironment/",
|
||||
"/largeScreen/personnelControl/","/largeScreen/scIndex/","/largeScreen/towerAssInspect/",
|
||||
"/largeScreen/video/","/largeScreen/xcIndex/","/largeScreen/dataAnalysis/","/largeScreen/constrDisplay/"};
|
||||
"/largeScreen/video/","/largeScreen/xcIndex/","/largeScreen/dataAnalysis/","/largeScreen/workReport/","/largeScreen/constrDisplay/"};
|
||||
|
||||
|
||||
private final String whiteURL = "http://127.0.0.1:18080/";
|
||||
|
|
@ -103,23 +103,20 @@ public class ParamSecureHandler implements AsyncHandlerInterceptor {
|
|||
@Override
|
||||
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
|
||||
try{
|
||||
|
||||
|
||||
if (!checkIsYq(request)) {
|
||||
returnJson(response, "越权访问,接口未授权", 401);
|
||||
return false;
|
||||
}
|
||||
}catch (Exception e){
|
||||
returnJson(response, "令牌不能为空", 401);
|
||||
return false;
|
||||
}
|
||||
// 过滤文件上传功能
|
||||
if(isFileUpload(request)){
|
||||
return true;
|
||||
}
|
||||
XssRequestWrapper requestWrapper = new XssRequestWrapper(request);
|
||||
// System.out.println("进入了拦截器");
|
||||
// System.err.println(request.getRequestURI());
|
||||
System.out.println("进入了拦截器");
|
||||
System.err.println(request.getRequestURI());
|
||||
String requestUrl = requestWrapper.getRequestURI();
|
||||
|
||||
/**
|
||||
|
|
@ -144,7 +141,7 @@ public class ParamSecureHandler implements AsyncHandlerInterceptor {
|
|||
return false;
|
||||
|
||||
}
|
||||
// System.err.println(JSON.toJSONString(request.getParameterMap()));
|
||||
System.err.println(JSON.toJSONString(request.getParameterMap()));
|
||||
/**
|
||||
* 获取所有跳转路径参数,保留传入下个界面
|
||||
*/
|
||||
|
|
@ -165,8 +162,8 @@ public class ParamSecureHandler implements AsyncHandlerInterceptor {
|
|||
*/
|
||||
String readerParam = requestWrapper.getReaderParam();
|
||||
// 判断是否是文件上传,是不对流参数进行验证
|
||||
String uplFile = "uploadFile", upImage = "uploadImage", path="pushImageData";
|
||||
if (!requestUrl.contains(uplFile) && !requestUrl.contains(upImage) && !requestUrl.contains(path)) {
|
||||
String uplFile = "uploadFile", upImage = "uploadImage";
|
||||
if (!requestUrl.contains(uplFile) && !requestUrl.contains(upImage)) {
|
||||
boolean checkReader = checkReader(readerParam, requestUrl);
|
||||
if (!checkReader) {
|
||||
returnJson(response, "请求重复", 500);
|
||||
|
|
@ -205,12 +202,8 @@ public class ParamSecureHandler implements AsyncHandlerInterceptor {
|
|||
if(SecurityConstants.INNER.equals(head)){
|
||||
return true;
|
||||
}
|
||||
|
||||
String requestUri = request.getRequestURI();
|
||||
if(requestUri.contains("files") || requestUri.contains("file")){
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
if(Arrays.asList(WHITE_URLS).contains(requestUri)){
|
||||
return true;
|
||||
}
|
||||
|
|
@ -238,7 +231,7 @@ public class ParamSecureHandler implements AsyncHandlerInterceptor {
|
|||
}
|
||||
}
|
||||
}
|
||||
// System.out.println("==================越狱记录:========================userId:" + userId + "============是否越狱:" + result);
|
||||
System.out.println("==================越狱记录:========================userId:" + userId + "============是否越狱:" + result);
|
||||
}
|
||||
if (!result) {
|
||||
addExceedsAccessLog(requestUri, token);
|
||||
|
|
@ -431,7 +424,7 @@ public class ParamSecureHandler implements AsyncHandlerInterceptor {
|
|||
*/
|
||||
private boolean checkReader(String readerParam, String requestUrl) {
|
||||
if (SafeUtil.checkScript(readerParam)) {
|
||||
// log.info("请求失败,当前请求参数不安全!请求地址:\n" + requestUrl + "\n不安全参数:数据流:" + readerParam);
|
||||
log.info("请求失败,当前请求参数不安全!请求地址:\n" + requestUrl + "\n不安全参数:数据流:" + readerParam);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,45 @@
|
|||
package com.securitycontrol.screen.controller;
|
||||
|
||||
import com.securitycontrol.common.core.web.controller.BaseController;
|
||||
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.screen.dto.ScreenParamDto;
|
||||
import com.securitycontrol.entity.screen.vo.WorkReportVo;
|
||||
import com.securitycontrol.screen.service.IWorkReportService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @className:WorkReportController
|
||||
* @author:cwchen
|
||||
* @date:2025-05-15-19:42
|
||||
* @version:1.0
|
||||
* @description:工作完成情况填报
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/largeScreen/workReport/")
|
||||
public class WorkReportController extends BaseController {
|
||||
|
||||
@Resource(name = "IWorkReportService")
|
||||
private IWorkReportService service;
|
||||
|
||||
@ApiOperation(value = "工作完成情况填报列表")
|
||||
@GetMapping("getWorkLists")
|
||||
@Log(title = "工作完成情况填报列表", menu = "工作完成情况填报->工作完成情况填报列表", grade = OperationType.QUERY_BUSINESS, details = "查询告警管理列表", type = "业务日志")
|
||||
public TableDataInfo getWorkLists(ScreenParamDto dto) {
|
||||
startLayPage();
|
||||
List<WorkReportVo> list = service.getWorkLists(dto);
|
||||
return getDataTableLayui(list);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "填报工作情况")
|
||||
@PostMapping("fillWorkSituation")
|
||||
public AjaxResult fillWorkSituation(@RequestBody WorkReportVo vo){
|
||||
return service.fillWorkSituation(vo);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
package com.securitycontrol.screen.mapper;
|
||||
|
||||
import com.securitycontrol.entity.screen.dto.ScreenParamDto;
|
||||
import com.securitycontrol.entity.screen.vo.WorkReportVo;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @className:IWorkReportMapper
|
||||
* @author:cwchen
|
||||
* @date:2025-05-15-19:43
|
||||
* @version:1.0
|
||||
* @description:工作完成情况-数据层
|
||||
*/
|
||||
@Repository("IWorkReportMapper")
|
||||
public interface IWorkReportMapper {
|
||||
/**
|
||||
* 工作完成情况填报列表
|
||||
* @param dto
|
||||
* @return List<WorkReportVo>
|
||||
* @author cwchen
|
||||
* @date 2025/5/16 9:20
|
||||
*/
|
||||
List<WorkReportVo> getWorkLists(ScreenParamDto dto);
|
||||
|
||||
/**
|
||||
* 填写工作情况
|
||||
* @param vo
|
||||
* @return void
|
||||
* @author cwchen
|
||||
* @date 2025/5/16 9:40
|
||||
*/
|
||||
void fillWorkSituation(WorkReportVo vo);
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package com.securitycontrol.screen.service;
|
||||
|
||||
import com.securitycontrol.common.core.web.domain.AjaxResult;
|
||||
import com.securitycontrol.entity.screen.dto.ScreenParamDto;
|
||||
import com.securitycontrol.entity.screen.vo.WorkReportVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @className:WorkReportService
|
||||
* @author:cwchen
|
||||
* @date:2025-05-15-19:42
|
||||
* @version:1.0
|
||||
* @description:工作完成情况填报-业务层
|
||||
*/
|
||||
public interface IWorkReportService {
|
||||
/**
|
||||
* 工作完成情况填报列表
|
||||
* @param dto
|
||||
* @return List<WorkReportVo>
|
||||
* @author cwchen
|
||||
* @date 2025/5/16 9:18
|
||||
*/
|
||||
List<WorkReportVo> getWorkLists(ScreenParamDto dto);
|
||||
|
||||
/**
|
||||
* 填报工作情况
|
||||
* @param vo
|
||||
* @return AjaxResult
|
||||
* @author cwchen
|
||||
* @date 2025/5/16 9:37
|
||||
*/
|
||||
AjaxResult fillWorkSituation(WorkReportVo vo);
|
||||
}
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
package com.securitycontrol.screen.service.impl;
|
||||
|
||||
import com.securitycontrol.common.core.web.domain.AjaxResult;
|
||||
import com.securitycontrol.entity.screen.dto.ScreenParamDto;
|
||||
import com.securitycontrol.entity.screen.vo.WorkReportVo;
|
||||
import com.securitycontrol.screen.mapper.IWorkReportMapper;
|
||||
import com.securitycontrol.screen.service.IWorkReportService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* @className:WorkReportServiceImpl
|
||||
* @author:cwchen
|
||||
* @date:2025-05-15-19:43
|
||||
* @version:1.0
|
||||
* @description:工作完成情况填报-业务逻辑层
|
||||
*/
|
||||
@Service(value = "IWorkReportService")
|
||||
@Slf4j
|
||||
public class WorkReportServiceImpl implements IWorkReportService {
|
||||
|
||||
@Resource(name = "IWorkReportMapper")
|
||||
private IWorkReportMapper mapper;
|
||||
|
||||
@Override
|
||||
public List<WorkReportVo> getWorkLists(ScreenParamDto dto) {
|
||||
List<WorkReportVo> list = null;
|
||||
try {
|
||||
list = Optional.ofNullable(mapper.getWorkLists(dto)).orElseGet(ArrayList::new);
|
||||
return list;
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(),e);
|
||||
return new ArrayList<>();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult fillWorkSituation(WorkReportVo vo) {
|
||||
try {
|
||||
mapper.fillWorkSituation(vo);
|
||||
return AjaxResult.success("操作成功");
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
return AjaxResult.error("操作失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
<?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.securitycontrol.screen.mapper.IWorkReportMapper">
|
||||
<!--填写工作情况-->
|
||||
<insert id="fillWorkSituation">
|
||||
INSERT INTO jj_class_completion(class_id,completion_status,fill_time) VALUES (
|
||||
#{id},#{completionStatus},#{fillTime}
|
||||
)
|
||||
</insert>
|
||||
|
||||
|
||||
<!--工作完成情况填报列表-->
|
||||
<select id="getWorkLists" resultType="com.securitycontrol.entity.screen.vo.WorkReportVo">
|
||||
SELECT jjcm.id,
|
||||
jjcmi.work_content AS workContent,
|
||||
current_constr_date AS workDate,
|
||||
jjcc.completion_status AS completionStatus,
|
||||
IFNULL(jjcc.class_id,'0') AS fillStatus
|
||||
FROM jj_class_meetting jjcm
|
||||
LEFT JOIN jj_class_metting_info jjcmi ON jjcm.id = jjcmi.class_id
|
||||
LEFT JOIN jj_class_completion jjcc ON jjcm.id = jjcc.class_id
|
||||
WHERE jjcm.single_project_code = '1612P021000T01' AND jjcm.delete_flag = '0'
|
||||
<if test="startTime !=null and startTime!='' and endTime!=null and endTime!=''">
|
||||
AND DATE_FORMAT(jjcm.current_constr_date,'%Y-%m-%d') BETWEEN #{startTime} AND #{endTime}
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue