|
@@ -7,10 +7,14 @@ import kd.bos.entity.EntityMetadataCache;
|
|
|
import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
|
|
|
import kd.bos.entity.plugin.args.EndOperationTransactionArgs;
|
|
|
import kd.bos.exception.KDBizException;
|
|
|
+import kd.bos.orm.query.QCP;
|
|
|
+import kd.bos.orm.query.QFilter;
|
|
|
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
|
|
|
|
|
+import java.math.BigDecimal;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
public class ExpenseAccountFileOpPlugin extends AbstractOperationServicePlugIn {
|
|
|
|
|
@@ -25,13 +29,10 @@ public class ExpenseAccountFileOpPlugin extends AbstractOperationServicePlugIn {
|
|
|
DynamicObject info = BusinessDataServiceHelper.loadSingle(dynamicObjects[i].getPkValue(), dynamicObjects[i].getDynamicObjectType().getName());
|
|
|
DynamicObjectCollection writeoffapply = info.getDynamicObjectCollection("contractentry");
|
|
|
if(writeoffapply.size()<=0){
|
|
|
- DynamicObjectCollection nckdAttachmentpanelsq = info.getDynamicObjectCollection("nckd_attachmentpanelsq");
|
|
|
- List<Object> threeAttachIdSet = new ArrayList<>();
|
|
|
- // 获取附件
|
|
|
- nckdAttachmentpanelsq.forEach(file -> threeAttachIdSet.add(file.getDynamicObject("fbasedataid").getPkValue()));
|
|
|
- // 提取附件信息
|
|
|
- DynamicObject[] sourceAttachments = BusinessDataServiceHelper.load(threeAttachIdSet.toArray(), EntityMetadataCache.getDataEntityType("bd_attachment"));
|
|
|
- if(sourceAttachments.length<=0){
|
|
|
+ QFilter nckd_orgamountFilter = new QFilter("fbilltype", QCP.equals, "er_tripreimburse");
|
|
|
+ nckd_orgamountFilter.and("finterid", QCP.equals, info.getLong("id"));
|
|
|
+ Map<Object, DynamicObject> nckd_cas_arbilMap = BusinessDataServiceHelper.loadFromCache("bos_attachment", new QFilter[]{nckd_orgamountFilter});
|
|
|
+ if(nckd_cas_arbilMap.size()<=0){
|
|
|
throw new KDBizException("请上传费用申请附件!");
|
|
|
}
|
|
|
}
|