Commit da545be86bda070ce82067c8f7ce090a069f4df4

Authored by 杜方
1 parent fe95a7d1

畅游通核销app:1.新增检前缀为OCP票流程

AndroidManifest.xml
... ... @@ -2,8 +2,8 @@
2 2 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
3 3 xmlns:tool="http://schemas.android.com/tools"
4 4 package="com.ectrip.trips.check"
5   - android:versionCode="26"
6   - android:versionName="4.23"
  5 + android:versionCode="27"
  6 + android:versionName="4.24"
7 7 tool:ignore="LockedOrientationActivity">
8 8  
9 9 <!-- 各个类型的大小布局声明 -->
... ... @@ -260,6 +260,13 @@
260 260 android:screenOrientation="portrait"
261 261 android:theme="@style/Theme"
262 262 android:windowSoftInputMode="adjustPan|stateHidden" />
  263 + <activity
  264 + android:name="com.ectrip.cyt.ui.PhoneCodeListActivity"
  265 + android:configChanges="orientation|keyboardHidden"
  266 + android:launchMode="singleTask"
  267 + android:screenOrientation="portrait"
  268 + android:theme="@style/Theme"
  269 + android:windowSoftInputMode="adjustPan|stateHidden" />
263 270 <!-- 身份证列表页面 -->
264 271 <activity
265 272 android:name="com.ectrip.cyt.ui.InputOrderListActivity"
... ...
res/values/colors.xml
... ... @@ -39,7 +39,7 @@
39 39 <color name="numbers_text_color">#8c8c8c</color>
40 40  
41 41 <color name="transparent_black">#7F000000</color>
42   -
  42 + <color name="black">#000000</color>
43 43 <!-- 下面的是名邦良本的日期选择器 -->
44 44 <color name="calendar_active_month_bg">#fff5f7f9</color>
45 45 <color name="calendar_bg">#ffffffff</color>
... ...
res/values/dimens.xml
... ... @@ -51,8 +51,11 @@
51 51 <dimen name="dp_48">48dp</dimen>
52 52 <dimen name="sp_25">25sp</dimen>
53 53 <dimen name="dp_20">20dp</dimen>
  54 + <dimen name="dp_18">18dp</dimen>
54 55 <dimen name="dp_68">68dp</dimen>
55 56 <dimen name="sp_18">18sp</dimen>
56 57 <dimen name="dp_15">15dp</dimen>
57 58 <dimen name="dp_0">0dp</dimen>
  59 + <dimen name="dp_5">5dp</dimen>
  60 + <dimen name="dp_10">10dp</dimen>
58 61 </resources>
... ...
res/values/strings.xml
... ... @@ -2,7 +2,7 @@
2 2 <resources>
3 3  
4 4 <!-- app_name 为"畅游通O2O移动终端"和 "去哪儿O2O移动终端" 或 "O2O移动终端" 或 "路路通O2O移动终端"-->
5   - <string name="app_name">畅游通O2O移动终端</string>
  5 + <string name="app_name">智能移动验证系统</string>
6 6 <string name="input_idcard_hit">请输入身份证号码</string>
7 7 <!-- list -->
8 8 <string name="loading">正在加载</string>
... ... @@ -86,6 +86,7 @@
86 86 <string name="system_setting">系统设置</string>
87 87 <string name="reprint">补打小票</string>
88 88 <string name="check">检票操作</string>
  89 + <string name="check_ticket">检票</string>
89 90 <string name="query">订单查询</string>
90 91 <string name="input_pwd">请输入密码</string>
91 92 <string name="btn_ok">确定</string>
... ...
src/com/ectrip/cyt/ui/PhomeScanerOrderActivity.java
... ... @@ -171,6 +171,9 @@ public class PhomeScanerOrderActivity extends BaseActivity implements Callback {
171 171 } else if ((resultString.startsWith("TY_") || (resultString.startsWith("PMS_")))) {
172 172 typeScan = 1;
173 173 resultString = resultString;
  174 + } else if (resultString.startsWith("OCP_")) {
  175 + typeScan = 0;
  176 + resultString = resultString;
174 177 } else {
175 178 typeScan = 1;
176 179 resultString = resultString;
... ... @@ -178,9 +181,14 @@ public class PhomeScanerOrderActivity extends BaseActivity implements Callback {
178 181 } catch (Exception e) {
179 182 e.printStackTrace();
180 183 }
181   -
182   - Intent intent = new Intent(PhomeScanerOrderActivity.this,
183   - QRCodeOrderListActivity.class);
  184 + Intent intent;
  185 + if (resultString.startsWith("OCP_")) {
  186 + intent = new Intent(PhomeScanerOrderActivity.this,
  187 + PhoneCodeListActivity.class);
  188 + } else {
  189 + intent = new Intent(PhomeScanerOrderActivity.this,
  190 + QRCodeOrderListActivity.class);
  191 + }
184 192 intent.putExtra("mode", 1);
185 193 intent.putExtra("input_orid", resultString);
186 194 LogUtil.i(TAG, getString(R.string.scan_result) + resultString);
... ... @@ -231,7 +239,7 @@ public class PhomeScanerOrderActivity extends BaseActivity implements Callback {
231 239 bean.setEc_signkey(identity);
232 240 if (1 == beans.get(0).getEc_isPrint()) {
233 241 bean.setEc_isPrint(beans.get(0).getEc_isPrint());
234   - }else {
  242 + } else {
235 243 bean.setEc_isPrint(0);
236 244 }
237 245 DbManager.ClearConfig();
... ...
src/com/ectrip/cyt/ui/QRCodeOrderListActivity.java
1 1 package com.ectrip.cyt.ui;
2 2  
  3 +import java.util.ArrayList;
3 4 import java.util.List;
4 5 import java.util.Timer;
5 6 import java.util.TimerTask;
... ... @@ -28,6 +29,7 @@ import com.ectrip.cyt.config.MyApp;
28 29 import com.ectrip.cyt.constant.DeviceType;
29 30 import com.ectrip.cyt.constant.OrderCode;
30 31 import com.ectrip.cyt.constant.SelectAction;
  32 +import com.ectrip.cyt.request.ProductOfConsumeOrder;
31 33 import com.ectrip.cyt.response.PassengerInfosBean;
32 34 import com.ectrip.cyt.response.ProductInfoQuery;
33 35 import com.ectrip.cyt.response.QueryOrderResponse;
... ... @@ -53,6 +55,7 @@ public class QRCodeOrderListActivity extends BaseActivity implements ListOnclick
53 55 private TextView errorInfo;
54 56 private Integer Select;
55 57 private int typeScan;
  58 +
56 59 @Override
57 60 protected void onCreate(Bundle savedInstanceState) {
58 61 super.onCreate(savedInstanceState);
... ... @@ -98,8 +101,14 @@ public class QRCodeOrderListActivity extends BaseActivity implements ListOnclick
98 101 .setName("MachineType").getObject("type", Integer.class);
99 102 orid = getIntent().getStringExtra("input_orid");
100 103 LogUtil.d(TAG, "orid = " + orid);
101   - typeScan = getIntent().getIntExtra("typeScan",0);
  104 + typeScan = getIntent().getIntExtra("typeScan", 0);
102 105 LogUtil.d(TAG, "typeScan = " + typeScan);
  106 + if (orid.startsWith("OCP_")) {
  107 + ArrayList<ProductOfConsumeOrder> productOfConsumeOrders = new ArrayList<>();
  108 + ProductOfConsumeOrder productOfConsumeOrder = new ProductOfConsumeOrder();
  109 + HttpHelper.getInstance(QRCodeOrderListActivity.this).codeConsume(orid, null, null, null, null, productOfConsumeOrders, new MyHttpCallback());
  110 + return;
  111 + }
103 112 HttpHelper.getInstance(QRCodeOrderListActivity.this).queryOrder(
104 113 "QRCODE", null, null, null, orid, null, null, "15", "1",
105 114 new MyHttpCallback());
... ... @@ -174,6 +183,7 @@ public class QRCodeOrderListActivity extends BaseActivity implements ListOnclick
174 183 data = result.getData();
175 184 parse2(result.getData(), QueryOrderResponse.class,
176 185 QRCodeOrderListActivity.this);
  186 + LogUtil.d("QRCodeOrderListActivity", "data = " + data);
177 187 } else {
178 188 if (dialog != null && dialog.isShowing()) {
179 189 try {
... ... @@ -282,7 +292,7 @@ public class QRCodeOrderListActivity extends BaseActivity implements ListOnclick
282 292 List<ProductInfoQuery> products = orderInfos.get(position).getProducts();
283 293 for (int i = 0; i < products.size(); i++) {
284 294 List<PassengerInfosBean> passengerInfosBeans = products.get(i).getPassengerInfos();
285   - for (PassengerInfosBean bean : passengerInfosBeans){
  295 + for (PassengerInfosBean bean : passengerInfosBeans) {
286 296 if (orid.equals(bean.getVoucher())) {
287 297 LogUtil.d(TAG, "getVoucher = " + bean.getVoucher());
288 298 centerHandle.partTicket(position, "", "TRUE", bean.getVoucher(), false);
... ...
src/com/ectrip/trips/net/HttpHelper.java
... ... @@ -16,6 +16,7 @@ import com.ectrip.cyt.config.MyApp;
16 16 import com.ectrip.cyt.constant.LogoType;
17 17 import com.ectrip.cyt.constant.constant;
18 18 import com.ectrip.cyt.db.DbManager;
  19 +import com.ectrip.cyt.request.ConsumeCodeRequest;
19 20 import com.ectrip.cyt.request.ConsumeOrderRequest;
20 21 import com.ectrip.cyt.request.DetectVersionRequest;
21 22 import com.ectrip.cyt.request.LoginRequest;
... ... @@ -90,7 +91,7 @@ public class HttpHelper extends HttpHelperCore {
90 91 map.put("requestParam", requestParam);
91 92 LogUtil.i(TAG,requestParam + "requestParam");
92 93 executeHttpPost(
93   - "http://" + MyApp.getInstance().getServiceIp() + action, "",
  94 + "https://" + MyApp.getInstance().getServiceIp() + action, "",
94 95 map, httpCallback, "data", DataTrans.class);
95 96 LogUtil.i(TAG,"url = " + "http://" + MyApp.getInstance().getServiceIp() + action);
96 97 if (testMOdel != null && testMOdel) { // 这个是调试弹框
... ... @@ -132,7 +133,7 @@ public class HttpHelper extends HttpHelperCore {
132 133 map.put("requestParam", requestParam);
133 134 LogUtil.i(TAG,"requestParam" + requestParam);
134 135 executeHttpPost(
135   - "http://" + MyApp.getInstance().getServiceIp() + action, "",
  136 + "https://" + MyApp.getInstance().getServiceIp() + action, "",
136 137 map, httpCallback, "data", DataTrans.class);
137 138  
138 139 if (testMOdel != null && testMOdel) { // 这个是调试弹框
... ... @@ -172,7 +173,7 @@ public class HttpHelper extends HttpHelperCore {
172 173 map.put("requestParam", requestParam);
173 174 LogUtil.i(TAG,"requestParam" + requestParam);
174 175 executeHttpPost(
175   - "http://" + MyApp.getInstance().getServiceIp() + action, "",
  176 + "https://" + MyApp.getInstance().getServiceIp() + action, "",
176 177 map, httpCallback, "data", DataTrans.class);
177 178  
178 179 if (testMOdel != null && testMOdel) { // 这个是调试弹框
... ... @@ -188,7 +189,41 @@ public class HttpHelper extends HttpHelperCore {
188 189 + ";", Toast.LENGTH_LONG);
189 190 }
190 191 }
  192 + public void codeConsume(String orderId, String count, String password,
  193 + String verifyPassword, String consumedSeq, List<ProductOfConsumeOrder> products, HttpCallback<DataTrans> httpCallback) {
  194 + Long accountId = MyApp.getInstance().getAccountId();
  195 + ConsumeCodeRequest consumeCode = new ConsumeCodeRequest(orderId,
  196 + count, password, verifyPassword, consumedSeq, products);
  197 + consumeCode.setVer(MyApp.getInstance().getVer());
  198 + consumeCode.setVerType(MyApp.getInstance().getVerType());
  199 + consumeCode.setDevId(configBeans.get(0).getEc_mac());
  200 + consumeCode.setAccountId(accountId);
  201 + consumeCode.setDevType(devType);
  202 +
  203 + HashMap<String, String> map = new HashMap<String, String>();
  204 + map.put("method", "onePassCodeConsumed");
  205 + String requestParam = DataTool.envelopeData(consumeCode, MyApp
  206 + .getInstance().getSignkey(), MyApp.getInstance().getIdentity());
  207 + map.put("requestParam", requestParam);
  208 + LogUtil.i(TAG,"requestParam" + requestParam);
  209 + LogUtil.i(TAG,"服务器地址:" + MyApp.getInstance().getServiceIp());
  210 + executeHttpPost(
  211 + "https://" + MyApp.getInstance().getServiceIp() + action, "",
  212 + map, httpCallback, "data", DataTrans.class);
191 213  
  214 + if (testMOdel != null && testMOdel) { // 这个是调试弹框
  215 + if (type == null) {
  216 + return;
  217 + }
  218 + if (activity == null) {
  219 + return;
  220 + }
  221 + activity.MToast(mContext, "服务地址:"
  222 + + MyApp.getInstance().getServiceIp() + ";" + "机器码:"
  223 + + configBeans.get(0).getEc_mac() + ";" + "订单号:" + orderId
  224 + + ";", Toast.LENGTH_LONG);
  225 + }
  226 + }
192 227 /**
193 228 * @param startdate
194 229 * @param enddate
... ... @@ -212,7 +247,7 @@ public class HttpHelper extends HttpHelperCore {
212 247 map.put("requestParam", requestParam);
213 248 LogUtil.i(TAG,"requestParam" + requestParam);
214 249 executeHttpPost(
215   - "http://" + MyApp.getInstance().getServiceIp() + action, "",
  250 + "https://" + MyApp.getInstance().getServiceIp() + action, "",
216 251 map, httpCallback, "data", DataTrans.class);
217 252 if (testMOdel != null && testMOdel) { // 这个是调试弹框
218 253 if (type == null) {
... ... @@ -255,7 +290,7 @@ public class HttpHelper extends HttpHelperCore {
255 290 map.put("requestParam", requestParam);
256 291 LogUtil.i(TAG,"requestParam" + requestParam);
257 292 executeHttpPost(
258   - "http://" + MyApp.getInstance().getServiceIp() + action, "",
  293 + "https://" + MyApp.getInstance().getServiceIp() + action, "",
259 294 map, httpCallback, "data", DataTrans.class);
260 295 if (testMOdel != null && testMOdel) { // 这个是调试弹框
261 296 if (type == null) {
... ... @@ -305,7 +340,7 @@ public class HttpHelper extends HttpHelperCore {
305 340 map.put("requestParam", requestParam);
306 341 LogUtil.i(TAG,"requestParam" + requestParam);
307 342 executeHttpPost(
308   - "http://" + MyApp.getInstance().getServiceIp() + action, "",
  343 + "https://" + MyApp.getInstance().getServiceIp() + action, "",
309 344 map, httpCallback, "data", DataTrans.class);
310 345 if (testMOdel != null && testMOdel) { // 这个是调试弹框
311 346 if (type == null) {
... ... @@ -351,7 +386,7 @@ public class HttpHelper extends HttpHelperCore {
351 386 signkey, identity);
352 387 map.put("requestParam", requestParam);
353 388 LogUtil.i(TAG,"requestParam" + requestParam);
354   - executeHttpPost("http://" + url + action, "", map, httpCallback,
  389 + executeHttpPost("https://" + url + action, "", map, httpCallback,
355 390 "data", DataTrans.class);
356 391 }
357 392  
... ... @@ -382,7 +417,7 @@ public class HttpHelper extends HttpHelperCore {
382 417 map.put("requestParam", requestParam);
383 418 LogUtil.i(TAG,"requestParam" + requestParam);
384 419 executeHttpPost(
385   - "http://" + MyApp.getInstance().getServiceIp() + action, "",
  420 + "https://" + MyApp.getInstance().getServiceIp() + action, "",
386 421 map, httpCallback, "data", DataTrans.class);
387 422  
388 423  
... ...