|
|
|
@ -263,6 +263,41 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
|
if (checkInvoiceByUuid != null) { |
|
|
|
|
log.info("进项票池已存在发票.直接返回票池信息"); |
|
|
|
|
R data = new R(1000, "default success"); |
|
|
|
|
|
|
|
|
|
//如果购方名称为空,则查验之后补充购销方相关信息
|
|
|
|
|
String gfName = checkInvoiceByUuid.getGfName(); |
|
|
|
|
String gfAddressAndPhone = checkInvoiceByUuid.getGfAddressAndPhone(); |
|
|
|
|
if(StringUtils.isEmpty(gfName) || StringUtils.isEmpty(gfAddressAndPhone)){ |
|
|
|
|
log.info("购方名称为空,查验补充信息"); |
|
|
|
|
checkInvoiceResult = snPushCheckRecordService.singleCheckInvoice(pramsMap, null); |
|
|
|
|
|
|
|
|
|
if (!checkInvoiceResult.containsKey("code")) { |
|
|
|
|
if (!checkInvoiceResult.containsKey("cyjg")) { |
|
|
|
|
//先删除原有主数据,再查验更新主数据和明细数据
|
|
|
|
|
int delete = baseTDxRecordInvoiceDao.delete(recordWrapper); |
|
|
|
|
if (delete > 0) { |
|
|
|
|
checkInvoiceResult.put("invoiceNo", checkInvoiceResult.getString("invoiceNumber")); |
|
|
|
|
signSaveInvoiceInfoService.saveQueryInvoiceResult(checkInvoiceResult, userid, "1", dbName); |
|
|
|
|
} |
|
|
|
|
} else if (checkInvoiceResult.containsKey("cyjg") && !"0001".equals(checkInvoiceResult.getString("cyjg"))) { |
|
|
|
|
data = errorInfo(checkInvoiceResult, data); |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
DynamicContextHolder.push("business" + DbConstant.BUSINESS_WRITE); |
|
|
|
|
requestRecordService.saveFailedRequestRecord(singleInvoiceCheckRecord, 0, JSONObject.toJSONString(data), |
|
|
|
|
(String) checkInvoiceResult.get("cyjgxx")); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("发票查验接口记录保存失败,errormsg:{}", e); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(data)); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
checkInvoiceByUuid = baseTDxRecordInvoiceDao.selectOne(recordWrapper); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
String invoiceNo = checkInvoiceByUuid.getInvoiceNo(); |
|
|
|
|
QueryWrapper<BaseTDxRecordInvoiceDetail> detailWrapper = new QueryWrapper<>(); |
|
|
|
|
detailWrapper.eq("uuid", uuid); |
|
|
|
@ -807,7 +842,7 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
|
checkInvoice.put("taxAuthorityNo", vehicleList.getString("taxBureauCode")); |
|
|
|
|
checkInvoice.put("taxAuthorityName", vehicleList.getString("taxBureauName")); |
|
|
|
|
checkInvoice.put("idcardNo", vehicleList.getString("buyerIdNum")); |
|
|
|
|
checkInvoice.put("amountTax", vehicleList.getString("carPrice")); |
|
|
|
|
// checkInvoice.put("amountTax", vehicleList.getString("carPrice"));
|
|
|
|
|
} |
|
|
|
|
//二手车
|
|
|
|
|
if ("15".equals(invoiceType)) { |
|
|
|
|