Commit 472245d0 authored by hywang's avatar hywang

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

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