增加推送开票信息回写

This commit is contained in:
2026-06-10 15:04:42 +08:00
parent 3a9682a36a
commit 31aac96d6a
2 changed files with 11 additions and 4 deletions

View File

@@ -56,9 +56,9 @@ public class PowerFeePushJob extends AbstractQuartzTask {
PowerFeeInvoiceInfo invoiceInfo = null;
if(columns != null && columns.size() > 0) {
for (FormColumn column : columns) {
String formId = column.getId();
try {
invoiceInfo = new PowerFeeInvoiceInfo();
String formId = column.getId();
if(column.getVos() == null) {
continue;
}
@@ -96,16 +96,23 @@ public class PowerFeePushJob extends AbstractQuartzTask {
throw new RuntimeException("某些必传参数为空,请检查金额、单价、手机号、订单请求流水号、纳税识别号等信息");
}
fillService.pushInvoiceInfo(param,secretKey,secretId,url);
String respText = fillService.pushInvoiceInfo(param, secretKey, secretId, url);
List<FormUpdateField> updateFiels = new ArrayList<>();
updateFiels.add(FormUpdateField.build().display("是否推送开票系统").value(""));
updateFiels.add(FormUpdateField.build().display("订单请求流水号").value(ddqqlsh));
updateFiels.add(FormUpdateField.build().display("开票接口返回").value(respText));
List<FormWhereCondition> whereClause = new ArrayList<>();
whereClause.add(FormWhereCondition.build().display("ID").value(Long.parseLong(formId)).clauseFactor(ClauseFactor.EQ));
powerFeeService.updateForm(updateFiels,whereClause,formNo);
}catch (Exception e) {
log.error("推送失败,请求批次号为:" + invoiceInfo.getReqNo() + " ,失败原因为: "+ e.getMessage());
log.error(e);
List<FormUpdateField> updateFiels = new ArrayList<>();
updateFiels.add(FormUpdateField.build().display("是否推送开票系统").value(""));
updateFiels.add(FormUpdateField.build().display("开票接口返回").value("推送出现异常: " + e.getMessage()));
List<FormWhereCondition> whereClause = new ArrayList<>();
whereClause.add(FormWhereCondition.build().display("ID").value(Long.parseLong(formId)).clauseFactor(ClauseFactor.EQ));
powerFeeService.updateForm(updateFiels,whereClause,formNo);
}
}
}

View File

@@ -210,7 +210,7 @@ public class HxInvoiceInfoFillService {
return jsonObject.toString();
}
public void pushInvoiceInfo(String params,String secretKey,String secretId,String url) throws Exception {
public String pushInvoiceInfo(String params,String secretKey,String secretId,String url) throws Exception {
// String secretKey = "IGedAOlfMsPotl7WXePNPSNdPtjnvn85Tvt9";
// secretId
// String secretId = "NfD7rBPYAk1Zod37wqlB4wWdgSFtRgMj";
@@ -304,8 +304,8 @@ public class HxInvoiceInfoFillService {
log.info("开票信息推送成功: " + hxinvoiceResponse.getData());
System.out.println("推送成功显示" + hxinvoiceResponse.getMsg());
} else {
System.out.println(hxinvoiceResponse.getMsg());
log.info("电费发票信息推送失败: " + hxinvoiceResponse.getMsg());
}
return hxinvoiceResponse.getMsg();
}
}