统计接口代码提交

main
zhangyu 2023-02-17 13:21:35 +08:00
parent f44b0f0b22
commit 49f9ec766f
42 changed files with 650 additions and 152 deletions

View File

@ -7,11 +7,9 @@ import com.hbt.safety.supervision.pojo.EnterpriseInfomation;
import com.hbt.safety.supervision.service.IEnterpriseInfomationService; import com.hbt.safety.supervision.service.IEnterpriseInfomationService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.hbt.common.security.annotation.RequiresPermissions;
import com.hbt.common.core.web.controller.BaseController; import com.hbt.common.core.web.controller.BaseController;
import com.hbt.common.core.web.domain.AjaxResult; import com.hbt.common.core.web.domain.AjaxResult;
import com.hbt.common.core.web.page.TableDataInfo; import com.hbt.common.core.web.page.TableDataInfo;
@ -20,7 +18,6 @@ import com.hbt.common.core.web.page.TableDataInfo;
* Controller * Controller
* *
* @author zhangyu * @author zhangyu
* @date 2023-02-14
*/ */
@RestController @RestController
@RequestMapping("/infomation") @RequestMapping("/infomation")
@ -44,9 +41,8 @@ public class EnterpriseInfomationController extends BaseController
/** /**
* *
*/ */
@RequiresPermissions("ep:infomation:query") @GetMapping(value = "/getInfo")
@GetMapping(value = "/{id}") public String getInfo(int id)
public String getInfo(@PathVariable("id") int id)
{ {
AjaxResult ajaxResult = success(enterpriseInfomationService.selectEnterpriseInfomationById(id)); AjaxResult ajaxResult = success(enterpriseInfomationService.selectEnterpriseInfomationById(id));
return JSONObject.toJSONString(ajaxResult); return JSONObject.toJSONString(ajaxResult);
@ -76,7 +72,7 @@ public class EnterpriseInfomationController extends BaseController
* *
*/ */
@GetMapping("/remove") @GetMapping("/remove")
public String remove(@PathVariable int[] ids) public String remove(int[] ids)
{ {
AjaxResult ajaxResult = toAjax(enterpriseInfomationService.deleteEnterpriseInfomationByIds(ids)); AjaxResult ajaxResult = toAjax(enterpriseInfomationService.deleteEnterpriseInfomationByIds(ids));
return JSONObject.toJSONString(ajaxResult); return JSONObject.toJSONString(ajaxResult);

View File

@ -6,7 +6,6 @@ import com.alibaba.fastjson.JSONObject;
import com.hbt.safety.supervision.pojo.EscalateHiddenDanger; import com.hbt.safety.supervision.pojo.EscalateHiddenDanger;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@ -19,7 +18,6 @@ import com.hbt.common.core.web.page.TableDataInfo;
* Controller * Controller
* *
* @author * @author
* @date 2023-02-14
*/ */
@RestController @RestController
@RequestMapping("/danger") @RequestMapping("/danger")
@ -43,8 +41,8 @@ public class EscalateHiddenDangerController extends BaseController
/** /**
* *
*/ */
@GetMapping(value = "/{id}") @GetMapping(value = "/getInfo")
public String getInfo(@PathVariable("id") int id) public String getInfo(int id)
{ {
AjaxResult ajaxResult = success(escalateHiddenDangerService.selectEscalateHiddenDangerById(id)); AjaxResult ajaxResult = success(escalateHiddenDangerService.selectEscalateHiddenDangerById(id));
return JSONObject.toJSONString(ajaxResult); return JSONObject.toJSONString(ajaxResult);
@ -74,7 +72,7 @@ public class EscalateHiddenDangerController extends BaseController
* *
*/ */
@GetMapping(value = "/remove") @GetMapping(value = "/remove")
public String remove(@PathVariable int[] ids) public String remove(int[] ids)
{ {
AjaxResult ajaxResult = toAjax(escalateHiddenDangerService.deleteEscalateHiddenDangerByIds(ids)); AjaxResult ajaxResult = toAjax(escalateHiddenDangerService.deleteEscalateHiddenDangerByIds(ids));
return JSONObject.toJSONString(ajaxResult); return JSONObject.toJSONString(ajaxResult);

View File

@ -6,7 +6,6 @@ import com.alibaba.fastjson.JSONObject;
import com.hbt.safety.supervision.pojo.EscalateRisk; import com.hbt.safety.supervision.pojo.EscalateRisk;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@ -19,7 +18,6 @@ import com.hbt.common.core.web.page.TableDataInfo;
* Controller * Controller
* *
* @author * @author
* @date 2023-02-14
*/ */
@RestController @RestController
@RequestMapping("/escalateRisk") @RequestMapping("/escalateRisk")
@ -32,10 +30,9 @@ public class EscalateRiskController extends BaseController
* *
*/ */
@GetMapping("/list") @GetMapping("/list")
public String list(EscalateRisk escalateRisk) public String list()
{ {
startPage(); List<EscalateRisk> list = escalateRiskService.selectEscalateRiskList();
List<EscalateRisk> list = escalateRiskService.selectEscalateRiskList(escalateRisk);
TableDataInfo tableDataInfo = getDataTable(list); TableDataInfo tableDataInfo = getDataTable(list);
return JSONObject.toJSONString(tableDataInfo); return JSONObject.toJSONString(tableDataInfo);
} }
@ -43,8 +40,8 @@ public class EscalateRiskController extends BaseController
/** /**
* *
*/ */
@GetMapping(value = "/{id}") @GetMapping(value = "/getInfo")
public String getInfo(@PathVariable("id") int id) public String getInfo(int id)
{ {
AjaxResult ajaxResult = success(escalateRiskService.selectEscalateRiskById(id)); AjaxResult ajaxResult = success(escalateRiskService.selectEscalateRiskById(id));
return JSONObject.toJSONString(ajaxResult); return JSONObject.toJSONString(ajaxResult);
@ -74,7 +71,7 @@ public class EscalateRiskController extends BaseController
* *
*/ */
@GetMapping(value = "/remove") @GetMapping(value = "/remove")
public String remove(@PathVariable int[] ids) public String remove(int[] ids)
{ {
AjaxResult ajaxResult = toAjax(escalateRiskService.deleteEscalateRiskByIds(ids)); AjaxResult ajaxResult = toAjax(escalateRiskService.deleteEscalateRiskByIds(ids));
return JSONObject.toJSONString(ajaxResult); return JSONObject.toJSONString(ajaxResult);

View File

@ -6,7 +6,6 @@ import com.alibaba.fastjson.JSONObject;
import com.hbt.safety.supervision.pojo.HazardousOperation; import com.hbt.safety.supervision.pojo.HazardousOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@ -19,7 +18,6 @@ import com.hbt.common.core.web.page.TableDataInfo;
* Controller * Controller
* *
* @author zhangyu * @author zhangyu
* @date 2023-02-14
*/ */
@RestController @RestController
@RequestMapping("/operation") @RequestMapping("/operation")
@ -32,10 +30,9 @@ public class HazardousOperationController extends BaseController
* *
*/ */
@GetMapping("/list") @GetMapping("/list")
public String list(HazardousOperation hazardousOperation) public String list()
{ {
startPage(); List<HazardousOperation> list = hazardousOperationService.selectHazardousOperationList();
List<HazardousOperation> list = hazardousOperationService.selectHazardousOperationList(hazardousOperation);
TableDataInfo tableDataInfo = getDataTable(list); TableDataInfo tableDataInfo = getDataTable(list);
return JSONObject.toJSONString(tableDataInfo); return JSONObject.toJSONString(tableDataInfo);
} }
@ -43,8 +40,8 @@ public class HazardousOperationController extends BaseController
/** /**
* *
*/ */
@GetMapping(value = "/{id}") @GetMapping(value = "/getInfo")
public String getInfo(@PathVariable("id") int id) public String getInfo(int id)
{ {
AjaxResult ajaxResult = success(hazardousOperationService.selectHazardousOperationById(id)); AjaxResult ajaxResult = success(hazardousOperationService.selectHazardousOperationById(id));
return JSONObject.toJSONString(ajaxResult); return JSONObject.toJSONString(ajaxResult);
@ -74,7 +71,7 @@ public class HazardousOperationController extends BaseController
* *
*/ */
@GetMapping(value = "/remove") @GetMapping(value = "/remove")
public String remove(@PathVariable int[] ids) public String remove(int[] ids)
{ {
AjaxResult ajaxResult = toAjax(hazardousOperationService.deleteHazardousOperationByIds(ids)); AjaxResult ajaxResult = toAjax(hazardousOperationService.deleteHazardousOperationByIds(ids));
return JSONObject.toJSONString(ajaxResult); return JSONObject.toJSONString(ajaxResult);
@ -88,4 +85,13 @@ public class HazardousOperationController extends BaseController
{ {
return hazardousOperationService.hazardousOperationStatistics(); return hazardousOperationService.hazardousOperationStatistics();
} }
/**
*
*/
@GetMapping(value = "/hazardousOperationManagement")
public String hazardousOperationManagement()
{
return hazardousOperationService.hazardousOperationManagement();
}
} }

View File

@ -7,7 +7,6 @@ import com.hbt.safety.supervision.pojo.HiddenDanger;
import com.hbt.safety.supervision.service.IHiddenDangerService; import com.hbt.safety.supervision.service.IHiddenDangerService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@ -19,7 +18,6 @@ import com.hbt.common.core.web.page.TableDataInfo;
* Controller * Controller
* *
* @author hbt * @author hbt
* @date 2023-02-14
*/ */
@RestController @RestController
@RequestMapping("/hiddenDanger") @RequestMapping("/hiddenDanger")
@ -43,8 +41,8 @@ public class HiddenDangerController extends BaseController
/** /**
* *
*/ */
@GetMapping(value = "/{id}") @GetMapping(value = "/getInfo")
public String getInfo(@PathVariable("id") int id) public String getInfo(int id)
{ {
AjaxResult ajaxResult = success(hiddenDangerService.selectHiddenDangerById(id)); AjaxResult ajaxResult = success(hiddenDangerService.selectHiddenDangerById(id));
return JSONObject.toJSONString(ajaxResult); return JSONObject.toJSONString(ajaxResult);
@ -74,7 +72,7 @@ public class HiddenDangerController extends BaseController
* *
*/ */
@GetMapping(value = "/remove") @GetMapping(value = "/remove")
public String remove(@PathVariable int[] ids) public String remove(int[] ids)
{ {
AjaxResult ajaxResult = toAjax(hiddenDangerService.deleteHiddenDangerByIds(ids)); AjaxResult ajaxResult = toAjax(hiddenDangerService.deleteHiddenDangerByIds(ids));
return JSONObject.toJSONString(ajaxResult); return JSONObject.toJSONString(ajaxResult);
@ -88,4 +86,22 @@ public class HiddenDangerController extends BaseController
{ {
return hiddenDangerService.hiddenDangerStatistics(); return hiddenDangerService.hiddenDangerStatistics();
} }
/**
*
*/
@GetMapping(value = "/hiddenDangerManagement")
public String hiddenDangerManagement()
{
return hiddenDangerService.hiddenDangerManagement();
}
/**
*
*/
@GetMapping(value = "/hiddenDangerWeeklyStatistics")
public String hiddenDangerWeeklyStatistics()
{
return hiddenDangerService.hiddenDangerWeeklyStatistics();
}
} }

View File

@ -6,7 +6,6 @@ import com.alibaba.fastjson.JSONObject;
import com.hbt.safety.supervision.pojo.LawEnforcementInspection; import com.hbt.safety.supervision.pojo.LawEnforcementInspection;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@ -19,7 +18,6 @@ import com.hbt.common.core.web.page.TableDataInfo;
* Controller * Controller
* *
* @author zhangyu * @author zhangyu
* @date 2023-02-14
*/ */
@RestController @RestController
@RequestMapping("/inspection") @RequestMapping("/inspection")
@ -32,10 +30,9 @@ public class LawEnforcementInspectionController extends BaseController
* *
*/ */
@GetMapping("/list") @GetMapping("/list")
public String list(LawEnforcementInspection lawEnforcementInspection) public String list()
{ {
startPage(); List<LawEnforcementInspection> list = lawEnforcementInspectionService.selectLawEnforcementInspectionList();
List<LawEnforcementInspection> list = lawEnforcementInspectionService.selectLawEnforcementInspectionList(lawEnforcementInspection);
TableDataInfo tableDataInfo = getDataTable(list); TableDataInfo tableDataInfo = getDataTable(list);
return JSONObject.toJSONString(tableDataInfo); return JSONObject.toJSONString(tableDataInfo);
} }
@ -43,8 +40,8 @@ public class LawEnforcementInspectionController extends BaseController
/** /**
* *
*/ */
@GetMapping(value = "/{id}") @GetMapping(value = "/getInfo")
public String getInfo(@PathVariable("id") int id) public String getInfo(int id)
{ {
AjaxResult ajaxResult = success(lawEnforcementInspectionService.selectLawEnforcementInspectionById(id)); AjaxResult ajaxResult = success(lawEnforcementInspectionService.selectLawEnforcementInspectionById(id));
return JSONObject.toJSONString(ajaxResult); return JSONObject.toJSONString(ajaxResult);
@ -74,7 +71,7 @@ public class LawEnforcementInspectionController extends BaseController
* *
*/ */
@GetMapping(value = "/remove") @GetMapping(value = "/remove")
public String remove(@PathVariable int[] ids) public String remove(int[] ids)
{ {
AjaxResult ajaxResult = toAjax(lawEnforcementInspectionService.deleteLawEnforcementInspectionByIds(ids)); AjaxResult ajaxResult = toAjax(lawEnforcementInspectionService.deleteLawEnforcementInspectionByIds(ids));
return JSONObject.toJSONString(ajaxResult); return JSONObject.toJSONString(ajaxResult);

View File

@ -7,7 +7,6 @@ import com.hbt.safety.supervision.pojo.MajorHazardSources;
import com.hbt.safety.supervision.service.IMajorHazardSourcesService; import com.hbt.safety.supervision.service.IMajorHazardSourcesService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@ -18,7 +17,6 @@ import com.hbt.common.core.web.domain.AjaxResult;
* Controller * Controller
* *
* @author zhangyu * @author zhangyu
* @date 2023-02-14
*/ */
@RestController @RestController
@RequestMapping("/sources") @RequestMapping("/sources")
@ -40,8 +38,8 @@ public class MajorHazardSourcesController extends BaseController
/** /**
* *
*/ */
@GetMapping(value = "/{id}") @GetMapping(value = "/getInfo")
public String getInfo(@PathVariable("id") int id) public String getInfo(int id)
{ {
MajorHazardSources majorHazardSources = majorHazardSourcesService.selectMajorHazardSourcesById(id); MajorHazardSources majorHazardSources = majorHazardSourcesService.selectMajorHazardSourcesById(id);
return JSONObject.toJSONString(majorHazardSources); return JSONObject.toJSONString(majorHazardSources);
@ -71,7 +69,7 @@ public class MajorHazardSourcesController extends BaseController
* *
*/ */
@GetMapping(value = "/remove") @GetMapping(value = "/remove")
public String remove(@PathVariable int[] ids) public String remove(int[] ids)
{ {
AjaxResult ajaxResult = toAjax(majorHazardSourcesService.deleteMajorHazardSourcesByIds(ids)); AjaxResult ajaxResult = toAjax(majorHazardSourcesService.deleteMajorHazardSourcesByIds(ids));
return JSONObject.toJSONString(ajaxResult); return JSONObject.toJSONString(ajaxResult);

View File

@ -6,7 +6,6 @@ import com.alibaba.fastjson.JSONObject;
import com.hbt.safety.supervision.pojo.Persion; import com.hbt.safety.supervision.pojo.Persion;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@ -19,7 +18,6 @@ import com.hbt.common.core.web.page.TableDataInfo;
* Controller * Controller
* *
* @author * @author
* @date 2023-02-14
*/ */
@RestController @RestController
@RequestMapping("/persion") @RequestMapping("/persion")
@ -43,8 +41,8 @@ public class PersionController extends BaseController
/** /**
* *
*/ */
@GetMapping(value = "/{id}") @GetMapping(value = "/getInfo")
public String getInfo(@PathVariable("id") int id) public String getInfo(int id)
{ {
Persion persion = persionService.selectPersionById(id); Persion persion = persionService.selectPersionById(id);
return JSONObject.toJSONString(persion); return JSONObject.toJSONString(persion);
@ -74,7 +72,7 @@ public class PersionController extends BaseController
* *
*/ */
@GetMapping(value = "/remove") @GetMapping(value = "/remove")
public String remove(@PathVariable int[] ids) public String remove(int[] ids)
{ {
AjaxResult ajaxResult = toAjax(persionService.deletePersionByIds(ids)); AjaxResult ajaxResult = toAjax(persionService.deletePersionByIds(ids));
return JSONObject.toJSONString(ajaxResult); return JSONObject.toJSONString(ajaxResult);

View File

@ -7,7 +7,6 @@ import com.hbt.safety.supervision.pojo.RiskArea;
import com.hbt.safety.supervision.service.IRiskAreaService; import com.hbt.safety.supervision.service.IRiskAreaService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@ -19,7 +18,6 @@ import com.hbt.common.core.web.page.TableDataInfo;
* Controller * Controller
* *
* @author * @author
* @date 2023-02-14
*/ */
@RestController @RestController
@RequestMapping("/area") @RequestMapping("/area")
@ -44,8 +42,8 @@ public class RiskAreaController extends BaseController
/** /**
* *
*/ */
@GetMapping(value = "/{id}") @GetMapping(value = "/getInfo")
public String getInfo(@PathVariable("id") int id) public String getInfo(int id)
{ {
AjaxResult ajaxResult = success(riskAreaService.selectRiskAreaById(id)); AjaxResult ajaxResult = success(riskAreaService.selectRiskAreaById(id));
return JSONObject.toJSONString(ajaxResult); return JSONObject.toJSONString(ajaxResult);
@ -75,7 +73,7 @@ public class RiskAreaController extends BaseController
* *
*/ */
@GetMapping(value = "/remove") @GetMapping(value = "/remove")
public String remove(@PathVariable int[] ids) public String remove(int[] ids)
{ {
AjaxResult ajaxResult = toAjax(riskAreaService.deleteRiskAreaByIds(ids)); AjaxResult ajaxResult = toAjax(riskAreaService.deleteRiskAreaByIds(ids));
return JSONObject.toJSONString(ajaxResult); return JSONObject.toJSONString(ajaxResult);

View File

@ -6,7 +6,6 @@ import com.alibaba.fastjson.JSONObject;
import com.hbt.safety.supervision.pojo.Risk; import com.hbt.safety.supervision.pojo.Risk;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@ -19,7 +18,6 @@ import com.hbt.common.core.web.page.TableDataInfo;
* Controller * Controller
* *
* @author * @author
* @date 2023-02-14
*/ */
@RestController @RestController
@RequestMapping("/risk") @RequestMapping("/risk")
@ -43,8 +41,8 @@ public class RiskController extends BaseController
/** /**
* *
*/ */
@GetMapping(value = "/{id}") @GetMapping(value = "/getInfo")
public String getInfo(@PathVariable("id") int id) public String getInfo(int id)
{ {
AjaxResult ajaxResult = success(riskService.selectRiskById(id)); AjaxResult ajaxResult = success(riskService.selectRiskById(id));
return JSONObject.toJSONString(ajaxResult); return JSONObject.toJSONString(ajaxResult);
@ -73,8 +71,8 @@ public class RiskController extends BaseController
/** /**
* *
*/ */
@GetMapping("/{ids}") @GetMapping("/remove")
public String remove(@PathVariable int[] ids) public String remove(int[] ids)
{ {
AjaxResult ajaxResult = toAjax(riskService.deleteRiskByIds(ids)); AjaxResult ajaxResult = toAjax(riskService.deleteRiskByIds(ids));
return JSONObject.toJSONString(ajaxResult); return JSONObject.toJSONString(ajaxResult);
@ -82,10 +80,27 @@ public class RiskController extends BaseController
/** /**
* *
* @return * @return
*/ */
@GetMapping("/riskStatistics") @GetMapping("/riskStatistics")
public String riskStatistics() { public String riskStatistics() {
return riskService.riskStatistics(); return riskService.riskStatistics();
} }
/**
*
*/
@GetMapping("/riskManagementAndControlStatistics")
public String riskManagementAndControlStatistics() {
return riskService.riskManagementAndControlStatistics();
}
/**
*
*/
@GetMapping("/weeklyQuantityStatistics")
public String weeklyQuantityStatistics() {
return riskService.weeklyQuantityStatistics();
}
} }

View File

@ -9,7 +9,6 @@ import com.hbt.safety.supervision.pojo.EnterpriseInfomation;
* Mapper * Mapper
* *
* @author zhangyu * @author zhangyu
* @date 2023-02-14
*/ */
public interface EnterpriseInfomationMapper public interface EnterpriseInfomationMapper
{ {
@ -68,9 +67,24 @@ public interface EnterpriseInfomationMapper
*/ */
List<EnterpriseInfomation> selectEnterpriseInfomations(); List<EnterpriseInfomation> selectEnterpriseInfomations();
/**
*
*
* @return
*/
List<Map<Object, Object>> enterpriseStatistics(); List<Map<Object, Object>> enterpriseStatistics();
/**
*
*
* @return
*/
int getEnterpriseCount(); int getEnterpriseCount();
/**
*
*
* @return
*/
int getCarCount(); int getCarCount();
} }

View File

@ -3,6 +3,7 @@ package com.hbt.safety.supervision.mapper;
import java.util.List; import java.util.List;
import com.hbt.safety.supervision.pojo.EscalateHiddenDanger; import com.hbt.safety.supervision.pojo.EscalateHiddenDanger;
import com.hbt.safety.supervision.pojo.HiddenDanger;
/** /**
* Mapper * Mapper
@ -18,7 +19,7 @@ public interface EscalateHiddenDangerMapper
* @param id * @param id
* @return * @return
*/ */
EscalateHiddenDanger selectEscalateHiddenDangerById(int id); HiddenDanger selectEscalateHiddenDangerById(int id);
/** /**
* *
@ -60,7 +61,10 @@ public interface EscalateHiddenDangerMapper
*/ */
int deleteEscalateHiddenDangerByIds(int[] ids); int deleteEscalateHiddenDangerByIds(int[] ids);
int getTotalEscalateHiddenDanger(); /**
* id
*
* @return id
*/
List<String> getEscalateHiddenDangerIds(); List<String> getEscalateHiddenDangerIds();
} }

View File

@ -21,11 +21,10 @@ public interface EscalateRiskMapper
/** /**
* *
* *
* @param escalateRisk
* @return * @return
*/ */
List<EscalateRisk> selectEscalateRiskList(EscalateRisk escalateRisk); List<EscalateRisk> selectEscalateRiskList();
/** /**
* *
@ -59,5 +58,9 @@ public interface EscalateRiskMapper
*/ */
int deleteEscalateRiskByIds(int[] ids); int deleteEscalateRiskByIds(int[] ids);
/**
* id
* @return id
*/
List<String> getEscalateRiskIds(); List<String> getEscalateRiskIds();
} }

View File

@ -22,11 +22,10 @@ public interface HazardousOperationMapper
/** /**
* *
* *
* @param hazardousOperation
* @return * @return
*/ */
List<HazardousOperation> selectHazardousOperationList(HazardousOperation hazardousOperation); List<HazardousOperation> selectHazardousOperationList();
/** /**
* *
@ -64,6 +63,12 @@ public interface HazardousOperationMapper
* *
* @return * @return
*/ */
List<HazardousOperation> selectHazardousOperations(); List<HazardousOperation> selectHazardousOperations();
/**
*
*
* @return
*/
List<HazardousOperation> hazardousOperationManagement();
} }

View File

@ -60,5 +60,16 @@ public interface HiddenDangerMapper
*/ */
int deleteHiddenDangerByIds(int[] ids); int deleteHiddenDangerByIds(int[] ids);
/**
*
*/
List<HiddenDanger> selectHiddenDangers(); List<HiddenDanger> selectHiddenDangers();
/**
*
*
* @param year
* @return
*/
List<Integer> selectHiddenDangerSubmitDats(int year);
} }

View File

@ -27,7 +27,7 @@ public interface LawEnforcementInspectionMapper
* @param lawEnforcementInspection * @param lawEnforcementInspection
* @return * @return
*/ */
List<LawEnforcementInspection> selectLawEnforcementInspectionList(LawEnforcementInspection lawEnforcementInspection); List<LawEnforcementInspection> selectLawEnforcementInspectionList();
/** /**
* *

View File

@ -1,5 +1,6 @@
package com.hbt.safety.supervision.mapper; package com.hbt.safety.supervision.mapper;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -63,7 +64,26 @@ public interface RiskMapper
*/ */
int deleteRiskByIds(int[] ids); int deleteRiskByIds(int[] ids);
/**
*
*
* @return
*/
List<Map<Object, Object>> riskStatistics(); List<Map<Object, Object>> riskStatistics();
/**
*
*
* @return
*/
List<Risk> selectRisks();
/**
*
*
* @param year
* @return
*/
List<Integer> selectRiskSubmitDats(int year);
} }

View File

@ -57,6 +57,9 @@ public class HazardousOperation extends BaseEntity
@Excel(name = "作业结束时间", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "作业结束时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date operationEnd; private Date operationEnd;
/** 作业地点 */
private String operationSite;
public void setId(int id) public void setId(int id)
{ {
this.id = id; this.id = id;
@ -147,6 +150,14 @@ public class HazardousOperation extends BaseEntity
this.operationLevel = operationLevel; this.operationLevel = operationLevel;
} }
public String getOperationSite() {
return operationSite;
}
public void setOperationSite(String operationSite) {
this.operationSite = operationSite;
}
@Override @Override
public String toString() { public String toString() {
return "HazardousOperation{" + return "HazardousOperation{" +
@ -160,6 +171,7 @@ public class HazardousOperation extends BaseEntity
", operationType=" + operationType + ", operationType=" + operationType +
", operationStart=" + operationStart + ", operationStart=" + operationStart +
", operationEnd=" + operationEnd + ", operationEnd=" + operationEnd +
", operationSite='" + operationSite + '\'' +
'}'; '}';
} }
} }

View File

@ -32,6 +32,9 @@ public class HiddenDanger extends BaseEntity
@Excel(name = "风险表id") @Excel(name = "风险表id")
private int riskId; private int riskId;
/** 风险名称 */
private String riskName;
/** 上报日期 */ /** 上报日期 */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "上报日期", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "上报日期", width = 30, dateFormat = "yyyy-MM-dd")
@ -56,14 +59,20 @@ public class HiddenDanger extends BaseEntity
@Excel(name = "超期状态") @Excel(name = "超期状态")
private int exceedTimeLimitStatus; private int exceedTimeLimitStatus;
/** 企业id */ /** 责任企业id */
@Excel(name = "企业id") @Excel(name = "责任企业id")
private int enterpriseId; private int enterpriseId;
/** 责任企业 */
private String enterprise;
/** 责任人id */ /** 责任人id */
@Excel(name = "责任人id") @Excel(name = "责任人id")
private int personId; private int personId;
/** 责任人 */
private String person;
/** 备注 */ /** 备注 */
@Excel(name = "备注") @Excel(name = "备注")
private String remarks; private String remarks;
@ -198,6 +207,30 @@ public class HiddenDanger extends BaseEntity
this.submitEnterpriseId = submitEnterpriseId; this.submitEnterpriseId = submitEnterpriseId;
} }
public String getRiskName() {
return riskName;
}
public void setRiskName(String riskName) {
this.riskName = riskName;
}
public String getEnterprise() {
return enterprise;
}
public void setEnterprise(String enterprise) {
this.enterprise = enterprise;
}
public String getPerson() {
return person;
}
public void setPerson(String person) {
this.person = person;
}
@Override @Override
public String toString() { public String toString() {
return "HiddenDanger{" + return "HiddenDanger{" +
@ -205,14 +238,17 @@ public class HiddenDanger extends BaseEntity
", name='" + name + '\'' + ", name='" + name + '\'' +
", details='" + details + '\'' + ", details='" + details + '\'' +
", riskId=" + riskId + ", riskId=" + riskId +
", riskName='" + riskName + '\'' +
", submitDate=" + submitDate + ", submitDate=" + submitDate +
", submitPersonId=" + submitPersonId + ", submitPersonId=" + submitPersonId +
", submitEnterpriseId=" + submitEnterpriseId + ", submitEnterpriseId=" + submitEnterpriseId +
", reformMeasures='" + reformMeasures + '\'' + ", reformMeasures='" + reformMeasures + '\'' +
", reformStatus=" + reformStatus + ", reformStatus='" + reformStatus + '\'' +
", exceedTimeLimitStatus=" + exceedTimeLimitStatus + ", exceedTimeLimitStatus=" + exceedTimeLimitStatus +
", enterpriseId=" + enterpriseId + ", enterpriseId=" + enterpriseId +
", enterprise='" + enterprise + '\'' +
", personId=" + personId + ", personId=" + personId +
", person='" + person + '\'' +
", remarks='" + remarks + '\'' + ", remarks='" + remarks + '\'' +
", rectificationPeriod='" + rectificationPeriod + '\'' + ", rectificationPeriod='" + rectificationPeriod + '\'' +
'}'; '}';

View File

@ -4,14 +4,11 @@ import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.hbt.common.core.annotation.Excel; import com.hbt.common.core.annotation.Excel;
import com.hbt.common.core.web.domain.BaseEntity; import com.hbt.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/** /**
* law_enforcement_inspection * law_enforcement_inspection
* *
* @author zhangyu * @author zhangyu
* @date 2023-02-14
*/ */
public class LawEnforcementInspection extends BaseEntity public class LawEnforcementInspection extends BaseEntity
{ {
@ -25,9 +22,9 @@ public class LawEnforcementInspection extends BaseEntity
@Excel(name = "巡查日期", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "巡查日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date inspectionDate; private Date inspectionDate;
/** 巡查人员id */ /** 巡查人员 */
@Excel(name = "巡查人员id") @Excel(name = "巡查人员")
private int persionId; private String persion;
/** 巡查名称 */ /** 巡查名称 */
@Excel(name = "巡查名称") @Excel(name = "巡查名称")
@ -37,6 +34,12 @@ public class LawEnforcementInspection extends BaseEntity
@Excel(name = "备注") @Excel(name = "备注")
private String remarks; private String remarks;
/** 上报隐患id */
private int hiddenDangerId;
/** 上报风险id */
private int riskId;
public void setId(int id) public void setId(int id)
{ {
this.id = id; this.id = id;
@ -55,14 +58,14 @@ public class LawEnforcementInspection extends BaseEntity
{ {
return inspectionDate; return inspectionDate;
} }
public void setPersionId(int persionId) public void setPersionId(String persion)
{ {
this.persionId = persionId; this.persion = persion;
} }
public int getPersionId() public String getPersionId()
{ {
return persionId; return persion;
} }
public void setName(String name) public void setName(String name)
{ {
@ -83,14 +86,40 @@ public class LawEnforcementInspection extends BaseEntity
return remarks; return remarks;
} }
public String getPersion() {
return persion;
}
public void setPersion(String persion) {
this.persion = persion;
}
public int getHiddenDangerId() {
return hiddenDangerId;
}
public void setHiddenDangerId(int hiddenDangerId) {
this.hiddenDangerId = hiddenDangerId;
}
public int getRiskId() {
return riskId;
}
public void setRiskId(int riskId) {
this.riskId = riskId;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) return "LawEnforcementInspection{" +
.append("id", getId()) "id=" + id +
.append("inspectionDate", getInspectionDate()) ", inspectionDate=" + inspectionDate +
.append("persionId", getPersionId()) ", persion='" + persion + '\'' +
.append("name", getName()) ", name='" + name + '\'' +
.append("remarks", getRemarks()) ", remarks='" + remarks + '\'' +
.toString(); ", hiddenDangerId=" + hiddenDangerId +
", riskId=" + riskId +
'}';
} }
} }

View File

@ -40,14 +40,21 @@ public class Risk extends BaseEntity
@Excel(name = "风险等级") @Excel(name = "风险等级")
private int level; private int level;
/** 企业id */ /** 责任企业id */
@Excel(name = "企业id") @Excel(name = "企业id")
private int enterpriseId; private int enterpriseId;
/** 责任企业 */
private String enterprise;
/** 责任人id */ /** 责任人id */
@Excel(name = "责任人id") @Excel(name = "责任人id")
private int responsiblePersonId; private int responsiblePersonId;
/** 责任人id */
@Excel(name = "责任人")
private String responsiblePerson;
/** 风险管控措施 */ /** 风险管控措施 */
@Excel(name = "风险管控措施") @Excel(name = "风险管控措施")
private String riskControlMeasures; private String riskControlMeasures;
@ -61,6 +68,13 @@ public class Risk extends BaseEntity
@Excel(name = "重大危险源id") @Excel(name = "重大危险源id")
private int majorHazardSourcesId; private int majorHazardSourcesId;
/** 上报时间 */
private Date submitDate;
/** 上报人id */
private int submitPersonId;
public void setId(int id) public void setId(int id)
{ {
this.id = id; this.id = id;
@ -161,20 +175,57 @@ public class Risk extends BaseEntity
return majorHazardSourcesId; return majorHazardSourcesId;
} }
public String getEnterprise() {
return enterprise;
}
public void setEnterprise(String enterprise) {
this.enterprise = enterprise;
}
public String getResponsiblePerson() {
return responsiblePerson;
}
public void setResponsiblePerson(String responsiblePerson) {
this.responsiblePerson = responsiblePerson;
}
public Date getSubmitDate() {
return submitDate;
}
public void setSubmitDate(Date submitDate) {
this.submitDate = submitDate;
}
public int getSubmitPersonId() {
return submitPersonId;
}
public void setSubmitPersonId(int submitPersonId) {
this.submitPersonId = submitPersonId;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) return "Risk{" +
.append("id", getId()) "id=" + id +
.append("name", getName()) ", name='" + name + '\'' +
.append("riskProbability", getRiskProbability()) ", riskProbability='" + riskProbability + '\'' +
.append("riskFactor", getRiskFactor()) ", riskFactor='" + riskFactor + '\'' +
.append("affectConsequences", getAffectConsequences()) ", affectConsequences='" + affectConsequences + '\'' +
.append("level", getLevel()) ", level=" + level +
.append("enterpriseId", getEnterpriseId()) ", enterpriseId=" + enterpriseId +
.append("responsiblePersonId", getResponsiblePersonId()) ", enterprise='" + enterprise + '\'' +
.append("riskControlMeasures", getRiskControlMeasures()) ", responsiblePersonId=" + responsiblePersonId +
.append("lastReviewDate", getLastReviewDate()) ", responsiblePerson='" + responsiblePerson + '\'' +
.append("majorHazardSourcesId", getMajorHazardSourcesId()) ", riskControlMeasures='" + riskControlMeasures + '\'' +
.toString(); ", lastReviewDate=" + lastReviewDate +
", majorHazardSourcesId=" + majorHazardSourcesId +
", submitDate=" + submitDate +
", submitPersonId=" + submitPersonId +
'}';
} }
} }

View File

@ -60,5 +60,10 @@ public interface IEnterpriseInfomationService
*/ */
int deleteEnterpriseInfomationById(int id); int deleteEnterpriseInfomationById(int id);
/**
*
*
* @return
*/
String enterpriseStatistics(); String enterpriseStatistics();
} }

View File

@ -3,6 +3,7 @@ package com.hbt.safety.supervision.service;
import java.util.List; import java.util.List;
import com.hbt.safety.supervision.pojo.EscalateHiddenDanger; import com.hbt.safety.supervision.pojo.EscalateHiddenDanger;
import com.hbt.safety.supervision.pojo.HiddenDanger;
/** /**
* Service * Service
@ -18,7 +19,7 @@ public interface IEscalateHiddenDangerService
* @param id * @param id
* @return * @return
*/ */
EscalateHiddenDanger selectEscalateHiddenDangerById(int id); HiddenDanger selectEscalateHiddenDangerById(int id);
/** /**
* *

View File

@ -26,7 +26,7 @@ public interface IEscalateRiskService
* @param escalateRisk * @param escalateRisk
* @return * @return
*/ */
List<EscalateRisk> selectEscalateRiskList(EscalateRisk escalateRisk); List<EscalateRisk> selectEscalateRiskList();
/** /**
* *

View File

@ -26,7 +26,7 @@ public interface IHazardousOperationService
* @param hazardousOperation * @param hazardousOperation
* @return * @return
*/ */
List<HazardousOperation> selectHazardousOperationList(HazardousOperation hazardousOperation); List<HazardousOperation> selectHazardousOperationList();
/** /**
* *
@ -61,4 +61,6 @@ public interface IHazardousOperationService
int deleteHazardousOperationById(int id); int deleteHazardousOperationById(int id);
String hazardousOperationStatistics(); String hazardousOperationStatistics();
String hazardousOperationManagement();
} }

View File

@ -60,5 +60,24 @@ public interface IHiddenDangerService
*/ */
int deleteHiddenDangerById(int id); int deleteHiddenDangerById(int id);
/**
*
*
* @return
*/
String hiddenDangerStatistics(); String hiddenDangerStatistics();
/**
*
*
* @return
*/
String hiddenDangerManagement();
/**
*
*
* @return
*/
String hiddenDangerWeeklyStatistics();
} }

View File

@ -26,7 +26,7 @@ public interface ILawEnforcementInspectionService
* @param lawEnforcementInspection * @param lawEnforcementInspection
* @return * @return
*/ */
List<LawEnforcementInspection> selectLawEnforcementInspectionList(LawEnforcementInspection lawEnforcementInspection); List<LawEnforcementInspection> selectLawEnforcementInspectionList();
/** /**
* *

View File

@ -60,5 +60,24 @@ public interface IRiskService
*/ */
int deleteRiskById(int id); int deleteRiskById(int id);
/**
*
*
* @return
*/
String riskStatistics(); String riskStatistics();
/**
*
*
* @return
*/
String riskManagementAndControlStatistics();
/**
*
*
* @return
*/
String weeklyQuantityStatistics();
} }

View File

@ -99,6 +99,11 @@ public class EnterpriseInfomationServiceImpl implements IEnterpriseInfomationSer
return enterpriseInfomationMapper.deleteEnterpriseInfomationById(id); return enterpriseInfomationMapper.deleteEnterpriseInfomationById(id);
} }
/**
*
*
* @return
*/
@Override @Override
public String enterpriseStatistics() { public String enterpriseStatistics() {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();

View File

@ -4,6 +4,7 @@ import java.util.List;
import com.hbt.safety.supervision.mapper.EscalateHiddenDangerMapper; import com.hbt.safety.supervision.mapper.EscalateHiddenDangerMapper;
import com.hbt.safety.supervision.pojo.EscalateHiddenDanger; import com.hbt.safety.supervision.pojo.EscalateHiddenDanger;
import com.hbt.safety.supervision.pojo.HiddenDanger;
import com.hbt.safety.supervision.service.IEscalateHiddenDangerService; import com.hbt.safety.supervision.service.IEscalateHiddenDangerService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -27,7 +28,7 @@ public class EscalateHiddenDangerServiceImpl implements IEscalateHiddenDangerSer
* @return * @return
*/ */
@Override @Override
public EscalateHiddenDanger selectEscalateHiddenDangerById(int id) public HiddenDanger selectEscalateHiddenDangerById(int id)
{ {
return escalateHiddenDangerMapper.selectEscalateHiddenDangerById(id); return escalateHiddenDangerMapper.selectEscalateHiddenDangerById(id);
} }

View File

@ -39,9 +39,9 @@ public class EscalateRiskServiceImpl implements IEscalateRiskService
* @return * @return
*/ */
@Override @Override
public List<EscalateRisk> selectEscalateRiskList(EscalateRisk escalateRisk) public List<EscalateRisk> selectEscalateRiskList()
{ {
return escalateRiskMapper.selectEscalateRiskList(escalateRisk); return escalateRiskMapper.selectEscalateRiskList();
} }
/** /**

View File

@ -41,9 +41,9 @@ public class HazardousOperationServiceImpl implements IHazardousOperationService
* @return * @return
*/ */
@Override @Override
public List<HazardousOperation> selectHazardousOperationList(HazardousOperation hazardousOperation) public List<HazardousOperation> selectHazardousOperationList()
{ {
return hazardousOperationMapper.selectHazardousOperationList(hazardousOperation); return hazardousOperationMapper.selectHazardousOperationList();
} }
/** /**
@ -144,4 +144,36 @@ public class HazardousOperationServiceImpl implements IHazardousOperationService
map.put("historyHazardousOperation", historyHazardousOperation); map.put("historyHazardousOperation", historyHazardousOperation);
return JSONObject.toJSONString(map); return JSONObject.toJSONString(map);
} }
@Override
public String hazardousOperationManagement() {
// 获取当前时间
Date date = new Date();
Map<String, Object> map = new HashMap<>();
// 查询危险作业信息
List<HazardousOperation> list = hazardousOperationMapper.hazardousOperationManagement();
if (list == null) {
return "";
}
// 进行中的危险作业
List<HazardousOperation> hazardousOperations = list.stream()
.filter(s -> s.getOperationStart().before(date) && s.getOperationEnd().after(date))
.collect(Collectors.toList());
map.put("underwayHazardousOperation", hazardousOperations);
// 待开始危险作业
List<HazardousOperation> toBeStarted = list.stream()
.filter(s -> s.getOperationStart().after(date)).collect(Collectors.toList());
map.put("toBeStarted", toBeStarted);
// 历史危险作业
List<HazardousOperation> historyHazardousOperation = list.stream()
.filter(s -> s.getOperationEnd().before(date)).collect(Collectors.toList());
map.put("historyHazardousOperation", historyHazardousOperation);
return JSONObject.toJSONString(map);
}
} }

View File

@ -9,6 +9,7 @@ import com.alibaba.fastjson.JSONObject;
import com.hbt.safety.supervision.mapper.HiddenDangerMapper; import com.hbt.safety.supervision.mapper.HiddenDangerMapper;
import com.hbt.safety.supervision.pojo.HiddenDanger; import com.hbt.safety.supervision.pojo.HiddenDanger;
import com.hbt.safety.supervision.service.IHiddenDangerService; import com.hbt.safety.supervision.service.IHiddenDangerService;
import com.hbt.safety.supervision.util.YearWeeksUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -95,6 +96,9 @@ public class HiddenDangerServiceImpl implements IHiddenDangerService
return hiddenDangerMapper.deleteHiddenDangerById(id); return hiddenDangerMapper.deleteHiddenDangerById(id);
} }
/**
*
*/
public String hiddenDangerStatistics() { public String hiddenDangerStatistics() {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
@ -112,4 +116,31 @@ public class HiddenDangerServiceImpl implements IHiddenDangerService
map.put("hiddenDangerList", hiddenDangerList); map.put("hiddenDangerList", hiddenDangerList);
return JSONObject.toJSONString(map); return JSONObject.toJSONString(map);
} }
/**
*
*/
@Override
public String hiddenDangerManagement() {
List<HiddenDanger> list = hiddenDangerMapper.selectHiddenDangers();
if (list == null) {
return "";
}
Map<Object, List<HiddenDanger>> hiddenDangerMap = list.stream()
.collect(Collectors.groupingBy(HiddenDanger::getReformStatus));
return JSONObject.toJSONString(hiddenDangerMap);
}
/**
*
*
* @return
*/
public String hiddenDangerWeeklyStatistics() {
// 获取当前年份
int year = YearWeeksUtil.getCurrentYear();
List<Integer> list = hiddenDangerMapper.selectHiddenDangerSubmitDats(year);
// 处理数据
return YearWeeksUtil.dealWeekDate(list, year);
}
} }

View File

@ -13,6 +13,7 @@ import com.hbt.safety.supervision.mapper.LawEnforcementInspectionMapper;
import com.hbt.safety.supervision.pojo.LawEnforcementInspection; import com.hbt.safety.supervision.pojo.LawEnforcementInspection;
import com.hbt.safety.supervision.pojo.vo.LawEnforcementInspectionStatics; import com.hbt.safety.supervision.pojo.vo.LawEnforcementInspectionStatics;
import com.hbt.safety.supervision.pojo.vo.LawEnforcementInspectionVo; import com.hbt.safety.supervision.pojo.vo.LawEnforcementInspectionVo;
import com.hbt.safety.supervision.util.YearWeeksUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.hbt.safety.supervision.service.ILawEnforcementInspectionService; import com.hbt.safety.supervision.service.ILawEnforcementInspectionService;
@ -54,9 +55,9 @@ public class LawEnforcementInspectionServiceImpl implements ILawEnforcementInspe
* @return * @return
*/ */
@Override @Override
public List<LawEnforcementInspection> selectLawEnforcementInspectionList(LawEnforcementInspection lawEnforcementInspection) public List<LawEnforcementInspection> selectLawEnforcementInspectionList()
{ {
return lawEnforcementInspectionMapper.selectLawEnforcementInspectionList(lawEnforcementInspection); return lawEnforcementInspectionMapper.selectLawEnforcementInspectionList();
} }
/** /**
@ -112,8 +113,7 @@ public class LawEnforcementInspectionServiceImpl implements ILawEnforcementInspe
List<LawEnforcementInspectionStatics> list = new ArrayList<>(); List<LawEnforcementInspectionStatics> list = new ArrayList<>();
// 获取当前年份 // 获取当前年份
Calendar calendar = Calendar.getInstance(); int year = YearWeeksUtil.getCurrentYear();
int year = calendar.get(Calendar.YEAR);
// 查询巡查列表 // 查询巡查列表
List<LawEnforcementInspectionVo> lawList = lawEnforcementInspectionMapper.selectLawEnforcementInspections(year); List<LawEnforcementInspectionVo> lawList = lawEnforcementInspectionMapper.selectLawEnforcementInspections(year);
if (lawList == null) { if (lawList == null) {

View File

@ -1,12 +1,16 @@
package com.hbt.safety.supervision.service.impl; package com.hbt.safety.supervision.service.impl;
import java.util.Date;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.hbt.safety.supervision.mapper.RiskMapper; import com.hbt.safety.supervision.mapper.RiskMapper;
import com.hbt.safety.supervision.pojo.Risk; import com.hbt.safety.supervision.pojo.Risk;
import com.hbt.safety.supervision.service.IRiskService; import com.hbt.safety.supervision.service.IRiskService;
import com.hbt.safety.supervision.util.YearWeeksUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -98,4 +102,27 @@ public class RiskServiceImpl implements IRiskService
List<Map<Object, Object>> map = riskMapper.riskStatistics(); List<Map<Object, Object>> map = riskMapper.riskStatistics();
return JSONObject.toJSONString(map); return JSONObject.toJSONString(map);
} }
/**
*
*/
public String riskManagementAndControlStatistics() {
List<Risk> list = riskMapper.selectRisks();
if (list == null) {
return "";
}
Map<Object, List<Risk>> map = list.stream().collect(Collectors.groupingBy(s -> s.getLevel()));
return JSONObject.toJSONString(map);
}
/**
*
*/
public String weeklyQuantityStatistics() {
// 获取当前年份
int year = YearWeeksUtil.getCurrentYear();
List<Integer> list = riskMapper.selectRiskSubmitDats(year);
// 处理数据
return YearWeeksUtil.dealWeekDate(list, year);
}
} }

View File

@ -0,0 +1,91 @@
package com.hbt.safety.supervision.util;
import com.alibaba.fastjson.JSONObject;
import org.springframework.util.CollectionUtils;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
/**
*
*/
public class YearWeeksUtil {
/**
*
*
* @return
*/
public static int getCurrentYear() {
Calendar calendar = Calendar.getInstance();
int weekYear = calendar.get(Calendar.YEAR);//获得当前的年
return weekYear;
}
/**
*
* @param year
* @param week
* @return
*/
public static Map<String, String> getWeekRangeMap(int year, int week) {
Map<String, String> timeMap = new HashMap<>();
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.YEAR,year);
calendar.setFirstDayOfWeek(Calendar.MONDAY);//设置星期一为一周开始的第一天
calendar.setMinimalDaysInFirstWeek(4);//可以不用设置
int weekYear = calendar.get(Calendar.YEAR);//获得当前的年
calendar.setWeekDate(weekYear, week, 2);//获得指定年的第几周的开始日期
Date time=calendar.getTime();
String startTime = new SimpleDateFormat("yyyy-MM-dd").format(time)+" 00:00:00";
timeMap.put("startTime",startTime);
calendar.setWeekDate(weekYear, week, 1);//获得指定年的第几周的结束日期
time=calendar.getTime();
String endTime = new SimpleDateFormat("yyyy-MM-dd").format(time)+" 23:59:59";
timeMap.put("endTime",endTime);
return timeMap;
}
/**
*
*
* @param year
* @return
* @throws ParseException
*/
public static int getYearWeekConut(int year){
int week = 52;
try {
Map<String, String> timeMap = getWeekRangeMap(year,53);
if(!CollectionUtils.isEmpty(timeMap)){
String startTime = timeMap.get("startTime");
if(startTime.substring(0, 4).equals(year+"")){ //判断年度是否相符如果相符说明有53个周。
week = 53;
}
}
} catch (Exception e) {
e.printStackTrace();
}
return week;
}
public static String dealWeekDate(List<Integer> list, int year) {
Map<Object, List<Integer>> weekList = new HashMap<>();
if (list != null) {
weekList = list.stream().collect(Collectors.groupingBy(s -> s));
}
Map<Integer, Integer> weekStatistics = new HashMap<>();
// 获取当前年份周数
int week = YearWeeksUtil.getYearWeekConut(year);
for (int i = 1; i <= week; i++) {
if (weekList.containsKey(i)) {
weekStatistics.put(i, weekList.get(i).size());
} else {
weekStatistics.put(i, 0);
}
}
return JSONObject.toJSONString(weekStatistics);
}
}

View File

@ -19,10 +19,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where> <where>
</where> </where>
</select> </select>
<select id="selectEscalateHiddenDangerById" parameterType="Integer" resultMap="EscalateHiddenDangerResult"> <sql id="selectEscalateHiddenDanger">
<include refid="selectEscalateHiddenDangerVo"/> select distinct(h.id) id, h.name name, e.name enterprise
where id = #{id} from escalate_hidden_danger as a
left join hidden_danger as h on a.hidden_danger_id = h.id
left join enterprise_infomation as e on h.enterprise_id = e.id
</sql>
<select id="selectEscalateHiddenDangerById" parameterType="Integer" resultType="HiddenDanger">
<include refid="selectEscalateHiddenDanger"/>
where a.id = #{id}
</select> </select>
<insert id="insertEscalateHiddenDanger" parameterType="com.hbt.safety.supervision.pojo.EscalateHiddenDanger"> <insert id="insertEscalateHiddenDanger" parameterType="com.hbt.safety.supervision.pojo.EscalateHiddenDanger">

View File

@ -19,10 +19,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where> <where>
</where> </where>
</select> </select>
<sql id="selectEscalateRisk">
select distinct(h.id) id, h.name name, e.name enterprise
from escalate_risk as a
left join risk as h on a.risk_id = h.id
left join enterprise_infomation as e on h.enterprise_id = e.id
</sql>
<select id="selectEscalateRiskById" parameterType="Integer" resultMap="EscalateRiskResult"> <select id="selectEscalateRiskById" parameterType="Integer" resultMap="EscalateRiskResult">
<include refid="selectEscalateRiskVo"/> <include refid="selectEscalateRisk"/>
where id = #{id} where a.id = #{id}
</select> </select>
<insert id="insertEscalateRisk" parameterType="com.hbt.safety.supervision.pojo.EscalateRisk"> <insert id="insertEscalateRisk" parameterType="com.hbt.safety.supervision.pojo.EscalateRisk">

View File

@ -15,22 +15,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="operationType" column="operation_type" /> <result property="operationType" column="operation_type" />
<result property="operationStart" column="operation_start" /> <result property="operationStart" column="operation_start" />
<result property="operationEnd" column="operation_end" /> <result property="operationEnd" column="operation_end" />
<result property="operationSite" column="operation_site" />
</resultMap> </resultMap>
<sql id="selectHazardousOperationVo"> <sql id="selectHazardousOperationVo">
select id, name, operation_level, enterprise_id, operation_content, operation_longitude, operation_latitude, operation_type, operation_start, operation_end from hazardous_operation select id, name, operation_longitude, operation_latitude, operation_type, operation_start, operation_end, operation_site from hazardous_operation
</sql> </sql>
<select id="selectHazardousOperationList" parameterType="com.hbt.safety.supervision.pojo.HazardousOperation" resultMap="HazardousOperationResult"> <select id="selectHazardousOperationList" parameterType="com.hbt.safety.supervision.pojo.HazardousOperation" resultMap="HazardousOperationResult">
<include refid="selectHazardousOperationVo"/> <include refid="selectHazardousOperationVo"/>
<where>
<if test="id != null "> and id = #{id}</if>
</where>
</select> </select>
<sql id="selectHazardousOperation">
select distinct(a.id) id, a.name name, a.operation_level operationLevel, a.enterprise_id enterpriseId, a.operation_content operationContent, a.operation_type operationType, a.operation_start operationStart, a.operation_end operationEnd,a.operation_site operationSite,
e.name
from hazardous_operation as a
left join enterprise_infomation as e on a.enterprise_id = e.id
</sql>
<select id="selectHazardousOperationById" parameterType="Integer" resultMap="HazardousOperationResult"> <select id="selectHazardousOperationById" parameterType="Integer" resultMap="HazardousOperationResult">
<include refid="selectHazardousOperationVo"/> <include refid="selectHazardousOperation"/>
where id = #{id} where a.id = #{id}
</select> </select>
<insert id="insertHazardousOperation" parameterType="com.hbt.safety.supervision.pojo.HazardousOperation"> <insert id="insertHazardousOperation" parameterType="com.hbt.safety.supervision.pojo.HazardousOperation">
@ -46,6 +51,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="operationType != null">operation_type,</if> <if test="operationType != null">operation_type,</if>
<if test="operationStart != null">operation_start,</if> <if test="operationStart != null">operation_start,</if>
<if test="operationEnd != null">operation_end,</if> <if test="operationEnd != null">operation_end,</if>
<if test="operationSite != null">operation_site,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if> <if test="id != null">#{id},</if>
@ -58,6 +64,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="operationType != null">#{operationType},</if> <if test="operationType != null">#{operationType},</if>
<if test="operationStart != null">#{operationStart},</if> <if test="operationStart != null">#{operationStart},</if>
<if test="operationEnd != null">#{operationEnd},</if> <if test="operationEnd != null">#{operationEnd},</if>
<if test="operationSite != null">#{operationSite},</if>
</trim> </trim>
</insert> </insert>
@ -73,6 +80,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="operationType != null">operation_type = #{operationType},</if> <if test="operationType != null">operation_type = #{operationType},</if>
<if test="operationStart != null">operation_start = #{operationStart},</if> <if test="operationStart != null">operation_start = #{operationStart},</if>
<if test="operationEnd != null">operation_end = #{operationEnd},</if> <if test="operationEnd != null">operation_end = #{operationEnd},</if>
<if test="operationSite != null">operation_site = #{operationSite},</if>
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>
@ -91,4 +99,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectHazardousOperations" resultType="com.hbt.safety.supervision.pojo.HazardousOperation"> <select id="selectHazardousOperations" resultType="com.hbt.safety.supervision.pojo.HazardousOperation">
select id,operation_type operationType,operation_start operationStart ,operation_end operationEnd,enterprise_id enterpriseId from hazardous_operation select id,operation_type operationType,operation_start operationStart ,operation_end operationEnd,enterprise_id enterpriseId from hazardous_operation
</select> </select>
<select id="hazardousOperationManagement" resultType="HazardousOperation">
select name,operation_start operationStart ,operation_end operationEnd from hazardous_operation
</select>
</mapper> </mapper>

View File

@ -30,10 +30,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where> <where>
</where> </where>
</select> </select>
<select id="selectHiddenDangerById" parameterType="Integer" resultMap="HiddenDangerResult"> <sql id="selectHiddenDanger">
<include refid="selectHiddenDangerVo"/> select distinct(a.id) id, a.name, a.details, a.risk_id riskId, a.submit_date submitDate, a.reform_measures reformMeasures, a.reform_status reformStatus, a.exceed_time_limit_status exceedTimeLimitStatus, a.enterprise_id enterpriseId, a.person_id personId, a.remarks remarks, a.rectification_period rectificationPeriod,
where id = #{id} b.name as enterprise,
p.name as person,
r.name as riskName
from hidden_danger as a
left join enterprise_infomation as b on a.enterprise_id = b.id
left join persion as p on a.person_id = p.id
left join risk as r on a.risk_id = r.id
</sql>
<select id="selectHiddenDangerById" parameterType="Integer" resultType="HiddenDanger">
<include refid="selectHiddenDanger"/>
where a.id = #{id}
</select> </select>
<insert id="insertHiddenDanger" parameterType="com.hbt.safety.supervision.pojo.HiddenDanger"> <insert id="insertHiddenDanger" parameterType="com.hbt.safety.supervision.pojo.HiddenDanger">
@ -104,6 +115,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete> </delete>
<select id="selectHiddenDangers" resultType="com.hbt.safety.supervision.pojo.HiddenDanger"> <select id="selectHiddenDangers" resultType="com.hbt.safety.supervision.pojo.HiddenDanger">
select reform_status reformStatus from hidden_danger where exceed_time_limit_status = 0 select name, reform_status reformStatus from hidden_danger where exceed_time_limit_status = 0
</select>
<select id="selectHiddenDangerSubmitDats" resultType="Integer">
select WEEK(submit_date, 1) + 1 from hidden_danger where YEAR(submit_date) = #{year}
</select> </select>
</mapper> </mapper>

View File

@ -7,19 +7,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="com.hbt.safety.supervision.pojo.LawEnforcementInspection" id="LawEnforcementInspectionResult"> <resultMap type="com.hbt.safety.supervision.pojo.LawEnforcementInspection" id="LawEnforcementInspectionResult">
<result property="id" column="id" /> <result property="id" column="id" />
<result property="inspectionDate" column="inspection_date" /> <result property="inspectionDate" column="inspection_date" />
<result property="persionId" column="persion_id" /> <result property="persion" column="persion" />
<result property="name" column="name" /> <result property="name" column="name" />
<result property="remarks" column="remarks" /> <result property="remarks" column="remarks" />
</resultMap> </resultMap>
<sql id="selectLawEnforcementInspectionVo"> <sql id="selectLawEnforcementInspectionVo">
select id, inspection_date, persion_id, name, remarks from law_enforcement_inspection select distinct(a.id) id, a.inspection_date, a.inspection_date, a.persion persion, a.name name,
b.hidden_danger_id hiddenDangerId,
c.risk_id riskId
from law_enforcement_inspection as a
left join escalate_hidden_danger as b on a.id = b.enforcement_id
left join escalate_risk as c on a.id = c.enforcement_id
</sql> </sql>
<select id="selectLawEnforcementInspectionList" parameterType="com.hbt.safety.supervision.pojo.LawEnforcementInspection" resultMap="LawEnforcementInspectionResult"> <select id="selectLawEnforcementInspectionList" parameterType="com.hbt.safety.supervision.pojo.LawEnforcementInspection" resultType="LawEnforcementInspection">
<include refid="selectLawEnforcementInspectionVo"/> <include refid="selectLawEnforcementInspectionVo"/>
<where>
</where>
</select> </select>
<select id="selectLawEnforcementInspectionById" parameterType="Integer" resultMap="LawEnforcementInspectionResult"> <select id="selectLawEnforcementInspectionById" parameterType="Integer" resultMap="LawEnforcementInspectionResult">
@ -32,14 +35,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if> <if test="id != null">id,</if>
<if test="inspectionDate != null">inspection_date,</if> <if test="inspectionDate != null">inspection_date,</if>
<if test="persionId != null">persion_id,</if> <if test="persion != null">persion,</if>
<if test="name != null">name,</if> <if test="name != null">name,</if>
<if test="remarks != null">remarks,</if> <if test="remarks != null">remarks,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if> <if test="id != null">#{id},</if>
<if test="inspectionDate != null">#{inspectionDate},</if> <if test="inspectionDate != null">#{inspectionDate},</if>
<if test="persionId != null">#{persionId},</if> <if test="persion != null">#{persion},</if>
<if test="name != null">#{name},</if> <if test="name != null">#{name},</if>
<if test="remarks != null">#{remarks},</if> <if test="remarks != null">#{remarks},</if>
</trim> </trim>
@ -49,7 +52,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update law_enforcement_inspection update law_enforcement_inspection
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="inspectionDate != null">inspection_date = #{inspectionDate},</if> <if test="inspectionDate != null">inspection_date = #{inspectionDate},</if>
<if test="persionId != null">persion_id = #{persionId},</if> <if test="persion != null">persion = #{persion},</if>
<if test="name != null">name = #{name},</if> <if test="name != null">name = #{name},</if>
<if test="remarks != null">remarks = #{remarks},</if> <if test="remarks != null">remarks = #{remarks},</if>
</trim> </trim>

View File

@ -27,10 +27,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where> <where>
</where> </where>
</select> </select>
<select id="selectRiskById" parameterType="Integer" resultMap="RiskResult">
<include refid="selectRiskVo"/> <sql id="selectRisk">
where id = #{id} select distinct(a.id) id, a.name name, a.risk_probability riskProbability, a.risk_factor riskFactor, a.affect_consequences affectConsequences, a.level level, a.enterprise_id enterpriseId, a.responsible_person_id responsiblePersonId, a.risk_control_measures riskControlMeasures, a.last_review_date lastReviewDate, a.major_hazard_sources_id majorHazardSourcesId,
b.name as enterprise,
p.name as responsiblePerson
from risk as a
left join enterprise_infomation as b on a.enterprise_id = b.id
left join persion as p on a.responsible_person_id = p.id
</sql>
<select id="selectRiskById" parameterType="Integer" resultType="Risk">
<include refid="selectRisk"/>
where a.id = #{id}
</select> </select>
<insert id="insertRisk" parameterType="com.hbt.safety.supervision.pojo.Risk"> <insert id="insertRisk" parameterType="com.hbt.safety.supervision.pojo.Risk">
@ -94,4 +103,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="riskStatistics" resultType="java.util.Map"> <select id="riskStatistics" resultType="java.util.Map">
select level as level, count(id) as num from risk group by level select level as level, count(id) as num from risk group by level
</select> </select>
<select id="selectRisks" resultType="com.hbt.safety.supervision.pojo.Risk">
select name, level from risk
</select>
<select id="selectRiskSubmitDats" resultType="Integer">
select WEEK(submit_date, 1) + 1 from risk where YEAR(submit_date) = #{year}
</select>
</mapper> </mapper>