From ffd8fae5453be55d597e6b3f7175cf01cd9b4dd4 Mon Sep 17 00:00:00 2001 From: yuxueliang0813 <407010292@qq.com> Date: Fri, 25 Apr 2025 17:59:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=8D=E6=B8=85=E8=B4=A6=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../operate/ClearAccountBillOperation.java | 35 ++++++++++++------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/main/java/shjh/jhzj7/fi/fi/plugin/operate/ClearAccountBillOperation.java b/main/java/shjh/jhzj7/fi/fi/plugin/operate/ClearAccountBillOperation.java index 8a124f5..7d89833 100644 --- a/main/java/shjh/jhzj7/fi/fi/plugin/operate/ClearAccountBillOperation.java +++ b/main/java/shjh/jhzj7/fi/fi/plugin/operate/ClearAccountBillOperation.java @@ -411,31 +411,40 @@ public class ClearAccountBillOperation extends AbstractOperationServicePlugIn im private String sapReversalVoucher(DynamicObject prinfo) { //SAP反清账接口入参组装和调用 JSONArray IT_LIST = new JSONArray(); + JSONObject iteminfo = new JSONObject(); String companyCode = prinfo.getDynamicObject("org").getString("number"); - //添加公司过滤条件 - addFilterCondition(IT_LIST, "BUKRS", companyCode, companyCode); + //添加公司 +// addFilterCondition(IT_LIST, "BUKRS", companyCode, companyCode); + iteminfo.put("BUKRS", companyCode); String shjh_pzh = prinfo.getString("shjh_pzh"); - //添加会计凭证编号过滤条件 - addFilterCondition(IT_LIST, "BELNR", shjh_pzh, shjh_pzh); + //添加会计凭证编号 +// addFilterCondition(IT_LIST, "BELNR", shjh_pzh, shjh_pzh); + iteminfo.put("BELNR", shjh_pzh); String shjh_year = prinfo.getString("shjh_year"); - //添加会计年度过滤条件 - addFilterCondition(IT_LIST, "GJAHR", shjh_year, shjh_year); - //添加冲销原因过滤条件-04-跨期冲销;默认04,冲销日期必传 - addFilterCondition(IT_LIST, "STGRD", "04", "04"); - //添加用户名过滤条件-操作反清账按钮的用户(OA用户名) + //添加会计年度 +// addFilterCondition(IT_LIST, "GJAHR", shjh_year, shjh_year); + iteminfo.put("GJAHR", shjh_year); + //添加冲销原因-04-跨期冲销;默认04,冲销日期必传 +// addFilterCondition(IT_LIST, "STGRD", "04", "04"); + iteminfo.put("STGRD", "04"); + //添加用户名-操作反清账按钮的用户(OA用户名) DynamicObject userinfo = BusinessDataServiceHelper.loadSingleFromCache(RequestContext.get().getCurrUserId(), userName); String oauser = userinfo.getString("shjh_oauser"); - addFilterCondition(IT_LIST, "UNAME", oauser, oauser); - //添加反清账日期过滤条件 +// addFilterCondition(IT_LIST, "UNAME", oauser, oauser); + iteminfo.put("UNAME", oauser); + //添加反清账日期 if(prinfo.getDate("shjh_uncleardate") != null){ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); String datestr = sdf.format(prinfo.getDate("shjh_uncleardate")); - addFilterCondition(IT_LIST, "BUDAT", datestr, datestr); +// addFilterCondition(IT_LIST, "BUDAT", datestr, datestr); + iteminfo.put("BUDAT", datestr); }else{ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); String datestr = sdf.format(new Date()); - addFilterCondition(IT_LIST, "BUDAT", datestr, datestr); +// addFilterCondition(IT_LIST, "BUDAT", datestr, datestr); + iteminfo.put("BUDAT", datestr); } + IT_LIST.add(iteminfo); JSONObject sapReturnData = SapUtils.sapReversalAPI(IT_LIST,prinfo.getString("billno")); //sap返回的结果不为空且正确