Browse Source

添加节点类型、标签等

master
陈裕财 4 years ago
parent
commit
627c5930d1
  1. 35
      xm-core/src/main/java/com/xm/core/ctrl/XmMenuController.java
  2. 8
      xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmIterationMapper.xml
  3. 8
      xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmMenuMapper.xml
  4. 2
      xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmProjectPhaseMapper.xml
  5. 2
      xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmTaskMapper.xml

35
xm-core/src/main/java/com/xm/core/ctrl/XmMenuController.java

@ -174,40 +174,7 @@ public class XmMenuController {
}
@RequestMapping(value="/listWithPlan",method=RequestMethod.GET)
public Map<String,Object> listWithPlan( @RequestParam Map<String,Object> xmMenu){
Map<String,Object> m = new HashMap<>();
RequestUtils.transformArray(xmMenu, "menuIds");
RequestUtils.transformArray(xmMenu, "tagIdList");
PageUtils.startPage(xmMenu);
Tips tips=new Tips("查询成功");
if(StringUtils.isEmpty(xmMenu.get("projectId"))) {
tips.setFailureMsg("项目编号projectId必传");
}else {
List<Map<String,Object>> xmMenuList = xmMenuService.selectListMapByWhereWithPlan(xmMenu); //列出XmMenu列表
PageUtils.responePage(m, xmMenuList);
if("1".equals(xmMenu.get("withParents")) && !"1".equals(xmMenu.get("isTop"))&& xmMenuList.size()>0){
Set<String> pidPathsSet=new HashSet<>();
Set<String> idSet=new HashSet<>();
for (Map<String, Object> map : xmMenuList) {
String id= (String) map.get("menuId");
idSet.add(id);
String pidPaths= (String) map.get("pidPaths");
pidPathsSet.add(PubTool.getPidPaths(pidPaths,id));
}
if(pidPathsSet!=null && pidPathsSet.size()>0){
List<Map<String,Object>> parentList=xmMenuService.selectListMapByWhereWithPlan(map("pidPathsList",pidPathsSet.stream().collect(Collectors.toList())));
parentList=parentList.stream().filter(i->!idSet.contains(i.get("menuId"))).collect(Collectors.toList());
if(parentList!=null && parentList.size()>0){
xmMenuList.addAll(parentList);
m.put("total", NumberUtil.getInteger(m.get("total"),0)+parentList.size());
}
}
}
m.put("data",xmMenuList);
}
m.put("tips", tips);
return m;
return listWithState(xmMenu);
}
/***/
@ApiOperation( value = "新增一条项目菜单表信息",notes="addXmMenu,主键如果为空,后台自动生成")

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

@ -25,7 +25,7 @@
<if test=" onlineTimeEnd !=null "> and res.online_time &lt; #{onlineTimeEnd} </if>
<include refid="where"/>
<if test=" ( menuId != null and menuId !='')">
and exists ( select 1 from xm_iteration_menu im where im.iteration_id=res.id and im.menu_id=#{menuId}
and exists ( select 1 from xm_menu im where im.iteration_id=res.id and im.menu_id=#{menuId}
<if test="productId != null and productId !='' "> and im.product_id=#{productId} </if>
)
</if>
@ -44,7 +44,7 @@
</if>
<if test="compete !=null and compete!=''">
and ( res.admin_userid=#{compete}
or exists (select 1 from xm_iteration_menu im left join xm_menu m on im.product_id=m.product_id where m.mm_userid=#{compete} and im.iteration_id=res.id)
or exists (select 1 from xm_menu m where m.mm_userid=#{compete} and m.iteration_id=res.id)
)
</if>
@ -71,7 +71,7 @@
<if test=" onlineTimeEnd !=null "> and res.online_time &lt; #{onlineTimeEnd} </if>
<include refid="where"/>
<if test=" ( menuId != null and menuId !='')">
and exists ( select 1 from xm_iteration_menu im where im.iteration_id=res.id and im.menu_id=#{menuId}
and exists ( select 1 from xm_menu im where im.iteration_id=res.id and im.menu_id=#{menuId}
<if test="productId != null and productId !='' "> and im.product_id=#{productId} </if>
)
</if>
@ -90,7 +90,7 @@
</if>
<if test="compete !=null and compete!=''">
and ( res.admin_userid=#{compete}
or exists (select 1 from xm_iteration_menu im left join xm_menu m on im.product_id=m.product_id where m.mm_userid=#{compete} and im.iteration_id=res.id)
or exists (select 1 from xm_menu m where m.mm_userid=#{compete} and m.iteration_id=res.id)
)
</if>
<if test="key != null and key !='' "> and res.iteration_name like #{key} </if>

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

@ -22,8 +22,8 @@
</foreach>
</if>
<if test=' iterationFilterType!=null and iterationFilterType!=""'>
and <if test='iterationFilterType=="not-join"'> not </if>
exists ( select 1 from xm_iteration_menu im where im.menu_id=res.menu_id)
<if test='iterationFilterType=="not-join"'> and (res.iteration_id is null or res.iteration_id ='') </if>
<if test='iterationFilterType!="not-join"'> and res.iteration_id is not null and res.iteration_id !='' </if>
</if>
<if test=' taskFilterType!=null and taskFilterType!="" '>
and <if test='taskFilterType=="not-join"'> not </if>
@ -35,11 +35,11 @@
<select id="selectExistIterationMenus" parameterType="HashMap" resultType="com.xm.core.entity.XmMenu">
select * from xm_menu res
where exists (select 1 from xm_iteration_menu im where im.menu_id in
where res.menu_id in
<foreach collection="menuIds" item="item" index="index" open="(" separator="," close=")" >
#{item}
</foreach>
and im.menu_id = res.menu_id )
and res.iteration_id is not null
</select>
<select id="queryTaskUsersByMenuId" parameterType="HashMap" resultType="HashMap">
select distinct te.userid,te.username,t.executor_userid, t.executor_username from xm_task_execuser te inner join xm_task t on t.id=te.task_id

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

@ -17,7 +17,7 @@
</foreach>
</if>
<if test='iterationId!=null and iterationId!="" '>
and exists( select 1 from xm_task t inner join xm_iteration_menu im on t.menu_id=im.menu_id where t.project_phase_id=res.id and im.iteration_id=#{iterationId})
and exists( select 1 from xm_task t inner join xm_menu im on t.menu_id=im.menu_id where t.project_phase_id=res.id and im.iteration_id=#{iterationId})
</if>
<if test='productId!=null and productId!="" '>
and exists( select 1 from xm_task t where t.product_id=#{productId})

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

@ -51,7 +51,7 @@
</if>
<if test="iterationId!=null and iterationId!=''">
and exists ( select 1 from xm_iteration_menu im where im.menu_id=res.menu_id and im.iteration_id=#{iterationId})
and exists ( select 1 from xm_menu im where im.menu_id=res.menu_id and im.iteration_id=#{iterationId})
</if>
<if test="key != null and key !='' "> and res.name like #{key} </if>
<if test="work != null and work != ''"> and res.rate != '100' </if>

Loading…
Cancel
Save