门口门禁增加摄像头功能

pull/10/head
zhaoyu 2024-01-23 17:37:28 +08:00
parent b7c071980e
commit fc979979d0
10 changed files with 583 additions and 0 deletions

View File

@ -119,4 +119,20 @@ public class MkmjAreaGateController extends BaseController {
return map;
}
/**
* @param
* @throws Exception
*/
@RequestMapping(value="/savePosition")
@ResponseBody
public Object savePosition() throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
mkmjAreaGateService.savePosition(pd); //根据ID读取
map.put("result", errInfo);
return map;
}
}

View File

@ -0,0 +1,140 @@
package com.zcloud.controller.mkmj;
import com.zcloud.controller.base.BaseController;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import com.zcloud.service.map.util.ReturnMap;
import com.zcloud.service.mkmj.MkmjAreaGateService;
import com.zcloud.service.mkmj.MkmjGateVideoService;
import com.zcloud.util.DateUtil;
import com.zcloud.util.Jurisdiction;
import com.zcloud.util.Tools;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
*
* zhaoyu
* 2024-01-16
* www.zcloudchina.com
*/
@Controller
@RequestMapping("/mkmjGateVideo")
public class MkmjGateVideoController extends BaseController {
@Autowired
private MkmjGateVideoService mkmjGateVideoService;
/**
* @param
* @throws Exception
*/
@RequestMapping(value="/add")
@RequiresPermissions("mkmjArea:add")
@ResponseBody
public ReturnMap add() throws Exception{
PageData pd = new PageData();
pd = this.getPageData();
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); // 添加时间
pd.put("CREATOR", Jurisdiction.getUSER_ID()); // 添加人
pd.put("CREATTIME", DateUtil.date2Str(new Date())); // 添加时间
pd.put("ISDELETE", "0"); //是否删除
pd.put("OPERATOR", Jurisdiction.getUsername()); //修改人
pd.put("OPERATTIME", DateUtil.date2Str(new Date()));//修改时间
return mkmjGateVideoService.save(pd);
}
/**
* @param
* @throws Exception
*/
@RequestMapping(value="/delete")
@RequiresPermissions("mkmjArea:del")
@ResponseBody
public ReturnMap delete() throws Exception{
PageData pd = new PageData();
pd = this.getPageData();
return mkmjGateVideoService.delete(pd);
}
/**
* @param
* @throws Exception
*/
@RequestMapping(value="/edit")
@RequiresPermissions("mkmjArea:edit")
@ResponseBody
public ReturnMap edit() throws Exception{
PageData pd = new PageData();
pd = this.getPageData();
pd.put("OPERATOR", Jurisdiction.getUsername()); //修改人
pd.put("OPERATTIME", DateUtil.date2Str(new Date()));//修改时间
return mkmjGateVideoService.edit(pd);
}
/**
* @param page
* @throws Exception
*/
@RequestMapping(value="/list")
@RequiresPermissions("mkmjArea:list")
@ResponseBody
public Object list(Page page) throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件
if(Tools.notEmpty(KEYWORDS))pd.put("KEYWORDS", KEYWORDS.trim());
page.setPd(pd);
List<PageData> varList = mkmjGateVideoService.list(page); //列出Coursectk列表
map.put("varList", varList);
map.put("page", page);
map.put("result", errInfo);
return map;
}
/**
* @param
* @throws Exception
*/
@RequestMapping(value="/goEdit")
@RequiresPermissions("mkmjArea:edit")
@ResponseBody
public Object goEdit() throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
pd = mkmjGateVideoService.findById(pd); //根据ID读取
map.put("pd", pd);
map.put("result", errInfo);
return map;
}
/**
* @param
* @throws Exception
*/
@RequestMapping(value="/savePosition")
@ResponseBody
public Object savePosition() throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
mkmjGateVideoService.savePosition(pd); //根据ID读取
map.put("result", errInfo);
return map;
}
}

View File

@ -61,5 +61,11 @@ public interface MkmjAreaGateMapper {
* @return
*/
PageData findByOnly(PageData pageData);
/**
*
* @param pd
*/
void savePosition(PageData pd);
}

View File

@ -0,0 +1,64 @@
package com.zcloud.mapper.datasource.mkmj;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import java.util.List;
/**
*
* zhaoyu
* 2024-01-16
* www.zcloudchina.com
*/
public interface MkmjGateVideoMapper {
/**
* @param pd
* @throws Exception
*/
void save(PageData pd);
/**
* @param pd
* @throws Exception
*/
void delete(PageData pd);
/**
* @param pd
* @throws Exception
*/
void edit(PageData pd);
/**
* @param page
* @throws Exception
*/
List<PageData> datalistPage(Page page);
/**()
* @param pd
* @throws Exception
*/
List<PageData> listAll(PageData pd);
/**id
* @param pd
* @throws Exception
*/
PageData findById(PageData pd);
/**
* @param ArrayDATA_IDS
* @throws Exception
*/
void deleteAll(String[] ArrayDATA_IDS);
/**
*
* @param pd
*/
void savePosition(PageData pd);
}

View File

@ -56,5 +56,11 @@ public interface MkmjAreaGateService {
*/
public ReturnMap deleteAll(String[] ArrayDATA_IDS)throws Exception;
/**
*
* @param pd
* @return
*/
ReturnMap savePosition(PageData pd);
}

View File

@ -0,0 +1,66 @@
package com.zcloud.service.mkmj;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import com.zcloud.service.map.util.ReturnMap;
import java.util.List;
/**
*
* zhaoyu
* 2024-01-16
* www.zcloudchina.com
*/
public interface MkmjGateVideoService {
/**
* @param pd
* @throws Exception
*/
public ReturnMap save(PageData pd)throws Exception;
/**
* @param pd
* @throws Exception
*/
public ReturnMap delete(PageData pd)throws Exception;
/**
* @param pd
* @throws Exception
*/
public ReturnMap edit(PageData pd)throws Exception;
/**
* @param page
* @throws Exception
*/
public List<PageData> list(Page page)throws Exception;
/**()
* @param pd
* @throws Exception
*/
public List<PageData> listAll(PageData pd)throws Exception;
/**id
* @param pd
* @throws Exception
*/
public PageData findById(PageData pd)throws Exception;
/**
* @param ArrayDATA_IDS
* @throws Exception
*/
public ReturnMap deleteAll(String[] ArrayDATA_IDS)throws Exception;
/**
*
* @param pd
* @return
*/
ReturnMap savePosition(PageData pd);
}

View File

@ -105,5 +105,11 @@ public class MkmjAreaGateServiceImpl implements MkmjAreaGateService {
return returnMap.ok("删除成功");
}
@Override
public ReturnMap savePosition(PageData pd) {
mkmjAreaGateMapper.savePosition(pd);
return ReturnMap.ok("定位成功");
}
}

View File

@ -0,0 +1,99 @@
package com.zcloud.service.mkmj.impl;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import com.zcloud.mapper.datasource.mkmj.MkmjAreaGateMapper;
import com.zcloud.mapper.datasource.mkmj.MkmjGateVideoMapper;
import com.zcloud.service.map.util.ReturnMap;
import com.zcloud.service.mkmj.MkmjAreaGateService;
import com.zcloud.service.mkmj.MkmjGateVideoService;
import com.zcloud.util.UuidUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
import java.util.List;
/**
*
* zhaoyu
* 2024-01-16
* www.zcloudchina.com
*/
@Service
@Transactional //开启事物
public class MkmjGateVideServiceImpl implements MkmjGateVideoService {
@Autowired
private MkmjGateVideoMapper mkmjGateVideoMapper;
/**
* @param pd
* @throws Exception
*/
public ReturnMap save(PageData pd)throws Exception{
mkmjGateVideoMapper.save(pd);
return ReturnMap.ok("保存成功");
}
/**
* @param pd
* @throws Exception
*/
public ReturnMap delete(PageData pd)throws Exception{
mkmjGateVideoMapper.delete(pd);
return ReturnMap.ok("删除成功");
}
/**
* @param pd
* @throws Exception
*/
public ReturnMap edit(PageData pd)throws Exception{
mkmjGateVideoMapper.edit(pd);
return ReturnMap.ok("编辑成功");
}
/**
* @param page
* @throws Exception
*/
public List<PageData> list(Page page)throws Exception{
return mkmjGateVideoMapper.datalistPage(page);
}
/**()
* @param pd
* @throws Exception
*/
public List<PageData> listAll(PageData pd)throws Exception{
return mkmjGateVideoMapper.listAll(pd);
}
/**id
* @param pd
* @throws Exception
*/
public PageData findById(PageData pd)throws Exception{
return mkmjGateVideoMapper.findById(pd);
}
/**
* @param ArrayDATA_IDS
* @throws Exception
*/
public ReturnMap deleteAll(String[] ArrayDATA_IDS)throws Exception{
ReturnMap ReturnMap = new ReturnMap();
mkmjGateVideoMapper.deleteAll(ArrayDATA_IDS);
return ReturnMap.ok("删除成功");
}
@Override
public ReturnMap savePosition(PageData pd) {
mkmjGateVideoMapper.savePosition(pd);
return ReturnMap.ok("定位成功");
}
}

View File

@ -19,6 +19,7 @@
f.AREA_ID,
f.GATE_NAME,
f.GATE_TYPE,
f.GATE_CATEGORY,
f.GATE_MODEL,
f.GATE_POSITION,
f.IS_ADJACENT,
@ -40,6 +41,7 @@
AREA_ID,
GATE_NAME,
GATE_TYPE,
GATE_CATEGORY,
GATE_MODEL,
GATE_POSITION,
IS_ADJACENT,
@ -61,6 +63,7 @@
#{AREA_ID},
#{GATE_NAME},
#{GATE_TYPE},
#{GATE_CATEGORY},
#{GATE_MODEL},
#{GATE_POSITION},
#{IS_ADJACENT},
@ -106,6 +109,7 @@
AREA_ID=#{AREA_ID},
GATE_NAME=#{GATE_NAME},
GATE_TYPE=#{GATE_TYPE},
GATE_CATEGORY=#{GATE_CATEGORY},
GATE_MODEL=#{GATE_MODEL},
GATE_POSITION=#{GATE_POSITION},
IS_ADJACENT=#{IS_ADJACENT},
@ -192,4 +196,15 @@
and f.AREA_GATE_ID != #{AREA_GATE_ID}
</if>
</select>
<!-- 定位 -->
<update id="savePosition" parameterType="pd">
update
<include refid="tableName"></include>
set
LATITUDE = #{LATITUDE},
LONGITUDE = #{LONGITUDE}
where
AREA_GATE_ID = #{AREA_GATE_ID}
</update>
</mapper>

View File

@ -0,0 +1,165 @@
<?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.zcloud.mapper.datasource.mkmj.MkmjGateVideoMapper">
<!--表名 -->
<sql id="tableName">
MKMJ_GATE_VIDEO
</sql>
<!--数据字典表名 -->
<sql id="dicTableName">
SYS_DICTIONARIES
</sql>
<!-- 字段 -->
<sql id="Field">
f.GATE_VIDEO_ID,
f.AREA_GATE_ID,
f.VIDEO_RESOURCES_ID,
f.LONGITUDE,
f.LATITUDE,
f.CORPINFO_ID,
f.CREATOR,
f.CREATTIME,
f.OPERATOR,
f.OPERATTIME,
f.ISDELETE
</sql>
<!-- 字段用于新增 -->
<sql id="Field2">
GATE_VIDEO_ID,
AREA_GATE_ID,
VIDEO_RESOURCES_ID,
LONGITUDE,
LATITUDE,
CORPINFO_ID,
CREATOR,
CREATTIME,
OPERATOR,
OPERATTIME,
ISDELETE
</sql>
<!-- 字段值 -->
<sql id="FieldValue">
#{GATE_VIDEO_ID},
#{AREA_GATE_ID},
#{VIDEO_RESOURCES_ID},
#{LONGITUDE},
#{LATITUDE},
#{CORPINFO_ID},
#{CREATOR},
#{CREATTIME},
#{OPERATOR},
#{OPERATTIME},
#{ISDELETE}
</sql>
<!-- 新增-->
<insert id="save" parameterType="pd">
insert into
<include refid="tableName"></include>
(
<include refid="Field2"></include>
) values (
<include refid="FieldValue"></include>
)
</insert>
<!-- 删除-->
<delete id="delete" parameterType="pd">
update
<include refid="tableName"></include>
set
ISDELETE = '1'
where
GATE_VIDEO_ID = #{GATE_VIDEO_ID}
</delete>
<!-- 修改 -->
<update id="edit" parameterType="pd">
update
<include refid="tableName"></include>
set
GATE_VIDEO_ID= GATE_VIDEO_ID,
AREA_GATE_ID=#{AREA_GATE_ID},
VIDEO_RESOURCES_ID=#{VIDEO_RESOURCES_ID},
LONGITUDE=#{LONGITUDE},
LATITUDE=#{LATITUDE},
CORPINFO_ID=#{CORPINFO_ID},
CREATOR=#{CREATOR},
CREATTIME=#{CREATTIME},
OPERATOR=#{OPERATOR},
OPERATTIME=#{OPERATTIME},
ISDELETE=#{ISDELETE}
where
GATE_VIDEO_ID=#{GATE_VIDEO_ID}
</update>
<!-- 通过ID获取数据 -->
<select id="findById" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where
f.GATE_VIDEO_ID=#{GATE_VIDEO_ID}
</select>
<!-- 列表 -->
<select id="datalistPage" parameterType="page" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where f.ISDELETE = '0'
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''"><!-- 关键词检索 -->
and
(
<!-- 根据需求自己加检索条件
字段1 LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
or
字段2 LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
-->
)
</if>
<if test="pd.AREA_GATE_ID != null and pd.AREA_GATE_ID != ''">
f.AREA_GATE_ID = #{pd.AREA_GATE_ID}
</if>
</select>
<!-- 列表(全部) -->
<select id="listAll" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where f.ISDELETE = '0'
</select>
<!-- 批量删除 -->
<delete id="deleteAll" parameterType="String">
update
<include refid="tableName"></include>
set
ISDELETE = '1'
where
GATE_VIDEO_ID in
<foreach item="item" index="index" collection="ArrayDATA_IDS" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
<!-- 定位 -->
<update id="savePosition" parameterType="pd">
update
<include refid="tableName"></include>
set
LATITUDE = #{LATITUDE},
LONGITUDE = #{LONGITUDE}
where
GATE_VIDEO_ID = #{GATE_VIDEO_ID}
</update>
</mapper>