|
@@ -10,9 +10,9 @@ import org.apache.commons.lang3.StringUtils;
|
|
|
import com.x.base.core.container.EntityManagerContainer;
|
|
import com.x.base.core.container.EntityManagerContainer;
|
|
|
import com.x.base.core.container.factory.EntityManagerContainerFactory;
|
|
import com.x.base.core.container.factory.EntityManagerContainerFactory;
|
|
|
import com.x.base.core.entity.JpaObject;
|
|
import com.x.base.core.entity.JpaObject;
|
|
|
|
|
+import com.x.base.core.project.annotation.FieldDescribe;
|
|
|
import com.x.base.core.project.bean.WrapCopier;
|
|
import com.x.base.core.project.bean.WrapCopier;
|
|
|
import com.x.base.core.project.bean.WrapCopierFactory;
|
|
import com.x.base.core.project.bean.WrapCopierFactory;
|
|
|
-import com.x.base.core.project.cache.ApplicationCache;
|
|
|
|
|
import com.x.base.core.project.http.ActionResult;
|
|
import com.x.base.core.project.http.ActionResult;
|
|
|
import com.x.base.core.project.http.EffectivePerson;
|
|
import com.x.base.core.project.http.EffectivePerson;
|
|
|
import com.x.base.core.project.logger.Logger;
|
|
import com.x.base.core.project.logger.Logger;
|
|
@@ -22,8 +22,8 @@ import com.x.teamwork.assemble.control.Business;
|
|
|
import com.x.teamwork.core.entity.Project;
|
|
import com.x.teamwork.core.entity.Project;
|
|
|
import com.x.teamwork.core.entity.ProjectDetail;
|
|
import com.x.teamwork.core.entity.ProjectDetail;
|
|
|
import com.x.teamwork.core.entity.ProjectGroup;
|
|
import com.x.teamwork.core.entity.ProjectGroup;
|
|
|
|
|
+import com.x.teamwork.core.entity.Task;
|
|
|
|
|
|
|
|
-import net.sf.ehcache.Element;
|
|
|
|
|
|
|
|
|
|
public class ActionGet extends BaseAction {
|
|
public class ActionGet extends BaseAction {
|
|
|
|
|
|
|
@@ -36,8 +36,14 @@ public class ActionGet extends BaseAction {
|
|
|
ProjectDetail projectDetail = null;
|
|
ProjectDetail projectDetail = null;
|
|
|
List<String> groupIds = null;
|
|
List<String> groupIds = null;
|
|
|
List<ProjectGroup> groups = null;
|
|
List<ProjectGroup> groups = null;
|
|
|
|
|
+ List<Task> taskList = null;
|
|
|
WrapOutControl control = null;
|
|
WrapOutControl control = null;
|
|
|
Boolean check = true;
|
|
Boolean check = true;
|
|
|
|
|
+
|
|
|
|
|
+ Integer taskTotal = 0;
|
|
|
|
|
+ Integer progressTotal = 0;
|
|
|
|
|
+ Integer completedTotal = 0;
|
|
|
|
|
+ Integer overtimeTotal = 0;
|
|
|
|
|
|
|
|
if ( StringUtils.isEmpty( flag ) ) {
|
|
if ( StringUtils.isEmpty( flag ) ) {
|
|
|
check = false;
|
|
check = false;
|
|
@@ -68,6 +74,25 @@ public class ActionGet extends BaseAction {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ if( Boolean.TRUE.equals( check ) ){
|
|
|
|
|
+ taskList = projectQueryService.listAllTasks(flag , true);
|
|
|
|
|
+ if( ListTools.isNotEmpty( taskList )) {
|
|
|
|
|
+ for( Task task : taskList ) {
|
|
|
|
|
+ taskTotal ++;
|
|
|
|
|
+ if( "completed".equalsIgnoreCase(task.getWorkStatus()) ) {
|
|
|
|
|
+ completedTotal++;
|
|
|
|
|
+ }
|
|
|
|
|
+ if( "processing".equalsIgnoreCase(task.getWorkStatus()) ) {
|
|
|
|
|
+ progressTotal++;
|
|
|
|
|
+ }
|
|
|
|
|
+ if( task.getOvertime() ) {
|
|
|
|
|
+ overtimeTotal++;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if( Boolean.TRUE.equals( check ) ){
|
|
if( Boolean.TRUE.equals( check ) ){
|
|
|
try {
|
|
try {
|
|
|
wo = Wo.copier.copy( project );
|
|
wo = Wo.copier.copy( project );
|
|
@@ -89,6 +114,7 @@ public class ActionGet extends BaseAction {
|
|
|
try (EntityManagerContainer bc = EntityManagerContainerFactory.instance().create()) {
|
|
try (EntityManagerContainer bc = EntityManagerContainerFactory.instance().create()) {
|
|
|
business = new Business(bc);
|
|
business = new Business(bc);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
control = new WrapOutControl();
|
|
control = new WrapOutControl();
|
|
|
if( business.isManager(effectivePerson)
|
|
if( business.isManager(effectivePerson)
|
|
|
|| effectivePerson.getDistinguishedName().equalsIgnoreCase( project.getCreatorPerson() )
|
|
|| effectivePerson.getDistinguishedName().equalsIgnoreCase( project.getCreatorPerson() )
|
|
@@ -96,10 +122,20 @@ public class ActionGet extends BaseAction {
|
|
|
control.setDelete( true );
|
|
control.setDelete( true );
|
|
|
control.setEdit( true );
|
|
control.setEdit( true );
|
|
|
control.setSortable( true );
|
|
control.setSortable( true );
|
|
|
|
|
+ control.setCreateable(true);
|
|
|
|
|
+
|
|
|
}else{
|
|
}else{
|
|
|
control.setDelete( false );
|
|
control.setDelete( false );
|
|
|
control.setEdit( false );
|
|
control.setEdit( false );
|
|
|
control.setSortable( false );
|
|
control.setSortable( false );
|
|
|
|
|
+ if(project.getCreateable()){
|
|
|
|
|
+ control.setCreateable(true);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ control.setCreateable(false);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if(project.getDeleted() || project.getCompleted()){
|
|
|
|
|
+ control.setCreateable(false);
|
|
|
}
|
|
}
|
|
|
if(effectivePerson.getDistinguishedName().equalsIgnoreCase( project.getCreatorPerson())){
|
|
if(effectivePerson.getDistinguishedName().equalsIgnoreCase( project.getCreatorPerson())){
|
|
|
control.setFounder( true );
|
|
control.setFounder( true );
|
|
@@ -107,7 +143,11 @@ public class ActionGet extends BaseAction {
|
|
|
control.setFounder( false );
|
|
control.setFounder( false );
|
|
|
}
|
|
}
|
|
|
wo.setControl(control);
|
|
wo.setControl(control);
|
|
|
- //projectCache.put(new Element(cacheKey, wo));
|
|
|
|
|
|
|
+
|
|
|
|
|
+ wo.setProgressTotal(progressTotal);
|
|
|
|
|
+ wo.setCompletedTotal(completedTotal);
|
|
|
|
|
+ wo.setOvertimeTotal(overtimeTotal);
|
|
|
|
|
+ wo.setTaskTotal(taskTotal);
|
|
|
result.setData(wo);
|
|
result.setData(wo);
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
Exception exception = new ProjectQueryException(e, "将查询出来的应用项目信息对象转换为可输出的数据信息时发生异常。");
|
|
Exception exception = new ProjectQueryException(e, "将查询出来的应用项目信息对象转换为可输出的数据信息时发生异常。");
|
|
@@ -122,6 +162,51 @@ public class ActionGet extends BaseAction {
|
|
|
public static class Wo extends WrapOutProject {
|
|
public static class Wo extends WrapOutProject {
|
|
|
|
|
|
|
|
private static final long serialVersionUID = -5076990764713538973L;
|
|
private static final long serialVersionUID = -5076990764713538973L;
|
|
|
|
|
+
|
|
|
|
|
+ @FieldDescribe("所有任务数量")
|
|
|
|
|
+ private Integer taskTotal = 0;
|
|
|
|
|
+
|
|
|
|
|
+ @FieldDescribe("执行中任务数量")
|
|
|
|
|
+ private Integer progressTotal = 0;
|
|
|
|
|
+
|
|
|
|
|
+ @FieldDescribe("已完成任务数量")
|
|
|
|
|
+ private Integer completedTotal = 0;
|
|
|
|
|
+
|
|
|
|
|
+ @FieldDescribe("超时任务数量")
|
|
|
|
|
+ private Integer overtimeTotal = 0;
|
|
|
|
|
+
|
|
|
|
|
+ public Integer getTaskTotal() {
|
|
|
|
|
+ return taskTotal;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public void setTaskTotal(Integer taskTotal) {
|
|
|
|
|
+ this.taskTotal = taskTotal;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public Integer getProgressTotal() {
|
|
|
|
|
+ return progressTotal;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public void setProgressTotal(Integer progressTotal) {
|
|
|
|
|
+ this.progressTotal = progressTotal;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public Integer getCompletedTotal() {
|
|
|
|
|
+ return completedTotal;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public void setCompletedTotal( Integer completedTotal ) {
|
|
|
|
|
+ this.completedTotal = completedTotal;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public Integer getOvertimeTotal() {
|
|
|
|
|
+ return overtimeTotal;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public void setOvertimeTotal( Integer overtimeTotal ) {
|
|
|
|
|
+ this.overtimeTotal = overtimeTotal;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
|
|
|
public static List<String> Excludes = new ArrayList<String>();
|
|
public static List<String> Excludes = new ArrayList<String>();
|
|
|
|
|
|