Browse Source

添加节点类型、标签等

master
陈裕财 4 years ago
parent
commit
2b9d6bda5e
  1. 20
      xm-core/src/main/java/com/xm/core/ctrl/XmIterationController.java
  2. 17
      xm-core/src/main/java/com/xm/core/service/XmIterationService.java
  3. 24
      xm-core/src/main/java/com/xm/core/vo/XmIterationVo.java
  4. 14
      xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmIterationMapper.xml
  5. 2
      xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmProductProjectLinkMapper.xml
  6. 5
      xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmProjectMapper.xml

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

@ -10,9 +10,11 @@ import com.mdp.qx.HasQx;
import com.mdp.safe.client.entity.User;
import com.mdp.safe.client.utils.LoginUtils;
import com.xm.core.entity.XmIteration;
import com.xm.core.entity.XmIterationLink;
import com.xm.core.service.XmIterationService;
import com.xm.core.service.XmProductService;
import com.xm.core.service.XmRecordService;
import com.xm.core.vo.XmIterationVo;
import io.swagger.annotations.*;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@ -151,7 +153,7 @@ public class XmIterationController {
})
@HasQx(value = "xm_core_xmIteration_add",name = "新增迭代计划",categoryId = "admin-xm",categoryName = "管理端-项目管理系统")
@RequestMapping(value="/add",method=RequestMethod.POST)
public Map<String,Object> addXmIteration(@RequestBody XmIteration xmIteration) {
public Map<String,Object> addXmIteration(@RequestBody XmIterationVo xmIteration) {
Map<String,Object> m = new HashMap<>();
Tips tips=new Tips("成功新增一条数据");
try{
@ -171,7 +173,21 @@ public class XmIterationController {
xmIteration.setCusername(user.getUsername());
xmIteration.setBranchId(user.getBranchId());
xmIteration.setIstatus("0");
xmIterationService.insert(xmIteration);
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","关联类型不能为空");
}
}
}
xmIterationService.addIteration(xmIteration);
xmRecordService.addXmIterationRecord(xmIteration.getId(),"迭代-新增","新增迭代"+xmIteration.getIterationName());
m.put("data",xmIteration);
}catch (BizException e) {

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

@ -1,7 +1,10 @@
package com.xm.core.service;
import com.mdp.core.service.BaseService;
import com.xm.core.vo.XmIterationVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Map;
@ -13,8 +16,9 @@ import java.util.Map;
***/
@Service("xm.core.xmIterationService")
public class XmIterationService extends BaseService {
/** 请在此类添加自定义函数 */
@Autowired
XmIterationLinkService xmIterationLinkService;
/**
* 调用存储过程计算指定迭代的任务预算数据
@ -26,12 +30,19 @@ public class XmIterationService extends BaseService {
/**
* 连同功能关联的状态数据一起带出
* @param xmMenu
* @param iterationMap
* @return
*/
public List<Map<String, Object>> selectListMapByWhereWithState(Map<String, Object> iterationMap) {
// TODO Auto-generated method stub
return this.selectList("selectListMapByWhereWithState", iterationMap);
}
@Transactional
public void addIteration(XmIterationVo xmIteration) {
super.insert(xmIteration);
this.xmIterationLinkService.batchInsert(xmIteration.getLinks());
}
}

24
xm-core/src/main/java/com/xm/core/vo/XmIterationVo.java

@ -1,21 +1,21 @@
package com.xm.core.vo;
import com.xm.core.entity.XmIteration;
import com.xm.core.entity.XmIterationLink;
import java.util.List;
public class XmIterationVo extends XmIteration {
private static final long serialVersionUID = 1534268338972176747L;
/**
* addSub,edit,delete
*/
String opType="";
public String getOpType() {
return opType;
}
public void setOpType(String opType) {
this.opType = opType;
List<XmIterationLink> links;
public List<XmIterationLink> getLinks() {
return links;
}
public void setLinks(List<XmIterationLink> links) {
this.links = links;
}
}

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

@ -36,10 +36,8 @@
)
</if>
<if test=" projectId !=null and projectId!=''">
and exists( select 1 from xm_iteration_link ipl inner join xm_product_project_link ppl
on ipl.pro_id=ppl.product_id
where ppl.project_id=#{projectId} and ipl.iteration_id =res.id
<if test=" productId != null and productId !='' "> and ipl.pro_id=#{productId}</if>
and exists( select 1 from xm_iteration_link ipl
where ipl.pro_id=#{projectId} and ipl.iteration_id =res.id
)
</if>
<if test="compete !=null and compete!=''">
@ -78,14 +76,12 @@
<if test="( productId != null and productId !='') and ( menuId == null or menuId =='') and ( projectId ==null or projectId=='' ) ">
and exists ( select 1 from xm_iteration_link ipl
where ipl.iteration_id=res.id and ipl.pro_id=#{productId}
where ipl.iteration_id=res.id and ipl.pro_id=#{productId} and ipl.ltype='1'
)
</if>
<if test=" projectId !=null and projectId!=''">
and exists( select 1 from xm_iteration_link ipl inner join xm_product_project_link ppl
on ipl.pro_id=ppl.product_id
where ppl.project_id=#{projectId} and ipl.iteration_id =res.id
<if test=" productId != null and productId !='' "> and ipl.pro_id=#{productId}</if>
and exists( select 1 from xm_iteration_link ipl
where ipl.pro_id=#{projectId} and ipl.iteration_id =res.id and ipl.ltype='0'
)
</if>
<if test="compete !=null and compete!=''">

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)
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')
</select>
<!--结束 自定义sql函数区域-->

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

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

Loading…
Cancel
Save