接口改动

main
zhangyu 2023-02-21 14:39:54 +08:00
parent f53daf85c9
commit 518b4289fd
29 changed files with 207 additions and 148 deletions

View File

@ -15,7 +15,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.hbt.common.core.web.controller.BaseController;
import com.hbt.common.core.web.domain.AjaxResult;
import com.hbt.common.core.web.page.TableDataInfo;
/**
* Controller
@ -89,7 +88,7 @@ public class EnterpriseInformationController extends BaseController
/**
*
*/
@ApiOperation("在管企业分类统计")
@ApiOperation("首页在管企业分类统计")
@GetMapping("/enterpriseStatistics")
public String enterpriseStatistics()
{

View File

@ -13,7 +13,6 @@ import org.springframework.web.bind.annotation.RestController;
import com.hbt.safety.supervision.service.IEscalateHiddenDangerService;
import com.hbt.common.core.web.controller.BaseController;
import com.hbt.common.core.web.domain.AjaxResult;
import com.hbt.common.core.web.page.TableDataInfo;
/**
* Controller

View File

@ -22,7 +22,11 @@ public class HazardousChemicalsController {
@GetMapping("/getHazardousChemicals")
public R<Msds> getHazardousChemicals(@Param("name") String name) {
return remoteMsdsService.getInfo(name, SecurityConstants.INNER);
try {
return remoteMsdsService.getInfo(name, SecurityConstants.INNER);
} catch (RuntimeException e) {
return R.fail(null);
}
}
}

View File

@ -4,6 +4,8 @@ import java.util.List;
import com.alibaba.fastjson.JSONObject;
import com.hbt.safety.supervision.pojo.HazardousOperation;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
@ -19,6 +21,7 @@ import com.hbt.common.core.web.page.TableDataInfo;
*
* @author zhangyu
*/
@Api(tags = "危险作业相关")
@RestController
@RequestMapping("/operation")
public class HazardousOperationController extends BaseController {
@ -28,6 +31,7 @@ public class HazardousOperationController extends BaseController {
/**
*
*/
@ApiOperation("查询危险作业列表")
@GetMapping("/list")
public String list() {
List<HazardousOperation> list = hazardousOperationService.selectHazardousOperationList();
@ -38,6 +42,7 @@ public class HazardousOperationController extends BaseController {
/**
*
*/
@ApiOperation("获取危险作业详细信息")
@GetMapping(value = "/getInfo")
public String getInfo(int id) {
AjaxResult ajaxResult = success(hazardousOperationService.selectHazardousOperationById(id));
@ -74,6 +79,7 @@ public class HazardousOperationController extends BaseController {
/**
*
*/
@ApiOperation("首页危险作业统计")
@GetMapping(value = "/hazardousOperationStatistics")
public String hazardousOperationStatistics() {
return hazardousOperationService.hazardousOperationStatistics();
@ -82,6 +88,7 @@ public class HazardousOperationController extends BaseController {
/**
*
*/
@ApiOperation("危险作业页-危险作业(进行中/待开始/已完成)统计")
@GetMapping(value = "/hazardousOperationManagement")
public String hazardousOperationManagement() {
return hazardousOperationService.hazardousOperationManagement();
@ -90,9 +97,13 @@ public class HazardousOperationController extends BaseController {
/**
* /
*/
@ApiOperation("危险作业页-进行中/已备案作业数量变化趋势图")
@GetMapping(value = "/hazardousOperationVariationTendency")
public String hazardousOperationVariationTendency() {
return hazardousOperationService.hazardousOperationVariationTendency();
}
// todo 按危险作业等级统计
}

View File

@ -5,6 +5,8 @@ import java.util.List;
import com.alibaba.fastjson.JSONObject;
import com.hbt.safety.supervision.pojo.HiddenDanger;
import com.hbt.safety.supervision.service.IHiddenDangerService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
@ -19,6 +21,7 @@ import com.hbt.common.core.web.page.TableDataInfo;
*
* @author hbt
*/
@Api(tags = "隐患治理相关")
@RestController
@RequestMapping("/hiddenDanger")
public class HiddenDangerController extends BaseController
@ -29,6 +32,7 @@ public class HiddenDangerController extends BaseController
/**
*
*/
@ApiOperation("查询隐患列表")
@GetMapping("/list")
public String list()
{
@ -41,6 +45,7 @@ public class HiddenDangerController extends BaseController
/**
*
*/
@ApiOperation("获取隐患详细信息")
@GetMapping(value = "/getInfo")
public String getInfo(int id)
{
@ -81,6 +86,7 @@ public class HiddenDangerController extends BaseController
/**
*
*/
@ApiOperation("首页-隐患统计信息")
@GetMapping(value = "/hiddenDangerStatistics")
public String hiddenDangerStatistics()
{
@ -90,6 +96,7 @@ public class HiddenDangerController extends BaseController
/**
*
*/
@ApiOperation("隐患治理页-隐患治理状态列表统计信息")
@GetMapping(value = "/hiddenDangerManagement")
public String hiddenDangerManagement()
{
@ -99,6 +106,7 @@ public class HiddenDangerController extends BaseController
/**
*
*/
@ApiOperation("隐患治理页-隐患数量变化趋势折线图")
@GetMapping(value = "/hiddenDangerWeeklyStatistics")
public String hiddenDangerWeeklyStatistics()
{

View File

@ -4,6 +4,8 @@ import java.util.List;
import com.alibaba.fastjson.JSONObject;
import com.hbt.safety.supervision.pojo.LawEnforcementInspection;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
@ -19,6 +21,7 @@ import com.hbt.common.core.web.page.TableDataInfo;
*
* @author zhangyu
*/
@Api(tags = "执法巡查相关")
@RestController
@RequestMapping("/inspection")
public class LawEnforcementInspectionController extends BaseController
@ -29,6 +32,7 @@ public class LawEnforcementInspectionController extends BaseController
/**
*
*/
@ApiOperation("查询执法巡查列表")
@GetMapping("/list")
public String list()
{
@ -40,6 +44,7 @@ public class LawEnforcementInspectionController extends BaseController
/**
*
*/
@ApiOperation("获取执法巡查详细信息")
@GetMapping(value = "/getInfo")
public String getInfo(int id)
{
@ -80,6 +85,7 @@ public class LawEnforcementInspectionController extends BaseController
/**
*
*/
@ApiOperation("首页-按月统计巡查信息")
@GetMapping(value = "/monthStatistics")
public String monthStatistics()
{

View File

@ -5,6 +5,8 @@ import java.util.List;
import com.alibaba.fastjson.JSONObject;
import com.hbt.safety.supervision.pojo.MajorHazardSources;
import com.hbt.safety.supervision.service.IMajorHazardSourcesService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
@ -18,6 +20,7 @@ import com.hbt.common.core.web.domain.AjaxResult;
*
* @author zhangyu
*/
@Api(tags = "重大危险源相关")
@RestController
@RequestMapping("/sources")
public class MajorHazardSourcesController extends BaseController {
@ -27,6 +30,7 @@ public class MajorHazardSourcesController extends BaseController {
/**
*
*/
@ApiOperation("查询重大危险源列表")
@GetMapping("/list")
public String list() {
List<MajorHazardSources> list = majorHazardSourcesService.selectMajorHazardSourcesList();
@ -36,6 +40,7 @@ public class MajorHazardSourcesController extends BaseController {
/**
*
*/
@ApiOperation("获取重大危险源详细信息")
@GetMapping(value = "/getInfo")
public String getInfo(int id) {
MajorHazardSources majorHazardSources = majorHazardSourcesService.selectMajorHazardSourcesById(id);
@ -72,6 +77,7 @@ public class MajorHazardSourcesController extends BaseController {
/**
*
*/
@ApiOperation("首页重大危险源统计")
@GetMapping(value = "/majorHazardSourcesStatistics")
public String majorHazardSourcesStatistics() {
return majorHazardSourcesService.majorHazardSourcesStatistics();

View File

@ -12,7 +12,6 @@ import org.springframework.web.bind.annotation.RestController;
import com.hbt.safety.supervision.service.IPersonService;
import com.hbt.common.core.web.controller.BaseController;
import com.hbt.common.core.web.domain.AjaxResult;
import com.hbt.common.core.web.page.TableDataInfo;
/**
* Controller

View File

@ -12,7 +12,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.hbt.common.core.web.controller.BaseController;
import com.hbt.common.core.web.domain.AjaxResult;
import com.hbt.common.core.web.page.TableDataInfo;
/**
* Controller

View File

@ -4,6 +4,8 @@ import java.util.List;
import com.alibaba.fastjson.JSONObject;
import com.hbt.safety.supervision.pojo.Risk;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
@ -12,13 +14,13 @@ import org.springframework.web.bind.annotation.RestController;
import com.hbt.safety.supervision.service.IRiskService;
import com.hbt.common.core.web.controller.BaseController;
import com.hbt.common.core.web.domain.AjaxResult;
import com.hbt.common.core.web.page.TableDataInfo;
/**
* Controller
*
* @author
*/
@Api(tags = "风险管控相关")
@RestController
@RequestMapping("/risk")
public class RiskController extends BaseController
@ -29,6 +31,7 @@ public class RiskController extends BaseController
/**
*
*/
@ApiOperation("查询风险列表")
@GetMapping("/list")
public String list()
{
@ -39,6 +42,7 @@ public class RiskController extends BaseController
/**
*
*/
@ApiOperation("获取风险详细信息")
@GetMapping(value = "/getInfo")
public String getInfo(int id)
{
@ -80,6 +84,7 @@ public class RiskController extends BaseController
*
* @return
*/
@ApiOperation("首页风险统计")
@GetMapping("/riskStatistics")
public String riskStatistics() {
return riskService.riskStatistics();
@ -88,6 +93,7 @@ public class RiskController extends BaseController
/**
*
*/
@ApiOperation("风险管控页-风险管控各等级列表数据统计")
@GetMapping("/riskManagementAndControlStatistics")
public String riskManagementAndControlStatistics() {
return riskService.riskManagementAndControlStatistics();
@ -97,9 +103,11 @@ public class RiskController extends BaseController
*
*
*/
@ApiOperation("风险管控页-风险项数量变化趋势折线图")
@GetMapping("/weeklyQuantityStatistics")
public String weeklyQuantityStatistics() {
return riskService.weeklyQuantityStatistics();
}
// todo 风险项类型及数量统计
}

View File

@ -1,5 +1,6 @@
package com.hbt.safety.supervision.mapper;
import java.util.Date;
import java.util.List;
import com.hbt.safety.supervision.pojo.LawEnforcementInspection;
@ -23,8 +24,7 @@ public interface LawEnforcementInspectionMapper
/**
*
*
* @param lawEnforcementInspection
*
* @return
*/
List<LawEnforcementInspection> selectLawEnforcementInspectionList();
@ -61,5 +61,5 @@ public interface LawEnforcementInspectionMapper
*/
int deleteLawEnforcementInspectionByIds(int[] ids);
List<LawEnforcementInspectionVo> selectLawEnforcementInspections(int year);
List<LawEnforcementInspectionVo> selectLawEnforcementInspections(Date yearAgo);
}

View File

@ -1,14 +1,11 @@
package com.hbt.safety.supervision.pojo;
import com.hbt.common.core.annotation.Excel;
import com.hbt.common.core.web.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import javax.validation.constraints.NotBlank;
/**
* enterprise_information
*

View File

@ -4,6 +4,8 @@ import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.hbt.common.core.annotation.Excel;
import com.hbt.common.core.web.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* hazardous_operation
@ -11,51 +13,53 @@ import com.hbt.common.core.web.domain.BaseEntity;
* @author zhangyu
* @date 2023-02-14
*/
@ApiModel
public class HazardousOperation extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 危险作业id */
@ApiModelProperty(value = "危险作业id")
private int id;
/** 危险作业名称 */
@Excel(name = "危险作业名称")
@ApiModelProperty(value = "危险作业名称")
private String name;
/** 危险作业等级 */
@ApiModelProperty(value = "危险作业等级")
private String operationLevel;
/** 企业id */
@Excel(name = "企业id")
@ApiModelProperty(value = "企业id")
private Long enterpriseId;
/** 作业内容 */
@Excel(name = "作业内容")
@ApiModelProperty(value = "作业内容")
private String operationContent;
/** 作业经度 */
@Excel(name = "作业经度")
@ApiModelProperty(value = "作业经度")
private String operationLongitude;
/** 作业纬度 */
@Excel(name = "作业纬度")
@ApiModelProperty(value = "作业纬度")
private String operationLatitude;
/** 作业类型 1-断路 2-动土 3-受限空间 4-高处 5-吊装 6-动火 7-盲板抽堵 8-设备检维修 9-临时用电*/
@Excel(name = "作业类型")
@ApiModelProperty(value = "作业类型 1-断路 2-动土 3-受限空间 4-高处 5-吊装 6-动火 7-盲板抽堵 8-设备检维修 9-临时用电")
private int operationType;
/** 作业开始时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "作业开始时间", width = 30, dateFormat = "yyyy-MM-dd")
@ApiModelProperty(value = "作业开始时间")
private Date operationStart;
/** 作业结束时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "作业结束时间", width = 30, dateFormat = "yyyy-MM-dd")
@ApiModelProperty(value = "作业结束时间")
private Date operationEnd;
/** 作业地点 */
@ApiModelProperty(value = "作业地点")
private String operationSite;
public void setId(int id)

View File

@ -4,8 +4,8 @@ import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.hbt.common.core.annotation.Excel;
import com.hbt.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* hidden_danger
@ -13,72 +13,76 @@ import org.apache.commons.lang3.builder.ToStringStyle;
* @author hbt
* @date 2023-02-14
*/
@ApiModel
public class HiddenDanger extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键id */
@ApiModelProperty(value = "隐患治理id")
private int id;
/** 隐患名称 */
@Excel(name = "隐患名称")
@ApiModelProperty(value = "隐患名称")
private String name;
/** 隐患详情 */
@Excel(name = "隐患详情")
@ApiModelProperty(value = "隐患详情")
private String details;
/** 风险表id */
@Excel(name = "风险表id")
@ApiModelProperty(value = "风险表id")
private int riskId;
/** 风险名称 */
@ApiModelProperty(value = "风险名称")
private String riskName;
/** 上报日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "上报日期", width = 30, dateFormat = "yyyy-MM-dd")
@ApiModelProperty(value = "上报日期")
private Date submitDate;
/** 上报人id */
@Excel(name = "上报人id")
@ApiModelProperty(value = "上报人id")
private int submitPersonId;
@Excel(name = "上报企业id")
@ApiModelProperty(value = "上报企业id")
private int submitEnterpriseId;
/** 隐患整改措施 */
@Excel(name = "隐患整改措施")
@ApiModelProperty(value = "隐患整改措施")
private String reformMeasures;
/** 隐患状态 */
@Excel(name = "隐患状态")
@ApiModelProperty(value = "隐患状态")
private int reformStatus;
/** 超期状态 0-正常 1-超期 */
@Excel(name = "超期状态")
@ApiModelProperty(value = "超期状态")
private int exceedTimeLimitStatus;
/** 责任企业id */
@Excel(name = "责任企业id")
@ApiModelProperty(value = "责任企业id")
private int enterpriseId;
/** 责任企业 */
@ApiModelProperty(value = "责任企业")
private String enterprise;
/** 责任人id */
@Excel(name = "责任人id")
@ApiModelProperty(value = "责任人id")
private int personId;
/** 责任人 */
@ApiModelProperty(value = "责任人")
private String person;
/** 备注 */
@Excel(name = "备注")
@ApiModelProperty(value = "备注")
private String remarks;
/** 整改期限 */
@Excel(name = "整改期限")
@ApiModelProperty(value = "整改期限")
private String rectificationPeriod;
public void setId(int id)

View File

@ -4,40 +4,45 @@ import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.hbt.common.core.annotation.Excel;
import com.hbt.common.core.web.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* law_enforcement_inspection
*
* @author zhangyu
*/
@ApiModel
public class LawEnforcementInspection extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
@ApiModelProperty(value = "执法巡查id")
private int id;
/** 巡查日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "巡查日期", width = 30, dateFormat = "yyyy-MM-dd")
@ApiModelProperty(value = "巡查日期")
private Date inspectionDate;
/** 巡查人员 */
@Excel(name = "巡查人员")
@ApiModelProperty(value = "巡查人员")
private String person;
/** 巡查名称 */
@Excel(name = "巡查名称")
@ApiModelProperty(value = "巡查名称")
private String name;
/** 备注 */
@Excel(name = "备注")
@ApiModelProperty(value = "备注")
private String remarks;
/** 上报隐患id */
@ApiModelProperty(value = "上报隐患id")
private int hiddenDangerId;
/** 上报风险id */
@ApiModelProperty(value = "上报风险id")
private int riskId;
public void setId(int id)

View File

@ -2,9 +2,8 @@ package com.hbt.safety.supervision.pojo;
import com.hbt.common.core.annotation.Excel;
import com.hbt.common.core.web.domain.BaseEntity;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* major_hazard_sources
@ -12,74 +11,89 @@ import org.apache.commons.lang3.builder.ToStringStyle;
* @author zhangyu
* @date 2023-02-14
*/
@ApiModel
public class MajorHazardSources extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键id */
@ApiModelProperty(value = "重大危险源id")
private int id;
/** 主要负责人id */
@ApiModelProperty(value = "主要负责人id")
private int mainResponsiblePersonId;
/** 主要负责人 */
@ApiModelProperty(value = "主要负责人")
private String mainResponsiblePerson;
/** 技术负责人id */
@ApiModelProperty(value = "技术负责人id")
private int technologyResponsiblePersonId;
/** 技术负责人id */
/** 技术负责人 */
@ApiModelProperty(value = "技术负责人")
private String technologyResponsiblePerson;
/** 操作负责人id */
@ApiModelProperty(value = "操作负责人id")
private int operateResponsiblePersonId;
/** 操作负责人id */
/** 操作负责人 */
@ApiModelProperty(value = "操作负责人")
private String operateResponsiblePerson;
/** 危险源名称 */
@Excel(name = "危险源名称")
@ApiModelProperty(value = "危险源名称")
private String name;
/** 危险因素 */
@Excel(name = "危险因素")
@ApiModelProperty(value = "危险因素")
private String riskFactor;
/** 可能导致后果 */
@Excel(name = "可能导致后果")
@ApiModelProperty(value = "可能导致后果")
private String consequence;
/** 风险等级 */
@Excel(name = "风险等级")
@ApiModelProperty(value = "风险等级")
private Integer dangerLevel;
/** 管控措施 */
@Excel(name = "管控措施")
@ApiModelProperty(value = "管控措施")
private String controlMeasures;
/** 危险源统一编码 */
@Excel(name = "危险源统一编码")
@ApiModelProperty(value = "危险源统一编码")
private String unifiedCoding;
/** 单元类型 0-生产单元 1-存储单元*/
@ApiModelProperty(value = "单元类型 0-生产单元 1-存储单元")
private int unitType;
/** 当前存储量 */
@ApiModelProperty(value = "当前存储量")
private String memorySpace;
/** 经度 */
@ApiModelProperty(value = "经度")
private String longitude;
/** 纬度 */
@ApiModelProperty(value = "纬度")
private String latitude;
/** 责任公司id */
@ApiModelProperty(value = "责任公司id")
private int enterpriseId;
/** 责任公司 */
@ApiModelProperty(value = "责任公司")
private String enterprise;
/** 管理危化品名称 */
@ApiModelProperty(value = "管理危化品名称")
private String hazardousChemicalsName;
public int getId() {

View File

@ -1,10 +1,7 @@
package com.hbt.safety.supervision.pojo;
import com.hbt.common.core.annotation.Excel;
import com.hbt.common.core.web.domain.BaseEntity;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* person

View File

@ -4,8 +4,8 @@ import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.hbt.common.core.annotation.Excel;
import com.hbt.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* risk
@ -13,65 +13,69 @@ import org.apache.commons.lang3.builder.ToStringStyle;
* @author
* @date 2023-02-14
*/
@ApiModel
public class Risk extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
@ApiModelProperty(value = "风险管控id")
private int id;
/** 风险名称 */
@Excel(name = "风险名称")
@ApiModelProperty(value = "风险管控id")
private String name;
/** 风险概率 */
@Excel(name = "风险概率")
@ApiModelProperty(value = "风险概率")
private String riskProbability;
/** 风险因素 */
@Excel(name = "风险因素")
@ApiModelProperty(value = "风险因素")
private String riskFactor;
/** 影响后果 */
@Excel(name = "影响后果")
@ApiModelProperty(value = "影响后果")
private String affectConsequences;
/** 风险等级 */
@Excel(name = "风险等级")
@ApiModelProperty(value = "风险等级")
private int level;
/** 责任企业id */
@Excel(name = "企业id")
@ApiModelProperty(value = "责任企业id")
private int enterpriseId;
/** 责任企业 */
@ApiModelProperty(value = "责任企业")
private String enterprise;
/** 责任人id */
@Excel(name = "责任人id")
@ApiModelProperty(value = "责任人id")
private int responsiblePersonId;
/** 责任人id */
@Excel(name = "责任人")
@ApiModelProperty(value = "责任人")
private String responsiblePerson;
/** 风险管控措施 */
@Excel(name = "风险管控措施")
@ApiModelProperty(value = "风险管控措施")
private String riskControlMeasures;
/** 最后一次审查日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "最后一次审查日期", width = 30, dateFormat = "yyyy-MM-dd")
@ApiModelProperty(value = "最后一次审查日期")
private Date lastReviewDate;
/** 重大危险源id */
@Excel(name = "重大危险源id")
@ApiModelProperty(value = "重大危险源id")
private int majorHazardSourcesId;
/** 上报时间 */
@ApiModelProperty(value = "上报时间")
private Date submitDate;
/** 上报人id */
@ApiModelProperty(value = "上报人id")
private int submitPersonId;

View File

@ -1,57 +1,19 @@
package com.hbt.safety.supervision.pojo.vo;
import lombok.Data;
/**
*
*
*/
@Data
public class LawEnforcementInspectionStatics {
private Object month; // 月份
private String date; // 时间
private int inspectionCount; // 巡查次数
private int hiddenTroubleCount; // 发现隐患数
private int riskCount; // 发现风险数
public Object getMonth() {
return month;
}
public void setMonth(Object month) {
this.month = month;
}
public int getInspectionCount() {
return inspectionCount;
}
public void setInspectionCount(int inspectionCount) {
this.inspectionCount = inspectionCount;
}
public int getHiddenTroubleCount() {
return hiddenTroubleCount;
}
public void setHiddenTroubleCount(int hiddenTroubleCount) {
this.hiddenTroubleCount = hiddenTroubleCount;
}
public int getRiskCount() {
return riskCount;
}
public void setRiskCount(int riskCount) {
this.riskCount = riskCount;
}
@Override
public String toString() {
return "LawEnforcementInspectionStatics{" +
"month=" + month +
", inspectionCount=" + inspectionCount +
", hiddenTroubleCount=" + hiddenTroubleCount +
", riskCount=" + riskCount +
'}';
}
}

View File

@ -1,7 +1,5 @@
package com.hbt.safety.supervision.pojo.vo;
import lombok.Data;
/**
* vo
*/

View File

@ -22,8 +22,7 @@ public interface IHazardousOperationService
/**
*
*
* @param hazardousOperation
*
* @return
*/
List<HazardousOperation> selectHazardousOperationList();

View File

@ -22,8 +22,7 @@ public interface ILawEnforcementInspectionService
/**
*
*
* @param lawEnforcementInspection
*
* @return
*/
List<LawEnforcementInspection> selectLawEnforcementInspectionList();
@ -60,5 +59,8 @@ public interface ILawEnforcementInspectionService
*/
int deleteLawEnforcementInspectionById(int id);
/**
*
*/
String monthStatistics();
}

View File

@ -58,5 +58,8 @@ public interface IMajorHazardSourcesService
*/
int deleteMajorHazardSourcesById(int id);
/**
*
*/
String majorHazardSourcesStatistics();
}

View File

@ -42,8 +42,7 @@ public class HazardousOperationServiceImpl implements IHazardousOperationService
/**
*
*
* @param hazardousOperation
*
* @return
*/
@Override
@ -195,8 +194,11 @@ public class HazardousOperationServiceImpl implements IHazardousOperationService
*/
@Override
public String hazardousOperationVariationTendency() {
// 获取当前时间往前推一年的时间
Date yearAgo = YearWeeksUtil.getyearAgoDate();
// 获取当前时间及往前推一年的危险作业开始结束时间
List<Date> list = hazardousOperationMapper.hazardousOperationVariationTendency(yearAgo);

View File

@ -1,9 +1,6 @@
package com.hbt.safety.supervision.service.impl;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject;
@ -50,8 +47,7 @@ public class LawEnforcementInspectionServiceImpl implements ILawEnforcementInspe
/**
*
*
* @param lawEnforcementInspection
*
* @return
*/
@Override
@ -108,14 +104,17 @@ public class LawEnforcementInspectionServiceImpl implements ILawEnforcementInspe
return lawEnforcementInspectionMapper.deleteLawEnforcementInspectionById(id);
}
/**
*
*/
@Override
public String monthStatistics() {
List<LawEnforcementInspectionStatics> list = new ArrayList<>();
// 获取当前年份
int year = YearWeeksUtil.getCurrentYear();
// 查询当前时间往前推一年的时间
Date yearAgoDate = YearWeeksUtil.getyearAgoDate();
// 查询巡查列表
List<LawEnforcementInspectionVo> lawList = lawEnforcementInspectionMapper.selectLawEnforcementInspections(year);
List<LawEnforcementInspectionVo> lawList = lawEnforcementInspectionMapper.selectLawEnforcementInspections(yearAgoDate);
if (lawList == null) {
return null;
}
@ -125,16 +124,34 @@ public class LawEnforcementInspectionServiceImpl implements ILawEnforcementInspe
// 查询隐患表id
List<String> escalateHiddenDangerIds = escalateHiddenDangerMapper.getEscalateHiddenDangerIds();
// 查询风险表id
Calendar calendar = YearWeeksUtil.getyearAgoDateCalendar();
// 获取当前时间往前推一年的月份
int month = calendar.get(Calendar.MONTH) + 1;
int year = calendar.get(Calendar.YEAR);
List<String> escalateRiskIds = escalateRiskMapper.getEscalateRiskIds();
for (Object key : typeList.keySet()) {
for (int i = 0; i < YearWeeksUtil.MONTH; i++) {
LawEnforcementInspectionStatics law = new LawEnforcementInspectionStatics();
law.setMonth(key);
List<LawEnforcementInspectionVo> lawEnforcementInspections = typeList.get(key);
law.setInspectionCount(lawEnforcementInspections.size());
// 计算实际月分与i的关系
int realityMonth = month + i;
int realityYear = year;
if (realityMonth > 12) {
realityMonth = realityMonth - 12;
realityYear = realityYear + 1;
}
law.setDate(realityYear + "-" + realityMonth);
List<LawEnforcementInspectionVo> lawEnforcementInspections = typeList.get(realityMonth);
law.setInspectionCount(lawEnforcementInspections == null ? 0 : lawEnforcementInspections.size());
if (lawEnforcementInspections == null || lawEnforcementInspections.size() == 0) {
law.setHiddenTroubleCount(0);
law.setRiskCount(0);
list.add(law);
continue;
}
// 获取每月上报隐患数
if (escalateHiddenDangerIds == null) {
if (escalateHiddenDangerIds == null || escalateHiddenDangerIds.size() == 0) {
law.setHiddenTroubleCount(0);
} else {
int hiddenTroubleCount = (int) lawEnforcementInspections.stream()
@ -143,18 +160,15 @@ public class LawEnforcementInspectionServiceImpl implements ILawEnforcementInspe
}
// 获取每月上报风险数
if (escalateRiskIds == null) {
if (escalateRiskIds == null || escalateRiskIds.size() == 0) {
law.setRiskCount(0);
} else {
int riskCount = (int) lawEnforcementInspections.stream()
.filter( s -> escalateRiskIds.stream().anyMatch(f -> f.equals(s.getId()))).count();
law.setRiskCount(riskCount);
}
list.add(law);
}
return JSONObject.toJSONString(list);
}
}

View File

@ -5,9 +5,6 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.hbt.safety.supervision.pojo.vo.StatisticsVo;
import com.hbt.safety.supervision.service.IMajorHazardSourcesService;
@ -99,6 +96,9 @@ public class MajorHazardSourcesServiceImpl implements IMajorHazardSourcesService
return majorHazardSourcesMapper.deleteMajorHazardSourcesById(id);
}
/**
*
*/
public String majorHazardSourcesStatistics() {
Map<String, Object> map = new HashMap<>();

View File

@ -11,6 +11,10 @@ import java.util.*;
*/
public class YearWeeksUtil {
/**
* 12*/
public static final int MONTH = 12;
/**
*
*
@ -70,6 +74,17 @@ public class YearWeeksUtil {
return calendar.getTime();
}
/**
*
*
* @return
*/
public static Calendar getyearAgoDateCalendar () {
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.YEAR, -1);
return calendar;
}
/**
*
*

View File

@ -71,6 +71,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<select id="selectLawEnforcementInspections" resultType="com.hbt.safety.supervision.pojo.vo.LawEnforcementInspectionVo">
select id,MONTH(inspection_date) inspectionDate from law_enforcement_inspection where YEAR(inspection_date) = #{year}
select id,MONTH(inspection_date) inspectionDate from law_enforcement_inspection where DATE_FORMAT(inspection_date,'%Y-%m') >= DATE_FORMAT(#{yearAgo},'%Y-%m') and DATE_FORMAT(inspection_date,'%Y-%m') &lt; DATE_FORMAT(NOW(),'%Y-%m')
</select>
</mapper>

View File

@ -28,7 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectMajorHazardSourcesVo">
select name, danger_level, unified_coding, memory_space, longitude, latitude from major_hazard_sources
select id, name, danger_level, unified_coding, memory_space, longitude, latitude from major_hazard_sources
</sql>
<select id="selectMajorHazardSourcesList" parameterType="com.hbt.safety.supervision.pojo.MajorHazardSources" resultMap="MajorHazardSourcesResult">