Commit 8f909f84 authored by 陳煦元's avatar 陳煦元

V3.0.1

parent cb1410bf
......@@ -10,7 +10,7 @@ android {
minSdk 27
targetSdk 30
versionCode 1
versionName "Dev Ver.3.0.0(無車辨)"
versionName "Dev Ver.3.0.1(無車辨)"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
......
......@@ -12,7 +12,7 @@
"filters": [],
"attributes": [],
"versionCode": 1,
"versionName": "Dev Ver.3.0.0(無車辨)",
"versionName": "Dev Ver.3.0.1(無車辨)",
"outputFile": "app-release.apk"
}
],
......
......@@ -71,6 +71,10 @@ public interface CaseDao {
@Query("SELECT * FROM `case` WHERE billingNumber2 IN (:billingNumber2s)")
List<Case> loadAllByIds(String[] billingNumber2s);
@Query("SELECT * FROM `case` WHERE billingNumber2 = :newbillingNumber2 ")
int caseExists(String newbillingNumber2);
@Insert
void insertAll(Case... cases);
......
......@@ -469,8 +469,17 @@ public class T02StartActivity extends AppCompatActivity {
if (photoFile == null) {
return;
}
//tempCase.caseStatus = CaseStatus.CHANGED;
if(t02StartViewModel.getCurrentCase().getValue().caseStatus !=CaseStatus.NEW)
{
t02StartViewModel.addNewPhotos(photoFile);
}
else
{
Toast.makeText(this, "請於成功開單後再添加照片", Toast.LENGTH_LONG).show();
}
}
});
vehicleColorResultLauncher = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), result -> {
......@@ -1056,8 +1065,6 @@ public class T02StartActivity extends AppCompatActivity {
t02StartViewModel.saveCurrentCase(false);
dataBinding.btnCancelbill.setEnabled(true);
closedatachange();
}else {
Toast.makeText(this, "請先確認資料後再列印", Toast.LENGTH_LONG).show();
return;
......@@ -1083,7 +1090,6 @@ public class T02StartActivity extends AppCompatActivity {
Toast.makeText(this, "請先連結藍芽印表機裝置", Toast.LENGTH_SHORT).show();
return;
}
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("是否重新列印");
builder.setNegativeButton("否", new DialogInterface.OnClickListener() {
......@@ -1101,7 +1107,6 @@ public class T02StartActivity extends AppCompatActivity {
blueToothViewModel.printCase(finalTempCase);
}
});
builder.create().show();
}
}
......
......@@ -413,9 +413,10 @@ public class T02StartViewModel extends AndroidViewModel {
switch (tempCase.caseStatus){
case NEW:
infoRepository.executorService.execute(() -> {
// 检查案件是否已存在 否則新增案件
// if (infoRepository.caseDao.caseExists(tempCase.billingNumber2)>0) {}
tempCase.caseStatus = CaseStatus.LIST;
infoRepository.caseDao.insertAll(tempCase);
for (int i = 0 ; i < tempCasePhoto.size(); i++){
infoRepository.casePhotoDao.insertAll(tempCasePhoto.get(i));
}
......@@ -436,6 +437,7 @@ public class T02StartViewModel extends AndroidViewModel {
// 加入清單
cases.add(tempCase);
caseCursor.postValue(caseCursor.getValue() + 1);
});
break;
case LIST:
......@@ -600,13 +602,18 @@ public class T02StartViewModel extends AndroidViewModel {
if (tempCase.caseStatus != CaseStatus.NEW) {
tempCase.caseStatus = CaseStatus.CHANGED;
}
currentCase.setValue(tempCase);
}
public void addNewPhotos(File photoFile){
Case tempCase = currentCase.getValue();
//tempCase.caseStatus = CaseStatus.CHANGED;
if(tempCase.caseStatus!=CaseStatus.NEW)
{
setNewCasePhoto(photoFile);
saveCurrentCase(false);
saveCurrentCase(false);//0524
}
}
......@@ -925,7 +932,6 @@ public class T02StartViewModel extends AndroidViewModel {
String plateNumber = "";
Bitmap bitmap = BitmapFactory.decodeFile(filePath);
bitmap = Common.turnPictureDegree(bitmap, filePath);
byte[] imageDataBytes = bitampToByteArray(bitmap);
BoxInfo[] boxInfos = null;
boxInfos = EcomALPR.retinaplate_detect(bitmap, imageDataBytes, bitmap.getWidth(), bitmap.getHeight(), threshold, nms_threshold);
......
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