第一版完成

master
wangh 1 year ago
parent 2302c91787
commit cf38cce772

@ -43,6 +43,8 @@ dependencies {
// https://mvnrepository.com/artifact/com.android.volley/volley
implementation 'com.android.volley:volley:1.2.1'
implementation 'com.lzy.net:okgo:3.0.4'
}

@ -2,6 +2,10 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.pulit">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<application
android:name=".MyApplication"
android:allowBackup="true"
@ -9,8 +13,11 @@
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.PuLiT">
<activity android:name=".X1Activity"></activity>
android:theme="@style/Theme.PuLiT"
android:usesCleartextTraffic="true">
<activity android:name=".SolventActivity"></activity>
<activity android:name=".X2Activity" />
<activity android:name=".X1Activity" />
<activity android:name=".BaseActivity" />
<activity android:name=".MainActivity">
<intent-filter>

@ -1,19 +1,38 @@
package com.example.pulit;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;
import android.Manifest;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import com.android.volley.RequestQueue;
import com.android.volley.toolbox.Volley;
import com.example.pulit.dialog.MyDialog;
import com.example.pulit.dialog.TipDialog;
import java.text.DecimalFormat;
public abstract class BaseActivity extends AppCompatActivity {
private ScanBroadcastReceiver scanBroadcastReceiver;
public RequestQueue mQueue;
public MyDialog dialog;
public DecimalFormat decimalFormat = new DecimalFormat("#.000");
public TipDialog tipDialog;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
scanBroadcastReceiver = new ScanBroadcastReceiver();
// mQueue = Volley.newRequestQueue(this);
ActivityCompat.requestPermissions(this,
new String[]{Manifest.permission.ACCESS_NETWORK_STATE,Manifest.permission.INTERNET},
100);
dialog=new MyDialog(this);
tipDialog=new TipDialog(this);
}
@Override

@ -17,6 +17,7 @@ import butterknife.OnClick;
public class MainActivity extends AppCompatActivity {
private SettingIPDialog textDialog;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@ -31,19 +32,23 @@ public class MainActivity extends AppCompatActivity {
}
@OnClick({R.id.home_xl_b, R.id.home_xl_t, R.id.home_rj_c, R.id.home_rj_t, R.id.home_setting, R.id.home_back})
public void onClick(View view) {
Intent intent = null;
switch (view.getId()) {
case R.id.home_xl_b:
intent=new Intent(this,X1Activity.class);
intent = new Intent(this, X2Activity.class);
break;
case R.id.home_xl_t:
intent = new Intent(this, X1Activity.class);
break;
case R.id.home_rj_c:
intent = new Intent(this, SolventActivity.class);
intent.putExtra("type", true);
break;
case R.id.home_rj_t:
intent = new Intent(this, SolventActivity.class);
intent.putExtra("type", false);
break;
case R.id.home_setting:
textDialog.setIpAddress(SharedPreferencesUtils.getstring("ip", null));

@ -4,10 +4,19 @@ import android.app.Application;
import com.example.pulit.util.SharedPreferencesUtils;
import com.lzy.okgo.OkGo;
import com.lzy.okgo.cache.CacheEntity;
import com.lzy.okgo.cache.CacheMode;
import com.lzy.okgo.cookie.CookieJarImpl;
import com.lzy.okgo.cookie.store.MemoryCookieStore;
import com.lzy.okgo.https.HttpsUtils;
import com.lzy.okgo.interceptor.HttpLoggingInterceptor;
import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
import okhttp3.OkHttpClient;
/**
* @author: wangh
@ -34,7 +43,7 @@ public class MyApplication extends Application {
//OKGO 初始化
private void okGoBase() {
/* OkHttpClient.Builder builder = new OkHttpClient.Builder();
OkHttpClient.Builder builder = new OkHttpClient.Builder();
HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor("OkGo");
//log打印级别决定了log显示的详细程度
loggingInterceptor.setPrintLevel(HttpLoggingInterceptor.Level.BODY);
@ -56,6 +65,8 @@ public class MyApplication extends Application {
OkGo.getInstance().init(this).setOkHttpClient(builder.build()) //建议设置OkHttpClient不设置将使用默认的
.setCacheMode(CacheMode.NO_CACHE) //全局统一缓存模式,默认不使用缓存,可以不传
.setCacheTime(CacheEntity.CACHE_NEVER_EXPIRE) //全局统一缓存时间,默认永不过期,可以不传
.setRetryCount(3);*/
.setRetryCount(3);
}
}

@ -0,0 +1,201 @@
package com.example.pulit;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
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 SolventActivity extends BaseActivity {
@BindView(R.id.solvent_title)
TextView solventTitle;
@BindView(R.id.solvent_frist_name)
TextView solventFristName;
@BindView(R.id.solvent_code)
TextView solventCode;
@BindView(R.id.solvent_title_name)
TextView solventTitleName;
@BindView(R.id.solvent_goods_code)
TextView solventGoodsCode;
@BindView(R.id.solvent_goodsName)
TextView solventGoodsName;
@BindView(R.id.solvent_goods)
TextView solventGoods;
@BindView(R.id.solvent_wc)
TextView solventWc;
// @BindView(R.id.solvent_submit)
// Button solventSubmit;
private boolean type;
private boolean sanType;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_solvent);
ButterKnife.bind(this);
sanType = true;
type = getIntent().getBooleanExtra("type", true);
if (type) {
solventTitle.setText("物料称重");
solventFristName.setText("扫描拉缸条码");
} else {
solventTitle.setText("溶剂投料");
solventFristName.setText("扫描泵位条码");
solventTitleName.setText("扫描容器条码");
}
}
private PlanView planView;
@Override
public void scanInfo(String info) {
if (sanType) {
dialog.show();
solventCode.setText(info);
selectSup(info);
} else {
try {
checkGoods(info);
} catch (Exception e) {
e.printStackTrace();
Toast.makeText(this, "条码格式错误", Toast.LENGTH_SHORT).show();
}
}
}
@OnClick({R.id.info_title_back, R.id.solvent_scan, R.id.solvent_submit})
public void onClick(View view) {
switch (view.getId()) {
case R.id.info_title_back:
finish();
break;
case R.id.solvent_scan:
super.sanCode();
break;
case R.id.solvent_submit:
if (planView == null) return;
dialog.show();
RequestBody requestBody = RequestBody.create(MediaType.parse("application/json;"),
JSONObject.toJSONString(planView));
OkGo.<Resust>post("http://" + SharedPreferencesUtils.getstring("ip", null) + "/api/Warehouse/ExecPlcState")
.upRequestBody(requestBody)
.execute(new MyOkGoCallback() {
@Override
public void onSuccess(Response<Resust> response) {
super.onSuccess(response);
dialog.dismiss();
Toast.makeText(SolventActivity.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(SolventActivity.this, "网络请求失败", Toast.LENGTH_SHORT).show();
}
});
break;
}
}
private void selectSup(String info) {
String uri = type ? "/api/Solvent/GetByCylinderCode" : "/api/Solvent/GetByPumpCode";
OkGo.<Resust>get("http://" + SharedPreferencesUtils.getstring("ip", null) + uri)
.params("code", info)
.execute(new MyOkGoCallback() {
@Override
public void onSuccess(Response<Resust> response) {
super.onSuccess(response);
dialog.dismiss();
if (response.body().isSuccess()) {
planView = JSONObject.parseObject(response.body().getData(), PlanView.class);
// Log.e("TAG", "onSuccess:" + planView.toString());
solventWc.setText(planView.getSet_Error()+"");
Toast.makeText(SolventActivity.this, "扫描成功", Toast.LENGTH_SHORT).show();
sanType = false;
} else {
Toast.makeText(SolventActivity.this, response.body().getMsg(), Toast.LENGTH_SHORT).show();
}
}
@Override
public void onError(Response<Resust> response) {
super.onError(response);
dialog.dismiss();
}
});
}
private void checkGoods(String scanInfo) {
{
solventGoodsCode.setText(scanInfo);
//物料编码
String goodsCode = scanInfo.substring(0, scanInfo.indexOf("-"));
Log.e("TAG", "scanInfo:" + goodsCode);
planView.setCode(goodsCode);
//品名
int index = scanInfo.indexOf("-", scanInfo.indexOf("-", scanInfo.indexOf("-") + 1) + 1) + 1;
int endIndex = scanInfo.indexOf("|");
String goodsName = scanInfo.substring(index, endIndex);
Log.e("TAG", "scanInfo:" + goodsName);
planView.setMaterialName(goodsName);
solventGoodsName.setText(goodsName);
//重量
String format = decimalFormat.format(
Double.parseDouble(
scanInfo.substring(scanInfo.indexOf("|") + 1, scanInfo.indexOf("kg"))
));
solventGoods.setText(format);
double weight = Double.parseDouble(format);
planView.setMaterialWeight(weight);
planView.setWholeMaterial(scanInfo);
double set_weight = planView.getSet_Weight();
double set_error = planView.getSet_Error();
if (type) {
//称量只验证重量
// double set_weight = planView.getSet_Weight();
// double set_error = planView.getSet_Error();
if (set_weight+set_error >= weight && set_weight-set_error <= weight) {
planView.setState(1);
tipDialog.showState(true);
} else {
planView.setState(0);
tipDialog.showState(false);
}
} else {
if (planView.getMaterial_code() .equals(goodsCode) && set_weight+set_error >= weight && set_weight-set_error <= weight) {
planView.setState(1);
tipDialog.showState(true);
} else {
planView.setState(0);
tipDialog.showState(false);
}
}
}
}
}

@ -1,37 +1,97 @@
package com.example.pulit;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.alibaba.fastjson2.JSONObject;
import com.example.pulit.adapter.ItemAdapter;
import com.example.pulit.entity.Item;
import com.example.pulit.entity.X1;
import com.example.pulit.entity.X1Submit;
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 java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import okhttp3.MediaType;
import okhttp3.RequestBody;
public class X1Activity extends BaseActivity {
@BindView(R.id.x1_code)
TextView x1Code;
@BindView(R.id.x1_plan_name)
TextView x1PlanName;
@BindView(R.id.x1_recycler_view)
RecyclerView x1RecyclerView;
@BindView(R.id.x1_tong)
TextView x1Tong;
@BindView(R.id.x1_goods_code)
TextView x1GoodsCode;
@BindView(R.id.x1_goods_name)
TextView x1GoodsName;
@BindView(R.id.x1_goods_Weight)
TextView x1GoodsWeight;
private boolean scanStates;
private List<Item> items;
private ItemAdapter adapter;
private X1Submit entrySubmit;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_x1);
ButterKnife.bind(this);
scanStates = true;
x1RecyclerView.setLayoutManager(new LinearLayoutManager(this));
adapter = new ItemAdapter(this);
}
@Override
public void scanInfo(String info) {
Toast.makeText(this, info, Toast.LENGTH_SHORT).show();
Log.e("TAG", "scanInfo:" + info);
if (scanStates) {
x1Code.setText(info);
dialog.show();
//反应釜查询
getF(info);
} else {
x1Tong.setText(info);
if (info.contains("kg")) {
//整包 截取 物料编码
String goodsCode = info.substring(0, info.indexOf("-"));
//格式化重量
String stringFormatWeight = decimalFormat.format(
Double.parseDouble(info.substring(info.indexOf("|") + 1, info.indexOf("kg"))));
double goodsWeight = Double.parseDouble(stringFormatWeight);
checkItem(goodsCode, goodsWeight, "整包", info);
} else {
//散装、查询接口
selectGoods(info);
}
}
}
@OnClick({R.id.info_title_back, R.id.x1_scan, R.id.x1_submit})
public void onClick(View view) {
@ -43,7 +103,116 @@ public class X1Activity extends BaseActivity {
super.sanCode();
break;
case R.id.x1_submit:
if (entrySubmit == null) return;
dialog.show();
RequestBody requestBody = RequestBody.create(MediaType.parse("application/json;"),
JSONObject.toJSONString(entrySubmit));
OkGo.<Resust>post("http://" + SharedPreferencesUtils.getstring("ip", null) + "/api/Warehouse/ExecPlcState")
.upRequestBody(requestBody)
.execute(new MyOkGoCallback() {
@Override
public void onSuccess(Response<Resust> response) {
super.onSuccess(response);
dialog.dismiss();
Toast.makeText(X1Activity.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();
}
});
break;
}
}
private String kcode;
private int station;
//查询 釜
private void getF(String info) {
OkGo.<Resust>get("http://" + SharedPreferencesUtils.getstring("ip", null) + "/api/Warehouse/GetByCode")
.params("code", info)
.execute(new MyOkGoCallback() {
@Override
public void onSuccess(Response<Resust> response) {
super.onSuccess(response);
dialog.dismiss();
if (response.body().isSuccess()) {
X1 x1 = JSONObject.parseObject(response.body().getData(), X1.class);
station = x1.getID();//
kcode = x1.getBarCode();//
items = x1.getChildren();
adapter.setList(items);
x1RecyclerView.setAdapter(adapter);
scanStates = false;//扫描
} else {
Toast.makeText(X1Activity.this, "请求失败,条码不正确", Toast.LENGTH_SHORT).show();
}
}
@Override
public void onError(Response<Resust> response) {
super.onError(response);
dialog.dismiss();
Toast.makeText(X1Activity.this, "网络请求失败", Toast.LENGTH_SHORT).show();
}
}
);
}
//查询散装
private void selectGoods(String info) {
OkGo.<Resust>get("http://" + SharedPreferencesUtils.getstring("ip", null) + "/api/Warehouse/GetByBarrelInfo")
.params("code", info)
.execute(new MyOkGoCallback() {
@Override
public void onSuccess(Response<Resust> response) {
super.onSuccess(response);
if (response.body().isSuccess()) {
JSONObject obj = response.body().getDateObj();
double goodsWeight = obj.getDoubleValue("Weight");
String goodsCode = obj.getString("MaterialID");
checkItem(goodsCode, goodsWeight, "散装", info);
} else {
Toast.makeText(X1Activity.this, "查询失败,条码不正确", Toast.LENGTH_SHORT).show();
x1GoodsCode.setText(null);
x1GoodsWeight.setText(null);
}
}
@Override
public void onError(Response<Resust> response) {
super.onError(response);
dialog.dismiss();
}
});
}
//比对
private void checkItem(String goodsCode, double goodsWeight, String matType, String info) {
x1GoodsCode.setText(goodsCode);
x1GoodsWeight.setText(goodsWeight + "");
entrySubmit = new X1Submit();
Item item = new Item();
item.setMaterial_Code(goodsCode);
item.setSetWeight(goodsWeight);
if (items.contains(item)) {
entrySubmit.setState(1);
tipDialog.showState(true);
} else {
tipDialog.showState(false);
entrySubmit.setState(2);
}
entrySubmit.setkCode(kcode);
entrySubmit.setStation(station);
entrySubmit.setMatWeight(goodsWeight);
entrySubmit.setMatCode(goodsCode);
entrySubmit.setMatType(matType);
entrySubmit.setWholePackage(info);
}
}

@ -0,0 +1,189 @@
package com.example.pulit;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
import com.alibaba.fastjson2.JSONObject;
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 X2Activity extends BaseActivity {
@BindView(R.id.x2_code)
TextView x2Code;
@BindView(R.id.x2_plan_code)
TextView x2PlanCode;
@BindView(R.id.x2_goods)
TextView x2Goods;
@BindView(R.id.x2_goods_code)
TextView x2GoodsCode;
@BindView(R.id.x2_plan_name)
TextView x2PlanName;
@BindView(R.id.x2_goods_name)
TextView x2GoodsName;
private boolean sanType;
private int state = 0;
private int Bin_Serial;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_x2);
ButterKnife.bind(this);
sanType = true;
}
@Override
public void scanInfo(String info) {
if (sanType) {
x2Code.setText(info);
selectSup(info);
} else {
x2Goods.setText(info);
if (info.contains("kg")) {
//整包 截取
String goodsCode = info.substring(0, info.indexOf("-"));
checkItem(goodsCode);
x2GoodsCode.setText(goodsCode);
int index = info.indexOf("-", info.indexOf("-", info.indexOf("-") + 1) + 1) + 1;
int endIndex = info.indexOf("|");
String goodsName = info.substring(index, endIndex);
x2GoodsName.setText(goodsName);
} else {
selectGoodsInfo(info);
}
}
}
private void checkItem(String goodsCode) {
String planCode = x2PlanCode.getText().toString();
if (planCode.equals(goodsCode)) {
tipDialog.showState(true);
state = 1;
} else {
tipDialog.showState(false);
state = 2;
}
}
@OnClick({R.id.info_title_back, R.id.x2_scan, R.id.x2_submit})
public void onClick(View view) {
switch (view.getId()) {
case R.id.info_title_back:
finish();
break;
case R.id.x2_scan:
super.sanCode();
break;
case R.id.x2_submit:
if (state == 0) return;
dialog.show();
OkGo.<Resust>post("http://" + SharedPreferencesUtils.getstring("ip", null) + "/api/xl_material/ExecPlcCode")
.params("code",Bin_Serial)
.params("state",state)
.execute(new MyOkGoCallback() {
@Override
public void onSuccess(Response<Resust> response) {
super.onSuccess(response);
dialog.dismiss();
Toast.makeText(X2Activity.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();
}
});
break;
}
}
private void selectSup(String info) {
dialog.show();
OkGo.<Resust>get("http://" + SharedPreferencesUtils.getstring("ip", null) + "/api/xl_material/GetByBinCode")
.params("code", info)
.execute(new MyOkGoCallback() {
@Override
public void onSuccess(Response<Resust> response) {
super.onSuccess(response);
dialog.dismiss();
if (response.body().isSuccess()) {
JSONObject obj = response.body().getDateObj();
x2PlanCode.setText(obj.getString("Material_code"));
Bin_Serial=obj.getInteger("Bin_Serial");
x2PlanName.setText(obj.getString("Material_Name"));
sanType=false;
} else {
Toast.makeText(X2Activity.this, "请求失败,条码不正确", Toast.LENGTH_SHORT).show();
x2PlanCode.setText(null);
x2PlanName.setText(null);
}
}
@Override
public void onError(Response<Resust> response) {
super.onError(response);
dialog.dismiss();
Toast.makeText(X2Activity.this, "网络请求失败", Toast.LENGTH_SHORT).show();
}
}
);
}
private void selectGoodsInfo(String info) {
dialog.show();
OkGo.<Resust>get("http://" + SharedPreferencesUtils.getstring("ip", null) + "/api/xl_material/GetByMaterialCode")
.params("code", info)
.execute(new MyOkGoCallback() {
@Override
public void onSuccess(Response<Resust> response) {
super.onSuccess(response);
dialog.dismiss();
if (response.body().isSuccess()) {
JSONObject obj = response.body().getDateObj();
String material_code = obj.getString("Material_code");
x2GoodsCode.setText(material_code);
x2GoodsName.setText(obj.getString("Material_name"));
checkItem(material_code);
} else {
Toast.makeText(X2Activity.this, "请求失败,条码不正确", Toast.LENGTH_SHORT).show();
x2GoodsCode.setText(null);
x2GoodsCode.setText(null);
}
}
@Override
public void onError(Response<Resust> response) {
super.onError(response);
dialog.dismiss();
Toast.makeText(X2Activity.this, "网络请求失败", Toast.LENGTH_SHORT).show();
}
}
);
}
}

@ -0,0 +1,106 @@
package com.example.pulit.adapter;
import android.content.Context;
import android.os.Build;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.RequiresApi;
import androidx.recyclerview.widget.RecyclerView;
import com.example.pulit.R;
import com.example.pulit.entity.Item;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
/**
* @author: wangh
* @description:
* @date: 2019/08/06-08:36
*/
public class ItemAdapter extends RecyclerView.Adapter<ItemAdapter.MyViewHolder> {
private List<Item> list;
private Context mContext;
private LayoutInflater inflater;
public void setList(List<Item> list) {
this.list = list;
}
public ItemAdapter(Context mContext) {
this.mContext = mContext;
inflater = LayoutInflater.from(mContext);
}
//创建
@NonNull
@Override
public MyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = inflater.inflate(R.layout.item_layout, parent, false);
return new MyViewHolder(view);
}
@Override
public void onBindViewHolder(@NonNull MyViewHolder holder, int position) {
Item been = list.get(position);
holder.index.setText(position+1+"");
holder.code.setText(been.getMaterial_Code());
holder.name.setText(been.getMaterialName());
holder.number.setText(been.getSetWeight()+"");
}
//没用
@RequiresApi(api = Build.VERSION_CODES.N)
@Override
public int getItemCount() {
return Optional.ofNullable(list).map(u -> list.size()).orElse(0);
}
//刷新
@Override
public void onBindViewHolder(@NonNull MyViewHolder holder, int position, @NonNull List<Object> payloads) {
super.onBindViewHolder(holder, position, payloads);
if (payloads.isEmpty()) {
onBindViewHolder(holder, position); //绑定数据
} else {//刷新倒计时所在的View
Log.e("test", "刷新倒计时所在的View");
}
}
//如果要点击变色必须要写用来固定view
class MyViewHolder extends RecyclerView.ViewHolder {
TextView index;
TextView code;
TextView name;
TextView number;
public MyViewHolder(View view) {
super(view);
index=view.findViewById(R.id.item_index);
code=view.findViewById(R.id.item_code);
name=view.findViewById(R.id.item_name);
number=view.findViewById(R.id.item_weight);
}
}
public interface ItemClikeLitener{
public void onItemClick(int tag);
}
}

@ -3,6 +3,7 @@ package com.example.pulit.dialog;
import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
@ -11,6 +12,7 @@ import androidx.annotation.NonNull;
import com.example.pulit.R;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
@ -21,12 +23,11 @@ import butterknife.OnClick;
*/
public class TipDialog extends Dialog {
@BindView(R.id.tip1_state)
ImageView tip1State;
@BindView(R.id.tip1_info)
TextView tip1Info;
private boolean state;
public TipDialog(@NonNull Context context) {
super(context, R.style.CustomDialog);
@ -36,10 +37,29 @@ public class TipDialog extends Dialog {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.dialog_layout);
ButterKnife.bind(this);
setCanceledOnTouchOutside(false);
}
@OnClick(R.id.tip1_button)
public void onClick() {
dismiss();
}
public void showState(boolean state) {
super.show();
tip1State.setImageResource(state ? R.mipmap.dialog_yes : R.mipmap.dialog_jingg);
tip1Info.setText(state ? "匹配成功" : "匹配失败");
}
private void showMsg(boolean state, String msg) {
super.show();
tip1State.setImageResource(state ? R.mipmap.dialog_yes : R.mipmap.dialog_jingg);
tip1Info.setText(msg);
}
}

@ -0,0 +1,83 @@
package com.example.pulit.entity;
/**
* @author wanghao
* @date 2023/8/7 15:42
*/
public class Item {
private int ID;
private String MainId;
private String MaterialID;
private String MaterialName;
private String Material_Code;
private double SetWeight;
public int getID() {
return ID;
}
public void setID(int ID) {
this.ID = ID;
}
public String getMainId() {
return MainId;
}
public void setMainId(String mainId) {
MainId = mainId;
}
public String getMaterialID() {
return MaterialID;
}
public void setMaterialID(String materialID) {
MaterialID = materialID;
}
public String getMaterialName() {
return MaterialName;
}
public void setMaterialName(String materialName) {
MaterialName = materialName;
}
public String getMaterial_Code() {
return Material_Code;
}
public void setMaterial_Code(String material_Code) {
Material_Code = material_Code;
}
public double getSetWeight() {
return SetWeight;
}
public void setSetWeight(double setWeight) {
SetWeight = setWeight;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Item item = (Item) o;
if (Double.compare(item.SetWeight, SetWeight) != 0) return false;
return Material_Code != null ? Material_Code.equals(item.Material_Code) : item.Material_Code == null;
}
@Override
public int hashCode() {
int result;
long temp;
result = Material_Code != null ? Material_Code.hashCode() : 0;
temp = Double.doubleToLongBits(SetWeight);
result = 31 * result + (int) (temp ^ (temp >>> 32));
return result;
}
}

@ -0,0 +1,297 @@
package com.example.pulit.entity;
/**
* @author wanghao
* @date 2023/8/8 13:54
*/
public class PlanView {
private int Mid;//物料下发排序ID
private String Plan_Id; //计划ID
private int Plan_Num;//计划执行数量
private int Real_Num;//实际执行数量
private int Plan_Serial;//计划序号我拿来传给PLC作为了唯一值
private String Plan_Date;//计划执行时间
private int Plan_State;// 计划执行状态
private String Plan_StateText;//中文状态标识
private double Plan_TotalError;//合计误差
private double Plan_TotalWeight;//合计重量
private String RecipeID;//配方ID
private String Recipe_Serial;//配方序列
private String Recipe_Name;//配方名称
private String Version;//版本
private String Recipe_Verify;//否是在计划中展示
private double Total_Weight;//配方重量
private double Total_Error;//配方误差
private String MaterialID;//物料ID
private String Material_name;//;物料
private double Set_Weight;//设置重量
private double Set_Error;//设置误差
private String Material_code;
private int RMatCode;//物料编码
private String Code;//匹配物料编码
private String MaterialName;//匹配物料名称
private double MaterialWeight;//匹配物料重量
private String WholeMaterial;
private int State;
public int getMid() {
return Mid;
}
public String getMaterial_code() {
return Material_code;
}
public void setMaterial_code(String material_code) {
Material_code = material_code;
}
public void setMid(int mid) {
Mid = mid;
}
public String getPlan_Id() {
return Plan_Id;
}
public void setPlan_Id(String plan_Id) {
Plan_Id = plan_Id;
}
public int getPlan_Num() {
return Plan_Num;
}
public void setPlan_Num(int plan_Num) {
Plan_Num = plan_Num;
}
public int getReal_Num() {
return Real_Num;
}
public void setReal_Num(int real_Num) {
Real_Num = real_Num;
}
public int getPlan_Serial() {
return Plan_Serial;
}
public void setPlan_Serial(int plan_Serial) {
Plan_Serial = plan_Serial;
}
public String getPlan_Date() {
return Plan_Date;
}
public void setPlan_Date(String plan_Date) {
Plan_Date = plan_Date;
}
public int getPlan_State() {
return Plan_State;
}
public void setPlan_State(int plan_State) {
Plan_State = plan_State;
}
public String getPlan_StateText() {
return Plan_StateText;
}
public void setPlan_StateText(String plan_StateText) {
Plan_StateText = plan_StateText;
}
public double getPlan_TotalError() {
return Plan_TotalError;
}
public void setPlan_TotalError(double plan_TotalError) {
Plan_TotalError = plan_TotalError;
}
public double getPlan_TotalWeight() {
return Plan_TotalWeight;
}
public void setPlan_TotalWeight(double plan_TotalWeight) {
Plan_TotalWeight = plan_TotalWeight;
}
public String getRecipeID() {
return RecipeID;
}
public void setRecipeID(String recipeID) {
RecipeID = recipeID;
}
public String getRecipe_Serial() {
return Recipe_Serial;
}
public void setRecipe_Serial(String recipe_Serial) {
Recipe_Serial = recipe_Serial;
}
public String getRecipe_Name() {
return Recipe_Name;
}
public void setRecipe_Name(String recipe_Name) {
Recipe_Name = recipe_Name;
}
public String getVersion() {
return Version;
}
public void setVersion(String version) {
Version = version;
}
public String getRecipe_Verify() {
return Recipe_Verify;
}
public void setRecipe_Verify(String recipe_Verify) {
Recipe_Verify = recipe_Verify;
}
public double getTotal_Weight() {
return Total_Weight;
}
public void setTotal_Weight(double total_Weight) {
Total_Weight = total_Weight;
}
public double getTotal_Error() {
return Total_Error;
}
public void setTotal_Error(double total_Error) {
Total_Error = total_Error;
}
public String getMaterialID() {
return MaterialID;
}
public void setMaterialID(String materialID) {
MaterialID = materialID;
}
public String getMaterial_name() {
return Material_name;
}
public void setMaterial_name(String material_name) {
Material_name = material_name;
}
public double getSet_Weight() {
return Set_Weight;
}
public void setSet_Weight(double set_Weight) {
Set_Weight = set_Weight;
}
public double getSet_Error() {
return Set_Error;
}
public void setSet_Error(double set_Error) {
Set_Error = set_Error;
}
public int getRMatCode() {
return RMatCode;
}
public void setRMatCode(int RMatCode) {
this.RMatCode = RMatCode;
}
public String getCode() {
return Code;
}
public void setCode(String code) {
Code = code;
}
public String getMaterialName() {
return MaterialName;
}
public void setMaterialName(String materialName) {
MaterialName = materialName;
}
public double getMaterialWeight() {
return MaterialWeight;
}
public void setMaterialWeight(double materialWeight) {
MaterialWeight = materialWeight;
}
public String getWholeMaterial() {
return WholeMaterial;
}
public void setWholeMaterial(String wholeMaterial) {
WholeMaterial = wholeMaterial;
}
public int getState() {
return State;
}
public void setState(int state) {
State = state;
}
@Override
public String toString() {
return "PlanView{" +
"Mid=" + Mid +
", Plan_Id='" + Plan_Id + '\'' +
", Plan_Num=" + Plan_Num +
", Real_Num=" + Real_Num +
", Plan_Serial=" + Plan_Serial +
", Plan_Date='" + Plan_Date + '\'' +
", Plan_State=" + Plan_State +
", Plan_StateText='" + Plan_StateText + '\'' +
", Plan_TotalError=" + Plan_TotalError +
", Plan_TotalWeight=" + Plan_TotalWeight +
", RecipeID='" + RecipeID + '\'' +
", Recipe_Serial='" + Recipe_Serial + '\'' +
", Recipe_Name='" + Recipe_Name + '\'' +
", Version='" + Version + '\'' +
", Recipe_Verify='" + Recipe_Verify + '\'' +
", Total_Weight=" + Total_Weight +
", Total_Error=" + Total_Error +
", MaterialID='" + MaterialID + '\'' +
", Material_name='" + Material_name + '\'' +
", Set_Weight=" + Set_Weight +
", Set_Error=" + Set_Error +
", RMatCode=" + RMatCode +
", Code='" + Code + '\'' +
", MaterialName='" + MaterialName + '\'' +
", MaterialWeight=" + MaterialWeight +
", WholeMaterial='" + WholeMaterial + '\'' +
", State=" + State +
'}';
}
}

@ -0,0 +1,66 @@
package com.example.pulit.entity;
import java.util.List;
/**
* @author wanghao
* @date 2023/8/7 15:39
*/
public class X1 {
private int ID;
private String Name;
private String BarCode;
private String CreateTime;
private List<Item> Children;
public int getID() {
return ID;
}
public void setID(int ID) {
this.ID = ID;
}
public String getName() {
return Name;
}
public void setName(String name) {
Name = name;
}
public String getBarCode() {
return BarCode;
}
public void setBarCode(String barCode) {
BarCode = barCode;
}
public String getCreateTime() {
return CreateTime;
}
public void setCreateTime(String createTime) {
CreateTime = createTime;
}
public List<Item> getChildren() {
return Children;
}
public void setChildren(List<Item> children) {
Children = children;
}
@Override
public String toString() {
return "X1{" +
"ID=" + ID +
", Name='" + Name + '\'' +
", BarCode='" + BarCode + '\'' +
", CreateTime='" + CreateTime + '\'' +
", Children=" + Children +
'}';
}
}

@ -0,0 +1,70 @@
package com.example.pulit.entity;
/**
* @author wanghao
* @date 2023/8/8 11:20
*/
public class X1Submit {
private int station;// 釜工位——主键
private String kCode;// 投料釜条码
private String matCode;// 物料条码
private double matWeight;//物料重量
private String matType;// 物料类型:整包、散装
private int state;//状态 0:未扫描 1:匹配 2:报警
private String wholePackage;
public int getStation() {
return station;
}
public void setStation(int station) {
this.station = station;
}
public String getkCode() {
return kCode;
}
public void setkCode(String kCode) {
this.kCode = kCode;
}
public String getMatCode() {
return matCode;
}
public void setMatCode(String matCode) {
this.matCode = matCode;
}
public double getMatWeight() {
return matWeight;
}
public void setMatWeight(double matWeight) {
this.matWeight = matWeight;
}
public String getMatType() {
return matType;
}
public void setMatType(String matType) {
this.matType = matType;
}
public int getState() {
return state;
}
public String getWholePackage() {
return wholePackage;
}
public void setWholePackage(String wholePackage) {
this.wholePackage = wholePackage;
}
public void setState(int state) {
this.state = state;
}
}

@ -0,0 +1,34 @@
package com.example.pulit.util;
import com.alibaba.fastjson2.JSONObject;
import com.lzy.okgo.callback.AbsCallback;
import com.lzy.okgo.model.Response;
import okhttp3.ResponseBody;
/**
* @author wanghao
* @date 2022/9/20 17:26
*/
public class MyOkGoCallback extends AbsCallback<Resust> {
@Override
public void onSuccess(Response<Resust> response) {
}
@Override
public Resust convertResponse(okhttp3.Response response) throws Throwable {
ResponseBody body = response.body();
if (body == null) return null;
Resust resust = JSONObject.parseObject(body.string(), Resust.class);
return resust;
}
}

@ -0,0 +1,59 @@
package com.example.pulit.util;
import com.alibaba.fastjson2.JSONObject;
/**
* @author wanghao
* @date 2022/9/20 17:22
*/
public class Resust {
private int status;
private boolean success;
private Object data;
private String msg;
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
public boolean isSuccess() {
return success;
}
public void setSuccess(boolean success) {
this.success = success;
}
public String getData() {
return data.toString();
}
public JSONObject getDateObj(){
return (JSONObject)data;
}
public void setData(Object data) {
this.data = data;
}
@Override
public String toString() {
return "Resust{" +
"status=" + status +
", success=" + success +
", data=" + data +
'}';
}
}

@ -34,13 +34,13 @@
android:id="@+id/home_xl_b"
style="@style/TabRadioButton"
android:drawableTop="@mipmap/home_xl"
android:text="料补料" />
android:text="料补料" />
<RadioButton
android:id="@+id/home_xl_t"
style="@style/TabRadioButton"
android:drawableTop="@mipmap/home_xl"
android:text="小料投料" />
android:text="粉体投料" />
</RadioGroup>
@ -59,7 +59,7 @@
android:id="@+id/home_rj_c"
style="@style/TabRadioButton"
android:drawableTop="@mipmap/home_rj"
android:text="溶剂称量" />
android:text="物料称重" />
<RadioButton
android:id="@+id/home_rj_t"

@ -0,0 +1,168 @@
<?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=".SolventActivity"
android:orientation="vertical">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="55dp"
android:background="@color/blue"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/solvent_title"
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="46dp"
android:layout_marginStart="10dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="10dp"
android:orientation="horizontal">
<TextView
android:id="@+id/solvent_frist_name"
style="@style/text_view"
android:layout_width="100dp"
android:layout_height="46dp"
android:text="" />
<TextView
android:id="@+id/solvent_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="46dp"
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="46dp"
android:text="设置误差" />
<TextView
android:id="@+id/solvent_wc"
style="@style/text_view1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="10dp"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="46dp"
android:layout_marginStart="10dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="10dp"
android:orientation="horizontal">
<TextView
android:id="@+id/solvent_title_name"
style="@style/text_view"
android:layout_width="100dp"
android:layout_height="46dp"
android:text="扫描物料条码" />
<TextView
android:id="@+id/solvent_goods_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="46dp"
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="46dp"
android:text="物料名称" />
<TextView
android:id="@+id/solvent_goodsName"
style="@style/text_view1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="10dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="46dp"
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="46dp"
android:text="物料重量" />
<TextView
android:id="@+id/solvent_goods"
style="@style/text_view1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="10dp" />
</LinearLayout>
<Button
android:id="@+id/solvent_scan"
style="@style/button_style1"
android:layout_width="match_parent"
android:layout_height="54dp"
android:layout_marginStart="20dp"
android:layout_marginTop="22dp"
android:layout_marginEnd="20dp"
android:text="触发扫描" />
<Button
android:id="@+id/solvent_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>

@ -5,12 +5,12 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@color/bg1"
tools:context=".X1Activity">
<FrameLayout
android:id="@+id/frameLayout"
android:layout_width="match_parent"
android:layout_height="59dp"
android:layout_height="55dp"
android:background="@color/blue"
app:layout_constraintTop_toTopOf="parent">
@ -18,7 +18,7 @@
style="@style/title_style"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="小料补料" />
android:text="粉体投料" />
<ImageView
android:id="@+id/info_title_back"
@ -39,38 +39,50 @@
<TextView
style="@style/text_view"
android:layout_width="120dp"
android:layout_width="100dp"
android:layout_height="46dp"
android:text="扫描料仓条码" />
android:text="扫描釜位条码" />
<TextView
android:id="@+id/x1_code"
style="@style/text_view2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="13dp" />
android:layout_marginLeft="10dp"/>
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/x1_recycler_view"
android:layout_width="match_parent"
android:background="@color/white"
android:layout_height="match_parent"
android:paddingLeft="10dp"
android:layout_marginTop="6dp"
android:paddingEnd="10dp"
android:layout_weight="1"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="46dp"
android:layout_marginStart="10dp"
android:layout_marginTop="20dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:orientation="horizontal">
<TextView
style="@style/text_view"
android:layout_width="120dp"
android:layout_width="100dp"
android:layout_height="46dp"
android:text="计划物料名称" />
android:text="扫描整包条码" />
<TextView
android:id="@+id/x1_plan_name"
style="@style/text_view1"
android:id="@+id/x1_tong"
style="@style/text_view2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="13dp" />
android:layout_marginLeft="10dp" />
</LinearLayout>
<LinearLayout
@ -83,18 +95,17 @@
<TextView
style="@style/text_view"
android:layout_width="120dp"
android:layout_width="100dp"
android:layout_height="46dp"
android:text="扫描物料条码" />
android:text="物料条码" />
<TextView
android:id="@+id/x1_goods_code"
style="@style/text_view2"
style="@style/text_view1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="13dp" />
android:layout_marginLeft="10dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="46dp"
@ -105,16 +116,16 @@
<TextView
style="@style/text_view"
android:layout_width="120dp"
android:layout_width="100dp"
android:layout_height="46dp"
android:text="物料查询结果" />
android:text="物料重量" />
<TextView
android:id="@+id/x1_goods_name"
android:id="@+id/x1_goods_Weight"
style="@style/text_view1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="13dp" />
android:layout_marginLeft="10dp" />
</LinearLayout>
<Button
@ -123,7 +134,7 @@
android:layout_width="match_parent"
android:layout_height="54dp"
android:layout_marginStart="20dp"
android:layout_marginTop="52dp"
android:layout_marginTop="22dp"
android:layout_marginEnd="20dp"
android:text="触发扫描" />
@ -135,7 +146,8 @@
android:layout_marginStart="20dp"
android:layout_marginTop="22dp"
android:layout_marginEnd="20dp"
android:text="补料完毕" />
android:layout_marginBottom="22dp"
android:text="粉体投料完毕" />
</LinearLayout>

@ -0,0 +1,184 @@
<?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=".X2Activity"
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="46dp"
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="46dp"
android:text="扫描料仓条码" />
<TextView
android:id="@+id/x2_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="46dp"
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="46dp"
android:text="计划物料编码" />
<TextView
android:id="@+id/x2_plan_code"
style="@style/text_view1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="10dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="46dp"
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="46dp"
android:text="计划物料名称" />
<TextView
android:id="@+id/x2_plan_name"
style="@style/text_view1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="10dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="46dp"
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="46dp"
android:text="扫描原材料" />
<TextView
android:id="@+id/x2_goods"
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="46dp"
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="46dp"
android:text="实际物料条码" />
<TextView
android:id="@+id/x2_goods_code"
style="@style/text_view1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="10dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="46dp"
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="46dp"
android:text="实际物料名称" />
<TextView
android:id="@+id/x2_goods_name"
style="@style/text_view1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="10dp" />
</LinearLayout>
<Button
android:id="@+id/x2_scan"
style="@style/button_style1"
android:layout_width="match_parent"
android:layout_height="54dp"
android:layout_marginStart="20dp"
android:layout_marginTop="22dp"
android:layout_marginEnd="20dp"
android:text="触发扫描" />
<Button
android:id="@+id/x2_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>

@ -1,21 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="246dp"
android:layout_width="355dp"
android:layout_height="230dp"
android:background="@drawable/dialog_bg">
<ImageView
android:id="@+id/tip1_state"
android:layout_width="match_parent"
android:layout_height="55dp"
android:layout_marginTop="23dp"
android:layout_height="85dp"
android:layout_marginTop="13dp"
android:gravity="center"
android:src="@mipmap/dialog_jingg" />
<TextView
android:id="@+id/tip1_info"
android:layout_width="match_parent"
android:layout_height="90dp"
android:layout_height="70dp"
android:text="是否使用"
android:layout_marginTop="5dp"
android:textSize="22sp"

@ -0,0 +1,57 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="44dp"
android:layout_marginTop="2dp"
android:background="#DEE3E6"
android:orientation="horizontal">
<TextView
android:id="@+id/item_index"
style="@style/item_text_style"
android:layout_width="50dp"
android:layout_height="match_parent"
android:text="01" />
<View
android:layout_width="2dp"
android:layout_height="match_parent"
android:background="@color/white" />
<TextView
android:id="@+id/item_code"
style="@style/item_text_style"
android:layout_width="100dp"
android:layout_height="match_parent"
android:text="000001" />
<View
android:layout_width="2dp"
android:layout_height="match_parent"
android:background="@color/white" />
<TextView
android:id="@+id/item_name"
style="@style/item_text_style"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="面涂稀释剂S823A" />
<View
android:layout_width="2dp"
android:layout_height="match_parent"
android:background="@color/white" />
<TextView
android:id="@+id/item_weight"
style="@style/item_text_style"
android:layout_width="80dp"
android:layout_height="match_parent"
android:text="55.001" />
</LinearLayout>

@ -6,7 +6,7 @@
<item name="android:letterSpacing">0.133</item>
<item name="android:textColor">@color/white</item>
<item name="android:textSize">27sp</item>
<item name="android:textSize">22sp</item>
</style>
<style name="TabRadioButton">
@ -33,14 +33,14 @@
<item name="android:backgroundDimEnabled">true</item>
</style>
<style name="text_view">
<item name="android:textSize">19sp</item>
<item name="android:textSize">16sp</item>
<item name="android:gravity">center</item>
<item name="android:textColor">#666666</item>
<item name="android:letterSpacing">0.033</item>
</style>
<style name="text_view1">
<item name="android:textSize">19sp</item>
<item name="android:textSize">18sp</item>
<item name="android:background">@drawable/text_bg1</item>
<item name="android:paddingLeft">20dp</item>
<item name="android:paddingRight">14dp</item>
@ -51,10 +51,10 @@
<style name="text_view2">
<item name="android:textSize">19sp</item>
<item name="android:textSize">18sp</item>
<item name="android:background">@drawable/text_bg2</item>
<item name="android:paddingLeft">20dp</item>
<item name="android:paddingRight">14dp</item>
<item name="android:paddingLeft">5dp</item>
<item name="android:paddingRight">5dp</item>
<item name="android:gravity">center|left</item>
<item name="android:textColor">#333333</item>
<item name="android:letterSpacing">0.033</item>

Loading…
Cancel
Save