|
|
|
@ -41,6 +41,7 @@ import com.jianshui.system.mapper.InvoiceAllApiLogMapper; |
|
|
|
|
import com.jianshui.system.mapper.InvoiceAllYhdjMapper; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
import org.springframework.context.annotation.Bean; |
|
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
|
import org.springframework.util.CollectionUtils; |
|
|
|
|
|
|
|
|
@ -150,7 +151,7 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService { |
|
|
|
|
if (resBillInfo > 0) { |
|
|
|
|
billInfoID = billInfo.getId(); |
|
|
|
|
if (BeanUtil.isEmpty(billInfo.getId())) { |
|
|
|
|
log.error("【金四服务类】【金财数科】【蓝字发票开具】API请求异常,billInfoId返回存储错误。"); |
|
|
|
|
log.error("【金四服务类】【数科】【蓝字发票开具】API请求异常,billInfoId返回存储错误。"); |
|
|
|
|
return new HXResponse("蓝字发票开具内部错误!"); |
|
|
|
|
} |
|
|
|
|
//数据库存储
|
|
|
|
@ -164,7 +165,7 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService { |
|
|
|
|
} |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
log.error("【金四服务类】【金财数科】【蓝字发票开具】API请求异常,billInfo存储错误。错误信息:{}", e.getMessage()); |
|
|
|
|
log.error("【金四服务类】【数科】【蓝字发票开具】API请求异常,billInfo存储错误。错误信息:{}", e.getMessage()); |
|
|
|
|
return new HXResponse("蓝字发票开具内部错误!"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -211,7 +212,7 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService { |
|
|
|
|
return new HXResponse(msg); |
|
|
|
|
} |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("【金四服务类】【金财数科】【蓝字发票开具】API请求异常,外部报文返回code非0000。错误信息:{}", e.getMessage()); |
|
|
|
|
log.error("【金四服务类】【数科】【蓝字发票开具】API请求异常,外部报文返回code非0000。错误信息:{}", e.getMessage()); |
|
|
|
|
return new HXResponse("蓝字发票开具异常"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -233,13 +234,13 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService { |
|
|
|
|
result = ApiHttp.request(WebServiceConstant.ADD_RED_INVOICE, WebServiceConstant.URL, addRedInvoiceDTO, companyservice); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
log.error("【金四服务类】【金财数科】【获取二维码】API请求异常,外部报文返回code非0000。错误信息:{}", e.getMessage()); |
|
|
|
|
log.error("【金四服务类】【数科】【获取二维码】API请求异常,外部报文返回code非0000。错误信息:{}", e.getMessage()); |
|
|
|
|
return new HXResponse(ErrorCode.INCOME_ERROR.toString()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 处理请求
|
|
|
|
|
if (!StringUtils.equals("0000", result.getStr("code"))) { |
|
|
|
|
log.error("【金四服务类】【金财数科】【获取二维码】API请求异常,外部报文返回code非0000。返回信息:{}", result); |
|
|
|
|
log.error("【金四服务类】【数科】【获取二维码】API请求异常,外部报文返回code非0000。返回信息:{}", result); |
|
|
|
|
return new HXResponse(result.getStr("message")); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -488,7 +489,7 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService { |
|
|
|
|
} |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
log.error("【金四服务类】【金财数科】【申请红字信息表】API请求异常,外部报文返回code非0000。错误信息:{}", e.getMessage()); |
|
|
|
|
log.error("【金四服务类】【数科】【申请红字信息表】API请求异常,外部报文返回code非0000。错误信息:{}", e.getMessage()); |
|
|
|
|
return new HXResponse("通用查询接口异常"); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
@ -596,7 +597,7 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService { |
|
|
|
|
} |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
log.error("【金四服务类】【金财数科】【查询红字信息表】API请求异常,外部报文返回code非0000。错误信息:{}", e.getMessage()); |
|
|
|
|
log.error("【金四服务类】【数科】【查询红字信息表】API请求异常,外部报文返回code非0000。错误信息:{}", e.getMessage()); |
|
|
|
|
return new HXResponse("查询红字信息表接口异常"); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
@ -787,7 +788,7 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService { |
|
|
|
|
} |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
log.error("【金四服务类】【金财数科】【获取发票下载地址】API请求异常,外部报文返回code非0000。错误信息:{}", e.getMessage()); |
|
|
|
|
log.error("【金四服务类】【数科】【获取发票下载地址】API请求异常,外部报文返回code非0000。错误信息:{}", e.getMessage()); |
|
|
|
|
return new HXResponse("获取发票下载地址错误!"); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
@ -846,7 +847,7 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService { |
|
|
|
|
} |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
log.error("【金四服务类】【金财数科】【全电安排文件获取】API请求异常,外部报文返回code非0000。错误信息:{}", e.getMessage()); |
|
|
|
|
log.error("【金四服务类】【数科】【全电安排文件获取】API请求异常,外部报文返回code非0000。错误信息:{}", e.getMessage()); |
|
|
|
|
return new HXResponse("全电发票文件获取错误!"); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
@ -889,13 +890,13 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService { |
|
|
|
|
} |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
log.error("【金四服务类】【金财数科】【获取二维码】API请求异常,外部报文返回code非0000。错误信息:{}", e.getMessage()); |
|
|
|
|
log.error("【金四服务类】【数科】【获取二维码】API请求异常,外部报文返回code非0000。错误信息:{}", e.getMessage()); |
|
|
|
|
return new HXResponse("获取二维码错误!"); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// TODO 处理日志
|
|
|
|
|
// log.info("【金四服务类】【金财数科】【获取二维码】API请求成功,外部报文返回code。返回信息:{}", result);
|
|
|
|
|
// log.info("【金四服务类】【数科】【获取二维码】API请求成功,外部报文返回code。返回信息:{}", result);
|
|
|
|
|
|
|
|
|
|
// return AjaxResult.success(result);
|
|
|
|
|
} |
|
|
|
@ -950,7 +951,7 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService { |
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
log.error("【金四服务类】【金财数科】【单张发票查询】API请求异常,外部报文返回code非0000。错误信息:{}", e.getMessage()); |
|
|
|
|
log.error("【金四服务类】【数科】【单张发票查询】API请求异常,外部报文返回code非0000。错误信息:{}", e.getMessage()); |
|
|
|
|
return new HXResponse("发票查询错误"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -1008,7 +1009,7 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService { |
|
|
|
|
} |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
log.error("【金四服务类】【金财数科】【获取发票打印XML】API请求异常,外部报文返回code非0000。错误信息:{}", e.getMessage()); |
|
|
|
|
log.error("【金四服务类】【数科】【获取发票打印XML】API请求异常,外部报文返回code非0000。错误信息:{}", e.getMessage()); |
|
|
|
|
return new HXResponse("获取发票打印XML错误!"); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
@ -1093,7 +1094,7 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService { |
|
|
|
|
} |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
log.error("【金四服务类】【金财数科】【快速红冲】API请求异常,外部报文返回code非0000。错误信息:{}", e.getMessage()); |
|
|
|
|
log.error("【金四服务类】【数科】【快速红冲】API请求异常,外部报文返回code非0000。错误信息:{}", e.getMessage()); |
|
|
|
|
return new HXResponse("快速红冲错误!"); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
@ -1152,7 +1153,7 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService { |
|
|
|
|
} |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
log.error("【金四服务类】【金财数科】【蓝字统计】API请求异常,外部报文返回code非0000。错误信息:{}", e.getMessage()); |
|
|
|
|
log.error("【金四服务类】【数科】【蓝字统计】API请求异常,外部报文返回code非0000。错误信息:{}", e.getMessage()); |
|
|
|
|
return new HXResponse("发票统计错误!"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -1211,7 +1212,7 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService { |
|
|
|
|
} |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
log.error("【金四服务类】【金财数科】【审核红字信息表】API请求异常,外部报文返回code非0000。错误信息:{}", e.getMessage()); |
|
|
|
|
log.error("【金四服务类】【数科】【审核红字信息表】API请求异常,外部报文返回code非0000。错误信息:{}", e.getMessage()); |
|
|
|
|
return new HXResponse("审核红字信息表错误!"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -1262,7 +1263,7 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService { |
|
|
|
|
} |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
log.error("【金四服务类】【金财数科】【查询红字申请表明细】API请求异常,外部报文返回code非0000。错误信息:{}", e.getMessage()); |
|
|
|
|
log.error("【金四服务类】【数科】【查询红字申请表明细】API请求异常,外部报文返回code非0000。错误信息:{}", e.getMessage()); |
|
|
|
|
return new HXResponse("查询红字申请表明细错误!"); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
@ -1388,7 +1389,7 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService { |
|
|
|
|
// 返回数据
|
|
|
|
|
response.put("data", invoice); |
|
|
|
|
} else { |
|
|
|
|
log.error("【金四服务类】【金财数科】【通用查询接口】API请求异常,billInfo未查询到,requestId={}。", requestId); |
|
|
|
|
log.error("【金四服务类】【数科】【通用查询接口】API请求异常,billInfo未查询到,requestId={}。", requestId); |
|
|
|
|
return new HXResponse("查询错误!"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -1577,7 +1578,7 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService { |
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
log.error("【金四服务类】【金财数科】【通用查询接口】API请求异常,外部报文返回code非0000。错误信息:{}", e.getMessage()); |
|
|
|
|
log.error("【金四服务类】【数科】【通用查询接口】API请求异常,外部报文返回code非0000。错误信息:{}", e.getMessage()); |
|
|
|
|
return new HXResponse("通用查询接口异常"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -1597,6 +1598,54 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService { |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** 获取人脸识别结果 */ |
|
|
|
|
@Override |
|
|
|
|
public HXResponse qrcodeResult(JSONObject decryptResult, Companyservice companyservice) { |
|
|
|
|
|
|
|
|
|
cn.hutool.json.JSONObject result = null; |
|
|
|
|
try { |
|
|
|
|
|
|
|
|
|
InvoiceAllQycodeResultDTO qycodeResultDTO = BeanUtil.copyProperties(decryptResult,InvoiceAllQycodeResultDTO.class); |
|
|
|
|
if(BeanUtil.isEmpty(qycodeResultDTO)){ |
|
|
|
|
return new HXResponse("参数为空!"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 查询用户登记参数
|
|
|
|
|
InvoiceAllYhdj yhdj = getUserInfo(companyservice); |
|
|
|
|
if (BeanUtil.isEmpty(yhdj)) { |
|
|
|
|
return new HXResponse("未查询到登记信息!"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 组装报文
|
|
|
|
|
QycodeResultTWODTO qycodeResultTWODTO = new QycodeResultTWODTO(); |
|
|
|
|
qycodeResultTWODTO.setAsync("true"); |
|
|
|
|
qycodeResultTWODTO.setBsrysfzjhm(yhdj.getBsrysfzjhm()); |
|
|
|
|
qycodeResultTWODTO.setDqbm(yhdj.getDqbm()); |
|
|
|
|
qycodeResultTWODTO.setNsrsbh(yhdj.getNsrsbh()); |
|
|
|
|
QycodeResultJsonDataTWODTO qycodeResultJsonDataTWODTO = BeanUtil.copyProperties(qycodeResultDTO,QycodeResultJsonDataTWODTO.class); |
|
|
|
|
qycodeResultTWODTO.setJsonData(qycodeResultJsonDataTWODTO); |
|
|
|
|
|
|
|
|
|
result = ApiHttp.request(WebServiceConstant.HQRLSBJG, WebServiceConstant.URL, qycodeResultDTO, 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)) { |
|
|
|
|
InvoiceAllQycodeResultVO qycodeResultVO = BeanUtil.copyProperties(data,InvoiceAllQycodeResultVO.class); |
|
|
|
|
HXResponse response = new HXResponse("0000", "请求成功", qycodeResultVO); |
|
|
|
|
return response; |
|
|
|
|
} else { |
|
|
|
|
return new HXResponse(msg); |
|
|
|
|
} |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
log.error("【金四服务类】【数科】【获取人脸识别结果】API请求异常,外部报文返回code非0000。错误信息:{}", e.getMessage()); |
|
|
|
|
return new HXResponse("获取二维码错误!"); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 简税和金财数科 发票类型互换 |
|
|
|
|
* |
|
|
|
|