提交 0b7599d8 编写于 作者: L luojing

teamwork后台服务

上级 da010299
......@@ -24,10 +24,11 @@ public class ActionProjectConfigGetByProject extends BaseAction {
private static Logger logger = LoggerFactory.getLogger(ActionProjectConfigGetByProject.class);
protected ActionResult<List<Wo>> execute(HttpServletRequest request, EffectivePerson effectivePerson, String id ) throws Exception {
ActionResult<List<Wo>> result = new ActionResult<List<Wo>>();
List<Wo> wo = null;
protected ActionResult<Wo> execute(HttpServletRequest request, EffectivePerson effectivePerson, String id ) throws Exception {
ActionResult<Wo> result = new ActionResult<Wo>();
Wo wo = null;
List<ProjectConfig> projectConfigs = null;
ProjectConfig projectConfig = null;
Boolean check = true;
if ( StringUtils.isEmpty( id ) ) {
......@@ -39,9 +40,10 @@ public class ActionProjectConfigGetByProject extends BaseAction {
if( Boolean.TRUE.equals( check ) ){
try {
projectConfigs = projectConfigQueryService.getProjectConfigByProject( id );
/*if(ListTools.isNotEmpty(projectConfigs)){
if(ListTools.isNotEmpty(projectConfigs)){
projectConfig = projectConfigs.get(0);
}
/*
if ( projectConfig == null) {
check = false;
Exception exception = new ProjectConfigNotExistsException( id );
......@@ -57,13 +59,8 @@ public class ActionProjectConfigGetByProject extends BaseAction {
if( Boolean.TRUE.equals( check ) ){
try {
if(ListTools.isEmpty(projectConfigs)){
wo = new ArrayList<Wo>();
wo = Wo.copier.copy( projectConfig );
result.setData(wo);
}else{
wo = Wo.copier.copy( projectConfigs );
result.setData(wo);
}
} catch (Exception e) {
Exception exception = new ProjectConfigQueryException(e, "将查询出来的项目配置信息对象转换为可输出的数据信息时发生异常。");
......
......@@ -213,7 +213,7 @@ public class GlobalAction extends StandardJaxrsAction {
public void projectConfigGetByProject(@Suspended final AsyncResponse asyncResponse,
@Context HttpServletRequest request,
@JaxrsParameterDescribe("项目ID") @PathParam("id") String id ) {
ActionResult<List<ActionProjectConfigGetByProject.Wo>> result = new ActionResult<>();
ActionResult<ActionProjectConfigGetByProject.Wo> result = new ActionResult<>();
EffectivePerson effectivePerson = this.effectivePerson(request);
try {
result = new ActionProjectConfigGetByProject().execute( request, effectivePerson, id );
......
......@@ -21,6 +21,7 @@ import com.x.base.core.project.logger.LoggerFactory;
import com.x.base.core.project.tools.ListTools;
import com.x.teamwork.assemble.control.Business;
import com.x.teamwork.core.entity.Project;
import com.x.teamwork.core.entity.ProjectConfig;
import com.x.teamwork.core.entity.tools.filter.QueryFilter;
import com.x.teamwork.core.entity.tools.filter.term.InTerm;
......@@ -105,13 +106,34 @@ public class ActionListNextWithFilter extends BaseAction {
try (EntityManagerContainer bc = EntityManagerContainerFactory.instance().create()) {
business = new Business(bc);
}
//查询项目配置信息
List<ProjectConfig> projectConfigs = null;
projectConfigs = projectConfigQueryService.getProjectConfigByProject( project.getId() );
control = new WrapOutControl();
if(ListTools.isNotEmpty(projectConfigs)){
ProjectConfig projectConfig = projectConfigs.get(0);
control.setTaskCreate(projectConfig.getTaskCreate());
control.setTaskCopy(projectConfig.getTaskCopy());
control.setTaskRemove(projectConfig.getTaskRemove());
control.setLaneCreate(projectConfig.getLaneCreate());
control.setLaneEdit(projectConfig.getLaneEdit());
control.setLaneRemove(projectConfig.getLaneRemove());
control.setAttachmentUpload(projectConfig.getAttachmentUpload());
control.setComment(projectConfig.getComment());
}else{
control.setTaskCreate(true);
}
if( business.isManager(effectivePerson)
|| effectivePerson.getDistinguishedName().equalsIgnoreCase( project.getCreatorPerson() )
|| project.getManageablePersonList().contains( effectivePerson.getDistinguishedName() )) {
control.setDelete( true );
control.setEdit( true );
control.setSortable( true );
control.setTaskCreate(true);
}else{
control.setDelete( false );
control.setEdit( false );
......@@ -122,6 +144,9 @@ public class ActionListNextWithFilter extends BaseAction {
}else{
control.setFounder( false );
}
if(project.getDeleted() || project.getCompleted()){
control.setTaskCreate(false);
}
wo.setControl(control);
wos.add( wo );
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册