Commit 15fa2c1e authored by YONG-LIN SU's avatar YONG-LIN SU

更新費率及車格資料

parent b3781c77
This diff is collapsed.
1 2 20 1 1 25 0
2 2 20 2 1 25 0
3 2 20 3 1 25 0
4 2 20 4 1 25 0
5 2 20 5 1 25 0
6 2 20 6 1 50 0
7 2 20 7 1 50 0
8 2 20 8 1 50 0
9 2 20 9 1 25 0
10 2 20 10 1 25 0
11 2 40 11 1 25 0
12 2 20 12 1 15 4
13 2 20 13 1 15 4
14 2 40 14 1 25 0
1 1 25 1 2 20 0
2 1 25 2 2 20 0
3 1 25 3 2 20 0
4 1 25 4 2 20 0
5 1 25 5 2 20 0
6 1 25 6 2 40 0
7 1 25 7 2 40 0
8 1 25 8 2 40 0
9 1 25 9 2 20 0
10 1 25 10 2 20 0
11 1 50 11 2 20 0
12 1 15 12 2 10 4
13 1 15 13 2 10 4
14 1 50 14 2 20 0
...@@ -6,9 +6,9 @@ ...@@ -6,9 +6,9 @@
06 大自客貨 06 大自客貨
07 遊覽車 07 遊覽車
08 大營貨 08 大營貨
09 大型機車
10 計程車 10 計程車
11 交通車 11 交通車
12 身心障礙(府-2) 12 身心障礙(府-2)
13 身心障礙(社-4) 13 身心障礙(社-4)
14 其他 14 其他
31 輕機 \ No newline at end of file
\ No newline at end of file
...@@ -19,10 +19,14 @@ public class SpaceFee { ...@@ -19,10 +19,14 @@ public class SpaceFee {
@ColumnInfo(name = "fee") @ColumnInfo(name = "fee")
public int fee; public int fee;
public SpaceFee(int id, VehicleType vehicleType, SpaceRate spaceRate, int fee) { @ColumnInfo(name = "free_time")
public float freeTime; // 免費時數
public SpaceFee(int id, VehicleType vehicleType, SpaceRate spaceRate, int fee, float freeTime) {
this.id = id; this.id = id;
this.vehicleType = vehicleType; this.vehicleType = vehicleType;
this.spaceRate = spaceRate; this.spaceRate = spaceRate;
this.fee = fee; this.fee = fee;
this.freeTime = freeTime;
} }
} }
...@@ -288,14 +288,16 @@ public class T01ImportDbViewModel extends AndroidViewModel { ...@@ -288,14 +288,16 @@ public class T01ImportDbViewModel extends AndroidViewModel {
infoRepository.spaceFeeDao.deleteAll(); infoRepository.spaceFeeDao.deleteAll();
for (int i = 0; i < lines.length; i++) { for (int i = 0; i < lines.length; i++) {
String[] columnString = lines[i].trim().split("[ ]"); String[] columnString = lines[i].trim().split("[ ]");
if (columnString.length != 3){ if (columnString.length != 4){
continue; continue;
} }
int vehicleTypeId,spaceRateId, fee; int vehicleTypeId,spaceRateId, fee;
float freeTime;
try { try {
vehicleTypeId = Integer.parseInt(columnString[0]); vehicleTypeId = Integer.parseInt(columnString[0]);
spaceRateId = Integer.parseInt(columnString[1]); spaceRateId = Integer.parseInt(columnString[1]);
fee = Integer.parseInt(columnString[2]); fee = Integer.parseInt(columnString[2]);
freeTime = Float.parseFloat(columnString[3]);
}catch (NumberFormatException e){ }catch (NumberFormatException e){
continue; continue;
} }
...@@ -308,7 +310,7 @@ public class T01ImportDbViewModel extends AndroidViewModel { ...@@ -308,7 +310,7 @@ public class T01ImportDbViewModel extends AndroidViewModel {
if (spaceRateList.size() == 0){continue;} if (spaceRateList.size() == 0){continue;}
SpaceRate spaceRate = spaceRateList.get(0); SpaceRate spaceRate = spaceRateList.get(0);
SpaceFee spaceFee = new SpaceFee(0, vehicleType, spaceRate, fee); SpaceFee spaceFee = new SpaceFee(0, vehicleType, spaceRate, fee, freeTime);
infoRepository.spaceFeeDao.insertAll(spaceFee); infoRepository.spaceFeeDao.insertAll(spaceFee);
} }
}); });
......
1 2 20 1 1 25 0
2 2 20 2 1 25 0
3 2 20 3 1 25 0
4 2 20 4 1 25 0
5 2 20 5 1 25 0
6 2 20 6 1 50 0
7 2 20 7 1 50 0
8 2 20 8 1 50 0
9 2 20 9 1 25 0
10 2 20 10 1 25 0
11 2 40 11 1 25 0
12 2 20 12 1 15 4
13 2 20 13 1 15 4
14 2 40 14 1 25 0
1 1 25 1 2 20 0
2 1 25 2 2 20 0
3 1 25 3 2 20 0
4 1 25 4 2 20 0
5 1 25 5 2 20 0
6 1 25 6 2 40 0
7 1 25 7 2 40 0
8 1 25 8 2 40 0
9 1 25 9 2 20 0
10 1 25 10 2 20 0
11 1 50 11 2 20 0
12 1 15 12 2 10 4
13 1 15 13 2 10 4
14 1 50 14 2 20 0
...@@ -6,9 +6,9 @@ ...@@ -6,9 +6,9 @@
06 大自客貨 06 大自客貨
07 遊覽車 07 遊覽車
08 大營貨 08 大營貨
09 大型機車
10 計程車 10 計程車
11 交通車 11 交通車
12 身心障礙(府-2) 12 身心障礙(府-2)
13 身心障礙(社-4) 13 身心障礙(社-4)
14 其他 14 其他
31 輕機 \ No newline at end of file
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment