Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/main/java/com/hisense/monitormanage/utils/EhcacheUtil.java
This commit is contained in:
yitonglei 2022-05-16 09:15:38 +08:00
commit 8d052e3918
6 changed files with 57 additions and 29 deletions

View File

@ -109,6 +109,13 @@ public class Controller {
return "startScenic finish";
}
@RequestMapping("capture1")
public Object capture1(){
monitorService.start1();
return "finish capture";
}
/**
* 查询所有摄像头
@ -190,6 +197,28 @@ public class Controller {
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

View File

@ -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}) ")
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);
}

View File

@ -71,10 +71,7 @@ public class MonitorService {
private String fileDir;
@Value("${hwx.file.pic-host}")
private String picHost;
@Value("${wwd.file.work-path}")
private String fileDir1;
@Value("${wwd.file.pic-host}")
private String picHost1;
@Value("iOgQotfgfyLvhj6WgfDTpq7F")
private String key;
@ -224,17 +221,18 @@ public class MonitorService {
try {
BufferedImage bufferedImage = capturecreenshot(channelCode);
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();
picture.setChannelCode(channelCode);
picture.setPicUrl(picUrl);
picture.setInsertTime(new Date());
/*channelPictureMapper.insert(picture);*/
/*picture.setInsertTime(new Date());
channelPictureMapper.insert(picture);*/
QueryWrapper<ChannelPicture> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("channel_code",channelCode);
picture.setInsertTime(new Date());
channelPictureMapper.update(picture,queryWrapper);
}catch (Exception e){
@ -261,17 +259,18 @@ public class MonitorService {
try {
BufferedImage bufferedImage = capturecreenshot(channelCode);
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();
picture.setChannelCode(channelCode);
picture.setPicUrl(picUrl);
picture.setInsertTime(new Date());
/*channelPictureMapper.insert(picture);*/
/*picture.setInsertTime(new Date());
channelPictureMapper.insert(picture);*/
QueryWrapper<ChannelPicture> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("channel_code",channelCode);
picture.setInsertTime(new Date());
channelPictureMapper.update(picture,queryWrapper);
}catch (Exception e){

View File

@ -4,9 +4,6 @@ import net.sf.ehcache.CacheManager;
import java.net.URL;
import net.sf.ehcache.Cache;
import net.sf.ehcache.Element;
import org.springframework.beans.factory.annotation.Autowired;
import javax.xml.ws.Action;
/**
* @author admin
@ -26,16 +23,16 @@ public class EhcacheUtil {
}
public static EhcacheUtil getInstance() {
if (ehCache== null) {
ehCache= new EhcacheUtil(path);
}
return ehCache;
if (ehCache== null) {
ehCache= new EhcacheUtil(path);
}
return ehCache;
}
public void put(String cacheName, String key, Object value) {
Cache cache = manager.getCache(cacheName);
Element element = new Element(key, value);
cache.put(element);
Cache cache = manager.getCache(cacheName);
Element element = new Element(key, value);
cache.put(element);
}
public Object get(String cacheName, String key) {
@ -45,8 +42,8 @@ public class EhcacheUtil {
}
public Cache get(String cacheName) {
return manager.getCache(cacheName);
}
return manager.getCache(cacheName);
}
public void remove(String cacheName, String key) {
Cache cache = manager.getCache(cacheName);

View File

@ -17,10 +17,8 @@ spring.datasource.username=root
spring.datasource.password=w@CmM1mBVQkPhdrc
#spring.datasource.password=123456
hwx.file.work-path=/Users/huangweixiong/Downloads/
wwd.file.work-path=C:/Users/szkingdom/.m2
hwx.file.work-path=D:/tupian/
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}
mybatis-plus.mapper-locations=classpath*:/mapper/*.xml

View File

@ -12,7 +12,7 @@
<select id="selectAll" resultType="com.hisense.monitormanage.dto.CameraChannelDto">
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'))
AND c.status != 0
AND c.status != 0 AND c.check_status != 0
<!-- <bind name="page" value="(page-1)*pageSize"/>-->
<!-- limit #{page},#{pageSize}-->
</select>