6 files modified
9 files added
| | |
| | | enabled: true |
| | | name: minio |
| | | tenant-mode: true |
| | | endpoint: https://web.byisf.com:9001 |
| | | endpoint: http://web.byisf.com:9000 |
| | | access-key: adminminio |
| | | secret-key: adminminio |
| | | bucket-name: jfpt |
| | |
| | | private String czTime; |
| | | private String bz; |
| | | private String cid; |
| | | private String vaddress; |
| | | |
| | | // @TableLogic |
| | | // private Integer isDeleted; |
| | |
| | | void updateJtype(String id, String jtype, String bz); |
| | | void updatePoliceStatus(String id, String status); |
| | | void updateOne(Alarm alarm); |
| | | void updateVaddress(String vaddress ,String jid); |
| | | |
| | | List<Map<String, Object>> selectScount(String time); |
| | | |
| | |
| | | <result column="bz" property="bz"/> |
| | | <result column="name" property="name"/> |
| | | <result column="cid" property="cid"/> |
| | | <result column="vaddress" property="vaddress"/> |
| | | </resultMap> |
| | | |
| | | |
| | |
| | | is_deleted != '1' |
| | | AND role_id = "1370562810882502657" |
| | | </select> |
| | | |
| | | <update id="updateVaddress"> |
| | | update sys_alarm SET vaddress=#{vaddress} where id=#{jid} |
| | | </update> |
| | | </mapper> |
| | |
| | | List<Map<String, Object>> selectScount(String time); |
| | | List<AlarmVO> selectListSe(String beginTime, String endTime); |
| | | void updateJtype(String id, String jtype, String bz); |
| | | |
| | | void updateVaddress(String vaddress ,String jid); |
| | | void updatePoliceStatus(String id, String status); |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void updateVaddress(String vaddress, String jid) { |
| | | baseMapper.updateVaddress(vaddress, jid); |
| | | } |
| | | |
| | | @Override |
| | | public void updatePoliceStatus(String id,String status) { |
| | | baseMapper.updatePoliceStatus(id,status); |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.jfpt.rvideo.controller; |
| | | |
| | | import io.minio.MinioClient; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import jodd.util.StringPool; |
| | | import lombok.AllArgsConstructor; |
| | | |
| | | import javax.validation.Valid; |
| | | |
| | | import net.logstash.logback.encoder.org.apache.commons.lang3.StringEscapeUtils; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springblade.jfpt.alarm.service.IAlarmService; |
| | | import org.springblade.jfpt.xlfeedback.service.IXlfeedbackService; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.jfpt.rvideo.entity.Rvideo; |
| | | import org.springblade.jfpt.rvideo.vo.RvideoVO; |
| | | import org.springblade.jfpt.rvideo.service.IRvideoService; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | |
| | | import java.io.File; |
| | | import java.io.InputStream; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.net.URLEncoder; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.UUID; |
| | | |
| | | /** |
| | | * 控制器 |
| | | * |
| | | * @author BladeX |
| | | * @since 2021-03-24 |
| | | */ |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("/rvideo") |
| | | @Api(value = "", tags = "接口") |
| | | public class RvideoController extends BladeController { |
| | | |
| | | private final IRvideoService rvideoService; |
| | | private final IAlarmService alarmService; |
| | | private final IXlfeedbackService xlfeedbackService; |
| | | private static String PRE_URL = "D:\\software\\minio\\data\\jfpt\\void\\"; |
| | | |
| | | private static String PRF_MINIO_URL = "minio/jfpt/void/"; |
| | | |
| | | /** |
| | | * 详情 |
| | | */ |
| | | @GetMapping("/detail") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "详情", notes = "传入rvideo") |
| | | public R<Rvideo> detail(Rvideo rvideo) { |
| | | Rvideo detail = rvideoService.getOne(Condition.getQueryWrapper(rvideo)); |
| | | return R.data(detail); |
| | | } |
| | | |
| | | /** |
| | | * 分页 |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "分页", notes = "传入rvideo") |
| | | public R<IPage<Rvideo>> list(Rvideo rvideo, Query query) { |
| | | IPage<Rvideo> pages = rvideoService.page(Condition.getPage(query), Condition.getQueryWrapper(rvideo)); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * 自定义分页 |
| | | */ |
| | | @GetMapping("/page") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "分页", notes = "传入rvideo") |
| | | public R<IPage<RvideoVO>> page(RvideoVO rvideo, Query query) { |
| | | IPage<RvideoVO> pages = rvideoService.selectRvideoPage(Condition.getPage(query), rvideo); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * 新增 |
| | | */ |
| | | @PostMapping("/save") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "新增", notes = "传入rvideo") |
| | | public R save(@Valid @RequestBody Rvideo rvideo) { |
| | | return R.status(rvideoService.save(rvideo)); |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | */ |
| | | @PostMapping("/update") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "修改", notes = "传入rvideo") |
| | | public R update(@Valid @RequestBody Rvideo rvideo) { |
| | | return R.status(rvideoService.updateById(rvideo)); |
| | | } |
| | | |
| | | /** |
| | | * 新增或修改 |
| | | */ |
| | | @PostMapping("/submit") |
| | | @ApiOperationSupport(order = 6) |
| | | @ApiOperation(value = "新增或修改", notes = "传入rvideo") |
| | | public R submit(@Valid @RequestBody Rvideo rvideo) { |
| | | return R.status(rvideoService.saveOrUpdate(rvideo)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 删除 |
| | | */ |
| | | @PostMapping("/remove") |
| | | @ApiOperationSupport(order = 8) |
| | | @ApiOperation(value = "删除", notes = "传入ids") |
| | | public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
| | | return R.status(rvideoService.removeByIds(Func.toLongList(ids))); |
| | | } |
| | | |
| | | /** |
| | | * @param sourcePath 源路径 |
| | | * @param jid 警情id |
| | | * @throws Exception |
| | | */ |
| | | @PostMapping("/rVoid") |
| | | public String rVoid(String sourcePath,String jid) throws Exception { |
| | | String webroot = "D:\\LXVideoServer\\3rd\\ffmpeg\\bin"; |
| | | String UUID = DateUtil.time(); |
| | | //目标路径 |
| | | String targetPath = PRE_URL + UUID + ".mp4"; |
| | | //返回前端路径 |
| | | String vaddress = null; |
| | | Runtime run = null; |
| | | |
| | | try { |
| | | |
| | | run = Runtime.getRuntime(); |
| | | |
| | | long start = System.currentTimeMillis(); |
| | | |
| | | System.out.println(new File(webroot).getAbsolutePath()); |
| | | //通过视频url录制30s视频保存,格式为MP4 |
| | | String newJson = StringEscapeUtils.unescapeHtml4(sourcePath); |
| | | Process p = run.exec(new File(webroot).getAbsolutePath() + "/ffmpeg -i " +newJson+ " -y -t 00:00:30 -codec copy -f mp4 " + targetPath); |
| | | |
| | | //释放进程 |
| | | |
| | | p.getOutputStream().close(); |
| | | |
| | | p.getInputStream().close(); |
| | | |
| | | p.getErrorStream().close(); |
| | | |
| | | p.waitFor(); |
| | | |
| | | long end = System.currentTimeMillis(); |
| | | |
| | | System.out.println(sourcePath + " convert success, costs:" + (end - start) + "ms"); |
| | | |
| | | } catch (Exception e) { |
| | | |
| | | e.printStackTrace(); |
| | | |
| | | } finally { |
| | | //run调用lame解码器最后释放内存 |
| | | run.freeMemory(); |
| | | //返回路径 |
| | | vaddress = "https://web.byisf.com/" + PRF_MINIO_URL + UUID + ".mp4"; |
| | | //把路径通过警情id添加到警情信息 |
| | | alarmService.updateVaddress(vaddress,jid); |
| | | } |
| | | return vaddress; |
| | | } |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.jfpt.rvideo.dto; |
| | | |
| | | import org.springblade.jfpt.rvideo.entity.Rvideo; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * 数据传输对象实体类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2021-03-24 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class RvideoDTO extends Rvideo { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.jfpt.rvideo.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import java.time.LocalDateTime; |
| | | import java.io.Serializable; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | /** |
| | | * 实体类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2021-03-24 |
| | | */ |
| | | @Data |
| | | @TableName("sys_rvideo") |
| | | @ApiModel(value = "Rvideo对象", description = "Rvideo对象") |
| | | public class Rvideo implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 警单id |
| | | */ |
| | | @ApiModelProperty(value = "警单id") |
| | | private String jid; |
| | | /** |
| | | * 录制发生时间 |
| | | */ |
| | | @ApiModelProperty(value = "录制发生时间") |
| | | private String rtime; |
| | | /** |
| | | * 录制地址 |
| | | */ |
| | | @ApiModelProperty(value = "录制地址") |
| | | private String address; |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.jfpt.rvideo.mapper; |
| | | |
| | | import org.springblade.jfpt.rvideo.entity.Rvideo; |
| | | import org.springblade.jfpt.rvideo.vo.RvideoVO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Mapper 接口 |
| | | * |
| | | * @author BladeX |
| | | * @since 2021-03-24 |
| | | */ |
| | | public interface RvideoMapper extends BaseMapper<Rvideo> { |
| | | |
| | | /** |
| | | * 自定义分页 |
| | | * |
| | | * @param page |
| | | * @param rvideo |
| | | * @return |
| | | */ |
| | | List<RvideoVO> selectRvideoPage(IPage page, RvideoVO rvideo); |
| | | |
| | | } |
| New file |
| | |
| | | <?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="org.springblade.jfpt.rvideo.mapper.RvideoMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="rvideoResultMap" type="org.springblade.jfpt.rvideo.entity.Rvideo"> |
| | | <id column="id" property="id"/> |
| | | <result column="jid" property="jid"/> |
| | | <result column="rtime" property="rtime"/> |
| | | <result column="address" property="address"/> |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="selectRvideoPage" resultMap="rvideoResultMap"> |
| | | select * from sys_rvideo where is_deleted = 0 |
| | | </select> |
| | | |
| | | </mapper> |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.jfpt.rvideo.service; |
| | | |
| | | import org.springblade.jfpt.rvideo.entity.Rvideo; |
| | | import org.springblade.jfpt.rvideo.vo.RvideoVO; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | |
| | | /** |
| | | * 服务类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2021-03-24 |
| | | */ |
| | | public interface IRvideoService extends IService<Rvideo> { |
| | | |
| | | /** |
| | | * 自定义分页 |
| | | * |
| | | * @param page |
| | | * @param rvideo |
| | | * @return |
| | | */ |
| | | IPage<RvideoVO> selectRvideoPage(IPage<RvideoVO> page, RvideoVO rvideo); |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.jfpt.rvideo.service.impl; |
| | | |
| | | import org.springblade.jfpt.rvideo.entity.Rvideo; |
| | | import org.springblade.jfpt.rvideo.vo.RvideoVO; |
| | | import org.springblade.jfpt.rvideo.mapper.RvideoMapper; |
| | | import org.springblade.jfpt.rvideo.service.IRvideoService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | |
| | | /** |
| | | * 服务实现类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2021-03-24 |
| | | */ |
| | | @Service |
| | | public class RvideoServiceImpl extends ServiceImpl<RvideoMapper, Rvideo> implements IRvideoService { |
| | | |
| | | @Override |
| | | public IPage<RvideoVO> selectRvideoPage(IPage<RvideoVO> page, RvideoVO rvideo) { |
| | | return page.setRecords(baseMapper.selectRvideoPage(page, rvideo)); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.jfpt.rvideo.vo; |
| | | |
| | | import org.springblade.jfpt.rvideo.entity.Rvideo; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import io.swagger.annotations.ApiModel; |
| | | |
| | | /** |
| | | * 视图实体类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2021-03-24 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @ApiModel(value = "RvideoVO对象", description = "RvideoVO对象") |
| | | public class RvideoVO extends Rvideo { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | } |
| New file |
| | |
| | | INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`) |
| | | VALUES ('1374630731515682822', 1123598815738675201, 'rvideo', '视频录制', 'menu', '/rvideo/rvideo', NULL, 1, 1, 0, 1, NULL, 0); |
| | | INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`) |
| | | VALUES ('1374630731515682823', '1374630731515682822', 'rvideo_add', '新增', 'add', '/rvideo/rvideo/add', 'plus', 1, 2, 1, 1, NULL, 0); |
| | | INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`) |
| | | VALUES ('1374630731515682824', '1374630731515682822', 'rvideo_edit', '修改', 'edit', '/rvideo/rvideo/edit', 'form', 2, 2, 2, 1, NULL, 0); |
| | | INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`) |
| | | VALUES ('1374630731515682825', '1374630731515682822', 'rvideo_delete', '删除', 'delete', '/api/blade-rvideo/rvideo/remove', 'delete', 3, 2, 3, 1, NULL, 0); |
| | | INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`) |
| | | VALUES ('1374630731515682826', '1374630731515682822', 'rvideo_view', '查看', 'view', '/rvideo/rvideo/view', 'file-text', 4, 2, 2, 1, NULL, 0); |