|
@@ -1,13 +1,16 @@
|
|
|
package com.huimv.production.service.impl;
|
|
|
|
|
|
import com.huimv.production.domain.IndexProductionGroup2;
|
|
|
+import com.huimv.production.domain.IndexProductionGroupEntity;
|
|
|
import com.huimv.production.repo.IndexProductionGroup2Repository;
|
|
|
+import com.huimv.production.repo.IndexProductionGroupEntityRepository;
|
|
|
import com.huimv.production.result.Result;
|
|
|
import com.huimv.production.result.ResultStatus;
|
|
|
import com.huimv.production.service.IndexProductionGroup2Service;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
@@ -18,6 +21,9 @@ public class IndexProductionGroup2ServiceImpl implements IndexProductionGroup2Se
|
|
|
@Autowired
|
|
|
private IndexProductionGroup2Repository rep;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IndexProductionGroupEntityRepository indexProductionGroupRepo;
|
|
|
+
|
|
|
@Override
|
|
|
public Result add(IndexProductionGroup2 entity){
|
|
|
if (entity == null){
|
|
@@ -61,9 +67,7 @@ public class IndexProductionGroup2ServiceImpl implements IndexProductionGroup2Se
|
|
|
|
|
|
@Override
|
|
|
public Result findAll() {
|
|
|
-
|
|
|
- return new Result(10000,ResultStatus.findSuccess,rep.findAll());
|
|
|
-
|
|
|
+ return new Result(10000,ResultStatus.findSuccess,rep.findAll());
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -75,4 +79,33 @@ public class IndexProductionGroup2ServiceImpl implements IndexProductionGroup2Se
|
|
|
return new Result(10001,ResultStatus.findFailed,null);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Result findAllFrom() {
|
|
|
+ List<IndexProductionGroupEntity> delivery = indexProductionGroupRepo.findAllByVariety("巴嘉");
|
|
|
+ List<IndexProductionGroupEntity> reservice = indexProductionGroupRepo.findAllByVariety("杜巴嘉");
|
|
|
+ List<IndexProductionGroupEntity> breeding = indexProductionGroupRepo.findAllByVariety("金华两头乌");
|
|
|
+ Map map1 = new HashMap();
|
|
|
+ Map map2 = new HashMap();
|
|
|
+ Map map3 = new HashMap();
|
|
|
+ map1.put("veriety","巴嘉");
|
|
|
+ map2.put("veriety","杜巴嘉");
|
|
|
+ map3.put("veriety","金华两头乌");
|
|
|
+ for (IndexProductionGroupEntity productionGroup : delivery) {
|
|
|
+ map1.put(productionGroup.getProductionType(),productionGroup.getFrequency());
|
|
|
+ }
|
|
|
+ for (IndexProductionGroupEntity productionGroup : reservice) {
|
|
|
+ map2.put(productionGroup.getProductionType(),productionGroup.getFrequency());
|
|
|
+ }
|
|
|
+ for (IndexProductionGroupEntity productionGroup : breeding) {
|
|
|
+ map3.put(productionGroup.getProductionType(),productionGroup.getFrequency());
|
|
|
+ }
|
|
|
+
|
|
|
+ List list = new ArrayList();
|
|
|
+ list.add(map1);
|
|
|
+ list.add(map2);
|
|
|
+ list.add(map3);
|
|
|
+
|
|
|
+ return new Result(10000,ResultStatus.findSuccess,list);
|
|
|
+ }
|
|
|
}
|