|
@@ -11,6 +11,7 @@ import com.ozs.service.entity.MsgAlarm;
|
|
|
import com.ozs.service.service.BaseCameraManagementService;
|
|
|
import com.ozs.service.service.BaseRailwayManagementService;
|
|
|
import com.ozs.service.service.MsgAlarmService;
|
|
|
+import com.ozs.web.core.util.FileMd5;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.util.ObjectUtils;
|
|
@@ -23,7 +24,9 @@ import org.springframework.web.multipart.MultipartFile;
|
|
|
import javax.annotation.Resource;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.Date;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
@RestController
|
|
|
@RequestMapping("/system/upLoad")
|
|
@@ -59,7 +62,7 @@ public class UploadController {
|
|
|
BaseCameraManagement baseCameraManagement = baseCameraManagementService.getOne(lw);
|
|
|
LambdaQueryWrapper<BaseRailwayManagement> wrapper = new LambdaQueryWrapper<BaseRailwayManagement>();
|
|
|
if (!ObjectUtils.isEmpty(baseCameraManagement.getCameraCode())) {
|
|
|
- wrapper.eq(BaseRailwayManagement::getRailwayCode,baseCameraManagement.getCameraCode());
|
|
|
+ wrapper.eq(BaseRailwayManagement::getRailwayCode, baseCameraManagement.getCameraCode());
|
|
|
}
|
|
|
BaseRailwayManagement baseRailwayManagement = baseRailwayManagementService.getOne(wrapper);
|
|
|
String date = new SimpleDateFormat("yyyyMMddHHmmss").format(new Date());
|
|
@@ -79,6 +82,7 @@ public class UploadController {
|
|
|
|
|
|
/**
|
|
|
* 相机版本文件上传
|
|
|
+ *
|
|
|
* @param image
|
|
|
* @return
|
|
|
* @throws Exception
|
|
@@ -90,6 +94,7 @@ public class UploadController {
|
|
|
}
|
|
|
//图片保存路径
|
|
|
String uploadFile = null;
|
|
|
+ String fileMd5Str = FileMd5.getMD5(image);
|
|
|
if (image != null || !image.isEmpty()) {
|
|
|
String imageName = image.getOriginalFilename();
|
|
|
if (StringUtils.isNotBlank(imageName)) {
|
|
@@ -104,6 +109,9 @@ public class UploadController {
|
|
|
} else {
|
|
|
return AjaxResult.error("上传功能出错");
|
|
|
}
|
|
|
- return AjaxResult.success(uploadFile);
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ map.put("url", uploadFile);
|
|
|
+ map.put("md5", fileMd5Str);
|
|
|
+ return AjaxResult.success(map);
|
|
|
}
|
|
|
}
|