增加 小料重量核对

master
wangh 1 year ago
parent cf38cce772
commit dce00b7e29

Binary file not shown.

@ -0,0 +1,18 @@
{
"version": 2,
"artifactType": {
"type": "APK",
"kind": "Directory"
},
"applicationId": "com.example.pulit",
"variantName": "release",
"elements": [
{
"type": "SINGLE",
"filters": [],
"versionCode": 1,
"versionName": "1.0",
"outputFile": "app-release.apk"
}
]
}

@ -15,7 +15,8 @@
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/Theme.PuLiT" android:theme="@style/Theme.PuLiT"
android:usesCleartextTraffic="true"> android:usesCleartextTraffic="true">
<activity android:name=".SolventActivity"></activity> <activity android:name=".X3Activity"></activity>
<activity android:name=".SolventActivity" />
<activity android:name=".X2Activity" /> <activity android:name=".X2Activity" />
<activity android:name=".X1Activity" /> <activity android:name=".X1Activity" />
<activity android:name=".BaseActivity" /> <activity android:name=".BaseActivity" />

@ -32,7 +32,7 @@ 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}) @OnClick({R.id.home_xl_b, R.id.home_xl_t, R.id.home_xl_z, R.id.home_rj_c, R.id.home_rj_t, R.id.home_setting, R.id.home_back})
public void onClick(View view) { public void onClick(View view) {
Intent intent = null; Intent intent = null;
switch (view.getId()) { switch (view.getId()) {
@ -42,6 +42,9 @@ public class MainActivity extends AppCompatActivity {
case R.id.home_xl_t: case R.id.home_xl_t:
intent = new Intent(this, X1Activity.class); intent = new Intent(this, X1Activity.class);
break; break;
case R.id.home_xl_z:
intent = new Intent(this, X3Activity.class);
break;
case R.id.home_rj_c: case R.id.home_rj_c:
intent = new Intent(this, SolventActivity.class); intent = new Intent(this, SolventActivity.class);
intent.putExtra("type", true); intent.putExtra("type", true);

@ -65,7 +65,7 @@ public class MyApplication extends Application {
OkGo.getInstance().init(this).setOkHttpClient(builder.build()) //建议设置OkHttpClient不设置将使用默认的 OkGo.getInstance().init(this).setOkHttpClient(builder.build()) //建议设置OkHttpClient不设置将使用默认的
.setCacheMode(CacheMode.NO_CACHE) //全局统一缓存模式,默认不使用缓存,可以不传 .setCacheMode(CacheMode.NO_CACHE) //全局统一缓存模式,默认不使用缓存,可以不传
.setCacheTime(CacheEntity.CACHE_NEVER_EXPIRE) //全局统一缓存时间,默认永不过期,可以不传 .setCacheTime(CacheEntity.CACHE_NEVER_EXPIRE) //全局统一缓存时间,默认永不过期,可以不传
.setRetryCount(3); .setRetryCount(1);
} }

@ -54,7 +54,7 @@ public class SolventActivity extends BaseActivity {
sanType = true; sanType = true;
type = getIntent().getBooleanExtra("type", true); type = getIntent().getBooleanExtra("type", true);
if (type) { if (type) {
solventTitle.setText("物料称重"); solventTitle.setText("液体称量");
solventFristName.setText("扫描拉缸条码"); solventFristName.setText("扫描拉缸条码");
} else { } else {
solventTitle.setText("溶剂投料"); solventTitle.setText("溶剂投料");

@ -0,0 +1,72 @@
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.appcompat.app.AppCompatActivity;
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 X3Activity extends BaseActivity {
@BindView(R.id.x3_code)
TextView x3Code;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_x3);
ButterKnife.bind(this);
}
@Override
public void scanInfo(String info) {
x3Code.setText(info);
Log.e("TAG", "scanInfo:" + info);
dialog.show();
OkGo.<Resust>get("http://" + SharedPreferencesUtils.getstring("ip", null) + "/api/xl_material/BindBarrel")
.params("code",info)
.execute(new MyOkGoCallback() {
@Override
public void onSuccess(Response<Resust> response) {
super.onSuccess(response);
dialog.dismiss();
Resust body = response.body();
boolean b= body.isSuccess();
tipDialog.showMsg(b,body.getMsg());
}
@Override
public void onError(Response<Resust> response) {
super.onError(response);
dialog.dismiss();
Toast.makeText(X3Activity.this, "网络请求失败", Toast.LENGTH_SHORT).show();
}
});
}
@OnClick({R.id.info_title_back, R.id.x3_scan})
public void onClick(View view) {
switch (view.getId()) {
case R.id.info_title_back:
finish();
break;
case R.id.x3_scan:
break;
}
}
}

@ -54,7 +54,7 @@ public class TipDialog extends Dialog {
} }
private void showMsg(boolean state, String msg) { public void showMsg(boolean state, String msg) {
super.show(); super.show();
tip1State.setImageResource(state ? R.mipmap.dialog_yes : R.mipmap.dialog_jingg); tip1State.setImageResource(state ? R.mipmap.dialog_yes : R.mipmap.dialog_jingg);
tip1Info.setText(msg); tip1Info.setText(msg);

@ -22,8 +22,8 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="140dp" android:layout_height="140dp"
android:layout_marginTop="162dp"
android:layout_marginStart="30dp" android:layout_marginStart="30dp"
android:layout_marginTop="162dp"
android:layout_marginEnd="30dp" android:layout_marginEnd="30dp"
android:orientation="horizontal" android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
@ -34,13 +34,19 @@
android:id="@+id/home_xl_b" android:id="@+id/home_xl_b"
style="@style/TabRadioButton" style="@style/TabRadioButton"
android:drawableTop="@mipmap/home_xl" android:drawableTop="@mipmap/home_xl"
android:text="料补料" /> android:text="料补料" />
<RadioButton <RadioButton
android:id="@+id/home_xl_t" android:id="@+id/home_xl_t"
style="@style/TabRadioButton" style="@style/TabRadioButton"
android:drawableTop="@mipmap/home_xl" android:drawableTop="@mipmap/home_xl"
android:text="粉体投料" /> android:text="反应釜投料" />
<RadioButton
android:id="@+id/home_xl_z"
style="@style/TabRadioButton"
android:drawableTop="@mipmap/home_xl"
android:text="小料重量 核对" />
</RadioGroup> </RadioGroup>
@ -59,7 +65,7 @@
android:id="@+id/home_rj_c" android:id="@+id/home_rj_c"
style="@style/TabRadioButton" style="@style/TabRadioButton"
android:drawableTop="@mipmap/home_rj" android:drawableTop="@mipmap/home_rj"
android:text="物料称重" /> android:text="液体称量" />
<RadioButton <RadioButton
android:id="@+id/home_rj_t" android:id="@+id/home_rj_t"

@ -18,7 +18,7 @@
style="@style/title_style" style="@style/title_style"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:text="粉体投料" /> android:text="反应釜投料" />
<ImageView <ImageView
android:id="@+id/info_title_back" android:id="@+id/info_title_back"
@ -147,7 +147,7 @@
android:layout_marginTop="22dp" android:layout_marginTop="22dp"
android:layout_marginEnd="20dp" android:layout_marginEnd="20dp"
android:layout_marginBottom="22dp" android:layout_marginBottom="22dp"
android:text="粉体投料完毕" /> android:text="反应釜投料完毕" />
</LinearLayout> </LinearLayout>

@ -17,7 +17,7 @@
style="@style/title_style" style="@style/title_style"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:text="料补料" /> android:text="料补料" />
<ImageView <ImageView
android:id="@+id/info_title_back" android:id="@+id/info_title_back"

@ -0,0 +1,61 @@
<?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=".X3Activity"
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="66dp"
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/x3_code"
style="@style/text_view2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="10dp"/>
</LinearLayout>
<Button
android:id="@+id/x3_scan"
style="@style/button_style1"
android:layout_width="match_parent"
android:layout_height="54dp"
android:layout_marginStart="20dp"
android:layout_marginTop="450dp"
android:layout_marginEnd="20dp"
android:text="触发扫描" />
</LinearLayout>

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:orientation="vertical"
android:layout_width="355dp" android:layout_width="365dp"
android:layout_height="230dp" android:layout_height="230dp"
android:background="@drawable/dialog_bg"> android:background="@drawable/dialog_bg">
@ -19,6 +19,8 @@
android:text="是否使用" android:text="是否使用"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:textSize="22sp" android:textSize="22sp"
android:paddingStart="10dp"
android:paddingEnd="10dp"
android:textColor="@color/black" android:textColor="@color/black"
android:gravity="center"/> android:gravity="center"/>
<View <View

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Loading…
Cancel
Save