增加 半成品入库

master
wanghao 5 months ago
parent 4669b3a3d6
commit 0b57b27987

@ -17,6 +17,7 @@ import com.example.haiwei_mom.uitls.SharedPreferencesUtils;
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.RawReturnActivity;
import com.example.haiwei_mom.wms.semi.SemiInActivity;
import com.example.haiwei_mom.wms.semi.SemiOutActivity;
@ -53,7 +54,7 @@ public class HomePageActivity extends BaseActivity implements ItemClickCall {
map.put("入库工装绑定", BindVehicleActivity.class);
map.put("成品批量入库", ProductInActivity.class);
map.put("成品出库", ProductOutActivity.class);
map.put("原材料入库", RawReturnActivity.class);
map.put("原材料入库", RawInActivity.class);
map.put("原材料出库", RawReturnActivity.class);
map.put("原材料盘点", RawReturnActivity.class);
map.put("原材料退库", RawReturnActivity.class);

@ -80,7 +80,6 @@ public class MainActivity extends BaseActivity {
var body = response.body();
if (body.getCode() == 200) {
String accessToken = JSONObject.parseObject(body.getDataJson()).get("access_token").toString();
// SharedPreferencesUtils.putstring("access_token", "Bearer "+accessToken);
MyApplication.getApplication().setAccessToken("Bearer "+accessToken);
boolean remember = loginVm.isRemember();
if (remember) {

@ -1,7 +1,101 @@
package com.example.haiwei_mom.data;
import androidx.databinding.BaseObservable;
import com.example.haiwei_mom.base.BaseActivity;
import java.math.BigDecimal;
import java.util.Date;
import java.util.Observable;
public class SemiInVo extends Observable {
public class SemiInVo extends BaseObservable {
// private String
private Long objId;
/**
*
*/
private String cardNo;
/**
*
*/
private String shelfNo;
/**
* id
*/
private Long storePlaceId;
/**
* ,0:,1:
*/
private String gradeCode;
/**
* 01
*/
private String productCategory;
/**
*
*/
private Long materialId;
/**
*
*/
private String materialSpec;
private String materialCode;
/**
* ,0:,2:线3:线
*/
private String instockType;
private String createBy;
private String createTime;
private double instockNum;
private String storePlaceCode;
private String unitName;
public String getCardNo() {
return cardNo;
}
public String getShelfNo() {
return shelfNo;
}
public void setShelfNo(String shelfNo) {
this.shelfNo= shelfNo;
notifyChange();
}
public String getMaterialSpec() {
return materialSpec;
}
public String getMaterialCode() {
return materialCode;
}
public double getInstockNum() {
return instockNum;
}
public String getUnitName() {
return unitName;
}
public String getStorePlaceCode() {
return storePlaceCode;
}
public void setStorePlaceCode(String storePlaceCode) {
this.storePlaceCode = storePlaceCode;notifyChange();
}
}

@ -0,0 +1,90 @@
package com.example.haiwei_mom.data;
import androidx.databinding.BaseObservable;
import java.util.Date;
import java.util.Observable;
/**
* wms_psm_in_load
*
* @author LionLi
* @date 2025-01-15
*/
public class WmsPsmInLoad extends BaseObservable {
public void setToolingBarcode(String toolingBarcode) {
this.toolingBarcode = toolingBarcode;
notifyChange();
}
/**
*
*/
private String toolingBarcode;
private Long inLoadId;
/**
* ID
*/
private Long materialId;
/**
*
*/
private String materialSpe;
/**
*
*/
private String checkGradeCode;
/**
*
*/
private Long loadAmount;
private String materialCode;
public String getToolingBarcode() {
return toolingBarcode;
}
public Long getMaterialId() {
return materialId;
}
public String getMaterialSpe() {
return materialSpe;
}
public String getCheckGradeCode() {
return checkGradeCode;
}
public Long getLoadAmount() {
return loadAmount;
}
public String getMaterialCode() {
return materialCode;
}
/**
*
*/
private String storePlaceCode;
public String getStorePlaceCode() {
return storePlaceCode;
}
public void setStorePlaceCode(String storePlaceCode) {
this.storePlaceCode = storePlaceCode;
notifyChange();
}
}

@ -14,19 +14,28 @@ import com.example.haiwei_mom.R;
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.WmsPsmInLoad;
import com.example.haiwei_mom.databinding.ActivityProductInBinding;
import com.lzy.okgo.OkGo;
import com.lzy.okgo.model.Response;
public class ProductInActivity extends BaseActivity {
import okhttp3.RequestBody;
public class ProductInActivity extends BaseActivity implements View.OnFocusChangeListener {
private WmsPsmInLoad wmsPsmInLoad;
private EditText productInCode;
private EditText productInLocation;private ActivityProductInBinding binding;
@SuppressLint("ClickableViewAccessibility")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ActivityProductInBinding binding;
binding = DataBindingUtil.setContentView(this, R.layout.activity_product_in);
var productInCode = binding.productInCode;
productInCode = binding.productInCode;
productInCode.setOnFocusChangeListener(this);
productInLocation = binding.productInLocation;
productInLocation .setOnFocusChangeListener(this);
productInCode.setOnTouchListener((v, event) -> {
final int DRAWABLE_RIGHT = 2;
if (event.getAction() == MotionEvent.ACTION_UP) {
@ -39,31 +48,71 @@ public class ProductInActivity extends BaseActivity {
Log.e("TAG", "onCreate2:" + drawableRightStart);
// 判断是否点击了右侧图标
if (x >= drawableRightStart && x <= (productInCode.getWidth() - productInCode.getPaddingRight())) {
selectVehicleInfo();
return true;
}
}
return false;
});
wmsPsmInLoad = new WmsPsmInLoad();
binding.setData(wmsPsmInLoad);
}
@Override
public void getScannerData(String data) {
super.getScannerData(data);
if (focusedView!=null){
if (focusedView==productInCode){
wmsPsmInLoad.setToolingBarcode(data);
selectVehicleInfo();
}else if (focusedView==productInLocation){
productInLocation.setText(data);
}
}
}
private void selectVehicleInfo(){
OkGo.<MyResult>post(url+"/wms/pda/product/selectVehicleInfo")
.params("code","")
.execute(new MyRecultCall(dialog,this) {
private void selectVehicleInfo() {
OkGo.<MyResult>post(url + "/wms/pda/product/selectVehicleInfo")
.params("code", wmsPsmInLoad.getToolingBarcode())
.execute(new MyRecultCall(dialog, this) {
@Override
public void onSuccess(Response<MyResult> response) {
super.onSuccess(response);
var body = response.body();
if (body.getCode()==200){
wmsPsmInLoad=gson.fromJson(body.getDataJson(),WmsPsmInLoad.class);
binding.setData(wmsPsmInLoad);
}
myToastUitls.show(body.getMsg());
}
});
}
public void productInSubmit(View view) {
public void productInSubmit(View view) {
OkGo.<MyResult>post(url + "/wms/pda/product/submitInStoreInfo")
.upRequestBody(RequestBody.create(JSON, gson.toJson(wmsPsmInLoad)))
.execute(new MyRecultCall(dialog, this) {
@Override
public void onSuccess(Response<MyResult> response) {
super.onSuccess(response);
var body = response.body();
if (body.getCode()==200){
wmsPsmInLoad=new WmsPsmInLoad();
binding.setData(wmsPsmInLoad);
}
myToastUitls.show(body.getMsg());
}
});
}
private EditText focusedView;
@Override
public void onFocusChange(View v, boolean hasFocus) {
if (hasFocus) {
Log.e("TAG", "onFocusChange:" + v.getId());
focusedView = (EditText) v;
}
}
}

@ -3,8 +3,12 @@ package com.example.haiwei_mom.wms.semi;
import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;
import android.annotation.SuppressLint;
import android.os.Bundle;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.widget.EditText;
import com.example.haiwei_mom.R;
import com.example.haiwei_mom.base.BaseActivity;
@ -17,25 +21,88 @@ import com.lzy.okgo.model.Response;
import okhttp3.RequestBody;
public class SemiInActivity extends BaseActivity {
public class SemiInActivity extends BaseActivity implements View.OnFocusChangeListener {
private SemiInVo semi;
private EditText semiInVehicle;
private EditText semiInLocation;
private ActivitySemiInBinding binding;
@SuppressLint("ClickableViewAccessibility")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ActivitySemiInBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_semi_in);
binding = DataBindingUtil.setContentView(this, R.layout.activity_semi_in);
semiInLocation = binding.semiInLocation;
semiInLocation.setOnFocusChangeListener(this);
semiInVehicle = binding.semiInVehicle;
semiInVehicle.setOnFocusChangeListener(this);
semiInVehicle.setOnTouchListener((v, event) -> {
if (event.getAction() == MotionEvent.ACTION_UP) {
// 获取触摸的位置
int x = (int) event.getX();
if (x >= 464) {
selectVehicleInfo();
return true;
}
}
return false;
});
semi=new SemiInVo();
binding.setData(semi);
}
public void semiInSubmit(View view) {
OkGo.<MyResult>post(url + "")
.upRequestBody(RequestBody.create(JSON, gson.toJson(semi)))
.execute(new MyRecultCall(dialog,this) {
private void selectVehicleInfo() {
OkGo.<MyResult>post(url + "/wms/pda/semi/selectVehicleInfo")
.params("code", semi.getShelfNo()).execute(new MyRecultCall(dialog, this) {
@Override
public void onSuccess(Response<MyResult> response) {
super.onSuccess(response);
var body = response.body();
if (body.getCode()==200){
semi=gson.fromJson(body.getDataJson(),SemiInVo.class);
binding.setData(semi);
}
myToastUitls.show(body.getMsg());
}
});
}
public void semiInSubmit(View view) {
OkGo.<MyResult>post(url + "/wms/pda/semi/submitInstore")
.upRequestBody(RequestBody.create(JSON, gson.toJson(semi)))
.execute(new MyRecultCall(dialog, this) {
@Override
public void onSuccess(Response<MyResult> response) {
super.onSuccess(response);
var body = response.body();
if (body.getCode()==200){
finish();
}
myToastUitls.show(body.getMsg());
}
});
}
@Override
public void getScannerData(String data) {
super.getScannerData(data);
if (focusedView!=null){
if (focusedView==semiInVehicle){
semi.setShelfNo(data);
selectVehicleInfo();
}else if (focusedView==semiInLocation){
semiInLocation.setText(data);
}
}
}
private EditText focusedView;
@Override
public void onFocusChange(View v, boolean hasFocus) {
focusedView = (EditText) v;
}
}

@ -8,6 +8,9 @@
<variable
name="title"
type="String" />
<variable
name="data"
type="com.example.haiwei_mom.data.WmsPsmInLoad" />
</data>
<LinearLayout
@ -37,7 +40,8 @@
style="@style/text_san"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:drawableRight="@mipmap/icon_chaxun"/>
android:drawableRight="@mipmap/icon_chaxun"
android:text="@{data.toolingBarcode}"/>
</LinearLayout>
@ -51,12 +55,13 @@
style="@style/text_title"
android:layout_width="110dp"
android:layout_height="match_parent"
android:text="物料名称:" />
android:text="物料编码:" />
<TextView
style="@style/text_info"
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:layout_height="match_parent"
android:text="@{data.materialCode}"/>
<!-- android:text="@{vo.materialName}"-->
</LinearLayout>
@ -76,8 +81,8 @@
<TextView
style="@style/text_info"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<!-- android:text="@{vo.materialName}" -->
android:layout_height="match_parent"
android:text="@{data.materialSpe}"/>
</LinearLayout>
@ -96,8 +101,8 @@
<TextView
style="@style/text_info"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<!-- android:text="@{vo.locationCode}"-->
android:layout_height="match_parent"
android:text='@{String.valueOf(data.loadAmount)??" "}'/>
</LinearLayout>
@ -117,7 +122,8 @@
android:id="@+id/product_in_location"
style="@style/text_san"
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:layout_height="match_parent"
android:text="@={data.storePlaceCode}"/>
</LinearLayout>

@ -1,9 +1,151 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<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=".wms.raw.RawInActivity">
</androidx.constraintlayout.widget.ConstraintLayout>
<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="110dp"
android:layout_height="match_parent"
android:text="扫描批次码:" />
<EditText
android:id="@+id/material_in_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="12dp"
android:layout_marginEnd="4dp">
<TextView
style="@style/text_title"
android:layout_width="110dp"
android:layout_height="match_parent"
android:text="物料编码:" />
<TextView
style="@style/text_info"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@{data.materialCode}" />
<!-- android:text="@{vo.materialName}"-->
</LinearLayout>
<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="110dp"
android:layout_height="match_parent"
android:text="物料规格:" />
<TextView
style="@style/text_info"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@{data.materialSpec}" />
</LinearLayout>
<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="110dp"
android:layout_height="match_parent"
android:text="批次数量:" />
<TextView
style="@style/text_info"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginEnd="5dp"
android:layout_weight="1"
android:text='@{String.valueOf(data.instockNum)??"0"}' />
<TextView
style="@style/text_info"
android:layout_width="60dp"
android:layout_height="match_parent" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:layout_marginEnd="4dp">
<TextView
style="@style/text_title"
android:layout_width="110dp"
android:layout_height="match_parent"
android:text="目标库位:" />
<!-- -->
<EditText
android:id="@+id/material_in_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="12dp"
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="20dp"
android:onClick="semiInSubmit"
android:text="提交" />
</LinearLayout>

@ -7,6 +7,9 @@
<variable
name="title"
type="String" />
<variable
name="data"
type="com.example.haiwei_mom.data.SemiInVo" />
</data>
@ -32,14 +35,95 @@
android:text="扫描载具:" />
<EditText
android:id="@+id/material_in_goods"
android:id="@+id/semi_in_vehicle"
style="@style/text_san"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:drawableRight="@mipmap/icon_chaxun"
android:text="@={data.shelfNo}"
/>
</LinearLayout>
<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="110dp"
android:layout_height="match_parent"
android:text="流水卡号:" />
<TextView
style="@style/text_info"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@{data.cardNo}"/>
<!-- android:text="@{vo.materialName}"-->
</LinearLayout>
<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="110dp"
android:layout_height="match_parent"
android:text="物料编码:" />
<TextView
style="@style/text_info"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@{data.materialCode}"/>
<!-- android:text="@{vo.materialName}"-->
</LinearLayout>
<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="110dp"
android:layout_height="match_parent"
android:text="物料规格:" />
<TextView
style="@style/text_info"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@{data.materialSpec}"/>
</LinearLayout>
<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="110dp"
android:layout_height="match_parent"
android:text="物料数量:" />
<TextView
style="@style/text_info"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text='@{String.valueOf(data.instockNum)??"0"}'/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -53,36 +137,37 @@
android:text="扫描库位:" />
<!-- -->
<EditText
android:id="@+id/material_in_location"
android:id="@+id/semi_in_location"
style="@style/text_san"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="45dp"
android:text="@={data.storePlaceCode}"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="4dp">
<!-- <LinearLayout-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="45dp"-->
<!-- android:layout_marginTop="20dp"-->
<!-- android:layout_marginEnd="4dp">-->
<TextView
style="@style/text_title"
android:layout_width="90dp"
android:layout_height="match_parent"
android:text="输入数量:" />
<!-- <TextView-->
<!-- style="@style/text_title"-->
<!-- android:layout_width="90dp"-->
<!-- android:layout_height="match_parent"-->
<!-- android:text="输入数量:" />-->
<EditText
style="@style/text_edit"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:inputType="numberDecimal"
/>
<!-- <EditText-->
<!-- style="@style/text_edit"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="match_parent"-->
<!-- android:inputType="numberDecimal"-->
<!-- />-->
</LinearLayout>
<!-- </LinearLayout>-->
<Button
style="@style/button_style"

@ -4,6 +4,7 @@
xmlns:tools="http://schemas.android.com/tools">
<data>
<variable
name="title"
type="String" />
@ -13,8 +14,9 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".wms.semi.SemiInActivity"
android:orientation="vertical">
android:orientation="vertical"
tools:context=".wms.semi.SemiInActivity">
<include
layout="@layout/toolbar"
app:title='@{title??"半成品出库"}' />
@ -35,8 +37,75 @@
android:id="@+id/material_in_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="12dp"
android:layout_marginEnd="4dp">
<TextView
style="@style/text_title"
android:layout_width="110dp"
android:layout_height="match_parent"
/>
android:text="物料编码:" />
<TextView
style="@style/text_info"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@{data.materialCode}" />
<!-- android:text="@{vo.materialName}"-->
</LinearLayout>
<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="110dp"
android:layout_height="match_parent"
android:text="物料规格:" />
<TextView
style="@style/text_info"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@{data.materialSpec}" />
</LinearLayout>
<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="110dp"
android:layout_height="match_parent"
android:text="库存数量:" />
<TextView
style="@style/text_info"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text='@{String.valueOf(data.instockNum)??"0"}'
android:layout_marginEnd="5dp"/>
<TextView
style="@style/text_info"
android:layout_width="60dp"
android:layout_height="match_parent" />
</LinearLayout>
@ -57,8 +126,7 @@
style="@style/text_san"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="45dp"
/>
android:minHeight="45dp" />
</LinearLayout>
@ -79,8 +147,7 @@
style="@style/text_info"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:inputType="numberDecimal"
/>
android:inputType="numberDecimal" />
</LinearLayout>

Loading…
Cancel
Save