|
@@ -2,7 +2,9 @@ package com.huimv.production.service.impl;
|
|
|
|
|
|
|
|
|
|
import com.huimv.production.domain.IndexProductionGroup2;
|
|
import com.huimv.production.domain.IndexProductionGroup2;
|
|
|
|
+import com.huimv.production.domain.IndexProductionGroupEntity;
|
|
import com.huimv.production.repo.IndexProductionGroup2Repository;
|
|
import com.huimv.production.repo.IndexProductionGroup2Repository;
|
|
|
|
+import com.huimv.production.repo.IndexProductionGroupRepository;
|
|
import com.huimv.production.result.Result;
|
|
import com.huimv.production.result.Result;
|
|
import com.huimv.production.result.ResultStatus;
|
|
import com.huimv.production.result.ResultStatus;
|
|
import com.huimv.production.service.IndexProductionGroup2Service;
|
|
import com.huimv.production.service.IndexProductionGroup2Service;
|
|
@@ -18,6 +20,8 @@ public class IndexProductionGroup2ServiceImpl implements IndexProductionGroup2Se
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private IndexProductionGroup2Repository rep;
|
|
private IndexProductionGroup2Repository rep;
|
|
|
|
+ @Autowired
|
|
|
|
+ private IndexProductionGroupRepository indexProductionGroupRepo;
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public Result add(IndexProductionGroup2 entity){
|
|
public Result add(IndexProductionGroup2 entity){
|
|
@@ -70,7 +74,7 @@ public class IndexProductionGroup2ServiceImpl implements IndexProductionGroup2Se
|
|
map.put("total",size);
|
|
map.put("total",size);
|
|
map.put("totalPageNum",(size + pageSize - 1) / pageSize);
|
|
map.put("totalPageNum",(size + pageSize - 1) / pageSize);
|
|
map.put("data",all);
|
|
map.put("data",all);
|
|
-
|
|
|
|
|
|
+
|
|
return new Result(10000,ResultStatus.findSuccess,map);
|
|
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);
|
|
@@ -86,4 +90,20 @@ public class IndexProductionGroup2ServiceImpl implements IndexProductionGroup2Se
|
|
return new Result(10001,ResultStatus.findFailed,null);
|
|
return new Result(10001,ResultStatus.findFailed,null);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public Result findAllFrom(String name , Integer pageNum , Integer pageSize) {
|
|
|
|
+ try {
|
|
|
|
+ Map map = new HashMap();
|
|
|
|
+ int size = indexProductionGroupRepo.findAll().size() ;
|
|
|
|
+ Integer startPage = (pageNum-1) * pageSize;
|
|
|
|
+ List<IndexProductionGroupEntity> all = indexProductionGroupRepo.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){
|
|
|
|
+ return new Result(10001,ResultStatus.findFailed,null);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|