diff --git a/.idea/deploymentTargetDropDown.xml b/.idea/deploymentTargetDropDown.xml
new file mode 100644
index 0000000..386c62e
--- /dev/null
+++ b/.idea/deploymentTargetDropDown.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 7e90762..94f041b 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -32,12 +32,15 @@
android:theme="@style/Theme.Jingyuanmes"
android:usesCleartextTraffic="true"
tools:targetApi="31">
+
+ android:exported="true" />
diff --git a/app/src/main/java/com/example/jingyuan_mes/HomePageActivity.java b/app/src/main/java/com/example/jingyuan_mes/HomePageActivity.java
index 7b2d902..37100e5 100644
--- a/app/src/main/java/com/example/jingyuan_mes/HomePageActivity.java
+++ b/app/src/main/java/com/example/jingyuan_mes/HomePageActivity.java
@@ -23,6 +23,7 @@ import com.example.jingyuan_mes.entity.MenuBeen;
import com.example.jingyuan_mes.entity.store.PdaRouters;
import com.example.jingyuan_mes.store.AssemblyOutActivity;
import com.example.jingyuan_mes.store.InventoryTaskActivity;
+import com.example.jingyuan_mes.store.LocationlockingActivity;
import com.example.jingyuan_mes.store.MaterialInActivity;
import com.example.jingyuan_mes.store.MaterialOutListActivity;
import com.example.jingyuan_mes.store.MaterialPassActivity;
@@ -87,6 +88,7 @@ public class HomePageActivity extends BaseActivity implements ItemClickCall {
map.put("人工移库", RelocationTaskActivity.class);
map.put("人工合库", RelocationTaskActivity.class);
map.put("库存盘点", InventoryTaskActivity.class);
+ map.put("库位锁定/解锁", LocationlockingActivity.class);
}
private void initRequest() {
diff --git a/app/src/main/java/com/example/jingyuan_mes/adapter/store/LockLocationAdapter.java b/app/src/main/java/com/example/jingyuan_mes/adapter/store/LockLocationAdapter.java
new file mode 100644
index 0000000..334a3fa
--- /dev/null
+++ b/app/src/main/java/com/example/jingyuan_mes/adapter/store/LockLocationAdapter.java
@@ -0,0 +1,71 @@
+package com.example.jingyuan_mes.adapter.store;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.ViewGroup;
+
+import androidx.annotation.NonNull;
+import androidx.databinding.DataBindingUtil;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.example.jingyuan_mes.BR;
+import com.example.jingyuan_mes.R;
+import com.example.jingyuan_mes.databinding.ItemInventoryTaskBinding;
+import com.example.jingyuan_mes.databinding.ItemLockLocationBinding;
+import com.example.jingyuan_mes.entity.store.InventoryTaskBeen;
+import com.example.jingyuan_mes.entity.store.LocationLockInfo;
+
+import java.util.List;
+
+/**
+ * @author wanghao
+ * @date 2024/1/31 15:18
+ */
+public class LockLocationAdapter extends RecyclerView.Adapter {
+ private List list;
+ private Context context;
+ private LayoutInflater inflater;
+
+ public LockLocationAdapter(Context context) {
+ this.context = context;
+ inflater = LayoutInflater.from(context);
+ }
+
+ public void setList(List list) {
+ this.list = list;
+ }
+
+ @NonNull
+ @Override
+ public ItemtViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+ ItemLockLocationBinding binding = DataBindingUtil.inflate(inflater, R.layout.item_lock_location, parent, false);
+ return new ItemtViewHolder(binding);
+ }
+
+ @Override
+ public void onBindViewHolder(@NonNull ItemtViewHolder holder, int position) {
+ var rawReturn = list.get(position);
+ var binding = holder.binding;
+ binding.setVariable(BR.vm,rawReturn);
+ }
+
+ @Override
+ public int getItemCount() {
+ return list==null?0:list.size();
+ }
+
+ static class ItemtViewHolder extends RecyclerView.ViewHolder {
+ private ItemLockLocationBinding binding;
+
+ public ItemtViewHolder(ItemLockLocationBinding binding) {
+ super(binding.getRoot());
+ this.binding = binding;
+ }
+
+
+ }
+
+ public interface MyItemClickCall{
+ void onClick(int index,boolean tag);
+ }
+}
diff --git a/app/src/main/java/com/example/jingyuan_mes/entity/store/LocationLockInfo.java b/app/src/main/java/com/example/jingyuan_mes/entity/store/LocationLockInfo.java
new file mode 100644
index 0000000..e0d376b
--- /dev/null
+++ b/app/src/main/java/com/example/jingyuan_mes/entity/store/LocationLockInfo.java
@@ -0,0 +1,24 @@
+package com.example.jingyuan_mes.entity.store;
+
+import java.util.List;
+
+public class LocationLockInfo {
+ private String warehouseName;
+ private List locationCodes;
+
+ public String getWarehouseName() {
+ return warehouseName;
+ }
+
+ public void setWarehouseName(String warehouseName) {
+ this.warehouseName = warehouseName;
+ }
+
+ public List getLocationCodes() {
+ return locationCodes;
+ }
+
+ public void setLocationCodes(List locationCodes) {
+ this.locationCodes = locationCodes;
+ }
+}
diff --git a/app/src/main/java/com/example/jingyuan_mes/store/LocationlockingActivity.java b/app/src/main/java/com/example/jingyuan_mes/store/LocationlockingActivity.java
new file mode 100644
index 0000000..e9f4480
--- /dev/null
+++ b/app/src/main/java/com/example/jingyuan_mes/store/LocationlockingActivity.java
@@ -0,0 +1,96 @@
+package com.example.jingyuan_mes.store;
+
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.databinding.DataBindingUtil;
+import androidx.databinding.ObservableBoolean;
+import androidx.lifecycle.Observer;
+
+import android.database.Observable;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.Toast;
+
+import com.example.jingyuan_mes.R;
+import com.example.jingyuan_mes.adapter.store.LockLocationAdapter;
+import com.example.jingyuan_mes.base.BaseActivity;
+import com.example.jingyuan_mes.base.MyRecultCall;
+import com.example.jingyuan_mes.base.MyResult;
+import com.example.jingyuan_mes.databinding.ActivityLocationlockingBinding;
+import com.example.jingyuan_mes.entity.store.LocationLockInfo;
+import com.example.jingyuan_mes.uitls.SharedPreferencesUtils;
+import com.google.gson.reflect.TypeToken;
+import com.lzy.okgo.OkGo;
+import com.lzy.okgo.model.Response;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import okhttp3.RequestBody;
+
+public class LocationlockingActivity extends BaseActivity {
+private ActivityLocationlockingBinding binding;
+private LockLocationAdapter adapter;
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ binding = DataBindingUtil.setContentView(this, R.layout.activity_locationlocking);
+ adapter=new LockLocationAdapter(this);
+ binding.setAdapter(adapter);
+
+ }
+
+ @Override
+ protected void onResume() {
+ super.onResume();
+ requestLocationList();
+ }
+private void requestLocationList(){
+ OkGo.get(url + "/wms/mobile/getLockLocations")
+ .headers("Authorization", SharedPreferencesUtils.getstring("access_token", ""))
+ .execute(new MyRecultCall(dialog, this) {
+ @Override
+ public void onSuccess(Response response) {
+ super.onSuccess(response);
+ var body = response.body();
+ if (body.getCode() == 200) {
+ // List list=gson.fromJson(body.getData().toString(),new TypeToken<>(){}.getType());
+ // adapter.setList(list);
+ // adapter.notifyDataSetChanged();
+ return;
+ }
+ String msg = body.getMsg();
+ Toast.makeText(context, msg==null?"操作失败":msg, Toast.LENGTH_SHORT).show();
+ }
+ });
+}
+ public void lockLocation(View view) {
+ requestLock("lockLocation");
+
+ }
+
+ public void unLockLocation(View view) {
+ requestLock("unlockLocation");
+ }
+
+ private void requestLock(String uri) {
+ Map map=new HashMap<>();
+ map.put("locationCode",binding.lockLocation.getText().toString().trim());
+ OkGo.post(url + "/wms/mobile/"+uri)
+ .headers("Authorization", SharedPreferencesUtils.getstring("access_token", ""))
+ .upRequestBody(RequestBody.create(JSON, gson.toJson(map)))
+ .execute(new MyRecultCall(dialog, this) {
+ @Override
+ public void onSuccess(Response response) {
+ super.onSuccess(response);
+ var body = response.body();
+ if (body.getCode() == 200) {
+ binding.lockLocation.setText(null);
+ }
+ String msg = body.getMsg();
+ Toast.makeText(context, msg==null?"操作失败":msg, Toast.LENGTH_SHORT).show();
+ }
+ });
+ requestLocationList();
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_locationlocking.xml b/app/src/main/res/layout/activity_locationlocking.xml
new file mode 100644
index 0000000..519f834
--- /dev/null
+++ b/app/src/main/res/layout/activity_locationlocking.xml
@@ -0,0 +1,89 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/item_lock_location.xml b/app/src/main/res/layout/item_lock_location.xml
new file mode 100644
index 0000000..8ced772
--- /dev/null
+++ b/app/src/main/res/layout/item_lock_location.xml
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/item_product_out_apply.xml b/app/src/main/res/layout/item_product_out_apply.xml
index 8f4df9e..226b995 100644
--- a/app/src/main/res/layout/item_product_out_apply.xml
+++ b/app/src/main/res/layout/item_product_out_apply.xml
@@ -12,7 +12,7 @@
android:orientation="vertical"
android:background="@drawable/san_text_bg"
android:layout_width="match_parent"
- android:layout_height="335dp"
+ android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:padding="4dp">