Merge remote-tracking branch 'origin/guoshengxiong' into guoshengxiong
This commit is contained in:
commit
6ac97db804
@ -2,13 +2,17 @@ package com.zhgd.xmgl.modules.dangerous.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
||||
import com.zhgd.xmgl.modules.basicdata.entity.SystemUser;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.ISystemUserService;
|
||||
import com.zhgd.xmgl.modules.dangerous.entity.*;
|
||||
import com.zhgd.xmgl.modules.dangerous.service.*;
|
||||
import com.zhgd.xmgl.modules.dangerous.service.IDangerousEngineeringRecordService;
|
||||
import com.zhgd.xmgl.modules.dangerous.service.IDangerousEngineeringTypeDescribeControlService;
|
||||
import com.zhgd.xmgl.modules.dangerous.service.IDangerousEngineeringTypeDescribeService;
|
||||
import com.zhgd.xmgl.modules.dangerous.service.IDangerousEngineeringTypeService;
|
||||
import com.zhgd.xmgl.modules.worker.entity.EnterpriseInfo;
|
||||
import com.zhgd.xmgl.modules.worker.entity.WorkerInfo;
|
||||
import com.zhgd.xmgl.modules.worker.service.IEnterpriseInfoService;
|
||||
@ -18,31 +22,27 @@ import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
|
||||
/**
|
||||
* @Title: Controller
|
||||
* @Description: 现场危大工程
|
||||
* @author: pds
|
||||
* @date: 2021-06-28
|
||||
* @date: 2021-06-28
|
||||
* @version: V1.0
|
||||
*/
|
||||
@RestController
|
||||
@ -52,9 +52,22 @@ import springfox.documentation.annotations.ApiIgnore;
|
||||
public class DangerousEngineeringRecordController {
|
||||
@Autowired
|
||||
private IDangerousEngineeringRecordService dangerousEngineeringRecordService;
|
||||
@Autowired
|
||||
private ISystemUserService systemUserService;
|
||||
@Autowired
|
||||
private IWorkerInfoService workerInfoService;
|
||||
@Autowired
|
||||
private IEnterpriseInfoService enterpriseInfoService;
|
||||
@Autowired
|
||||
private IDangerousEngineeringTypeDescribeService dangerousEngineeringTypeDescribeService;
|
||||
@Autowired
|
||||
private IDangerousEngineeringTypeService dangerousEngineeringTypeService;
|
||||
@Autowired
|
||||
private IDangerousEngineeringTypeDescribeControlService dangerousEngineeringTypeDescribeControlService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页列表查询现场危大工程信息", notes = "分页列表查询现场危大工程信息", httpMethod = "POST")
|
||||
@ -64,17 +77,18 @@ public class DangerousEngineeringRecordController {
|
||||
@ApiImplicitParam(name = "pageNo", value = "第几页", paramType = "body", required = true, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "pageSize", value = "每页显示条数", paramType = "body", required = true, dataType = "Integer"),
|
||||
})
|
||||
@PostMapping(value = "/list")
|
||||
public Result<IPage<EntityMap>> queryPageList(@RequestBody Map<String,Object> map) {
|
||||
Result<IPage<EntityMap>> result = new Result<IPage<EntityMap>>();
|
||||
IPage<EntityMap> pageList = dangerousEngineeringRecordService.queryDangerousEngineeringPageList(map);
|
||||
result.setSuccess(true);
|
||||
result.setResult(pageList);
|
||||
return result;
|
||||
}
|
||||
@PostMapping(value = "/list")
|
||||
public Result<IPage<EntityMap>> queryPageList(@RequestBody Map<String, Object> map) {
|
||||
Result<IPage<EntityMap>> result = new Result<IPage<EntityMap>>();
|
||||
IPage<EntityMap> pageList = dangerousEngineeringRecordService.queryDangerousEngineeringPageList(map);
|
||||
result.setSuccess(true);
|
||||
result.setResult(pageList);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
* 添加
|
||||
*
|
||||
* @param dangerousEngineeringRecord
|
||||
* @return
|
||||
*/
|
||||
@ -85,26 +99,9 @@ public class DangerousEngineeringRecordController {
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private ISystemUserService systemUserService;
|
||||
|
||||
@Autowired
|
||||
private IWorkerInfoService workerInfoService;
|
||||
|
||||
@Autowired
|
||||
private IEnterpriseInfoService enterpriseInfoService;
|
||||
|
||||
@Autowired
|
||||
private IDangerousEngineeringTypeDescribeService dangerousEngineeringTypeDescribeService;
|
||||
|
||||
@Autowired
|
||||
private IDangerousEngineeringTypeService dangerousEngineeringTypeService;
|
||||
|
||||
@Autowired
|
||||
private IDangerousEngineeringTypeDescribeControlService dangerousEngineeringTypeDescribeControlService;
|
||||
|
||||
/**
|
||||
* 添加
|
||||
* 添加
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@ -141,7 +138,7 @@ public class DangerousEngineeringRecordController {
|
||||
dangerousEngineeringRecord.setEngineeringTypeName(engineeringType.getTypeName());
|
||||
// dangerousEngineeringRecord.setBuildStartTime(buildTime.get(0));
|
||||
// dangerousEngineeringRecord.setBuildEndTime(buildTime.get(1));
|
||||
dangerousEngineeringRecord.setPlanStartTime(planTime== null ? null : planTime.get(0));
|
||||
dangerousEngineeringRecord.setPlanStartTime(planTime == null ? null : planTime.get(0));
|
||||
dangerousEngineeringRecord.setPlanEndTime(planTime == null ? null : planTime.get(1));
|
||||
dangerousEngineeringRecord.setResponsibilityCompanyId(enterpriseInfo.getId());
|
||||
String securityConstructionSchemeType = MapUtils.getString(map, "securityConstructionSchemeType");
|
||||
@ -199,11 +196,12 @@ public class DangerousEngineeringRecordController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* 编辑
|
||||
*
|
||||
* @param dangerousEngineeringRecord
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "编辑现场危大工程信息", notes = "编辑现场危大工程信息" , httpMethod="POST")
|
||||
@ApiOperation(value = "编辑现场危大工程信息", notes = "编辑现场危大工程信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<DangerousEngineeringRecord> edit(@RequestBody DangerousEngineeringRecord dangerousEngineeringRecord) {
|
||||
dangerousEngineeringRecordService.edit(dangerousEngineeringRecord);
|
||||
@ -211,21 +209,22 @@ public class DangerousEngineeringRecordController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
* 通过id删除
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "删除现场危大工程信息", notes = "删除现场危大工程信息", httpMethod = "POST")
|
||||
@ApiImplicitParam(name = "id", value = "现场危大工程ID", paramType = "body", required = true, dataType = "Integer")
|
||||
@PostMapping(value = "/delete")
|
||||
public Result<DangerousEngineeringRecord> delete(@RequestBody Map<String,Object> map) {
|
||||
public Result<DangerousEngineeringRecord> delete(@RequestBody Map<String, Object> map) {
|
||||
Result<DangerousEngineeringRecord> result = new Result<DangerousEngineeringRecord>();
|
||||
DangerousEngineeringRecord dangerousEngineeringRecord = dangerousEngineeringRecordService.getById(MapUtils.getString(map,"id"));
|
||||
if(dangerousEngineeringRecord==null) {
|
||||
DangerousEngineeringRecord dangerousEngineeringRecord = dangerousEngineeringRecordService.getById(MapUtils.getString(map, "id"));
|
||||
if (dangerousEngineeringRecord == null) {
|
||||
result.error500(MessageUtil.get("notFindErr"));
|
||||
}else {
|
||||
boolean ok = dangerousEngineeringRecordService.removeById(MapUtils.getString(map,"id"));
|
||||
if(ok) {
|
||||
} else {
|
||||
boolean ok = dangerousEngineeringRecordService.removeById(MapUtils.getString(map, "id"));
|
||||
if (ok) {
|
||||
result.successMsg(MessageUtil.get("deleteSucess"));
|
||||
}
|
||||
}
|
||||
@ -235,6 +234,7 @@ public class DangerousEngineeringRecordController {
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
|
||||
@ -45,7 +45,7 @@ public class DangerousEngineeringSideStationController {
|
||||
@ApiImplicitParam(name = "projectSn", value = "projectSn", paramType = "body", required = false, dataType = "String"),
|
||||
})
|
||||
@PostMapping(value = "/selectList")
|
||||
public Result<List<EntityMap>> selectSideStationList(@RequestBody Map<String, Object> map) {
|
||||
public Result<List<DangerousEngineeringSideStation>> selectSideStationList(@RequestBody Map<String, Object> map) {
|
||||
return Result.success(dangerousEngineeringSideStationService.selectSideStationList(map));
|
||||
}
|
||||
|
||||
@ -55,7 +55,7 @@ public class DangerousEngineeringSideStationController {
|
||||
@ApiImplicitParam(name = "projectSn", value = "projectSn", paramType = "body", required = false, dataType = "String"),
|
||||
})
|
||||
@PostMapping(value = "/page")
|
||||
public Result<Page<EntityMap>> selectSideStationPage(@RequestBody Map<String, Object> map) {
|
||||
public Result<Page<DangerousEngineeringSideStation>> selectSideStationPage(@RequestBody Map<String, Object> map) {
|
||||
return Result.success(dangerousEngineeringSideStationService.selectSideStationPage(map));
|
||||
}
|
||||
|
||||
|
||||
@ -3,6 +3,7 @@ package com.zhgd.xmgl.modules.dangerous.entity;
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
@ -22,7 +23,7 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
@ApiModel(value="DangerousEngineeringSideStation实体类",description="DangerousEngineeringSideStation")
|
||||
public class DangerousEngineeringSideStation implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
/**id*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value="id")
|
||||
@ -55,14 +56,21 @@ public class DangerousEngineeringSideStation implements Serializable {
|
||||
/**图片*/
|
||||
@Excel(name = "图片", width = 15)
|
||||
@ApiModelProperty(value="图片")
|
||||
private java.lang.String imageUrl ;
|
||||
/**创建人员ID*/
|
||||
private java.lang.String imageUrl;
|
||||
/**
|
||||
* 创建人员ID
|
||||
*/
|
||||
@Excel(name = "创建人员ID", width = 15)
|
||||
@ApiModelProperty(value="创建人员ID")
|
||||
@ApiModelProperty(value = "创建人员ID")
|
||||
|
||||
private java.lang.Long createUser ;
|
||||
/**创建时间*/
|
||||
private java.lang.Long createUser;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Excel(name = "创建时间", width = 15)
|
||||
@ApiModelProperty(value="创建时间")
|
||||
private java.lang.String createTime ;
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private java.lang.String createTime;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String createUserName;
|
||||
}
|
||||
|
||||
@ -19,7 +19,7 @@ import org.apache.ibatis.annotations.Param;
|
||||
@Mapper
|
||||
public interface DangerousEngineeringSideStationMapper extends BaseMapper<DangerousEngineeringSideStation> {
|
||||
|
||||
List<EntityMap> selectSideStationList(@Param("param") Map<String, Object> map);
|
||||
List<DangerousEngineeringSideStation> selectSideStationList(@Param("param") Map<String, Object> map);
|
||||
|
||||
Page<EntityMap> selectSideStationList(@Param("param") Map<String, Object> map, Page page);
|
||||
Page<DangerousEngineeringSideStation> selectSideStationList(@Param("param") Map<String, Object> map, Page page);
|
||||
}
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
<?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.zhgd.xmgl.modules.dangerous.mapper.DangerousEngineeringSideStationMapper">
|
||||
|
||||
<select id="selectSideStationList" resultType="com.zhgd.jeecg.common.mybatis.EntityMap">
|
||||
SELECT a.*,b.real_name create_user_name
|
||||
<select id="selectSideStationList"
|
||||
resultType="com.zhgd.xmgl.modules.dangerous.entity.DangerousEngineeringSideStation">
|
||||
SELECT a.*,b.real_name as create_user_name
|
||||
from dangerous_engineering_side_station a LEFT JOIN system_user b ON a.create_user=b.user_id
|
||||
left join dangerous_engineering_record der on der.id=a.dangerous_engineering_id
|
||||
where 1=1
|
||||
|
||||
@ -16,7 +16,7 @@ import java.util.Map;
|
||||
*/
|
||||
public interface IDangerousEngineeringSideStationService extends IService<DangerousEngineeringSideStation> {
|
||||
|
||||
List<EntityMap> selectSideStationList(Map<String, Object> map);
|
||||
List<DangerousEngineeringSideStation> selectSideStationList(Map<String, Object> map);
|
||||
|
||||
Page<EntityMap> selectSideStationPage(Map<String, Object> map);
|
||||
Page<DangerousEngineeringSideStation> selectSideStationPage(Map<String, Object> map);
|
||||
}
|
||||
|
||||
@ -28,12 +28,12 @@ public class DangerousEngineeringSideStationServiceImpl extends ServiceImpl<Dang
|
||||
private DangerousEngineeringSideStationMapper dangerousEngineeringSideStationMapper;
|
||||
|
||||
@Override
|
||||
public List<EntityMap> selectSideStationList(Map<String, Object> map) {
|
||||
public List<DangerousEngineeringSideStation> selectSideStationList(Map<String, Object> map) {
|
||||
return dangerousEngineeringSideStationMapper.selectSideStationList(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<EntityMap> selectSideStationPage(Map<String, Object> map) {
|
||||
public Page<DangerousEngineeringSideStation> selectSideStationPage(Map<String, Object> map) {
|
||||
Page page = PageUtil.getPage(map);
|
||||
return dangerousEngineeringSideStationMapper.selectSideStationList(map, page);
|
||||
}
|
||||
|
||||
@ -406,7 +406,6 @@ public class XzSecurityQualityInspectionRecordController {
|
||||
return Result.success(qualityInspectionRecordService.statsDangerType(paramMap));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "指挥部大屏数量统计", notes = "指挥部大屏数量统计", httpMethod = "POST")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "body", required = true, dataType = "String"),
|
||||
|
||||
@ -9,6 +9,8 @@ public class StatsByEnterpriseVo {
|
||||
private String enterpriseName;
|
||||
@ApiModelProperty("已整改数量")
|
||||
private Integer rectifiedNum;
|
||||
@ApiModelProperty("隐患数量")
|
||||
private Integer totalNum;
|
||||
@ApiModelProperty("已整改率")
|
||||
private Double rectifiedNumRatio;
|
||||
@ApiModelProperty("已及时整改率")
|
||||
|
||||
@ -1,20 +1,23 @@
|
||||
package com.zhgd.xmgl.modules.xz.security.entity.vo;
|
||||
|
||||
import com.zhgd.xmgl.modules.xz.entity.XzTaskProgressContent;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class StatsDirectorateBigscreenVo {
|
||||
//@ApiModelProperty("危大工程数量")
|
||||
//private Integer wdNum;
|
||||
//@ApiModelProperty("人员登记培训数量")
|
||||
//private Integer Num;
|
||||
//@ApiModelProperty("影响进度数量")
|
||||
//private Integer Num;
|
||||
//@ApiModelProperty("风险统计数量")
|
||||
//private Integer Num;
|
||||
//@ApiModelProperty("安全隐患数量")
|
||||
//private Integer Num;
|
||||
//@ApiModelProperty("AI报警数量")
|
||||
//private Integer Num;
|
||||
@ApiModelProperty("危大工程数量")
|
||||
private Integer dangerousEngineeringRecordNum;
|
||||
|
||||
@ApiModelProperty("人员登记培训数量")
|
||||
private Integer workerInfoAuditRecordNum;
|
||||
|
||||
@ApiModelProperty("影响进度数量")
|
||||
private Integer taskProgressContentNum;
|
||||
|
||||
@ApiModelProperty("风险统计数量(安全隐患数量)")
|
||||
private Integer securityQualityInspectionRecordNum;
|
||||
|
||||
@ApiModelProperty("AI报警数量")
|
||||
private Integer aiAnalyseHardWareAlarmRecordNum;
|
||||
}
|
||||
|
||||
@ -1,9 +1,11 @@
|
||||
package com.zhgd.xmgl.modules.xz.security.entity.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class XzSecurityQualityInspectionRecordTotalVo {
|
||||
|
||||
private Integer verificationNum;
|
||||
|
||||
@ -33,7 +33,7 @@ public interface XzSecurityQualityInspectionRecordMapper extends BaseMapper<XzSe
|
||||
|
||||
XzSecurityQualityInspectionRecordTotalVo selectQualityInspectionRecordPageTotal(@Param("param") Map<String, Object> map);
|
||||
|
||||
List<XzSecurityQualityInspectionRecordTotalVo> selectQualityInspectionRecordPageTotal(@Param("map") Map<String, Object> map, @Param("o") Object o);
|
||||
List<XzSecurityQualityInspectionRecordTotalVo> selectQualityInspectionRecordPageTotal(@Param("param") Map<String, Object> map, @Param("o") Object o);
|
||||
|
||||
List<Map<String, Object>> selectQualityInspectionRecordCountByDay(Map<String, Object> map);
|
||||
|
||||
@ -67,7 +67,7 @@ public interface XzSecurityQualityInspectionRecordMapper extends BaseMapper<XzSe
|
||||
|
||||
Page<StatsByChangeIdVo> statsByChangeId(@Param("param") Map<String, Object> paramMap, Page page);
|
||||
|
||||
ArrayList<SectorOneVo> countDangerLevel(Map<String, Object> paramMap);
|
||||
ArrayList<SectorOneVo> countDangerLevel(@Param("param") Map<String, Object> paramMap);
|
||||
|
||||
Page<StatsByInspectManVo> statsByInspectManVo(@Param("param") Map<String, Object> paramMap, Page page);
|
||||
|
||||
|
||||
@ -1,6 +1,21 @@
|
||||
<?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.zhgd.xmgl.modules.xz.security.mapper.XzSecurityQualityInspectionRecordMapper">
|
||||
<sql id="whereCondition">
|
||||
<if test="param.isOverdueRectification == '1'.toString()">
|
||||
and (t.status = 2 AND now() > t.change_limit_time)
|
||||
</if>
|
||||
<if test="param.isNotQualified == '1'.toString()">
|
||||
and t.status != 5
|
||||
</if>
|
||||
<if test="param.inspectStartTime != null and param.inspectStartTime != ''">
|
||||
and t.inspect_time >= #{param.inspectStartTime}
|
||||
</if>
|
||||
<if test="param.inspectEndTime != null and param.inspectEndTime != ''">
|
||||
and t.inspect_time <= if(LENGTH(#{param.inspectEndTime}) = 10,
|
||||
CONCAT(DATE_FORMAT(#{param.inspectEndTime},'%Y-%m-%d'),' 23:59:59'), #{param.inspectEndTime})
|
||||
</if>
|
||||
</sql>
|
||||
<select id="selectQualityInspectionRecordById"
|
||||
resultType="com.zhgd.xmgl.modules.xz.security.entity.vo.XzSecurityQualityInspectionRecordVo">
|
||||
SELECT a.*,
|
||||
@ -207,7 +222,8 @@
|
||||
IFNULL(SUM((CASE WHEN t.level = 2 THEN 1 ELSE 0 END)), 0) largerRiskNum,
|
||||
IFNULL(SUM((CASE WHEN t.level = 3 THEN 1 ELSE 0 END)), 0) generalRiskNum,
|
||||
IFNULL(SUM((CASE WHEN t.level = 4 THEN 1 ELSE 0 END)), 0) lowRiskNum,
|
||||
if(FLOOR((DAYOFMONTH(t.create_time)-1) / 7)>3,3,FLOOR((DAYOFMONTH(t.create_time)-1) / 7)) whichWeekOfMonth
|
||||
if(FLOOR((DAYOFMONTH(t.create_time) - 1) / 7) > 3, 3,
|
||||
FLOOR((DAYOFMONTH(t.create_time) - 1) / 7)) whichWeekOfMonth
|
||||
from xz_security_quality_inspection_record t
|
||||
WHERE t.project_sn = #{param.projectSn}
|
||||
and t.status != 6
|
||||
@ -544,7 +560,9 @@
|
||||
from quality_region qr
|
||||
left join xz_security_quality_inspection_record t on qr.id = t.region_id
|
||||
where 1 = 1
|
||||
and qr.project_sn = #{param.projectSn} and t.status !=6 and t.record_type = 1
|
||||
and qr.project_sn = #{param.projectSn}
|
||||
and t.status != 6
|
||||
and t.record_type = 1
|
||||
<if test="param.isNotQualified == '1'.toString()">
|
||||
and t.status != 5
|
||||
</if>
|
||||
@ -600,23 +618,13 @@
|
||||
</select>
|
||||
|
||||
<select id="countDangerLevel" resultType="com.zhgd.xmgl.base.entity.vo.SectorOneVo">
|
||||
select count(*) count, a.level as enumType
|
||||
from xz_security_quality_inspection_record a
|
||||
where project_sn = #{projectSn}
|
||||
and a.record_type = 1
|
||||
and a.status != 6
|
||||
<if test="isOverdueRectification == '1'.toString()">
|
||||
and (a.status = 2 AND now() > a.change_limit_time)
|
||||
</if>
|
||||
<if test="isNotQualified == '1'.toString()">
|
||||
and a.status != 5
|
||||
</if>
|
||||
<if test="inspectStartTime != null and inspectStartTime != ''">
|
||||
and a.inspect_time >= #{inspectStartTime}
|
||||
</if>
|
||||
<if test="inspectEndTime != null and inspectEndTime != ''">
|
||||
and a.inspect_time <= #{inspectEndTime}
|
||||
</if>
|
||||
select count(*) count, t.level as enumType
|
||||
from xz_security_quality_inspection_record t
|
||||
where project_sn = #{param.projectSn}
|
||||
and t.record_type = 1
|
||||
and t.status != 6
|
||||
<include refid="whereCondition">
|
||||
</include>
|
||||
group by enumType
|
||||
</select>
|
||||
|
||||
@ -687,7 +695,7 @@
|
||||
</select>
|
||||
|
||||
<select id="statsDangerType" resultType="com.zhgd.xmgl.base.entity.vo.SectorOneVo">
|
||||
select count(*) count, SUBSTRING_INDEX(t.danger_item_content,'/',1) as name
|
||||
select count(*) count, SUBSTRING_INDEX(t.danger_item_content, '/', 1) as name
|
||||
from xz_security_quality_inspection_record t
|
||||
where project_sn = #{param.projectSn}
|
||||
and t.record_type = 1
|
||||
|
||||
@ -23,14 +23,22 @@ import com.zhgd.xmgl.enums.ParamEnum;
|
||||
import com.zhgd.xmgl.modules.basicdata.entity.SystemUser;
|
||||
import com.zhgd.xmgl.modules.basicdata.mapper.SystemUserMapper;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.INoticeService;
|
||||
import com.zhgd.xmgl.modules.dangerous.entity.DangerousEngineeringRecord;
|
||||
import com.zhgd.xmgl.modules.dangerous.mapper.DangerousEngineeringRecordMapper;
|
||||
import com.zhgd.xmgl.modules.quality.entity.QualityRegion;
|
||||
import com.zhgd.xmgl.modules.quality.mapper.QualityRegionMapper;
|
||||
import com.zhgd.xmgl.modules.video.entity.AiAnalyseHardWareAlarmRecord;
|
||||
import com.zhgd.xmgl.modules.video.mapper.AiAnalyseHardWareAlarmRecordMapper;
|
||||
import com.zhgd.xmgl.modules.worker.entity.EnterpriseInfo;
|
||||
import com.zhgd.xmgl.modules.worker.entity.WorkerInfo;
|
||||
import com.zhgd.xmgl.modules.worker.entity.WorkerInfoAuditRecord;
|
||||
import com.zhgd.xmgl.modules.worker.mapper.EnterpriseInfoMapper;
|
||||
import com.zhgd.xmgl.modules.worker.mapper.WorkerInfoAuditRecordMapper;
|
||||
import com.zhgd.xmgl.modules.worker.mapper.WorkerInfoMapper;
|
||||
import com.zhgd.xmgl.modules.xz.entity.XzDeductScoreRecord;
|
||||
import com.zhgd.xmgl.modules.xz.entity.XzTaskProgressContent;
|
||||
import com.zhgd.xmgl.modules.xz.mapper.XzDeductScoreRecordMapper;
|
||||
import com.zhgd.xmgl.modules.xz.mapper.XzTaskProgressContentMapper;
|
||||
import com.zhgd.xmgl.modules.xz.security.entity.XzSecurityDangerItemRecord;
|
||||
import com.zhgd.xmgl.modules.xz.security.entity.XzSecurityQualityInspectionRecord;
|
||||
import com.zhgd.xmgl.modules.xz.security.entity.XzSecurityQualityRectifyRecord;
|
||||
@ -48,6 +56,7 @@ import com.zhgd.xmgl.util.PageUtil;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@ -56,6 +65,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Description: 安全检查记录
|
||||
@ -77,6 +87,14 @@ public class XzSecurityXzSecurityQualityInspectionRecordServiceImpl extends Serv
|
||||
@Autowired
|
||||
XzDeductScoreRecordMapper xzDeductScoreRecordMapper;
|
||||
@Autowired
|
||||
AiAnalyseHardWareAlarmRecordMapper aiAnalyseHardWareAlarmRecordMapper;
|
||||
@Autowired
|
||||
XzTaskProgressContentMapper xzTaskProgressContentMapper;
|
||||
@Autowired
|
||||
DangerousEngineeringRecordMapper dangerousEngineeringRecordMapper;
|
||||
@Autowired
|
||||
WorkerInfoAuditRecordMapper workerInfoAuditRecordMapper;
|
||||
@Autowired
|
||||
private QualityRegionMapper qualityRegionMapper;
|
||||
@Autowired
|
||||
private EnterpriseInfoMapper enterpriseInfoMapper;
|
||||
@ -272,16 +290,11 @@ public class XzSecurityXzSecurityQualityInspectionRecordServiceImpl extends Serv
|
||||
xzSecurityQualityInspectionRecord.setEnterpriseId(enterpriseInfo.getId());
|
||||
}
|
||||
xzSecurityQualityInspectionRecordMapper.insert(xzSecurityQualityInspectionRecord);
|
||||
noticeUser(xzSecurityQualityInspectionRecord);
|
||||
|
||||
deductScoreIf(xzSecurityQualityInspectionRecord);
|
||||
}
|
||||
|
||||
private void noticeUser(XzSecurityQualityInspectionRecord xzSecurityQualityInspectionRecord) {
|
||||
if (xzSecurityQualityInspectionRecord.getRecordType() == 1 && xzSecurityQualityInspectionRecord.getStatus() == 2) {
|
||||
noticeService.addUserNoticeAndApp(xzSecurityQualityInspectionRecord.getChangeId(), "您有一条安全检查待整改,问题:" + xzSecurityQualityInspectionRecord.getDangerItemContent(), "安全管理待整改", "10",
|
||||
PushPayloads.buildPushPayload(10, xzSecurityQualityInspectionRecord));
|
||||
}
|
||||
deductScoreIf(xzSecurityQualityInspectionRecord);
|
||||
}
|
||||
|
||||
private void deductScoreIf(XzSecurityQualityInspectionRecord hiddenDangerInspectRecord) {
|
||||
@ -509,10 +522,20 @@ public class XzSecurityXzSecurityQualityInspectionRecordServiceImpl extends Serv
|
||||
public List<XzSecurityQualityInspectionRecordTotalVo> selectQualityStatisticsNumList(Map<String, Object> map) {
|
||||
Integer isStatsByWeek = MapUtils.getInteger(map, "isStatsByWeek");
|
||||
List<XzSecurityQualityInspectionRecordTotalVo> vos = xzSecurityQualityInspectionRecordMapper.selectQualityInspectionRecordPageTotal(map, "");
|
||||
|
||||
Map<Integer, XzSecurityQualityInspectionRecordTotalVo> whichMap = vos.stream().collect(Collectors.toMap(XzSecurityQualityInspectionRecordTotalVo::getWhichWeekOfMonth, v -> v, (t, t2) -> t));
|
||||
if (Objects.equals(isStatsByWeek, 1)) {
|
||||
for (XzSecurityQualityInspectionRecordTotalVo vo : vos) {
|
||||
ArrayList<XzSecurityQualityInspectionRecordTotalVo> allList = new ArrayList<>();
|
||||
allList.add(getWeekCountInitial(0));
|
||||
allList.add(getWeekCountInitial(1));
|
||||
allList.add(getWeekCountInitial(2));
|
||||
allList.add(getWeekCountInitial(3));
|
||||
ArrayList<XzSecurityQualityInspectionRecordTotalVo> rtList = new ArrayList<>();
|
||||
for (XzSecurityQualityInspectionRecordTotalVo vo : allList) {
|
||||
Integer whichWeekOfMonth = vo.getWhichWeekOfMonth();
|
||||
XzSecurityQualityInspectionRecordTotalVo dataVo = whichMap.get(whichWeekOfMonth);
|
||||
if (dataVo != null) {
|
||||
vo = dataVo;
|
||||
}
|
||||
if (Objects.equals(whichWeekOfMonth, 0)) {
|
||||
String w1b = DateUtil.format(new Date(), "yyyy-MM-") + "01";
|
||||
String w1e = DateUtil.format(new Date(), "yyyy-MM-") + "07";
|
||||
@ -530,11 +553,27 @@ public class XzSecurityXzSecurityQualityInspectionRecordServiceImpl extends Serv
|
||||
String w1e = DateUtil.format(DateUtil.endOfMonth(new Date()), "yyyy-MM-dd");
|
||||
vo.setWeekBetweenStr(w1b + " - " + w1e);
|
||||
}
|
||||
rtList.add(vo);
|
||||
}
|
||||
vos = rtList;
|
||||
|
||||
}
|
||||
return vos;
|
||||
}
|
||||
|
||||
private XzSecurityQualityInspectionRecordTotalVo getWeekCountInitial(Integer whichWeekOfMonth) {
|
||||
XzSecurityQualityInspectionRecordTotalVo e = new XzSecurityQualityInspectionRecordTotalVo();
|
||||
e.setDangerNum(0);
|
||||
e.setLowRiskNum(0);
|
||||
e.setGeneralRiskNum(0);
|
||||
e.setLargerRiskNum(0);
|
||||
e.setGreatFaultLevelNum(0);
|
||||
e.setRectificationNum(0);
|
||||
e.setNotCloseNum(0);
|
||||
e.setWhichWeekOfMonth(whichWeekOfMonth);
|
||||
return e;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SectorVo countDangerLevel(Map<String, Object> paramMap) {
|
||||
ArrayList<SectorOneVo> list = baseMapper.countDangerLevel(paramMap);
|
||||
@ -561,19 +600,49 @@ public class XzSecurityXzSecurityQualityInspectionRecordServiceImpl extends Serv
|
||||
|
||||
@Override
|
||||
public StatsDirectorateBigscreenVo statsDirectorateBigScreen(Map<String, Object> paramMap) {
|
||||
|
||||
StatsDirectorateBigscreenVo statsDirectorateBigscreenVo = new StatsDirectorateBigscreenVo();
|
||||
return statsDirectorateBigscreenVo;
|
||||
StatsDirectorateBigscreenVo vo = new StatsDirectorateBigscreenVo();
|
||||
String projectSn = MapUtils.getString(paramMap, "projectSn");
|
||||
Integer dc = dangerousEngineeringRecordMapper.selectCount(new LambdaQueryWrapper<DangerousEngineeringRecord>()
|
||||
.eq(DangerousEngineeringRecord::getProjectSn, projectSn));
|
||||
vo.setDangerousEngineeringRecordNum(dc);
|
||||
Integer arc = workerInfoAuditRecordMapper.selectCount(new LambdaQueryWrapper<WorkerInfoAuditRecord>()
|
||||
.eq(WorkerInfoAuditRecord::getProjectSn, projectSn));
|
||||
vo.setWorkerInfoAuditRecordNum(arc);
|
||||
Integer cc = xzTaskProgressContentMapper.selectCount(new LambdaQueryWrapper<XzTaskProgressContent>()
|
||||
.eq(XzTaskProgressContent::getProjectSn, projectSn)
|
||||
.eq(XzTaskProgressContent::getAuditType, 2)
|
||||
.eq(XzTaskProgressContent::getHasDelayEvent, 1)
|
||||
);
|
||||
vo.setTaskProgressContentNum(cc);
|
||||
Integer rc = xzSecurityQualityInspectionRecordMapper.selectCount(new LambdaQueryWrapper<XzSecurityQualityInspectionRecord>()
|
||||
.ne(XzSecurityQualityInspectionRecord::getStatus, 6)
|
||||
.ne(XzSecurityQualityInspectionRecord::getRecordType, 2)
|
||||
.eq(XzSecurityQualityInspectionRecord::getProjectSn, projectSn)
|
||||
);
|
||||
vo.setSecurityQualityInspectionRecordNum(rc);
|
||||
Integer ac = aiAnalyseHardWareAlarmRecordMapper.selectCount(new LambdaQueryWrapper<AiAnalyseHardWareAlarmRecord>()
|
||||
.eq(AiAnalyseHardWareAlarmRecord::getProjectSn, projectSn));
|
||||
vo.setAiAnalyseHardWareAlarmRecordNum(ac);
|
||||
return vo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void supervise(Map<String, Object> paramMap) {
|
||||
Integer id = MapUtils.getInteger(paramMap, "id");
|
||||
XzSecurityQualityInspectionRecord record = baseMapper.selectById(id);
|
||||
if (record == null) {
|
||||
Long id = MapUtils.getLong(paramMap, "id");
|
||||
XzSecurityQualityInspectionRecord xzSecurityQualityInspectionRecord = baseMapper.selectById(id);
|
||||
if (xzSecurityQualityInspectionRecord == null) {
|
||||
throw new OpenAlertException("数据不存在");
|
||||
}
|
||||
noticeUser(record);
|
||||
if (Objects.equals(xzSecurityQualityInspectionRecord.getStatus(), 2)) {
|
||||
noticeService.addUserNoticeAndApp(xzSecurityQualityInspectionRecord.getChangeId(), "您有一条安全检查待整改,问题:" + xzSecurityQualityInspectionRecord.getDangerItemContent(), "安全管理待整改", "10",
|
||||
PushPayloads.buildPushPayload(10, xzSecurityQualityInspectionRecord));
|
||||
} else if (Objects.equals(xzSecurityQualityInspectionRecord.getStatus(), 3)) {
|
||||
noticeService.addUserNoticeAndApp(xzSecurityQualityInspectionRecord.getReviewId(), "您有一条安全检查的整改结果需要复查,请及时查看。", "安全管理整改结果待复查", "10",
|
||||
PushPayloads.buildPushPayload(10, xzSecurityQualityInspectionRecord));
|
||||
} else if (Objects.equals(xzSecurityQualityInspectionRecord.getStatus(), 4)) {
|
||||
noticeService.addUserNoticeAndApp(xzSecurityQualityInspectionRecord.getVerifyManId(), "您有一条安全检查的整改结果需要核验,请及时查看。", "安全管理整改结果核验通知", "10",
|
||||
PushPayloads.buildPushPayload(10, xzSecurityQualityInspectionRecord));
|
||||
}
|
||||
}
|
||||
|
||||
private void recoverScore(XzSecurityQualityInspectionRecord hiddenDangerInspectRecord) {
|
||||
|
||||
@ -74,41 +74,39 @@ public class XzSecurityXzSecurityQualityRectifyRecordServiceImpl extends Service
|
||||
xzSecurityQualityRectifyRecord.setCreateTime(sdf.format(new Date()));
|
||||
xzSecurityQualityRectifyRecordMapper.insert(xzSecurityQualityRectifyRecord);
|
||||
XzSecurityQualityInspectionRecord tempXzSecurityQualityInspectionRecord = xzSecurityQualityInspectionRecordMapper.selectById(xzSecurityQualityRectifyRecord.getQualityId());
|
||||
XzSecurityQualityInspectionRecord xzSecurityQualityInspectionRecord = new XzSecurityQualityInspectionRecord();
|
||||
xzSecurityQualityInspectionRecord.setId(xzSecurityQualityRectifyRecord.getQualityId());
|
||||
if (xzSecurityQualityRectifyRecord.getType() == 1) {
|
||||
//已整改时候需要复查
|
||||
if (xzSecurityQualityRectifyRecord.getStatus() == 2) {
|
||||
xzSecurityQualityInspectionRecord.setStatus(3);
|
||||
tempXzSecurityQualityInspectionRecord.setStatus(3);
|
||||
noticeService.addUserNoticeAndApp(tempXzSecurityQualityInspectionRecord.getReviewId(), "您有一条安全检查的整改结果需要复查,请及时查看。", "安全管理整改结果待复查", "10",
|
||||
PushPayloads.buildPushPayload(10, xzSecurityQualityInspectionRecord));
|
||||
PushPayloads.buildPushPayload(10, tempXzSecurityQualityInspectionRecord));
|
||||
} else {
|
||||
xzSecurityQualityInspectionRecord.setStatus(2);
|
||||
tempXzSecurityQualityInspectionRecord.setStatus(2);
|
||||
}
|
||||
} else if (xzSecurityQualityRectifyRecord.getType() == 2) {
|
||||
//复查合格时候需要核验
|
||||
if (xzSecurityQualityRectifyRecord.getStatus() == 2) {
|
||||
xzSecurityQualityInspectionRecord.setStatus(4);
|
||||
tempXzSecurityQualityInspectionRecord.setStatus(4);
|
||||
noticeService.addUserNoticeAndApp(tempXzSecurityQualityInspectionRecord.getVerifyManId(), "您有一条安全检查的整改结果需要核验,请及时查看。", "安全管理整改结果核验通知", "10",
|
||||
PushPayloads.buildPushPayload(10, xzSecurityQualityInspectionRecord));
|
||||
PushPayloads.buildPushPayload(10, tempXzSecurityQualityInspectionRecord));
|
||||
} else {
|
||||
xzSecurityQualityInspectionRecord.setStatus(2);
|
||||
tempXzSecurityQualityInspectionRecord.setStatus(2);
|
||||
noticeService.addUserNoticeAndApp(tempXzSecurityQualityInspectionRecord.getChangeId(), "您提交的安全检查的整改结果复查不通过,请及时重新整改。", "安全管理整改结果复查通知", "10",
|
||||
PushPayloads.buildPushPayload(10, xzSecurityQualityInspectionRecord));
|
||||
PushPayloads.buildPushPayload(10, tempXzSecurityQualityInspectionRecord));
|
||||
}
|
||||
} else {
|
||||
//核验合格时候则该记录合格
|
||||
if (xzSecurityQualityRectifyRecord.getStatus() == 2) {
|
||||
xzSecurityQualityInspectionRecord.setStatus(5);
|
||||
tempXzSecurityQualityInspectionRecord.setStatus(5);
|
||||
noticeService.addUserNoticeAndApp(tempXzSecurityQualityInspectionRecord.getChangeId(), "您提交的安全检查的整改结果已通过核验。", "安全管理整改结果核验通知", "10",
|
||||
PushPayloads.buildPushPayload(10, xzSecurityQualityInspectionRecord));
|
||||
PushPayloads.buildPushPayload(10, tempXzSecurityQualityInspectionRecord));
|
||||
} else {
|
||||
xzSecurityQualityInspectionRecord.setStatus(2);
|
||||
tempXzSecurityQualityInspectionRecord.setStatus(2);
|
||||
noticeService.addUserNoticeAndApp(tempXzSecurityQualityInspectionRecord.getChangeId(), "您提交的安全检查的整改结果核验不通过,请及时重新整改。", "安全管理整改结果核验通知", "10",
|
||||
PushPayloads.buildPushPayload(10, xzSecurityQualityInspectionRecord));
|
||||
PushPayloads.buildPushPayload(10, tempXzSecurityQualityInspectionRecord));
|
||||
}
|
||||
}
|
||||
xzSecurityQualityInspectionRecordMapper.updateById(xzSecurityQualityInspectionRecord);
|
||||
xzSecurityQualityInspectionRecordMapper.updateById(tempXzSecurityQualityInspectionRecord);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -25,6 +25,7 @@
|
||||
and c.upload_date <= concat(#{month},'-31 23:59:59')
|
||||
</if>
|
||||
and c.audit_type=2
|
||||
and c.has_delay_event=1
|
||||
group by c.delay_event_type
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user