|
|
|
@ -1,4 +1,5 @@ |
|
|
|
|
package com.jianshui.invoice.service.impl.api; |
|
|
|
|
|
|
|
|
|
import java.util.Date; |
|
|
|
|
|
|
|
|
|
import cn.hutool.core.bean.copier.CopyOptions; |
|
|
|
@ -339,6 +340,7 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService { |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 数科报文=》简税报文转换 |
|
|
|
|
* |
|
|
|
|
* @param redInvoiceQueryAllTWOVO |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
@ -350,7 +352,8 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService { |
|
|
|
|
// 每页条数
|
|
|
|
|
int pageSize = redInvoiceQueryAllTWOVO.getPageSize(); |
|
|
|
|
// 总条数
|
|
|
|
|
int total = redInvoiceQueryAllTWOVO.getTotal();; |
|
|
|
|
int total = redInvoiceQueryAllTWOVO.getTotal(); |
|
|
|
|
; |
|
|
|
|
//发票集合
|
|
|
|
|
List<RedInvoiceQueryTWOVO> redInvoiceQueryTWOVOS = redInvoiceQueryAllTWOVO.getFpList(); |
|
|
|
|
|
|
|
|
@ -469,6 +472,9 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService { |
|
|
|
|
allApiLog.setCreateTime(new Date()); |
|
|
|
|
allApiLogMapper.insertInvoiceAllApiLog(allApiLog); |
|
|
|
|
|
|
|
|
|
// 更新响应ID
|
|
|
|
|
redinfo.setOutTradeOrderno(requestId); |
|
|
|
|
redinfoMapper.updateRedinfo(redinfo); |
|
|
|
|
|
|
|
|
|
HXResponse response = new HXResponse("0000", "申请成功"); |
|
|
|
|
response.put("queryid", requestId); |
|
|
|
@ -714,9 +720,9 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** 金财数科新增接口 **/ |
|
|
|
|
/** |
|
|
|
|
* 金财数科新增接口 |
|
|
|
|
**/ |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public Object addCallback(HttpServletRequest request) { |
|
|
|
@ -729,8 +735,6 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public HXResponse getFileUrl(InvoiceAllFileAcquisitionTWODTO invoiceAllFileAcquisitionTWODTO, Companyservice companyservice) { |
|
|
|
|
|
|
|
|
@ -821,7 +825,9 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService { |
|
|
|
|
return response; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** 获取人脸识别二维码*/ |
|
|
|
|
/** |
|
|
|
|
* 获取人脸识别二维码 |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public HXResponse qrcode(JSONObject decryptResult, Companyservice companyservice) { |
|
|
|
|
cn.hutool.json.JSONObject result = null; |
|
|
|
@ -1039,6 +1045,7 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService { |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 查询红字信息表明细 |
|
|
|
|
* |
|
|
|
|
* @param invoiceAllRedInvoiceDetailDTO |
|
|
|
|
* @param companyservice |
|
|
|
|
* @return |
|
|
|
@ -1092,6 +1099,7 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService { |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 通用查询接口 |
|
|
|
|
* |
|
|
|
|
* @param invoiceAllYhdjDTO |
|
|
|
|
* @param companyservice |
|
|
|
|
* @return |
|
|
|
@ -1126,7 +1134,30 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService { |
|
|
|
|
|
|
|
|
|
cn.hutool.json.JSONObject result = null; |
|
|
|
|
try { |
|
|
|
|
result = ApiHttp.request(WebServiceConstant.TYCXJK, WebServiceConstant.URL, queryDTO, companyservice); |
|
|
|
|
// result = ApiHttp.request(WebServiceConstant.TYCXJK, WebServiceConstant.URL, queryDTO, companyservice);
|
|
|
|
|
|
|
|
|
|
result = new cn.hutool.json.JSONObject(); |
|
|
|
|
result.set("code", "0000"); |
|
|
|
|
result.set("msg", "123"); |
|
|
|
|
result.set("data", "{\n" + |
|
|
|
|
" \"hzfpxxqrdbh\": \"37021423051000203148\",\n" + |
|
|
|
|
" \"hzfpxxqrdid\": \"953bf4ef7ac74c24ae9a056262939f96\",\n" + |
|
|
|
|
" \"hzfpxxqrdZtdm\": \"01\",\n" + |
|
|
|
|
" \"lrrq\": \"2023-05-09 09:47:53\",\n" + |
|
|
|
|
" \"hzfpxx\": {\n" + |
|
|
|
|
" \"fpqqlsh\": \"c817769da5c27e3fbda4fe5ce72857f7\",\n" + |
|
|
|
|
" \"gmfnsrsbh\": \"91370102MA3UD2FG21\",\n" + |
|
|
|
|
" \"gmfmc\": \"山东慧永信息科技有限公司\",\n" + |
|
|
|
|
" \"xsfmc\": \"城阳区兴顺通制冷设备维修服务部\",\n" + |
|
|
|
|
" \"xsfnsrsbh\": \"92370214MACAAEK16E\",\n" + |
|
|
|
|
" \"kprq\": \"2023-05-09 09:47:54\",\n" + |
|
|
|
|
" \"fphm\": \"23922000000005190521\",\n" + |
|
|
|
|
" \"ewmUrl\": \"https://dppt.qingdao.chinatax.gov.cn:8443/v/2_23922000000005190521_202305090947549016EF6F4\",\n" + |
|
|
|
|
" \"pdfUrl\": \"https://rocgw.jcsk100.com/external/d/v/qingdao_23922000000005190521_202305090947549016EF6F4_cde295cba75225c66fe9902c88fc4d03_pdf\",\n" + |
|
|
|
|
" \"ofdUrl\": \"https://rocgw.jcsk100.com/external/d/v/qingdao_23922000000005190521_202305090947549016EF6F4_cde295cba75225c66fe9902c88fc4d03_ofd\",\n" + |
|
|
|
|
" \"xmlUrl\": \"https://rocgw.jcsk100.com/external/d/v/qingdao_23922000000005190521_202305090947549016EF6F4_cde295cba75225c66fe9902c88fc4d03_xml\"\n" + |
|
|
|
|
" }\n" + |
|
|
|
|
"}"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String code = result.get("code") != null ? result.get("code").toString() : ""; |
|
|
|
@ -1183,6 +1214,7 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService { |
|
|
|
|
invoice.setcOfdUrl(addInvoiceVO.getXmlUrl()); |
|
|
|
|
invoice.setState(2); |
|
|
|
|
invoiceMapper.updateInvoice(invoice); |
|
|
|
|
billInfoR.setOriginFphm(addInvoiceVO.getFphm()); |
|
|
|
|
billInfoR.setState(2); |
|
|
|
|
billInfoMapper.updateById(billInfoR); |
|
|
|
|
} else { |
|
|
|
@ -1203,6 +1235,7 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService { |
|
|
|
|
invoice.setState(2); |
|
|
|
|
invoiceMapper.insertInvoice(invoice); |
|
|
|
|
billInfoR.setState(2); |
|
|
|
|
billInfoR.setOriginFphm(addInvoiceVO.getFphm()); |
|
|
|
|
billInfoMapper.updateById(billInfoR); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -1214,7 +1247,8 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} else if (WebServiceConstant.FPEWMXZ.equals(finalServiceId)) { |
|
|
|
|
} |
|
|
|
|
else if (WebServiceConstant.FPEWMXZ.equals(finalServiceId)) { |
|
|
|
|
// 获取发票下载地址
|
|
|
|
|
cn.hutool.json.JSONObject json = JSONUtil.parseObj(data); |
|
|
|
|
String ewmUrl = json.getOrDefault("ewmUrl", "").toString(); |
|
|
|
@ -1232,27 +1266,26 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// TODO: 2023/3/29 返回数据处理
|
|
|
|
|
} else if (WebServiceConstant.ADD_RED_INVOICE.equals(finalServiceId)) { |
|
|
|
|
} |
|
|
|
|
else if (WebServiceConstant.ADD_RED_INVOICE.equals(finalServiceId)) { |
|
|
|
|
// 查找原发票信息
|
|
|
|
|
AddRedInvoiceTWOVO addRedInvoiceVO = BeanUtil.copyProperties(data, AddRedInvoiceTWOVO.class); |
|
|
|
|
QueryWrapper<BillInfo> billInfoQueryWrapper = new QueryWrapper<>(); |
|
|
|
|
billInfoQueryWrapper.eq("fpqqlsh", requestId); |
|
|
|
|
billInfoQueryWrapper.eq("out_trade_orderno", 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("未查询到原发票信息");
|
|
|
|
|
if (billInfoR != null && StrUtil.isNotEmpty(billInfoR.getOriginFphm())) { |
|
|
|
|
|
|
|
|
|
// 查找原发票信息
|
|
|
|
|
Invoice originInvoice = invoiceMapper.selectInvoiceByBillInfoId(originBillInfo.getId()); |
|
|
|
|
Invoice invoice = BeanUtil.copyProperties(originInvoice, Invoice.class); |
|
|
|
|
String originFphm = billInfoR.getOriginFphm(); |
|
|
|
|
QueryWrapper<Invoice> invoiceQueryWrapper = new QueryWrapper<>(); |
|
|
|
|
invoiceQueryWrapper.eq("fphm", originFphm); |
|
|
|
|
Invoice invoice = invoiceMapper.selectOne(invoiceQueryWrapper); |
|
|
|
|
|
|
|
|
|
invoice.setId(null); |
|
|
|
|
invoice.setFphm(addRedInvoiceVO.getFphm()); |
|
|
|
|
invoice.setBillInfoId(billInfoR.getId()); |
|
|
|
|
invoice.setSystemOrderno(billInfoR.getSystemOrderno()); |
|
|
|
|
invoice.setOutTradeOrderno(billInfoR.getOutTradeOrderno()); |
|
|
|
|
invoice.setOutTradeOrderno(requestId); |
|
|
|
|
invoice.setFpqqlsh(billInfoR.getFpqqlsh()); |
|
|
|
|
invoice.setKprq(DateUtil.parse(addRedInvoiceVO.getKprq())); |
|
|
|
|
invoice.setZzfpdm(addRedInvoiceVO.getZzfpdm()); |
|
|
|
@ -1273,17 +1306,12 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService { |
|
|
|
|
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)) { |
|
|
|
|
// 查询红字信息表
|
|
|
|
|
|
|
|
|
@ -1300,9 +1328,60 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService { |
|
|
|
|
// TODO: 全电发票文件获取
|
|
|
|
|
} else if (WebServiceConstant.QRCODE.equals(finalServiceId)) { |
|
|
|
|
response.put("data", JSONUtil.parse(data)); |
|
|
|
|
} else if (WebServiceConstant.SQHZFPXXQRD.equals(finalServiceId)) { |
|
|
|
|
// 申请红字信息表
|
|
|
|
|
AddRedInfoInvoiceTWOVO addRedInfoInvoiceTWOVO = BeanUtil.copyProperties(JSONUtil.parse(data), AddRedInfoInvoiceTWOVO.class); |
|
|
|
|
|
|
|
|
|
QueryWrapper<Redinfo> billInfoQueryWrapper = new QueryWrapper<>(); |
|
|
|
|
billInfoQueryWrapper.eq("out_trade_orderno", requestId); |
|
|
|
|
Redinfo billInfoR = redinfoMapper.selectOne(billInfoQueryWrapper); |
|
|
|
|
if (billInfoR != null && StrUtil.isNotEmpty(billInfoR.getOriginFphm())) { |
|
|
|
|
|
|
|
|
|
// 查找原发票信息
|
|
|
|
|
String originFphm = billInfoR.getOriginFphm(); |
|
|
|
|
QueryWrapper<Invoice> invoiceQueryWrapper = new QueryWrapper<>(); |
|
|
|
|
invoiceQueryWrapper.eq("fphm", originFphm); |
|
|
|
|
Invoice invoice = invoiceMapper.selectOne(invoiceQueryWrapper); |
|
|
|
|
|
|
|
|
|
AddRedInfoInvoiceJsonDataTWOVO addRedInfoInvoiceJsonDataTWOVO = addRedInfoInvoiceTWOVO.getHzfpxx(); |
|
|
|
|
if(BeanUtil.isNotEmpty(addRedInfoInvoiceJsonDataTWOVO)){ |
|
|
|
|
|
|
|
|
|
//更新蓝字发票状态为冲红 99
|
|
|
|
|
invoice.setState(99); |
|
|
|
|
invoiceMapper.updateInvoice(invoice); |
|
|
|
|
|
|
|
|
|
invoice.setId(null); |
|
|
|
|
invoice.setOriginFphm(invoice.getFphm()); |
|
|
|
|
invoice.setFphm(addRedInfoInvoiceJsonDataTWOVO.getFphm()); |
|
|
|
|
invoice.setBillInfoId(billInfoR.getId()); |
|
|
|
|
invoice.setSystemOrderno(billInfoR.getSystemOrderno()); |
|
|
|
|
invoice.setOutTradeOrderno(requestId); |
|
|
|
|
invoice.setFpqqlsh(billInfoR.getFpqqlsh()); |
|
|
|
|
invoice.setKprq(DateUtil.parse(addRedInfoInvoiceJsonDataTWOVO.getKprq())); |
|
|
|
|
invoice.setZzfpdm(addRedInfoInvoiceJsonDataTWOVO.getZzfpdm()); |
|
|
|
|
invoice.setZzfphm(addRedInfoInvoiceJsonDataTWOVO.getZzfphm()); |
|
|
|
|
//二维码=二维码下载地址
|
|
|
|
|
invoice.setQrCode(addRedInfoInvoiceJsonDataTWOVO.getEwmUrl()); |
|
|
|
|
//发票 pdf 地址=PDF格式下载地址
|
|
|
|
|
invoice.setInvoicePdfUrl(addRedInfoInvoiceJsonDataTWOVO.getPdfUrl()); |
|
|
|
|
//发票详情地址=OFD格式下载地址
|
|
|
|
|
invoice.setInvoiceJpgUrl(addRedInfoInvoiceJsonDataTWOVO.getOfdUrl()); |
|
|
|
|
//ofdUrl=XML格式下载地址
|
|
|
|
|
invoice.setcOfdUrl(addRedInfoInvoiceJsonDataTWOVO.getXmlUrl()); |
|
|
|
|
invoice.setState(2); |
|
|
|
|
invoiceMapper.insertInvoice(invoice); |
|
|
|
|
} |
|
|
|
|
billInfoR.setRedInfoNo(addRedInfoInvoiceTWOVO.getHzfpxxqrdbh()); |
|
|
|
|
billInfoR.setRedInfoStatus(addRedInfoInvoiceTWOVO.getHzfpxxqrdZtdm()); |
|
|
|
|
billInfoR.setBillInputTime(addRedInfoInvoiceTWOVO.getLrrq()); |
|
|
|
|
redinfoMapper.updateById(billInfoR); |
|
|
|
|
|
|
|
|
|
response.put("data", addRedInfoInvoiceTWOVO); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return response; |
|
|
|
|
} else { |
|
|
|
|
// TODO: 2023/5/9 这里更新到日志表记录
|
|
|
|
|
|
|
|
|
|
return new HXResponse(msg); |
|
|
|
|
} |
|
|
|
@ -1373,7 +1452,4 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|