Browse Source

添加节点类型、标签等

master
陈裕财 4 years ago
parent
commit
2cbdafd9aa
  1. 27
      xm-core/src/main/java/com/xm/core/ctrl/XmIterationController.java
  2. 5
      xm-core/src/main/java/com/xm/core/service/XmIterationService.java
  3. 8
      xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmIterationLinkMapper.xml
  4. 3
      xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmMenuMapper.xml
  5. 6
      xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmProductMapper.xml
  6. 2
      xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmProductProjectLinkMapper.xml
  7. 4
      xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmProjectMapper.xml

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

@ -177,30 +177,9 @@ public class XmIterationController {
xmIteration.setIstatus("0");
xmIteration.setAdminUserid(user.getUserid());
xmIteration.setAdminUsername(user.getUsername());
if(xmIteration.getLinks()!=null && xmIteration.getLinks().size()>0){
for (XmIterationLink link : xmIteration.getLinks()) {
link.setIterationId(xmIteration.getId());
link.setCtime(new Date());
link.setLinkStatus("1");
link.setCuserid(user.getUserid());
link.setCusername(user.getUsername());
if(!StringUtils.hasText(link.getLtype())){
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","请上送正确的关联类型");
}
}
}
if(!xmGroupService.checkUserIsPmOrAssByPtype(user.getUserid(),"1",null,xmIteration.getProductId() )){
return ResponseHelper.failed("no-product-qx","您不是产品管理人员,无权将该产品与迭代关联");
};
xmIterationService.addIteration(xmIteration);
xmRecordService.addXmIterationRecord(xmIteration.getId(),"迭代-新增","新增迭代"+xmIteration.getIterationName());
m.put("data",xmIteration);

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

@ -49,7 +49,10 @@ public class XmIterationService extends BaseService {
@Transactional
public void addIteration(XmIterationVo xmIteration) {
super.insert(xmIteration);
this.xmIterationLinkService.batchInsert(xmIteration.getLinks());
if(xmIteration.getLinks()!=null && xmIteration.getLinks().size()>0){
this.xmIterationLinkService.batchInsert(xmIteration.getLinks());
}
}

8
xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmIterationLinkMapper.xml

@ -16,16 +16,16 @@
<select id="listWithProjectInfo" parameterType="HashMap" resultType="HashMap">
select res.*,p.name as project_name,p.id as project_id,i.iteration_name,i.seq_no from xm_iteration_link res inner join xm_project p on res.pro_id=p.id
inner join xm_iteration i on i.id=res.iteration_id
select res.*,p.name as project_name,p.id as project_id from xm_iteration res inner join xm_product_project_link ppl on res.product_id=ppl.product_id
inner join xm_project p on p.id=ppl.project_id
<where>
<include refid="whereForMap"/>
<include refid="where"/>
</where>
order by i.seq_no desc
order by res.seq_no desc
</select>
<select id="listWithProductInfo" parameterType="HashMap" resultType="HashMap">
select res.*,p.product_name,p.id as product_id,i.iteration_name,i.seq_no from xm_iteration_link res inner join xm_product p on res.pro_id=p.id
select res.*,p.product_name,p.id as product_id,i.iteration_name,i.seq_no from xm_iteration i inner join xm_product p on res.pro_id=p.id
inner join xm_iteration i on i.id=res.iteration_id
<where>
<include refid="whereForMap"/>

3
xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmMenuMapper.xml

@ -46,9 +46,6 @@
<if test=" linkProjectId!=null and linkProjectId!=''"> and
exists (select 1 from xm_product_project_link link where link.product_id=res.product_id and link.project_id=#{linkProjectId})
</if>
<if test=" linkIterationId!=null and linkIterationId!=''"> and
exists (select 1 from xm_iteration_link link where link.pro_id=res.product_id and link.iteration_id=#{linkIterationId} and link.ltype='1')
</if>
</sql>
<select id="selectExistIterationMenus" parameterType="HashMap" resultType="com.xm.core.entity.XmMenu">

6
xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmProductMapper.xml

@ -18,8 +18,8 @@
)
</if>
<if test=" iterationId !=null and iterationId!=''">
and exists( select 1 from xm_iteration_link ppl
where ppl.iteration_id=#{iterationId} and ppl.product_id=res.id
and exists( select 1 from xm_iteration ppl
where ppl.id=#{iterationId} and ppl.product_id=res.id
)
</if>
<if test="compete !=null and compete!=''">
@ -50,7 +50,7 @@
)
</if>
<if test="iterationId!=null and iterationId!=''">
and exists( select 1 from xm_iteration_link ipl where ipl.pro_id =res.id and ipl.iteration_id=#{iterationId} )
and exists( select 1 from xm_iteration ipl where ipl.product_id =res.id and ipl.id=#{iterationId} )
</if>
<if test="compete !=null and compete!=''">
and ( exists ( select 1 from xm_group_user gu inner join xm_task t on gu.project_id=t.project_id and t.product_id=res.id where gu.userid=#{compete} and t.product_id=res.id )

2
xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmProductProjectLinkMapper.xml

@ -8,7 +8,7 @@
<select id="selectListByIterationId" parameterType="String" resultType="com.xm.core.entity.XmProductProjectLink">
select * from xm_product_project_link res
where exists (select 1 from xm_iteration_link ipl where ipl.iteration_id=#{iterationId} and ipl.pro_id=res.product_id and ipl.ltype='1')
where exists (select 1 from xm_iteration ipl where ipl.id=#{iterationId} and ipl.product_id=res.product_id)
</select>
<!--结束 自定义sql函数区域-->

4
xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmProjectMapper.xml

@ -55,8 +55,8 @@
)
</if>
<if test="iterationId!=null and iterationId!=''">
and exists( select 1 from xm_iteration_link ipl
where ipl.pro_id =res.id and ipl.iteration_id=#{iterationId} and ipl.ltype='0'
and exists( select 1 from xm_iteration ipl inner join xm_product_project_link l on ipl.product_id=l.product_id
where l.project_id =res.id and ipl.id=#{iterationId}
)
</if>
<if test="key != null and key !='' "> and res.name like #{key} </if>

Loading…
Cancel
Save