配置调整

master
hwf452 10 months ago
parent 5d44210ac2
commit 0a13104961

@ -82,7 +82,6 @@
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
@ -190,6 +189,7 @@
android:screenOrientation="portrait" />
<activity
android:name=".activity.sbxj.SxgzActivity"
android:exported="true"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait" />
<activity

@ -104,6 +104,8 @@ public class LoginActivity extends BaseActivity {
// etUse.setText("BA001");
// etPwd.setText("BA001");
// etUse.setText("ba001");
// etPwd.setText("ba001");
}
@ -252,6 +254,7 @@ public class LoginActivity extends BaseActivity {
Intent intent = new Intent(LoginActivity.this, MainActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
startActivity(intent);
finish();
break;
@ -516,14 +519,17 @@ public class LoginActivity extends BaseActivity {
}
};
@Override
protected void onResume() {
super.onResume();
}
// @Override
// protected void onResume() {
// super.onResume();
// }
@Override
public void handleNfc(String result) {
super.handleNfc(result);
//super.handleNfc(result);
//nfcOnlineLogin(result);
showLog("-------------");
showLog(result);
showToast(result);
}
}

@ -271,32 +271,39 @@ public class MainActivity extends BaseActivity3 {
// str.add("测振");
if(iconText.equals("运行巡检")){
Intent intentTemp=new Intent(MainActivity.this, XscbglActivity.class);
intentTemp.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
intentTemp.putExtra("type","YX");
startActivity(intentTemp);
}else if(iconText.equals("燃料巡检")){
Intent intentTemp=new Intent(MainActivity.this, XscbglActivity.class);
intentTemp.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
intentTemp.putExtra("type","RL");
startActivity(intentTemp);
}else if(iconText.equals("运行定期")){
Intent intentTemp=new Intent(MainActivity.this, RegularActivity.class);
intentTemp.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
intentTemp.putExtra("type","YX");
startActivity(intentTemp);
}else if(iconText.equals("燃料定期")){
Intent intentTemp=new Intent(MainActivity.this, RegularActivity.class);
intentTemp.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
intentTemp.putExtra("type","RL");
startActivity(intentTemp);
}else if(iconText.equals("读取NFC")){
startActivity(NfcinfoActivity.class);
}else if(iconText.equals("测温")){
Intent intentTemp=new Intent(MainActivity.this, CustomDialogActivity.class);
intentTemp.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
intentTemp.putExtra("type","7");
startActivity(intentTemp);
}else if(iconText.equals("测振")){
Intent intentVibration=new Intent(MainActivity.this, CustomDialogActivity.class);
intentVibration.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
intentVibration.putExtra("type","11");
startActivity(intentVibration);
}else if(iconText.equals("保安巡检")){
Intent intentTemp=new Intent(MainActivity.this, XscbglActivity.class);
intentTemp.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
intentTemp.putExtra("type","BA");
startActivity(intentTemp);
}else if(iconText.equals("手电筒")){
@ -307,6 +314,7 @@ public class MainActivity extends BaseActivity3 {
if (NetworkUtil.hasNetWorkStatus(context, true)) {
Log.i("app", "有wifi网络");
Intent intentTemp = new Intent(context, BamjActivity.class);
intentTemp.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
intentTemp.putExtra("type", "BA");
startActivity(intentTemp);
} else {

@ -66,7 +66,7 @@ public class SxgzActivity extends BaseActivity3 {
private List<XSJJHXZDataBean> noCheckeListBA = new ArrayList<>();
private List<String> qybh = new ArrayList<>();
private ArrayList<XSJJHDataBean> xsjjhDataBeanArrayList = new ArrayList<>();//点检记录列表
String nfcValue = null;
//String nfcValue = null;
String lastNfcbm = null;
private String type = null;
private String username;
@ -93,6 +93,7 @@ public class SxgzActivity extends BaseActivity3 {
private void goScan() {
Intent intent = new Intent(SxgzActivity.this, MipcaActivityCapture.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
startActivityForResult(intent, 1);
}
@ -108,7 +109,12 @@ public class SxgzActivity extends BaseActivity3 {
Intent intent = getIntent();
type = intent.getStringExtra("type");
username = (String) SPUtils.get(context, Contans.USERID, "");
// showLog(type);
// showLog(username);
lv.setEmptyView(tvNodata);
headView = View.inflate(this, R.layout.xsgz_item, null);
headView.findViewById(R.id.head).setVisibility(View.VISIBLE);
@ -136,6 +142,7 @@ public class SxgzActivity extends BaseActivity3 {
public void onClick(View v) {
Bundle bundle = new Bundle();
Intent intent = new Intent(SxgzActivity.this, CheckedListActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
// bundle.putParcelableArrayList("xsjjhDataBeanArrayList", xsjjhDataBeanArrayList);
// bundle.putBoolean("edit", false);
// bundle.putInt(Contans.KEY_ITEM, 0);
@ -152,6 +159,7 @@ public class SxgzActivity extends BaseActivity3 {
public void onClick(View v) {
Bundle bundle = new Bundle();
Intent intent = new Intent(SxgzActivity.this, NoCheckedListActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
// bundle.putParcelableArrayList("xsjjhDataBeanArrayList", xsjjhDataBeanArrayList);
// bundle.putBoolean("edit", false);
// bundle.putInt(Contans.KEY_ITEM, 0);
@ -182,57 +190,54 @@ public class SxgzActivity extends BaseActivity3 {
setListData();
}
@Override
public void handleNfc(String result) {
super.handleNfc(result);
handleNfcCheck(result);
//handleNfcCheck("04B46E8AF36780");
}
//加载数据库中已经下载的计划
private void getDataInSqlite() {
xsjjhxzDataBeanList.clear();
checkedListBA.clear();
noCheckeListBA.clear();
checkedList.clear();
noCheckeList.clear();
List<XSJJHXZDataBean> planTemp = where("mk = ? and username = ?", type, username).find(XSJJHXZDataBean.class);
//DataSupport.findAll(XSJJHXZDataBean.class);
List<XSJJHXZDataBean> planTemp1 = this.removeDuplicate(planTemp);
xsjjhxzDataBeanList.addAll(planTemp1);
Log.i("app", String.valueOf(xsjjhxzDataBeanList.size()));
for (int i = 0; i < xsjjhxzDataBeanList.size(); i++) {
XSJJHXZDataBean item = xsjjhxzDataBeanList.get(i);
if (type != null && type.equals("BA")) {
if(item.isBAChecked()){
checkedListBA.add(item);
if(type!=null&&username!=null){
xsjjhxzDataBeanList.clear();
checkedListBA.clear();
noCheckeListBA.clear();
checkedList.clear();
noCheckeList.clear();
List<XSJJHXZDataBean> planTemp = where("mk = ? and username = ?", type, username).find(XSJJHXZDataBean.class);
//DataSupport.findAll(XSJJHXZDataBean.class);
List<XSJJHXZDataBean> planTemp1 = this.removeDuplicate(planTemp);
xsjjhxzDataBeanList.addAll(planTemp1);
//showLog(String.valueOf(String.valueOf(xsjjhxzDataBeanList.size())));
for (int i = 0; i < xsjjhxzDataBeanList.size(); i++) {
XSJJHXZDataBean item = xsjjhxzDataBeanList.get(i);
if (type != null && type.equals("BA")) {
//showLog(GsonUtils.GsonString(item));
if(item.isBAChecked()){
checkedListBA.add(item);
}else{
noCheckeListBA.add(item);
}
}else{
noCheckeListBA.add(item);
}
}else{
int checkedCount = 0;
List<XSJJHDataBean> xsjjhdatabean = DataSupport.where("qybh = ? and mk = ? and username = ?", item.getQybh(), type, username).find(XSJJHDataBean.class);
for (int j = 0; j< xsjjhdatabean.size(); j++) {
if (xsjjhdatabean.get(j).isChecked()) {
checkedCount++;
int checkedCount = 0;
List<XSJJHDataBean> xsjjhdatabean = DataSupport.where("qybh = ? and mk = ? and username = ?", item.getQybh(), type, username).find(XSJJHDataBean.class);
for (int j = 0; j< xsjjhdatabean.size(); j++) {
if (xsjjhdatabean.get(j).isChecked()) {
checkedCount++;
}
}
int a = checkedCount;
int b = xsjjhdatabean.size();
if (a == b) {
checkedList.add(item);
} else {
noCheckeList.add(item);
}
}
int a = checkedCount;
int b = xsjjhdatabean.size();
if (a == b) {
checkedList.add(item);
} else {
noCheckeList.add(item);
}
}
}
total_point.setText(String.valueOf(xsjjhxzDataBeanList.size()));
if (type != null && type.equals("BA")) {
total_no_check.setText(String.valueOf(noCheckeListBA.size()));
total_checked.setText(String.valueOf(checkedListBA.size()));
}else{
total_no_check.setText(String.valueOf(noCheckeList.size()));
total_checked.setText(String.valueOf(checkedList.size()));
total_point.setText(String.valueOf(xsjjhxzDataBeanList.size()));
if (type != null && type.equals("BA")) {
total_no_check.setText(String.valueOf(noCheckeListBA.size()));
total_checked.setText(String.valueOf(checkedListBA.size()));
}else{
total_no_check.setText(String.valueOf(noCheckeList.size()));
total_checked.setText(String.valueOf(checkedList.size()));
}
}
}
@ -324,7 +329,7 @@ public class SxgzActivity extends BaseActivity3 {
} else {
showToast("请使用NFC进行巡检");
nfcValue = "click";
//nfcValue = "click";
xsjjhDataBeanArrayList.clear();
//List<XSJJHDataBean> xsjjhdatabean = DataSupport.where("qybh = ?",xsjjhxzDataBeanList.get(postion - 1).getQybh()).find( XSJJHDataBean.class);
xsjjhDataBeanArrayList.addAll(where("qybh = ? and mk = ? and username = ?", xsjjhxzDataBeanList.get(postion - 1).getQybh(), type, username).find(XSJJHDataBean.class));
@ -333,6 +338,7 @@ public class SxgzActivity extends BaseActivity3 {
if (xsjjhDataBeanArrayList.size() != 0) {
Bundle bundle = new Bundle();
Intent intent = new Intent(SxgzActivity.this, XjYulActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
bundle.putParcelableArrayList("xsjjhDataBeanArrayList", xsjjhDataBeanArrayList);
bundle.putBoolean("edit", false);
// bundle.putBoolean("edit", true);
@ -363,10 +369,16 @@ public class SxgzActivity extends BaseActivity3 {
//处理NFC的数据
public void handleNfcCheck(String result) {
// showLog(type);
// showLog(username);
// showLog(result);
if (type != null && type.equals("BA")) {
//showLog("BA");
//保安巡检
List<XSJJHXZDataBean> planNFC = where("nfcbm = ? and mk = ? and username = ?", result, type, username).find(XSJJHXZDataBean.class);
//showLog(String.valueOf(planNFC.size()));
if (planNFC != null && planNFC.size() > 0) {
showLog("planNFC != null");
XSJJHXZDataBean itemQY = planNFC.get(0);
String content = null;
String notice = null;
@ -395,22 +407,38 @@ public class SxgzActivity extends BaseActivity3 {
auditDialog.setCancelable(true);
auditDialog.show();
} else {
nfcValue = null;
//showLog("planNFC == null");
BaCheckDialog auditDialog = new BaCheckDialog(context, "无数据请联系管理员", new BaCheckDialog.AuditDialogListener() {
@Override
public void confirm(String notice) {
}
});
auditDialog.setTvTitle("提示");
auditDialog.setNotice("");
auditDialog.hideNotice("");
auditDialog.setCancelable(true);
auditDialog.hideBottomClick();
auditDialog.show();
//nfcValue = null;
//getLastUploadUser(result);
toastviewbymyself.makeText(SxgzActivity.this, "无数据请联系管理员", Toast.LENGTH_SHORT).show();
//showToast("无数据请联系管理员");
//toastviewbymyself.makeText(SxgzActivity.this, "无数据请联系管理员", Toast.LENGTH_SHORT).show();
}
} else {
//showLog("运行,燃料巡检");
//运行,燃料巡检
List<XSJJHDataBean> xsjjhDataBeen = DataSupport.where("nfcbm = ? and mk = ? and username = ?", result, type, username).find(XSJJHDataBean.class);
xsjjhDataBeanArrayList.clear();
xsjjhDataBeanArrayList.addAll(xsjjhDataBeen);
if (xsjjhDataBeen.size() == 0) {
nfcValue = null;
//nfcValue = null;
//getLastUploadUser(result);
toastviewbymyself.makeText(SxgzActivity.this, "无数据请联系管理员", Toast.LENGTH_SHORT).show();
} else {
Bundle bundle3 = new Bundle();
Intent intent = new Intent(SxgzActivity.this, XjYulActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
bundle3.putParcelableArrayList("xsjjhDataBeanArrayList", xsjjhDataBeanArrayList);
bundle3.putBoolean("edit", true);
bundle3.putInt(Contans.KEY_ITEM, 0);
@ -538,8 +566,20 @@ public class SxgzActivity extends BaseActivity3 {
auditDialog.setCancelable(true);
auditDialog.show();
} else {
nfcValue = null;
toastviewbymyself.makeText(SxgzActivity.this, "无数据请联系管理员", Toast.LENGTH_SHORT).show();
//nfcValue = null;
BaCheckDialog auditDialog = new BaCheckDialog(context, "无数据请联系管理员", new BaCheckDialog.AuditDialogListener() {
@Override
public void confirm(String notice) {
}
});
auditDialog.setTvTitle("提示");
auditDialog.setNotice("");
auditDialog.hideNotice("");
auditDialog.setCancelable(true);
auditDialog.hideBottomClick();
auditDialog.show();
//toastviewbymyself.makeText(SxgzActivity.this, "无数据请联系管理员", Toast.LENGTH_SHORT).show();
}
} else {
List<XSJJHXZDataBean> scranTwoCodeList = where("txm = ? and txm_zt = 1 and mk = ? and username = ?", result, type, username).find(XSJJHXZDataBean.class);
@ -552,11 +592,12 @@ public class SxgzActivity extends BaseActivity3 {
xsjjhDataBeanArrayList.clear();
xsjjhDataBeanArrayList.addAll(xsjjhDataBeen);
if (xsjjhDataBeen.size() == 0) {
nfcValue = null;
//nfcValue = null;
toastviewbymyself.makeText(SxgzActivity.this, "无数据请联系管理员", Toast.LENGTH_SHORT).show();
} else {
Bundle bundle3 = new Bundle();
Intent intent = new Intent(SxgzActivity.this, XjYulActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
bundle3.putParcelableArrayList("xsjjhDataBeanArrayList", xsjjhDataBeanArrayList);
bundle3.putBoolean("edit", true);
bundle3.putInt(Contans.KEY_ITEM, 0);
@ -689,6 +730,14 @@ public class SxgzActivity extends BaseActivity3 {
@Override
protected void onResume() {
super.onResume();
nfcValue = null;
//nfcValue = null;
}
@Override
public void handleNfc(String result) {
// showLog("-------------");
// showLog(result);
handleNfcCheck(result);
//handleNfcCheck("SGP-AB001");
}
}

@ -119,14 +119,17 @@ public class XscbglActivity extends BaseActivity {
switch (i) {
case 0:
intent = new Intent(XscbglActivity.this, XjMainActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
intent.putExtra("type",type);
break;
case 1:
intent = new Intent(XscbglActivity.this, SxgzActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
intent.putExtra("type",type);
break;
case 2:
intent = new Intent(XscbglActivity.this, XJStatisticsActivity.class);//XJStatisticsMyUploadActivity //XJStatisticsActivity
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
intent.putExtra("type",type);
break;
}

@ -325,7 +325,7 @@ public class XzxsjhFragment extends BaseFragment {
XSJJHXZDataBean xsjjhxzDataBean = xsjjhxzDataBeanList.get(i);
Log.i("app", gson.toJson(xsjjhxzDataBean));
}
DataSupport.updateAll(Xjjh.class, values, "zxid = ? and mk = ? and username = ?", xsjjhxzDataBeanList.get(0).getZxid(), type, username);
DataSupport.updateAll(Xjjh.class, values, "zxid = ? and mk = ? and username = ?", xsjjhxzDataBeanList.get(0).getZxid(), type, username);
List<Xjjh> xjjhTemp = where("mk = ? and zxid = ? and username = ?", type, xsjjhxzDataBeanList.get(0).getZxid(), username).find(Xjjh.class);
String jhmc = "";
if (xjjhTemp != null && xjjhTemp.size() > 0) {
@ -443,7 +443,7 @@ public class XzxsjhFragment extends BaseFragment {
Log.i("app", "--------");
if (xsjjhxzDataBeanList != null && xsjjhxzDataBeanList.size() > 0) {
Log.i("app", String.valueOf(xsjjhxzDataBeanList.size()));
DataSupport.updateAll(Xjjh.class, values, "zxid = ? and mk = ? and username = ?", xsjjhxzDataBeanList.get(0).getZxid(), type, username);
DataSupport.updateAll(Xjjh.class, values, "zxid = ? and mk = ? and username = ?", xsjjhxzDataBeanList.get(0).getZxid(), type, username);
}
int dataCount = DataSupport.count(XSJJHXZDataBean.class);
int index;//序号
@ -478,7 +478,7 @@ public class XzxsjhFragment extends BaseFragment {
dialog.cancel();
xjjhs.clear();
List<Xjjh> xjjhListall = new ArrayList<>();
xjjhs.addAll(where("download = ? and mk = ? and username = ?", "0", type, username).find(Xjjh.class));
xjjhs.addAll(where("download = ? and mk = ? and username = ?", "0", type, username).find(Xjjh.class));
if (adapter != null) {
cb.setChecked(false);
adapter.notifyDataSetChanged();

@ -84,7 +84,7 @@ public abstract class BaseActivity extends AutoLayoutActivity {
}
public void showToast(String text) {
if (text != null && !text.trim().equals("")) {
if (text != null) {
Toast.makeText(this, text, Toast.LENGTH_SHORT).show();
}
}
@ -130,7 +130,7 @@ public abstract class BaseActivity extends AutoLayoutActivity {
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.S) {
pendingIntent = PendingIntent.getActivity(this, 0, new Intent(this, getClass()).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP), PendingIntent.FLAG_MUTABLE | PendingIntent.FLAG_UPDATE_CURRENT);
} else {
pendingIntent = PendingIntent.getActivity(this, 0, new Intent(this, getClass()).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP), 0);
pendingIntent = PendingIntent.getActivity(this, 0, new Intent(this, getClass()).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP), PendingIntent.FLAG_UPDATE_CURRENT);
}
//设定要过滤的标签动作这里只接收ACTION_NDEF_DISCOVERED类型
ndef = new IntentFilter(NfcAdapter.ACTION_NDEF_DISCOVERED);

@ -84,7 +84,7 @@ public abstract class BaseActivity3 extends AutoLayoutActivity {
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.S) {
pendingIntent = PendingIntent.getActivity(this, 0, new Intent(this, getClass()).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP), PendingIntent.FLAG_MUTABLE | PendingIntent.FLAG_UPDATE_CURRENT);
} else {
pendingIntent = PendingIntent.getActivity(this, 0, new Intent(this, getClass()).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP), 0);
pendingIntent = PendingIntent.getActivity(this, 0, new Intent(this, getClass()).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP), PendingIntent.FLAG_UPDATE_CURRENT);
}
//pendingIntent = PendingIntent.getActivity(this, 0, new Intent(this, getClass()).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP), 0);
//设定要过滤的标签动作这里只接收ACTION_NDEF_DISCOVERED类型

@ -7,6 +7,10 @@ public class Contans {
public static String LOGINNFC = "AppLogin/userLogin.ashx";
//内网正式环境
public static String IP = "http://10.21.100.21:1102/";
// public static String IP = "http://192.168.2.6:9099/";
public static String MAXIMOIP = "http://10.46.0.152:7001/";

Loading…
Cancel
Save