中交建-销项合并测试:通用查询接口

beta-enc
dongxiaoke 2 years ago
parent 9df18f797f
commit ccda54552f
  1. 7
      jianshui-admin/src/main/java/com/jianshui/api/controller/http/invoiceall/v1/InvoiceAllController.java
  2. 12
      jianshui-invoice-all/src/main/java/com/jianshui/invoiceall/service/IInvoiceAll.java
  3. 7
      jianshui-invoice-all/src/main/java/com/jianshui/invoiceall/service/impl/InvoiceAllImpl.java
  4. 3
      jianshui-invoice/src/main/java/com/jianshui/invoice/mapper/BillInfoMapper.java
  5. 344
      jianshui-invoice/src/main/java/com/jianshui/invoice/service/impl/api/JcskInvoiceApiServiceImpl.java
  6. 86
      jianshui-invoice/src/main/resources/mapper/invoice/BillInfoMapper.xml

@ -667,9 +667,6 @@ public class InvoiceAllController {
@PostMapping({"/api/invoice_all/v1/queryInvoiceBeRed/{identity}", "/api/invoice_all/v1/queryInvoiceBeRed"})
public Object queryInvoiceBeRed(HttpServletRequest request, String identity) throws Exception {
// TODO: 2023/5/6 .....||||
if (StringUtils.isEmpty(identity)) {
return AjaxResult.error(ErrorCode.EMPTY_IDENTITY);
}
@ -688,8 +685,8 @@ public class InvoiceAllController {
String serviceKey = serviceManageService.getCompanyServiceSupplier(SERVICE_KEY, companyservice.getCompanyid());
IInvoiceAll invoiceAllService = iInvoceiAllServiceFactory.getService(serviceKey);
InvoiceAllRedInvoiceDetailDTO invoiceAllRedInvoiceDetailDTO= requestBody.toJavaObject(InvoiceAllRedInvoiceDetailDTO.class);
AjaxResult result = invoiceAllService.queryRedInfoDetail(companyservice, invoiceAllRedInvoiceDetailDTO);
InvoiceAllCanRedDTO invoiceAllCanRedDTO = requestBody.toJavaObject(InvoiceAllCanRedDTO.class);
AjaxResult result = invoiceAllService.queryInvoiceBeRed(companyservice, invoiceAllCanRedDTO);
//返回处理 增加调用次数
if (result.isSuccess()) {

@ -148,14 +148,6 @@ public interface IInvoiceAll {
AjaxResult queryRedInfoDetail(Companyservice companyservice, InvoiceAllRedInvoiceDetailDTO invoiceAllRedInvoiceDetailDTO);
/** 查询蓝字发票可红冲金额*/
AjaxResult queryInvoiceBeRed(Companyservice companyservice, InvoiceAllCanRedDTO invoiceAllCanRedDTO);
}

@ -1212,4 +1212,11 @@ public class InvoiceAllImpl implements IInvoiceAll {
}
/** 查询蓝字发票可红冲金额*/
@Override
public AjaxResult queryInvoiceBeRed(Companyservice companyservice, InvoiceAllCanRedDTO invoiceAllCanRedDTO) {
return null;
}
}

@ -97,4 +97,7 @@ public interface BillInfoMapper extends BaseMapper<BillInfo> {
*/
public BillInfo selectBySystemOrderNo(@Param(("companyId")) Long companyId, @Param("system_orderno") String systemOrderNo);
public BillInfo selectByOutTradeOrderno(@Param(("companyId")) Long companyId, @Param("out_trade_orderno") String outTradeOrderno);
}

@ -93,25 +93,24 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService {
// kptype 1蓝票 2红票
String kpType = billInfo.getKptype();
if ("1".equals(kpType)) {
// 查询用户登记参数
QueryWrapper<InvoiceAllYhdj> yhdjQueryWrapper = new QueryWrapper<>();
yhdjQueryWrapper.eq("nsrsbh", companyservice.getSellertax());
yhdjQueryWrapper.eq("identity", companyservice.getIdentity());
InvoiceAllYhdj invoiceAllYhdj = yhdjMapper.selectOne(yhdjQueryWrapper);
// 查询用户登记参数
QueryWrapper<InvoiceAllYhdj> yhdjQueryWrapper = new QueryWrapper<>();
yhdjQueryWrapper.eq("nsrsbh", companyservice.getSellertax());
yhdjQueryWrapper.eq("identity", companyservice.getIdentity());
InvoiceAllYhdj invoiceAllYhdj = yhdjMapper.selectOne(yhdjQueryWrapper);
if (BeanUtil.isEmpty(invoiceAllYhdj)) {
return new HXResponse("用户未登记!");
}
if (BeanUtil.isEmpty(invoiceAllYhdj)) {
return new HXResponse("用户未登记!");
}
QueryTwoDTO queryDTO = new QueryTwoDTO();
queryDTO.setDqbm(invoiceAllYhdj.getDqbm());
queryDTO.setAsync("false");
queryDTO.setBsrysfzjhm(invoiceAllYhdj.getBsrysfzjhm());
queryDTO.setNsrsbh(invoiceAllYhdj.getNsrsbh());
queryDTO.setRequestId("tycxjk");
QueryTwoDTO queryDTO = new QueryTwoDTO();
queryDTO.setDqbm(invoiceAllYhdj.getDqbm());
queryDTO.setAsync("false");
queryDTO.setBsrysfzjhm(invoiceAllYhdj.getBsrysfzjhm());
queryDTO.setNsrsbh(invoiceAllYhdj.getNsrsbh());
queryDTO.setRequestId("tycxjk");
if ("1".equals(kpType)) {
// 开票实体转换,校验
InvoiceAllAddTwoDTO invoiceAllAddTwoDTO = BeanUtil.copyProperties(billInfo, InvoiceAllAddTwoDTO.class);
invoiceAllAddTwoDTO.setDqbm(queryDTO.getDqbm());
@ -124,7 +123,6 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService {
InvoiceAllAddInfoTwoDTO invoiceAllAddInfoTwoDTO = BeanUtil.copyProperties(billInfo, InvoiceAllAddInfoTwoDTO.class
,"fjxxList","mxList","tdywxx","ext");
// 发票类型处理
ValidateUtils.validate(invoiceAllAddInfoTwoDTO);
// 明细集合
@ -139,7 +137,6 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService {
invoiceAllAddInfoTwoDTO.setMxList(mxList);
invoiceAllAddTwoDTO.setJsonData(invoiceAllAddInfoTwoDTO);
// 报文转换存储
billInfo.setCompanyId(companyservice.getCompanyid());
billInfo.setServiceSupplierKey("JCSK");
@ -179,8 +176,6 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService {
cn.hutool.json.JSONObject result = null;
// TODO: 2023/4/23 调试
try {
Map<String,Object> map = BeanToMapUtils.fastJsonBean2Map(invoiceAllAddTwoDTO);
result = ApiHttp.request(WebServiceConstant.LZFPKJ, WebServiceConstant.URL, JSONUtil.parse(map), companyservice);
@ -229,9 +224,7 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService {
}
} else if ("2".equals(kpType)) {
//billinfo => 红字报文
AddRedInvoiceTwoDTO addRedInvoiceDTO = BeanUtil.copyProperties(billInfo, AddRedInvoiceTwoDTO.class);
ValidateUtils.validate(addRedInvoiceDTO);
@ -339,210 +332,7 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService {
@Override
public HXResponse queryInvoice(QueryBillInfoDTO billInfo, Companyservice companyservice) {
String systemOrderNo = billInfo.getSystemOrderno();
BillInfo billInfoResult = billInfoMapper.selectBySystemOrderNo(companyservice.getCompanyid(), systemOrderNo);
// requestId=OutTradeOrderno
if (StrUtil.isEmpty(billInfoResult.getOutTradeOrderno())) {
return new HXResponse("未获取到开票记录!");
}
// 查询用户登记参数
QueryWrapper<InvoiceAllYhdj> yhdjQueryWrapper = new QueryWrapper<>();
yhdjQueryWrapper.eq("nsrsbh", companyservice.getSellertax());
yhdjQueryWrapper.eq("identity", companyservice.getIdentity());
InvoiceAllYhdj invoiceAllYhdj = yhdjMapper.selectOne(yhdjQueryWrapper);
if (BeanUtil.isEmpty(invoiceAllYhdj)) {
return new HXResponse("用户未登记!");
}
QueryTwoDTO queryDTO = new QueryTwoDTO();
queryDTO.setDqbm(invoiceAllYhdj.getDqbm());
queryDTO.setAsync("false");
queryDTO.setBsrysfzjhm(invoiceAllYhdj.getBsrysfzjhm());
queryDTO.setNsrsbh(invoiceAllYhdj.getNsrsbh());
queryDTO.setRequestId("tycxjk");
ValidateUtils.validate(queryDTO);
String requestId = queryDTO.getRequestId();
String serviceId = "";
cn.hutool.json.JSONObject result = null;
try {
result = ApiHttp.request(WebServiceConstant.TYCXJK, WebServiceConstant.URL, queryDTO, companyservice);
String code = result.get("code") != null ? result.get("code").toString() : "";
String msg = result.get("msg") != null ? result.get("msg").toString() : "";
String data = result.get("data") != null ? result.get("data").toString() : "";
if ("0000".equals(code) && StrUtil.isNotEmpty(data)) {
QueryWrapper<InvoiceAllApiLog> apiLogQueryWrapper = new QueryWrapper<>();
apiLogQueryWrapper.eq("request_id", requestId);
InvoiceAllApiLog allApiLog = allApiLogMapper.selectOne(apiLogQueryWrapper);
if (BeanUtil.isNotEmpty(allApiLog) && StrUtil.isNotEmpty(allApiLog.getRequestId())) {
serviceId = allApiLog.getRequestId();
}
HXResponse response = new HXResponse("0000", "查询成功");
String finalServiceId = serviceId;
if (WebServiceConstant.LZFPKJ.equals(finalServiceId)) {
// 蓝字发票开具
AddInvoiceTWOVO addInvoiceVO = BeanUtil.copyProperties(data, AddInvoiceTWOVO.class);
if (BeanUtil.isNotEmpty(addInvoiceVO)) {
QueryWrapper<BillInfo> billInfoQueryWrapper = new QueryWrapper<>();
billInfoQueryWrapper.eq("out_trade_orderno", requestId);
BillInfo billInfoR = billInfoMapper.selectOne(billInfoQueryWrapper);
if (BeanUtil.isNotEmpty(billInfoR)) {
QueryWrapper<Invoice> invoiceQueryWrapper = new QueryWrapper<>();
invoiceQueryWrapper.eq("out_trade_orderno", requestId);
Invoice invoice = invoiceMapper.selectOne(invoiceQueryWrapper);
if (BeanUtil.isNotEmpty(invoice)) {
invoice = BeanUtil.copyProperties(billInfo, Invoice.class);
invoice.setFphm(addInvoiceVO.getFphm());
invoice.setKprq(DateUtil.parse(addInvoiceVO.getKprq()));
invoice.setZzfpdm(addInvoiceVO.getZzfpdm());
invoice.setZzfphm(addInvoiceVO.getZzfphm());
//二维码=二维码下载地址
invoice.setQrCode(addInvoiceVO.getEwmUrl());
//发票 pdf 地址=PDF格式下载地址
invoice.setInvoicePdfUrl(addInvoiceVO.getPdfUrl());
//发票详情地址=OFD格式下载地址
invoice.setInvoiceJpgUrl(addInvoiceVO.getOfdUrl());
//ofdUrl=XML格式下载地址
invoice.setcOfdUrl(addInvoiceVO.getXmlUrl());
invoice.setState(2);
invoiceMapper.updateInvoice(invoice);
billInfoR.setState(2);
billInfoMapper.updateById(billInfoR);
} else {
invoice = BeanUtil.copyProperties(billInfo, Invoice.class);
invoice.setFphm(addInvoiceVO.getFphm());
invoice.setKprq(DateUtil.parse(addInvoiceVO.getKprq()));
invoice.setZzfpdm(addInvoiceVO.getZzfpdm());
invoice.setZzfphm(addInvoiceVO.getZzfphm());
//二维码=二维码下载地址
invoice.setQrCode(addInvoiceVO.getEwmUrl());
//发票 pdf 地址=PDF格式下载地址
invoice.setInvoicePdfUrl(addInvoiceVO.getPdfUrl());
//发票详情地址=OFD格式下载地址
invoice.setInvoiceJpgUrl(addInvoiceVO.getOfdUrl());
//ofdUrl=XML格式下载地址
invoice.setcOfdUrl(addInvoiceVO.getXmlUrl());
invoice.setState(2);
invoiceMapper.insertInvoice(invoice);
billInfoR.setState(2);
billInfoMapper.updateById(billInfoR);
}
// 返回数据
response.put("data", invoice);
} else {
log.error("【金四服务类】【金财数科】【通用查询接口】API请求异常,billInfo未查询到,requestId={}。", requestId);
return new HXResponse("查询错误!");
}
}
} else if (WebServiceConstant.FPEWMXZ.equals(finalServiceId)) {
// 获取发票下载地址
cn.hutool.json.JSONObject json = JSONUtil.parseObj(data);
String ewmUrl = json.getOrDefault("ewmUrl", "").toString();
String pdfUrl = json.getOrDefault("pdfUrl", "").toString();
String ofdUrl = json.getOrDefault("ofdUrl", "").toString();
String xmlUrl = json.getOrDefault("xmlUrl", "").toString();
if (StrUtil.isNotEmpty(requestId)) {
QueryWrapper<Invoice> invoiceQueryWrapper = new QueryWrapper<>();
invoiceQueryWrapper.eq("out_trade_orderno", requestId);
Invoice invoice = invoiceMapper.selectOne(invoiceQueryWrapper);
if (BeanUtil.isNotEmpty(invoice)) {
invoice.setInvoicePdfUrl(pdfUrl);
invoice.setcOfdUrl(ofdUrl);
invoiceMapper.updateInvoice(invoice);
}
}
// TODO: 2023/3/29 返回数据处理
} else if (WebServiceConstant.ADD_RED_INVOICE.equals(finalServiceId)) {
// 查找原发票信息
AddRedInvoiceTWOVO addRedInvoiceVO = BeanUtil.copyProperties(data, AddRedInvoiceTWOVO.class);
QueryWrapper<BillInfo> billInfoQueryWrapper = new QueryWrapper<>();
billInfoQueryWrapper.eq("fpqqlsh", requestId);
BillInfo billInfoR = billInfoMapper.selectOne(billInfoQueryWrapper);
if (billInfoR != null) {
// return AjaxResult.error("未查询到原发票信息");
// 根据billInfo获得原发票号码
QueryWrapper<BillInfo> originBillInfoWrapper = new QueryWrapper<>();
originBillInfoWrapper.eq("origin_fphm", billInfoR.getOriginFphm());
BillInfo originBillInfo = billInfoMapper.selectOne(originBillInfoWrapper);
if (originBillInfo != null) {
// return AjaxResult.error("未查询到原发票信息");
// 查找原发票信息
Invoice originInvoice = invoiceMapper.selectInvoiceByBillInfoId(originBillInfo.getId());
Invoice invoice = BeanUtil.copyProperties(originInvoice, Invoice.class);
invoice.setFphm(addRedInvoiceVO.getFphm());
invoice.setBillInfoId(billInfo.getId());
invoice.setSystemOrderno(billInfo.getSystemOrderno());
invoice.setOutTradeOrderno(billInfo.getOutTradeOrderno());
invoice.setFpqqlsh(billInfo.getFpqqlsh());
invoice.setKprq(DateUtil.parse(addRedInvoiceVO.getKprq()));
invoice.setZzfpdm(addRedInvoiceVO.getZzfpdm());
invoice.setZzfphm(addRedInvoiceVO.getZzfphm());
//二维码=二维码下载地址
invoice.setQrCode(addRedInvoiceVO.getEwmUrl());
//发票 pdf 地址=PDF格式下载地址
invoice.setInvoicePdfUrl(addRedInvoiceVO.getPdfUrl());
//发票详情地址=OFD格式下载地址
invoice.setInvoiceJpgUrl(addRedInvoiceVO.getOfdUrl());
//ofdUrl=XML格式下载地址
invoice.setcOfdUrl(addRedInvoiceVO.getXmlUrl());
invoice.setState(2);
invoiceMapper.insertInvoice(invoice);
billInfoR.setState(2);
billInfoMapper.updateById(billInfoR);
response.put("data", invoice);
}
}
}
else if (WebServiceConstant.KSHC.equals(finalServiceId)) {
// 快速冲红
// TODO: 后期存库
// KschVO kschVO = BeanUtil.copyProperties(data,KschVO.class);
// InvoiceAllKschVO invoiceAllKschVO = BeanUtil.copyProperties(kschVO,InvoiceAllKschVO.class);
}else if (WebServiceConstant.SQHZFPXXQRD.equals(finalServiceId)) {
// 申请红字信息表
// TODO: 后期存库
}else if (WebServiceConstant.CXHZFPXXQRD.equals(finalServiceId)) {
// 查询红字信息表
RedInvoiceQueryAllTWOVO redInvoiceQueryAllTWOVO = BeanUtil.copyProperties(data, RedInvoiceQueryAllTWOVO.class);
// 返回报文转换
List<Redinfo> resultDownload = parseRedINFO(redInvoiceQueryAllTWOVO);
// TODO: 2023/4/6 数据存储
response.put("data", resultDownload);
}else if (WebServiceConstant.SHHZFPXXQRD.equals(finalServiceId)) {
// 审核红字信息表
// TODO: 后期存库
}else if (WebServiceConstant.QDFPWJHQ.equals(finalServiceId)) {
// 审核红字信息表
// TODO: 全电发票文件获取
}
return response;
} else {
return new HXResponse(msg);
}
} catch (Exception e) {
e.printStackTrace();
log.error("【金四服务类】【金财数科】【通用查询接口】API请求异常,外部报文返回code非0000。错误信息:{}", e.getMessage());
return new HXResponse("通用查询接口异常");
}
return null;
}
@ -1060,6 +850,7 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService {
return response;
}
/** 获取人脸识别二维码*/
@Override
public HXResponse qrcode(JSONObject decryptResult, Companyservice companyservice) {
cn.hutool.json.JSONObject result = null;
@ -1079,6 +870,16 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService {
return new HXResponse(msg);
}
InvoiceAllApiLog allApiLog = new InvoiceAllApiLog();
allApiLog.setUrl(WebServiceConstant.QRCODE);
allApiLog.setSendMsg(JSONUtil.toJsonStr(decryptResult));
allApiLog.setResultMsg(JSONUtil.toJsonStr(result));
allApiLog.setCompany(companyservice.getSellertax());
allApiLog.setIdentityId(companyservice.getIdentity());
allApiLog.setRequestId(requestId);
allApiLog.setCreateTime(new Date());
allApiLogMapper.insertInvoiceAllApiLog(allApiLog);
HXResponse response = new HXResponse("0000", "请求成功",json);
return response;
} else {
@ -1367,7 +1168,11 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService {
apiLogQueryWrapper.eq("request_id", requestId);
InvoiceAllApiLog allApiLog = allApiLogMapper.selectOne(apiLogQueryWrapper);
if (BeanUtil.isNotEmpty(allApiLog) && StrUtil.isNotEmpty(allApiLog.getRequestId())) {
serviceId = allApiLog.getRequestId();
serviceId = allApiLog.getUrl();
}
if(BeanUtil.isEmpty(allApiLog)){
log.error("金四日志表未记录,requestId={},返回结果={}",requestId,data);
}
HXResponse response = new HXResponse("0000", "查询成功");
@ -1376,7 +1181,7 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService {
if (WebServiceConstant.LZFPKJ.equals(finalServiceId)) {
// 蓝字发票开具
AddInvoiceTWOVO addInvoiceVO = BeanUtil.copyProperties(data, AddInvoiceTWOVO.class);
AddInvoiceTWOVO addInvoiceVO = BeanUtil.copyProperties(JSONUtil.parse(data), AddInvoiceTWOVO.class);
if (BeanUtil.isNotEmpty(addInvoiceVO)) {
QueryWrapper<BillInfo> billInfoQueryWrapper = new QueryWrapper<>();
@ -1387,44 +1192,48 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService {
invoiceQueryWrapper.eq("out_trade_orderno", requestId);
Invoice invoice = invoiceMapper.selectOne(invoiceQueryWrapper);
BillInfo billInfoResult = billInfoMapper.selectBySystemOrderNo(companyservice.getCompanyid(), systemOrderNo);
if (BeanUtil.isNotEmpty(invoice)) {
invoice = BeanUtil.copyProperties(billInfoResult, Invoice.class);
invoice.setFphm(addInvoiceVO.getFphm());
invoice.setKprq(DateUtil.parse(addInvoiceVO.getKprq()));
invoice.setZzfpdm(addInvoiceVO.getZzfpdm());
invoice.setZzfphm(addInvoiceVO.getZzfphm());
//二维码=二维码下载地址
invoice.setQrCode(addInvoiceVO.getEwmUrl());
//发票 pdf 地址=PDF格式下载地址
invoice.setInvoicePdfUrl(addInvoiceVO.getPdfUrl());
//发票详情地址=OFD格式下载地址
invoice.setInvoiceJpgUrl(addInvoiceVO.getOfdUrl());
//ofdUrl=XML格式下载地址
invoice.setcOfdUrl(addInvoiceVO.getXmlUrl());
invoice.setState(2);
invoiceMapper.updateInvoice(invoice);
billInfoR.setState(2);
billInfoMapper.updateById(billInfoR);
} else {
invoice = BeanUtil.copyProperties(billInfoResult, Invoice.class);
invoice.setFphm(addInvoiceVO.getFphm());
invoice.setKprq(DateUtil.parse(addInvoiceVO.getKprq()));
invoice.setZzfpdm(addInvoiceVO.getZzfpdm());
invoice.setZzfphm(addInvoiceVO.getZzfphm());
//二维码=二维码下载地址
invoice.setQrCode(addInvoiceVO.getEwmUrl());
//发票 pdf 地址=PDF格式下载地址
invoice.setInvoicePdfUrl(addInvoiceVO.getPdfUrl());
//发票详情地址=OFD格式下载地址
invoice.setInvoiceJpgUrl(addInvoiceVO.getOfdUrl());
//ofdUrl=XML格式下载地址
invoice.setcOfdUrl(addInvoiceVO.getXmlUrl());
invoice.setState(2);
invoiceMapper.insertInvoice(invoice);
billInfoR.setState(2);
billInfoMapper.updateById(billInfoR);
// 根据
BillInfo billInfoResult = billInfoMapper.selectByOutTradeOrderno(companyservice.getCompanyid(), systemOrderNo);
if(BeanUtil.isNotEmpty(billInfoResult)){
if (BeanUtil.isNotEmpty(invoice)) {
invoice = BeanUtil.copyProperties(billInfoResult, Invoice.class);
invoice.setBillInfoId(billInfoResult.getId());
invoice.setFphm(addInvoiceVO.getFphm());
invoice.setKprq(DateUtil.parse(addInvoiceVO.getKprq()));
invoice.setZzfpdm(addInvoiceVO.getZzfpdm());
invoice.setZzfphm(addInvoiceVO.getZzfphm());
//二维码=二维码下载地址
invoice.setQrCode(addInvoiceVO.getEwmUrl());
//发票 pdf 地址=PDF格式下载地址
invoice.setInvoicePdfUrl(addInvoiceVO.getPdfUrl());
//发票详情地址=OFD格式下载地址
invoice.setInvoiceJpgUrl(addInvoiceVO.getOfdUrl());
//ofdUrl=XML格式下载地址
invoice.setcOfdUrl(addInvoiceVO.getXmlUrl());
invoice.setState(2);
invoiceMapper.updateInvoice(invoice);
billInfoR.setState(2);
billInfoMapper.updateById(billInfoR);
} else {
invoice = BeanUtil.copyProperties(billInfoResult, Invoice.class);
invoice.setBillInfoId(billInfoResult.getId());
invoice.setFphm(addInvoiceVO.getFphm());
invoice.setKprq(DateUtil.parse(addInvoiceVO.getKprq()));
invoice.setZzfpdm(addInvoiceVO.getZzfpdm());
invoice.setZzfphm(addInvoiceVO.getZzfphm());
//二维码=二维码下载地址
invoice.setQrCode(addInvoiceVO.getEwmUrl());
//发票 pdf 地址=PDF格式下载地址
invoice.setInvoicePdfUrl(addInvoiceVO.getPdfUrl());
//发票详情地址=OFD格式下载地址
invoice.setInvoiceJpgUrl(addInvoiceVO.getOfdUrl());
//ofdUrl=XML格式下载地址
invoice.setcOfdUrl(addInvoiceVO.getXmlUrl());
invoice.setState(2);
invoiceMapper.insertInvoice(invoice);
billInfoR.setState(2);
billInfoMapper.updateById(billInfoR);
}
}
// 返回数据
response.put("data", invoice);
@ -1433,6 +1242,7 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService {
return new HXResponse("查询错误!");
}
}
} else if (WebServiceConstant.FPEWMXZ.equals(finalServiceId)) {
// 获取发票下载地址
cn.hutool.json.JSONObject json = JSONUtil.parseObj(data);
@ -1517,6 +1327,8 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService {
}else if (WebServiceConstant.QDFPWJHQ.equals(finalServiceId)) {
// 审核红字信息表
// TODO: 全电发票文件获取
}else if(WebServiceConstant.QRCODE.equals(finalServiceId)){
response.put("data", JSONUtil.parse(data));
}
return response;
} else {

@ -391,6 +391,92 @@
and a.system_orderno = #{system_orderno}
</select>
<select id="selectByOutTradeOrderno" resultMap="BillInfoBillDetailResult">
select a.id,
a.company_id,
a.system_orderno,
a.out_trade_orderno,
a.fpqqlsh,
a.invoice_type,
a.buyer_name,
a.buyer_taxnum,
a.buyer_address,
a.buyer_telephone,
a.buyer_bank,
a.buyer_account,
a.buyer_email,
a.buyer_phone,
a.seller_name,
a.seller_taxnum,
a.seller_address,
a.seller_telephone,
a.seller_account,
a.message,
a.seller_bank,
a.clerk,
a.payee,
a.checker,
a.red_invoice_info_code,
a.fjh,
a.terminal_number,
a.remark,
a.kptype,
a.origin_system_orderno,
a.bmbbh,
a.origin_fpdm,
a.origin_fphm,
a.tsfs,
a.qdbz,
a.qdxmmc,
a.dkbz,
a.cpybz,
a.state,
a.source,
a.service_supplier_key,
a.bill_type,
a.business_remark,
a.taxfreeamt,
a.invoiced_time,
a.create_by,
a.tax,
a.callback_url,
a.create_time,
a.taxamt,
a.update_by,
a.update_time,
a.deleted_time,
b.id as sub_id,
b.bill_info_id as sub_bill_info_id,
b.index as sub_index,
b.good_name as sub_good_name,
b.num as sub_num,
b.price as sub_price,
b.hsbz as sub_hsbz,
b.taxrate as sub_taxrate,
b.spec as sub_spec,
b.unit as sub_unit,
b.spbm as sub_spbm,
b.bmbbh as sub_bmbbh,
b.zsbm as sub_zsbm,
b.fphxz as sub_fphxz,
b.yhzcbs as sub_yhzcbs,
b.zzstsgl as sub_zzstsgl,
b.lslbs as sub_lslbs,
b.kce as sub_kce,
b.taxfreeamt as sub_taxfreeamt,
b.tax as sub_tax,
b.taxamt as sub_taxamt,
b.tspz as sub_tspz,
b.create_by as sub_create_by,
b.create_time as sub_create_time,
b.update_by as sub_update_by,
b.updated_time as sub_updated_time
from bill_info a
left join bill_detail b on b.bill_info_id = a.id
where a.company_id = #{companyId}
and a.out_trade_orderno = #{out_trade_orderno}
</select>
<insert id="insertBillInfo" parameterType="BillInfo" useGeneratedKeys="true" keyProperty="id">
insert into bill_info

Loading…
Cancel
Save