From 2452d3781b7296196e60f43351bf6fb844f2ec8d Mon Sep 17 00:00:00 2001 From: o2sword <171715986@qq.com> Date: Tue, 1 Mar 2022 14:55:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=81=E7=A8=8B=E6=96=87=E6=A1=A3=E7=AD=BE?= =?UTF-8?q?=E6=89=B91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- o2server/pom.xml | 4 +- .../jaxrs/attachment/ActionHtmlToImage.java | 7 +- .../core/entity/PersistenceProperties.java | 6 +- .../core/entity/content/DocSign.java | 227 ++++++++++++++++++ .../entity/content/DocSignProperties.java | 33 +++ 5 files changed, 269 insertions(+), 8 deletions(-) create mode 100644 o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/content/DocSign.java create mode 100644 o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/content/DocSignProperties.java diff --git a/o2server/pom.xml b/o2server/pom.xml index 2f022876fb..4581cec201 100644 --- a/o2server/pom.xml +++ b/o2server/pom.xml @@ -1059,7 +1059,7 @@ com.microsoft.playwright playwright - 1.10.0 + 1.17.1 javax.cache @@ -1102,4 +1102,4 @@ http://maven.o2oa.net/repository/o2oa-release/ - \ No newline at end of file + diff --git a/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/attachment/ActionHtmlToImage.java b/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/attachment/ActionHtmlToImage.java index 78c235f897..53fe12d0c9 100644 --- a/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/attachment/ActionHtmlToImage.java +++ b/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/attachment/ActionHtmlToImage.java @@ -240,14 +240,11 @@ class ActionHtmlToImage extends BaseAction { try (Browser browser = browserType.launch(options)) { BrowserContext context = browser.newContext(); Page page = context.newPage(); - page.navigate("file:///Users/chengjian/dev/tmp/html2Image.html"); - //page.setContent("测试一下"); - //Thread.sleep(1000); + page.navigate("file:///Users/chengjian/dev/temp/test.html"); Page.ScreenshotOptions screenshotOptions = new Page.ScreenshotOptions(); screenshotOptions.setFullPage(true); - screenshotOptions.setQuality(80); //screenshotOptions.setQuality(2); - screenshotOptions.setPath(Paths.get("/Users/chengjian/dev/tmp/screenshot-" + browserType.name() + ".jpg")); + screenshotOptions.setPath(Paths.get("/Users/chengjian/dev/temp/screenshot-" + browserType.name() + ".png")); page.screenshot(screenshotOptions); break; } catch (Exception e) { diff --git a/o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/PersistenceProperties.java b/o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/PersistenceProperties.java index 485a0bca88..ecbbc0f23e 100644 --- a/o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/PersistenceProperties.java +++ b/o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/PersistenceProperties.java @@ -17,6 +17,10 @@ public final class PersistenceProperties extends AbstractPersistenceProperties { public static final String table = "PP_C_DRAFT"; } + public static class DocSign { + public static final String table = "PP_C_DOC_SIGN"; + } + public static class TaskCompleted { public static final String table = "PP_C_TASKCOMPLETED"; } @@ -237,4 +241,4 @@ public final class PersistenceProperties extends AbstractPersistenceProperties { public static final String table = "PP_T_SERVICEVALUE"; } } -} \ No newline at end of file +} diff --git a/o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/content/DocSign.java b/o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/content/DocSign.java new file mode 100644 index 0000000000..d9a40d7046 --- /dev/null +++ b/o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/content/DocSign.java @@ -0,0 +1,227 @@ +package com.x.processplatform.core.entity.content; + +import com.x.base.core.entity.JpaObject; +import com.x.base.core.entity.SliceJpaObject; +import com.x.base.core.entity.annotation.CheckPersist; +import com.x.base.core.entity.annotation.ContainerEntity; +import com.x.base.core.project.annotation.FieldDescribe; +import com.x.base.core.project.tools.StringTools; +import com.x.processplatform.core.entity.PersistenceProperties; +import org.apache.commons.lang3.StringUtils; +import org.apache.openjpa.persistence.Persistent; +import org.apache.openjpa.persistence.jdbc.Index; +import org.apache.openjpa.persistence.jdbc.Strategy; + +import javax.persistence.*; +import java.util.Date; + +@Entity +@ContainerEntity(dumpSize = 5, type = ContainerEntity.Type.content, reference = ContainerEntity.Reference.strong) +@Table(name = PersistenceProperties.Content.DocSign.table, uniqueConstraints = { + @UniqueConstraint(name = PersistenceProperties.Content.DocSign.table + JpaObject.IndexNameMiddle + + JpaObject.DefaultUniqueConstraintSuffix, columnNames = { JpaObject.IDCOLUMN, + JpaObject.CREATETIMECOLUMN, JpaObject.UPDATETIMECOLUMN, JpaObject.SEQUENCECOLUMN }) }) +@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS) +public class DocSign extends SliceJpaObject { + + private static final long serialVersionUID = -6321354875403866277L; + + private static final String TABLE = PersistenceProperties.Content.DocSign.table; + + @Override + public String getId() { + return id; + } + + @Override + public void setId(String id) { + this.id = id; + } + + @FieldDescribe("数据库主键,自动生成.") + @Id + @Column(length = length_id, name = ColumnNamePrefix + id_FIELDNAME) + private String id = createId(); + + @Override + public void onPersist() throws Exception { + if (StringTools.utf8Length(this.getProperties().getTitle()) > length_255B) { + this.title = StringTools.utf8SubString(this.getProperties().getTitle(), length_255B - 3) + "..."; + } + } + + @PostLoad + public void postLoad() { + if ((null != this.properties) && StringUtils.isNotEmpty(this.getProperties().getTitle())) { + this.title = this.getProperties().getTitle(); + } + } + + public void setTitle(String title) { + this.title = title; + this.getProperties().setTitle(title); + } + + public String getTitle() { + if ((null != this.properties) && StringUtils.isNotEmpty(this.properties.getTitle())) { + return this.properties.getTitle(); + } else { + return this.title; + } + } + + public DocSign() { + // nothing + } + + public DocSignProperties getProperties() { + if (null == this.properties) { + this.properties = new DocSignProperties(); + } + return this.properties; + } + + public void setProperties(DocSignProperties properties) { + this.properties = properties; + } + + public static final String title_FIELDNAME = "title"; + @FieldDescribe("标题.") + @Column(length = length_255B, name = ColumnNamePrefix + title_FIELDNAME) + @Index(name = TABLE + IndexNameMiddle + title_FIELDNAME) + @CheckPersist(allowEmpty = true) + private String title; + + public static final String application_FIELDNAME = "application"; + @FieldDescribe("应用.") + @Column(length = JpaObject.length_id, name = ColumnNamePrefix + application_FIELDNAME) + @Index(name = TABLE + IndexNameMiddle + application_FIELDNAME) + @CheckPersist(allowEmpty = false) + private String application; + + public static final String process_FIELDNAME = "process"; + @FieldDescribe("流程ID.") + @Column(length = JpaObject.length_id, name = ColumnNamePrefix + process_FIELDNAME) + @Index(name = TABLE + IndexNameMiddle + process_FIELDNAME) + @CheckPersist(allowEmpty = false) + private String process; + + public static final String job_FIELDNAME = "job"; + @FieldDescribe("任务.") + @Column(length = JpaObject.length_id, name = ColumnNamePrefix + job_FIELDNAME) + @Index(name = TABLE + IndexNameMiddle + job_FIELDNAME) + @CheckPersist(allowEmpty = false) + private String job; + + public static final String work_FIELDNAME = "work"; + @FieldDescribe("工作ID.") + @Column(length = JpaObject.length_id, name = ColumnNamePrefix + work_FIELDNAME) + @Index(name = TABLE + IndexNameMiddle + work_FIELDNAME) + @CheckPersist(allowEmpty = false) + private String work; + + public static final String activity_FIELDNAME = "activity"; + @FieldDescribe("活动ID.") + @Column(length = JpaObject.length_id, name = ColumnNamePrefix + activity_FIELDNAME) + @Index(name = TABLE + IndexNameMiddle + activity_FIELDNAME) + @CheckPersist(allowEmpty = false) + private String activity; + + public static final String activityName_FIELDNAME = "activityName"; + @FieldDescribe("活动名称.") + @Column(length = length_255B, name = ColumnNamePrefix + activityName_FIELDNAME) + @Index(name = TABLE + IndexNameMiddle + activityName_FIELDNAME) + @CheckPersist(allowEmpty = true) + private String activityName; + + public static final String person_FIELDNAME = "person"; + @FieldDescribe("当前处理人") + @Column(length = length_255B, name = ColumnNamePrefix + person_FIELDNAME) + @Index(name = TABLE + IndexNameMiddle + person_FIELDNAME) + @CheckPersist(allowEmpty = false) + private String person; + + public static final String commitTime_FIELDNAME = "commitTime"; + @Temporal(TemporalType.TIME) + @FieldDescribe("提交时间.") + @Column(name = ColumnNamePrefix + commitTime_FIELDNAME) + @Index(name = TABLE + IndexNameMiddle + commitTime_FIELDNAME) + @CheckPersist(allowEmpty = true) + private Date commitTime; + + public static final String properties_FIELDNAME = "properties"; + @FieldDescribe("属性对象存储字段.") + @Persistent + @Strategy(JsonPropertiesValueHandler) + @Column(length = JpaObject.length_20M, name = ColumnNamePrefix + properties_FIELDNAME) + @CheckPersist(allowEmpty = true) + private DocSignProperties properties; + + public String getProcess() { + return process; + } + + public void setProcess(String process) { + this.process = process; + } + + public String getApplication() { + return application; + } + + public void setApplication(String application) { + this.application = application; + } + + public String getPerson() { + return person; + } + + public void setPerson(String person) { + this.person = person; + } + + public static long getSerialVersionUID() { + return serialVersionUID; + } + + public String getJob() { + return job; + } + + public void setJob(String job) { + this.job = job; + } + + public String getWork() { + return work; + } + + public void setWork(String work) { + this.work = work; + } + + public String getActivity() { + return activity; + } + + public void setActivity(String activity) { + this.activity = activity; + } + + public String getActivityName() { + return activityName; + } + + public void setActivityName(String activityName) { + this.activityName = activityName; + } + + public Date getCommitTime() { + return commitTime; + } + + public void setCommitTime(Date commitTime) { + this.commitTime = commitTime; + } +} diff --git a/o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/content/DocSignProperties.java b/o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/content/DocSignProperties.java new file mode 100644 index 0000000000..33f0682bba --- /dev/null +++ b/o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/content/DocSignProperties.java @@ -0,0 +1,33 @@ +package com.x.processplatform.core.entity.content; + +import com.x.base.core.entity.JsonProperties; + +/** + * 文件签批扩展信息 + * @author sword + */ +public class DocSignProperties extends JsonProperties { + + private Data data = new Data(); + + private String title; + + public Data getData() { + return data; + } + + public void setData(Data data) { + this.data = data; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + + +} -- GitLab