|
@@ -8,10 +8,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
+import java.util.*;
|
|
|
|
|
|
@Service
|
|
|
public class LargePlatAssetServiceImpl implements ILargePlatAssetService {
|
|
@@ -168,26 +165,54 @@ public class LargePlatAssetServiceImpl implements ILargePlatAssetService {
|
|
|
}
|
|
|
|
|
|
public Map<String, Object> getSceneRate(int flag){
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
List<LargeLogistics> list;
|
|
|
- List<String> list1 = new ArrayList<>();
|
|
|
- List<BigDecimal> list2 = new ArrayList<>();
|
|
|
if (flag == 0){
|
|
|
+ List<String> appOrg = new ArrayList<>(Arrays.asList("1A003", "1B001", "1C001", "1D001", "1E001", "1F001", "1K001", "1L001", "1H001", "1M001", "1J001"));
|
|
|
+ List<String> appName = new ArrayList<>(Arrays.asList("太原", "大同", "阳泉", "长治", "晋城", "朔州", "晋中", "临汾", "忻州", "运城", "吕梁"));
|
|
|
+ map.put("xList", appName);
|
|
|
list = platAssetMapper.getSceneRateX();
|
|
|
- for (LargeLogistics it : list){
|
|
|
- it.setAppName(it.getAppName().substring(6, 8));
|
|
|
+ if (list.isEmpty()){
|
|
|
+ map.put("yList", new ArrayList<>(Arrays.asList(0,0,0,0,0,0,0,0,0,0,0)));
|
|
|
+ return map;
|
|
|
}
|
|
|
+ List<BigDecimal> list3 = new ArrayList<>();
|
|
|
+ for (String str : appOrg){
|
|
|
+ BigDecimal t = BigDecimal.valueOf(0);
|
|
|
+ for (LargeLogistics it : list){
|
|
|
+ if (it.getAppOrg().equals(str)){
|
|
|
+ t = it.getSceneRate();
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ list3.add(t);
|
|
|
+ }
|
|
|
+ map.put("yList", list3);
|
|
|
+ return map;
|
|
|
}
|
|
|
else {
|
|
|
+ List<String> appOrg = new ArrayList<>(Arrays.asList("1A001", "1A002", "1A003", "1A004", "1A005", "1B001", "1C001", "1D001", "1E001", "1F001", "1K001", "1L001", "1H001", "1M001", "1J001"));
|
|
|
+ List<String> appName = new ArrayList<>(Arrays.asList("国网营销服务中心", "国网超高压变电分公司", "国网电力公司太原供电公司", "国网电力科学技术研究院", "国网山西省电力公司党校", "国网电力公司大同供电公司", "国网电力公司阳泉供电公司", "国网电力公司长治供电公司", "国网电力公司晋城供电公司", "国网电力公司朔州供电公司", "国网电力公司晋中供电公司", "国网电力公司临汾供电公司", "国网电力公司忻州供电公司", "国网电力公司运城供电公司", "国网电力公司吕梁供电公司"));
|
|
|
+ map.put("xList", appName);
|
|
|
list = platAssetMapper.getSceneRateY();
|
|
|
+ if (list.isEmpty()){
|
|
|
+ map.put("yList", new ArrayList<>(Arrays.asList(0,0,0,0,0,0,0,0,0,0,0)));
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+ List<BigDecimal> list3 = new ArrayList<>();
|
|
|
+ for (String str : appOrg){
|
|
|
+ BigDecimal t = BigDecimal.valueOf(0);
|
|
|
+ for (LargeLogistics it : list){
|
|
|
+ if (it.getAppOrg().equals(str)){
|
|
|
+ t = it.getSceneRate();
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ list3.add(t);
|
|
|
+ }
|
|
|
+ map.put("yList", list3);
|
|
|
+ return map;
|
|
|
}
|
|
|
- for (LargeLogistics it : list){
|
|
|
- list1.add(it.getAppName());
|
|
|
- list2.add(it.getSceneRate());
|
|
|
- }
|
|
|
- Map<String, Object> map = new HashMap<>();
|
|
|
- map.put("xList", list1);
|
|
|
- map.put("yList", list2);
|
|
|
- return map;
|
|
|
}
|
|
|
|
|
|
public LargeLogistics getOperation(String appOrg){
|
|
@@ -203,15 +228,26 @@ public class LargePlatAssetServiceImpl implements ILargePlatAssetService {
|
|
|
}
|
|
|
|
|
|
public Map<String, Object> getInspectionSchemeNumX(){
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ List<String> appOrg = new ArrayList<>(Arrays.asList("1A003", "1B001", "1C001", "1D001", "1E001", "1F001", "1K001", "1L001", "1H001", "1M001", "1J001"));
|
|
|
+ List<String> appName = new ArrayList<>(Arrays.asList("太原", "大同", "阳泉", "长治", "晋城", "朔州", "晋中", "临汾", "忻州", "运城", "吕梁"));
|
|
|
+ map.put("xList", appName);
|
|
|
List<LargeLogistics> list = platAssetMapper.getInspectionSchemeNumX();
|
|
|
- List<String> list1 = new ArrayList<>();
|
|
|
+ if (list.isEmpty()){
|
|
|
+ map.put("yList", new ArrayList<>(Arrays.asList(0,0,0,0,0,0,0,0,0,0,0)));
|
|
|
+ return map;
|
|
|
+ }
|
|
|
List<Long> list2 = new ArrayList<>();
|
|
|
- for (LargeLogistics it : list){
|
|
|
- list1.add(it.getAppName().substring(6, 8));
|
|
|
- list2.add(it.getInspectionSchemeNum());
|
|
|
+ for (String str : appOrg){
|
|
|
+ Long t = 0L;
|
|
|
+ for (LargeLogistics it : list){
|
|
|
+ if (it.getAppOrg().equals(str)){
|
|
|
+ t = it.getInspectionSchemeNum();
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ list2.add(t);
|
|
|
}
|
|
|
- Map<String, Object> map = new HashMap<>();
|
|
|
- map.put("xList", list1);
|
|
|
map.put("yList", list2);
|
|
|
return map;
|
|
|
}
|