Commit d440a51b authored by 陳煦元's avatar 陳煦元

1130710V3.0.6

3.0.4

- [x]  如果遇到車主抽單,要重新開單,格號車號一樣會被鎖定住一樣不能更改車種(比方說自小客車要改殘障車)(無須更改)
- [x]  停車單上面的時間可以預印,但不要印金額(暫不修改)
- [x]  印單後自動跳添加照片
- [x]  紅字改白字
- [x]  無法配合舊印表機(這邊測試正常)
- [x]  廠牌>多做一欄常用廠牌出來

3.0.5

- [x]  車牌辨識還原成可開關
- [x]  累加時自動拍照
- [x]  鎖定資料時不要反灰
- [x]  確認是否註銷
- [x]  調整字體大小
- [x]  修正開單員編號只有一碼

3.0.6

- [x]  重新列印後,該筆資料不要清除
- [x]  車種預設小客車(只有預設開啟自動下一步的才有此功能)
- [x]  待阿達確定能不能更改格位(可以)
- [x]  累加時照片會被切一半(優先度中) &累加一次會有兩張照片剛開完單的那次添加照片,照片會變橫的
邏輯
1.正常開單
2.再次按下新筆拍照以進行累加>此時若選取累加照片就會存入累加照片中
3.累加完後再跳一次拍照>所以兩個問題 1.第一次照片是一半且轉90度的 2.累加一次拍兩張照片
- [x]  累加提醒確認會跳一堆錯 原因是使用了已關閉的TIMER(加上判斷式 暫時修正)
parent 8f909f84
...@@ -10,7 +10,7 @@ android { ...@@ -10,7 +10,7 @@ android {
minSdk 27 minSdk 27
targetSdk 30 targetSdk 30
versionCode 1 versionCode 1
versionName "Dev Ver.3.0.1(無車辨)" versionName "Dev Ver.3.0.6(無車辨)"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
"filters": [], "filters": [],
"attributes": [], "attributes": [],
"versionCode": 1, "versionCode": 1,
"versionName": "Dev Ver.3.0.1(無車辨)", "versionName": "Dev Ver.3.0.5(無車辨)",
"outputFile": "app-release.apk" "outputFile": "app-release.apk"
} }
], ],
......
17 豐田 (Toyota)
39 日產 (Nissan)
41 本田 (Honda)
29 三菱 (Mitsubishi)
07 福特 (Ford)
10 賓士 (Benz)
11 寶馬 (BMW)
52 凌志 (Lexus)
06 中華
25 福斯 (Volkswagon)
33 馬自達 (Mazda)
34 鈴木 (Suzuki)
58 SKODA
12 富豪 (Volvo)
56 MG
30 速霸路 (Subaru)
59 特斯拉
35 現代 (Hyundai)
01 無限 (INFINITI) 01 無限 (INFINITI)
55 納智捷 (Luxgen)
43 保時捷 (Porsche)
31 奧迪 (Audi)
02 裕隆 02 裕隆
03 三陽 (Honda) 03 三陽 (Honda)
04 大發 (Daihatsu) 04 大發 (Daihatsu)
05 喜悅 (Seat) 05 喜悅 (Seat)
06 中華
07 福特 (Ford)
08 雷諾 (Renault) 08 雷諾 (Renault)
09 寶獅 (Peugeot) 09 寶獅 (Peugeot)
10 賓士 (Benz)
11 寶馬 (BMW)
12 富豪 (Volvo)
13 別克 (Buick) 13 別克 (Buick)
14 雪鐵龍 (Citroen) 14 雪鐵龍 (Citroen)
15 飛雅特 (Fiat) 15 飛雅特 (Fiat)
16 其他 16 其他
17 豐田 (Toyota)
18 歐寶 (Opel) 18 歐寶 (Opel)
19 奧斯摩比 (Oldsmobile) 19 奧斯摩比 (Oldsmobile)
20 龐帝克 (Pontiac) 20 龐帝克 (Pontiac)
...@@ -22,25 +37,15 @@ ...@@ -22,25 +37,15 @@
22 雪佛蘭 (Chevrolet) 22 雪佛蘭 (Chevrolet)
23 克萊斯勒 (Chrysler) 23 克萊斯勒 (Chrysler)
24 愛快羅密歐 (Alfa Romeo) 24 愛快羅密歐 (Alfa Romeo)
25 福斯 (Volkswagon)
26 紳寶 (Saab) 26 紳寶 (Saab)
27 蘭吉雅 (Lancia) 27 蘭吉雅 (Lancia)
28 謀克利 (Mercury) 28 謀克利 (Mercury)
29 三菱 (Mitsubishi)
30 速霸路 (Subaru)
31 奧迪 (Audi)
32 路寶 (Rover) 32 路寶 (Rover)
33 馬自達 (Mazda)
34 鈴木 (Suzuki)
35 現代 (Hyundai)
36 大慶 36 大慶
37 凱迪拉克 (Cadillac) 37 凱迪拉克 (Cadillac)
38 釷星 (Saturn) 38 釷星 (Saturn)
39 日產 (Nissan)
40 五十鈴 (Isuzu) 40 五十鈴 (Isuzu)
41 本田 (Honda)
42 拉達 (Lada) 42 拉達 (Lada)
43 保時捷 (Porsche)
44 紳揚 44 紳揚
45 大宇 (Dwewoo) 45 大宇 (Dwewoo)
46 勞斯萊斯 (Rolls Royce) 46 勞斯萊斯 (Rolls Royce)
...@@ -49,10 +54,6 @@ ...@@ -49,10 +54,6 @@
49 捷豹 (Jaguar) 49 捷豹 (Jaguar)
50 道奇 (Dodge) 50 道奇 (Dodge)
51 台塑 (Formosa) 51 台塑 (Formosa)
52 凌志 (Lexus)
53 蓮花 (Lotus) 53 蓮花 (Lotus)
54 吉普 (Jeep) 54 吉普 (Jeep)
55 納智捷 (Luxgen)
56 MG
57 寶騰 (pontiac) 57 寶騰 (pontiac)
58 SKODA
\ No newline at end of file
01 咖啡
02 黑 02 黑
03 白 03 白
12 銀
08 藍
13 灰
04 紅 04 紅
05 橙
06 黃 06 黃
07 綠 07 綠
08 藍 14 其他
09 紫
10 金 10 金
01 咖啡
11 棕 11 棕
12 銀 05 橙
13 灰 09 紫
14 其他 \ No newline at end of file
\ No newline at end of file
...@@ -19,6 +19,9 @@ public interface VehicleBrandDao { ...@@ -19,6 +19,9 @@ public interface VehicleBrandDao {
@Query("SELECT * FROM vehiclebrand") @Query("SELECT * FROM vehiclebrand")
LiveData<List<VehicleBrand>> getAllLiveData(); LiveData<List<VehicleBrand>> getAllLiveData();
@Query("SELECT * FROM vehiclebrand WHERE id = 17 OR id = 39 OR id = 41 OR id = 29 OR id = 07 OR id = 10 OR id = 11 OR id = 52 OR id = 06 OR id = 25 ")
LiveData<List<VehicleBrand>> getcommonData();
@Query("SELECT * FROM vehiclebrand WHERE id IN (:Ids)") @Query("SELECT * FROM vehiclebrand WHERE id IN (:Ids)")
List<VehicleBrand> loadAllByIds(int[] Ids); List<VehicleBrand> loadAllByIds(int[] Ids);
......
...@@ -195,13 +195,19 @@ public class Case { ...@@ -195,13 +195,19 @@ public class Case {
{ {
Brand="0"+Brand; Brand="0"+Brand;
} }
String userid =String.valueOf(user.id);
if(userid.length()==1)
{
userid="0"+userid;
}
// 2022/7/29 加入GPS座標功能後,修改該處假資料 // 2022/7/29 加入GPS座標功能後,修改該處假資料
String locationString = String.format("Lat:%f Lon:%f", location == null ? 0.0 : location.getLatitude(), location == null ? 0.0 : location.getLongitude()); // Lat:24.1434911 Lon:120.7285887 String locationString = String.format("Lat:%f Lon:%f", location == null ? 0.0 : location.getLatitude(), location == null ? 0.0 : location.getLongitude()); // Lat:24.1434911 Lon:120.7285887
return String.format(Locale.TAIWAN, "%s%s;%s;%s;%s;%s;%s;%s;%s;%s;%s;%.1f;%d;%s;%s;%d;\r\n", return String.format(Locale.TAIWAN, "%s%s;%s;%s;%s;%s;%s;%s;%s;%s;%s;%.1f;%d;%s;%s;%d;\r\n",
getShift(), getShift(),
user.id, userid,
billingNumber2, billingNumber2,
terminateDateString, terminateDateString,
caseTimeString, caseTimeString,
......
...@@ -17,7 +17,6 @@ public class VehicleType implements Parcelable { ...@@ -17,7 +17,6 @@ public class VehicleType implements Parcelable {
@NonNull @NonNull
//public int id; //public int id;
public String id; public String id;
@ColumnInfo(name = "name") @ColumnInfo(name = "name")
public String name; // 車種名稱 public String name; // 車種名稱
......
...@@ -80,7 +80,7 @@ public class T02PlateAndSpaceConfirmActivity extends AppCompatActivity { ...@@ -80,7 +80,7 @@ public class T02PlateAndSpaceConfirmActivity extends AppCompatActivity {
}catch (NullPointerException nullPointerException){ }catch (NullPointerException nullPointerException){
nullPointerException.printStackTrace(); nullPointerException.printStackTrace();
} }
resetRecyclerView(savedInstanceState);
plateNumber = boxInfo == null ? null : boxInfo.getPlateNumbs(); plateNumber = boxInfo == null ? null : boxInfo.getPlateNumbs();
if (userId == -1 || shift == null || location == null ){ if (userId == -1 || shift == null || location == null ){
finish(); finish();
...@@ -220,6 +220,18 @@ public class T02PlateAndSpaceConfirmActivity extends AppCompatActivity { ...@@ -220,6 +220,18 @@ public class T02PlateAndSpaceConfirmActivity extends AppCompatActivity {
keyInPlateNumberActivityResultLauncher.launch(intent); keyInPlateNumberActivityResultLauncher.launch(intent);
} }
private void resetRecyclerView(Bundle savedInstanceState)
{
/*// 初始化 RecyclerView
recyclerView = findViewById(R.id.rv_space_option);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
recyclerView.setAdapter(new MyAdapter());
// 如果有保存的状态,则恢复滚动位置
if (savedInstanceState != null) {
onRestoreInstanceState(savedInstanceState);
}*/
}
private void nextStage(Space space){ private void nextStage(Space space){
boolean isNewCase = false; boolean isNewCase = false;
Intent intent = getIntent(); Intent intent = getIntent();
......
...@@ -6,8 +6,11 @@ import androidx.appcompat.app.AppCompatActivity; ...@@ -6,8 +6,11 @@ import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil; import androidx.databinding.DataBindingUtil;
import androidx.lifecycle.ViewModelProvider; import androidx.lifecycle.ViewModelProvider;
import androidx.recyclerview.widget.GridLayoutManager; import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences;
import android.location.Location; import android.location.Location;
import android.os.Bundle; import android.os.Bundle;
...@@ -34,6 +37,7 @@ public class T02SelectSpaceActivity extends AppCompatActivity { ...@@ -34,6 +37,7 @@ public class T02SelectSpaceActivity extends AppCompatActivity {
dataBinding = DataBindingUtil.setContentView(this, R.layout.activity_t02_select_space); dataBinding = DataBindingUtil.setContentView(this, R.layout.activity_t02_select_space);
t02SelectSpaceViewModel = new ViewModelProvider(this).get(T02SelectSpaceViewModel.class); t02SelectSpaceViewModel = new ViewModelProvider(this).get(T02SelectSpaceViewModel.class);
enableNearbyLocation = getIntent().getBooleanExtra("EnableNearbyLocation", false); enableNearbyLocation = getIntent().getBooleanExtra("EnableNearbyLocation", false);
location = getIntent().getParcelableExtra("Location"); location = getIntent().getParcelableExtra("Location");
...@@ -58,8 +62,34 @@ public class T02SelectSpaceActivity extends AppCompatActivity { ...@@ -58,8 +62,34 @@ public class T02SelectSpaceActivity extends AppCompatActivity {
private void eventBinding(){ private void eventBinding(){
dataBinding.btnSelectSpaceBack.setOnClickListener(view -> spaceSelected(null)); dataBinding.btnSelectSpaceBack.setOnClickListener(view -> spaceSelected(null));
dataBinding.btnSelectRoad.setOnClickListener(view -> btnSelectRoadOnClicked()); dataBinding.btnSelectRoad.setOnClickListener(view -> btnSelectRoadOnClicked());
} }
/* @Override
protected void onPause() {
super.onPause();
RecyclerView rvspaceoption = findViewById(R.id.rv_space_option);
int scrollPosition = ((LinearLayoutManager) rvspaceoption.getLayoutManager()).findFirstVisibleItemPosition();
SharedPreferences.Editor editor = getSharedPreferences("MyPrefs", MODE_PRIVATE).edit();
editor.putInt("scroll_position", scrollPosition);
editor.apply();
}
@Override
protected void onResume() {
super.onResume();
RecyclerView rvspaceoption = findViewById(R.id.rv_space_option);
// 从SharedPreferences中读取保存的滚动位置
SharedPreferences prefs = getSharedPreferences("MyPrefs", MODE_PRIVATE);
final int scrollPosition = prefs.getInt("scroll_position", 0);
// 延迟设置滚动位置,确保RecyclerView已经设置了Adapter
rvspaceoption.post(new Runnable() {
@Override
public void run() {
rvspaceoption.getLayoutManager().scrollToPosition(scrollPosition);
}
});
}*/
private void resultLauncherRegister() { private void resultLauncherRegister() {
roadResultLauncher = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), result -> { roadResultLauncher = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), result -> {
...@@ -104,4 +134,5 @@ public class T02SelectSpaceActivity extends AppCompatActivity { ...@@ -104,4 +134,5 @@ public class T02SelectSpaceActivity extends AppCompatActivity {
intent.setClass(this, T02SelectRoadActivity.class); intent.setClass(this, T02SelectRoadActivity.class);
roadResultLauncher.launch(intent); roadResultLauncher.launch(intent);
} }
} }
\ No newline at end of file
...@@ -17,20 +17,30 @@ import ecom.android.newparkapp.repository.InfoRepository; ...@@ -17,20 +17,30 @@ import ecom.android.newparkapp.repository.InfoRepository;
public class T02SelectVehicleBrand extends AppCompatActivity { public class T02SelectVehicleBrand extends AppCompatActivity {
private ActivityT02SelectVehicleBrandBinding dataBinding; private ActivityT02SelectVehicleBrandBinding dataBinding;
private InfoRepository infoRepository; private InfoRepository infoRepository , infoRepository2;
private SelectVehicleBrandAdapter selectVehicleBrandAdapter; private SelectVehicleBrandAdapter selectVehicleBrandAdapter , selectVehicleBrandAdapter2;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
dataBinding = DataBindingUtil.setContentView(this,R.layout.activity_t02_select_vehicle_brand); dataBinding = DataBindingUtil.setContentView(this,R.layout.activity_t02_select_vehicle_brand);
infoRepository = new InfoRepository(getApplication()); infoRepository = new InfoRepository(getApplication());
infoRepository2 = new InfoRepository(getApplication());
selectVehicleBrandAdapter = new SelectVehicleBrandAdapter(vehicleBrand -> vehicleBrandSelected(vehicleBrand)); selectVehicleBrandAdapter = new SelectVehicleBrandAdapter(vehicleBrand -> vehicleBrandSelected(vehicleBrand));
infoRepository.vehicleBrandDao.getAllLiveData().observe(this, vehicleBrands -> selectVehicleBrandAdapter.submitList(vehicleBrands)); infoRepository.vehicleBrandDao.getAllLiveData().observe(this, vehicleBrands -> selectVehicleBrandAdapter.submitList(vehicleBrands));
selectVehicleBrandAdapter2 = new SelectVehicleBrandAdapter(vehicleBrand -> vehicleBrandSelected(vehicleBrand));
infoRepository2.vehicleBrandDao.getcommonData().observe(this, vehicleBrands -> selectVehicleBrandAdapter2.submitList(vehicleBrands));
dataBinding.rvSelectOption.setLayoutManager(new GridLayoutManager(this,2)); dataBinding.rvSelectOption.setLayoutManager(new GridLayoutManager(this,2));
dataBinding.rvSelectOption.setAdapter(selectVehicleBrandAdapter); dataBinding.rvSelectOption.setAdapter(selectVehicleBrandAdapter);
dataBinding.rvSelectOptionUsed.setLayoutManager(new GridLayoutManager(this,2));
dataBinding.rvSelectOptionUsed.setAdapter(selectVehicleBrandAdapter2);
dataBinding.btnSelectBack.setOnClickListener(view -> vehicleBrandSelected(null)); dataBinding.btnSelectBack.setOnClickListener(view -> vehicleBrandSelected(null));
} }
......
...@@ -13,6 +13,7 @@ import java.util.List; ...@@ -13,6 +13,7 @@ import java.util.List;
import ecom.android.newparkapp.R; import ecom.android.newparkapp.R;
import ecom.android.newparkapp.adapter.SelectVehicleTypeAdapter; import ecom.android.newparkapp.adapter.SelectVehicleTypeAdapter;
import ecom.android.newparkapp.databinding.ActivityT02SelectVehicleTypeBinding; import ecom.android.newparkapp.databinding.ActivityT02SelectVehicleTypeBinding;
import ecom.android.newparkapp.entity.Case;
import ecom.android.newparkapp.entity.VehicleType; import ecom.android.newparkapp.entity.VehicleType;
import ecom.android.newparkapp.repository.InfoRepository; import ecom.android.newparkapp.repository.InfoRepository;
...@@ -28,16 +29,11 @@ public class T02SelectVehicleTypeActivity extends AppCompatActivity { ...@@ -28,16 +29,11 @@ public class T02SelectVehicleTypeActivity extends AppCompatActivity {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
dataBinding = DataBindingUtil.setContentView(this, R.layout.activity_t02_select_vehicle_type); dataBinding = DataBindingUtil.setContentView(this, R.layout.activity_t02_select_vehicle_type);
infoRepository = new InfoRepository(getApplication()); infoRepository = new InfoRepository(getApplication());
selectVehicleTypeAdapter = new SelectVehicleTypeAdapter(vehicleType -> vehicleTypeSelected(vehicleType));//如果選了車種 則依照選擇的車種進入
selectVehicleTypeAdapter = new SelectVehicleTypeAdapter(vehicleType -> vehicleTypeSelected(vehicleType));
infoRepository.vehicleTypeDao.getAllLiveData().observe(this, vehicleTypes -> {selectVehicleTypeAdapter.submitList(vehicleTypes);}); infoRepository.vehicleTypeDao.getAllLiveData().observe(this, vehicleTypes -> {selectVehicleTypeAdapter.submitList(vehicleTypes);});
dataBinding.rvSelectOption.setLayoutManager(new GridLayoutManager(this,2)); dataBinding.rvSelectOption.setLayoutManager(new GridLayoutManager(this,2));
dataBinding.rvSelectOption.setAdapter(selectVehicleTypeAdapter); dataBinding.rvSelectOption.setAdapter(selectVehicleTypeAdapter);
dataBinding.btnSelectBack.setOnClickListener(view -> vehicleTypeSelected(null));//若都無選擇 則回傳自小客
dataBinding.btnSelectBack.setOnClickListener(view -> vehicleTypeSelected(null));
} }
private void vehicleTypeSelected(VehicleType vehicleType){ private void vehicleTypeSelected(VehicleType vehicleType){
......
...@@ -32,12 +32,10 @@ public class T03ListFilesActivity extends AppCompatActivity { ...@@ -32,12 +32,10 @@ public class T03ListFilesActivity extends AppCompatActivity {
private ActivityT03ListFilesBinding dataBinding; private ActivityT03ListFilesBinding dataBinding;
private CaseListAdapter caseListAdapter; private CaseListAdapter caseListAdapter;
private InfoRepository infoRepository; private InfoRepository infoRepository;
private List<CaseAndAllCasePhoto> caseAndAllCasePhotos,caseAndplateNumberCasePhotos; private List<CaseAndAllCasePhoto> caseAndAllCasePhotos;
private T01SettingViewModel t01SettingViewModel; private T01SettingViewModel t01SettingViewModel;
private ViewModelProvider viewModelProvider; private ViewModelProvider viewModelProvider;
private ActivityResultLauncher plateNumberResultLauncher; private ActivityResultLauncher plateNumberResultLauncher;
private int userId; private int userId;
private Shift shift; private Shift shift;
private String plateNumber; private String plateNumber;
...@@ -89,8 +87,6 @@ public class T03ListFilesActivity extends AppCompatActivity { ...@@ -89,8 +87,6 @@ public class T03ListFilesActivity extends AppCompatActivity {
intent.setClass(this, T02KeyInPlateNumberActivity.class); intent.setClass(this, T02KeyInPlateNumberActivity.class);
} }
plateNumberResultLauncher.launch(intent); plateNumberResultLauncher.launch(intent);
} }
private void resultLauncherRegister(){ private void resultLauncherRegister(){
plateNumberResultLauncher = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), result -> { plateNumberResultLauncher = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), result -> {
...@@ -104,7 +100,7 @@ public class T03ListFilesActivity extends AppCompatActivity { ...@@ -104,7 +100,7 @@ public class T03ListFilesActivity extends AppCompatActivity {
Bundle bundle = getIntent().getExtras(); Bundle bundle = getIntent().getExtras();
shift = bundle.getParcelable("Shift"); shift = bundle.getParcelable("Shift");
userId = bundle.getInt("UserId"); userId = bundle.getInt("UserId");
plateNumber = plt.getText().toString();; plateNumber = plt.getText().toString();
caseListAdapter = new CaseListAdapter(new CaseListAdapter.OnItemClickListener() { caseListAdapter = new CaseListAdapter(new CaseListAdapter.OnItemClickListener() {
@Override @Override
public void onCaseClick(int position) { public void onCaseClick(int position) {
...@@ -124,11 +120,11 @@ public class T03ListFilesActivity extends AppCompatActivity { ...@@ -124,11 +120,11 @@ public class T03ListFilesActivity extends AppCompatActivity {
} }
}); });
infoRepository = new InfoRepository(getApplication()); infoRepository = new InfoRepository(getApplication());
caseAndplateNumberCasePhotos = infoRepository.getAllWithCasePhotoByShitAndUserIdANDplateNumberInDay(shift, userId, plateNumber); caseAndAllCasePhotos = infoRepository.getAllWithCasePhotoByShitAndUserIdANDplateNumberInDay(shift, userId, plateNumber);
caseListAdapter.submitList(caseAndplateNumberCasePhotos); caseListAdapter.submitList(caseAndAllCasePhotos);
dataBinding.rvCaseList.setLayoutManager(new LinearLayoutManager(this)); dataBinding.rvCaseList.setLayoutManager(new LinearLayoutManager(this));
dataBinding.rvCaseList.setAdapter(caseListAdapter); dataBinding.rvCaseList.setAdapter(caseListAdapter);
caseListAdapter.notifyDataSetChanged();
} }
} }
\ No newline at end of file
...@@ -174,9 +174,7 @@ public class T01ImportDbViewModel extends AndroidViewModel { ...@@ -174,9 +174,7 @@ public class T01ImportDbViewModel extends AndroidViewModel {
case VehicleBrand: case VehicleBrand:
infoRepository.executorService.execute(() -> { infoRepository.executorService.execute(() -> {
showAlertDialogProgress.postValue(true); showAlertDialogProgress.postValue(true);
infoRepository.vehicleBrandDao.deleteAll(); infoRepository.vehicleBrandDao.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("[ ]");
int newId; int newId;
...@@ -193,9 +191,7 @@ public class T01ImportDbViewModel extends AndroidViewModel { ...@@ -193,9 +191,7 @@ public class T01ImportDbViewModel extends AndroidViewModel {
VehicleBrand newVehicleBrand = new VehicleBrand(newId, newName, newEnglishName); VehicleBrand newVehicleBrand = new VehicleBrand(newId, newName, newEnglishName);
infoRepository.vehicleBrandDao.insertAll(newVehicleBrand); infoRepository.vehicleBrandDao.insertAll(newVehicleBrand);
} }
showAlertDialogProgress.postValue(false); showAlertDialogProgress.postValue(false);
}); });
break; break;
......
...@@ -129,7 +129,6 @@ public class T01SettingViewModel extends AndroidViewModel { ...@@ -129,7 +129,6 @@ public class T01SettingViewModel extends AndroidViewModel {
settings.edit().putFloat(Common.PREF_GPS_SEARCH_RANGE, tempPREF.pref_GpsSearchRange).apply(); settings.edit().putFloat(Common.PREF_GPS_SEARCH_RANGE, tempPREF.pref_GpsSearchRange).apply();
settings.edit().putBoolean(Common.PREF_AUTO_DEDUCTION, tempPREF.pref_autoDeduction).apply(); settings.edit().putBoolean(Common.PREF_AUTO_DEDUCTION, tempPREF.pref_autoDeduction).apply();
settings.edit().putBoolean(Common.PREF_MARKIDENTIFY, tempPREF.pref_markidentify).apply();//車牌辨識 settings.edit().putBoolean(Common.PREF_MARKIDENTIFY, tempPREF.pref_markidentify).apply();//車牌辨識
} }
/* PREF get set 操作 /* PREF get set 操作
......
...@@ -443,6 +443,7 @@ public class T02StartViewModel extends AndroidViewModel { ...@@ -443,6 +443,7 @@ public class T02StartViewModel extends AndroidViewModel {
case LIST: case LIST:
currentCase.postValue(newCase()); currentCase.postValue(newCase());
caseCursor.postValue(caseCursor.getValue() + 1); caseCursor.postValue(caseCursor.getValue() + 1);
currentCase.postValue(tempCase);//1130627新增 因他們重新列印後不想清除資料
break; break;
case CHANGED: case CHANGED:
// 更新資料 // 更新資料
...@@ -836,11 +837,11 @@ public class T02StartViewModel extends AndroidViewModel { ...@@ -836,11 +837,11 @@ public class T02StartViewModel extends AndroidViewModel {
if (!isPhotoProcessed){ if (!isPhotoProcessed){
// 取得完整路徑 // 取得完整路徑
final String path = photoFile.getAbsolutePath(); final String path = photoFile.getAbsolutePath();
//1130709刪除累加時的車牌辨識
// 進行車牌辨識 // 進行車牌辨識
String plateNumber = doLPRByFilePath(path, threshold, nms_threshold); // String plateNumber = doLPRByFilePath(path, threshold, nms_threshold);
// 車牌辨識結果 車牌規則 過濾 // 車牌辨識結果 車牌規則 過濾
String newPlateNumber = plateModifyByRule(plateNumber); // String newPlateNumber = plateModifyByRule(plateNumber);
String day = new SimpleDateFormat("yyyyMMdd").format(new Date()); String day = new SimpleDateFormat("yyyyMMdd").format(new Date());
String newPath = Environment.getExternalStorageDirectory() + getApplication().getString(R.string.sysDataPhoto_path) + day; String newPath = Environment.getExternalStorageDirectory() + getApplication().getString(R.string.sysDataPhoto_path) + day;
...@@ -852,8 +853,8 @@ public class T02StartViewModel extends AndroidViewModel { ...@@ -852,8 +853,8 @@ public class T02StartViewModel extends AndroidViewModel {
String newFilePath = newFile.getAbsolutePath(); String newFilePath = newFile.getAbsolutePath();
// 添加車牌辨識 結果 // 添加車牌辨識 結果
CasePhoto newCasePhoto = new CasePhoto(0, tempCase.billingNumber2, newFilePath, newPlateNumber); // CasePhoto newCasePhoto = new CasePhoto(0, tempCase.billingNumber2, newFilePath, newPlateNumber);
tempCasePhoto.add(newCasePhoto); // tempCasePhoto.add(newCasePhoto);
// 為圖片壓制浮水印 // 為圖片壓制浮水印
Thread ModifyPhotoT = new Thread(new ModifyPhoto(path, newFilePath), "ModifyPhoto_Thread"); Thread ModifyPhotoT = new Thread(new ModifyPhoto(path, newFilePath), "ModifyPhoto_Thread");
...@@ -863,7 +864,7 @@ public class T02StartViewModel extends AndroidViewModel { ...@@ -863,7 +864,7 @@ public class T02StartViewModel extends AndroidViewModel {
MediaScannerConnection.scanFile(getApplication().getApplicationContext(), new String[]{newFilePath}, null, null); MediaScannerConnection.scanFile(getApplication().getApplicationContext(), new String[]{newFilePath}, null, null);
// 更新照片數量 // 更新照片數量
tempCase.photoCount+=1; //tempCase.photoCount+=1;
} }
// 更新當前案件 // 更新當前案件
...@@ -899,11 +900,12 @@ public class T02StartViewModel extends AndroidViewModel { ...@@ -899,11 +900,12 @@ public class T02StartViewModel extends AndroidViewModel {
}*/ }*/
caseCursor.setValue(cases.size()); caseCursor.setValue(cases.size());
if(timer != null){
// 定期60s檢查案件是否需要加時 // 定期60s檢查案件是否需要加時
hasNeedAddCase.setValue(false); hasNeedAddCase.setValue(false);
timer.schedule(new NotifyReNewTimerTask(), 0, 1000*60); timer.schedule(new NotifyReNewTimerTask(), 0, 1000*60);
} }
}
/** /**
* 註銷當前的案件 * 註銷當前的案件
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
name="blueToothViewModel" name="blueToothViewModel"
type="ecom.android.newparkapp.viewModel.BlueToothPortViewModel" /> type="ecom.android.newparkapp.viewModel.BlueToothPortViewModel" />
</data> </data>
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
android:id="@+id/t02_start_border" android:id="@+id/t02_start_border"
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -179,7 +180,7 @@ ...@@ -179,7 +180,7 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="0.47" android:layout_weight="0.47"
android:gravity="center" android:gravity="center"
android:textColor="@color/sys_RED" android:textColor="@color/ic_icon_launcher_background"
android:textSize="28sp" android:textSize="28sp"
app:date2TimeString="@{t02StartViewModel.currentCase.caseTime}" /> app:date2TimeString="@{t02StartViewModel.currentCase.caseTime}" />
...@@ -245,7 +246,8 @@ ...@@ -245,7 +246,8 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="0.47" android:layout_weight="0.47"
android:text="@{t02StartViewModel.currentCase.space.id}" android:text="@{t02StartViewModel.currentCase.space.id}"
android:textColor="@color/textColorWhite" android:textColor="@color/ic_icon_launcher_background"
android:textSize="28sp" /> android:textSize="28sp" />
<Button <Button
...@@ -254,7 +256,7 @@ ...@@ -254,7 +256,7 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="0.87" android:layout_weight="0.87"
android:text="@string/searchParkingSpace_button_text" android:text="@string/searchParkingSpace_button_text"
android:textColor="@color/red" android:textColor="@color/ic_icon_launcher_background"
android:textSize="28sp" /> android:textSize="28sp" />
</LinearLayout> </LinearLayout>
...@@ -286,6 +288,7 @@ ...@@ -286,6 +288,7 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="0.17" android:layout_weight="0.17"
android:textSize="28sp" android:textSize="28sp"
android:textColor="@color/ic_icon_launcher_background"
android:text="@{t02StartViewModel.currentCase.vehicleType.name}"/> android:text="@{t02StartViewModel.currentCase.vehicleType.name}"/>
</LinearLayout> </LinearLayout>
...@@ -316,6 +319,7 @@ ...@@ -316,6 +319,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="0.17" android:layout_weight="0.17"
android:textColor="@color/ic_icon_launcher_background"
android:text="@{t02StartViewModel.currentCase.plateNumber}" android:text="@{t02StartViewModel.currentCase.plateNumber}"
android:textSize="28sp" /> android:textSize="28sp" />
</LinearLayout> </LinearLayout>
...@@ -347,6 +351,7 @@ ...@@ -347,6 +351,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="0.17" android:layout_weight="0.17"
android:textColor="@color/ic_icon_launcher_background"
android:text="@{t02StartViewModel.currentCase.vehicleColor.name}" android:text="@{t02StartViewModel.currentCase.vehicleColor.name}"
android:textSize="28sp" /> android:textSize="28sp" />
</LinearLayout> </LinearLayout>
...@@ -378,6 +383,7 @@ ...@@ -378,6 +383,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="0.17" android:layout_weight="0.17"
android:textColor="@color/ic_icon_launcher_background"
android:text="@{t02StartViewModel.currentCase.vehicleBrand.name}" android:text="@{t02StartViewModel.currentCase.vehicleBrand.name}"
android:textSize="28sp" /> android:textSize="28sp" />
</LinearLayout> </LinearLayout>
...@@ -453,6 +459,7 @@ ...@@ -453,6 +459,7 @@
android:layout_weight="0.26" android:layout_weight="0.26"
android:text="添加照片" android:text="添加照片"
android:textSize="28sp" android:textSize="28sp"
android:textColor="@color/ic_icon_launcher_background"
tools:ignore="ButtonStyle" /> tools:ignore="ButtonStyle" />
<Button <Button
...@@ -488,7 +495,7 @@ ...@@ -488,7 +495,7 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1" android:layout_weight="1"
android:text="@string/label_print" android:text="@string/label_print"
android:textColor="@color/red" android:textColor="@color/ic_icon_launcher_background"
android:textSize="28sp" /> android:textSize="28sp" />
<LinearLayout <LinearLayout
...@@ -504,6 +511,8 @@ ...@@ -504,6 +511,8 @@
android:layout_weight="1" android:layout_weight="1"
android:text="@string/label_inventory" android:text="@string/label_inventory"
android:textSize="20sp" android:textSize="20sp"
android:textColor="@color/ic_icon_launcher_background"
tools:ignore="NestedWeights" /> tools:ignore="NestedWeights" />
<Button <Button
...@@ -512,6 +521,7 @@ ...@@ -512,6 +521,7 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1" android:layout_weight="1"
android:text="@string/pageUp_button_text" android:text="@string/pageUp_button_text"
android:textColor="@color/ic_icon_launcher_background"
android:textSize="20sp" /> android:textSize="20sp" />
</LinearLayout> </LinearLayout>
...@@ -536,6 +546,8 @@ ...@@ -536,6 +546,8 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1" android:layout_weight="1"
android:text="@string/pageDown_button_text" android:text="@string/pageDown_button_text"
android:textColor="@color/ic_icon_launcher_background"
android:textSize="20sp" /> android:textSize="20sp" />
</LinearLayout> </LinearLayout>
...@@ -545,7 +557,7 @@ ...@@ -545,7 +557,7 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1" android:layout_weight="1"
android:text="@string/photographtxt" android:text="@string/photographtxt"
android:textColor="@color/red" android:textColor="@color/ic_icon_launcher_background"
android:textSize="28sp" /> android:textSize="28sp" />
</LinearLayout> </LinearLayout>
...@@ -560,7 +572,6 @@ ...@@ -560,7 +572,6 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:enabled="false" android:enabled="false"
android:text="註銷本單" android:text="註銷本單"
android:textColor="@color/red"
android:textSize="28sp" /> android:textSize="28sp" />
<Button <Button
android:id="@+id/btn_gps_search_mode" android:id="@+id/btn_gps_search_mode"
......
...@@ -367,7 +367,7 @@ ...@@ -367,7 +367,7 @@
android:textSize="24sp" android:textSize="24sp"
android:checked="@={t01SettingViewModel.PREF.pref_autoDeduction}"/>--> android:checked="@={t01SettingViewModel.PREF.pref_autoDeduction}"/>-->
<!-- <androidx.appcompat.widget.SwitchCompat <androidx.appcompat.widget.SwitchCompat
android:id="@+id/markidentify_switch" android:id="@+id/markidentify_switch"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="45dp" android:layout_height="45dp"
...@@ -375,7 +375,7 @@ ...@@ -375,7 +375,7 @@
android:paddingEnd="0dp" android:paddingEnd="0dp"
android:text="車牌辨識" android:text="車牌辨識"
android:textSize="24sp" android:textSize="24sp"
android:checked="@={t01SettingViewModel.PREF.pref_markidentify}"/> --> android:checked="@={t01SettingViewModel.PREF.pref_markidentify}"/>
<Button <Button
android:id="@+id/importData_button" android:id="@+id/importData_button"
......
...@@ -40,5 +40,6 @@ ...@@ -40,5 +40,6 @@
tools:listitem="@layout/recycler_view_road_item" tools:listitem="@layout/recycler_view_road_item"
tools:spanCount="2" tools:spanCount="2"
tools:layoutManager="GridLayoutManager" /> tools:layoutManager="GridLayoutManager" />
</LinearLayout> </LinearLayout>
</layout> </layout>
\ No newline at end of file
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1" android:layout_weight="0.75"
android:gravity="center" android:gravity="center"
android:orientation="horizontal" android:orientation="horizontal"
android:paddingEnd="5dp" android:paddingEnd="5dp"
......
...@@ -8,21 +8,22 @@ ...@@ -8,21 +8,22 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical" android:orientation="vertical"
tools:context=".view.T02SelectVehicleBrand"> tools:context=".view.T02SelectVehicleBrand">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="0dp"
android:layout_weight="1" android:layout_weight="0.09"
android:orientation="horizontal" android:orientation="horizontal"
android:paddingStart="0dp" android:paddingStart="0dp"
android:paddingEnd="5dp"> android:paddingEnd="5dp">
<TextView <TextView
android:id="@+id/tv_select_title" android:id="@+id/tv_select_title_all"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="0.25" android:layout_weight="0.25"
android:gravity="center|center_vertical" android:gravity="center|center_vertical"
android:text="廠牌" android:text="常用廠牌"
android:textSize="30sp" /> android:textSize="30sp" />
<Button <Button
...@@ -35,19 +36,44 @@ ...@@ -35,19 +36,44 @@
</LinearLayout> </LinearLayout>
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_select_option" android:id="@+id/rv_select_option_used"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.375"
android:padding="6dp"
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
app:spanCount="2"
tools:listitem="@layout/recycler_view_vehicle_brand_item" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.09"
android:orientation="horizontal"
android:paddingStart="0dp"
android:paddingEnd="5dp">
<TextView
android:id="@+id/tv_select_title"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="0.1" android:layout_weight="1"
android:gravity="center|center_vertical"
android:text="所有廠牌"
android:textSize="30sp" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_select_option"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.375"
android:padding="6dp" android:padding="6dp"
app:layoutManager = "androidx.recyclerview.widget.GridLayoutManager" app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:spanCount="2" app:spanCount="2"
tools:listitem="@layout/recycler_view_vehicle_brand_item" /> tools:listitem="@layout/recycler_view_vehicle_brand_item" />
</LinearLayout> </LinearLayout>
</layout> </layout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"> <layout xmlns:android="http://schemas.android.com/apk/res/android">
<Button <Button
android:id="@+id/btn_select_vehicle_brand" android:id="@+id/btn_select_vehicle_brand"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="Button" android:text="Button"
android:textSize="20dp"/> android:textSize="25dp" />
</layout> </layout>
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"> <layout xmlns:android="http://schemas.android.com/apk/res/android">
<Button <Button
android:id="@+id/btn_select_vehicle_color" android:id="@+id/btn_select_vehicle_color"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="Button" android:text="Button"
android:textSize="20dp"/> android:textSize="34sp" />
</layout> </layout>
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"> <layout xmlns:android="http://schemas.android.com/apk/res/android">
<Button <Button
android:id="@+id/btn_select_vehicle_type" android:id="@+id/btn_select_vehicle_type"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="Button" android:text="Button"
android:textSize="20dp"/> android:textSize="25dp" />
</layout> </layout>
...@@ -83,4 +83,6 @@ ...@@ -83,4 +83,6 @@
<string name="ecom2024title">2024©版權所有\n昱通資訊事業股份有限公司</string> <string name="ecom2024title">2024©版權所有\n昱通資訊事業股份有限公司</string>
<string name="pootograph_new_text2">拍照/新筆</string> <string name="pootograph_new_text2">拍照/新筆</string>
<string name="photographtxt">新筆拍照</string> <string name="photographtxt">新筆拍照</string>
<string name="space_next_page">下一頁</string>
<string name="space_up_page">上一頁</string>
</resources> </resources>
\ 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