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";