|
|
|
@ -12,6 +12,8 @@ import com.jianshui.invoice.factory.IInvoiceServiceFactory; |
|
|
|
|
import com.jianshui.invoice.mapper.BillInfoMapper; |
|
|
|
|
import com.jianshui.invoice.service.IInvoiceApiService; |
|
|
|
|
import com.jianshui.platform.dto.InvoiceAdd.BillInfoPDTO; |
|
|
|
|
import com.jianshui.platform.dto.InvoiceAdd.species.BillInfoSDGenInvoicePDTO; |
|
|
|
|
import com.jianshui.platform.dto.InvoiceAdd.species.BillInfoSDSpecialInvoicePDTO; |
|
|
|
|
import com.jianshui.platform.service.InvoiceAddService; |
|
|
|
|
import com.jianshui.platform.utils.InvoiceAllYhdjUtils; |
|
|
|
|
import com.jianshui.system.domain.InvoiceAllYhdj; |
|
|
|
@ -58,8 +60,27 @@ public class InvoiceAddServiceImpl implements InvoiceAddService { |
|
|
|
|
@Override |
|
|
|
|
public HXResponse invoiceIssuance(BillInfoPDTO billInfoPDTO) { |
|
|
|
|
|
|
|
|
|
String invoiceType = Optional.ofNullable(billInfoPDTO.getInvoiceType()).orElse(""); |
|
|
|
|
|
|
|
|
|
BillInfo billInfo = BeanUtil.copyProperties(billInfoPDTO, BillInfo.class); |
|
|
|
|
// 数电(普票、专票)校验
|
|
|
|
|
BillInfo billInfo = null; |
|
|
|
|
if("1".equals(invoiceType)){ |
|
|
|
|
BillInfoSDGenInvoicePDTO sdGenInvoicePDTO = BeanUtil.copyProperties(billInfoPDTO, BillInfoSDGenInvoicePDTO.class); |
|
|
|
|
ValidateUtils.validate(sdGenInvoicePDTO.getBillInfoDetailPDTOList()); |
|
|
|
|
ValidateUtils.validate(sdGenInvoicePDTO); |
|
|
|
|
|
|
|
|
|
billInfo = BeanUtil.copyProperties(sdGenInvoicePDTO, BillInfo.class); |
|
|
|
|
}else if("2".equals(invoiceType)){ |
|
|
|
|
BillInfoSDSpecialInvoicePDTO sdSpecialInvoicePDTO = BeanUtil.copyProperties(billInfoPDTO, BillInfoSDSpecialInvoicePDTO.class); |
|
|
|
|
ValidateUtils.validate(sdSpecialInvoicePDTO.getBillInfoDetailPDTOList()); |
|
|
|
|
ValidateUtils.validate(sdSpecialInvoicePDTO); |
|
|
|
|
|
|
|
|
|
billInfo = BeanUtil.copyProperties(sdSpecialInvoicePDTO, BillInfo.class); |
|
|
|
|
}else { |
|
|
|
|
return new HXResponse("未获取到发票类别!"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
billInfo = BeanUtil.copyProperties(billInfoPDTO, BillInfo.class); |
|
|
|
|
|
|
|
|
|
billInfo.setSource(ChannelSource.PLATFORM.getCode()); |
|
|
|
|
|
|
|
|
|