隧道定位

This commit is contained in:
guo 2023-09-13 14:16:46 +08:00
parent cb849b8e1d
commit 61dd67f838
39 changed files with 1817 additions and 22 deletions

View File

@ -176,6 +176,19 @@ public class QueryGenerator {
name = origDescriptors[i].getName();
type = origDescriptors[i].getPropertyType().toString();
try {
// 添加 判断是否有区间值
String endValue = null, beginValue = null;
if (parameterMap != null && parameterMap.containsKey(name + BEGIN)) {
beginValue = parameterMap.get(name + BEGIN)[0].trim();
addQueryByRule(queryWrapper, name, type, beginValue, QueryRuleEnum.GE, defaultAlias);
continue;
}
if (parameterMap != null && parameterMap.containsKey(name + END)) {
endValue = parameterMap.get(name + END)[0].trim();
addQueryByRule(queryWrapper, name, type, endValue, QueryRuleEnum.LE, defaultAlias);
continue;
}
if (!isExistTable(searchObj, name)) {
continue;
}
@ -190,18 +203,6 @@ public class QueryGenerator {
continue;
}
// 添加 判断是否有区间值
String endValue = null, beginValue = null;
if (parameterMap != null && parameterMap.containsKey(name + BEGIN)) {
beginValue = parameterMap.get(name + BEGIN)[0].trim();
addQueryByRule(queryWrapper, name, type, beginValue, QueryRuleEnum.GE);
}
if (parameterMap != null && parameterMap.containsKey(name + END)) {
endValue = parameterMap.get(name + END)[0].trim();
addQueryByRule(queryWrapper, name, type, endValue, QueryRuleEnum.LE);
}
//判断单值 参数带不同标识字符串 走不同的查询
//TODO 这种前后带逗号的支持分割后模糊查询需要否 使多选字段的查询生效
Object value = PropertyUtils.getSimpleProperty(searchObj, name);
@ -363,7 +364,7 @@ public class QueryGenerator {
return value;
}
private static void addQueryByRule(QueryWrapper<?> queryWrapper, String name, String type, String value, QueryRuleEnum rule) throws ParseException {
private static void addQueryByRule(QueryWrapper<?> queryWrapper, String name, String type, String value, QueryRuleEnum rule, String defaultAlias) throws ParseException {
if (!"".equals(value)) {
Object temp;
switch (type) {
@ -392,7 +393,7 @@ public class QueryGenerator {
temp = value;
break;
}
addEasyQuery(queryWrapper, name, rule, temp);
addEasyQuery(queryWrapper, name, rule, temp, defaultAlias);
}
}

View File

@ -1,7 +1,9 @@
package com.zhgd.jeecg.common.util.pass;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSONObject;
import com.gexin.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.http.HttpMethod;
@ -102,4 +104,19 @@ public class HttpUtils {
}
return result;
}
/**
* 发送http请求json格式
*
* @param url
* @param body
*/
public static String post(String url, Object body) {
String b = JSON.toJSONString(body);
log.info("post(rq)url{},body:{}", url, b);
String rs = HttpUtil.post(url, b);
log.info("post(rs)url{},rs:{}", url, rs);
return rs;
}
}

View File

@ -0,0 +1,108 @@
package com.zhgd.xmgl.async;
import com.zhgd.xmgl.call.JiLianDaCall;
import com.zhgd.xmgl.modules.project.entity.ProjectEnterprise;
import com.zhgd.xmgl.modules.worker.entity.DepartmentInfo;
import com.zhgd.xmgl.modules.worker.entity.EnterpriseInfo;
import com.zhgd.xmgl.modules.worker.entity.TeamInfo;
import com.zhgd.xmgl.modules.worker.entity.WorkerInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
@Slf4j
@Component
public class AsyncJiLianDa {
@Autowired
private JiLianDaCall jiLianDaCall;
/**
* 添加企业
*
* @param enterpriseInfo
*/
@Async("sendWorkerExecutor")
public void saveEnterpriseInfo(EnterpriseInfo enterpriseInfo) {
try {
jiLianDaCall.saveEnterpriseInfo(enterpriseInfo);
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 解除企业绑定
*
* @param projectEnterprise
*/
@Async("sendWorkerExecutor")
public void removeEnterpriseInfo(ProjectEnterprise projectEnterprise) {
try {
jiLianDaCall.removeEnterpriseInfo(projectEnterprise);
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 添加班组
*/
@Async("sendWorkerExecutor")
public void saveTeamInfo(TeamInfo teamInfo) {
try {
jiLianDaCall.saveTeamInfo(teamInfo);
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 删除班组
*/
@Async("sendWorkerExecutor")
public void removeTeamInfo(TeamInfo teamInfo) {
try {
jiLianDaCall.removeTeamInfo(teamInfo);
} catch (Exception e) {
e.printStackTrace();
}
}
@Async("sendWorkerExecutor")
public void saveWorkerInfo(WorkerInfo workerInfo) {
try {
jiLianDaCall.saveWorkerInfo(workerInfo);
} catch (Exception e) {
e.printStackTrace();
}
}
@Async("sendWorkerExecutor")
public void removeWorkerInfo(WorkerInfo workerInfo) {
try {
jiLianDaCall.removeWorkerInfo(workerInfo);
} catch (Exception e) {
e.printStackTrace();
}
}
@Async("sendWorkerExecutor")
public void saveDepartmentInfo(DepartmentInfo departmentInfo) {
try {
jiLianDaCall.saveDepartmentInfo(departmentInfo);
} catch (Exception e) {
e.printStackTrace();
}
}
@Async("sendWorkerExecutor")
public void removeDepartmentInfo(DepartmentInfo departmentInfo) {
try {
jiLianDaCall.removeDepartmentInfo(departmentInfo);
} catch (Exception e) {
e.printStackTrace();
}
}
}

View File

@ -0,0 +1,93 @@
package com.zhgd.xmgl.call;
import cn.hutool.core.util.StrUtil;
import com.zhgd.xmgl.modules.project.entity.ProjectEnterprise;
import com.zhgd.xmgl.modules.worker.entity.DepartmentInfo;
import com.zhgd.xmgl.modules.worker.entity.EnterpriseInfo;
import com.zhgd.xmgl.modules.worker.entity.TeamInfo;
import com.zhgd.xmgl.modules.worker.entity.WorkerInfo;
import com.zhgd.xmgl.util.ThirdPartRequestUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
@Component
@Slf4j
public class JiLianDaCall {
@Value("${jld_push_url:}")
String jldPushUrl;
@Autowired
ThirdPartRequestUtil thirdPartRequestUtil;
private boolean ifSend() {
return StrUtil.isNotBlank(jldPushUrl);
}
/**
* 保存企业
*
* @param enterpriseInfo
*/
public void saveEnterpriseInfo(EnterpriseInfo enterpriseInfo) {
if (!ifSend()) {
return;
}
thirdPartRequestUtil.post(jldPushUrl + "/saveEnterpriseInfo", enterpriseInfo);
}
/**
* 删除企业
*
* @param projectEnterprise
*/
public void removeEnterpriseInfo(ProjectEnterprise projectEnterprise) {
if (!ifSend()) {
return;
}
thirdPartRequestUtil.post(jldPushUrl + "/removeEnterpriseInfo", projectEnterprise);
}
public void saveTeamInfo(TeamInfo teamInfo) {
if (!ifSend()) {
return;
}
thirdPartRequestUtil.post(jldPushUrl + "/saveTeamInfo", teamInfo);
}
public void removeTeamInfo(TeamInfo teamInfo) {
if (!ifSend()) {
return;
}
thirdPartRequestUtil.post(jldPushUrl + "/removeTeamInfo", teamInfo);
}
public void saveWorkerInfo(WorkerInfo workerInfo) {
if (!ifSend()) {
return;
}
thirdPartRequestUtil.post(jldPushUrl + "/saveWorkerInfo", workerInfo);
}
public void removeWorkerInfo(WorkerInfo workerInfo) {
if (!ifSend()) {
return;
}
thirdPartRequestUtil.post(jldPushUrl + "/removeWorkerInfo", workerInfo);
}
public void saveDepartmentInfo(DepartmentInfo departmentInfo) {
if (!ifSend()) {
return;
}
thirdPartRequestUtil.post(jldPushUrl + "/saveDepartmentInfo", departmentInfo);
}
public void removeDepartmentInfo(DepartmentInfo departmentInfo) {
if (!ifSend()) {
return;
}
thirdPartRequestUtil.post(jldPushUrl + "/removeDepartmentInfo", departmentInfo);
}
}

View File

@ -291,5 +291,4 @@ public class WkServiceuCall {
}
}
}

View File

@ -0,0 +1,71 @@
package com.zhgd.xmgl.modules.basicdata.entity;
import com.baomidou.mybatisplus.annotation.IdType;
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;
/**
* @Description: 第三方请求记录
* @author pds
* @date 2023-09-11
* @version V1.0
*/
@Data
@TableName("third_part_request_log")
@ApiModel(value = "ThirdPartRequestLog实体类", description = "ThirdPartRequestLog")
public class ThirdPartRequestLog implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "id")
private java.lang.Long id;
/**
* 请求URL
*/
@Excel(name = "请求URL", width = 15)
@ApiModelProperty(value = "请求URL")
private java.lang.String url;
/**
* 请求方法1GET2POST
*/
@Excel(name = "请求方法1GET2POST", width = 15)
@ApiModelProperty(value = "请求方法1GET2POST")
private java.lang.Integer method;
/**
* 请求参数
*/
@Excel(name = "请求参数", width = 15)
@ApiModelProperty(value = "请求参数")
private java.lang.String param;
/**
* 请求结果
*/
@Excel(name = "请求结果", width = 15)
@ApiModelProperty(value = "请求结果")
private java.lang.String result;
/**
* 请求状态0未知1完成
*/
@Excel(name = "请求状态0未知1完成", width = 15)
@ApiModelProperty(value = "请求状态0未知1完成")
private java.lang.Integer status;
/**
* 创建时间
*/
@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建时间")
private java.util.Date createTime;
}

View File

@ -0,0 +1,16 @@
package com.zhgd.xmgl.modules.basicdata.mapper;
import org.apache.ibatis.annotations.Mapper;
import com.zhgd.xmgl.modules.basicdata.entity.ThirdPartRequestLog;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 第三方请求记录
* @author pds
* @date 2023-09-11
* @version V1.0
*/
@Mapper
public interface ThirdPartRequestLogMapper extends BaseMapper<ThirdPartRequestLog> {
}

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhgd.xmgl.modules.basicdata.mapper.ThirdPartRequestLogMapper">
</mapper>

View File

@ -0,0 +1,14 @@
package com.zhgd.xmgl.modules.basicdata.service;
import com.zhgd.xmgl.modules.basicdata.entity.ThirdPartRequestLog;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 第三方请求记录
* @author pds
* @date 2023-09-11
* @version V1.0
*/
public interface IThirdPartRequestLogService extends IService<ThirdPartRequestLog> {
}

View File

@ -0,0 +1,19 @@
package com.zhgd.xmgl.modules.basicdata.service.impl;
import com.zhgd.xmgl.modules.basicdata.entity.ThirdPartRequestLog;
import com.zhgd.xmgl.modules.basicdata.mapper.ThirdPartRequestLogMapper;
import com.zhgd.xmgl.modules.basicdata.service.IThirdPartRequestLogService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 第三方请求记录
* @author pds
* @date 2023-09-11
* @version V1.0
*/
@Service
public class ThirdPartRequestLogServiceImpl extends ServiceImpl<ThirdPartRequestLogMapper, ThirdPartRequestLog> implements IThirdPartRequestLogService {
}

View File

@ -0,0 +1,44 @@
package com.zhgd.xmgl.modules.location.controller;
import com.gexin.fastjson.JSON;
import com.zhgd.xmgl.modules.location.entity.dto.JiLianDaRt;
import com.zhgd.xmgl.modules.location.service.ILocationDataService;
import com.zhgd.xmgl.modules.location.service.ILocationTagLowVoltageAlarmService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
import java.util.HashMap;
@RestController
@Api(tags = "定位外部相关Api")
@RequestMapping("/")
@Slf4j
public class LocationApiController {
@Autowired
private ILocationTagLowVoltageAlarmService locationTagLowVoltageAlarmService;
@Autowired
private ILocationDataService locationDataService;
@ApiOperation(value = "上传气体报警数据", notes = "上传气体报警数据", httpMethod = "POST")
@PostMapping(value = "/api/uploadSensorAlarm")
public JiLianDaRt uploadSensorAlarm(@ApiIgnore @RequestBody HashMap<String, Object> paramMap) {
log.info("uploadSensorAlarm:{}", JSON.toJSONString(paramMap));
return locationTagLowVoltageAlarmService.uploadSensorAlarm(paramMap);
}
@ApiOperation(value = "上传全量人员定位实时数据", notes = "上传全量人员定位实时数据", httpMethod = "POST")
@PostMapping(value = "/api/uploadLocationDataList")
public JiLianDaRt uploadLocationDataList(@ApiIgnore @RequestBody HashMap<String, Object> paramMap) {
log.info("uploadLocationDataList:{}", JSON.toJSONString(paramMap));
return locationDataService.uploadLocationDataList(paramMap);
}
}

View File

@ -0,0 +1,177 @@
package com.zhgd.xmgl.modules.location.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhgd.jeecg.common.api.vo.Result;
import com.zhgd.jeecg.common.system.query.QueryGenerator;
import com.zhgd.xmgl.modules.location.entity.LocationData;
import com.zhgd.xmgl.modules.location.entity.vo.RealTimeLocationWorkerVo;
import com.zhgd.xmgl.modules.location.service.ILocationDataService;
import com.zhgd.xmgl.util.RefUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.MapUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
/**
* @Title: Controller
* @Description: 定位数据
* @author pds
* @date 2023-09-12
* @version V1.0
*/
@RestController
@RequestMapping("/xmgl/locationData")
@Slf4j
@Api(tags = "定位数据相关Api")
public class LocationDataController {
@Autowired
private ILocationDataService locationDataService;
/**
* 分页列表查询
*
* @param locationData
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@ApiOperation(value = "分页列表查询定位数据信息", notes = "分页列表查询定位数据信息", httpMethod = "GET")
@ApiImplicitParams({
@ApiImplicitParam(name = "createTime_begin", value = "查询开始时间", paramType = "body", required = false, dataType = "String"),
@ApiImplicitParam(name = "createTime_end", value = "查询结束时间", paramType = "body", required = false, dataType = "String")
})
@GetMapping(value = "/page")
public Result<IPage<LocationData>> queryPageList(LocationData locationData,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
Result<IPage<LocationData>> result = new Result<IPage<LocationData>>();
IPage<LocationData> pageList = locationDataService.queryPageList(locationData, pageNo, pageSize, req);
result.setSuccess(true);
result.setResult(pageList);
return result;
}
/**
* 列表查询
*
* @param locationData
* @param req
* @return
*/
@ApiOperation(value = "列表查询定位数据信息", notes = "列表查询定位数据信息", httpMethod = "GET")
@GetMapping(value = "/list")
public Result<List<LocationData>> queryList(LocationData locationData,
HttpServletRequest req) {
QueryWrapper<LocationData> queryWrapper = QueryGenerator.initQueryWrapper(locationData, req.getParameterMap());
return Result.success(locationDataService.list(queryWrapper));
}
/**
* 添加
*
* @param locationData
* @return
*/
@ApiOperation(value = "添加定位数据信息", notes = "添加定位数据信息", httpMethod = "POST")
@PostMapping(value = "/add")
public Result<LocationData> add(@RequestBody LocationData locationData) {
locationDataService.save(locationData);
return Result.ok();
}
/**
* 编辑
*
* @param locationData
* @return
*/
@ApiOperation(value = "编辑定位数据信息", notes = "编辑定位数据信息", httpMethod = "POST")
@PostMapping(value = "/edit")
public Result<LocationData> edit(@RequestBody LocationData locationData) {
locationDataService.updateById(locationData);
return Result.ok();
}
/**
* 通过id删除
*
* @param id
* @return
*/
@ApiOperation(value = "删除定位数据信息", notes = "删除定位数据信息", httpMethod = "POST")
@ApiImplicitParam(name = "id", value = "定位数据ID", paramType = "body", required = true, dataType = "String", example = "{\"id\":\"1\"}")
@PostMapping(value = "/delete")
public Result<LocationData> delete(@ApiIgnore @RequestBody HashMap<String, Object> map) {
String id = MapUtils.getString(map, "id");
Result<LocationData> result = new Result<LocationData>();
LocationData locationData = locationDataService.getById(id);
if (locationData == null) {
result.error500("未找到对应实体");
} else {
boolean ok = locationDataService.removeById(id);
if (ok) {
result.success("删除成功!");
}
}
return result;
}
/**
* 通过id查询
*
* @param id
* @return
*/
@ApiOperation(value = "通过id查询定位数据信息", notes = "通过id查询定位数据信息", httpMethod = "GET")
@ApiImplicitParam(name = "id", value = "定位数据ID", paramType = "query", required = true, dataType = "Integer")
@GetMapping(value = "/queryById")
public Result<LocationData> queryById(@RequestParam(name = "id", required = true) String id) {
Result<LocationData> result = new Result<LocationData>();
LocationData locationData = locationDataService.getById(id);
if (locationData == null) {
result.error500("未找到对应实体");
} else {
result.setResult(locationData);
result.setSuccess(true);
}
return result;
}
@ApiOperation(value = "统计实时定位人数", notes = "统计实时定位人数", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "body", required = true, dataType = "String"),
@ApiImplicitParam(name = "locationTunnelId", value = "定位隧道信息id", paramType = "body", required = true, dataType = "String"),
})
@PostMapping(value = "/countRealTimeLocationWorker")
public Result<List<RealTimeLocationWorkerVo>> countRealTimeLocationWorker(@ApiIgnore @RequestBody HashMap<String, Object> paramMap) {
return Result.success(locationDataService.countRealTimeLocationWorker(paramMap));
}
@ApiOperation(value = "查询实时定位人数", notes = "查询实时定位人数", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "body", required = true, dataType = "String"),
@ApiImplicitParam(name = "locationTunnelId", value = "定位隧道信息id", paramType = "body", required = true, dataType = "String"),
@ApiImplicitParam(name = "queryStr", value = "卡号或姓名", paramType = "body", required = false, dataType = "String"),
})
@PostMapping(value = "/getRealTimeLocationWorker")
public Result<List<LocationData>> getRealTimeLocationWorker(@ApiIgnore @RequestBody HashMap<String, Object> paramMap) {
return Result.success(locationDataService.getRealTimeLocationWorker(paramMap));
}
}

View File

@ -0,0 +1,169 @@
package com.zhgd.xmgl.modules.location.controller;
import com.zhgd.xmgl.modules.location.entity.LocationTagLowVoltageAlarm;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import java.util.HashMap;
import java.util.List;
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 org.apache.commons.collections.MapUtils;
import com.zhgd.xmgl.modules.location.service.ILocationTagLowVoltageAlarmService;
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.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 com.alibaba.fastjson.JSON;
import springfox.documentation.annotations.ApiIgnore;
/**
* @Title: Controller
* @Description: 定位低电量报警
* @author pds
* @date 2023-09-12
* @version V1.0
*/
@RestController
@RequestMapping("/xmgl/locationTagLowVoltageAlarm")
@Slf4j
@Api(tags = "定位低电量报警相关Api")
public class LocationTagLowVoltageAlarmController {
@Autowired
private ILocationTagLowVoltageAlarmService locationTagLowVoltageAlarmService;
/**
* 分页列表查询
*
* @param locationTagLowVoltageAlarm
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@ApiOperation(value = "分页列表查询定位低电量报警信息", notes = "分页列表查询定位低电量报警信息", httpMethod = "GET")
@ApiImplicitParams({
@ApiImplicitParam(name = "createTime_begin", value = "查询开始时间", paramType = "body", required = false, dataType = "String"),
@ApiImplicitParam(name = "createTime_end", value = "查询结束时间", paramType = "body", required = false, dataType = "String")
})
@GetMapping(value = "/page")
public Result<IPage<LocationTagLowVoltageAlarm>> queryPageList(LocationTagLowVoltageAlarm locationTagLowVoltageAlarm,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
Result<IPage<LocationTagLowVoltageAlarm>> result = new Result<IPage<LocationTagLowVoltageAlarm>>();
QueryWrapper<LocationTagLowVoltageAlarm> queryWrapper = QueryGenerator.initQueryWrapper(locationTagLowVoltageAlarm, req.getParameterMap());
Page<LocationTagLowVoltageAlarm> page = new Page<LocationTagLowVoltageAlarm>(pageNo, pageSize);
IPage<LocationTagLowVoltageAlarm> pageList = locationTagLowVoltageAlarmService.page(page, queryWrapper);
result.setSuccess(true);
result.setResult(pageList);
return result;
}
/**
* 列表查询
*
* @param locationTagLowVoltageAlarm
* @param req
* @return
*/
@ApiOperation(value = "列表查询定位低电量报警信息", notes = "列表查询定位低电量报警信息", httpMethod = "GET")
@GetMapping(value = "/list")
public Result<List<LocationTagLowVoltageAlarm>> queryList(LocationTagLowVoltageAlarm locationTagLowVoltageAlarm,
HttpServletRequest req) {
QueryWrapper<LocationTagLowVoltageAlarm> queryWrapper = QueryGenerator.initQueryWrapper(locationTagLowVoltageAlarm, req.getParameterMap());
return Result.success(locationTagLowVoltageAlarmService.list(queryWrapper));
}
/**
* 添加
*
* @param locationTagLowVoltageAlarm
* @return
*/
@ApiOperation(value = "添加定位低电量报警信息", notes = "添加定位低电量报警信息", httpMethod = "POST")
@PostMapping(value = "/add")
public Result<LocationTagLowVoltageAlarm> add(@RequestBody LocationTagLowVoltageAlarm locationTagLowVoltageAlarm) {
locationTagLowVoltageAlarmService.save(locationTagLowVoltageAlarm);
return Result.ok();
}
/**
* 编辑
*
* @param locationTagLowVoltageAlarm
* @return
*/
@ApiOperation(value = "编辑定位低电量报警信息", notes = "编辑定位低电量报警信息", httpMethod = "POST")
@PostMapping(value = "/edit")
public Result<LocationTagLowVoltageAlarm> edit(@RequestBody LocationTagLowVoltageAlarm locationTagLowVoltageAlarm) {
locationTagLowVoltageAlarmService.updateById(locationTagLowVoltageAlarm);
return Result.ok();
}
/**
* 通过id删除
*
* @param id
* @return
*/
@ApiOperation(value = "删除定位低电量报警信息", notes = "删除定位低电量报警信息", httpMethod = "POST")
@ApiImplicitParam(name = "id", value = "定位低电量报警ID", paramType = "body", required = true, dataType = "String", example = "{\"id\":\"1\"}")
@PostMapping(value = "/delete")
public Result<LocationTagLowVoltageAlarm> delete(@ApiIgnore @RequestBody HashMap<String, Object> map) {
String id = MapUtils.getString(map, "id");
Result<LocationTagLowVoltageAlarm> result = new Result<LocationTagLowVoltageAlarm>();
LocationTagLowVoltageAlarm locationTagLowVoltageAlarm = locationTagLowVoltageAlarmService.getById(id);
if (locationTagLowVoltageAlarm == null) {
result.error500("未找到对应实体");
} else {
boolean ok = locationTagLowVoltageAlarmService.removeById(id);
if (ok) {
result.success("删除成功!");
}
}
return result;
}
/**
* 通过id查询
*
* @param id
* @return
*/
@ApiOperation(value = "通过id查询定位低电量报警信息", notes = "通过id查询定位低电量报警信息", httpMethod = "GET")
@ApiImplicitParam(name = "id", value = "定位低电量报警ID", paramType = "query", required = true, dataType = "Integer")
@GetMapping(value = "/queryById")
public Result<LocationTagLowVoltageAlarm> queryById(@RequestParam(name = "id", required = true) String id) {
Result<LocationTagLowVoltageAlarm> result = new Result<LocationTagLowVoltageAlarm>();
LocationTagLowVoltageAlarm locationTagLowVoltageAlarm = locationTagLowVoltageAlarmService.getById(id);
if (locationTagLowVoltageAlarm == null) {
result.error500("未找到对应实体");
} else {
result.setResult(locationTagLowVoltageAlarm);
result.setSuccess(true);
}
return result;
}
}

View File

@ -0,0 +1,163 @@
package com.zhgd.xmgl.modules.location.controller;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import java.util.HashMap;
import java.util.List;
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 org.apache.commons.collections.MapUtils;
import com.zhgd.xmgl.modules.location.entity.LocationTunnel;
import com.zhgd.xmgl.modules.location.service.ILocationTunnelService;
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.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 com.alibaba.fastjson.JSON;
import springfox.documentation.annotations.ApiIgnore;
/**
* @Title: Controller
* @Description: 定位隧道
* @author pds
* @date 2023-09-12
* @version V1.0
*/
@RestController
@RequestMapping("/xmgl/locationTunnel")
@Slf4j
@Api(tags = "定位隧道相关Api")
public class LocationTunnelController {
@Autowired
private ILocationTunnelService locationTunnelService;
/**
* 分页列表查询
*
* @param locationTunnel
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@ApiOperation(value = "分页列表查询定位隧道信息", notes = "分页列表查询定位隧道信息", httpMethod = "GET")
@GetMapping(value = "/page")
public Result<IPage<LocationTunnel>> queryPageList(LocationTunnel locationTunnel,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
Result<IPage<LocationTunnel>> result = new Result<IPage<LocationTunnel>>();
QueryWrapper<LocationTunnel> queryWrapper = QueryGenerator.initQueryWrapper(locationTunnel, req.getParameterMap());
Page<LocationTunnel> page = new Page<LocationTunnel>(pageNo, pageSize);
IPage<LocationTunnel> pageList = locationTunnelService.page(page, queryWrapper);
result.setSuccess(true);
result.setResult(pageList);
return result;
}
/**
* 列表查询
*
* @param locationTunnel
* @param req
* @return
*/
@ApiOperation(value = "列表查询定位隧道信息", notes = "列表查询定位隧道信息", httpMethod = "GET")
@GetMapping(value = "/list")
public Result<List<LocationTunnel>> queryList(LocationTunnel locationTunnel,
HttpServletRequest req) {
QueryWrapper<LocationTunnel> queryWrapper = QueryGenerator.initQueryWrapper(locationTunnel, req.getParameterMap());
return Result.success(locationTunnelService.list(queryWrapper));
}
/**
* 添加
*
* @param locationTunnel
* @return
*/
@ApiOperation(value = "添加定位隧道信息", notes = "添加定位隧道信息", httpMethod = "POST")
@PostMapping(value = "/add")
public Result<LocationTunnel> add(@RequestBody LocationTunnel locationTunnel) {
locationTunnelService.save(locationTunnel);
return Result.ok();
}
/**
* 编辑
*
* @param locationTunnel
* @return
*/
@ApiOperation(value = "编辑定位隧道信息", notes = "编辑定位隧道信息", httpMethod = "POST")
@PostMapping(value = "/edit")
public Result<LocationTunnel> edit(@RequestBody LocationTunnel locationTunnel) {
locationTunnelService.updateById(locationTunnel);
return Result.ok();
}
/**
* 通过id删除
*
* @param id
* @return
*/
@ApiOperation(value = "删除定位隧道信息", notes = "删除定位隧道信息", httpMethod = "POST")
@ApiImplicitParam(name = "id", value = "定位隧道ID", paramType = "body", required = true, dataType = "String", example = "{\"id\":\"1\"}")
@PostMapping(value = "/delete")
public Result<LocationTunnel> delete(@ApiIgnore @RequestBody HashMap<String, Object> map) {
String id = MapUtils.getString(map, "id");
Result<LocationTunnel> result = new Result<LocationTunnel>();
LocationTunnel locationTunnel = locationTunnelService.getById(id);
if (locationTunnel == null) {
result.error500("未找到对应实体");
} else {
boolean ok = locationTunnelService.removeById(id);
if (ok) {
result.success("删除成功!");
}
}
return result;
}
/**
* 通过id查询
*
* @param id
* @return
*/
@ApiOperation(value = "通过id查询定位隧道信息", notes = "通过id查询定位隧道信息", httpMethod = "GET")
@ApiImplicitParam(name = "id", value = "定位隧道ID", paramType = "query", required = true, dataType = "Integer")
@GetMapping(value = "/queryById")
public Result<LocationTunnel> queryById(@RequestParam(name = "id", required = true) String id) {
Result<LocationTunnel> result = new Result<LocationTunnel>();
LocationTunnel locationTunnel = locationTunnelService.getById(id);
if (locationTunnel == null) {
result.error500("未找到对应实体");
} else {
result.setResult(locationTunnel);
result.setSuccess(true);
}
return result;
}
}

View File

@ -0,0 +1,262 @@
package com.zhgd.xmgl.modules.location.entity;
import cn.hutool.core.util.ReflectUtil;
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;
import java.lang.reflect.Field;
import java.util.Date;
/**
* @Description: 定位数据
* @author pds
* @date 2023-09-12
* @version V1.0
*/
@Data
@TableName("location_data")
@ApiModel(value = "LocationData实体类", description = "LocationData")
public class LocationData implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键id
*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键id")
private Long id;
/**
* 人员ID 唯一
*/
@Excel(name = "人员ID 唯一", width = 15)
@ApiModelProperty(value = "人员ID 唯一")
private String personId;
/**
* 标签类型1510人员1520车辆
*/
@Excel(name = "标签类型1510人员1520车辆", width = 15)
@ApiModelProperty(value = "标签类型1510人员1520车辆")
private String cardType;
/**
* 标签号
*/
@Excel(name = "标签号", width = 15)
@ApiModelProperty(value = "标签号")
private String cardno;
/**
* 人员姓名
*/
@Excel(name = "人员姓名", width = 15)
@ApiModelProperty(value = "人员姓名")
private String personName;
/**
* 企业ID
*/
@Excel(name = "企业ID", width = 15)
@ApiModelProperty(value = "企业ID")
private String companyId;
/**
* 班组企业名称
*/
@Excel(name = "班组企业名称", width = 15)
@ApiModelProperty(value = "班组企业名称")
private String companyName;
/**
* 班组ID
*/
@Excel(name = "班组ID", width = 15)
@ApiModelProperty(value = "班组ID")
private String teamId;
/**
* 班组名称
*/
@Excel(name = "班组名称 ", width = 15)
@ApiModelProperty(value = "班组名称 ")
private String teamName;
/**
* 部门名称
*/
@Excel(name = "部门名称", width = 15)
@ApiModelProperty(value = "部门名称")
private String department;
/**
* 性别
*/
@Excel(name = "性别", width = 15)
@ApiModelProperty(value = "性别")
private String gender;
/**
* 电话号码
*/
@Excel(name = "电话号码", width = 15)
@ApiModelProperty(value = "电话号码")
private String phone;
/**
* 身份证号码
*/
@Excel(name = "身份证号码", width = 15)
@ApiModelProperty(value = "身份证号码")
private String idNumber;
/**
* 设备SN
*/
@Excel(name = "设备SN", width = 15)
@ApiModelProperty(value = "设备SN")
private String deviceSn;
/**
* 设备名称
*/
@Excel(name = "设备名称", width = 15)
@ApiModelProperty(value = "设备名称")
private String deviceName;
/**
* 区域ID
*/
@Excel(name = "区域ID", width = 15)
@ApiModelProperty(value = "区域ID")
private String regionId;
/**
* 区域Code可自定义
*/
@Excel(name = "区域Code可自定义", width = 15)
@ApiModelProperty(value = "区域Code可自定义")
private String regionCode;
/**
* 区域名称
*/
@Excel(name = "区域名称", width = 15)
@ApiModelProperty(value = "区域名称")
private String regionName;
/**
* 标签实际位置(桩号)
*/
@Excel(name = "标签实际位置(桩号)", width = 15)
@ApiModelProperty(value = "标签实际位置(桩号)")
private String pileNo;
/**
* 标签实际位置
*/
@Excel(name = "标签实际位置(米)", width = 15)
@ApiModelProperty(value = "标签实际位置(米)")
private Double nX;
/**
* 标签相对地图Y位置()
*/
@Excel(name = "标签相对地图Y位置(米)", width = 15)
@ApiModelProperty(value = "标签相对地图Y位置(米)")
private Double nY;
/**
* 标签X位置(单位像素) 相对12000*12000位置坐标
*/
@Excel(name = "标签X位置(单位像素) 相对12000*12000位置坐标", width = 15)
@ApiModelProperty(value = "标签X位置(单位像素) 相对12000*12000位置坐标")
private Double pX;
/**
* 标签Y位置单位像素
*/
@Excel(name = "标签Y位置单位像素", width = 15)
@ApiModelProperty(value = "标签Y位置单位像素")
private Double pY;
/**
* 标签距离洞口
*/
@Excel(name = "标签距离洞口(米)", width = 15)
@ApiModelProperty(value = "标签距离洞口(米)")
private Double inlX;
/**
* 标签距离基站米数
*/
@Excel(name = "标签距离基站米数", width = 15)
@ApiModelProperty(value = "标签距离基站米数")
private Double masterX;
/**
* 标签位置环数地铁项目单位
*/
@Excel(name = "标签位置环数(地铁项目单位)", width = 15)
@ApiModelProperty(value = "标签位置环数(地铁项目单位)")
private Double ringNum;
/**
* 经度 需正确填写坐标映射表
*/
@Excel(name = "经度 需正确填写坐标映射表", width = 15)
@ApiModelProperty(value = "经度 需正确填写坐标映射表")
private String longitude;
/**
* 纬度 需正确填写坐标映射表
*/
@Excel(name = "纬度 需正确填写坐标映射表", width = 15)
@ApiModelProperty(value = "纬度 需正确填写坐标映射表")
private String latitude;
/**
* 高程
*/
@Excel(name = "高程", width = 15)
@ApiModelProperty(value = "高程")
private String altitude;
/**
* 报警类型 0正常1求救报警4静止报警8低电量报警
*/
@Excel(name = "报警类型 0正常1求救报警4静止报警8低电量报警", width = 15)
@ApiModelProperty(value = "报警类型 0正常1求救报警4静止报警8低电量报警")
private Integer alarm;
/**
* 标签电量 0-100%
*/
@Excel(name = "标签电量 0-100%", width = 15)
@ApiModelProperty(value = "标签电量 0-100%")
private Integer volume;
/**
* 心率 0-240 0未正常检测或检测超时
*/
@Excel(name = "心率 0-240 0未正常检测或检测超时", width = 15)
@ApiModelProperty(value = "心率 0-240 0未正常检测或检测超时")
private String heartRate;
/**
* 项目sn
*/
@Excel(name = "项目sn", width = 15)
@ApiModelProperty(value = "项目sn")
private String projectSn;
/**
* 创建时间
*/
@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建时间")
private Date createTime;
/**
* 更新时间
*/
@Excel(name = "更新时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新时间")
private Date updateTime;
/**
* 实时数据id
*/
@Excel(name = "实时数据id", width = 15)
@ApiModelProperty(value = "实时数据id")
private Long realtimeId;
@ApiModelProperty(value = "隧道ID")
private String tunnel_id;
@TableField(exist = false)
private String projectId;
@TableField(exist = false)
@ApiModelProperty(value = "创建时间开始")
private String createTime_begin;
@TableField(exist = false)
@ApiModelProperty(value = "创建时间结束")
private String createTime_end;
}

View File

@ -0,0 +1,116 @@
package com.zhgd.xmgl.modules.location.entity;
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;
/**
* @Description: 定位低电量报警
* @author pds
* @date 2023-09-12
* @version V1.0
*/
@Data
@TableName("location_tag_low_voltage_alarm")
@ApiModel(value = "LocationTagLowVoltageAlarm实体类", description = "LocationTagLowVoltageAlarm")
public class LocationTagLowVoltageAlarm implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键id
*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键id")
private java.lang.Long id;
/**
* 报警类型 = 2140
*/
@Excel(name = "报警类型 = 2140", width = 15)
@ApiModelProperty(value = "报警类型 = 2140")
private java.lang.String alarmType;
/**
* 报警编号
*/
@Excel(name = "报警编号", width = 15)
@ApiModelProperty(value = "报警编号")
private java.lang.String alarmId;
/**
* 工号
*/
@Excel(name = "工号", width = 15)
@ApiModelProperty(value = "工号")
private java.lang.String personId;
/**
* 标签卡号
*/
@Excel(name = "标签卡号", width = 15)
@ApiModelProperty(value = "标签卡号")
private java.lang.String cardno;
/**
* 姓名
*/
@Excel(name = "姓名", width = 15)
@ApiModelProperty(value = "姓名")
private java.lang.String personName;
/**
* 身份证号码
*/
@Excel(name = "身份证号码", width = 15)
@ApiModelProperty(value = "身份证号码")
private java.lang.String idNumber;
/**
* 联系电话
*/
@Excel(name = "联系电话", width = 15)
@ApiModelProperty(value = "联系电话")
private java.lang.String phone;
/**
* 班组ID
*/
@Excel(name = "班组ID", width = 15)
@ApiModelProperty(value = "班组ID")
private java.lang.String teamId;
/**
* 班组名称
*/
@Excel(name = "班组名称", width = 15)
@ApiModelProperty(value = "班组名称")
private java.lang.String teamName;
/**
* 当前电量 百分比
*/
@Excel(name = "当前电量 百分比", width = 15)
@ApiModelProperty(value = "当前电量 百分比")
private java.lang.Integer voltage;
/**
* 报警时间
*/
@Excel(name = "报警时间", width = 15)
@ApiModelProperty(value = "报警时间")
private java.lang.String updateTime;
/**
* 项目sn
*/
@Excel(name = "项目sn", width = 15)
@ApiModelProperty(value = "项目sn")
private java.lang.String projectSn;
/**
* 创建时间
*/
@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建时间")
private java.util.Date createTime;
@TableField(exist = false)
private java.lang.String projectId;
}

View File

@ -0,0 +1,112 @@
package com.zhgd.xmgl.modules.location.entity;
import com.baomidou.mybatisplus.annotation.IdType;
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;
import java.util.Date;
/**
* @Description: 定位隧道
* @author pds
* @date 2023-09-12
* @version V1.0
*/
@Data
@TableName("location_tunnel")
@ApiModel(value = "LocationTunnel实体类", description = "LocationTunnel")
public class LocationTunnel implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键id
*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键id")
private Long id;
/**
* 隧道名称
*/
@Excel(name = "隧道名称", width = 15)
@ApiModelProperty(value = "隧道名称")
private String tunnelName;
/**
* 隧道ID
*/
@Excel(name = "隧道ID", width = 15)
@ApiModelProperty(value = "隧道ID")
private String tunnelId;
/**
* 隧道长度(m)
*/
@Excel(name = "隧道长度(m)", width = 15)
@ApiModelProperty(value = "隧道长度(m)")
private Double tunnelLength;
/**
* 施工进度开始(m)
*/
@Excel(name = "施工进度开始(m)", width = 15)
@ApiModelProperty(value = "施工进度开始(m)")
private Double constructionProgressBegin;
/**
* 施工进度结束(m)
*/
@Excel(name = "施工进度结束(m)", width = 15)
@ApiModelProperty(value = "施工进度结束(m)")
private Double constructionProgressEnd;
/**
* Y值随机范围开始(px)
*/
@Excel(name = "Y值随机范围开始(px)", width = 15)
@ApiModelProperty(value = "Y值随机范围开始(px)")
private Integer yValueRandomRangeStart;
/**
* Y值随机范围结束(px)
*/
@Excel(name = "Y值随机范围结束(px)", width = 15)
@ApiModelProperty(value = "Y值随机范围结束(px)")
private Integer yValueRandomRangeEnd;
/**
* 备注
*/
@Excel(name = "备注", width = 15)
@ApiModelProperty(value = "备注")
private String remark;
/**
* 项目sn
*/
@Excel(name = "项目sn", width = 15)
@ApiModelProperty(value = "项目sn")
private String projectSn;
/**
* 创建时间
*/
@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建时间")
private Date createTime;
/**
* 更新时间
*/
@Excel(name = "更新时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新时间")
private Date updateTime;
/**
* 平面图
*/
@Excel(name = "平面图", width = 15)
@ApiModelProperty(value = "平面图")
private String planarGraph;
@ApiModelProperty(value = "实时数据id")
private Long realtimeId;
}

View File

@ -0,0 +1,28 @@
package com.zhgd.xmgl.modules.location.entity.dto;
import lombok.Data;
@Data
public class JiLianDaRt {
private String data;
private Integer code;
private String info;
public static JiLianDaRt success() {
JiLianDaRt jiLianDaRt = new JiLianDaRt();
jiLianDaRt.setData("ok!");
jiLianDaRt.setCode(200);
jiLianDaRt.setInfo("success");
return jiLianDaRt;
}
public static JiLianDaRt fail() {
JiLianDaRt jiLianDaRt = new JiLianDaRt();
jiLianDaRt.setData("fail!");
jiLianDaRt.setCode(500);
jiLianDaRt.setInfo("fail");
return success();
}
}

View File

@ -0,0 +1,14 @@
package com.zhgd.xmgl.modules.location.entity.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class RealTimeLocationWorkerVo {
@ApiModelProperty(value = "企业名称")
private String enterpriseName;
@ApiModelProperty(value = "班组名称")
private String teamName;
@ApiModelProperty(value = "人数")
private Integer count;
}

View File

@ -0,0 +1,30 @@
package com.zhgd.xmgl.modules.location.mapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhgd.xmgl.modules.location.entity.LocationData;
import com.zhgd.xmgl.modules.location.entity.vo.RealTimeLocationWorkerVo;
import org.apache.ibatis.annotations.Mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.HashMap;
import java.util.List;
/**
* @Description: 定位数据
* @author pds
* @date 2023-09-12
* @version V1.0
*/
@Mapper
public interface LocationDataMapper extends BaseMapper<LocationData> {
List<RealTimeLocationWorkerVo> countRealTimeLocationWorker(HashMap<String, Object> paramMap);
List<LocationData> getRealTimeLocationWorker(HashMap<String, Object> paramMap);
IPage<LocationData> queryPageList(Page<LocationData> page, @Param(Constants.WRAPPER) QueryWrapper<LocationData> queryWrapper);
}

View File

@ -0,0 +1,16 @@
package com.zhgd.xmgl.modules.location.mapper;
import org.apache.ibatis.annotations.Mapper;
import com.zhgd.xmgl.modules.location.entity.LocationTagLowVoltageAlarm;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 定位低电量报警
* @author pds
* @date 2023-09-12
* @version V1.0
*/
@Mapper
public interface LocationTagLowVoltageAlarmMapper extends BaseMapper<LocationTagLowVoltageAlarm> {
}

View File

@ -0,0 +1,16 @@
package com.zhgd.xmgl.modules.location.mapper;
import org.apache.ibatis.annotations.Mapper;
import com.zhgd.xmgl.modules.location.entity.LocationTunnel;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 定位隧道
* @author pds
* @date 2023-09-12
* @version V1.0
*/
@Mapper
public interface LocationTunnelMapper extends BaseMapper<LocationTunnel> {
}

View File

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhgd.xmgl.modules.location.mapper.LocationDataMapper">
<select id="countRealTimeLocationWorker"
resultType="com.zhgd.xmgl.modules.location.entity.vo.RealTimeLocationWorkerVo">
select ei.enterprise_name, i.team_name, count(*) count
from location_data d
join worker_info wi on d.cardno = wi.location_cardno
join team_info i on i.id = wi.team_id
join enterprise_info ei on ei.id = wi.enterprise_id
where 1 = 1
and d.realtime_id = (select location_tunnel.realtime_id from location_tunnel where id = #{locationTunnelId})
<if test="projectSn != null and projectSn != ''">
and d.project_sn = #{projectSn}
</if>
group by i.id
</select>
<select id="getRealTimeLocationWorker" resultType="com.zhgd.xmgl.modules.location.entity.LocationData">
select d.*
from location_data d
join worker_info wi on d.cardno = wi.location_cardno
where d.realtime_id = (select location_tunnel.realtime_id from location_tunnel where id = #{locationTunnelId})
<if test="queryStr != null and queryStr != ''">
and (wi.worker_name like concat('%', #{queryStr}, '%') or
wi.location_cardno like concat('%', #{queryStr}, '%'))
</if>
</select>
<select id="queryPageList" resultType="com.zhgd.xmgl.modules.location.entity.LocationData">
select wi.worker_name as personName, d.*
from location_data d
join worker_info wi on d.cardno = wi.location_cardno
${ew.customSqlSegment}
</select>
</mapper>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhgd.xmgl.modules.location.mapper.LocationTagLowVoltageAlarmMapper">
</mapper>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhgd.xmgl.modules.location.mapper.LocationTunnelMapper">
</mapper>

View File

@ -0,0 +1,29 @@
package com.zhgd.xmgl.modules.location.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zhgd.xmgl.modules.location.entity.LocationData;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zhgd.xmgl.modules.location.entity.dto.JiLianDaRt;
import com.zhgd.xmgl.modules.location.entity.vo.RealTimeLocationWorkerVo;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
/**
* @Description: 定位数据
* @author pds
* @date 2023-09-12
* @version V1.0
*/
public interface ILocationDataService extends IService<LocationData> {
List<RealTimeLocationWorkerVo> countRealTimeLocationWorker(HashMap<String, Object> paramMap);
List<LocationData> getRealTimeLocationWorker(HashMap<String, Object> paramMap);
IPage<LocationData> queryPageList(LocationData locationData, Integer pageNo, Integer pageSize, HttpServletRequest req);
JiLianDaRt uploadLocationDataList(HashMap<String, Object> paramMap);
}

View File

@ -0,0 +1,19 @@
package com.zhgd.xmgl.modules.location.service;
import com.zhgd.xmgl.modules.location.entity.LocationTagLowVoltageAlarm;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zhgd.xmgl.modules.location.entity.dto.JiLianDaRt;
import java.util.HashMap;
/**
* @Description: 定位低电量报警
* @author pds
* @date 2023-09-12
* @version V1.0
*/
public interface ILocationTagLowVoltageAlarmService extends IService<LocationTagLowVoltageAlarm> {
JiLianDaRt uploadSensorAlarm(HashMap<String, Object> paramMap);
}

View File

@ -0,0 +1,14 @@
package com.zhgd.xmgl.modules.location.service;
import com.zhgd.xmgl.modules.location.entity.LocationTunnel;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 定位隧道
* @author pds
* @date 2023-09-12
* @version V1.0
*/
public interface ILocationTunnelService extends IService<LocationTunnel> {
}

View File

@ -0,0 +1,81 @@
package com.zhgd.xmgl.modules.location.service.impl;
import cn.hutool.core.util.IdUtil;
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.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gexin.fastjson.JSON;
import com.gexin.fastjson.TypeReference;
import com.sun.jersey.core.util.Base64;
import com.zhgd.jeecg.common.execption.OpenAlertException;
import com.zhgd.jeecg.common.system.query.QueryGenerator;
import com.zhgd.xmgl.modules.location.entity.LocationData;
import com.zhgd.xmgl.modules.location.entity.LocationTunnel;
import com.zhgd.xmgl.modules.location.entity.dto.JiLianDaRt;
import com.zhgd.xmgl.modules.location.entity.vo.RealTimeLocationWorkerVo;
import com.zhgd.xmgl.modules.location.mapper.LocationDataMapper;
import com.zhgd.xmgl.modules.location.mapper.LocationTunnelMapper;
import com.zhgd.xmgl.modules.location.service.ILocationDataService;
import com.zhgd.xmgl.util.RefUtil;
import org.apache.commons.collections.MapUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
/**
* @Description: 定位数据
* @author pds
* @date 2023-09-12
* @version V1.0
*/
@Service
public class LocationDataServiceImpl extends ServiceImpl<LocationDataMapper, LocationData> implements ILocationDataService {
@Autowired
LocationTunnelMapper locationTunnelMapper;
@Override
public List<RealTimeLocationWorkerVo> countRealTimeLocationWorker(HashMap<String, Object> paramMap) {
List<RealTimeLocationWorkerVo> realTimeLocationWorkerVos = baseMapper.countRealTimeLocationWorker(paramMap);
return realTimeLocationWorkerVos;
}
@Override
public List<LocationData> getRealTimeLocationWorker(HashMap<String, Object> paramMap) {
return baseMapper.getRealTimeLocationWorker(paramMap);
}
@Override
public IPage<LocationData> queryPageList(LocationData locationData, Integer pageNo, Integer pageSize, HttpServletRequest req) {
QueryWrapper<LocationData> queryWrapper = QueryGenerator.initQueryWrapper(locationData, req.getParameterMap(),
null, RefUtil.fieldNames(LocationData::getPersonName), "d.");
Page<LocationData> page = new Page<LocationData>(pageNo, pageSize);
IPage<LocationData> pageList = baseMapper.queryPageList(page, queryWrapper);
return pageList;
}
@Override
public JiLianDaRt uploadLocationDataList(HashMap<String, Object> paramMap) {
long l = IdUtil.getSnowflake().nextId();
String data = MapUtils.getString(paramMap, "data");
List<LocationData> locationDataList = JSON.parseObject(Base64.base64Decode(data), new TypeReference<List<LocationData>>() {
});
for (LocationData locationData : locationDataList) {
LocationTunnel tunnel = locationTunnelMapper.selectOne(new LambdaQueryWrapper<LocationTunnel>().eq(LocationTunnel::getTunnelId, locationData.getRegionId()));
if (tunnel == null) {
throw new OpenAlertException("隧道id区域id不存在");
}
locationData.setProjectSn(locationData.getProjectId());
locationData.setRealtimeId(l);
locationData.setTunnel_id(locationData.getRegionId());
baseMapper.insert(locationData);
tunnel.setRealtimeId(l);
locationTunnelMapper.updateById(tunnel);
}
return JiLianDaRt.success();
}
}

View File

@ -0,0 +1,33 @@
package com.zhgd.xmgl.modules.location.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gexin.fastjson.JSON;
import com.sun.jersey.core.util.Base64;
import com.zhgd.xmgl.modules.location.entity.LocationTagLowVoltageAlarm;
import com.zhgd.xmgl.modules.location.entity.dto.JiLianDaRt;
import com.zhgd.xmgl.modules.location.mapper.LocationTagLowVoltageAlarmMapper;
import com.zhgd.xmgl.modules.location.service.ILocationTagLowVoltageAlarmService;
import org.apache.commons.collections.MapUtils;
import org.springframework.stereotype.Service;
import java.util.HashMap;
/**
* @Description: 定位低电量报警
* @author pds
* @date 2023-09-12
* @version V1.0
*/
@Service
public class LocationTagLowVoltageAlarmServiceImpl extends ServiceImpl<LocationTagLowVoltageAlarmMapper, LocationTagLowVoltageAlarm> implements ILocationTagLowVoltageAlarmService {
@Override
public JiLianDaRt uploadSensorAlarm(HashMap<String, Object> paramMap) {
String data = MapUtils.getString(paramMap, "data");
LocationTagLowVoltageAlarm alarm = JSON.parseObject(Base64.base64Decode(data), LocationTagLowVoltageAlarm.class);
alarm.setProjectSn(alarm.getProjectId());
baseMapper.insert(alarm);
return JiLianDaRt.success();
}
}

View File

@ -0,0 +1,19 @@
package com.zhgd.xmgl.modules.location.service.impl;
import com.zhgd.xmgl.modules.location.entity.LocationTunnel;
import com.zhgd.xmgl.modules.location.mapper.LocationTunnelMapper;
import com.zhgd.xmgl.modules.location.service.ILocationTunnelService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 定位隧道
* @author pds
* @date 2023-09-12
* @version V1.0
*/
@Service
public class LocationTunnelServiceImpl extends ServiceImpl<LocationTunnelMapper, LocationTunnel> implements ILocationTunnelService {
}

View File

@ -5,8 +5,6 @@ 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 com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -322,6 +320,9 @@ public class WorkerInfo implements Serializable {
@ApiModelProperty(value = "人员分类1普通人员2外来人员3其他人员")
private java.lang.Integer workerClassify;
@ApiModelProperty(value = "'定位标签号'")
private java.lang.String locationCardno;
@TableField(exist = false)
@ApiModelProperty(value = "人脸分数")
private java.lang.Integer faceScore;

View File

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhgd.jeecg.common.execption.OpenAlertException;
import com.zhgd.jeecg.common.mybatis.EntityMap;
import com.zhgd.xmgl.async.AsyncJiLianDa;
import com.zhgd.xmgl.async.AsyncWorker;
import com.zhgd.xmgl.modules.gt.entity.GtMaterialInOutWarehouse;
import com.zhgd.xmgl.modules.worker.entity.DepartmentInfo;
@ -35,6 +36,8 @@ public class DepartmentInfoServiceImpl extends ServiceImpl<DepartmentInfoMapper,
private WorkerInfoMapper workerInfoMapper;
@Autowired
private AsyncWorker asyncWorker;
@Autowired
private AsyncJiLianDa asyncJiLianDa;
@Override
public void removeDepartmentInfo(String id) {
@ -50,6 +53,7 @@ public class DepartmentInfoServiceImpl extends ServiceImpl<DepartmentInfoMapper,
throw new OpenAlertException(MessageUtil.get("notDeleteDepartmentErr"));
}
departmentInfoMapper.deleteById(id);
asyncJiLianDa.removeDepartmentInfo(departmentInfo);
}
@Override
@ -85,6 +89,7 @@ public class DepartmentInfoServiceImpl extends ServiceImpl<DepartmentInfoMapper,
departmentInfoMapper.insert(departmentInfo);
//上传外部平台
asyncWorker.sendAddOrUpdateTeam(null, departmentInfo, 2);
asyncJiLianDa.saveDepartmentInfo(departmentInfo);
return departmentInfo;
}
@ -101,6 +106,7 @@ public class DepartmentInfoServiceImpl extends ServiceImpl<DepartmentInfoMapper,
departmentInfoMapper.updateById(departmentInfo);
//上传外部平台
asyncWorker.sendAddOrUpdateTeam(null, departmentInfo, 2);
asyncJiLianDa.saveDepartmentInfo(departmentInfo);
return departmentInfo;
}

View File

@ -10,13 +10,16 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhgd.jeecg.common.api.vo.Result;
import com.zhgd.jeecg.common.execption.OpenAlertException;
import com.zhgd.jeecg.common.mybatis.EntityMap;
import com.zhgd.xmgl.async.AsyncJiLianDa;
import com.zhgd.xmgl.async.AsyncWorker;
import com.zhgd.xmgl.base.CompanyVo;
import com.zhgd.xmgl.modules.project.entity.Project;
import com.zhgd.xmgl.modules.project.entity.ProjectEnterprise;
import com.zhgd.xmgl.modules.project.mapper.ProjectEnterpriseMapper;
import com.zhgd.xmgl.modules.project.mapper.ProjectMapper;
import com.zhgd.xmgl.modules.worker.entity.*;
import com.zhgd.xmgl.modules.worker.entity.EnterpriseInfo;
import com.zhgd.xmgl.modules.worker.entity.SjEnterpriseInfo;
import com.zhgd.xmgl.modules.worker.entity.TeamInfo;
import com.zhgd.xmgl.modules.worker.mapper.EnterpriseInfoMapper;
import com.zhgd.xmgl.modules.worker.mapper.TeamInfoMapper;
import com.zhgd.xmgl.modules.worker.service.IEnterpriseInfoService;
@ -30,7 +33,10 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
/**
* @Description: 劳务公司
@ -53,6 +59,8 @@ public class EnterpriseInfoServiceImpl extends ServiceImpl<EnterpriseInfoMapper,
private TeamInfoMapper teamInfoMapper;
@Autowired
private AsyncWorker asyncWorker;
@Autowired
private AsyncJiLianDa asyncJiLianDa;
@Override
public List<EntityMap> getEnterpriseInfoList(Map<String, Object> map) {
@ -101,6 +109,7 @@ public class EnterpriseInfoServiceImpl extends ServiceImpl<EnterpriseInfoMapper,
projectEnterprise.setDepartmentType(enterpriseInfo.getDepartmentType());
projectEnterpriseMapper.insert(projectEnterprise);
asyncWorker.addEnterpriseInfo(enterpriseInfo);
asyncJiLianDa.saveEnterpriseInfo(enterpriseInfo);
userEnterpriseService.addEnterpriseIdForSubProject(String.valueOf(enterpriseInfo.getId()));
return enterpriseInfo;
}
@ -128,9 +137,8 @@ public class EnterpriseInfoServiceImpl extends ServiceImpl<EnterpriseInfoMapper,
//projectEnterpriseMapper.delete(queryWrapper);
projectEnterpriseMapper.deleteById(projectEnterprise.getId());
asyncWorker.removeEnterpriseInfo(projectEnterprise);
asyncJiLianDa.removeEnterpriseInfo(projectEnterprise);
}
}
@Override
@ -177,6 +185,7 @@ public class EnterpriseInfoServiceImpl extends ServiceImpl<EnterpriseInfoMapper,
/*if(enterpriseInfo.getEnterpriseTypeId()!=projectEnterpris.getEnterpriseTypeId().intValue()){
}*/
asyncJiLianDa.saveEnterpriseInfo(enterpriseInfo);
return enterpriseInfo;
}

View File

@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhgd.jeecg.common.execption.OpenAlertException;
import com.zhgd.jeecg.common.mybatis.EntityMap;
import com.zhgd.xmgl.async.AsyncJiLianDa;
import com.zhgd.xmgl.async.AsyncWorker;
import com.zhgd.xmgl.modules.worker.entity.EnterpriseInfo;
import com.zhgd.xmgl.modules.worker.entity.TeamInfo;
@ -50,6 +51,8 @@ public class TeamInfoServiceImpl extends ServiceImpl<TeamInfoMapper, TeamInfo> i
private AsyncWorker asyncWorker;
@Autowired
private EnterpriseInfoMapper enterpriseInfoMapper;
@Autowired
private AsyncJiLianDa asyncJiLianDa;
@Override
public void removeTeamInfo(String id) {
@ -65,6 +68,7 @@ public class TeamInfoServiceImpl extends ServiceImpl<TeamInfoMapper, TeamInfo> i
throw new OpenAlertException(MessageUtil.get("notDeleteTeamErr"));
}
teamInfoMapper.deleteById(id);
asyncJiLianDa.removeTeamInfo(teamInfo);
}
@Override
@ -108,6 +112,7 @@ public class TeamInfoServiceImpl extends ServiceImpl<TeamInfoMapper, TeamInfo> i
teamInfoMapper.updateById(teamInfo);
//上传外部平台
asyncWorker.sendAddOrUpdateTeam(teamInfo, null, 1);
asyncJiLianDa.saveTeamInfo(teamInfo);
return teamInfo;
}
@ -136,6 +141,7 @@ public class TeamInfoServiceImpl extends ServiceImpl<TeamInfoMapper, TeamInfo> i
teamInfoMapper.insert(teamInfo);
//上传外部平台
asyncWorker.sendAddOrUpdateTeam(teamInfo, null, 1);
asyncJiLianDa.saveTeamInfo(teamInfo);
return teamInfo;
}

View File

@ -17,6 +17,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhgd.jeecg.common.api.vo.Result;
import com.zhgd.jeecg.common.execption.OpenAlertException;
import com.zhgd.jeecg.common.mybatis.EntityMap;
import com.zhgd.xmgl.async.AsyncJiLianDa;
import com.zhgd.xmgl.async.AsyncWorker;
import com.zhgd.xmgl.modules.basicdata.entity.Company;
import com.zhgd.xmgl.modules.basicdata.mapper.CompanyMapper;
@ -63,6 +64,8 @@ import java.util.stream.Collectors;
@Slf4j
@Transactional(rollbackFor = Exception.class)
public class WorkerInfoServiceImpl extends ServiceImpl<WorkerInfoMapper, WorkerInfo> implements IWorkerInfoService {
@Autowired
private AsyncJiLianDa asyncJiLianDa;
@Autowired
private ICompanyService companyService;
@Autowired
@ -280,6 +283,7 @@ public class WorkerInfoServiceImpl extends ServiceImpl<WorkerInfoMapper, WorkerI
// 同步到政务平台
govtOpenApiService.workerInfoAddSync(workerInfo);
}
asyncJiLianDa.saveWorkerInfo(workerInfo);
return workerInfo;
}
@ -328,6 +332,7 @@ public class WorkerInfoServiceImpl extends ServiceImpl<WorkerInfoMapper, WorkerI
// 同步到政务平台
govtOpenApiService.workerInfoAddSync(workerInfo);
}
asyncJiLianDa.saveWorkerInfo(workerInfo);
return workerInfo;
}
@ -350,6 +355,7 @@ public class WorkerInfoServiceImpl extends ServiceImpl<WorkerInfoMapper, WorkerI
// 同步
govtOpenApiService.workerInfoDelSync(workerInfo);
}
asyncJiLianDa.removeWorkerInfo(workerInfo);
}
/**
@ -1531,6 +1537,7 @@ public class WorkerInfoServiceImpl extends ServiceImpl<WorkerInfoMapper, WorkerI
workerInfo.setAttendanceNumber(workerInfo.getIdCard());
workerInfoMapper.insert(workerInfo);
}
asyncJiLianDa.saveWorkerInfo(workerInfo);
}
if (!"".equals(existName.toString())) {
existName.deleteCharAt(existName.lastIndexOf(""));

View File

@ -238,6 +238,8 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
.antMatchers("/xmgl/upload/getRenameFile").permitAll()
.antMatchers("/xmgl/poisonousGasDevCurrentData/add").permitAll()
.antMatchers("/xmgl/concreteMonitorAlarm/add").permitAll()
.antMatchers("/api/uploadLocationDataList").permitAll()
.antMatchers("/api/uploadSensorAlarm").permitAll()
.antMatchers(HttpMethod.OPTIONS, "/**").anonymous()
.anyRequest().authenticated() // 剩下所有的验证都需要验证
.and()

View File

@ -0,0 +1,34 @@
package com.zhgd.xmgl.util;
import com.gexin.fastjson.JSON;
import com.zhgd.jeecg.common.util.pass.HttpUtils;
import com.zhgd.xmgl.modules.basicdata.entity.ThirdPartRequestLog;
import com.zhgd.xmgl.modules.basicdata.mapper.ThirdPartRequestLogMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class ThirdPartRequestUtil {
@Autowired
ThirdPartRequestLogMapper thirdPartRequestLogMapper;
/**
* 发送http请求json格式
*
* @param url
* @param body
*/
public String post(String url, Object body) {
ThirdPartRequestLog log = new ThirdPartRequestLog();
log.setUrl(url);
log.setMethod(2);
log.setParam(JSON.toJSONString(body));
thirdPartRequestLogMapper.insert(log);
String rs = HttpUtils.post(url, body);
log.setResult(rs);
log.setStatus(1);
thirdPartRequestLogMapper.updateById(log);
return rs;
}
}

View File

@ -100,3 +100,5 @@ xiwon.postEnvironmentDustData=http://openapi.xiwon588.com/dust/realTimeData
#携稳的appId和appSecret
xiwon.appId=1690940695416
xiwon.appSecret=b6162078-6f1c-4f2c-8cd5-0873f45199b2
#吉联达的推送合作单位、班组、部门、人员的url
jld_push_url=http://127.9.90.1:7123