Compare commits

...

10 Commits

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="deploymentTargetDropDown">
<targetSelectedWithDropDown>
<Target>
<type value="QUICK_BOOT_TARGET" />
<deviceKey>
<Key>
<type value="VIRTUAL_DEVICE_PATH" />
<value value="C:\Users\wanghao\.android\avd\Pixel_XL_API_33.avd" />
</Key>
</deviceKey>
</Target>
</targetSelectedWithDropDown>
<timeTargetWasSelectedWithDropDown value="2025-01-09T11:21:07.708219300Z" />
</component>
</project>

@ -10,13 +10,13 @@ android {
applicationId "com.example.beijing_daxing"
minSdk 24
targetSdk 33
versionCode 1
versionName "1.0"
versionCode 5
versionName "1.5"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
ndk {
// SO
abiFilters 'arm64-v8a' , 'armeabi' , 'armeabi-v7a'
abiFilters 'arm64-v8a' , 'armeabi' , 'armeabi-v7a'
}
}
@ -57,5 +57,5 @@ dependencies {
implementation 'com.github.xuexiangjys:XUpdate:2.1.4'
implementation 'com.github.xuexiangjys.XUpdateAPI:xupdate-easy:1.0.1'
implementation 'com.github.bumptech.glide:glide:4.16.0'
implementation 'com.contrarywind:Android-PickerView:4.1.9'
}

@ -0,0 +1,20 @@
{
"version": 3,
"artifactType": {
"type": "APK",
"kind": "Directory"
},
"applicationId": "com.example.beijing_daxing",
"variantName": "debug",
"elements": [
{
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 5,
"versionName": "1.5",
"outputFile": "app-debug.apk"
}
],
"elementType": "File"
}

@ -0,0 +1,20 @@
{
"version": 3,
"artifactType": {
"type": "APK",
"kind": "Directory"
},
"applicationId": "com.example.beijing_daxing",
"variantName": "release",
"elements": [
{
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 5,
"versionName": "1.5",
"outputFile": "app-release.apk"
}
],
"elementType": "File"
}

@ -6,14 +6,11 @@
android:name="android.hardware.camera"
android:required="false" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.INTERNET" /> <!-- //震动权限 -->
<uses-permission android:name="android.permission.VIBRATE" /> <!-- //外部存储器权限 -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="32"
tools:ignore="ScopedStorage" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
@ -21,7 +18,8 @@
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
<uses-permission android:name="android.permission.CAMERA" /> <!-- 相机权限 -->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<application
android:name=".base.MyApplication"
android:allowBackup="true"
@ -34,6 +32,10 @@
android:theme="@style/Theme.Beijingdaxing"
android:usesCleartextTraffic="true"
tools:targetApi="31">
<activity
android:name=".SelectPersonInfoActivity"
android:exported="false" />
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="com.example.beijing_daxing"
@ -44,7 +46,6 @@
android:resource="@xml/file_paths" />
</provider>
<activity
android:name=".SetingPowerActivity"
android:exported="false" />
@ -61,9 +62,6 @@
</intent-filter>
</receiver>
<activity
android:name=".OffLineCheckActivity"
android:exported="false" />
<activity
android:name=".FpOutActivity"
android:exported="false" />
@ -95,6 +93,7 @@
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

@ -43,13 +43,26 @@ public class BFActivity extends BaseActivity implements TakePictureDialog.dialog
dataBinding.setVm(wm);
takeDialog = new TakePictureDialog(this);
takeDialog.setCall(this);
setPower(SharedPreferencesUtils.getInt("powerScrap", 17));
bitmaps = new ArrayList<>();
files = new ArrayList<>();
}
@Override
protected void onResume() {
super.onResume();
setPower(SharedPreferencesUtils.getInt("powerScrap",17));
uhfLongerManager.setGen2session(true);
uhfLongerManager.asyncStartReading();
}
@Override
protected void sanRfid(List<Reader.TAGINFO> epcs) {
protected void onDestroy() {
super.onDestroy();
uhfLongerManager.setGen2session(false);
uhfLongerManager.asyncStopReading();
}
@Override
public void sanRfid(List<Reader.TAGINFO> epcs) {
var epc = epcs.get(0);
byte[] epcId = epc.EpcId;
String epc1 = HexAscii.hex2Str(Tools.Bytes2HexString(epcId, epcId.length));
@ -76,7 +89,7 @@ public class BFActivity extends BaseActivity implements TakePictureDialog.dialog
}
public void bfTackPhoto(View view) {
takePhoto();
takePhoto(false,"");
}
public void bfShowPhoto(View view) {
@ -84,7 +97,14 @@ public class BFActivity extends BaseActivity implements TakePictureDialog.dialog
takeDialog.show();
}
public void bf_submit4(View view) {
bf_submit(4);
}
public void bf_submit(View view) {
bf_submit(2);
}
private void bf_submit(int type) {
String state = wm.getState();
if (state==null ) return;
if ( state.equals("正常")) {
@ -95,6 +115,7 @@ public class BFActivity extends BaseActivity implements TakePictureDialog.dialog
.params("epc", wm.getEpc())
.params("reason", reason)
.params("remark", remark)
.params("type", type)
.params("user", SharedPreferencesUtils.getstring("user", ""))
.addFileParams("files",files)
.execute(new MyRecultCall(dialog, this) {
@ -113,7 +134,7 @@ public class BFActivity extends BaseActivity implements TakePictureDialog.dialog
});
} else {
Toast.makeText(this, "轮挡已报废,无需操作", Toast.LENGTH_SHORT).show();
Toast.makeText(this, "异常轮挡,无需操作", Toast.LENGTH_SHORT).show();
}
}

@ -13,6 +13,8 @@ import android.os.Message;
import android.view.View;
import android.widget.Toast;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.example.beijing_daxing.adapter.CheckAdapter;
import com.example.beijing_daxing.base.AdapterClickCall;
import com.example.beijing_daxing.base.BaseActivity;
@ -22,6 +24,7 @@ import com.example.beijing_daxing.been.Stock;
import com.example.beijing_daxing.databinding.ActivityCheckBinding;
import com.example.beijing_daxing.dialog.InPutDialog;
import com.example.beijing_daxing.dialog.TakePictureDialog;
import com.example.beijing_daxing.uitls.CustomWatermarkTransformation;
import com.example.beijing_daxing.uitls.HexAscii;
import com.example.beijing_daxing.uitls.SharedPreferencesUtils;
import com.google.gson.reflect.TypeToken;
@ -40,6 +43,7 @@ public class CheckActivity extends BaseActivity implements AdapterClickCall, InP
private ActivityCheckBinding binding;
private CheckAdapter adapter;
private List<Stock> list;
private List<Stock> list1;
private List<String> selectList;
private ObservableBoolean state;
private ObservableBoolean checkState;
@ -48,6 +52,7 @@ public class CheckActivity extends BaseActivity implements AdapterClickCall, InP
private long id;
private long inspectionId;
private int backIndex;
private String code;
@Override
protected void onCreate(Bundle savedInstanceState) {
@ -73,10 +78,11 @@ public class CheckActivity extends BaseActivity implements AdapterClickCall, InP
}
});*/
Intent intent = getIntent();
id = intent.getLongExtra("id", 0);
id = intent.getLongExtra("id", 0);
backIndex = intent.getIntExtra("backIndex", 0);
inspectionId = intent.getLongExtra("inspectionId", 0);
String code = intent.getStringExtra("code");
code = intent.getStringExtra("code");
initRequest(code);
inputDialog = new InPutDialog(this);
inputDialog.setInPutDialogCall(this);
@ -96,12 +102,14 @@ public class CheckActivity extends BaseActivity implements AdapterClickCall, InP
if (body.getCode() == 0) {
list = gson.fromJson(body.getData().toString(), new TypeToken<List<Stock>>() {
}.getType());
if (list == null || list.isEmpty()) {
/* if (list == null || list.isEmpty()) {
Toast.makeText(CheckActivity.this, "没有维护巡检区域", Toast.LENGTH_SHORT).show();
return;
}
adapter.setList(list);
adapter.notifyDataSetChanged();
}*/
binding.setListNumber(list.size() + "");
list1 = new ArrayList<>();
adapter.setList(list1);
// adapter.notifyDataSetChanged();
return;
}
Toast.makeText(CheckActivity.this, body.getMsg(), Toast.LENGTH_SHORT).show();
@ -112,53 +120,53 @@ public class CheckActivity extends BaseActivity implements AdapterClickCall, InP
private List<String> tagList;
private int subIndex = -1;
// 扫描到返回数据
// 扫描
@SuppressLint("NotifyDataSetChanged")
@Override
protected void sanRfid(List<Reader.TAGINFO> epcs) {
public void sanRfid(List<Reader.TAGINFO> epcs) {
epcs.forEach(t -> {
var epc = Tools.Bytes2HexString(t.EpcId, t.EpcId.length);
if (tagList.contains(t)) {
return;
}
tagList.add(epc);
var stock = new Stock();
stock.setEpcCode(HexAscii.hex2Str(epc));
var index = list.indexOf(stock);
if (index != -1) {
list.get(index).setState("正常");
if (!tagList.contains(epc)) {
tagList.add(epc);
String s = HexAscii.hex2Str(epc);
var stock = new Stock();
stock.setEpcCode(s);
stock.setLocationCode(code);
stock.setState("正常");
list1.add(stock);
}
});
adapter.notifyDataSetChanged();
binding.setSanNumber(list1.size() + "");
}
// 完成巡检,提交数据
public void check_submit(View view) {
var type = list.stream().anyMatch(t -> t.getState().equals("未检"));
if (type) {
// var type = list.stream().anyMatch(t -> t.getState().equals("未检"));
// if (type) {
// 数量必须相同
if (list.size() > list1.size() && files.size() == 0) {
Toast.makeText(this, "未检完全部轮挡,不允许提交", Toast.LENGTH_SHORT).show();
return;
}
OkGo.<MyResult>post(url + "/xj/submit").tag(this)
.params("tableId", id)
.params("json", gson.toJson(list))
.params("inspectionId",inspectionId)
.params("user", SharedPreferencesUtils.getstring("user",""))
.addFileParams("files",files)
.execute(new MyRecultCall(dialog, this) {
@Override
public void onSuccess(Response<MyResult> response) {
super.onSuccess(response);
Toast.makeText(CheckActivity.this, "提交成功", Toast.LENGTH_SHORT).show();
Intent resultIntent = new Intent();
resultIntent.putExtra("backIndex", backIndex);
files.forEach(File::delete);
setResult(RESULT_OK, resultIntent);
finish();
}
});
OkGo.<MyResult>post(url + "/xj/submit").tag(this).params("tableId", id)
.params("json", gson.toJson(list1))
.params("inspectionId", inspectionId)
.params("user", SharedPreferencesUtils.getstring("user", ""))
.params("locationCode", code)
.addFileParams("files", files).execute(new MyRecultCall(dialog, this) {
@Override
public void onSuccess(Response<MyResult> response) {
super.onSuccess(response);
Toast.makeText(CheckActivity.this, "提交成功", Toast.LENGTH_SHORT).show();
Intent resultIntent = new Intent();
resultIntent.putExtra("backIndex", backIndex);
files.forEach(File::delete);
setResult(RESULT_OK, resultIntent);
finish();
}
});
}
// 一条数据保存
// public void check_stock(View view) {
@ -194,8 +202,12 @@ public class CheckActivity extends BaseActivity implements AdapterClickCall, InP
public void offCheckRead(View view) {
var b = checkState.get();
if (b) {
uhfLongerManager.setGen2session(false);
uhfLongerManager.asyncStopReading();
handler.removeCallbacks(runnable);
} else {
uhfLongerManager.setGen2session(true);
uhfLongerManager.asyncStartReading();
handler.postDelayed(runnable, 0);
}
checkState.set(!b);
@ -214,13 +226,13 @@ public class CheckActivity extends BaseActivity implements AdapterClickCall, InP
public void run() {
// sendBroadcast(broadcastIntent);
sanEpc();
handler.postDelayed(runnable, 1000);
handler.postDelayed(runnable, 10);
}
};
// 拍照
public void check_tackPhoto(View view) {
takePhoto();
takePhoto(true, code);
}
// 显示拍的照片
@ -234,6 +246,11 @@ public class CheckActivity extends BaseActivity implements AdapterClickCall, InP
@Override
public void takePhotoCall(File outputImage, Bitmap bitmap) {
// Glide.with(this)
// .load(outputImage.getPath())
// .apply(RequestOptions.bitmapTransform(new CustomWatermarkTransformation()))
// .into(imageView);
files.add(outputImage);
bitmaps.add(bitmap);
binding.confirmPictureNumber2.setText(bitmaps.size() + "");
@ -243,4 +260,14 @@ public class CheckActivity extends BaseActivity implements AdapterClickCall, InP
public void returnListSize(int size) {
binding.confirmPictureNumber2.setText(bitmaps.size() + "");
}
@Override
protected void onDestroy() {
super.onDestroy();
handler.removeCallbacks(runnable);
uhfLongerManager.setGen2session(false);
uhfLongerManager.asyncStopReading();
handler = null;
runnable = null;
}
}

@ -9,6 +9,8 @@ import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.Spinner;
import android.widget.Toast;
import com.example.beijing_daxing.adapter.CheckListAdapter;
@ -19,6 +21,7 @@ import com.example.beijing_daxing.base.MyResult;
import com.example.beijing_daxing.been.CheckTaskInfo;
import com.example.beijing_daxing.been.Stock;
import com.example.beijing_daxing.databinding.ActivityCheckListBinding;
import com.example.beijing_daxing.dialog.InPutDialog;
import com.example.beijing_daxing.uitls.SharedPreferencesUtils;
import com.google.gson.reflect.TypeToken;
import com.lzy.okgo.OkGo;
@ -27,10 +30,12 @@ import com.uhf.api.cls.Reader;
import java.util.List;
public class CheckListActivity extends BaseActivity implements AdapterClickCall {
public class CheckListActivity extends BaseActivity implements CheckListAdapter.AdapterClickCall, InPutDialog.InPutDialogCall {
private CheckListAdapter adapter;
private List<CheckTaskInfo> list;
private ObservableBoolean createState;
private String[] stateList;
private InPutDialog inputDialog;
@Override
protected void onCreate(Bundle savedInstanceState) {
@ -41,58 +46,65 @@ public class CheckListActivity extends BaseActivity implements AdapterClickCall
createState = new ObservableBoolean();
createState.set(false);
binding.setState(createState);
initRequest();
}
inputDialog = new InPutDialog(this);
inputDialog.setInPutDialogCall(this);
stateList = getResources().getStringArray(R.array.checkState);
binding.checkListState.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
String state = stateList[position];
Log.e("TAG", "onItemSelected:" + state);
initRequest(state);
}
private void initRequest() {
OkGo.<MyResult>post(url + "/inspection/selectTask")
.params("user", SharedPreferencesUtils.getstring("user", ""))
.execute(new MyRecultCall(dialog, this) {
@SuppressLint("NotifyDataSetChanged")
@Override
public void onSuccess(Response<MyResult> response) {
super.onSuccess(response);
MyResult body = response.body();
if (body.getCode() == 0) {
createState.set(false);
list = gson.fromJson(body.getData().toString(), new TypeToken<List<CheckTaskInfo>>() {
}.getType());
adapter.setList(list);
adapter.notifyDataSetChanged();
} else {
createState.set(true);
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
});
}
@Override
protected void sanRfid(List<Reader.TAGINFO> epcs) {
}
});
}
private void initRequest(String state) {
OkGo.<MyResult>post(url + "/inspection/selectTask").params("state", state).execute(new MyRecultCall(dialog, this) {
@SuppressLint("NotifyDataSetChanged")
@Override
public void onSuccess(Response<MyResult> response) {
super.onSuccess(response);
MyResult body = response.body();
if (body.getCode() == 0) {
createState.set(false);
list = gson.fromJson(body.getData().toString(), new TypeToken<List<CheckTaskInfo>>() {
}.getType());
adapter.setList(list);
adapter.notifyDataSetChanged();
} else {
createState.set(true);
}
}
});
}
public void check_start(View view) {
OkGo.<MyResult>post(url + "/xj/createTask")
.params("user", SharedPreferencesUtils.getstring("user", ""))
.execute(new MyRecultCall(dialog, this) {
@Override
public void onSuccess(Response<MyResult> response) {
super.onSuccess(response);
var body = response.body();
if (body.getCode() == 0) {
initRequest();
return;
}
Toast.makeText(CheckListActivity.this, body.getMsg(), Toast.LENGTH_SHORT).show();
}
});
OkGo.<MyResult>post(url + "/xj/createTask").params("user", SharedPreferencesUtils.getstring("user", "")).execute(new MyRecultCall(dialog, this) {
@Override
public void onSuccess(Response<MyResult> response) {
super.onSuccess(response);
var body = response.body();
if (body.getCode() == 0) {
// initRequest();
return;
}
Toast.makeText(CheckListActivity.this, body.getMsg(), Toast.LENGTH_SHORT).show();
}
});
}
@Override
public void clickItem(int index) {
Intent intent = new Intent(this, CheckActivity.class);
CheckTaskInfo checkTaskInfo = list.get(index);
intent.putExtra("id", checkTaskInfo.getId());
intent.putExtra("inspectionId", checkTaskInfo.getInspectionId());
@ -101,6 +113,14 @@ public class CheckListActivity extends BaseActivity implements AdapterClickCall
startActivityForResult(intent, 1);
}
private int skipIndex;
@Override
public void clickItemSkip(int index) {
skipIndex = index;
inputDialog.show();
}
@SuppressLint("NotifyDataSetChanged")
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
@ -109,9 +129,28 @@ public class CheckListActivity extends BaseActivity implements AdapterClickCall
if (requestCode == 1 && data != null) {
int index = data.getIntExtra("backIndex", 0);
Log.e("TAG", "onActivityResult:" + index);
list.get(index).setTaskState("完成");
list.get(index).setTaskState("完成");
adapter.notifyDataSetChanged();
}
}
@Override
public void inPutDialogReculi(String name) {
CheckTaskInfo checkTaskInfo = list.get(skipIndex);
OkGo.<MyResult>post(url + "/inspection/skipTask").params("remark", name).params("tableId", checkTaskInfo.getId()).execute(new MyRecultCall(dialog, this) {
@SuppressLint("NotifyDataSetChanged")
@Override
public void onSuccess(Response<MyResult> response) {
super.onSuccess(response);
MyResult body = response.body();
if (body.getCode() == 0) {
checkTaskInfo.setTaskState("跳过");
adapter.notifyDataSetChanged();
}
}
});
inputDialog.dismiss();
}
}

@ -33,11 +33,26 @@ public class FpInActivity extends BaseActivity {
ActivityFpInBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_fp_in);
vm = new FpInVm();
binding.setVm(vm);
setPower(SharedPreferencesUtils.getInt("powerScrapIn",17));
}
@Override
protected void sanRfid(List<Reader.TAGINFO> epcs) {
protected void onResume() {
super.onResume();
setPower(SharedPreferencesUtils.getInt("powerScrapIn",17));
uhfLongerManager.setGen2session(true);
uhfLongerManager.asyncStartReading();
}
@Override
protected void onDestroy() {
super.onDestroy();
uhfLongerManager.setGen2session(false);
uhfLongerManager.asyncStopReading();
}
@Override
public void sanRfid(List<Reader.TAGINFO> epcs) {
Reader.TAGINFO taginfo = epcs.get(0);
var epc = HexAscii.hex2Str(Tools.Bytes2HexString(taginfo.EpcId,taginfo.EpcId.length));
vm.setEpc(epc);
@ -65,10 +80,13 @@ public class FpInActivity extends BaseActivity {
public void fpin_submit(View view){
// Log.e("TAG", "onSuccess:" +vm.toString() );
var state = vm.getState();
if (!state.equals("报废")){
boolean b = state.equals("报废") || state.equals("维修");
if (!b){
Toast.makeText(this, "轮挡状态:"+state+",不能使用废品入库功能", Toast.LENGTH_SHORT).show();
return;
}
if (vm.getLocation().equals("仓库")){
Toast.makeText(this, "轮挡状态已在仓库", Toast.LENGTH_SHORT).show();
return;

@ -45,12 +45,12 @@ public class FpOutActivity extends BaseActivity {
binding.setAdapter(adapter);
tagList=new ArrayList<>();
initRequest();
setPower(SharedPreferencesUtils.getInt("powerScrapOut",17));
setPower(SharedPreferencesUtils.getInt("powerScrapOut",33));
}
private List<String> tagList;
@Override
protected void sanRfid(List<Reader.TAGINFO> epcs) {
public void sanRfid(List<Reader.TAGINFO> epcs) {
if (tagList==null) return;
epcs.forEach(t -> {
var epc = Tools.Bytes2HexString(t.EpcId,t.EpcId.length);
@ -87,8 +87,12 @@ public class FpOutActivity extends BaseActivity {
public void fp_out_read(View view) {
var b = checkState.get();
if (b) {
uhfLongerManager.setGen2session(false);
uhfLongerManager.asyncStopReading();
handler.removeCallbacks(runnable);
} else {
uhfLongerManager.setGen2session(true);
uhfLongerManager.asyncStartReading();
handler.postDelayed(runnable, 0);
}
checkState.set(!b);
@ -131,7 +135,7 @@ public class FpOutActivity extends BaseActivity {
public void run() {
// sendBroadcast(broadcastIntent);
sanEpc();
handler.postDelayed(runnable, 1000);
handler.postDelayed(runnable, 10);
}
};
@ -139,7 +143,11 @@ public class FpOutActivity extends BaseActivity {
protected void onDestroy() {
super.onDestroy();
handler.removeCallbacks(runnable);
uhfLongerManager.setGen2session(false);
uhfLongerManager.asyncStopReading();
handler=null;
runnable=null;
}
}

@ -21,23 +21,36 @@ import com.example.beijing_daxing.databinding.ActivityHomePageBinding;
import com.example.beijing_daxing.been.HomeIcon;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.handheld.uhfr.UHFRManager;
import com.uhf.api.cls.Reader;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import cn.pda.serialport.Tools;
public class HomePageActivity extends AppCompatActivity {
private MyNetWorkReceiver myNetWorkReceiver;
// private MyNetWorkReceiver myNetWorkReceiver;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ActivityHomePageBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_home_page);
initUi(binding);
/* myNetWorkReceiver=new MyNetWorkReceiver();
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(WifiManager.NETWORK_STATE_CHANGED_ACTION);
registerReceiver(myNetWorkReceiver, intentFilter);*/
UHFRManager instance = UHFRManager.getInstance();
try {
MyApplication.getApplication().setUhfrManager(instance);
instance.setRegion(Reader.Region_Conf.RG_PRC);
instance.setPower(33,33);
instance.setGen2session(false);
String epcConfig = getIntent().getStringExtra("epcConfig");
boolean b = instance.setInventoryFilter(Tools.HexString2Bytes(epcConfig), 1, 2, true);
Log.e("TAG", "设置过滤:" + b);
}catch (NullPointerException e){
Toast.makeText(this, "扫描驱动异常,重新启动程序加载", Toast.LENGTH_SHORT).show();
finish();
}
}
@ -62,25 +75,19 @@ public class HomePageActivity extends AppCompatActivity {
@Override
protected void onDestroy() {
super.onDestroy();
var uhfLongerManager = MyApplication.getUhfLongerManager();
var uhfLongerManager = MyApplication.getApplication().getUhfrManager();
uhfLongerManager.asyncStopReading();
uhfLongerManager.close();
MyApplication.uhfLongerManager = null;
MyApplication.getApplication().setUhfrManager(null);
Log.e("TAG", "关闭" );
// unregisterReceiver(myNetWorkReceiver);
}
private void initUi(ActivityHomePageBinding binding) {
List<HomeIcon> list = new ArrayList<>();
list.add(new HomeIcon(R.mipmap.home_in1, "轮挡入库", InActivity.class));
list.add(new HomeIcon(R.mipmap.home_out1, "轮挡领用出库", OutActivity.class));
list.add(new HomeIcon(R.mipmap.home_store_check, "仓库盘点", StoreCheckActivity.class));
list.add(new HomeIcon(R.mipmap.home_check, "轮挡巡检", CheckListActivity.class));
list.add(new HomeIcon(R.mipmap.home_bf, "轮挡报废", BFActivity.class));
list.add(new HomeIcon(R.mipmap.home_in, "废品入库", FpInActivity.class));
list.add(new HomeIcon(R.mipmap.home_out, "废品出库", FpOutActivity.class));
list.add(new HomeIcon(R.mipmap.home_check, "信息查询", SelectPersonInfoActivity.class));
list.add(new HomeIcon(R.mipmap.home_out, "功率设置", SetingPowerActivity.class));
var intent = getIntent();
/*var intent = getIntent();
try {
if (!intent.getStringExtra("user").equals("admin")) {
ArrayList<String> strings = new Gson().fromJson(intent.getStringExtra("json"), new TypeToken<ArrayList<String>>() {
@ -99,7 +106,7 @@ public class HomePageActivity extends AppCompatActivity {
}
} catch (Exception e) {
e.printStackTrace();
}
}*/
HomePageAdapter adapter = new HomePageAdapter(list, this);
binding.homeGridview.setAdapter(adapter);
binding.homeGridview.setOnItemClickListener(new AdapterView.OnItemClickListener() {

@ -38,12 +38,12 @@ public class InActivity extends BaseActivity implements AdapterClickCall {
private InAdapter adapter;
private List<String> epcList;
private List<String> tagList;
private ActivityInBinding binding;
private ObservableBoolean checkState;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
binding = DataBindingUtil.setContentView(this, R.layout.activity_in);
ActivityInBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_in);
vm = new InStoreVM();
binding.setVm(vm);
initRequest();
@ -52,26 +52,28 @@ public class InActivity extends BaseActivity implements AdapterClickCall {
adapter.setList(epcList);
adapter.setAdapterClickCall(this);
binding.setAdapter(adapter);
checkState=new ObservableBoolean();
checkState = new ObservableBoolean();
binding.setCheckState(checkState);
tagList=new ArrayList<>();
tagList = new ArrayList<>();
}
@Override
protected void onResume() {
super.onResume();
setPower(SharedPreferencesUtils.getInt("powerIn",33));
setPower(SharedPreferencesUtils.getInt("powerIn", 33));
}
@SuppressLint("NotifyDataSetChanged")
@Override
protected void sanRfid(List<Reader.TAGINFO> epcs) {
epcs.stream().forEach(t -> {
var epc = Tools.Bytes2HexString(t.EpcId,t.EpcId.length);
if (!epc.substring(0,8).equals("53574C44")) return;
if (tagList.contains(epc)) return;
tagList.add(epc);
epcList.add(HexAscii.hex2Str(epc));
public void sanRfid(List<Reader.TAGINFO> epcs) {
epcs.forEach(t->{
var epc = Tools.Bytes2HexString(t.EpcId, t.EpcId.length);
if (!tagList.contains(epc)) {
tagList.add(epc);
epcList.add(HexAscii.hex2Str(epc));
}
});
vm.setSanLength(epcList.size());
adapter.notifyDataSetChanged();
@ -88,6 +90,7 @@ public class InActivity extends BaseActivity implements AdapterClickCall {
});
}
@SuppressLint("NotifyDataSetChanged")
@Override
public void clickItem(int index) {
tagList.remove(HexAscii.str2Hex(epcList.get(index)));
@ -126,26 +129,31 @@ public class InActivity extends BaseActivity implements AdapterClickCall {
private Runnable runnable = new Runnable() {
@Override
public void run() {
// Log.e("TAG", "发送广播读取RFID");
// sendBroadcast(broadcastIntent);
sanEpc();
handler.postDelayed(runnable, 50);
}
};
public void instore_check(View view) {
var b = checkState.get();
if (b) {
uhfLongerManager.setGen2session(false);
uhfLongerManager.asyncStopReading();
handler.removeCallbacks(runnable);
} else {
uhfLongerManager.setGen2session(true);
uhfLongerManager.asyncStartReading();
handler.postDelayed(runnable, 0);
}
checkState.set(!b);
}
@Override
protected void onDestroy() {
super.onDestroy();
uhfLongerManager.setGen2session(false);
uhfLongerManager.asyncStopReading();
handler.removeCallbacks(runnable);
handler = null;
runnable = null;

@ -1,15 +1,13 @@
package com.example.beijing_daxing;
import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;
import androidx.databinding.ObservableField;
import android.content.Intent;
import android.os.Bundle;
import android.os.FileObserver;
import android.view.View;
import android.widget.Toast;
import androidx.databinding.DataBindingUtil;
import androidx.databinding.ObservableBoolean;
import com.example.beijing_daxing.base.BaseActivity;
import com.example.beijing_daxing.databinding.ActivityMainBinding;
import com.example.beijing_daxing.uitls.SharedPreferencesUtils;
@ -17,43 +15,49 @@ import com.example.beijing_daxing.vm.LoginVm;
import com.lzy.okgo.OkGo;
import com.lzy.okgo.callback.StringCallback;
import com.lzy.okgo.model.Response;
import com.uhf.api.cls.Reader;
import com.xuexiang.xupdate.XUpdate;
import com.xuexiang.xupdate.easy.EasyUpdate;
import java.util.List;
public class MainActivity extends BaseActivity {
private LoginVm loginVm;
private ObservableBoolean isShow = new ObservableBoolean(false);
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ActivityMainBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_main);
loginVm = new LoginVm();
String ipConfig = SharedPreferencesUtils.getstring("ipConfig", "");
loginVm.setIpConfig(ipConfig);
String epcConfig = SharedPreferencesUtils.getstring("epcConfig", "");
loginVm.setEpcConfig(epcConfig);
boolean isRemember = SharedPreferencesUtils.getboolean("isRemember", false);
if (isRemember) {
loginVm.setName(SharedPreferencesUtils.getstring("user", ""));
loginVm.setPass(SharedPreferencesUtils.getstring("pass", ""));
loginVm.setRemember(isRemember);
}
binding.setUser(loginVm);
EasyUpdate.checkUpdate(this,url + "/getVersion");
isShow.set(ipConfig.isEmpty() || epcConfig.isEmpty());
binding.setIsShow(isShow);
// EasyUpdate.checkUpdate(this,url + "/getVersion");
// XUpdate.newBuild(this)
// .updateUrl(url + "/getVersion")
// .promptIgnoreDownloadError(true)
// .update();
}
@Override
protected void sanRfid(List<Reader.TAGINFO> epcs) {
}
public void login_click(View view) {
String pass = loginVm.getPass();
String name = loginVm.getName();
if (pass == null || name == null || pass.isEmpty() || name.isEmpty()) return;
String ipConfig = loginVm.getIpConfig();
String epcConfig = loginVm.getEpcConfig();
if (epcConfig.length()!=8){
Toast.makeText(this, "请输入正确的EPC配置", Toast.LENGTH_SHORT).show();
return;
}
setUrl(ipConfig);
if (pass == null || name == null || pass.isEmpty() || name.isEmpty() || ipConfig.isEmpty() || epcConfig.isEmpty()) return;
dialog.show();
OkGo.<String>get(url + "/login/finduser").tag(this)
.params("name", name)
@ -67,15 +71,17 @@ public class MainActivity extends BaseActivity {
Toast.makeText(MainActivity.this, "暂无权限", Toast.LENGTH_SHORT).show();
} else if (body.equals("Error")) {
Toast.makeText(MainActivity.this, "用户名密码错误", Toast.LENGTH_SHORT).show();
} else {
} else if (body.equals("ok")) {
boolean remember = loginVm.isRemember();
SharedPreferencesUtils.putstring("ipConfig", ipConfig);
SharedPreferencesUtils.putstring("epcConfig", epcConfig);
if (remember) {
SharedPreferencesUtils.putboolean("isRemember", remember);
SharedPreferencesUtils.putstring("user", name);
SharedPreferencesUtils.putstring("pass", pass);
Intent intent = new Intent(MainActivity.this, HomePageActivity.class);
intent.putExtra("json", body);
intent.putExtra("user", name);
intent.putExtra("epcConfig", epcConfig);
// intent.putExtra("user", name);
startActivity(intent);
finish();
}
@ -84,5 +90,8 @@ public class MainActivity extends BaseActivity {
});
}
public void setting(View view) {
isShow.set(!isShow.get());
}
}

@ -4,6 +4,7 @@ import androidx.databinding.DataBindingUtil;
import android.annotation.SuppressLint;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Toast;
import com.example.beijing_daxing.adapter.InAdapter;
@ -51,16 +52,18 @@ public class OutActivity extends BaseActivity implements AdapterClickCall {
protected void onResume() {
super.onResume();
setPower(SharedPreferencesUtils.getInt("powerOut",17));
uhfLongerManager.setGen2session(true);
uhfLongerManager.asyncStartReading();
}
@SuppressLint("NotifyDataSetChanged")
@Override
protected void sanRfid(List<Reader.TAGINFO> epcs) {
public void sanRfid(List<Reader.TAGINFO> epcs) {
epcs.forEach(t -> {
var epc = Tools.Bytes2HexString(t.EpcId,t.EpcId.length);
if (!epc.startsWith("53574C44")) return;
if (tagList.contains(epc)) return;
tagList.add(epc);
epcList.add(HexAscii.hex2Str(epc));
if (!tagList.contains(epc)){
tagList.add(epc);
epcList.add(HexAscii.hex2Str(epc));
}
});
adapter.notifyDataSetChanged();
}
@ -103,4 +106,10 @@ public class OutActivity extends BaseActivity implements AdapterClickCall {
});
}
@Override
protected void onDestroy() {
super.onDestroy();
uhfLongerManager.setGen2session(false);
uhfLongerManager.asyncStopReading();
}
}

@ -0,0 +1,171 @@
package com.example.beijing_daxing;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Toast;
import androidx.databinding.DataBindingUtil;
import com.bigkoo.pickerview.builder.OptionsPickerBuilder;
import com.bigkoo.pickerview.listener.OnOptionsSelectListener;
import com.bigkoo.pickerview.view.OptionsPickerView;
import com.bumptech.glide.Glide;
import com.example.beijing_daxing.base.BaseActivity;
import com.example.beijing_daxing.base.MyRecultCall;
import com.example.beijing_daxing.base.MyResult;
import com.example.beijing_daxing.been.PmBasePenaltyType;
import com.example.beijing_daxing.been.PmBasePersonInfo;
import com.example.beijing_daxing.been.PmRecordPenalty;
import com.example.beijing_daxing.databinding.ActivitySelectPersonInfoBinding;
import com.example.beijing_daxing.dialog.LookPictureDialog;
import com.example.beijing_daxing.uitls.SharedPreferencesUtils;
import com.google.gson.reflect.TypeToken;
import com.lzy.okgo.OkGo;
import com.lzy.okgo.model.Response;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import okhttp3.RequestBody;
public class SelectPersonInfoActivity extends BaseActivity implements OnOptionsSelectListener {
private ActivitySelectPersonInfoBinding binding;
private LookPictureDialog pictureDialog;
private PmBasePersonInfo personInfo;
private List<String> list1;
private List<List<String>> list2;
private OptionsPickerView opv;
private List<PmBasePenaltyType> list;
private PmRecordPenalty recordPenalty;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
binding = DataBindingUtil.setContentView(this, R.layout.activity_select_person_info);
pictureDialog = new LookPictureDialog(this);
opv= new OptionsPickerBuilder(this, this).build();
initCheckList();
recordPenalty=new PmRecordPenalty();
recordPenalty.setCreateBy(SharedPreferencesUtils.getstring("user",""));
}
private void initCheckList() {
OkGo.<MyResult>post(url + "/selectPenaltyTypeList")
.execute(new MyRecultCall(dialog, this) {
@Override
public void onSuccess(Response<MyResult> response) {
super.onSuccess(response);
MyResult body = response.body();
if (body.getCode() == 0) {
list = gson.fromJson(body.getJson(), new TypeToken<List<PmBasePenaltyType>>() {
}.getType());
list1 = new ArrayList<>();
list2 = new ArrayList<>();
Map<Long, String> map = new HashMap<>();
list.forEach(penaltyType -> {
String penaltyInfo = penaltyType.getPenaltyInfo();// 处罚说明
Long parentId = penaltyType.getParentId();// 父id
Long penaltyTypeId = penaltyType.getPenaltyTypeId();// 自id
if (parentId == null) {// 如果是一级菜单
if (!list1.contains(penaltyInfo)) {
list1.add(penaltyInfo);
map.put(penaltyTypeId, penaltyInfo);
list2.add(new ArrayList<>());
}
} else {// 如果是二级菜单
String tag = map.get(parentId);
int i = list1.indexOf(tag);
String penaltyTypeCode = penaltyType.getPenaltyTypeCode();
list2.get(i).add(penaltyTypeCode+"-"+penaltyInfo);
}
});
opv.setPicker(list1, list2, null);
return;
}
Toast.makeText(SelectPersonInfoActivity.this, body.getMsg(), Toast.LENGTH_SHORT).show();
}
});
}
@Override
public void readTidReault(boolean b, String bytes2HexString, byte[] rdata) {
super.readTidReault(b, bytes2HexString, rdata);
binding.selectInfoEpc.setText(bytes2HexString);
OkGo.<MyResult>post(url + "/selectPersonInfo")
.params("epc", bytes2HexString)
.params("user", SharedPreferencesUtils.getstring("user", ""))
.execute(new MyRecultCall(dialog, this) {
@Override
public void onSuccess(Response<MyResult> response) {
super.onSuccess(response);
MyResult body = response.body();
if (body.getCode() == 0) {
personInfo = gson.fromJson(body.getJson(), PmBasePersonInfo.class);
recordPenalty.setBasePersonId(personInfo.getBasePersonId());
binding.setPersonInfo(personInfo);
Glide.with(SelectPersonInfoActivity.this).load(url.replace("/api", "") + personInfo.getPhotoPath()).into(binding.selectInfoPhoto);
return;
}
Toast.makeText(SelectPersonInfoActivity.this, body.getMsg(), Toast.LENGTH_SHORT).show();
}
});
}
public void selectInfoPhoto(View view) {
if (personInfo == null) {
Toast.makeText(this, "请先查询人员信息", Toast.LENGTH_SHORT).show();
return;
}
pictureDialog.setPath(url.replace("/api", "") + personInfo.getPhotoPath());
pictureDialog.show();
}
public void checkSelect(View view) {
if (personInfo == null) {
Toast.makeText(this, "请先查询人员信息", Toast.LENGTH_SHORT).show();
return;
}
opv.show();
}
public void selectInfoSubmit(View view) {
OkGo.<MyResult>post(url + "/insertRrecordPenalty")
.upRequestBody(RequestBody.create(JSON, gson.toJson(recordPenalty)))
.execute(new MyRecultCall(dialog, this) {
@Override
public void onSuccess(Response<MyResult> response) {
super.onSuccess(response);
MyResult body = response.body();
if (body.getCode() == 0) {
finish();
}
Toast.makeText(SelectPersonInfoActivity.this, body.getMsg(), Toast.LENGTH_SHORT).show();
}
});
}
@Override
public void onOptionsSelect(int options1, int options2, int options3, View v) {
String type = list1.get(options1);
String s = list2.get(options1).get(options2);
binding.selectPenalty.setText(s);
s = s.substring(s.indexOf("-")+1,s.length());
Log.e("TAG", "onOptionsSelect:" + type + ", " + s);
PmBasePenaltyType penaltyType = new PmBasePenaltyType();
penaltyType.setPenaltyInfo(s);
int index = list.indexOf(penaltyType);
PmBasePenaltyType penaltyType1 = list.get(index);
// 设置处罚类型
recordPenalty.setPenaltyType(type);
recordPenalty.setPenaltyTypeCode(penaltyType1.getPenaltyTypeCode());
recordPenalty.setPenaltyInfo(penaltyType1.getPenaltyInfo());
recordPenalty.setPenaltyAmount(penaltyType1.getPenaltyAmount());
}
}

@ -20,12 +20,12 @@ public class SetingPowerActivity extends AppCompatActivity {
super.onCreate(savedInstanceState);
ActivitySetingPowerBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_seting_power);
powerData = new PowerData();
powerData.setPowerIn( SharedPreferencesUtils.getInt("powerIn",0));
powerData.setPowerOut( SharedPreferencesUtils.getInt("powerOut",0));
powerData.setPowerIn( SharedPreferencesUtils.getInt("powerIn",33));
powerData.setPowerOut( SharedPreferencesUtils.getInt("powerOut",17));
powerData.setPowerStockCheck( SharedPreferencesUtils.getInt("powerStoreCheck",0));
powerData.setPowerCheck( SharedPreferencesUtils.getInt("powerCheck",0));
powerData.setPowerScrap( SharedPreferencesUtils.getInt("powerScrap",0));
powerData.setPowerScrapIn( SharedPreferencesUtils.getInt("powerScrapIn",0));
powerData.setPowerCheck( SharedPreferencesUtils.getInt("powerCheck",33));
powerData.setPowerScrap( SharedPreferencesUtils.getInt("powerScrap",17));
powerData.setPowerScrapIn( SharedPreferencesUtils.getInt("powerScrapIn",17));
powerData.setPowerScrapOut( SharedPreferencesUtils.getInt("powerScrapOut",0));
binding.setVm(powerData);

@ -63,7 +63,7 @@ public class StoreCheckActivity extends BaseActivity {
@SuppressLint("NotifyDataSetChanged")
@Override
protected void sanRfid(List<Reader.TAGINFO> epcs) {
public void sanRfid(List<Reader.TAGINFO> epcs) {
if (tagList == null) return;
epcs.forEach(t -> {
var epc = Tools.Bytes2HexString(t.EpcId, t.EpcId.length);
@ -110,8 +110,12 @@ public class StoreCheckActivity extends BaseActivity {
public void check_read(View view) {
var b = checkState.get();
if (b) {
uhfLongerManager.setGen2session(false);
uhfLongerManager.asyncStopReading();
handler.removeCallbacks(runnable);
} else {
uhfLongerManager.setGen2session(true);
uhfLongerManager.asyncStartReading();
handler.postDelayed(runnable, 0);
}
checkState.set(!b);
@ -152,7 +156,7 @@ public class StoreCheckActivity extends BaseActivity {
// Log.e("TAG", "发送广播读取RFID");
// sendBroadcast(broadcastIntent);
sanEpc();
handler.postDelayed(runnable, 0);
handler.postDelayed(runnable, 10);
}
};
@ -160,6 +164,8 @@ public class StoreCheckActivity extends BaseActivity {
protected void onDestroy() {
super.onDestroy();
handler.removeCallbacks(runnable);
uhfLongerManager.setGen2session(false);
uhfLongerManager.asyncStopReading();
handler = null;
runnable = null;
}

@ -9,15 +9,10 @@ import android.widget.TextView;
import androidx.databinding.BindingAdapter;
import androidx.databinding.DataBindingUtil;
import androidx.recyclerview.widget.RecyclerView;
import com.example.beijing_daxing.BR;
import com.example.beijing_daxing.R;
import com.example.beijing_daxing.base.AdapterClickCall;
import com.example.beijing_daxing.been.CheckTaskInfo;
import com.example.beijing_daxing.been.Stock;
import com.example.beijing_daxing.databinding.ItemCheckBinding;
import com.example.beijing_daxing.databinding.ItemCheckListBinding;
import java.util.List;
/**
@ -50,6 +45,7 @@ public class CheckListAdapter extends RecyclerView.Adapter<CheckListAdapter.MyVi
var binding = holder.getBinding();
binding.setVariable(BR.vm, list.get(position));
binding.checkListStart.setOnClickListener(v -> call.clickItem(position));
binding.checkListSkip.setOnClickListener(v -> call.clickItemSkip(position));
binding.executePendingBindings();
}
@ -78,8 +74,15 @@ public class CheckListAdapter extends RecyclerView.Adapter<CheckListAdapter.MyVi
public static void setCustomBackground(TextView textView, String taskState) {
if ("待完成".equals(taskState)) {
textView.setBackgroundResource(R.drawable.state_n_bg);
} else {
} else if ("已完成".equals(taskState)) {
textView.setBackgroundResource(R.drawable.state_y_bg);
} else {
textView.setBackgroundResource(R.drawable.state_j_bg);
}
}
public interface AdapterClickCall {
void clickItem(int index);
void clickItemSkip(int index);
}
}

@ -10,6 +10,9 @@ import android.content.IntentFilter;
import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.media.MediaPlayer;
import android.net.Uri;
import android.os.Build;
@ -17,16 +20,16 @@ import android.os.Bundle;
import android.provider.MediaStore;
import android.util.Log;
import android.view.Window;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import androidx.core.content.FileProvider;
import com.example.beijing_daxing.R;
import com.google.gson.Gson;
import com.handheld.uhfr.*;
import com.handheld.uhfr.UHFRManager;
import com.uhf.api.cls.Reader;
import java.io.File;
@ -34,21 +37,38 @@ import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.time.DayOfWeek;
import java.time.LocalDate;
import java.time.ZoneId;
import java.util.Date;
import java.util.List;
import cn.pda.serialport.Tools;
import okhttp3.MediaType;
public abstract class BaseActivity extends AppCompatActivity {
public static String url = "http://192.168.137.1:8090/api";
// public static String url = "http://119.45.202.115:8090/api";
public class BaseActivity extends AppCompatActivity {
public static final int CAMERA_PHOTO = 0X02;
public static String url;
public ProgressDialog dialog;
public Gson gson;
public MediaType JSON = MediaType.parse("application/json; charset=utf-8");
public UHFRManager uhfLongerManager;
private MediaPlayer mediaPlayer;
public MyReceiver myReceiver;
public Intent broadcastIntent;
public File outputImage;
public Uri img_uri;
public SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss");
public SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
private MediaPlayer mediaPlayer;
private byte[] accesspwd;
private boolean addWatermarkType;
private String addWatermarkLocation;
private String[] strings =
new String[]{"星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"};
public static void setUrl(String url) {
BaseActivity.url = "http://" + url + "/api";
}
@SuppressLint("UnspecifiedRegisterReceiverFlag")
@Override
@ -61,28 +81,41 @@ public abstract class BaseActivity extends AppCompatActivity {
broadcastIntent.putExtra("keydown", false);
}
public class MyReceiver extends BroadcastReceiver {
private void initSan() {
uhfLongerManager = MyApplication.getApplication().getUhfrManager();
myReceiver = new MyReceiver();
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction("android.rfid.FUN_KEY");
registerReceiver(myReceiver, intentFilter);
mediaPlayer = MediaPlayer.create(this, R.raw.msg);
accesspwd = Tools.HexString2Bytes("00000000");
}
@Override
public void onReceive(Context context, Intent intent) {
var keydown = intent.getBooleanExtra("keydown", false);
Log.e("TAG", "接收到广播:" + keydown);
if (!keydown) {
// readTime = System.currentTimeMillis();
sanEpc();
}
// 1- 读取EPC
public void readEPC(int lenth) {
byte[] rdata = new byte[lenth];
Reader.READER_ERR readerErr =
uhfLongerManager.getTagData(1, 2, lenth / 2, rdata, accesspwd, (short) 1000);
if (readerErr == Reader.READER_ERR.MT_OK_ERR) {
mediaPlayer.start();
readTidReault(true, Tools.Bytes2HexString(rdata, lenth), rdata);
} else {
Toast.makeText(this, "读取失败", Toast.LENGTH_SHORT).show();
}
}
public void readTidReault(boolean b, String bytes2HexString, byte[] rdata) {
}
public void sanEpc() {
List<Reader.TAGINFO> strings = uhfLongerManager.tagInventoryRealTime();
// Log.e("TAG", "驱动" + (uhfLongerManager == null));
if (strings == null || strings.isEmpty()) {
return;
}
mediaPlayer.start();
sanRfid(strings);
}
@ -95,24 +128,10 @@ public abstract class BaseActivity extends AppCompatActivity {
dialog.setMessage("请求网络...");
}
private void initSan() {
uhfLongerManager = MyApplication.getUhfLongerManager();
// intentFilter.addAction("android.intent.action.FUN_KEY");
uhfLongerManager.asyncStartReading();
myReceiver = new MyReceiver();
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction("android.rfid.FUN_KEY");
registerReceiver(myReceiver, intentFilter);
mediaPlayer = MediaPlayer.create(this, R.raw.msg);
}
public void setPower(int power) {
try {
Reader.READER_ERR readerErr = uhfLongerManager.setPower(power, power);
Log.e("TAG", "setPower:" + readerErr.name());
int[] power1 = uhfLongerManager.getPower();
Log.e("TAG", "readPower:" + power1[0] + "," + power1[1]);
} catch (Exception e) {
@ -127,20 +146,19 @@ public abstract class BaseActivity extends AppCompatActivity {
unregisterReceiver(myReceiver);
}
public void sanRfid(List<Reader.TAGINFO> epcs) {
protected abstract void sanRfid(List<Reader.TAGINFO> epcs);
public static final int CAMERA_PHOTO = 0X02;
public File outputImage;
public Uri img_uri;
public SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss");
}
// 拍照
public void takePhoto() {
public void takePhoto(boolean type, String location) {
this.addWatermarkType = type;
addWatermarkLocation = location;
if (ContextCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}, 1);
}
outputImage = new File(getExternalCacheDir(), "output_imgage" + format.format(new Date()) + ".jpg");
outputImage =
new File(getExternalCacheDir(), "output_imgage" + format.format(new Date()) + ".jpg");
try {
outputImage.createNewFile();
} catch (IOException e) {
@ -158,7 +176,8 @@ public abstract class BaseActivity extends AppCompatActivity {
startActivityForResult(intent, CAMERA_PHOTO);
} else {
// 提示用户开户权限 拍照和读写sd卡权限
String[] perms = {Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.CAMERA};
String[] perms =
{Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.CAMERA};
ActivityCompat.requestPermissions(this, perms, CAMERA_PHOTO);
}
}
@ -177,6 +196,10 @@ public abstract class BaseActivity extends AppCompatActivity {
try {
Log.e("TAG", "onActivityResult:" + img_uri.getPath());
bitmap = BitmapFactory.decodeStream(getContentResolver().openInputStream(img_uri));
if (addWatermarkType) {
// 添加水印
bitmap = addWatermark(bitmap);
}
FileOutputStream outputStream = new FileOutputStream(outputImage);
bitmap.compress(Bitmap.CompressFormat.JPEG, 50, outputStream);
takePhotoCall(outputImage, bitmap);
@ -189,4 +212,39 @@ public abstract class BaseActivity extends AppCompatActivity {
}
}
@SuppressLint("NewApi")
private Bitmap addWatermark(Bitmap src) {
int w = src.getWidth();
int h = src.getHeight();
Bitmap result = Bitmap.createBitmap(w, h, src.getConfig());
Canvas canvas = new Canvas(result);
canvas.drawBitmap(src, 0, 0, null);
Paint paint = new Paint();
paint.setColor(Color.RED);
paint.setStrokeWidth(30);
paint.setTextSize(85);
paint.setAntiAlias(true);
// 获取当前日期
LocalDate today = LocalDate.now(ZoneId.systemDefault());
// 获取当前日期是周几
DayOfWeek dayOfWeek = today.getDayOfWeek();
canvas.drawText("机位:" + addWatermarkLocation, 10, h - 400, paint);
canvas.drawText(dateFormat.format(new Date()), 10, h - 200, paint);
canvas.drawText(strings[dayOfWeek.getValue()], 10, h - 20, paint);
return result;
}
public class MyReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
var keydown = intent.getBooleanExtra("keydown", false);
Log.e("TAG", "接收到广播:" + keydown);
if (!keydown) {
readEPC(6);
}
}
}
}

@ -38,40 +38,40 @@ import okhttp3.OkHttpClient;
*/
public class MyApplication extends Application {
MyApplication application;
public static UHFRManager uhfLongerManager;
private static MyApplication application;
private UHFRManager uhfrManager;
@Override
public void onCreate() {
super.onCreate();
application = this;
LitePal.initialize(this);
SharedPreferencesUtils.init(getApplicationContext(), "myapp");
SharedPreferencesUtils.init(getApplicationContext(), "myapp_text");
okGoBase();
// getUhfLongerManager();
XUpdate.get().debug(true).isWifiOnly(false) // 默认设置只在wifi下检查版本更新
.isGet(true) // 默认设置使用get请求检查版本
.isAutoMode(false) // 默认设置非自动模式,可根据具体使用配置
// .param("versionCode", UpdateUtils.getVersionCode(this)) //设置默认公共请求参数
// .param("appKey", getPackageName())
.supportSilentInstall(false) // 设置是否支持静默安装默认是true
.setIUpdateHttpService(new OkHttpUpdateHttpServiceImpl()) // 这个必须设置!实现网络请求功能。
.init(this);
// XUpdate.get().debug(true).isWifiOnly(false) // 默认设置只在wifi下检查版本更新
// .isGet(true) // 默认设置使用get请求检查版本
// .isAutoMode(false) // 默认设置非自动模式,可根据具体使用配置
// // .param("versionCode", UpdateUtils.getVersionCode(this)) //设置默认公共请求参数
// // .param("appKey", getPackageName())
//
// .supportSilentInstall(false) // 设置是否支持静默安装默认是true
// .setIUpdateHttpService(new OkHttpUpdateHttpServiceImpl()) // 这个必须设置!实现网络请求功能。
// .init(this);
}
public static UHFRManager getUhfLongerManager() {
if (uhfLongerManager==null){
try {
uhfLongerManager = UHFRManager.getInstance();
uhfLongerManager.setPower(33,33);
} catch (Exception e) {
e.printStackTrace();
}
}
return uhfLongerManager;
public static MyApplication getApplication() {
return application;
}
public UHFRManager getUhfrManager() {
return uhfrManager;
}
public void setUhfrManager(UHFRManager uhfrManager) {
this.uhfrManager = uhfrManager;
}
// OKGO 初始化
private void okGoBase() {
OkHttpClient.Builder builder = new OkHttpClient.Builder();
@ -95,7 +95,7 @@ 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(0);
}

@ -32,7 +32,7 @@ public class MyRecultCall extends AbsCallback<MyResult> {
if (body == null) return null;
Gson gson = new Gson();
MyResult resust = gson.fromJson(body.string(), MyResult.class);
resust.setData(gson.toJson(resust.getData()));
resust.setJson(gson.toJson(resust.getData()));
return resust;
}

@ -8,6 +8,15 @@ public class MyResult {
private int code;
private String msg;
private Object data;
private String json;
public String getJson() {
return json;
}
public void setJson(String json) {
this.json = json;
}
public int getCode() {
return code;

@ -0,0 +1,109 @@
package com.example.beijing_daxing.been;
import java.math.BigDecimal;
import java.util.Objects;
/**
* pm_base_penalty_type
*
* @author ruoyi
* @date 2025-11-27
*/
public class PmBasePenaltyType {
/**
*
*/
private Long penaltyTypeId;
/** 父菜单ID */
private Long parentId;
/**
*
*/
private String penaltyTypeCode;
/**
*
*/
private String penaltyInfo;
/**
*
*/
private Double penaltyAmount;
/**
*
*/
private String typeState;
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
PmBasePenaltyType that = (PmBasePenaltyType) o;
return Objects.equals(penaltyInfo, that.penaltyInfo);
}
@Override
public int hashCode() {
return penaltyInfo != null ? penaltyInfo.hashCode() : 0;
}
public Long getParentId() {
return parentId;
}
public void setParentId(Long parentId) {
this.parentId = parentId;
}
public Long getPenaltyTypeId() {
return penaltyTypeId;
}
public void setPenaltyTypeId(Long penaltyTypeId) {
this.penaltyTypeId = penaltyTypeId;
}
public String getPenaltyTypeCode() {
return penaltyTypeCode;
}
public void setPenaltyTypeCode(String penaltyTypeCode) {
this.penaltyTypeCode = penaltyTypeCode;
}
public String getPenaltyInfo() {
return penaltyInfo;
}
public void setPenaltyInfo(String penaltyInfo) {
this.penaltyInfo = penaltyInfo;
}
public Double getPenaltyAmount() {
return penaltyAmount;
}
public void setPenaltyAmount(Double penaltyAmount) {
this.penaltyAmount = penaltyAmount;
}
public String getTypeState() {
return typeState;
}
public void setTypeState(String typeState) {
this.typeState = typeState;
}
}

@ -0,0 +1,145 @@
package com.example.beijing_daxing.been;
/**
* pm_base_person_info
*
* @author ruoyi
* @date 2025-11-26
*/
public class PmBasePersonInfo {
/**
*
*/
private Long basePersonId;
/**
* RFID
*/
private String rfidId;
/**
*
*/
private String employeeId;
/**
*
*/
private String peopleName;
/**
*
*/
private String peopleSex;
/**
*
*/
private String driverCode;
/**
*
*/
private String phoneNumber;
/**
*
*/
private String photoPath;
/**
*
*/
private String joinDate;
/**
*
*/
private String academicQualification;
public Long getBasePersonId() {
return basePersonId;
}
public void setBasePersonId(Long basePersonId) {
this.basePersonId = basePersonId;
}
public String getRfidId() {
return rfidId;
}
public void setRfidId(String rfidId) {
this.rfidId = rfidId;
}
public String getEmployeeId() {
return employeeId;
}
public void setEmployeeId(String employeeId) {
this.employeeId = employeeId;
}
public String getPeopleName() {
return peopleName;
}
public void setPeopleName(String peopleName) {
this.peopleName = peopleName;
}
public String getPeopleSex() {
return peopleSex;
}
public void setPeopleSex(String peopleSex) {
this.peopleSex = peopleSex;
}
public String getDriverCode() {
return driverCode;
}
public void setDriverCode(String driverCode) {
this.driverCode = driverCode;
}
public String getPhoneNumber() {
return phoneNumber;
}
public void setPhoneNumber(String phoneNumber) {
this.phoneNumber = phoneNumber;
}
public String getPhotoPath() {
return photoPath;
}
public void setPhotoPath(String photoPath) {
this.photoPath = photoPath;
}
public String getJoinDate() {
return joinDate;
}
public void setJoinDate(String joinDate) {
this.joinDate = joinDate;
}
public String getAcademicQualification() {
return academicQualification;
}
public void setAcademicQualification(String academicQualification) {
this.academicQualification = academicQualification;
}
}

@ -0,0 +1,120 @@
package com.example.beijing_daxing.been;
/**
* pm_record_penalty
*
* @author ruoyi
* @date 2025-11-27
*/
public class PmRecordPenalty {
/**
*
*/
private Long recordPenaltyId;
/**
*
*/
private String penaltyType;
/**
*
*/
private String penaltyTypeCode;
/**
*
*/
private String penaltyInfo;
/**
*
*/
private Double penaltyAmount;
/**
*
*/
private Long basePersonId;
/**
*
*/
private String processState;
private String createBy;
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
public Long getRecordPenaltyId() {
return recordPenaltyId;
}
public void setRecordPenaltyId(Long recordPenaltyId) {
this.recordPenaltyId = recordPenaltyId;
}
public String getPenaltyType() {
return penaltyType;
}
public void setPenaltyType(String penaltyType) {
this.penaltyType = penaltyType;
}
public String getPenaltyTypeCode() {
return penaltyTypeCode;
}
public void setPenaltyTypeCode(String penaltyTypeCode) {
this.penaltyTypeCode = penaltyTypeCode;
}
public String getPenaltyInfo() {
return penaltyInfo;
}
public void setPenaltyInfo(String penaltyInfo) {
this.penaltyInfo = penaltyInfo;
}
public Double getPenaltyAmount() {
return penaltyAmount;
}
public void setPenaltyAmount(Double penaltyAmount) {
this.penaltyAmount = penaltyAmount;
}
public Long getBasePersonId() {
return basePersonId;
}
public void setBasePersonId(Long basePersonId) {
this.basePersonId = basePersonId;
}
public String getProcessState() {
return processState;
}
public void setProcessState(String processState) {
this.processState = processState;
}
}

@ -30,7 +30,7 @@ public class InPutDialog extends Dialog {
setContentView(binding.getRoot());
binding.dialogFalse.setOnClickListener(v -> dismiss());
binding.dialogTrue.setOnClickListener(v -> {
inPutDialogCall.inPutDialogReculi( binding.inputDialogText.getText().toString().trim());
inPutDialogCall.inPutDialogReculi( binding.inputDialogSelect.getSelectedItem().toString());
});
}

@ -0,0 +1,57 @@
package com.example.beijing_daxing.dialog;
import android.annotation.SuppressLint;
import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.widget.ImageView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.LinearLayoutManager;
import com.bumptech.glide.Glide;
import com.example.beijing_daxing.R;
/**
* @author wanghao
* @date 2023/2/1 17:06
*/
public class LookPictureDialog extends Dialog {
private Context context;
private String path;
private ImageView imageView;
public LookPictureDialog(@NonNull Context context) {
super(context, R.style.dialog);
this.context = context;
}
public void setPath(String path) {
this.path = path;
}
@SuppressLint("MissingInflatedId")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.dialog_look_picture);
imageView = findViewById(R.id.picture_imageview);
findViewById(R.id.confirm_back).setOnClickListener(v -> {
dismiss();
});
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(context);
linearLayoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
}
@Override
public void show() {
super.show();
Glide.with(context).load(path).into(imageView);
}
}

@ -1,10 +0,0 @@
package com.example.beijing_daxing.rfid;
public interface RFID {
void initRFIDModel();
void setPower(int power);
void sanRFID();
void close();
}

@ -1,60 +0,0 @@
package com.example.beijing_daxing.rfid.impl;
import android.util.Log;
import com.example.beijing_daxing.rfid.RFID;
import com.handheld.uhfr.UHFRManager;
import com.uhf.api.cls.Reader;
import java.util.List;
public class Device6109 implements RFID {
private UHFRManager uhfrManager;
private EpcDataInterface epcDataInterface;
public Device6109(EpcDataInterface epcDataInterface) {
this.epcDataInterface = epcDataInterface;
}
public Device6109() {
}
@Override
public void initRFIDModel() {
if (uhfrManager == null) {
uhfrManager = UHFRManager.getInstance();
}
uhfrManager.asyncStartReading();
}
@Override
public void setPower(int power) {
Reader.READER_ERR readerErr = uhfrManager.setPower(power, power);
Log.e("TAG", "setPower:" + readerErr);
}
@Override
public void sanRFID() {
List<Reader.TAGINFO> data = uhfrManager.tagInventoryRealTime();
if (data == null || data.isEmpty()) {
return;
}
epcDataInterface.epcData(data);
}
@Override
public void close() {
if (uhfrManager == null) {
return;
}
uhfrManager.asyncStopReading();
uhfrManager.close();
uhfrManager = null;
}
public interface EpcDataInterface {
void epcData(List<Reader.TAGINFO> data);
}
}

@ -0,0 +1,47 @@
package com.example.beijing_daxing.uitls;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool;
import com.bumptech.glide.load.resource.bitmap.BitmapTransformation;
import java.security.MessageDigest;
public class CustomWatermarkTransformation extends BitmapTransformation {
@Override
protected Bitmap transform(BitmapPool pool, Bitmap toTransform, int outWidth, int outHeight) {
// 获取原始图片的宽度和高度
int width = toTransform.getWidth();
int height = toTransform.getHeight();
// 创建一个新的Bitmap用于绘制带有水印的图片
Bitmap watermarkedBitmap = pool.get(width, height, Bitmap.Config.ARGB_8888);
// 创建画布,并将原始图片绘制到画布上
Canvas canvas = new Canvas(watermarkedBitmap);
canvas.drawBitmap(toTransform, 0, 0, null);
// 创建一个画笔,用于绘制水印
Paint paint = new Paint();
paint.setColor(Color.RED);
paint.setTextSize(50);
paint.setAntiAlias(true);
// 设置水印的透明度
paint.setAlpha(128);
// 在指定位置绘制水印文字
canvas.drawText("自定义水印1", width - 200, height - 50, paint);
canvas.drawText("自定义水印2", width - 200, height - 80, paint);
return watermarkedBitmap;
}
@Override
public void updateDiskCacheKey(MessageDigest messageDigest) {}
}

@ -11,6 +11,25 @@ public class LoginVm extends BaseObservable {
private String pass;
private boolean remember;
private String ipConfig;
private String epcConfig;
public String getIpConfig() {
return ipConfig;
}
public void setIpConfig(String ipConfig) {
this.ipConfig = ipConfig;
}
public String getEpcConfig() {
return epcConfig;
}
public void setEpcConfig(String epcConfig) {
this.epcConfig = epcConfig;
}
public String getName() {
return name;
}

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="50dp"/>
<solid android:color="#03A9F4"/>
</shape>

@ -22,7 +22,7 @@
style="@style/title_text"
android:layout_width="match_parent"
android:layout_height="45dp"
android:text="轮挡报废" />
android:text="维修和报废" />
<LinearLayout
android:layout_width="match_parent"
@ -170,13 +170,29 @@
</FrameLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="55dp"
android:layout_marginTop="15dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:orientation="horizontal">
<Button
style="@style/button_style"
android:layout_width="match_parent"
android:layout_height="55dp"
android:layout_marginTop="10dp"
android:layout_height="match_parent"
android:onClick="bf_submit4"
android:backgroundTint="@color/yellow"
android:layout_weight="1"
android:text="标记维修" />
<Button
style="@style/button_style"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:onClick="bf_submit"
android:layout_weight="1"
android:text="标记报废" />
</LinearLayout>
</LinearLayout>
</layout>

@ -17,6 +17,13 @@
name="checkState"
type="androidx.databinding.ObservableBoolean" />
<variable
name="listNumber"
type="String" />
<variable
name="sanNumber"
type="String" />
<import type="android.view.View" />
</data>
@ -36,9 +43,9 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="42dp"
android:layout_marginTop="2dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:layout_marginTop="2dp">
android:paddingRight="5dp">
<TextView
style="@style/item_text_style"
@ -46,6 +53,7 @@
android:layout_height="match_parent"
android:text="轮挡RFID" />
<View
android:layout_width="1dp"
android:layout_height="28dp"
@ -74,8 +82,7 @@
android:layout_height="match_parent"
android:letterSpacing="0.1"
android:text="操作"
android:textColor="@color/blue"
/>
android:textColor="@color/blue" />
</LinearLayout>
<!-- <LinearLayout
@ -159,6 +166,43 @@
android:padding="5dp"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="35dp">
<TextView
android:layout_width="50dp"
android:layout_height="match_parent"
android:gravity="center"
android:text="总数:" />
<TextView
android:layout_width="100dp"
android:layout_height="match_parent"
android:gravity="center"
android:text='@{listNumber??"0"}'
android:textColor="@color/blue" />
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1" />
<TextView
android:layout_width="50dp"
android:layout_height="match_parent"
android:gravity="center"
android:text="已扫描:" />
<TextView
android:layout_width="100dp"
android:layout_height="match_parent"
android:gravity="center"
android:text='@{sanNumber??"0"}'
android:textColor="@color/blue" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="55dp"
@ -175,27 +219,29 @@
android:onClick="offCheckRead"
android:text='@{checkState?"停止读取":"开始扫描"}'
android:textSize="20sp" />
<ImageButton
android:layout_width="100dp"
android:layout_height="match_parent"
android:layout_marginStart="10dp"
android:layout_marginEnd="5dp"
android:src="@mipmap/icon_cromer"
android:onClick="check_tackPhoto"/>
android:onClick="check_tackPhoto"
android:src="@mipmap/icon_cromer" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_marginLeft="10dp"
android:layout_weight="1">
android:layout_marginLeft="10dp">
<Button
android:layout_width="match_parent"
android:layout_height="match_parent"
android:onClick="check_showPhoto"
android:text="查看照片"/>
android:text="查看照片" />
<TextView
android:id="@+id/confirm_picture_number2"
@ -206,8 +252,7 @@
android:gravity="center"
android:text="0"
android:textColor="@color/white"
android:textSize="18sp"
/>
android:textSize="18sp" />
</FrameLayout>
</LinearLayout>

@ -27,6 +27,24 @@
android:layout_height="45dp"
android:letterSpacing="0"
android:text="待巡检机位列表" />
<LinearLayout
android:layout_width="match_parent"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:layout_height="45dp">
<TextView
android:layout_width="110dp"
android:layout_height="match_parent"
style="@style/info_text"
android:text="巡检状态:"/>
<Spinner
android:id="@+id/check_list_state"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textAlignment="center"
android:spinnerMode="dropdown"
android:entries="@array/checkState"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:paddingLeft="5dp"
@ -65,8 +83,7 @@
style="@style/item_text_style"
android:layout_width="115dp"
android:layout_height="match_parent"
android:text="机位编码"
android:text="机位编码(点击)"
/>
<View
@ -90,7 +107,7 @@
style="@style/item_text_style"
android:layout_width="63dp"
android:layout_height="match_parent"
android:text="操作" />
android:text="跳过" />
</LinearLayout>
@ -109,7 +126,7 @@
android:layout_height="55dp"
android:layout_margin="15dp"
android:onClick="check_start"
android:visibility="@{state?View.VISIBLE:View.GONE}"
android:text="创建巡检列表" />
android:text="创建巡检列表"
android:visibility="@{state?View.VISIBLE:View.GONE}" />
</LinearLayout>
</layout>

@ -21,7 +21,7 @@
style="@style/title_text"
android:layout_width="match_parent"
android:layout_height="45dp"
android:text="废品入库" />
android:text="异常轮挡回库" />
<LinearLayout
android:layout_width="match_parent"
@ -138,7 +138,7 @@
android:layout_width="110dp"
android:layout_height="45dp"
android:layout_gravity="center"
android:text="报时间:" />
android:text="报时间:" />
<TextView
style="@style/info_text1"
@ -178,6 +178,6 @@
android:layout_height="55dp"
android:layout_margin="20dp"
android:onClick="fpin_submit"
android:text="废品入库" />
android:text="库" />
</LinearLayout>
</layout>

@ -9,49 +9,37 @@
name="user"
type="com.example.beijing_daxing.vm.LoginVm" />
<variable
name="isShow"
type="androidx.databinding.ObservableBoolean" />
<import type="android.view.View" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@drawable/login_bg"
android:orientation="vertical"
tools:context=".MainActivity">
<!-- <FrameLayout-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content">-->
<!-- <ImageView-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="match_parent"-->
<!-- android:src="@mipmap/main_bg" />-->
<ImageView
android:layout_width="300dp"
android:layout_height="45dp"
android:layout_marginTop="100dp"
android:src="@mipmap/login_base"
android:textColor="@color/white"
android:layout_gravity="center"/>
<!-- </FrameLayout>-->
<TextView
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="50dp"
android:gravity="left|center"
android:text="登录RFID机场轮挡管理系统"
android:textColor="@color/black"
android:textSize="22sp" />
android:layout_height="55dp"
android:layout_marginTop="80dp"
android:gravity="center"
android:letterSpacing="0.5"
android:text="叉车人员管理"
android:textColor="@color/white"
android:textSize="25sp"
android:textStyle="bold" />
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/textInputLayout"
android:layout_width="match_parent"
android:layout_height="55dp"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginTop="20dp"
android:layout_marginTop="50dp"
android:layout_marginRight="20dp"
android:focusable="true"
android:focusableInTouchMode="true"
@ -59,7 +47,7 @@
<EditText
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@={user.name}" />
@ -68,7 +56,7 @@
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/textInputLayout2"
android:layout_width="match_parent"
android:layout_height="55dp"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginTop="15dp"
android:layout_marginRight="20dp"
@ -77,10 +65,10 @@
<EditText
android:layout_width="match_parent"
android:layout_height="50dp"
android:inputType="textPassword"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:imeOptions="actionDone"
android:inputType="textPassword"
android:text="@={user.pass}" />
</com.google.android.material.textfield.TextInputLayout>
@ -94,6 +82,44 @@
android:checked="@={user.remember}"
android:text="记住我" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginTop="15dp"
android:layout_marginRight="20dp"
android:visibility="@{isShow ? View.VISIBLE : View.GONE}"
android:orientation="vertical">
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:hint="输入IP地址"
android:imeOptions="actionDone"
android:text="@={user.ipConfig}" />
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:gravity="center"
android:hint="输入RFID 8位前缀"
android:imeOptions="actionDone"
android:text="@={user.epcConfig}" />
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="30dp"
android:gravity="right|center"
android:paddingEnd="20dp"
android:textColor="@color/blue"
android:text='@{isShow ? ">>> 隐藏" : "&lt;&lt;&lt; 配置"}'
android:onClick="setting"
android:textSize="18sp" />
<Button
android:layout_width="match_parent"
android:layout_height="55dp"
@ -101,10 +127,10 @@
android:layout_marginTop="10dp"
android:layout_marginRight="20dp"
android:letterSpacing="1"
android:onClick="login_click"
android:text="登录"
android:textSize="20sp"
android:textStyle="bold"
android:onClick="login_click"/>
android:textStyle="bold" />
</LinearLayout>

@ -0,0 +1,183 @@
<?xml version="1.0" encoding="utf-8"?>
<layout 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">
<data>
<variable
name="personInfo"
type="com.example.beijing_daxing.been.PmBasePersonInfo" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@color/bg1"
tools:context=".SelectPersonInfoActivity">
<TextView
style="@style/title_text"
android:layout_width="match_parent"
android:layout_height="45dp"
android:text="信息查询" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_marginTop="10dp"
android:orientation="horizontal">
<TextView
style="@style/info_text"
android:layout_width="110dp"
android:layout_height="45dp"
android:layout_gravity="center"
android:text="扫描RFID:" />
<TextView
android:id="@+id/select_info_epc"
style="@style/san_text"
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_gravity="center"
android:text="" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_marginTop="10dp"
android:orientation="horizontal">
<TextView
style="@style/info_text"
android:layout_width="110dp"
android:layout_height="45dp"
android:layout_gravity="center"
android:text="工号:" />
<TextView
style="@style/info_text1"
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_gravity="center"
android:text="@{personInfo.employeeId}" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_marginTop="10dp"
android:orientation="horizontal">
<TextView
style="@style/info_text"
android:layout_width="110dp"
android:layout_height="45dp"
android:layout_gravity="center"
android:text="姓名:" />
<TextView
style="@style/info_text1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:text="@{personInfo.peopleName}" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_marginTop="10dp"
android:orientation="horizontal">
<TextView
style="@style/info_text"
android:layout_width="110dp"
android:layout_height="45dp"
android:layout_gravity="center"
android:text="驾驶证代号:" />
<TextView
style="@style/info_text1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:text="@{personInfo.driverCode}" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_marginTop="10dp">
<TextView
style="@style/info_text"
android:layout_width="110dp"
android:layout_height="45dp"
android:layout_gravity="center"
android:text="有效日期:" />
<TextView
style="@style/info_text1"
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_gravity="center"
android:text="@{personInfo.joinDate}" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="205dp"
android:layout_marginTop="10dp">
<TextView
style="@style/info_text"
android:layout_width="110dp"
android:layout_height="45dp"
android:layout_gravity="center|top"
android:text="照片:" />
<ImageView
android:id="@+id/select_info_photo"
style="@style/info_text1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:onClick="selectInfoPhoto"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_marginTop="10dp">
<TextView
style="@style/info_text"
android:layout_width="110dp"
android:layout_height="45dp"
android:layout_gravity="center"
android:text="处罚说明:" />
<TextView
android:id="@+id/select_penalty"
style="@style/info_text1"
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_gravity="center"
android:drawableEnd="@mipmap/icon_select"
android:onClick="checkSelect"
android:paddingEnd="8dp"/>
</LinearLayout>
<Button
style="@style/button_style"
android:layout_width="match_parent"
android:layout_height="55dp"
android:layout_margin="20dp"
android:onClick="selectInfoSubmit"
android:text="处罚提交" />
</LinearLayout>
</layout>

@ -64,26 +64,26 @@
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_marginTop="10dp"
android:orientation="horizontal">
<!-- <LinearLayout-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="45dp"-->
<!-- android:layout_marginTop="10dp"-->
<!-- android:orientation="horizontal">-->
<TextView
style="@style/info_text"
android:layout_width="110dp"
android:layout_height="45dp"
android:layout_gravity="center"
android:text="盘点功率:" />
<!-- <TextView-->
<!-- style="@style/info_text"-->
<!-- android:layout_width="110dp"-->
<!-- android:layout_height="45dp"-->
<!-- android:layout_gravity="center"-->
<!-- android:text="盘点功率:" />-->
<EditText
style="@style/san_text"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:text='@={vm.powerStockCheck+""}' />
</LinearLayout>
<!-- <EditText-->
<!-- style="@style/san_text"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="match_parent"-->
<!-- android:layout_gravity="center"-->
<!-- android:text='@={vm.powerStockCheck+""}' />-->
<!-- </LinearLayout>-->
<LinearLayout
android:layout_width="match_parent"
@ -147,25 +147,25 @@
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_marginTop="10dp">
<!-- <LinearLayout-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="45dp"-->
<!-- android:layout_marginTop="10dp">-->
<TextView
style="@style/info_text"
android:layout_width="110dp"
android:layout_height="45dp"
android:layout_gravity="center"
android:text="废品出库:" />
<!-- <TextView-->
<!-- style="@style/info_text"-->
<!-- android:layout_width="110dp"-->
<!-- android:layout_height="45dp"-->
<!-- android:layout_gravity="center"-->
<!-- android:text="废品出库:" />-->
<EditText
style="@style/san_text"
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_gravity="center"
android:text='@={vm.powerScrapOut+""}' />
</LinearLayout>
<!-- <EditText-->
<!-- style="@style/san_text"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="45dp"-->
<!-- android:layout_gravity="center"-->
<!-- android:text='@={vm.powerScrapOut+""}' />-->
<!-- </LinearLayout>-->
<Button

@ -16,7 +16,7 @@
android:layout_height="50dp"
android:gravity="center"
android:letterSpacing="0.2"
android:text="输入提示"
android:text="选择跳过巡检原因"
android:textColor="@color/black"
android:textSize="23sp" />
@ -26,8 +26,18 @@
android:layout_height="100dp"
android:layout_margin="20dp"
android:background="@drawable/san_text_bg"
android:gravity="center"
android:hint="输入巡检跳过原因"
android:gravity="center" />
android:visibility="gone" />
<Spinner
android:id="@+id/input_dialog_select"
android:layout_width="match_parent"
android:layout_height="100dp"
android:layout_margin="20dp"
android:textAlignment="center"
android:spinnerMode="dropdown"
android:entries="@array/check_j"/>
<View
android:layout_width="match_parent"
@ -44,10 +54,10 @@
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:textSize="20sp"
android:textColor="@color/yellow"
android:letterSpacing="1"
android:text="取消" />
android:text="取消"
android:textColor="@color/yellow"
android:textSize="20sp" />
<View
android:layout_width="2dp"
@ -61,10 +71,10 @@
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:textSize="20sp"
android:textColor="@color/blue"
android:letterSpacing="1"
android:text="确定" />
android:text="确定"
android:textColor="@color/blue"
android:textSize="20sp" />
</LinearLayout>
</LinearLayout>

@ -0,0 +1,25 @@
<?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="450dp"
android:background="@drawable/info_text_bg"
android:orientation="vertical">
<ImageView
android:id="@+id/picture_imageview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:padding="12dp" />
<Button
android:id="@+id/confirm_back"
style="@style/button_style2"
android:layout_width="150dp"
android:layout_height="48dp"
android:layout_margin="10dp"
android:layout_gravity="center"
android:text="关闭" />
</LinearLayout>

@ -43,10 +43,10 @@
android:background="@color/white" />
<TextView
android:id="@+id/check_list_start"
style="@style/item_text_style"
android:layout_width="115dp"
android:layout_height="match_parent"
android:text="@{vm.locationCode}"
/>
@ -70,12 +70,11 @@
android:background="@color/white" />
<ImageView
android:id="@+id/check_list_start"
android:id="@+id/check_list_skip"
style="@style/item_text_style"
android:layout_width="63dp"
android:layout_height="match_parent"
android:src="@mipmap/ic_start"
android:src="@mipmap/ic_jump"
android:visibility='@{vm.taskState.equals("待完成")?View.VISIBLE:View.GONE}'
android:padding="5dp"/>
</LinearLayout>

Binary file not shown.

After

Width:  |  Height:  |  Size: 466 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

@ -7,6 +7,13 @@
<item>报废</item>
</string-array>
<string-array name="check_j">
<item>使用中</item>
<item>安全隔离未完成</item>
<item>轮挡损坏,需要维修</item>
<item>轮挡损坏,需要报废</item>
</string-array>
<string-array name="bfyy">
<item>轮挡绳子损坏</item>
@ -14,4 +21,11 @@
<item>橡胶损坏</item>
<item>其他</item>
</string-array>
<string-array name="checkState">
<item>全部</item>
<item>待完成</item>
<item>已完成</item>
<item>跳过</item>
</string-array>
</resources>

@ -1,3 +1,3 @@
<resources>
<string name="app_name">RFID轮挡</string>
<string name="app_name">人员管理</string>
</resources>
Loading…
Cancel
Save