增加 反应釜投料误差验证
parent
dce00b7e29
commit
9ef7e50fa6
Binary file not shown.
@ -0,0 +1,114 @@
|
||||
package com.example.pulit;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.example.pulit.entity.PlanView;
|
||||
import com.example.pulit.util.MyOkGoCallback;
|
||||
import com.example.pulit.util.Resust;
|
||||
import com.example.pulit.util.SharedPreferencesUtils;
|
||||
import com.lzy.okgo.OkGo;
|
||||
import com.lzy.okgo.model.Response;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.OnClick;
|
||||
import okhttp3.MediaType;
|
||||
import okhttp3.RequestBody;
|
||||
|
||||
public class So2Activity extends BaseActivity {
|
||||
|
||||
@BindView(R.id.solvent2_code)
|
||||
TextView solvent2Code;
|
||||
@BindView(R.id.solvent2_goods_code)
|
||||
TextView solvent2GoodsCode;
|
||||
private boolean sanType;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_so2);
|
||||
ButterKnife.bind(this);
|
||||
sanType = true;
|
||||
}
|
||||
|
||||
private String Plan_Id;
|
||||
private String PumpBarCode;
|
||||
|
||||
@Override
|
||||
public void scanInfo(String info) {
|
||||
if (sanType) {
|
||||
solvent2Code.setText(info);
|
||||
OkGo.<Resust>get("http://" + SharedPreferencesUtils.getstring("ip", null) + "/api/Solvent/GetByPumpInfo")
|
||||
.params("code", info)
|
||||
.execute(new MyOkGoCallback() {
|
||||
@Override
|
||||
public void onSuccess(Response<Resust> response) {
|
||||
super.onSuccess(response);
|
||||
dialog.dismiss();
|
||||
if (response.body().isSuccess()) {
|
||||
JSONObject dateObj = response.body().getDateObj();
|
||||
Plan_Id = dateObj.getString("Plan_Id");
|
||||
PumpBarCode = dateObj.getString("PumpBarCode");
|
||||
Toast.makeText(So2Activity.this, "查询成功", Toast.LENGTH_SHORT).show();
|
||||
sanType = false;
|
||||
} else {
|
||||
Toast.makeText(So2Activity.this, response.body().getMsg(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Response<Resust> response) {
|
||||
super.onError(response);
|
||||
dialog.dismiss();
|
||||
Toast.makeText(So2Activity.this, "网络请求失败", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
solvent2GoodsCode.setText(info);
|
||||
}
|
||||
}
|
||||
|
||||
@OnClick({R.id.info_title_back, R.id.solvent2_scan, R.id.solvent2_submit})
|
||||
public void onClick(View view) {
|
||||
switch (view.getId()) {
|
||||
case R.id.info_title_back:
|
||||
finish();
|
||||
break;
|
||||
case R.id.solvent2_scan:
|
||||
sanCode();
|
||||
break;
|
||||
case R.id.solvent2_submit:
|
||||
if (Plan_Id == null || Plan_Id.isEmpty()) return;
|
||||
dialog.show();
|
||||
OkGo.<Resust>get("http://" + SharedPreferencesUtils.getstring("ip", null) + "/api/Solvent/ExecState")
|
||||
.params("planId",Plan_Id)
|
||||
.params("pumpCode",PumpBarCode)
|
||||
.params("cylinderCode",solvent2GoodsCode.getText().toString())
|
||||
.execute(new MyOkGoCallback() {
|
||||
@Override
|
||||
public void onSuccess(Response<Resust> response) {
|
||||
super.onSuccess(response);
|
||||
dialog.dismiss();
|
||||
Toast.makeText(So2Activity.this, response.body().getMsg(), Toast.LENGTH_SHORT).show();
|
||||
if (response.body().isSuccess()) {
|
||||
finish();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Response<Resust> response) {
|
||||
super.onError(response);
|
||||
dialog.dismiss();
|
||||
Toast.makeText(So2Activity.this, "网络请求失败", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,103 @@
|
||||
<?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"
|
||||
tools:context=".So2Activity"
|
||||
android:orientation="vertical">
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="55dp"
|
||||
android:background="@color/blue"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
style="@style/title_style"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:text="液体核对" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/info_title_back"
|
||||
android:layout_width="55dp"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="15dp"
|
||||
android:src="@mipmap/icon_back" />
|
||||
</FrameLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="56dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
style="@style/text_view"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="match_parent"
|
||||
android:text="扫描泵位条码" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/solvent2_code"
|
||||
style="@style/text_view2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="10dp"/>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="56dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
style="@style/text_view"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="match_parent"
|
||||
android:text="扫描拉缸条码" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/solvent2_goods_code"
|
||||
style="@style/text_view2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="10dp" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
|
||||
<Button
|
||||
android:id="@+id/solvent2_scan"
|
||||
style="@style/button_style1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="54dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="202dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:text="触发扫描" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/solvent2_submit"
|
||||
style="@style/button_style2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="54dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="22dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:layout_marginBottom="22dp"
|
||||
android:text="提交" />
|
||||
</LinearLayout>
|
Loading…
Reference in New Issue