Browse Source

添加节点类型、标签等

master
陈裕财 4 years ago
parent
commit
fcf8322ed4
  1. 27
      xm-core/src/main/java/com/xm/core/ctrl/XmProductController.java
  2. 13
      xm-core/src/main/java/com/xm/core/ctrl/XmProjectController.java
  3. 3
      xm-core/src/main/java/com/xm/core/service/XmProjectService.java
  4. 4
      xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmProductMapper.xml
  5. 3
      xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmProjectMapper.xml

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

@ -16,6 +16,7 @@ import io.swagger.annotations.*;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -41,8 +42,10 @@ public class XmProductController {
@Autowired @Autowired
private XmProductService xmProductService; private XmProductService xmProductService;
@Value("${mdp.platform-branch-id:platform-branch-001}")
String platformBranchId="platform-branch-001";
@ApiOperation( value = "查询产品表信息列表",notes="listXmProduct,条件之间是 and关系,模糊查询写法如 {studentName:'%才哥%'}") @ApiOperation( value = "查询产品表信息列表",notes="listXmProduct,条件之间是 and关系,模糊查询写法如 {studentName:'%才哥%'}")
@ -85,12 +88,21 @@ public class XmProductController {
} }
} }
xmProduct.put("userid",user.getUserid()); xmProduct.put("userid",user.getUserid());
if( !StringUtils.hasText(queryScope) && !(StringUtils.hasText(id) || StringUtils.hasText(projectId)|| StringUtils.hasText(pmUserid)||ids!=null if( !StringUtils.hasText(queryScope) && !(StringUtils.hasText(id) || StringUtils.hasText(projectId)|| StringUtils.hasText(pmUserid)||ids!=null
||ids!=null ) ){ ||ids!=null ) ){
xmProduct.put("compete",user.getUserid()); xmProduct.put("compete",user.getUserid());
} }
if(!StringUtils.hasText((String) xmProduct.get("isTpl"))){
xmProduct.put("isTpl","0");
}else{
if("1".equals(xmProduct.get("isTpl"))){
xmProduct.remove("branchId");
xmProduct.put("myBranchId",user.getBranchId());
xmProduct.put("platformBranchId",platformBranchId);
}
}
List<Map<String,Object>> xmProductList = xmProductService.selectListMapByWhere(xmProduct); //列出XmProduct列表 List<Map<String,Object>> xmProductList = xmProductService.selectListMapByWhere(xmProduct); //列出XmProduct列表
PageUtils.responePage(m, xmProductList); PageUtils.responePage(m, xmProductList);
m.put("data",xmProductList); m.put("data",xmProductList);
@ -132,6 +144,15 @@ public class XmProductController {
||ids!=null ) ){ ||ids!=null ) ){
xmProduct.put("compete",user.getUserid()); xmProduct.put("compete",user.getUserid());
} }
if(!StringUtils.hasText((String) xmProduct.get("isTpl"))){
xmProduct.put("isTpl","0");
}else{
if("1".equals(xmProduct.get("isTpl"))){
xmProduct.remove("branchId");
xmProduct.put("myBranchId",user.getBranchId());
xmProduct.put("platformBranchId",platformBranchId);
}
}
List<Map<String,Object>> xmProductList = xmProductService.selectListMapByWhereWithState(xmProduct); //列出XmProduct列表 List<Map<String,Object>> xmProductList = xmProductService.selectListMapByWhereWithState(xmProduct); //列出XmProduct列表
PageUtils.responePage(m, xmProductList); PageUtils.responePage(m, xmProductList);
m.put("data",xmProductList); m.put("data",xmProductList);

13
xm-core/src/main/java/com/xm/core/ctrl/XmProjectController.java

@ -25,6 +25,7 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -56,6 +57,9 @@ public class XmProjectController {
@Autowired @Autowired
private XmProjectPhaseService xmProjectPhaseService; private XmProjectPhaseService xmProjectPhaseService;
@Value("${mdp.platform-branch-id:platform-branch-001}")
String platformBranchId="platform-branch-001";
@Autowired @Autowired
private XmTaskService xmTaskService; private XmTaskService xmTaskService;
@ -108,6 +112,15 @@ public class XmProjectController {
xmProject.put("compete",user.getUserid()); xmProject.put("compete",user.getUserid());
} }
if(!StringUtils.hasText((String) xmProject.get("isTpl"))){
xmProject.put("isTpl","0");
}else{
if("1".equals(xmProject.get("isTpl"))){
xmProject.remove("branchId");
xmProject.put("myBranchId",user.getBranchId());
xmProject.put("platformBranchId",platformBranchId);
}
}
List<Map<String,Object>> xmProjectList = xmProjectService.getProject(xmProject); //列出XmProject列表 List<Map<String,Object>> xmProjectList = xmProjectService.getProject(xmProject); //列出XmProject列表
PageUtils.responePage(m, xmProjectList); PageUtils.responePage(m, xmProjectList);
m.put("data",xmProjectList); m.put("data",xmProjectList);

3
xm-core/src/main/java/com/xm/core/service/XmProjectService.java

@ -210,6 +210,9 @@ public class XmProjectService extends BaseService {
xmProjectVo.setCreateTime(new Date()); xmProjectVo.setCreateTime(new Date());
xmProjectVo.setBranchId(user.getBranchId()); xmProjectVo.setBranchId(user.getBranchId());
xmProjectVo.setStatus("0"); xmProjectVo.setStatus("0");
if(!StringUtils.hasText(xmProjectVo.getIsTpl())){
xmProjectVo.setIsTpl("0");
}
XmProject projectDb=new XmProject(); XmProject projectDb=new XmProject();
BeanUtils.copyProperties(xmProjectVo,projectDb); BeanUtils.copyProperties(xmProjectVo,projectDb);
this.insert(projectDb); this.insert(projectDb);

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

@ -32,6 +32,10 @@
</if> </if>
<if test="key != null and key !='' "> and res.product_name like #{key} </if> <if test="key != null and key !='' "> and res.product_name like #{key} </if>
<if test="ctimeStart!=null and ctimeEnd!=null ">and ctime between #{ctimeStart} and #{ctimeEnd}</if> <if test="ctimeStart!=null and ctimeEnd!=null ">and ctime between #{ctimeStart} and #{ctimeEnd}</if>
<if test="isTpl!=null and isTpl=='1'">
and (res.branch_id in( #{platformBranchId},#{myBranchId}) and res.is_tpl='1')
</if>
</where> </where>
</select> </select>

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

@ -127,6 +127,9 @@
) )
</if> </if>
<if test="key != null and key !='' "> and res.name like #{key} </if> <if test="key != null and key !='' "> and res.name like #{key} </if>
<if test="isTpl!=null and isTpl=='1'">
and (res.branch_id in( #{platformBranchId},#{myBranchId}) and res.is_tpl='1')
</if>
</where> </where>
</select> </select>

Loading…
Cancel
Save