接口日志保存

This commit is contained in:
yuxueliang0813 2024-09-25 10:03:25 +08:00
parent 235cf0b13b
commit eac91bdfc2
2 changed files with 16 additions and 2 deletions

View File

@ -319,6 +319,7 @@ public class YongyouBIPOperation extends AbstractOperationServicePlugIn implemen
log.error(String.format("用友付款接口处理失败,具体原因:%s", json_reuslt.toString())); log.error(String.format("用友付款接口处理失败,具体原因:%s", json_reuslt.toString()));
//此时除了日志打印增加日志记录 //此时除了日志打印增加日志记录
DobeDWUtils.saveLog(payrequestinfo.getString("billno"),"用友BIP",payData.toString(),json_reuslt.toString(),false); DobeDWUtils.saveLog(payrequestinfo.getString("billno"),"用友BIP",payData.toString(),json_reuslt.toString(),false);
return;
}else{ }else{
yynum = json_reuslt.getJSONObject("data").getString("billno"); yynum = json_reuslt.getJSONObject("data").getString("billno");
} }
@ -334,8 +335,8 @@ public class YongyouBIPOperation extends AbstractOperationServicePlugIn implemen
//推送用友bip成功后反写合同付款申请单的用友付款单id字段值 //推送用友bip成功后反写合同付款申请单的用友付款单id字段值
String sql = "UPDATE t_xxx SET fk_qeug_yynum=? WHERE fid=?;"; String sql = "UPDATE t_xxx SET fk_qeug_yynum=? WHERE fid=?;";
DB.update(DBRoute.of("scm"), sql, new Object[]{yynum, payrequestinfo.getLong("id")}); DB.update(DBRoute.of("scm"), sql, new Object[]{yynum, payrequestinfo.getLong("id")});
DobeDWUtils.saveLog(payrequestinfo.getString("billno"),"用友BIP",payData.toString(),json_reuslt.toString(),true);
} }
DobeDWUtils.saveLog(payrequestinfo.getString("billno"),"用友BIP",payData.toString(),json_reuslt.toString(),true);
} }
private void handleWithOutContract(String eventName, DynamicObject payrequestinfo){ private void handleWithOutContract(String eventName, DynamicObject payrequestinfo){

View File

@ -2,6 +2,9 @@ package shkd.utils;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.servicehelper.BusinessDataServiceHelper;
import kd.bos.servicehelper.operation.SaveServiceHelper;
import okhttp3.MediaType; import okhttp3.MediaType;
import okhttp3.RequestBody; import okhttp3.RequestBody;
import okio.ByteString; import okio.ByteString;
@ -36,13 +39,23 @@ public class DobeDWUtils {
//付款金额查询接口 //付款金额查询接口
public static final String payQueryUrl = "http://106.14.25.83:8090/nccloud/api/arap/paybill/insertandcommit"; public static final String payQueryUrl = "http://106.14.25.83:8090/nccloud/api/arap/paybill/insertandcommit";
private static final String jklogEntityName = "qeug_recon_jklog";
public static boolean isEmpty(String value) { public static boolean isEmpty(String value) {
return value == null || value.trim().length() <= 0; return value == null || value.trim().length() <= 0;
} }
public static void saveLog(String billno,String jkname,String inputs,String outputs,boolean isSuccess){ public static void saveLog(String billno,String jkname,String inputs,String outputs,boolean isSuccess){
//保存星瀚与第三方接口调用之间的日志记录 //保存星瀚与第三方接口调用之间的日志记录
//参数说明单据编号接口名称接口入参接口返回值接口调用是否成功 //参数说明单据编号接口名称接口入参接口返回值接口执行结果是否成功
DynamicObject billinfo = BusinessDataServiceHelper.newDynamicObject(jklogEntityName);
billinfo.set("number",billno);
billinfo.set("name",jkname);
billinfo.set("qeug_inputs_tag",inputs);//大文本赋值标识后加_tag 是内容不加是文本标题
billinfo.set("qeug_outputs_tag",outputs);
billinfo.set("qeug_issuccess",isSuccess);
billinfo.set("status","A"); //单据状态默认暂存
SaveServiceHelper.save(new DynamicObject[]{billinfo});
} }
public static String getDateString(Date billDate){ public static String getDateString(Date billDate){