|
|
|
@ -99,6 +99,71 @@ public class AisinoInvoiceResponseAdapterImpl implements IInvoiceResponseService |
|
|
|
|
queryResult.put("list", new ArrayList<>()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 红字确认单查询
|
|
|
|
|
if (StringUtils.equals("hzqrdFind", query)) { |
|
|
|
|
// 判断有无data
|
|
|
|
|
Object datas = result.getData(); |
|
|
|
|
|
|
|
|
|
// 如果datas不为Null
|
|
|
|
|
if (datas != null) { |
|
|
|
|
// 如果返回将诶过为invioce
|
|
|
|
|
List<AisinoJnInvoiceResponse> responses = new ArrayList<>(); |
|
|
|
|
if (datas instanceof List) { |
|
|
|
|
for (int ij = 0; ij < ((List<?>) datas).size(); ij++) { |
|
|
|
|
Object data = ((List<?>) datas).get(ij); |
|
|
|
|
// 转为HxInvoice
|
|
|
|
|
Invoice invoice = (Invoice) data; |
|
|
|
|
if (invoice == null) { |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
AisinoJnInvoiceResponse invoiceResponse = new AisinoJnInvoiceResponse(); |
|
|
|
|
BeanUtils.copyProperties(invoice, invoiceResponse); |
|
|
|
|
String invoiceType = DictUtils.getDictLabel("invoice_type", invoice.getInvoiceType()); |
|
|
|
|
if (invoiceType != null) { |
|
|
|
|
invoiceResponse.setInvoiceType(invoiceType); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 处理发票状态
|
|
|
|
|
|
|
|
|
|
// 处理Detail
|
|
|
|
|
List<InvoiceDetail> detailList = invoice.getInvoiceDetailList(); |
|
|
|
|
if (detailList != null) { |
|
|
|
|
List<AisinoJnInvoiceDetailResponse> invoiceDetailResponses = new ArrayList<>(); |
|
|
|
|
for (int i = 0; i < detailList.size(); i++) { |
|
|
|
|
AisinoJnInvoiceDetailResponse response = new AisinoJnInvoiceDetailResponse(); |
|
|
|
|
InvoiceDetail tempDetail = detailList.get(i); |
|
|
|
|
BeanUtils.copyProperties(tempDetail, response); |
|
|
|
|
Integer hsbz = tempDetail.getHsbz(); |
|
|
|
|
if (hsbz == 0) { |
|
|
|
|
response.setHsbz("false"); |
|
|
|
|
response.setTaxamt(null); |
|
|
|
|
// 如果不含税
|
|
|
|
|
} else { |
|
|
|
|
// 如果含税
|
|
|
|
|
response.setHsbz("true"); |
|
|
|
|
response.setTaxfreeamt(response.getTaxamt()); |
|
|
|
|
} |
|
|
|
|
invoiceDetailResponses.add(response); |
|
|
|
|
} |
|
|
|
|
invoiceResponse.setInvoiceDetailList(invoiceDetailResponses); |
|
|
|
|
} |
|
|
|
|
responses.add(invoiceResponse); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
JSONObject queryResult = new JSONObject(); |
|
|
|
|
queryResult.put("message", result.getMessage()); |
|
|
|
|
queryResult.put("list", responses); |
|
|
|
|
queryResult.put("status", result.getStatus()); |
|
|
|
|
return queryResult; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
JSONObject queryResult = new JSONObject(); |
|
|
|
|
queryResult.put("result", result.getMessage()); |
|
|
|
|
queryResult.put("list", new ArrayList<>()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 如果是开具红票
|
|
|
|
|
if (StringUtils.equals("add_redinfo", query)) { |
|
|
|
|
return result; |
|
|
|
|