From c4a15a6a0513fae651c0465ba15f29c5cc97b14b Mon Sep 17 00:00:00 2001 From: yuxueliang0813 <407010292@qq.com> Date: Wed, 23 Oct 2024 16:05:33 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E5=8F=8B=E4=BB=98=E6=AC=BE=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E6=8E=A5=E5=8F=A3=E8=81=94=E8=B0=83=E4=BC=98=E5=8C=96?= =?UTF-8?q?=EF=BC=8C=E5=A2=9E=E5=8A=A0=E4=BB=98=E6=AC=BE=E5=8D=95id?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E5=92=8C=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../recon/opplugin/YongyouBIPOperation.java | 17 ++++++++++------- .../java/shkd/repc/task/YongyouBIPTask.java | 18 ++++++++++-------- .../src/main/java/shkd/utils/DobeDWUtils.java | 2 +- 3 files changed, 21 insertions(+), 16 deletions(-) diff --git a/fi/fi/shkd-fi-fi-plugin/src/main/java/shkd/repc/recon/opplugin/YongyouBIPOperation.java b/fi/fi/shkd-fi-fi-plugin/src/main/java/shkd/repc/recon/opplugin/YongyouBIPOperation.java index 99109ee..6960e1c 100644 --- a/fi/fi/shkd-fi-fi-plugin/src/main/java/shkd/repc/recon/opplugin/YongyouBIPOperation.java +++ b/fi/fi/shkd-fi-fi-plugin/src/main/java/shkd/repc/recon/opplugin/YongyouBIPOperation.java @@ -393,6 +393,7 @@ public class YongyouBIPOperation extends AbstractOperationServicePlugIn implemen .header("client_id", DobeDWUtils.clientid) .build(); String yynum = null;//用友单据编号 + String yyid = null;//用友单据id JSONObject json_reuslt = null; try { Response response = client.newCall(request).execute(); @@ -404,6 +405,7 @@ public class YongyouBIPOperation extends AbstractOperationServicePlugIn implemen return false; }else{ yynum = json_reuslt.getJSONObject("data").getString("billno"); + yyid = json_reuslt.getJSONObject("data").getString("pk_bill"); } } catch (Exception e) { log.error(String.format("用友付款接口异常:%s", e.getMessage())); @@ -416,19 +418,20 @@ public class YongyouBIPOperation extends AbstractOperationServicePlugIn implemen DobeDWUtils.saveLog(payrequestinfo.getString("billno"),"用友BIP",payData.toString(),"用友billno为空"+json_reuslt.toString(),false,eventName); return false; }else{ - //审核推送用友bip成功后,反写费用登记和合同付款申请单的用友付款单id字段值,并清空红冲单据编号字段 - String sql = "UPDATE t_recon_payreqbill SET fk_qeug_yynum=?,fk_qeug_yyhc=? WHERE fid=?;"; + //审核推送用友bip成功后,反写费用登记和合同付款申请单的用友付款单编号和id字段值,并清空红冲单据编号字段 + String sql = "UPDATE t_recon_payreqbill SET fk_qeug_yynum=?,fk_qeug_yyhc=?,fk_qeug_yyid=? WHERE fid=?;"; if(isnotext){ - sql = "UPDATE t_recon_connotextbill SET fk_qeug_yynum=?,fk_qeug_yyhc=? WHERE fid=?;"; + sql = "UPDATE t_recon_connotextbill SET fk_qeug_yynum=?,fk_qeug_yyhc=?,fk_qeug_yyid=? WHERE fid=?;"; } if("unaudit".equals(eventName)){ - //如果是反审核推送bip成功后,反写红冲单据编号字段,并清空bip单据编号 - sql = "UPDATE t_recon_payreqbill SET fk_qeug_yyhc=?,fk_qeug_yynum=? WHERE fid=?;"; + //如果是反审核推送bip成功后,反写红冲单据编号字段,并清空bip单据编号和id + sql = "UPDATE t_recon_payreqbill SET fk_qeug_yyhc=?,fk_qeug_yynum=?,fk_qeug_yyid=? WHERE fid=?;"; if(isnotext){ - sql = "UPDATE t_recon_connotextbill SET fk_qeug_yyhc=?,fk_qeug_yynum=? WHERE fid=?;"; + sql = "UPDATE t_recon_connotextbill SET fk_qeug_yyhc=?,fk_qeug_yynum=?,fk_qeug_yyid=? WHERE fid=?;"; } + yyid = ""; } - DB.update(DBRoute.of("scm"), sql, new Object[]{yynum,"",payrequestinfo.getLong("id")}); + DB.update(DBRoute.of("scm"), sql, new Object[]{yynum,"",yyid,payrequestinfo.getLong("id")}); DobeDWUtils.saveLog(payrequestinfo.getString("billno"),"用友BIP",payData.toString(),json_reuslt.toString(),true,eventName); return true; } diff --git a/fi/fi/shkd-fi-fi-plugin/src/main/java/shkd/repc/task/YongyouBIPTask.java b/fi/fi/shkd-fi-fi-plugin/src/main/java/shkd/repc/task/YongyouBIPTask.java index f76ff47..11baac6 100644 --- a/fi/fi/shkd-fi-fi-plugin/src/main/java/shkd/repc/task/YongyouBIPTask.java +++ b/fi/fi/shkd-fi-fi-plugin/src/main/java/shkd/repc/task/YongyouBIPTask.java @@ -59,10 +59,11 @@ public class YongyouBIPTask extends AbstractTask implements Plugin { //将满足本次查询条件的单子存入map中 DynamicObject prinfo = null; DynamicObject requestinfo = null; - String yynum = null; + String yyid = null; JSONObject idjson = null; JSONArray idarray = new JSONArray(); Map billMap = new HashMap(); + Map billNumberMap = new HashMap(); for (int i = 0; i < prs.length; i++) { prinfo = BusinessDataServiceHelper.loadSingle(prs[i].getPkValue(),payregisterEntity); //费用登记 @@ -73,14 +74,15 @@ public class YongyouBIPTask extends AbstractTask implements Plugin { } requestinfo = BusinessDataServiceHelper.loadSingle(requestinfo.getPkValue(),requestinfo.getDataEntityType().getName()); //看用友的实付款查询接口是一个个查询,还是集中查询;这个字段直接从F7实体对象中获取不到,需要扩展F7实体 - yynum = requestinfo.getString("qeug_yynum"); + yyid = requestinfo.getString("qeug_yyid"); //获取到的yynum为空,则不进行实付查询 - if(DobeDWUtils.isEmpty(yynum)){ + if(DobeDWUtils.isEmpty(yyid)){ continue; } - billMap.put(yynum,prinfo); + billMap.put(yyid,prinfo); + billNumberMap.put(yyid,requestinfo.getString("qeug_yynum")); idjson = new JSONObject(); - idjson.put("id",yynum); + idjson.put("id",yyid); idarray.add(idjson); } if(billMap.isEmpty()){ @@ -132,11 +134,11 @@ public class YongyouBIPTask extends AbstractTask implements Plugin { JSONArray dataArray = resultData.getJSONArray("data"); for (int i = 0; i < dataArray.size(); i++) { idjson = dataArray.getJSONObject(i); - yynum = idjson.getJSONObject("parentVO").getString("pk_settle"); - prinfo = billMap.get(yynum); + yyid = idjson.getJSONObject("parentVO").getString("pk_busi"); + prinfo = billMap.get(yyid); if(prinfo != null){ prinfo.set("bizdate",idjson.getJSONObject("parentVO").getDate("settleDate")); - prinfo.set("billno",yynum); + prinfo.set("billno",billNumberMap.get(yyid)); prinfo.set("billstatus","B"); //单据状态改为已提交 SaveServiceHelper.update(prinfo);//保存上述设置内容 //调用付款登记单的审核方法 diff --git a/fi/fi/shkd-fi-fi-plugin/src/main/java/shkd/utils/DobeDWUtils.java b/fi/fi/shkd-fi-fi-plugin/src/main/java/shkd/utils/DobeDWUtils.java index 71b13ee..ee98527 100644 --- a/fi/fi/shkd-fi-fi-plugin/src/main/java/shkd/utils/DobeDWUtils.java +++ b/fi/fi/shkd-fi-fi-plugin/src/main/java/shkd/utils/DobeDWUtils.java @@ -39,7 +39,7 @@ public class DobeDWUtils { //用友付款单新增接口 public static final String payUrl = "http://106.14.25.83:9999/nccloud/api/arap/paybill/insertandcommit"; //付款金额查询接口 - public static final String payQueryUrl = "http://106.14.25.83:8090/nccloud/api/sp/spPaybillQuery/querySettleStatus"; + public static final String payQueryUrl = "http://106.14.25.83:9999/nccloud/api/sp/spPaybillQuery/querySettleStatus"; private static final String jklogEntityName = "qeug_recon_jklog";