Merge remote-tracking branch 'origin/master'
# Conflicts: # src/main/java/com/hisense/monitormanage/utils/EhcacheUtil.java
This commit is contained in:
commit
8d052e3918
|
@ -109,6 +109,13 @@ public class Controller {
|
||||||
return "startScenic finish";
|
return "startScenic finish";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequestMapping("capture1")
|
||||||
|
public Object capture1(){
|
||||||
|
monitorService.start1();
|
||||||
|
|
||||||
|
return "finish capture";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询所有摄像头
|
* 查询所有摄像头
|
||||||
|
@ -190,6 +197,28 @@ public class Controller {
|
||||||
return Result.success(channelLabelDtos);
|
return Result.success(channelLabelDtos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据两个点查询范围内的摄像头
|
||||||
|
* @param gpsX
|
||||||
|
* @param gpsX1
|
||||||
|
* @param gpsY
|
||||||
|
* @param gpsY1
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping("selectAllByGps")
|
||||||
|
public Result selectAllByGps(String gpsX,String gpsX1,String gpsY,String gpsY1){
|
||||||
|
|
||||||
|
List<CameraChannelDto> gps = cameraChannelMapper.selectAllByGps(gpsX, gpsX1, gpsY, gpsY1);
|
||||||
|
double gpsx = Double.parseDouble(gpsX);
|
||||||
|
double gpsx1 = Double.parseDouble(gpsX1);
|
||||||
|
double gpsy = Double.parseDouble(gpsY);
|
||||||
|
double gpsy1 = Double.parseDouble(gpsY1);
|
||||||
|
if (gpsx < gpsx1 || gpsy < gpsy1){
|
||||||
|
return Result.success(gps);
|
||||||
|
}
|
||||||
|
return Result.error("请输入正确的精度范围");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询所有标签
|
* 查询所有标签
|
||||||
* @param label
|
* @param label
|
||||||
|
|
|
@ -43,6 +43,11 @@ public interface CameraChannelMapper extends BaseMapper<CameraChannel> {
|
||||||
"ON a.label_code = b.label_code AND b.channel_code = c.channel_code where c.`status`!= 0) m where m.label_code in (#{labelCode},#{labelCode1}) ")
|
"ON a.label_code = b.label_code AND b.channel_code = c.channel_code where c.`status`!= 0) m where m.label_code in (#{labelCode},#{labelCode1}) ")
|
||||||
List<ChannelLabelDto> selectLabelAndChannel(@Param("labelCode") String labelCode,@Param("labelCode1") String labelCode1);
|
List<ChannelLabelDto> selectLabelAndChannel(@Param("labelCode") String labelCode,@Param("labelCode1") String labelCode1);
|
||||||
|
|
||||||
|
@Select("select cc.channel_code,cc.gps_x,cc.gps_y from t_camera_channel cc " +
|
||||||
|
"where (gps_x between #{gpsX} and #{gpsX1}) and (gps_y between #{gpsY} and #{gpsY1} )")
|
||||||
|
List<CameraChannelDto> selectAllByGps(@Param("gpsX") String gpsX,
|
||||||
|
@Param("gpsX1") String gpsX1,
|
||||||
|
@Param("gpsY") String gpsY,
|
||||||
|
@Param("gpsY1") String gpsY1);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,10 +71,7 @@ public class MonitorService {
|
||||||
private String fileDir;
|
private String fileDir;
|
||||||
@Value("${hwx.file.pic-host}")
|
@Value("${hwx.file.pic-host}")
|
||||||
private String picHost;
|
private String picHost;
|
||||||
@Value("${wwd.file.work-path}")
|
|
||||||
private String fileDir1;
|
|
||||||
@Value("${wwd.file.pic-host}")
|
|
||||||
private String picHost1;
|
|
||||||
@Value("iOgQotfgfyLvhj6WgfDTpq7F")
|
@Value("iOgQotfgfyLvhj6WgfDTpq7F")
|
||||||
private String key;
|
private String key;
|
||||||
|
|
||||||
|
@ -224,17 +221,18 @@ public class MonitorService {
|
||||||
try {
|
try {
|
||||||
BufferedImage bufferedImage = capturecreenshot(channelCode);
|
BufferedImage bufferedImage = capturecreenshot(channelCode);
|
||||||
String fileName = channelCode + ".jpg";
|
String fileName = channelCode + ".jpg";
|
||||||
ImageIO.write(bufferedImage, "jpg", new File(fileDir1 + "/images/" + fileName));
|
ImageIO.write(bufferedImage, "jpg", new File(fileDir + "/images/" + fileName));
|
||||||
|
|
||||||
String picUrl = picHost1 + "/images/" + fileName;
|
String picUrl = picHost + "/images/" + fileName;
|
||||||
|
|
||||||
ChannelPicture picture = new ChannelPicture();
|
ChannelPicture picture = new ChannelPicture();
|
||||||
picture.setChannelCode(channelCode);
|
picture.setChannelCode(channelCode);
|
||||||
picture.setPicUrl(picUrl);
|
picture.setPicUrl(picUrl);
|
||||||
picture.setInsertTime(new Date());
|
/*picture.setInsertTime(new Date());
|
||||||
/*channelPictureMapper.insert(picture);*/
|
channelPictureMapper.insert(picture);*/
|
||||||
QueryWrapper<ChannelPicture> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<ChannelPicture> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.eq("channel_code",channelCode);
|
queryWrapper.eq("channel_code",channelCode);
|
||||||
|
picture.setInsertTime(new Date());
|
||||||
channelPictureMapper.update(picture,queryWrapper);
|
channelPictureMapper.update(picture,queryWrapper);
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
|
|
||||||
|
@ -261,17 +259,18 @@ public class MonitorService {
|
||||||
try {
|
try {
|
||||||
BufferedImage bufferedImage = capturecreenshot(channelCode);
|
BufferedImage bufferedImage = capturecreenshot(channelCode);
|
||||||
String fileName = channelCode + ".jpg";
|
String fileName = channelCode + ".jpg";
|
||||||
ImageIO.write(bufferedImage, "jpg", new File(fileDir1 + "/images/" + fileName));
|
ImageIO.write(bufferedImage, "jpg", new File(fileDir + "/images/" + fileName));
|
||||||
|
|
||||||
String picUrl = picHost1 + "/images/" + fileName;
|
String picUrl = picHost + "/images/" + fileName;
|
||||||
|
|
||||||
ChannelPicture picture = new ChannelPicture();
|
ChannelPicture picture = new ChannelPicture();
|
||||||
picture.setChannelCode(channelCode);
|
picture.setChannelCode(channelCode);
|
||||||
picture.setPicUrl(picUrl);
|
picture.setPicUrl(picUrl);
|
||||||
picture.setInsertTime(new Date());
|
/*picture.setInsertTime(new Date());
|
||||||
/*channelPictureMapper.insert(picture);*/
|
channelPictureMapper.insert(picture);*/
|
||||||
QueryWrapper<ChannelPicture> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<ChannelPicture> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.eq("channel_code",channelCode);
|
queryWrapper.eq("channel_code",channelCode);
|
||||||
|
picture.setInsertTime(new Date());
|
||||||
channelPictureMapper.update(picture,queryWrapper);
|
channelPictureMapper.update(picture,queryWrapper);
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
|
|
||||||
|
|
|
@ -4,9 +4,6 @@ import net.sf.ehcache.CacheManager;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import net.sf.ehcache.Cache;
|
import net.sf.ehcache.Cache;
|
||||||
import net.sf.ehcache.Element;
|
import net.sf.ehcache.Element;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
|
|
||||||
import javax.xml.ws.Action;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author admin
|
* @author admin
|
||||||
|
@ -26,16 +23,16 @@ public class EhcacheUtil {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static EhcacheUtil getInstance() {
|
public static EhcacheUtil getInstance() {
|
||||||
if (ehCache== null) {
|
if (ehCache== null) {
|
||||||
ehCache= new EhcacheUtil(path);
|
ehCache= new EhcacheUtil(path);
|
||||||
}
|
}
|
||||||
return ehCache;
|
return ehCache;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void put(String cacheName, String key, Object value) {
|
public void put(String cacheName, String key, Object value) {
|
||||||
Cache cache = manager.getCache(cacheName);
|
Cache cache = manager.getCache(cacheName);
|
||||||
Element element = new Element(key, value);
|
Element element = new Element(key, value);
|
||||||
cache.put(element);
|
cache.put(element);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object get(String cacheName, String key) {
|
public Object get(String cacheName, String key) {
|
||||||
|
@ -45,8 +42,8 @@ public class EhcacheUtil {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Cache get(String cacheName) {
|
public Cache get(String cacheName) {
|
||||||
return manager.getCache(cacheName);
|
return manager.getCache(cacheName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void remove(String cacheName, String key) {
|
public void remove(String cacheName, String key) {
|
||||||
Cache cache = manager.getCache(cacheName);
|
Cache cache = manager.getCache(cacheName);
|
||||||
|
|
|
@ -17,10 +17,8 @@ spring.datasource.username=root
|
||||||
spring.datasource.password=w@CmM1mBVQkPhdrc
|
spring.datasource.password=w@CmM1mBVQkPhdrc
|
||||||
#spring.datasource.password=123456
|
#spring.datasource.password=123456
|
||||||
|
|
||||||
hwx.file.work-path=/Users/huangweixiong/Downloads/
|
hwx.file.work-path=D:/tupian/
|
||||||
wwd.file.work-path=C:/Users/szkingdom/.m2
|
|
||||||
hwx.file.pic-host=http://127.0.0.1:7009
|
hwx.file.pic-host=http://127.0.0.1:7009
|
||||||
wwd.file.pic-host=http://15.72.183.90:7009
|
|
||||||
spring.resources.static-locations=classpath:/static,classpath:/public,file:${hwx.file.work-path}
|
spring.resources.static-locations=classpath:/static,classpath:/public,file:${hwx.file.work-path}
|
||||||
mybatis-plus.mapper-locations=classpath*:/mapper/*.xml
|
mybatis-plus.mapper-locations=classpath*:/mapper/*.xml
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
<select id="selectAll" resultType="com.hisense.monitormanage.dto.CameraChannelDto">
|
<select id="selectAll" resultType="com.hisense.monitormanage.dto.CameraChannelDto">
|
||||||
select c.* from t_camera_channel c
|
select c.* from t_camera_channel c
|
||||||
where (c.gps_x NOT IN('0.0','0','','-1000.0') OR c.gps_y NOT IN('0.0','0','','-1000.0'))
|
where (c.gps_x NOT IN('0.0','0','','-1000.0') OR c.gps_y NOT IN('0.0','0','','-1000.0'))
|
||||||
AND c.status != 0
|
AND c.status != 0 AND c.check_status != 0
|
||||||
<!-- <bind name="page" value="(page-1)*pageSize"/>-->
|
<!-- <bind name="page" value="(page-1)*pageSize"/>-->
|
||||||
<!-- limit #{page},#{pageSize}-->
|
<!-- limit #{page},#{pageSize}-->
|
||||||
</select>
|
</select>
|
||||||
|
|
Loading…
Reference in New Issue