修改业务逻辑及tplink问价夹
This commit is contained in:
parent
6f04849ad4
commit
7fadd08bbe
|
|
@ -28,6 +28,8 @@ import org.springframework.context.annotation.Lazy;
|
|||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.io.File;
|
||||
import java.math.BigDecimal;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
|
|
@ -2888,13 +2890,14 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
|||
String fileName = nuId +"-"+DateUtils.formatDate(new Date(),"yyyyMMddHHmmss");
|
||||
String year = DateUtils.formatDate(new Date(),"yyyy");
|
||||
String month = DateUtils.formatDate(new Date(),"MM");
|
||||
String day = DateUtils.formatDate(new Date(),"dd");
|
||||
CameraInfo tplinkInfo = tplinkList.get(0);
|
||||
CameraInfo cameraInfo = new CameraInfo();
|
||||
cameraInfo.setDeviceIndex(tplinkInfo.getDeviceIndex());
|
||||
cameraInfo.setParentId(tplinkInfo.getParentId());
|
||||
cameraInfo.setFileName(fileName);
|
||||
cameraInfo.setVideoType("1");
|
||||
cameraInfo.setFtpUploadpath("/upload/"+year+"/"+month+"/fwxm/tplinkVideo");
|
||||
cameraInfo.setFtpUploadpath("/upload/"+year+month+day+"/fwxm/tplinkVideo");
|
||||
cameraInfo.setStartTime(startTime);
|
||||
cameraInfo.setEndTime(endTime);
|
||||
try {
|
||||
|
|
@ -2936,6 +2939,8 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
|||
if(StringUtils.isNotBlank(cameraInfo.getFtpUploadpath())){
|
||||
ftpUploadpath = cameraInfo.getFtpUploadpath();
|
||||
}
|
||||
//判断文件夹是否存在
|
||||
mkdirsFolder(ftpUploadpath);
|
||||
String deviceIndex = cameraInfo.getDeviceIndex();
|
||||
String parentId = cameraInfo.getParentId();
|
||||
String fileName = cameraInfo.getFileName();
|
||||
|
|
@ -2959,10 +2964,10 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
|||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
Date date = sdf.parse(cameraInfo.getStartTime());
|
||||
Date date2 = sdf.parse(cameraInfo.getEndTime());
|
||||
// long startTime = date.getTime();
|
||||
// long endTime = date2.getTime();
|
||||
long startTime = 1765993096;
|
||||
long endTime = 1765993156;
|
||||
long startTime = date.getTime();
|
||||
long endTime = date2.getTime();
|
||||
// long startTime = 1765993096;
|
||||
// long endTime = 1765993156;
|
||||
sb.append("\"startTime\"").append(":").append(startTime).append(",");
|
||||
sb.append("\"endTime\"").append(":").append(endTime).append(",");
|
||||
sb.append("\"downloadInfo\"").append(":{");
|
||||
|
|
@ -3007,4 +3012,35 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
|||
List<CameraInfoEntity> listDto =BeanUtil.copyToList(list, CameraInfoEntity.class);
|
||||
return listDto;
|
||||
}
|
||||
|
||||
public String mkdirsFolder(String folderPath){
|
||||
// 创建File对象
|
||||
File folder = new File(folderPath);
|
||||
|
||||
// 判断文件夹是否存在
|
||||
if (!folder.exists()) {
|
||||
System.out.println("文件夹不存在,开始创建...");
|
||||
|
||||
// 创建文件夹(包括所有不存在的父文件夹)
|
||||
boolean created = folder.mkdirs();
|
||||
|
||||
if (created) {
|
||||
System.out.println("文件夹创建成功:" + folderPath);
|
||||
} else {
|
||||
System.out.println("文件夹创建失败:" + folderPath);
|
||||
}
|
||||
} else {
|
||||
System.out.println("文件夹已存在:" + folderPath);
|
||||
|
||||
// 还可以判断是否是文件夹而不是文件
|
||||
if (folder.isDirectory()) {
|
||||
System.out.println("这是一个文件夹");
|
||||
} else {
|
||||
System.out.println("这不是一个文件夹,而是文件");
|
||||
}
|
||||
}
|
||||
return "success";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ public class CarePadServiceImpl extends ServiceImpl<CareOrdersMapper, CareOrders
|
|||
careOrdersSub.setBeginTime(new Date());
|
||||
careOrdersSubMapper.updateById(careOrdersSub);
|
||||
|
||||
if(!StringUtils.equals("Y",careOrdersSub.getIzStart())){
|
||||
if(!StringUtils.equals("Y",careOrders.getIzStart())){
|
||||
careOrders.setIzStart("Y");
|
||||
careOrders.setBeginTime(new Date());
|
||||
baseMapper.updateById(careOrders);
|
||||
|
|
|
|||
Loading…
Reference in New Issue