|
@@ -274,11 +274,11 @@ public class PriceInfoController {
|
|
|
List<Map> stationPriceColumns = new ArrayList<>();
|
|
|
|
|
|
|
|
|
- for (StationInfo startSi : stationInfoList){
|
|
|
+ for (StationInfo endSi : stationInfoList){
|
|
|
Map<String,Object> map = new HashMap<>();
|
|
|
List<Map> priceList = new ArrayList<>();
|
|
|
Map<String,Map> stationPriceMap = new HashMap<>();
|
|
|
- for(StationInfo endSi : stationInfoList){
|
|
|
+ for(StationInfo startSi : stationInfoList){
|
|
|
Map<String,Object> priceMap = new HashMap<>();
|
|
|
PriceInfo priceInfo = priceInfoService.findByStartStationAndEndStation(startSi.getId(),endSi.getId());
|
|
|
String priceStr = "无";
|
|
@@ -289,11 +289,11 @@ public class PriceInfoController {
|
|
|
|
|
|
priceMap.put("price",priceStr);
|
|
|
priceList.add(priceMap);
|
|
|
- stationPriceMap.put(endSi.getId(),priceMap);
|
|
|
+ stationPriceMap.put(startSi.getId(),priceMap);
|
|
|
}
|
|
|
|
|
|
- map.put("id",startSi.getId());
|
|
|
- map.put("name",startSi.getName());
|
|
|
+ map.put("id",endSi.getId());
|
|
|
+ map.put("name",endSi.getName());
|
|
|
map.put("priceList",priceList);
|
|
|
map.put("stationPriceMap",stationPriceMap);
|
|
|
|
|
@@ -347,12 +347,12 @@ public class PriceInfoController {
|
|
|
|
|
|
|
|
|
Map<Integer,String> heardMap = new HashMap<Integer,String>();
|
|
|
- //查第一列 表头的站点名称名称 -- 终点站
|
|
|
+ //查第一列 表头的站点名称名称 -- 起点站
|
|
|
if(sheet1.getLastRowNum() > 0){
|
|
|
int coloumNum = sheet1.getRow(0).getPhysicalNumberOfCells();
|
|
|
for(int i = 1;i<coloumNum;i++){
|
|
|
- String endName = (String)poiUtils.getCellValue(sheetIndex,0,i).toString().replace(" ","");
|
|
|
- heardMap.put(i,endName);
|
|
|
+ String startName = (String)poiUtils.getCellValue(sheetIndex,0,i).toString().replace(" ","");
|
|
|
+ heardMap.put(i,startName);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -360,23 +360,27 @@ public class PriceInfoController {
|
|
|
|
|
|
for(int rowIndex=0 ; rowIndex<=sheet1.getLastRowNum(); rowIndex++){
|
|
|
try {
|
|
|
- //第一列为起点站点
|
|
|
- String startName = (String)poiUtils.getCellValue(sheetIndex,rowIndex,0).toString().replace(" ","");
|
|
|
- StationInfo startInfo = stationInfoService.findByRouteIdAndName(routeId,startName);
|
|
|
- if(startInfo == null){
|
|
|
+ //第一列为终点站点
|
|
|
+ String endName = (String)poiUtils.getCellValue(sheetIndex,rowIndex,0).toString().replace(" ","");
|
|
|
+ StationInfo endInfo = stationInfoService.findByRouteIdAndName(routeId,endName);
|
|
|
+ if(endInfo == null){
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
- for(int endIndex = 1;endIndex <=heardMap.size();endIndex++){
|
|
|
- String endName = heardMap.get(endIndex);
|
|
|
- StationInfo endInfo = stationInfoService.findByRouteIdAndName(routeId,endName);
|
|
|
- if(endInfo == null){
|
|
|
+ for(int startIndex = 1;startIndex <=heardMap.size();startIndex++){
|
|
|
+ String startName = heardMap.get(startIndex);
|
|
|
+ StationInfo startInfo = stationInfoService.findByRouteIdAndName(routeId,startName);
|
|
|
+ if(startInfo == null){
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
PriceInfo pi = priceInfoService.findByStartStationAndEndStation(startInfo.getId(),endInfo.getId());
|
|
|
|
|
|
- String price = (String)poiUtils.getCellValue(sheetIndex,rowIndex,endIndex).toString().replace(" ","");
|
|
|
+ String price = (String)poiUtils.getCellValue(sheetIndex,rowIndex,startIndex).toString().replace(" ","");
|
|
|
+ if("0".equals(price)){
|
|
|
+ //金额为0不保存
|
|
|
+ continue;
|
|
|
+ }
|
|
|
|
|
|
if(pi == null){
|
|
|
pi = new PriceInfo();
|