完善 质量检测
parent
d5b7f8e336
commit
9d6ecd4a21
@ -0,0 +1,69 @@
|
|||||||
|
package com.example.haiwei_mom.data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 半成品库位视图对象 wms_hpp_store_place
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class WmsHppStorePlaceVo {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键id
|
||||||
|
*/
|
||||||
|
private Long objId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 库位名
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String storePlaceName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 库位代码
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String storePlaceCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 仓库id
|
||||||
|
*/
|
||||||
|
|
||||||
|
private Long storeId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 使用状态
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String usedFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 特殊库位
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String specitialType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 位置类型
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String positionType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 仓库名
|
||||||
|
*/
|
||||||
|
private String storeName;
|
||||||
|
|
||||||
|
public String getStorePlaceCode() {
|
||||||
|
return storePlaceCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStoreName() {
|
||||||
|
return storeName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getObjId() {
|
||||||
|
return objId;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
package com.example.haiwei_mom.ipc.data;
|
||||||
|
|
||||||
|
public class MachinePlan {
|
||||||
|
private String planCode,materialName;
|
||||||
|
|
||||||
|
public String getPlanCode() {
|
||||||
|
return planCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPlanCode(String planCode) {
|
||||||
|
this.planCode = planCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMaterialName() {
|
||||||
|
return materialName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMaterialName(String materialName) {
|
||||||
|
this.materialName = materialName;
|
||||||
|
}
|
||||||
|
}
|
@ -1,18 +1,173 @@
|
|||||||
package com.example.haiwei_mom.wms.semi;
|
package com.example.haiwei_mom.wms.semi;
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.databinding.DataBindingUtil;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
import android.content.Context;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.MotionEvent;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.inputmethod.InputMethodManager;
|
||||||
|
|
||||||
|
import com.bigkoo.pickerview.builder.OptionsPickerBuilder;
|
||||||
|
import com.bigkoo.pickerview.listener.OnOptionsSelectListener;
|
||||||
import com.bigkoo.pickerview.view.OptionsPickerView;
|
import com.bigkoo.pickerview.view.OptionsPickerView;
|
||||||
import com.example.haiwei_mom.R;
|
import com.example.haiwei_mom.R;
|
||||||
import com.example.haiwei_mom.base.BaseActivity;
|
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.SemiInVo;
|
||||||
|
import com.example.haiwei_mom.data.SemiOutVo;
|
||||||
|
import com.example.haiwei_mom.data.WmsHppStorePlaceVo;
|
||||||
|
import com.example.haiwei_mom.databinding.ActivitySeimMoveBinding;
|
||||||
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
import com.lzy.okgo.OkGo;
|
||||||
|
import com.lzy.okgo.model.Response;
|
||||||
|
|
||||||
public class SeimMoveActivity extends BaseActivity {
|
import java.io.File;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
public class SeimMoveActivity extends BaseActivity implements OnOptionsSelectListener {
|
||||||
private OptionsPickerView opv;
|
private OptionsPickerView opv;
|
||||||
|
private List<String> options1List;
|
||||||
|
private List<List<String>> options2List;
|
||||||
|
private SemiOutVo semi;
|
||||||
|
private ActivitySeimMoveBinding binding;
|
||||||
|
private String placeId;
|
||||||
|
|
||||||
|
@SuppressLint("ClickableViewAccessibility")
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_seim_move);
|
binding = DataBindingUtil.setContentView(this, R.layout.activity_seim_move);
|
||||||
|
InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||||
|
// opv=new OptionsPickerView(this);
|
||||||
|
initRequest();
|
||||||
|
binding.semiOutCode.setOnTouchListener((v, event) -> {
|
||||||
|
|
||||||
|
if (event.getAction() == MotionEvent.ACTION_UP) {
|
||||||
|
// 获取触摸的位置
|
||||||
|
int x = (int) event.getX();
|
||||||
|
// 获取图标的边界
|
||||||
|
int drawableRightWidth = binding.semiOutCode.getCompoundDrawables()[2].getBounds().width();
|
||||||
|
int drawableRightStart = (int) (binding.semiOutCode.getWidth() - binding.semiOutCode.getPaddingRight() - drawableRightWidth);
|
||||||
|
// 判断是否点击了右侧图标
|
||||||
|
if (x >= drawableRightStart && x <= (binding.semiOutCode.getWidth() - binding.semiOutCode.getPaddingRight())) {
|
||||||
|
imm.hideSoftInputFromWindow(Objects.requireNonNull(this.getCurrentFocus()).getWindowToken(),
|
||||||
|
InputMethodManager.HIDE_NOT_ALWAYS);
|
||||||
|
selectHppStorageInfo(binding.semiOutCode.getText().toString());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
private List<WmsHppStorePlaceVo> list;
|
||||||
|
private void initRequest() {
|
||||||
|
opv = new OptionsPickerBuilder(this, this).build();
|
||||||
|
options1List = new ArrayList<>();
|
||||||
|
options2List = new ArrayList<>();
|
||||||
|
OkGo.<MyResult>post(url + "/wms/pda/seimMove/selectStore").execute(new MyRecultCall(dialog, this) {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Response<MyResult> response) {
|
||||||
|
super.onSuccess(response);
|
||||||
|
var body = response.body();
|
||||||
|
if (body.getCode() == 200) {
|
||||||
|
|
||||||
|
list = gson.fromJson(body.getDataJson(), new TypeToken<List<WmsHppStorePlaceVo>>() {
|
||||||
|
}.getType());
|
||||||
|
list.forEach(t -> {
|
||||||
|
String storeName = t.getStoreName();
|
||||||
|
String storePlaceCode = t.getStorePlaceCode();
|
||||||
|
if (!options1List.contains(storeName)) {
|
||||||
|
options1List.add(storeName);
|
||||||
|
}
|
||||||
|
int i = options1List.indexOf(storeName);
|
||||||
|
if (options2List.size() <= i) {
|
||||||
|
options2List.add(new ArrayList<>());
|
||||||
|
}
|
||||||
|
List<String> strings = options2List.get(i);
|
||||||
|
|
||||||
|
strings.add(storePlaceCode);
|
||||||
|
|
||||||
|
});
|
||||||
|
opv.setPicker(options1List, options2List);
|
||||||
|
|
||||||
|
}
|
||||||
|
// myToastUitls.show(body.getMsg());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void semiMoveSelect(View view) {
|
||||||
|
opv.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onOptionsSelect(int options1, int options2, int options3, View v) {
|
||||||
|
String locationCode = options2List.get(options1).get(options2);
|
||||||
|
binding.setLocation(locationCode);
|
||||||
|
// Optional<S> first = list.stream().filter(wmsHppStorePlaceVo -> wmsHppStorePlaceVo.getStorePlaceCode()
|
||||||
|
// .equals(locationCode)).map(WmsHppStorePlaceVo::getStorePlaceCode).findFirst();
|
||||||
|
placeId=locationCode;
|
||||||
|
// Log.e("TAG", "onOptionsSelect1:" + first.get());
|
||||||
|
// for (int i = 0; i < list.size(); i++) {
|
||||||
|
// WmsHppStorePlaceVo wmsHppStorePlaceVo = list.get(i);
|
||||||
|
// if (wmsHppStorePlaceVo.getStorePlaceCode().equals(locationCode)){
|
||||||
|
// Log.e("TAG", "onOptionsSelect1:" + i);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// Log.e("TAG", "onOptionsSelect2:" + (options2+options1-1));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void getScannerData(String data) {
|
||||||
|
super.getScannerData(data);
|
||||||
|
selectHppStorageInfo(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void selectHppStorageInfo(String code) {
|
||||||
|
OkGo.<MyResult>post(url + "/wms/pda/semi/selectHppStorageInfo").params("code", code).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(), SemiOutVo.class);
|
||||||
|
semi.setOutNumber(semi.getStorageNum());
|
||||||
|
binding.setData(semi);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
myToastUitls.show(body.getMsg());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void semiMoveSubmit(View view) {
|
||||||
|
|
||||||
|
if (semi==null) return;
|
||||||
|
OkGo.<MyResult>post(url + "/wms/pda/seimMove/submit")
|
||||||
|
.params("id", semi.getObjId())
|
||||||
|
.params("placeId", placeId)
|
||||||
|
.execute(new MyRecultCall(dialog, this) {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Response<MyResult> response) {
|
||||||
|
super.onSuccess(response);
|
||||||
|
var body = response.body();
|
||||||
|
if (body.getCode() == 200) {
|
||||||
|
finish();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
myToastUitls.show(body.getMsg());
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue