ActionList.java 2.3 KB
Newer Older
L
luojing 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
package com.x.teamwork.assemble.control.jaxrs.projectTemplate;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpServletRequest;

import com.x.base.core.entity.JpaObject;
import com.x.base.core.project.bean.WrapCopier;
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.EffectivePerson;
import com.x.base.core.project.logger.Logger;
import com.x.base.core.project.logger.LoggerFactory;
import com.x.base.core.project.tools.ListTools;
import com.x.base.core.project.tools.SortTools;
import com.x.teamwork.core.entity.ProjectGroup;
L
luojing 已提交
19
import com.x.teamwork.core.entity.TaskListTemplate;
L
luojing 已提交
20 21 22 23 24 25 26 27 28 29 30

import net.sf.ehcache.Element;

public class ActionList extends BaseAction {

	private static Logger logger = LoggerFactory.getLogger(ActionList.class);

	@SuppressWarnings("unchecked")
	protected ActionResult<List<Wo>> execute(HttpServletRequest request, EffectivePerson effectivePerson ) throws Exception {
		ActionResult<List<Wo>> result = new ActionResult<>();
		List<Wo> wos = null;
L
luojing 已提交
31
		List<TaskListTemplate> projectGroups = null;
L
luojing 已提交
32 33
		Boolean check = true;

L
luojing 已提交
34 35 36 37 38 39 40 41 42
		/*if( Boolean.TRUE.equals( check ) ){
			try {
				projectGroups = projectGroupQueryService.listGroupByPerson( effectivePerson.getDistinguishedName() );
				if( ListTools.isNotEmpty( projectGroups )) {
					wos = Wo.copier.copy( projectGroups );
					
					SortTools.asc( wos, "createTime");
					
					result.setData(wos);
L
luojing 已提交
43
				}
L
luojing 已提交
44 45 46 47 48
			} catch (Exception e) {
				check = false;
				Exception exception = new ProjectTemplateQueryException(e, "根据用户拥有的项目组信息列表时发生异常。");
				result.error(exception);
				logger.error(e, effectivePerson, request, null);
L
luojing 已提交
49 50
			}
		}*/
L
luojing 已提交
51
		
L
luojing 已提交
52 53 54
		return result;
	}

L
luojing 已提交
55
	public static class Wo extends TaskListTemplate {
L
luojing 已提交
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
		
		private Long rank;

		public Long getRank() {
			return rank;
		}

		public void setRank(Long rank) {
			this.rank = rank;
		}

		private static final long serialVersionUID = -5076990764713538973L;

		public static List<String> Excludes = new ArrayList<String>();

L
luojing 已提交
71
		static WrapCopier<TaskListTemplate, Wo> copier = WrapCopierFactory.wo( TaskListTemplate.class, Wo.class, null, ListTools.toList(JpaObject.FieldsInvisible));
L
luojing 已提交
72 73 74

	}
}