28个文件已添加
1个文件已删除
48个文件已修改
1 文件已重命名
| | |
| | | package com.dayu.recharge; |
| | | |
| | | import android.app.Activity; |
| | | import android.app.Application; |
| | | import android.content.Context; |
| | | import android.content.Intent; |
| | | import android.text.TextUtils; |
| | | |
| | | import com.dayu.baselibrary.BaseApplication; |
| | | import com.dayu.baselibrary.business.BusinessProvider; |
| | | import com.dayu.baselibrary.business.StartLoginNavigotor; |
| | | import com.dayu.baselibrary.dao.BaseDaoSingleton; |
| | | import com.dayu.baselibrary.dbbean.LibraryBean; |
| | | import com.dayu.baselibrary.utils.BaseCommon; |
| | |
| | | import com.dayu.henanlibrary.dbBean.AdminDataBean; |
| | | import com.dayu.qihealonelibrary.QHAloneApplication; |
| | | import com.dayu.qiheonlinelibrary.QHOnLineApplication; |
| | | import com.dayu.recharge.activity.LoginActivity; |
| | | import com.tencent.bugly.crashreport.CrashReport; |
| | | |
| | | import java.io.File; |
| | | |
| | | public class MyApplication extends Application { |
| | | public class MyApplication extends Application implements StartLoginNavigotor { |
| | | public static String TAG = "MyApplication"; |
| | | |
| | | //当前加载的library模块 //0:河南版本,1齐河单机版 |
| | |
| | | QHAloneApplication.getInstance().application = this; |
| | | break; |
| | | case BaseCommon.QHOnLineLibrary: |
| | | QHOnLineApplication.getInstance().application = this; |
| | | QHOnLineApplication.getInstance(this); |
| | | BusinessProvider.getInstance(this); |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void navigateToLogin(Context context) { |
| | | Intent intent = new Intent(context, LoginActivity.class); |
| | | intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); |
| | | context.startActivity(intent); |
| | | } |
| | | } |
| | |
| | | import android.os.Bundle; |
| | | import android.text.TextUtils; |
| | | import android.util.Log; |
| | | import android.view.KeyEvent; |
| | | import android.view.LayoutInflater; |
| | | import android.view.View; |
| | | import android.widget.Toast; |
| | | |
| | | import androidx.annotation.NonNull; |
| | |
| | | import com.dayu.henanlibrary.dao.HNBaseDaoSingleton; |
| | | |
| | | import com.dayu.qihealonelibrary.activity.HomeActivity; |
| | | import com.dayu.qiheonlinelibrary.QHOnLineApplication; |
| | | import com.dayu.qiheonlinelibrary.dao.QHOnLineAppDatabase; |
| | | import com.dayu.qiheonlinelibrary.dao.QHOnlineBaseDaoSingleton; |
| | | import com.dayu.recharge.MyApplication; |
| | | import com.dayu.recharge.databinding.ActivityLoginBinding; |
| | | import com.hjq.permissions.OnPermissionCallback; |
| | |
| | | |
| | | ActivityLoginBinding binding; |
| | | PassWordBean passWordBean; |
| | | // com.dayu.qihealonelibrary.dbBean.PassWordBean |
| | | // com.dayu.qihealonelibrary.dbBean.PassWordBean |
| | | int clickNumber; |
| | | |
| | | @Override |
| | |
| | | }); |
| | | binding.loginBtn.setOnClickListener(v -> { |
| | | String psStr = binding.loginPw.getText().toString(); |
| | | String nameStr = binding.loginName.getText().toString(); |
| | | if (TextUtils.isEmpty(psStr)) { |
| | | TipUtil.show("请输入密码"); |
| | | return; |
| | | } |
| | | if ((passWordBean == null && psStr.equals("123456")) |
| | | if (MyApplication.myApplication.libraryType == BaseCommon.QHOnLineLibrary && TextUtils.isEmpty(nameStr)) { |
| | | TipUtil.show("请输入账号"); |
| | | return; |
| | | } |
| | | if (MyApplication.myApplication.libraryType == BaseCommon.QHOnLineLibrary) { |
| | | QHOnLineApplication.getInstance().getPublicKey(this, nameStr, psStr); |
| | | } else if ((passWordBean == null && psStr.equals("123456")) |
| | | || passWordBean != null && passWordBean.getPassWord().equalsIgnoreCase(WSMD5.getMD5Str(psStr))) { |
| | | |
| | | startToHomeActivity(); |
| | | |
| | | startToHomeActivity(); |
| | | } else { |
| | | Toast.makeText(LoginActivity.this, "密码错误", Toast.LENGTH_SHORT).show(); |
| | | } |
| | | |
| | | |
| | | }); |
| | | try { |
| | | PackageInfo packageInfo = getPackageManager().getPackageInfo(getPackageName(), 0); |
| | | binding.versionName.setText("当前版本:V" + packageInfo.versionName); |
| | | } catch (PackageManager.NameNotFoundException e) { |
| | | } catch ( |
| | | PackageManager.NameNotFoundException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | protected void onResume() { |
| | | super.onResume(); |
| | | Log.i("LoginActivity","onResume"); |
| | | |
| | | Log.i("LoginActivity", "onResume"); |
| | | if (MyApplication.myApplication.libraryType == BaseCommon.QHOnLineLibrary) { |
| | | binding.nameLL.setVisibility(View.VISIBLE); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | if (type == BaseCommon.HeNanLibrary) { |
| | | getHNPermission(); |
| | | } else if (type == BaseCommon.QHOnLineLibrary) { |
| | | getHNPermission(); |
| | | getQHOnlinPermission(); |
| | | binding.nameLL.setVisibility(View.VISIBLE); |
| | | } |
| | | MyApplication.myApplication.initApplication(); |
| | | }); |
| | |
| | | startActivity(new Intent(LoginActivity.this, com.dayu.henanlibrary.activity.HomeActivity.class)); |
| | | } else if (MyApplication.myApplication.libraryType == BaseCommon.QHAloneLibrary) { |
| | | startActivity(new Intent(LoginActivity.this, HomeActivity.class)); |
| | | }else if (MyApplication.myApplication.libraryType==BaseCommon.QHOnLineLibrary){ |
| | | } else if (MyApplication.myApplication.libraryType == BaseCommon.QHOnLineLibrary) { |
| | | startActivity(new Intent(LoginActivity.this, com.dayu.qiheonlinelibrary.activity.HomeActivity.class)); |
| | | } |
| | | LoginActivity.this.finish(); |
| | |
| | | } |
| | | |
| | | |
| | | private void getQHOnlinPermission() { |
| | | try { |
| | | XXPermissions.with(this) |
| | | // 申请单个权限 |
| | | // .permission(Permission.RECORD_AUDIO) |
| | | // 申请多个权限 |
| | | .permission(Permission.READ_PHONE_STATE, |
| | | Permission.READ_EXTERNAL_STORAGE, |
| | | Permission.WRITE_EXTERNAL_STORAGE) |
| | | // 设置权限请求拦截器(局部设置) |
| | | //.interceptor(new PermissionInterceptor()) |
| | | // 设置不触发错误检测机制(局部设置) |
| | | //.unchecked() |
| | | .request(new OnPermissionCallback() { |
| | | |
| | | @Override |
| | | public void onGranted(@NonNull List<String> permissions, boolean allGranted) { |
| | | if (allGranted) { |
| | | if (allGranted) {//所有申请的权限都已通过 |
| | | try { |
| | | File file = new File(QHOnlineBaseDaoSingleton.SqlitePath); |
| | | if (!file.exists()) { |
| | | file.mkdirs(); |
| | | } |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onDenied(@NonNull List<String> permissions, boolean doNotAskAgain) { |
| | | if (doNotAskAgain) { |
| | | // 如果是被永久拒绝就跳转到应用权限系统设置页面 |
| | | } else { |
| | | // toast("获取录音和日历权限失败"); |
| | | } |
| | | } |
| | | }); |
| | | } catch (Throwable e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | long mExitTime; |
| | | @Override |
| | | public boolean onKeyDown(int keyCode, KeyEvent event) { |
| | | if (keyCode == KeyEvent.KEYCODE_BACK) { |
| | | if ((System.currentTimeMillis() - mExitTime) > 2000) { |
| | | Toast.makeText(LoginActivity.this, "再按一次退出程序", Toast.LENGTH_SHORT).show(); |
| | | mExitTime = System.currentTimeMillis(); |
| | | } else { |
| | | LoginActivity.this.finish(); |
| | | } |
| | | return true; |
| | | } |
| | | return super.onKeyDown(keyCode, event); |
| | | } |
| | | } |
| | |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:hint="请输入账号" |
| | | android:text="" /> |
| | | android:text="zuoxiao" /> |
| | | </LinearLayout> |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | |
| | | android:layout_height="wrap_content" |
| | | android:hint="初始密码为数字1-6" |
| | | android:inputType="textPassword" |
| | | android:text="" /> |
| | | android:text="ZX@@123qwA" /> |
| | | </LinearLayout> |
| | | |
| | | |
| New file |
| | |
| | | package com.dayu.baselibrary.business; |
| | | |
| | | /** |
| | | * author: zuo |
| | | * Date: 2024-08-05 |
| | | * Time: 14:15 |
| | | * 备注: |
| | | */ |
| | | public class BusinessProvider { |
| | | public static BusinessProvider businessProvider; |
| | | public StartLoginNavigotor startLoginNavigotor; |
| | | |
| | | public static BusinessProvider getInstance(StartLoginNavigotor startLoginNavigotor) { |
| | | if (businessProvider == null) { |
| | | |
| | | businessProvider = new BusinessProvider(); |
| | | businessProvider.startLoginNavigotor = startLoginNavigotor; |
| | | } |
| | | return businessProvider; |
| | | } |
| | | |
| | | public static BusinessProvider getBusinessProvider() { |
| | | return businessProvider; |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.dayu.baselibrary.business; |
| | | |
| | | import android.content.Context; |
| | | |
| | | /** |
| | | * author: zuo |
| | | * Date: 2024-08-05 |
| | | * Time: 12:29 |
| | | * 备注: |
| | | */ |
| | | public interface StartLoginNavigotor { |
| | | |
| | | void navigateToLogin(Context context); |
| | | } |
| | |
| | | public final static int HeNanLibrary = 0; |
| | | public final static int QHAloneLibrary = 1; |
| | | |
| | | public final static int QHOnLineLibrary=2; |
| | | public final static int QHOnLineLibrary = 2; |
| | | |
| | | /** |
| | | * 当前卡密码错误,不是本公司卡 |
| | | */ |
| | | public final static String CARD_TYPE_ERROR2= "-2"; |
| | | public final static String CARD_TYPE_ERROR2 = "-2"; |
| | | |
| | | public final static String CARD_TYPE_ERROR1="-1"; |
| | | public final static String CARD_TYPE_ERROR1 = "-1"; |
| | | |
| | | //挂失卡片 |
| | | public final static int LOSS_CARD = 1; |
| | | //解除挂失 |
| | | public final static int REPORT_LOSS_CARD = 2; |
| | | //未关泵补卡 |
| | | public final static int REPLACE_HAS_CARD = 3; |
| | | //已关泵补卡 |
| | | public final static int REPLACE_NO_CARD = 4; |
| | | |
| | | } |
| New file |
| | |
| | | package com.dayu.baselibrary.utils; |
| | | |
| | | import android.annotation.SuppressLint; |
| | | import android.os.Build; |
| | | |
| | | import java.lang.reflect.Method; |
| | | |
| | | /** |
| | | * author: zuo |
| | | * Date: 2024-08-02 |
| | | * Time: 17:29 |
| | | * 备注: |
| | | */ |
| | | public class DeviceUtils { |
| | | @SuppressLint("MissingPermission") |
| | | public static String getSN() { |
| | | String serial = null; |
| | | try { |
| | | Class<?> c = Class.forName("android.os.SystemProperties"); |
| | | Method get = c.getMethod("get", String.class); |
| | | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { |
| | | try { |
| | | serial = (String) get.invoke(c, "ro.sunmi.serial"); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return serial; |
| | | } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { |
| | | serial = Build.getSerial(); |
| | | return serial; |
| | | } else { |
| | | //安卓8以下使用Build.SERIAL相同方式 |
| | | //return Build.SERIAL; |
| | | try { |
| | | serial = (String) get.invoke(c, "ro.serialno"); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return serial; |
| | | } |
| | | } catch (ClassNotFoundException e) { |
| | | throw new RuntimeException(e); |
| | | } catch (NoSuchMethodException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | } |
| | |
| | | package com.dayu.baselibrary.utils; |
| | | |
| | | import android.text.TextUtils; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.text.DecimalFormat; |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | public static int changeY2F(String amount) { |
| | | if (TextUtils.isEmpty(amount)){ |
| | | return 0; |
| | | } |
| | | BigDecimal bigDecimal = new BigDecimal(amount).setScale(2); |
| | | return bigDecimal.multiply(new BigDecimal(100)).intValue(); |
| | | } |
| | |
| | | |
| | | |
| | | /** |
| | | * 精确除法,保留两位小数 |
| | | * 精确除法,保留两位小数 |
| | | * |
| | | * @param dividend |
| | | * @param divisor |
| | | * @return |
| | |
| | | return df.format(result); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 系数和水价相乘获得电价保留三位小数 |
| | | * @param num1 |
| | | * @param num2 |
| | | * @return |
| | | */ |
| | | public static String multiplyPrice(float num1, float num2) { |
| | | BigDecimal bd1 = BigDecimal.valueOf(num1); |
| | | BigDecimal bd2 = BigDecimal.valueOf(num2); |
| | | BigDecimal result = bd1.multiply(bd2); |
| | | return result.setScale(3, RoundingMode.HALF_UP).toString(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * |
| | | * @param num1 |
| | | * @param num2 |
| | | * @return |
| | | */ |
| | | public static String sumPrice(float num1, float num2) { |
| | | BigDecimal bd1 = BigDecimal.valueOf(num1); |
| | | BigDecimal bd2 = BigDecimal.valueOf(num2); |
| | | BigDecimal result = bd1.add(bd2); |
| | | return result.setScale(2, RoundingMode.HALF_UP).toString(); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | Activity mContext; |
| | | View.OnClickListener mListner; |
| | | String mData; |
| | | String mTitle; |
| | | |
| | | public ConfirmDialog(@NonNull Activity context) { |
| | | super(context, com.dayu.baselibrary.R.style.ws_pay_showSelfDialog); |
| | |
| | | initView(); |
| | | } |
| | | |
| | | public ConfirmDialog(@NonNull Activity context, String title, String data, View.OnClickListener listner) { |
| | | super(context, com.dayu.baselibrary.R.style.ws_pay_showSelfDialog); |
| | | mContext = context; |
| | | mListner = listner; |
| | | mData = data; |
| | | mTitle = title; |
| | | initView(); |
| | | } |
| | | |
| | | |
| | | private void initView() { |
| | | getWindow().setGravity(Gravity.CENTER); |
| | | setContentView(R.layout.confirm_dialog); |
| | | setCanceledOnTouchOutside(false); |
| | | TextView title = (TextView) this.findViewById(R.id.title); |
| | | if (!TextUtils.isEmpty(mTitle)) { |
| | | title.setVisibility(View.VISIBLE); |
| | | title.setText(mTitle); |
| | | } |
| | | |
| | | TextView data = (TextView) this.findViewById(R.id.confirm_data); |
| | | if (!TextUtils.isEmpty(mData)) { |
| | | data.setText(mData); |
| | |
| | | DialogBack mDialogBack; |
| | | |
| | | String mEdtHint; |
| | | String mTitle; |
| | | |
| | | public EdtDialog(Context context, Intent intent) { |
| | | super(context, R.style.ws_pay_showSelfDialog); |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * @param context |
| | | * @param edtHint 输入框默认显示的内容 |
| | | * @param dialogBack |
| | | */ |
| | | public EdtDialog(Context context, String title, String edtHint, DialogBack dialogBack) { |
| | | super(context, R.style.ws_pay_showSelfDialog); |
| | | mContext = context; |
| | | mDialogBack = dialogBack; |
| | | mEdtHint = edtHint; |
| | | mTitle = title; |
| | | initView(); |
| | | } |
| | | |
| | | |
| | | private void initView() { |
| | | getWindow().setGravity(Gravity.CENTER); |
| | | setContentView(R.layout.edt_dialog); |
| | |
| | | if (!TextUtils.isEmpty(mEdtHint)) { |
| | | editText.setHint(mEdtHint); |
| | | } |
| | | TextView title = this.findViewById(R.id.title); |
| | | if (!TextUtils.isEmpty(mTitle)) { |
| | | title.setVisibility(View.VISIBLE); |
| | | title.setText(mTitle); |
| | | } |
| | | |
| | | |
| | | TextView cannel = (TextView) this.findViewById(R.id.pw_cannel); |
| | | textView.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | |
| | | mDialogBack = dialogBack; |
| | | initView(); |
| | | } |
| | | |
| | | @Override |
| | | public void onBackPressed() { |
| | | // 拦截返回键事件,不执行默认的操作 |
| | | // 如果想要对话框消失,可以在此处调用 super.onBackPressed(); |
| | | } |
| | | |
| | | private void initView() { |
| | | getWindow().setGravity(Gravity.CENTER); |
| | | setContentView(R.layout.text_dialog); |
| | |
| | | |
| | | @Override |
| | | public void show() { |
| | | |
| | | super.show(); |
| | | /** |
| | | * 设置宽度全屏,要设置在show的后面 |
| New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <shape xmlns:android="http://schemas.android.com/apk/res/android" |
| | | android:shape="rectangle"> |
| | | <size android:width="2dp" /> |
| | | <solid android:color="#000000" /> |
| | | </shape> |
| | |
| | | android:orientation="vertical"> |
| | | |
| | | <TextView |
| | | android:id="@+id/title" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginLeft="20dp" |
| | | android:layout_marginTop="20dp" |
| | | android:layout_marginRight="20dp" |
| | | android:layout_marginBottom="5dp" |
| | | android:gravity="center" |
| | | android:text="" |
| | | android:textColor="@color/dialog_btn" |
| | | android:textSize="25sp" |
| | | android:textStyle="bold" |
| | | android:visibility="gone" /> |
| | | |
| | | |
| | | <TextView |
| | | android:id="@+id/confirm_data" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | |
| | | android:background="@drawable/base_bg_dialog_top_stroke" |
| | | android:gravity="center" |
| | | android:orientation="vertical"> |
| | | <TextView |
| | | android:id="@+id/title" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginLeft="20dp" |
| | | android:layout_marginTop="20dp" |
| | | android:layout_marginRight="20dp" |
| | | android:layout_marginBottom="5dp" |
| | | android:gravity="center" |
| | | android:text="补卡" |
| | | android:textColor="@color/dialog_btn" |
| | | android:textSize="25sp" |
| | | android:textStyle="bold" |
| | | android:visibility="gone" /> |
| | | |
| | | |
| | | <EditText |
| | |
| | | android:background="@drawable/base_bg_dialog_top_stroke" |
| | | android:gravity="center" |
| | | android:orientation="vertical"> |
| | | <TextView |
| | | |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginLeft="20dp" |
| | | android:layout_marginTop="20dp" |
| | | android:layout_marginRight="20dp" |
| | | android:gravity="center" |
| | | android:text="管理密码" |
| | | android:textStyle="bold" |
| | | android:textColor="@color/dialog_btn" |
| | | android:textSize="25sp" /> |
| | | |
| | | <EditText |
| | | android:id="@+id/pw_et" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="50dp" |
| | | android:layout_marginLeft="20dp" |
| | | android:layout_marginTop="20dp" |
| | | android:layout_marginTop="30dp" |
| | | android:layout_marginRight="20dp" |
| | | android:background="@drawable/editbg" |
| | | android:hint="请输入管理密码" |
| | |
| | | import android.view.View; |
| | | import android.widget.Toast; |
| | | |
| | | import com.dayu.baselibrary.utils.DeviceUtils; |
| | | import com.dayu.baselibrary.utils.TipUtil; |
| | | import com.dayu.baselibrary.view.PassWordDialog; |
| | | import com.dayu.henanlibrary.HeNanApplication; |
| | |
| | | // 生成 1 到 12 之间的随机数字 |
| | | int randomNumber = random.nextInt(12) + 1; |
| | | AdminDataBean adminDataBean = new AdminDataBean(); |
| | | adminDataBean.setSerial(randomNumber + generateUniqueNumber(getSN())); |
| | | adminDataBean.setSerial(randomNumber + generateUniqueNumber(DeviceUtils.getSN())); |
| | | baseDao.adminDao().insert(adminDataBean); |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | @SuppressLint("MissingPermission") |
| | | public static String getSN() { |
| | | String serial = null; |
| | | try { |
| | | Class<?> c = Class.forName("android.os.SystemProperties"); |
| | | Method get = c.getMethod("get", String.class); |
| | | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { |
| | | try { |
| | | serial = (String) get.invoke(c, "ro.sunmi.serial"); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return serial; |
| | | } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { |
| | | serial = Build.getSerial(); |
| | | return serial; |
| | | } else { |
| | | //安卓8以下使用Build.SERIAL相同方式 |
| | | //return Build.SERIAL; |
| | | try { |
| | | serial = (String) get.invoke(c, "ro.serialno"); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return serial; |
| | | } |
| | | } catch (ClassNotFoundException e) { |
| | | throw new RuntimeException(e); |
| | | } catch (NoSuchMethodException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | if (this.getIntent().hasExtra("electricPriceCard")) { |
| | | electricPriceCard = (ElectricPriceCard) this.getIntent().getSerializableExtra("electricPriceCard"); |
| | | |
| | | binding.cardData.setText("制作用户电量单价卡\n当前单价:" + electricPriceCard.getElectricPrice().toString() + " 元"); |
| | | } |
| | | if (this.getIntent().hasExtra("passWordCard")) { |
| | |
| | | data.append("卡 号:" + rechargeBean.getCardNumber() + "\n"); |
| | | data.append("充值金额:" + rechargeBean.getMorny() + " 元" + "\n"); |
| | | data.append("卡内余额:" + rechargeBean.getBalance() + " 元" + "\n"); |
| | | // data.append("充值水量:" + rechargeBean.getRechargeWater() + " 吨" + "\n"); |
| | | // data.append("剩余水量:" + rechargeBean.getSurplusWater() + " 吨" + "\n"); |
| | | data.append("日 期:" + DateUtil.dateToStamp(rechargeBean.getDate(), DateUtil.type2) + "\n\n"); |
| | | data.append("*****************************"); |
| | | } |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.dayu.qiheonlinelibrary"> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" |
| | | package="com.dayu.qiheonlinelibrary"> |
| | | <!--允许访问网络,必选权限--> |
| | | <uses-permission android:name="android.permission.INTERNET" /> |
| | | <application |
| | | android:allowBackup="true" |
| | | android:label="@string/app_name" |
| | | android:roundIcon="@mipmap/ic_launcher_round" |
| | | android:supportsRtl="true" |
| | | > |
| | | android:supportsRtl="true"> |
| | | <activity |
| | | android:name="com.dayu.qiheonlinelibrary.activity.AdminSetupActivity" |
| | | android:exported="true"> |
| | |
| | | <data android:mimeType="text/plain" /> |
| | | </intent-filter> |
| | | </activity> |
| | | <activity |
| | | android:name=".activity.UserSearchActivity" |
| | | android:launchMode="singleTop" /> |
| | | <activity |
| | | android:name=".activity.CardSearchActivity" |
| | | android:launchMode="singleTop" /> |
| | | </application> |
| | | |
| | | </manifest> |
| | |
| | | |
| | | extern "C" |
| | | JNIEXPORT jstring |
| | | Java_com_dayu_qihealonelibrary_tools_BaseNFCHelper_getSafeKey(JNIEnv *env, jobject instance,jobject contextObject) { |
| | | Java_com_dayu_qiheonlinelibrary_tools_BaseNFCHelper_getSafeKey(JNIEnv *env, jobject instance,jobject contextObject) { |
| | | jmethodID getPackageManagerId = (env)->GetMethodID(contextClass, "getPackageManager","()Landroid/content/pm/PackageManager;"); |
| | | jmethodID getPackageNameId = (env)->GetMethodID(contextClass, "getPackageName","()Ljava/lang/String;"); |
| | | jmethodID signToStringId = (env)->GetMethodID(signatureClass, "toCharsString","()Ljava/lang/String;"); |
| | |
| | | package com.dayu.qiheonlinelibrary; |
| | | |
| | | import android.app.Activity; |
| | | import android.app.Application; |
| | | import android.content.Context; |
| | | import android.content.Intent; |
| | | |
| | | import com.dayu.baselibrary.utils.ToastUtil; |
| | | import com.dayu.qiheonlinelibrary.bean.LoginResult; |
| | | import com.dayu.qiheonlinelibrary.bean.PricePlanResult; |
| | | import com.dayu.qiheonlinelibrary.net.ApiManager; |
| | | import com.dayu.qiheonlinelibrary.net.BaseResponse; |
| | | import com.dayu.qiheonlinelibrary.net.RSAUtile; |
| | | import com.dayu.qiheonlinelibrary.net.subscribers.SubscriberListener; |
| | | |
| | | import java.security.AllPermission; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * author: zuo |
| | |
| | | public static QHOnLineApplication qhAloneApplication; |
| | | public Application application; |
| | | |
| | | public String tokenStr; |
| | | public String adcd;//用户地址码 |
| | | public String addressName;//用户地址名称 |
| | | |
| | | public String arerNumber;//区域号 |
| | | |
| | | public String planId;//价格ID |
| | | |
| | | public String electriclePriceStr;//电价 |
| | | |
| | | public static QHOnLineApplication getInstance(Application context) { |
| | | if (qhAloneApplication == null) { |
| | | qhAloneApplication = new QHOnLineApplication(); |
| | | } |
| | | qhAloneApplication.application = context; |
| | | ApiManager.init(); |
| | | return qhAloneApplication; |
| | | } |
| | | |
| | | public static QHOnLineApplication getInstance() { |
| | | if (qhAloneApplication == null) { |
| | | qhAloneApplication = new QHOnLineApplication(); |
| | |
| | | } |
| | | |
| | | |
| | | private void getPublicKey(){ |
| | | ApiManager.getInstance().requestPost(application, "/login/getPubKey", String.class, null, new SubscriberListener<BaseResponse<String>>() { |
| | | public void getPublicKey(Context context, String name, String pw) { |
| | | Map<String, Object> data = new HashMap<>(); |
| | | data.put("loginType", "account"); |
| | | |
| | | ApiManager.getInstance().requestPostLoading(context, "api/login/getPubKey", String.class, null, new SubscriberListener<BaseResponse<String>>() { |
| | | @Override |
| | | public void onNext(BaseResponse<String> t) { |
| | | |
| | | if (t.isSuccess()) { |
| | | getToken(context, name, pw, t.getData()); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | public void getToken(Context context, String name, String pw, String pubKey) { |
| | | Map<String, Object> data = new HashMap<>(); |
| | | data.put("loginType", "account"); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | String dateString = sdf.format(new Date()); |
| | | data.put("password", RSAUtile.encryptByPublicKey(pw + "@TIME@" + dateString, pubKey)); |
| | | data.put("username", name); |
| | | ApiManager.getInstance().requestPostLoading(application, "api/login/login/getToken", String.class, data, new SubscriberListener<BaseResponse<String>>() { |
| | | @Override |
| | | public void onNext(BaseResponse<String> t) { |
| | | if (t.isSuccess()) { |
| | | tokenStr = t.getData(); |
| | | login(context, name, pw, pubKey); |
| | | } else { |
| | | ToastUtil.show(t.getMsg()); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | public void login(Context context, String name, String pw, String pubKey) { |
| | | Map<String, Object> data = new HashMap<>(); |
| | | data.put("loginType", "account"); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | String dateString = sdf.format(new Date()); |
| | | data.put("password", RSAUtile.encryptByPublicKey(pw + "@TIME@" + dateString, pubKey)); |
| | | data.put("username", name); |
| | | ApiManager.getInstance().requestPostLoading(application, "api/login/login", LoginResult.class, data, new SubscriberListener<BaseResponse<LoginResult>>() { |
| | | @Override |
| | | public void onNext(BaseResponse<LoginResult> t) { |
| | | if (t.isSuccess()) { |
| | | if (t.getData() != null && t.getData().getOtherData() != null) { |
| | | LoginResult.OtherData otherData = t.getData().getOtherData(); |
| | | String tenantAdnm = otherData.getTenantAdnm(); |
| | | List<String> adnmList = otherData.getAdnmList(); |
| | | if (tenantAdnm != null && adnmList != null && !adnmList.isEmpty()) { |
| | | addressName = tenantAdnm + adnmList.get(0); |
| | | } |
| | | List<String> adcdList = otherData.getAdnmList(); |
| | | if (adcdList != null && !adcdList.isEmpty()) { |
| | | adcd = t.getData().getOtherData().getAdcdList().get(0); |
| | | arerNumber = t.getData().getOtherData().getAdcdList().get(0).substring(4); |
| | | } |
| | | } |
| | | context.startActivity(new Intent(context, com.dayu.qiheonlinelibrary.activity.HomeActivity.class)); |
| | | ((Activity) context).finish(); |
| | | } else { |
| | | ToastUtil.show(t.getMsg()); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * 获取价格信息 |
| | | */ |
| | | public void getPricePlanVo(Context context) { |
| | | Map<String, Object> data = new HashMap<>(); |
| | | data.put("priceMethod", 2); |
| | | |
| | | ApiManager.getInstance().requestPost(context, "api/sjgg/water/waterPricePlan/pageWaterPricePlanVo", PricePlanResult.class, data, new SubscriberListener<BaseResponse<PricePlanResult>>() { |
| | | @Override |
| | | public void onNext(BaseResponse<PricePlanResult> t) { |
| | | if (t.isSuccess()) { |
| | | planId = t.getData().getRecords().get(0).getPlanId(); |
| | | electriclePriceStr = t.getData().getRecords().get(0).getElectricityPrice(); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | } |
| | |
| | | |
| | | import com.dayu.baselibrary.view.TitleBar; |
| | | import com.dayu.qiheonlinelibrary.R; |
| | | import com.dayu.qiheonlinelibrary.dao.BaseDaoSingleton; |
| | | import com.dayu.qiheonlinelibrary.dao.QHOnlineBaseDaoSingleton; |
| | | import com.dayu.qiheonlinelibrary.dao.QHOnLineAppDatabase; |
| | | |
| | | |
| | |
| | | @Override |
| | | protected void onCreate(Bundle savedInstanceState) { |
| | | super.onCreate(savedInstanceState); |
| | | baseDao = BaseDaoSingleton.getInstance(this); |
| | | asynchBaseDao = BaseDaoSingleton.getAsynchInstance(this); |
| | | baseDao = QHOnlineBaseDaoSingleton.getInstance(this); |
| | | asynchBaseDao = QHOnlineBaseDaoSingleton.getAsynchInstance(this); |
| | | Log.i(TAG, SIGN); |
| | | if (!isMyApp()) { |
| | | Log.i(TAG, "isMyApp"); |
| New file |
| | |
| | | package com.dayu.qiheonlinelibrary.activity; |
| | | |
| | | import android.content.Intent; |
| | | import android.os.Bundle; |
| | | import android.view.LayoutInflater; |
| | | |
| | | import androidx.recyclerview.widget.LinearLayoutManager; |
| | | |
| | | import com.dayu.baselibrary.activity.BaseActivity; |
| | | import com.dayu.baselibrary.utils.BaseCommon; |
| | | import com.dayu.baselibrary.utils.DeviceUtils; |
| | | import com.dayu.baselibrary.utils.TipUtil; |
| | | import com.dayu.baselibrary.utils.ToastUtil; |
| | | import com.dayu.baselibrary.view.ConfirmDialog; |
| | | import com.dayu.qiheonlinelibrary.adapter.CardAdapter; |
| | | import com.dayu.qiheonlinelibrary.bean.CardInfoListResult; |
| | | import com.dayu.qiheonlinelibrary.bean.UserListResult; |
| | | import com.dayu.qiheonlinelibrary.databinding.ActivityCardSearchQhlBinding; |
| | | import com.dayu.qiheonlinelibrary.net.ApiManager; |
| | | import com.dayu.qiheonlinelibrary.net.BaseResponse; |
| | | import com.dayu.qiheonlinelibrary.net.subscribers.SubscriberListener; |
| | | import com.scwang.smart.refresh.footer.ClassicsFooter; |
| | | import com.scwang.smart.refresh.header.ClassicsHeader; |
| | | import com.scwang.smart.refresh.layout.api.RefreshLayout; |
| | | import com.scwang.smart.refresh.layout.listener.OnLoadMoreListener; |
| | | import com.scwang.smart.refresh.layout.listener.OnRefreshListener; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * author: zuo |
| | | * Date: 2024-08-08 |
| | | * Time: 13:37 |
| | | * 备注:选择用户的卡片 |
| | | */ |
| | | public class CardSearchActivity extends BaseActivity { |
| | | ActivityCardSearchQhlBinding binding; |
| | | RefreshLayout myRefreshLayout; |
| | | CardAdapter adapter; |
| | | |
| | | int page = 1; |
| | | int size = 10; |
| | | |
| | | String pearsontId; |
| | | List<CardInfoListResult.Records> records = new ArrayList<>(); |
| | | int type; |
| | | ConfirmDialog confirmDialog; |
| | | |
| | | @Override |
| | | protected void onCreate(Bundle savedInstanceState) { |
| | | super.onCreate(savedInstanceState); |
| | | binding = ActivityCardSearchQhlBinding.inflate(LayoutInflater.from(this)); |
| | | setContentView(binding.getRoot()); |
| | | pearsontId = this.getIntent().getStringExtra("pearsontId"); |
| | | type = this.getIntent().getIntExtra("type", 0); |
| | | initView(); |
| | | selectUser(true); |
| | | } |
| | | |
| | | |
| | | private void initView() { |
| | | myRefreshLayout = (RefreshLayout) binding.refreshLayout; |
| | | myRefreshLayout.setRefreshFooter(new ClassicsFooter(this)); |
| | | myRefreshLayout.setRefreshHeader(new ClassicsHeader(this)); |
| | | myRefreshLayout.setOnLoadMoreListener(new OnLoadMoreListener() { |
| | | @Override |
| | | public void onLoadMore(RefreshLayout refreshlayout) { |
| | | page = page + 1; |
| | | selectUser(false); |
| | | } |
| | | }); |
| | | adapter = new CardAdapter(this, records, new CardAdapter.OnItemClickListener() { |
| | | @Override |
| | | public void onItemClick(int position) { |
| | | String title; |
| | | if (type == BaseCommon.LOSS_CARD) { |
| | | title = "挂失卡片"; |
| | | } else if (type == BaseCommon.REPORT_LOSS_CARD) { |
| | | title = "解除挂失卡片"; |
| | | } else { |
| | | title = "补卡"; |
| | | } |
| | | String data = "卡号:" + records.get(position).getIccardNum(); |
| | | confirmDialog = new ConfirmDialog(CardSearchActivity.this, title, data, v -> { |
| | | |
| | | String iccardInfoId = records.get(position).getIccardInfoId(); |
| | | if (type == BaseCommon.LOSS_CARD) { |
| | | lossCard(iccardInfoId); |
| | | } else if (type == BaseCommon.REPORT_LOSS_CARD) { |
| | | reportLossCard(iccardInfoId); |
| | | } else if (type == BaseCommon.REPLACE_HAS_CARD) { |
| | | |
| | | } else if (type == BaseCommon.REPLACE_NO_CARD) { |
| | | //补卡前需要先挂失 |
| | | if (records.get(position).getIccardStatus() == 0) { |
| | | lossCard(iccardInfoId); |
| | | } else if (records.get(position).getIccardStatus() == 2) { |
| | | startNFCActivit(iccardInfoId); |
| | | } else { |
| | | TipUtil.show("当前卡状态不能再补卡"); |
| | | } |
| | | |
| | | |
| | | } |
| | | confirmDialog.dismiss(); |
| | | }); |
| | | confirmDialog.show(); |
| | | |
| | | |
| | | } |
| | | }); |
| | | LinearLayoutManager layoutManager = new LinearLayoutManager(this); |
| | | binding.recyclerView.setLayoutManager(layoutManager); |
| | | binding.recyclerView.setAdapter(adapter); |
| | | |
| | | myRefreshLayout.setOnRefreshListener(new OnRefreshListener() { |
| | | @Override |
| | | public void onRefresh(RefreshLayout refreshlayout) { |
| | | selectUser(true); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询卡 |
| | | */ |
| | | private void selectUser(boolean isRefresh) { |
| | | if (isRefresh) { |
| | | page = 1; |
| | | records.clear(); |
| | | } |
| | | Map<String, Object> data = new HashMap<>(); |
| | | data.put("peasantId", pearsontId); |
| | | data.put("current", page); |
| | | data.put("pageSize", size); |
| | | ApiManager.getInstance().requestPostLoading(this, "api/sjgg/iccard/info/getIccardPeasantVoList", CardInfoListResult.class, data, new SubscriberListener<BaseResponse<CardInfoListResult>>() { |
| | | @Override |
| | | public void onNext(BaseResponse<CardInfoListResult> t) { |
| | | if (t.isSuccess()) { |
| | | if (t.getData().getTotal() == records.size()) { |
| | | myRefreshLayout.finishLoadMoreWithNoMoreData(); |
| | | } else { |
| | | records.addAll(t.getData().getRecords()); |
| | | } |
| | | adapter.notifyDataSetChanged(); |
| | | myRefreshLayout.finishLoadMore(); |
| | | if (isRefresh) { |
| | | myRefreshLayout.finishRefresh(); |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * 挂失卡 |
| | | */ |
| | | private void lossCard(String iccardInfoId) { |
| | | |
| | | Map<String, Object> data = new HashMap<>(); |
| | | data.put("iccardInfoId", iccardInfoId); |
| | | data.put("equipCode", DeviceUtils.getSN()); |
| | | ApiManager.getInstance().requestPostLoading(this, "api/sjgg/iccard/recharge/reportLossCard", UserListResult.class, data, new SubscriberListener<BaseResponse<UserListResult>>() { |
| | | @Override |
| | | public void onNext(BaseResponse<UserListResult> t) { |
| | | if (t.isSuccess()) { |
| | | if (type == BaseCommon.LOSS_CARD) { |
| | | TipUtil.show(CardSearchActivity.this, "挂失成功", () -> { |
| | | CardSearchActivity.this.finish(); |
| | | }); |
| | | } else if (type == BaseCommon.REPLACE_NO_CARD) { |
| | | startNFCActivit(iccardInfoId); |
| | | } |
| | | |
| | | } else { |
| | | ToastUtil.show(t.getMsg()); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * 解除挂失卡 |
| | | */ |
| | | private void reportLossCard(String iccardInfoId) { |
| | | |
| | | Map<String, Object> data = new HashMap<>(); |
| | | data.put("iccardInfoId", iccardInfoId); |
| | | data.put("equipCode", DeviceUtils.getSN()); |
| | | ApiManager.getInstance().requestPostLoading(this, "api/sjgg/iccard/recharge/releaseLossCard", UserListResult.class, data, new SubscriberListener<BaseResponse<UserListResult>>() { |
| | | @Override |
| | | public void onNext(BaseResponse<UserListResult> t) { |
| | | if (t.isSuccess()) { |
| | | TipUtil.show(CardSearchActivity.this, "解除挂失成功", () -> { |
| | | CardSearchActivity.this.finish(); |
| | | }); |
| | | } else { |
| | | ToastUtil.show(t.getMsg()); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | private void startNFCActivit(String iccardInfoId) { |
| | | //直接补卡的方式 |
| | | Intent intent = new Intent(CardSearchActivity.this, NFCWreatActivity.class); |
| | | intent.putExtra("iccardInfoId", iccardInfoId); |
| | | intent.putExtra("replaceType", type); |
| | | startActivity(intent); |
| | | CardSearchActivity.this.finish(); |
| | | } |
| | | } |
| | |
| | | |
| | | import android.content.Intent; |
| | | import android.os.Bundle; |
| | | import android.text.TextUtils; |
| | | import android.view.KeyEvent; |
| | | import android.view.LayoutInflater; |
| | | import android.view.View; |
| | | import android.widget.Toast; |
| | | |
| | | import com.dayu.baselibrary.utils.BaseCommon; |
| | | import com.dayu.baselibrary.utils.TipUtil; |
| | | import com.dayu.baselibrary.view.PassWordDialog; |
| | | import com.dayu.qiheonlinelibrary.QHOnLineApplication; |
| | | import com.dayu.qiheonlinelibrary.bean.PricePlanResult; |
| | | import com.dayu.qiheonlinelibrary.databinding.ActivityHomeQhlBinding; |
| | | import com.dayu.qiheonlinelibrary.dbBean.AdminDataBean; |
| | | import com.dayu.qiheonlinelibrary.net.ApiManager; |
| | | import com.dayu.qiheonlinelibrary.net.BaseResponse; |
| | | import com.dayu.qiheonlinelibrary.net.subscribers.SubscriberListener; |
| | | import com.dayu.qiheonlinelibrary.view.ChooseReplacementDialog; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | |
| | | /** |
| | |
| | | |
| | | public static HomeActivity homeActivity; |
| | | ActivityHomeQhlBinding homeBinding; |
| | | ChooseReplacementDialog replacementDialog; |
| | | |
| | | @Override |
| | | protected void onCreate(Bundle savedInstanceState) { |
| | |
| | | |
| | | } |
| | | |
| | | @Override |
| | | protected void onResume() { |
| | | super.onResume(); |
| | | if (TextUtils.isEmpty(QHOnLineApplication.getInstance().planId)) { |
| | | QHOnLineApplication.getInstance().getPricePlanVo(this); |
| | | } |
| | | } |
| | | |
| | | private void initView() { |
| | | homeBinding.homeNewCard.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | AdminDataBean adminData = baseDao.adminDao().findFirst(); |
| | | if (adminData != null) { |
| | | startActivity(new Intent(HomeActivity.this, NewCardActivity.class)); |
| | | } else { |
| | | TipUtil.show(HomeActivity.this, "请先在个人中心内设置区域号"); |
| | | } |
| | | |
| | | } |
| | | }); |
| | | homeBinding.homeRecharge.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | AdminDataBean adminData = baseDao.adminDao().findFirst(); |
| | | if (adminData != null) { |
| | | // if (adminData.getWaterPrice() != 0) { |
| | | startActivity(new Intent(HomeActivity.this, RechargeActivity.class)); |
| | | // } else { |
| | | // TipUtil.show(HomeActivity.this, "请先在个人中心内设置水价"); |
| | | // } |
| | | } else { |
| | | TipUtil.show("请先在个人中心内设置区域号"); |
| | | } |
| | | |
| | | } |
| | | }); |
| | | homeBinding.homeRedCard.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | startActivity(new Intent(HomeActivity.this, ReadCardAcitivy.class)); |
| | | } |
| | | }); |
| | | homeBinding.homeNewCard.setOnClickListener(v -> startActivity(new Intent(HomeActivity.this, NewCardActivity.class))); |
| | | homeBinding.homeRecharge.setOnClickListener(v -> startActivity(new Intent(HomeActivity.this, RechargeActivity.class))); |
| | | homeBinding.homeRedCard.setOnClickListener(v -> startActivity(new Intent(HomeActivity.this, ReadCardAcitivy.class))); |
| | | //管理系统界面 |
| | | homeBinding.homeAdmin.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | PassWordDialog passWordDialog = new PassWordDialog(HomeActivity.this, new Intent(HomeActivity.this, SysActivity.class)); |
| | | passWordDialog.show(); |
| | | } |
| | | homeBinding.homeAdmin.setOnClickListener(v -> { |
| | | PassWordDialog passWordDialog = new PassWordDialog(HomeActivity.this, new Intent(HomeActivity.this, SysActivity.class)); |
| | | passWordDialog.show(); |
| | | }); |
| | | //参数设置 |
| | | homeBinding.homeParameter.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | PassWordDialog passWordDialog = new PassWordDialog(HomeActivity.this, new Intent(HomeActivity.this, ParameterActivity.class)); |
| | | passWordDialog.show(); |
| | | } |
| | | homeBinding.homeParameter.setOnClickListener(v -> { |
| | | PassWordDialog passWordDialog = new PassWordDialog(HomeActivity.this, new Intent(HomeActivity.this, ParameterActivity.class)); |
| | | passWordDialog.show(); |
| | | }); |
| | | homeBinding.homeMy.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | startActivity(new Intent(HomeActivity.this, MyActivity.class)); |
| | | |
| | | } |
| | | homeBinding.homeMy.setOnClickListener(v -> startActivity(new Intent(HomeActivity.this, MyActivity.class))); |
| | | homeBinding.homeLoss.setOnClickListener(v -> { |
| | | Intent intent = new Intent(HomeActivity.this, UserSearchActivity.class); |
| | | intent.putExtra("type", BaseCommon.LOSS_CARD); |
| | | startActivity(intent); |
| | | }); |
| | | homeBinding.homeReportLoss.setOnClickListener(v -> { |
| | | Intent intent = new Intent(HomeActivity.this, UserSearchActivity.class); |
| | | intent.putExtra("type", BaseCommon.REPORT_LOSS_CARD); |
| | | startActivity(intent); |
| | | }); |
| | | homeBinding.homeReplacement.setOnClickListener(v -> { |
| | | replacementDialog = new ChooseReplacementDialog(this, type -> { |
| | | Intent intent = new Intent(HomeActivity.this, UserSearchActivity.class); |
| | | intent.putExtra("type", type); |
| | | startActivity(intent); |
| | | replacementDialog.dismiss(); |
| | | }); |
| | | replacementDialog.show(); |
| | | }); |
| | | } |
| | | |
| | |
| | | } |
| | | return super.onKeyDown(keyCode, event); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import android.os.Bundle; |
| | | import android.os.Handler; |
| | | import android.os.Message; |
| | | import android.text.TextUtils; |
| | | import android.view.LayoutInflater; |
| | | import android.view.View; |
| | | |
| | |
| | | import com.dayu.baselibrary.view.PassWordDialog; |
| | | import com.dayu.baselibrary.view.datepicker.CustomDatePicker; |
| | | import com.dayu.baselibrary.view.datepicker.DateFormatUtils; |
| | | import com.dayu.qiheonlinelibrary.QHOnLineApplication; |
| | | import com.dayu.qiheonlinelibrary.databinding.ActivityMyQhlBinding; |
| | | import com.dayu.qiheonlinelibrary.dbBean.AdminDataBean; |
| | | import com.dayu.qiheonlinelibrary.dbBean.ElectricPriceBean; |
| | | import com.dayu.qiheonlinelibrary.utils.DeviceNumberUtils; |
| | | import com.dayu.qiheonlinelibrary.utils.ExcelUtil; |
| | | |
| | | import java.io.File; |
| | |
| | | private void setData() { |
| | | AdminDataBean adminData; |
| | | try { |
| | | adminData = baseDao.adminDao().findFirst(); |
| | | if (adminData != null) { |
| | | myBinding.myAdminName.setText(adminData.getAddressCode()); |
| | | myBinding.myVillageNum.setText(adminData.getSerial()); |
| | | // myBinding.myWaterPrice.setText(MornyUtil.changeF2Y(adminData.getWaterPrice())); |
| | | } else { |
| | | myBinding.myAdminName.setText("请点击区域号进行设置"); |
| | | myBinding.myVillageNum.setText("请点击区域号进行设置"); |
| | | // myBinding.myWaterPrice.setText("请点击区域号进行设置"); |
| | | } |
| | | StringBuilder msgData = new StringBuilder(); |
| | | myBinding.myAdName.setText(QHOnLineApplication.getInstance().addressName); |
| | | myBinding.myAdminName.setText(QHOnLineApplication.getInstance().arerNumber); |
| | | myBinding.myWaterPrice.setText(QHOnLineApplication.getInstance().electriclePriceStr); |
| | | |
| | | String initCode = DeviceNumberUtils.getDeviceNumber(); |
| | | if (TextUtils.isEmpty(initCode)) { |
| | | msgData.append("设备未注册"); |
| | | } else { |
| | | msgData.append("设备注册号:" + initCode); |
| | | } |
| | | myBinding.myTestConnect.setText(msgData); |
| | | ElectricPriceBean priceBean = baseDao.electricPriceDao().findFirst(); |
| | | if (priceBean != null) { |
| | | myBinding.myWaterPrice.setText(priceBean.getPrice() + "元"); |
| | | } else { |
| | | myBinding.myWaterPrice.setText("1.000元"); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | import com.dayu.baselibrary.utils.AidlUtil; |
| | | import com.dayu.baselibrary.utils.BaseCommon; |
| | | import com.dayu.baselibrary.utils.DateUtil; |
| | | import com.dayu.baselibrary.utils.DeviceUtils; |
| | | import com.dayu.baselibrary.utils.MornyUtil; |
| | | import com.dayu.baselibrary.utils.TipUtil; |
| | | import com.dayu.baselibrary.view.ConfirmDialog; |
| | | import com.dayu.baselibrary.view.TitleBar; |
| | | |
| | | import com.dayu.qiheonlinelibrary.QHOnLineApplication; |
| | | import com.dayu.qiheonlinelibrary.bean.LoginResult; |
| | | import com.dayu.qiheonlinelibrary.bean.OpenCardResult; |
| | | import com.dayu.qiheonlinelibrary.bean.ReplaceCardResult; |
| | | import com.dayu.qiheonlinelibrary.card.CleanCard; |
| | | import com.dayu.qiheonlinelibrary.card.CleanUserCard; |
| | | import com.dayu.qiheonlinelibrary.card.ConfigurationPowerCard; |
| | |
| | | import com.dayu.qiheonlinelibrary.card.TestCard; |
| | | import com.dayu.qiheonlinelibrary.card.UserCard; |
| | | import com.dayu.qiheonlinelibrary.databinding.ActivityWriteTextQhlBinding; |
| | | import com.dayu.qiheonlinelibrary.dbBean.AdminDataBean; |
| | | import com.dayu.qiheonlinelibrary.dbBean.RechargeBean; |
| | | import com.dayu.qiheonlinelibrary.dbBean.UserCardBean; |
| | | import com.dayu.qiheonlinelibrary.tools.NFCWriteHelper; |
| | | import com.dayu.qiheonlinelibrary.net.ApiManager; |
| | | import com.dayu.qiheonlinelibrary.net.BaseResponse; |
| | | import com.dayu.qiheonlinelibrary.net.subscribers.SubscriberListener; |
| | | import com.dayu.qiheonlinelibrary.tools.NfcReadHelper; |
| | | import com.dayu.qiheonlinelibrary.tools.WriteCardUtils; |
| | | import com.dayu.qiheonlinelibrary.utils.CardCommon; |
| | | import com.dayu.qiheonlinelibrary.utils.NFCWreatUtils; |
| | | import com.dayu.qiheonlinelibrary.view.ReplacementPriceDialog; |
| | | import com.tencent.bugly.crashreport.CrashReport; |
| | | |
| | | import java.util.Calendar; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * Copyright (C), 2023, |
| | |
| | | CleanUserCard cleanUserCard; |
| | | ManageCard manageCard; |
| | | DomainCard domainCard; |
| | | |
| | | CleanCard cleanCard; |
| | | ConfigureDeviceRegistrationCrad configureDeviceRegistrationCrad; |
| | | TestCard testCard; |
| | |
| | | boolean passwordFlag = false; |
| | | boolean cleanFlag = false; |
| | | boolean regionFlag = false; |
| | | boolean userFlag = false; |
| | | boolean manageCardFlag = false; |
| | | boolean registeredFlag = false; |
| | | boolean administrativeCardFlag = false; |
| | |
| | | |
| | | boolean domainCrdFlag = false; |
| | | |
| | | boolean testCardFlag = false; |
| | | |
| | | boolean configDeviceRegiestFlag = false; |
| | | |
| | | boolean configPowerFlag = false; |
| | | |
| | | UserCardBean userCardBean; |
| | | UserCard olduserCard; |
| | | |
| | | String morny; |
| | | String rechageWater;//充值的水量 |
| | | String userName; |
| | | AdminDataBean adminData; |
| | | RechargeBean rechargeBean; |
| | | Intent intent; |
| | | |
| | | |
| | | //打印 |
| | | QHOnLineApplication baseApp; |
| | | |
| | |
| | | //当前卡的物理卡号 |
| | | String cardNumber; |
| | | ConfirmDialog confirmDialog; |
| | | //旧的卡id |
| | | String iccardInfoId; |
| | | //补卡类型 |
| | | int replaceType; |
| | | //补卡工本费用 |
| | | String rechargeCardMoney; |
| | | ReplacementPriceDialog replacementPriceDialog; |
| | | |
| | | @Override |
| | | protected void onCreate(Bundle savedInstanceState) { |
| | |
| | | binding = ActivityWriteTextQhlBinding.inflate(LayoutInflater.from(this)); |
| | | setContentView(binding.getRoot()); |
| | | nfcWreatActivity = this; |
| | | getData(); |
| | | titleBack(); |
| | | baseApp = QHOnLineApplication.getInstance(); |
| | | getData(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | CrashReport.postCatchedException(e); |
| | |
| | | isRecharge = true; |
| | | morny = this.getIntent().getStringExtra("morny"); |
| | | userName = this.getIntent().getStringExtra("userName"); |
| | | cardNumber = this.getIntent().getStringExtra("cardNumber"); |
| | | userCardBean = (UserCardBean) this.getIntent().getSerializableExtra("userCardBean"); |
| | | rechargeBean = (RechargeBean) this.getIntent().getSerializableExtra("rechargeBean"); |
| | | |
| | | // rechageWater = this.getIntent().getStringExtra("rechageWater"); |
| | | binding.cardData.setText("充值金额:" + morny + " 元"); |
| | | } |
| | | |
| | | try { |
| | | adminData = baseDao.adminDao().findFirst(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | CrashReport.postCatchedException(e); |
| | | if (this.getIntent().hasExtra("iccardInfoId")) { |
| | | iccardInfoId = this.getIntent().getStringExtra("iccardInfoId"); |
| | | replaceType = this.getIntent().getIntExtra("replaceType", 0); |
| | | replacementPriceDialog = new ReplacementPriceDialog(this, data -> { |
| | | if (TextUtils.isEmpty(data)) { |
| | | rechargeCardMoney = "0"; |
| | | } |
| | | rechargeCardMoney = data; |
| | | binding.cardData.setText("补卡工本费:" + rechargeCardMoney + "元"); |
| | | replacementPriceDialog.dismiss(); |
| | | }); |
| | | replacementPriceDialog.show(); |
| | | } |
| | | |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | CrashReport.postCatchedException(e); |
| | |
| | | String[] cardTypes = cardType.split(","); |
| | | if (cardTypes != null && cardTypes.length == 2) { |
| | | cardNumber = cardType.split(",")[0]; |
| | | cardNumber = HexUtil.spaceHex(cardNumber); |
| | | cardNumber = HexUtil.HighLowHex(cardNumber); |
| | | cardType = cardType.split(",")[1]; |
| | | } |
| | | Log.i("NFCWreatActivity", "cardType=" + cardType); |
| | |
| | | } else if (cardType.equals(BaseCommon.CARD_TYPE_ERROR2)) { |
| | | TipUtil.show(NFCWreatActivity.this, "卡片未能识别,请检查卡片是否是本公司卡片"); |
| | | } else { |
| | | //读卡成功 |
| | | Log.i("NFCWreatActivity", "olduserCard!=null saveData"); |
| | | userCardBean.setCardNumber(cardNumber); |
| | | baseDao.userCardDao().insert(userCardBean); |
| | | saveData(); |
| | | // |
| | | openCard(cardNumber, 1, userCardBean.getPersonId(), String.valueOf(userCardBean.getCardMorny())); |
| | | |
| | | |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | |
| | | || domainCard != null || testCard != null |
| | | || configureDeviceRegistrationCrad != null |
| | | || configurationPowerCard != null || regionCard != null || passWordCard != null || electricPriceCard != null) { |
| | | if (userCard != null && TextUtils.isEmpty(morny)) { |
| | | userFlag = WriteCardUtils.setUser(intent, userCard, this); |
| | | } |
| | | |
| | | if (electricPriceCard != null) { |
| | | setElectricPriceCard(intent, electricPriceCard); |
| | | electricPriceFlag = NFCWreatUtils.getInstance(this, baseDao).setElectricPriceCard(intent, electricPriceCard); |
| | | } |
| | | if (passWordCard != null) { |
| | | setPassWordCard(intent, passWordCard); |
| | | passwordFlag = NFCWreatUtils.getInstance(this, baseDao).setPassWordCard(intent, passWordCard); |
| | | } |
| | | if (regionCard != null) { |
| | | setRegionCard(intent, regionCard); |
| | | regionFlag = NFCWreatUtils.getInstance(this, baseDao).setRegionCard(intent, regionCard); |
| | | } |
| | | if (cleanCard != null) { |
| | | setClean(intent, cleanCard); |
| | | cleanFlag = NFCWreatUtils.getInstance(this, baseDao).setClean(intent, cleanCard); |
| | | } |
| | | if (manageCard != null) { |
| | | setmanageCard(intent, manageCard); |
| | | // if (manageCardFlag && userCardBeanByManager != null) { |
| | | // //修改用户表信息修改成新卡卡号 |
| | | // userCardBeanByManager.setCardNumber(cardNumber); |
| | | // baseDao.userCardDao().update(userCardBeanByManager); |
| | | // } |
| | | manageCardFlag = NFCWreatUtils.getInstance(this, baseDao).setmanageCard(intent, manageCard); |
| | | } |
| | | if (registeredCard != null) { |
| | | setRegisteredCard(intent, registeredCard); |
| | | registeredFlag = NFCWreatUtils.getInstance(this, baseDao).setRegisteredCard(intent, registeredCard); |
| | | } |
| | | if (cleanUserCard != null) { |
| | | setCleanUserCard(intent, cleanUserCard); |
| | | cleanUserCardFlag = NFCWreatUtils.getInstance(this, baseDao).setCleanUserCard(intent, cleanUserCard); |
| | | } |
| | | if (domainCard != null) { |
| | | setDomainCard(intent, domainCard); |
| | | } |
| | | if (testCard != null) { |
| | | setTestCard(intent, testCard); |
| | | domainCrdFlag = NFCWreatUtils.getInstance(this, baseDao).setDomainCard(intent, domainCard); |
| | | } |
| | | if (configureDeviceRegistrationCrad != null) { |
| | | setConfigDeviceRegiest(intent, configureDeviceRegistrationCrad); |
| | | configDeviceRegiestFlag = NFCWreatUtils.getInstance(this, baseDao).setConfigDeviceRegiest(intent, configureDeviceRegistrationCrad); |
| | | } |
| | | if (configurationPowerCard != null) { |
| | | setConfigurationPower(intent, configurationPowerCard); |
| | | configPowerFlag = NFCWreatUtils.getInstance(this, baseDao).setConfigurationPower(intent, configurationPowerCard); |
| | | } |
| | | if (electricPriceFlag || passwordFlag || regionFlag || configPowerFlag || configDeviceRegiestFlag || testCardFlag || domainCrdFlag || userFlag || cleanFlag || manageCardFlag || registeredFlag || administrativeCardFlag || cleanUserCardFlag) { |
| | | if (electricPriceFlag || passwordFlag || regionFlag || configPowerFlag || configDeviceRegiestFlag || domainCrdFlag || cleanFlag || manageCardFlag || registeredFlag || administrativeCardFlag || cleanUserCardFlag) { |
| | | try { |
| | | if (userFlag && userCardBean != null) { |
| | | //用户卡 |
| | | startDetailActivity(userCardBean.getUserName(), "终端写卡"); |
| | | } else if (!TextUtils.isEmpty(morny)) { |
| | | if (!TextUtils.isEmpty(morny)) { |
| | | TipUtil.show(NFCWreatActivity.this, "充值成功", () -> NFCWreatActivity.this.finish()); |
| | | } else { |
| | | TipUtil.show(NFCWreatActivity.this, "写卡成功", () -> NFCWreatActivity.this.finish()); |
| | |
| | | super.onNewIntent(intent); |
| | | try { |
| | | this.intent = intent; |
| | | // startAnim(); |
| | | Log.i("NFCWreatActivity", "isUser:" + isUser); |
| | | if (isUser) { |
| | | //新卡注册逻辑 |
| | | checkHasUser(); |
| | | } else if (isRecharge) { |
| | | //充值逻辑 |
| | | rechargeWreatCard(); |
| | | } else if (!TextUtils.isEmpty(iccardInfoId)) { |
| | | //补卡逻辑 |
| | | replaceCard(); |
| | | } else { |
| | | //其他管理卡逻辑 |
| | | saveData(); |
| | |
| | | data.append("卡 号:" + rechargeBean.getCardNumber() + "\n"); |
| | | data.append("充值金额:" + rechargeBean.getMorny() + " 元" + "\n"); |
| | | data.append("卡内余额:" + rechargeBean.getBalance() + " 元" + "\n"); |
| | | // data.append("充值水量:" + rechargeBean.getRechargeWater() + " 吨" + "\n"); |
| | | // data.append("剩余水量:" + rechargeBean.getSurplusWater() + " 吨" + "\n"); |
| | | data.append("日 期:" + DateUtil.dateToStamp(rechargeBean.getDate(), DateUtil.type2) + "\n\n"); |
| | | data.append("日 期:" + DateUtil.dateToStamp(rechargeBean.getRechargeDate(), DateUtil.type2) + "\n\n"); |
| | | data.append("*****************************"); |
| | | } |
| | | float size = 26; |
| | |
| | | private void rechargeWreatCard() { |
| | | try { |
| | | String cardNumberThis = NfcReadHelper.getInstence(intent, this).getCardNumber(); |
| | | cardNumberThis = HexUtil.spaceHex(cardNumberThis); |
| | | cardNumberThis = HexUtil.HighLowHex(cardNumberThis); |
| | | //判断是否充值的是一个卡 |
| | | if (cardNumberThis.equalsIgnoreCase(cardNumber)) { |
| | | //余额 |
| | | int balance = userCard.getBalance() + MornyUtil.changeY2F(morny); |
| | | userCard.setBalance(balance); |
| | | //剩余水量 |
| | | // int surplusWater = userCard.getSurplusWater() + MornyUtil.changeY2F(rechageWater); |
| | | // userCard.setSurplusWater(surplusWater); |
| | | |
| | | int rechageTims = userCard.getRechargeTimes() + 1; |
| | | if (rechageTims == 256) { |
| | | rechageTims = 0; |
| | | } |
| | | userCard.setRechargeTimes((short) rechageTims); |
| | | if (cardNumberThis.equalsIgnoreCase(rechargeBean.getCardNumber())) { |
| | | userCard.setRechargeDate(Calendar.getInstance()); |
| | | userFlag = WriteCardUtils.setUser(intent, userCard, this); |
| | | if (userFlag) { |
| | | rechargeBean = new RechargeBean(); |
| | | rechargeBean.setUserName(userName); |
| | | rechargeBean.setSerial(userCardBean.getSerial()); |
| | | rechargeBean.setUserId(userCardBean.getUserID()); |
| | | rechargeBean.setDate(System.currentTimeMillis()); |
| | | rechargeBean.setMorny(morny); |
| | | rechargeBean.setBalance(MornyUtil.changeF2Y(balance)); |
| | | rechargeBean.setCardNumber(cardNumber); |
| | | rechargeBean.setSurplusWater(MornyUtil.changeF2Y(0)); |
| | | rechargeBean.setRechargeWater(rechageWater); |
| | | try { |
| | | baseDao.rechargeDao().insert(rechargeBean); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | // 打印相关 |
| | | setPrinterData(rechargeBean); |
| | | startDetailActivity(userName, "终端写卡"); |
| | | if (WriteCardUtils.setUser(intent, userCard, this)) { |
| | | confromRecharge(rechargeBean.getOrderId(), 0); |
| | | } else { |
| | | TipUtil.show(NFCWreatActivity.this, "写卡失败,请重新再试"); |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | private void setmanageCard(Intent intent, final ManageCard manageCard) { |
| | | manageCardFlag = NFCWriteHelper.getInstence(intent, this).writeData(manageCard.toByte(baseDao), 1, 0); |
| | | } |
| | | |
| | | /** |
| | | * 制作清零卡 |
| | | * |
| | | * @param intent |
| | | * @param clearOrInitCard |
| | | */ |
| | | private void setClean(Intent intent, CleanCard clearOrInitCard) { |
| | | cleanFlag = NFCWriteHelper.getInstence(intent, this).writeData(clearOrInitCard.toByte(baseDao), 1, 0); |
| | | } |
| | | |
| | | /** |
| | | * 保存区域表号卡 |
| | | * |
| | | * @param intent |
| | | * @param regionCard |
| | | */ |
| | | private void setRegionCard(Intent intent, RegionCard regionCard) { |
| | | regionFlag = NFCWriteHelper.getInstence(intent, this).writeData(regionCard.toByte(), 1, 0); |
| | | } |
| | | |
| | | /** |
| | | * 密码卡 |
| | | * |
| | | * @param intent |
| | | * @param passWordCard |
| | | */ |
| | | private void setPassWordCard(Intent intent, PassWordCard passWordCard) { |
| | | passwordFlag = NFCWriteHelper.getInstence(intent, this).writeData(passWordCard.toByte(baseDao), 1, 0); |
| | | } |
| | | |
| | | /** |
| | | * 用户电量单价 |
| | | * |
| | | * @param intent |
| | | * @param electricPriceCard |
| | | */ |
| | | private void setElectricPriceCard(Intent intent, ElectricPriceCard electricPriceCard) { |
| | | electricPriceFlag = NFCWriteHelper.getInstence(intent, this).writeData(electricPriceCard.toByte(baseDao), 1, 0); |
| | | } |
| | | |
| | | /** |
| | | * 重新注册设备卡 |
| | | * |
| | | * @param intent |
| | | * @param registeredCard |
| | | */ |
| | | private void setRegisteredCard(Intent intent, RegisteredCard registeredCard) { |
| | | registeredFlag = NFCWriteHelper.getInstence(intent, this).writeData(registeredCard.toByte(baseDao), 1, 0); |
| | | } |
| | | |
| | | /** |
| | | * 删除全部用户卡 |
| | | * |
| | | * @param intent |
| | | * @param cleanUserCard |
| | | */ |
| | | private void setCleanUserCard(Intent intent, CleanUserCard cleanUserCard) { |
| | | cleanUserCardFlag = NFCWriteHelper.getInstence(intent, this).writeData(cleanUserCard.toByte(baseDao), 1, 0); |
| | | } |
| | | |
| | | /** |
| | | * 设置域名卡 |
| | | * |
| | | * @param intent |
| | | * @param domainCard |
| | | */ |
| | | private void setDomainCard(Intent intent, DomainCard domainCard) { |
| | | try { |
| | | domainCrdFlag = NFCWriteHelper.getInstence(intent, this).writeData(domainCard.getZeroByte(), 1, 0); |
| | | if (!domainCrdFlag) { |
| | | return; |
| | | } |
| | | domainCrdFlag = NFCWriteHelper.getInstence(intent, this).writeData(domainCard.getOneByte(), 1, 1); |
| | | if (!domainCrdFlag) { |
| | | return; |
| | | } |
| | | domainCrdFlag = NFCWriteHelper.getInstence(intent, this).writeData(domainCard.getTwoByte(), 1, 2); |
| | | } catch (Exception e) { |
| | | domainCrdFlag = false; |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | |
| | | private void setTestCard(Intent intent, TestCard testCard) { |
| | | testCardFlag = NFCWriteHelper.getInstence(intent, this).writeData(testCard.toByte(baseDao), 1, 0); |
| | | } |
| | | |
| | | |
| | | private void setConfigDeviceRegiest(Intent intent, ConfigureDeviceRegistrationCrad configureDeviceRegistrationCrad) { |
| | | configDeviceRegiestFlag = NFCWriteHelper.getInstence(intent, this).writeData(configureDeviceRegistrationCrad.toByte(baseDao), 1, 0); |
| | | } |
| | | |
| | | private void setConfigurationPower(Intent intent, ConfigurationPowerCard configurationPowerCard) { |
| | | try { |
| | | configPowerFlag = NFCWriteHelper.getInstence(intent, this).writeData(configurationPowerCard.toByte(baseDao), 1, 0); |
| | | } catch (Exception e) { |
| | | configPowerFlag = false; |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | |
| | | |
| | | private void startDetailActivity(String userName, String statu) { |
| | | Intent detail = new Intent(this, RechargeDetailActivity.class); |
| | | detail.putExtra("userName", userName); |
| | |
| | | detail.putExtra("userCard", userCard); |
| | | if (!TextUtils.isEmpty(morny)) { |
| | | detail.putExtra("morny", morny); |
| | | detail.putExtra("rechageWater", rechageWater); |
| | | detail.putExtra("rechargeBean", rechargeBean); |
| | | } |
| | | if (!TextUtils.isEmpty(cardNumber)) { |
| | | detail.putExtra("cardNumber", cardNumber); |
| | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * IC开卡接口 |
| | | * |
| | | * @param iccardNum 物理卡号 |
| | | * @param iccardType ic卡类型 1 用户卡 2 管理卡 |
| | | * @param peasantId |
| | | * @param rechargeMoney |
| | | */ |
| | | private void openCard(String iccardNum, int iccardType, String peasantId, String rechargeMoney) { |
| | | Map<String, Object> data = new HashMap<>(); |
| | | data.put("iccardNum", iccardNum);//物理卡号 |
| | | data.put("iccardType", iccardType); |
| | | data.put("peasantId", peasantId); |
| | | //工本费 |
| | | data.put("rechargeCardMoney", rechargeMoney); |
| | | ApiManager.getInstance().requestPostLoading(this, "api/sjgg/iccard/recharge/openCard", OpenCardResult.class, data, new SubscriberListener<BaseResponse<OpenCardResult>>() { |
| | | @Override |
| | | public void onNext(BaseResponse<OpenCardResult> t) { |
| | | if (t.isSuccess()) { |
| | | String userCode = t.getData().getIccardCode(); |
| | | userCard.setUserCode(userCode.substring(0, 12)); |
| | | userCard.setUserCodeNumber(Integer.valueOf(userCode.substring(12, 16))); |
| | | userCardBean.setCardNumber(cardNumber); |
| | | userCardBean.setUserCode(userCode); |
| | | baseDao.userCardDao().insert(userCardBean); |
| | | if (WriteCardUtils.setUser(intent, userCard, NFCWreatActivity.this)) { |
| | | confromOpenCard(t.getData().getIccardRechargeRecordId(), 0); |
| | | } else { |
| | | confromOpenCard(t.getData().getIccardRechargeRecordId(), 2); |
| | | } |
| | | } else { |
| | | TipUtil.show(t.getMsg()); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 确认开卡写卡 |
| | | * |
| | | * @param iccardRechargeRecordId |
| | | * @param writeCardStatus |
| | | */ |
| | | private void confromOpenCard(String iccardRechargeRecordId, int writeCardStatus) { |
| | | Map<String, Object> data = new HashMap<>(); |
| | | data.put("iccardRechargeRecordId", iccardRechargeRecordId); |
| | | //写卡状态 0 写卡成功 1 待写卡 2 写卡失败 |
| | | data.put("writeCardStatus", writeCardStatus); |
| | | |
| | | |
| | | ApiManager.getInstance().requestPostLoading(this, "api/sjgg/iccard/recharge/openCardResult", LoginResult.class, data, new SubscriberListener<BaseResponse<LoginResult>>() { |
| | | @Override |
| | | public void onNext(BaseResponse<LoginResult> t) { |
| | | if (t.isSuccess()) { |
| | | //{"code":"0","msg":"操作成功","data":{"chargeMethod":"","iccardCancelTime":"","lastRechargeTime":"2024-08-05 17:04:15","thisSaleMoney":"","totalRechargeWaterAmount":0.00,"iccardBalanceAmonunt":0.00,"iccardInfoId":"1820385315354320898","iccardProtocolName":"","totalRechargeElectricAmount":0.00,"logicState":1,"username":"","state":1,"familySize":"","yearRechargeMoney":0.00,"thisSaleAmount":"","onlyRechargeMoney":"","identityCard":"","iccardBrand":"","iccardBalanceMoney":0.00,"openOperatorUsername":"","adName":"","rechargeWaterAmount":"","openOperatorUserId":"1816297106145103873","lastSwipeTime":"","address":"","yearCompensateMoney":0.00,"iccardProtocolOpenMoney":"","peasantId":"1820374742679953410","reissueTimes":0,"iccardProtocolReissueMoney":"","iccardProtocolId":"","yearRechargeWaterAmount":0.00,"iccardBalanceElectric":0.00,"iccardStatus":0,"phone":"","lastRechargeMoney":0.00,"iccardOpenTime":"","yearRechargeElectricAmount":0.00,"reissueRechargeRecordId":"","iccardPrice":1.50,"iccardNum":"3714251023011","accountType":0,"equipCode":"","rechargeWaterMoney":"","totalRechargeMoney":0.00,"executeWaterPrice":"","iccardType":1,"iccardCode":"BADA4044"}} |
| | | startDetailActivity(userCardBean.getUserName(), "终端写卡"); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 确认充值回调 |
| | | * |
| | | * @param iccardRechargeRecordId |
| | | * @param writeCardStatus |
| | | */ |
| | | private void confromRecharge(String iccardRechargeRecordId, int writeCardStatus) { |
| | | Map<String, Object> data = new HashMap<>(); |
| | | data.put("iccardRechargeRecordId", iccardRechargeRecordId); |
| | | //写卡状态 0 写卡成功 1 待写卡 2 写卡失败 |
| | | data.put("writeCardStatus", writeCardStatus); |
| | | data.put("writeCardStatus", writeCardStatus); |
| | | |
| | | ApiManager.getInstance().requestPostLoading(this, "api/sjgg/iccard/recharge/rechargeCardResult", LoginResult.class, data, new SubscriberListener<BaseResponse<LoginResult>>() { |
| | | @Override |
| | | public void onNext(BaseResponse<LoginResult> t) { |
| | | if (t.isSuccess()) { |
| | | |
| | | try { |
| | | baseDao.rechargeDao().insert(rechargeBean); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | // 打印相关 |
| | | setPrinterData(rechargeBean); |
| | | startDetailActivity(rechargeBean.getUserName(), "终端写卡"); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 补卡 |
| | | */ |
| | | private void replaceCardPost(String iccardBalanceMoney, String iccardBalanceElectric) { |
| | | Map<String, Object> data = new HashMap<>(); |
| | | data.put("equipCode", DeviceUtils.getSN()); |
| | | //充值卡费 |
| | | data.put("rechargeCardMoney", rechargeCardMoney); |
| | | // 旧卡的id |
| | | data.put("iccardInfoId", iccardInfoId); |
| | | //新卡的物理卡号 |
| | | data.put("iccardNum", cardNumber); |
| | | //卡内剩余金额 |
| | | data.put("iccardBalanceMoney", iccardBalanceMoney); |
| | | //卡内剩余电量 |
| | | data.put("iccardBalanceElectric", iccardBalanceElectric); |
| | | ApiManager.getInstance().requestPostLoading(this, "api/sjgg/iccard/recharge/reissueOpenCard", ReplaceCardResult.class, data, new SubscriberListener<BaseResponse<ReplaceCardResult>>() { |
| | | @Override |
| | | public void onNext(BaseResponse<ReplaceCardResult> t) { |
| | | if (t.isSuccess()) { |
| | | ReplaceCardResult replaceCardResult = t.getData(); |
| | | userCard = new UserCard(); |
| | | userCard.setArerNumber(Integer.valueOf(QHOnLineApplication.getInstance().arerNumber)); |
| | | String userCode = t.getData().getIccardCode(); |
| | | userCard.setUserCode(userCode.substring(0, 12)); |
| | | userCard.setUserCodeNumber(Integer.valueOf(userCode.substring(12, 16))); |
| | | userCard.setCardWriteState(0); |
| | | userCard.setCardState(1); |
| | | userCard.setBalance(MornyUtil.changeY2F(replaceCardResult.getIccardBalanceMoney())); |
| | | userCard.setSurplusElecticity(MornyUtil.changeY2F(replaceCardResult.getIccardBalanceElectric())); |
| | | userCard.setTotalMorny(MornyUtil.changeY2F(replaceCardResult.getTotalRechargeMoney())); |
| | | userCard.setRechargeDate(Calendar.getInstance()); |
| | | userCard.setElectricPrice(Float.valueOf(QHOnLineApplication.getInstance().electriclePriceStr)); |
| | | if (WriteCardUtils.setUser(intent, userCard, NFCWreatActivity.this)) { |
| | | confromReplaceCard(replaceCardResult.getIccardRechargeRecordId(), 0); |
| | | } else { |
| | | TipUtil.show(NFCWreatActivity.this, "写卡失败,请重试"); |
| | | } |
| | | // 打印相关 |
| | | // setPrinterData(rechargeBean); |
| | | // startDetailActivity(rechargeBean.getUserName(), "终端写卡"); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * 确认补卡写卡成功 |
| | | * |
| | | * @param iccardRechargeRecordId |
| | | * @param writeCardStatus |
| | | */ |
| | | private void confromReplaceCard(String iccardRechargeRecordId, int writeCardStatus) { |
| | | Map<String, Object> data = new HashMap<>(); |
| | | data.put("equipCode", DeviceUtils.getSN()); |
| | | // data.put("iccardRechargeRecordId", iccardRechargeRecordId); |
| | | //写卡状态 0 写卡成功 1 待写卡 2 写卡失败 |
| | | data.put("writeCardStatus", writeCardStatus); |
| | | |
| | | ApiManager.getInstance().requestPostLoading(this, "api/sjgg/iccard/recharge/reissueOpenCardResult", LoginResult.class, data, new SubscriberListener<BaseResponse<LoginResult>>() { |
| | | @Override |
| | | public void onNext(BaseResponse<LoginResult> t) { |
| | | if (t.isSuccess()) { |
| | | |
| | | try { |
| | | baseDao.rechargeDao().insert(rechargeBean); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | // 打印相关 |
| | | setPrinterData(rechargeBean); |
| | | startDetailActivity(rechargeBean.getUserName(), "终端写卡"); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * 补卡逻辑 |
| | | */ |
| | | private void replaceCard() { |
| | | cardNumber = NfcReadHelper.getInstence(intent, this).getCardNumber(); |
| | | if (replaceType == BaseCommon.REPLACE_NO_CARD) { |
| | | replaceCardPost("", ""); |
| | | } |
| | | } |
| | | } |
| | |
| | | import androidx.annotation.NonNull; |
| | | |
| | | import com.dayu.baselibrary.tools.Utils; |
| | | import com.dayu.baselibrary.utils.DeviceUtils; |
| | | import com.dayu.baselibrary.utils.TipUtil; |
| | | import com.dayu.baselibrary.utils.ToastUtil; |
| | | |
| | | import com.dayu.qiheonlinelibrary.QHOnLineApplication; |
| | | import com.dayu.qiheonlinelibrary.bean.AddUserResult; |
| | | import com.dayu.qiheonlinelibrary.bean.PricePlanResult; |
| | | import com.dayu.qiheonlinelibrary.bean.UserListResult; |
| | | import com.dayu.qiheonlinelibrary.card.UserCard; |
| | | import com.dayu.qiheonlinelibrary.databinding.ActivityNewCardQhlBinding; |
| | | import com.dayu.qiheonlinelibrary.dbBean.AdminDataBean; |
| | | import com.dayu.qiheonlinelibrary.dbBean.UserCardBean; |
| | | import com.dayu.qiheonlinelibrary.net.ApiManager; |
| | | import com.dayu.qiheonlinelibrary.net.BaseResponse; |
| | | import com.dayu.qiheonlinelibrary.net.RSAUtile; |
| | | import com.dayu.qiheonlinelibrary.net.subscribers.SubscriberListener; |
| | | import com.hjq.permissions.OnPermissionCallback; |
| | | import com.hjq.permissions.Permission; |
| | | import com.hjq.permissions.XXPermissions; |
| | | import com.kernal.passportreader.sdk.CardsCameraActivity; |
| | | import com.kernal.passportreader.sdk.utils.DefaultPicSavePath; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.regex.Matcher; |
| | | import java.util.regex.Pattern; |
| | | |
| | |
| | | public class NewCardActivity extends BaseActivity { |
| | | |
| | | public static final int SCAN_IDCARD_REQUEST = 1; |
| | | UserCardBean userCardBean; |
| | | |
| | | ActivityNewCardQhlBinding newCardBinding; |
| | | AdminDataBean adminData; |
| | | |
| | | static NewCardActivity newCardActivity; |
| | | private int defValueMainId = 2; |
| | |
| | | newCardBinding.newCardRegistBtn.setOnClickListener(v -> { |
| | | |
| | | String userName = newCardBinding.newCardName.getText().toString(); |
| | | long date = System.currentTimeMillis(); |
| | | String phone = newCardBinding.newCardPhone.getText().toString(); |
| | | String userID = newCardBinding.newCardId.getText().toString().toUpperCase(); |
| | | |
| | | String morny = newCardBinding.newCardMorny.getText().toString(); |
| | | |
| | | if (!TextUtils.isEmpty(userName) |
| | | && !TextUtils.isEmpty(phone) && !TextUtils.isEmpty(userID) |
| | |
| | | } else if (!Utils.check(userID)) { |
| | | TipUtil.show(NewCardActivity.this, "请输入正确身份证号"); |
| | | } else { |
| | | userCardBean = new UserCardBean(); |
| | | userCardBean.setUserName(userName); |
| | | userCardBean.setDate(date); |
| | | userCardBean.setSerial(adminData.getSerial()); |
| | | userCardBean.setPhone(phone); |
| | | userCardBean.setUserID(userID); |
| | | |
| | | |
| | | UserCard userCard = new UserCard(); |
| | | userCard.setArerNumber(Integer.valueOf(adminData.getSerial())); |
| | | userCard.setDeviceNumberl(Integer.valueOf(adminData.getAddressCode())); |
| | | userCard.setRechargeTimes((byte) 0); |
| | | userCard.setTotalWater(0); |
| | | userCard.setTotalElectric(0); |
| | | userCard.setBalance(0); |
| | | userCard.setSurplusWater(0); |
| | | userCard.setRechargeDate(Calendar.getInstance()); |
| | | |
| | | Intent intent = new Intent(NewCardActivity.this, NFCWreatActivity.class); |
| | | intent.putExtra("userCard", userCard); |
| | | intent.putExtra("dbUserCard", userCardBean); |
| | | startActivity(intent); |
| | | selectUser(userID, phone, userName, morny); |
| | | } |
| | | |
| | | } else { |
| | |
| | | }); |
| | | } |
| | | |
| | | //校验手机号 |
| | | private boolean isValidPhoneNumber(String phoneNumber) { |
| | | // 定义手机号的正则表达式,确保数字部分没有连续6位相同的数字 |
| | | String phoneRegex = "^1[0-9]{10}$"; |
| | |
| | | private void setData() { |
| | | |
| | | try { |
| | | adminData = baseDao.adminDao().findFirst(); |
| | | newCardBinding.newCardVillageNum.setText(adminData.getSerial()); |
| | | newCardBinding.newCardArerNumber.setText(QHOnLineApplication.getInstance().arerNumber); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | newCardActivity = null; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询用户 |
| | | * |
| | | * @param peasantIdNumber |
| | | * @param peasantPhone |
| | | * @param peasantName |
| | | * @param morny 开卡金额 |
| | | */ |
| | | private void selectUser(String peasantIdNumber, String peasantPhone, String peasantName, String morny) { |
| | | Map<String, Object> data = new HashMap<>(); |
| | | data.put("adcd", QHOnLineApplication.getInstance().adcd); |
| | | data.put("peasantIdNumber", peasantIdNumber); |
| | | data.put("current", 1); |
| | | data.put("pageSize", 10); |
| | | ApiManager.getInstance().requestPostLoading(this, "api/sjgg/base/peasant/pagePeasantVo", UserListResult.class, data, new SubscriberListener<BaseResponse<UserListResult>>() { |
| | | @Override |
| | | public void onNext(BaseResponse<UserListResult> t) { |
| | | if (t.isSuccess()) { |
| | | if (t.getData().getTotal() == 0) { |
| | | if (!TextUtils.isEmpty(QHOnLineApplication.getInstance().planId)) { |
| | | addUser(peasantIdNumber, peasantPhone, peasantName, QHOnLineApplication.getInstance().planId, morny); |
| | | } |
| | | } else { |
| | | startNFCWreatActivity(peasantIdNumber, peasantPhone, peasantName, t.getData().getRecords().get(0).getPeasantId(), morny); |
| | | } |
| | | }else { |
| | | ToastUtil.show(t.getMsg()); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | private void startNFCWreatActivity(String peasantIdNumber, String peasantPhone, String peasantName, String peasanId, String morny) { |
| | | UserCard userCard = new UserCard(); |
| | | userCard.setArerNumber(Integer.valueOf(QHOnLineApplication.getInstance().arerNumber)); |
| | | userCard.setUserCode(QHOnLineApplication.getInstance().adcd); |
| | | userCard.setCardWriteState(0); |
| | | userCard.setCardState(1); |
| | | userCard.setBalance(0); |
| | | userCard.setSurplusElecticity(0); |
| | | userCard.setTotalMorny(0); |
| | | userCard.setRechargeDate(Calendar.getInstance()); |
| | | |
| | | UserCardBean userCardBean = new UserCardBean(); |
| | | |
| | | userCardBean.setUserName(peasantName); |
| | | userCardBean.setUserID(peasantIdNumber); |
| | | userCardBean.setPhone(peasantPhone); |
| | | userCardBean.setPersonId(peasanId); |
| | | if (!TextUtils.isEmpty(morny)) { |
| | | userCardBean.setCardMorny(Integer.valueOf(morny)); |
| | | } else { |
| | | userCardBean.setCardMorny(0); |
| | | } |
| | | userCardBean.setAddressCode(QHOnLineApplication.getInstance().adcd); |
| | | userCardBean.setAddressName(QHOnLineApplication.getInstance().addressName); |
| | | userCardBean.setArerNumber(QHOnLineApplication.getInstance().arerNumber); |
| | | userCardBean.setDate(System.currentTimeMillis()); |
| | | userCardBean.setSerial(DeviceUtils.getSN()); |
| | | |
| | | Intent intent = new Intent(NewCardActivity.this, NFCWreatActivity.class); |
| | | intent.putExtra("userCard", userCard); |
| | | intent.putExtra("dbUserCard", userCardBean); |
| | | startActivity(intent); |
| | | } |
| | | |
| | | /** |
| | | * 添加用户 |
| | | * |
| | | * @param peasantIdNumber |
| | | * @param peasantPhone |
| | | * @param peasantName |
| | | * @param planId 价格ID |
| | | */ |
| | | private void addUser(String peasantIdNumber, String peasantPhone, String peasantName, String planId, String morny) { |
| | | Map<String, Object> data = new HashMap<>(); |
| | | data.put("planId", planId); |
| | | data.put("adcd", QHOnLineApplication.getInstance().adcd); |
| | | data.put("peasantIdNumber", peasantIdNumber); |
| | | data.put("peasantCode", ""); |
| | | data.put("peasantName", peasantName); |
| | | data.put("peasantPhone", peasantPhone); |
| | | ApiManager.getInstance().requestPostLoading(this, "api/sjgg/base/peasant/savePeasant", AddUserResult.class, data, new SubscriberListener<BaseResponse<AddUserResult>>() { |
| | | @Override |
| | | public void onNext(BaseResponse<AddUserResult> t) { |
| | | if (t.isSuccess()) { |
| | | startNFCWreatActivity(peasantIdNumber, peasantPhone, peasantName, t.getData().getPeasantId(), morny); |
| | | }else { |
| | | ToastUtil.show(t.getMsg()); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import com.dayu.baselibrary.utils.MornyUtil; |
| | | import com.dayu.baselibrary.utils.TipUtil; |
| | | import com.dayu.baselibrary.view.ConfirmDialog; |
| | | import com.dayu.qiheonlinelibrary.bean.CardInfoResult; |
| | | import com.dayu.qiheonlinelibrary.card.BlackCard; |
| | | import com.dayu.qiheonlinelibrary.card.ConfigurationPowerCard; |
| | | import com.dayu.qiheonlinelibrary.card.DomainCard; |
| | |
| | | import com.dayu.qiheonlinelibrary.databinding.ActivityRedCardQhlBinding; |
| | | import com.dayu.qiheonlinelibrary.dbBean.AdminDataBean; |
| | | import com.dayu.qiheonlinelibrary.dbBean.UserCardBean; |
| | | import com.dayu.qiheonlinelibrary.net.ApiManager; |
| | | import com.dayu.qiheonlinelibrary.net.BaseResponse; |
| | | import com.dayu.qiheonlinelibrary.net.subscribers.SubscriberListener; |
| | | import com.dayu.qiheonlinelibrary.tools.NFCWriteHelper; |
| | | import com.dayu.qiheonlinelibrary.tools.NfcReadHelper; |
| | | import com.dayu.qiheonlinelibrary.utils.CardCommon; |
| | |
| | | |
| | | |
| | | import java.util.Calendar; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * Copyright (C), 2023, |
| | |
| | | AdminDataBean adminData; |
| | | String cardNumber; |
| | | String userCardStr; |
| | | |
| | | @Override |
| | | protected void onCreate(Bundle savedInstanceState) { |
| | | super.onCreate(savedInstanceState); |
| | | redCardBinding = ActivityRedCardQhlBinding.inflate(LayoutInflater.from(this)); |
| | | setContentView(redCardBinding.getRoot()); |
| | | } |
| | | |
| | | |
| | | private void setUserData(String userName, String statu, String cardNumber) { |
| | | viweGone(true); |
| | | redCardBinding.redName.setText("用户姓名:" + userName); |
| | | redCardBinding.redStatu.setText("卡状态:" + statu); |
| | | if (userCard != null) { |
| | | Calendar calendar = userCard.getRechargeDate(); |
| | | if (calendar != null) { |
| | | int year = calendar.get(Calendar.YEAR); |
| | | int month = calendar.get(Calendar.MONTH); // 月份从0开始,所以需要加1 |
| | | int day = calendar.get(Calendar.DAY_OF_MONTH); |
| | | redCardBinding.redRechargeDate.setText("本卡最后购水日期:" + year + "年" + month + "月" + day + "日"); |
| | | } else { |
| | | redCardBinding.redRechargeDate.setText("本卡最后购水日期:无"); |
| | | } |
| | | redCardBinding.redInitCode.setText(cardNumber); |
| | | redCardBinding.redRechargeNumber.setText("本卡充值次数:" + userCard.getRechargeTimes() + " 次"); |
| | | // redCardBinding.redTotalWater.setText("总用水量:" + MornyUtil.changeF2Y(userCard.getTotalWater()) + " 吨"); |
| | | // redCardBinding.redTotalPower.setText("总用电量:" + MornyUtil.changeF2Y(userCard.getTotalElectric()) + " 度"); |
| | | redCardBinding.redRemainderBlance.setText("剩余金额:" + MornyUtil.changeF2Y(userCard.getBalance()) + " 元"); |
| | | // redCardBinding.redRemainderWater.setText("剩余水量:" + MornyUtil.changeF2Y(userCard.getSurplusWater()) + " 吨"); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | String[] cardTypes = cardType.split(","); |
| | | if (cardTypes != null && cardTypes.length == 2) { |
| | | cardNumber = cardType.split(",")[0]; |
| | | cardNumber = HexUtil.spaceHex(cardNumber); |
| | | cardNumber = HexUtil.HighLowHex(cardNumber); |
| | | cardType = cardType.split(",")[1]; |
| | | } |
| | | List<byte[]> data = NfcReadHelper.getInstence(intent, this).getOnesectorData(); |
| | |
| | | if (!data.isEmpty()) { |
| | | if (!TextUtils.isEmpty(cardNumber)) { |
| | | userCard = UserCard.getBean(data); |
| | | List<UserCardBean> userCardBeans = baseDao.userCardDao().findUserName(cardNumber); |
| | | if (userCardBeans != null && !userCardBeans.isEmpty()) { |
| | | UserCardBean userName = userCardBeans.get(0); |
| | | setUserData(userName.getUserName(), state, cardNumber); |
| | | } else { |
| | | setUserData("未查询到用户名", state, cardNumber); |
| | | } |
| | | getUserInfoAndCardInfo(cardNumber); |
| | | } else { |
| | | |
| | | } |
| | |
| | | case CardCommon.MANAGE_CRAD://管理卡 |
| | | ManageCard manageCard = ManageCard.getBean(data); |
| | | viweGone(false); |
| | | userCardStr = manageCard.getUserCard().toUpperCase(); |
| | | userCardStr = HexUtil.spaceHex(userCardStr); |
| | | userCardStr = HexUtil.HighLowHex(userCardStr); |
| | | userCardStr = manageCard.getUserCard().toUpperCase(); |
| | | redCardBinding.readCardTypeTV.setText("当前为管理卡" + "\n\n" |
| | | + "原始卡号:" + userCardStr); |
| | | if (manageCard.getType()==(byte) 1){ |
| | | if (manageCard.getType() == (byte) 1) { |
| | | //当01时将1扇区0块原管理卡信息改成用户卡内容 |
| | | confirmDialog=new ConfirmDialog(this, "是否确认补卡,该卡将成为新用户卡?并且不要移动卡片", new View.OnClickListener() { |
| | | confirmDialog = new ConfirmDialog(this, "是否确认补卡,该卡将成为新用户卡?并且不要移动卡片", new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | ProgressDialog.show(ReadCardAcitivy.this); |
| | |
| | | baseDao.userCardDao().update(userName); |
| | | } |
| | | |
| | | NFCWriteHelper nfcWriteHelper= NFCWriteHelper.getInstence(intent,ReadCardAcitivy.this); |
| | | NFCWriteHelper nfcWriteHelper = NFCWriteHelper.getInstence(intent, ReadCardAcitivy.this); |
| | | adminData = baseDao.adminDao().findFirst(); |
| | | ManagerToUserCard managerToUserCard=new ManagerToUserCard(); |
| | | ManagerToUserCard managerToUserCard = new ManagerToUserCard(); |
| | | managerToUserCard.setArerNumber(Integer.valueOf(adminData.getSerial())); |
| | | managerToUserCard.setDeviceNumberl(Integer.valueOf(adminData.getAddressCode())); |
| | | managerToUserCard.setTotalElectric(manageCard.getTotalElectric()); |
| | | if (nfcWriteHelper.writeData(managerToUserCard.getZeroBytes(),1,0)){ |
| | | if (nfcWriteHelper.writeData(managerToUserCard.getZeroBytes(), 1, 0)) { |
| | | TipUtil.show(ReadCardAcitivy.this, "补卡成功", () -> ReadCardAcitivy.this.finish()); |
| | | }else { |
| | | } else { |
| | | TipUtil.show(ReadCardAcitivy.this, "补卡失败,请重新刷卡", () -> ReadCardAcitivy.this.finish()); |
| | | } |
| | | |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | e.printStackTrace(); |
| | | } |
| | | stopAnim(); |
| | | } |
| | |
| | | if (!data.isEmpty()) { |
| | | RegionCard regionCard = RegionCard.getBean(data); |
| | | StringBuilder stringBuilder = new StringBuilder(); |
| | | stringBuilder.append("区域地址:").append(regionCard.getRegion()).append("\n"); |
| | | stringBuilder.append("控制器编号:").append(regionCard.getControllerCodel()).append("\n"); |
| | | stringBuilder.append("区域号:").append(regionCard.getArerNumber()); |
| | | redCardBinding.readCardDataTV.setText(stringBuilder.toString()); |
| | | } else { |
| | | TipUtil.show("卡片识别错误,请重试!"); |
| | |
| | | // or avi.smoothToHide(); |
| | | } |
| | | |
| | | /** |
| | | * 获取卡信息和用户信息 |
| | | * |
| | | * @param iccardCode |
| | | */ |
| | | public void getUserInfoAndCardInfo(String iccardCode) { |
| | | Map<String, Object> data = new HashMap<>(); |
| | | //ic卡信息id |
| | | data.put("iccardNum", iccardCode); |
| | | ApiManager.getInstance().requestPostLoading(this, "api/sjgg/iccard/peasant/getIccardInfoVoByCardCode", CardInfoResult.class, data, new SubscriberListener<BaseResponse<CardInfoResult>>() { |
| | | @Override |
| | | public void onNext(BaseResponse<CardInfoResult> t) { |
| | | String state = ""; |
| | | if (t.isSuccess()) { |
| | | setUserData(t.getData()); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | private void setUserData(CardInfoResult cardInfoResult) { |
| | | viweGone(true); |
| | | if (cardInfoResult != null) { |
| | | redCardBinding.redName.setText(cardInfoResult.getPeasantName()); |
| | | redCardBinding.redCardCode.setText(cardNumber); |
| | | redCardBinding.redUserCode.setText(cardInfoResult.getIccardCode()); |
| | | redCardBinding.redBlance.setText(MornyUtil.changeF2Y(userCard.getBalance())+"元"); |
| | | redCardBinding.redElectric.setText(MornyUtil.changeF2Y(userCard.getSurplusElecticity())+"度"); |
| | | redCardBinding.redTotalMorny.setText(MornyUtil.changeF2Y(userCard.getTotalMorny())+"元"); |
| | | redCardBinding.redPhone.setText(cardInfoResult.getPeasantPhone()); |
| | | redCardBinding.redCodeId.setText(cardInfoResult.getPeasantIdNumber()); |
| | | if (cardInfoResult.getIccardStatus() == 0) { |
| | | redCardBinding.redStatu.setText("正常"); |
| | | } else if (cardInfoResult.getIccardStatus() == 1) { |
| | | redCardBinding.redStatu.setText("已注销"); |
| | | } else { |
| | | redCardBinding.redStatu.setText("已挂失"); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | package com.dayu.qiheonlinelibrary.activity; |
| | | |
| | | import android.annotation.SuppressLint; |
| | | import android.content.Context; |
| | | import android.content.Intent; |
| | | import android.os.Bundle; |
| | | import android.text.Editable; |
| | |
| | | import android.widget.EditText; |
| | | |
| | | import com.dayu.baselibrary.tools.HexUtil; |
| | | import com.dayu.baselibrary.utils.DeviceUtils; |
| | | import com.dayu.baselibrary.utils.MornyUtil; |
| | | import com.dayu.baselibrary.utils.TipUtil; |
| | | |
| | | |
| | | import com.dayu.baselibrary.utils.ToastUtil; |
| | | import com.dayu.baselibrary.view.TipDialog; |
| | | import com.dayu.qiheonlinelibrary.QHOnLineApplication; |
| | | import com.dayu.qiheonlinelibrary.R; |
| | | import com.dayu.qiheonlinelibrary.bean.CardInfoResult; |
| | | import com.dayu.qiheonlinelibrary.bean.RechargeResult; |
| | | import com.dayu.qiheonlinelibrary.card.UserCard; |
| | | import com.dayu.qiheonlinelibrary.databinding.ActivityRechargeQhlBinding; |
| | | import com.dayu.qiheonlinelibrary.dbBean.AdminDataBean; |
| | | import com.dayu.qiheonlinelibrary.dbBean.ElectricPriceBean; |
| | | import com.dayu.qiheonlinelibrary.dbBean.RechargeBean; |
| | | import com.dayu.qiheonlinelibrary.dbBean.UserCardBean; |
| | | import com.dayu.qiheonlinelibrary.net.ApiManager; |
| | | import com.dayu.qiheonlinelibrary.net.BaseResponse; |
| | | import com.dayu.qiheonlinelibrary.net.RSAUtile; |
| | | import com.dayu.qiheonlinelibrary.net.subscribers.SubscriberListener; |
| | | import com.dayu.qiheonlinelibrary.tools.NfcReadHelper; |
| | | import com.dayu.qiheonlinelibrary.utils.CardCommon; |
| | | import com.tencent.bugly.crashreport.CrashReport; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | |
| | | /** |
| | |
| | | ActivityRechargeQhlBinding binding; |
| | | public static RechargeActivity rechargeActivity; |
| | | |
| | | AdminDataBean adminData; |
| | | String userName; |
| | | String cardNumber = null; |
| | | UserCardBean userCardBean; |
| | | int waterPrice; |
| | | |
| | | String cardNumber = null;//实体卡号 |
| | | RechargeBean rechargeBean; |
| | | |
| | | String rechageWater;//充值的水量 |
| | | ElectricPriceBean priceBean; |
| | | |
| | | String cardType;//卡状态 |
| | | |
| | | CardInfoResult cardInfoResult; |
| | | |
| | | @Override |
| | | protected void onCreate(Bundle savedInstanceState) { |
| | |
| | | setContentView(binding.getRoot()); |
| | | setPricePoint(binding.rechargeWater); |
| | | rechargeActivity = this; |
| | | waterPrice = baseDao.adminDao().findFirst().getWaterPrice(); |
| | | initView(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | |
| | | |
| | | |
| | | private void readAllData() { |
| | | String cardType = NfcReadHelper.getInstence(intent, this).getCradTypeAndCardNumber(); |
| | | cardType = NfcReadHelper.getInstence(intent, this).getCradTypeAndCardNumber(); |
| | | |
| | | String[] cardTypes = cardType.split(","); |
| | | if (cardTypes != null && cardTypes.length == 2) { |
| | | cardNumber = cardType.split(",")[0]; |
| | | cardNumber = HexUtil.spaceHex(cardNumber); |
| | | cardNumber = HexUtil.HighLowHex(cardNumber); |
| | | cardType = cardType.split(",")[1]; |
| | | } |
| | | List<byte[]> data = NfcReadHelper.getInstence(intent, this).getOnesectorData(); |
| | | getUserInfoAndCardInfo(cardNumber); |
| | | |
| | | if (!data.isEmpty()) { |
| | | if (!TextUtils.isEmpty(cardNumber)) { |
| | | setUserData(cardType, cardNumber, data); |
| | | if(priceBean!=null){ |
| | | binding.redRechargeElectric.setText("电量单价:"+priceBean.getPrice()+"元/度"); |
| | | } |
| | | } else { |
| | | TipUtil.show(this, "读取卡片失败,请重新贴卡"); |
| | | } |
| | | } else { |
| | | TipUtil.show(this, "卡片识别错误,请重试!"); |
| | | } |
| | | } |
| | | |
| | | |
| | | @SuppressLint("ResourceAsColor") |
| | | private void setUserData(String cardType, String cardNumber, List<byte[]> data) { |
| | | |
| | | |
| | | private void setUserData(String cardNumber, String userName, String lastRechargeTime, float iccardBalanceMoney, List<byte[]> data) { |
| | | String state = ""; |
| | | if (cardType.equalsIgnoreCase(CardCommon.USER_CARD_TYPE_1)) { |
| | | state = "终端写卡"; |
| | | binding.rechargeLL.setVisibility(View.VISIBLE); |
| | | binding.rechargeRegistBtn.setVisibility(View.VISIBLE); |
| | | binding.redStatu.setTextColor(R.color.black); |
| | | binding.redStatu.setTextColor(this.getResources().getColor(R.color.black)); |
| | | } else if (cardType.equalsIgnoreCase(CardCommon.USER_CARD_TYPE_2)) { |
| | | state = "未刷卡关泵,当前不可充值"; |
| | | binding.rechargeLL.setVisibility(View.GONE); |
| | | binding.rechargeRegistBtn.setVisibility(View.GONE); |
| | | binding.redStatu.setTextColor(com.dayu.baselibrary.R.color.red); |
| | | setCardState("未刷卡关泵,当前不可充值"); |
| | | } else if (cardType.equalsIgnoreCase(CardCommon.USER_CARD_TYPE_3)) { |
| | | state = "叠加充值"; |
| | | binding.rechargeLL.setVisibility(View.GONE); |
| | | binding.rechargeRegistBtn.setVisibility(View.GONE); |
| | | setCardState("叠加充值"); |
| | | } else { |
| | | TipUtil.show(this, "非用户卡,不能充值"); |
| | | return; |
| | | } |
| | | |
| | | |
| | | userCard = UserCard.getBean(data); |
| | | List<UserCardBean> userCardBeans = baseDao.userCardDao().findUserName(cardNumber); |
| | | AdminDataBean adminDataBean = baseDao.adminDao().findFirst(); |
| | | |
| | | if (Integer.valueOf(QHOnLineApplication.getInstance().arerNumber) == userCard.getArerNumber()) { |
| | | |
| | | if (Integer.valueOf(adminDataBean.getAddressCode()) == userCard.getArerNumber()) { |
| | | if (!userCardBeans.isEmpty()) { |
| | | userCardBean = userCardBeans.get(0); |
| | | this.userName = userCardBean.getUserName(); |
| | | } else { |
| | | userCardBean = new UserCardBean(); |
| | | userCardBean.setCardNumber(cardNumber); |
| | | userCardBean.setUserName("未知用户"); |
| | | userCardBean.setPhone("未知"); |
| | | userCardBean.setUserID("未知"); |
| | | userCardBean.setAddressCode(String.valueOf(userCard.getArerNumber())); |
| | | userCardBean.setSerial(String.valueOf(userCard.getArerNumber())); |
| | | this.userName = "未知用户"; |
| | | } |
| | | binding.rechargeReadLL.setVisibility(View.GONE); |
| | | binding.rechargeTextLL.setVisibility(View.VISIBLE); |
| | | binding.userName.setText(userName); |
| | | binding.redStatu.setText(state); |
| | | binding.redInitCode.setText(cardNumber); |
| | | binding.redRechargeDate.setText("本卡最后购水日期:\n\n" + lastRechargeTime); |
| | | if (userCard != null) { |
| | | Calendar calendar = userCard.getRechargeDate(); |
| | | if (calendar != null) { |
| | | int year = calendar.get(Calendar.YEAR); |
| | | int month = calendar.get(Calendar.MONTH); // 月份从0开始,所以需要加1 |
| | | int day = calendar.get(Calendar.DAY_OF_MONTH); |
| | | binding.redRechargeDate.setText("本卡最后购水日期:" + year + "年" + month + "月" + day + "日"); |
| | | } else { |
| | | binding.redRechargeDate.setText("本卡最后购水日期:无"); |
| | | } |
| | | binding.redInitCode.setText(cardNumber); |
| | | // binding.redRechargeNumber.setText("本卡充值次数:" + userCard.getRechargeTimes() + " 次"); |
| | | // binding.redTotalWater.setText("总用水量:" + MornyUtil.changeF2Y(userCard.getTotalWater()) + " 吨"); |
| | | // binding.redTotalPower.setText("总用电量:" + MornyUtil.changeF2Y(userCard.getTotalElectric()) + " 度"); |
| | | binding.redRemainderBlance.setText(MornyUtil.changeF2Y(userCard.getBalance()) + " 元"); |
| | | binding.redRemainderWater.setText("剩余水量:" + MornyUtil.changeF2Y(userCard.getSurplusWater()) + " 吨"); |
| | | // binding.redWaterPrice.setText("每立方米水价格:" + MornyUtil.changeF2Y(adminData.getWaterPrice()) + " 元"); |
| | | |
| | | binding.redRemainderBlance.setText(String.valueOf(iccardBalanceMoney) + " 元"); |
| | | } |
| | | |
| | | binding.redRechargeElectric.setText("电量单价:" + QHOnLineApplication.getInstance().electriclePriceStr + "元/度"); |
| | | |
| | | } else { |
| | | TipUtil.show(this, "非本区域卡\n不能充值!!!"); |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | private void initView() { |
| | | try { |
| | | adminData = baseDao.adminDao().findFirst(); |
| | | priceBean = baseDao.electricPriceDao().findFirst(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | CrashReport.postCatchedException(e); |
| | | } |
| | | binding.rechargeRegistBtn.setOnClickListener(v -> { |
| | | String morny = binding.rechargeWater.getText().toString(); |
| | | if (!TextUtils.isEmpty(morny)) { |
| | | Intent intent = new Intent(RechargeActivity.this, NFCWreatActivity.class); |
| | | //当前金额单位为元 |
| | | intent.putExtra("morny", morny); |
| | | intent.putExtra("userName", userName); |
| | | intent.putExtra("cardNumber", cardNumber); |
| | | intent.putExtra("userCard", userCard); |
| | | intent.putExtra("userCardBean", userCardBean); |
| | | // intent.putExtra("rechageWater", rechageWater); |
| | | startActivity(intent); |
| | | rechaege(morny); |
| | | } else { |
| | | TipUtil.show(RechargeActivity.this, "请输入充值金额(元)"); |
| | | TipUtil.show(RechargeActivity.this, "请输入充值金额"); |
| | | } |
| | | }); |
| | | } |
| | |
| | | } |
| | | String morny = editText.getText().toString(); |
| | | if (!TextUtils.isEmpty(morny)) { |
| | | rechageWater = MornyUtil.intDiv(MornyUtil.changeY2F(editText.getText().toString()), waterPrice); |
| | | // rechageWater = MornyUtil.intDiv(MornyUtil.changeY2F(editText.getText().toString()), waterPrice); |
| | | // binding.redRechargeWater.setText("充值水量:" + rechageWater + " 立方米(吨)"); |
| | | } |
| | | |
| | |
| | | super.onDestroy(); |
| | | rechargeActivity = null; |
| | | } |
| | | |
| | | |
| | | private void startNfcActivity(String morny, String balance, float rechargeElectric, float iccardBalanceElectric, float totalMorny, String iccardRechargeRecordId) { |
| | | |
| | | //添加充值信息 |
| | | rechargeBean = new RechargeBean(); |
| | | rechargeBean.setCardNumber(cardNumber); |
| | | rechargeBean.setUserCode(userCard.getUserCode()); |
| | | rechargeBean.setUserName(""); |
| | | rechargeBean.setPersonId(cardInfoResult.getPeasantId()); |
| | | rechargeBean.setSerial(DeviceUtils.getSN()); |
| | | rechargeBean.setArerNumber(QHOnLineApplication.getInstance().arerNumber); |
| | | rechargeBean.setMorny(morny); |
| | | rechargeBean.setBalance(balance); |
| | | rechargeBean.setRechargeElectric(String.valueOf(rechargeElectric)); |
| | | rechargeBean.setPrice(QHOnLineApplication.getInstance().electriclePriceStr); |
| | | rechargeBean.setSurplusElectic(String.valueOf(iccardBalanceElectric)); |
| | | long time = System.currentTimeMillis(); |
| | | rechargeBean.setRechargeDate(time); |
| | | rechargeBean.setUserId(""); |
| | | rechargeBean.setTotalMorny(String.valueOf(totalMorny)); |
| | | rechargeBean.setState(1); |
| | | rechargeBean.setOrderId(iccardRechargeRecordId); |
| | | |
| | | userCard.setCardWriteState(0); |
| | | userCard.setCardState(1); |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTimeInMillis(time); |
| | | userCard.setBalance(MornyUtil.changeY2F(String.valueOf(balance))); |
| | | userCard.setSurplusElecticity(MornyUtil.changeY2F(String.valueOf(iccardBalanceElectric))); |
| | | String sumMorny = MornyUtil.sumPrice(Float.valueOf(MornyUtil.changeF2Y(userCard.getTotalMorny())), Float.valueOf(morny)); |
| | | userCard.setTotalMorny(MornyUtil.changeY2F(sumMorny)); |
| | | userCard.setRechargeDate(calendar); |
| | | |
| | | |
| | | Intent intent = new Intent(RechargeActivity.this, NFCWreatActivity.class); |
| | | intent.putExtra("morny", morny); |
| | | intent.putExtra("userCard", userCard); |
| | | intent.putExtra("rechargeBean", rechargeBean); |
| | | startActivity(intent); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * IC卡充值 |
| | | * |
| | | * @param morny |
| | | */ |
| | | public void rechaege(String morny) { |
| | | Map<String, Object> data = new HashMap<>(); |
| | | //终端设备号 |
| | | data.put("equipCode", DeviceUtils.getSN()); |
| | | //ic卡信息id |
| | | data.put("iccardNum", cardNumber); |
| | | //交易水费金额(元) |
| | | data.put("rechargeWaterMoney", morny); |
| | | //卡内剩余金额(元) |
| | | data.put("iccardBalanceMoney", MornyUtil.changeF2Y(userCard.getBalance())); |
| | | //卡内剩余水量(m³) |
| | | data.put("iccardBalanceAmonunt", "0"); |
| | | //卡内剩余电量 |
| | | data.put("iccardBalanceElectric", MornyUtil.changeF2Y(userCard.getSurplusElecticity())); |
| | | ApiManager.getInstance().requestPostLoading(this, "api/sjgg/iccard/recharge/rechargeCard", RechargeResult.class, data, new SubscriberListener<BaseResponse<RechargeResult>>() { |
| | | @Override |
| | | public void onNext(BaseResponse<RechargeResult> t) { |
| | | if (t.isSuccess()) { |
| | | RechargeResult rechargeResult = t.getData(); |
| | | startNfcActivity(morny, rechargeResult.getIccardBalanceMoney(), rechargeResult.getRechargeElectricAmount(), rechargeResult.getIccardBalanceElectric(), rechargeResult.getTotalRechargeMoney(), rechargeResult.getIccardRechargeRecordId()); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取卡信息和用户信息 |
| | | * |
| | | * @param iccardCode |
| | | */ |
| | | public void getUserInfoAndCardInfo(String iccardCode) { |
| | | Map<String, Object> data = new HashMap<>(); |
| | | //ic卡信息id |
| | | data.put("iccardNum", iccardCode); |
| | | ApiManager.getInstance().requestPostLoading(this, "api/sjgg/iccard/peasant/getIccardInfoVoByCardCode", CardInfoResult.class, data, new SubscriberListener<BaseResponse<CardInfoResult>>() { |
| | | @Override |
| | | public void onNext(BaseResponse<CardInfoResult> t) { |
| | | String state = ""; |
| | | if (t.isSuccess()) { |
| | | //ic卡状态 0 正常 1 已注销 2 已挂失 |
| | | if (t.getData().getIccardStatus() == 0) { |
| | | List<byte[]> data = NfcReadHelper.getInstence(intent, RechargeActivity.this).getOnesectorData(); |
| | | if (!data.isEmpty()) { |
| | | if (!TextUtils.isEmpty(cardNumber)) { |
| | | cardInfoResult = t.getData(); |
| | | setUserData(cardNumber, cardInfoResult.getPeasantName(), cardInfoResult.getLastRechargeTime(), cardInfoResult.getIccardBalanceMoney(), data); |
| | | } else { |
| | | TipUtil.show(RechargeActivity.this, "读取卡片失败,请重新贴卡"); |
| | | } |
| | | } else { |
| | | TipUtil.show(RechargeActivity.this, "卡片识别错误,请重试!"); |
| | | } |
| | | } else if (t.getData().getIccardStatus() == 1) { |
| | | TipUtil.show(RechargeActivity.this, "当前卡已注销"); |
| | | } else { |
| | | TipUtil.show(RechargeActivity.this, "当前卡已挂失"); |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | private void setCardState(String state) { |
| | | binding.rechargeLL.setVisibility(View.GONE); |
| | | binding.rechargeRegistBtn.setVisibility(View.GONE); |
| | | binding.redStatu.setTextColor(RechargeActivity.this.getResources().getColor(com.dayu.baselibrary.R.color.red)); |
| | | binding.redStatu.setText(state); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | } |
| | | binding.redName.setText("用户姓名:" + userName); |
| | | // binding.redRemainderBlance.setText("剩余金额:" + MornyUtil.changeF2Y(balance) + " 元"); |
| | | binding.redSurplusWater.setText("剩余水量:" + MornyUtil.changeF2Y(userCard.getSurplusWater()) + " 吨"); |
| | | // binding.redSurplusWater.setText("剩余水量:" + MornyUtil.changeF2Y(userCard.getSurplusWater()) + " 吨"); |
| | | binding.redStatu.setText("卡状态:" + statu); |
| | | if (userCard != null) { |
| | | binding.redInitCode.setText("当前卡号:" + cardNumber); |
| | |
| | | |
| | | import android.content.Intent; |
| | | import android.os.Bundle; |
| | | import android.text.TextUtils; |
| | | import android.view.LayoutInflater; |
| | | |
| | | import com.dayu.baselibrary.utils.TipUtil; |
| | | import com.dayu.qiheonlinelibrary.QHOnLineApplication; |
| | | import com.dayu.qiheonlinelibrary.card.CleanCard; |
| | | import com.dayu.qiheonlinelibrary.card.ElectricPriceCard; |
| | | import com.dayu.qiheonlinelibrary.card.PassWordCard; |
| | |
| | | //制作管理卡 |
| | | adminBinding.adminAdmin.setOnClickListener(v -> { |
| | | |
| | | AdminCardDialog dialog=new AdminCardDialog(this); |
| | | AdminCardDialog dialog = new AdminCardDialog(this); |
| | | dialog.show(); |
| | | |
| | | }); |
| | |
| | | |
| | | Intent intent = new Intent(SysActivity.this, NFCWreatActivity.class); |
| | | RegionCard regionCard = new RegionCard(); |
| | | AdminDataBean adminDataBean = baseDao.adminDao().findFirst(); |
| | | regionCard.setRegion(Integer.valueOf(adminDataBean.getAddressCode())); |
| | | regionCard.setControllerCodel(Integer.valueOf(adminDataBean.getAddressCode())); |
| | | regionCard.setArerNumber(Integer.valueOf(QHOnLineApplication.getInstance().arerNumber)); |
| | | intent.putExtra("regionCard", regionCard); |
| | | startActivity(intent); |
| | | }); |
| | | //制作设置用户电量单价卡 |
| | | adminBinding.adminElectricCard.setOnClickListener(v -> { |
| | | Intent intent = new Intent(SysActivity.this, NFCWreatActivity.class); |
| | | ElectricPriceBean electricPriceBean = baseDao.electricPriceDao().findFirst(); |
| | | if (electricPriceBean != null) { |
| | | |
| | | if (!TextUtils.isEmpty(QHOnLineApplication.getInstance().electriclePriceStr)) { |
| | | ElectricPriceCard electricPriceCard = new ElectricPriceCard(); |
| | | electricPriceCard.setElectricPrice(electricPriceBean.getPrice()); |
| | | electricPriceCard.setElectricPrice(Float.valueOf(QHOnLineApplication.getInstance().electriclePriceStr)); |
| | | intent.putExtra("electricPriceCard", electricPriceCard); |
| | | startActivity(intent); |
| | | } else { |
| | | TipUtil.show(this, "请先在参数设置内设置电量单价"); |
| | | TipUtil.show(this, "未获取到电价"); |
| | | } |
| | | |
| | | }); |
| New file |
| | |
| | | package com.dayu.qiheonlinelibrary.activity; |
| | | |
| | | import static com.dayu.baselibrary.view.TitleBar.ClickType_RIGHT_TEXT; |
| | | |
| | | import android.content.Intent; |
| | | import android.os.Bundle; |
| | | import android.view.LayoutInflater; |
| | | import android.view.View; |
| | | |
| | | import androidx.recyclerview.widget.LinearLayoutManager; |
| | | |
| | | import com.dayu.qiheonlinelibrary.adapter.UserSearchAdapter; |
| | | import com.dayu.qiheonlinelibrary.bean.UserListResult; |
| | | import com.dayu.qiheonlinelibrary.databinding.ActivityUserSearchQhlBinding; |
| | | import com.dayu.qiheonlinelibrary.net.ApiManager; |
| | | import com.dayu.qiheonlinelibrary.net.BaseResponse; |
| | | import com.dayu.qiheonlinelibrary.net.subscribers.SubscriberListener; |
| | | import com.dayu.qiheonlinelibrary.view.UserSearchDialog; |
| | | import com.scwang.smart.refresh.footer.ClassicsFooter; |
| | | import com.scwang.smart.refresh.layout.api.RefreshLayout; |
| | | import com.scwang.smart.refresh.layout.listener.OnLoadMoreListener; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * author: zuo |
| | | * Date: 2024-08-07 |
| | | * Time: 18:13 |
| | | * 备注:用户搜索 |
| | | */ |
| | | public class UserSearchActivity extends BaseActivity { |
| | | ActivityUserSearchQhlBinding binding; |
| | | UserSearchDialog userSearchDialog; |
| | | RefreshLayout myRefreshLayout; |
| | | UserSearchAdapter adapter; |
| | | |
| | | int page = 1; |
| | | int size = 10; |
| | | String name; |
| | | String cardID; |
| | | List<UserListResult.Records> records = new ArrayList<>(); |
| | | |
| | | int type;//当前操作类型 |
| | | |
| | | @Override |
| | | protected void onCreate(Bundle savedInstanceState) { |
| | | super.onCreate(savedInstanceState); |
| | | binding = ActivityUserSearchQhlBinding.inflate(LayoutInflater.from(this)); |
| | | setContentView(binding.getRoot()); |
| | | type = this.getIntent().getIntExtra("type", 0); |
| | | initView(); |
| | | showDialog(); |
| | | } |
| | | |
| | | private void initView() { |
| | | myRefreshLayout = (RefreshLayout) binding.refreshLayout; |
| | | myRefreshLayout.setEnableRefresh(false); |
| | | myRefreshLayout.setRefreshFooter(new ClassicsFooter(this)); |
| | | myRefreshLayout.setOnLoadMoreListener(new OnLoadMoreListener() { |
| | | @Override |
| | | public void onLoadMore(RefreshLayout refreshlayout) { |
| | | page = page + 1; |
| | | selectUser(cardID, name, false); |
| | | } |
| | | }); |
| | | adapter = new UserSearchAdapter(this, records, new UserSearchAdapter.OnItemClickListener() { |
| | | @Override |
| | | public void onItemClick(int position) { |
| | | Intent intent = new Intent(UserSearchActivity.this, CardSearchActivity.class); |
| | | intent.putExtra("pearsontId", records.get(position).getPeasantId()); |
| | | intent.putExtra("type", type); |
| | | UserSearchActivity.this.startActivity(intent); |
| | | UserSearchActivity.this.finish(); |
| | | } |
| | | }); |
| | | LinearLayoutManager layoutManager = new LinearLayoutManager(this); |
| | | binding.recyclerView.setLayoutManager(layoutManager); |
| | | binding.recyclerView.setAdapter(adapter); |
| | | titleBar.setOnItemclickListner(ClickType_RIGHT_TEXT, new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | showDialog(); |
| | | } |
| | | }); |
| | | |
| | | } |
| | | |
| | | private void showDialog() { |
| | | userSearchDialog = new UserSearchDialog(this, (name, cardId) -> { |
| | | UserSearchActivity.this.name = name; |
| | | UserSearchActivity.this.cardID = cardId; |
| | | |
| | | selectUser(cardId, name, true); |
| | | }); |
| | | userSearchDialog.show(); |
| | | } |
| | | |
| | | /** |
| | | * 查询用户 |
| | | * |
| | | * @param peasantIdNumber |
| | | */ |
| | | private void selectUser(String peasantIdNumber, String name, boolean isRefresh) { |
| | | if (isRefresh) { |
| | | page = 1; |
| | | records.clear(); |
| | | } |
| | | Map<String, Object> data = new HashMap<>(); |
| | | data.put("peasantIdNumber", peasantIdNumber); |
| | | data.put("peasantName", name); |
| | | data.put("current", page); |
| | | data.put("pageSize", size); |
| | | ApiManager.getInstance().requestPostLoading(this, "api/sjgg/base/peasant/pagePeasantVo", UserListResult.class, data, new SubscriberListener<BaseResponse<UserListResult>>() { |
| | | @Override |
| | | public void onNext(BaseResponse<UserListResult> t) { |
| | | if (t.isSuccess()) { |
| | | if (t.getData().getTotal() == records.size()) { |
| | | myRefreshLayout.finishLoadMoreWithNoMoreData(); |
| | | } else { |
| | | records.addAll(t.getData().getRecords()); |
| | | } |
| | | adapter.notifyDataSetChanged(); |
| | | myRefreshLayout.finishLoadMore(); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.dayu.qiheonlinelibrary.adapter; |
| | | |
| | | import android.content.Context; |
| | | import android.view.LayoutInflater; |
| | | import android.view.ViewGroup; |
| | | |
| | | import androidx.annotation.NonNull; |
| | | import androidx.databinding.DataBindingUtil; |
| | | import androidx.recyclerview.widget.RecyclerView; |
| | | |
| | | import com.dayu.baselibrary.databinding.ItemNoMoreBinding; |
| | | import com.dayu.qiheonlinelibrary.R; |
| | | import com.dayu.qiheonlinelibrary.bean.CardInfoListResult; |
| | | import com.dayu.qiheonlinelibrary.bean.UserListResult; |
| | | import com.dayu.qiheonlinelibrary.databinding.QiheLineItemUserBinding; |
| | | import com.dayu.qiheonlinelibrary.databinding.QiheLineItenCardBinding; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * author: zuo |
| | | * Date: 2024-08-08 |
| | | * Time: 17:26 |
| | | * 备注: |
| | | */ |
| | | public class CardAdapter extends BaseRecyclerAdapter<RecyclerView.ViewHolder> { |
| | | |
| | | List<CardInfoListResult.Records> records; |
| | | Context mContext; |
| | | OnItemClickListener onItemClickListener; |
| | | |
| | | public interface OnItemClickListener { |
| | | void onItemClick(int position); |
| | | } |
| | | |
| | | public CardAdapter(Context context, List<CardInfoListResult.Records> rechargeList, OnItemClickListener onItemClickListener) { |
| | | mContext = context; |
| | | this.onItemClickListener = onItemClickListener; |
| | | this.records = rechargeList; |
| | | } |
| | | |
| | | |
| | | @NonNull |
| | | @Override |
| | | public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { |
| | | if (viewType == VIEW_TYPE_EMPTY) { |
| | | ItemNoMoreBinding emptyView = DataBindingUtil.inflate((LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE), com.dayu.baselibrary.R.layout.item_no_more, parent, false); |
| | | return new ViewHolderEmpty(emptyView); |
| | | } else { |
| | | QiheLineItenCardBinding binding = DataBindingUtil.inflate((LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE), R.layout.qihe_line_iten_card, parent, false); |
| | | |
| | | return new ViewHolder(binding); |
| | | } |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) { |
| | | if (holder instanceof ViewHolder) { |
| | | if (records.size() > 0) { |
| | | try { |
| | | CardInfoListResult.Records record = records.get(position); |
| | | ((ViewHolder) holder).getBinding().cardId.setText(record.getIccardNum()); |
| | | ((ViewHolder) holder).getBinding().userCode.setText(record.getIccardCode()); |
| | | ((ViewHolder) holder).getBinding().balance.setText(record.getIccardBalanceMoney() + "元"); |
| | | ((ViewHolder) holder).getBinding().totalMorny.setText(record.getTotalRechargeMoney() + "元"); |
| | | ((ViewHolder) holder).getBinding().balanceElectic.setText(record.getIccardBalanceElectric()); |
| | | ((ViewHolder) holder).getBinding().lastRechargeTime.setText("最后充值时间:" + record.getLastRechargeTime()); |
| | | if (record.getIccardStatus() == 0) { |
| | | ((ViewHolder) holder).getBinding().state.setText("正常"); |
| | | } else if (record.getIccardStatus() == 1) { |
| | | ((ViewHolder) holder).getBinding().state.setText("已注销"); |
| | | } else { |
| | | ((ViewHolder) holder).getBinding().state.setText("已挂失"); |
| | | } |
| | | ((ViewHolder) holder).getBinding().item.setOnClickListener(v -> onItemClickListener.onItemClick(position)); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public int getItemCount() { |
| | | //同时这里也需要添加判断,如果mData.size()为0的话,只引入一个布局,就是emptyView |
| | | // 那么,这个recyclerView的itemCount为1 |
| | | if (records.size() == 0) { |
| | | return 1; |
| | | } |
| | | return records.size(); |
| | | } |
| | | |
| | | @Override |
| | | public int getItemViewType(int position) { |
| | | if (records.size() == 0) { |
| | | return VIEW_TYPE_EMPTY; |
| | | } else { |
| | | return VIEW_TYPE_ITEM; |
| | | } |
| | | } |
| | | |
| | | |
| | | static class ViewHolder extends RecyclerView.ViewHolder { |
| | | QiheLineItenCardBinding mBinding; |
| | | |
| | | public QiheLineItenCardBinding getBinding() { |
| | | return mBinding; |
| | | } |
| | | |
| | | public void setBinding(QiheLineItenCardBinding binding) { |
| | | this.mBinding = binding; |
| | | } |
| | | |
| | | public ViewHolder(QiheLineItenCardBinding itemView) { |
| | | super(itemView.getRoot()); |
| | | this.mBinding = itemView; |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | // ((ViewHolder) holder).getBinding().rachagerWater.setText("充值水量:" + rechargeList.get(position).getRechargeWater() + " 吨"); |
| | | ((ViewHolder) holder).getBinding().balance.setText("充值时余额:" + rechargeList.get(position).getBalance() + " 元"); |
| | | // ((ViewHolder) holder).getBinding().surplusWater.setText("剩余水量:" + rechargeList.get(position).getSurplusWater() + " 吨"); |
| | | ((ViewHolder) holder).getBinding().date.setText("日期:" + DateUtil.dateToStamp(rechargeList.get(position).getDate(), DateUtil.type1)); |
| | | ((ViewHolder) holder).getBinding().date.setText("日期:" + DateUtil.dateToStamp(rechargeList.get(position).getRechargeDate(), DateUtil.type1)); |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | package com.dayu.qiheonlinelibrary.adapter; |
| | | |
| | | import android.content.Context; |
| | | import android.view.LayoutInflater; |
| | | import android.view.ViewGroup; |
| | | |
| | | import androidx.annotation.NonNull; |
| | | import androidx.databinding.DataBindingUtil; |
| | | import androidx.recyclerview.widget.RecyclerView; |
| | | |
| | | import com.dayu.baselibrary.databinding.ItemNoMoreBinding; |
| | | import com.dayu.qiheonlinelibrary.R; |
| | | import com.dayu.qiheonlinelibrary.bean.UserListResult; |
| | | import com.dayu.qiheonlinelibrary.databinding.QiheLineItemUserBinding; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * author: zuo |
| | | * Date: 2024-08-08 |
| | | * Time: 10:13 |
| | | * 备注: |
| | | */ |
| | | public class UserSearchAdapter extends BaseRecyclerAdapter<RecyclerView.ViewHolder> { |
| | | |
| | | List<UserListResult.Records> records; |
| | | Context mContext; |
| | | OnItemClickListener onItemClickListener; |
| | | |
| | | public interface OnItemClickListener { |
| | | void onItemClick(int position); |
| | | } |
| | | |
| | | public UserSearchAdapter(Context context, List<UserListResult.Records> rechargeList, OnItemClickListener onItemClickListener) { |
| | | mContext = context; |
| | | this.onItemClickListener = onItemClickListener; |
| | | this.records = rechargeList; |
| | | } |
| | | |
| | | |
| | | @NonNull |
| | | @Override |
| | | public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { |
| | | if (viewType == VIEW_TYPE_EMPTY) { |
| | | ItemNoMoreBinding emptyView = DataBindingUtil.inflate((LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE), com.dayu.baselibrary.R.layout.item_no_more, parent, false); |
| | | return new ViewHolderEmpty(emptyView); |
| | | } else { |
| | | QiheLineItemUserBinding binding = DataBindingUtil.inflate((LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE), R.layout.qihe_line_item_user, parent, false); |
| | | |
| | | return new ViewHolder(binding); |
| | | } |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) { |
| | | if (holder instanceof ViewHolder) { |
| | | if (records.size() > 0) { |
| | | try { |
| | | ((ViewHolder) holder).getBinding().userName.setText(records.get(position).getPeasantName()); |
| | | ((ViewHolder) holder).getBinding().cardID.setText(records.get(position).getPeasantIdNumber()); |
| | | ((ViewHolder) holder).getBinding().phone.setText(records.get(position).getPeasantPhone()); |
| | | ((ViewHolder) holder).getBinding().address.setText(records.get(position).getAdcdName()); |
| | | ((ViewHolder) holder).getBinding().state.setText(records.get(position).getState() == 0 ? "未启用" : "启用"); |
| | | ((ViewHolder) holder).getBinding().item.setOnClickListener(v -> onItemClickListener.onItemClick(position)); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public int getItemCount() { |
| | | //同时这里也需要添加判断,如果mData.size()为0的话,只引入一个布局,就是emptyView |
| | | // 那么,这个recyclerView的itemCount为1 |
| | | if (records.size() == 0) { |
| | | return 1; |
| | | } |
| | | return records.size(); |
| | | } |
| | | |
| | | @Override |
| | | public int getItemViewType(int position) { |
| | | if (records.size() == 0) { |
| | | return VIEW_TYPE_EMPTY; |
| | | } else { |
| | | return VIEW_TYPE_ITEM; |
| | | } |
| | | } |
| | | |
| | | |
| | | static class ViewHolder extends RecyclerView.ViewHolder { |
| | | QiheLineItemUserBinding mBinding; |
| | | |
| | | public QiheLineItemUserBinding getBinding() { |
| | | return mBinding; |
| | | } |
| | | |
| | | public void setBinding(QiheLineItemUserBinding binding) { |
| | | this.mBinding = binding; |
| | | } |
| | | |
| | | public ViewHolder(QiheLineItemUserBinding itemView) { |
| | | super(itemView.getRoot()); |
| | | this.mBinding = itemView; |
| | | |
| | | } |
| | | } |
| | | } |
| | | |
| New file |
| | |
| | | package com.dayu.qiheonlinelibrary.bean; |
| | | |
| | | /** |
| | | * author: zuo |
| | | * Date: 2024-08-05 |
| | | * Time: 16:13 |
| | | * 备注: |
| | | */ |
| | | public class AddUserResult { |
| | | // {"state":1,"updatedTime":"2024-08-05 16:12:29","accountType":0,"planId":"","preRechargeMoney":0.00,"adcdName":"焦庙村委会","iccardBalanceMoney":"","updatedBy":"1816297106145103873","peasantType":"","compensateMoney":0.00,"createdTime":"2024-08-05 16:12:29","refunds":0.00,"peasantId":"1820372286394867713","priceType":"","createdBy":"1816297106145103873","adcd":"371425102301","peasantIdNumber":"130107199210160023","peasantCode":"37142510230100013","peasantName":"测试","peasantPhone":"15802220723","contractedLandArea":"","address":"","planName":""} |
| | | |
| | | |
| | | public String peasantId; |
| | | |
| | | public String getPeasantId() { |
| | | return peasantId; |
| | | } |
| | | |
| | | public void setPeasantId(String peasantId) { |
| | | this.peasantId = peasantId; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.dayu.qiheonlinelibrary.bean; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * author: zuo |
| | | * Date: 2024-08-08 |
| | | * Time: 14:43 |
| | | * 备注: |
| | | */ |
| | | public class CardInfoListResult { |
| | | |
| | | int total;//总数 |
| | | |
| | | int pages; |
| | | |
| | | int size; |
| | | |
| | | List<Records> records; |
| | | |
| | | public int getTotal() { |
| | | return total; |
| | | } |
| | | |
| | | public void setTotal(int total) { |
| | | this.total = total; |
| | | } |
| | | |
| | | public int getPages() { |
| | | return pages; |
| | | } |
| | | |
| | | public void setPages(int pages) { |
| | | this.pages = pages; |
| | | } |
| | | |
| | | public int getSize() { |
| | | return size; |
| | | } |
| | | |
| | | public void setSize(int size) { |
| | | this.size = size; |
| | | } |
| | | |
| | | public List<Records> getRecords() { |
| | | return records; |
| | | } |
| | | |
| | | public void setRecords(List<Records> records) { |
| | | this.records = records; |
| | | } |
| | | |
| | | public class Records { |
| | | String iccardInfoId;//ic卡信息id |
| | | String iccardNum;//实体卡号 |
| | | |
| | | String totalRechargeMoney;//累计充值金额(元) |
| | | |
| | | int iccardStatus;//ic卡状态 0 正常 1 已注销 2 已挂失 |
| | | String peasantId;//用户id |
| | | |
| | | String yearRechargeMoney;// 本年充值金额 |
| | | |
| | | String lastRechargeTime; |
| | | |
| | | |
| | | String iccardOpenTime;//用户开卡id |
| | | |
| | | |
| | | String iccardBalanceMoney;//卡内剩余金额(元) |
| | | |
| | | String iccardCode;//用户卡号(写在卡里的用户编号) |
| | | |
| | | String iccardBalanceElectric;// 卡内剩余电量 |
| | | |
| | | public String getIccardBalanceElectric() { |
| | | return iccardBalanceElectric; |
| | | } |
| | | |
| | | public void setIccardBalanceElectric(String iccardBalanceElectric) { |
| | | this.iccardBalanceElectric = iccardBalanceElectric; |
| | | } |
| | | |
| | | public String getIccardInfoId() { |
| | | return iccardInfoId; |
| | | } |
| | | |
| | | public void setIccardInfoId(String iccardInfoId) { |
| | | this.iccardInfoId = iccardInfoId; |
| | | } |
| | | |
| | | public String getIccardNum() { |
| | | return iccardNum; |
| | | } |
| | | |
| | | public void setIccardNum(String iccardNum) { |
| | | this.iccardNum = iccardNum; |
| | | } |
| | | |
| | | public String getTotalRechargeMoney() { |
| | | return totalRechargeMoney; |
| | | } |
| | | |
| | | public void setTotalRechargeMoney(String totalRechargeMoney) { |
| | | this.totalRechargeMoney = totalRechargeMoney; |
| | | } |
| | | |
| | | public int getIccardStatus() { |
| | | return iccardStatus; |
| | | } |
| | | |
| | | public void setIccardStatus(int iccardStatus) { |
| | | this.iccardStatus = iccardStatus; |
| | | } |
| | | |
| | | public String getPeasantId() { |
| | | return peasantId; |
| | | } |
| | | |
| | | public void setPeasantId(String peasantId) { |
| | | this.peasantId = peasantId; |
| | | } |
| | | |
| | | public String getYearRechargeMoney() { |
| | | return yearRechargeMoney; |
| | | } |
| | | |
| | | public void setYearRechargeMoney(String yearRechargeMoney) { |
| | | this.yearRechargeMoney = yearRechargeMoney; |
| | | } |
| | | |
| | | public String getLastRechargeTime() { |
| | | return lastRechargeTime; |
| | | } |
| | | |
| | | public void setLastRechargeTime(String lastRechargeTime) { |
| | | this.lastRechargeTime = lastRechargeTime; |
| | | } |
| | | |
| | | public String getIccardOpenTime() { |
| | | return iccardOpenTime; |
| | | } |
| | | |
| | | public void setIccardOpenTime(String iccardOpenTime) { |
| | | this.iccardOpenTime = iccardOpenTime; |
| | | } |
| | | |
| | | public String getIccardBalanceMoney() { |
| | | return iccardBalanceMoney; |
| | | } |
| | | |
| | | public void setIccardBalanceMoney(String iccardBalanceMoney) { |
| | | this.iccardBalanceMoney = iccardBalanceMoney; |
| | | } |
| | | |
| | | public String getIccardCode() { |
| | | return iccardCode; |
| | | } |
| | | |
| | | public void setIccardCode(String iccardCode) { |
| | | this.iccardCode = iccardCode; |
| | | } |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.dayu.qiheonlinelibrary.bean; |
| | | |
| | | /** |
| | | * author: zuo |
| | | * Date: 2024-08-06 |
| | | * Time: 16:51 |
| | | * 备注:通过实体卡号查询到的信息 |
| | | */ |
| | | public class CardInfoResult { |
| | | //{"chargeMethod":"","iccardCancelTime":"","lastRechargeTime":"2024-08-06 15:21:59","thisSaleMoney":"","totalRechargeWaterAmount":0.00,"iccardBalanceAmonunt":0.00,"iccardInfoId":"1820721965431267330","iccardProtocolName":"","totalRechargeElectricAmount":0.00,"logicState":1,"username":"","state":1,"familySize":"","yearRechargeMoney":0.00,"thisSaleAmount":"","onlyRechargeMoney":"","identityCard":"","iccardBrand":"","iccardBalanceMoney":0.00,"openOperatorUsername":"","adName":"","rechargeWaterAmount":"","openOperatorUserId":"1816297106145103873","lastSwipeTime":"","address":"","yearCompensateMoney":0.00,"iccardProtocolOpenMoney":"","peasantId":"1820374742679953410","reissueTimes":0,"iccardProtocolReissueMoney":"","iccardProtocolId":"","yearRechargeWaterAmount":0.00,"iccardBalanceElectric":0.00,"iccardStatus":0,"phone":"","lastRechargeMoney":0.00,"iccardOpenTime":"2024-08-06 15:21:59","yearRechargeElectricAmount":0.00,"reissueRechargeRecordId":"","iccardPrice":1.50,"iccardNum":"3714251023011","accountType":0,"equipCode":"","rechargeWaterMoney":"","totalRechargeMoney":0.00,"executeWaterPrice":"","iccardType":1,"iccardCode":"4440DABA"} |
| | | |
| | | int iccardStatus;//ic卡状态 0 正常 1 已注销 2 已挂失 |
| | | String peasantId;//用户id |
| | | float totalRechargeMoney;// 累计充值金额 |
| | | float yearRechargeMoney;// 本年充值金额 |
| | | |
| | | String lastRechargeTime; |
| | | |
| | | String iccardInfoId;//ic卡平台id |
| | | |
| | | String iccardOpenTime;//用户开卡id |
| | | |
| | | float iccardBalanceMoney;//卡内剩余金额(元) |
| | | String iccardCode;//用户卡号(写在卡里的用户编号) |
| | | |
| | | String peasantName;//用户名称 |
| | | |
| | | String peasantIdNumber;//身份证号 |
| | | |
| | | String peasantPhone;//手机号 |
| | | |
| | | String iccardBalanceElectric;// 卡内剩余电量 |
| | | |
| | | public String getIccardBalanceElectric() { |
| | | return iccardBalanceElectric; |
| | | } |
| | | |
| | | public void setIccardBalanceElectric(String iccardBalanceElectric) { |
| | | this.iccardBalanceElectric = iccardBalanceElectric; |
| | | } |
| | | |
| | | public String getPeasantName() { |
| | | return peasantName; |
| | | } |
| | | |
| | | public void setPeasantName(String peasantName) { |
| | | this.peasantName = peasantName; |
| | | } |
| | | |
| | | public String getPeasantIdNumber() { |
| | | return peasantIdNumber; |
| | | } |
| | | |
| | | public void setPeasantIdNumber(String peasantIdNumber) { |
| | | this.peasantIdNumber = peasantIdNumber; |
| | | } |
| | | |
| | | public String getPeasantPhone() { |
| | | return peasantPhone; |
| | | } |
| | | |
| | | public void setPeasantPhone(String peasantPhone) { |
| | | this.peasantPhone = peasantPhone; |
| | | } |
| | | |
| | | public String getIccardCode() { |
| | | return iccardCode; |
| | | } |
| | | |
| | | public void setIccardCode(String iccardCode) { |
| | | this.iccardCode = iccardCode; |
| | | } |
| | | |
| | | public float getIccardBalanceMoney() { |
| | | return iccardBalanceMoney; |
| | | } |
| | | |
| | | public void setIccardBalanceMoney(float iccardBalanceMoney) { |
| | | this.iccardBalanceMoney = iccardBalanceMoney; |
| | | } |
| | | |
| | | public int getIccardStatus() { |
| | | return iccardStatus; |
| | | } |
| | | |
| | | public void setIccardStatus(int iccardStatus) { |
| | | this.iccardStatus = iccardStatus; |
| | | } |
| | | |
| | | public String getPeasantId() { |
| | | return peasantId; |
| | | } |
| | | |
| | | public void setPeasantId(String peasantId) { |
| | | this.peasantId = peasantId; |
| | | } |
| | | |
| | | public float getTotalRechargeMoney() { |
| | | return totalRechargeMoney; |
| | | } |
| | | |
| | | public void setTotalRechargeMoney(float totalRechargeMoney) { |
| | | this.totalRechargeMoney = totalRechargeMoney; |
| | | } |
| | | |
| | | public float getYearRechargeMoney() { |
| | | return yearRechargeMoney; |
| | | } |
| | | |
| | | public void setYearRechargeMoney(float yearRechargeMoney) { |
| | | this.yearRechargeMoney = yearRechargeMoney; |
| | | } |
| | | |
| | | public String getLastRechargeTime() { |
| | | return lastRechargeTime; |
| | | } |
| | | |
| | | public void setLastRechargeTime(String lastRechargeTime) { |
| | | this.lastRechargeTime = lastRechargeTime; |
| | | } |
| | | |
| | | public String getIccardInfoId() { |
| | | return iccardInfoId; |
| | | } |
| | | |
| | | public void setIccardInfoId(String iccardInfoId) { |
| | | this.iccardInfoId = iccardInfoId; |
| | | } |
| | | |
| | | public String getIccardOpenTime() { |
| | | return iccardOpenTime; |
| | | } |
| | | |
| | | public void setIccardOpenTime(String iccardOpenTime) { |
| | | this.iccardOpenTime = iccardOpenTime; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.dayu.qiheonlinelibrary.bean; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * author: zuo |
| | | * Date: 2024-07-30 |
| | | * Time: 16:06 |
| | | * 备注: |
| | | */ |
| | | public class LoginResult { |
| | | //{"code":"0","msg":"操作成功","data":{"chargeMethod":"","iccardCancelTime":"","lastRechargeTime":"2024-08-05 17:04:15","thisSaleMoney":"","totalRechargeWaterAmount":0.00,"iccardBalanceAmonunt":0.00,"iccardInfoId":"1820385315354320898","iccardProtocolName":"","totalRechargeElectricAmount":0.00,"logicState":1,"username":"","state":1,"familySize":"","yearRechargeMoney":0.00,"thisSaleAmount":"","onlyRechargeMoney":"","identityCard":"","iccardBrand":"","iccardBalanceMoney":0.00,"openOperatorUsername":"","adName":"","rechargeWaterAmount":"","openOperatorUserId":"1816297106145103873","lastSwipeTime":"","address":"","yearCompensateMoney":0.00,"iccardProtocolOpenMoney":"","peasantId":"1820374742679953410","reissueTimes":0,"iccardProtocolReissueMoney":"","iccardProtocolId":"","yearRechargeWaterAmount":0.00,"iccardBalanceElectric":0.00,"iccardStatus":0,"phone":"","lastRechargeMoney":0.00,"iccardOpenTime":"","yearRechargeElectricAmount":0.00,"reissueRechargeRecordId":"","iccardPrice":1.50,"iccardNum":"3714251023011","accountType":0,"equipCode":"","rechargeWaterMoney":"","totalRechargeMoney":0.00,"executeWaterPrice":"","iccardType":1,"iccardCode":"BADA4044"}} |
| | | |
| | | |
| | | OtherData otherData; |
| | | |
| | | public OtherData getOtherData() { |
| | | return otherData; |
| | | } |
| | | |
| | | public void setOtherData(OtherData otherData) { |
| | | this.otherData = otherData; |
| | | } |
| | | |
| | | public class OtherData { |
| | | List<String> adcdList;//该用户的地址编码 |
| | | String tenantAdnm;//县名称 |
| | | List<String> adnmList;//村委会名称 |
| | | |
| | | public List<String> getAdcdList() { |
| | | return adcdList; |
| | | } |
| | | |
| | | public void setAdcdList(List<String> adcdList) { |
| | | this.adcdList = adcdList; |
| | | } |
| | | |
| | | public String getTenantAdnm() { |
| | | return tenantAdnm; |
| | | } |
| | | |
| | | public void setTenantAdnm(String tenantAdnm) { |
| | | this.tenantAdnm = tenantAdnm; |
| | | } |
| | | |
| | | public List<String> getAdnmList() { |
| | | return adnmList; |
| | | } |
| | | |
| | | public void setAdnmList(List<String> adnmList) { |
| | | this.adnmList = adnmList; |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.dayu.qiheonlinelibrary.bean; |
| | | |
| | | /** |
| | | * author: zuo |
| | | * Date: 2024-08-05 |
| | | * Time: 16:23 |
| | | * 备注: |
| | | */ |
| | | public class OpenCardResult { |
| | | // {"code":"0","msg":"操作成功","data":{"iccardBalanceMoney":0,"lastSwipeTime":"","rechargeOperatorUsername":"","rechargeType":0,"iccardCode":"3714251023010002","rechargeCallbackType":"","iccardNum":"","lastRechargeTime":"","iccardBalanceAmonunt":0,"thisSaleAmount":"","remark":"待写卡,开卡交易中","username":"","rechargeRecordNum":"1821459146525384704","totalRechargeMoney":"","iccardType":"","reissueTimes":"","yearRechargeElectricAmount":"","rechargeWaterAmount":"","iccardRechargeRecordId":"1821459146567327745","rechargeOperatorUserId":"1816297106145103873","chargeMethod":"","yearRechargeMoney":"","rechargeElectricAmount":"","iccardProtocolName":"","equipCode":"","thisSaleMoney":"","iccardBalanceElectric":"","rechargeCardMoney":5,"peasantId":"1821458177314004994","totalRechargeElectricAmount":"","rechargeStatus":1,"writeCardStatus":1,"lastRechargeMoney":"","totalRechargeWaterAmount":"","executeWaterPrice":"","adName":"","yearCompensateMoney":"","iccardBrand":"","rechargeWaterMoney":"","yearRechargeWaterAmount":"","rechargeMoney":5,"iccardInfoId":"1821459146349223937","rechargeTime":"","iccardPrice":1.50016}} |
| | | |
| | | String iccardRechargeRecordId;//ic卡交易记录id |
| | | |
| | | String iccardCode;//平台生成的存在卡内的用户编号 |
| | | |
| | | public String getIccardCode() { |
| | | return iccardCode; |
| | | } |
| | | |
| | | public void setIccardCode(String iccardCode) { |
| | | this.iccardCode = iccardCode; |
| | | } |
| | | |
| | | public String getIccardRechargeRecordId() { |
| | | return iccardRechargeRecordId; |
| | | } |
| | | |
| | | public void setIccardRechargeRecordId(String iccardRechargeRecordId) { |
| | | this.iccardRechargeRecordId = iccardRechargeRecordId; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.dayu.qiheonlinelibrary.bean; |
| | | |
| | | import com.dayu.baselibrary.utils.MornyUtil; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * author: zuo |
| | | * Date: 2024-08-05 |
| | | * Time: 16:00 |
| | | * 备注:水价管理列表 |
| | | */ |
| | | public class PricePlanResult { |
| | | |
| | | // { |
| | | // "code": "0", |
| | | // "msg": "操作成功", |
| | | // "data": { |
| | | // "records": [ |
| | | // { |
| | | // "priceMethod": 2, |
| | | // "priceTypeName": "按户阶梯水价", |
| | | // "cardManagementFee": 5, |
| | | // "itemList": [ |
| | | // { |
| | | // "ladder": 1, |
| | | // "planId": "1816390728315052033", |
| | | // "updatedTime": "2024-07-25 16:31:11", |
| | | // "ladderName": "第一阶梯", |
| | | // "logicState": 1, |
| | | // "price": 0, |
| | | // "planItemId": "1816390728386355201", |
| | | // "createdBy": "1761933307362938881", |
| | | // "tenantId": "1761933241344593922", |
| | | // "waterPrice": "", |
| | | // "endWaterVolume": 0, |
| | | // "createdTime": "2024-07-25 16:31:11", |
| | | // "updatedBy": "1761933307362938881", |
| | | // "initialWaterVolume": 0 |
| | | // }, |
| | | // { |
| | | // "ladder": 2, |
| | | // "planId": "1816390728315052033", |
| | | // "updatedTime": "2024-07-25 16:31:11", |
| | | // "ladderName": "第二阶梯", |
| | | // "logicState": 1, |
| | | // "price": 0, |
| | | // "planItemId": "1816390728407326722", |
| | | // "createdBy": "1761933307362938881", |
| | | // "tenantId": "1761933241344593922", |
| | | // "waterPrice": "", |
| | | // "endWaterVolume": "", |
| | | // "createdTime": "2024-07-25 16:31:11", |
| | | // "updatedBy": "1761933307362938881", |
| | | // "initialWaterVolume": 0 |
| | | // }, |
| | | // { |
| | | // "ladder": 3, |
| | | // "planId": "1816390728315052033", |
| | | // "updatedTime": "2024-07-25 16:31:11", |
| | | // "ladderName": "第三阶梯", |
| | | // "logicState": 1, |
| | | // "price": 0, |
| | | // "planItemId": "1816390728415715330", |
| | | // "createdBy": "1761933307362938881", |
| | | // "tenantId": "1761933241344593922", |
| | | // "waterPrice": "", |
| | | // "endWaterVolume": "", |
| | | // "createdTime": "2024-07-25 16:31:11", |
| | | // "updatedBy": "1761933307362938881", |
| | | // "initialWaterVolume": 0 |
| | | // } |
| | | // ], |
| | | // "weratio": 4.688, |
| | | // "cropTypeName": "", |
| | | // "unitPrice": 0.32, |
| | | // "planId": "1816390728315052033", |
| | | // "adnm": "齐河县", |
| | | // "cropType": "", |
| | | // "state": 1, |
| | | // "adId": "371425000000", |
| | | // "priceType": 2, |
| | | // "createdTime": "2024-07-25 16:31:11", |
| | | // "planName": "基础水价" |
| | | // } |
| | | // ], |
| | | // "total": "1", |
| | | // "size": "50", |
| | | // "current": "1", |
| | | // "orders": [ |
| | | // |
| | | // ], |
| | | // "optimizeCountSql": true, |
| | | // "searchCount": true, |
| | | // "countId": "", |
| | | // "maxLimit": "", |
| | | // "pages": "1" |
| | | // } |
| | | // } |
| | | |
| | | |
| | | int total; |
| | | int pages; |
| | | int size; |
| | | |
| | | |
| | | List<Records> records; |
| | | |
| | | public int getTotal() { |
| | | return total; |
| | | } |
| | | |
| | | public void setTotal(int total) { |
| | | this.total = total; |
| | | } |
| | | |
| | | public int getPages() { |
| | | return pages; |
| | | } |
| | | |
| | | public void setPages(int pages) { |
| | | this.pages = pages; |
| | | } |
| | | |
| | | public int getSize() { |
| | | return size; |
| | | } |
| | | |
| | | public void setSize(int size) { |
| | | this.size = size; |
| | | } |
| | | |
| | | public List<Records> getRecords() { |
| | | return records; |
| | | } |
| | | |
| | | public void setRecords(List<Records> records) { |
| | | this.records = records; |
| | | } |
| | | |
| | | public class Records { |
| | | String planId; |
| | | |
| | | float weratio;//水价 乘以系数得出电价 |
| | | float unitPrice;//系数 |
| | | |
| | | public String getElectricityPrice() { |
| | | try { |
| | | return MornyUtil.multiplyPrice(weratio, unitPrice); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return ""; |
| | | } |
| | | |
| | | public String getPlanId() { |
| | | return planId; |
| | | } |
| | | |
| | | public void setPlanId(String planId) { |
| | | this.planId = planId; |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.dayu.qiheonlinelibrary.bean; |
| | | |
| | | /** |
| | | * author: zuo |
| | | * Date: 2024-08-07 |
| | | * Time: 11:08 |
| | | * 备注: |
| | | */ |
| | | public class RechargeResult { |
| | | //{"iccardBalanceMoney":2,"lastSwipeTime":"","rechargeOperatorUsername":"","rechargeType":1,"iccardCode":"4440DABA","rechargeCallbackType":"","iccardNum":"","lastRechargeTime":"","iccardBalanceAmonunt":6.25,"thisSaleAmount":"","remark":"待写卡,充值交易中","username":"","rechargeRecordNum":"1821020394581663744","totalRechargeMoney":0.00,"iccardType":"","reissueTimes":"","yearRechargeElectricAmount":0.00,"rechargeWaterAmount":6.25,"iccardRechargeRecordId":"1821020394594246658","rechargeOperatorUserId":"1816297106145103873","chargeMethod":"","yearRechargeMoney":0.00,"rechargeElectricAmount":1.33,"iccardProtocolName":"","equipCode":"","thisSaleMoney":"","iccardBalanceElectric":1.33,"rechargeCardMoney":"","peasantId":"1820374742679953410","totalRechargeElectricAmount":0.00,"rechargeStatus":1,"writeCardStatus":1,"lastRechargeMoney":"","totalRechargeWaterAmount":0.00,"executeWaterPrice":"","adName":"","yearCompensateMoney":"","iccardBrand":"","rechargeWaterMoney":2,"yearRechargeWaterAmount":0.00,"rechargeMoney":2,"iccardInfoId":"","rechargeTime":"","iccardPrice":1.50} |
| | | |
| | | String iccardBalanceMoney;//卡内剩余金额(元) |
| | | |
| | | float totalRechargeMoney;// 累计充值金额 |
| | | |
| | | float yearRechargeMoney;// 本年充值金额 |
| | | |
| | | float rechargeElectricAmount;//交易电量 |
| | | |
| | | float iccardBalanceElectric;//卡内剩余电量 |
| | | |
| | | String iccardRechargeRecordId;//订单号 |
| | | |
| | | public String getIccardBalanceMoney() { |
| | | return iccardBalanceMoney; |
| | | } |
| | | |
| | | public void setIccardBalanceMoney(String iccardBalanceMoney) { |
| | | this.iccardBalanceMoney = iccardBalanceMoney; |
| | | } |
| | | |
| | | public float getTotalRechargeMoney() { |
| | | return totalRechargeMoney; |
| | | } |
| | | |
| | | public void setTotalRechargeMoney(float totalRechargeMoney) { |
| | | this.totalRechargeMoney = totalRechargeMoney; |
| | | } |
| | | |
| | | public float getYearRechargeMoney() { |
| | | return yearRechargeMoney; |
| | | } |
| | | |
| | | public void setYearRechargeMoney(float yearRechargeMoney) { |
| | | this.yearRechargeMoney = yearRechargeMoney; |
| | | } |
| | | |
| | | public float getRechargeElectricAmount() { |
| | | return rechargeElectricAmount; |
| | | } |
| | | |
| | | public void setRechargeElectricAmount(float rechargeElectricAmount) { |
| | | this.rechargeElectricAmount = rechargeElectricAmount; |
| | | } |
| | | |
| | | public float getIccardBalanceElectric() { |
| | | return iccardBalanceElectric; |
| | | } |
| | | |
| | | public void setIccardBalanceElectric(float iccardBalanceElectric) { |
| | | this.iccardBalanceElectric = iccardBalanceElectric; |
| | | } |
| | | |
| | | public String getIccardRechargeRecordId() { |
| | | return iccardRechargeRecordId; |
| | | } |
| | | |
| | | public void setIccardRechargeRecordId(String iccardRechargeRecordId) { |
| | | this.iccardRechargeRecordId = iccardRechargeRecordId; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.dayu.qiheonlinelibrary.bean; |
| | | |
| | | /** |
| | | * author: zuo |
| | | * Date: 2024-08-09 |
| | | * Time: 16:29 |
| | | * 备注:补卡返回参数 |
| | | */ |
| | | public class ReplaceCardResult { |
| | | //{"code":"0","msg":"操作成功","data":{"iccardBalanceMoney":5.00,"lastSwipeTime":"","rechargeOperatorUsername":"","rechargeType":0,"iccardCode":"3714251023010005","rechargeCallbackType":"","iccardNum":"","lastRechargeTime":"","iccardBalanceAmonunt":15.63,"thisSaleAmount":"","remark":"待写卡,补卡开卡交易中","username":"","rechargeRecordNum":"1821825921016406016","totalRechargeMoney":"","iccardType":"","reissueTimes":"","yearRechargeElectricAmount":"","rechargeWaterAmount":"","iccardRechargeRecordId":"1821825921020600321","rechargeOperatorUserId":"1816297106145103873","chargeMethod":"","yearRechargeMoney":"","rechargeElectricAmount":"","iccardProtocolName":"","equipCode":"","thisSaleMoney":"","iccardBalanceElectric":3.33,"rechargeCardMoney":4,"peasantId":"1821458177314004994","totalRechargeElectricAmount":"","rechargeStatus":1,"writeCardStatus":1,"lastRechargeMoney":"","totalRechargeWaterAmount":"","executeWaterPrice":"","adName":"","yearCompensateMoney":"","iccardBrand":"","rechargeWaterMoney":"","yearRechargeWaterAmount":"","rechargeMoney":4,"iccardInfoId":"1821825920739581954","rechargeTime":"","iccardPrice":1.50}} |
| | | |
| | | |
| | | String iccardBalanceMoney;//卡内剩余金额(元) |
| | | String iccardBalanceElectric;//卡内剩余电量 |
| | | |
| | | String iccardCode;//用户卡号(写在卡里的用户编号) |
| | | String totalRechargeMoney;//累计充值金额(元) |
| | | |
| | | String lastRechargeTime;//最后充值时间 |
| | | |
| | | String iccardRechargeRecordId;//ic卡交易记录id |
| | | |
| | | public String getIccardRechargeRecordId() { |
| | | return iccardRechargeRecordId; |
| | | } |
| | | |
| | | public void setIccardRechargeRecordId(String iccardRechargeRecordId) { |
| | | this.iccardRechargeRecordId = iccardRechargeRecordId; |
| | | } |
| | | |
| | | public String getIccardBalanceMoney() { |
| | | return iccardBalanceMoney; |
| | | } |
| | | |
| | | public void setIccardBalanceMoney(String iccardBalanceMoney) { |
| | | this.iccardBalanceMoney = iccardBalanceMoney; |
| | | } |
| | | |
| | | public String getIccardBalanceElectric() { |
| | | return iccardBalanceElectric; |
| | | } |
| | | |
| | | public void setIccardBalanceElectric(String iccardBalanceElectric) { |
| | | this.iccardBalanceElectric = iccardBalanceElectric; |
| | | } |
| | | |
| | | public String getIccardCode() { |
| | | return iccardCode; |
| | | } |
| | | |
| | | public void setIccardCode(String iccardCode) { |
| | | this.iccardCode = iccardCode; |
| | | } |
| | | |
| | | public String getTotalRechargeMoney() { |
| | | return totalRechargeMoney; |
| | | } |
| | | |
| | | public void setTotalRechargeMoney(String totalRechargeMoney) { |
| | | this.totalRechargeMoney = totalRechargeMoney; |
| | | } |
| | | |
| | | public String getLastRechargeTime() { |
| | | return lastRechargeTime; |
| | | } |
| | | |
| | | public void setLastRechargeTime(String lastRechargeTime) { |
| | | this.lastRechargeTime = lastRechargeTime; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.dayu.qiheonlinelibrary.bean; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * author: zuo |
| | | * Date: 2024-07-31 |
| | | * Time: 15:28 |
| | | * 备注: |
| | | */ |
| | | public class UserListResult { |
| | | |
| | | int total;//总数 |
| | | |
| | | int pages; |
| | | |
| | | int size; |
| | | |
| | | List<Records> records; |
| | | |
| | | public List<Records> getRecords() { |
| | | return records; |
| | | } |
| | | |
| | | public void setRecords(List<Records> records) { |
| | | this.records = records; |
| | | } |
| | | |
| | | public class Records { |
| | | String peasantId; |
| | | String peasantName;//用户名称 |
| | | String peasantIdNumber;//用户身份证号 |
| | | String peasantPhone;//手机号 |
| | | String adcd;//地址码 |
| | | String adcdName;//地址:焦庙村委会 |
| | | int state;//状态 0 未启用 1 启用 |
| | | |
| | | public String getPeasantName() { |
| | | return peasantName; |
| | | } |
| | | |
| | | public void setPeasantName(String peasantName) { |
| | | this.peasantName = peasantName; |
| | | } |
| | | |
| | | public String getPeasantIdNumber() { |
| | | return peasantIdNumber; |
| | | } |
| | | |
| | | public void setPeasantIdNumber(String peasantIdNumber) { |
| | | this.peasantIdNumber = peasantIdNumber; |
| | | } |
| | | |
| | | public String getPeasantPhone() { |
| | | return peasantPhone; |
| | | } |
| | | |
| | | public void setPeasantPhone(String peasantPhone) { |
| | | this.peasantPhone = peasantPhone; |
| | | } |
| | | |
| | | public String getAdcd() { |
| | | return adcd; |
| | | } |
| | | |
| | | public void setAdcd(String adcd) { |
| | | this.adcd = adcd; |
| | | } |
| | | |
| | | public String getAdcdName() { |
| | | return adcdName; |
| | | } |
| | | |
| | | public void setAdcdName(String adcdName) { |
| | | this.adcdName = adcdName; |
| | | } |
| | | |
| | | public int getState() { |
| | | return state; |
| | | } |
| | | |
| | | public void setState(int state) { |
| | | this.state = state; |
| | | } |
| | | |
| | | public String getPeasantId() { |
| | | return peasantId; |
| | | } |
| | | |
| | | public void setPeasantId(String peasantId) { |
| | | this.peasantId = peasantId; |
| | | } |
| | | } |
| | | |
| | | public int getPages() { |
| | | return pages; |
| | | } |
| | | |
| | | public void setPages(int pages) { |
| | | this.pages = pages; |
| | | } |
| | | |
| | | public int getSize() { |
| | | return size; |
| | | } |
| | | |
| | | public void setSize(int size) { |
| | | this.size = size; |
| | | } |
| | | |
| | | public int getTotal() { |
| | | return total; |
| | | } |
| | | |
| | | public void setTotal(int total) { |
| | | this.total = total; |
| | | } |
| | | } |
| | |
| | | |
| | | public String cardType = CardCommon.REGION;//卡命令 |
| | | |
| | | public int region;//区域地址(低前高后) 可以识别某县镇村 |
| | | |
| | | public int controllerCodel;// 控制器编号(低前高后) 本区域内控制器编号 |
| | | public int arerNumber;//区域号(底位在前高位在后) |
| | | |
| | | |
| | | public int getRegion() { |
| | | return region; |
| | | public int getArerNumber() { |
| | | return arerNumber; |
| | | } |
| | | |
| | | public void setRegion(int region) { |
| | | this.region = region; |
| | | } |
| | | |
| | | public int getControllerCodel() { |
| | | return controllerCodel; |
| | | } |
| | | |
| | | public void setControllerCodel(int controllerCodel) { |
| | | this.controllerCodel = controllerCodel; |
| | | public void setArerNumber(int arerNumber) { |
| | | this.arerNumber = arerNumber; |
| | | } |
| | | |
| | | public byte[] toByte() { |
| | |
| | | byte[] zero = data.get(0); |
| | | regionCard.cardType = HexUtil.byteToHex(zero[0]); |
| | | |
| | | byte[] regionByte = new byte[2]; |
| | | System.arraycopy(zero, 1, regionByte, 0, regionByte.length); |
| | | regionCard.region = HexUtil.get16To10LowHightByBytes(regionByte); |
| | | |
| | | |
| | | byte[] controllerCodelByte = new byte[2]; |
| | | System.arraycopy(zero, 3, controllerCodelByte, 0, controllerCodelByte.length); |
| | | regionCard.controllerCodel = HexUtil.get16To10LowHightByBytes(controllerCodelByte); |
| | | byte[] arerNumberByte = new byte[4]; |
| | | System.arraycopy(zero, 1, arerNumberByte, 0, arerNumberByte.length); |
| | | regionCard.arerNumber = HexUtil.get16To10LowHightByBytes(arerNumberByte); |
| | | |
| | | |
| | | return regionCard; |
| | |
| | | public byte[] toByte() { |
| | | byte[] data = new byte[16]; |
| | | data[0] = HexUtil.hexToByte(cardType); |
| | | byte[] regionBytes = new byte[2]; |
| | | byte[] regionDatas = HexUtil.hexToByteArray(HexUtil.get10To16LowHigh(region)); |
| | | System.arraycopy(regionDatas, 0, regionBytes, 0, regionDatas.length); |
| | | if (regionBytes != null) { |
| | | System.arraycopy(regionBytes, 0, data, 1, regionBytes.length); |
| | | //区域号 |
| | | byte[] arerNumberBytes = new byte[4]; |
| | | byte[] arerNumberDatas = HexUtil.hexToByteArray(HexUtil.get10To16LowHigh(arerNumber)); |
| | | System.arraycopy(arerNumberDatas, 0, arerNumberBytes, 0, arerNumberDatas.length); |
| | | if (arerNumberBytes != null) { |
| | | System.arraycopy(arerNumberBytes, 0, data, 1, arerNumberBytes.length); |
| | | } |
| | | byte[] controllerCodelBytes = new byte[2]; |
| | | byte[] controllerCodelDatas = HexUtil.hexToByteArray(HexUtil.get10To16LowHigh(controllerCodel)); |
| | | System.arraycopy(controllerCodelDatas, 0, controllerCodelBytes, 0, controllerCodelDatas.length); |
| | | if (controllerCodelBytes != null) { |
| | | System.arraycopy(controllerCodelBytes, 0, data, 3, controllerCodelBytes.length); |
| | | } |
| | | |
| | | |
| | | data[15] = getByteSum(data); |
| | | return data; |
| | | } |
| | |
| | | package com.dayu.qiheonlinelibrary.card; |
| | | |
| | | import com.dayu.baselibrary.tools.BcdUtil; |
| | | import com.dayu.baselibrary.tools.HexUtil; |
| | | |
| | | import com.dayu.qiheonlinelibrary.utils.CardCommon; |
| | |
| | | |
| | | public int arerNumber;//区域号(底位在前高位在后) |
| | | |
| | | public int deviceNumberl;//设备编号(底位在前高位在后) |
| | | public short rechargeTimes;//充值次数 |
| | | public String userCode;//用户编号BCD省市县乡村 |
| | | |
| | | public int totalWater;//用户总用水量 底位在前,高位在后2位小数点 含两个小数点的整数 |
| | | public int userCodeNumber;//用户编号(高位在前低位在后) |
| | | |
| | | public int totalElectric;//总用电量位 底位在前,高位在后 1位小数点 含1位小数点的整数 |
| | | public int cardWriteState;//管理卡返写机制 00:中心写01:控制器返写 |
| | | |
| | | public int cardState;//现场卡状态 00:旧卡 01:新卡 |
| | | |
| | | public int balance;//剩余金额 底位在前 2位小数点,单位分 |
| | | |
| | | public int surplusWater;//剩余水量 底位在前 2位小数点 单位立方米 (跟价格一样先乘以100) |
| | | public int surplusElecticity;//剩余电量 底位在前 2位小数点 单位立方米 (跟价格一样先乘以100) |
| | | |
| | | public int totalMorny;//累计充值金额 |
| | | |
| | | public Calendar rechargeDate;// 购水时间 BCD |
| | | |
| | | public Float electricPrice;//电单价,保留三位小数 |
| | | |
| | | |
| | | /** |
| | |
| | | |
| | | userCard.cardType = HexUtil.byteToHex(zero[0]); |
| | | |
| | | byte[] arerNumberByte = new byte[2]; |
| | | byte[] arerNumberByte = new byte[4]; |
| | | System.arraycopy(zero, 1, arerNumberByte, 0, arerNumberByte.length); |
| | | userCard.arerNumber = HexUtil.get16To10LowHightByBytes(arerNumberByte); |
| | | |
| | | byte[] deviceNumberlByte = new byte[2]; |
| | | System.arraycopy(zero, 3, deviceNumberlByte, 0, deviceNumberlByte.length); |
| | | userCard.deviceNumberl = HexUtil.get16To10LowHightByBytes(deviceNumberlByte); |
| | | |
| | | userCard.rechargeTimes = HexUtil.hexToByte(HexUtil.byteToHex(zero[5])); |
| | | |
| | | byte[] totalWaterByte = new byte[4]; |
| | | System.arraycopy(zero, 6, totalWaterByte, 0, totalWaterByte.length); |
| | | userCard.totalWater = HexUtil.get16To10LowHightByBytes(totalWaterByte); |
| | | |
| | | byte[] totalElectricByte = new byte[4]; |
| | | System.arraycopy(zero, 10, totalElectricByte, 0, totalElectricByte.length); |
| | | userCard.totalElectric = HexUtil.get16To10LowHightByBytes(totalElectricByte); |
| | | |
| | | byte[] userCodeByte = new byte[6]; |
| | | System.arraycopy(zero, 5, userCodeByte, 0, userCodeByte.length); |
| | | userCard.userCode= BcdUtil.bcdToStr(userCodeByte); |
| | | byte[] userCodeNumber = new byte[2]; |
| | | System.arraycopy(zero, 10, userCodeNumber, 0, userCodeNumber.length); |
| | | userCard.userCodeNumber=HexUtil.get16To10LowHightByBytes(userCodeNumber); |
| | | byte[] cardWriteState = new byte[1]; |
| | | System.arraycopy(zero, 13, cardWriteState, 0, cardWriteState.length); |
| | | userCard.cardWriteState=HexUtil.get16To10LowHightByBytes(cardWriteState); |
| | | byte[] cardState = new byte[1]; |
| | | System.arraycopy(zero, 14, cardState, 0, cardState.length); |
| | | userCard.cardState=HexUtil.get16To10LowHightByBytes(cardState); |
| | | //第1块解析 |
| | | byte[] one = data.get(1); |
| | | byte[] balanceByte = new byte[4]; |
| | |
| | | |
| | | byte[] surplusWaterByte = new byte[4]; |
| | | System.arraycopy(one, 4, surplusWaterByte, 0, surplusWaterByte.length); |
| | | userCard.surplusWater = HexUtil.get16To10LowHightByBytes(surplusWaterByte); |
| | | userCard.surplusElecticity = HexUtil.get16To10LowHightByBytes(surplusWaterByte); |
| | | |
| | | byte[] totalMorny = new byte[4]; |
| | | System.arraycopy(one, 8, totalMorny, 0, totalMorny.length); |
| | | userCard.totalMorny = HexUtil.get16To10LowHightByBytes(totalMorny); |
| | | |
| | | byte[] rechargeDateByte = new byte[3]; |
| | | System.arraycopy(one, 12, rechargeDateByte, 0, rechargeDateByte.length); |
| | | |
| | | int year = HexUtil.getBcdToInt(one[12]); |
| | | int month = HexUtil.getBcdToInt(one[13]); |
| | | int day = HexUtil.getBcdToInt(one[14]); |
| | | |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.set(2000 + year, month, day, 0, 0, 0); |
| | | userCard.rechargeDate = calendar; |
| | | |
| | | byte[] two = data.get(2); |
| | | byte[] electricPriceByte = new byte[4]; |
| | | System.arraycopy(two, 8, electricPriceByte, 0, electricPriceByte.length); |
| | | userCard.electricPrice = HexUtil.hexToFloatLowHigh(electricPriceByte); |
| | | |
| | | return userCard; |
| | | |
| | |
| | | byte[] data = new byte[16]; |
| | | data[0] = HexUtil.hexToByte(cardType); |
| | | //区域号 |
| | | byte[] arerNumberBytes = new byte[2]; |
| | | byte[] arerNumberBytes = new byte[4]; |
| | | byte[] arerNumberDatas = HexUtil.hexToByteArray(HexUtil.get10To16LowHigh(arerNumber)); |
| | | System.arraycopy(arerNumberDatas, 0, arerNumberBytes, 0, arerNumberDatas.length); |
| | | if (arerNumberBytes != null) { |
| | | System.arraycopy(arerNumberBytes, 0, data, 1, arerNumberBytes.length); |
| | | } |
| | | //设备编号 |
| | | byte[] deviceNumberlBytes = new byte[2]; |
| | | byte[] deviceNumberlDatas = HexUtil.hexToByteArray(HexUtil.get10To16LowHigh(deviceNumberl)); |
| | | System.arraycopy(deviceNumberlDatas, 0, deviceNumberlBytes, 0, deviceNumberlDatas.length); |
| | | if (deviceNumberlBytes != null) { |
| | | System.arraycopy(deviceNumberlBytes, 0, data, 3, deviceNumberlBytes.length); |
| | | } |
| | | //充值次数 |
| | | byte rechargeTimesByte = HexUtil.hexToByte(HexUtil.get10to16(rechargeTimes)); |
| | | data[5] = rechargeTimesByte; |
| | | |
| | | //用户总用水量 |
| | | byte[] totalWaterBytes = new byte[4]; |
| | | byte[] totalWaterDatas = HexUtil.hexToByteArray(HexUtil.get10To16LowHigh(totalWater)); |
| | | System.arraycopy(totalWaterDatas, 0, totalWaterBytes, 0, totalWaterDatas.length); |
| | | if (totalWaterBytes != null) { |
| | | System.arraycopy(totalWaterBytes, 0, data, 6, totalWaterBytes.length); |
| | | |
| | | //用户编号(地址) |
| | | byte[] userCodeBytes = new byte[6]; |
| | | byte[] userCodeDatas = BcdUtil.strToBcd(userCode); |
| | | System.arraycopy(userCodeDatas, 0, userCodeBytes, 0, userCodeDatas.length); |
| | | if (userCodeBytes != null) { |
| | | System.arraycopy(userCodeBytes, 0, data, 5, userCodeBytes.length); |
| | | } |
| | | //总用电量位 |
| | | byte[] totalElectricBytes = new byte[4]; |
| | | byte[] totalElectricDatas = HexUtil.hexToByteArray(HexUtil.get10To16LowHigh(totalElectric)); |
| | | System.arraycopy(totalElectricDatas, 0, totalElectricBytes, 0, totalElectricDatas.length); |
| | | if (totalElectricBytes != null) { |
| | | System.arraycopy(totalElectricBytes, 0, data, 10, totalElectricBytes.length); |
| | | //用户编号(自增) |
| | | byte[] userCodeNumberBytes = new byte[2]; |
| | | byte[] userCodeNumberDatas = HexUtil.hexToByteArray(HexUtil.get10To16LowHigh(userCodeNumber)); |
| | | System.arraycopy(userCodeNumberDatas, 0, userCodeNumberBytes, 0, userCodeNumberDatas.length); |
| | | if (userCodeNumberBytes != null) { |
| | | System.arraycopy(userCodeNumberBytes, 0, data, 11, userCodeNumberBytes.length); |
| | | } |
| | | //管理卡返写机制 00:中心写01:控制器返写 |
| | | byte[] cardWriteStateBytes = new byte[1]; |
| | | byte[] cardWriteStateDatas = HexUtil.hexToByteArray(HexUtil.get10To16LowHigh(cardWriteState)); |
| | | System.arraycopy(cardWriteStateDatas, 0, cardWriteStateBytes, 0, cardWriteStateDatas.length); |
| | | if (cardWriteStateBytes != null) { |
| | | System.arraycopy(cardWriteStateBytes, 0, data, 13, cardWriteStateBytes.length); |
| | | } |
| | | |
| | | //管理卡返写机制 00:中心写01:控制器返写 |
| | | byte[] cardStateBytes = new byte[1]; |
| | | byte[] cardStateDatas = HexUtil.hexToByteArray(HexUtil.get10To16LowHigh(cardState)); |
| | | System.arraycopy(cardStateDatas, 0, cardStateBytes, 0, cardStateDatas.length); |
| | | if (cardStateBytes != null) { |
| | | System.arraycopy(cardStateBytes, 0, data, 13, cardStateBytes.length); |
| | | } |
| | | |
| | | |
| | | data[15] = getByteSum(data); |
| | | return data; |
| | | } catch (Exception e) { |
| | |
| | | System.arraycopy(balanceBytes, 0, data, 0, balanceBytes.length); |
| | | } |
| | | |
| | | byte[] surplusWaterBytes = new byte[4]; |
| | | byte[] surplusWaterDatas = HexUtil.hexToByteArray(HexUtil.get10To16LowHigh(surplusWater)); |
| | | System.arraycopy(surplusWaterDatas, 0, surplusWaterBytes, 0, surplusWaterDatas.length); |
| | | if (surplusWaterBytes != null) { |
| | | System.arraycopy(surplusWaterBytes, 0, data, 4, surplusWaterBytes.length); |
| | | byte[] surplusElecticityBytes = new byte[4]; |
| | | byte[] surplusElecticityDatas = HexUtil.hexToByteArray(HexUtil.get10To16LowHigh(surplusElecticity)); |
| | | System.arraycopy(surplusElecticityDatas, 0, surplusElecticityBytes, 0, surplusElecticityDatas.length); |
| | | if (surplusElecticityBytes != null) { |
| | | System.arraycopy(surplusElecticityBytes, 0, data, 4, surplusElecticityBytes.length); |
| | | } |
| | | byte[] totalMornyBytes = new byte[4]; |
| | | byte[] totalMornyDatas = HexUtil.hexToByteArray(HexUtil.get10To16LowHigh(totalMorny)); |
| | | System.arraycopy(totalMornyDatas, 0, totalMornyBytes, 0, totalMornyDatas.length); |
| | | if (totalMornyBytes != null) { |
| | | System.arraycopy(totalMornyBytes, 0, data, 8, totalMornyBytes.length); |
| | | } |
| | | |
| | | if (rechargeDate != null) { |
| | |
| | | public byte[] toBytes() { |
| | | byte[] data = new byte[16]; |
| | | |
| | | |
| | | try { |
| | | byte[] balanceBytes = new byte[4]; |
| | | byte[] balanceDatas = HexUtil.hexToByteArray(HexUtil.get10To16LowHigh(balance)); |
| | |
| | | System.arraycopy(balanceBytes, 0, data, 0, balanceBytes.length); |
| | | } |
| | | |
| | | byte[] surplusWaterBytes = new byte[4]; |
| | | byte[] surplusWaterDatas = HexUtil.hexToByteArray(HexUtil.get10To16LowHigh(surplusWater)); |
| | | System.arraycopy(surplusWaterDatas, 0, surplusWaterBytes, 0, surplusWaterDatas.length); |
| | | if (surplusWaterBytes != null) { |
| | | System.arraycopy(surplusWaterBytes, 0, data, 4, surplusWaterBytes.length); |
| | | byte[] surplusElecticityBytes = new byte[4]; |
| | | byte[] surplusElecticityDatas = HexUtil.hexToByteArray(HexUtil.get10To16LowHigh(surplusElecticity)); |
| | | System.arraycopy(surplusElecticityDatas, 0, surplusElecticityBytes, 0, surplusElecticityDatas.length); |
| | | if (surplusElecticityBytes != null) { |
| | | System.arraycopy(surplusElecticityBytes, 0, data, 4, surplusElecticityBytes.length); |
| | | } |
| | | |
| | | byte[] electricPriceBytes = new byte[4]; |
| | | byte[] electricPriceDatas = HexUtil.hexToByteArray(HexUtil.floatToHexLowHigh(electricPrice)); |
| | | System.arraycopy(electricPriceDatas, 0, electricPriceBytes, 0, electricPriceDatas.length); |
| | | if (electricPriceBytes != null) { |
| | | System.arraycopy(electricPriceBytes, 0, data, 8, electricPriceBytes.length); |
| | | } |
| | | |
| | | if (rechargeDate != null) { |
| | |
| | | data[13] = bcdMonth; |
| | | data[14] = bcdDay; |
| | | } |
| | | |
| | | |
| | | data[15] = getByteSum(data); |
| | | } catch (Exception e) { |
| | |
| | | this.arerNumber = arerNumber; |
| | | } |
| | | |
| | | public int getDeviceNumberl() { |
| | | return deviceNumberl; |
| | | public String getUserCode() { |
| | | return userCode; |
| | | } |
| | | |
| | | public void setDeviceNumberl(int deviceNumberl) { |
| | | this.deviceNumberl = deviceNumberl; |
| | | public void setUserCode(String userCode) { |
| | | this.userCode = userCode; |
| | | } |
| | | |
| | | public short getRechargeTimes() { |
| | | return rechargeTimes; |
| | | public int getUserCodeNumber() { |
| | | return userCodeNumber; |
| | | } |
| | | |
| | | public void setRechargeTimes(short rechargeTimes) { |
| | | this.rechargeTimes = rechargeTimes; |
| | | public void setUserCodeNumber(int userCodeNumber) { |
| | | this.userCodeNumber = userCodeNumber; |
| | | } |
| | | |
| | | public int getTotalWater() { |
| | | return totalWater; |
| | | public int getCardWriteState() { |
| | | return cardWriteState; |
| | | } |
| | | |
| | | public void setTotalWater(int totalWater) { |
| | | this.totalWater = totalWater; |
| | | public void setCardWriteState(int cardWriteState) { |
| | | this.cardWriteState = cardWriteState; |
| | | } |
| | | |
| | | public int getTotalElectric() { |
| | | return totalElectric; |
| | | public int getCardState() { |
| | | return cardState; |
| | | } |
| | | |
| | | public void setTotalElectric(int totalElectric) { |
| | | this.totalElectric = totalElectric; |
| | | public void setCardState(int cardState) { |
| | | this.cardState = cardState; |
| | | } |
| | | |
| | | public int getBalance() { |
| | |
| | | this.balance = balance; |
| | | } |
| | | |
| | | public int getSurplusWater() { |
| | | return surplusWater; |
| | | public int getSurplusElecticity() { |
| | | return surplusElecticity; |
| | | } |
| | | |
| | | public void setSurplusWater(int surplusWater) { |
| | | this.surplusWater = surplusWater; |
| | | public void setSurplusElecticity(int surplusElecticity) { |
| | | this.surplusElecticity = surplusElecticity; |
| | | } |
| | | |
| | | public int getTotalMorny() { |
| | | return totalMorny; |
| | | } |
| | | |
| | | public void setTotalMorny(int totalMorny) { |
| | | this.totalMorny = totalMorny; |
| | | } |
| | | |
| | | public Calendar getRechargeDate() { |
| | |
| | | this.rechargeDate = rechargeDate; |
| | | } |
| | | |
| | | public Float getElectricPrice() { |
| | | return electricPrice; |
| | | } |
| | | |
| | | public void setElectricPrice(Float electricPrice) { |
| | | this.electricPrice = electricPrice; |
| | | } |
| | | } |
| | |
| | | * Date: 2023-11-05 16:23 |
| | | * Description: |
| | | */ |
| | | @Database(entities = {RegionBean.class, PassWordCardBean.class, CardData.class, DeviceNumber.class, IdentityBean.class, DomainBean.class, ElectricPriceBean.class, IpBean.class, AdminDataBean.class, UserCardBean.class, RechargeBean.class, PowerBean.class}, version = 1, exportSchema = false) |
| | | @Database(entities = {RegionBean.class, PassWordCardBean.class, CardData.class, DeviceNumber.class, IdentityBean.class, DomainBean.class, ElectricPriceBean.class, IpBean.class, AdminDataBean.class, UserCardBean.class, RechargeBean.class, PowerBean.class}, version = 1, exportSchema = false) |
| | | public abstract class QHOnLineAppDatabase extends RoomDatabase { |
| | | |
| | | |
| | | public abstract AdminDataDao adminDao(); |
| | | |
| | | |
| | | |
| | | public abstract UserCardDao userCardDao(); |
| File was renamed from qiheonlinelibrary/src/main/java/com/dayu/qiheonlinelibrary/dao/BaseDaoSingleton.java |
| | |
| | | * Date: 2023-11-06 16:58 |
| | | * Description: 创建数据库实例 |
| | | */ |
| | | public class BaseDaoSingleton { |
| | | public class QHOnlineBaseDaoSingleton { |
| | | public static QHOnLineAppDatabase baseDao; |
| | | public static QHOnLineAppDatabase AsynchBaseDao; |
| | | public static String SqlitePath = Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + ".dayu" + File.separator + "data" + File.separator; |
| | |
| | | @Delete |
| | | void delete(RechargeBean passWord); |
| | | |
| | | @Query("select * from RechargeBean order by date desc") |
| | | @Query("select * from RechargeBean order by rechargeDate desc") |
| | | LiveData<List<RechargeBean>> findAll(); |
| | | |
| | | @Query("select * from RechargeBean where date>=:beginTime and date<=:endTime") |
| | | @Query("select * from RechargeBean where rechargeDate>=:beginTime and rechargeDate<=:endTime") |
| | | LiveData<List<RechargeBean>> findByTime(long beginTime, long endTime); |
| | | |
| | | @Query("select * from RechargeBean where date>=:beginTime and date<=:endTime") |
| | | @Query("select * from RechargeBean where rechargeDate>=:beginTime and rechargeDate<=:endTime") |
| | | List<RechargeBean> ansyFindByTime(long beginTime, long endTime); |
| | | |
| | | @Query("select * from RechargeBean order by date desc LIMIT :limit OFFSET :offset") |
| | | @Query("select * from RechargeBean order by rechargeDate desc LIMIT :limit OFFSET :offset") |
| | | List<RechargeBean> findAll(int offset,int limit); |
| | | } |
| | |
| | | import androidx.room.Entity; |
| | | import androidx.room.PrimaryKey; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * Copyright (C), 2023, |
| | | * Author: zuo |
| | |
| | | * Description: 充值实体类 |
| | | */ |
| | | @Entity |
| | | public class RechargeBean { |
| | | public class RechargeBean implements Serializable { |
| | | |
| | | @PrimaryKey(autoGenerate = true) |
| | | public long id; |
| | | |
| | | public String cardNumber;//卡号(实体卡号) |
| | | private String userCode;//充值机生成的用户编号 |
| | | private String userName; |
| | | private String personId;//服务器返回的用户id |
| | | private String serial;//设备序列号 |
| | | public String userName; |
| | | public String userId;//用户身份证号 |
| | | public long date; |
| | | public String morny;//充值金额 单位元 |
| | | public String rechargeWater;//充值水量 |
| | | public String balance;//余额 单位元 |
| | | public String total_morn;//总充值金额 |
| | | private String arerNumber;//区域号 |
| | | private String morny;//充值金额 单位元 |
| | | private String balance;//余额 单位元 |
| | | private String rechargeElectric;//充值电量 |
| | | |
| | | private String price;//电单价 |
| | | |
| | | private String surplusElectic;//剩余电量 |
| | | private long rechargeDate;//充值时间 |
| | | |
| | | private String userId;//用户身份证号 |
| | | |
| | | private String rechargeWater;//充值水量 |
| | | |
| | | private String totalMorny;//总充值金额 |
| | | //状态 0未上传 1成功上传 |
| | | public int state = 0; |
| | | private int state = 0; |
| | | |
| | | public String cardNumber;//卡号 |
| | | public String surplusWater;//剩余水量 底位在前 2位小数点 单位元/立方米 () |
| | | private String surplusWater;//剩余水量 底位在前 2位小数点 单位元/立方米 () |
| | | |
| | | public String getRechargeWater() { |
| | | return rechargeWater; |
| | | private String orderId;//充值订单号 |
| | | |
| | | private String deductionMorny;//补扣钱款 充值补扣金额=充值金额+充值前读取的卡内余额-充值回调返回卡内余额 |
| | | |
| | | |
| | | public String getDeductionMorny() { |
| | | return deductionMorny; |
| | | } |
| | | |
| | | public void setRechargeWater(String rechargeWater) { |
| | | this.rechargeWater = rechargeWater; |
| | | public void setDeductionMorny(String deductionMorny) { |
| | | this.deductionMorny = deductionMorny; |
| | | } |
| | | |
| | | public String getSurplusWater() { |
| | | return surplusWater; |
| | | public String getOrderId() { |
| | | return orderId; |
| | | } |
| | | |
| | | public void setSurplusWater(String surplusWater) { |
| | | this.surplusWater = surplusWater; |
| | | public void setOrderId(String orderId) { |
| | | this.orderId = orderId; |
| | | } |
| | | |
| | | public String getCardNumber() { |
| | |
| | | this.cardNumber = cardNumber; |
| | | } |
| | | |
| | | public String getTotal_morn() { |
| | | return total_morn; |
| | | public String getUserCode() { |
| | | return userCode; |
| | | } |
| | | |
| | | public String getUserId() { |
| | | return userId; |
| | | } |
| | | |
| | | public void setUserId(String userId) { |
| | | this.userId = userId; |
| | | } |
| | | |
| | | public void setTotal_morn(String total_morn) { |
| | | this.total_morn = total_morn; |
| | | } |
| | | |
| | | public int getState() { |
| | | return state; |
| | | } |
| | | |
| | | public void setState(int state) { |
| | | this.state = state; |
| | | } |
| | | |
| | | public String getSerial() { |
| | | return serial; |
| | | } |
| | | |
| | | public void setSerial(String serial) { |
| | | this.serial = serial; |
| | | public void setUserCode(String userCode) { |
| | | this.userCode = userCode; |
| | | } |
| | | |
| | | public String getUserName() { |
| | |
| | | this.userName = userName; |
| | | } |
| | | |
| | | |
| | | public long getDate() { |
| | | return date; |
| | | public String getPersonId() { |
| | | return personId; |
| | | } |
| | | |
| | | public void setDate(long date) { |
| | | this.date = date; |
| | | public void setPersonId(String personId) { |
| | | this.personId = personId; |
| | | } |
| | | |
| | | public String getSerial() { |
| | | return serial; |
| | | } |
| | | |
| | | public void setSerial(String serial) { |
| | | this.serial = serial; |
| | | } |
| | | |
| | | public String getArerNumber() { |
| | | return arerNumber; |
| | | } |
| | | |
| | | public void setArerNumber(String arerNumber) { |
| | | this.arerNumber = arerNumber; |
| | | } |
| | | |
| | | public String getMorny() { |
| | |
| | | public void setBalance(String balance) { |
| | | this.balance = balance; |
| | | } |
| | | |
| | | public String getRechargeElectric() { |
| | | return rechargeElectric; |
| | | } |
| | | |
| | | public void setRechargeElectric(String rechargeElectric) { |
| | | this.rechargeElectric = rechargeElectric; |
| | | } |
| | | |
| | | public String getPrice() { |
| | | return price; |
| | | } |
| | | |
| | | public void setPrice(String price) { |
| | | this.price = price; |
| | | } |
| | | |
| | | public String getSurplusElectic() { |
| | | return surplusElectic; |
| | | } |
| | | |
| | | public void setSurplusElectic(String surplusElectic) { |
| | | this.surplusElectic = surplusElectic; |
| | | } |
| | | |
| | | public long getRechargeDate() { |
| | | return rechargeDate; |
| | | } |
| | | |
| | | public void setRechargeDate(long rechargeDate) { |
| | | this.rechargeDate = rechargeDate; |
| | | } |
| | | |
| | | public String getUserId() { |
| | | return userId; |
| | | } |
| | | |
| | | public void setUserId(String userId) { |
| | | this.userId = userId; |
| | | } |
| | | |
| | | public String getRechargeWater() { |
| | | return rechargeWater; |
| | | } |
| | | |
| | | public void setRechargeWater(String rechargeWater) { |
| | | this.rechargeWater = rechargeWater; |
| | | } |
| | | |
| | | |
| | | public String getTotalMorny() { |
| | | return totalMorny; |
| | | } |
| | | |
| | | public void setTotalMorny(String totalMorny) { |
| | | this.totalMorny = totalMorny; |
| | | } |
| | | |
| | | public int getState() { |
| | | return state; |
| | | } |
| | | |
| | | public void setState(int state) { |
| | | this.state = state; |
| | | } |
| | | |
| | | public String getSurplusWater() { |
| | | return surplusWater; |
| | | } |
| | | |
| | | public void setSurplusWater(String surplusWater) { |
| | | this.surplusWater = surplusWater; |
| | | } |
| | | } |
| | |
| | | public class UserCardBean implements Serializable { |
| | | @PrimaryKey(autoGenerate = true) |
| | | public long id; |
| | | private String serial ;//设备序列号(也是设备编号) |
| | | |
| | | private String cardNumber;//卡号(实体卡号) |
| | | private String userCode;//充值机生成的用户编号 |
| | | private String userName ;//用户名称 |
| | | private String userID ;//身份证号 |
| | | private String phone;//电话 |
| | | private String personId;//服务器返回的用户id |
| | | private int cardMorny;//开卡金额 |
| | | private String addressCode;//地址编号 |
| | | private String addressName;//地址名称 |
| | | private String arerNumber;//区域号 |
| | | private long date;//开卡时间 |
| | | private String serial ;//设备序列号(也是设备编号) |
| | | |
| | | private String cardNumber;//卡号 |
| | | |
| | | private long date; |
| | | private String phone; |
| | | //状态 0空闲 1使用 |
| | | private int St = 0; |
| | | //服务器返回的农户注册编号 |
| | | private String initPeasantCode; |
| | | //状态 0未上传 1成功上传 |
| | | private int state = 0; |
| | | |
| | | private String addressCode;//区域号 |
| | | |
| | | public String getCardNumber() { |
| | | return cardNumber; |
| | |
| | | |
| | | public void setCardNumber(String cardNumber) { |
| | | this.cardNumber = cardNumber; |
| | | } |
| | | |
| | | public String getUserCode() { |
| | | return userCode; |
| | | } |
| | | |
| | | public void setUserCode(String userCode) { |
| | | this.userCode = userCode; |
| | | } |
| | | |
| | | public String getUserName() { |
| | | return userName; |
| | | } |
| | | |
| | | public void setUserName(String userName) { |
| | | this.userName = userName; |
| | | } |
| | | |
| | | public String getUserID() { |
| | | return userID; |
| | | } |
| | | |
| | | public void setUserID(String userID) { |
| | | this.userID = userID; |
| | | } |
| | | |
| | | public String getPhone() { |
| | | return phone; |
| | | } |
| | | |
| | | public void setPhone(String phone) { |
| | | this.phone = phone; |
| | | } |
| | | |
| | | public String getPersonId() { |
| | | return personId; |
| | | } |
| | | |
| | | public void setPersonId(String personId) { |
| | | this.personId = personId; |
| | | } |
| | | |
| | | public int getCardMorny() { |
| | | return cardMorny; |
| | | } |
| | | |
| | | public void setCardMorny(int cardMorny) { |
| | | this.cardMorny = cardMorny; |
| | | } |
| | | |
| | | public String getAddressCode() { |
| | |
| | | this.addressCode = addressCode; |
| | | } |
| | | |
| | | public String getSerial() { |
| | | return serial; |
| | | public String getAddressName() { |
| | | return addressName; |
| | | } |
| | | |
| | | public void setSerial(String serial) { |
| | | this.serial = serial; |
| | | public void setAddressName(String addressName) { |
| | | this.addressName = addressName; |
| | | } |
| | | |
| | | public String getInitPeasantCode() { |
| | | return initPeasantCode; |
| | | public String getArerNumber() { |
| | | return arerNumber; |
| | | } |
| | | |
| | | public void setInitPeasantCode(String initPeasantCode) { |
| | | this.initPeasantCode = initPeasantCode; |
| | | public void setArerNumber(String arerNumber) { |
| | | this.arerNumber = arerNumber; |
| | | } |
| | | |
| | | public int getSt() { |
| | | return St; |
| | | } |
| | | |
| | | public void setSt(int st) { |
| | | St = st; |
| | | } |
| | | |
| | | |
| | | |
| | | public String getPhone() { |
| | | return phone; |
| | | } |
| | | |
| | | public void setPhone(String phone) { |
| | | this.phone = phone; |
| | | } |
| | | |
| | | |
| | | |
| | | public int getState() { |
| | | return state; |
| | | } |
| | | |
| | | public void setState(int state) { |
| | | this.state = state; |
| | | } |
| | | |
| | | |
| | | |
| | | public String getUserName() { |
| | | return userName; |
| | | } |
| | | |
| | | public void setUserName(String userName) { |
| | | this.userName = userName; |
| | | } |
| | | |
| | | |
| | | public long getDate() { |
| | | return date; |
| | |
| | | this.date = date; |
| | | } |
| | | |
| | | |
| | | |
| | | public String getUserID() { |
| | | return userID; |
| | | public String getSerial() { |
| | | return serial; |
| | | } |
| | | |
| | | public void setUserID(String userID) { |
| | | this.userID = userID; |
| | | public void setSerial(String serial) { |
| | | this.serial = serial; |
| | | } |
| | | } |
| | |
| | | package com.dayu.qiheonlinelibrary.net; |
| | | |
| | | import android.content.Context; |
| | | import android.content.Intent; |
| | | |
| | | |
| | | import com.dayu.baselibrary.business.BusinessProvider; |
| | | import com.dayu.qiheonlinelibrary.net.subscribers.BaseProgressSubscriber; |
| | | import com.dayu.qiheonlinelibrary.net.subscribers.ProgressSubscriber; |
| | | import com.dayu.qiheonlinelibrary.net.subscribers.SubscriberListener; |
| | |
| | | observable = apiService.requestGet(path, params); |
| | | } |
| | | } else { |
| | | observable = apiService.requestPost(path, params); |
| | | if (params != null) { |
| | | observable = apiService.requestPost(path, params); |
| | | } else { |
| | | observable = apiService.requestPost(path); |
| | | } |
| | | } |
| | | |
| | | mySubscriber = new ProgressSubscriber(context, hideLoading, listener); |
| | |
| | | if (o instanceof BaseResponse) { |
| | | BaseResponse tem = (BaseResponse) o; |
| | | BaseResponse<T> response = new BaseResponse<>(); |
| | | //未登录或登录超时,请重新登录 |
| | | if (tem.getCode()==100401){ |
| | | if (BusinessProvider.getBusinessProvider()!=null){ |
| | | BusinessProvider.getBusinessProvider().startLoginNavigotor.navigateToLogin(context); |
| | | } |
| | | |
| | | } |
| | | |
| | | response.setCode(tem.getCode()); |
| | | response.setMsg(tem.getMsg()); |
| | | |
| | | if (tClass != null && tem.getData() instanceof Map) { |
| | | if (tClass!= null) { |
| | | if ( tem.getData() instanceof Map) { |
| | | try { |
| | | // response.setData(MyJsonParser.getBeanFromMap((Map<String, Object>) tem.getData(), tClass)); |
| | | String jsonData = MyJsonParser.getJsontoMap((Map) tem.getData()); |
| | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } else if (tClass != null && tem.getData() instanceof List) { |
| | | } else if ( tem.getData() instanceof List) { |
| | | try { |
| | | response.setData((T) MyJsonParser.getListByJson(MyJsonParser.getJsonbyList((List) tem.getData()), tClass)); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } else if (tClass != null && tem.getData() instanceof Integer) { |
| | | } else if ( tem.getData() instanceof Integer) { |
| | | response.setData((T) tem.getData()); |
| | | } else if (tem.getData() instanceof Boolean){ |
| | | response.setData((T) tem.getData()); |
| | | } |
| | | if (tClass != null && tClass.getName() instanceof String && tem.getData() instanceof String) { |
| | | if ( tClass.getName() instanceof String && tem.getData() instanceof String) { |
| | | try { |
| | | response.setData((T) tem.getData()); |
| | | } catch (Exception e) { |
| | |
| | | } |
| | | } |
| | | return response; |
| | | |
| | | |
| | | } |
| | | }} |
| | | |
| | | return null; |
| | | } |
| | |
| | | .subscribe(mySubscriber); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | // @FormUrlEncoded |
| | | @POST() |
| | | Observable<BaseResponse> requestPost(@Url String url, @Body Map<String, Object> params); |
| | | |
| | | @POST() |
| | | Observable<BaseResponse> requestPost(@Url String url); |
| | | @GET("{url}") |
| | | Observable<BaseResponse> requestGet(@Path("url") String url, @QueryMap Map<String, Object> params); |
| | | |
| | |
| | | package com.dayu.qiheonlinelibrary.net; |
| | | |
| | | |
| | | import androidx.annotation.NonNull; |
| | | import androidx.annotation.Nullable; |
| | | |
| | | import okhttp3.Handshake; |
| | | import okhttp3.Headers; |
| | | import okhttp3.MediaType; |
| | | import okhttp3.Protocol; |
| | | import okhttp3.Request; |
| | | import okhttp3.Response; |
| | | import okhttp3.ResponseBody; |
| | | import okhttp3.internal.connection.Exchange; |
| | | import okio.BufferedSource; |
| | | |
| | | /** |
| | | * Copyright (C), 2023, |
| | | * Author: zuo |
| | | * Date: 2023-03-27 15:17 |
| | | * Description: |
| | | */ |
| | | public class BaseResponse<T> { |
| | | public class BaseResponse<T> { |
| | | private int code; |
| | | private String msg; |
| | | private T data; |
| | | private String stackErrorInfo;//堆栈错误描述 |
| | | |
| | | |
| | | public int getCode() { |
| | | return code; |
| | |
| | | this.data = data; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | * Description: |
| | | */ |
| | | public class Constants { |
| | | public static final String BASE_URL = "http://yzgb.yunguangai.cn/api/"; |
| | | public static final String BASE_URL = "http://120.46.45.35:20081/"; |
| | | |
| | | /** |
| | | * 代表请求成功 |
| | |
| | | package com.dayu.qiheonlinelibrary.net; |
| | | |
| | | import android.text.TextUtils; |
| | | |
| | | import com.dayu.qiheonlinelibrary.QHOnLineApplication; |
| | | import com.dayu.qiheonlinelibrary.utils.SharedPreferencesHelper; |
| | | import com.dayu.qiheonlinelibrary.utils.ToastUtil; |
| | |
| | | if (request.method().equals("GET")) { |
| | | builder.url(request.url().toString()); |
| | | } else { |
| | | |
| | | RequestBody body = request.body(); |
| | | if (body instanceof FormBody) { |
| | | FormBody oldFormBody = (FormBody) body; |
| | | if (oldFormBody != null && oldFormBody.size() > 0) { |
| | | //处理body |
| | | } |
| | | if (!TextUtils.isEmpty(QHOnLineApplication.getInstance().tokenStr)) { |
| | | builder.addHeader("Token-Cloud", QHOnLineApplication.getInstance().tokenStr); |
| | | } |
| | | builder.addHeader("os", "app"); |
| | | builder.addHeader("Authorization", SharedPreferencesHelper.getInstance(QHOnLineApplication.qhAloneApplication.application).get("token", "")); |
| | | } |
| | | return builder.build(); |
| | | } catch (Exception e) { |
| | |
| | | package com.dayu.qiheonlinelibrary.net; |
| | | |
| | | import java.io.ByteArrayInputStream; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.security.InvalidKeyException; |
| | | import java.security.KeyFactory; |
| | | import java.security.NoSuchAlgorithmException; |
| | | import java.security.PublicKey; |
| | | import java.security.cert.CertificateFactory; |
| | | import java.security.cert.X509Certificate; |
| | | import java.security.spec.InvalidKeySpecException; |
| | | import java.security.spec.X509EncodedKeySpec; |
| | | import java.util.Base64; |
| | | |
| | | import javax.crypto.BadPaddingException; |
| | | import javax.crypto.Cipher; |
| | | import javax.crypto.IllegalBlockSizeException; |
| | | import javax.crypto.NoSuchPaddingException; |
| | | |
| | | /** |
| | | * author: zuo |
| | |
| | | */ |
| | | public class RSAUtile { |
| | | |
| | | public static byte[] encryptByPublicKey(String data, String publicKey) throws Exception { |
| | | // 得到公钥 |
| | | X509EncodedKeySpec keySpec = new X509EncodedKeySpec(publicKey.getBytes(StandardCharsets.UTF_8)); |
| | | KeyFactory kf = KeyFactory.getInstance("RSA"); |
| | | PublicKey keyPublic = kf.generatePublic(keySpec); |
| | | |
| | | // 加密数据 |
| | | Cipher cp = Cipher.getInstance("RSA/ECB/PKCS1Padding"); |
| | | cp.init(Cipher.ENCRYPT_MODE, keyPublic); |
| | | return cp.doFinal(data.getBytes(StandardCharsets.UTF_8)); |
| | | } |
| | | |
| | | |
| | | public static String encryptByPublicKey(String data, String publicKeyPEM) { |
| | | try { |
| | | // 得到公钥 |
| | | publicKeyPEM = publicKeyPEM.replace("-----BEGIN PUBLIC KEY-----", "") |
| | | .replace("-----END PUBLIC KEY-----", "") |
| | | .replaceAll("\\s+", ""); |
| | | // 解码Base64编码的公钥 |
| | | byte[] decoded = new byte[0]; |
| | | if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) { |
| | | decoded = Base64.getDecoder().decode(publicKeyPEM); |
| | | } else { |
| | | decoded = android.util.Base64.decode(publicKeyPEM, android.util.Base64.DEFAULT); |
| | | } |
| | | // 生成公钥 |
| | | X509EncodedKeySpec spec = new X509EncodedKeySpec(decoded); |
| | | KeyFactory keyFactory = KeyFactory.getInstance("RSA"); |
| | | PublicKey publicKey = keyFactory.generatePublic(spec); |
| | | // 加密数据 |
| | | Cipher cipher = Cipher.getInstance("RSA/ECB/PKCS1Padding"); |
| | | cipher.init(Cipher.ENCRYPT_MODE, publicKey); |
| | | byte[] encryptedBytes = cipher.doFinal(data.getBytes("UTF-8")); |
| | | String encryptedData = null; |
| | | if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) { |
| | | encryptedData = Base64.getEncoder().encodeToString(encryptedBytes); |
| | | } else { |
| | | encryptedData = android.util.Base64.encodeToString(encryptedBytes, android.util.Base64.DEFAULT); |
| | | } |
| | | return encryptedData; |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return ""; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | public void startAnim() { |
| | | try { |
| | | this.show(); |
| | | // mHandler.postDelayed(new Runnable() { |
| | | // @Override |
| | | // public void run() { |
| | | // mAnimationDrawable.start(); |
| | | // } |
| | | // }, 100); |
| | | } catch (Exception e) { |
| | | |
| | | } |
| | |
| | | |
| | | public void stopAnim() { |
| | | try { |
| | | // mAnimationDrawable.stop(); |
| | | |
| | | this.dismiss(); |
| | | } catch (Exception e) { |
| | | |
| | |
| | | |
| | | |
| | | static { |
| | | System.loadLibrary("qihealone-native-lib"); |
| | | System.loadLibrary("qiheonline-native-lib"); |
| | | } |
| | | |
| | | public native String getSafeKey(Object object); |
| | |
| | | list.add(projectBean.getSerial()); |
| | | list.add(projectBean.getUserName()); |
| | | list.add(projectBean.getCardNumber()); |
| | | list.add(DateUtil.dateToStamp(projectBean.getDate(), DateUtil.type2)); |
| | | list.add(DateUtil.dateToStamp(projectBean.getRechargeDate(), DateUtil.type2)); |
| | | list.add(projectBean.getMorny()); |
| | | list.add(projectBean.getBalance()); |
| | | } else { |
| New file |
| | |
| | | package com.dayu.qiheonlinelibrary.utils; |
| | | |
| | | import android.app.Activity; |
| | | import android.content.Intent; |
| | | |
| | | import com.dayu.qiheonlinelibrary.card.CleanCard; |
| | | import com.dayu.qiheonlinelibrary.card.CleanUserCard; |
| | | import com.dayu.qiheonlinelibrary.card.ConfigurationPowerCard; |
| | | import com.dayu.qiheonlinelibrary.card.ConfigureDeviceRegistrationCrad; |
| | | import com.dayu.qiheonlinelibrary.card.DomainCard; |
| | | import com.dayu.qiheonlinelibrary.card.ElectricPriceCard; |
| | | import com.dayu.qiheonlinelibrary.card.ManageCard; |
| | | import com.dayu.qiheonlinelibrary.card.PassWordCard; |
| | | import com.dayu.qiheonlinelibrary.card.RegionCard; |
| | | import com.dayu.qiheonlinelibrary.card.RegisteredCard; |
| | | import com.dayu.qiheonlinelibrary.dao.QHOnLineAppDatabase; |
| | | import com.dayu.qiheonlinelibrary.tools.NFCWriteHelper; |
| | | |
| | | /** |
| | | * author: zuo |
| | | * Date: 2024-08-02 |
| | | * Time: 18:01 |
| | | * 备注: |
| | | */ |
| | | public class NFCWreatUtils { |
| | | Activity activity; |
| | | QHOnLineAppDatabase baseDao; |
| | | static NFCWreatUtils nfcWreatUtils; |
| | | |
| | | public static NFCWreatUtils getInstance(Activity activity, QHOnLineAppDatabase baseDao) { |
| | | if (nfcWreatUtils == null) { |
| | | nfcWreatUtils = new NFCWreatUtils(); |
| | | nfcWreatUtils.activity = activity; |
| | | nfcWreatUtils.baseDao = baseDao; |
| | | } |
| | | return nfcWreatUtils; |
| | | } |
| | | |
| | | |
| | | public boolean setmanageCard( Intent intent, final ManageCard manageCard) { |
| | | return NFCWriteHelper.getInstence(intent, activity).writeData(manageCard.toByte(baseDao), 1, 0); |
| | | } |
| | | |
| | | /** |
| | | * 制作清零卡 |
| | | * |
| | | * @param intent |
| | | * @param clearOrInitCard |
| | | */ |
| | | public boolean setClean( Intent intent, CleanCard clearOrInitCard) { |
| | | return NFCWriteHelper.getInstence(intent, activity).writeData(clearOrInitCard.toByte(baseDao), 1, 0); |
| | | } |
| | | |
| | | /** |
| | | * 保存区域表号卡 |
| | | * |
| | | * @param intent |
| | | * @param regionCard |
| | | */ |
| | | public boolean setRegionCard(Intent intent, RegionCard regionCard) { |
| | | return NFCWriteHelper.getInstence(intent, activity).writeData(regionCard.toByte(), 1, 0); |
| | | } |
| | | |
| | | /** |
| | | * 密码卡 |
| | | * |
| | | * @param intent |
| | | * @param passWordCard |
| | | */ |
| | | public boolean setPassWordCard(Intent intent, PassWordCard passWordCard) { |
| | | return NFCWriteHelper.getInstence(intent, activity).writeData(passWordCard.toByte(baseDao), 1, 0); |
| | | } |
| | | |
| | | /** |
| | | * 用户电量单价 |
| | | * |
| | | * @param intent |
| | | * @param electricPriceCard |
| | | */ |
| | | public boolean setElectricPriceCard(Intent intent, ElectricPriceCard electricPriceCard) { |
| | | return NFCWriteHelper.getInstence(intent, activity).writeData(electricPriceCard.toByte(baseDao), 1, 0); |
| | | } |
| | | |
| | | /** |
| | | * 重新注册设备卡 |
| | | * |
| | | * @param intent |
| | | * @param registeredCard |
| | | */ |
| | | public boolean setRegisteredCard(Intent intent, RegisteredCard registeredCard) { |
| | | return NFCWriteHelper.getInstence(intent, activity).writeData(registeredCard.toByte(baseDao), 1, 0); |
| | | } |
| | | |
| | | /** |
| | | * 删除全部用户卡 |
| | | * |
| | | * @param intent |
| | | * @param cleanUserCard |
| | | */ |
| | | public boolean setCleanUserCard(Intent intent, CleanUserCard cleanUserCard) { |
| | | return NFCWriteHelper.getInstence(intent, activity).writeData(cleanUserCard.toByte(baseDao), 1, 0); |
| | | } |
| | | |
| | | /** |
| | | * 设置域名卡 |
| | | * |
| | | * @param intent |
| | | * @param domainCard |
| | | */ |
| | | public boolean setDomainCard(Intent intent, DomainCard domainCard) { |
| | | boolean domainCrdFlag; |
| | | try { |
| | | domainCrdFlag = NFCWriteHelper.getInstence(intent, activity).writeData(domainCard.getZeroByte(), 1, 0); |
| | | if (!domainCrdFlag) { |
| | | return false; |
| | | } |
| | | domainCrdFlag = NFCWriteHelper.getInstence(intent, activity).writeData(domainCard.getOneByte(), 1, 1); |
| | | if (!domainCrdFlag) { |
| | | return false; |
| | | } |
| | | domainCrdFlag = NFCWriteHelper.getInstence(intent, activity).writeData(domainCard.getTwoByte(), 1, 2); |
| | | } catch (Exception e) { |
| | | domainCrdFlag = false; |
| | | throw new RuntimeException(e); |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | |
| | | public boolean setConfigDeviceRegiest(Intent intent, ConfigureDeviceRegistrationCrad configureDeviceRegistrationCrad) { |
| | | return NFCWriteHelper.getInstence(intent, activity).writeData(configureDeviceRegistrationCrad.toByte(baseDao), 1, 0); |
| | | } |
| | | |
| | | public boolean setConfigurationPower(Intent intent, ConfigurationPowerCard configurationPowerCard) { |
| | | try { |
| | | return NFCWriteHelper.getInstence(intent, activity).writeData(configurationPowerCard.toByte(baseDao), 1, 0); |
| | | } catch (Exception e) { |
| | | return false; |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | package com.dayu.qiheonlinelibrary.view; |
| | | |
| | | import static android.view.Gravity.CENTER; |
| | | import static com.dayu.baselibrary.utils.BaseCommon.REPLACE_HAS_CARD; |
| | | import static com.dayu.baselibrary.utils.BaseCommon.REPLACE_NO_CARD; |
| | | |
| | | import android.app.Activity; |
| | | import android.app.Dialog; |
| | | import android.view.ViewGroup; |
| | | import android.view.WindowManager; |
| | | import android.widget.RadioGroup; |
| | | import android.widget.TextView; |
| | | |
| | | import com.dayu.baselibrary.dao.BaseDaoSingleton; |
| | | import com.dayu.baselibrary.dao.LibraryDao; |
| | | import com.dayu.baselibrary.dbbean.LibraryBean; |
| | | import com.dayu.baselibrary.view.ConfirmDialog; |
| | | import com.dayu.qiheonlinelibrary.R; |
| | | |
| | | /** |
| | | * author: zuo |
| | | * Date: 2024-08-09 |
| | | * Time: 10:05 |
| | | * 备注:选择补卡类型 |
| | | */ |
| | | public class ChooseReplacementDialog extends Dialog { |
| | | |
| | | Activity mContext; |
| | | boolean ischose = false; |
| | | OnCallBack mOnCallBack; |
| | | int type; |
| | | |
| | | public ChooseReplacementDialog(Activity context, OnCallBack onCallBack) { |
| | | super(context, com.dayu.baselibrary.R.style.ws_pay_showSelfDialog); |
| | | mContext = context; |
| | | mOnCallBack = onCallBack; |
| | | initView(); |
| | | } |
| | | |
| | | private void initView() { |
| | | getWindow().setGravity(CENTER); |
| | | setContentView(R.layout.dialog_chose_type); |
| | | setCanceledOnTouchOutside(false); |
| | | setCancelable(false); |
| | | RadioGroup radioGroup = findViewById(com.dayu.baselibrary.R.id.radioLibrary); |
| | | |
| | | |
| | | radioGroup.setOnCheckedChangeListener((group, checkedId) -> { |
| | | ischose = true; |
| | | // 当选中的RadioButton发生变化时调用 |
| | | if (checkedId == R.id.hasCard) { |
| | | type = REPLACE_HAS_CARD; |
| | | |
| | | } else if (checkedId == R.id.noCard) { |
| | | type = REPLACE_NO_CARD; |
| | | } |
| | | }); |
| | | TextView okBtn = findViewById(com.dayu.baselibrary.R.id.ok); |
| | | okBtn.setOnClickListener(v -> { |
| | | if (ischose) { |
| | | mOnCallBack.listener(type); |
| | | } |
| | | }); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void show() { |
| | | super.show(); |
| | | /** |
| | | * 设置宽度全屏,要设置在show的后面 |
| | | */ |
| | | WindowManager.LayoutParams layoutParams = getWindow().getAttributes(); |
| | | layoutParams.gravity = CENTER; |
| | | layoutParams.width = ViewGroup.LayoutParams.MATCH_PARENT; |
| | | layoutParams.height = ViewGroup.LayoutParams.MATCH_PARENT; |
| | | getWindow().getDecorView().setPadding(0, 0, 0, 0); |
| | | getWindow().setAttributes(layoutParams); |
| | | } |
| | | |
| | | |
| | | public interface OnCallBack { |
| | | void listener(int type); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.dayu.qiheonlinelibrary.view; |
| | | |
| | | import android.app.Dialog; |
| | | import android.content.Context; |
| | | import android.content.DialogInterface; |
| | | import android.content.Intent; |
| | | import android.text.Editable; |
| | | import android.text.TextUtils; |
| | | import android.text.TextWatcher; |
| | | import android.view.Gravity; |
| | | import android.view.KeyEvent; |
| | | import android.view.View; |
| | | import android.view.ViewGroup; |
| | | import android.view.WindowManager; |
| | | import android.widget.EditText; |
| | | import android.widget.TextView; |
| | | |
| | | import com.dayu.baselibrary.utils.TipUtil; |
| | | import com.dayu.baselibrary.view.EdtDialog; |
| | | import com.dayu.qiheonlinelibrary.R; |
| | | |
| | | /** |
| | | * author: zuo |
| | | * Date: 2024-08-09 |
| | | * Time: 14:52 |
| | | * 备注:补卡工本费 |
| | | */ |
| | | public class ReplacementPriceDialog extends Dialog { |
| | | |
| | | Intent intent; |
| | | Context mContext; |
| | | DialogBack mDialogBack; |
| | | |
| | | String mTitle; |
| | | |
| | | |
| | | public ReplacementPriceDialog(Context context, DialogBack dialogBack) { |
| | | super(context, com.dayu.baselibrary.R.style.ws_pay_showSelfDialog); |
| | | mContext = context; |
| | | mDialogBack = dialogBack; |
| | | initView(); |
| | | } |
| | | |
| | | |
| | | private void initView() { |
| | | getWindow().setGravity(Gravity.CENTER); |
| | | setContentView(R.layout.dialog_replace_price); |
| | | setCanceledOnTouchOutside(false); |
| | | TextView textView = (TextView) this.findViewById(com.dayu.baselibrary.R.id.pw_ok); |
| | | EditText editText = (EditText) this.findViewById(com.dayu.baselibrary.R.id.pw_et); |
| | | setPricePoint(editText); |
| | | TextView title = this.findViewById(com.dayu.baselibrary.R.id.title); |
| | | if (!TextUtils.isEmpty(mTitle)) { |
| | | title.setVisibility(View.VISIBLE); |
| | | title.setText(mTitle); |
| | | } |
| | | textView.setOnClickListener(v -> { |
| | | String data = editText.getText().toString(); |
| | | if (TextUtils.isEmpty(data)) { |
| | | TipUtil.show("请输入工本费"); |
| | | } else { |
| | | if (mDialogBack != null) { |
| | | mDialogBack.onOk(data); |
| | | } |
| | | } |
| | | |
| | | }); |
| | | // 设置 OnKeyListener 拦截返回键事件 |
| | | setOnKeyListener((dialog, keyCode, event) -> { |
| | | if (keyCode == KeyEvent.KEYCODE_BACK) { |
| | | // 拦截返回键事件,返回 true |
| | | return true; |
| | | } |
| | | return false; |
| | | }); |
| | | } |
| | | |
| | | @Override |
| | | public void show() { |
| | | |
| | | super.show(); |
| | | /** |
| | | * 设置宽度全屏,要设置在show的后面 |
| | | */ |
| | | WindowManager.LayoutParams layoutParams = getWindow().getAttributes(); |
| | | layoutParams.gravity = Gravity.CENTER; |
| | | layoutParams.width = ViewGroup.LayoutParams.MATCH_PARENT; |
| | | layoutParams.height = ViewGroup.LayoutParams.MATCH_PARENT; |
| | | getWindow().getDecorView().setPadding(0, 0, 0, 0); |
| | | getWindow().setAttributes(layoutParams); |
| | | } |
| | | |
| | | public interface DialogBack { |
| | | void onOk(String data); |
| | | } |
| | | |
| | | |
| | | //校验金额 |
| | | public void setPricePoint(final EditText editText) { |
| | | editText.addTextChangedListener(new TextWatcher() { |
| | | @Override |
| | | public void onTextChanged(CharSequence s, int start, int before, |
| | | int count) { |
| | | if (s.toString().contains(".")) { |
| | | if (s.length() - 1 - s.toString().indexOf(".") > 2) { |
| | | s = s.toString().subSequence(0, |
| | | s.toString().indexOf(".") + 3); |
| | | editText.setText(s); |
| | | editText.setSelection(s.length()); |
| | | } |
| | | } |
| | | if (s.toString().trim().substring(0).equals(".")) { |
| | | s = "0" + s; |
| | | editText.setText(s); |
| | | editText.setSelection(2); |
| | | } |
| | | |
| | | if (s.toString().startsWith("0") |
| | | && s.toString().trim().length() > 1) { |
| | | if (!s.toString().substring(1, 2).equals(".")) { |
| | | editText.setText(s.subSequence(0, 1)); |
| | | editText.setSelection(1); |
| | | } |
| | | } |
| | | String morny = editText.getText().toString(); |
| | | if (!TextUtils.isEmpty(morny)) { |
| | | // rechageWater = MornyUtil.intDiv(MornyUtil.changeY2F(editText.getText().toString()), waterPrice); |
| | | // binding.redRechargeWater.setText("充值水量:" + rechageWater + " 立方米(吨)"); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void beforeTextChanged(CharSequence s, int start, int count, |
| | | int after) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void afterTextChanged(Editable s) { |
| | | // TODO Auto-generated method stub |
| | | |
| | | } |
| | | |
| | | }); |
| | | |
| | | } |
| | | } |
| New file |
| | |
| | | package com.dayu.qiheonlinelibrary.view; |
| | | |
| | | import static android.view.Gravity.CENTER; |
| | | |
| | | import android.app.Dialog; |
| | | import android.content.DialogInterface; |
| | | import android.text.TextUtils; |
| | | import android.view.KeyEvent; |
| | | import android.view.View; |
| | | import android.view.ViewGroup; |
| | | import android.view.WindowManager; |
| | | import android.widget.EditText; |
| | | import android.widget.TextView; |
| | | |
| | | import com.dayu.baselibrary.utils.ToastUtil; |
| | | import com.dayu.baselibrary.view.EdtDialog; |
| | | import com.dayu.qiheonlinelibrary.R; |
| | | import com.dayu.qiheonlinelibrary.activity.BaseActivity; |
| | | |
| | | /** |
| | | * author: zuo |
| | | * Date: 2024-08-07 |
| | | * Time: 18:27 |
| | | * 备注:搜索用户 |
| | | */ |
| | | public class UserSearchDialog extends Dialog { |
| | | BaseActivity mContext; |
| | | EditText etName, etCardId; |
| | | |
| | | public interface SearchCallBack { |
| | | void onBack(String name, String cardId); |
| | | } |
| | | |
| | | SearchCallBack searchCallBack; |
| | | |
| | | public UserSearchDialog(BaseActivity context, SearchCallBack searchCallBack) { |
| | | super(context, com.dayu.baselibrary.R.style.ws_pay_showSelfDialog); |
| | | mContext = context; |
| | | this.searchCallBack = searchCallBack; |
| | | initView(); |
| | | } |
| | | |
| | | private void initView() { |
| | | getWindow().setGravity(CENTER); |
| | | setContentView(R.layout.dialog_search_user); |
| | | setCanceledOnTouchOutside(false); |
| | | |
| | | etName = findViewById(R.id.etName); |
| | | etCardId = findViewById(R.id.etCardId); |
| | | TextView ok = findViewById(R.id.pw_ok); |
| | | ok.setOnClickListener(v -> { |
| | | String name = etName.getText().toString(); |
| | | String cardId = etCardId.getText().toString(); |
| | | if (!TextUtils.isEmpty(name) || !TextUtils.isEmpty(cardId)) { |
| | | if (searchCallBack != null) { |
| | | searchCallBack.onBack(name, cardId); |
| | | UserSearchDialog.this.dismiss(); |
| | | } |
| | | } else { |
| | | ToastUtil.show("请输入姓名或身份证号"); |
| | | } |
| | | }); |
| | | // 设置 OnKeyListener 拦截返回键事件 |
| | | setOnKeyListener(new DialogInterface.OnKeyListener() { |
| | | @Override |
| | | public boolean onKey(DialogInterface dialog, int keyCode, KeyEvent event) { |
| | | if (keyCode == KeyEvent.KEYCODE_BACK) { |
| | | // 拦截返回键事件,返回 true |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | }); |
| | | } |
| | | |
| | | public void show() { |
| | | |
| | | super.show(); |
| | | /** |
| | | * 设置宽度全屏,要设置在show的后面 |
| | | */ |
| | | WindowManager.LayoutParams layoutParams = getWindow().getAttributes(); |
| | | layoutParams.gravity = CENTER; |
| | | layoutParams.width = ViewGroup.LayoutParams.MATCH_PARENT; |
| | | layoutParams.height = ViewGroup.LayoutParams.MATCH_PARENT; |
| | | getWindow().getDecorView().setPadding(0, 0, 0, 0); |
| | | getWindow().setAttributes(layoutParams); |
| | | } |
| | | } |
| | |
| | | android:padding="5dp" |
| | | android:text="制作管理卡" |
| | | android:textColor="@color/text_selecter_color" |
| | | android:textSize="@dimen/text_size" /> |
| | | android:textSize="@dimen/text_size" |
| | | android:visibility="gone" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/admin_cleanZero" |
| | |
| | | android:layout_marginTop="20dp" |
| | | android:padding="5dp" |
| | | android:text="制作清零卡" |
| | | android:visibility="gone" |
| | | android:textColor="@color/text_selecter_color" |
| | | android:textSize="@dimen/text_size" /> |
| | | android:textSize="@dimen/text_size" |
| | | android:visibility="gone" /> |
| | | |
| | | |
| | | <TextView |
| | |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginLeft="20dp" |
| | | android:visibility="gone" |
| | | android:layout_marginTop="20dp" |
| | | android:padding="5dp" |
| | | android:text="制作密码卡" |
| | | android:textColor="@color/text_selecter_color" |
| | | android:textSize="@dimen/text_size" /> |
| | | android:textSize="@dimen/text_size" |
| | | android:visibility="gone" /> |
| | | |
| | | |
| | | <TextView |
| New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| | | xmlns:app="http://schemas.android.com/apk/res-auto" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent"> |
| | | |
| | | <com.dayu.baselibrary.view.TitleBar |
| | | android:id="@+id/titleBar" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="@dimen/dimen_title_height" |
| | | android:background="@color/title_bar_bg" |
| | | app:centerText="选择卡" |
| | | app:leftImage="@mipmap/icon_back" |
| | | /> |
| | | |
| | | |
| | | <com.scwang.smart.refresh.layout.SmartRefreshLayout |
| | | android:id="@+id/refreshLayout" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:layout_below="@+id/titleBar"> |
| | | |
| | | <androidx.recyclerview.widget.RecyclerView |
| | | android:id="@+id/recyclerView" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="#ffffff" |
| | | android:overScrollMode="never" |
| | | android:padding="10dp" /> |
| | | |
| | | <com.scwang.smart.refresh.footer.ClassicsFooter |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" /> |
| | | </com.scwang.smart.refresh.layout.SmartRefreshLayout> |
| | | |
| | | |
| | | </RelativeLayout> |
| | |
| | | android:textColor="@color/text_selecter_color" |
| | | android:textSize="@dimen/home_text_size" /> |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="50dp" |
| | | android:layout_gravity="center" |
| | | android:layout_marginTop="30dp" |
| | | android:orientation="horizontal"> |
| | | <TextView |
| | | android:id="@+id/home_loss" |
| | | android:layout_width="0dp" |
| | | android:layout_height="match_parent" |
| | | android:layout_weight="1" |
| | | android:gravity="center" |
| | | android:text="挂失" |
| | | android:textColor="@color/text_selecter_color" |
| | | android:textSize="@dimen/home_text_size" /> |
| | | <TextView |
| | | android:id="@+id/home_reportLoss" |
| | | android:layout_width="0dp" |
| | | android:layout_height="match_parent" |
| | | android:layout_weight="1" |
| | | android:gravity="center" |
| | | android:text="解除挂失" |
| | | android:textColor="@color/text_selecter_color" |
| | | android:textSize="@dimen/home_text_size" /> |
| | | <TextView |
| | | android:id="@+id/home_replacement" |
| | | android:layout_width="0dp" |
| | | android:layout_height="match_parent" |
| | | android:layout_weight="1" |
| | | android:gravity="center" |
| | | android:text="补卡" |
| | | android:textColor="@color/text_selecter_color" |
| | | android:textSize="@dimen/home_text_size" /> |
| | | </LinearLayout> |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="50dp" |
| | |
| | | |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content"> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="区域名称:" |
| | | android:textColor="@color/text_selecter_color" |
| | | android:textSize="@dimen/text_size" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/my_adName" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:textColor="@color/text_selecter_color" |
| | | android:textSize="@dimen/text_size" /> |
| | | |
| | | |
| | | </LinearLayout> |
| | | <LinearLayout |
| | | android:id="@+id/my_admin" |
| | | android:layout_width="match_parent" |
| | |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="15dp" |
| | | android:text="登录密码设置" |
| | | android:visibility="gone" |
| | | android:textColor="@color/text_selecter_color" |
| | | android:textSize="@dimen/text_size" /> |
| | | |
| | |
| | | android:textSize="@dimen/new_card_size" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/newCard_villageNum" |
| | | android:id="@+id/newCard_arerNumber" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:inputType="number" |
| | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="姓 名:" |
| | | android:text="姓 名:" |
| | | android:textSize="@dimen/new_card_size" /> |
| | | |
| | | <EditText |
| | |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_weight="1" |
| | | android:text="测试" |
| | | android:textSize="@dimen/new_card_size" /> |
| | | |
| | | <ImageView |
| | |
| | | android:digits="0123456789Xx" |
| | | android:inputType="text" |
| | | android:maxLength="18" |
| | | android:text="130107199210160024" |
| | | android:textSize="@dimen/new_card_size" /> |
| | | |
| | | |
| | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="电 话:" |
| | | android:text="电 话:" |
| | | android:textSize="@dimen/new_card_size" /> |
| | | |
| | | <EditText |
| | |
| | | android:layout_height="wrap_content" |
| | | android:inputType="number" |
| | | android:maxLength="11" |
| | | android:text="15802220723" |
| | | android:textSize="@dimen/new_card_size" /> |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | style="@style/newCardLL" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content"> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="开卡工本费(元):" |
| | | android:textSize="@dimen/new_card_size" /> |
| | | |
| | | <EditText |
| | | android:id="@+id/newCard_morny" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:inputType="number" |
| | | android:text="5" |
| | | |
| | | android:textSize="@dimen/new_card_size" /> |
| | | </LinearLayout> |
| | | |
| | | </LinearLayout> |
| | | |
| | |
| | | |
| | | </LinearLayout> |
| | | |
| | | |
| | | <LinearLayout |
| | | android:id="@+id/recharge_text_LL" |
| | | <ScrollView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:layout_below="@+id/titleBar" |
| | | android:orientation="vertical" |
| | | android:padding="20dp" |
| | | android:visibility="gone"> |
| | | android:layout_above="@+id/recharge_registBtn" |
| | | android:layout_below="@+id/titleBar"> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="15dp" |
| | | android:orientation="horizontal"> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="卡状态:" |
| | | android:textSize="@dimen/text_size" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/red_statu" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:textColor="@color/red" |
| | | android:textSize="@dimen/new_card_size" /> |
| | | |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="15dp" |
| | | android:orientation="horizontal"> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="姓名:" |
| | | android:textSize="@dimen/new_card_size" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/userName" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:textSize="@dimen/new_card_size" /> |
| | | |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="15dp" |
| | | android:orientation="horizontal"> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="卡号:" |
| | | android:textSize="@dimen/text_size" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/red_initCode" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:text="" |
| | | android:textSize="@dimen/new_card_size" /> |
| | | |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="15dp" |
| | | android:orientation="horizontal" |
| | | android:visibility="visible"> |
| | | |
| | | <TextView |
| | | |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="剩余金额:" |
| | | android:textSize="@dimen/text_size" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/red_remainder_blance" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:textSize="@dimen/new_card_size" /> |
| | | |
| | | </LinearLayout> |
| | | |
| | | <TextView |
| | | android:id="@+id/red_remainder_water" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="15dp" |
| | | android:text="剩余水量:" |
| | | android:visibility="gone" |
| | | android:textSize="@dimen/text_size" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/red_rechargeDate" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="15dp" |
| | | android:text="最后购水日期:" |
| | | android:textSize="@dimen/text_size" |
| | | android:visibility="visible" /> |
| | | <TextView |
| | | android:id="@+id/red_rechargeElectric" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="15dp" |
| | | android:text="电量单价:" |
| | | android:textSize="@dimen/text_size" |
| | | android:visibility="visible" /> |
| | | <TextView |
| | | android:id="@+id/red_rechargeNumber" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="15dp" |
| | | android:text="充值次数:" |
| | | android:textSize="@dimen/text_size" |
| | | android:visibility="gone" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/red_total_water" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="15dp" |
| | | android:text="总用水量:" |
| | | android:textSize="@dimen/text_size" |
| | | android:visibility="gone" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/red_total_power" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="15dp" |
| | | android:text="总用电量:" |
| | | android:textSize="@dimen/text_size" |
| | | android:visibility="gone" /> |
| | | |
| | | |
| | | <TextView |
| | | android:id="@+id/red_waterPrice" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="15dp" |
| | | android:text="每立方米水价格:" |
| | | android:textSize="@dimen/text_size" |
| | | android:visibility="gone" /> |
| | | |
| | | <LinearLayout |
| | | android:id="@+id/recharge_LL" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="15dp" |
| | | android:layout_height="match_parent" |
| | | android:orientation="vertical"> |
| | | |
| | | <TextView |
| | | android:id="@+id/red_recharge_water" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="15dp" |
| | | android:text="充值水量:" |
| | | android:textSize="@dimen/text_size" |
| | | android:visibility="gone" /> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="wrap_content" |
| | | android:id="@+id/recharge_text_LL" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:orientation="horizontal"> |
| | | android:layout_below="@+id/titleBar" |
| | | android:orientation="vertical" |
| | | android:padding="20dp" |
| | | android:visibility="gone"> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="15dp" |
| | | android:orientation="horizontal"> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="卡状态:" |
| | | android:textSize="@dimen/text_size" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/red_statu" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:textColor="@color/red" |
| | | android:textSize="@dimen/new_card_size" /> |
| | | |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="15dp" |
| | | android:orientation="horizontal"> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="姓名:" |
| | | android:textSize="@dimen/new_card_size" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/userName" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:textSize="@dimen/new_card_size" /> |
| | | |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="15dp" |
| | | android:orientation="horizontal"> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="卡号:" |
| | | android:textSize="@dimen/text_size" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/red_initCode" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:text="" |
| | | android:textSize="@dimen/new_card_size" /> |
| | | |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="15dp" |
| | | android:orientation="horizontal" |
| | | android:visibility="visible"> |
| | | |
| | | <TextView |
| | | |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="剩余金额:" |
| | | android:textSize="@dimen/text_size" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/red_remainder_blance" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:textSize="@dimen/new_card_size" /> |
| | | |
| | | </LinearLayout> |
| | | |
| | | <TextView |
| | | android:id="@+id/red_remainder_water" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="15dp" |
| | | android:text="剩余水量:" |
| | | android:textSize="@dimen/text_size" |
| | | android:visibility="gone" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/red_rechargeDate" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="15dp" |
| | | android:text="最后购水日期:" |
| | | android:textSize="@dimen/text_size" |
| | | android:visibility="visible" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/red_rechargeElectric" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="15dp" |
| | | android:text="电量单价:" |
| | | android:textSize="@dimen/text_size" |
| | | android:visibility="visible" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/red_rechargeNumber" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="15dp" |
| | | android:text="充值次数:" |
| | | android:textSize="@dimen/text_size" |
| | | android:visibility="gone" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/red_total_water" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="15dp" |
| | | android:text="总用水量:" |
| | | android:textSize="@dimen/text_size" |
| | | android:visibility="gone" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/red_total_power" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="15dp" |
| | | android:text="总用电量:" |
| | | android:textSize="@dimen/text_size" |
| | | android:visibility="gone" /> |
| | | |
| | | |
| | | <TextView |
| | | android:id="@+id/recharge_tx" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="金额(元):" |
| | | android:textColor="@color/red" |
| | | android:textSize="@dimen/new_card_size" /> |
| | | |
| | | <EditText |
| | | android:id="@+id/recharge_water" |
| | | android:id="@+id/red_waterPrice" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:hint="请输入充值的金额" |
| | | android:inputType="numberDecimal" |
| | | android:textSize="@dimen/new_card_size" /> |
| | | android:layout_marginTop="15dp" |
| | | android:text="每立方米水价格:" |
| | | android:textSize="@dimen/text_size" |
| | | android:visibility="gone" /> |
| | | |
| | | <LinearLayout |
| | | android:id="@+id/recharge_LL" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="15dp" |
| | | android:orientation="vertical"> |
| | | |
| | | <TextView |
| | | android:id="@+id/red_recharge_water" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="15dp" |
| | | android:text="充值水量:" |
| | | android:textSize="@dimen/text_size" |
| | | android:visibility="gone" /> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="match_parent" |
| | | android:orientation="horizontal"> |
| | | |
| | | |
| | | <TextView |
| | | android:id="@+id/recharge_tx" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="金额(元):" |
| | | android:textColor="@color/red" |
| | | android:textSize="@dimen/new_card_size" /> |
| | | |
| | | <EditText |
| | | android:id="@+id/recharge_water" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:hint="请输入充值的金额" |
| | | android:inputType="numberDecimal" |
| | | android:textSize="@dimen/new_card_size" /> |
| | | |
| | | </LinearLayout> |
| | | |
| | | |
| | | </LinearLayout> |
| | | </LinearLayout> |
| | | |
| | | |
| | | </LinearLayout> |
| | | </LinearLayout> |
| | | |
| | | </ScrollView> |
| | | |
| | | <TextView |
| | | android:id="@+id/recharge_registBtn" |
| | |
| | | android:layout_margin="20dp" |
| | | android:orientation="vertical"> |
| | | |
| | | <TextView |
| | | android:id="@+id/red_name" |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="15dp" |
| | | android:text="姓名:" |
| | | android:textSize="@dimen/text_size" /> |
| | | android:orientation="horizontal"> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="姓名:" |
| | | android:textSize="@dimen/text_size" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/red_name" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | |
| | | android:text="" |
| | | android:textSize="@dimen/text_size" /> |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | |
| | | android:textSize="@dimen/text_size" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/red_initCode" |
| | | android:id="@+id/red_cardCode" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:text="" |
| | | android:textSize="@dimen/text_size" /> |
| | | </LinearLayout> |
| | | |
| | | |
| | | <TextView |
| | | android:id="@+id/red_remainder_blance" |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="15dp" |
| | | android:text="剩余金额:" |
| | | android:textSize="@dimen/text_size" |
| | | android:visibility="visible" /> |
| | | android:orientation="horizontal"> |
| | | |
| | | <TextView |
| | | android:id="@+id/red_remainder_water" |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="用户编号:" |
| | | android:textSize="@dimen/text_size" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/red_userCode" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:text="" |
| | | android:textSize="@dimen/text_size" /> |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="15dp" |
| | | android:text="剩余水量:" |
| | | android:textSize="@dimen/text_size" |
| | | android:visibility="gone"/> |
| | | android:orientation="horizontal"> |
| | | |
| | | <TextView |
| | | android:id="@+id/red_rechargeDate" |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="剩余金额:" |
| | | android:textSize="@dimen/text_size" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/red_blance" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:text="" |
| | | android:textSize="@dimen/text_size" |
| | | android:visibility="visible" /> |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="15dp" |
| | | android:text="最后购水日期:" |
| | | android:textSize="@dimen/text_size" |
| | | android:visibility="visible" /> |
| | | android:orientation="horizontal"> |
| | | |
| | | <TextView |
| | | android:id="@+id/red_rechargeNumber" |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="剩余电量:" |
| | | android:textSize="@dimen/text_size" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/red_electric" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:text="" |
| | | android:textSize="@dimen/text_size" |
| | | android:visibility="visible" /> |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="15dp" |
| | | android:text="充值次数:" |
| | | android:textSize="@dimen/text_size" |
| | | android:visibility="gone" /> |
| | | android:orientation="horizontal"> |
| | | |
| | | <TextView |
| | | android:id="@+id/red_total_water" |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="总充值金额:" |
| | | android:textSize="@dimen/text_size" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/red_totalMorny" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:text="" |
| | | android:textSize="@dimen/text_size" |
| | | android:visibility="visible" /> |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="15dp" |
| | | android:text="总用水量:" |
| | | android:textSize="@dimen/text_size" |
| | | android:visibility="gone" /> |
| | | android:orientation="horizontal"> |
| | | |
| | | <TextView |
| | | android:id="@+id/red_total_power" |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="手机号:" |
| | | android:textSize="@dimen/text_size" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/red_phone" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:text="" |
| | | android:textSize="@dimen/text_size" /> |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="15dp" |
| | | android:text="总用电量:" |
| | | android:textSize="@dimen/text_size" |
| | | android:visibility="gone" /> |
| | | android:orientation="horizontal"> |
| | | |
| | | <TextView |
| | | android:id="@+id/red_statu" |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="身份证号:" |
| | | android:textSize="@dimen/text_size" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/red_codeId" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:text="" |
| | | android:textSize="@dimen/text_size" /> |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="15dp" |
| | | android:text="卡状态:" |
| | | android:textSize="@dimen/text_size" /> |
| | | android:orientation="horizontal"> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="卡状态:" |
| | | android:textSize="@dimen/text_size" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/red_statu" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:text="" |
| | | android:textSize="@dimen/text_size" /> |
| | | </LinearLayout> |
| | | |
| | | </LinearLayout> |
| | | |
| New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| | | xmlns:app="http://schemas.android.com/apk/res-auto" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent"> |
| | | |
| | | <com.dayu.baselibrary.view.TitleBar |
| | | android:id="@+id/titleBar" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="@dimen/dimen_title_height" |
| | | android:background="@color/title_bar_bg" |
| | | app:centerText="选择用户" |
| | | app:leftImage="@mipmap/icon_back" |
| | | app:rightText="搜索" /> |
| | | |
| | | |
| | | <com.scwang.smart.refresh.layout.SmartRefreshLayout |
| | | android:id="@+id/refreshLayout" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:layout_below="@+id/titleBar"> |
| | | |
| | | <androidx.recyclerview.widget.RecyclerView |
| | | android:id="@+id/recyclerView" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="#ffffff" |
| | | android:overScrollMode="never" |
| | | android:padding="10dp" /> |
| | | |
| | | <com.scwang.smart.refresh.footer.ClassicsFooter |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" /> |
| | | </com.scwang.smart.refresh.layout.SmartRefreshLayout> |
| | | |
| | | |
| | | </RelativeLayout> |
| New file |
| | |
| | | <?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="match_parent" |
| | | android:background="#40000000" |
| | | android:gravity="center" |
| | | android:orientation="vertical"> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_margin="@dimen/dialog_bg_margin" |
| | | android:background="@drawable/base_bg_dialog_top_stroke" |
| | | android:gravity="center" |
| | | android:orientation="vertical"> |
| | | |
| | | <TextView |
| | | android:layout_width="300dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="20dp" |
| | | android:gravity="center" |
| | | android:text="选择补卡类型" |
| | | android:textColor="@color/dialog_btn" |
| | | android:textSize="23sp" |
| | | android:textStyle="bold" /> |
| | | |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="2px" |
| | | android:layout_marginTop="20dp" |
| | | android:background="@color/line_bg" /> |
| | | |
| | | <RadioGroup |
| | | android:id="@+id/radioLibrary" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content"> |
| | | |
| | | |
| | | <RadioButton |
| | | android:id="@+id/hasCard" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginLeft="50dp" |
| | | android:layout_marginTop="25dp" |
| | | android:layout_marginRight="50dp" |
| | | android:background="@drawable/radio_select" |
| | | android:button="@null" |
| | | android:gravity="center" |
| | | android:padding="6dp" |
| | | android:text="泵未关补卡" |
| | | android:textColor="@drawable/radio_text_select" |
| | | android:textSize="20sp" /> |
| | | <RadioButton |
| | | android:id="@+id/noCard" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginLeft="50dp" |
| | | android:layout_marginTop="25dp" |
| | | android:layout_marginRight="50dp" |
| | | android:background="@drawable/radio_select" |
| | | android:button="@null" |
| | | android:gravity="center" |
| | | android:padding="6dp" |
| | | android:text="泵已关补卡" |
| | | android:textColor="@drawable/radio_text_select" |
| | | android:textSize="20sp" /> |
| | | |
| | | |
| | | </RadioGroup> |
| | | |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="2px" |
| | | android:layout_marginTop="35dp" |
| | | android:background="@color/line_bg" /> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:gravity="center_horizontal" |
| | | android:padding="5dp" |
| | | android:orientation="horizontal"> |
| | | |
| | | <TextView |
| | | android:id="@+id/ok" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="@dimen/dialog_btn_height" |
| | | android:background="@drawable/textview_select_bg" |
| | | android:gravity="center" |
| | | android:paddingLeft="15dp" |
| | | android:paddingTop="5dp" |
| | | android:paddingRight="15dp" |
| | | android:paddingBottom="5dp" |
| | | android:text="确 认" |
| | | android:textColor="@color/dialog_btn" |
| | | android:textSize="20sp" /> |
| | | |
| | | |
| | | </LinearLayout> |
| | | |
| | | |
| | | </LinearLayout> |
| | | |
| | | </LinearLayout> |
| | | |
| New file |
| | |
| | | <?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="match_parent" |
| | | android:background="#00ffffff" |
| | | android:gravity="center" |
| | | android:orientation="vertical"> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_margin="@dimen/dialog_bg_margin" |
| | | android:background="@drawable/base_bg_dialog_top_stroke" |
| | | android:gravity="center" |
| | | android:orientation="vertical"> |
| | | |
| | | <TextView |
| | | android:id="@+id/title" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginLeft="20dp" |
| | | android:layout_marginTop="20dp" |
| | | android:layout_marginRight="20dp" |
| | | android:layout_marginBottom="5dp" |
| | | android:gravity="center" |
| | | android:text="补卡工本费" |
| | | android:textColor="@color/dialog_btn" |
| | | android:textSize="25sp" |
| | | android:textStyle="bold" /> |
| | | |
| | | |
| | | <EditText |
| | | android:id="@+id/pw_et" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="@dimen/edt_height" |
| | | android:layout_marginLeft="20dp" |
| | | android:layout_marginTop="20dp" |
| | | android:layout_marginRight="20dp" |
| | | android:background="@drawable/editbg" |
| | | android:hint="请输入补卡工本费(元)" |
| | | android:paddingLeft="10dp" |
| | | android:textColor="#000000" /> |
| | | |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="2px" |
| | | android:layout_marginTop="20dp" |
| | | android:background="@color/line_bg" /> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:gravity="center_horizontal" |
| | | android:orientation="horizontal" |
| | | android:padding="5dp"> |
| | | |
| | | |
| | | |
| | | |
| | | <TextView |
| | | android:id="@+id/pw_ok" |
| | | android:layout_width="0dp" |
| | | android:layout_height="@dimen/dialog_btn_height" |
| | | android:layout_weight="1" |
| | | android:background="@drawable/textview_select_bg" |
| | | android:gravity="center" |
| | | android:text="确 认" |
| | | android:textColor="@color/dialog_btn" |
| | | android:textSize="20sp" /> |
| | | |
| | | |
| | | </LinearLayout> |
| | | |
| | | |
| | | </LinearLayout> |
| | | |
| | | </LinearLayout> |
| | | |
| New file |
| | |
| | | <?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="match_parent" |
| | | android:background="#40000000" |
| | | android:gravity="center" |
| | | android:orientation="vertical"> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_margin="@dimen/dialog_bg_margin" |
| | | android:background="@drawable/base_bg_dialog_top_stroke" |
| | | android:gravity="center" |
| | | android:orientation="vertical" |
| | | android:padding="5dp"> |
| | | |
| | | <TextView |
| | | |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginLeft="20dp" |
| | | android:layout_marginTop="20dp" |
| | | android:layout_marginRight="20dp" |
| | | android:gravity="center" |
| | | android:text="搜索用户" |
| | | android:textColor="@color/text_color" |
| | | android:textSize="20sp" |
| | | android:textStyle="bold" /> |
| | | |
| | | <EditText |
| | | android:id="@+id/etName" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="50dp" |
| | | android:layout_marginLeft="20dp" |
| | | android:layout_marginTop="20dp" |
| | | android:layout_marginRight="20dp" |
| | | android:background="@drawable/editbg" |
| | | android:hint="请输入用户名" |
| | | android:paddingLeft="15dp" |
| | | android:textColor="#000000" |
| | | android:textCursorDrawable="@drawable/cursor_drawable" /> |
| | | |
| | | <EditText |
| | | android:id="@+id/etCardId" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="50dp" |
| | | android:layout_marginLeft="20dp" |
| | | android:layout_marginTop="20dp" |
| | | android:layout_marginRight="20dp" |
| | | android:background="@drawable/editbg" |
| | | android:hint="请输入身份证号" |
| | | android:paddingLeft="15dp" |
| | | android:textColor="#000000" |
| | | android:textCursorDrawable="@drawable/cursor_drawable" /> |
| | | |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="2px" |
| | | android:layout_marginTop="20dp" |
| | | android:background="@color/line_bg" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/pw_ok" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="@dimen/dialog_btn_height" |
| | | android:gravity="center" |
| | | android:text="确 认" |
| | | android:textColor="@color/dialog_btn" |
| | | android:textSize="@dimen/text_size" /> |
| | | |
| | | </LinearLayout> |
| | | |
| | | </LinearLayout> |
| | | |
| New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <layout xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="vertical"> |
| | | |
| | | <LinearLayout |
| | | android:id="@+id/item" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginLeft="13dp" |
| | | android:layout_marginTop="10dp" |
| | | android:layout_marginRight="13dp" |
| | | android:orientation="vertical"> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | |
| | | android:orientation="horizontal"> |
| | | |
| | | <TextView |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_weight="1" |
| | | android:text="姓名:" |
| | | android:textSize="18sp" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/userName" |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_weight="2" |
| | | android:text="" |
| | | android:textSize="18sp" /> |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="3dp" |
| | | android:orientation="horizontal"> |
| | | |
| | | <TextView |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_weight="1" |
| | | android:text="身份证号:" |
| | | android:textSize="18sp" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/cardID" |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_weight="2" |
| | | android:text="" |
| | | android:textSize="18sp" /> |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="3dp" |
| | | android:orientation="horizontal"> |
| | | |
| | | <TextView |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_weight="1" |
| | | android:text="手机号:" |
| | | android:textSize="18sp" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/phone" |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_weight="2" |
| | | android:text="" |
| | | android:textSize="18sp" /> |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="3dp" |
| | | android:orientation="horizontal"> |
| | | |
| | | <TextView |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_weight="1" |
| | | android:text="地址:" |
| | | android:textSize="18sp" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/address" |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_weight="2" |
| | | android:text="" |
| | | android:textSize="18sp" /> |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="3dp" |
| | | android:orientation="horizontal"> |
| | | |
| | | <TextView |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_weight="1" |
| | | android:text="状态:" |
| | | android:textSize="18sp" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/state" |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_weight="2" |
| | | android:text="" |
| | | android:textSize="18sp" /> |
| | | </LinearLayout> |
| | | </LinearLayout> |
| | | |
| | | |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="1px" |
| | | android:layout_marginTop="13dp" |
| | | android:background="#000000" /> |
| | | |
| | | </LinearLayout> |
| | | </layout> |
| | | |
| New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <layout xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="vertical"> |
| | | |
| | | <LinearLayout |
| | | android:id="@+id/item" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginLeft="13dp" |
| | | android:layout_marginTop="10dp" |
| | | android:layout_marginRight="13dp" |
| | | android:orientation="vertical"> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | |
| | | android:orientation="horizontal"> |
| | | |
| | | <TextView |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_weight="1" |
| | | android:text="卡号:" |
| | | android:textSize="18sp" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/cardId" |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_weight="2" |
| | | android:text="" |
| | | android:textSize="18sp" /> |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="3dp" |
| | | android:orientation="horizontal"> |
| | | |
| | | <TextView |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_weight="1" |
| | | android:text="用户编号:" |
| | | android:textSize="18sp" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/userCode" |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_weight="2" |
| | | android:text="" |
| | | android:textSize="18sp" /> |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="3dp" |
| | | android:orientation="horizontal"> |
| | | |
| | | <TextView |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_weight="1" |
| | | android:text="卡内余额:" |
| | | android:textSize="18sp" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/balance" |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_weight="2" |
| | | android:text="" |
| | | android:textSize="18sp" /> |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="3dp" |
| | | android:orientation="horizontal"> |
| | | |
| | | <TextView |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_weight="1" |
| | | android:text="剩余电量:" |
| | | android:textSize="18sp" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/balanceElectic" |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_weight="2" |
| | | android:text="" |
| | | android:textSize="18sp" /> |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="3dp" |
| | | android:orientation="horizontal"> |
| | | |
| | | <TextView |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_weight="1" |
| | | android:text="累计充值:" |
| | | android:textSize="18sp" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/totalMorny" |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_weight="2" |
| | | android:text="" |
| | | android:textSize="18sp" /> |
| | | </LinearLayout> |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="3dp" |
| | | android:orientation="horizontal"> |
| | | |
| | | <TextView |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_weight="1" |
| | | android:text="卡状态:" |
| | | android:textSize="18sp" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/state" |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_weight="2" |
| | | android:text="" |
| | | android:textSize="18sp" /> |
| | | </LinearLayout> |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="3dp" |
| | | android:gravity="center" |
| | | android:orientation="horizontal"> |
| | | |
| | | <!-- <TextView--> |
| | | <!-- android:layout_width="0dp"--> |
| | | <!-- android:layout_height="wrap_content"--> |
| | | <!-- android:layout_weight="1"--> |
| | | <!-- android:text="最后充值时间:"--> |
| | | <!-- android:textSize="18sp" />--> |
| | | |
| | | <TextView |
| | | android:id="@+id/lastRechargeTime" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | |
| | | android:text="" |
| | | android:textSize="18sp" /> |
| | | </LinearLayout> |
| | | |
| | | |
| | | </LinearLayout> |
| | | |
| | | |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="1px" |
| | | android:layout_marginTop="13dp" |
| | | android:background="#000000" /> |
| | | |
| | | </LinearLayout> |
| | | </layout> |
| | | |