修改 物料质检显示list

master
wangh 10 months ago
parent 41f399bdea
commit 6e0f0edcb7

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

@ -43,8 +43,8 @@ import okhttp3.MediaType;
public class BaseActivity extends AppCompatActivity {
public static final int CAMERA_PHOTO = 1;
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://175.27.215.92:7018/prod-api";
public static String url = "http://10.11.40.120:7018/dev-api";
public ProgressDialog dialog;
public Gson gson;
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.model.Response;
import java.util.ArrayList;
import java.util.List;
import okhttp3.RequestBody;
@ -38,35 +39,37 @@ public class CheckActivity extends BaseActivity {
binding.setAdapter(adapter);
var intent = getIntent();
var id = intent.getStringExtra("id");
if (id!=null){
if (id != null) {
var visble = intent.getBooleanExtra("visble", true);
binding.checkSearchLinear.setVisibility(View.GONE);
Log.e("TAG", "传值:" + visble);
searchRequest(null,id, visble);
searchRequest(null, id, visble);
}
}
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", ""))
.upRequestBody(RequestBody.create(JSON,gson.toJson(checkResult)))
.execute(new MyRecultCall(dialog,this){
.upRequestBody(RequestBody.create(JSON, gson.toJson(checkResult)))
.execute(new MyRecultCall(dialog, this) {
@Override
public void onSuccess(Response<MyResult> response) {
super.onSuccess(response);
var body = response.body();
if (body.getCode()==200){
if (body.getCode() == 200) {
finish();
}
Toast.makeText(context, body.getMsg(), Toast.LENGTH_SHORT).show();
}
});
}
public void checkSearch(View view) {
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")
.headers("Authorization", SharedPreferencesUtils.getstring("access_token", ""))
.params("materialBarcode", serchText)
@ -81,13 +84,25 @@ public class CheckActivity extends BaseActivity {
checkResult = gson.fromJson(body.getData().toString(), CheckResult.class);
checkResult.setVisbleStatus(status);
binding.setVm(checkResult);
var qmsCheckResultDetailProjectList = checkResult.getQmsCheckResultDetailProjectList();
if (qmsCheckResultDetailProjectList==null || qmsCheckResultDetailProjectList.isEmpty()) return;
List<CheckResultDetal> qmsCheckResultDetailProjectList;
qmsCheckResultDetailProjectList = checkResult.getQmsCheckResultDetailProjectList();
if (qmsCheckResultDetailProjectList == null || qmsCheckResultDetailProjectList.isEmpty()) {
qmsCheckResultDetailProjectList = new ArrayList<>();
var qmsCheckRuleProjectList = checkResult.getQmsCheckRuleProjectList();
qmsCheckResultDetailProjectList.addAll(qmsCheckRuleProjectList);
}
adapter.setList(qmsCheckResultDetailProjectList);
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> 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() {
if (checkStatus==null) return "";
switch (checkStatus) {
case "0":
setCheckStatus("待检验");

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

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

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