+
+
+
+ 这里是一个H5页面
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/java/com/ycgis/macall/personalcenter/m/adapterbean/ApplyAppBean.java b/app/src/main/java/com/ycgis/macall/personalcenter/m/adapterbean/ApplyAppBean.java
index d8b66a9..f0b9c62 100644
--- a/app/src/main/java/com/ycgis/macall/personalcenter/m/adapterbean/ApplyAppBean.java
+++ b/app/src/main/java/com/ycgis/macall/personalcenter/m/adapterbean/ApplyAppBean.java
@@ -18,10 +18,9 @@ public class ApplyAppBean implements Serializable {
* code : 200
* data : [{"createBy":null,"createTime":"2023-06-02 12:11:26","updateBy":null,"updateTime":"2023-06-03 11:30:27","remark":"是的","id":6,"name":"2121","icon":"/profile/upload/2023/06/02/logo_20230602121120A001.png","category":"1","deptId":340100000000,"deptName":"合肥市公安局","status":1,"createUserId":null,"createDeptId":null,"createUserName":null,"createDeptName":null,"roles":[{"createBy":null,"createTime":null,"updateBy":null,"updateTime":null,"remark":null,"id":9,"appId":6,"roleName":"超级管理员"},{"createBy":null,"createTime":null,"updateBy":null,"updateTime":null,"remark":null,"id":10,"appId":6,"roleName":"地市"}]},{"createBy":null,"createTime":"2023-06-02 10:21:31","updateBy":null,"updateTime":"2023-06-03 11:30:27","remark":"这是一个治安应用2023年6月2日10:21:31","id":1,"name":"皖治通","icon":"/profile/upload/2023/06/02/logo_20230602102112A002.png","category":"1","deptId":340100000000,"deptName":"合肥市公安局","status":1,"createUserId":null,"createDeptId":null,"createUserName":null,"createDeptName":null,"roles":[{"createBy":null,"createTime":null,"updateBy":null,"updateTime":null,"remark":null,"id":11,"appId":1,"roleName":"普通用户"},{"createBy":null,"createTime":null,"updateBy":null,"updateTime":null,"remark":null,"id":12,"appId":1,"roleName":"管理员1"}]},{"createBy":null,"createTime":"2023-06-02 11:58:39","updateBy":null,"updateTime":"2023-06-03 11:30:27","remark":"是否","id":5,"name":"11111","icon":"/profile/upload/2023/06/02/logo_20230602115827A002.png","category":"1","deptId":340000000000,"deptName":"安徽省公安厅","status":1,"createUserId":null,"createDeptId":null,"createUserName":null,"createDeptName":null,"roles":[{"createBy":null,"createTime":null,"updateBy":null,"updateTime":null,"remark":null,"id":13,"appId":5,"roleName":"12"}]},{"createBy":null,"createTime":"2023-06-02 10:56:43","updateBy":null,"updateTime":"2023-06-03 11:30:27","remark":"1","id":3,"name":"云搜索","icon":"/profile/upload/2023/06/02/btn_record_20230602105626A002.png","category":"1","deptId":800701750001,"deptName":"安徽省","status":1,"createUserId":null,"createDeptId":null,"createUserName":null,"createDeptName":null,"roles":[{"createBy":null,"createTime":null,"updateBy":null,"updateTime":null,"remark":null,"id":14,"appId":3,"roleName":"23"}]}]
*/
-
private String msg;
private int code;
- private List data;
+ private List data;
public String getMsg() {
return msg;
@@ -39,11 +38,11 @@ public class ApplyAppBean implements Serializable {
this.code = code;
}
- public List getData() {
+ public List getData() {
return data;
}
- public void setData(List data) {
+ public void setData(List data) {
this.data = data;
}
@@ -51,6 +50,63 @@ public class ApplyAppBean implements Serializable {
return code == 200;
}
+ public static class DataBean2 extends BaseBean implements Serializable {
+ private int id;
+ private String remark;
+ private String roleName;
+ private int roleSort;
+ private int status;
+ private boolean isSelect;
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public String getRemark() {
+ return remark;
+ }
+
+ public void setRemark(String remark) {
+ this.remark = remark;
+ }
+
+ public String getRoleName() {
+ return roleName;
+ }
+
+ public void setRoleName(String roleName) {
+ this.roleName = roleName;
+ }
+
+ public int getRoleSort() {
+ return roleSort;
+ }
+
+ public void setRoleSort(int roleSort) {
+ this.roleSort = roleSort;
+ }
+
+ public int getStatus() {
+ return status;
+ }
+
+ public void setStatus(int status) {
+ this.status = status;
+ }
+
+ public boolean isSelect() {
+ return isSelect;
+ }
+
+ public void setSelect(boolean select) {
+ isSelect = select;
+ }
+ }
+
public static class DataBean extends BaseBean implements Serializable {
/**
* createBy : null
diff --git a/app/src/main/java/com/ycgis/macall/personalcenter/m/adapterbean/ApplyAuditBean.java b/app/src/main/java/com/ycgis/macall/personalcenter/m/adapterbean/ApplyAuditBean.java
index f443b62..74e2220 100644
--- a/app/src/main/java/com/ycgis/macall/personalcenter/m/adapterbean/ApplyAuditBean.java
+++ b/app/src/main/java/com/ycgis/macall/personalcenter/m/adapterbean/ApplyAuditBean.java
@@ -153,8 +153,16 @@ public class ApplyAuditBean extends BaseBean {
return "所在单位意见:";
case "3":
return "所在地市意见:";
+ case "5":
+ return "单位领导意见:";
case "6":
return "省厅意见:";
+ case "7":
+ return "督察部门意见:";
+ case "8":
+ return "纪检部门意见:";
+ case "9":
+ return "政工部门意见:";
default:
return "运维单位:";
}
diff --git a/app/src/main/java/com/ycgis/macall/personalcenter/m/adapterbean/ApplyBean.java b/app/src/main/java/com/ycgis/macall/personalcenter/m/adapterbean/ApplyBean.java
index 5202526..b4d19bf 100644
--- a/app/src/main/java/com/ycgis/macall/personalcenter/m/adapterbean/ApplyBean.java
+++ b/app/src/main/java/com/ycgis/macall/personalcenter/m/adapterbean/ApplyBean.java
@@ -63,6 +63,10 @@ public class ApplyBean extends BaseBean {
return StringUtil.get(applyReason,"暂无");
}
+ public String getApplyReasonStr() {
+ return "申请原因:" +getApplyReason();
+ }
+
public void setApplyReason(String applyReason) {
this.applyReason = applyReason;
}
@@ -124,13 +128,30 @@ public class ApplyBean extends BaseBean {
}
public String getRoleNameStr() {
- return "角色名称:" + roleName;
+ return "权限名称:" + StringUtil.get(roleName,"暂无");
}
public String getRoleName() {
return roleName;
}
+ public String getAuthorityStr() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("权限名称:");
+ if (roleName == null){
+ builder.append("暂无");
+ }else if (roleName.contains("普通")){
+ builder.append("");
+ builder.append(roleName);
+ builder.append("");
+ }else {
+ builder.append("");
+ builder.append(roleName);
+ builder.append("");
+ }
+ return builder.toString();
+ }
+
public void setRoleName(String roleName) {
this.roleName = roleName;
}
diff --git a/app/src/main/java/com/ycgis/macall/personalcenter/m/adapterbean/BluetoothOV.java b/app/src/main/java/com/ycgis/macall/personalcenter/m/adapterbean/BluetoothOV.java
new file mode 100644
index 0000000..8b4e9f7
--- /dev/null
+++ b/app/src/main/java/com/ycgis/macall/personalcenter/m/adapterbean/BluetoothOV.java
@@ -0,0 +1,49 @@
+package com.ycgis.macall.personalcenter.m.adapterbean;
+
+/**
+ * created by: Macall
+ * create time: 2025/5/29 16:23
+ * copyright: @ruansee.com
+ * Describe:
+ */
+public class BluetoothOV {
+ private String name;
+ private String address;
+ private int status;
+ private int type;
+
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getAddress() {
+ return address;
+ }
+
+ public void setAddress(String address) {
+ this.address = address;
+ }
+
+ public int getStatus() {
+ return status;
+ }
+
+ public void setStatus(int status) {
+ this.status = status;
+ }
+
+ public int getType() {
+ return type;
+ }
+
+ public void setType(int type) {
+ this.type = type;
+ }
+
+
+}
diff --git a/app/src/main/java/com/ycgis/macall/personalcenter/m/adapterbean/ExamineDetails.java b/app/src/main/java/com/ycgis/macall/personalcenter/m/adapterbean/ExamineDetails.java
new file mode 100644
index 0000000..c6ad097
--- /dev/null
+++ b/app/src/main/java/com/ycgis/macall/personalcenter/m/adapterbean/ExamineDetails.java
@@ -0,0 +1,12 @@
+package com.ycgis.macall.personalcenter.m.adapterbean;
+
+/**
+ * created by: Macall
+ * create time: 2024/9/17 11:28
+ * copyright: @ruansee.com
+ * Describe:
+ */
+public class ExamineDetails {
+
+
+}
diff --git a/app/src/main/java/com/ycgis/macall/personalcenter/m/datamodel/PrintModel.java b/app/src/main/java/com/ycgis/macall/personalcenter/m/datamodel/PrintModel.java
new file mode 100644
index 0000000..361d3de
--- /dev/null
+++ b/app/src/main/java/com/ycgis/macall/personalcenter/m/datamodel/PrintModel.java
@@ -0,0 +1,79 @@
+package com.ycgis.macall.personalcenter.m.datamodel;
+
+/**
+ * created by: Macall
+ * create time: 2025/5/29 16:56
+ * copyright: @ruansee.com
+ * Describe:
+ */
+public class PrintModel {
+// "content":"文字内容",
+// * "printType":1
+
+ private String content;
+ private int printType;
+ private int contentWidth;
+ private int contentHeight;
+ private int pageHeight;
+ private int pageWidth;
+ private int zoomLevel;
+
+ public int getZoomLevel() {
+ if (zoomLevel>32) return 32;
+ return Math.max(zoomLevel, 1);
+ }
+
+ public void setZoomLevel(int zoomLevel) {
+ this.zoomLevel = zoomLevel;
+ }
+
+ public String getContent() {
+ return content;
+ }
+
+ public void setContent(String content) {
+ this.content = content;
+ }
+
+ public int getPrintType() {
+ return printType;
+ }
+
+ public void setPrintType(int printType) {
+ this.printType = printType;
+ }
+
+ public int getContentWidth() {
+ return contentWidth;
+ }
+
+ public void setContentWidth(int contentWidth) {
+ this.contentWidth = contentWidth;
+ }
+
+ public int getContentHeight() {
+ return contentHeight;
+ }
+
+ public void setContentHeight(int contentHeight) {
+ this.contentHeight = contentHeight;
+ }
+
+ public int getPageHeight() {
+ if (pageHeight<100)return 100;
+ return Math.min(pageHeight,2000);
+ }
+
+ public void setPageHeight(int pageHeight) {
+ this.pageHeight = pageHeight;
+ }
+
+ public int getPageWidth() {
+ if (pageWidth<100)return 100;
+ return Math.min(pageWidth,2000);
+ }
+
+ public void setPageWidth(int pageWidth) {
+ this.pageWidth = pageWidth;
+ }
+}
diff --git a/app/src/main/java/com/ycgis/macall/personalcenter/m/provider/BluetoothBroadcastReceiver.java b/app/src/main/java/com/ycgis/macall/personalcenter/m/provider/BluetoothBroadcastReceiver.java
new file mode 100644
index 0000000..55d7d27
--- /dev/null
+++ b/app/src/main/java/com/ycgis/macall/personalcenter/m/provider/BluetoothBroadcastReceiver.java
@@ -0,0 +1,47 @@
+package com.ycgis.macall.personalcenter.m.provider;
+
+import android.bluetooth.BluetoothDevice;
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.os.Build;
+
+import com.ycgis.macall.personalcenter.m.adapterbean.BluetoothOV;
+import com.ycgis.macall.personalcenter.util.BluetoothManage;
+
+import org.greenrobot.eventbus.EventBus;
+
+/**
+ * created by: Macall
+ * create time: 2025/5/29 17:37
+ * copyright: @ruansee.com
+ * Describe:
+ */
+public class BluetoothBroadcastReceiver extends BroadcastReceiver {
+
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ String action = intent.getAction();
+ if (BluetoothDevice.ACTION_BOND_STATE_CHANGED.equals(action)) {
+ BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
+ int bondState = intent.getIntExtra(BluetoothDevice.EXTRA_BOND_STATE, BluetoothDevice.ERROR);
+ int prevBondState = intent.getIntExtra(BluetoothDevice.EXTRA_PREVIOUS_BOND_STATE, BluetoothDevice.ERROR);
+ if (bondState == BluetoothDevice.BOND_BONDING) {
+
+ // 正在配对
+ } else if (bondState == BluetoothDevice.BOND_BONDED) {
+ // 配对成功
+
+ } else if (bondState == BluetoothDevice.BOND_NONE) {
+
+ // 取消配对/配对失败
+ }
+ }
+ if (BluetoothDevice.ACTION_ACL_CONNECTED.equals(action)) {
+ // 设备已连接
+ } else if (BluetoothDevice.ACTION_ACL_DISCONNECTED.equals(action)) {
+ // 设备已断开
+ }
+ }
+
+}
diff --git a/app/src/main/java/com/ycgis/macall/personalcenter/m/requestbean/BaseRequestModel.java b/app/src/main/java/com/ycgis/macall/personalcenter/m/requestbean/BaseRequestModel.java
index 68d5e37..d5dd039 100644
--- a/app/src/main/java/com/ycgis/macall/personalcenter/m/requestbean/BaseRequestModel.java
+++ b/app/src/main/java/com/ycgis/macall/personalcenter/m/requestbean/BaseRequestModel.java
@@ -14,6 +14,8 @@ public class BaseRequestModel {
private int total;
// private int counts;
private T data;
+ private T rows;
+
// public int getCounts() {
// return counts;
@@ -23,6 +25,15 @@ public class BaseRequestModel {
// this.counts = counts;
// }
+
+ public T getRows() {
+ return rows;
+ }
+
+ public void setRows(T rows) {
+ this.rows = rows;
+ }
+
public int getTotal() {
return total;
}
diff --git a/app/src/main/java/com/ycgis/macall/personalcenter/p/app/AppCache.java b/app/src/main/java/com/ycgis/macall/personalcenter/p/app/AppCache.java
index 39c29f5..ab6dab5 100644
--- a/app/src/main/java/com/ycgis/macall/personalcenter/p/app/AppCache.java
+++ b/app/src/main/java/com/ycgis/macall/personalcenter/p/app/AppCache.java
@@ -37,11 +37,11 @@ public class AppCache {
//统一认证token
private String token;
+ /* 用户信息加密 */
private String userInfo;
private String imei,imsi;
-
private AppCache() {
}
@@ -55,7 +55,6 @@ public class AppCache {
return appCache;
}
-
public void setIpAndPort(String ip,String port){
this.ip = ip;
this.port = port;
@@ -125,11 +124,12 @@ public class AppCache {
}
public String getUserInfo() {
- return userInfo;
+ return StringUtil.get(userInfo,RuanseeApplication.getStringValue("appUserInfo"));
}
public void setUserInfo(String userInfo) {
this.userInfo = userInfo;
+ RuanseeApplication.saveData("appUserInfo",userInfo);
}
public String getImei() {
diff --git a/app/src/main/java/com/ycgis/macall/personalcenter/p/app/MyAppGlideModule.java b/app/src/main/java/com/ycgis/macall/personalcenter/p/app/MyAppGlideModule.java
index f0f98ba..4e9abab 100644
--- a/app/src/main/java/com/ycgis/macall/personalcenter/p/app/MyAppGlideModule.java
+++ b/app/src/main/java/com/ycgis/macall/personalcenter/p/app/MyAppGlideModule.java
@@ -18,6 +18,7 @@ import com.bumptech.glide.module.AppGlideModule;
import com.bumptech.glide.request.RequestOptions;
import com.rs.macall.androidx.basemodel.request.OkHttpUtils;
import com.ycgis.macall.personalcenter.R;
+import com.ycgis.macall.personalcenter.p.request.interceptors.HttpLoggingInterceptor;
import com.ycgis.macall.personalcenter.util.FileUtils;
import org.jetbrains.annotations.NotNull;
@@ -34,7 +35,7 @@ public class MyAppGlideModule extends AppGlideModule {
@Override
public void registerComponents(@NonNull Context context, @NonNull Glide glide, @NonNull Registry registry) {
- OkHttpUrlLoader.Factory factory = new OkHttpUrlLoader.Factory(OkHttpUtils.getClient(30,40,60));
+ OkHttpUrlLoader.Factory factory = new OkHttpUrlLoader.Factory(OkHttpUtils.getClient(30,40,60,new HttpLoggingInterceptor()));
registry.replace(GlideUrl.class, InputStream.class, factory);
}
diff --git a/app/src/main/java/com/ycgis/macall/personalcenter/p/app/RuanseeApplication.java b/app/src/main/java/com/ycgis/macall/personalcenter/p/app/RuanseeApplication.java
index e38b350..201c96c 100644
--- a/app/src/main/java/com/ycgis/macall/personalcenter/p/app/RuanseeApplication.java
+++ b/app/src/main/java/com/ycgis/macall/personalcenter/p/app/RuanseeApplication.java
@@ -51,6 +51,7 @@ public class RuanseeApplication extends BaseApplication {
.setBorderSwitch(isPrintLog)
.setLogSwitch(isPrintLog)
.setLog2FileSwitch(false);
+// DeviceIdentifier.register(this);
//统一服务组件
USMConfigure.getDefault().init("11811535", "grzx_test_app");
diff --git a/app/src/main/java/com/ycgis/macall/personalcenter/p/callback/BluetoothFragmentListener.java b/app/src/main/java/com/ycgis/macall/personalcenter/p/callback/BluetoothFragmentListener.java
new file mode 100644
index 0000000..d5019df
--- /dev/null
+++ b/app/src/main/java/com/ycgis/macall/personalcenter/p/callback/BluetoothFragmentListener.java
@@ -0,0 +1,17 @@
+package com.ycgis.macall.personalcenter.p.callback;
+
+import android.bluetooth.BluetoothDevice;
+
+/**
+ * created by: Macall
+ * create time: 2025/5/30 16:49
+ * copyright: @ruansee.com
+ * Describe:
+ */
+public interface BluetoothFragmentListener {
+
+ void onClickBluetoothDevice(BluetoothDevice device);
+
+ void onError(int code,String msg);
+
+}
diff --git a/app/src/main/java/com/ycgis/macall/personalcenter/p/presenter/BtnSkip.java b/app/src/main/java/com/ycgis/macall/personalcenter/p/presenter/BtnSkip.java
new file mode 100644
index 0000000..c514dfc
--- /dev/null
+++ b/app/src/main/java/com/ycgis/macall/personalcenter/p/presenter/BtnSkip.java
@@ -0,0 +1,90 @@
+package com.ycgis.macall.personalcenter.p.presenter;
+
+import android.content.Context;
+import android.util.ArrayMap;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import androidx.core.content.ContextCompat;
+
+import com.ycgis.macall.personalcenter.R;
+
+import java.util.Map;
+
+/**
+ * created by: Macall
+ * create time: 2024/3/16 17:51
+ * copyright: @ruansee.com
+ * Describe:
+ */
+public class BtnSkip {
+ private Map contentMap;
+ private Context context;
+ private int selColorId = R.color.colorWhite,defColorId = R.color.colorGrey8;
+
+ public BtnSkip(Context context) {
+ this.context = context;
+ this.contentMap = new ArrayMap<>();
+ }
+
+ public BtnSkip setTextColor(int selColorId , int defColorId){
+ this.defColorId = defColorId;
+ this.selColorId = selColorId;
+ return this;
+ }
+
+ public BtnSkip add(int index, Content content){
+ contentMap.put(index,content);
+ return this;
+ }
+
+ public void clean(){
+ context = null;
+ if (contentMap!=null){
+ for (int key:contentMap.keySet()) {
+ Content content = contentMap.get(key);
+ if (content!=null){
+ content.clean();
+ }
+ }
+ contentMap.clear();
+ }
+
+ contentMap = null;
+ }
+
+ public void unDateStatus(int index,boolean isSel){
+ Content content = contentMap.get(index);
+ if (content == null) return;
+ content.setStatus(isSel);
+ }
+
+ public class Content{
+ private TextView view;
+ private ImageView image;
+ private int selDrawable,defDrawable;
+
+ public Content(TextView view, ImageView image, int selDrawable, int defDrawable) {
+ this.view = view;
+ this.image = image;
+ this.selDrawable = selDrawable;
+ this.defDrawable = defDrawable;
+ }
+
+ private void setStatus(boolean isSel){
+ if (isSel){
+ view.setTextColor(ContextCompat.getColor(context,selColorId));
+ image.setImageDrawable(ContextCompat.getDrawable(context,selDrawable));
+ }else {
+ view.setTextColor(ContextCompat.getColor(context,defColorId));
+ image.setImageDrawable(ContextCompat.getDrawable(context,defDrawable));
+ }
+ }
+
+ public void clean(){
+ view = null;
+ selDrawable = 0;
+ defColorId = 0;
+ }
+ }
+}
diff --git a/app/src/main/java/com/ycgis/macall/personalcenter/p/presenter/WebViewPresenter.java b/app/src/main/java/com/ycgis/macall/personalcenter/p/presenter/WebViewPresenter.java
index ca2ebb7..bf8a5a6 100644
--- a/app/src/main/java/com/ycgis/macall/personalcenter/p/presenter/WebViewPresenter.java
+++ b/app/src/main/java/com/ycgis/macall/personalcenter/p/presenter/WebViewPresenter.java
@@ -319,7 +319,6 @@ public class WebViewPresenter extends BasePresenter {
}
};
-
public void showLoadWebError(String titleStr, String msg, String lxryName, String lxryPhone) {
if (StringUtil.isNullOrEmpty(titleStr)){
titleStr = "温馨提示";
diff --git a/app/src/main/java/com/ycgis/macall/personalcenter/p/request/AsyncBitmapLoader.java b/app/src/main/java/com/ycgis/macall/personalcenter/p/request/AsyncBitmapLoader.java
index 6fe9b05..1e84999 100644
--- a/app/src/main/java/com/ycgis/macall/personalcenter/p/request/AsyncBitmapLoader.java
+++ b/app/src/main/java/com/ycgis/macall/personalcenter/p/request/AsyncBitmapLoader.java
@@ -15,6 +15,7 @@ import com.rs.macall.androidx.basemodel.utils.TypConversion;
import com.ycgis.macall.personalcenter.p.app.RuanseeApplication;
import com.ycgis.macall.personalcenter.p.callback.BaseRequestCallback;
import com.ycgis.macall.personalcenter.p.callback.ImageCallBack;
+import com.ycgis.macall.personalcenter.p.request.interceptors.HttpLoggingInterceptor;
import com.ycgis.macall.personalcenter.util.FileUtils;
import com.ycgis.macall.personalcenter.v.activity.applyfo.ApplyForMainActivity;
@@ -162,7 +163,7 @@ public class AsyncBitmapLoader {
Request request = new Request.Builder()
.url(url)
.build();
- OkHttpUtils.getClient(10, 30, 40)
+ OkHttpUtils.getClient(10, 30, 40,new HttpLoggingInterceptor())
.newCall(request)
.enqueue(new Callback() {
@Override
diff --git a/app/src/main/java/com/ycgis/macall/personalcenter/p/request/RetrofitService.java b/app/src/main/java/com/ycgis/macall/personalcenter/p/request/RetrofitService.java
index 5c89b46..3512944 100644
--- a/app/src/main/java/com/ycgis/macall/personalcenter/p/request/RetrofitService.java
+++ b/app/src/main/java/com/ycgis/macall/personalcenter/p/request/RetrofitService.java
@@ -27,6 +27,7 @@ public class RetrofitService {
public static void resetRetrofitApi() {
retrofitService = new Retrofit.Builder()
.baseUrl(RuanseeApplication.getAppCache().getBaseUrlPath())
+ .client(OkHttpUtils.getClient(10, 10, 10,new HttpLoggingInterceptor()))
.addConverterFactory(new NullOnEmptyConverterFactory())//处理接口返回没有响应体body
// 添加Gson转换器
.addConverterFactory(GsonConverterFactory.create())
@@ -36,7 +37,6 @@ public class RetrofitService {
// ))
// 添加Retrofit到RxJava的转换器
.addCallAdapterFactory(RxJava2CallAdapterFactory.create())
- .client(OkHttpUtils.getClient(10, 10, 10,new HttpLoggingInterceptor()))
.build()
.create(
RetrofitApi.class);
diff --git a/app/src/main/java/com/ycgis/macall/personalcenter/p/request/interceptors/HttpLoggingInterceptor.java b/app/src/main/java/com/ycgis/macall/personalcenter/p/request/interceptors/HttpLoggingInterceptor.java
index 1ad1f58..d5f0eee 100644
--- a/app/src/main/java/com/ycgis/macall/personalcenter/p/request/interceptors/HttpLoggingInterceptor.java
+++ b/app/src/main/java/com/ycgis/macall/personalcenter/p/request/interceptors/HttpLoggingInterceptor.java
@@ -33,7 +33,6 @@ public class HttpLoggingInterceptor implements Interceptor {
private static final Charset UTF8 = Charset.forName("UTF-8");
- private Map headers;
public enum Level {
/**
@@ -111,16 +110,6 @@ public class HttpLoggingInterceptor implements Interceptor {
this(Logger.DEFAULT);
}
- /**
- * 设置请求Header
- *
- * @param headers header 集合
- */
- public HttpLoggingInterceptor(Map headers) {
- this(Logger.DEFAULT);
- this.headers = headers;
- }
-
public HttpLoggingInterceptor(Logger logger) {
this.logger = logger;
}
@@ -148,7 +137,7 @@ public class HttpLoggingInterceptor implements Interceptor {
RuanseeApplication.getAppCache().setUserInfo(s);
}
requestBuilder.addHeader("userInfo", RuanseeApplication.getAppCache().getUserInfo());
- String se = requestS.url().toString();
+// String se = requestS.url().toString();
// if (StringUtil.hasContent(se)) {
// if (!se.endsWith(".jpg") && !se.endsWith(".png")&&!se.contains("wzt")){
// se = se.replace("http://" + RuanseeApplication.getAppCache().getIp() + ":8081/", RuanseeApplication.getAppCache().getBaseUrlPath());
diff --git a/app/src/main/java/com/ycgis/macall/personalcenter/util/BluetoothManage.java b/app/src/main/java/com/ycgis/macall/personalcenter/util/BluetoothManage.java
new file mode 100644
index 0000000..2c2c3de
--- /dev/null
+++ b/app/src/main/java/com/ycgis/macall/personalcenter/util/BluetoothManage.java
@@ -0,0 +1,383 @@
+package com.ycgis.macall.personalcenter.util;
+
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.app.Dialog;
+import android.bluetooth.BluetoothAdapter;
+import android.bluetooth.BluetoothDevice;
+import android.bluetooth.BluetoothSocket;
+import android.bluetooth.le.BluetoothLeScanner;
+import android.bluetooth.le.ScanCallback;
+import android.bluetooth.le.ScanResult;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.graphics.Bitmap;
+import android.graphics.Color;
+import android.os.Build;
+import android.view.LayoutInflater;
+import android.view.View;
+
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.google.zxing.BarcodeFormat;
+import com.google.zxing.WriterException;
+import com.google.zxing.common.BitMatrix;
+import com.google.zxing.qrcode.QRCodeWriter;
+import com.rs.macall.androidx.basemodel.callback.SimpleListClickListener;
+import com.rs.macall.androidx.basemodel.decoration.MyDividerItemDecoration;
+import com.rs.macall.androidx.basemodel.utils.BitMapUtils;
+import com.rs.macall.androidx.basemodel.utils.LogUtils;
+import com.ycgis.macall.personalcenter.R;
+import com.ycgis.macall.personalcenter.m.adapterbean.BluetoothOV;
+import com.ycgis.macall.personalcenter.m.datamodel.PrintModel;
+import com.ycgis.macall.personalcenter.m.provider.BluetoothBroadcastReceiver;
+import com.ycgis.macall.personalcenter.v.adapter.BluetoothListAdapter;
+
+import org.greenrobot.eventbus.EventBus;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+import java.util.UUID;
+
+/**
+ * created by: Macall
+ * create time: 2025/5/29 11:22
+ * copyright: @ruansee.com
+ * Describe:
+ */
+public class BluetoothManage {
+ private static BluetoothManage bluetoothManage;
+ public final static int REQUEST_OPEN_BLUETOOTH = 0x142;
+ private BluetoothAdapter bluetoothAdapter;
+
+ private BluetoothSocket bluetoothSocket;
+ private OutputStream outputStream;
+ private InputStream inputStream;
+ private BluetoothBroadcastReceiver receiver;
+
+ private CallBack callBack;
+
+ // SPP UUID
+ private static final UUID SPP_UUID = UUID.fromString("00001101-0000-1000-8000-00805F9B34FB");
+
+ public void setCallBack(CallBack callBack) {
+ this.callBack = callBack;
+ }
+
+ private BluetoothManage() {
+
+ }
+
+
+ public static BluetoothManage getInstance() {
+ if (bluetoothManage == null) {
+ synchronized (BluetoothManage.class) {
+ if (bluetoothManage == null) {
+ bluetoothManage = new BluetoothManage();
+ }
+ }
+ }
+ return bluetoothManage;
+ }
+
+ /**
+ * 设备是否支持蓝牙
+ *
+ * @return
+ */
+ public boolean init() {
+ bluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
+ if (bluetoothAdapter == null) {
+ // 设备不支持蓝牙
+ return false;
+ }
+ return true;
+ }
+
+ // 发送数据
+ public boolean sendData(List dataList) {
+ if (outputStream != null) {
+ if (dataList == null) return false;
+ try {
+ for (int i = 0; i < dataList.size(); i++) {
+ PrintModel printModel = dataList.get(i);
+ if (printModel.getPrintType() == 1) {
+ outputStream.write(printModel.getContent().getBytes("GBK")); // 部分打印机需GBK编码
+ } else if (printModel.getPrintType() == 2) {
+ Bitmap bitmap = generateQRCode(printModel.getContent(), 100);
+ if (bitmap == null) continue;
+ outputStream.write(decodeBitmap(bitmap)); // 部分打印机需GBK编码
+ } else if (printModel.getPrintType() == 3) {
+ Bitmap bitmap = BitMapUtils.base64ToBitmap(printModel.getContent());
+ if (bitmap == null) continue;
+ outputStream.write(decodeBitmap(bitmap)); // 部分打印机需GBK编码
+ }
+ }
+ outputStream.flush();
+ return true;
+ } catch (IOException | WriterException e) {
+ e.printStackTrace();
+ }
+ }
+ return false;
+ }
+
+ /**
+ * 判断蓝牙是否打开
+ *
+ * @param activity
+ * @return 打开 true false 未打开,并跳转设置页面
+ */
+ public boolean isBluetoothOpen(Activity activity, boolean isSkipSetting) {
+ if (!bluetoothAdapter.isEnabled()) {
+ if (isSkipSetting) {
+ Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
+ activity.startActivityForResult(enableBtIntent, REQUEST_OPEN_BLUETOOTH);
+ }
+ return false;
+ }
+ return true;
+ }
+
+
+ // 连接指定MAC地址的打印机
+ public boolean connect(String macAddress) {
+ if (bluetoothAdapter == null) return false;
+ BluetoothDevice device = bluetoothAdapter.getRemoteDevice(macAddress);
+ try {
+ bluetoothSocket = device.createRfcommSocketToServiceRecord(SPP_UUID);
+ bluetoothSocket.connect();
+ outputStream = bluetoothSocket.getOutputStream();
+ return true;
+ } catch (IOException e) {
+ e.printStackTrace();
+ close();
+ return false;
+ }
+ }
+
+ public boolean SPPOpen(BluetoothDevice myDevice) {
+ boolean error = false;
+ bluetoothAdapter = bluetoothAdapter;
+
+ if (!bluetoothAdapter.isEnabled()) {
+ if (callBack != null) {
+ callBack.onConnect(false, "蓝牙适配器没有打开");
+ }
+ return false;
+ }
+ bluetoothAdapter.cancelDiscovery();
+
+ try {
+ //bluetoothSocket = myDevice.createRfcommSocketToServiceRecord(SPP_UUID);
+ Method m = myDevice.getClass().getMethod("createRfcommSocket", new Class[]{int.class});
+ bluetoothSocket = (android.bluetooth.BluetoothSocket) m.invoke(myDevice, 1);
+ } catch (SecurityException | IllegalArgumentException | NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
+ bluetoothSocket = null;
+ if (callBack != null) {
+ callBack.onConnect(false, "蓝牙端口错误");
+ }
+ return false;
+ }
+
+ try {
+ bluetoothSocket.connect();
+ } catch (IOException e2) {
+ if (callBack != null) {
+ callBack.onConnect(false, e2.getLocalizedMessage());
+ }
+ bluetoothSocket = null;
+ return false;
+ }
+
+ try {
+ outputStream = bluetoothSocket.getOutputStream();
+ } catch (IOException e3) {
+ outputStream = null;
+ error = true;
+ return false;
+ }
+
+ try {
+ inputStream = bluetoothSocket.getInputStream();
+ } catch (IOException e3) {
+ inputStream = null;
+ error = true;
+ return false;
+ }
+
+ if (error) {
+ //SPPClose();
+ return false;
+ }
+
+ return true;
+ }
+
+ public boolean disconnect() {
+ if (!SPPClose())
+ return false;
+ return true;
+ }
+
+ private boolean SPPClose() {
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ }
+ if (outputStream != null) {
+ try {
+ outputStream.flush();
+ } catch (IOException e1) {
+ }
+ try {
+ outputStream.close();
+ } catch (IOException e) {
+ }
+ outputStream = null;
+ }
+ if (inputStream != null) {
+ try {
+ inputStream.close();
+ } catch (IOException e) {
+ }
+ inputStream = null;
+ }
+ if (bluetoothSocket != null) {
+ try {
+ bluetoothSocket.close();
+ } catch (IOException e) {
+ }
+ bluetoothSocket = null;
+ }
+ try {
+ Thread.sleep(200);
+ } catch (InterruptedException e) {
+ }
+ return true;
+ }
+
+
+ // 检查是否已连接
+ public boolean isConnected() {
+ return bluetoothSocket != null && bluetoothSocket.isConnected();
+ }
+
+ // 断开连接
+ public void close() {
+ try {
+ if (outputStream != null) outputStream.close();
+ if (bluetoothSocket != null) bluetoothSocket.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ outputStream = null;
+ bluetoothSocket = null;
+ }
+
+ public BluetoothBroadcastReceiver getReceiver() {
+ if (receiver == null) {
+ receiver = new BluetoothBroadcastReceiver();
+ }
+ return receiver;
+ }
+
+ public void searchBluetoothList(ScanCallback callback) {
+ if (callback == null) return;
+ BluetoothLeScanner bluetoothLeScanner = bluetoothAdapter.getBluetoothLeScanner();
+ if (bluetoothLeScanner != null) {
+ stop(callback);
+ bluetoothAdapter.getBluetoothLeScanner().startScan(callback);
+ }
+ }
+
+ public void stop(ScanCallback callback) {
+ if (callback == null) return;
+ BluetoothLeScanner bluetoothLeScanner = bluetoothAdapter.getBluetoothLeScanner();
+ if (bluetoothLeScanner != null) {
+ bluetoothLeScanner.stopScan(callback);
+ }
+ }
+
+
+ /**
+ * 生成二位码图片
+ *
+ * @param content
+ * @param size
+ * @return
+ * @throws WriterException
+ */
+ public Bitmap generateQRCode(String content, int size) throws WriterException {
+ QRCodeWriter writer = new QRCodeWriter();
+ BitMatrix bitMatrix = writer.encode(content, BarcodeFormat.QR_CODE, size, size);
+ Bitmap bmp = Bitmap.createBitmap(size, size, Bitmap.Config.RGB_565);
+ for (int x = 0; x < size; x++) {
+ for (int y = 0; y < size; y++) {
+ bmp.setPixel(x, y, bitMatrix.get(x, y) ? Color.BLACK : Color.WHITE);
+ }
+ }
+ return bmp;
+ }
+
+ /**
+ * 位图转换
+ *
+ * @param bmp
+ * @return
+ */
+ public byte[] decodeBitmap(Bitmap bmp) {
+ int width = bmp.getWidth();
+ int height = bmp.getHeight();
+ int[] pixels = new int[width * height];
+ bmp.getPixels(pixels, 0, width, 0, 0, width, height);
+
+ // 生成 ESC/POS 位图指令
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ baos.write(0x1D);
+ baos.write(0x76);
+ baos.write(0x30);
+ baos.write(0x00);
+ baos.write(width / 8); // 宽度(以8为单位)
+ baos.write(0x00);
+ baos.write(height % 256); // 高度低字节
+ baos.write(height / 256); // 高度高字节
+
+ for (int y = 0; y < height; y++) {
+ for (int x = 0; x < width; x += 8) {
+ byte b = 0;
+ for (int n = 0; n < 8; n++) {
+ int pixel = pixels[y * width + x + n];
+ int gray = (Color.red(pixel) + Color.green(pixel) + Color.blue(pixel)) / 3;
+ if (gray < 128) {
+ b |= (1 << (7 - n));
+ }
+ }
+ baos.write(b);
+ }
+ }
+ return baos.toByteArray();
+ }
+
+
+ public interface CallBack {
+
+ void onConnect(boolean connect, String msg);
+
+ void onPrintSuccess();
+
+ void onPrintFail(String msg);
+
+ }
+
+}
diff --git a/app/src/main/java/com/ycgis/macall/personalcenter/util/FileUtils.java b/app/src/main/java/com/ycgis/macall/personalcenter/util/FileUtils.java
index f3ae679..ab11910 100644
--- a/app/src/main/java/com/ycgis/macall/personalcenter/util/FileUtils.java
+++ b/app/src/main/java/com/ycgis/macall/personalcenter/util/FileUtils.java
@@ -181,6 +181,11 @@ public class FileUtils {
}
}
+ /**
+ * 计算文件
+ * @param file 文件
+ * @return 大小单位Bit
+ */
public static long calculateFileSize(File file) {
long totals = 0;
if (!file.exists()) return 0;
diff --git a/app/src/main/java/com/ycgis/macall/personalcenter/util/LocationGPSManage.java b/app/src/main/java/com/ycgis/macall/personalcenter/util/LocationGPSManage.java
index 4dfe602..027b84a 100644
--- a/app/src/main/java/com/ycgis/macall/personalcenter/util/LocationGPSManage.java
+++ b/app/src/main/java/com/ycgis/macall/personalcenter/util/LocationGPSManage.java
@@ -68,6 +68,7 @@ public class LocationGPSManage implements LifecycleObserver {
}
private LocationGPSManage() {
+
}
/**
diff --git a/app/src/main/java/com/ycgis/macall/personalcenter/util/ReadDeviceInfo.java b/app/src/main/java/com/ycgis/macall/personalcenter/util/ReadDeviceInfo.java
index 6e2d600..38d1a76 100644
--- a/app/src/main/java/com/ycgis/macall/personalcenter/util/ReadDeviceInfo.java
+++ b/app/src/main/java/com/ycgis/macall/personalcenter/util/ReadDeviceInfo.java
@@ -5,6 +5,7 @@ import android.annotation.SuppressLint;
import android.content.Context;
import android.content.pm.PackageManager;
import android.os.Build;
+import android.provider.Settings;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
@@ -26,6 +27,24 @@ import java.lang.reflect.Method;
public class ReadDeviceInfo {
private static final String TAG = "ReadDeviceInfo";
+
+ public static String getOAID(Context context) {
+ String oaid = null;
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
+ oaid = Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID);
+ } else {
+ oaid = Settings.System.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID);
+ }
+ //处理获取到的OAID
+ if (oaid == null || oaid.isEmpty()) {
+ // OAID获取失败
+ } else {
+ // 成功获取到OAID,进行后续操作
+ }
+ return oaid;
+ }
+
+
/**
* 获取默认的imei 一般都是IMEI 1
*
diff --git a/app/src/main/java/com/ycgis/macall/personalcenter/util/SearchHistoryUtils.java b/app/src/main/java/com/ycgis/macall/personalcenter/util/SearchHistoryUtils.java
index 1b3e928..0a00159 100644
--- a/app/src/main/java/com/ycgis/macall/personalcenter/util/SearchHistoryUtils.java
+++ b/app/src/main/java/com/ycgis/macall/personalcenter/util/SearchHistoryUtils.java
@@ -10,6 +10,7 @@ import com.ycgis.macall.personalcenter.p.app.RuanseeApplication;
* copyright: @ruansee.com
* Describe:
*/
+@Deprecated
public class SearchHistoryUtils {
public static final String SEARCH_HISTORY = "searchHistory";
diff --git a/app/src/main/java/com/ycgis/macall/personalcenter/util/ToThirdPartyAppUtils.java b/app/src/main/java/com/ycgis/macall/personalcenter/util/ToThirdPartyAppUtils.java
index dc25965..d4d90f2 100644
--- a/app/src/main/java/com/ycgis/macall/personalcenter/util/ToThirdPartyAppUtils.java
+++ b/app/src/main/java/com/ycgis/macall/personalcenter/util/ToThirdPartyAppUtils.java
@@ -220,14 +220,8 @@ public class ToThirdPartyAppUtils implements LifecycleObserver {
param.put("deptId", RuanseeApplication.getUserData().getDeptCode());
param.put("deptName", RuanseeApplication.getUserData().getDeptName());
param.put("type", operatorType);
- String url = "http://192.168.43.183:8081/wzt/app/v1/zamh/addOperationRecords";
+// String url = "http://192.168.43.183:8081/wzt/app/v1/zamh/addOperationRecords";
- Object appId1 = param.get("appId");
- if (appId1 instanceof Long){
- long id = (long) appId1;
- }else if(appId1 instanceof Integer) {
- int id = (int) appId1;
- }
// MediaType mediaType = MediaType.parse("application/json;charset=utf-8");
MediaType mediaType = MediaType.Companion.parse("application/json;charset=utf-8");
diff --git a/app/src/main/java/com/ycgis/macall/personalcenter/v/activity/AboutActivity.java b/app/src/main/java/com/ycgis/macall/personalcenter/v/activity/AboutActivity.java
index ef1a908..7f68bbb 100644
--- a/app/src/main/java/com/ycgis/macall/personalcenter/v/activity/AboutActivity.java
+++ b/app/src/main/java/com/ycgis/macall/personalcenter/v/activity/AboutActivity.java
@@ -8,8 +8,11 @@ import android.os.Bundle;
import androidx.annotation.NonNull;
+import com.anhui.police.market.callback.AbstractMarketResult;
+import com.anhui.police.market.sdk.MarketConfigure;
import com.fri.libfriapkrecord.read.SignRecordTools;
import com.rs.macall.androidx.basemodel.base.BaseViewBindActivity;
+import com.rs.macall.androidx.basemodel.utils.LogUtils;
import com.rs.macall.androidx.basemodel.utils.StringUtil;
import com.rs.macall.androidx.basemodel.utils.ToastUtil;
import com.ycgis.macall.personalcenter.R;
@@ -68,14 +71,42 @@ public class AboutActivity extends BaseViewBindActivity {
viewBinding.aboutVersionNum.setText(version[0]);
viewBinding.aboutVersionName.setText("V " + version[1]);
String recordNumber = RuanseeApplication.getStringValue("NRRecordNumber");
- if (StringUtil.isNullOrEmpty(recordNumber)||recordNumber.contains("应用未备案")||recordNumber.contains("未获取")){
+ if (StringUtil.isNullOrEmpty(recordNumber) || recordNumber.contains("应用未备案") || recordNumber.contains("未获取")) {
//读取备案号
String apkPath = getNativeApkPath(getApplicationContext());
recordNumber = SignRecordTools.readNumbers(apkPath);
- RuanseeApplication.saveData("NRRecordNumber",recordNumber);
+ RuanseeApplication.saveData("NRRecordNumber", recordNumber);
}
- viewBinding.tvBah.setText(String.format("全国注册备案号:%s",recordNumber));
-// jsdx();
+ viewBinding.tvBah.setText(String.format("全国注册备案号:%s", recordNumber));
+
+ //3.0.20240111 没有添加检测更新
+ MarketConfigure.detectAppUpdates(this, false, "", new AbstractMarketResult() {
+ @Override
+ public void onResult(String result, boolean upgrade) {
+ LogUtils.w(result);
+ }
+
+ @Override
+ public void onConfirm(int stateType) {
+ LogUtils.w("stateType:" + stateType);
+
+ }
+
+ @Override
+ public void onCancel() {
+ LogUtils.w("onCancel");
+ }
+
+ @Override
+ public void onWarning() {
+ LogUtils.w("onWarning");
+ }
+
+ @Override
+ public void onResult(String result) {
+ LogUtils.w(result);
+ }
+ });
}
//获取系统内APK文件路径
@@ -96,24 +127,24 @@ public class AboutActivity extends BaseViewBindActivity {
private void jsdx() {
Observable.create(emitter -> {
String s = FileUtils.initFilePath(getContext());
- File file = new File(s);
- if (!file.exists()){
+ File file = new File(s);
+ if (!file.exists()) {
throw new FileNotFoundException("没有找到指定文件夹");
}
long l = FileUtils.calculateFileSize(file);
- emitter.onNext("缓存文件大小: "+FileUtils.formatFileSize(l, FileUtils.FileSizeFormType.M));
+ emitter.onNext("缓存文件大小: " + FileUtils.formatFileSize(l, FileUtils.FileSizeFormType.M));
emitter.onComplete();
}).subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new ResultObserver