Browse Source

元素参数调整

yangyj 2 năm trước cách đây
mục cha
commit
3edc4e7dde

+ 1 - 1
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/dto/WbsParamBean.java

@@ -19,7 +19,7 @@ public class WbsParamBean {
     @ApiModelProperty(value = "参数内容,普通参数才需要")
     private  String v;
     @ApiModelProperty(value = "节点id,普通参数才需要")
-    private Long wbsId;
+    private Long nodeId;
     @ApiModelProperty(value = "描述说明")
     private  String remark;
     @ApiModelProperty(value = "类型:0参数名称字典,1普通参数")

+ 1 - 1
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/WbsParam.java

@@ -23,5 +23,5 @@ public class WbsParam  extends BaseEntity {
     /**
      * WBS树节点Id
      * */
-    private  Long wbsId;
+    private  Long nodeId;
 }

+ 2 - 1
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/ParamBean.java

@@ -13,7 +13,8 @@ import java.util.List;
 @Data
 public class ParamBean {
    private List<WbsParamBean> wps ;
-   private String wbsId;
    private String projectId;
+   /**
+    * wbs_tree_private的p_key_id*/
    private Long   nodeId;
 }

+ 4 - 5
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/WbsParamController.java

@@ -10,7 +10,6 @@ import io.swagger.annotations.ApiParam;
 import lombok.AllArgsConstructor;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
-import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.BeanUtil;
 import org.springblade.core.tool.utils.CollectionUtil;
@@ -83,8 +82,8 @@ public class WbsParamController {
            if(wps.size()==1){
                WbsParamBean kone = wps.get(0);
                if(kone.getType()<0){
-                   if(Func.isNotEmpty(kone.getWbsId())) {
-                       this.service.update(Wrappers.<WbsParam>update().lambda().set(WbsParam::getIsDeleted, 1).eq(WbsParam::getWbsId, kone.getWbsId()));
+                   if(Func.isNotEmpty(kone.getNodeId())) {
+                       this.service.update(Wrappers.<WbsParam>update().lambda().set(WbsParam::getIsDeleted, 1).eq(WbsParam::getNodeId, kone.getNodeId()));
                        return R.status(true);
                    }else{
                        return R.fail("至少保留一个模版");
@@ -97,7 +96,7 @@ public class WbsParamController {
                if(one.getType().equals(0)){
                    this.service.update(Wrappers.<WbsParam>update().lambda().set(WbsParam::getIsDeleted,1).eq(WbsParam::getType,0).notIn(WbsParam::getId,ids));
                }else{
-                   this.service.update(Wrappers.<WbsParam>update().lambda().set(WbsParam::getIsDeleted,1).eq(WbsParam::getWbsId,one.getWbsId()).notIn(WbsParam::getId,ids));
+                   this.service.update(Wrappers.<WbsParam>update().lambda().set(WbsParam::getIsDeleted,1).eq(WbsParam::getNodeId,one.getNodeId()).notIn(WbsParam::getId,ids));
                    /*把当前节点已删除参数的关联公式删除*/
                   // this.formulaService.update(Wrappers.<Formula>lambdaUpdate().set(Formula::getIsDeleted,1).eq(Formula::getElementId,1));
                }
@@ -183,7 +182,7 @@ public class WbsParamController {
     @ApiOperation(value = "节点参数列表", notes = "节点参数列表")
     @GetMapping("/list")
     public R<List<WbsParamBean>> list3(@ApiParam(value = "wbs节点id", required = true) Long wbsId) {
-        LambdaQueryWrapper<WbsParam> queryWrapper = Wrappers.<WbsParam>query().lambda().eq(WbsParam::getWbsId,wbsId).eq(WbsParam::getType,1);
+        LambdaQueryWrapper<WbsParam> queryWrapper = Wrappers.<WbsParam>query().lambda().eq(WbsParam::getNodeId,wbsId).eq(WbsParam::getType,1);
         List<WbsParamBean> list = new ArrayList<>();
         List<WbsParam> data =  this.service.list(queryWrapper);
         if(CollectionUtil.isNotEmpty(data)){

+ 1 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsParamMapper.xml

@@ -13,7 +13,7 @@
         <result column="name" property="name"/>
         <result column="k" property="k"/>
         <result column="v" property="v"/>
-        <result column="wbsId" property="wbs_id"/>
+        <result column="nodeId" property="node_id"/>
         <result column="remark" property="remark"/>
         <result column="type" property="type"/>
     </resultMap>

+ 2 - 2
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/FormulaServiceImpl.java

@@ -149,11 +149,11 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
     public Map<String,Object> getWpMap(Long id,Long primaryKeyId){
         Map<String,Object> result = new HashMap<>(100);
         List<WbsParam> total = new ArrayList<>();
-        List<WbsParam> wpsPublic = this.wpService.list(Wrappers.<WbsParam>lambdaQuery().eq(WbsParam::getWbsId,id));
+        List<WbsParam> wpsPublic = this.wpService.list(Wrappers.<WbsParam>lambdaQuery().eq(WbsParam::getNodeId,id));
         if(Func.isNotEmpty(wpsPublic)){
             total.addAll(wpsPublic);
         }
-        List<WbsParam> wpsPrivate = this.wpService.list(Wrappers.<WbsParam>lambdaQuery().eq(WbsParam::getWbsId,primaryKeyId));
+        List<WbsParam> wpsPrivate = this.wpService.list(Wrappers.<WbsParam>lambdaQuery().eq(WbsParam::getNodeId,primaryKeyId));
         if(Func.isNotEmpty(wpsPrivate)){
             total.addAll(wpsPrivate);
         }

+ 3 - 7
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/WbsParamServiceImpl.java

@@ -5,11 +5,8 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.mixsmart.utils.CustomFunction;
 import lombok.AllArgsConstructor;
 import org.springblade.common.utils.BaseUtils;
-import org.springblade.common.utils.CommonUtil;
 import org.springblade.core.mp.base.BaseServiceImpl;
-import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.utils.Func;
-import org.springblade.core.tool.utils.StringPool;
 import org.springblade.manager.entity.WbsParam;
 import org.springblade.manager.entity.WbsTreeContract;
 import org.springblade.manager.mapper.WbsParamMapper;
@@ -18,7 +15,6 @@ import org.springblade.manager.service.IWbsTreeContractService;
 import org.springframework.cache.annotation.Cacheable;
 import org.springframework.stereotype.Service;
 
-import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 import java.util.stream.Collectors;
@@ -44,9 +40,9 @@ public class WbsParamServiceImpl extends BaseServiceImpl<WbsParamMapper, WbsPara
             List<WbsTreeContract> nodes = chain(contractId,nodeId,wbsTreeContract.getPKeyId(),wbsTreeContract);
             if(Func.isNotEmpty(nodes)){
                 /**优先取私有*/
-                WbsParam wp = this.getOne(Wrappers.<WbsParam>lambdaQuery().eq(WbsParam::getWbsId,wbsTreeContract.getPKeyId()).eq(WbsParam::getK,FILE_TITLE));
+                WbsParam wp = this.getOne(Wrappers.<WbsParam>lambdaQuery().eq(WbsParam::getNodeId,wbsTreeContract.getPKeyId()).eq(WbsParam::getK,FILE_TITLE));
                 if(wp==null){
-                     wp = this.getOne(Wrappers.<WbsParam>lambdaQuery().eq(WbsParam::getWbsId,nodeId).eq(WbsParam::getK,FILE_TITLE));
+                     wp = this.getOne(Wrappers.<WbsParam>lambdaQuery().eq(WbsParam::getNodeId,nodeId).eq(WbsParam::getK,FILE_TITLE));
                 }
                 if(Func.isNotEmpty(wp)){
                     return CustomFunction.tree(nodes.stream().map(WbsTreeContract::getNodeName).collect(Collectors.toList()), wp.getV()).toString();
@@ -60,7 +56,7 @@ public class WbsParamServiceImpl extends BaseServiceImpl<WbsParamMapper, WbsPara
     @Override
     public List<WbsParam> findByNodeId(Long nodeId) {
         if(nodeId != null){
-           return this.list(Wrappers.<WbsParam>lambdaQuery().eq(WbsParam::getWbsId,nodeId));
+           return this.list(Wrappers.<WbsParam>lambdaQuery().eq(WbsParam::getNodeId,nodeId));
         }
         return Collections.emptyList();
     }

+ 5 - 5
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/WbsTreePrivateServiceImpl.java

@@ -497,12 +497,12 @@ public class WbsTreePrivateServiceImpl extends BaseServiceImpl<WbsTreePrivateMap
                         for (WbsTree wbsTree : treePublicNodeAll) {
                             if (wbsTree.getId().equals(wbsTreePrivate.getId())) {
                                 //获取公有节点参数
-                                List<WbsParam> wbsParamList = wbsParamListAll.stream().filter(f -> f.getWbsId().equals(wbsTree.getId())).collect(Collectors.toList());
+                                List<WbsParam> wbsParamList = wbsParamListAll.stream().filter(f -> f.getNodeId().equals(wbsTree.getId())).collect(Collectors.toList());
                                 if (wbsParamList.size() > 0) {
                                     for (WbsParam wbsParam : wbsParamList) {
                                         WbsParam param = BeanUtil.copyProperties(wbsParam, WbsParam.class);
                                         if (param != null) {
-                                            param.setWbsId(wbsTreePrivate.getPKeyId());
+                                            param.setNodeId(wbsTreePrivate.getPKeyId());
                                             param.setId(SnowFlakeUtil.getId());
                                             paramListData.add(param);
                                         }
@@ -531,12 +531,12 @@ public class WbsTreePrivateServiceImpl extends BaseServiceImpl<WbsTreePrivateMap
                         for (WbsTreePrivate wbsTreePrivateYS : treePrivateNodeAll) {
                             if (wbsTreePrivateYS.getId().equals(wbsTreePrivate.getId())) {
                                 //获取公有节点参数
-                                List<WbsParam> wbsParamList = wbsParamListAll.stream().filter(f -> f.getWbsId().equals(wbsTreePrivateYS.getPKeyId())).collect(Collectors.toList());
+                                List<WbsParam> wbsParamList = wbsParamListAll.stream().filter(f -> f.getNodeId().equals(wbsTreePrivateYS.getPKeyId())).collect(Collectors.toList());
                                 if (wbsParamList.size() > 0) {
                                     for (WbsParam wbsParam : wbsParamList) {
                                         WbsParam param = BeanUtil.copyProperties(wbsParam, WbsParam.class);
                                         if (param != null) {
-                                            param.setWbsId(wbsTreePrivate.getPKeyId());
+                                            param.setNodeId(wbsTreePrivate.getPKeyId());
                                             param.setId(SnowFlakeUtil.getId());
                                             paramListData.add(param);
                                         }
@@ -555,7 +555,7 @@ public class WbsTreePrivateServiceImpl extends BaseServiceImpl<WbsTreePrivateMap
                             (StringUtils.isNotEmpty(f.getK()) && f.getK().equals(next.getK()))
                                     && (StringUtils.isNotEmpty(f.getV()) && f.getV().equals(next.getV()))
                                     && (StringUtils.isNotEmpty(f.getName()) && f.getName().equals(next.getName()))
-                                    && (ObjectUtils.isNotEmpty(f.getWbsId()) && f.getWbsId().equals(next.getWbsId())))
+                                    && (ObjectUtils.isNotEmpty(f.getNodeId()) && f.getNodeId().equals(next.getNodeId())))
                             .collect(Collectors.toList());
                     if (collect.size() > 0) {
                         iterator.remove();