Browse Source

添加节点类型、标签等

master
陈裕财 4 years ago
parent
commit
ad69633c23
  1. 21
      xm-core/src/main/java/com/xm/core/ctrl/XmIterationController.java
  2. 38
      xm-core/src/main/java/com/xm/core/ctrl/XmIterationLinkController.java
  3. 9
      xm-core/src/main/java/com/xm/core/service/XmIterationLinkService.java
  4. 7
      xm-core/src/main/java/com/xm/core/service/XmIterationService.java

21
xm-core/src/main/java/com/xm/core/ctrl/XmIterationController.java

@ -11,10 +11,7 @@ import com.mdp.safe.client.entity.User;
import com.mdp.safe.client.utils.LoginUtils; import com.mdp.safe.client.utils.LoginUtils;
import com.xm.core.entity.XmIteration; import com.xm.core.entity.XmIteration;
import com.xm.core.entity.XmIterationLink; import com.xm.core.entity.XmIterationLink;
import com.xm.core.service.XmIterationLinkService;
import com.xm.core.service.XmIterationService;
import com.xm.core.service.XmProductService;
import com.xm.core.service.XmRecordService;
import com.xm.core.service.*;
import com.xm.core.vo.XmIterationVo; import com.xm.core.vo.XmIterationVo;
import io.swagger.annotations.*; import io.swagger.annotations.*;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
@ -59,6 +56,10 @@ public class XmIterationController {
@Autowired @Autowired
private XmRecordService xmRecordService; private XmRecordService xmRecordService;
@Autowired
XmGroupService xmGroupService;
@ApiOperation( value = "查询迭代定义信息列表",notes="listXmIteration,条件之间是 and关系,模糊查询写法如 {studentName:'%才哥%'}") @ApiOperation( value = "查询迭代定义信息列表",notes="listXmIteration,条件之间是 and关系,模糊查询写法如 {studentName:'%才哥%'}")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name="id",value="迭代编码,主键",required=false), @ApiImplicitParam(name="id",value="迭代编码,主键",required=false),
@ -188,6 +189,18 @@ public class XmIterationController {
if(!StringUtils.hasText(link.getLtype())){ if(!StringUtils.hasText(link.getLtype())){
return ResponseHelper.failed("ltype-0","关联类型不能为空"); return ResponseHelper.failed("ltype-0","关联类型不能为空");
} }
if("1".equals(link.getLtype())){
if(!xmGroupService.checkUserIsProductAdm(link.getProId(),user.getUserid())){
return ResponseHelper.failed("no-product-qx","您不是产品管理人员,无权将该产品与迭代关联");
};
}else if("0".equals(link.getLtype())){
if(!xmGroupService.checkUserIsProjectAdm(link.getProId(),user.getUserid())){
return ResponseHelper.failed("no-project-qx","您不是项目管理人员,无权将该项目与迭代关联");
};
}else{
return ResponseHelper.failed("ltype-not-0|1","请上送正确的关联类型");
}
} }
} }
xmIterationService.addIteration(xmIteration); xmIterationService.addIteration(xmIteration);

38
xm-core/src/main/java/com/xm/core/ctrl/XmIterationLinkController.java

@ -9,6 +9,9 @@ import com.mdp.core.utils.ResponseHelper;
import com.mdp.safe.client.entity.User; import com.mdp.safe.client.entity.User;
import com.mdp.safe.client.utils.LoginUtils; import com.mdp.safe.client.utils.LoginUtils;
import com.xm.core.entity.XmIterationLink; import com.xm.core.entity.XmIterationLink;
import com.xm.core.service.XmGroupService;
import com.xm.core.service.XmProductService;
import com.xm.core.service.XmProjectService;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -50,9 +53,10 @@ public class XmIterationLinkController {
@Autowired @Autowired
private XmIterationLinkService xmIterationLinkService; private XmIterationLinkService xmIterationLinkService;
@Autowired
XmGroupService xmGroupService;
@ApiOperation( value = "查询迭代表与产品表的关联关系,一般由迭代管理员将迭代挂接到产品表信息列表",notes=" ") @ApiOperation( value = "查询迭代表与产品表的关联关系,一般由迭代管理员将迭代挂接到产品表信息列表",notes=" ")
@ApiResponses({ @ApiResponses({
@ -130,6 +134,18 @@ public class XmIterationLinkController {
return m; return m;
} }
User user= LoginUtils.getCurrentUserInfo(); User user= LoginUtils.getCurrentUserInfo();
if("1".equals(xmIterationLink.getLtype())){
if(!xmGroupService.checkUserIsProductAdm(xmIterationLink.getProId(),user.getUserid())){
return ResponseHelper.failed("no-product-qx","您不是产品管理人员,无权将该产品与迭代关联");
};
}else if("0".equals(xmIterationLink.getLtype())){
if(!xmGroupService.checkUserIsProjectAdm(xmIterationLink.getProId(),user.getUserid())){
return ResponseHelper.failed("no-project-qx","您不是项目管理人员,无权将该项目与迭代关联");
};
}else{
return ResponseHelper.failed("ltype-not-0|1","请上送正确的关联类型");
}
xmIterationLink.setCuserid(user.getUserid()); xmIterationLink.setCuserid(user.getUserid());
xmIterationLink.setCusername(user.getUsername()); xmIterationLink.setCusername(user.getUsername());
xmIterationLink.setCtime(new Date()); xmIterationLink.setCtime(new Date());
@ -162,6 +178,22 @@ public class XmIterationLinkController {
if(StringUtils.isEmpty(xmIterationLink.getProId())) { if(StringUtils.isEmpty(xmIterationLink.getProId())) {
return ResponseHelper.failed("proId-0","请上送产品编号或项目编号"); return ResponseHelper.failed("proId-0","请上送产品编号或项目编号");
} }
xmIterationLink=this.xmIterationLinkService.selectOneObject(xmIterationLink);
if(xmIterationLink==null){
return ResponseHelper.failed("data-0","该关联关系已不存在");
}
User user= LoginUtils.getCurrentUserInfo();
if("1".equals(xmIterationLink.getLtype())){
if(!xmGroupService.checkUserIsProductAdm(xmIterationLink.getProId(),user.getUserid())){
return ResponseHelper.failed("no-product-qx","您不是产品管理人员,无权将该产品移出迭代");
};
}else if("0".equals(xmIterationLink.getLtype())){
if(!xmGroupService.checkUserIsProjectAdm(xmIterationLink.getProId(),user.getUserid())){
return ResponseHelper.failed("no-project-qx","您不是项目管理人员,无权将该项目移出迭代");
};
}else{
return ResponseHelper.failed("ltype-not-0|1","请上送正确的关联类型");
}
xmIterationLinkService.deleteByPk(xmIterationLink); xmIterationLinkService.deleteByPk(xmIterationLink);
}catch (BizException e) { }catch (BizException e) {
tips=e.getTips(); tips=e.getTips();

9
xm-core/src/main/java/com/xm/core/service/XmIterationLinkService.java

@ -1,7 +1,10 @@
package com.xm.core.service; package com.xm.core.service;
import com.mdp.core.entity.Tips;
import com.xm.core.entity.XmIteration;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.mdp.core.service.BaseService; import com.mdp.core.service.BaseService;
@ -15,6 +18,10 @@ import java.util.Map;
***/ ***/
@Service("xm.core.xmIterationLinkService") @Service("xm.core.xmIterationLinkService")
public class XmIterationLinkService extends BaseService { public class XmIterationLinkService extends BaseService {
static Logger logger =LoggerFactory.getLogger(XmIterationLinkService.class); static Logger logger =LoggerFactory.getLogger(XmIterationLinkService.class);
public List<Map<String, Object>> listWithProductInfo(Map<String, Object> xmIterationLink) { public List<Map<String, Object>> listWithProductInfo(Map<String, Object> xmIterationLink) {
@ -26,5 +33,7 @@ public class XmIterationLinkService extends BaseService {
} }
/** 请在此类添加自定义函数 */ /** 请在此类添加自定义函数 */
} }

7
xm-core/src/main/java/com/xm/core/service/XmIterationService.java

@ -1,6 +1,10 @@
package com.xm.core.service; package com.xm.core.service;
import com.mdp.core.entity.Tips;
import com.mdp.core.service.BaseService; import com.mdp.core.service.BaseService;
import com.mdp.safe.client.entity.User;
import com.xm.core.entity.XmIteration;
import com.xm.core.entity.XmProject;
import com.xm.core.vo.XmIterationVo; import com.xm.core.vo.XmIterationVo;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -19,6 +23,9 @@ public class XmIterationService extends BaseService {
@Autowired @Autowired
XmIterationLinkService xmIterationLinkService; XmIterationLinkService xmIterationLinkService;
/** /**
* 调用存储过程计算指定迭代的任务预算数据 * 调用存储过程计算指定迭代的任务预算数据

Loading…
Cancel
Save