|
@@ -1,10 +1,7 @@
|
|
package com.huimv.production.service.impl;
|
|
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;
|
|
@@ -20,8 +17,6 @@ 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){
|
|
@@ -65,20 +60,10 @@ public class IndexProductionGroup2ServiceImpl implements IndexProductionGroup2Se
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public Result findAll(String name , Integer pageNum , Integer pageSize) {
|
|
|
|
- try {
|
|
|
|
- Map map = new HashMap();
|
|
|
|
- int size = rep.findAll().size() ;
|
|
|
|
- Integer startPage = (pageNum-1) * pageSize;
|
|
|
|
- List<IndexProductionGroup2> all = rep.findAll(name,startPage,pageSize);
|
|
|
|
- map.put("total",size);
|
|
|
|
- map.put("totalPageNum",(size + pageSize - 1) / pageSize);
|
|
|
|
- map.put("data",all);
|
|
|
|
|
|
+ public Result findAll() {
|
|
|
|
+
|
|
|
|
+ return new Result(10000,ResultStatus.findSuccess,rep.findAll());
|
|
|
|
|
|
- return new Result(10000,ResultStatus.findSuccess,map);
|
|
|
|
- }catch (Exception e){
|
|
|
|
- return new Result(10001,ResultStatus.findFailed,null);
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -90,20 +75,4 @@ 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);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
}
|
|
}
|