From c009e106c00ef9dd96cc1a6f54d2158e4618f90f Mon Sep 17 00:00:00 2001 From: pengjie <17373303529@163.com> Date: Fri, 16 May 2025 18:19:15 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9E=8D=E9=92=A2=E5=86=8D=E6=AC=A1=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/zhgd/xmgl/enums/ParamEnum.java | 8 +- .../controller/DownloadController.java | 13 ++ .../controller/ExamRegulationController.java | 73 ++++++- .../ExamSafetyManualController.java | 73 ++++++- .../modules/exam/entity/ExamRegulation.java | 8 + .../modules/exam/entity/ExamSafetyManual.java | 13 ++ .../exam/service/IExamRegulationService.java | 4 + .../service/IExamSafetyManualService.java | 4 + .../impl/ExamRegulationServiceImpl.java | 29 +++ .../impl/ExamSafetyManualServiceImpl.java | 30 +++ .../SafetyHatAlarmConfigController.java | 181 ++++++++++++++++++ .../controller/SafetyHatDataController.java | 13 ++ .../controller/SafetyHatDevController.java | 28 ++- .../entity/SafetyHatAlarmConfig.java | 52 +++++ .../safetyhat/entity/SafetyHatDev.java | 52 +++++ .../safetyhat/entity/SafetyHatFence.java | 4 + .../entity/vo/SafetyHatDevExport.java | 32 ++++ .../entity/vo/WorkerListyByRegionVo.java | 17 ++ .../entity/vo/WorkerNumAndRegionName.java | 5 + .../mapper/SafetyHatAlarmConfigMapper.java | 19 ++ .../mapper/xml/SafetyHatAlarmConfigMapper.xml | 5 + .../xml/SafetyHatAlarmConfigServiceImpl.java | 19 ++ .../mapper/xml/SafetyHatDevMapper.xml | 6 +- .../service/ISafetyHatAlarmConfigService.java | 14 ++ .../service/ISafetyHatDataService.java | 4 + .../service/ISafetyHatDevService.java | 9 + .../impl/SafetyHatAlarmServiceImpl.java | 14 ++ .../impl/SafetyHatDataServiceImpl.java | 121 ++++++++++-- .../service/impl/SafetyHatDevServiceImpl.java | 101 +++++++++- .../impl/SafetyHatFenceServiceImpl.java | 21 +- .../mapper/xml/DepartmentInfoMapper.xml | 3 + .../worker/mapper/xml/TeamInfoMapper.xml | 2 +- .../worker/mapper/xml/WorkerInfoMapper.xml | 13 ++ .../impl/DepartmentInfoServiceImpl.java | 7 + .../service/impl/TeamInfoServiceImpl.java | 6 + .../com/zhgd/xmgl/task/SafetyHatTask.java | 127 +++++++++++- .../java/com/zhgd/xmgl/util/ExcelUtils.java | 35 ++++ .../resources/excel/安全帽设备导入模板.xlsx | Bin 8834 -> 10772 bytes 38 files changed, 1118 insertions(+), 47 deletions(-) create mode 100644 src/main/java/com/zhgd/xmgl/modules/safetyhat/controller/SafetyHatAlarmConfigController.java create mode 100644 src/main/java/com/zhgd/xmgl/modules/safetyhat/entity/SafetyHatAlarmConfig.java create mode 100644 src/main/java/com/zhgd/xmgl/modules/safetyhat/entity/vo/SafetyHatDevExport.java create mode 100644 src/main/java/com/zhgd/xmgl/modules/safetyhat/entity/vo/WorkerListyByRegionVo.java create mode 100644 src/main/java/com/zhgd/xmgl/modules/safetyhat/mapper/SafetyHatAlarmConfigMapper.java create mode 100644 src/main/java/com/zhgd/xmgl/modules/safetyhat/mapper/xml/SafetyHatAlarmConfigMapper.xml create mode 100644 src/main/java/com/zhgd/xmgl/modules/safetyhat/mapper/xml/SafetyHatAlarmConfigServiceImpl.java create mode 100644 src/main/java/com/zhgd/xmgl/modules/safetyhat/service/ISafetyHatAlarmConfigService.java diff --git a/src/main/java/com/zhgd/xmgl/enums/ParamEnum.java b/src/main/java/com/zhgd/xmgl/enums/ParamEnum.java index de5517498..a1910f086 100644 --- a/src/main/java/com/zhgd/xmgl/enums/ParamEnum.java +++ b/src/main/java/com/zhgd/xmgl/enums/ParamEnum.java @@ -1246,7 +1246,7 @@ public class ParamEnum { /** * 围栏报警1 离开工作区域 */ - WLBJ1(2, "围栏报警1 离开工作区域"), + WLBJ1(2, "人员在考勤时间段内离岗报警"), /** * 温度报警 */ @@ -1258,7 +1258,7 @@ public class ParamEnum { /** * 围栏报警2 进入禁区 */ - WLBJ2(5, "围栏报警2 进入禁区"), + WLBJ2(5, "人员非法闯入区域报警"), /** * 静默报警 */ @@ -1315,6 +1315,10 @@ public class ParamEnum { * 血压报警 */ XYBJ(22, "血压报警"), + /** + * 区域超员报警 + */ + CYBJ(23, "区域超员报警"), ; private Integer value; diff --git a/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/DownloadController.java b/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/DownloadController.java index 1294b3d6d..fdbe0d5e5 100644 --- a/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/DownloadController.java +++ b/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/DownloadController.java @@ -8,6 +8,7 @@ import com.zhgd.xmgl.modules.dangerous.service.IHiddenDangerInspectRecordService import com.zhgd.xmgl.modules.exam.service.IExamQuestionBankService; import com.zhgd.xmgl.modules.massrebound.service.IMassReboundSurveyAreaService; import com.zhgd.xmgl.modules.quality.service.IQualityInspectionRecordService; +import com.zhgd.xmgl.modules.safetyhat.service.ISafetyHatDevService; import com.zhgd.xmgl.modules.standard.service.IStandardAlarmService; import com.zhgd.xmgl.modules.worker.service.IWorkerAttendanceService; import com.zhgd.xmgl.modules.worker.service.IWorkerInfoService; @@ -22,6 +23,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.servlet.ModelAndView; import javax.servlet.http.HttpServletResponse; import java.text.SimpleDateFormat; @@ -45,6 +47,8 @@ public class DownloadController { @Autowired private IWorkerInfoService workerInfoService; @Autowired + private ISafetyHatDevService safetyHatDevService; + @Autowired private IExamQuestionBankService examQuestionBankService; @Autowired private IWorkerMonthAttendanceStatisticsService workerMonthAttendanceStatisticsService; @@ -333,6 +337,15 @@ public class DownloadController { examQuestionBankService.exporExcelTemplate(response, projectSn); } + @ApiOperation(value = "人员安全帽导入模板下载", notes = "人员安全帽导入模板下载", httpMethod = "GET") + @ApiImplicitParams({ + @ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "query", required = true, dataType = "String"), + }) + @GetMapping(value = "/exporExcelSafeDevTemplate") + public ModelAndView exporExcelSafeDevTemplate(HttpServletResponse response, String projectSn) { + return safetyHatDevService.exporExcelSafeDevTemplate(response, projectSn); + } + @ApiOperation(value = "列表查询隐患检查记录信息下载", notes = "列表查询隐患检查记录信息下载", httpMethod = "GET") @ApiImplicitParams({ @ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "query", required = true, dataType = "String"), diff --git a/src/main/java/com/zhgd/xmgl/modules/exam/controller/ExamRegulationController.java b/src/main/java/com/zhgd/xmgl/modules/exam/controller/ExamRegulationController.java index 811a90996..788f74ae5 100644 --- a/src/main/java/com/zhgd/xmgl/modules/exam/controller/ExamRegulationController.java +++ b/src/main/java/com/zhgd/xmgl/modules/exam/controller/ExamRegulationController.java @@ -1,6 +1,11 @@ package com.zhgd.xmgl.modules.exam.controller; +import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.zhgd.annotation.OperLog; +import com.zhgd.xmgl.modules.safetyhat.entity.SafetyHatDev; +import com.zhgd.xmgl.modules.worker.entity.WorkerInfo; +import com.zhgd.xmgl.modules.worker.mapper.WorkerInfoMapper; +import com.zhgd.xmgl.modules.worker.service.IWorkerInfoService; import com.zhgd.xmgl.security.entity.UserInfo; import com.zhgd.xmgl.security.util.SecurityUtils; import com.zhgd.xmgl.util.PageUtil; @@ -9,12 +14,11 @@ import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; -import java.util.Arrays; -import java.util.List; -import java.util.Map; +import java.util.*; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.net.URLDecoder; +import java.util.stream.Collectors; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -59,6 +63,9 @@ public class ExamRegulationController { @Autowired private IExamRegulationService examRegulationService; + @Autowired + private WorkerInfoMapper workerInfoMapper; + /** * 分页列表查询 * @@ -68,11 +75,17 @@ public class ExamRegulationController { @ApiOperation(value = " 分页列表查询规章制度信息", notes = "分页列表查询规章制度信息", httpMethod = "POST") @ApiImplicitParams({ @ApiImplicitParam(name = "pageNo", value = "页数", paramType = "body", required = true, defaultValue = "1", dataType = "Integer"), - @ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "body", required = true, defaultValue = "10", dataType = "Integer") + @ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "body", required = true, defaultValue = "10", dataType = "Integer"), + @ApiImplicitParam(name = "workerId", value = "劳务ID", paramType = "body", required = true, defaultValue = "10", dataType = "String") }) @PostMapping(value = "/page") public Result> queryPageList(@ApiIgnore @RequestBody Map map) { + String workerId = MapUtils.getString(map, "workerId"); + map.remove("workerId"); QueryWrapper queryWrapper = QueryGenerator.initPageQueryWrapper(ExamRegulation.class, map); + if (StringUtils.isNotBlank(workerId)) { + queryWrapper.lambda().like(ExamRegulation::getWorkerId, workerId); + } Page page = PageUtil.getPage(map); IPage pageList = examRegulationService.page(page, queryWrapper); return Result.success(pageList); @@ -204,4 +217,56 @@ public class ExamRegulationController { } return result; } + + /** + * 绑定人员 + * @param examRegulation + * @return + */ + @OperLog(operModul = "规章制度管理", operType = "编辑", operDesc = "绑定人员") + @ApiOperation(value = "绑定人员", notes = "绑定人员", httpMethod = "POST") + @PostMapping(value = "/bind") + public Result bind(@RequestBody ExamRegulation examRegulation) { + examRegulationService.bind(examRegulation); + return Result.ok(); + } + + /** + * 取消绑定 + * @param examRegulation + * @return + */ + @OperLog(operModul = "规章制度管理", operType = "编辑", operDesc = "取消绑定") + @ApiOperation(value = "取消绑定", notes = "取消绑定", httpMethod = "POST") + @PostMapping(value = "/unBind") + public Result unBind(@RequestBody ExamRegulation examRegulation) { + examRegulationService.unBind(examRegulation); + return Result.ok(); + } + + /** + * 查询绑定权限人员列表 + * + * @return + */ + @OperLog(operModul = "规章制度管理", operType = "分页查询", operDesc = "查询绑定权限人员列表") + @ApiOperation(value = " 查询绑定权限人员列表", notes = "查询绑定权限人员列表", httpMethod = "POST") + @ApiImplicitParams({ + @ApiImplicitParam(name = "pageNo", value = "页数", paramType = "body", required = true, defaultValue = "1", dataType = "Integer"), + @ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "body", required = true, defaultValue = "10", dataType = "Integer"), + @ApiImplicitParam(name = "id", value = "规章制度ID", paramType = "body", required = true, dataType = "String") + }) + @PostMapping(value = "/queryPageById") + public Result> queryPageById(@ApiIgnore @RequestBody Map map) { + String id = MapUtils.getString(map, "id"); + Page page = PageUtil.getPage(map); + ExamRegulation byId = examRegulationService.getById(id); + if (byId != null && byId.getWorkerId() != null) { + map.remove("id"); + map.put("workerIdList", new ArrayList<>(Arrays.asList(byId.getWorkerId().split(",")))); + List workerInfoList = workerInfoMapper.selectWorkerInfoList(page, map); + page.setRecords(workerInfoList); + } + return Result.success(page); + } } diff --git a/src/main/java/com/zhgd/xmgl/modules/exam/controller/ExamSafetyManualController.java b/src/main/java/com/zhgd/xmgl/modules/exam/controller/ExamSafetyManualController.java index 4ca6cbdfb..4c95ac45c 100644 --- a/src/main/java/com/zhgd/xmgl/modules/exam/controller/ExamSafetyManualController.java +++ b/src/main/java/com/zhgd/xmgl/modules/exam/controller/ExamSafetyManualController.java @@ -1,6 +1,11 @@ package com.zhgd.xmgl.modules.exam.controller; +import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.zhgd.annotation.OperLog; +import com.zhgd.xmgl.modules.exam.entity.ExamRegulation; +import com.zhgd.xmgl.modules.safetyhat.entity.SafetyHatDev; +import com.zhgd.xmgl.modules.worker.entity.WorkerInfo; +import com.zhgd.xmgl.modules.worker.mapper.WorkerInfoMapper; import com.zhgd.xmgl.security.entity.UserInfo; import com.zhgd.xmgl.security.util.SecurityUtils; import com.zhgd.xmgl.util.PageUtil; @@ -9,12 +14,11 @@ import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; -import java.util.Arrays; -import java.util.List; -import java.util.Map; +import java.util.*; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.net.URLDecoder; +import java.util.stream.Collectors; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -59,6 +63,9 @@ public class ExamSafetyManualController { @Autowired private IExamSafetyManualService examSafetyManualService; + @Autowired + private WorkerInfoMapper workerInfoMapper; + /** * 分页列表查询 * @@ -68,11 +75,17 @@ public class ExamSafetyManualController { @ApiOperation(value = " 分页列表查询安全手册信息", notes = "分页列表查询安全手册信息", httpMethod = "POST") @ApiImplicitParams({ @ApiImplicitParam(name = "pageNo", value = "页数", paramType = "body", required = true, defaultValue = "1", dataType = "Integer"), - @ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "body", required = true, defaultValue = "10", dataType = "Integer") + @ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "body", required = true, defaultValue = "10", dataType = "Integer"), + @ApiImplicitParam(name = "workerId", value = "劳务ID", paramType = "body", required = true, defaultValue = "10", dataType = "String") }) @PostMapping(value = "/page") public Result> queryPageList(@ApiIgnore @RequestBody Map map) { + String workerId = MapUtils.getString(map, "workerId"); + map.remove("workerId"); QueryWrapper queryWrapper = QueryGenerator.initPageQueryWrapper(ExamSafetyManual.class, map); + if (StringUtils.isNotBlank(workerId)) { + queryWrapper.lambda().like(ExamSafetyManual::getWorkerId, workerId); + } Page page = PageUtil.getPage(map); IPage pageList = examSafetyManualService.page(page, queryWrapper); return Result.success(pageList); @@ -204,4 +217,56 @@ public class ExamSafetyManualController { } return result; } + + /** + * 绑定人员 + * @param examSafetyManual + * @return + */ + @OperLog(operModul = "安全手册管理", operType = "编辑", operDesc = "绑定人员") + @ApiOperation(value = "绑定人员", notes = "绑定人员", httpMethod = "POST") + @PostMapping(value = "/bind") + public Result bind(@RequestBody ExamSafetyManual examSafetyManual) { + examSafetyManualService.bind(examSafetyManual); + return Result.ok(); + } + + /** + * 取消绑定 + * @param examSafetyManual + * @return + */ + @OperLog(operModul = "安全手册管理", operType = "编辑", operDesc = "取消绑定") + @ApiOperation(value = "取消绑定", notes = "取消绑定", httpMethod = "POST") + @PostMapping(value = "/unBind") + public Result unBind(@RequestBody ExamSafetyManual examSafetyManual) { + examSafetyManualService.unBind(examSafetyManual); + return Result.ok(); + } + + /** + * 查询绑定权限人员列表 + * + * @return + */ + @OperLog(operModul = "安全手册管理", operType = "分页查询", operDesc = "查询绑定权限人员列表") + @ApiOperation(value = " 查询绑定权限人员列表", notes = "查询绑定权限人员列表", httpMethod = "POST") + @ApiImplicitParams({ + @ApiImplicitParam(name = "pageNo", value = "页数", paramType = "body", required = true, defaultValue = "1", dataType = "Integer"), + @ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "body", required = true, defaultValue = "10", dataType = "Integer"), + @ApiImplicitParam(name = "id", value = "规章制度ID", paramType = "body", required = true, dataType = "String") + }) + @PostMapping(value = "/queryPageById") + public Result> queryPageById(@ApiIgnore @RequestBody Map map) { + String id = MapUtils.getString(map, "id"); + Page page = PageUtil.getPage(map); + ExamSafetyManual byId = examSafetyManualService.getById(id); + if (byId != null && byId.getWorkerId() != null) { + map.remove("id"); + map.put("workerIdList", new ArrayList<>(Arrays.asList(byId.getWorkerId().split(",")))); + List workerInfoList = workerInfoMapper.selectWorkerInfoList(page, map); + page.setRecords(workerInfoList); + } + return Result.success(page); + } } diff --git a/src/main/java/com/zhgd/xmgl/modules/exam/entity/ExamRegulation.java b/src/main/java/com/zhgd/xmgl/modules/exam/entity/ExamRegulation.java index 4ffd75fd3..e1a4c7561 100644 --- a/src/main/java/com/zhgd/xmgl/modules/exam/entity/ExamRegulation.java +++ b/src/main/java/com/zhgd/xmgl/modules/exam/entity/ExamRegulation.java @@ -2,10 +2,13 @@ package com.zhgd.xmgl.modules.exam.entity; import java.io.Serializable; import java.util.Date; +import java.util.List; import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import com.zhgd.xmgl.modules.worker.entity.WorkerInfo; import lombok.Data; import com.fasterxml.jackson.annotation.JsonFormat; import org.springframework.format.annotation.DateTimeFormat; @@ -79,4 +82,9 @@ public class ExamRegulation implements Serializable { @Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss") @ApiModelProperty(value = "修改时间") private Date updateTime; + /** + * 权限劳务人员ID + */ + @ApiModelProperty(value = "权限劳务人员ID") + private String workerId; } diff --git a/src/main/java/com/zhgd/xmgl/modules/exam/entity/ExamSafetyManual.java b/src/main/java/com/zhgd/xmgl/modules/exam/entity/ExamSafetyManual.java index d9b759312..13871ec6a 100644 --- a/src/main/java/com/zhgd/xmgl/modules/exam/entity/ExamSafetyManual.java +++ b/src/main/java/com/zhgd/xmgl/modules/exam/entity/ExamSafetyManual.java @@ -2,10 +2,13 @@ package com.zhgd.xmgl.modules.exam.entity; import java.io.Serializable; import java.util.Date; +import java.util.List; import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import com.zhgd.xmgl.modules.worker.entity.WorkerInfo; import lombok.Data; import com.fasterxml.jackson.annotation.JsonFormat; import org.springframework.format.annotation.DateTimeFormat; @@ -79,4 +82,14 @@ public class ExamSafetyManual implements Serializable { @Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss") @ApiModelProperty(value = "修改时间") private Date updateTime; + /** + * 权限劳务人员ID + */ + @Excel(name = "权限劳务人员ID", width = 20) + @ApiModelProperty(value = "权限劳务人员ID") + private String workerId; + + @TableField(exist = false) + @ApiModelProperty(value = "有权限的劳务人员列表") + private List workerInfoList; } diff --git a/src/main/java/com/zhgd/xmgl/modules/exam/service/IExamRegulationService.java b/src/main/java/com/zhgd/xmgl/modules/exam/service/IExamRegulationService.java index 73201bedd..44467e3d1 100644 --- a/src/main/java/com/zhgd/xmgl/modules/exam/service/IExamRegulationService.java +++ b/src/main/java/com/zhgd/xmgl/modules/exam/service/IExamRegulationService.java @@ -2,6 +2,7 @@ package com.zhgd.xmgl.modules.exam.service; import com.zhgd.xmgl.modules.exam.entity.ExamRegulation; import com.baomidou.mybatisplus.extension.service.IService; +import com.zhgd.xmgl.modules.safetyhat.entity.SafetyHatDev; /** * @Description: 规章制度 @@ -11,4 +12,7 @@ import com.baomidou.mybatisplus.extension.service.IService; */ public interface IExamRegulationService extends IService { + void bind(ExamRegulation examRegulation); + + void unBind(ExamRegulation examRegulation); } diff --git a/src/main/java/com/zhgd/xmgl/modules/exam/service/IExamSafetyManualService.java b/src/main/java/com/zhgd/xmgl/modules/exam/service/IExamSafetyManualService.java index d0227216a..9652bfca5 100644 --- a/src/main/java/com/zhgd/xmgl/modules/exam/service/IExamSafetyManualService.java +++ b/src/main/java/com/zhgd/xmgl/modules/exam/service/IExamSafetyManualService.java @@ -1,5 +1,6 @@ package com.zhgd.xmgl.modules.exam.service; +import com.zhgd.xmgl.modules.exam.entity.ExamRegulation; import com.zhgd.xmgl.modules.exam.entity.ExamSafetyManual; import com.baomidou.mybatisplus.extension.service.IService; @@ -11,4 +12,7 @@ import com.baomidou.mybatisplus.extension.service.IService; */ public interface IExamSafetyManualService extends IService { + void bind(ExamSafetyManual examSafetyManual); + + void unBind(ExamSafetyManual examSafetyManual); } diff --git a/src/main/java/com/zhgd/xmgl/modules/exam/service/impl/ExamRegulationServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/exam/service/impl/ExamRegulationServiceImpl.java index 637045acc..3fad3bcd3 100644 --- a/src/main/java/com/zhgd/xmgl/modules/exam/service/impl/ExamRegulationServiceImpl.java +++ b/src/main/java/com/zhgd/xmgl/modules/exam/service/impl/ExamRegulationServiceImpl.java @@ -1,12 +1,18 @@ package com.zhgd.xmgl.modules.exam.service.impl; +import com.baomidou.mybatisplus.core.toolkit.StringUtils; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.zhgd.xmgl.modules.exam.entity.ExamRegulation; import com.zhgd.xmgl.modules.exam.mapper.ExamRegulationMapper; import com.zhgd.xmgl.modules.exam.service.IExamRegulationService; +import com.zhgd.xmgl.modules.safetyhat.entity.SafetyHatDev; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import java.util.*; +import java.util.stream.Collectors; + /** * @Description: 规章制度 * @author: pengj @@ -16,4 +22,27 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @Service public class ExamRegulationServiceImpl extends ServiceImpl implements IExamRegulationService { + @Override + public void bind(ExamRegulation examRegulation) { + ExamRegulation byId = this.getById(examRegulation.getId()); + if (StringUtils.isNotBlank(byId.getWorkerId())) { + Set split = new HashSet(Arrays.asList(byId.getWorkerId().split(","))); + split.addAll(new HashSet(Arrays.asList(examRegulation.getWorkerId().split(",")))); + byId.setWorkerId(split.stream().collect(Collectors.joining(","))); + } else { + byId.setWorkerId(examRegulation.getWorkerId()); + } + this.updateById(byId); + } + + @Override + public void unBind(ExamRegulation examRegulation) { + ExamRegulation byId = this.getById(examRegulation.getId()); + if (StringUtils.isNotBlank(byId.getWorkerId())) { + Set split = new HashSet(Arrays.asList(byId.getWorkerId().split(","))); + split.removeAll(new HashSet(Arrays.asList(examRegulation.getWorkerId().split(",")))); + byId.setWorkerId(split.stream().collect(Collectors.joining(","))); + } + this.updateById(byId); + } } diff --git a/src/main/java/com/zhgd/xmgl/modules/exam/service/impl/ExamSafetyManualServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/exam/service/impl/ExamSafetyManualServiceImpl.java index 7db85b8d3..b43c3eb3e 100644 --- a/src/main/java/com/zhgd/xmgl/modules/exam/service/impl/ExamSafetyManualServiceImpl.java +++ b/src/main/java/com/zhgd/xmgl/modules/exam/service/impl/ExamSafetyManualServiceImpl.java @@ -1,5 +1,7 @@ package com.zhgd.xmgl.modules.exam.service.impl; +import com.baomidou.mybatisplus.core.toolkit.StringUtils; +import com.zhgd.xmgl.modules.exam.entity.ExamRegulation; import com.zhgd.xmgl.modules.exam.entity.ExamSafetyManual; import com.zhgd.xmgl.modules.exam.mapper.ExamSafetyManualMapper; import com.zhgd.xmgl.modules.exam.service.IExamSafetyManualService; @@ -7,6 +9,11 @@ import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; +import java.util.stream.Collectors; + /** * @Description: 安全手册 * @author: pengj @@ -16,4 +23,27 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @Service public class ExamSafetyManualServiceImpl extends ServiceImpl implements IExamSafetyManualService { + @Override + public void bind(ExamSafetyManual examSafetyManual) { + ExamSafetyManual byId = this.getById(examSafetyManual.getId()); + if (StringUtils.isNotBlank(byId.getWorkerId())) { + Set split = new HashSet(Arrays.asList(byId.getWorkerId().split(","))); + split.addAll(new HashSet(Arrays.asList(examSafetyManual.getWorkerId().split(",")))); + byId.setWorkerId(split.stream().collect(Collectors.joining(","))); + } else { + byId.setWorkerId(examSafetyManual.getWorkerId()); + } + this.updateById(byId); + } + + @Override + public void unBind(ExamSafetyManual examSafetyManual) { + ExamSafetyManual byId = this.getById(examSafetyManual.getId()); + if (StringUtils.isNotBlank(byId.getWorkerId())) { + Set split = new HashSet(Arrays.asList(byId.getWorkerId().split(","))); + split.removeAll(new HashSet(Arrays.asList(examSafetyManual.getWorkerId().split(",")))); + byId.setWorkerId(split.stream().collect(Collectors.joining(","))); + } + this.updateById(byId); + } } diff --git a/src/main/java/com/zhgd/xmgl/modules/safetyhat/controller/SafetyHatAlarmConfigController.java b/src/main/java/com/zhgd/xmgl/modules/safetyhat/controller/SafetyHatAlarmConfigController.java new file mode 100644 index 000000000..62dd515a7 --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/safetyhat/controller/SafetyHatAlarmConfigController.java @@ -0,0 +1,181 @@ +package com.zhgd.xmgl.modules.safetyhat.controller; + +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.zhgd.annotation.OperLog; +import com.zhgd.xmgl.util.PageUtil; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLDecoder; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import com.zhgd.jeecg.common.api.vo.Result; +import com.zhgd.jeecg.common.system.query.QueryGenerator; +import com.zhgd.jeecg.common.util.oConvertUtils; +import com.zhgd.xmgl.modules.safetyhat.entity.SafetyHatAlarmConfig; +import com.zhgd.xmgl.modules.safetyhat.service.ISafetyHatAlarmConfigService; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.extern.slf4j.Slf4j; + +import org.apache.commons.collections.MapUtils; +import org.jeecgframework.poi.excel.ExcelImportUtil; +import org.jeecgframework.poi.excel.def.NormalExcelConstants; +import org.jeecgframework.poi.excel.entity.ExportParams; +import org.jeecgframework.poi.excel.entity.ImportParams; +import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.multipart.MultipartHttpServletRequest; +import org.springframework.web.servlet.ModelAndView; +import com.alibaba.fastjson.JSON; +import springfox.documentation.annotations.ApiIgnore; + + +/** + * @Title: Controller + * @Description: 安全帽报警配置 + * @author: pengj + * @date: 2025-05-13 + * @version: V1.0 + */ +@RestController +@RequestMapping("/xmgl/safetyHatAlarmConfig") +@Slf4j +@Api(tags = "安全帽报警配置管理") +public class SafetyHatAlarmConfigController { + @Autowired + private ISafetyHatAlarmConfigService safetyHatAlarmConfigService; + + /** + * 分页列表查询 + * + * @return + */ + @OperLog(operModul = "安全帽报警配置管理", operType = "分页查询", operDesc = "分页列表查询安全帽报警配置信息") + @ApiOperation(value = " 分页列表查询安全帽报警配置信息", notes = "分页列表查询安全帽报警配置信息", httpMethod = "POST") + @ApiImplicitParams({ + @ApiImplicitParam(name = "pageNo", value = "页数", paramType = "body", required = true, defaultValue = "1", dataType = "Integer"), + @ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "body", required = true, defaultValue = "10", dataType = "Integer") + }) + @PostMapping(value = "/page") + public Result> queryPageList(@ApiIgnore @RequestBody Map map) { + QueryWrapper queryWrapper = QueryGenerator.initPageQueryWrapper(SafetyHatAlarmConfig.class, map); + Page page = PageUtil.getPage(map); + IPage pageList = safetyHatAlarmConfigService.page(page, queryWrapper); + return Result.success(pageList); + } + + /** + * 列表查询 + * + * @param safetyHatAlarmConfig + * @return + */ + @OperLog(operModul = "安全帽报警配置管理", operType = "列表查询", operDesc = "列表查询安全帽报警配置信息") + @ApiOperation(value = " 列表查询安全帽报警配置信息", notes = "列表查询安全帽报警配置信息", httpMethod = "POST") + @PostMapping(value = "/list") + public Result> queryList(@RequestBody SafetyHatAlarmConfig safetyHatAlarmConfig) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(safetyHatAlarmConfig); + List list = safetyHatAlarmConfigService.list(queryWrapper); + return Result.success(list); + } + + + /** + * 添加 + * + * @param safetyHatAlarmConfig + * @return + */ + @OperLog(operModul = "安全帽报警配置管理", operType = "新增", operDesc = "添加安全帽报警配置信息") + @ApiOperation(value = " 添加安全帽报警配置信息", notes = "添加安全帽报警配置信息", httpMethod = "POST") + @PostMapping(value = "/add") + public Result add(@RequestBody SafetyHatAlarmConfig safetyHatAlarmConfig) { + Result result = new Result(); + safetyHatAlarmConfigService.save(safetyHatAlarmConfig); + return Result.success("添加成功!"); + } + + /** + * 编辑 + * + * @param safetyHatAlarmConfig + * @return + */ + @OperLog(operModul = "安全帽报警配置管理", operType = "修改", operDesc = "编辑安全帽报警配置信息") + @ApiOperation(value = "编辑安全帽报警配置信息", notes = "编辑安全帽报警配置信息", httpMethod = "POST") + @PostMapping(value = "/edit") + public Result edit(@RequestBody SafetyHatAlarmConfig safetyHatAlarmConfig) { + Result result = new Result(); + SafetyHatAlarmConfig safetyHatAlarmConfigEntity = safetyHatAlarmConfigService.getById(safetyHatAlarmConfig.getId()); + if (safetyHatAlarmConfigEntity == null) { + result.error500("未找到对应实体"); + } else { + boolean ok = safetyHatAlarmConfigService.updateById(safetyHatAlarmConfig); + if (ok) { + result.success("修改成功!"); + } else { + result.success("操作失败!"); + } + } + + return result; + } + + + /** + * 通过id查询 + * + * @return + */ + @OperLog(operModul = "安全帽报警配置管理", operType = "查询", operDesc = "通过id查询安全帽报警配置信息") + @ApiOperation(value = "通过id查询安全帽报警配置信息", notes = "通过id查询安全帽报警配置信息", httpMethod = "POST") + @ApiImplicitParam(name = "id", value = "安全帽报警配置ID", paramType = "body", required = true, dataType = "Integer") + @PostMapping(value = "/queryById") + public Result queryById(@ApiIgnore @RequestBody Map map) { + Result result = new Result(); + SafetyHatAlarmConfig safetyHatAlarmConfig = safetyHatAlarmConfigService.getById(MapUtils.getString(map, "id")); + if (safetyHatAlarmConfig == null) { + result.error500("未找到对应实体"); + } else { + result.setResult(safetyHatAlarmConfig); + result.setSuccess(true); + } + return result; + } + + /** + * 通过SN查询 + * + * @return + */ + @OperLog(operModul = "安全帽报警配置管理", operType = "查询", operDesc = "通过SN查询") + @ApiOperation(value = "通过SN查询", notes = "通过id查询安全帽报警配置信息", httpMethod = "POST") + @ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "body", required = true, dataType = "Integer") + @PostMapping(value = "/queryBySn") + public Result queryBySn(@ApiIgnore @RequestBody Map map) { + Result result = new Result(); + SafetyHatAlarmConfig safetyHatAlarmConfig = safetyHatAlarmConfigService.getOne(Wrappers.lambdaQuery() + .eq(SafetyHatAlarmConfig::getProjectSn, MapUtils.getString(map, "projectSn"))); + if (safetyHatAlarmConfig == null) { + result.error500("未找到对应实体"); + } else { + result.setResult(safetyHatAlarmConfig); + result.setSuccess(true); + } + return result; + } +} diff --git a/src/main/java/com/zhgd/xmgl/modules/safetyhat/controller/SafetyHatDataController.java b/src/main/java/com/zhgd/xmgl/modules/safetyhat/controller/SafetyHatDataController.java index 387eb3176..9258a6053 100644 --- a/src/main/java/com/zhgd/xmgl/modules/safetyhat/controller/SafetyHatDataController.java +++ b/src/main/java/com/zhgd/xmgl/modules/safetyhat/controller/SafetyHatDataController.java @@ -8,6 +8,7 @@ import com.zhgd.annotation.OperLog; import com.zhgd.jeecg.common.api.vo.Result; import com.zhgd.xmgl.modules.safetyhat.entity.SafetyHatData; import com.zhgd.xmgl.modules.safetyhat.entity.SafetyHatDev; +import com.zhgd.xmgl.modules.safetyhat.entity.vo.WorkerListyByRegionVo; import com.zhgd.xmgl.modules.safetyhat.entity.vo.WorkerNumByRegionVo; import com.zhgd.xmgl.modules.safetyhat.service.ISafetyHatDataService; import com.zhgd.xmgl.modules.worker.entity.WorkerInfo; @@ -18,6 +19,7 @@ import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections.MapUtils; +import org.apache.ibatis.annotations.Param; import org.simpleframework.xml.core.Validate; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -210,4 +212,15 @@ public class SafetyHatDataController { return Result.success(safetyHatDataService.countWorkerNumByRegion(param)); } + + @OperLog(operModul = "智能安全帽实时数据管理", operType = "查询", operDesc = "区域人员列表") + @ApiOperation(value = "区域人员列表", notes = "区域人员列表", httpMethod = "POST") + @ApiImplicitParams({ + @ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "body", required = true, dataType = "String"), + @ApiImplicitParam(name = "regionId", value = "区域ID", paramType = "body", required = true, dataType = "String") + }) + @PostMapping(value = "/getWorkerListByRegion") + public Result getWorkerListByRegion(@ApiIgnore @RequestBody Map param) { + return Result.success(safetyHatDataService.getWorkerListByRegion(param)); + } } diff --git a/src/main/java/com/zhgd/xmgl/modules/safetyhat/controller/SafetyHatDevController.java b/src/main/java/com/zhgd/xmgl/modules/safetyhat/controller/SafetyHatDevController.java index 8b9a124f2..3c0b3721d 100644 --- a/src/main/java/com/zhgd/xmgl/modules/safetyhat/controller/SafetyHatDevController.java +++ b/src/main/java/com/zhgd/xmgl/modules/safetyhat/controller/SafetyHatDevController.java @@ -1,4 +1,4 @@ -package com.zhgd.xmgl.modules.safetyhat.controller; + package com.zhgd.xmgl.modules.safetyhat.controller; import com.baomidou.mybatisplus.core.metadata.IPage; import com.zhgd.annotation.OperLog; @@ -177,4 +177,30 @@ public class SafetyHatDevController { safetyHatDevService.importExcelTemplate(file, projectSn); return Result.ok(); } + + /** + * 设备绑定围栏 + * @param safetyHatDev + * @return + */ + @OperLog(operModul = "智能安全帽设备管理", operType = "编辑", operDesc = "设备绑定围栏") + @ApiOperation(value = "设备绑定围栏", notes = "设备绑定围栏", httpMethod = "POST") + @PostMapping(value = "/bind") + public Result bind(@RequestBody SafetyHatDev safetyHatDev) { + safetyHatDevService.bind(safetyHatDev); + return Result.ok(); + } + + /** + * 取消绑定 + * @param safetyHatDev + * @return + */ + @OperLog(operModul = "智能安全帽设备管理", operType = "编辑", operDesc = "取消绑定") + @ApiOperation(value = "取消绑定", notes = "取消绑定", httpMethod = "POST") + @PostMapping(value = "/unBind") + public Result unBind(@RequestBody SafetyHatDev safetyHatDev) { + safetyHatDevService.unBind(safetyHatDev); + return Result.ok(); + } } diff --git a/src/main/java/com/zhgd/xmgl/modules/safetyhat/entity/SafetyHatAlarmConfig.java b/src/main/java/com/zhgd/xmgl/modules/safetyhat/entity/SafetyHatAlarmConfig.java new file mode 100644 index 000000000..25271eb38 --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/safetyhat/entity/SafetyHatAlarmConfig.java @@ -0,0 +1,52 @@ +package com.zhgd.xmgl.modules.safetyhat.entity; + +import java.io.Serializable; +import java.util.Date; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.format.annotation.DateTimeFormat; +import org.jeecgframework.poi.excel.annotation.Excel; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * @Description: 安全帽报警配置 + * @author: pengj + * @date: 2025-05-13 + * @version: V1.0 + */ +@Data +@TableName("safety_hat_alarm_config") +@ApiModel(value = "SafetyHatAlarmConfig实体类", description = "SafetyHatAlarmConfig") +public class SafetyHatAlarmConfig implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId(type = IdType.ASSIGN_ID) + @ApiModelProperty(value = "id") + private Long id; + + @ApiModelProperty(value = "SOS是否启用(0:未启用;1:已启用)") + private Integer sosEnable; + + @ApiModelProperty(value = "离开工作区域(0:未启用;1:已启用)") + private Integer leaveEnable; + + @ApiModelProperty(value = "报警人员非法闯入区域报警是否启用(0:未启用;1:已启用)") + private Integer illegalEnable; + + @ApiModelProperty(value = "区域超员999人报警是否启用(0:未启用;1:已启用)") + private Integer numEnable; + + @ApiModelProperty(value = "区域超员999人报警人员数量") + private Integer numCount; + + @ApiModelProperty(value = "项目SN") + private String projectSn; +} diff --git a/src/main/java/com/zhgd/xmgl/modules/safetyhat/entity/SafetyHatDev.java b/src/main/java/com/zhgd/xmgl/modules/safetyhat/entity/SafetyHatDev.java index 01d850288..432b00957 100644 --- a/src/main/java/com/zhgd/xmgl/modules/safetyhat/entity/SafetyHatDev.java +++ b/src/main/java/com/zhgd/xmgl/modules/safetyhat/entity/SafetyHatDev.java @@ -98,4 +98,56 @@ public class SafetyHatDev implements Serializable { @TableField(exist = false) private java.lang.String workerName; + /** + * 围栏名称 + */ + @Excel(name = "围栏名称", width = 15) + @ApiModelProperty(value = "围栏名称") + @TableField(exist = false) + private java.lang.String fenceName; + + /** + * 围栏ID + */ + @Excel(name = "围栏ID", width = 15) + @ApiModelProperty(value = "围栏ID") + private java.lang.String fenceId; + + /** + * 班组ID + */ + @Excel(name = "班组ID", width = 15) + @ApiModelProperty(value = "班组ID") + @TableField(exist = false) + private java.lang.String teamId; + + /** + * 部门ID + */ + @Excel(name = "部门ID", width = 15) + @ApiModelProperty(value = "部门ID") + @TableField(exist = false) + private java.lang.String deptId; + + + @TableField(exist = false) + @ApiModelProperty(value = "身份证号") + private java.lang.String idCard; + + @TableField(exist = false) + @ApiModelProperty(value = "班组") + private java.lang.String teamName; + + @TableField(exist = false) + @ApiModelProperty(value = "部门") + private java.lang.String departmentName; + + @TableField(exist = false) + @ApiModelProperty(value = "工种") + private java.lang.String typeName; + + @TableField(exist = false) + @ApiModelProperty(value = "进场日期") + private java.lang.String enterDate; + } diff --git a/src/main/java/com/zhgd/xmgl/modules/safetyhat/entity/SafetyHatFence.java b/src/main/java/com/zhgd/xmgl/modules/safetyhat/entity/SafetyHatFence.java index 138c75a6f..3a5fa400a 100644 --- a/src/main/java/com/zhgd/xmgl/modules/safetyhat/entity/SafetyHatFence.java +++ b/src/main/java/com/zhgd/xmgl/modules/safetyhat/entity/SafetyHatFence.java @@ -97,6 +97,10 @@ public class SafetyHatFence implements Serializable { @ApiModelProperty(value = "围栏内人数") private Integer workerNum; + @TableField(exist = false) + @ApiModelProperty(value = "围栏内违法人数") + private Integer illegalNum; + @TableField(exist = false) @ApiModelProperty(value = "围栏内人员列表") private List workerListInFence; diff --git a/src/main/java/com/zhgd/xmgl/modules/safetyhat/entity/vo/SafetyHatDevExport.java b/src/main/java/com/zhgd/xmgl/modules/safetyhat/entity/vo/SafetyHatDevExport.java new file mode 100644 index 000000000..ae679b9ba --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/safetyhat/entity/vo/SafetyHatDevExport.java @@ -0,0 +1,32 @@ +package com.zhgd.xmgl.modules.safetyhat.entity.vo; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; + + +@Data +public class SafetyHatDevExport { + + + @Excel(name = "人员名称", width = 15) + @ApiModelProperty(value = "人员名称") + private String workerName; + + @Excel(name = "设备序号", width = 15) + @ApiModelProperty(value = "设备序号") + private String devSn; + + @Excel(name = "分包单位", width = 15) + @ApiModelProperty(value = "分包单位") + private String enterpriseName; +} diff --git a/src/main/java/com/zhgd/xmgl/modules/safetyhat/entity/vo/WorkerListyByRegionVo.java b/src/main/java/com/zhgd/xmgl/modules/safetyhat/entity/vo/WorkerListyByRegionVo.java new file mode 100644 index 000000000..06a1ae123 --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/safetyhat/entity/vo/WorkerListyByRegionVo.java @@ -0,0 +1,17 @@ +package com.zhgd.xmgl.modules.safetyhat.entity.vo; + +import com.zhgd.xmgl.modules.worker.entity.WorkerInfo; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +@Data +public class WorkerListyByRegionVo { + + @ApiModelProperty(value = "合法人员信息") + private List list; + + @ApiModelProperty(value = "非法人员信息") + private List list1; +} diff --git a/src/main/java/com/zhgd/xmgl/modules/safetyhat/entity/vo/WorkerNumAndRegionName.java b/src/main/java/com/zhgd/xmgl/modules/safetyhat/entity/vo/WorkerNumAndRegionName.java index 77f5007eb..781e86e2c 100644 --- a/src/main/java/com/zhgd/xmgl/modules/safetyhat/entity/vo/WorkerNumAndRegionName.java +++ b/src/main/java/com/zhgd/xmgl/modules/safetyhat/entity/vo/WorkerNumAndRegionName.java @@ -1,11 +1,16 @@ package com.zhgd.xmgl.modules.safetyhat.entity.vo; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; @Data public class WorkerNumAndRegionName { private String date; private Integer workerNum; + private Integer illegalNum; private String regionName; + private Long regionId; + private String fenceShape; + private String fenceShapeArr; } diff --git a/src/main/java/com/zhgd/xmgl/modules/safetyhat/mapper/SafetyHatAlarmConfigMapper.java b/src/main/java/com/zhgd/xmgl/modules/safetyhat/mapper/SafetyHatAlarmConfigMapper.java new file mode 100644 index 000000000..0fc3fcbb7 --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/safetyhat/mapper/SafetyHatAlarmConfigMapper.java @@ -0,0 +1,19 @@ +package com.zhgd.xmgl.modules.safetyhat.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import com.zhgd.xmgl.modules.safetyhat.entity.SafetyHatAlarmConfig; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Description: 安全帽报警配置 + * @author: pengj + * @date: 2025-05-13 + * @version: V1.0 + */ +@Mapper +public interface SafetyHatAlarmConfigMapper extends BaseMapper { + +} diff --git a/src/main/java/com/zhgd/xmgl/modules/safetyhat/mapper/xml/SafetyHatAlarmConfigMapper.xml b/src/main/java/com/zhgd/xmgl/modules/safetyhat/mapper/xml/SafetyHatAlarmConfigMapper.xml new file mode 100644 index 000000000..4bb9570d8 --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/safetyhat/mapper/xml/SafetyHatAlarmConfigMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/src/main/java/com/zhgd/xmgl/modules/safetyhat/mapper/xml/SafetyHatAlarmConfigServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/safetyhat/mapper/xml/SafetyHatAlarmConfigServiceImpl.java new file mode 100644 index 000000000..d452996f6 --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/safetyhat/mapper/xml/SafetyHatAlarmConfigServiceImpl.java @@ -0,0 +1,19 @@ +package com.zhgd.xmgl.modules.safetyhat.mapper.xml; + +import com.zhgd.xmgl.modules.safetyhat.entity.SafetyHatAlarmConfig; +import com.zhgd.xmgl.modules.safetyhat.mapper.SafetyHatAlarmConfigMapper; +import com.zhgd.xmgl.modules.safetyhat.service.ISafetyHatAlarmConfigService; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * @Description: 安全帽报警配置 + * @author: pengj + * @date: 2025-05-13 + * @version: V1.0 + */ +@Service +public class SafetyHatAlarmConfigServiceImpl extends ServiceImpl implements ISafetyHatAlarmConfigService { + +} diff --git a/src/main/java/com/zhgd/xmgl/modules/safetyhat/mapper/xml/SafetyHatDevMapper.xml b/src/main/java/com/zhgd/xmgl/modules/safetyhat/mapper/xml/SafetyHatDevMapper.xml index f9d057382..34f3763c6 100644 --- a/src/main/java/com/zhgd/xmgl/modules/safetyhat/mapper/xml/SafetyHatDevMapper.xml +++ b/src/main/java/com/zhgd/xmgl/modules/safetyhat/mapper/xml/SafetyHatDevMapper.xml @@ -2,9 +2,13 @@ diff --git a/src/main/java/com/zhgd/xmgl/modules/safetyhat/service/ISafetyHatAlarmConfigService.java b/src/main/java/com/zhgd/xmgl/modules/safetyhat/service/ISafetyHatAlarmConfigService.java new file mode 100644 index 000000000..4a0d34604 --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/safetyhat/service/ISafetyHatAlarmConfigService.java @@ -0,0 +1,14 @@ +package com.zhgd.xmgl.modules.safetyhat.service; + +import com.zhgd.xmgl.modules.safetyhat.entity.SafetyHatAlarmConfig; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * @Description: 安全帽报警配置 + * @author: pengj + * @date: 2025-05-13 + * @version: V1.0 + */ +public interface ISafetyHatAlarmConfigService extends IService { + +} diff --git a/src/main/java/com/zhgd/xmgl/modules/safetyhat/service/ISafetyHatDataService.java b/src/main/java/com/zhgd/xmgl/modules/safetyhat/service/ISafetyHatDataService.java index 553eafaa9..b6db97b52 100644 --- a/src/main/java/com/zhgd/xmgl/modules/safetyhat/service/ISafetyHatDataService.java +++ b/src/main/java/com/zhgd/xmgl/modules/safetyhat/service/ISafetyHatDataService.java @@ -4,7 +4,9 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.IService; import com.zhgd.xmgl.modules.safetyhat.entity.SafetyHatData; import com.zhgd.xmgl.modules.safetyhat.entity.SafetyHatDev; +import com.zhgd.xmgl.modules.safetyhat.entity.vo.WorkerListyByRegionVo; import com.zhgd.xmgl.modules.safetyhat.entity.vo.WorkerNumByRegionVo; +import com.zhgd.xmgl.modules.worker.entity.WorkerInfo; import java.util.HashMap; import java.util.List; @@ -96,4 +98,6 @@ public interface ISafetyHatDataService extends IService { * @return */ List countWorkerNumByRegion(Map param); + + WorkerListyByRegionVo getWorkerListByRegion(Map param); } diff --git a/src/main/java/com/zhgd/xmgl/modules/safetyhat/service/ISafetyHatDevService.java b/src/main/java/com/zhgd/xmgl/modules/safetyhat/service/ISafetyHatDevService.java index 2e53cba93..3a472b321 100644 --- a/src/main/java/com/zhgd/xmgl/modules/safetyhat/service/ISafetyHatDevService.java +++ b/src/main/java/com/zhgd/xmgl/modules/safetyhat/service/ISafetyHatDevService.java @@ -5,7 +5,9 @@ import com.baomidou.mybatisplus.extension.service.IService; import com.zhgd.xmgl.modules.safetyhat.entity.SafetyHatDev; import com.zhgd.xmgl.modules.vehicleposition.entity.vo.CountVehiclePositionDevVo; import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.servlet.ModelAndView; +import javax.servlet.http.HttpServletResponse; import java.util.HashMap; import java.util.List; @@ -66,4 +68,11 @@ public interface ISafetyHatDevService extends IService { * @throws Exception */ void importExcelTemplate(MultipartFile excelFile, String projectSn) throws Exception; + + + ModelAndView exporExcelSafeDevTemplate(HttpServletResponse response, String projectSn); + + void bind(SafetyHatDev safetyHatDev); + + void unBind(SafetyHatDev safetyHatDev); } diff --git a/src/main/java/com/zhgd/xmgl/modules/safetyhat/service/impl/SafetyHatAlarmServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/safetyhat/service/impl/SafetyHatAlarmServiceImpl.java index 837078cae..b24c8bdb2 100644 --- a/src/main/java/com/zhgd/xmgl/modules/safetyhat/service/impl/SafetyHatAlarmServiceImpl.java +++ b/src/main/java/com/zhgd/xmgl/modules/safetyhat/service/impl/SafetyHatAlarmServiceImpl.java @@ -4,6 +4,7 @@ import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.zhgd.jeecg.common.execption.OpenAlertException; @@ -12,9 +13,12 @@ import com.zhgd.xmgl.base.entity.vo.TrendOneVo; import com.zhgd.xmgl.base.entity.vo.TrendVo; import com.zhgd.xmgl.enums.ParamEnum; import com.zhgd.xmgl.modules.safetyhat.entity.SafetyHatAlarm; +import com.zhgd.xmgl.modules.safetyhat.entity.SafetyHatAlarmConfig; import com.zhgd.xmgl.modules.safetyhat.entity.SafetyHatDev; +import com.zhgd.xmgl.modules.safetyhat.mapper.SafetyHatAlarmConfigMapper; import com.zhgd.xmgl.modules.safetyhat.mapper.SafetyHatAlarmMapper; import com.zhgd.xmgl.modules.safetyhat.mapper.SafetyHatDevMapper; +import com.zhgd.xmgl.modules.safetyhat.service.ISafetyHatAlarmConfigService; import com.zhgd.xmgl.modules.safetyhat.service.ISafetyHatAlarmService; import com.zhgd.xmgl.util.DateUtils; import com.zhgd.xmgl.util.PageUtil; @@ -44,6 +48,9 @@ public class SafetyHatAlarmServiceImpl extends ServiceImpl queryPageList(HashMap paramMap) { QueryWrapper queryWrapper = getQueryWrapper(paramMap); @@ -82,6 +89,13 @@ public class SafetyHatAlarmServiceImpl extends ServiceImpllambdaQuery() + .eq(SafetyHatAlarmConfig::getProjectSn, dev.getProjectSn())); + if (safetyHatAlarm.getAlarmType() == ParamEnum.SafetyHatAlarmAlarmType.SOSBJ.getValue() && + safetyHatAlarmConfig != null && safetyHatAlarmConfig.getSosEnable() == 0) { + return; + } String str = ParamEnum.getStr(ParamEnum.SafetyHatAlarmAlarmType.values(), safetyHatAlarm.getAlarmType()); safetyHatAlarm.setAlarmInfo(str); safetyHatAlarm.setWorkerInfoId(dev.getWorkerInfoId()); diff --git a/src/main/java/com/zhgd/xmgl/modules/safetyhat/service/impl/SafetyHatDataServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/safetyhat/service/impl/SafetyHatDataServiceImpl.java index 5c82529b6..b303f371d 100644 --- a/src/main/java/com/zhgd/xmgl/modules/safetyhat/service/impl/SafetyHatDataServiceImpl.java +++ b/src/main/java/com/zhgd/xmgl/modules/safetyhat/service/impl/SafetyHatDataServiceImpl.java @@ -10,24 +10,32 @@ import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.google.common.collect.Lists; import com.zhgd.jeecg.common.execption.OpenAlertException; import com.zhgd.jeecg.common.system.query.QueryGenerator; import com.zhgd.xmgl.constant.Cts; +import com.zhgd.xmgl.enums.ParamEnum; import com.zhgd.xmgl.modules.project.entity.Project; import com.zhgd.xmgl.modules.project.mapper.ProjectMapper; import com.zhgd.xmgl.modules.safetyhat.entity.*; +import com.zhgd.xmgl.modules.safetyhat.entity.vo.WorkerListyByRegionVo; import com.zhgd.xmgl.modules.safetyhat.entity.vo.WorkerNumAndRegionName; import com.zhgd.xmgl.modules.safetyhat.entity.vo.WorkerNumByRegionVo; import com.zhgd.xmgl.modules.safetyhat.mapper.*; import com.zhgd.xmgl.modules.safetyhat.service.ISafetyHatAlarmService; import com.zhgd.xmgl.modules.safetyhat.service.ISafetyHatDataService; +import com.zhgd.xmgl.modules.worker.entity.WorkerAttendanceRule; +import com.zhgd.xmgl.modules.worker.entity.WorkerInfo; +import com.zhgd.xmgl.modules.worker.mapper.WorkerAttendanceRuleMapper; +import com.zhgd.xmgl.modules.worker.mapper.WorkerInfoMapper; import com.zhgd.xmgl.util.*; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections.MapUtils; import org.apache.commons.lang3.StringUtils; +import org.apache.ibatis.annotations.Param; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -61,6 +69,12 @@ public class SafetyHatDataServiceImpl extends ServiceImpl queryPageList(HashMap paramMap) { @@ -126,6 +140,10 @@ public class SafetyHatDataServiceImpl extends ServiceImpl fenceList = safetyHatFenceMapper.selectList(new LambdaQueryWrapper() .eq(SafetyHatFence::getProjectSn, dev.getProjectSn())); + + SafetyHatAlarmConfig safetyHatAlarmConfig = safetyHatAlarmConfigMapper.selectOne(Wrappers.lambdaQuery() + .eq(SafetyHatAlarmConfig::getProjectSn, dev.getProjectSn())); + if (CollUtil.isNotEmpty(fenceList)) { boolean isInFence = false; boolean inFence = false; @@ -150,16 +168,47 @@ public class SafetyHatDataServiceImpl extends ServiceImpl 0) { + SafetyHatAlarm alarm = new SafetyHatAlarm(); + alarm.setDevSn(dev.getDevSn()); + alarm.setAlarmTime(new Date()); + alarm.setAlarmType(2); + alarm.setLatitude(safetyHatData.getLatitude()); + alarm.setLongitude(safetyHatData.getLongitude()); + safetyHatAlarmService.add(alarm); + } } } } @@ -294,16 +343,28 @@ public class SafetyHatDataServiceImpl extends ServiceImpl dateList = DateUtils.getDateTimeStrList(60, "yyyy-MM-dd"); + List safetyHatDevs = safetyHatDevMapper.selectList(Wrappers.lambdaQuery().eq(SafetyHatDev::getProjectSn, projectSn)); for (String date : dateList) { List list = new ArrayList<>(); for (SafetyHatFence region : regions) { List datas1 = datas.stream().filter(safetyHatData -> DateUtil.compare(safetyHatData.getUploadTime(), DateUtil.beginOfDay(DateUtil.parse(date))) >= 0 && DateUtil.compare(safetyHatData.getUploadTime(), DateUtil.endOfDay(DateUtil.parse(date))) <= 0).collect(Collectors.toList()); - int workerNum = getWorkerNumInFence(region, datas1); + Set workerSet = getWorkerNumInFence(region, datas1); + int illegalNum = 0; + for (Long workerId : workerSet) { + List collect = safetyHatDevs.stream().filter(s -> s.getWorkerInfoId().toString().equals(workerId.toString())).collect(Collectors.toList()); + if (collect.size() == 0 || !Arrays.asList(collect.get(0).getFenceId().split(",")).contains(region.getId().toString())) { + illegalNum = illegalNum + 1; + } + } WorkerNumAndRegionName workerNumAndRegionName = new WorkerNumAndRegionName(); - workerNumAndRegionName.setWorkerNum(workerNum); + workerNumAndRegionName.setWorkerNum(workerSet.size()); + workerNumAndRegionName.setIllegalNum(illegalNum); workerNumAndRegionName.setDate(date); workerNumAndRegionName.setRegionName(region.getRegionName()); + workerNumAndRegionName.setRegionId(region.getId()); + workerNumAndRegionName.setFenceShape(region.getFenceShape()); + workerNumAndRegionName.setFenceShapeArr(region.getFenceShapeArr()); list.add(workerNumAndRegionName); } WorkerNumByRegionVo oneVo = new WorkerNumByRegionVo(); @@ -315,8 +376,40 @@ public class SafetyHatDataServiceImpl extends ServiceImpl datas) { - int workerNum = 0; + @Override + public WorkerListyByRegionVo getWorkerListByRegion(Map param) { + String projectSn = MapUtils.getString(param, "projectSn"); + String regionId = MapUtils.getString(param, "regionId"); + SafetyHatFence safetyHatFence = safetyHatFenceMapper.selectById(regionId); + List safetyHatDevs = safetyHatDevMapper.selectList(Wrappers.lambdaQuery().like(SafetyHatDev::getFenceId, regionId)); + // 区域绑定的人员 + List bindWorkerIds = safetyHatDevs.stream().map(s -> s.getWorkerInfoId()).collect(Collectors.toList()); + // 今天进入区域人员 + List datas = safetyHatDataMapper.getNewestDataGroupByProjectSn(projectSn); + // 在区域中的人员 + Set workerSet = getWorkerNumInFence(safetyHatFence, datas); + Set allWorker = new HashSet<>(); + allWorker.addAll(workerSet); + allWorker.addAll(bindWorkerIds); + allWorker.add(-1L); + param.put("workerIdList", allWorker); + List workerInfoList = workerInfoMapper.selectWorkerInfoList(new Page<>(-1, -1), param); + WorkerListyByRegionVo vo = new WorkerListyByRegionVo(); + List collect = workerInfoList.stream().filter(w -> bindWorkerIds.contains(w.getId())).collect(Collectors.toList()); + for (WorkerInfo workerInfo : collect) { + workerInfo.setInserviceType(workerSet.contains(workerInfo.getId()) ? 1 : 2); + } + collect.sort((a,b) -> a.getInserviceType().compareTo(b.getInserviceType())); + vo.setList(collect); + List collect1 = workerInfoList.stream().filter(w -> !bindWorkerIds.contains(w.getId()) && workerSet.contains(w.getId())).collect(Collectors.toList()); + for (WorkerInfo workerInfo : collect1) { + workerInfo.setInserviceType(1); + } + vo.setList1(collect1); + return vo; + } + + private Set getWorkerNumInFence(SafetyHatFence fence, List datas) { Set inWorkerSet = new HashSet<>(); for (SafetyHatData d : datas) { boolean inFence = false; @@ -339,12 +432,10 @@ public class SafetyHatDataServiceImpl extends ServiceImpl queryPageList(HashMap paramMap) { + String fenceId = MapUtils.getString(paramMap, "fenceId"); + String workerName = MapUtils.getString(paramMap, "workerName"); + String enterpriseId = MapUtils.getString(paramMap, "enterpriseId"); + String teamId = MapUtils.getString(paramMap, "teamId"); + String departmentId = MapUtils.getString(paramMap, "departmentId"); + paramMap.remove("fenceId"); QueryWrapper queryWrapper = getQueryWrapper(paramMap); Page page = PageUtil.getPage(paramMap); + if (StringUtils.isNotBlank(fenceId)) { + queryWrapper.like("shd.fence_id", fenceId); + } + if (StringUtils.isNotBlank(workerName)) { + queryWrapper.like("wi.worker_name", workerName); + } + if (StringUtils.isNotBlank(enterpriseId)) { + queryWrapper.in("en.id", new ArrayList<>(Arrays.asList(enterpriseId.split(",")))); + } + if (StringUtils.isNotBlank(teamId)) { + queryWrapper.in("b.id", new ArrayList<>(Arrays.asList(teamId.split(",")))); + } + if (StringUtils.isNotBlank(departmentId)) { + queryWrapper.in("c.id", new ArrayList<>(Arrays.asList(departmentId.split(",")))); + } IPage pageList = baseMapper.queryList(page, queryWrapper); pageList.setRecords(dealList(pageList.getRecords())); return pageList; @@ -169,5 +203,60 @@ public class SafetyHatDevServiceImpl extends ServiceImpl fenceList = safetyHatFenceMapper.selectList(Wrappers.lambdaQuery() +// .eq(SafetyHatFence::getProjectSn, projectSn)); +// List enterpriseInfoList = enterpriseInfoMapper.selectBySnAndNumberOneList(projectSn, null); +// List workerInfoList = workerInfoMapper.selectOnJobWorkInfoList(projectSn); +// ExcelUtils.exporExcelSafeDevTemplate(response, enterpriseInfoList, workerInfoList); + // Step.1 组装查询条件 + //Step.2 AutoPoi 导出Excel + ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); + Map map = new HashMap<>(); + map.put("projectSn", projectSn); + List workerInfoList = workerInfoMapper.selectWorkerInfoList(new Page<>(-1, -1), map); + List list = new ArrayList<>(); + for (WorkerInfo workerInfo : workerInfoList) { + SafetyHatDevExport export = new SafetyHatDevExport(); + export.setWorkerName(workerInfo.getWorkerName()); + export.setDevSn(workerInfo.getIdCard()); + export.setEnterpriseName(workerInfo.getEnterpriseName()); + list.add(export); + } + //导出文件名称 + mv.addObject(NormalExcelConstants.FILE_NAME, "安全帽设备"); + mv.addObject(NormalExcelConstants.CLASS, SafetyHatDevExport.class); + mv.addObject(NormalExcelConstants.PARAMS, new ExportParams()); + mv.addObject(NormalExcelConstants.DATA_LIST, list); + return mv; + } + @Override + public void bind(SafetyHatDev safetyHatDev) { + List snList = Arrays.asList(safetyHatDev.getDevSn().split(",")); + List hatDevs = this.list(Wrappers.lambdaQuery().in(SafetyHatDev::getDevSn, snList)); + for (SafetyHatDev hatDev : hatDevs) { + if (StringUtils.isNotBlank(hatDev.getFenceId())) { + Set split = new HashSet(Arrays.asList(hatDev.getFenceId().split(","))); + split.add(safetyHatDev.getFenceId()); + hatDev.setFenceId(split.stream().collect(Collectors.joining(","))); + } else { + hatDev.setFenceId(safetyHatDev.getFenceId()); + } + } + this.updateBatchById(hatDevs); + } + + @Override + public void unBind(SafetyHatDev safetyHatDev) { + List snList = Arrays.asList(safetyHatDev.getDevSn().split(",")); + List hatDevs = this.list(Wrappers.lambdaQuery().in(SafetyHatDev::getDevSn, snList)); + for (SafetyHatDev hatDev : hatDevs) { + List split = new ArrayList(Arrays.asList(hatDev.getFenceId().split(","))); + split.remove(safetyHatDev.getFenceId()); + hatDev.setFenceId(split.stream().collect(Collectors.joining(","))); + } + this.updateBatchById(hatDevs); + } } diff --git a/src/main/java/com/zhgd/xmgl/modules/safetyhat/service/impl/SafetyHatFenceServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/safetyhat/service/impl/SafetyHatFenceServiceImpl.java index b14f3c15e..98fbc7124 100644 --- a/src/main/java/com/zhgd/xmgl/modules/safetyhat/service/impl/SafetyHatFenceServiceImpl.java +++ b/src/main/java/com/zhgd/xmgl/modules/safetyhat/service/impl/SafetyHatFenceServiceImpl.java @@ -4,12 +4,15 @@ import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.zhgd.jeecg.common.system.query.QueryGenerator; import com.zhgd.xmgl.modules.safetyhat.entity.SafetyHatData; +import com.zhgd.xmgl.modules.safetyhat.entity.SafetyHatDev; import com.zhgd.xmgl.modules.safetyhat.entity.SafetyHatFence; import com.zhgd.xmgl.modules.safetyhat.mapper.SafetyHatDataMapper; +import com.zhgd.xmgl.modules.safetyhat.mapper.SafetyHatDevMapper; import com.zhgd.xmgl.modules.safetyhat.mapper.SafetyHatFenceMapper; import com.zhgd.xmgl.modules.safetyhat.service.ISafetyHatFenceService; import com.zhgd.xmgl.modules.worker.entity.WorkerInfo; @@ -21,10 +24,8 @@ import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Objects; +import java.util.*; +import java.util.stream.Collectors; /** * @Description: 智能安全帽-围栏 @@ -37,6 +38,9 @@ public class SafetyHatFenceServiceImpl extends ServiceImpl queryPageList(HashMap paramMap) { QueryWrapper queryWrapper = getQueryWrapper(paramMap); @@ -62,10 +66,12 @@ public class SafetyHatFenceServiceImpl extends ServiceImpl dealList(List list, HashMap paramMap) { String projectSn = MapUtils.getString(paramMap, "projectSn"); if (CollUtil.isNotEmpty(list)) { + List safetyHatDevs = safetyHatDevMapper.selectList(Wrappers.lambdaQuery().eq(SafetyHatDev::getProjectSn, projectSn)); List dataList = safetyHatDataMapper.getNewestDataGroupByProjectSn(projectSn); for (SafetyHatFence fence : list) { ArrayList workerInfos = new ArrayList<>(); int workerNum = 0; + int illegalNum = 0; if (CollUtil.isNotEmpty(dataList)) { for (SafetyHatData d : dataList) { boolean inFence = false; @@ -93,10 +99,17 @@ public class SafetyHatFenceServiceImpl extends ServiceImpl collect = safetyHatDevs.stream().filter(s -> s.getDevSn().equals(d.getDevSn())).collect(Collectors.toList()); + if (collect.size() > 0) { + if (!Arrays.asList(collect.get(0).getFenceId().split(",")).contains(fence.getId().toString())) { + illegalNum++; + } + } } } } fence.setWorkerNum(workerNum); + fence.setIllegalNum(illegalNum); fence.setWorkerListInFence(workerInfos); } } diff --git a/src/main/java/com/zhgd/xmgl/modules/worker/mapper/xml/DepartmentInfoMapper.xml b/src/main/java/com/zhgd/xmgl/modules/worker/mapper/xml/DepartmentInfoMapper.xml index 68418876b..cab7d39fe 100644 --- a/src/main/java/com/zhgd/xmgl/modules/worker/mapper/xml/DepartmentInfoMapper.xml +++ b/src/main/java/com/zhgd/xmgl/modules/worker/mapper/xml/DepartmentInfoMapper.xml @@ -22,6 +22,9 @@ and a.enterprise_id=#{enterpriseId} + + and FIND_IN_SET(a.enterprise_id,#{enterpriseIds}) + and FIND_IN_SET(a.enterprise_id,#{userEnterpriseId}) diff --git a/src/main/java/com/zhgd/xmgl/modules/worker/mapper/xml/TeamInfoMapper.xml b/src/main/java/com/zhgd/xmgl/modules/worker/mapper/xml/TeamInfoMapper.xml index 6b075f905..d9fd69b59 100644 --- a/src/main/java/com/zhgd/xmgl/modules/worker/mapper/xml/TeamInfoMapper.xml +++ b/src/main/java/com/zhgd/xmgl/modules/worker/mapper/xml/TeamInfoMapper.xml @@ -21,7 +21,7 @@ and FIND_IN_SET(a.enterprise_id,#{userEnterpriseId}) - and a.id in + and a.enterprise_id in #{item} diff --git a/src/main/java/com/zhgd/xmgl/modules/worker/mapper/xml/WorkerInfoMapper.xml b/src/main/java/com/zhgd/xmgl/modules/worker/mapper/xml/WorkerInfoMapper.xml index 0df802c37..a75f095a5 100644 --- a/src/main/java/com/zhgd/xmgl/modules/worker/mapper/xml/WorkerInfoMapper.xml +++ b/src/main/java/com/zhgd/xmgl/modules/worker/mapper/xml/WorkerInfoMapper.xml @@ -113,6 +113,13 @@ #{item} + + and a.id in + + #{item} + + and a.worker_name like CONCAT(CONCAT('%', #{param.workerName}), '%') @@ -134,6 +141,12 @@ and a.department_id = #{param.departmentId} and a.person_type = 2 + + and find_in_set(a.team_id, #{param.teamIds}) and a.person_type = 1 + + + and find_in_set(a.department_id, #{param.departmentId}) and a.person_type = 2 + and a.person_type = #{param.personType} diff --git a/src/main/java/com/zhgd/xmgl/modules/worker/service/impl/DepartmentInfoServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/worker/service/impl/DepartmentInfoServiceImpl.java index 672cf82ab..f00ce021b 100644 --- a/src/main/java/com/zhgd/xmgl/modules/worker/service/impl/DepartmentInfoServiceImpl.java +++ b/src/main/java/com/zhgd/xmgl/modules/worker/service/impl/DepartmentInfoServiceImpl.java @@ -15,6 +15,8 @@ import com.zhgd.xmgl.modules.worker.mapper.DepartmentInfoMapper; import com.zhgd.xmgl.modules.worker.mapper.WorkerInfoMapper; import com.zhgd.xmgl.modules.worker.service.IDepartmentInfoService; import com.zhgd.xmgl.util.MessageUtil; +import org.apache.commons.collections.MapUtils; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -71,6 +73,11 @@ public class DepartmentInfoServiceImpl extends ServiceImpl getDepartmentInfoList(Map map) { Map data = new HashMap<>(16); + String enterpriseId = MapUtils.getString(map, "enterpriseId"); + if (StringUtils.isNotBlank(enterpriseId)) { + map.remove("enterpriseId"); + map.put("enterpriseIds", enterpriseId); + } List list = departmentInfoMapper.getDepartmentInfoList(map); data.put("list", list); int totalWorkerNum = 0; diff --git a/src/main/java/com/zhgd/xmgl/modules/worker/service/impl/TeamInfoServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/worker/service/impl/TeamInfoServiceImpl.java index 72bb94099..1b5c21adc 100644 --- a/src/main/java/com/zhgd/xmgl/modules/worker/service/impl/TeamInfoServiceImpl.java +++ b/src/main/java/com/zhgd/xmgl/modules/worker/service/impl/TeamInfoServiceImpl.java @@ -99,10 +99,16 @@ public class TeamInfoServiceImpl extends ServiceImpl i if (systemUserService.isSupplier()) { List enterprises = enterpriseInfoService.getSupplierEnterprises(map); if (CollUtil.isNotEmpty(enterprises)) { + map.remove("enterpriseId"); map.put("enterpriseIds", enterprises.stream().map(entityMap -> entityMap.get("id")).collect(Collectors.toList())); list = teamInfoMapper.getTeamInfoList(map); } } else { + String enterpriseId = MapUtils.getString(map, "enterpriseId"); + if (StringUtils.isNotBlank(enterpriseId)) { + map.remove("enterpriseId"); + map.put("enterpriseIds", new ArrayList<>(Arrays.asList(enterpriseId.split(",")))); + } list = teamInfoMapper.getTeamInfoList(map); } data.put("list", list); diff --git a/src/main/java/com/zhgd/xmgl/task/SafetyHatTask.java b/src/main/java/com/zhgd/xmgl/task/SafetyHatTask.java index 1750cc5d6..ff06a5474 100644 --- a/src/main/java/com/zhgd/xmgl/task/SafetyHatTask.java +++ b/src/main/java/com/zhgd/xmgl/task/SafetyHatTask.java @@ -11,18 +11,27 @@ import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.zhgd.jeecg.common.system.query.QueryGenerator; import com.zhgd.xmgl.config.SafetyHatWSClient; import com.zhgd.xmgl.modules.project.entity.Project; import com.zhgd.xmgl.modules.project.service.IProjectService; -import com.zhgd.xmgl.modules.safetyhat.entity.SafetyHatData; -import com.zhgd.xmgl.modules.safetyhat.entity.SafetyHatDev; +import com.zhgd.xmgl.modules.safetyhat.entity.*; +import com.zhgd.xmgl.modules.safetyhat.mapper.SafetyHatAlarmConfigMapper; import com.zhgd.xmgl.modules.safetyhat.mapper.SafetyHatDataMapper; import com.zhgd.xmgl.modules.safetyhat.mapper.SafetyHatDevMapper; +import com.zhgd.xmgl.modules.safetyhat.mapper.SafetyHatFenceMapper; +import com.zhgd.xmgl.modules.safetyhat.service.ISafetyHatAlarmService; +import com.zhgd.xmgl.modules.safetyhat.service.ISafetyHatDataService; import com.zhgd.xmgl.modules.safetyhat.service.ISafetyHatDevService; +import com.zhgd.xmgl.modules.worker.entity.WorkerInfo; +import com.zhgd.xmgl.util.RefUtil; +import com.zhgd.xmgl.util.RegionUtil; import com.zhgd.xmgl.util.RundeSafeyHatUtils; import lombok.extern.slf4j.Slf4j; import net.javacrumbs.shedlock.core.SchedulerLock; +import org.apache.commons.collections.MapUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Scheduled; @@ -35,9 +44,9 @@ import javax.websocket.WebSocketContainer; import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; -import java.util.Date; -import java.util.List; +import java.util.*; import java.util.concurrent.CompletableFuture; +import java.util.stream.Collectors; /** * 智能安全帽task @@ -55,9 +64,17 @@ public class SafetyHatTask { @Autowired ISafetyHatDevService safetyHatDevService; @Autowired - SafetyHatDataMapper safetyHatDataMapper; + ISafetyHatDataService safetyHatDataService; @Autowired WebSocketContainer webSocketContainer; + @Autowired + SafetyHatFenceMapper safetyHatFenceMapper; + @Autowired + SafetyHatDataMapper safetyHatDataMapper; + @Autowired + SafetyHatAlarmConfigMapper safetyHatAlarmConfigMapper; + @Autowired + ISafetyHatAlarmService safetyHatAlarmService; /** * 获取安全帽心跳 @@ -116,7 +133,7 @@ public class SafetyHatTask { log.info("定时2分钟获取安全帽数据任务,安全帽外部user_id没有设置,devSn:{}", dev.getDevSn()); continue; } - SafetyHatData lastData = safetyHatDataMapper.selectOne(new LambdaQueryWrapper() + SafetyHatData lastData = safetyHatDataService.getOne(new LambdaQueryWrapper() .eq(SafetyHatData::getDevSn, dev.getDevSn()).orderByDesc(SafetyHatData::getUploadTime).last("limit 1")); String start; if (lastData != null) { @@ -158,7 +175,7 @@ public class SafetyHatTask { data.setUploadTime(new Date(time * 1000L)); data.setProjectSn(dev.getProjectSn()); data.setIsPlatformData(1); - safetyHatDataMapper.insert(data); + safetyHatDataService.add(data); } } else { log.error("定时2分钟获取安全帽数据任务失败:devSn:{}", dev.getDevSn()); @@ -169,6 +186,98 @@ public class SafetyHatTask { } } + /** + * 区域超员报警 + */ + @Scheduled(cron = "*/30 * * * * ?") + @RequestMapping("overcrowding") + public void overcrowding() { + List projectList = projectService.list(); + HashMap paramMap = new HashMap(); + List list = new ArrayList<>(); + for (Project project : projectList) { + SafetyHatAlarmConfig safetyHatAlarmConfig = safetyHatAlarmConfigMapper.selectOne(Wrappers.lambdaQuery() + .eq(SafetyHatAlarmConfig::getProjectSn, project.getProjectSn())); + if (safetyHatAlarmConfig == null || safetyHatAlarmConfig.getNumEnable() == 0) { + continue; + } + paramMap.put("projectSn", project.getProjectSn()); + QueryWrapper queryWrapper = getQueryWrapper(paramMap); + List safetyHatFenceList = dealList(safetyHatFenceMapper.queryList(queryWrapper), paramMap); + for (SafetyHatFence safetyHatFence : safetyHatFenceList) { + if (safetyHatFence.getWorkerNum() > safetyHatAlarmConfig.getNumCount()) { + SafetyHatAlarm alarm = new SafetyHatAlarm(); + alarm.setAlarmTime(new Date()); + alarm.setAlarmType(23); + alarm.setAlarmInfo("围栏:" + safetyHatFence.getFenceName() + "发生区域超员报警,实际人数为" + safetyHatFence.getWorkerNum() + + "人员限制数为" + safetyHatAlarmConfig.getNumCount()); + list.add(alarm); + } + } + } + safetyHatAlarmService.saveBatch(list); + } + + private List dealList(List list, HashMap paramMap) { + String projectSn = MapUtils.getString(paramMap, "projectSn"); + if (CollUtil.isNotEmpty(list)) { + List safetyHatDevs = safetyHatDevMapper.selectList(Wrappers.lambdaQuery().eq(SafetyHatDev::getProjectSn, projectSn)); + List dataList = safetyHatDataMapper.getNewestDataGroupByProjectSn(projectSn); + for (SafetyHatFence fence : list) { + ArrayList workerInfos = new ArrayList<>(); + int workerNum = 0; + int illegalNum = 0; + if (CollUtil.isNotEmpty(dataList)) { + for (SafetyHatData d : dataList) { + boolean inFence = false; + //判断是否在围栏范围内 + if (Objects.equals(fence.getRangeType(), 1)) { + inFence = RegionUtil.isInCircle(d.getLongitude(), d.getLatitude(), fence.getLongitude(), fence.getLatitude(), fence.getAreaRadius()); + } else if (Objects.equals(fence.getRangeType(), 2)) { + String fenceShape = fence.getFenceShape(); + if (StrUtil.isNotBlank(fenceShape)) { + String[] couples = StringUtils.split(fenceShape, ","); + Double[] lon = new Double[couples.length]; + Double[] lat = new Double[couples.length]; + for (int i = 0; i < couples.length; i++) { + String couple = couples[i]; + String[] two = StringUtils.split(couple, "|"); + lon[i] = Double.valueOf(two[0]); + lat[i] = Double.valueOf(two[1]); + } + inFence = RegionUtil.isInPolygon(d.getLongitude(), d.getLatitude(), lon, lat); + } + } + if (inFence) { + workerNum++; + WorkerInfo workerInfo = new WorkerInfo(); + workerInfo.setWorkerName(d.getWorkerName()); + workerInfo.setIdCard(d.getIdCard()); + workerInfos.add(workerInfo); + List collect = safetyHatDevs.stream().filter(s -> s.getDevSn().equals(d.getDevSn())).collect(Collectors.toList()); + if (collect.size() > 0) { + if (!Arrays.asList(collect.get(0).getFenceId().split(",")).contains(fence.getId().toString())) { + illegalNum++; + } + } + } + } + } + fence.setWorkerNum(workerNum); + fence.setIllegalNum(illegalNum); + fence.setWorkerListInFence(workerInfos); + } + } + return list; + } + + private QueryWrapper getQueryWrapper(HashMap paramMap) { + String alias = "t."; + QueryWrapper queryWrapper = QueryGenerator.initPageQueryWrapper(SafetyHatFence.class, paramMap, alias); + queryWrapper.orderByDesc(alias + RefUtil.fieldNameUlc(SafetyHatFence::getId)); + return queryWrapper; + } + /** * 定时设置昨天的轨迹到数据库 */ @@ -208,7 +317,7 @@ public class SafetyHatTask { if (rsJo.getBoolean("status")) { JSONArray dataJa = rsJo.getJSONArray("data"); //删除昨日的数据 - safetyHatDataMapper.delete(new LambdaQueryWrapper() + safetyHatDataService.remove(new LambdaQueryWrapper() .eq(SafetyHatData::getDevSn, dev.getDevSn()) .eq(SafetyHatData::getIsPlatformData, 1) .ge(SafetyHatData::getUploadTime, yB) @@ -230,7 +339,7 @@ public class SafetyHatTask { data.setUploadTime(new Date(time * 1000L)); data.setProjectSn(dev.getProjectSn()); data.setIsPlatformData(1); - safetyHatDataMapper.insert(data); + safetyHatDataService.add(data); } } else { log.error("定时设置昨天的轨迹到数据库任务失败:devSn:{}", dev.getDevSn()); diff --git a/src/main/java/com/zhgd/xmgl/util/ExcelUtils.java b/src/main/java/com/zhgd/xmgl/util/ExcelUtils.java index 45700dd74..ca516871d 100644 --- a/src/main/java/com/zhgd/xmgl/util/ExcelUtils.java +++ b/src/main/java/com/zhgd/xmgl/util/ExcelUtils.java @@ -2,6 +2,9 @@ package com.zhgd.xmgl.util; import com.zhgd.jeecg.common.mybatis.EntityMap; import com.zhgd.xmgl.modules.exam.entity.ExamSubject; +import com.zhgd.xmgl.modules.safetyhat.entity.SafetyHatFence; +import com.zhgd.xmgl.modules.worker.entity.EnterpriseInfo; +import com.zhgd.xmgl.modules.worker.entity.WorkerInfo; import com.zhgd.xmgl.modules.worker.entity.WorkerSafeEducationWorker; import com.zhgd.xmgl.modules.worker.entity.WorkerType; import lombok.extern.slf4j.Slf4j; @@ -298,6 +301,38 @@ public class ExcelUtils { } } + public static void exporExcelSafeDevTemplate(HttpServletResponse response, List enterpriseInfoList + ,List workerInfoList) { + try { + ClassPathResource classPathResource = new ClassPathResource("excel/安全帽设备导入模板.xlsx"); + InputStream inputStream = classPathResource.getInputStream(); + XSSFWorkbook workbook = new XSSFWorkbook(inputStream); + //分包单位下拉列 + XSSFSheet sheet3 = workbook.getSheet("分包单位"); + if (enterpriseInfoList.size() > 0) { + for (int i = 0; i < enterpriseInfoList.size(); i++) { + XSSFRow row1 = sheet3.createRow(i); + XSSFCell cell1 = row1.createCell(0); + cell1.setCellType(CellType.STRING); + cell1.setCellValue(enterpriseInfoList.get(i).getEnterpriseName()); + } + } + //人员下拉列 + XSSFSheet sheet4 = workbook.getSheet("人员"); + if (workerInfoList.size() > 0) { + for (int i = 0; i < workerInfoList.size(); i++) { + XSSFRow row1 = sheet4.createRow(i); + XSSFCell cell1 = row1.createCell(0); + cell1.setCellType(CellType.STRING); + cell1.setCellValue(workerInfoList.get(i).getWorkerName()); + } + } + downLoadExcel("安全帽设备导入模板.xlsx", response, workbook); + } catch (IOException e) { + log.error("error:", e); + } + } + private static void picture(String path, XSSFSheet sheet, int startRow, int endRow, int startCol, int endCol) { try { InputStream inputStreamPic = new FileInputStream(path); diff --git a/src/main/resources/excel/安全帽设备导入模板.xlsx b/src/main/resources/excel/安全帽设备导入模板.xlsx index 2243dbbc05f0b4bb608151b26d1b4be129627e3f..6d46113a0c9f375beaeec7e5ed783cb747c8eb39 100644 GIT binary patch delta 5174 zc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