修改 物料质检显示list

master
wangh 10 months ago
parent 41f399bdea
commit 6e0f0edcb7

@ -34,8 +34,7 @@
tools:targetApi="31"> tools:targetApi="31">
<activity <activity
android:name=".store.InventoryWorkActivity" android:name=".store.InventoryWorkActivity"
android:exported="true" > android:exported="true">
</activity> </activity>
@ -137,10 +136,10 @@
<activity <activity
android:name=".HomePageActivity" android:name=".HomePageActivity"
android:exported="true"> android:exported="true">
<intent-filter> <!-- <intent-filter>-->
<action android:name="android.intent.action.MAIN" /> <!-- <action android:name="android.intent.action.MAIN" />-->
<category android:name="android.intent.category.LAUNCHER" /> <!-- <category android:name="android.intent.category.LAUNCHER" />-->
</intent-filter> <!-- </intent-filter>-->
</activity> </activity>
<activity <activity
android:name=".store.MaterialOutListActivity" android:name=".store.MaterialOutListActivity"
@ -151,11 +150,10 @@
<activity <activity
android:name=".MainActivity" android:name=".MainActivity"
android:exported="true"> android:exported="true">
<intent-filter>
<!-- <intent-filter>--> <action android:name="android.intent.action.MAIN" />
<!-- <action android:name="android.intent.action.MAIN" />--> <category android:name="android.intent.category.LAUNCHER" />
<!-- <category android:name="android.intent.category.LAUNCHER" />--> </intent-filter>
<!-- </intent-filter>-->
</activity> </activity>
</application> </application>

@ -43,8 +43,8 @@ import okhttp3.MediaType;
public class BaseActivity extends AppCompatActivity { public class BaseActivity extends AppCompatActivity {
public static final int CAMERA_PHOTO = 1; public static final int CAMERA_PHOTO = 1;
public static String url = "http://175.27.215.92:7018/prod-api"; // public static String url = "http://175.27.215.92:7018/prod-api";
// public static String url = "http://10.11.40.120:7018/dev-api"; public static String url = "http://10.11.40.120:7018/dev-api";
public ProgressDialog dialog; public ProgressDialog dialog;
public Gson gson; public Gson gson;
public MediaType JSON = MediaType.parse("application/json; charset=utf-8"); public MediaType JSON = MediaType.parse("application/json; charset=utf-8");

@ -21,6 +21,7 @@ import com.example.jingyuan_mes.uitls.SharedPreferencesUtils;
import com.lzy.okgo.OkGo; import com.lzy.okgo.OkGo;
import com.lzy.okgo.model.Response; import com.lzy.okgo.model.Response;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import okhttp3.RequestBody; import okhttp3.RequestBody;
@ -38,35 +39,37 @@ public class CheckActivity extends BaseActivity {
binding.setAdapter(adapter); binding.setAdapter(adapter);
var intent = getIntent(); var intent = getIntent();
var id = intent.getStringExtra("id"); var id = intent.getStringExtra("id");
if (id!=null){ if (id != null) {
var visble = intent.getBooleanExtra("visble", true); var visble = intent.getBooleanExtra("visble", true);
binding.checkSearchLinear.setVisibility(View.GONE); binding.checkSearchLinear.setVisibility(View.GONE);
Log.e("TAG", "传值:" + visble); Log.e("TAG", "传值:" + visble);
searchRequest(null,id, visble); searchRequest(null, id, visble);
} }
} }
public void checkSubmit(View view) { public void checkSubmit(View view) {
OkGo.<MyResult>post(url+"/qms/mobile/saveCheckResultDetail") OkGo.<MyResult>post(url + "/qms/mobile/saveCheckResultDetail")
.headers("Authorization", SharedPreferencesUtils.getstring("access_token", "")) .headers("Authorization", SharedPreferencesUtils.getstring("access_token", ""))
.upRequestBody(RequestBody.create(JSON,gson.toJson(checkResult))) .upRequestBody(RequestBody.create(JSON, gson.toJson(checkResult)))
.execute(new MyRecultCall(dialog,this){ .execute(new MyRecultCall(dialog, this) {
@Override @Override
public void onSuccess(Response<MyResult> response) { public void onSuccess(Response<MyResult> response) {
super.onSuccess(response); super.onSuccess(response);
var body = response.body(); var body = response.body();
if (body.getCode()==200){ if (body.getCode() == 200) {
finish(); finish();
} }
Toast.makeText(context, body.getMsg(), Toast.LENGTH_SHORT).show(); Toast.makeText(context, body.getMsg(), Toast.LENGTH_SHORT).show();
} }
}); });
} }
public void checkSearch(View view) { public void checkSearch(View view) {
var serchText = binding.checkSearchText.getText().toString(); var serchText = binding.checkSearchText.getText().toString();
searchRequest(serchText,null,true); searchRequest(serchText, null, true);
} }
private void searchRequest(String serchText,String id,boolean status){
private void searchRequest(String serchText, String id, boolean status) {
OkGo.<MyResult>get(url + "/qms/mobile/getCheckResultDetail") OkGo.<MyResult>get(url + "/qms/mobile/getCheckResultDetail")
.headers("Authorization", SharedPreferencesUtils.getstring("access_token", "")) .headers("Authorization", SharedPreferencesUtils.getstring("access_token", ""))
.params("materialBarcode", serchText) .params("materialBarcode", serchText)
@ -81,13 +84,25 @@ public class CheckActivity extends BaseActivity {
checkResult = gson.fromJson(body.getData().toString(), CheckResult.class); checkResult = gson.fromJson(body.getData().toString(), CheckResult.class);
checkResult.setVisbleStatus(status); checkResult.setVisbleStatus(status);
binding.setVm(checkResult); binding.setVm(checkResult);
var qmsCheckResultDetailProjectList = checkResult.getQmsCheckResultDetailProjectList(); List<CheckResultDetal> qmsCheckResultDetailProjectList;
if (qmsCheckResultDetailProjectList==null || qmsCheckResultDetailProjectList.isEmpty()) return;
qmsCheckResultDetailProjectList = checkResult.getQmsCheckResultDetailProjectList();
if (qmsCheckResultDetailProjectList == null || qmsCheckResultDetailProjectList.isEmpty()) {
qmsCheckResultDetailProjectList = new ArrayList<>();
var qmsCheckRuleProjectList = checkResult.getQmsCheckRuleProjectList();
qmsCheckResultDetailProjectList.addAll(qmsCheckRuleProjectList);
}
adapter.setList(qmsCheckResultDetailProjectList); adapter.setList(qmsCheckResultDetailProjectList);
adapter.notifyDataSetChanged(); adapter.notifyDataSetChanged();
return;
} else {
binding.setVm(null);
adapter.setList(null);
adapter.notifyDataSetChanged();
Toast.makeText(CheckActivity.this, body.getMsg(), Toast.LENGTH_SHORT).show();
} }
Toast.makeText(CheckActivity.this, body.getMsg(), Toast.LENGTH_SHORT).show();
} }
}); });
} }

@ -77,6 +77,16 @@ public class CheckResult extends BaseObservable {
} }
private List<CheckResultDetal> qmsCheckResultDetailProjectList; private List<CheckResultDetal> qmsCheckResultDetailProjectList;
private List<CheckResultDetal> qmsCheckRuleProjectList;
public List<CheckResultDetal> getQmsCheckRuleProjectList() {
return qmsCheckRuleProjectList;
}
public void setQmsCheckRuleProjectList(List<CheckResultDetal> qmsCheckRuleProjectList) {
this.qmsCheckRuleProjectList = qmsCheckRuleProjectList;
}
/** /**
* *
*/ */
@ -183,6 +193,7 @@ public class CheckResult extends BaseObservable {
} }
public String getCheckStatus() { public String getCheckStatus() {
if (checkStatus==null) return "";
switch (checkStatus) { switch (checkStatus) {
case "0": case "0":
setCheckStatus("待检验"); setCheckStatus("待检验");

@ -42,9 +42,10 @@ public class InventoryTaskCreateActivity extends BaseActivity implements Adapter
private InventoryLocationAdapter adapter; private InventoryLocationAdapter adapter;
private List<HouseLocation> list; private List<HouseLocation> list;
private Map<String, Object> map; private Map<String, Object> map;
private int pageNum=1; private int pageNum = 1;
private int warehouseId; private int warehouseId;
private Intent intent; private Intent intent;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
@ -61,13 +62,13 @@ public class InventoryTaskCreateActivity extends BaseActivity implements Adapter
lpw.setOnItemClickListener(this); lpw.setOnItemClickListener(this);
var intent = getIntent(); var intent = getIntent();
var inventoryCheckId = intent.getIntExtra("inventoryCheckId", -1); var inventoryCheckId = intent.getIntExtra("inventoryCheckId", -1);
map.put("inventoryCheckId", inventoryCheckId==-1?null:inventoryCheckId); map.put("inventoryCheckId", inventoryCheckId == -1 ? null : inventoryCheckId);
warehouseId = intent.getIntExtra("warehouseId", 0); warehouseId = intent.getIntExtra("warehouseId", 0);
if (warehouseId == 0) { if (warehouseId == 0) {
initRequest(); initRequest();
} else { } else {
var warehouseName = intent.getStringExtra("warehouseName"); var warehouseName = intent.getStringExtra("warehouseName");
createLocation(warehouseId,warehouseName); createLocation(warehouseId, warehouseName);
} }
} }
@ -101,19 +102,20 @@ public class InventoryTaskCreateActivity extends BaseActivity implements Adapter
var warehouseBeen = warehouseBeenList.get(position); var warehouseBeen = warehouseBeenList.get(position);
warehouseId = warehouseBeen.getWarehouseId(); warehouseId = warehouseBeen.getWarehouseId();
lpw.dismiss(); lpw.dismiss();
pageNum=1; pageNum = 1;
createLocation(warehouseId, warehouseBeen.getWarehouseName()); createLocation(warehouseId, warehouseBeen.getWarehouseName());
} }
// 请求库位 // 请求库位
private void createLocation(int warehouseId,String warehouseName) { private void createLocation(int warehouseId, String warehouseName) {
binding.inventoryCreateHouse.setText(warehouseName); binding.inventoryCreateHouse.setText(warehouseName);
map.put("warehouseId", warehouseId); map.put("warehouseId", warehouseId);
OkGo.<MyResult>get(url + "/wms/mobile/getLocations").tag(this) OkGo.<MyResult>get(url + "/wms/mobile/getLocations").tag(this)
.headers("Authorization", SharedPreferencesUtils.getstring("access_token", "")) .headers("Authorization", SharedPreferencesUtils.getstring("access_token", ""))
.params("warehouseId", warehouseId) .params("warehouseId", warehouseId)
.params("pageNum",pageNum) .params("pageNum", pageNum)
.params("pagesize",10) .params("pagesize", 10)
.execute(new MyRecultCall(dialog, this) { .execute(new MyRecultCall(dialog, this) {
@SuppressLint("NotifyDataSetChanged") @SuppressLint("NotifyDataSetChanged")
@Override @Override
@ -135,6 +137,7 @@ public class InventoryTaskCreateActivity extends BaseActivity implements Adapter
public void inventorySelectHouse(View view) { public void inventorySelectHouse(View view) {
lpw.show(); lpw.show();
} }
// 创建任务 提交 // 创建任务 提交
public void inventoryCreateSubmit(View view) { public void inventoryCreateSubmit(View view) {
List<String> submitList = new ArrayList<>(); List<String> submitList = new ArrayList<>();
@ -155,7 +158,7 @@ public class InventoryTaskCreateActivity extends BaseActivity implements Adapter
var body = response.body(); var body = response.body();
if (body.getCode() == 200) { if (body.getCode() == 200) {
intent.putExtra("inventoryCheckId",(int)Double.parseDouble(body.getData().toString())); intent.putExtra("inventoryCheckId", (int) Double.parseDouble(body.getData().toString()));
// intent.putExtra("checkStatus",); // intent.putExtra("checkStatus",);
startActivity(intent); startActivity(intent);
finish(); finish();
@ -169,6 +172,6 @@ public class InventoryTaskCreateActivity extends BaseActivity implements Adapter
public void onLoadMore(@NonNull RefreshLayout refreshLayout) { public void onLoadMore(@NonNull RefreshLayout refreshLayout) {
pageNum++; pageNum++;
// createLocation(); // createLocation();
Log.e("TAG", "onLoadMore" ); Log.e("TAG", "onLoadMore");
} }
} }

@ -103,13 +103,16 @@ public class InventoryWorkActivity extends BaseActivity implements TabLayout.OnT
public void onClick(int position) { public void onClick(int position) {
var inventoryWorkBeen = list.get(position); var inventoryWorkBeen = list.get(position);
OkGo.<MyResult>post(url + "/wms/mobile/confirmInventoryCheckDetail").headers("Authorization", SharedPreferencesUtils.getstring("access_token", "")).upRequestBody(RequestBody.create(JSON, gson.toJson(inventoryWorkBeen))).execute(new MyRecultCall(dialog, this) { OkGo.<MyResult>post(url + "/wms/mobile/confirmInventoryCheckDetail").headers("Authorization", SharedPreferencesUtils.getstring("access_token", "")).upRequestBody(RequestBody.create(JSON, gson.toJson(inventoryWorkBeen))).execute(new MyRecultCall(dialog, this) {
@SuppressLint("NotifyDataSetChanged")
@Override @Override
public void onSuccess(Response<MyResult> response) { public void onSuccess(Response<MyResult> response) {
super.onSuccess(response); super.onSuccess(response);
var body = response.body(); var body = response.body();
// if (body.getCode() == 200) { if (body.getCode() == 200) {
// var inventoryTime = inventoryWorkBeen.getInventoryTime();
// } inventoryWorkBeen.setInventoryTime(inventoryTime++);
adapter.notifyDataSetChanged();
}
Toast.makeText(context, body.getMsg(), Toast.LENGTH_SHORT).show(); Toast.makeText(context, body.getMsg(), Toast.LENGTH_SHORT).show();
} }
}); });

@ -63,14 +63,14 @@
app:srlEnableRefresh="false" app:srlEnableRefresh="false"
> >
<!-- app:srlEnableLoadMoreWhenContentNotFull="false"--> <!-- -->
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:adapter="@{adapter}" android:adapter="@{adapter}"
android:background="@color/white" android:background="@color/white"
android:overScrollMode="never" android:overScrollMode="never"
android:padding="5dp" android:padding="5dp" app:srlEnableLoadMoreWhenContentNotFull="false"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" /> app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
<com.scwang.smart.refresh.footer.ClassicsFooter <com.scwang.smart.refresh.footer.ClassicsFooter

@ -10,84 +10,84 @@
</data> </data>
<LinearLayout <LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity"
android:background="@color/white"
android:orientation="vertical">
<ImageView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="100dp"
tools:context=".MainActivity" android:layout_marginTop="50dp"
android:background="@color/white" android:src="@drawable/logo"/>
android:orientation="vertical">
<ImageView
android:layout_width="match_parent"
android:layout_height="100dp"
android:layout_marginTop="50dp"
android:src="@drawable/logo"/>
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="45dp" android:layout_height="45dp"
android:layout_marginLeft="20dp" android:layout_marginLeft="20dp"
android:gravity="left|center" android:gravity="left|center"
android:text="登录MES" android:text="登录MES"
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="22sp" /> android:textSize="22sp" />
<com.google.android.material.textfield.TextInputLayout <com.google.android.material.textfield.TextInputLayout
android:id="@+id/textInputLayout" android:id="@+id/textInputLayout"
android:layout_width="match_parent"
android:layout_height="55dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="20dp"
android:layout_marginRight="20dp"
android:hint="用户名">
<EditText
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="55dp" android:layout_height="match_parent"
android:layout_marginLeft="20dp" android:text="@={user.username}" />
android:layout_marginTop="20dp"
android:layout_marginRight="20dp"
android:hint="用户名">
<EditText </com.google.android.material.textfield.TextInputLayout>
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@={user.username}" />
</com.google.android.material.textfield.TextInputLayout> <com.google.android.material.textfield.TextInputLayout
android:id="@+id/textInputLayout2"
android:layout_width="match_parent"
android:layout_height="55dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="15dp"
android:layout_marginRight="20dp"
android:hint="密码"
app:passwordToggleEnabled="true">
<com.google.android.material.textfield.TextInputLayout <EditText
android:id="@+id/textInputLayout2"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="55dp" android:layout_height="match_parent"
android:layout_marginLeft="20dp" android:inputType="textPassword"
android:layout_marginTop="15dp" android:layout_gravity="center"
android:layout_marginRight="20dp" android:imeOptions="actionDone"
android:hint="密码" android:text="@={user.password}" />
app:passwordToggleEnabled="true">
<EditText </com.google.android.material.textfield.TextInputLayout>
android:layout_width="match_parent"
android:layout_height="match_parent"
android:inputType="textPassword"
android:layout_gravity="center"
android:imeOptions="actionDone"
android:text="@={user.password}" />
</com.google.android.material.textfield.TextInputLayout> <CheckBox
android:layout_width="match_parent"
<CheckBox android:layout_height="wrap_content"
android:layout_width="match_parent" android:layout_marginLeft="20dp"
android:layout_height="wrap_content" android:layout_marginTop="10dp"
android:layout_marginLeft="20dp" android:layout_marginRight="20dp"
android:layout_marginTop="10dp" android:checked="@={user.remember}"
android:layout_marginRight="20dp" android:text="记住我" />
android:checked="@={user.remember}"
android:text="记住我" />
<Button <Button
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="55dp" android:layout_height="55dp"
android:layout_marginLeft="20dp" android:layout_marginLeft="20dp"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:letterSpacing="1" android:letterSpacing="1"
android:text="登录" android:text="登录"
android:textSize="20sp" android:textSize="20sp"
android:textStyle="bold" android:textStyle="bold"
android:onClick="login_click" /> android:onClick="login_click" />
</LinearLayout> </LinearLayout>
</layout> </layout>
Loading…
Cancel
Save