Browse Source

添加节点类型、标签等

master
陈裕财 4 years ago
parent
commit
67f31e5323
  1. 20
      xm-core/src/main/java/com/xm/core/service/XmProductService.java
  2. 15
      xm-core/src/main/java/com/xm/core/service/XmProjectService.java

20
xm-core/src/main/java/com/xm/core/service/XmProductService.java

@ -7,6 +7,7 @@ import com.xm.core.entity.*;
import com.xm.core.service.cache.XmProductCacheService; import com.xm.core.service.cache.XmProductCacheService;
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.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
@ -21,8 +22,10 @@ import java.util.stream.Collectors;
***/ ***/
@Service("xm.core.xmProductService") @Service("xm.core.xmProductService")
public class XmProductService extends BaseService { public class XmProductService extends BaseService {
/** 请在此类添加自定义函数 */
@Value("${mdp.platform-branch-id:platform-branch-001}")
String platformBranchId="platform-branch-001";
@Autowired @Autowired
XmProjectService xmProjectService; XmProjectService xmProjectService;
@ -43,6 +46,8 @@ public class XmProductService extends BaseService {
@Autowired @Autowired
XmProjectPhaseService xmProjectPhaseService; XmProjectPhaseService xmProjectPhaseService;
/** /**
* 产品不直接根项目关联此函数作废了 * 产品不直接根项目关联此函数作废了
@ -89,6 +94,17 @@ public class XmProductService extends BaseService {
if(xmProductDb==null){ if(xmProductDb==null){
throw new BizException("产品不存在"); throw new BizException("产品不存在");
} }
if(!"1".equals(xmProductDb.getIsTpl())){
if(!user.getBranchId().equals(xmProductDb.getBranchId())){
throw new BizException("您无权复制其它组织的产品。");
}
}else{
if(!user.getBranchId().equals(xmProductDb.getBranchId())){
if(!platformBranchId.equals(xmProductDb.getBranchId())){
throw new BizException("您无权复制其它组织的产品");
}
}
}
String isTpl=xmProduct.getIsTpl(); String isTpl=xmProduct.getIsTpl();
XmProduct xmProductTo=new XmProduct(); XmProduct xmProductTo=new XmProduct();
BeanUtils.copyProperties(xmProductDb,xmProductTo); BeanUtils.copyProperties(xmProductDb,xmProductTo);

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

@ -15,6 +15,7 @@ import com.xm.core.vo.XmProjectCopyVo;
import com.xm.core.vo.XmProjectVo; import com.xm.core.vo.XmProjectVo;
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.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
@ -31,6 +32,8 @@ import java.util.*;
public class XmProjectService extends BaseService { public class XmProjectService extends BaseService {
@Value("${mdp.platform-branch-id:platform-branch-001}")
String platformBranchId="platform-branch-001";
@Autowired @Autowired
@ -78,6 +81,18 @@ public class XmProjectService extends BaseService {
if(xmProjectDb==null){ if(xmProjectDb==null){
return null; return null;
} }
if(!"1".equals(xmProjectDb.getIsTpl())){
if(!user.getBranchId().equals(xmProjectDb.getBranchId())){
throw new BizException("您无权复制其它组织的项目。");
}
}else{
if(!user.getBranchId().equals(xmProjectDb.getBranchId())){
if(!platformBranchId.equals(xmProjectDb.getBranchId())){
throw new BizException("您无权复制其它组织的项目");
}
}
}
String isTpl=xmProject.getIsTpl(); String isTpl=xmProject.getIsTpl();
XmProjectVo xmProjectTo=new XmProjectVo(); XmProjectVo xmProjectTo=new XmProjectVo();
BeanUtils.copyProperties(xmProjectDb,xmProjectTo); BeanUtils.copyProperties(xmProjectDb,xmProjectTo);

Loading…
Cancel
Save