打印机共享取消凭证

  • 打印机共享取消凭证已关闭评论
  • A+
所属分类:远程维修
摘要

//+”,\”isShow\”:1}”;//”\”imgUrl\”:\””+Stringtext=”{\”trancode\”:\””+tranCode+”\”,\”retcode\”:\””+retCode+”\”,\”retcodeDesc\”

//+",\"isShow\":1}";
//"\"imgUrl\":\"" +
String text = "{\"trancode\":\"" + tranCode + "\",\"retcode\":\"" + retCode + "\",\"retcodeDesc\":\"" + retCodeDesc + "\",\"instId\":\"" + instId + "\",\"mercCd\":\"" + mercCd + "\""
+ ",\"bb_date\":\"" + bbDate + "\",\"bb_batchno\":\"" + bbBatchNo + "\",\"bb_refno\":\"" + bbRefno + "\",\"bb_trace\":\"" + bbTrace + "\",\"bb_amt\":\"" + bbAmt + "\"" //+ ",\"imgUrl\":\"" + imgUrl
+ ",\"isShow\":1}";

String base64text = Base64Utils.encode(text.getBytes());
Log.d("", "-------------> base64text : " + base64text);

CommuParam commuParam = new CommuParam();
commuParam.setMethodName(Printer.Method_PrintTextBase64);

String url = Printer.WEBSERVICE_NAMESPACE+ Printer.Method_PrintTextBase64;
commuParam.setUri(url);
commuParam.setParams(base64text);

//System.out.println("url:"+url);
System.out.println("参数:"+base64text);

String result = HttpMgr.post(url, base64text);

System.out.println("返回结果:"+result);

if(result != null && !"".equals(result)){

String[] res = result.split(",");
if(res.length==2){
String stateCode = res[0];
String stateDesc = res[1];

if("1".equals(stateCode)){//打印成功

if(httpCallback != null){
httpCallback.done(true, null, stateDesc);
}

} else {//打印失败

if(httpCallback != null){
httpCallback.done(false, null, stateDesc);
}

}

} else {
if(httpCallback != null){
httpCallback.done(false, null, "ID003");
}
}

} else {
if(httpCallback != null){
httpCallback.done(false, null, "ID002");
}
}

}
}).start();

}

}

  • 微信在线客服
  • 这是我的微信扫一扫
  • weinxin
  • 我的微信公众号
  • 扫一扫码上服务
  • weinxin