修改 巡检

master
wanghao 3 months ago
parent 3cc3ea1443
commit 66f811b5de

@ -10,8 +10,8 @@ android {
applicationId "com.example.beijing_daxing" applicationId "com.example.beijing_daxing"
minSdk 24 minSdk 24
targetSdk 33 targetSdk 33
versionCode 2 versionCode 4
versionName "1.2" versionName "1.4"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
ndk { ndk {

@ -159,7 +159,7 @@ public class CheckActivity extends BaseActivity implements AdapterClickCall, InP
// var type = list.stream().anyMatch(t -> t.getState().equals("未检")); // var type = list.stream().anyMatch(t -> t.getState().equals("未检"));
// if (type) { // if (type) {
// 数量必须相同 // 数量必须相同
if (list.size()>list1.size()) { if (list.size()>list1.size()&&files.size()==0) {
Toast.makeText(this, "未检完全部轮挡,不允许提交", Toast.LENGTH_SHORT).show(); Toast.makeText(this, "未检完全部轮挡,不允许提交", Toast.LENGTH_SHORT).show();
return; return;
} }
@ -167,6 +167,7 @@ public class CheckActivity extends BaseActivity implements AdapterClickCall, InP
.params("json", gson.toJson(list1)) .params("json", gson.toJson(list1))
.params("inspectionId", inspectionId) .params("inspectionId", inspectionId)
.params("user", SharedPreferencesUtils.getstring("user", "")) .params("user", SharedPreferencesUtils.getstring("user", ""))
.params("locationCode",code)
.addFileParams("files", files).execute(new MyRecultCall(dialog, this) { .addFileParams("files", files).execute(new MyRecultCall(dialog, this) {
@Override @Override
public void onSuccess(Response<MyResult> response) { public void onSuccess(Response<MyResult> response) {

@ -66,44 +66,40 @@ public class CheckListActivity extends BaseActivity implements CheckListAdapter.
} }
private void initRequest(String state) { private void initRequest(String state) {
OkGo.<MyResult>post(url + "/inspection/selectTask") OkGo.<MyResult>post(url + "/inspection/selectTask").params("state", state).execute(new MyRecultCall(dialog, this) {
.params("state", state) @SuppressLint("NotifyDataSetChanged")
.execute(new MyRecultCall(dialog, this) { @Override
@SuppressLint("NotifyDataSetChanged") public void onSuccess(Response<MyResult> response) {
@Override super.onSuccess(response);
public void onSuccess(Response<MyResult> response) { MyResult body = response.body();
super.onSuccess(response); if (body.getCode() == 0) {
MyResult body = response.body(); createState.set(false);
if (body.getCode() == 0) { list = gson.fromJson(body.getData().toString(), new TypeToken<List<CheckTaskInfo>>() {
createState.set(false); }.getType());
list = gson.fromJson(body.getData().toString(), new TypeToken<List<CheckTaskInfo>>() { adapter.setList(list);
}.getType()); adapter.notifyDataSetChanged();
adapter.setList(list); } else {
adapter.notifyDataSetChanged(); createState.set(true);
} else { }
createState.set(true);
} }
});
}
});
} }
public void check_start(View view) { public void check_start(View view) {
OkGo.<MyResult>post(url + "/xj/createTask") OkGo.<MyResult>post(url + "/xj/createTask").params("user", SharedPreferencesUtils.getstring("user", "")).execute(new MyRecultCall(dialog, this) {
.params("user", SharedPreferencesUtils.getstring("user", "")) @Override
.execute(new MyRecultCall(dialog, this) { public void onSuccess(Response<MyResult> response) {
@Override super.onSuccess(response);
public void onSuccess(Response<MyResult> response) { var body = response.body();
super.onSuccess(response); if (body.getCode() == 0) {
var body = response.body(); // initRequest();
if (body.getCode() == 0) { return;
// initRequest(); }
return; Toast.makeText(CheckListActivity.this, body.getMsg(), Toast.LENGTH_SHORT).show();
} }
Toast.makeText(CheckListActivity.this, body.getMsg(), Toast.LENGTH_SHORT).show(); });
}
});
} }
@Override @Override
@ -116,10 +112,12 @@ public class CheckListActivity extends BaseActivity implements CheckListAdapter.
intent.putExtra("backIndex", index); intent.putExtra("backIndex", index);
startActivityForResult(intent, 1); startActivityForResult(intent, 1);
} }
private int skipIndex;
private int skipIndex;
@Override @Override
public void clickItemSkip(int index) { public void clickItemSkip(int index) {
skipIndex=index; skipIndex = index;
inputDialog.show(); inputDialog.show();
} }
@ -140,22 +138,19 @@ private int skipIndex;
@Override @Override
public void inPutDialogReculi(String name) { public void inPutDialogReculi(String name) {
CheckTaskInfo checkTaskInfo = list.get(skipIndex); CheckTaskInfo checkTaskInfo = list.get(skipIndex);
OkGo.<MyResult>post(url + "/inspection/skipTask") OkGo.<MyResult>post(url + "/inspection/skipTask").params("remark", name).params("tableId", checkTaskInfo.getId()).execute(new MyRecultCall(dialog, this) {
.params("remark", name) @SuppressLint("NotifyDataSetChanged")
.params("tableId", checkTaskInfo.getId()) @Override
.execute(new MyRecultCall(dialog, this) { public void onSuccess(Response<MyResult> response) {
@SuppressLint("NotifyDataSetChanged") super.onSuccess(response);
@Override MyResult body = response.body();
public void onSuccess(Response<MyResult> response) { if (body.getCode() == 0) {
super.onSuccess(response); checkTaskInfo.setTaskState("跳过");
MyResult body = response.body(); adapter.notifyDataSetChanged();
if (body.getCode() == 0) { }
checkTaskInfo.setTaskState("跳过");
adapter.notifyDataSetChanged(); }
} });
}
});
inputDialog.dismiss(); inputDialog.dismiss();
} }
} }

@ -207,7 +207,7 @@ public class BaseActivity extends AppCompatActivity {
Paint paint = new Paint(); Paint paint = new Paint();
paint.setColor(Color.RED); paint.setColor(Color.RED);
paint.setStrokeWidth(30); paint.setStrokeWidth(30);
paint.setTextSize(150); paint.setTextSize(85);
paint.setAntiAlias(true); paint.setAntiAlias(true);
// 获取当前日期 // 获取当前日期
LocalDate today = LocalDate.now(ZoneId.systemDefault()); LocalDate today = LocalDate.now(ZoneId.systemDefault());

Loading…
Cancel
Save