提交 8b50e885 编写于 作者: R Ray

process 添加ProcessProperties

上级 6aa32ef2
......@@ -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<String> 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<String> 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<String> 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<String> 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<String> 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<String> FieldsDefault = ListUtils
.unmodifiableList(Arrays.asList(id_FIELDNAME, key_FIELDNAME, createTime_FIELDNAME, updateTime_FIELDNAME,
......
......@@ -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<ActionGet.Wo> result = new ActionResult<>();
EffectivePerson effectivePerson = this.effectivePerson(request);
try {
......
......@@ -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<NameValueCountPair> applicationList = new ArrayList<NameValueCountPair>();
private List<NameValueCountPair> applicationList = new ArrayList<>();
@FieldDescribe("可选流程范围")
private List<NameValueCountPair> processList = new ArrayList<NameValueCountPair>();
private List<NameValueCountPair> processList = new ArrayList<>();
@FieldDescribe("可选组织范围")
private List<NameValueCountPair> creatorUnitList = new ArrayList<NameValueCountPair>();
private List<NameValueCountPair> creatorUnitList = new ArrayList<>();
@FieldDescribe("可选择的开始月份")
private List<NameValueCountPair> startTimeMonthList = new ArrayList<NameValueCountPair>();
private List<NameValueCountPair> startTimeMonthList = new ArrayList<>();
@FieldDescribe("可选活动范围")
private List<NameValueCountPair> activityNameList = new ArrayList<NameValueCountPair>();
private List<NameValueCountPair> activityNameList = new ArrayList<>();
@FieldDescribe("可选择的完成状态")
private List<NameValueCountPair> completedList = new ArrayList<>();
public List<NameValueCountPair> getApplicationList() {
return applicationList;
......@@ -96,6 +100,14 @@ class ActionFilterAttribute extends BaseAction {
this.startTimeMonthList = startTimeMonthList;
}
public List<NameValueCountPair> getCompletedList() {
return completedList;
}
public void setCompletedList(List<NameValueCountPair> completedList) {
this.completedList = completedList;
}
}
private List<NameValueCountPair> listApplicationPair(Business business, EffectivePerson effectivePerson)
......@@ -220,4 +232,29 @@ class ActionFilterAttribute extends BaseAction {
return wos;
}
private List<NameValueCountPair> listCompletedPair(Business business, EffectivePerson effectivePerson)
throws Exception {
EntityManager em = business.entityManagerContainer().get(Read.class);
CriteriaBuilder cb = em.getCriteriaBuilder();
CriteriaQuery<Boolean> cq = cb.createQuery(Boolean.class);
Root<Read> root = cq.from(Read.class);
Predicate p = cb.equal(root.get(Read_.person), effectivePerson.getDistinguishedName());
cq.select(root.get(Read_.completed)).where(p);
List<Boolean> os = em.createQuery(cq).getResultList().stream().distinct().collect(Collectors.toList());
List<NameValueCountPair> 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
......@@ -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<String> activityNameList = new ArrayList<>();
@FieldDescribe("可选择的完成状态")
private List<Boolean> completedList = new ArrayList<>();
public List<Boolean> getCompletedList() {
return completedList;
}
public void setCompletedList(List<Boolean> completedList) {
this.completedList = completedList;
}
public List<String> getApplicationList() {
return applicationList;
}
......@@ -123,6 +136,17 @@ class ActionFilterAttributeFilter extends BaseAction {
@FieldDescribe("可选择的活动节点")
private List<NameValueCountPair> activityNameList = new ArrayList<>();
@FieldDescribe("可选择的完成状态")
private List<NameValueCountPair> completedList = new ArrayList<>();
public List<NameValueCountPair> getCompletedList() {
return completedList;
}
public void setCompletedList(List<NameValueCountPair> completedList) {
this.completedList = completedList;
}
public List<NameValueCountPair> 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<String> os = em.createQuery(cq).getResultList().stream().distinct().collect(Collectors.toList());
List<NameValueCountPair> 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<String> os = em.createQuery(cq).getResultList().stream().distinct().collect(Collectors.toList());
List<NameValueCountPair> 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<String> os = em.createQuery(cq).getResultList().stream().distinct().collect(Collectors.toList());
List<NameValueCountPair> 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<String> os = em.createQuery(cq).getResultList().stream().distinct().collect(Collectors.toList());
List<NameValueCountPair> 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<String> os = em.createQuery(cq).getResultList().stream().distinct().collect(Collectors.toList());
List<NameValueCountPair> 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<NameValueCountPair> listCompletedPair(Business business, EffectivePerson effectivePerson, Wi wi)
throws Exception {
EntityManager em = business.entityManagerContainer().get(Read.class);
CriteriaBuilder cb = em.getCriteriaBuilder();
CriteriaQuery<Boolean> cq = cb.createQuery(Boolean.class);
Root<Read> 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<Boolean> os = em.createQuery(cq).getResultList().stream().distinct().collect(Collectors.toList());
List<NameValueCountPair> 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
......@@ -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<NameValueCountPair> completedTimeMonthList = new ArrayList<>();
@FieldDescribe("可选活动范围")
private List<NameValueCountPair> activityNameList = new ArrayList<>();
@FieldDescribe("可选择的完成状态")
private List<NameValueCountPair> completedList = new ArrayList<>();
public List<NameValueCountPair> getApplicationList() {
return applicationList;
......@@ -107,6 +111,14 @@ class ActionFilterAttribute extends BaseAction {
this.startTimeMonthList = startTimeMonthList;
}
public List<NameValueCountPair> getCompletedList() {
return completedList;
}
public void setCompletedList(List<NameValueCountPair> completedList) {
this.completedList = completedList;
}
}
private List<NameValueCountPair> 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<String> list = em.createQuery(cq).getResultList().stream().distinct().collect(Collectors.toList());
;
List<NameValueCountPair> 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<String> list = em.createQuery(cq).getResultList().stream().distinct().collect(Collectors.toList());
;
List<NameValueCountPair> 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<NameValueCountPair> listCompletedPair(Business business, EffectivePerson effectivePerson)
throws Exception {
EntityManager em = business.entityManagerContainer().get(ReadCompleted.class);
CriteriaBuilder cb = em.getCriteriaBuilder();
CriteriaQuery<Boolean> cq = cb.createQuery(Boolean.class);
Root<ReadCompleted> root = cq.from(ReadCompleted.class);
Predicate p = cb.equal(root.get(ReadCompleted_.person), effectivePerson.getDistinguishedName());
cq.select(root.get(ReadCompleted_.completed)).where(p);
List<Boolean> os = em.createQuery(cq).getResultList().stream().distinct().collect(Collectors.toList());
List<NameValueCountPair> 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
......@@ -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<Boolean> getCompletedList() {
return completedList;
}
public void setCompletedList(List<Boolean> completedList) {
this.completedList = completedList;
}
@FieldDescribe("限制应用范围")
private List<String> applicationList = new ArrayList<>();
......@@ -68,6 +79,9 @@ class ActionFilterAttributeFilter extends BaseAction {
@FieldDescribe("限制活动名称范围")
private List<String> activityNameList = new ArrayList<>();
@FieldDescribe("可选择的完成状态")
private List<Boolean> completedList = new ArrayList<>();
public List<String> getApplicationList() {
return applicationList;
}
......@@ -138,6 +152,17 @@ class ActionFilterAttributeFilter extends BaseAction {
@FieldDescribe("可选择的活动节点")
private List<NameValueCountPair> activityNameList = new ArrayList<>();
@FieldDescribe("可选择的完成状态")
private List<NameValueCountPair> completedList = new ArrayList<>();
public List<NameValueCountPair> getCompletedList() {
return completedList;
}
public void setCompletedList(List<NameValueCountPair> completedList) {
this.completedList = completedList;
}
public List<NameValueCountPair> 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<String> 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<String> os = em.createQuery(cq).getResultList().stream().distinct().collect(Collectors.toList());
List<NameValueCountPair> 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<String> os = em.createQuery(cq).getResultList().stream().distinct().collect(Collectors.toList());
List<NameValueCountPair> 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<String> os = em.createQuery(cq).getResultList().stream().distinct().collect(Collectors.toList());
List<NameValueCountPair> 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<String> os = em.createQuery(cq).getResultList().stream().distinct().collect(Collectors.toList());
List<NameValueCountPair> 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<String> os = em.createQuery(cq).getResultList().stream().distinct().collect(Collectors.toList());
List<NameValueCountPair> wos = new ArrayList<>();
......@@ -452,4 +495,49 @@ class ActionFilterAttributeFilter extends BaseAction {
})).collect(Collectors.toList());
return wos;
}
private List<NameValueCountPair> listCompletedPair(Business business, EffectivePerson effectivePerson, Wi wi)
throws Exception {
EntityManager em = business.entityManagerContainer().get(TaskCompleted.class);
CriteriaBuilder cb = em.getCriteriaBuilder();
CriteriaQuery<Boolean> cq = cb.createQuery(Boolean.class);
Root<ReadCompleted> 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<Boolean> os = em.createQuery(cq).getResultList().stream().distinct().collect(Collectors.toList());
List<NameValueCountPair> 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
......@@ -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<String> getControllerList() {
return controllerList;
}
......
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;
}
}
......@@ -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<ActionSyncOrganizationCallbackGet.Wo> 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<ActionSyncOrganizationCallbackPost.Wo> result = new ActionResult<>();
try {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册