From 803dca253d0d54a491819f4d071600ee004184c8 Mon Sep 17 00:00:00 2001 From: guo Date: Fri, 22 Mar 2024 10:11:58 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../zhgd/xmgl/config/SafetyHatWSClient.java | 2 + .../controller/OperationLogController.java | 59 ++++++++++++++++--- .../mapper/xml/OperationLogMapper.xml | 11 ++-- ...nicalEquipmentPositionDataServiceImpl.java | 5 +- .../com/zhgd/xmgl/task/SafetyHatTask.java | 1 + 5 files changed, 65 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/zhgd/xmgl/config/SafetyHatWSClient.java b/src/main/java/com/zhgd/xmgl/config/SafetyHatWSClient.java index 02e20a147..3bb3896bc 100644 --- a/src/main/java/com/zhgd/xmgl/config/SafetyHatWSClient.java +++ b/src/main/java/com/zhgd/xmgl/config/SafetyHatWSClient.java @@ -55,6 +55,7 @@ public class SafetyHatWSClient { this.send("{\"act\":\"ma_get_active_devices\"}"); } } else if (Objects.equals(cmd, "ma_get_active_devices")) { + log.info("SafetyHatWSClient获取实时数据"); //插入实时数据 Boolean status = jo.getBoolean("status"); if (status != null && status) { @@ -93,6 +94,7 @@ public class SafetyHatWSClient { } } } else if (Objects.equals(cmd, "server_push_sos")) { + log.info("SafetyHatWSClient接受报警数据"); //接受报警数据 JSONObject joData = jo.getJSONObject("data"); if (joData != null) { diff --git a/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/OperationLogController.java b/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/OperationLogController.java index 296cb68fd..59f2796f3 100644 --- a/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/OperationLogController.java +++ b/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/OperationLogController.java @@ -1,19 +1,33 @@ package com.zhgd.xmgl.modules.basicdata.controller; +import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.zhgd.jeecg.common.api.vo.Result; import com.zhgd.jeecg.common.mybatis.EntityMap; +import com.zhgd.jeecg.common.system.query.QueryGenerator; +import com.zhgd.jeecg.common.util.oConvertUtils; import com.zhgd.xmgl.modules.basicdata.entity.OperationLog; import com.zhgd.xmgl.modules.basicdata.service.IOperationLogService; +import com.zhgd.xmgl.modules.party.entity.PartyPromotionalVideo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; +import org.jeecgframework.poi.excel.def.NormalExcelConstants; +import org.jeecgframework.poi.excel.entity.ExportParams; +import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import org.springframework.web.servlet.ModelAndView; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.UnsupportedEncodingException; +import java.net.URLDecoder; import java.util.Arrays; +import java.util.List; import java.util.Map; @@ -42,6 +56,7 @@ public class OperationLogController { @ApiImplicitParam(name = "startTime", value = "开始时间,格式2021-08-15", paramType = "body", required = false, dataType = "String"), @ApiImplicitParam(name = "endTime", value = "结束时间,格式2021-08-15", paramType = "body", required = false, dataType = "String"), @ApiImplicitParam(name = "sn", value = "项目SN或企业sn", paramType = "body", required = true, dataType = "String"), + @ApiImplicitParam(name = "operModul", value = "功能模块", paramType = "body", required = false, dataType = "String"), @ApiImplicitParam(name = "pageNo", value = "第几页", paramType = "body", required = true, dataType = "Integer"), @ApiImplicitParam(name = "pageSize", value = "每页显示条数", paramType = "body", required = true, dataType = "Integer"), }) @@ -124,14 +139,42 @@ public class OperationLogController { public Result queryById(@RequestParam(name="id",required=true) String id) { Result result = new Result(); OperationLog operationLog = operationLogService.getById(id); - if(operationLog==null) { - result.error500("未找到对应实体"); - }else { - result.setResult(operationLog); - result.setSuccess(true); - } - return result; + if (operationLog == null) { + result.error500("未找到对应实体"); + } else { + result.setResult(operationLog); + result.setSuccess(true); + } + return result; + } + + + @ApiOperation(value = "导出excel操作日志表信息", notes = "导出excel操作日志表信息", httpMethod = "POST") + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) { + //// Step.1 组装查询条件 + //QueryWrapper queryWrapper = null; + //try { + // String paramsStr = request.getParameter("paramsStr"); + // if (oConvertUtils.isNotEmpty(paramsStr)) { + // String deString = URLDecoder.decode(paramsStr, "UTF-8"); + // PartyPromotionalVideo partyPromotionalVideo = JSON.parseObject(deString, PartyPromotionalVideo.class); + // queryWrapper = QueryGenerator.initQueryWrapper(partyPromotionalVideo, request.getParameterMap()); + // } + //} catch (UnsupportedEncodingException e) { + // e.printStackTrace(); + //} + // + ////Step.2 AutoPoi 导出Excel + //ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); + //List pageList = s.list(queryWrapper); + ////导出文件名称 + //mv.addObject(NormalExcelConstants.FILE_NAME, "宣传视频列表"); + //mv.addObject(NormalExcelConstants.CLASS, PartyPromotionalVideo.class); + //mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("宣传视频列表数据", "导出人:Jeecg", "导出信息")); + //mv.addObject(NormalExcelConstants.DATA_LIST, pageList); + //return mv; + return null; } - } diff --git a/src/main/java/com/zhgd/xmgl/modules/basicdata/mapper/xml/OperationLogMapper.xml b/src/main/java/com/zhgd/xmgl/modules/basicdata/mapper/xml/OperationLogMapper.xml index 4b671a006..54f7de282 100644 --- a/src/main/java/com/zhgd/xmgl/modules/basicdata/mapper/xml/OperationLogMapper.xml +++ b/src/main/java/com/zhgd/xmgl/modules/basicdata/mapper/xml/OperationLogMapper.xml @@ -28,16 +28,19 @@ (b.sn=#{param.sn} OR py.company_sn=#{param.sn}) - + and b.real_name like CONCAT(CONCAT('%',#{param.userName}),'%') - + and a.oper_type like CONCAT(CONCAT('%',#{param.operName}),'%') - + + and a.oper_modul like CONCAT(CONCAT('%',#{param.operModul}),'%') + + AND a.oper_create_time >=CONCAT(DATE_FORMAT(#{param.startTime},'%Y-%m-%d'),' 00:00:00') - + AND a.oper_create_time <=CONCAT(DATE_FORMAT(#{param.endTime},'%Y-%m-%d'),' 23:59:59') diff --git a/src/main/java/com/zhgd/xmgl/modules/mechanicalequipmentposition/service/impl/MechanicalEquipmentPositionDataServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/mechanicalequipmentposition/service/impl/MechanicalEquipmentPositionDataServiceImpl.java index cd1ef444d..7c6a97271 100644 --- a/src/main/java/com/zhgd/xmgl/modules/mechanicalequipmentposition/service/impl/MechanicalEquipmentPositionDataServiceImpl.java +++ b/src/main/java/com/zhgd/xmgl/modules/mechanicalequipmentposition/service/impl/MechanicalEquipmentPositionDataServiceImpl.java @@ -190,8 +190,11 @@ public class MechanicalEquipmentPositionDataServiceImpl extends ServiceImpl projectList = projectService.list(Wrappers.lambdaQuery().ne(Project::getHelmetUser, "").ne(Project::getHelmetPassword, "")); if (CollUtil.isNotEmpty(projectList)) { for (Project project : projectList) { + log.info("安全帽user:{}", project.getHelmetUser()); SafetyHatWSClient client = SafetyHatWSClient.clientMap.get(project.getHelmetUser()); try { if (client == null) {