diff --git a/AndroidManifest.xml b/AndroidManifest.xml index b77df4f..2af419f 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -2,8 +2,8 @@ diff --git a/build.gradle b/build.gradle index aad4db6..e3f61f0 100644 --- a/build.gradle +++ b/build.gradle @@ -5,21 +5,30 @@ apply plugin: 'com.android.application' buildscript { repositories { mavenCentral() - maven { - url 'https://maven.aliyun.com/repository/google/' + jcenter() + google() + maven { url "https://jitpack.io"} + maven { url "https://maven.aliyun.com/repository/google"} + maven { url "https://maven.aliyun.com/repository/public"} +// maven { url "https://maven.aliyun.com/repository/releases"} +// maven { url "https://maven.aliyun.com/repository/central"} +// maven { url "https://maven.aliyun.com/repository/gradle-plugin"} +// maven { url 'https://maven.aliyun.com/nexus/content/groups/public/'} +// maven { +// url 'https://maven.aliyun.com/repository/google/' // url 'https://maven.google.com/' // name 'Google' - } - maven { - url 'https://maven.aliyun.com/repository/jcenter/' - } +// } +// maven { +// url 'https://maven.aliyun.com/repository/jcenter/' +// } // maven { // url 'https://maven.google.com/' // name 'Google' // } } dependencies { - classpath 'com.android.tools.build:gradle:3.4.0' + classpath 'com.android.tools.build:gradle:4.1.3' } } @@ -30,7 +39,7 @@ dependencies { implementation files('libs/fastjson-1.2.3.jar') implementation files('libs/sunjce_provider.jar') implementation files('libs/zbar.jar') - implementation files('libs/zxing.jar') +// implementation files('libs/zxing.jar') implementation files('libs/gson-2.6.2.jar') implementation files('libs\\rskapi.jar') implementation files('libs\\zkandroidcore.jar') @@ -42,10 +51,12 @@ dependencies { implementation files('libs\\zypos1.8.jar') implementation files('libs\\jsch-0.1.54.jar') implementation 'org.jetbrains:annotations-java5:15.0' + implementation files('libs\\zxingcore-2.3.0.jar') compileOnly files('external_libs/classes_2.1.11_20160907.jar') compileOnly files('external_libs/bw_odm_20160526.jar') implementation files('libs/bw_pos_sdk2.0.18.jar') implementation 'com.squareup.okhttp3:okhttp:3.6.0' + implementation 'com.sunmi:printerx:1.0.18' // implementation('com.android.support:support-v4:21.0.0') // implementation('com.android.support:appcompat-v7:21.0.0'){ // You should exclude one of them not both of them // exclude module: "support-v4" @@ -117,12 +128,13 @@ android { release.setRoot('build-types/release') } defaultConfig { - minSdkVersion 14 + minSdkVersion 19 targetSdkVersion 21 vectorDrawables.useSupportLibrary =true ndk { abiFilters "armeabi", "armeabi-v7a"//可以适当补填其他 + abiFilters "arm64-v8a" // abiFilters "armeabi"//可以适当补填其他 } } @@ -149,12 +161,10 @@ def releaseTime() { } repositories { - maven { - url 'https://maven.aliyun.com/repository/google/' -// url 'https://maven.google.com/' -// name 'Google' - } - maven { - url 'https://maven.aliyun.com/repository/jcenter/' - } + mavenCentral() + jcenter() + google() + maven { url "https://jitpack.io"} + maven { url "https://maven.aliyun.com/repository/google"} + maven { url "https://maven.aliyun.com/repository/public"} } \ No newline at end of file diff --git a/libs/zxingcore-2.3.0.jar b/libs/zxingcore-2.3.0.jar new file mode 100644 index 0000000..4ab8cb7 --- /dev/null +++ b/libs/zxingcore-2.3.0.jar diff --git a/src/com/ectrip/cyt/center/PrintHandle.java b/src/com/ectrip/cyt/center/PrintHandle.java index c42391e..46fae59 100644 --- a/src/com/ectrip/cyt/center/PrintHandle.java +++ b/src/com/ectrip/cyt/center/PrintHandle.java @@ -3,15 +3,31 @@ package com.ectrip.cyt.center; import android.content.Context; import android.content.Intent; import android.content.res.Resources; +import android.text.TextUtils; import android.widget.Toast; import com.ectrip.cyt.bean.ConfigBean; +import com.ectrip.cyt.config.MyApp; +import com.ectrip.cyt.constant.LogoType; +import com.ectrip.cyt.constant.SelectAction; +import com.ectrip.cyt.constant.constant; import com.ectrip.cyt.db.DbManager; import com.ectrip.cyt.ui.BaseActivity; +import com.ectrip.cyt.ui.MainActivity; +import com.ectrip.cyt.utils.LogUtil; import com.ectrip.cyt.utils.SharedPreferences2Obj; import com.ectrip.trips.check.R; - +import com.sunmi.printerx.SdkException; +import com.sunmi.printerx.api.LineApi; +import com.sunmi.printerx.api.PrintResult; +import com.sunmi.printerx.enums.Align; +import com.sunmi.printerx.enums.DividingLine; +import com.sunmi.printerx.style.BaseStyle; +import com.sunmi.printerx.style.TextStyle; + +import java.text.SimpleDateFormat; import java.util.ArrayList; +import java.util.Date; import android_serialport_api.print_tool.BasewinRebPosPortTool; import android_serialport_api.print_tool.MobilePrintTool; @@ -25,46 +41,48 @@ import android_serialport_api.print_tool.SerialSmallPortTool; * @author jigo 打印处理 */ public class PrintHandle { - // private String TAG = PrintHandle.class.getSimpleName(); - private Context context; - private String printInfo; - private final int ID_POS = 5;// 身份证pos - private final int GENERAL_POS = 6;// 一般pos - private final int SMALL_POS = 7;// 小的pos - private final int HANDSET = 8; // 手持机 - private final int MOBILE = 9;// 手机 - private final int New_POS = 10; // 新版的pos机 - private final int New_IDPOS = 11; // 新版的身份证 - private final int New_HANDSET_POS = 12; // 新版的手持机pos机 - private final int BASEWIN_REB_POS = 13; // 盛本的红色pos机 - - private int isPrint = -1;// 是否打印 - private String isStatistic = "0"; - - private static PrintHandle printHandle = null; - - private Integer type = null;// 设备类型 - private Resources resources; - - public static PrintHandle getInstance() { - if (printHandle == null) { - synchronized (PrintHandle.class) { - - printHandle = new PrintHandle(); - } - } - return printHandle; - } - - private boolean isClick = true; - - public void print(String printInfo, Context context) { - this.context = context; - resources = context.getResources(); - - if (printInfo == null) { - return; - } + private String TAG = PrintHandle.class.getSimpleName(); + private Context context; + private String printInfo; + private final int ID_POS = 5;// 身份证pos + private final int GENERAL_POS = 6;// 一般pos + private final int SMALL_POS = 7;// 小的pos + private final int HANDSET = 8; // 手持机 + private final int MOBILE = 9;// 手机 + private final int New_POS = 10; // 新版的pos机 + private final int New_IDPOS = 11; // 新版的身份证 + private final int New_HANDSET_POS = 12; // 新版的手持机pos机 + private final int BASEWIN_REB_POS = 13; // 盛本的红色pos机 + private final int SHANGMI_POS = 16; + + private int isPrint = -1;// 是否打印 + private String isStatistic = "0"; + private int Select = 0; + + private static PrintHandle printHandle = null; + + private Integer type = null;// 设备类型 + private Resources resources; + + public static PrintHandle getInstance() { + if (printHandle == null) { + synchronized (PrintHandle.class) { + + printHandle = new PrintHandle(); + } + } + return printHandle; + } + + private boolean isClick = true; + + public void print(String printInfo, Context context) { + this.context = context; + resources = context.getResources(); + LogUtil.d(TAG, "printInfo = " + printInfo); + if (TextUtils.isEmpty(printInfo)) { + return; + } // int index = printInfo.indexOf("证件号码"); // if (printInfo.length()>27){ // String noString = printInfo.substring(26, 27); @@ -75,236 +93,322 @@ public class PrintHandle { // // } - type = SharedPreferences2Obj.getInstance(context) - .setName("MachineType").getObject("type", Integer.class); - - if (isClick == false) { - return; - } - - if (isClick == true) { - - this.printInfo = printInfo; - try { - ArrayList beans = DbManager.GetConfigs(); - if (beans != null && beans.get(0) != null) { - // 判断是否为打印 - isPrint = beans.get(0).getEc_isPrint(); - } - } catch (Exception e) { - e.printStackTrace(); - } - - isStatistic = SharedPreferences2Obj.getInstance(context) - .setName("SelectAction") - .getObject("isStatistic", String.class); // 非统计 - if (isStatistic != null) { - if (isStatistic.equals("0")) { // 非统计 - String titleName = SharedPreferences2Obj - .getInstance(context).setName("SelectAction") - .getObject("titleName", String.class); - if (titleName != null) { - if (titleName.equals(resources - .getString(R.string.check))) { - if (isPrint == 1) { // 1的时候打印小票 - printInfo(type); - } - } else if (titleName.equals(resources - .getString(R.string.reprint))) { - printInfo(type); - } - } else { - printInfo(type); - } - } else if (isStatistic.equals("1")) { - printInfo(type); - } - } - } - } - - private void printInfo(Integer type) { - - if (type != null) { - switch (type) { - case ID_POS: - try { - idPosPrint(); - } catch (Exception e) { - e.printStackTrace(); - } - break; - case GENERAL_POS: - try { - generalPrint(); - } catch (Exception e) { - e.printStackTrace(); - } - break; - case SMALL_POS: - try { - smallPosprint(); - } catch (Exception e) { - e.printStackTrace(); - } - break; - case HANDSET: - ((BaseActivity) context).MToast(context, - context.getString(R.string.not_support_print), - Toast.LENGTH_SHORT); - // try { - // handlePrint(); - // } catch (Exception e) { - // e.printStackTrace(); - // } - break; - case MOBILE: - try { - mobilePrint(); - } catch (Exception e) { - e.printStackTrace(); - } - break; - case New_POS: - try { - newPosPrint(); - } catch (Exception e) { - e.printStackTrace(); - } + type = SharedPreferences2Obj.getInstance(context) + .setName("MachineType").getObject("type", Integer.class); + + LogUtil.d(TAG, "type = " + type); + + if (isClick == false) { + return; + } + + if (isClick == true) { + + this.printInfo = printInfo; + try { + ArrayList beans = DbManager.GetConfigs(); + if (beans != null && beans.get(0) != null) { + // 判断是否为打印 + isPrint = beans.get(0).getEc_isPrint(); + } + } catch (Exception e) { + e.printStackTrace(); + } + + isStatistic = SharedPreferences2Obj.getInstance(context) + .setName("SelectAction") + .getObject("isStatistic", String.class); // 非统计 + Select = SharedPreferences2Obj.getInstance(context). + setName("SelectAction").getObject("Select", Integer.class); + if (isStatistic != null) { + if (isStatistic.equals("0")) { // 非统计 + String titleName = SharedPreferences2Obj + .getInstance(context).setName("SelectAction") + .getObject("titleName", String.class); + if (titleName != null) { + if (titleName.equals(resources + .getString(R.string.check))) { + if (isPrint == 1) { // 1的时候打印小票 + printInfo(type); + } + } else if (titleName.equals(resources + .getString(R.string.reprint))) { + printInfo(type); + } + } else { + printInfo(type); + } + } else if (isStatistic.equals("1")) { + printInfo(type); + } + } + } + } + + private void printInfo(Integer type) { + + if (type != null) { + switch (type) { + case ID_POS: + try { + idPosPrint(); + } catch (Exception e) { + e.printStackTrace(); + } + break; + case GENERAL_POS: + try { + generalPrint(); + } catch (Exception e) { + e.printStackTrace(); + } + break; + case SMALL_POS: + try { + smallPosprint(); + } catch (Exception e) { + e.printStackTrace(); + } + break; + case HANDSET: + ((BaseActivity) context).MToast(context, + context.getString(R.string.not_support_print), + Toast.LENGTH_SHORT); + // try { + // handlePrint(); + // } catch (Exception e) { + // e.printStackTrace(); + // } + break; + case MOBILE: + try { + mobilePrint(); + } catch (Exception e) { + e.printStackTrace(); + } + break; + case New_POS: + try { + newPosPrint(); + } catch (Exception e) { + e.printStackTrace(); + } // Toast.makeText(context, "不支持", Toast.LENGTH_SHORT).show(); - break; - case New_IDPOS: - try { - handlePosPrint(); - } catch (Exception e) { - e.printStackTrace(); - } - break; - case New_HANDSET_POS: - try { - handlePosPrint(); - } catch (Exception e) { - e.printStackTrace(); - } - break; - case BASEWIN_REB_POS: - try { - basewinPosPrint(); - } catch (Exception e) { - e.printStackTrace(); - } - - break; - default: - break; - } - } - } - - /************************ 关闭打印 *******************************************/ - public void printClose() { - if (type != null) { - switch (type) { - case ID_POS: - break; - case GENERAL_POS: - break; - case SMALL_POS: - break; - case HANDSET: - break; - case MOBILE: - break; - case New_POS: - try { - if(serialNewPortTool!=null){ - serialNewPortTool.close(); - } - } catch (Exception e1) { - e1.printStackTrace(); - } - break; - case New_IDPOS: - break; - case New_HANDSET_POS: - try { - if(serialNewHandlePortTool!=null){ - serialNewHandlePortTool.close(); - } - } catch (Exception e) { - e.printStackTrace(); - } - break; - case BASEWIN_REB_POS: - try { - if(basewinRebPosPortTool!=null){ - basewinRebPosPortTool.close(); - } - } catch (Exception e) { - e.printStackTrace(); - } - break; - - default: - break; - } - } - } - - /***************************** 普通pos机 ***********************************/ - SerialPortTool portTool; - private void generalPrint() { - portTool = new SerialPortTool(); - portTool.init(context, printInfo); - } - - /******************************** 带身份证打印 ****************************************************/ - SerialIDPortTool idPortTool; - - private void idPosPrint() { - idPortTool = new SerialIDPortTool(); - idPortTool.init(context, printInfo); - } - - /******************************* 小pos机(手持pos机) ****************************************/ - SerialSmallPortTool smallPortTool; - - private void smallPosprint() { - smallPortTool = new SerialSmallPortTool(); - smallPortTool.init(context, printInfo); - } - - /********************************* 手机 ***************************************************/ - private void mobilePrint() { - Intent intent = new Intent(context, MobilePrintTool.class); - intent.putExtra("info", printInfo); - context.startActivity(intent); - } - - /********************************* 手持机 ******************************************************/ - private void handlePrint() { - Intent intent = new Intent(context, MobilePrintTool.class); - intent.putExtra("info", printInfo); - context.startActivity(intent); - } - - /******************************** 新版pos机 ***************************************************/ - SerialNewPortTool serialNewPortTool; - private void newPosPrint() { - serialNewPortTool = new SerialNewPortTool(); - serialNewPortTool.init(context, printInfo); - } - - /********************************* 新版手持pos机 ***********************************************/ - SerialNewHandlePortTool serialNewHandlePortTool; - private void handlePosPrint() { - serialNewHandlePortTool = new SerialNewHandlePortTool(); - serialNewHandlePortTool.init(context, printInfo); - } - /********************************* 盛本红色pos机 ***********************************************/ - BasewinRebPosPortTool basewinRebPosPortTool; - private void basewinPosPrint(){ - basewinRebPosPortTool = new BasewinRebPosPortTool(); - basewinRebPosPortTool.init(context, printInfo); - } + break; + case New_IDPOS: + try { + handlePosPrint(); + } catch (Exception e) { + e.printStackTrace(); + } + break; + case New_HANDSET_POS: + try { + handlePosPrint(); + } catch (Exception e) { + e.printStackTrace(); + } + break; + case BASEWIN_REB_POS: + try { + basewinPosPrint(); + } catch (Exception e) { + e.printStackTrace(); + } + + break; + case SHANGMI_POS: + printSm(); + break; + default: + break; + } + } + } + + /************************ 关闭打印 *******************************************/ + public void printClose() { + if (type != null) { + switch (type) { + case ID_POS: + break; + case GENERAL_POS: + break; + case SMALL_POS: + break; + case HANDSET: + break; + case MOBILE: + break; + case New_POS: + try { + if (serialNewPortTool != null) { + serialNewPortTool.close(); + } + } catch (Exception e1) { + e1.printStackTrace(); + } + break; + case New_IDPOS: + break; + case New_HANDSET_POS: + try { + if (serialNewHandlePortTool != null) { + serialNewHandlePortTool.close(); + } + } catch (Exception e) { + e.printStackTrace(); + } + break; + case BASEWIN_REB_POS: + try { + if (basewinRebPosPortTool != null) { + basewinRebPosPortTool.close(); + } + } catch (Exception e) { + e.printStackTrace(); + } + break; + + default: + break; + } + } + } + + /***************************** 普通pos机 ***********************************/ + SerialPortTool portTool; + + private void generalPrint() { + portTool = new SerialPortTool(); + portTool.init(context, printInfo); + } + + /******************************** 带身份证打印 ****************************************************/ + SerialIDPortTool idPortTool; + + private void idPosPrint() { + idPortTool = new SerialIDPortTool(); + idPortTool.init(context, printInfo); + } + + /******************************* 小pos机(手持pos机) ****************************************/ + SerialSmallPortTool smallPortTool; + + private void smallPosprint() { + smallPortTool = new SerialSmallPortTool(); + smallPortTool.init(context, printInfo); + } + + /********************************* 手机 ***************************************************/ + private void mobilePrint() { + Intent intent = new Intent(context, MobilePrintTool.class); + intent.putExtra("info", printInfo); + context.startActivity(intent); + } + + /********************************* 手持机 ******************************************************/ + private void handlePrint() { + Intent intent = new Intent(context, MobilePrintTool.class); + intent.putExtra("info", printInfo); + context.startActivity(intent); + } + + /******************************** 新版pos机 ***************************************************/ + SerialNewPortTool serialNewPortTool; + + private void newPosPrint() { + serialNewPortTool = new SerialNewPortTool(); + serialNewPortTool.init(context, printInfo); + } + + /********************************* 新版手持pos机 ***********************************************/ + SerialNewHandlePortTool serialNewHandlePortTool; + + private void handlePosPrint() { + serialNewHandlePortTool = new SerialNewHandlePortTool(); + serialNewHandlePortTool.init(context, printInfo); + } + + /********************************* 盛本红色pos机 ***********************************************/ + BasewinRebPosPortTool basewinRebPosPortTool; + + private void basewinPosPrint() { + basewinRebPosPortTool = new BasewinRebPosPortTool(); + basewinRebPosPortTool.init(context, printInfo); + } + /********************************* 商米pos机 ***********************************************/ + private void printSm() { + try { + LineApi api = MainActivity.selectPrinter.lineApi(); + //需要监听打印结果时可以开启事务模式,只需要调用一次 + api.enableTransMode(true); + printSmallTicket(); + api.enableTransMode(false); + } catch (SdkException e) { + e.printStackTrace(); + } + } + + private void printSmallTicket() { + int printNum = MyApp.getInstance().getPrintNum(); + try { + LogUtil.d(TAG, "商米打印 = " + printInfo); + LineApi api = null; + for (int k = 0; k < printNum; k++) { + api = MainActivity.selectPrinter.lineApi(); + api.initLine(BaseStyle.getStyle().setAlign(Align.CENTER)); + if (isStatistic != null && isStatistic.equals("1")) { + api.printText("统计信息", TextStyle.getStyle().enableBold(true)); + } else { + if (Select == 2) { + api.printText("订单信息(重打小票)", TextStyle.getStyle().enableBold(true)); + } else { + api.printText("订单信息", TextStyle.getStyle().enableBold(true)); + } + } + api.initLine(BaseStyle.getStyle().setAlign(Align.LEFT)); + + if (isStatistic != null && isStatistic.equals("1")) { + + } else { + if (Select == SelectAction.Query.getValue()) { //打印时间 + SimpleDateFormat df = new SimpleDateFormat( + "yyyy-MM-dd HH:mm:ss");// 设置日期格式 + api.printText("检票时间:" + df.format(new Date()), TextStyle.getStyle()); + } else if (Select == SelectAction.Reprint.getValue()) {// 重打时间 + SimpleDateFormat df = new SimpleDateFormat( + "yyyy-MM-dd HH:mm:ss");// 设置日期格式 + api.printText("重打时间:" + df.format(new Date()), TextStyle.getStyle()); + } + } + api.printText(printInfo, TextStyle.getStyle()); + api.printDividingLine(DividingLine.EMPTY, 30); + api.printText("取票人签名:" , TextStyle.getStyle()); + api.printDividingLine(DividingLine.EMPTY, 30); + if (constant.logoMark == LogoType.CYT.getValue()) { + api.printText("----畅游通—智慧旅游O2O平台----", TextStyle.getStyle()); + api.printText("--------www.jingqu.cn---------", TextStyle.getStyle()); + }else if (constant.logoMark == LogoType.QNE.getValue()) { + api.printText("----欢迎使用去哪儿网O2O系统----", TextStyle.getStyle()); + api.printText("--------www.qunar.com---------", TextStyle.getStyle()); + } + api.autoOut(); + api.printTrans(new PrintResult() { + @Override + public void onResult(int resultCode, String message) { + if (resultCode == 0) { + //打印成功 + LogUtil.d(TAG, "打印成功"); + } else { + //打印失败 + LogUtil.d(TAG, "打印失败"); + } + } + }); + } + } catch (SdkException e) { + e.printStackTrace(); + } + } } diff --git a/src/com/ectrip/cyt/constant/CheckTicketConstant.java b/src/com/ectrip/cyt/constant/CheckTicketConstant.java index b6653a5..bef065f 100644 --- a/src/com/ectrip/cyt/constant/CheckTicketConstant.java +++ b/src/com/ectrip/cyt/constant/CheckTicketConstant.java @@ -6,7 +6,7 @@ package com.ectrip.cyt.constant; public class CheckTicketConstant { public static String IP; - public static final String httphead = "http://"; + public static final String httphead = "https://"; public static final String action = "/checkTicket/excuteCheckTicket.action"; public static final String MD5KEY = "029124EDC5E180631627E3AE44108724"; public static final String CHECKTICKET = "C001"; //检票 diff --git a/src/com/ectrip/cyt/constant/DeviceType.java b/src/com/ectrip/cyt/constant/DeviceType.java index 1119c63..9c905ef 100644 --- a/src/com/ectrip/cyt/constant/DeviceType.java +++ b/src/com/ectrip/cyt/constant/DeviceType.java @@ -17,7 +17,8 @@ public enum DeviceType { //BLACK_ID_POS:5501H手持机 //ID_CARD_POS_RSK:RSK手持机 ID_POS(5),GENERAL_POS(6),SMALL_POS(7),HANDSET(8),MOBILE(9),New_POS(10), - New_IDPOS(11),New_HANDSET_POS(12),BASEWIN_REB_POS(13),BLACK_ID_POS(14),ID_CARD_POS_RSK(15); + New_IDPOS(11),New_HANDSET_POS(12),BASEWIN_REB_POS(13),BLACK_ID_POS(14),ID_CARD_POS_RSK(15) + ,SHANGMI_POS(16); private int value; private DeviceType(int value) { diff --git a/src/com/ectrip/cyt/request/ConsumeCodeRequest.java b/src/com/ectrip/cyt/request/ConsumeCodeRequest.java new file mode 100644 index 0000000..795e4c0 --- /dev/null +++ b/src/com/ectrip/cyt/request/ConsumeCodeRequest.java @@ -0,0 +1,115 @@ +package com.ectrip.cyt.request; + +import java.util.List; + +public class ConsumeCodeRequest { + public String ver;// 版本号 + public String verType; //版本类型 + public String devId;// 移动终端ID + public String devType;// 终端类型 + public Long accountId; + public String orderId; + public String count; + public String password; + public String verifyPassword; + public String consumedSeq; + public List products; + + public ConsumeCodeRequest(String orderId, String count, String password, String verifyPassword, String consumedSeq, List products) { + super(); + this.orderId = orderId; + this.count = count; + this.password = password; + this.verifyPassword = verifyPassword; + this.consumedSeq = consumedSeq; + this.products = products; + } + + public String getOrderId() { + return orderId; + } + + public void setOrderId(String orderId) { + this.orderId = orderId; + } + + public String getCount() { + return count; + } + + public void setCount(String count) { + this.count = count; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getVerifyPassword() { + return verifyPassword; + } + + public void setVerifyPassword(String verifyPassword) { + this.verifyPassword = verifyPassword; + } + + public String getConsumedSeq() { + return consumedSeq; + } + + public void setConsumedSeq(String consumedSeq) { + this.consumedSeq = consumedSeq; + } + + public List getProducts() { + return products; + } + + public void setProducts(List products) { + this.products = products; + } + + public String getVer() { + return ver; + } + + public void setVer(String ver) { + this.ver = ver; + } + + public String getVerType() { + return verType; + } + + public void setVerType(String verType) { + this.verType = verType; + } + + public String getDevId() { + return devId; + } + + public void setDevId(String devId) { + this.devId = devId; + } + + public String getDevType() { + return devType; + } + + public void setDevType(String devType) { + this.devType = devType; + } + + public Long getAccountId() { + return accountId; + } + + public void setAccountId(Long accountId) { + this.accountId = accountId; + } +} diff --git a/src/com/ectrip/cyt/ui/MainActivity.java b/src/com/ectrip/cyt/ui/MainActivity.java index 94a22b6..673a812 100644 --- a/src/com/ectrip/cyt/ui/MainActivity.java +++ b/src/com/ectrip/cyt/ui/MainActivity.java @@ -65,11 +65,14 @@ import com.ectrip.cyt.utils.SharedPreferences2Obj; import com.ectrip.trips.check.R; import com.ectrip.trips.net.HttpHelper; import com.fri.idcread.idcread; +import com.sunmi.printerx.PrinterSdk; +import com.sunmi.printerx.SdkException; import java.io.File; import java.io.InputStream; import java.lang.reflect.Method; import java.util.ArrayList; +import java.util.List; import hdx.HdxUtil; @@ -87,6 +90,8 @@ public class MainActivity extends BaseActivity implements OnItemClickListener, V private TextView unlogin; private TextView tv_username; private final Handler mHandler = new Handler(); + public static PrinterSdk.Printer selectPrinter; + @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -97,6 +102,12 @@ public class MainActivity extends BaseActivity implements OnItemClickListener, V initView(); regularDelecte(); typeJudgment(); + if (TextUtils.equals("V1", android.os.Build.MODEL) + || TextUtils.equals("V2", android.os.Build.MODEL) + || TextUtils.equals("P1_4G", android.os.Build.MODEL) + || TextUtils.equals("V2s", android.os.Build.MODEL)) { + initPrinter(); + } LogUtil.e(TAG, "硬件序列号 : " + getSerialNumber() + ",型号 :" + Build.MODEL); mHandler.postDelayed(new Runnable() { @Override @@ -136,6 +147,26 @@ public class MainActivity extends BaseActivity implements OnItemClickListener, V startService(upLoad); } + /** + * 初始化默认打印机作为待操作的打印设备 + */ + private void initPrinter() { + try { + PrinterSdk.getInstance().getPrinter(this, new PrinterSdk.PrinterListen() { + @Override + public void onDefPrinter(PrinterSdk.Printer printer) { + selectPrinter = printer; + } + + @Override + public void onPrinters(List printers) { + + } + }); + } catch (SdkException e) { + e.printStackTrace(); + } + } /** * 获取硬件的序列号 @@ -162,7 +193,7 @@ public class MainActivity extends BaseActivity implements OnItemClickListener, V // 得到存储的类型 Integer type = SharedPreferences2Obj.getInstance(MainActivity.this) .setName("MachineType").getObject("type", Integer.class); - + LogUtil.d(TAG, "type = " + type); //如果未存储类型 if (type == null || type == 0) { DisplayMetrics metrics = new DisplayMetrics(); @@ -247,6 +278,14 @@ public class MainActivity extends BaseActivity implements OnItemClickListener, V SharedPreferences2Obj.getInstance(MainActivity.this) .setName("MachineType") .setObject("type", DeviceType.BASEWIN_REB_POS.getValue()); + } else if (TextUtils.equals("V1", android.os.Build.MODEL) + || TextUtils.equals("V2", android.os.Build.MODEL) + || TextUtils.equals("P1_4G", android.os.Build.MODEL) + || TextUtils.equals("V2s", android.os.Build.MODEL)) { + LogUtil.i(TAG, "商米:" + android.os.Build.MODEL); + SharedPreferences2Obj.getInstance(MainActivity.this) + .setName("MachineType") + .setObject("type", DeviceType.SHANGMI_POS.getValue()); } //盛本pos机测试******************************* else { @@ -916,4 +955,10 @@ public class MainActivity extends BaseActivity implements OnItemClickListener, V }); } + + @Override + protected void onDestroy() { + super.onDestroy(); + PrinterSdk.getInstance().destroy(); + } } diff --git a/src/com/ectrip/cyt/ui/PhomeScanerOrderActivity.java b/src/com/ectrip/cyt/ui/PhomeScanerOrderActivity.java index d345aa4..a312042 100644 --- a/src/com/ectrip/cyt/ui/PhomeScanerOrderActivity.java +++ b/src/com/ectrip/cyt/ui/PhomeScanerOrderActivity.java @@ -182,13 +182,13 @@ public class PhomeScanerOrderActivity extends BaseActivity implements Callback { e.printStackTrace(); } Intent intent; - if (resultString.startsWith("OCP_")) { - intent = new Intent(PhomeScanerOrderActivity.this, - PhoneCodeListActivity.class); - } else { +// if (resultString.startsWith("OCP_")) { +// intent = new Intent(PhomeScanerOrderActivity.this, +// PhoneCodeListActivity.class); +// } else { intent = new Intent(PhomeScanerOrderActivity.this, QRCodeOrderListActivity.class); - } +// } intent.putExtra("mode", 1); intent.putExtra("input_orid", resultString); LogUtil.i(TAG, getString(R.string.scan_result) + resultString); diff --git a/src/com/ectrip/cyt/zxing/camera/CameraConfigurationManager.java b/src/com/ectrip/cyt/zxing/camera/CameraConfigurationManager.java index 4b9941a..6640210 100644 --- a/src/com/ectrip/cyt/zxing/camera/CameraConfigurationManager.java +++ b/src/com/ectrip/cyt/zxing/camera/CameraConfigurationManager.java @@ -30,288 +30,288 @@ import com.ectrip.cyt.constant.DeviceType; import com.ectrip.cyt.utils.LogUtil; import com.ectrip.cyt.utils.SharedPreferences2Obj; -@SuppressWarnings({"deprecation" }) +@SuppressWarnings({"deprecation"}) final class CameraConfigurationManager { - private final String TAG = CameraConfigurationManager.class.getSimpleName(); - - private final int TEN_DESIRED_ZOOM = 27; - private final int DESIRED_SHARPNESS = 30; - - private final Pattern COMMA_PATTERN = Pattern.compile(","); - - private Point screenResolution; - private Point cameraResolution; - private int previewFormat; - private String previewFormatString; - - /** - * Reads, one time, values from the camera that are needed by the app. - */ - void initFromCameraParameters(Camera camera, Context context) { - Camera.Parameters parameters = camera.getParameters(); - previewFormat = parameters.getPreviewFormat(); - previewFormatString = parameters.get("preview-format"); - LogUtil.d(TAG, "Default preview format: " + previewFormat + '/' - + previewFormatString); - WindowManager manager = (WindowManager) context - .getSystemService(Context.WINDOW_SERVICE); - Display display = manager.getDefaultDisplay(); - screenResolution = new Point(display.getWidth(), display.getHeight()); - LogUtil.d(TAG, "Screen resolution: " + screenResolution); - cameraResolution = getCameraResolution(parameters, screenResolution); - LogUtil.d(TAG, "Camera resolution: " + screenResolution); - } - - /** - * Sets the camera up to take preview images which are used for both preview - * and decoding. We detect the preview format here so that - * buildLuminanceSource() can build an appropriate LuminanceSource subclass. - * In the future we may want to force YUV420SP as it's the smallest, and the - * planar Y can be used for barcode scanning without a copy in some cases. - */ - void setDesiredCameraParameters(Camera camera, Context context) { - Camera.Parameters parameters = camera.getParameters(); - LogUtil.d(TAG, "Setting preview size: " + cameraResolution); - parameters.setPreviewSize(cameraResolution.x, cameraResolution.y); - setFlash(parameters); - setZoom(parameters); - // setSharpness(parameters); - // modify here - - // camera.setDisplayOrientation(90); - // 兼容2.1 - Integer type = SharedPreferences2Obj.getInstance(context) - .setName("MachineType").getObject("type", Integer.class); - if (type == DeviceType.HANDSET.getValue() - || type == DeviceType.MOBILE.getValue()||type == DeviceType.BASEWIN_REB_POS.getValue()||type == DeviceType.ID_CARD_POS_RSK.getValue()) { - setDisplayOrientation(camera, 90); - } - camera.setParameters(parameters); - } - - Point getCameraResolution() { - return cameraResolution; - } - - Point getScreenResolution() { - return screenResolution; - } - - int getPreviewFormat() { - return previewFormat; - } - - String getPreviewFormatString() { - return previewFormatString; - } - - private Point getCameraResolution(Camera.Parameters parameters, - Point screenResolution) { - - String previewSizeValueString = parameters.get("preview-size-values"); - // saw this on Xperia - if (previewSizeValueString == null) { - previewSizeValueString = parameters.get("preview-size-value"); - } - - Point cameraResolution = null; - - if (previewSizeValueString != null) { - LogUtil.d(TAG, "preview-size-values parameter: " - + previewSizeValueString); - cameraResolution = findBestPreviewSizeValue(previewSizeValueString, - screenResolution); - } - - if (cameraResolution == null) { - // Ensure that the camera resolution is a multiple of 8, as the - // screen may not be. - cameraResolution = new Point((screenResolution.x >> 3) << 3, - (screenResolution.y >> 3) << 3); - } - return cameraResolution; - } - - private Point findBestPreviewSizeValue(CharSequence previewSizeValueString, - Point screenResolution) { - int bestX = 0; - int bestY = 0; - int diff = Integer.MAX_VALUE; - for (String previewSize : COMMA_PATTERN.split(previewSizeValueString)) { - - previewSize = previewSize.trim(); - int dimPosition = previewSize.indexOf('x'); - if (dimPosition < 0) { - LogUtil.w(TAG, "Bad preview-size: " + previewSize); - continue; - } - - int newX; - int newY; - try { - newX = Integer.parseInt(previewSize.substring(0, dimPosition)); - newY = Integer.parseInt(previewSize.substring(dimPosition + 1)); - } catch (NumberFormatException nfe) { - LogUtil.w(TAG, "Bad preview-size: " + previewSize); - continue; - } - - int newDiff = Math.abs(newX - screenResolution.x) - + Math.abs(newY - screenResolution.y); - if (newDiff == 0) { - bestX = newX; - bestY = newY; - break; - } else if (newDiff < diff) { - bestX = newX; - bestY = newY; - diff = newDiff; - } - - } - - if (bestX > 0 && bestY > 0) { - return new Point(bestX, bestY); - } - return null; - } - - private int findBestMotZoomValue(CharSequence stringValues, - int tenDesiredZoom) { - int tenBestValue = 0; - for (String stringValue : COMMA_PATTERN.split(stringValues)) { - stringValue = stringValue.trim(); - double value; - try { - value = Double.parseDouble(stringValue); - } catch (NumberFormatException nfe) { - return tenDesiredZoom; - } - int tenValue = (int) (10.0 * value); - if (Math.abs(tenDesiredZoom - value) < Math.abs(tenDesiredZoom - - tenBestValue)) { - tenBestValue = tenValue; - } - } - return tenBestValue; - } - - /** - * @param parameters - * FIXME: This is a hack to turn the flash off on the Samsung - * Galaxy. And this is a hack-hack to work around a different - * value on the Behold II Restrict Behold II check to Cupcake, - * per Samsung's advice if (Build.MODEL.contains("Behold II") && - * CameraManager.SDK_INT == Build.VERSION_CODES.CUPCAKE) { - */ - private void setFlash(Camera.Parameters parameters) { - int sdkInt; - try { - sdkInt = Integer.parseInt(Build.VERSION.SDK); - } catch (NumberFormatException nfe) { - // Just to be safe - sdkInt = 10000; - } - if (Build.MODEL.contains("Behold II") && sdkInt== 3) { // 3 - parameters.set("flash-value", 1); - } else { - parameters.set("flash-value", 2); - } - // This is the standard setting to turn the flash off that all devices - // should honor. - parameters.set("flash-mode", "off"); - } - - private void setZoom(Camera.Parameters parameters) { - - String zoomSupportedString = parameters.get("zoom-supported"); - if (zoomSupportedString != null - && !Boolean.parseBoolean(zoomSupportedString)) { - return; - } - - int tenDesiredZoom = TEN_DESIRED_ZOOM; - - String maxZoomString = parameters.get("max-zoom"); - if (maxZoomString != null) { - try { - int tenMaxZoom = (int) (10.0 * Double - .parseDouble(maxZoomString)); - if (tenDesiredZoom > tenMaxZoom) { - tenDesiredZoom = tenMaxZoom; - } - } catch (NumberFormatException nfe) { - LogUtil.w(TAG, "Bad max-zoom: " + maxZoomString); - } - } - - String takingPictureZoomMaxString = parameters - .get("taking-picture-zoom-max"); - if (takingPictureZoomMaxString != null) { - try { - int tenMaxZoom = Integer.parseInt(takingPictureZoomMaxString); - if (tenDesiredZoom > tenMaxZoom) { - tenDesiredZoom = tenMaxZoom; - } - } catch (NumberFormatException nfe) { - LogUtil.w(TAG, "Bad taking-picture-zoom-max: " - + takingPictureZoomMaxString); - } - } - - String motZoomValuesString = parameters.get("mot-zoom-values"); - if (motZoomValuesString != null) { - tenDesiredZoom = findBestMotZoomValue(motZoomValuesString, - tenDesiredZoom); - } - - String motZoomStepString = parameters.get("mot-zoom-step"); - if (motZoomStepString != null) { - try { - double motZoomStep = Double.parseDouble(motZoomStepString - .trim()); - int tenZoomStep = (int) (10.0 * motZoomStep); - if (tenZoomStep > 1) { - tenDesiredZoom -= tenDesiredZoom % tenZoomStep; - } - } catch (NumberFormatException nfe) { - // continue - } - } - - // Set zoom. This helps encourage the user to pull back. - // Some devices like the Behold have a zoom parameter - if (maxZoomString != null || motZoomValuesString != null) { - parameters.set("zoom", String.valueOf(tenDesiredZoom / 10.0)); - } - - // Most devices, like the Hero, appear to expose this zoom parameter. - // It takes on values like "27" which appears to mean 2.7x zoom - if (takingPictureZoomMaxString != null) { - parameters.set("taking-picture-zoom", tenDesiredZoom); - } - } - - public int getDesiredSharpness() { - return DESIRED_SHARPNESS; - } - - /** - * compatible 1.6 - * - * @param camera - * @param angle - */ - protected void setDisplayOrientation(Camera camera, int angle) { - Method downPolymorphic; - try { - downPolymorphic = camera.getClass().getMethod( - "setDisplayOrientation", new Class[] { int.class }); - if (downPolymorphic != null) - downPolymorphic.invoke(camera, new Object[] { angle }); - } catch (Exception e1) { - } - } + private final String TAG = CameraConfigurationManager.class.getSimpleName(); + + private final int TEN_DESIRED_ZOOM = 27; + private final int DESIRED_SHARPNESS = 30; + + private final Pattern COMMA_PATTERN = Pattern.compile(","); + + private Point screenResolution; + private Point cameraResolution; + private int previewFormat; + private String previewFormatString; + + /** + * Reads, one time, values from the camera that are needed by the app. + */ + void initFromCameraParameters(Camera camera, Context context) { + Camera.Parameters parameters = camera.getParameters(); + previewFormat = parameters.getPreviewFormat(); + previewFormatString = parameters.get("preview-format"); + LogUtil.d(TAG, "Default preview format: " + previewFormat + '/' + + previewFormatString); + WindowManager manager = (WindowManager) context + .getSystemService(Context.WINDOW_SERVICE); + Display display = manager.getDefaultDisplay(); + screenResolution = new Point(display.getWidth(), display.getHeight()); + LogUtil.d(TAG, "Screen resolution: " + screenResolution); + cameraResolution = getCameraResolution(parameters, screenResolution); + LogUtil.d(TAG, "Camera resolution: " + screenResolution); + } + + /** + * Sets the camera up to take preview images which are used for both preview + * and decoding. We detect the preview format here so that + * buildLuminanceSource() can build an appropriate LuminanceSource subclass. + * In the future we may want to force YUV420SP as it's the smallest, and the + * planar Y can be used for barcode scanning without a copy in some cases. + */ + void setDesiredCameraParameters(Camera camera, Context context) { + Camera.Parameters parameters = camera.getParameters(); + LogUtil.d(TAG, "Setting preview size: " + cameraResolution); + parameters.setPreviewSize(cameraResolution.x, cameraResolution.y); + setFlash(parameters); + setZoom(parameters); + // setSharpness(parameters); + // modify here + + // camera.setDisplayOrientation(90); + // 兼容2.1 + Integer type = SharedPreferences2Obj.getInstance(context) + .setName("MachineType").getObject("type", Integer.class); + if (type == DeviceType.HANDSET.getValue() + || type == DeviceType.MOBILE.getValue() || type == DeviceType.BASEWIN_REB_POS.getValue() || type == DeviceType.ID_CARD_POS_RSK.getValue() + || type == DeviceType.SHANGMI_POS.getValue()) { + setDisplayOrientation(camera, 90); + } + camera.setParameters(parameters); + } + + Point getCameraResolution() { + return cameraResolution; + } + + Point getScreenResolution() { + return screenResolution; + } + + int getPreviewFormat() { + return previewFormat; + } + + String getPreviewFormatString() { + return previewFormatString; + } + + private Point getCameraResolution(Camera.Parameters parameters, + Point screenResolution) { + + String previewSizeValueString = parameters.get("preview-size-values"); + // saw this on Xperia + if (previewSizeValueString == null) { + previewSizeValueString = parameters.get("preview-size-value"); + } + + Point cameraResolution = null; + + if (previewSizeValueString != null) { + LogUtil.d(TAG, "preview-size-values parameter: " + + previewSizeValueString); + cameraResolution = findBestPreviewSizeValue(previewSizeValueString, + screenResolution); + } + + if (cameraResolution == null) { + // Ensure that the camera resolution is a multiple of 8, as the + // screen may not be. + cameraResolution = new Point((screenResolution.x >> 3) << 3, + (screenResolution.y >> 3) << 3); + } + return cameraResolution; + } + + private Point findBestPreviewSizeValue(CharSequence previewSizeValueString, + Point screenResolution) { + int bestX = 0; + int bestY = 0; + int diff = Integer.MAX_VALUE; + for (String previewSize : COMMA_PATTERN.split(previewSizeValueString)) { + + previewSize = previewSize.trim(); + int dimPosition = previewSize.indexOf('x'); + if (dimPosition < 0) { + LogUtil.w(TAG, "Bad preview-size: " + previewSize); + continue; + } + + int newX; + int newY; + try { + newX = Integer.parseInt(previewSize.substring(0, dimPosition)); + newY = Integer.parseInt(previewSize.substring(dimPosition + 1)); + } catch (NumberFormatException nfe) { + LogUtil.w(TAG, "Bad preview-size: " + previewSize); + continue; + } + + int newDiff = Math.abs(newX - screenResolution.x) + + Math.abs(newY - screenResolution.y); + if (newDiff == 0) { + bestX = newX; + bestY = newY; + break; + } else if (newDiff < diff) { + bestX = newX; + bestY = newY; + diff = newDiff; + } + + } + + if (bestX > 0 && bestY > 0) { + return new Point(bestX, bestY); + } + return null; + } + + private int findBestMotZoomValue(CharSequence stringValues, + int tenDesiredZoom) { + int tenBestValue = 0; + for (String stringValue : COMMA_PATTERN.split(stringValues)) { + stringValue = stringValue.trim(); + double value; + try { + value = Double.parseDouble(stringValue); + } catch (NumberFormatException nfe) { + return tenDesiredZoom; + } + int tenValue = (int) (10.0 * value); + if (Math.abs(tenDesiredZoom - value) < Math.abs(tenDesiredZoom + - tenBestValue)) { + tenBestValue = tenValue; + } + } + return tenBestValue; + } + + /** + * @param parameters FIXME: This is a hack to turn the flash off on the Samsung + * Galaxy. And this is a hack-hack to work around a different + * value on the Behold II Restrict Behold II check to Cupcake, + * per Samsung's advice if (Build.MODEL.contains("Behold II") && + * CameraManager.SDK_INT == Build.VERSION_CODES.CUPCAKE) { + */ + private void setFlash(Camera.Parameters parameters) { + int sdkInt; + try { + sdkInt = Integer.parseInt(Build.VERSION.SDK); + } catch (NumberFormatException nfe) { + // Just to be safe + sdkInt = 10000; + } + if (Build.MODEL.contains("Behold II") && sdkInt == 3) { // 3 + parameters.set("flash-value", 1); + } else { + parameters.set("flash-value", 2); + } + // This is the standard setting to turn the flash off that all devices + // should honor. + parameters.set("flash-mode", "off"); + } + + private void setZoom(Camera.Parameters parameters) { + + String zoomSupportedString = parameters.get("zoom-supported"); + if (zoomSupportedString != null + && !Boolean.parseBoolean(zoomSupportedString)) { + return; + } + + int tenDesiredZoom = TEN_DESIRED_ZOOM; + + String maxZoomString = parameters.get("max-zoom"); + if (maxZoomString != null) { + try { + int tenMaxZoom = (int) (10.0 * Double + .parseDouble(maxZoomString)); + if (tenDesiredZoom > tenMaxZoom) { + tenDesiredZoom = tenMaxZoom; + } + } catch (NumberFormatException nfe) { + LogUtil.w(TAG, "Bad max-zoom: " + maxZoomString); + } + } + + String takingPictureZoomMaxString = parameters + .get("taking-picture-zoom-max"); + if (takingPictureZoomMaxString != null) { + try { + int tenMaxZoom = Integer.parseInt(takingPictureZoomMaxString); + if (tenDesiredZoom > tenMaxZoom) { + tenDesiredZoom = tenMaxZoom; + } + } catch (NumberFormatException nfe) { + LogUtil.w(TAG, "Bad taking-picture-zoom-max: " + + takingPictureZoomMaxString); + } + } + + String motZoomValuesString = parameters.get("mot-zoom-values"); + if (motZoomValuesString != null) { + tenDesiredZoom = findBestMotZoomValue(motZoomValuesString, + tenDesiredZoom); + } + + String motZoomStepString = parameters.get("mot-zoom-step"); + if (motZoomStepString != null) { + try { + double motZoomStep = Double.parseDouble(motZoomStepString + .trim()); + int tenZoomStep = (int) (10.0 * motZoomStep); + if (tenZoomStep > 1) { + tenDesiredZoom -= tenDesiredZoom % tenZoomStep; + } + } catch (NumberFormatException nfe) { + // continue + } + } + + // Set zoom. This helps encourage the user to pull back. + // Some devices like the Behold have a zoom parameter + if (maxZoomString != null || motZoomValuesString != null) { + parameters.set("zoom", String.valueOf(tenDesiredZoom / 10.0)); + } + + // Most devices, like the Hero, appear to expose this zoom parameter. + // It takes on values like "27" which appears to mean 2.7x zoom + if (takingPictureZoomMaxString != null) { + parameters.set("taking-picture-zoom", tenDesiredZoom); + } + } + + public int getDesiredSharpness() { + return DESIRED_SHARPNESS; + } + + /** + * compatible 1.6 + * + * @param camera + * @param angle + */ + protected void setDisplayOrientation(Camera camera, int angle) { + Method downPolymorphic; + try { + downPolymorphic = camera.getClass().getMethod( + "setDisplayOrientation", new Class[]{int.class}); + if (downPolymorphic != null) + downPolymorphic.invoke(camera, new Object[]{angle}); + } catch (Exception e1) { + } + } } diff --git a/src/com/ectrip/trips/net/HttpHelper.java b/src/com/ectrip/trips/net/HttpHelper.java index 1cd2e69..a845a50 100644 --- a/src/com/ectrip/trips/net/HttpHelper.java +++ b/src/com/ectrip/trips/net/HttpHelper.java @@ -13,6 +13,7 @@ import com.ectrip.cyt.bean.ConfigBean; import com.ectrip.cyt.callback.HttpCallback; import com.ectrip.cyt.config.DevicTool; import com.ectrip.cyt.config.MyApp; +import com.ectrip.cyt.constant.CheckTicketConstant; import com.ectrip.cyt.constant.LogoType; import com.ectrip.cyt.constant.constant; import com.ectrip.cyt.db.DbManager; @@ -92,9 +93,9 @@ public class HttpHelper extends HttpHelperCore { map.put("requestParam", requestParam); LogUtil.i(TAG, requestParam + "requestParam"); executeHttpPost( - "https://" + MyApp.getInstance().getServiceIp() + action, "", + CheckTicketConstant.httphead + MyApp.getInstance().getServiceIp() + action, "", map, httpCallback, "data", DataTrans.class); - LogUtil.i(TAG, "url = " + "http://" + MyApp.getInstance().getServiceIp() + action); + LogUtil.i(TAG, "url = " + CheckTicketConstant.httphead + MyApp.getInstance().getServiceIp() + action); if (testMOdel != null && testMOdel) { // 这个是调试弹框 if (type == null) { return; @@ -133,9 +134,9 @@ public class HttpHelper extends HttpHelperCore { .getInstance().getSignkey(), MyApp.getInstance().getIdentity()); map.put("requestParam", requestParam); LogUtil.i(TAG, "requestParam" + requestParam); - LogUtil.i(TAG, "url = " + "http://" + MyApp.getInstance().getServiceIp() + action); + LogUtil.i(TAG, "url = " + CheckTicketConstant.httphead + MyApp.getInstance().getServiceIp() + action); executeHttpPost( - "https://" + MyApp.getInstance().getServiceIp() + action, "", + CheckTicketConstant.httphead + MyApp.getInstance().getServiceIp() + action, "", map, httpCallback, "data", DataTrans.class); if (testMOdel != null && testMOdel) { // 这个是调试弹框 @@ -175,7 +176,7 @@ public class HttpHelper extends HttpHelperCore { map.put("requestParam", requestParam); LogUtil.i(TAG, "requestParam" + requestParam); executeHttpPost( - "https://" + MyApp.getInstance().getServiceIp() + action, "", + CheckTicketConstant.httphead + MyApp.getInstance().getServiceIp() + action, "", map, httpCallback, "data", DataTrans.class); if (testMOdel != null && testMOdel) { // 这个是调试弹框 @@ -211,7 +212,7 @@ public class HttpHelper extends HttpHelperCore { LogUtil.i(TAG, "requestParam" + requestParam); LogUtil.i(TAG, "服务器地址:" + MyApp.getInstance().getServiceIp()); executeHttpPost( - "https://" + MyApp.getInstance().getServiceIp() + action, "", + CheckTicketConstant.httphead + MyApp.getInstance().getServiceIp() + action, "", map, httpCallback, "data", DataTrans.class); if (testMOdel != null && testMOdel) { // 这个是调试弹框 @@ -251,7 +252,7 @@ public class HttpHelper extends HttpHelperCore { map.put("requestParam", requestParam); LogUtil.i(TAG, "requestParam" + requestParam); executeHttpPost( - "https://" + MyApp.getInstance().getServiceIp() + action, "", + CheckTicketConstant.httphead + MyApp.getInstance().getServiceIp() + action, "", map, httpCallback, "data", DataTrans.class); if (testMOdel != null && testMOdel) { // 这个是调试弹框 if (type == null) { @@ -294,7 +295,7 @@ public class HttpHelper extends HttpHelperCore { map.put("requestParam", requestParam); LogUtil.i(TAG, "requestParam" + requestParam); executeHttpPost( - "https://" + MyApp.getInstance().getServiceIp() + action, "", + CheckTicketConstant.httphead + MyApp.getInstance().getServiceIp() + action, "", map, httpCallback, "data", DataTrans.class); if (testMOdel != null && testMOdel) { // 这个是调试弹框 if (type == null) { @@ -344,7 +345,7 @@ public class HttpHelper extends HttpHelperCore { map.put("requestParam", requestParam); LogUtil.i(TAG, "requestParam" + requestParam); executeHttpPost( - "https://" + MyApp.getInstance().getServiceIp() + action, "", + CheckTicketConstant.httphead + MyApp.getInstance().getServiceIp() + action, "", map, httpCallback, "data", DataTrans.class); if (testMOdel != null && testMOdel) { // 这个是调试弹框 if (type == null) { @@ -389,9 +390,9 @@ public class HttpHelper extends HttpHelperCore { String requestParam = DataTool.envelopeData(detectVersionRequest, signkey, identity); map.put("requestParam", requestParam); - LogUtil.i(TAG, "url = " + "https://" + url + action); + LogUtil.i(TAG, "url = " + CheckTicketConstant.httphead + url + action); LogUtil.i(TAG, "requestParam" + requestParam); - executeHttpPost("https://" + url + action, "", map, httpCallback, + executeHttpPost(CheckTicketConstant.httphead + url + action, "", map, httpCallback, "data", DataTrans.class); } @@ -422,7 +423,7 @@ public class HttpHelper extends HttpHelperCore { map.put("requestParam", requestParam); LogUtil.i(TAG, "requestParam" + requestParam); executeHttpPost( - "https://" + MyApp.getInstance().getServiceIp() + action, "", + CheckTicketConstant.httphead + MyApp.getInstance().getServiceIp() + action, "", map, httpCallback, "data", DataTrans.class);