|
@@ -0,0 +1,90 @@
|
|
|
+package kd.bos.newdevportal.table;
|
|
|
+
|
|
|
+import kd.bos.dataentity.entity.DynamicObject;
|
|
|
+import kd.bos.dataentity.entity.DynamicObjectCollection;
|
|
|
+import kd.bos.db.DBRoute;
|
|
|
+import kd.bos.entity.datamodel.events.PropertyChangedArgs;
|
|
|
+import kd.bos.form.events.AfterDoOperationEventArgs;
|
|
|
+
|
|
|
+import kd.bos.list.plugin.AbstractListPlugin;
|
|
|
+import kd.bos.newdevportal.table.DesignerTable;
|
|
|
+import kd.bos.newdevportal.table.TableManagerListPlugin;
|
|
|
+import java.util.Collections;
|
|
|
+import java.util.Iterator;
|
|
|
+import java.util.Map;
|
|
|
+import kd.bos.dataentity.utils.StringUtils;
|
|
|
+import kd.bos.db.DB;
|
|
|
+import kd.bos.db.DBRoute;
|
|
|
+import kd.bos.entity.EntityMetadataCache;
|
|
|
+import kd.bos.entity.datamodel.ListSelectedRow;
|
|
|
+import kd.bos.entity.datamodel.ListSelectedRowCollection;
|
|
|
+import kd.bos.form.control.events.ItemClickEvent;
|
|
|
+import kd.bos.list.BillList;
|
|
|
+import kd.bos.metadata.dao.MetadataDao;
|
|
|
+import kd.bos.orm.query.QCP;
|
|
|
+import kd.bos.orm.query.QFilter;
|
|
|
+import kd.bos.servicehelper.BusinessDataServiceHelper;
|
|
|
+import kd.scm.bid.formplugin.report.biddetailquery.QingFiledContent;
|
|
|
+import sys.sc.opplugin.utils.DatFileCreatUtils;
|
|
|
+
|
|
|
+import java.util.*;
|
|
|
+import java.util.stream.Collectors;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ * @author cjz
|
|
|
+ * @date 2024/9/18 11:30
|
|
|
+ * @description:数据表基础资料,选择数据表带出数据表信息
|
|
|
+ */
|
|
|
+ public class TableDataBasicPlugin extends AbstractListPlugin {
|
|
|
+
|
|
|
+ private static String nckd_tabledatabasic="nckd_tabledatabasic";
|
|
|
+
|
|
|
+
|
|
|
+ public void propertyChanged(PropertyChangedArgs e){
|
|
|
+ super.beforePropertyChanged(e);
|
|
|
+ String name=e.getProperty().getName();
|
|
|
+ if (nckd_tabledatabasic.equals(name)) {
|
|
|
+
|
|
|
+ this.getModel().deleteEntryData("nckd_tableentry");
|
|
|
+
|
|
|
+ DynamicObject data=this.getModel().getDataEntity(true);
|
|
|
+
|
|
|
+ DynamicObject tabledatabasic=data.getDynamicObject(nckd_tabledatabasic);
|
|
|
+
|
|
|
+ String bizappnumber=tabledatabasic.getString("nckd_bizapp.number");
|
|
|
+
|
|
|
+ this.getModel().setValue("number",tabledatabasic.getString("tablename"));
|
|
|
+
|
|
|
+ this.getModel().setValue("nckd_biazppnum",bizappnumber);
|
|
|
+
|
|
|
+ this.getModel().setValue("name",tabledatabasic.getString("nckd_entity.name"));
|
|
|
+ DBTableProviderNew provider =new DBTableProviderNew();
|
|
|
+
|
|
|
+ provider.setRoute(DBRoute.of("sys"));
|
|
|
+ Map<String, DesignerTable> tableMap =provider
|
|
|
+ .getTableInfo_youhua(Collections.singletonList(tabledatabasic.getString("tablename")),
|
|
|
+ Collections.singletonList(tabledatabasic.getString("id")));
|
|
|
+ for (Map.Entry<String, DesignerTable> table : tableMap.entrySet()) {
|
|
|
+
|
|
|
+ String tablename = table.getKey();
|
|
|
+ DesignerTable designerTable = table.getValue();
|
|
|
+ String comment = designerTable.getName();
|
|
|
+
|
|
|
+ Iterator fields = designerTable.getCols().iterator();
|
|
|
+ while(fields.hasNext()) {
|
|
|
+ DesignerColumn col = (DesignerColumn)fields.next();
|
|
|
+ String f_fieldkey = col.getCode();
|
|
|
+ String f_fieldname = col.getName();
|
|
|
+
|
|
|
+ int rowIndex = this.getModel().createNewEntryRow("nckd_tableentry");
|
|
|
+
|
|
|
+ this.getModel().setValue("nckd_entrycode",f_fieldkey,rowIndex);
|
|
|
+
|
|
|
+ this.getModel().setValue("nckd_entryname",f_fieldname,rowIndex);
|
|
|
+ this.getModel().setValue("nckd_isable",1,rowIndex);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|