diff --git a/o2server/x_base_core_project/src/main/java/com/x/base/core/entity/JpaObject.java b/o2server/x_base_core_project/src/main/java/com/x/base/core/entity/JpaObject.java index 2e3da66c2195005624936262abc123f7472a20db..ebce916c61cd1ee8a1d7e2b09dbe23c1271a3a72 100644 --- a/o2server/x_base_core_project/src/main/java/com/x/base/core/entity/JpaObject.java +++ b/o2server/x_base_core_project/src/main/java/com/x/base/core/entity/JpaObject.java @@ -85,7 +85,7 @@ public abstract class JpaObject extends GsonPropertyObject implements Serializab public static final String scratchInteger_FIELDNAME = "scratchInteger"; - public static final String properties_FIELDNAME = "properties"; + public static final String PROPERTIES_FIELDNAME = "properties"; public static final String JsonPropertiesValueHandler = "com.x.base.core.entity.annotation.JsonPropertiesValueHandler"; @@ -96,7 +96,7 @@ public abstract class JpaObject extends GsonPropertyObject implements Serializab public static final List FieldsUnmodifyIncludePorperties = ListUtils .unmodifiableList(Arrays.asList(id_FIELDNAME, distributeFactor_FIELDNAME, createTime_FIELDNAME, updateTime_FIELDNAME, sequence_FIELDNAME, scratchString_FIELDNAME, scratchBoolean_FIELDNAME, - scratchDate_FIELDNAME, scratchInteger_FIELDNAME, properties_FIELDNAME)); + scratchDate_FIELDNAME, scratchInteger_FIELDNAME, PROPERTIES_FIELDNAME)); public static final List FieldsUnmodifyExcludeId = ListUtils.unmodifiableList(Arrays.asList( distributeFactor_FIELDNAME, createTime_FIELDNAME, updateTime_FIELDNAME, sequence_FIELDNAME, @@ -105,7 +105,7 @@ public abstract class JpaObject extends GsonPropertyObject implements Serializab public static final List FieldsUnmodifyIncludePorpertiesExcludeId = ListUtils .unmodifiableList(Arrays.asList(distributeFactor_FIELDNAME, createTime_FIELDNAME, updateTime_FIELDNAME, sequence_FIELDNAME, scratchString_FIELDNAME, scratchBoolean_FIELDNAME, scratchDate_FIELDNAME, - scratchInteger_FIELDNAME, properties_FIELDNAME)); + scratchInteger_FIELDNAME, PROPERTIES_FIELDNAME)); public static final List FieldsInvisible = ListUtils.unmodifiableList( Arrays.asList(distributeFactor_FIELDNAME, sequence_FIELDNAME, password_FIELDNAME, scratchString_FIELDNAME, @@ -113,7 +113,7 @@ public abstract class JpaObject extends GsonPropertyObject implements Serializab public static final List FieldsInvisibleIncludeProperites = ListUtils.unmodifiableList( Arrays.asList(distributeFactor_FIELDNAME, sequence_FIELDNAME, password_FIELDNAME, scratchString_FIELDNAME, - scratchBoolean_FIELDNAME, scratchDate_FIELDNAME, scratchInteger_FIELDNAME, properties_FIELDNAME)); + scratchBoolean_FIELDNAME, scratchDate_FIELDNAME, scratchInteger_FIELDNAME, PROPERTIES_FIELDNAME)); public static final List FieldsDefault = ListUtils .unmodifiableList(Arrays.asList(id_FIELDNAME, key_FIELDNAME, createTime_FIELDNAME, updateTime_FIELDNAME, diff --git a/o2server/x_meeting_assemble_control/src/main/java/com/x/meeting/assemble/control/jaxrs/attachment/AttachmentAction.java b/o2server/x_meeting_assemble_control/src/main/java/com/x/meeting/assemble/control/jaxrs/attachment/AttachmentAction.java index c1dfb2e58012535f0743e3b958c41a0aa4d09fb5..b309eb2eea8eefc080515da16dabd93b815b4755 100644 --- a/o2server/x_meeting_assemble_control/src/main/java/com/x/meeting/assemble/control/jaxrs/attachment/AttachmentAction.java +++ b/o2server/x_meeting_assemble_control/src/main/java/com/x/meeting/assemble/control/jaxrs/attachment/AttachmentAction.java @@ -44,7 +44,7 @@ public class AttachmentAction extends StandardJaxrsAction { @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) @Consumes(MediaType.APPLICATION_JSON) public void get(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, - @PathParam("id") String id) { + @JaxrsParameterDescribe("附件标识") @PathParam("id") String id) { ActionResult result = new ActionResult<>(); EffectivePerson effectivePerson = this.effectivePerson(request); try { diff --git a/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/read/ActionFilterAttribute.java b/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/read/ActionFilterAttribute.java index a21e954d2097594158089e0bd615268a15ee21ee..1b8441f47e4b22b1dbb955a13a45dfee68b89d53 100644 --- a/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/read/ActionFilterAttribute.java +++ b/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/read/ActionFilterAttribute.java @@ -10,6 +10,7 @@ import javax.persistence.criteria.CriteriaQuery; import javax.persistence.criteria.Predicate; import javax.persistence.criteria.Root; +import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.StringUtils; import com.x.base.core.container.EntityManagerContainer; @@ -38,6 +39,7 @@ class ActionFilterAttribute extends BaseAction { wo.getCreatorUnitList().addAll(this.listCreatorUnitPair(business, effectivePerson)); wo.getStartTimeMonthList().addAll(this.listStartTimeMonthPair(business, effectivePerson)); wo.getActivityNameList().addAll(this.listActivityNamePair(business, effectivePerson)); + wo.getCompletedList().addAll(this.listCompletedPair(business, effectivePerson)); result.setData(wo); return result; } @@ -46,15 +48,17 @@ class ActionFilterAttribute extends BaseAction { public static class Wo extends GsonPropertyObject { @FieldDescribe("可选应用范围") - private List applicationList = new ArrayList(); + private List applicationList = new ArrayList<>(); @FieldDescribe("可选流程范围") - private List processList = new ArrayList(); + private List processList = new ArrayList<>(); @FieldDescribe("可选组织范围") - private List creatorUnitList = new ArrayList(); + private List creatorUnitList = new ArrayList<>(); @FieldDescribe("可选择的开始月份") - private List startTimeMonthList = new ArrayList(); + private List startTimeMonthList = new ArrayList<>(); @FieldDescribe("可选活动范围") - private List activityNameList = new ArrayList(); + private List activityNameList = new ArrayList<>(); + @FieldDescribe("可选择的完成状态") + private List completedList = new ArrayList<>(); public List getApplicationList() { return applicationList; @@ -96,6 +100,14 @@ class ActionFilterAttribute extends BaseAction { this.startTimeMonthList = startTimeMonthList; } + public List getCompletedList() { + return completedList; + } + + public void setCompletedList(List completedList) { + this.completedList = completedList; + } + } private List listApplicationPair(Business business, EffectivePerson effectivePerson) @@ -220,4 +232,29 @@ class ActionFilterAttribute extends BaseAction { return wos; } + private List listCompletedPair(Business business, EffectivePerson effectivePerson) + throws Exception { + EntityManager em = business.entityManagerContainer().get(Read.class); + CriteriaBuilder cb = em.getCriteriaBuilder(); + CriteriaQuery cq = cb.createQuery(Boolean.class); + Root root = cq.from(Read.class); + Predicate p = cb.equal(root.get(Read_.person), effectivePerson.getDistinguishedName()); + cq.select(root.get(Read_.completed)).where(p); + List os = em.createQuery(cq).getResultList().stream().distinct().collect(Collectors.toList()); + List wos = new ArrayList<>(); + for (Boolean value : os) { + NameValueCountPair o = new NameValueCountPair(); + if (BooleanUtils.isTrue(value)) { + o.setValue(Boolean.TRUE); + o.setName("not completed"); + } else { + o.setValue(Boolean.FALSE); + o.setName("completed"); + } + wos.add(o); + } + SortTools.asc(wos, "name"); + return wos; + } + } \ No newline at end of file diff --git a/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/read/ActionFilterAttributeFilter.java b/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/read/ActionFilterAttributeFilter.java index 52fd3ecfbb35f0e04df1e7eaf4bf07e22cd2fa4a..3d0e94f46a183dc6bf0716da45742d3ecebf4f75 100644 --- a/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/read/ActionFilterAttributeFilter.java +++ b/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/read/ActionFilterAttributeFilter.java @@ -12,6 +12,7 @@ import javax.persistence.criteria.CriteriaQuery; import javax.persistence.criteria.Predicate; import javax.persistence.criteria.Root; +import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonElement; @@ -42,6 +43,7 @@ class ActionFilterAttributeFilter extends BaseAction { wo.getCreatorUnitList().addAll(this.listCreatorUnitPair(business, effectivePerson, wi)); wo.getStartTimeMonthList().addAll(this.listStartTimeMonthPair(business, effectivePerson, wi)); wo.getActivityNameList().addAll(this.listActivityNamePair(business, effectivePerson, wi)); + wo.getCompletedList().addAll(this.listCompletedPair(business, effectivePerson, wi)); result.setData(wo); return result; } @@ -64,6 +66,17 @@ class ActionFilterAttributeFilter extends BaseAction { @FieldDescribe("限制活动名称范围") private List activityNameList = new ArrayList<>(); + @FieldDescribe("可选择的完成状态") + private List completedList = new ArrayList<>(); + + public List getCompletedList() { + return completedList; + } + + public void setCompletedList(List completedList) { + this.completedList = completedList; + } + public List getApplicationList() { return applicationList; } @@ -123,6 +136,17 @@ class ActionFilterAttributeFilter extends BaseAction { @FieldDescribe("可选择的活动节点") private List activityNameList = new ArrayList<>(); + @FieldDescribe("可选择的完成状态") + private List completedList = new ArrayList<>(); + + public List getCompletedList() { + return completedList; + } + + public void setCompletedList(List completedList) { + this.completedList = completedList; + } + public List getApplicationList() { return applicationList; } @@ -187,6 +211,9 @@ class ActionFilterAttributeFilter extends BaseAction { if (ListTools.isNotEmpty(wi.getActivityNameList())) { p = cb.and(p, root.get(Read_.activityName).in(wi.getActivityNameList())); } + if (ListTools.isNotEmpty(wi.getCompletedList())) { + p = cb.and(p, root.get(Read_.completed).in(wi.getCompletedList())); + } cq.select(root.get(Read_.application)).where(p); List os = em.createQuery(cq).getResultList().stream().distinct().collect(Collectors.toList()); List wos = new ArrayList<>(); @@ -204,9 +231,10 @@ class ActionFilterAttributeFilter extends BaseAction { wos.add(o); } } - wos = wos.stream().sorted(Comparator.comparing(NameValueCountPair::getName, (s1, s2) -> { - return Objects.toString(s1, "").compareTo(Objects.toString(s2, "")); - })).collect(Collectors.toList()); + wos = wos.stream() + .sorted(Comparator.comparing(NameValueCountPair::getName, + (s1, s2) -> Objects.toString(s1, "").compareTo(Objects.toString(s2, "")))) + .collect(Collectors.toList()); return wos; } @@ -232,6 +260,9 @@ class ActionFilterAttributeFilter extends BaseAction { if (ListTools.isNotEmpty(wi.getActivityNameList())) { p = cb.and(p, root.get(Read_.activityName).in(wi.getActivityNameList())); } + if (ListTools.isNotEmpty(wi.getCompletedList())) { + p = cb.and(p, root.get(Read_.completed).in(wi.getCompletedList())); + } cq.select(root.get(Read_.process)).where(p); List os = em.createQuery(cq).getResultList().stream().distinct().collect(Collectors.toList()); List wos = new ArrayList<>(); @@ -249,9 +280,10 @@ class ActionFilterAttributeFilter extends BaseAction { wos.add(o); } } - wos = wos.stream().sorted(Comparator.comparing(NameValueCountPair::getName, (s1, s2) -> { - return Objects.toString(s1, "").compareTo(Objects.toString(s2, "")); - })).collect(Collectors.toList()); + wos = wos.stream() + .sorted(Comparator.comparing(NameValueCountPair::getName, + (s1, s2) -> Objects.toString(s1, "").compareTo(Objects.toString(s2, "")))) + .collect(Collectors.toList()); return wos; } @@ -277,6 +309,9 @@ class ActionFilterAttributeFilter extends BaseAction { if (ListTools.isNotEmpty(wi.getActivityNameList())) { p = cb.and(p, root.get(Read_.activityName).in(wi.getActivityNameList())); } + if (ListTools.isNotEmpty(wi.getCompletedList())) { + p = cb.and(p, root.get(Read_.completed).in(wi.getCompletedList())); + } cq.select(root.get(Read_.creatorUnit)).where(p); List os = em.createQuery(cq).getResultList().stream().distinct().collect(Collectors.toList()); List wos = new ArrayList<>(); @@ -288,9 +323,10 @@ class ActionFilterAttributeFilter extends BaseAction { wos.add(o); } } - wos = wos.stream().sorted(Comparator.comparing(NameValueCountPair::getName, (s1, s2) -> { - return Objects.toString(s1, "").compareTo(Objects.toString(s2, "")); - })).collect(Collectors.toList()); + wos = wos.stream() + .sorted(Comparator.comparing(NameValueCountPair::getName, + (s1, s2) -> Objects.toString(s1, "").compareTo(Objects.toString(s2, "")))) + .collect(Collectors.toList()); return wos; } @@ -316,6 +352,9 @@ class ActionFilterAttributeFilter extends BaseAction { if (ListTools.isNotEmpty(wi.getActivityNameList())) { p = cb.and(p, root.get(Read_.activityName).in(wi.getActivityNameList())); } + if (ListTools.isNotEmpty(wi.getCompletedList())) { + p = cb.and(p, root.get(Read_.completed).in(wi.getCompletedList())); + } cq.select(root.get(Read_.activityName)).where(p); List os = em.createQuery(cq).getResultList().stream().distinct().collect(Collectors.toList()); List wos = new ArrayList<>(); @@ -327,9 +366,10 @@ class ActionFilterAttributeFilter extends BaseAction { wos.add(o); } } - wos = wos.stream().sorted(Comparator.comparing(NameValueCountPair::getName, (s1, s2) -> { - return Objects.toString(s1, "").compareTo(Objects.toString(s2, "")); - })).collect(Collectors.toList()); + wos = wos.stream() + .sorted(Comparator.comparing(NameValueCountPair::getName, + (s1, s2) -> Objects.toString(s1, "").compareTo(Objects.toString(s2, "")))) + .collect(Collectors.toList()); return wos; } @@ -355,6 +395,9 @@ class ActionFilterAttributeFilter extends BaseAction { if (ListTools.isNotEmpty(wi.getActivityNameList())) { p = cb.and(p, root.get(Read_.activityName).in(wi.getActivityNameList())); } + if (ListTools.isNotEmpty(wi.getCompletedList())) { + p = cb.and(p, root.get(Read_.completed).in(wi.getCompletedList())); + } cq.select(root.get(Read_.startTimeMonth)).where(p); List os = em.createQuery(cq).getResultList().stream().distinct().collect(Collectors.toList()); List wos = new ArrayList<>(); @@ -366,9 +409,52 @@ class ActionFilterAttributeFilter extends BaseAction { wos.add(o); } } - wos = wos.stream().sorted(Comparator.comparing(NameValueCountPair::getName, (s1, s2) -> { - return Objects.toString(s1, "").compareTo(Objects.toString(s2, "")); - })).collect(Collectors.toList()); + wos = wos.stream() + .sorted(Comparator.comparing(NameValueCountPair::getName, + (s1, s2) -> Objects.toString(s1, "").compareTo(Objects.toString(s2, "")))) + .collect(Collectors.toList()); + return wos; + } + + private List listCompletedPair(Business business, EffectivePerson effectivePerson, Wi wi) + throws Exception { + EntityManager em = business.entityManagerContainer().get(Read.class); + CriteriaBuilder cb = em.getCriteriaBuilder(); + CriteriaQuery cq = cb.createQuery(Boolean.class); + Root root = cq.from(Read.class); + Predicate p = cb.equal(root.get(Read_.person), effectivePerson.getDistinguishedName()); + if (ListTools.isNotEmpty(wi.getApplicationList())) { + p = cb.and(p, root.get(Read_.application).in(wi.getApplicationList())); + } + if (ListTools.isNotEmpty(wi.getProcessList())) { + p = cb.and(p, root.get(Read_.process).in(wi.getProcessList())); + } + if (ListTools.isNotEmpty(wi.getCreatorUnitList())) { + p = cb.and(p, root.get(Read_.creatorUnit).in(wi.getCreatorUnitList())); + } + if (ListTools.isNotEmpty(wi.getStartTimeMonthList())) { + p = cb.and(p, root.get(Read_.startTimeMonth).in(wi.getStartTimeMonthList())); + } + if (ListTools.isNotEmpty(wi.getActivityNameList())) { + p = cb.and(p, root.get(Read_.activityName).in(wi.getActivityNameList())); + } + if (ListTools.isNotEmpty(wi.getCompletedList())) { + p = cb.and(p, root.get(Read_.completed).in(wi.getCompletedList())); + } + cq.select(root.get(Read_.completed)).where(p); + List os = em.createQuery(cq).getResultList().stream().distinct().collect(Collectors.toList()); + List wos = new ArrayList<>(); + for (Boolean value : os) { + NameValueCountPair o = new NameValueCountPair(); + if (BooleanUtils.isTrue(value)) { + o.setValue(Boolean.TRUE); + o.setName("not completed"); + } else { + o.setValue(Boolean.FALSE); + o.setName("completed"); + } + wos.add(o); + } return wos; } } \ No newline at end of file diff --git a/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/readcompleted/ActionFilterAttribute.java b/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/readcompleted/ActionFilterAttribute.java index f77f02c318c1460229e2420d0cc9280e0dbe39d4..961e4be98d87037fde445ba7d487fff7e5d9838c 100644 --- a/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/readcompleted/ActionFilterAttribute.java +++ b/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/readcompleted/ActionFilterAttribute.java @@ -10,6 +10,7 @@ import javax.persistence.criteria.CriteriaQuery; import javax.persistence.criteria.Predicate; import javax.persistence.criteria.Root; +import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.StringUtils; import com.x.base.core.container.EntityManagerContainer; @@ -39,6 +40,7 @@ class ActionFilterAttribute extends BaseAction { wo.getStartTimeMonthList().addAll(this.listStartTimeMonthPair(business, effectivePerson)); wo.getCompletedTimeMonthList().addAll(this.listCompletedTimeMonthPair(business, effectivePerson)); wo.getActivityNameList().addAll(this.listActivityNamePair(business, effectivePerson)); + wo.getCompletedList().addAll(this.listCompletedPair(business, effectivePerson)); result.setData(wo); return result; } @@ -58,6 +60,8 @@ class ActionFilterAttribute extends BaseAction { private List completedTimeMonthList = new ArrayList<>(); @FieldDescribe("可选活动范围") private List activityNameList = new ArrayList<>(); + @FieldDescribe("可选择的完成状态") + private List completedList = new ArrayList<>(); public List getApplicationList() { return applicationList; @@ -107,6 +111,14 @@ class ActionFilterAttribute extends BaseAction { this.startTimeMonthList = startTimeMonthList; } + public List getCompletedList() { + return completedList; + } + + public void setCompletedList(List completedList) { + this.completedList = completedList; + } + } private List listApplicationPair(Business business, EffectivePerson effectivePerson) @@ -218,7 +230,6 @@ class ActionFilterAttribute extends BaseAction { Predicate p = cb.equal(root.get(ReadCompleted_.person), effectivePerson.getDistinguishedName()); cq.select(root.get(ReadCompleted_.completedTimeMonth)).where(p); List list = em.createQuery(cq).getResultList().stream().distinct().collect(Collectors.toList()); - ; List wos = new ArrayList<>(); for (String str : list) { if (StringUtils.isNotEmpty(str)) { @@ -241,7 +252,6 @@ class ActionFilterAttribute extends BaseAction { Predicate p = cb.equal(root.get(ReadCompleted_.person), effectivePerson.getDistinguishedName()); cq.select(root.get(ReadCompleted_.startTimeMonth)).where(p); List list = em.createQuery(cq).getResultList().stream().distinct().collect(Collectors.toList()); - ; List wos = new ArrayList<>(); for (String str : list) { if (StringUtils.isNotEmpty(str)) { @@ -254,4 +264,29 @@ class ActionFilterAttribute extends BaseAction { SortTools.desc(wos, "name"); return wos; } + + private List listCompletedPair(Business business, EffectivePerson effectivePerson) + throws Exception { + EntityManager em = business.entityManagerContainer().get(ReadCompleted.class); + CriteriaBuilder cb = em.getCriteriaBuilder(); + CriteriaQuery cq = cb.createQuery(Boolean.class); + Root root = cq.from(ReadCompleted.class); + Predicate p = cb.equal(root.get(ReadCompleted_.person), effectivePerson.getDistinguishedName()); + cq.select(root.get(ReadCompleted_.completed)).where(p); + List os = em.createQuery(cq).getResultList().stream().distinct().collect(Collectors.toList()); + List wos = new ArrayList<>(); + for (Boolean value : os) { + NameValueCountPair o = new NameValueCountPair(); + if (BooleanUtils.isTrue(value)) { + o.setValue(Boolean.TRUE); + o.setName("not completed"); + } else { + o.setValue(Boolean.FALSE); + o.setName("completed"); + } + wos.add(o); + } + SortTools.asc(wos, "name"); + return wos; + } } \ No newline at end of file diff --git a/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/readcompleted/ActionFilterAttributeFilter.java b/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/readcompleted/ActionFilterAttributeFilter.java index c19eacc9598eeb38eb6256550a7a3f9cd548063f..a4ec3d519bebb963adb655e4807ec4b5b1b6dcf1 100644 --- a/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/readcompleted/ActionFilterAttributeFilter.java +++ b/o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/readcompleted/ActionFilterAttributeFilter.java @@ -12,6 +12,7 @@ import javax.persistence.criteria.CriteriaQuery; import javax.persistence.criteria.Predicate; import javax.persistence.criteria.Root; +import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonElement; @@ -26,6 +27,7 @@ import com.x.base.core.project.tools.ListTools; import com.x.processplatform.assemble.surface.Business; import com.x.processplatform.core.entity.content.ReadCompleted; import com.x.processplatform.core.entity.content.ReadCompleted_; +import com.x.processplatform.core.entity.content.TaskCompleted; import com.x.processplatform.core.entity.element.Application; import com.x.processplatform.core.entity.element.Process; @@ -43,6 +45,7 @@ class ActionFilterAttributeFilter extends BaseAction { wo.getStartTimeMonthList().addAll(this.listStartTimeMonthPair(business, effectivePerson, wi)); wo.getCompletedTimeMonthList().addAll(this.listCompletedTimeMonthPair(business, effectivePerson, wi)); wo.getActivityNameList().addAll(this.listActivityNamePair(business, effectivePerson, wi)); + wo.getCompletedList().addAll(this.listCompletedPair(business, effectivePerson, wi)); result.setData(wo); return result; } @@ -50,6 +53,14 @@ class ActionFilterAttributeFilter extends BaseAction { public class Wi extends GsonPropertyObject { + public List getCompletedList() { + return completedList; + } + + public void setCompletedList(List completedList) { + this.completedList = completedList; + } + @FieldDescribe("限制应用范围") private List applicationList = new ArrayList<>(); @@ -68,6 +79,9 @@ class ActionFilterAttributeFilter extends BaseAction { @FieldDescribe("限制活动名称范围") private List activityNameList = new ArrayList<>(); + @FieldDescribe("可选择的完成状态") + private List completedList = new ArrayList<>(); + public List getApplicationList() { return applicationList; } @@ -138,6 +152,17 @@ class ActionFilterAttributeFilter extends BaseAction { @FieldDescribe("可选择的活动节点") private List activityNameList = new ArrayList<>(); + @FieldDescribe("可选择的完成状态") + private List completedList = new ArrayList<>(); + + public List getCompletedList() { + return completedList; + } + + public void setCompletedList(List completedList) { + this.completedList = completedList; + } + public List getApplicationList() { return applicationList; } @@ -213,6 +238,9 @@ class ActionFilterAttributeFilter extends BaseAction { if (ListTools.isNotEmpty(wi.getActivityNameList())) { p = cb.and(p, root.get(ReadCompleted_.activityName).in(wi.getActivityNameList())); } + if (ListTools.isNotEmpty(wi.getCompletedList())) { + p = cb.and(p, root.get(ReadCompleted_.completed).in(wi.getCompletedList())); + } cq.select(root.get(ReadCompleted_.application)).where(p); List os = em.createQuery(cq).getResultList().stream().distinct().collect(Collectors.toList()); ; @@ -262,6 +290,9 @@ class ActionFilterAttributeFilter extends BaseAction { if (ListTools.isNotEmpty(wi.getActivityNameList())) { p = cb.and(p, root.get(ReadCompleted_.activityName).in(wi.getActivityNameList())); } + if (ListTools.isNotEmpty(wi.getCompletedList())) { + p = cb.and(p, root.get(ReadCompleted_.completed).in(wi.getCompletedList())); + } cq.select(root.get(ReadCompleted_.process)).where(p); List os = em.createQuery(cq).getResultList().stream().distinct().collect(Collectors.toList()); List wos = new ArrayList<>(); @@ -310,6 +341,9 @@ class ActionFilterAttributeFilter extends BaseAction { if (ListTools.isNotEmpty(wi.getActivityNameList())) { p = cb.and(p, root.get(ReadCompleted_.activityName).in(wi.getActivityNameList())); } + if (ListTools.isNotEmpty(wi.getCompletedList())) { + p = cb.and(p, root.get(ReadCompleted_.completed).in(wi.getCompletedList())); + } cq.select(root.get(ReadCompleted_.creatorUnit)).where(p); List os = em.createQuery(cq).getResultList().stream().distinct().collect(Collectors.toList()); List wos = new ArrayList<>(); @@ -352,6 +386,9 @@ class ActionFilterAttributeFilter extends BaseAction { if (ListTools.isNotEmpty(wi.getActivityNameList())) { p = cb.and(p, root.get(ReadCompleted_.activityName).in(wi.getActivityNameList())); } + if (ListTools.isNotEmpty(wi.getCompletedList())) { + p = cb.and(p, root.get(ReadCompleted_.completed).in(wi.getCompletedList())); + } cq.select(root.get(ReadCompleted_.activityName)).where(p); List os = em.createQuery(cq).getResultList().stream().distinct().collect(Collectors.toList()); List wos = new ArrayList<>(); @@ -394,6 +431,9 @@ class ActionFilterAttributeFilter extends BaseAction { if (ListTools.isNotEmpty(wi.getActivityNameList())) { p = cb.and(p, root.get(ReadCompleted_.activityName).in(wi.getActivityNameList())); } + if (ListTools.isNotEmpty(wi.getCompletedList())) { + p = cb.and(p, root.get(ReadCompleted_.completed).in(wi.getCompletedList())); + } cq.select(root.get(ReadCompleted_.startTimeMonth)).where(p); List os = em.createQuery(cq).getResultList().stream().distinct().collect(Collectors.toList()); List wos = new ArrayList<>(); @@ -436,6 +476,9 @@ class ActionFilterAttributeFilter extends BaseAction { if (ListTools.isNotEmpty(wi.getActivityNameList())) { p = cb.and(p, root.get(ReadCompleted_.activityName).in(wi.getActivityNameList())); } + if (ListTools.isNotEmpty(wi.getCompletedList())) { + p = cb.and(p, root.get(ReadCompleted_.completed).in(wi.getCompletedList())); + } cq.select(root.get(ReadCompleted_.completedTimeMonth)).where(p); List os = em.createQuery(cq).getResultList().stream().distinct().collect(Collectors.toList()); List wos = new ArrayList<>(); @@ -452,4 +495,49 @@ class ActionFilterAttributeFilter extends BaseAction { })).collect(Collectors.toList()); return wos; } + + private List listCompletedPair(Business business, EffectivePerson effectivePerson, Wi wi) + throws Exception { + EntityManager em = business.entityManagerContainer().get(TaskCompleted.class); + CriteriaBuilder cb = em.getCriteriaBuilder(); + CriteriaQuery cq = cb.createQuery(Boolean.class); + Root root = cq.from(ReadCompleted.class); + Predicate p = cb.equal(root.get(ReadCompleted_.person), effectivePerson.getDistinguishedName()); + if (ListTools.isNotEmpty(wi.getApplicationList())) { + p = cb.and(p, root.get(ReadCompleted_.application).in(wi.getApplicationList())); + } + if (ListTools.isNotEmpty(wi.getProcessList())) { + p = cb.and(p, root.get(ReadCompleted_.process).in(wi.getProcessList())); + } + if (ListTools.isNotEmpty(wi.getCreatorUnitList())) { + p = cb.and(p, root.get(ReadCompleted_.creatorUnit).in(wi.getCreatorUnitList())); + } + if (ListTools.isNotEmpty(wi.getStartTimeMonthList())) { + p = cb.and(p, root.get(ReadCompleted_.startTimeMonth).in(wi.getStartTimeMonthList())); + } + if (ListTools.isNotEmpty(wi.getCompletedTimeMonthList())) { + p = cb.and(p, root.get(ReadCompleted_.completedTimeMonth).in(wi.getCompletedTimeMonthList())); + } + if (ListTools.isNotEmpty(wi.getActivityNameList())) { + p = cb.and(p, root.get(ReadCompleted_.activityName).in(wi.getActivityNameList())); + } + if (ListTools.isNotEmpty(wi.getCompletedList())) { + p = cb.and(p, root.get(ReadCompleted_.completed).in(wi.getCompletedList())); + } + cq.select(root.get(ReadCompleted_.completed)).where(p); + List os = em.createQuery(cq).getResultList().stream().distinct().collect(Collectors.toList()); + List wos = new ArrayList<>(); + for (Boolean value : os) { + NameValueCountPair o = new NameValueCountPair(); + if (BooleanUtils.isTrue(value)) { + o.setValue(Boolean.TRUE); + o.setName("not completed"); + } else { + o.setValue(Boolean.FALSE); + o.setName("completed"); + } + wos.add(o); + } + return wos; + } } \ No newline at end of file diff --git a/o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/element/Process.java b/o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/element/Process.java index f8f156bf5fac577a37586e57d9f0712ff46e458d..47535bacaf9ebb44a235f1b3df43af768ae0cd47 100644 --- a/o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/element/Process.java +++ b/o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/element/Process.java @@ -14,7 +14,9 @@ import javax.persistence.Inheritance; import javax.persistence.InheritanceType; import javax.persistence.Lob; import javax.persistence.OrderColumn; +import javax.persistence.PostLoad; import javax.persistence.Table; +import javax.persistence.Transient; import javax.persistence.UniqueConstraint; import org.apache.commons.lang3.BooleanUtils; @@ -147,7 +149,30 @@ public class Process extends SliceJpaObject { } public Boolean getRouteNameAsOpinion() { - return BooleanUtils.isFalse(routeNameAsOpinion) ? false : true; + return !BooleanUtils.isFalse(routeNameAsOpinion); + } + + public ProcessProperties getProperties() { + if (null == this.properties) { + this.properties = new ProcessProperties(); + } + return this.properties; + } + + public void setProperties(ProcessProperties properties) { + this.properties = properties; + } + + @PostLoad + public void postLoad() { + if (null != this.properties) { + this.manualBeforeTaskScript = this.getProperties().getManualBeforeTaskScript(); + this.manualBeforeTaskScriptText = this.getProperties().getManualBeforeTaskScriptText(); + this.manualAfterTaskScript = this.getProperties().getManualAfterTaskScript(); + this.manualAfterTaskScriptText = this.getProperties().getManualAfterTaskScriptText(); + this.manualStayScript = this.getProperties().getManualStayScript(); + this.manualStayScriptText = this.getProperties().getManualStayScriptText(); + } } public static final String name_FIELDNAME = "name"; @@ -336,13 +361,13 @@ public class Process extends SliceJpaObject { @CheckPersist(allowEmpty = true) private Boolean expireWorkTime; - public static final String expireScript_FIELDNAME = "expireScript"; - @IdReference(Script.class) - /** 脚本可能使用名称,所以长度为255 */ - @FieldDescribe("过期时间设定脚本.") - @Column(length = length_255B, name = ColumnNamePrefix + expireScript_FIELDNAME) - @CheckPersist(allowEmpty = true) - private String expireScript; +// public static final String expireScript_FIELDNAME = "expireScript"; +// @IdReference(Script.class) +// /** 脚本可能使用名称,所以长度为255 */ +// @FieldDescribe("过期时间设定脚本.") +// @Column(length = length_255B, name = ColumnNamePrefix + expireScript_FIELDNAME) +// @CheckPersist(allowEmpty = true) +// private String expireScript; // public static final String expireScriptText_FIELDNAME = "expireScriptText"; // @FieldDescribe("过期时间设定脚本文本.") @@ -505,6 +530,91 @@ public class Process extends SliceJpaObject { @Column(length = JpaObject.length_16B, name = ColumnNamePrefix + defaultStartMode_FIELDNAME) private String defaultStartMode; + @FieldDescribe("属性对象存储字段.") + @Persistent + @Strategy(JsonPropertiesValueHandler) + @Column(length = JpaObject.length_10M, name = ColumnNamePrefix + PROPERTIES_FIELDNAME) + @CheckPersist(allowEmpty = true) + private ProcessProperties properties; + + public String getManualBeforeTaskScript() { + return manualBeforeTaskScript; + } + + public void setManualBeforeTaskScript(String manualBeforeTaskScript) { + this.getProperties().setManualBeforeTaskScript(manualBeforeTaskScript); + this.manualBeforeTaskScript = manualBeforeTaskScript; + } + + public void setManualBeforeTaskScriptText(String manualBeforeTaskScriptText) { + this.getProperties().setManualBeforeTaskScriptText(manualBeforeTaskScriptText); + this.manualBeforeTaskScriptText = manualBeforeTaskScriptText; + } + + public void setManualAfterTaskScript(String manualAfterTaskScript) { + this.getProperties().setManualAfterTaskScript(manualAfterTaskScript); + this.manualAfterTaskScript = manualAfterTaskScript; + } + + public void setManualAfterTaskScriptText(String manualAfterTaskScriptText) { + this.getProperties().setManualAfterTaskScriptText(manualAfterTaskScriptText); + this.manualAfterTaskScriptText = manualAfterTaskScriptText; + } + + public void setManualStayScript(String manualStayScript) { + this.getProperties().setManualStayScript(manualStayScript); + this.manualStayScript = manualStayScript; + } + + public void setManualStayScriptText(String manualStayScriptText) { + this.getProperties().setManualStayScriptText(manualStayScriptText); + this.manualStayScriptText = manualStayScriptText; + } + + public String getManualBeforeTaskScriptText() { + return manualBeforeTaskScriptText; + } + + public String getManualAfterTaskScript() { + return manualAfterTaskScript; + } + + public String getManualAfterTaskScriptText() { + return manualAfterTaskScriptText; + } + + public String getManualStayScript() { + return manualStayScript; + } + + public String getManualStayScriptText() { + return manualStayScriptText; + } + + @FieldDescribe("待办执行前脚本.") + @Transient + private String manualBeforeTaskScript; + + @FieldDescribe("待办执行前脚本文本.") + @Transient + private String manualBeforeTaskScriptText; + + @FieldDescribe("待办执行后脚本.") + @Transient + private String manualAfterTaskScript; + + @FieldDescribe("待办执行后脚本文本.") + @Transient + private String manualAfterTaskScriptText; + + @FieldDescribe("人工活动有停留脚本.") + @Transient + private String manualStayScript; + + @FieldDescribe("人工活动有停留脚本文本.") + @Transient + private String manualStayScriptText; + /* flag标志位 */ public String getName() { @@ -559,14 +669,6 @@ public class Process extends SliceJpaObject { this.application = application; } -// public String getBeforeBeginScript() { -// return beforeBeginScript; -// } -// -// public void setBeforeBeginScript(String beforeBeginScript) { -// this.beforeBeginScript = beforeBeginScript; -// } - public String getAfterEndScript() { return afterEndScript; } @@ -599,14 +701,6 @@ public class Process extends SliceJpaObject { this.startableUnitList = startableUnitList; } -// public String getBeforeBeginScriptText() { -// return beforeBeginScriptText; -// } -// -// public void setBeforeBeginScriptText(String beforeBeginScriptText) { -// this.beforeBeginScriptText = beforeBeginScriptText; -// } - public String getAfterBeginScript() { return afterBeginScript; } @@ -623,22 +717,6 @@ public class Process extends SliceJpaObject { this.afterBeginScriptText = afterBeginScriptText; } -// public String getBeforeEndScript() { -// return beforeEndScript; -// } -// -// public void setBeforeEndScript(String beforeEndScript) { -// this.beforeEndScript = beforeEndScript; -// } -// -// public String getBeforeEndScriptText() { -// return beforeEndScriptText; -// } -// -// public void setBeforeEndScriptText(String beforeEndScriptText) { -// this.beforeEndScriptText = beforeEndScriptText; -// } - public String getAfterEndScriptText() { return afterEndScriptText; } @@ -703,22 +781,6 @@ public class Process extends SliceJpaObject { this.expireWorkTime = expireWorkTime; } - public String getExpireScript() { - return expireScript; - } - - public void setExpireScript(String expireScript) { - this.expireScript = expireScript; - } - -// public String getExpireScriptText() { -// return expireScriptText; -// } -// -// public void setExpireScriptText(String expireScriptText) { -// this.expireScriptText = expireScriptText; -// } - public List getControllerList() { return controllerList; } diff --git a/o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/element/ProcessProperties.java b/o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/element/ProcessProperties.java new file mode 100644 index 0000000000000000000000000000000000000000..9b41227e0d735f4cb502814ce327a3eac4e7de36 --- /dev/null +++ b/o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/element/ProcessProperties.java @@ -0,0 +1,78 @@ +package com.x.processplatform.core.entity.element; + +import com.x.base.core.entity.JsonProperties; +import com.x.base.core.project.annotation.FieldDescribe; + +public class ProcessProperties extends JsonProperties { + + private static final long serialVersionUID = 1L; + + @FieldDescribe("待办执行前脚本.") + private String manualBeforeTaskScript; + + @FieldDescribe("待办执行前脚本文本.") + private String manualBeforeTaskScriptText; + + @FieldDescribe("待办执行后脚本.") + private String manualAfterTaskScript; + + @FieldDescribe("待办执行后脚本文本.") + private String manualAfterTaskScriptText; + + @FieldDescribe("人工活动有停留脚本.") + private String manualStayScript; + + @FieldDescribe("人工活动有停留脚本文本.") + private String manualStayScriptText; + + public String getManualBeforeTaskScript() { + return manualBeforeTaskScript; + } + + public void setManualBeforeTaskScript(String manualBeforeTaskScript) { + this.manualBeforeTaskScript = manualBeforeTaskScript; + } + + public String getManualBeforeTaskScriptText() { + return manualBeforeTaskScriptText; + } + + public void setManualBeforeTaskScriptText(String manualBeforeTaskScriptText) { + this.manualBeforeTaskScriptText = manualBeforeTaskScriptText; + } + + public String getManualAfterTaskScript() { + return manualAfterTaskScript; + } + + public void setManualAfterTaskScript(String manualAfterTaskScript) { + this.manualAfterTaskScript = manualAfterTaskScript; + } + + public String getManualAfterTaskScriptText() { + return manualAfterTaskScriptText; + } + + public void setManualAfterTaskScriptText(String manualAfterTaskScriptText) { + this.manualAfterTaskScriptText = manualAfterTaskScriptText; + } + + public String getManualStayScript() { + return manualStayScript; + } + + public void setManualStayScript(String manualStayScript) { + this.manualStayScript = manualStayScript; + } + + public String getManualStayScriptText() { + return manualStayScriptText; + } + + public void setManualStayScriptText(String manualStayScriptText) { + this.manualStayScriptText = manualStayScriptText; + } + + + +} diff --git a/o2server/x_program_center/src/main/java/com/x/program/center/jaxrs/qiyeweixin/QiyeweixinAction.java b/o2server/x_program_center/src/main/java/com/x/program/center/jaxrs/qiyeweixin/QiyeweixinAction.java index 376eb3c79da6b51bf58467157d47ee8da4bb69cf..4c84b23a1c070ebcde41c5f628b89275676cc030 100644 --- a/o2server/x_program_center/src/main/java/com/x/program/center/jaxrs/qiyeweixin/QiyeweixinAction.java +++ b/o2server/x_program_center/src/main/java/com/x/program/center/jaxrs/qiyeweixin/QiyeweixinAction.java @@ -15,6 +15,7 @@ import javax.ws.rs.core.MediaType; import com.google.gson.JsonElement; import com.x.base.core.project.annotation.JaxrsDescribe; import com.x.base.core.project.annotation.JaxrsMethodDescribe; +import com.x.base.core.project.annotation.JaxrsParameterDescribe; import com.x.base.core.project.http.ActionResult; import com.x.base.core.project.http.EffectivePerson; import com.x.base.core.project.http.HttpMediaType; @@ -85,9 +86,11 @@ public class QiyeweixinAction extends StandardJaxrsAction { @JaxrsMethodDescribe(value = "接收企业微信通讯录变更回调的验证请求.", action = ActionSyncOrganizationCallbackGet.class) @GET public void syncOrganizationCallbackGet(@Suspended final AsyncResponse asyncResponse, - @Context HttpServletRequest request, @QueryParam("msg_signature") String msg_signature, - @QueryParam("timestamp") String timestamp, @QueryParam("nonce") String nonce, - @QueryParam("echostr") String echostr) { + @Context HttpServletRequest request, + @JaxrsParameterDescribe("msg_signature") @QueryParam("msg_signature") String msg_signature, + @JaxrsParameterDescribe("timestamp") @QueryParam("timestamp") String timestamp, + @JaxrsParameterDescribe("nonce") @QueryParam("nonce") String nonce, + @JaxrsParameterDescribe("echostr") @QueryParam("echostr") String echostr) { EffectivePerson effectivePerson = this.effectivePerson(request); ActionResult result = new ActionResult<>(); try { @@ -103,8 +106,10 @@ public class QiyeweixinAction extends StandardJaxrsAction { @JaxrsMethodDescribe(value = "接收企业微信通讯录变更回调.", action = ActionSyncOrganizationCallbackPost.class) @POST public void syncOrganizationCallbackPost(@Suspended final AsyncResponse asyncResponse, - @Context HttpServletRequest request, @QueryParam("msg_signature") String msg_signature, - @QueryParam("timestamp") String timestamp, @QueryParam("nonce") String nonce, String body) { + @Context HttpServletRequest request, + @JaxrsParameterDescribe("msg_signature") @QueryParam("msg_signature") String msg_signature, + @JaxrsParameterDescribe("timestamp") @QueryParam("timestamp") String timestamp, + @JaxrsParameterDescribe("nonce") @QueryParam("nonce") String nonce, String body) { EffectivePerson effectivePerson = this.effectivePerson(request); ActionResult result = new ActionResult<>(); try {