public String readVoucherAgain(ReadVoucherAgainFrom from) {
try {
log.info("查询未签收凭证参数--------->req:{}"+JSON.toJSONString(from));
String post = get(from,VouUrl +readVoucherAgain);
log.info("查询未签收凭证返回--------->post:{}"+post);
JSONObject jsonObject = JSON.parseObject(post);
if("1".equals(jsonObject.get("code"))){
//返回
return jsonObject.get("data").toString();
}
}catch (Exception e){
e.printStackTrace();
throw new BizException("查询失败");
}
return null;
}
public List readVoucherAgain(Class clz , String vtCode) {
try {
//查询未签收凭证
//返回报文字符串
String data =voucherService.readVoucherAgain(createReadVoucherAgainFrom(vtCode));
String regx ="<Voucher>(.*?)</Voucher>";
//凭证号字符串集合
List noList =new ArrayList<>();
Pattern compile = Pattern.compile(regx);
Matcher matcher = compile.matcher(data);
while (matcher.find()){
try {
int i =1;
byte[] bytes = Base64.getDecoder().decode(matcher.group(i));
Z z = JaxbUtil.converyToJavaBean(new String(bytes,"GBK"),clz);
noList.add(z);
i++;
}catch (Exception e){
e.printStackTrace();
}
}
return noList;
}catch (Exception e){
e.printStackTrace();
}
return null;
}