|
|
|
@ -338,7 +338,7 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter { |
|
|
|
|
* @return |
|
|
|
|
* @throws ParseException |
|
|
|
|
*/ |
|
|
|
|
public ServiceResult<InvoiceInfo> valoremTaxCount(InvoiceInfo invoiceInfo, String enterpriseId, String isDeductible) |
|
|
|
|
public ServiceResult<InvoiceInfo> valoremTaxCount(InvoiceInfo invoiceInfo, String isDeductible) |
|
|
|
|
throws ParseException { |
|
|
|
|
if (isDeductible == null || StringUtils.isEmpty(isDeductible)) { |
|
|
|
|
logger.error("客票价税计算失败:费用类别或可抵扣标识为空"); |
|
|
|
@ -356,7 +356,7 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 校验客票可抵扣条件
|
|
|
|
|
ServiceResult<?> result = checkIsDeduction(invoiceInfo, enterpriseId); |
|
|
|
|
ServiceResult<?> result = checkIsDeduction(invoiceInfo); |
|
|
|
|
if (!result.getResult()) { |
|
|
|
|
logger.error("客票价税计算失败:" + result.getMsg()); |
|
|
|
|
return fail(result.getMsg()); |
|
|
|
@ -449,7 +449,7 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter { |
|
|
|
|
* @return |
|
|
|
|
* @throws ParseException |
|
|
|
|
*/ |
|
|
|
|
private ServiceResult<?> checkIsDeduction(InvoiceInfo invoiceInfo, String enterpriseId) throws ParseException { |
|
|
|
|
private ServiceResult<?> checkIsDeduction(InvoiceInfo invoiceInfo) throws ParseException { |
|
|
|
|
try { |
|
|
|
|
String result = verifyInfo(invoiceInfo); |
|
|
|
|
if (!CommonEnum.RESPONSE_INTERFACE_STATUS_CODE_SUCCESS.equals(result)) { |
|
|
|
@ -487,25 +487,25 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
// 校验公路、水路、其他运输客票(实名),航空客运电子客票行程单,火车票
|
|
|
|
|
if (invoiceInfo.getInvoiceTypeCode().equals(Constant.ROAD_TRANSPORT_TICKET_REAL_NAME_CODE) |
|
|
|
|
|| invoiceInfo.getInvoiceTypeCode().equals(Constant.WATER_TRANSPORT_TICKET_REAL_NAME_CODE) |
|
|
|
|
|| invoiceInfo.getInvoiceTypeCode().equals(Constant.OTHER_TRANSPORT_TICKET_REAL_NAME_CODE) |
|
|
|
|
|| invoiceInfo.getInvoiceTypeCode().equals(Constant.AIR_PASSENGER_ELECTRONIC_TICKET_ITINERARY_CODE) |
|
|
|
|
|| invoiceInfo.getInvoiceTypeCode().equals(Constant.RAILWAY_TICKET_CODE)) { |
|
|
|
|
if (StringUtils.isEmpty(invoiceInfo.getIdentityNumber()) |
|
|
|
|
|| StringUtils.isEmpty(invoiceInfo.getPassenger()) || StringUtils.isEmpty(enterpriseId)) { |
|
|
|
|
return fail("必填字段为空"); |
|
|
|
|
} |
|
|
|
|
int count = orgUserInfoDao.countUserByIdentityNumber(invoiceInfo.getIdentityNumber(), |
|
|
|
|
invoiceInfo.getPassenger(), enterpriseId); |
|
|
|
|
if (count == 0) { |
|
|
|
|
return fail("未查询到用户信息"); |
|
|
|
|
} |
|
|
|
|
if (count > 1) { |
|
|
|
|
return fail("查询到多个用户"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// // 校验公路、水路、其他运输客票(实名),航空客运电子客票行程单,火车票
|
|
|
|
|
// if (invoiceInfo.getInvoiceTypeCode().equals(Constant.ROAD_TRANSPORT_TICKET_REAL_NAME_CODE)
|
|
|
|
|
// || invoiceInfo.getInvoiceTypeCode().equals(Constant.WATER_TRANSPORT_TICKET_REAL_NAME_CODE)
|
|
|
|
|
// || invoiceInfo.getInvoiceTypeCode().equals(Constant.OTHER_TRANSPORT_TICKET_REAL_NAME_CODE)
|
|
|
|
|
// || invoiceInfo.getInvoiceTypeCode().equals(Constant.AIR_PASSENGER_ELECTRONIC_TICKET_ITINERARY_CODE)
|
|
|
|
|
// || invoiceInfo.getInvoiceTypeCode().equals(Constant.RAILWAY_TICKET_CODE)) {
|
|
|
|
|
// if (StringUtils.isEmpty(invoiceInfo.getIdentityNumber())
|
|
|
|
|
// || StringUtils.isEmpty(invoiceInfo.getPassenger())) {
|
|
|
|
|
// return fail("必填字段为空");
|
|
|
|
|
// }
|
|
|
|
|
// int count = orgUserInfoDao.countUserByIdentityNumber(invoiceInfo.getIdentityNumber(),
|
|
|
|
|
// invoiceInfo.getPassenger(), enterpriseId);
|
|
|
|
|
// if (count == 0) {
|
|
|
|
|
// return fail("未查询到用户信息");
|
|
|
|
|
// }
|
|
|
|
|
// if (count > 1) {
|
|
|
|
|
// return fail("查询到多个用户");
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
return ok(); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
logger.error("校验客运发票是否可抵扣异常:" + e.toString()); |
|
|
|
|