diff --git a/main/java/shjh/jhzj7/fi/fi/plugin/form/SappzFormPlugin.java b/main/java/shjh/jhzj7/fi/fi/plugin/form/SappzFormPlugin.java index 3d8b9b9..94e206d 100644 --- a/main/java/shjh/jhzj7/fi/fi/plugin/form/SappzFormPlugin.java +++ b/main/java/shjh/jhzj7/fi/fi/plugin/form/SappzFormPlugin.java @@ -61,6 +61,8 @@ public class SappzFormPlugin extends AbstractFormPlugin { Date dateofpreparat_end = (Date) this.getModel().getValue("shjh_dateofpreparat_end");//SAP应付凭证制单日期(结束) String procurementteam = (String) this.getModel().getValue("shjh_procurementteam");//采购组 Boolean isselfprocurement = (Boolean) this.getModel().getValue("shjh_isselfprocurement");//是否自行采购 + DynamicObjectCollection shjh_yymm = (DynamicObjectCollection) this.getModel().getValue("shjh_yymm");//原因码 + String shjh_djh = (String) this.getModel().getValue("shjh_djh");//单据号 // 日期格式 SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); @@ -96,6 +98,15 @@ public class SappzFormPlugin extends AbstractFormPlugin { String dateofpreparat_ends = formatDate(sdf, dateofpreparat_end); addFilterCondition(IT_LIST, "BLDAT", dateofpreparat_starts, dateofpreparat_ends); } + // 添加原因码过滤条件--改成多选 + for (DynamicObject shjh_yym : shjh_yymm) { + addFilterDumpCondition(IT_LIST, "RSTGR", shjh_yym.getString("fbasedataid.number"), shjh_yym.getString("fbasedataid.number")); + } + + // 添加单据号过滤条件 + if (StringUtils.isNotEmpty(shjh_djh)) { + addFilterCondition(IT_LIST, "UUID", shjh_djh, shjh_djh); + } DynamicObjectCollection shjhEntryentity = this.getModel().getEntryEntity("shjh_entryentity"); shjhEntryentity.clear(); //根据查询条件,调用SAP查询凭证接口,生成分录行 @@ -255,7 +266,7 @@ public class SappzFormPlugin extends AbstractFormPlugin { DynamicObject paytype_s = BusinessDataServiceHelper.loadSingle(CAS_PAYMENTBILLTYPE, new QFilter[]{qq2}); //付款类型 外部系统单据类型 if (uuid.contains("JKY")) { - this.getModel().setValue("shjh_externalsystemdocume","A",i);//员工借款单 + this.getModel().setValue("shjh_externalsystemdocume","A",i);//员工借款单ton this.getModel().setValue("shjh_epaymenttype", paytype_s,i);//对私 }else if (uuid.contains("TYB")) { this.getModel().setValue("shjh_externalsystemdocume","B",i);//通用报销单 @@ -613,6 +624,13 @@ public class SappzFormPlugin extends AbstractFormPlugin { } } + //部门 + String department = (String) this.getModel().getValue("shjh_secondarydept", selectRow); + QFilter q8 = new QFilter("number", QCP.equals, department); + DynamicObject adminorg = BusinessDataServiceHelper.loadSingle("bos_adminorg", new QFilter[]{q8}); + if (null != adminorg) { + ap_payapply.set("shjh_secondarydept", adminorg); + } /* ---------------------------------------------------默认字段---------------------------------------------------- */ @@ -678,6 +696,7 @@ public class SappzFormPlugin extends AbstractFormPlugin { //SAP凭证来源 //单据号 String uuid = (String) this.getModel().getValue("shjh_uuid", selectRow); + ap_payapply.set("shjh_fkdjbh",uuid);//单据号 QFilter qq1 = new QFilter("number", QCP.equals, "JH001");//对公 QFilter qq2 = new QFilter("number", QCP.equals, "JH002");//对私 DynamicObject paytype_g = BusinessDataServiceHelper.loadSingle(CAS_PAYMENTBILLTYPE, new QFilter[]{qq1}); diff --git a/main/java/shjh/jhzj7/fi/fi/plugin/operate/SchedulebillMergeOperation.java b/main/java/shjh/jhzj7/fi/fi/plugin/operate/SchedulebillMergeOperation.java index 4f261cb..6723c6a 100644 --- a/main/java/shjh/jhzj7/fi/fi/plugin/operate/SchedulebillMergeOperation.java +++ b/main/java/shjh/jhzj7/fi/fi/plugin/operate/SchedulebillMergeOperation.java @@ -1,8 +1,10 @@ package shjh.jhzj7.fi.fi.plugin.operate; +import com.sap.db.jdbc.packet.ErrorLevel; import kd.bos.dataentity.entity.DynamicObject; import kd.bos.dataentity.entity.DynamicObjectCollection; import kd.bos.entity.ExtendedDataEntity; +import kd.bos.entity.operate.result.OperateErrorInfo; import kd.bos.entity.plugin.AbstractOperationServicePlugIn; import kd.bos.entity.plugin.AddValidatorsEventArgs; import kd.bos.entity.plugin.args.AfterOperationArgs; @@ -149,9 +151,15 @@ public class SchedulebillMergeOperation extends AbstractOperationServicePlugIn i for (Long aLong : longs) { sb.append(aLong).append(","); } - this.getOperationResult().setSuccess(true); - this.getOperationResult().setMessage("合并数:" + size + " 合并的批次号:" + sb); - this.getOperationResult().setShowMessage(true); +// this.getOperationResult().setSuccess(true); +// this.getOperationResult().setMessage("合并数:" + size + " 合并的批次号:" + sb); +// this.getOperationResult().setShowMessage(true); + + OperateErrorInfo operateErrorInfo = new OperateErrorInfo(); + operateErrorInfo.setMessage("合并数:" + size + " 合并的批次号:" + sb); + operateErrorInfo.setErrorLevel(ErrorLevel.FatalError.name()); +// operateErrorInfo.setPkValue(bill.getPkValue()); + this.operationResult.addErrorInfo(operateErrorInfo); return; } } diff --git a/main/java/shjh/jhzj7/fi/fi/plugin/task/QuerySapCreatePayApplyTask.java b/main/java/shjh/jhzj7/fi/fi/plugin/task/QuerySapCreatePayApplyTask.java index 1cc8923..a0f2194 100644 --- a/main/java/shjh/jhzj7/fi/fi/plugin/task/QuerySapCreatePayApplyTask.java +++ b/main/java/shjh/jhzj7/fi/fi/plugin/task/QuerySapCreatePayApplyTask.java @@ -466,6 +466,14 @@ public class QuerySapCreatePayApplyTask extends AbstractTask { ap_payapply_entry.set("e_settlementtype", settlementtypes); } String uuid = it_list.getString("XBLNR");//单据号 + ap_payapply.set("shjh_fkdjbh", uuid); + String department = it_list.getString("ZREQ_DEPT"); + QFilter q8 = new QFilter("number", QCP.equals, department); + DynamicObject adminorg = BusinessDataServiceHelper.loadSingle("bos_adminorg", new QFilter[]{q8}); + if (null != adminorg) { + ap_payapply.set("shjh_secondarydept", adminorg); + } + // 设置付款类型 //付款类型 外部系统单据类型 setPaymentType(ap_payapply, uuid); diff --git a/main/java/shjh/jhzj7/fi/fi/webapi/ApplyAdjustBillControler.java b/main/java/shjh/jhzj7/fi/fi/webapi/ApplyAdjustBillControler.java index a2ca1ee..df8e950 100644 --- a/main/java/shjh/jhzj7/fi/fi/webapi/ApplyAdjustBillControler.java +++ b/main/java/shjh/jhzj7/fi/fi/webapi/ApplyAdjustBillControler.java @@ -550,6 +550,15 @@ public class ApplyAdjustBillControler { return s1; } String uuid = it_list.getString("XBLNR");//单据号 + ap_payapply.set("shjh_fkdjbh", uuid); + + //部门 + String department = it_list.getString("ZREQ_DEPT"); + QFilter q8 = new QFilter("number", QCP.equals, department); + DynamicObject adminorg = BusinessDataServiceHelper.loadSingle("bos_adminorg", new QFilter[]{q8}); + if (null != adminorg) { + ap_payapply.set("shjh_secondarydept", adminorg); + } // 设置付款类型 //付款类型 外部系统单据类型 setPaymentType(ap_payapply, uuid);