Commit bb5c5da0 authored by hywang's avatar hywang

1.性能测定页面,写死,带上扫码时的重量

2.未扫到标签提示,弹出时自动关闭上一个
3.离线登录 基础信息排序错误修复
4.
parent 104a795b
......@@ -9,8 +9,8 @@ android {
applicationId "com.phlx.anchorcollect"
minSdkVersion 21
targetSdkVersion 29
versionCode 4
versionName "1.0.3"
versionCode 6
versionName "1.0.5"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
......
......@@ -65,6 +65,8 @@ public class BasicsCollectFragment extends BaseFragment<FragmentBasicsCollectBin
private ImagePicker mImagePicker;
private MaterialDialog showEpcDialog;
private static class SingletonClassInstance {
private static final BasicsCollectFragment instance = new BasicsCollectFragment();
}
......@@ -260,7 +262,13 @@ public class BasicsCollectFragment extends BaseFragment<FragmentBasicsCollectBin
@Override
public void onChanged(List<String> stringList) {
new MaterialDialog.Builder(getActivity())
if (showEpcDialog != null) {
if (showEpcDialog.isShowing()) {//弹窗前先给上一次的取消了
showEpcDialog.dismiss();
}
showEpcDialog = null;
}
showEpcDialog = new MaterialDialog.Builder(getActivity())
.title("请选择耳标")
// .positiveText("确认")
// .negativeText("取消")
......
......@@ -373,6 +373,7 @@ public class PerformanceFragment extends BaseFragment<FragmentPerformanceBinding
viewModel.isModify = true;
viewModel.queryPerformance();
} else {
viewModel.refreshWeight();//把扫标签时的重量带过去
//清除一下数据
viewModel.isModify = false;
binding.rvCollect.getAdapter().notifyDataSetChanged();
......
......@@ -66,6 +66,8 @@ public class WeightManFragment extends BaseFragment<FragmentWeightmanBinding, We
private ImagePicker mImagePicker;
private MaterialDialog showEpcDialog;
private static class SingletonClassInstance {
private static final WeightManFragment instance = new WeightManFragment();
}
......@@ -261,7 +263,6 @@ public class WeightManFragment extends BaseFragment<FragmentWeightmanBinding, We
viewModel.onShowDialogEvent.observe(getActivity(), new Observer<String>() {
@Override
public void onChanged(String s) {
new MaterialDialog.Builder(getActivity()).title("系统提示").content(s).positiveText("确定").onAny(new MaterialDialog.SingleButtonCallback() {
@Override
public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
......@@ -277,7 +278,13 @@ public class WeightManFragment extends BaseFragment<FragmentWeightmanBinding, We
@Override
public void onChanged(List<String> stringList) {
new MaterialDialog.Builder(getActivity())
if (showEpcDialog != null) {
if (showEpcDialog.isShowing()) {//弹窗前先给上一次的取消了
showEpcDialog.dismiss();
}
showEpcDialog = null;
}
showEpcDialog = new MaterialDialog.Builder(getActivity())
.title("请选择耳标")
// .positiveText("确认")
// .negativeText("取消")
......
......@@ -96,6 +96,13 @@ public class PerformanceVM extends BaseViewModel<Repository> {
imgFile = new File(imgUrl);
for (GenTableColumn gtc : Configs.performance) {
//强制赋值为扫标签时的重量
if (gtc.getJavaField().equals("weight")) {
gtc.setShowName(Configs.tempWeight + "");
gtc.setContent(Configs.tempWeight + "");
}
CollectGridItem cgi = new CollectGridItem(this, gtc, Configs.SIGN_MEASURE);
observableList.add(cgi);
}
......@@ -112,6 +119,18 @@ public class PerformanceVM extends BaseViewModel<Repository> {
}
public void refreshWeight(){
for (GenTableColumn gtc : Configs.performance) {
//强制赋值为扫标签时的重量
if (gtc.getJavaField().equals("weight")) {
gtc.setShowName(Configs.tempWeight + "");
gtc.setContent(Configs.tempWeight + "");
}
}
}
private void initData(PerformanceEntity performanceEntity) {
remarkParamEntity.setShowName(performanceEntity.getRemark());
......@@ -146,6 +165,11 @@ public class PerformanceVM extends BaseViewModel<Repository> {
e.printStackTrace();
}
}
//强制赋值为扫标签时的重量
if (gtc.getJavaField().equals("weight")) {
gtc.setShowName(Configs.tempWeight + "");
gtc.setContent(Configs.tempWeight + "");
}
}
onNotifyAllEvent.setValue(false);
......@@ -272,7 +296,6 @@ public class PerformanceVM extends BaseViewModel<Repository> {
Configs.resumeId = null;
}
performanceEntity.setRemark(remarkParamEntity.getContent());
performanceEntity.setWeight(Configs.tempWeight);
performanceEntity.setUploadStatus("0");
uploadData = new ArrayList<>();
......
......@@ -99,7 +99,7 @@ public class WeightManVM extends BaseViewModel<Repository> implements OnInventor
public ObservableField<String> tag = new ObservableField<>("");
public ObservableField<String> rfid = new ObservableField<>("");
public ObservableField<Double> weight = new ObservableField<>(50.2);
public ObservableField<Double> weight = new ObservableField<>(0.0);
public ObservableField<Double> lastGainWeight = new ObservableField<>(0.0);//上次增重
public ObservableField<Double> adgGainWeight = new ObservableField<>(0.0);//日增重
......@@ -523,10 +523,10 @@ public class WeightManVM extends BaseViewModel<Repository> implements OnInventor
}
if (name.equals(gtc.getJavaField())) {
try {
Log.e("key:", name);
// Log.e("key:", name);
Object fieldValueByName = EntityUtils.getFieldValueByName(name, result.get(0));
String value = fieldValueByName == null ? "" : fieldValueByName.toString();
Log.e("value:", value);
// Log.e("value:", value);
gtc.setContent(value);
String showName = value;
// 如果是选择的,查字典项
......
......@@ -248,7 +248,7 @@ public class LoginVM extends BaseViewModel<Repository> {
DbUtil.getInstance().getQueryBuilder(GenTableColumn.class)
.where(GenTableColumnDao.Properties.TableId.eq(gt.getTableId())
, GenTableColumnDao.Properties.IsQuery.eq("1"))
.orderDesc(GenTableColumnDao.Properties.Sort);
.orderAsc(GenTableColumnDao.Properties.Sort);
Configs.cattleresume = DbUtil.getInstance().queryAll(GenTableColumn.class, builderDetaile0);
break;
case "zxgl_performance":
......
......@@ -67,7 +67,7 @@
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="可视耳标"
android:text="可视耳标"
android:textColor="@color/colorPrimary"
android:textSize="@dimen/sp_10" />
......
1.称重页面:时间强制默认当天
2.性能测定:写死重量从扫码页面带过来
\ 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