feat:文件预览测试
This commit is contained in:
parent
df7ac79878
commit
54acfdb315
@ -2,13 +2,18 @@ package com.yem;
|
||||
|
||||
import com.yem.wm.utils.YEM;
|
||||
import kd.bos.bill.AbstractBillPlugIn;
|
||||
import kd.bos.dataentity.entity.DynamicObject;
|
||||
import kd.bos.entity.datamodel.IDataModel;
|
||||
import kd.bos.form.IFormView;
|
||||
import kd.bos.form.events.AfterDoOperationEventArgs;
|
||||
import kd.bos.servicehelper.AttachmentServiceHelper;
|
||||
import kd.bos.servicehelper.workflow.MessageCenterServiceHelper;
|
||||
import kd.bos.workflow.engine.msg.info.MessageInfo;
|
||||
import org.apache.commons.compress.utils.Lists;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@ -22,29 +27,17 @@ public class TestBillPlugin extends AbstractBillPlugIn {
|
||||
public void afterDoOperation(AfterDoOperationEventArgs e) {
|
||||
super.afterDoOperation(e);
|
||||
String operateKey = e.getOperateKey();
|
||||
if ("test_btn".equals(operateKey)) {
|
||||
IDataModel model = this.getModel();
|
||||
IFormView view = this.getView();
|
||||
DynamicObject dataEntity = model.getDataEntity();
|
||||
if ("editfile".equals(operateKey)) {
|
||||
String url = (String) model.getValue("yem_urls");
|
||||
|
||||
}
|
||||
if ("test_sendmsg".equals(operateKey)) {
|
||||
ArrayList<Long> list = Lists.newArrayList();
|
||||
list.add(1995049501487820800L);
|
||||
list.add(1891246179585375232L);
|
||||
// YEM.sendMessage(list, "系统发送", MessageInfo.TYPE_NOTICE, "TEST_MESSAGE_TITLE_1", "TEST_MESSAGE_CONTENT_1", "业务消息");
|
||||
|
||||
MessageInfo message = new MessageInfo();
|
||||
message.setUserIds(list);
|
||||
message.setSenderName("系统发送");
|
||||
message.setType(MessageInfo.TYPE_NOTICE);
|
||||
message.setTitle("TEST_MESSAGE_TITLE_1");
|
||||
message.setContent("TEST_MESSAGE_CONTENT_1");
|
||||
message.setTag("业务消息");
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
Map<String, Object> systemNotice = new HashMap<>();
|
||||
systemNotice.put("showType", 1);
|
||||
params.put("systemNotice", systemNotice);
|
||||
message.setParams(params);
|
||||
MessageCenterServiceHelper.sendMessage(message);
|
||||
// MessageCenterServiceHelper.sendMessage(message);
|
||||
List<Map<String, Object>> attachments = AttachmentServiceHelper.getAttachments("yem_testbill", dataEntity.getPkValue(), "attachmentpanel");
|
||||
if (!attachments.isEmpty()) {
|
||||
String attPkId = (String) attachments.get(0).get("billPkId");
|
||||
view.openUrl(url + attPkId);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user