|
|
|
@ -270,7 +270,7 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter { |
|
|
|
|
return queryInvoiceResult; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public JSONObject singleCheckInvoice(Map<String, String> pramsMap) throws Exception { |
|
|
|
|
public JSONObject singleCheckInvoice(Map<String, String> pramsMap, String isInteger) throws Exception { |
|
|
|
|
|
|
|
|
|
//1.封装查验参数
|
|
|
|
|
ApiRequest apiRequest = new ApiRequest(); |
|
|
|
@ -306,7 +306,7 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter { |
|
|
|
|
JSONObject jsonObject = new JSONObject(); |
|
|
|
|
if (StringUtils.isNoneBlank(apiResponse.getContent())) { |
|
|
|
|
log.info("查验的结果为:{}", apiResponse.getContent()); |
|
|
|
|
jsonObject = convertToSnObject(apiResponse.getContent(), jsonObject, fplxdm); |
|
|
|
|
jsonObject = convertToSnObject(apiResponse.getContent(), jsonObject, fplxdm, isInteger); |
|
|
|
|
} |
|
|
|
|
// saveCheckRecord(pramsMap, apiResponse);
|
|
|
|
|
|
|
|
|
@ -331,7 +331,7 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter { |
|
|
|
|
platformCheckLogService.save(checkLog); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private JSONObject convertToSnObject(String content, JSONObject jsonObject, String invoiceType) throws ParseException { |
|
|
|
|
private JSONObject convertToSnObject(String content, JSONObject jsonObject, String invoiceType, String isInteger) throws ParseException { |
|
|
|
|
|
|
|
|
|
String con = new String(Base64.decode(content)); |
|
|
|
|
HashMap contentMap = JSONObject.parseObject(con, HashMap.class); |
|
|
|
@ -468,6 +468,11 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter { |
|
|
|
|
if (!"0".equals(taxRate)) { |
|
|
|
|
taxRate = taxRate.substring(0, taxRate.length() - 1); |
|
|
|
|
} |
|
|
|
|
//按照小数处理
|
|
|
|
|
if(StringUtils.isNotBlank(isInteger)){ |
|
|
|
|
BigDecimal bigDecimal = new BigDecimal(taxRate); |
|
|
|
|
taxRate = bigDecimal.divide(new BigDecimal("100")).toPlainString(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ("11".equals(invoiceType)) { |
|
|
|
|
taxRate = "0"; |
|
|
|
@ -726,7 +731,7 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter { |
|
|
|
|
pramsMap.put("invoiceType", invoice.getInvoiceType()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
checkInvoiceResult = snPushCheckRecordService.singleCheckInvoice(pramsMap); |
|
|
|
|
checkInvoiceResult = snPushCheckRecordService.singleCheckInvoice(pramsMap,null); |
|
|
|
|
log.info("补充查验结果为:{}", checkInvoiceResult); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|