修改 巡检

master
wanghao 3 months ago
parent 3cc3ea1443
commit 66f811b5de

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

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

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

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

Loading…
Cancel
Save