|
@@ -24,14 +24,13 @@ public class ImageServiceImpl implements IImageService {
|
|
private ImagePathRepo imagePathRepo;
|
|
private ImagePathRepo imagePathRepo;
|
|
|
|
|
|
/**
|
|
/**
|
|
- * @Method : getLastImage
|
|
|
|
|
|
+ * @Method : getLastImage
|
|
* @Description : 读取最后一幅图像
|
|
* @Description : 读取最后一幅图像
|
|
- * @Params : []
|
|
|
|
- * @Return : java.lang.String
|
|
|
|
- *
|
|
|
|
- * @Author : ZhuoNing
|
|
|
|
- * @Date : 2021/1/21
|
|
|
|
- * @Time : 20:49
|
|
|
|
|
|
+ * @Params : []
|
|
|
|
+ * @Return : java.lang.String
|
|
|
|
+ * @Author : ZhuoNing
|
|
|
|
+ * @Date : 2021/1/21
|
|
|
|
+ * @Time : 20:49
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
public ImagePathEntity getLastImage() {
|
|
public ImagePathEntity getLastImage() {
|
|
@@ -41,76 +40,78 @@ public class ImageServiceImpl implements IImageService {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * @Method : getNextImage
|
|
|
|
|
|
+ * @Method : getNextImage
|
|
* @Description : 读取下一副图像
|
|
* @Description : 读取下一副图像
|
|
- * @Params : []
|
|
|
|
- * @Return : java.lang.String
|
|
|
|
- *
|
|
|
|
- * @Author : ZhuoNing
|
|
|
|
- * @Date : 2021/1/21
|
|
|
|
- * @Time : 20:49
|
|
|
|
|
|
+ * @Params : []
|
|
|
|
+ * @Return : java.lang.String
|
|
|
|
+ * @Author : ZhuoNing
|
|
|
|
+ * @Date : 2021/1/21
|
|
|
|
+ * @Time : 20:49
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
public ImagePathEntity getNextImage() {
|
|
public ImagePathEntity getNextImage() {
|
|
// 读取下一副图像
|
|
// 读取下一副图像
|
|
ImagePathEntity imagePathEntity = imagePathRepo.getNextImage();
|
|
ImagePathEntity imagePathEntity = imagePathRepo.getNextImage();
|
|
- if(imagePathEntity!=null){
|
|
|
|
|
|
+ if (imagePathEntity != null) {
|
|
// 更改记录
|
|
// 更改记录
|
|
imagePathEntity.setEffective(0);
|
|
imagePathEntity.setEffective(0);
|
|
imagePathRepo.saveAndFlush(imagePathEntity);
|
|
imagePathRepo.saveAndFlush(imagePathEntity);
|
|
return imagePathEntity;
|
|
return imagePathEntity;
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
return imagePathRepo.getLastImage();
|
|
return imagePathRepo.getLastImage();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * @Method : getImageList
|
|
|
|
- * @Description :
|
|
|
|
- * @Params : [startDate, endDate, pageNo, pageSize]
|
|
|
|
- * @Return : java.util.List<com.huimv.manager.dao.entity.ImagePathEntity>
|
|
|
|
- *
|
|
|
|
- * @Author : ZhuoNing
|
|
|
|
- * @Date : 2021/1/22
|
|
|
|
- * @Time : 16:50
|
|
|
|
|
|
+ * @Method : getImageList
|
|
|
|
+ * @Description :
|
|
|
|
+ * @Params : [startDate, endDate, pageNo, pageSize]
|
|
|
|
+ * @Return : java.util.List<com.huimv.manager.dao.entity.ImagePathEntity>
|
|
|
|
+ * @Author : ZhuoNing
|
|
|
|
+ * @Date : 2021/1/22
|
|
|
|
+ * @Time : 16:50
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- public List<ImagePathEntity> getImageList(String startDate, String endDate,int pageNo,int pageSize) {
|
|
|
|
- System.out.println("pageNo>>"+pageNo);
|
|
|
|
- System.out.println("pageSize>>"+pageSize);
|
|
|
|
- int start = (pageNo-1)*pageSize;
|
|
|
|
- System.out.println("start>>"+start);
|
|
|
|
- // 按照日期区间,读取图片列表
|
|
|
|
- return imagePathRepo.listImage(startDate,endDate,start,pageSize);
|
|
|
|
|
|
+ public List<ImagePathEntity> getImageList(String startDate, String endDate, int pageNo, int pageSize, String catalog) {
|
|
|
|
+ System.out.println("pageNo>>" + pageNo);
|
|
|
|
+ System.out.println("pageSize>>" + pageSize);
|
|
|
|
+ int start = (pageNo - 1) * pageSize;
|
|
|
|
+ System.out.println("start>>" + start);
|
|
|
|
+ if (catalog != null && !catalog.isEmpty()) {
|
|
|
|
+ // 按照日期区间,读取图片列表
|
|
|
|
+ return imagePathRepo.listImage(startDate, endDate, start, pageSize,catalog);
|
|
|
|
+ } else {
|
|
|
|
+ // 按照日期区间,读取图片列表
|
|
|
|
+ return imagePathRepo.listImage(startDate, endDate, start, pageSize);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * @Method : getTotal
|
|
|
|
- * @Description :
|
|
|
|
- * @Params : [startDate, endDate]
|
|
|
|
- * @Return : int
|
|
|
|
- *
|
|
|
|
- * @Author : ZhuoNing
|
|
|
|
- * @Date : 2021/1/22
|
|
|
|
- * @Time : 16:50
|
|
|
|
|
|
+ * @Method : getTotal
|
|
|
|
+ * @Description :
|
|
|
|
+ * @Params : [startDate, endDate]
|
|
|
|
+ * @Return : int
|
|
|
|
+ * @Author : ZhuoNing
|
|
|
|
+ * @Date : 2021/1/22
|
|
|
|
+ * @Time : 16:50
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
public int getTotal(String startDate, String endDate) {
|
|
public int getTotal(String startDate, String endDate) {
|
|
// 根据条件读取总记录数
|
|
// 根据条件读取总记录数
|
|
- return imagePathRepo.getTotal(startDate,endDate);
|
|
|
|
|
|
+ return imagePathRepo.getTotal(startDate, endDate);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public List<ImagePathEntity> getExportImageList(String startDate, String endDate, String imageIds) {
|
|
public List<ImagePathEntity> getExportImageList(String startDate, String endDate, String imageIds) {
|
|
// 以指定图片导出优先条件
|
|
// 以指定图片导出优先条件
|
|
- if(imageIds == null || imageIds.trim().isEmpty()){
|
|
|
|
|
|
+ if (imageIds == null || imageIds.trim().isEmpty()) {
|
|
// 用startDate,endDate读取需要导出的图片
|
|
// 用startDate,endDate读取需要导出的图片
|
|
- return imagePathRepo.getExportImageListByStartAndEndDate(startDate,endDate);
|
|
|
|
- }else{
|
|
|
|
|
|
+ return imagePathRepo.getExportImageListByStartAndEndDate(startDate, endDate);
|
|
|
|
+ } else {
|
|
// 指定需要导出的图片
|
|
// 指定需要导出的图片
|
|
String[] idArray = imageIds.split(",");
|
|
String[] idArray = imageIds.split(",");
|
|
List imageIdList = new ArrayList();
|
|
List imageIdList = new ArrayList();
|
|
- for(String id:idArray){
|
|
|
|
|
|
+ for (String id : idArray) {
|
|
imageIdList.add(id);
|
|
imageIdList.add(id);
|
|
}
|
|
}
|
|
// 读取导出图片
|
|
// 读取导出图片
|
|
@@ -120,12 +121,12 @@ public class ImageServiceImpl implements IImageService {
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public ImagePathEntity getOneImage(String type, int imageId) {
|
|
public ImagePathEntity getOneImage(String type, int imageId) {
|
|
- if(type.trim().equalsIgnoreCase("next")){
|
|
|
|
|
|
+ if (type.trim().equalsIgnoreCase("next")) {
|
|
// 读取下一张照片
|
|
// 读取下一张照片
|
|
- return imagePathRepo.getNextImageById(imageId);
|
|
|
|
- }else{
|
|
|
|
|
|
+ return imagePathRepo.getNextImageById(imageId);
|
|
|
|
+ } else {
|
|
// 读取上一张照片
|
|
// 读取上一张照片
|
|
- return imagePathRepo.getPreviousImageById(imageId);
|
|
|
|
|
|
+ return imagePathRepo.getPreviousImageById(imageId);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|