Commit f50688fc authored by hywang's avatar hywang

修复一些bug

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