木垒修改

This commit is contained in:
guoshengxiong 2024-10-29 18:51:03 +08:00
parent 3101ce2b3c
commit 9203de6402
12 changed files with 480 additions and 6 deletions

View File

@ -14,6 +14,7 @@ import com.zhgd.xmgl.modules.car.entity.vo.TodayOutInNumber;
import com.zhgd.xmgl.modules.car.service.ICarCameraService;
import com.zhgd.xmgl.modules.car.service.ICarPassRecordService;
import com.zhgd.xmgl.util.EnvironmentUtil;
import com.zhgd.xmgl.util.PathUtil;
import com.zhgd.xmgl.util.yunboCarUtils;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
@ -198,8 +199,7 @@ public class CarPassRecordController {
if (EnvironmentUtil.getActiveEnvironment().equals("baise") && Objects.equals(parkId, "F20D19C31C5140C585185BAB10E8D9A2")) {
CompletableFuture.runAsync(() -> {
//木垒转发
map.put("park_id", "58FD625B512E4592B7E63C3797442D2C");
String result2 = HttpRequest.post("http://222.80.185.228:6090/xmgl/carPassRecord/saveCarPassRecord")
String result2 = HttpRequest.post(PathUtil.getMlTranspondUrl() + "/xmgl/carPassRecord/saveCarPassRecord")
.form(map)
.timeout(2000)//超时毫秒
.execute().body();

View File

@ -15,6 +15,7 @@ import com.zhgd.xmgl.modules.mulei.service.IMlHoistService;
import com.zhgd.xmgl.modules.video.entity.VideoItem;
import com.zhgd.xmgl.modules.video.service.IVideoItemService;
import com.zhgd.xmgl.util.FlowUtil;
import com.zhgd.xmgl.util.PathUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
@ -128,9 +129,8 @@ public class MlHoistController {
VideoItem finalItem = item;
CompletableFuture.runAsync(() -> {
//木垒转发
map.put("projectSn", "58FD625B512E4592B7E63C3797442D2C");
map.put("serialNumber", finalItem.getSerialNumber());
String result2 = HttpRequest.post("http://222.80.185.228:6090/xmgl/mlHoist/flow/add/transpond")
String result2 = HttpRequest.post(PathUtil.getMlTranspondUrl() + "/xmgl/mlHoist/flow/add/transpond")
.body(JSON.toJSONString(map))
.timeout(2000)//超时毫秒
.execute().body();

View File

@ -0,0 +1,149 @@
package com.zhgd.xmgl.modules.prevention.controller;
import com.alibaba.fastjson.JSONObject;
import com.zhgd.annotation.OperLog;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiImplicitParams;
import java.util.HashMap;
import springfox.documentation.annotations.ApiIgnore;
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 org.apache.commons.collections.MapUtils;
import com.zhgd.xmgl.modules.prevention.entity.PreventionEpidemicRecord;
import com.zhgd.xmgl.modules.prevention.service.IPreventionEpidemicRecordService;
import org.simpleframework.xml.core.Validate;
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.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;
/**
* @Title: Controller
* @Description: 防疫管理台账
* @author pds
* @date 2024-10-29
* @version V1.0
*/
@RestController
@RequestMapping("/xmgl/preventionEpidemicRecord")
@Slf4j
@Api(tags = "防疫管理台账相关Api")
public class PreventionEpidemicRecordController {
@Autowired
private IPreventionEpidemicRecordService preventionEpidemicRecordService;
/**
* 分页列表查询
*
* @return
*/
@OperLog(operModul = "防疫管理台账管理", operType = "分页查询", operDesc = "分页列表查询防疫管理台账信息")
@ApiOperation(value = "分页列表查询防疫管理台账信息", notes = "分页列表查询防疫管理台账信息", httpMethod = "GET")
@ApiImplicitParams({
@ApiImplicitParam(name = "pageNo", value = "第几页", paramType = "query", required = true, dataType = "Integer"),
@ApiImplicitParam(name = "pageSize", value = "每页显示条数", paramType = "query", required = true, dataType = "Integer"),
})
@GetMapping(value = "/page")
public Result<IPage<PreventionEpidemicRecord>> queryPageList(@ApiIgnore @RequestParam HashMap<String, Object> param) {
return Result.success(preventionEpidemicRecordService.queryPageList(param));
}
/**
* 列表查询
*
* @return
*/
@OperLog(operModul = "防疫管理台账管理", operType = "列表查询", operDesc = "列表查询防疫管理台账信息")
@ApiOperation(value = "列表查询防疫管理台账信息", notes = "列表查询防疫管理台账信息", httpMethod = "GET")
@GetMapping(value = "/list")
public Result<List<PreventionEpidemicRecord>> queryList(@ApiIgnore @RequestParam HashMap<String, Object> param) {
return Result.success(preventionEpidemicRecordService.queryList(param));
}
/**
* 添加
*
* @param preventionEpidemicRecord
* @return
*/
@OperLog(operModul = "防疫管理台账管理", operType = "添加", operDesc = "添加防疫管理台账信息")
@ApiOperation(value = "添加防疫管理台账信息", notes = "添加防疫管理台账信息", httpMethod = "POST")
@PostMapping(value = "/add")
public Result<PreventionEpidemicRecord> add(@RequestBody @Validate PreventionEpidemicRecord preventionEpidemicRecord) {
preventionEpidemicRecordService.add(preventionEpidemicRecord);
return Result.ok();
}
/**
* 编辑
*
* @param preventionEpidemicRecord
* @return
*/
@OperLog(operModul = "防疫管理台账管理", operType = "编辑", operDesc = "编辑防疫管理台账信息")
@ApiOperation(value = "编辑防疫管理台账信息", notes = "编辑防疫管理台账信息", httpMethod = "POST")
@PostMapping(value = "/edit")
public Result<PreventionEpidemicRecord> edit(@RequestBody PreventionEpidemicRecord preventionEpidemicRecord) {
preventionEpidemicRecordService.edit(preventionEpidemicRecord);
return Result.ok();
}
/**
* 通过id删除
*
* @return
*/
@OperLog(operModul = "防疫管理台账管理", operType = "删除", operDesc = "删除防疫管理台账信息")
@ApiOperation(value = "删除防疫管理台账信息", notes = "删除防疫管理台账信息", httpMethod = "POST")
@ApiImplicitParam(name = "id", value = "防疫管理台账ID", paramType = "body", required = true, dataType = "String", example = "{\"id\":\"1\"}")
@PostMapping(value = "/delete")
public Result<PreventionEpidemicRecord> delete(@ApiIgnore @RequestBody HashMap<String, Object> map) {
preventionEpidemicRecordService.delete(MapUtils.getString(map, "id"));
return Result.ok();
}
/**
* 通过id查询
*
* @param id
* @return
*/
@OperLog(operModul = "防疫管理台账管理", operType = "通过id查询", operDesc = "通过id查询防疫管理台账信息")
@ApiOperation(value = "通过id查询防疫管理台账信息", notes = "通过id查询防疫管理台账信息", httpMethod = "GET")
@ApiImplicitParam(name = "id", value = "防疫管理台账ID", paramType = "query", required = true, dataType = "Integer")
@GetMapping(value = "/queryById")
public Result<PreventionEpidemicRecord> queryById(@RequestParam(name = "id", required = true) String id) {
return Result.success(preventionEpidemicRecordService.queryById(id));
}
}

View File

@ -0,0 +1,88 @@
package com.zhgd.xmgl.modules.prevention.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 pds
* @date 2024-10-29
* @version V1.0
*/
@Data
@TableName("prevention_epidemic_record")
@ApiModel(value = "PreventionEpidemicRecord实体类", description = "PreventionEpidemicRecord")
public class PreventionEpidemicRecord implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "id")
private java.lang.Long id;
/**
* 姓名
*/
@ApiModelProperty(value = "姓名")
private java.lang.String name;
/**
* 体温
*/
@ApiModelProperty(value = "体温")
private java.lang.String bodyTemperature;
/**
* 工作区域
*/
@ApiModelProperty(value = "工作区域")
private java.lang.String workingArea;
/**
* 核酸检测日期
*/
@ApiModelProperty(value = "核酸检测日期")
private java.lang.String nucleicDate;
/**
* 是否有发烧咳嗽等症状
*/
@ApiModelProperty(value = "是否有发烧咳嗽等症状")
private java.lang.String feverAndCough;
/**
* 是否有疫情发生地旅居史
*/
@ApiModelProperty(value = "是否有疫情发生地旅居史")
private java.lang.String travelHistory;
/**
* 备注
*/
@ApiModelProperty(value = "备注")
private java.lang.String remark;
/**
* 创建时间 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 = "创建时间 yyyy-MM-dd HH:mm:ss")
private java.util.Date createTime;
/**
* 更新时间 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 = "更新时间 yyyy-MM-dd HH:mm:ss")
private java.util.Date updateTime;
/**
* 项目SN
*/
@ApiModelProperty(value = "项目SN")
private java.lang.String projectSn;
}

View File

@ -0,0 +1,51 @@
package com.zhgd.xmgl.modules.prevention.mapper;
import java.util.List;
import java.util.HashMap;
import com.zhgd.xmgl.modules.prevention.entity.PreventionEpidemicRecord;
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 org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 防疫管理台账
* @author pds
* @date 2024-10-29
* @version V1.0
*/
@Mapper
public interface PreventionEpidemicRecordMapper extends BaseMapper<PreventionEpidemicRecord> {
/**
* 分页列表查询防疫管理台账信息
*
* @param page
* @param queryWrapper
* @param param
* @return
*/
IPage<PreventionEpidemicRecord> queryList(Page<PreventionEpidemicRecord> page, @Param(Constants.WRAPPER) QueryWrapper<PreventionEpidemicRecord> queryWrapper, @Param("param") HashMap<String, Object> param);
/**
* 列表查询防疫管理台账信息
*
* @param queryWrapper
* @param param
* @return
*/
List<PreventionEpidemicRecord> queryList(@Param(Constants.WRAPPER) QueryWrapper<PreventionEpidemicRecord> queryWrapper, @Param("param") HashMap<String, Object> param);
/**
* 通过id查询防疫管理台账信息
*
* @param id
* @return
*/
PreventionEpidemicRecord queryById(String id);
}

View File

@ -0,0 +1,18 @@
<?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.prevention.mapper.PreventionEpidemicRecordMapper">
<select id="queryList" resultType="com.zhgd.xmgl.modules.prevention.entity.PreventionEpidemicRecord">
select * from (
select t.*
from prevention_epidemic_record t
)t
${ew.customSqlSegment}
</select>
<select id="queryById" resultType="com.zhgd.xmgl.modules.prevention.entity.PreventionEpidemicRecord">
select * from (
select t.*
from prevention_epidemic_record t
)t
where t.id = #{id}
</select>
</mapper>

View File

@ -0,0 +1,65 @@
package com.zhgd.xmgl.modules.prevention.service;
import com.zhgd.xmgl.modules.prevention.entity.PreventionEpidemicRecord;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import java.util.HashMap;
import java.util.List;
/**
* @Description: 防疫管理台账
* @author pds
* @date 2024-10-29
* @version V1.0
*/
public interface IPreventionEpidemicRecordService extends IService<PreventionEpidemicRecord> {
/**
* 分页列表查询防疫管理台账信息
*
* @param param 参数map
* @return
*/
IPage<PreventionEpidemicRecord> queryPageList(HashMap<String, Object> param);
/**
* 列表查询防疫管理台账信息
*
* @param param 参数map
* @return
*/
List<PreventionEpidemicRecord> queryList(HashMap<String, Object> param);
/**
* 添加防疫管理台账信息
*
* @param preventionEpidemicRecord 防疫管理台账
* @return
*/
void add(PreventionEpidemicRecord preventionEpidemicRecord);
/**
* 编辑防疫管理台账信息
*
* @param preventionEpidemicRecord 防疫管理台账
* @return
*/
void edit(PreventionEpidemicRecord preventionEpidemicRecord);
/**
* 根据id删除防疫管理台账信息
*
* @param id 防疫管理台账的id
* @return
*/
void delete(String id);
/**
* 根据id查询防疫管理台账信息
*
* @param id 防疫管理台账的id
* @return
*/
PreventionEpidemicRecord queryById(String id);
}

View File

@ -0,0 +1,91 @@
package com.zhgd.xmgl.modules.prevention.service.impl;
import com.zhgd.jeecg.common.execption.OpenAlertException;
import com.zhgd.xmgl.modules.prevention.entity.PreventionEpidemicRecord;
import com.zhgd.xmgl.modules.prevention.mapper.PreventionEpidemicRecordMapper;
import com.zhgd.xmgl.modules.prevention.service.IPreventionEpidemicRecordService;
import org.springframework.stereotype.Service;
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.system.query.QueryGenerator;
import com.zhgd.xmgl.util.PageUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.HashMap;
import java.util.List;
import com.zhgd.xmgl.util.RefUtil;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.beans.factory.annotation.Autowired;
/**
* @Description: 防疫管理台账
* @author pds
* @date 2024-10-29
* @version V1.0
*/
@Service
public class PreventionEpidemicRecordServiceImpl extends ServiceImpl<PreventionEpidemicRecordMapper, PreventionEpidemicRecord> implements IPreventionEpidemicRecordService {
@Autowired
private PreventionEpidemicRecordMapper preventionEpidemicRecordMapper;
@Override
public IPage<PreventionEpidemicRecord> queryPageList(HashMap<String, Object> param) {
QueryWrapper<PreventionEpidemicRecord> queryWrapper = this.getQueryWrapper(param);
Page<PreventionEpidemicRecord> page = PageUtil.getPage(param);
IPage<PreventionEpidemicRecord> pageList = baseMapper.queryList(page, queryWrapper, param);
pageList.setRecords(this.dealList(pageList.getRecords()));
return pageList;
}
@Override
public List<PreventionEpidemicRecord> queryList(HashMap<String, Object> param) {
QueryWrapper<PreventionEpidemicRecord> queryWrapper = getQueryWrapper(param);
return dealList(baseMapper.queryList(queryWrapper, param));
}
private QueryWrapper<PreventionEpidemicRecord> getQueryWrapper(HashMap<String, Object> param) {
QueryWrapper<PreventionEpidemicRecord> queryWrapper = QueryGenerator.initPageQueryWrapper(PreventionEpidemicRecord.class, param, true);
queryWrapper.orderByDesc(RefUtil.fieldNameUlc(PreventionEpidemicRecord::getId));
return queryWrapper;
}
private List<PreventionEpidemicRecord> dealList(List<PreventionEpidemicRecord> list) {
return list;
}
@Override
public void add(PreventionEpidemicRecord preventionEpidemicRecord) {
preventionEpidemicRecord.setId(null);
baseMapper.insert(preventionEpidemicRecord);
}
@Override
public void edit(PreventionEpidemicRecord preventionEpidemicRecord) {
PreventionEpidemicRecord oldPreventionEpidemicRecord = baseMapper.selectById(preventionEpidemicRecord.getId());
if (oldPreventionEpidemicRecord == null) {
throw new OpenAlertException("未找到对应实体");
}
baseMapper.updateById(preventionEpidemicRecord);
}
@Override
public void delete(String id) {
PreventionEpidemicRecord preventionEpidemicRecord = baseMapper.selectById(id);
if (preventionEpidemicRecord == null) {
throw new OpenAlertException("未找到对应实体");
}
baseMapper.deleteById(id);
}
@Override
public PreventionEpidemicRecord queryById(String id) {
PreventionEpidemicRecord entity = baseMapper.queryById(id);
if (entity == null) {
throw new OpenAlertException("未找到对应实体");
}
return entity;
}
}

View File

@ -219,7 +219,7 @@ public class AiAnalyseHardWareAlarmRecordServiceImpl extends ServiceImpl<AiAnaly
if(aiAnalyseHardWareRecord.getProjectSn().equals("F20D19C31C5140C585185BAB10E8D9A2")) {
CompletableFuture.runAsync(() -> {
//木垒转发
String result2 = HttpRequest.post("http://222.80.185.228:6090/xmgl/api/saveHardWareAlarm")
String result2 = HttpRequest.post(PathUtil.getMlTranspondUrl() + "/xmgl/api/saveHardWareAlarm")
.body(JSON.toJSONString(body))
.timeout(2000)//超时毫秒
.execute().body();

View File

@ -1201,7 +1201,7 @@ status 状态码 String 1表示成功其余表示失败
if (Objects.equals(dev.getProjectSn(), "F20D19C31C5140C585185BAB10E8D9A2")) {
CompletableFuture.runAsync(() -> {
//木垒转发
String result2 = HttpRequest.post("http://222.80.185.228:6090/photo")
String result2 = HttpRequest.post(PathUtil.getMlTranspondUrl() + "/photo")
.body(JSON.toJSONString(dto))
.timeout(2000)//超时毫秒
.execute().body();

View File

@ -9,6 +9,7 @@ public class PathUtil {
private static String basePath;
private static String serverUrl;
private static String mlTranspondUrl;
/**
* 删除多余的斜杠
@ -29,6 +30,15 @@ public class PathUtil {
PathUtil.serverUrl = serverUrl;
}
public static String getMlTranspondUrl() {
return StrUtil.removeSuffix(mlTranspondUrl, "/");
}
@Value("${ml.transpond.url}")
public void setMlTranspondUrl(String mlTranspondUrl) {
PathUtil.mlTranspondUrl = mlTranspondUrl;
}
public static void main(String[] args) {
System.out.println(reviseSlash("/home//foo/"));

View File

@ -100,3 +100,5 @@ magic-api.resource.location=C:/jxj/prod/backEnd/itbgpImage/data/magic-api
upload.image.url.prefix=http://jxj.zhgdyun.com:51234/image/
#内网的服务图片的url前缀
xingzong.inner.upload.image.url.prefix=http://10.168.2.104:9809/image/
#转发木垒url
ml.transpond.url=https://zm.zhgdyun.com:11111