Commit 472245d0 authored by hywang's avatar hywang

1.修复图片异常无法上传基础数据bug;

2.修复同步数据bug。
parent f9235109
...@@ -9,8 +9,8 @@ android { ...@@ -9,8 +9,8 @@ android {
applicationId "com.phlx.anchorcollect_p" applicationId "com.phlx.anchorcollect_p"
minSdkVersion 21 minSdkVersion 21
targetSdkVersion 29 targetSdkVersion 29
versionCode 14 versionCode 16
versionName "2.0.8" versionName "2.0.11"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
...@@ -45,6 +45,8 @@ android { ...@@ -45,6 +45,8 @@ android {
abortOnError false abortOnError false
} }
ndkVersion '22.1.7171670'
} }
greendao { greendao {
......
...@@ -49,7 +49,8 @@ public class RetrofitClient { ...@@ -49,7 +49,8 @@ public class RetrofitClient {
private static final int CACHE_TIMEOUT = 10 * 1024 * 1024; private static final int CACHE_TIMEOUT = 10 * 1024 * 1024;
//服务端根路径 //服务端根路径
public static String baseUrl = public static String baseUrl =
"serve.xlglmnmyzspt.org.cn"//正式 // "serve.xlglmnmyzspt.org.cn"//正式old
"serve.xlglzy.org.cn"//正式
// "39.101.170.186"//阿里云测试 // "39.101.170.186"//阿里云测试
// "192.168.8.135"//董 // "192.168.8.135"//董
// "192.168.43.154"//张敏 // "192.168.43.154"//张敏
......
...@@ -129,9 +129,9 @@ public class BasicsCollectFragment extends BaseFragment<FragmentBasicsCollectBin ...@@ -129,9 +129,9 @@ public class BasicsCollectFragment extends BaseFragment<FragmentBasicsCollectBin
if (!hidden) { if (!hidden) {
viewModel.addInventoryListener(); viewModel.addInventoryListener();
initImagePicker(); initImagePicker();
Configs.currentEvent = EventTag.EVENT_WEIGHT_DATA_BASICS;
if (!Configs.currentEvent.equals(EventTag.EVENT_WEIGHT_DATA_BASICS))//防止拍照刷新页面 if (!Configs.currentEvent.equals(EventTag.EVENT_WEIGHT_DATA_BASICS))//防止拍照刷新页面
viewModel.initDataForUnid(Configs.tempUnid); viewModel.initDataForUnid(Configs.tempUnid);
Configs.currentEvent = EventTag.EVENT_WEIGHT_DATA_BASICS;
} else { } else {
viewModel.removeInventoryListener(); viewModel.removeInventoryListener();
// Configs.currentEvent = ""; // Configs.currentEvent = "";
......
...@@ -153,6 +153,7 @@ public class BasicsCollectVM extends BaseViewModel<Repository> implements OnInve ...@@ -153,6 +153,7 @@ public class BasicsCollectVM extends BaseViewModel<Repository> implements OnInve
File externalFileRootDir = getApplication().getExternalFilesDir("/collect/picture/"); File externalFileRootDir = getApplication().getExternalFilesDir("/collect/picture/");
// externalFileRootDir.mkdirs(); // externalFileRootDir.mkdirs();
// Environment.getExternalStorageDirectory().getAbsolutePath()
String savePath = externalFileRootDir.getAbsolutePath();//不分开就少个斜杠 String savePath = externalFileRootDir.getAbsolutePath();//不分开就少个斜杠
markeImgUrl = savePath + "/anchorCiq" + Configs.tempCattleResume.getUnid() + ".jpg"; markeImgUrl = savePath + "/anchorCiq" + Configs.tempCattleResume.getUnid() + ".jpg";
markFile = new File(markeImgUrl); markFile = new File(markeImgUrl);
...@@ -413,7 +414,7 @@ public class BasicsCollectVM extends BaseViewModel<Repository> implements OnInve ...@@ -413,7 +414,7 @@ public class BasicsCollectVM extends BaseViewModel<Repository> implements OnInve
tag.set(Configs.tempTag); tag.set(Configs.tempTag);
rfid.set(Configs.tempRfid); rfid.set(Configs.tempRfid);
remarkParamEntity.setShowName(result.get(0).getRemark()); remarkParamEntity.setShowName(result.get(0).getRemark());
Configs.tempCattleResume.setPhotoPath(markeImgUrl); // Configs.tempCattleResume.setPhotoPath(markeImgUrl);
String[] filedName = EntityUtils.getFiledName(result.get(0)); String[] filedName = EntityUtils.getFiledName(result.get(0));
for (String name : filedName) { for (String name : filedName) {
......
...@@ -221,7 +221,7 @@ public class LoginVM extends BaseViewModel<Repository> { ...@@ -221,7 +221,7 @@ public class LoginVM extends BaseViewModel<Repository> {
ToastUtils.showShort("账号错误"); ToastUtils.showShort("账号错误");
return; return;
} }
if (!model.getUserName().equals(userName.get())) { if (!model.getPassword().equals(password.get())) {
ToastUtils.showShort("密码错误"); ToastUtils.showShort("密码错误");
return; return;
} }
......
<layout xmlns:android="http://schemas.android.com/apk/res/android" <layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/tools" xmlns:app="http://schemas.android.com/tools"
xmlns:binding="http://schemas.android.com/apk/res-auto" xmlns:binding="http://schemas.android.com/apk/res-auto">
app:ignore="NamespaceTypo">
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -35,6 +34,7 @@ ...@@ -35,6 +34,7 @@
<TextView <TextView
android:id="@+id/tv_rfid_text" android:id="@+id/tv_rfid_text"
onClickCommand="@{viewModel.onWeightChangedClick}"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="@dimen/dp_45" android:layout_height="@dimen/dp_45"
android:layout_marginRight="@dimen/dp_10" android:layout_marginRight="@dimen/dp_10"
...@@ -45,9 +45,7 @@ ...@@ -45,9 +45,7 @@
android:textColor="@color/black" android:textColor="@color/black"
binding:layout_constraintLeft_toLeftOf="parent" binding:layout_constraintLeft_toLeftOf="parent"
binding:layout_constraintRight_toLeftOf="@+id/iv_sync" binding:layout_constraintRight_toLeftOf="@+id/iv_sync"
binding:layout_constraintTop_toTopOf="parent" binding:layout_constraintTop_toTopOf="parent" />
onClickCommand="@{viewModel.onWeightChangedClick}"
/>
<androidx.appcompat.widget.LinearLayoutCompat <androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/ll_tag" android:id="@+id/ll_tag"
...@@ -69,7 +67,7 @@ ...@@ -69,7 +67,7 @@
android:text="可视耳标" android:text="可视耳标"
android:textColor="@color/colorPrimary" android:textColor="@color/colorPrimary"
android:textSize="@dimen/sp_16" android:textSize="@dimen/sp_16"
binding:onClickCommand="@{viewModel.onTagInputClick}"/> binding:onClickCommand="@{viewModel.onTagInputClick}" />
<androidx.appcompat.widget.AppCompatTextView <androidx.appcompat.widget.AppCompatTextView
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -81,19 +79,19 @@ ...@@ -81,19 +79,19 @@
android:textSize="@dimen/sp_18" android:textSize="@dimen/sp_18"
binding:onClickCommand="@{viewModel.onTagInputClick}" /> binding:onClickCommand="@{viewModel.onTagInputClick}" />
<!-- <androidx.appcompat.widget.AppCompatTextView--> <!-- <androidx.appcompat.widget.AppCompatTextView-->
<!-- android:layout_width="match_parent"--> <!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content"--> <!-- android:layout_height="wrap_content"-->
<!-- android:text="换绑标签"--> <!-- android:text="换绑标签"-->
<!-- android:layout_marginLeft="10dp"--> <!-- android:layout_marginLeft="10dp"-->
<!-- android:layout_marginRight="10dp"--> <!-- android:layout_marginRight="10dp"-->
<!-- android:layout_marginTop="10dp"--> <!-- android:layout_marginTop="10dp"-->
<!-- android:paddingBottom="5dp"--> <!-- android:paddingBottom="5dp"-->
<!-- android:paddingTop="5dp"--> <!-- android:paddingTop="5dp"-->
<!-- android:textColor="@color/white"--> <!-- android:textColor="@color/white"-->
<!-- android:background="@drawable/bg_button_orange_gradient"--> <!-- android:background="@drawable/bg_button_orange_gradient"-->
<!-- android:gravity="center"--> <!-- android:gravity="center"-->
<!-- binding:onClickCommand="@{viewModel.onLabelChangeClick}"/>--> <!-- binding:onClickCommand="@{viewModel.onLabelChangeClick}"/>-->
</androidx.appcompat.widget.LinearLayoutCompat> </androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat <androidx.appcompat.widget.LinearLayoutCompat
...@@ -150,8 +148,8 @@ ...@@ -150,8 +148,8 @@
android:id="@+id/card_99" android:id="@+id/card_99"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="37dp" android:layout_height="37dp"
android:layout_weight="1"
android:layout_marginLeft="5dp" android:layout_marginLeft="5dp"
android:layout_weight="1"
android:background="@drawable/bg_radius_white_5" android:background="@drawable/bg_radius_white_5"
android:onClick="@{() ->viewModel.click(99)}" android:onClick="@{() ->viewModel.click(99)}"
android:orientation="vertical" android:orientation="vertical"
......
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