From af77e5de723066ac57f2c2c1863fb455ad4e58f5 Mon Sep 17 00:00:00 2001 From: chenshaoxin <1981897232@qq.com> Date: Mon, 16 Jun 2025 11:27:34 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BA=BA=EF=BC=9A?= =?UTF-8?q?=E9=99=88=E7=BB=8D=E9=91=AB=20=E6=97=A5=E6=9C=9F=EF=BC=9A2025/6?= =?UTF-8?q?/16=2012=EF=BC=9A30=20=E5=86=85=E5=AE=B9:=E6=94=B6=E7=A5=A8?= =?UTF-8?q?=E7=99=BB=E8=AE=B0=E8=87=AA=E5=8A=A8=E4=B8=8B=E6=8E=A8=E5=AE=A1?= =?UTF-8?q?=E6=A0=B8=E7=A1=AE=E8=AE=A4=E6=94=B6=E6=AC=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sys/plugin/list/ReceivableListPlugin.java | 102 ++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/list/ReceivableListPlugin.java diff --git a/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/list/ReceivableListPlugin.java b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/list/ReceivableListPlugin.java new file mode 100644 index 0000000..4689818 --- /dev/null +++ b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/list/ReceivableListPlugin.java @@ -0,0 +1,102 @@ +package shkd.sys.sys.plugin.list; + +import com.alibaba.druid.util.StringUtils; +import kd.bos.dataentity.OperateOption; +import kd.bos.dataentity.entity.DynamicObject; +import kd.bos.entity.operate.result.OperateErrorInfo; +import kd.bos.entity.operate.result.OperationResult; +import kd.bos.form.ConfirmTypes; +import kd.bos.form.MessageBoxOptions; +import kd.bos.form.events.AfterDoOperationEventArgs; +import kd.bos.list.plugin.AbstractListPlugin; +import kd.bos.logging.Log; +import kd.bos.logging.LogFactory; +import kd.bos.orm.query.QCP; +import kd.bos.orm.query.QFilter; +import kd.bos.servicehelper.BusinessDataServiceHelper; +import kd.bos.servicehelper.botp.BFTrackerServiceHelper; +import kd.bos.servicehelper.operation.OperationServiceHelper; +import kd.tmc.cdm.common.constant.CdmEntityConst; +import shkd.sys.sys.plugin.report.FinanceReportPlugin; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; + +public class ReceivableListPlugin extends AbstractListPlugin { + + private static final Log logger = LogFactory.getLog(ReceivableListPlugin.class); + + @Override + public void afterDoOperation(AfterDoOperationEventArgs afterDoOperationEventArgs) { + super.afterDoOperation(afterDoOperationEventArgs); + String operateKey = afterDoOperationEventArgs.getOperateKey(); + if ("autogenrecbill".equals(operateKey)){ + OperationResult operationResult = afterDoOperationEventArgs.getOperationResult(); + if (operationResult.getSuccessPkIds().size()!=0){ + List successPkIds = operationResult.getSuccessPkIds(); + for (Object successPkId : successPkIds) { + Map> cdm_receivablebill = BFTrackerServiceHelper.findTargetBills("cdm_receivablebill", new Long[]{(Long) successPkId}); + System.out.println(cdm_receivablebill); + HashSet cas_recbill = cdm_receivablebill.get("cas_recbill"); + QFilter filter = new QFilter("shkd_zdxtid", QCP.equals, "true"); + filter.and(new QFilter("id", QCP.in, cas_recbill)); + DynamicObject[] CDM_PAYABLEBILLs = BusinessDataServiceHelper.load("cas_recbill", "id,billno,org", filter.toArray()); + List list = new ArrayList<>(); + for (int i = 0; i < CDM_PAYABLEBILLs.length; i++) { + DynamicObject dynamicObject = BusinessDataServiceHelper.loadSingle(CDM_PAYABLEBILLs[i].get("id"), "cas_recbill"); + list.add(dynamicObject.getLong("id")); + } + StringBuilder Builder = new StringBuilder(""); + //调用方法执行数据 - 自动兑付下推 + OperationResult operationResult1 = OperationServiceHelper.executeOperate("submit", + "cas_recbill", + list.toArray(), OperateOption.create()); + logger.info("operationResult1:"+operationResult1); +// if (operationResult1.getAllErrorInfo().size()!=0){ +// List allErrorInfo = operationResult1.getAllErrorInfo(); +// for (int i = 0; i < allErrorInfo.size(); i++) { +// String message = allErrorInfo.get(i).getMessage(); +// Builder.append(message+"\n"); +// } +// } + + OperationResult operationResult2=null; + if ( operationResult1.getSuccessPkIds().size()!=0){ + operationResult2 = OperationServiceHelper.executeOperate("audit", + "cas_recbill", + operationResult1.getSuccessPkIds().toArray(), OperateOption.create()); +// if (operationResult2.getAllErrorInfo().size()!=0){ +// List allErrorInfo = operationResult2.getAllErrorInfo(); +// for (int i = 0; i < allErrorInfo.size(); i++) { +// String message = allErrorInfo.get(i).getMessage(); +// Builder.append(message+"\n"); +// } +// } + } + logger.info("operationResult2:"+operationResult2); + + OperationResult operationResult3=null; + if ( operationResult2.getSuccessPkIds().size()!=0){ + operationResult3 = OperationServiceHelper.executeOperate("receivingrec", + "cas_recbill", + operationResult2.getSuccessPkIds().toArray(), OperateOption.create()); +// if (operationResult3.getAllErrorInfo().size()!=0){ +// List allErrorInfo = operationResult3.getAllErrorInfo(); +// for (int i = 0; i < allErrorInfo.size(); i++) { +// String message = allErrorInfo.get(i).getMessage(); +// Builder.append(message+"\n"); +// } +// } + } + logger.info("operationResult3:"+operationResult3); + +// if (StringUtils.isEmpty(Builder.toString())){ +// this.getView().showConfirm("操作失败",Builder.toString() , MessageBoxOptions.None, ConfirmTypes.Default, null); +// } + } + } + } + } +} From 78b5d1c91b2c1195ff99b4f301866051a0505709 Mon Sep 17 00:00:00 2001 From: chenshaoxin <1981897232@qq.com> Date: Mon, 16 Jun 2025 14:08:09 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BA=BA=EF=BC=9A?= =?UTF-8?q?=E9=99=88=E7=BB=8D=E9=91=AB=20=E6=97=A5=E6=9C=9F=EF=BC=9A2025/6?= =?UTF-8?q?/16=2012=EF=BC=9A30=20=E5=86=85=E5=AE=B9:=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E5=86=B7=E5=8D=B4=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sys/sys/plugin/operation/domain/TimeValidator.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/operation/domain/TimeValidator.java b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/operation/domain/TimeValidator.java index bbd4fd7..84fa633 100644 --- a/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/operation/domain/TimeValidator.java +++ b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/operation/domain/TimeValidator.java @@ -4,6 +4,8 @@ import kd.bos.dataentity.entity.DynamicObject; import kd.bos.entity.ExtendedDataEntity; import kd.bos.entity.validate.AbstractValidator; import kd.bos.entity.validate.ErrorLevel; +import kd.bos.entity.validate.ValidationErrorInfo; +import kd.bos.servicehelper.BusinessDataServiceHelper; import shkd.sys.sys.plugin.operation.ElectronicPayDealOPPlugin; import java.time.Duration; @@ -27,9 +29,14 @@ public class TimeValidator extends AbstractValidator { // 判断时间差是否超过 10 秒 if (duration.getSeconds() <= 10) { this.addMessage(obj,"当前单据已更新操作结果,请十秒后再更新", ErrorLevel.Error);//错误消息 + timemap.put(id,localDateTime); + }else { + timemap.put(id,currentTime); } + }else { + timemap.put(id,currentTime); } - timemap.put(id,currentTime); + } } } From 21b6a017328ef80e442d443c2bfa056685c30e94 Mon Sep 17 00:00:00 2001 From: chenshaoxin <1981897232@qq.com> Date: Mon, 16 Jun 2025 17:38:29 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BA=BA=EF=BC=9A?= =?UTF-8?q?=E9=99=88=E7=BB=8D=E9=91=AB=20=E6=97=A5=E6=9C=9F=EF=BC=9A2025/6?= =?UTF-8?q?/16=2017=EF=BC=9A30=20=E5=86=85=E5=AE=B9:=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E5=86=B7=E5=8D=B4=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../operation/ElectronicPayDealOPPlugin.java | 62 +++++++++---------- .../operation/domain/TimeValidator.java | 35 ++++++----- 2 files changed, 50 insertions(+), 47 deletions(-) diff --git a/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/operation/ElectronicPayDealOPPlugin.java b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/operation/ElectronicPayDealOPPlugin.java index 2d78595..1daaf8e 100644 --- a/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/operation/ElectronicPayDealOPPlugin.java +++ b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/operation/ElectronicPayDealOPPlugin.java @@ -10,13 +10,11 @@ import kd.bos.entity.plugin.args.AfterOperationArgs; import kd.bos.entity.plugin.args.BeforeOperationArgs; import kd.bos.entity.plugin.args.BeginOperationTransactionArgs; import kd.bos.entity.plugin.args.ReturnOperationArgs; -import kd.bos.entity.validate.AbstractValidator; -import kd.bos.entity.validate.ValidatePriority; -import kd.bos.entity.validate.ValidateResult; -import kd.bos.entity.validate.ValidateResultCollection; +import kd.bos.entity.validate.*; import kd.bos.logging.Log; import kd.bos.logging.LogFactory; import kd.sdk.plugin.Plugin; +import shkd.sys.sys.plugin.list.ElectronicPayDealListPlugin; import shkd.sys.sys.plugin.operation.domain.TimeValidator; import java.time.Duration; @@ -33,14 +31,14 @@ public class ElectronicPayDealOPPlugin extends AbstractOperationServicePlugIn im @Override public void onPreparePropertys(PreparePropertysEventArgs e) { super.onPreparePropertys(e); - Iterator> iterator = timemap.entrySet().iterator(); - while (iterator.hasNext()) { - Map.Entry entry = iterator.next(); - Duration duration = Duration.between(entry.getValue(), LocalDateTime.now()); - if (duration.getSeconds() > 10) { - iterator.remove(); - } - } +// Iterator> iterator = timemap.entrySet().iterator(); +// while (iterator.hasNext()) { +// Map.Entry entry = iterator.next(); +// Duration duration = Duration.between(entry.getValue(), LocalDateTime.now()); +// if (duration.getSeconds() > 10) { +// iterator.remove(); +// } +// } } @Override @@ -78,25 +76,25 @@ public class ElectronicPayDealOPPlugin extends AbstractOperationServicePlugIn im @Override public void onReturnOperation(ReturnOperationArgs e) { - List overtime = new ArrayList<>();//存放因连续点击而校验失败的数据 - super.onReturnOperation(e); - ValidateResultCollection validateResult = this.operationResult.getValidateResult(); - List validateErrors = validateResult.getValidateErrors(); - for (ValidateResult validateError : validateErrors) { - List allErrorInfo = validateError.getAllErrorInfo(); - for (OperateErrorInfo operateErrorInfo : allErrorInfo) { - String message = operateErrorInfo.getMessage(); - if (message.contains("当前单据已更新操作结果,请十秒后再更新")){ - overtime.add(operateErrorInfo.getPkValue()); - } - } - } - List successPkIds = e.getOperationResult().getSuccessPkIds();//执行成功的数据 - Map billNos = ((OperationResult) e.getOperationResult()).getBillNos(); - billNos.keySet().removeAll(successPkIds); - billNos.keySet().removeAll(overtime); - for (Object key : billNos.keySet()) { - timemap.remove(key); - } +// List overtime = new ArrayList<>();//存放因连续点击而校验失败的数据 +// super.onReturnOperation(e); +// ValidateResultCollection validateResult = this.operationResult.getValidateResult(); +// List validateErrors = validateResult.getValidateErrors(); +// for (ValidateResult validateError : validateErrors) { +// List allErrorInfo = validateError.getAllErrorInfo(); +// for (OperateErrorInfo operateErrorInfo : allErrorInfo) { +// String message = operateErrorInfo.getMessage(); +// if (message.contains("当前单据已更新操作结果,请十秒后再更新")){ +// overtime.add(operateErrorInfo.getPkValue()); +// } +// } +// } +// List successPkIds = e.getOperationResult().getSuccessPkIds();//执行成功的数据 +// Map billNos = ((OperationResult) e.getOperationResult()).getBillNos();//用于存放要去除的数据 +// billNos.keySet().removeAll(successPkIds); +// billNos.keySet().removeAll(overtime); +// for (Object key : billNos.keySet()) { +// timemap.remove(key); +// } } } diff --git a/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/operation/domain/TimeValidator.java b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/operation/domain/TimeValidator.java index 84fa633..041ee7c 100644 --- a/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/operation/domain/TimeValidator.java +++ b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/operation/domain/TimeValidator.java @@ -20,21 +20,26 @@ public class TimeValidator extends AbstractValidator { for(ExtendedDataEntity obj :dataEntities){ DynamicObject bill = obj.getDataEntity();//获取当前单据的数据包 Long id = bill.getLong("id");//进一步获取编码字段 - Map timemap = ElectronicPayDealOPPlugin.timemap; - LocalDateTime localDateTime = timemap.get(id); - LocalDateTime currentTime = LocalDateTime.now(); - if (localDateTime!=null){ - - Duration duration = Duration.between(localDateTime, currentTime); - // 判断时间差是否超过 10 秒 - if (duration.getSeconds() <= 10) { - this.addMessage(obj,"当前单据已更新操作结果,请十秒后再更新", ErrorLevel.Error);//错误消息 - timemap.put(id,localDateTime); - }else { - timemap.put(id,currentTime); - } - }else { - timemap.put(id,currentTime); +// Map timemap = ElectronicPayDealOPPlugin.timemap; +// LocalDateTime localDateTime = timemap.get(id); +// LocalDateTime currentTime = LocalDateTime.now(); +// if (localDateTime!=null){ +// +// Duration duration = Duration.between(localDateTime, currentTime); +// // 判断时间差是否超过 10 秒 +// if (duration.getSeconds() <= 10) { +// this.addMessage(obj,"当前单据已更新操作结果,请十秒后再更新", ErrorLevel.Error);//错误消息 +// timemap.put(id,localDateTime); +// }else { +// timemap.put(id,currentTime); +// } +// }else { +// timemap.put(id,currentTime); +// } + DynamicObject dynamicObject = BusinessDataServiceHelper.loadSingle(id, obj.getDataEntity().getDataEntityType().getName()); + boolean shkd_lock = dynamicObject.getBoolean("shkd_lock"); + if (shkd_lock){ + this.addMessage(obj,"当前单据已锁定", ErrorLevel.Error);//错误消息 } } From d4fa6770d8f571aa73b1033e97e214929578f5ad Mon Sep 17 00:00:00 2001 From: chenshaoxin <1981897232@qq.com> Date: Mon, 16 Jun 2025 17:59:39 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BA=BA=EF=BC=9A?= =?UTF-8?q?=E9=99=88=E7=BB=8D=E9=91=AB=20=E6=97=A5=E6=9C=9F=EF=BC=9A2025/6?= =?UTF-8?q?/16=2018=EF=BC=9A00=20=E5=86=85=E5=AE=B9:=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E5=86=B7=E5=8D=B4=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sys/plugin/list/ReceivableListPlugin.java | 43 ++++++++++--------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/list/ReceivableListPlugin.java b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/list/ReceivableListPlugin.java index 4689818..0a2d558 100644 --- a/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/list/ReceivableListPlugin.java +++ b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/list/ReceivableListPlugin.java @@ -48,12 +48,13 @@ public class ReceivableListPlugin extends AbstractListPlugin { DynamicObject dynamicObject = BusinessDataServiceHelper.loadSingle(CDM_PAYABLEBILLs[i].get("id"), "cas_recbill"); list.add(dynamicObject.getLong("id")); } - StringBuilder Builder = new StringBuilder(""); - //调用方法执行数据 - 自动兑付下推 - OperationResult operationResult1 = OperationServiceHelper.executeOperate("submit", - "cas_recbill", - list.toArray(), OperateOption.create()); - logger.info("operationResult1:"+operationResult1); + if (list.size()!=0){ + StringBuilder Builder = new StringBuilder(""); + //调用方法执行数据 - 自动兑付下推 + OperationResult operationResult1 = OperationServiceHelper.executeOperate("submit", + "cas_recbill", + list.toArray(), OperateOption.create()); + logger.info("operationResult1:"+operationResult1); // if (operationResult1.getAllErrorInfo().size()!=0){ // List allErrorInfo = operationResult1.getAllErrorInfo(); // for (int i = 0; i < allErrorInfo.size(); i++) { @@ -62,11 +63,11 @@ public class ReceivableListPlugin extends AbstractListPlugin { // } // } - OperationResult operationResult2=null; - if ( operationResult1.getSuccessPkIds().size()!=0){ - operationResult2 = OperationServiceHelper.executeOperate("audit", - "cas_recbill", - operationResult1.getSuccessPkIds().toArray(), OperateOption.create()); + OperationResult operationResult2=null; + if ( operationResult1.getSuccessPkIds().size()!=0){ + operationResult2 = OperationServiceHelper.executeOperate("audit", + "cas_recbill", + operationResult1.getSuccessPkIds().toArray(), OperateOption.create()); // if (operationResult2.getAllErrorInfo().size()!=0){ // List allErrorInfo = operationResult2.getAllErrorInfo(); // for (int i = 0; i < allErrorInfo.size(); i++) { @@ -74,14 +75,15 @@ public class ReceivableListPlugin extends AbstractListPlugin { // Builder.append(message+"\n"); // } // } - } - logger.info("operationResult2:"+operationResult2); + } + logger.info("operationResult2:"+operationResult2); - OperationResult operationResult3=null; - if ( operationResult2.getSuccessPkIds().size()!=0){ - operationResult3 = OperationServiceHelper.executeOperate("receivingrec", - "cas_recbill", - operationResult2.getSuccessPkIds().toArray(), OperateOption.create()); + + OperationResult operationResult3=null; + if (operationResult2!=null && operationResult2.getSuccessPkIds().size()!=0){ + operationResult3 = OperationServiceHelper.executeOperate("receivingrec", + "cas_recbill", + operationResult2.getSuccessPkIds().toArray(), OperateOption.create()); // if (operationResult3.getAllErrorInfo().size()!=0){ // List allErrorInfo = operationResult3.getAllErrorInfo(); // for (int i = 0; i < allErrorInfo.size(); i++) { @@ -89,12 +91,13 @@ public class ReceivableListPlugin extends AbstractListPlugin { // Builder.append(message+"\n"); // } // } - } - logger.info("operationResult3:"+operationResult3); + } + logger.info("operationResult3:"+operationResult3); // if (StringUtils.isEmpty(Builder.toString())){ // this.getView().showConfirm("操作失败",Builder.toString() , MessageBoxOptions.None, ConfirmTypes.Default, null); // } + } } } } From 6c105bd87cbf8b9ac90211f10c0b15f6e4f7b6b0 Mon Sep 17 00:00:00 2001 From: chenshaoxin <1981897232@qq.com> Date: Tue, 17 Jun 2025 10:25:41 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BA=BA=EF=BC=9A?= =?UTF-8?q?=E9=99=88=E7=BB=8D=E9=91=AB=20=E6=97=A5=E6=9C=9F=EF=BC=9A2025/6?= =?UTF-8?q?/17=2010=EF=BC=9A00=20=E5=86=85=E5=AE=B9:=E5=8D=95=E6=8D=AE?= =?UTF-8?q?=E4=B8=8B=E6=8E=A8=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugin/other/CasRecbillBOTPPlugin.java | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/other/CasRecbillBOTPPlugin.java diff --git a/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/other/CasRecbillBOTPPlugin.java b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/other/CasRecbillBOTPPlugin.java new file mode 100644 index 0000000..2899c11 --- /dev/null +++ b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/other/CasRecbillBOTPPlugin.java @@ -0,0 +1,65 @@ +package shkd.sys.sys.plugin.other; + +import kd.bos.dataentity.entity.DynamicObject; +import kd.bos.entity.BillEntityType; +import kd.bos.entity.ExtendedDataEntity; +import kd.bos.entity.ExtendedDataEntitySet; +import kd.bos.entity.botp.plugin.AbstractConvertPlugIn; +import kd.bos.entity.botp.plugin.args.AfterConvertEventArgs; +import kd.bos.entity.botp.plugin.args.AfterCreateLinkEventArgs; +import kd.bos.entity.botp.plugin.args.AfterCreateTargetEventArgs; +import kd.bos.entity.botp.plugin.args.AfterFieldMappingEventArgs; + +import java.util.List; + +public class CasRecbillBOTPPlugin extends AbstractConvertPlugIn { + + /** + * 创建目标单据数据包后事件 + * + * @param e + * @remark + * 这个事件,只在下推时触发,把根据分单规则创建好的目标单,传递给插件 + */ + @Override + public void afterCreateTarget(AfterCreateTargetEventArgs e) { + System.out.println(666); + } + + /** + * 目标字段赋值完毕后事件 + * + * @param e + * @remark + * 插件可以在此基础上,继续填写目标字段值 + */ + @Override + public void afterFieldMapping(AfterFieldMappingEventArgs e) { + System.out.println(666); + } + + + /** + * 记录关联关系后事件 + * + * @param e + * @remark + * 根据系统自动记录的关联关系,进行相关数据的同步携带,如携带其他子单据体数据 + */ + @Override + public void afterCreateLink(AfterCreateLinkEventArgs e) { + System.out.println(); + } + + @Override + public void afterConvert(AfterConvertEventArgs e) { + super.afterConvert(e); + BillEntityType tgtMainType = this.getTgtMainType(); + ExtendedDataEntitySet targetExtDataEntitySet = e.getTargetExtDataEntitySet(); + List cas_recbill = targetExtDataEntitySet.getExtDataEntityMap().get("cas_recbill"); + for (ExtendedDataEntity extendedDataEntity : cas_recbill) { + DynamicObject dataEntity = extendedDataEntity.getDataEntity(); + dataEntity.set("shkd_zdxtid","true"); + } + } +}