From 27a5aacbba55146c262c2c7e104becf3a9ff431e Mon Sep 17 00:00:00 2001 From: yuxueliang0813 <407010292@qq.com> Date: Fri, 11 Jul 2025 16:49:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=98=E6=AC=BE=E7=94=B3=E8=AF=B7=E5=8D=95?= =?UTF-8?q?=E5=85=B3=E9=97=AD=E6=8E=A8=E9=80=81sap=E5=92=8C=E8=B4=B9?= =?UTF-8?q?=E6=8E=A7=E6=8E=A5=E5=8F=A3=E6=8C=87=E5=90=91=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fi/fi/plugin/form/ScheduleListPlugin.java | 16 ++++++---------- .../plugin/operate/PayrequestBillOperation.java | 15 ++++++--------- 2 files changed, 12 insertions(+), 19 deletions(-) diff --git a/main/java/shjh/jhzj7/fi/fi/plugin/form/ScheduleListPlugin.java b/main/java/shjh/jhzj7/fi/fi/plugin/form/ScheduleListPlugin.java index 5f2f4ab..8106a79 100644 --- a/main/java/shjh/jhzj7/fi/fi/plugin/form/ScheduleListPlugin.java +++ b/main/java/shjh/jhzj7/fi/fi/plugin/form/ScheduleListPlugin.java @@ -18,12 +18,9 @@ import kd.bos.orm.query.QFilter; import kd.bos.servicehelper.BusinessDataServiceHelper; import kd.bos.servicehelper.operation.OperationServiceHelper; import kd.bos.servicehelper.operation.SaveServiceHelper; -import kd.bos.util.StringUtils; import java.text.SimpleDateFormat; -import java.util.ArrayList; import java.util.Date; -import java.util.Map; import static shjh.jhzj7.fi.fi.utils.SapUtils.backpayment_status; import static shjh.jhzj7.fi.fi.utils.SapUtils.unlocked_status; @@ -65,6 +62,7 @@ public class ScheduleListPlugin extends AbstractListPlugin { } } } + private void processRows(String status) { ListSelectedRowCollection rows = this.getSelectedRows(); for (ListSelectedRow row : rows) { @@ -77,11 +75,11 @@ public class ScheduleListPlugin extends AbstractListPlugin { DynamicObject payapply = BusinessDataServiceHelper.loadSingle("ap_payapply", "id,billno,shjh_sourceadjustment", qFilter.toArray()); if (null != payapply) { - //如果付款申请单不是来源调整单 + //如果付款申请单不是来源调整单,则触发状态回写至费控和sap if (!payapply.getBoolean("shjh_sourceadjustment")) { //来源SAP - String shjhSapuniquevalue = bill.getString("shjh_sapuniquevalue"); - if (StringUtils.isNotEmpty(shjhSapuniquevalue)) { + String sourcesystem = bill.getString("shjh_sourcesystem"); + if ("A".equals(sourcesystem)) { JSONArray IT_INPUT = createInputJSONArray(bill, status); JSONObject jsonObjects = unlocked_status(IT_INPUT, bill.getString("billno")); String code = jsonObjects.getString("code"); @@ -93,10 +91,8 @@ public class ScheduleListPlugin extends AbstractListPlugin { closeOrUnauditApply(payapply,"unaudit"); } return; - } - //若来源为费控,调用费控状态修改接口 - String fkbillid = bill.getString("shjh_fkbillid");//获取费控单据表头ID - if (StringUtils.isNotEmpty(fkbillid)) { + }else if ("B".equals(sourcesystem)) { + //若来源为费控,调用费控状态修改接口 //先付后记(其他付款、劳务报销单、SAP会员退卡单)回写付款状态 JSONObject jsonObjects = backpayment_status(createInputJSONArrays(bill),bill.getString("billno")); String code = (String)jsonObjects.get("code"); diff --git a/main/java/shjh/jhzj7/fi/fi/plugin/operate/PayrequestBillOperation.java b/main/java/shjh/jhzj7/fi/fi/plugin/operate/PayrequestBillOperation.java index 77e3821..b6574d0 100644 --- a/main/java/shjh/jhzj7/fi/fi/plugin/operate/PayrequestBillOperation.java +++ b/main/java/shjh/jhzj7/fi/fi/plugin/operate/PayrequestBillOperation.java @@ -59,14 +59,13 @@ public class PayrequestBillOperation extends AbstractOperationServicePlugIn impl for (DynamicObject bill : dataEntities) { bill = BusinessDataServiceHelper.loadSingle(bill.getPkValue(), bill.getDataEntityType().getName()); //若来源为SAP,调用SAP状态修改接口 - String shjhSapuniquevalue = bill.getString("shjh_sapuniquevalue");//获取SAP唯一值 - if (shjhSapuniquevalue!= null && !shjhSapuniquevalue.isEmpty()) { - + String sourcesystem = bill.getString("shjh_sourcesystem"); + if ("A".equals(sourcesystem)) { //调关闭接口 JSONArray IT_INPUT = new JSONArray(); JSONObject jsonObject = new JSONObject(); String FM_CompanyCode = ""; - if (null!= bill.getDynamicObject("applyorg")) { + if (null != bill.getDynamicObject("applyorg")) { FM_CompanyCode = bill.getDynamicObject("applyorg").getString("number");//公司编码_申请付款组织 } jsonObject.put("BUKRS",FM_CompanyCode);//公司代码_申请付款组织 @@ -75,7 +74,7 @@ public class PayrequestBillOperation extends AbstractOperationServicePlugIn impl jsonObject.put("STATUS", "03");//状态 01:锁定,02:解锁,03:关闭,04:退单:05:作废 jsonObject.put("BUZEI", bill.getString("shjh_voucherentrynum"));//行编号_SAP应付凭证行号 String cname = ""; - if (null!= bill.getDynamicObject("creator")) { + if (null != bill.getDynamicObject("creator")) { cname = bill.getDynamicObject("creator").getString("number");//创建人,工号_申请人 } jsonObject.put("CNAME", cname);//创建人,工号 @@ -91,10 +90,8 @@ public class PayrequestBillOperation extends AbstractOperationServicePlugIn impl }else { log.info("付款申请单:"+bill.getString("billno")+"状态关闭(SAP)成功"); } - } - //若来源为费控,调用费控状态修改接口 - String fkbillid = bill.getString("shjh_fkbillid");//获取费控单据表头ID - if (fkbillid != null && !fkbillid.isEmpty()) { + }else if ("B".equals(sourcesystem)) { + //若来源为费控,调用费控状态修改接口 JSONObject data = new JSONObject(); JSONArray datas = new JSONArray(); JSONObject jsonObject = new JSONObject();