|
@@ -4,10 +4,7 @@ import com.bowintek.smartsearch.mapper.cquery.FactWellCQuery;
|
|
import com.bowintek.smartsearch.services.service.FactWellService;
|
|
import com.bowintek.smartsearch.services.service.FactWellService;
|
|
import com.bowintek.smartsearch.util.multipdb.DBTypeEnum;
|
|
import com.bowintek.smartsearch.util.multipdb.DBTypeEnum;
|
|
import com.bowintek.smartsearch.util.multipdb.SwitchDataSource;
|
|
import com.bowintek.smartsearch.util.multipdb.SwitchDataSource;
|
|
-import com.bowintek.smartsearch.vo.FactWell.FactWellGroupList;
|
|
|
|
-import com.bowintek.smartsearch.vo.FactWell.FactWellResult;
|
|
|
|
-import com.bowintek.smartsearch.vo.FactWell.FactWellTime;
|
|
|
|
-import com.bowintek.smartsearch.vo.FactWell.FactWellTimeResult;
|
|
|
|
|
|
+import com.bowintek.smartsearch.vo.FactWell.*;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
@@ -24,7 +21,7 @@ public class FactWellServiceImpl implements FactWellService {
|
|
@Override
|
|
@Override
|
|
@SwitchDataSource(DBTypeEnum.POSTGRE)
|
|
@SwitchDataSource(DBTypeEnum.POSTGRE)
|
|
public FactWellResult getFactWellList(String wellId, String timeType){
|
|
public FactWellResult getFactWellList(String wellId, String timeType){
|
|
- if(wellId==null) return FactWellResult.gen(new ArrayList<>(), null, wellId);
|
|
|
|
|
|
+ if(wellId==null) return FactWellResult.gen(new ArrayList<>(), null, null, wellId);
|
|
//当前只有月份计算方式
|
|
//当前只有月份计算方式
|
|
return getMonthShowInList(wellId, null, null);
|
|
return getMonthShowInList(wellId, null, null);
|
|
}
|
|
}
|
|
@@ -64,6 +61,7 @@ public class FactWellServiceImpl implements FactWellService {
|
|
|
|
|
|
List<FactWellGroupList> rtnList = factWellCQuery
|
|
List<FactWellGroupList> rtnList = factWellCQuery
|
|
.getMonthShowInList(wellId, dateToDayString(startTime), dateToDayString(endTime));
|
|
.getMonthShowInList(wellId, dateToDayString(startTime), dateToDayString(endTime));
|
|
|
|
+// List<FactWellUnit> unitList = setUnit(rtnList);
|
|
|
|
|
|
//补充列表数据
|
|
//补充列表数据
|
|
List<String> monthList = new ArrayList<>();
|
|
List<String> monthList = new ArrayList<>();
|
|
@@ -77,7 +75,7 @@ public class FactWellServiceImpl implements FactWellService {
|
|
}
|
|
}
|
|
|
|
|
|
return FactWellResult.gen(supplementList(wellId, monthList, rtnList),
|
|
return FactWellResult.gen(supplementList(wellId, monthList, rtnList),
|
|
- Arrays.stream((new FactWellTimeResult[]{timeResult})).toList(), wellId);
|
|
|
|
|
|
+ Arrays.stream((new FactWellTimeResult[]{timeResult})).toList(), null, wellId);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -104,6 +102,7 @@ public class FactWellServiceImpl implements FactWellService {
|
|
|
|
|
|
List<FactWellGroupList> rtnList = factWellCQuery
|
|
List<FactWellGroupList> rtnList = factWellCQuery
|
|
.getDayGroupList(wellId, dateToDayString(startTime), dateToDayString(endTime));
|
|
.getDayGroupList(wellId, dateToDayString(startTime), dateToDayString(endTime));
|
|
|
|
+ List<FactWellUnit> unitList = setUnit(rtnList);
|
|
|
|
|
|
//补充列表数据
|
|
//补充列表数据
|
|
List<String> dayList = new ArrayList<>();
|
|
List<String> dayList = new ArrayList<>();
|
|
@@ -116,7 +115,7 @@ public class FactWellServiceImpl implements FactWellService {
|
|
time = calendarTime.getTime();
|
|
time = calendarTime.getTime();
|
|
}
|
|
}
|
|
|
|
|
|
- return FactWellResult.gen(supplementList(wellId, dayList, rtnList), timeList, wellId);
|
|
|
|
|
|
+ return FactWellResult.gen(supplementList(wellId, dayList, rtnList), timeList, unitList, wellId);
|
|
}
|
|
}
|
|
|
|
|
|
public FactWellResult getMonthGroupList(String wellId, Date startTime, Date endTime){
|
|
public FactWellResult getMonthGroupList(String wellId, Date startTime, Date endTime){
|
|
@@ -135,6 +134,7 @@ public class FactWellServiceImpl implements FactWellService {
|
|
|
|
|
|
List<FactWellGroupList> rtnList = factWellCQuery
|
|
List<FactWellGroupList> rtnList = factWellCQuery
|
|
.getMonthGroupList(wellId, dateToDayString(startTime), dateToDayString(endTime));
|
|
.getMonthGroupList(wellId, dateToDayString(startTime), dateToDayString(endTime));
|
|
|
|
+ List<FactWellUnit> unitList = setUnit(rtnList);
|
|
|
|
|
|
//补充列表数据
|
|
//补充列表数据
|
|
List<String> monthList = new ArrayList<>();
|
|
List<String> monthList = new ArrayList<>();
|
|
@@ -147,7 +147,7 @@ public class FactWellServiceImpl implements FactWellService {
|
|
time = calendarTime.getTime();
|
|
time = calendarTime.getTime();
|
|
}
|
|
}
|
|
|
|
|
|
- return FactWellResult.gen(supplementList(wellId, monthList, rtnList), timeList, wellId);
|
|
|
|
|
|
+ return FactWellResult.gen(supplementList(wellId, monthList, rtnList), timeList, unitList, wellId);
|
|
}
|
|
}
|
|
|
|
|
|
public FactWellResult getYearGroupList(String wellId, Date startTime, Date endTime){
|
|
public FactWellResult getYearGroupList(String wellId, Date startTime, Date endTime){
|
|
@@ -166,6 +166,7 @@ public class FactWellServiceImpl implements FactWellService {
|
|
|
|
|
|
List<FactWellGroupList> rtnList = factWellCQuery
|
|
List<FactWellGroupList> rtnList = factWellCQuery
|
|
.getYearGroupList(wellId, dateToDayString(startTime), dateToDayString(endTime));
|
|
.getYearGroupList(wellId, dateToDayString(startTime), dateToDayString(endTime));
|
|
|
|
+ List<FactWellUnit> unitList = setUnit(rtnList);
|
|
|
|
|
|
//补充列表数据
|
|
//补充列表数据
|
|
List<String> monthList = new ArrayList<>();
|
|
List<String> monthList = new ArrayList<>();
|
|
@@ -178,7 +179,7 @@ public class FactWellServiceImpl implements FactWellService {
|
|
time = calendarTime.getTime();
|
|
time = calendarTime.getTime();
|
|
}
|
|
}
|
|
|
|
|
|
- return FactWellResult.gen(supplementList(wellId, monthList, rtnList), timeList, wellId);
|
|
|
|
|
|
+ return FactWellResult.gen(supplementList(wellId, monthList, rtnList), timeList, unitList, wellId);
|
|
}
|
|
}
|
|
|
|
|
|
public List<FactWellTimeResult> getTimeLimitList(String wellId){
|
|
public List<FactWellTimeResult> getTimeLimitList(String wellId){
|
|
@@ -292,4 +293,59 @@ public class FactWellServiceImpl implements FactWellService {
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy");
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy");
|
|
return sdf.format(time);
|
|
return sdf.format(time);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ public List<FactWellUnit> setUnit(List<FactWellGroupList> list){
|
|
|
|
+ List<FactWellUnit> units = new ArrayList<>();
|
|
|
|
+ int listSize = list.size();
|
|
|
|
+
|
|
|
|
+ if(list.stream().filter(x->x.getGas()>10000).count() == listSize){
|
|
|
|
+ list.forEach(item->{
|
|
|
|
+ item.setGas(item.getGas()/10000);
|
|
|
|
+ });
|
|
|
|
+ units.add(new FactWellUnit("gas", "万立方米"));
|
|
|
|
+ }else{
|
|
|
|
+ units.add(new FactWellUnit("gas", "立方米"));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(list.stream().filter(x->x.getOil()>10000).count() == listSize){
|
|
|
|
+ list.forEach(item->{
|
|
|
|
+ item.setOil(item.getOil()/10000);
|
|
|
|
+ });
|
|
|
|
+ units.add(new FactWellUnit("oil", "万吨"));
|
|
|
|
+ }else{
|
|
|
|
+ units.add(new FactWellUnit("oil", "吨"));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(list.stream().filter(x->x.getWater()>10000).count() == listSize){
|
|
|
|
+ list.forEach(item->{
|
|
|
|
+ item.setWater(item.getWater()/10000);
|
|
|
|
+ });
|
|
|
|
+ units.add(new FactWellUnit("water", "万吨"));
|
|
|
|
+ }else{
|
|
|
|
+ units.add(new FactWellUnit("water", "吨"));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(list.stream().filter(x->x.getFluid()>10000).count() == listSize){
|
|
|
|
+ list.forEach(item->{
|
|
|
|
+ item.setFluid(item.getFluid()/10000);
|
|
|
|
+ });
|
|
|
|
+ units.add(new FactWellUnit("fluid", "万吨"));
|
|
|
|
+ }else{
|
|
|
|
+ units.add(new FactWellUnit("fluid", "吨"));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(list.stream().filter(x->x.getVol()>10000).count() == listSize){
|
|
|
|
+ list.forEach(item->{
|
|
|
|
+ item.setOil(item.getVol()/10000);
|
|
|
|
+ });
|
|
|
|
+ units.add(new FactWellUnit("vol", "万吨"));
|
|
|
|
+ }else{
|
|
|
|
+ units.add(new FactWellUnit("vol", "吨"));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ units.add(new FactWellUnit("watercut", "%"));
|
|
|
|
+
|
|
|
|
+ return units;
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|