|
|
@ -20,10 +20,7 @@ import com.dxhy.order.consumer.modules.manager.service.InvoiceDataService; |
|
|
|
import com.dxhy.order.consumer.modules.manager.service.InvoiceService; |
|
|
|
import com.dxhy.order.consumer.modules.manager.service.InvoiceService; |
|
|
|
import com.dxhy.order.consumer.modules.oil.model.OilLog; |
|
|
|
import com.dxhy.order.consumer.modules.oil.model.OilLog; |
|
|
|
import com.dxhy.order.consumer.modules.oil.service.OilService; |
|
|
|
import com.dxhy.order.consumer.modules.oil.service.OilService; |
|
|
|
import com.dxhy.order.consumer.modules.order.service.OrderCommonService; |
|
|
|
import com.dxhy.order.consumer.modules.order.service.*; |
|
|
|
import com.dxhy.order.consumer.modules.order.service.OrderInfoService; |
|
|
|
|
|
|
|
import com.dxhy.order.consumer.modules.order.service.OrderItemInfoService; |
|
|
|
|
|
|
|
import com.dxhy.order.consumer.modules.order.service.OrderProcessService; |
|
|
|
|
|
|
|
import com.dxhy.order.consumer.openapi.protocol.specialinvoice.RedInvoiceFormRspBO; |
|
|
|
import com.dxhy.order.consumer.openapi.protocol.specialinvoice.RedInvoiceFormRspBO; |
|
|
|
import com.dxhy.order.consumer.openapi.protocol.specialinvoice.RedInvoiceFormUploadResponseBO; |
|
|
|
import com.dxhy.order.consumer.openapi.protocol.specialinvoice.RedInvoiceFormUploadResponseBO; |
|
|
|
import com.dxhy.order.consumer.openapi.service.FangGeInterfaceService; |
|
|
|
import com.dxhy.order.consumer.openapi.service.FangGeInterfaceService; |
|
|
@ -45,6 +42,8 @@ import com.dxhy.order.invoice.module.fangge.protocol.taxdisk.FgRegistTaxdiskReqB |
|
|
|
import com.dxhy.order.invoice.module.fangge.service.FangGeService; |
|
|
|
import com.dxhy.order.invoice.module.fangge.service.FangGeService; |
|
|
|
import com.dxhy.order.invoice.module.fangge.service.RegistrationCodeService; |
|
|
|
import com.dxhy.order.invoice.module.fangge.service.RegistrationCodeService; |
|
|
|
import com.dxhy.order.invoice.module.invoice.dao.InvoicePrintInfoMapper; |
|
|
|
import com.dxhy.order.invoice.module.invoice.dao.InvoicePrintInfoMapper; |
|
|
|
|
|
|
|
import com.dxhy.order.invoice.module.invoice.model.vo.OrderInfoEscVO; |
|
|
|
|
|
|
|
import com.dxhy.order.invoice.module.invoice.model.vo.OrderInfoJdcVO; |
|
|
|
import com.dxhy.order.invoice.module.invoice.service.HistoryDataPdfService; |
|
|
|
import com.dxhy.order.invoice.module.invoice.service.HistoryDataPdfService; |
|
|
|
import com.dxhy.order.invoice.module.invoice.service.InvalidInvoiceService; |
|
|
|
import com.dxhy.order.invoice.module.invoice.service.InvalidInvoiceService; |
|
|
|
import com.dxhy.order.invoice.module.invoice.service.OrderInvoiceInfoService; |
|
|
|
import com.dxhy.order.invoice.module.invoice.service.OrderInvoiceInfoService; |
|
|
@ -155,6 +154,13 @@ public class FangGeInterfaceServiceImpl implements FangGeInterfaceService { |
|
|
|
@Resource |
|
|
|
@Resource |
|
|
|
private BaseServiceConfig baseServiceConfig; |
|
|
|
private BaseServiceConfig baseServiceConfig; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
|
|
|
private OrderInfoJdcService orderInfoJdcService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
|
|
|
private OrderInfoEscService orderInfoEscService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 待开发票数据接口 |
|
|
|
* 待开发票数据接口 |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -205,6 +211,19 @@ public class FangGeInterfaceServiceImpl implements FangGeInterfaceService { |
|
|
|
|
|
|
|
|
|
|
|
FgCommonOrderBO fgCommonOrder = new FgCommonOrderBO(); |
|
|
|
FgCommonOrderBO fgCommonOrder = new FgCommonOrderBO(); |
|
|
|
//查询订单数据
|
|
|
|
//查询订单数据
|
|
|
|
|
|
|
|
//查询对应的机动车订单数据
|
|
|
|
|
|
|
|
OrderInfoJdcVO orderInfoJdc = orderInfoJdcService.queryOrderInfoJdcByOrderId(info.getOrderInfoId()); |
|
|
|
|
|
|
|
if (null != orderInfoJdc) { |
|
|
|
|
|
|
|
FgJdctxxBO fgJdctxxBO = BeanTransitionUtils.transitionJdcfgOrderInvoiceHead(orderInfoJdc); |
|
|
|
|
|
|
|
fgCommonOrder.setJDCTXX(fgJdctxxBO); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//查询二手车订单数据
|
|
|
|
|
|
|
|
OrderInfoEscVO orderInfoEsc = orderInfoEscService.queryOrderInfoEscByOrderId(info.getOrderInfoId()); |
|
|
|
|
|
|
|
if (null != orderInfoEsc) { |
|
|
|
|
|
|
|
FgEsctxxBO fgEsctxxBO = BeanTransitionUtils.transitionEscfgOrderInvoiceHead(orderInfoEsc); |
|
|
|
|
|
|
|
fgCommonOrder.setESCTXX(fgEsctxxBO); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
OrderInfo orderInfo = orderInfoService.selectOrderInfoByOrderId(info.getOrderInfoId(), shList); |
|
|
|
OrderInfo orderInfo = orderInfoService.selectOrderInfoByOrderId(info.getOrderInfoId(), shList); |
|
|
|
if (orderInfo == null) { |
|
|
|
if (orderInfo == null) { |
|
|
|
if (StringUtils.isNotBlank(nsrsbh) && StringUtils.isNotBlank(jqbh)) { |
|
|
|
if (StringUtils.isNotBlank(nsrsbh) && StringUtils.isNotBlank(jqbh)) { |
|
|
@ -265,6 +284,20 @@ public class FangGeInterfaceServiceImpl implements FangGeInterfaceService { |
|
|
|
* 数据组装 |
|
|
|
* 数据组装 |
|
|
|
* 订单状态 0 未开具 1 开具成功 2 开具失败 |
|
|
|
* 订单状态 0 未开具 1 开具成功 2 开具失败 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
if (orderInfo.getYfpKprq()==null&&ConfigureConstant.STRING_1.equals(orderInfo.getKplx())){ |
|
|
|
|
|
|
|
//根据发票请求流水号和原代码号码取查询原发票的开票日期
|
|
|
|
|
|
|
|
OrderInvoiceInfo orderInvoiceInfo1 = new OrderInvoiceInfo(); |
|
|
|
|
|
|
|
orderInvoiceInfo1.setFpdm(orderInfo.getYfpDm()); |
|
|
|
|
|
|
|
orderInvoiceInfo1.setFphm(orderInfo.getYfpHm()); |
|
|
|
|
|
|
|
List<String> taxNos = new ArrayList<>(); |
|
|
|
|
|
|
|
taxNos.add(orderInfo.getXhfNsrsbh()); |
|
|
|
|
|
|
|
OrderInvoiceInfo invoiceInfo = orderInvoiceInfoService.selectOrderInvoiceInfo(orderInvoiceInfo1, taxNos); |
|
|
|
|
|
|
|
if (invoiceInfo!=null){ |
|
|
|
|
|
|
|
log.info("\n************************\n原蓝票代码: {},\n原蓝票号码: {},\n原开票日期: {}\n************************",orderInfo.getYfpDm(),orderInfo.getYfpHm(),invoiceInfo.getKprq()); |
|
|
|
|
|
|
|
orderInfo.setYfpKprq(invoiceInfo.getKprq()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
FgCommonOrderHeadBO fgCommonOrderHead = BeanTransitionUtils.transitionfgOrderInvoiceHead(orderInfo, orderInvoiceInfo, orderItemInfos); |
|
|
|
FgCommonOrderHeadBO fgCommonOrderHead = BeanTransitionUtils.transitionfgOrderInvoiceHead(orderInfo, orderInvoiceInfo, orderItemInfos); |
|
|
|
String terminalCode = orderInfo.getSksbCode(); |
|
|
|
String terminalCode = orderInfo.getSksbCode(); |
|
|
|
if (StringUtils.isBlank(terminalCode)) { |
|
|
|
if (StringUtils.isBlank(terminalCode)) { |
|
|
@ -365,9 +398,16 @@ public class FangGeInterfaceServiceImpl implements FangGeInterfaceService { |
|
|
|
} else if (OrderInfoEnum.QDBZ_CODE_4.getKey().equals(orderInfo.getQdBz())) { |
|
|
|
} else if (OrderInfoEnum.QDBZ_CODE_4.getKey().equals(orderInfo.getQdBz())) { |
|
|
|
fgCommonOrderHead.setTSPZ(OrderInfoEnum.TSPZ_08.getKey()); |
|
|
|
fgCommonOrderHead.setTSPZ(OrderInfoEnum.TSPZ_08.getKey()); |
|
|
|
} else if (OrderInfoEnum.QDBZ_CODE_5.getKey().equals(orderInfo.getQdBz()) || OrderInfoEnum.QDBZ_CODE_6.getKey().equals(orderInfo.getQdBz())) { |
|
|
|
} else if (OrderInfoEnum.QDBZ_CODE_5.getKey().equals(orderInfo.getQdBz()) || OrderInfoEnum.QDBZ_CODE_6.getKey().equals(orderInfo.getQdBz())) { |
|
|
|
fgCommonOrderHead.setTSPZ(OrderInfoEnum.TSPZ_09.getKey()); |
|
|
|
//fgCommonOrderHead.setTSPZ(OrderInfoEnum.TSPZ_09.getKey());
|
|
|
|
|
|
|
|
//机动车专票--方格设置成12 其余设置为09
|
|
|
|
|
|
|
|
if(OrderInfoEnum.TAX_EQUIPMENT_FGUKEY.getKey().equals(terminalCode)){ |
|
|
|
|
|
|
|
fgCommonOrderHead.setTSPZ(OrderInfoEnum.TSPZ_12.getKey()); |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
fgCommonOrderHead.setTSPZ(OrderInfoEnum.TSPZ_09.getKey()); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 含税税率标识 |
|
|
|
* 含税税率标识 |
|
|
|
* 0是普通征收,1是减按计增,2是差额征收 |
|
|
|
* 0是普通征收,1是减按计增,2是差额征收 |
|
|
@ -1072,7 +1112,19 @@ public class FangGeInterfaceServiceImpl implements FangGeInterfaceService { |
|
|
|
fgRedInvoiceFormHead.setHJSE(specialInvoiceReversal.getHjse()); |
|
|
|
fgRedInvoiceFormHead.setHJSE(specialInvoiceReversal.getHjse()); |
|
|
|
fgRedInvoiceFormHead.setSQSM(specialInvoiceReversal.getSqsm()); |
|
|
|
fgRedInvoiceFormHead.setSQSM(specialInvoiceReversal.getSqsm()); |
|
|
|
fgRedInvoiceFormHead.setBMB_BBH("1.0"); |
|
|
|
fgRedInvoiceFormHead.setBMB_BBH("1.0"); |
|
|
|
fgRedInvoiceFormHead.setXXBLX("0"); |
|
|
|
//方格的xxblx要专门专门 存3转2 存4转3
|
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(specialInvoiceReversal.getType())){ |
|
|
|
|
|
|
|
if ("3".equals(specialInvoiceReversal.getType())){ |
|
|
|
|
|
|
|
//机动车红字信息表(涉及退货和开具错误等)
|
|
|
|
|
|
|
|
fgRedInvoiceFormHead.setXXBLX("2"); |
|
|
|
|
|
|
|
}else if("4".equals(specialInvoiceReversal.getType())){ |
|
|
|
|
|
|
|
fgRedInvoiceFormHead.setXXBLX("3"); |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
fgRedInvoiceFormHead.setXXBLX("0"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
fgRedInvoiceFormHead.setXXBLX("0"); |
|
|
|
|
|
|
|
} |
|
|
|
//填开时间为 yyyy-MM-dd HH:mm:ss ,返回方格转换为yyyyMMdd
|
|
|
|
//填开时间为 yyyy-MM-dd HH:mm:ss ,返回方格转换为yyyyMMdd
|
|
|
|
fgRedInvoiceFormHead.setTKSJ(DateUtil.format(specialInvoiceReversal.getTksj(), ConfigureConstant.DATE_FORMAT_DATE_YMD)); |
|
|
|
fgRedInvoiceFormHead.setTKSJ(DateUtil.format(specialInvoiceReversal.getTksj(), ConfigureConstant.DATE_FORMAT_DATE_YMD)); |
|
|
|
fgRedInvoiceFormHead.setYYSBZ(OrderInfoEnum.SPECIAL_YYSBZ_0000000000.getKey()); |
|
|
|
fgRedInvoiceFormHead.setYYSBZ(OrderInfoEnum.SPECIAL_YYSBZ_0000000000.getKey()); |
|
|
@ -1654,6 +1706,28 @@ public class FangGeInterfaceServiceImpl implements FangGeInterfaceService { |
|
|
|
log.error("{}没有作废发票", LOGGER_MSG); |
|
|
|
log.error("{}没有作废发票", LOGGER_MSG); |
|
|
|
return fgInvalidInvoiceRspfgOrderResponse; |
|
|
|
return fgInvalidInvoiceRspfgOrderResponse; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//获取方格UKey税局地址
|
|
|
|
|
|
|
|
FgUkeySf fgukeysf = new FgUkeySf(); |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
fgukeysf = getFgukeysf(paramContent.getNSRSBH(),invalidInvoiceInfo.get(0).getEntId(), ConfigureConstant.STRING_DICTIONARY_FGOFDDOWNLOAD_URL); |
|
|
|
|
|
|
|
} catch (OrderReceiveException e) { |
|
|
|
|
|
|
|
fgInvalidInvoiceRspfgOrderResponse.setSTATUS_CODE(e.getCode()); |
|
|
|
|
|
|
|
fgInvalidInvoiceRspfgOrderResponse.setSTATUS_MESSAGE(e.getMessage()); |
|
|
|
|
|
|
|
log.error("{},开票接口读取数据异常,异常信息为:{}", LOGGER_MSG, e); |
|
|
|
|
|
|
|
return fgInvalidInvoiceRspfgOrderResponse; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 上传地址补全 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
FgUkeySf fgukeysf1 = new FgUkeySf(); |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
fgukeysf1 = getFgukeysf(paramContent.getNSRSBH(),invalidInvoiceInfo.get(0).getEntId(), ConfigureConstant.STRING_DICTIONARY_FGUPLOAD_URL); |
|
|
|
|
|
|
|
} catch (OrderReceiveException e) { |
|
|
|
|
|
|
|
fgInvalidInvoiceRspfgOrderResponse.setSTATUS_CODE(e.getCode()); |
|
|
|
|
|
|
|
fgInvalidInvoiceRspfgOrderResponse.setSTATUS_MESSAGE(e.getMessage()); |
|
|
|
|
|
|
|
log.error("{},开票接口读取数据异常,异常信息为:{}", LOGGER_MSG, e); |
|
|
|
|
|
|
|
return fgInvalidInvoiceRspfgOrderResponse; |
|
|
|
|
|
|
|
} |
|
|
|
String jqbh = null; |
|
|
|
String jqbh = null; |
|
|
|
for (InvalidInvoiceInfo invalidInvoiceInfo1 : invalidInvoiceInfo) { |
|
|
|
for (InvalidInvoiceInfo invalidInvoiceInfo1 : invalidInvoiceInfo) { |
|
|
|
FgInvalidInvoiceInfosBO infos = new FgInvalidInvoiceInfosBO(); |
|
|
|
FgInvalidInvoiceInfosBO infos = new FgInvalidInvoiceInfosBO(); |
|
|
@ -1661,6 +1735,11 @@ public class FangGeInterfaceServiceImpl implements FangGeInterfaceService { |
|
|
|
infos.setFP_HM(invalidInvoiceInfo1.getFphm()); |
|
|
|
infos.setFP_HM(invalidInvoiceInfo1.getFphm()); |
|
|
|
infos.setQMCS(""); |
|
|
|
infos.setQMCS(""); |
|
|
|
infos.setZFR(invalidInvoiceInfo1.getZfr()); |
|
|
|
infos.setZFR(invalidInvoiceInfo1.getZfr()); |
|
|
|
|
|
|
|
//设置局端IP
|
|
|
|
|
|
|
|
infos.setJDIP(fgukeysf.getSjdz()); |
|
|
|
|
|
|
|
infos.setJDDK(fgukeysf.getSjdk()); |
|
|
|
|
|
|
|
infos.setJDIPSC(fgukeysf1.getSjdz()); |
|
|
|
|
|
|
|
infos.setJDDKSC(fgukeysf1.getSjdk()); |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 方格底层支持持作废类型,0空白,1已开 |
|
|
|
* 方格底层支持持作废类型,0空白,1已开 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|