|
@@ -7,6 +7,8 @@ import com.huimv.manager.service.IImageService;
|
|
import com.huimv.manager.utils.DateUtil;
|
|
import com.huimv.manager.utils.DateUtil;
|
|
import com.huimv.manager.utils.ImageByteUtil;
|
|
import com.huimv.manager.utils.ImageByteUtil;
|
|
//import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer;
|
|
//import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer;
|
|
|
|
+import com.huimv.manager.utils.Result;
|
|
|
|
+import com.huimv.manager.utils.ResultCode;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.apache.commons.compress.archivers.ArchiveException;
|
|
import org.apache.commons.compress.archivers.ArchiveException;
|
|
import org.apache.commons.compress.archivers.ArchiveOutputStream;
|
|
import org.apache.commons.compress.archivers.ArchiveOutputStream;
|
|
@@ -109,6 +111,7 @@ public class ImageManagerController {
|
|
imageJo.put("imgPath", imageEntity.getImgPath());
|
|
imageJo.put("imgPath", imageEntity.getImgPath());
|
|
imageJo.put("name", imageEntity.getName());
|
|
imageJo.put("name", imageEntity.getName());
|
|
imageJo.put("relativePath", imageEntity.getRelativePath());
|
|
imageJo.put("relativePath", imageEntity.getRelativePath());
|
|
|
|
+ imageJo.put("pigQuantity", imageEntity.getPigQuantity());
|
|
imageJa.add(imageJo);
|
|
imageJa.add(imageJo);
|
|
}
|
|
}
|
|
// 读取记录数
|
|
// 读取记录数
|
|
@@ -129,8 +132,14 @@ public class ImageManagerController {
|
|
* @Time : 19:09
|
|
* @Time : 19:09
|
|
*/
|
|
*/
|
|
@RequestMapping(value = "/getPreviousImage", method = RequestMethod.GET)
|
|
@RequestMapping(value = "/getPreviousImage", method = RequestMethod.GET)
|
|
- public JSONObject getPreviousImage(@RequestParam(value = "imageId", required = true) int imageId) {
|
|
|
|
- return imageService.getOneImage("previous", imageId);
|
|
|
|
|
|
+ public Result getPreviousImage(@RequestParam(value = "imageId", required = true) int imageId) {
|
|
|
|
+ //
|
|
|
|
+ ImagePathEntity imagePathEntity = imageService.getOneImage("previous", imageId);
|
|
|
|
+ if(imagePathEntity == null){
|
|
|
|
+ return new Result(10001,"未查询到任何记录.",false);
|
|
|
|
+ }else{
|
|
|
|
+ return new Result(ResultCode.SUCCESS,(JSONObject)JSONObject.toJSON(imagePathEntity));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -143,9 +152,14 @@ public class ImageManagerController {
|
|
* @Time : 19:09
|
|
* @Time : 19:09
|
|
*/
|
|
*/
|
|
@RequestMapping(value = "/getNextImage", method = RequestMethod.GET)
|
|
@RequestMapping(value = "/getNextImage", method = RequestMethod.GET)
|
|
- public JSONObject getNextImage(@RequestParam(value = "imageId", required = true) int imageId) {
|
|
|
|
|
|
+ public Result getNextImage(@RequestParam(value = "imageId", required = true) int imageId) {
|
|
//
|
|
//
|
|
- return imageService.getOneImage("next", imageId);
|
|
|
|
|
|
+ ImagePathEntity imagePathEntity = imageService.getOneImage("next", imageId);
|
|
|
|
+ if(imagePathEntity == null){
|
|
|
|
+ return new Result(10001,"未查询到任何记录.",false);
|
|
|
|
+ }else{
|
|
|
|
+ return new Result(ResultCode.SUCCESS,(JSONObject)JSONObject.toJSON(imagePathEntity));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
@Deprecated
|
|
@Deprecated
|