|
|
|
@ -520,6 +520,31 @@ 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 = snPushCheckRecordService.deleteRecordByWrapper(recordWrapper); |
|
|
|
|
if (delete > 0) { |
|
|
|
|
checkInvoiceResult.put("invoiceNo", checkInvoiceResult.getString("invoiceNumber")); |
|
|
|
|
signSaveInvoiceInfoService.saveQueryInvoiceResult(checkInvoiceResult, "", "1", dbName); |
|
|
|
|
} |
|
|
|
|
} else if (checkInvoiceResult.containsKey("cyjg") && !"0001".equals(checkInvoiceResult.getString("cyjg"))) { |
|
|
|
|
data = errorInfo(checkInvoiceResult, data); |
|
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(data)); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
checkInvoiceByUuid = snPushCheckRecordService.selectRecordByWrapper(recordWrapper); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
String invoiceNo = checkInvoiceByUuid.getInvoiceNo(); |
|
|
|
|
QueryWrapper<BaseTDxRecordInvoiceDetail> detailWrapper = new QueryWrapper<>(); |
|
|
|
|
detailWrapper.eq("uuid", uuid); |
|
|
|
@ -532,10 +557,7 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
|
baseTDxRecordInvoiceDetail = snPushCheckRecordService.selectRecordDetailListByWrapper(detailWrapper); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
String gfName = checkInvoiceByUuid.getGfName(); |
|
|
|
|
String gfAddressAndPhone = checkInvoiceByUuid.getGfAddressAndPhone(); |
|
|
|
|
|
|
|
|
|
if ((baseTDxRecordInvoiceDetail == null || baseTDxRecordInvoiceDetail.size() == 0) && (vehicleList == null || vehicleList.size() == 0) || StringUtils.isEmpty(gfName) || StringUtils.isEmpty(gfAddressAndPhone)) { |
|
|
|
|
if ((baseTDxRecordInvoiceDetail == null || baseTDxRecordInvoiceDetail.size() == 0) && (vehicleList == null || vehicleList.size() == 0)) { |
|
|
|
|
checkInvoiceResult = snPushCheckRecordService.singleCheckInvoice(pramsMap, null); |
|
|
|
|
|
|
|
|
|
if (!checkInvoiceResult.containsKey("code")) { |
|
|
|
|