Commit f50688fc authored by hywang's avatar hywang

修复一些bug

parent 80c4a802
......@@ -8,8 +8,8 @@ android {
applicationId "com.phlx.wool"
minSdkVersion 21
targetSdkVersion 29
versionCode 13
versionName "1.1.3"
versionCode 14
versionName "1.1.4"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
......
......@@ -116,8 +116,7 @@ public class LoginVM extends BackBarVM<Repository> {
if (checkPerson(userName.get(), password.get()))
return;
String postInfoStr = new Gson().toJson(new UserParams(userName.get(), password.get()));
RequestBody body = RequestBody.create(MediaType.parse("application/json; charset=utf-8"),
postInfoStr);
RequestBody body = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), postInfoStr);
addSubscribe(model.loginPost(body)
.compose(RxUtils.bindToLifecycle(getLifecycleProvider()))
.compose(RxUtils.schedulersTransformer())
......
......@@ -85,7 +85,7 @@ public class MainActivity extends BaseActivity<ActivityMainBinding, MainVM> {
public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
if (which == DialogAction.POSITIVE) {
ModuleManager.destroyLibSO();
finish();
// finish();
android.os.Process.killProcess(android.os.Process.myPid());
}
}
......
......@@ -128,6 +128,7 @@ public class VillusBuyVM extends BackBarVM<Repository> {
public BindingCommand onBuyDateClick = new BindingCommand(() -> buyDay.call());
public void setBuyDate(Date date) {
dateFormat = new SimpleDateFormat("yyyy-MM-dd");
entity.setBuyDate(dateFormat.format(date));
entity.notifyChange();
}
......@@ -192,6 +193,7 @@ public class VillusBuyVM extends BackBarVM<Repository> {
uploadData = new ArrayList<>();
entity.setId(id);
entity.setCreateBy(SPUtils.getInstance().getString(Configs.SP_LOGIN_NAME));
dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
entity.setCreateTime(dateFormat.format(new Date()));
entity.setStatus(1);
entity.setProductId(StringUtil.to32String(IdUtil.createSnowflake(3, 1).nextId()));
......
......@@ -82,6 +82,7 @@ public class VillusGaugeVM extends BackBarVM<Repository> {
public BindingCommand onGaugeDateClick = new BindingCommand(() -> gaugeDay.call());
public void setGaugeDate(Date date) {
dateFormat = new SimpleDateFormat("yyyy-MM-dd");
entity.setMeasuringTime(dateFormat.format(date));
entity.notifyChange();
}
......@@ -128,6 +129,7 @@ public class VillusGaugeVM extends BackBarVM<Repository> {
uploadData = new ArrayList<>();
entity.setId(id);
entity.setCreateBy(SPUtils.getInstance().getString(Configs.SP_LOGIN_NAME));
dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
entity.setCreateTime(dateFormat.format(new Date()));
entity.setStatus(1);
uploadData.add(entity);
......
......@@ -88,16 +88,19 @@ public class HarmlessVM extends BackBarVM<Repository> {
public BindingCommand onVeterinaryNameClick = new BindingCommand(() -> showSearch.call());
public void setOnsetTime(Date date) {
dateFormat = new SimpleDateFormat("yyyy-MM-dd");
entity.setOnsetTime(dateFormat.format(date));
entity.notifyChange();
}
public void setDeathTime(Date date) {
dateFormat = new SimpleDateFormat("yyyy-MM-dd");
entity.setDeathTime(dateFormat.format(date));
entity.notifyChange();
}
public void setTreatmentTime(Date date) {
dateFormat = new SimpleDateFormat("yyyy-MM-dd");
entity.setTreatmentTime(dateFormat.format(date));
entity.notifyChange();
}
......@@ -134,6 +137,7 @@ public class HarmlessVM extends BackBarVM<Repository> {
entity.setManagerName(SPUtils.getInstance().getString(Configs.SP_UNIT_NAME));
entity.setManagerCode(SPUtils.getInstance().getString(Configs.SP_UNIT_CODE));
entity.setCreateBy(SPUtils.getInstance().getString(Configs.SP_LOGIN_NAME));
dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
entity.setCreateTime(dateFormat.format(new Date(System.currentTimeMillis())));
entity.setStatus(1);
parentId = DbUtil.getInstance().insertOrReplace(entity);
......@@ -147,6 +151,7 @@ public class HarmlessVM extends BackBarVM<Repository> {
harmlessDetail.setTwodimensionno(labels.get(i).getTwodimensionno());
harmlessDetail.setReceivingUnit(labels.get(i).getReceivingUnit());
harmlessDetail.setCreateBy(SPUtils.getInstance().getString(Configs.SP_LOGIN_NAME));
dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
harmlessDetail.setCreateTime(dateFormat.format(new Date(System.currentTimeMillis())));
detailList.add(harmlessDetail);
}
......
......@@ -119,6 +119,7 @@ public class MarkingVM extends BackBarVM<Repository> {
public BindingCommand onVeterinaryNameClick = new BindingCommand(() -> showSearch.call());
public void setBirthTime(Date date) {
dateFormat = new SimpleDateFormat("yyyy-MM-dd");
String dateStr = dateFormat.format(date);
entity.setBirthTime(dateStr.substring(0, dateStr.length() - 3));
entity.notifyChange();
......@@ -179,6 +180,7 @@ public class MarkingVM extends BackBarVM<Repository> {
marking.setVeterinaryName(entity.getVeterinaryName());
marking.setManagerCode(entity.getManagerCode());
marking.setManagerName(entity.getManagerName());
dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
marking.setCreateTime(dateFormat.format(new Date(System.currentTimeMillis())));
marking.setCreateBy(SPUtils.getInstance().getString(Configs.SP_LOGIN_NAME));
uploadData.add(marking);
......@@ -212,8 +214,7 @@ public class MarkingVM extends BackBarVM<Repository> {
new GsonBuilder().serializeNulls()
// .excludeFieldsWithoutExposeAnnotation()
.create().toJson(new UploadParams<List<Marking>>(uploadData));
RequestBody body = RequestBody.create(MediaType.parse("application/json; charset=utf-8"),
postInfoStr);
RequestBody body = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), postInfoStr);
KLog.e(postInfoStr);
addSubscribe(model.submitMarking(body)
.compose(RxUtils.bindToLifecycle(getLifecycleProvider()))
......
......@@ -101,12 +101,13 @@ public class QuarantineVM extends BackBarVM<Repository> {
public void setQuarantineTime(Date date) {
dateFormat = new SimpleDateFormat("yyyy-MM-dd");
entity.setQuarantineTime(dateFormat.format(date));
entity.notifyChange();
}
public void setImmunityTime(Date date) {
dateFormat = new SimpleDateFormat("yyyy-MM-dd");
entity.setImmuneDate(dateFormat.format(date));
entity.notifyChange();
}
......@@ -130,6 +131,7 @@ public class QuarantineVM extends BackBarVM<Repository> {
entity.setManagerCode(SPUtils.getInstance().getString(Configs.SP_UNIT_CODE));
entity.setManagerPhone(SPUtils.getInstance().getString(Configs.SP_UNIT_PHONE));
entity.setCreateBy(SPUtils.getInstance().getString(Configs.SP_LOGIN_NAME));
dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
entity.setCreateTime(dateFormat.format(new Date(System.currentTimeMillis())));
entity.setStatus(1);
parentId = DbUtil.getInstance().insertOrReplace(entity);
......@@ -144,6 +146,7 @@ public class QuarantineVM extends BackBarVM<Repository> {
quarantineDetail.setTwodimensionno(labels.get(i).getTwodimensionno());
quarantineDetail.setReceivingUnit(labels.get(i).getReceivingUnit());
quarantineDetail.setCreateBy(SPUtils.getInstance().getString(Configs.SP_LOGIN_NAME));
dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
quarantineDetail.setCreateTime(dateFormat.format(new Date(System.currentTimeMillis())));
detailList.add(quarantineDetail);
}
......
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