增加 页面

master
wanghao 4 months ago
parent 8918b063d9
commit c5e5c3fd22

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto">
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<application
android:name=".base.MyApplication"
@ -15,6 +15,15 @@
android:theme="@style/Theme.Haiweimom"
android:usesCleartextTraffic="true"
tools:targetApi="31">
<activity
android:name=".ClassItemActivity"
android:exported="false" />
<activity
android:name=".ConfigActivity"
android:exported="false" />
<activity
android:name=".wms.raw.RawOutActivity"
android:exported="false" />
<activity
android:name=".qm.CheckActivity"
android:exported="false" />

@ -0,0 +1,14 @@
package com.example.haiwei_mom;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
public class ClassItemActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_class_item);
}
}

@ -0,0 +1,14 @@
package com.example.haiwei_mom;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
public class ConfigActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_config);
}
}

@ -19,6 +19,7 @@ import com.example.haiwei_mom.wms.product.BindVehicleActivity;
import com.example.haiwei_mom.wms.product.ProductInActivity;
import com.example.haiwei_mom.wms.product.ProductOutActivity;
import com.example.haiwei_mom.wms.raw.RawInActivity;
import com.example.haiwei_mom.wms.raw.RawOutActivity;
import com.example.haiwei_mom.wms.raw.RawReturnActivity;
import com.example.haiwei_mom.wms.semi.SemiInActivity;
import com.example.haiwei_mom.wms.semi.SemiOutActivity;
@ -56,11 +57,13 @@ public class HomePageActivity extends BaseActivity implements ItemClickCall {
map.put("成品批量入库", ProductInActivity.class);
map.put("成品出库", ProductOutActivity.class);
map.put("原材料入库", RawInActivity.class);
map.put("原材料出库", RawReturnActivity.class);
map.put("原材料出库", RawOutActivity.class);
map.put("原材料盘点", RawReturnActivity.class);
map.put("原材料退库", RawReturnActivity.class);
map.put("制品质检", CheckActivity.class);
map.put("制品复检", CheckActivity.class);
map.put("系统配置", ConfigActivity.class);
map.put("班组管理", ClassItemActivity.class);
}
private void initRequest() {

@ -0,0 +1,63 @@
package com.example.haiwei_mom.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.databinding.DataBindingUtil;
import androidx.recyclerview.widget.RecyclerView;
import com.example.haiwei_mom.R;
import com.example.haiwei_mom.data.OutDetail;
import com.example.haiwei_mom.databinding.ItemBindVehicleBinding;
import com.example.haiwei_mom.databinding.ItemRawOutBinding;
import java.util.List;
public class RawOutDetailAdapter extends RecyclerView.Adapter<RawOutDetailAdapter.MyViewHolder> {
private Context context;
private LayoutInflater inflater;
public RawOutDetailAdapter(Context context) {
this.context = context;
inflater=LayoutInflater.from(context);
}
private List<OutDetail> list;
public void setList(List<OutDetail> list) {
this.list = list;
}
@NonNull
@Override
public MyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
ItemRawOutBinding binding=DataBindingUtil.inflate(inflater, R.layout.item_raw_out,parent,false);
return new MyViewHolder(binding);
}
@Override
public void onBindViewHolder(@NonNull MyViewHolder holder, int position) {
var binding = holder.binding;
binding.setVm(list.get(position));
}
@Override
public int getItemCount() {
return list==null?0:list.size();
}
public class MyViewHolder extends RecyclerView.ViewHolder{
private ItemRawOutBinding binding;
public MyViewHolder(ItemRawOutBinding binding) {
super(binding.getRoot());
this.binding = binding;
}
}
}

@ -0,0 +1,77 @@
package com.example.haiwei_mom.data;
import java.io.Serializable;
import java.util.Date;
/**
* - wms_outstock_detail
*
* @author LionLi
* @date 2025-01-08
*/
public class OutDetail {
/**
*
*/
private Long outstockDetailId;
/**
*
*/
private String outstockCode;
/**
*
*/
private Long outstockId;
/**
* id
*/
private Long materialId;
/**
*
*/
private double outstockQty;
private double outSum;
/**
*
*/
private String materialCategories;
private String materialCode;
private String materialName;
public double getOutstockQty() {
return outstockQty;
}
public double getOutSum() {
return outSum;
}
public String getMaterialCode() {
return materialCode;
}
public String getMaterialName() {
return materialName;
}
}

@ -0,0 +1,127 @@
package com.example.haiwei_mom.wms.raw;
import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;
import android.annotation.SuppressLint;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
import android.widget.EditText;
import com.example.haiwei_mom.R;
import com.example.haiwei_mom.adapter.RawOutDetailAdapter;
import com.example.haiwei_mom.base.BaseActivity;
import com.example.haiwei_mom.base.MyRecultCall;
import com.example.haiwei_mom.base.MyResult;
import com.example.haiwei_mom.data.OutDetail;
import com.example.haiwei_mom.databinding.ActivityRawOutBinding;
import com.google.gson.reflect.TypeToken;
import com.lzy.okgo.OkGo;
import com.lzy.okgo.model.Response;
import java.util.List;
public class RawOutActivity extends BaseActivity implements View.OnFocusChangeListener {
private ActivityRawOutBinding binding;
private RawOutDetailAdapter rawOutDetailAdapter;
private EditText rawOutCodeView;
private EditText rawOutLocationView;
private EditText rawOutGoodsView;
private EditText focusView;
private boolean sanState = true;
@SuppressLint("ClickableViewAccessibility")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
binding = DataBindingUtil.setContentView(this, R.layout.activity_raw_out);
rawOutCodeView = binding.rawOutCode;
rawOutCodeView.setOnTouchListener((v, event) -> {
if (event.getAction() == MotionEvent.ACTION_UP) {
// 获取触摸的位置
int x = (int) event.getX();
if (x >= 464) {
selectOutOrderCode(binding.rawOutCode.getText().toString());
return true;
}
}
return false;
});
rawOutLocationView = binding.rawOutLocation;
rawOutLocationView.setOnFocusChangeListener(this);
rawOutGoodsView = binding.rawOutGoods;
rawOutGoodsView.setOnFocusChangeListener(this);
rawOutDetailAdapter = new RawOutDetailAdapter(this);
binding.setDetailAdapter(rawOutDetailAdapter);
}
private void selectOutOrderCode(String orderCode) {
OkGo.<MyResult>post(url + "/wms/pda/raw/outSelectByOrderCode").params("orderCode", orderCode).execute(new MyRecultCall(dialog, this) {
@Override
public void onSuccess(Response<MyResult> response) {
super.onSuccess(response);
var body = response.body();
if (body.getCode() == 200) {
List<OutDetail> list = gson.fromJson(body.getDataJson(), new TypeToken<List<OutDetail>>() {
}.getType());
rawOutDetailAdapter.setList(list);
rawOutDetailAdapter.notifyDataSetChanged();
sanState = false;
return;
}
sanState = true;
myToastUitls.show(body.getMsg());
}
});
}
@Override
public void getScannerData(String data) {
super.getScannerData(data);
if (sanState) {
rawOutCodeView.setText(data);
selectOutOrderCode(data);
return;
}
if (focusView == rawOutLocationView) {
rawOutLocationView.setText(data);
} else if (focusView == rawOutGoodsView) {
rawOutGoodsView.setText(data);
selectBacthCode(data, rawOutLocationView.getText().toString());
}
}
// 查询物料
private void selectBacthCode(String bacthCode, String locationCode) {
OkGo.<MyResult>post(url + "/wms/pda/raw/selectInVentoryByBatchCode").params("bacthCode", bacthCode).params("locationCode", locationCode).execute(new MyRecultCall(dialog, this) {
@Override
public void onSuccess(Response<MyResult> response) {
super.onSuccess(response);
var body = response.body();
if (body.getCode() == 200) {
List<OutDetail> list = gson.fromJson(body.getDataJson(), new TypeToken<List<OutDetail>>() {
}.getType());
rawOutDetailAdapter.setList(list);
rawOutDetailAdapter.notifyDataSetChanged();
return;
}
myToastUitls.show(body.getMsg());
}
});
}
@Override
public void onFocusChange(View v, boolean hasFocus) {
if (hasFocus) {
focusView = (EditText) v;
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 466 B

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape>
<corners android:radius="6dp"/>
<solid android:color="@color/white"/>
<stroke android:width="1dp"/>
</shape>
</item>
<item android:width="15dp" android:height="15dp" android:gravity="center|end"
android:right="10dp"
android:drawable="@drawable/icon_select">
</item>
</layer-list>

@ -0,0 +1,190 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".ClassItemActivity">
<include layout="@layout/toolbar"
app:title='@{title??"班组"}'/>
<!-- <LinearLayout-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="45dp"-->
<!-- android:layout_marginTop="5dp"-->
<!-- android:layout_marginEnd="4dp">-->
<!-- <TextView-->
<!-- style="@style/text_title"-->
<!-- android:layout_width="100dp"-->
<!-- android:layout_height="match_parent"-->
<!-- android:text="公司编号:" />-->
<!-- <TextView-->
<!-- style="@style/text_info"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="match_parent"-->
<!-- android:text="@{been.companyCode}" />-->
<!-- </LinearLayout>-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="4dp">
<TextView
style="@style/text_title"
android:layout_width="100dp"
android:layout_height="match_parent"
android:text="公司名称:" />
<TextView
style="@style/text_info"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@{been.companyName}" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="4dp">
<TextView
style="@style/text_title"
android:layout_width="100dp"
android:layout_height="match_parent"
android:text="工厂编号:" />
<TextView
style="@style/text_info"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@{been.factoryCode}" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="4dp">
<TextView
style="@style/text_title"
android:layout_width="100dp"
android:layout_height="match_parent"
android:text="工厂名称:" />
<TextView
style="@style/text_info"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@{been.factoryName}" />
</LinearLayout>
<!-- <LinearLayout-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="45dp"-->
<!-- android:layout_marginTop="8dp"-->
<!-- android:layout_marginEnd="4dp"-->
<!-- app:layout_constraintEnd_toEndOf="parent"-->
<!-- app:layout_constraintStart_toStartOf="parent">-->
<!-- <TextView-->
<!-- style="@style/text_title"-->
<!-- android:layout_width="100dp"-->
<!-- android:layout_height="match_parent"-->
<!-- android:text="班组编号:" />-->
<!-- <TextView-->
<!-- style="@style/text_info"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="match_parent"-->
<!-- android:text="@{user.teamCode}" />-->
<!-- </LinearLayout>-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="4dp">
<TextView
style="@style/text_title"
android:layout_width="100dp"
android:layout_height="match_parent"
android:text="班组名称:" />
<TextView
style="@style/text_info"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@{user.teamName}" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="4dp">
<TextView
style="@style/text_title"
android:layout_width="100dp"
android:layout_height="match_parent"
android:text="用户编号:" />
<TextView
style="@style/text_info"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@{user.username}" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="4dp">
<TextView
style="@style/text_title"
android:layout_width="100dp"
android:layout_height="match_parent"
android:text="用户名称:" />
<TextView
style="@style/text_info"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@{user.nickName}" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="4dp">
<TextView
style="@style/text_title"
android:layout_width="100dp"
android:layout_height="match_parent"
android:text="选择班组:" />
<Spinner
style="@style/spinner_style"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@{user.nickName}"
android:entries="@array/class_item"/>
</LinearLayout>
<Button
style="@style/button_submit"
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_gravity="center"
android:text="接班" />
</LinearLayout>

@ -0,0 +1,77 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".ConfigActivity">
<include
layout="@layout/toolbar"
app:title='@{title??"机台配置"}' />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="4dp">
<TextView
style="@style/text_title"
android:layout_width="100dp"
android:layout_height="match_parent"
android:text="选择机台:" />
<Spinner
style="@style/spinner_style"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:entries="@array/class_item"
android:text="@{user.nickName}" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="4dp">
<TextView
style="@style/text_title"
android:layout_width="100dp"
android:layout_height="match_parent"
android:text="机台名称:" />
<TextView
style="@style/text_info"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@{been.companyName}" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="4dp">
<TextView
style="@style/text_title"
android:layout_width="100dp"
android:layout_height="match_parent"
android:text="服务地址:" />
<TextView
style="@style/text_info"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@{been.companyName}" />
</LinearLayout>
<Button
style="@style/button_submit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="提交" />
</LinearLayout>

@ -21,7 +21,7 @@
<include
layout="@layout/toolbar"
app:title='@{title??"半成品出库"}' />
app:title='@{title??"原材料入库"}' />
<LinearLayout
android:layout_width="match_parent"

@ -0,0 +1,134 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<data>
<variable
name="title"
type="String" />
<variable
name="detailAdapter"
type="com.example.haiwei_mom.adapter.RawOutDetailAdapter" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".wms.raw.RawOutActivity">
<include
layout="@layout/toolbar"
app:title='@{title??"原材料出库"}' />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_marginTop="12dp"
android:layout_marginEnd="4dp">
<TextView
style="@style/text_title"
android:layout_width="90dp"
android:layout_height="match_parent"
android:text="出库单号:" />
<EditText
android:id="@+id/raw_out_code"
style="@style/text_san"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:drawableRight="@mipmap/icon_chaxun" />
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:text="待出库物料"
android:textColor="@color/blue" />
<androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:adapter="@{detailAdapter}"
android:padding="5dp"
android:background="@color/white"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginEnd="4dp">
<TextView
style="@style/text_title"
android:layout_width="110dp"
android:layout_height="match_parent"
android:text="目标库位:" />
<!-- -->
<EditText
android:id="@+id/raw_out_location"
style="@style/text_san"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="45dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="4dp">
<TextView
style="@style/text_title"
android:layout_width="110dp"
android:layout_height="match_parent"
android:text="扫描批次码:" />
<EditText
android:id="@+id/raw_out_goods"
style="@style/text_san"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="4dp">
<TextView
style="@style/text_title"
android:layout_width="110dp"
android:layout_height="match_parent"
android:text="出库数量:" />
<EditText
style="@style/text_info"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:inputType="numberDecimal"/>
</LinearLayout>
<Button
style="@style/button_style"
android:layout_width="match_parent"
android:layout_height="55dp"
android:layout_margin="12dp"
android:onClick="rawinSubmit"
android:text="提交" />
</LinearLayout>
</layout>

@ -0,0 +1,87 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<variable
name="vm"
type="com.example.haiwei_mom.data.OutDetail" />
</data>
<LinearLayout
android:id="@+id/device_inspection_click"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/san_text_bg"
android:orientation="vertical"
android:layout_marginTop="5dp"
android:padding="5dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="40dp">
<TextView
style="@style/item_title_blue"
android:layout_width="70dp"
android:layout_height="match_parent"
android:text="物料编码:" />
<TextView
style="@style/item_text_13"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="@{vm.materialCode}" />
<TextView
style="@style/item_title_blue"
android:layout_width="70dp"
android:layout_height="match_parent"
android:text="物料名称:" />
<TextView
style="@style/item_text_13"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="@{vm.materialName}" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="40dp">
<TextView
style="@style/item_title_blue"
android:layout_width="70dp"
android:layout_height="match_parent"
android:text="工单数量:" />
<TextView
style="@style/item_text_13"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text='@{String.valueOf(vm.outstockQty)}' />
<TextView
style="@style/item_title_blue"
android:layout_width="70dp"
android:layout_height="match_parent"
android:text="已出库数量:" />
<TextView
style="@style/item_text_13"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="@{String.valueOf(vm.outSum)}" />
</LinearLayout>
</LinearLayout>
</layout>

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="class_item">
<item></item>
<item></item>
<item></item>
<item></item>
</string-array>
</resources>

@ -55,8 +55,19 @@
<item name="android:letterSpacing">0.5</item>
<item name="android:layout_gravity">center</item>
<item name="android:layout_margin">10dp</item>
</style>
<style name="item_title_blue">
<item name="android:textSize">13sp</item>
<item name="android:gravity">center</item>
<item name="android:textColor">@color/blue</item>
</style>
<style name="item_text_13">
<item name="android:textSize">13sp</item>
<item name="android:gravity">center</item>
<item name="android:textColor">@color/black</item>
</style>
<style name="spinner_style">
<item name="android:textAlignment">center</item>
<item name="android:background">@drawable/spinner_bg</item>
</style>
</resources>
Loading…
Cancel
Save