|
@@ -1,5 +1,6 @@
|
|
package com.huimv.production.service.impl;
|
|
package com.huimv.production.service.impl;
|
|
|
|
|
|
|
|
+import com.huimv.production.domain.MAnimalHeatWarningEntity;
|
|
import com.huimv.production.domain.YvfeiCount;
|
|
import com.huimv.production.domain.YvfeiCount;
|
|
import com.huimv.production.repo.YvfeiCountRepository;
|
|
import com.huimv.production.repo.YvfeiCountRepository;
|
|
import com.huimv.production.result.Result;
|
|
import com.huimv.production.result.Result;
|
|
@@ -8,7 +9,9 @@ import com.huimv.production.service.YvfeiCountService;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
+import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
|
|
|
|
@Service
|
|
@Service
|
|
public class YvfeiCountServiceImpl implements YvfeiCountService {
|
|
public class YvfeiCountServiceImpl implements YvfeiCountService {
|
|
@@ -58,15 +61,21 @@ public class YvfeiCountServiceImpl implements YvfeiCountService {
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public Result findAll() {
|
|
|
|
|
|
+ public Result findAll(String name ,Integer pageNum , Integer pageSize) {
|
|
try {
|
|
try {
|
|
- List<YvfeiCount> all = rep.findAll();
|
|
|
|
- return new Result(10000, ResultStatus.findSuccess,all);
|
|
|
|
|
|
+ Map map = new HashMap();
|
|
|
|
+ int size = rep.findAll().size() ;
|
|
|
|
+ Integer startPage = (pageNum-1) * pageSize;
|
|
|
|
+ List<YvfeiCount> all = rep.findAll(name,startPage,pageSize);
|
|
|
|
+ map.put("total",size);
|
|
|
|
+ map.put("totalPageNum",(size + pageSize - 1) / pageSize);
|
|
|
|
+ map.put("data",all);
|
|
|
|
+
|
|
|
|
+ return new Result(10000, ResultStatus.findSuccess,map);
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
- return new Result(10001, ResultStatus.findFailed,null);
|
|
|
|
|
|
+ return new Result(10001,ResultStatus.findFailed,null);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
@Override
|
|
@Override
|
|
public Result findAllById(Integer id) {
|
|
public Result findAllById(Integer id) {
|
|
try {
|
|
try {
|