1.优化合同模板逻辑

S
This commit is contained in:
weiyunlong 2025-01-03 16:52:08 +08:00
parent 6d8065fd16
commit 02e5f43977
3 changed files with 68 additions and 1 deletions

View File

@ -0,0 +1,59 @@
package shkd.repc.recon.formplugin;
import kd.bos.bill.AbstractBillPlugIn;
import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.dataentity.metadata.IDataEntityType;
import kd.bos.entity.datamodel.IDataModel;
import kd.bos.form.IFormView;
import kd.bos.form.events.SetFilterEvent;
import kd.bos.form.field.BasedataEdit;
import kd.bos.form.field.events.BeforeF7SelectEvent;
import kd.bos.form.field.events.BeforeF7SelectListener;
import kd.bos.list.plugin.AbstractListPlugin;
import kd.bos.orm.query.QCP;
import kd.bos.orm.query.QFilter;
import java.util.ArrayList;
import java.util.EventObject;
import java.util.List;
public class ContractTypeListPlugin extends AbstractListPlugin {
// @Override
// public void registerListener(EventObject e) {
// super.registerListener(e);
//
// BasedataEdit control = this.getControl("contemplate");
// control.addBeforeF7SelectListener(this);
// }
// @Override
// public void beforeF7Select(BeforeF7SelectEvent beforeF7SelectEvent) {
//
// String name = beforeF7SelectEvent.getProperty().getName();
// List<QFilter> qFilters = new ArrayList<>();
// if ("contemplate".equals(name)) {
//// qFilters.add(new QFilter("1", QCP.equals, "1"));
// List<QFilter> customQFilters = beforeF7SelectEvent.getCustomQFilters();
// beforeF7SelectEvent.setCustomQFilters(qFilters);
// }
//
// }
@Override
public void setFilter(SetFilterEvent e) {
super.setFilter(e);
IFormView parentView = this.getView().getParentView();
IDataModel model = parentView.getModel();
DynamicObject dataEntity = model.getDataEntity();
IDataEntityType dataEntityType = dataEntity.getDataEntityType();
String name = dataEntityType.getName();
if ("recon_contractbill".equals(name)) {
List<QFilter> qFiletrs = e.getQFilters();
qFiletrs.removeAll(qFiletrs);
qFiletrs.add(new QFilter("status", QCP.equals, "C"));
qFiletrs.add(new QFilter("enable", QCP.equals, "1"));
}
}
}

View File

@ -28,7 +28,7 @@ public class closeTaskPagePlugin implements IApprovalSubPlugin {
if ("zhiyuan".equals(apptype)) {
try {
view.close();
}catch (Exception e) {
}catch (Exception e) {
logger.info("发送指令时异常" + e.getMessage());
throw new RuntimeException(e);
}

View File

@ -34,7 +34,15 @@ public class todoZyTaskServiceHandler extends AbstractMessageServiceHandler {
* @param approvers 人员信息集合
*/
private List<DynamicObject> getApprovers(List<Long> userIds, List<DynamicObject> approvers) {
List<Long> distinctUserIds = new ArrayList<>();
for (Long userId : userIds) {
if (!distinctUserIds.contains(userId)) {
distinctUserIds.add(userId);
}
}
for (Long userId : distinctUserIds) {
DynamicObject user = BusinessDataServiceHelper.loadSingle(userId, "bos_user");
approvers.add(user);
}