0517 ljc
This commit is contained in:
parent
08ea03fd77
commit
34d94b0e98
@ -30,7 +30,7 @@ public class PipelineQueryReq extends PageParam {
|
|||||||
/**
|
/**
|
||||||
* 创建人用户id
|
* 创建人用户id
|
||||||
*/
|
*/
|
||||||
private Long createUserId;
|
private String creator;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -0,0 +1,48 @@
|
|||||||
|
package cd.casic.ci.common.pipeline.req.target;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author HopeLi
|
||||||
|
* @version v1.0
|
||||||
|
* @ClassName TargetManagerReq
|
||||||
|
* @Date: 2025/5/17 15:36
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class TargetManagerCreateReq {
|
||||||
|
/**
|
||||||
|
* 目标名称
|
||||||
|
*/
|
||||||
|
private String targetName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 版本
|
||||||
|
*/
|
||||||
|
private String version;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 图标
|
||||||
|
*/
|
||||||
|
private String fileIcon;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件地址路径
|
||||||
|
*/
|
||||||
|
private String filePath;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 目标类型
|
||||||
|
*/
|
||||||
|
private String targetType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 描述
|
||||||
|
*/
|
||||||
|
private String targetDesc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件大小(byte)
|
||||||
|
*/
|
||||||
|
private Double totalSize;
|
||||||
|
}
|
@ -0,0 +1,53 @@
|
|||||||
|
package cd.casic.ci.common.pipeline.req.target;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author HopeLi
|
||||||
|
* @version v1.0
|
||||||
|
* @ClassName TargetManagerReq
|
||||||
|
* @Date: 2025/5/17 15:36
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class TargetManagerUpdateReq {
|
||||||
|
/**
|
||||||
|
* 主键id
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 目标名称
|
||||||
|
*/
|
||||||
|
private String targetName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 版本
|
||||||
|
*/
|
||||||
|
private String version;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 图标
|
||||||
|
*/
|
||||||
|
private String fileIcon;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件地址路径
|
||||||
|
*/
|
||||||
|
private String filePath;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 目标类型
|
||||||
|
*/
|
||||||
|
private String targetType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 描述
|
||||||
|
*/
|
||||||
|
private String targetDesc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件大小(byte)
|
||||||
|
*/
|
||||||
|
private Double totalSize;
|
||||||
|
}
|
@ -0,0 +1,37 @@
|
|||||||
|
package cd.casic.ci.common.pipeline.req.target;
|
||||||
|
|
||||||
|
import cd.casic.framework.commons.pojo.PageParam;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName PipelineQueryReq
|
||||||
|
* @Author hopeli
|
||||||
|
* @Date 2025/5/10 9:54
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
public class TargetQueryReq extends PageParam {
|
||||||
|
/**
|
||||||
|
* 主键id
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
private List<String> idList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 目标名称
|
||||||
|
*/
|
||||||
|
@TableField("target_name")
|
||||||
|
private String targetName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人用户id
|
||||||
|
*/
|
||||||
|
private String creator;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,80 @@
|
|||||||
|
package cd.casic.ci.common.pipeline.resp.target;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author HopeLi
|
||||||
|
* @version v1.0
|
||||||
|
* @ClassName TargetManager
|
||||||
|
* @Date: 2025/5/17 10:23
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class TargetManagerResp{
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户id
|
||||||
|
*/
|
||||||
|
private String userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 目标名称
|
||||||
|
*/
|
||||||
|
private String targetName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 目标类型
|
||||||
|
*/
|
||||||
|
private String targetType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 版本
|
||||||
|
*/
|
||||||
|
private String version;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 描述
|
||||||
|
*/
|
||||||
|
private String targetDesc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件唯一标识
|
||||||
|
*/
|
||||||
|
private String identifier;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件大小(byte)
|
||||||
|
*/
|
||||||
|
private Double totalSize;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件名字
|
||||||
|
*/
|
||||||
|
private String fileName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件密级
|
||||||
|
*/
|
||||||
|
private String fileSecrets;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件类型
|
||||||
|
*/
|
||||||
|
private String fileType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 密级
|
||||||
|
*/
|
||||||
|
private String secretId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组织id
|
||||||
|
*/
|
||||||
|
private Long orgId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 图标
|
||||||
|
*/
|
||||||
|
private String fileIcon;
|
||||||
|
}
|
@ -0,0 +1,26 @@
|
|||||||
|
package cd.casic.ci.process.process.converter;
|
||||||
|
|
||||||
|
import cd.casic.ci.common.pipeline.resp.pipeline.PipelineFindResp;
|
||||||
|
import cd.casic.ci.common.pipeline.resp.target.TargetManagerResp;
|
||||||
|
import cd.casic.ci.process.process.dataObject.pipeline.PipPipeline;
|
||||||
|
import cd.casic.ci.process.process.dataObject.target.TargetManager;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
import org.mapstruct.factory.Mappers;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author HopeLi
|
||||||
|
* @version v1.0
|
||||||
|
* @ClassName PipelineConverter
|
||||||
|
* @Date: 2025/5/13 14:39
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
@Mapper(componentModel = "spring")
|
||||||
|
public interface TargetConverter {
|
||||||
|
TargetConverter INSTANCE = Mappers.getMapper(TargetConverter.class);
|
||||||
|
|
||||||
|
PipelineFindResp toResp(PipPipeline pipPipeline);
|
||||||
|
List<TargetManagerResp> toRespList(List<TargetManager> pipPipelines);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
package cd.casic.ci.process.process.dal.pipeline;
|
||||||
|
|
||||||
|
import cd.casic.ci.process.process.dataObject.target.TargetManager;
|
||||||
|
import cd.casic.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author HopeLi
|
||||||
|
* @version v1.0
|
||||||
|
* @ClassName TargetManagerDao
|
||||||
|
* @Date: 2025/5/17 15:21
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
public interface TargetManagerDao extends BaseMapperX<TargetManager> {
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
package cd.casic.ci.process.process.dal.pipeline;
|
||||||
|
|
||||||
|
import cd.casic.ci.process.process.dataObject.target.TargetVersion;
|
||||||
|
import cd.casic.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author HopeLi
|
||||||
|
* @version v1.0
|
||||||
|
* @ClassName TargetManagerDao
|
||||||
|
* @Date: 2025/5/17 15:21
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
public interface TargetVersionDao extends BaseMapperX<TargetVersion> {
|
||||||
|
}
|
@ -0,0 +1,18 @@
|
|||||||
|
package cd.casic.ci.process.process.dataObject.base;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author HopeLi
|
||||||
|
* @version v1.0
|
||||||
|
* @ClassName BaseIdReq
|
||||||
|
* @Date: 2025/5/17 16:40
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class BaseIdReq {
|
||||||
|
private String id;
|
||||||
|
private List<String> idList;
|
||||||
|
}
|
@ -1,21 +1,15 @@
|
|||||||
package cd.casic.ci.process.process.dataObject.base;
|
package cd.casic.ci.process.process.dataObject.base;
|
||||||
|
|
||||||
|
import cd.casic.framework.commons.dataobject.BaseDO;
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class PipBaseElement {
|
public class PipBaseElement extends BaseDO {
|
||||||
/**
|
/**
|
||||||
* 主键id
|
* 主键id
|
||||||
*/
|
*/
|
||||||
@TableId(type = IdType.ASSIGN_ID)
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
private String id;
|
private String id;
|
||||||
//@ApiProperty(name = "createTime",desc="创建时间")
|
|
||||||
private LocalDateTime createTime;
|
|
||||||
private LocalDateTime updateTime;
|
|
||||||
private Long createUserId;
|
|
||||||
private Long updateUserId;
|
|
||||||
}
|
}
|
||||||
|
@ -1,13 +1,12 @@
|
|||||||
package cd.casic.ci.process.process.dataObject.resource;
|
package cd.casic.ci.process.process.dataObject.resource;
|
||||||
|
|
||||||
|
import cd.casic.ci.process.process.dataObject.base.PipBaseElement;
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class PipResource {
|
public class PipResource extends PipBaseElement {
|
||||||
/**
|
/**
|
||||||
* 主键id
|
* 主键id
|
||||||
*/
|
*/
|
||||||
@ -113,18 +112,4 @@ public class PipResource {
|
|||||||
* 流水线id
|
* 流水线id
|
||||||
*/
|
*/
|
||||||
private String pipelineId;
|
private String pipelineId;
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建人用户id
|
|
||||||
*/
|
|
||||||
private Long createUserId;
|
|
||||||
|
|
||||||
private Long updateUserId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建时间
|
|
||||||
*/
|
|
||||||
private LocalDateTime createTime;
|
|
||||||
|
|
||||||
private LocalDateTime updateTime;
|
|
||||||
}
|
}
|
||||||
|
@ -2,13 +2,10 @@ package cd.casic.ci.process.process.dataObject.stage;
|
|||||||
|
|
||||||
import cd.casic.ci.process.process.dataObject.base.PipBaseElement;
|
import cd.casic.ci.process.process.dataObject.base.PipBaseElement;
|
||||||
import cd.casic.ci.process.process.dataObject.task.PipTask;
|
import cd.casic.ci.process.process.dataObject.task.PipTask;
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Data
|
@Data
|
||||||
|
@ -0,0 +1,95 @@
|
|||||||
|
package cd.casic.ci.process.process.dataObject.target;
|
||||||
|
|
||||||
|
import cd.casic.ci.process.process.dataObject.base.PipBaseElement;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author HopeLi
|
||||||
|
* @version v1.0
|
||||||
|
* @ClassName TargetManager
|
||||||
|
* @Date: 2025/5/17 10:23
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
@TableName("target_manager")
|
||||||
|
public class TargetManager extends PipBaseElement {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户id
|
||||||
|
*/
|
||||||
|
@TableField("user_id")
|
||||||
|
private String userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 目标名称
|
||||||
|
*/
|
||||||
|
@TableField("target_name")
|
||||||
|
private String targetName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 目标类型
|
||||||
|
*/
|
||||||
|
@TableField("target_type")
|
||||||
|
private String targetType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 版本
|
||||||
|
*/
|
||||||
|
private String version;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 描述
|
||||||
|
*/
|
||||||
|
@TableField("target_desc")
|
||||||
|
private String targetDesc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件唯一标识
|
||||||
|
*/
|
||||||
|
private String identifier;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件大小(byte)
|
||||||
|
*/
|
||||||
|
@TableField("total_size")
|
||||||
|
private Double totalSize;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件名字
|
||||||
|
*/
|
||||||
|
@TableField("file_name")
|
||||||
|
private String fileName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件密级
|
||||||
|
*/
|
||||||
|
@TableField("file_secrets")
|
||||||
|
private String fileSecrets;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件类型
|
||||||
|
*/
|
||||||
|
@TableField("file_type")
|
||||||
|
private String fileType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 密级
|
||||||
|
*/
|
||||||
|
private String secretId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组织id
|
||||||
|
*/
|
||||||
|
@TableField("org_id")
|
||||||
|
private Long orgId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 图标
|
||||||
|
*/
|
||||||
|
@TableField("file_icon")
|
||||||
|
private String fileIcon;
|
||||||
|
}
|
@ -0,0 +1,79 @@
|
|||||||
|
package cd.casic.ci.process.process.dataObject.target;
|
||||||
|
|
||||||
|
import cd.casic.ci.process.process.dataObject.base.PipBaseElement;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author HopeLi
|
||||||
|
* @version v1.0
|
||||||
|
* @ClassName TargetVersion
|
||||||
|
* @Date: 2025/5/17 10:23
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
@TableName("target_version")
|
||||||
|
public class TargetVersion extends PipBaseElement {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 目标id
|
||||||
|
*/
|
||||||
|
@TableField("target_id")
|
||||||
|
private String targetId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 目标类型
|
||||||
|
*/
|
||||||
|
@TableField("target_type")
|
||||||
|
private String targetType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 版本
|
||||||
|
*/
|
||||||
|
private String version;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 描述
|
||||||
|
*/
|
||||||
|
@TableField("target_desc")
|
||||||
|
private String targetDesc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件唯一标识
|
||||||
|
*/
|
||||||
|
private String identifier;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件大小(byte)
|
||||||
|
*/
|
||||||
|
@TableField("file_size")
|
||||||
|
private Double fileSize;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件名字
|
||||||
|
*/
|
||||||
|
@TableField("file_name")
|
||||||
|
private String fileName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件类型
|
||||||
|
*/
|
||||||
|
@TableField("file_type")
|
||||||
|
private String fileType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 密级
|
||||||
|
* 人员:1一般,2重要,3核心
|
||||||
|
* 文件/功能:1公开 2内部 3秘密 4机密
|
||||||
|
*/
|
||||||
|
private String secretId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件地址路径
|
||||||
|
*/
|
||||||
|
@TableField("file_path")
|
||||||
|
private String filePath;
|
||||||
|
}
|
@ -1,15 +1,11 @@
|
|||||||
package cd.casic.ci.process.process.dataObject.task;
|
package cd.casic.ci.process.process.dataObject.task;
|
||||||
|
|
||||||
import cd.casic.ci.process.process.dataObject.base.PipBaseElement;
|
import cd.casic.ci.process.process.dataObject.base.PipBaseElement;
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Data
|
@Data
|
||||||
public class PipTask extends PipBaseElement {
|
public class PipTask extends PipBaseElement {
|
||||||
|
@ -82,8 +82,8 @@ public class PipelineServiceImpl extends ServiceImpl<PipelineDao, PipPipeline> i
|
|||||||
pipeline.setColor(randomNumber);
|
pipeline.setColor(randomNumber);
|
||||||
|
|
||||||
pipeline.setCreateTime(LocalDateTime.now());
|
pipeline.setCreateTime(LocalDateTime.now());
|
||||||
if (Objects.isNull(pipeline.getCreateUserId())){
|
if (Objects.isNull(pipeline.getCreator())){
|
||||||
pipeline.setCreateUserId(WebFrameworkUtils.getLoginUserId());
|
pipeline.setCreator(String.valueOf(WebFrameworkUtils.getLoginUserId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
pipeline.setState(1);
|
pipeline.setState(1);
|
||||||
@ -92,7 +92,7 @@ public class PipelineServiceImpl extends ServiceImpl<PipelineDao, PipPipeline> i
|
|||||||
if (!ObjectUtils.isEmpty(pipelineReq.getResourceReq())){
|
if (!ObjectUtils.isEmpty(pipelineReq.getResourceReq())){
|
||||||
PipResource resource = new PipResource();
|
PipResource resource = new PipResource();
|
||||||
BeanUtils.copyProperties(pipelineReq.getResourceReq(),resource);
|
BeanUtils.copyProperties(pipelineReq.getResourceReq(),resource);
|
||||||
resource.setCreateUserId(pipeline.getCreateUserId());
|
resource.setCreator(pipeline.getCreator());
|
||||||
resource.setCreateTime(LocalDateTime.now());
|
resource.setCreateTime(LocalDateTime.now());
|
||||||
resourceService.save(resource);
|
resourceService.save(resource);
|
||||||
|
|
||||||
@ -111,7 +111,7 @@ public class PipelineServiceImpl extends ServiceImpl<PipelineDao, PipPipeline> i
|
|||||||
stageReq1.setPipelineId(pipeline.getId());
|
stageReq1.setPipelineId(pipeline.getId());
|
||||||
stageReq1.setStageName("阶段-1");
|
stageReq1.setStageName("阶段-1");
|
||||||
stageReq1.setCreateTime(LocalDateTime.now());
|
stageReq1.setCreateTime(LocalDateTime.now());
|
||||||
stageReq1.setCreateUserId(WebFrameworkUtils.getLoginUserId());
|
stageReq1.setCreator(String.valueOf(WebFrameworkUtils.getLoginUserId()));
|
||||||
stageReq1.setStageSort(1);
|
stageReq1.setStageSort(1);
|
||||||
stageReq1.setParentId("-1");
|
stageReq1.setParentId("-1");
|
||||||
stageReq1.setCode(true);
|
stageReq1.setCode(true);
|
||||||
@ -121,7 +121,7 @@ public class PipelineServiceImpl extends ServiceImpl<PipelineDao, PipPipeline> i
|
|||||||
childStage1.setPipelineId(pipeline.getId());
|
childStage1.setPipelineId(pipeline.getId());
|
||||||
childStage1.setStageName("源码");
|
childStage1.setStageName("源码");
|
||||||
childStage1.setCreateTime(LocalDateTime.now());
|
childStage1.setCreateTime(LocalDateTime.now());
|
||||||
childStage1.setCreateUserId(WebFrameworkUtils.getLoginUserId());
|
childStage1.setCreator(String.valueOf(WebFrameworkUtils.getLoginUserId()));
|
||||||
childStage1.setStageSort(1);
|
childStage1.setStageSort(1);
|
||||||
childStage1.setCode(false);
|
childStage1.setCode(false);
|
||||||
childStage1.setParentId(stageReq1.getId());
|
childStage1.setParentId(stageReq1.getId());
|
||||||
@ -132,7 +132,7 @@ public class PipelineServiceImpl extends ServiceImpl<PipelineDao, PipPipeline> i
|
|||||||
stageReq2.setPipelineId(pipeline.getId());
|
stageReq2.setPipelineId(pipeline.getId());
|
||||||
stageReq2.setStageName("阶段-2");
|
stageReq2.setStageName("阶段-2");
|
||||||
stageReq2.setCreateTime(LocalDateTime.now());
|
stageReq2.setCreateTime(LocalDateTime.now());
|
||||||
stageReq2.setCreateUserId(WebFrameworkUtils.getLoginUserId());
|
stageReq2.setCreator(String.valueOf(WebFrameworkUtils.getLoginUserId()));
|
||||||
stageReq2.setStageSort(2);
|
stageReq2.setStageSort(2);
|
||||||
stageReq2.setParentId("-1");
|
stageReq2.setParentId("-1");
|
||||||
stageReq2.setCode(true);
|
stageReq2.setCode(true);
|
||||||
@ -143,7 +143,7 @@ public class PipelineServiceImpl extends ServiceImpl<PipelineDao, PipPipeline> i
|
|||||||
childStage21.setStageName("并行阶段-2-1");
|
childStage21.setStageName("并行阶段-2-1");
|
||||||
childStage21.setPipelineId(pipeline.getId());
|
childStage21.setPipelineId(pipeline.getId());
|
||||||
childStage21.setCreateTime(LocalDateTime.now());
|
childStage21.setCreateTime(LocalDateTime.now());
|
||||||
childStage21.setCreateUserId(WebFrameworkUtils.getLoginUserId());
|
childStage21.setCreator(String.valueOf(WebFrameworkUtils.getLoginUserId()));
|
||||||
childStage21.setStageSort(1);
|
childStage21.setStageSort(1);
|
||||||
childStage21.setCode(false);
|
childStage21.setCode(false);
|
||||||
childStage21.setParentId(stageReq2.getId());
|
childStage21.setParentId(stageReq2.getId());
|
||||||
@ -154,7 +154,7 @@ public class PipelineServiceImpl extends ServiceImpl<PipelineDao, PipPipeline> i
|
|||||||
childTask21.setPipelineId(pipeline.getId());
|
childTask21.setPipelineId(pipeline.getId());
|
||||||
childTask21.setTaskName("串行任务-2-1");
|
childTask21.setTaskName("串行任务-2-1");
|
||||||
childTask21.setCreateTime(LocalDateTime.now());
|
childTask21.setCreateTime(LocalDateTime.now());
|
||||||
childTask21.setCreateUserId(WebFrameworkUtils.getLoginUserId());
|
childTask21.setCreator(String.valueOf(WebFrameworkUtils.getLoginUserId()));
|
||||||
childTask21.setTaskType("test");
|
childTask21.setTaskType("test");
|
||||||
childTask21.setTaskSort(1);
|
childTask21.setTaskSort(1);
|
||||||
childTask21.setStageId(childStage21.getId());
|
childTask21.setStageId(childStage21.getId());
|
||||||
@ -165,7 +165,7 @@ public class PipelineServiceImpl extends ServiceImpl<PipelineDao, PipPipeline> i
|
|||||||
childStage22.setStageName("并行阶段-2-2");
|
childStage22.setStageName("并行阶段-2-2");
|
||||||
childStage22.setPipelineId(pipeline.getId());
|
childStage22.setPipelineId(pipeline.getId());
|
||||||
childStage22.setCreateTime(LocalDateTime.now());
|
childStage22.setCreateTime(LocalDateTime.now());
|
||||||
childStage22.setCreateUserId(WebFrameworkUtils.getLoginUserId());
|
childStage22.setCreator(String.valueOf(WebFrameworkUtils.getLoginUserId()));
|
||||||
childStage22.setStageSort(2);
|
childStage22.setStageSort(2);
|
||||||
childStage22.setCode(false);
|
childStage22.setCode(false);
|
||||||
childStage22.setParentId(stageReq2.getId());
|
childStage22.setParentId(stageReq2.getId());
|
||||||
@ -173,7 +173,7 @@ public class PipelineServiceImpl extends ServiceImpl<PipelineDao, PipPipeline> i
|
|||||||
|
|
||||||
PipTask childTask22 = new PipTask();
|
PipTask childTask22 = new PipTask();
|
||||||
childTask22.setCreateTime(LocalDateTime.now());
|
childTask22.setCreateTime(LocalDateTime.now());
|
||||||
childTask22.setCreateUserId(WebFrameworkUtils.getLoginUserId());
|
childTask22.setCreator(String.valueOf(WebFrameworkUtils.getLoginUserId()));
|
||||||
childTask22.setTaskName("串行任务-2-2");
|
childTask22.setTaskName("串行任务-2-2");
|
||||||
childTask22.setPipelineId(pipeline.getId());
|
childTask22.setPipelineId(pipeline.getId());
|
||||||
childTask22.setTaskType("test");
|
childTask22.setTaskType("test");
|
||||||
@ -186,7 +186,7 @@ public class PipelineServiceImpl extends ServiceImpl<PipelineDao, PipPipeline> i
|
|||||||
stageReq3.setPipelineId(pipeline.getId());
|
stageReq3.setPipelineId(pipeline.getId());
|
||||||
stageReq3.setStageName("阶段-3");
|
stageReq3.setStageName("阶段-3");
|
||||||
stageReq3.setCreateTime(LocalDateTime.now());
|
stageReq3.setCreateTime(LocalDateTime.now());
|
||||||
stageReq3.setCreateUserId(WebFrameworkUtils.getLoginUserId());
|
stageReq3.setCreator(String.valueOf(WebFrameworkUtils.getLoginUserId()));
|
||||||
stageReq3.setStageSort(3);
|
stageReq3.setStageSort(3);
|
||||||
stageReq3.setParentId("-1");
|
stageReq3.setParentId("-1");
|
||||||
stageReq3.setCode(true);
|
stageReq3.setCode(true);
|
||||||
@ -196,7 +196,7 @@ public class PipelineServiceImpl extends ServiceImpl<PipelineDao, PipPipeline> i
|
|||||||
childStage31.setStageName("并行任务-3-1");
|
childStage31.setStageName("并行任务-3-1");
|
||||||
childStage31.setPipelineId(pipeline.getId());
|
childStage31.setPipelineId(pipeline.getId());
|
||||||
childStage31.setCreateTime(LocalDateTime.now());
|
childStage31.setCreateTime(LocalDateTime.now());
|
||||||
childStage31.setCreateUserId(WebFrameworkUtils.getLoginUserId());
|
childStage31.setCreator(String.valueOf(WebFrameworkUtils.getLoginUserId()));
|
||||||
childStage31.setStageSort(1);
|
childStage31.setStageSort(1);
|
||||||
childStage31.setCode(false);
|
childStage31.setCode(false);
|
||||||
childStage31.setParentId(stageReq3.getId());
|
childStage31.setParentId(stageReq3.getId());
|
||||||
@ -204,7 +204,7 @@ public class PipelineServiceImpl extends ServiceImpl<PipelineDao, PipPipeline> i
|
|||||||
|
|
||||||
PipTask childTask31 = new PipTask();
|
PipTask childTask31 = new PipTask();
|
||||||
childTask31.setCreateTime(LocalDateTime.now());
|
childTask31.setCreateTime(LocalDateTime.now());
|
||||||
childTask31.setCreateUserId(WebFrameworkUtils.getLoginUserId());
|
childTask31.setCreator(String.valueOf(WebFrameworkUtils.getLoginUserId()));
|
||||||
childTask31.setTaskName("串行任务-3-1");
|
childTask31.setTaskName("串行任务-3-1");
|
||||||
childTask31.setPipelineId(pipeline.getId());
|
childTask31.setPipelineId(pipeline.getId());
|
||||||
childTask31.setTaskType("test");
|
childTask31.setTaskType("test");
|
||||||
@ -217,7 +217,7 @@ public class PipelineServiceImpl extends ServiceImpl<PipelineDao, PipPipeline> i
|
|||||||
stageReq4.setPipelineId(pipeline.getId());
|
stageReq4.setPipelineId(pipeline.getId());
|
||||||
stageReq4.setStageName("阶段-4");
|
stageReq4.setStageName("阶段-4");
|
||||||
stageReq4.setCreateTime(LocalDateTime.now());
|
stageReq4.setCreateTime(LocalDateTime.now());
|
||||||
stageReq4.setCreateUserId(WebFrameworkUtils.getLoginUserId());
|
stageReq4.setCreator(String.valueOf(WebFrameworkUtils.getLoginUserId()));
|
||||||
stageReq4.setStageSort(4);
|
stageReq4.setStageSort(4);
|
||||||
stageReq4.setParentId("-1");
|
stageReq4.setParentId("-1");
|
||||||
stageReq4.setCode(true);
|
stageReq4.setCode(true);
|
||||||
@ -227,7 +227,7 @@ public class PipelineServiceImpl extends ServiceImpl<PipelineDao, PipPipeline> i
|
|||||||
childStage41.setStageName("并行任务-4-1");
|
childStage41.setStageName("并行任务-4-1");
|
||||||
childStage41.setPipelineId(pipeline.getId());
|
childStage41.setPipelineId(pipeline.getId());
|
||||||
childStage41.setCreateTime(LocalDateTime.now());
|
childStage41.setCreateTime(LocalDateTime.now());
|
||||||
childStage41.setCreateUserId(WebFrameworkUtils.getLoginUserId());
|
childStage41.setCreator(String.valueOf(WebFrameworkUtils.getLoginUserId()));
|
||||||
childStage41.setStageSort(1);
|
childStage41.setStageSort(1);
|
||||||
childStage41.setCode(false);
|
childStage41.setCode(false);
|
||||||
childStage41.setParentId(stageReq4.getId());
|
childStage41.setParentId(stageReq4.getId());
|
||||||
@ -235,7 +235,7 @@ public class PipelineServiceImpl extends ServiceImpl<PipelineDao, PipPipeline> i
|
|||||||
|
|
||||||
PipTask childTask41 = new PipTask();
|
PipTask childTask41 = new PipTask();
|
||||||
childTask41.setCreateTime(LocalDateTime.now());
|
childTask41.setCreateTime(LocalDateTime.now());
|
||||||
childTask41.setCreateUserId(WebFrameworkUtils.getLoginUserId());
|
childTask41.setCreator(String.valueOf(WebFrameworkUtils.getLoginUserId()));
|
||||||
childTask41.setTaskName("串行任务-4-1");
|
childTask41.setTaskName("串行任务-4-1");
|
||||||
childTask41.setPipelineId(pipeline.getId());
|
childTask41.setPipelineId(pipeline.getId());
|
||||||
childTask41.setTaskType("test");
|
childTask41.setTaskType("test");
|
||||||
@ -260,8 +260,8 @@ public class PipelineServiceImpl extends ServiceImpl<PipelineDao, PipPipeline> i
|
|||||||
if (!ObjectUtils.isEmpty(pipelineQueryReq.getName())){
|
if (!ObjectUtils.isEmpty(pipelineQueryReq.getName())){
|
||||||
wrapper.like("name",pipelineQueryReq.getName());
|
wrapper.like("name",pipelineQueryReq.getName());
|
||||||
}
|
}
|
||||||
if (!ObjectUtils.isEmpty(pipelineQueryReq.getCreateUserId())){
|
if (!ObjectUtils.isEmpty(pipelineQueryReq.getCreator())){
|
||||||
wrapper.eq("create_user_id",pipelineQueryReq.getCreateUserId());
|
wrapper.eq("creator",pipelineQueryReq.getCreator());
|
||||||
}
|
}
|
||||||
if (!ObjectUtils.isEmpty(pipelineQueryReq.getCollect())){
|
if (!ObjectUtils.isEmpty(pipelineQueryReq.getCollect())){
|
||||||
wrapper.eq("collect",pipelineQueryReq.getCollect());
|
wrapper.eq("collect",pipelineQueryReq.getCollect());
|
||||||
@ -340,7 +340,7 @@ public class PipelineServiceImpl extends ServiceImpl<PipelineDao, PipPipeline> i
|
|||||||
PipPipeline pipPipeline = new PipPipeline();
|
PipPipeline pipPipeline = new PipPipeline();
|
||||||
BeanUtils.copyProperties(pipeline,pipPipeline);
|
BeanUtils.copyProperties(pipeline,pipPipeline);
|
||||||
pipPipeline.setUpdateTime(LocalDateTime.now());
|
pipPipeline.setUpdateTime(LocalDateTime.now());
|
||||||
pipPipeline.setUpdateUserId(WebFrameworkUtils.getLoginUserId());
|
pipPipeline.setUpdater(String.valueOf(WebFrameworkUtils.getLoginUserId()));
|
||||||
pipelineDao.updateById(pipPipeline);
|
pipelineDao.updateById(pipPipeline);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -358,8 +358,8 @@ public class PipelineServiceImpl extends ServiceImpl<PipelineDao, PipPipeline> i
|
|||||||
if (!ObjectUtils.isEmpty(query.getName())){
|
if (!ObjectUtils.isEmpty(query.getName())){
|
||||||
wrapper.like("name",query.getName());
|
wrapper.like("name",query.getName());
|
||||||
}
|
}
|
||||||
if (!ObjectUtils.isEmpty(query.getCreateUserId())){
|
if (!ObjectUtils.isEmpty(query.getCreator())){
|
||||||
wrapper.eq("create_user_id",query.getCreateUserId());
|
wrapper.eq("creator",query.getCreator());
|
||||||
}
|
}
|
||||||
if (!ObjectUtils.isEmpty(query.getCollect())){
|
if (!ObjectUtils.isEmpty(query.getCollect())){
|
||||||
wrapper.eq("collect",query.getCollect());
|
wrapper.eq("collect",query.getCollect());
|
||||||
@ -398,7 +398,7 @@ public class PipelineServiceImpl extends ServiceImpl<PipelineDao, PipPipeline> i
|
|||||||
pipeline.setId(null);
|
pipeline.setId(null);
|
||||||
pipeline.setName(pipelineName);
|
pipeline.setName(pipelineName);
|
||||||
pipeline.setCreateTime(LocalDateTime.now());
|
pipeline.setCreateTime(LocalDateTime.now());
|
||||||
pipeline.setCreateUserId(WebFrameworkUtils.getLoginUserId());
|
pipeline.setCreator(String.valueOf(WebFrameworkUtils.getLoginUserId()));
|
||||||
this.save(pipeline);
|
this.save(pipeline);
|
||||||
|
|
||||||
//复制stage
|
//复制stage
|
||||||
@ -421,7 +421,7 @@ public class PipelineServiceImpl extends ServiceImpl<PipelineDao, PipPipeline> i
|
|||||||
o.setId(null);
|
o.setId(null);
|
||||||
o.setPipelineId(pipeline.getId());
|
o.setPipelineId(pipeline.getId());
|
||||||
o.setCreateTime(LocalDateTime.now());
|
o.setCreateTime(LocalDateTime.now());
|
||||||
o.setCreateUserId(WebFrameworkUtils.getLoginUserId());
|
o.setCreator(String.valueOf(WebFrameworkUtils.getLoginUserId()));
|
||||||
stageService.save(o);
|
stageService.save(o);
|
||||||
|
|
||||||
if (!CollectionUtils.isEmpty(pipStageChildList)){
|
if (!CollectionUtils.isEmpty(pipStageChildList)){
|
||||||
@ -438,7 +438,7 @@ public class PipelineServiceImpl extends ServiceImpl<PipelineDao, PipPipeline> i
|
|||||||
j.setParentId(o.getId());
|
j.setParentId(o.getId());
|
||||||
j.setPipelineId(pipeline.getId());
|
j.setPipelineId(pipeline.getId());
|
||||||
j.setCreateTime(LocalDateTime.now());
|
j.setCreateTime(LocalDateTime.now());
|
||||||
j.setCreateUserId(WebFrameworkUtils.getLoginUserId());
|
j.setCreator(String.valueOf(WebFrameworkUtils.getLoginUserId()));
|
||||||
stageService.save(j);
|
stageService.save(j);
|
||||||
|
|
||||||
if (!CollectionUtils.isEmpty(taskList)){
|
if (!CollectionUtils.isEmpty(taskList)){
|
||||||
@ -447,7 +447,7 @@ public class PipelineServiceImpl extends ServiceImpl<PipelineDao, PipPipeline> i
|
|||||||
k.setStageId(j.getId());
|
k.setStageId(j.getId());
|
||||||
k.setPipelineId(pipeline.getId());
|
k.setPipelineId(pipeline.getId());
|
||||||
k.setCreateTime(LocalDateTime.now());
|
k.setCreateTime(LocalDateTime.now());
|
||||||
k.setCreateUserId(WebFrameworkUtils.getLoginUserId());
|
k.setCreator(String.valueOf(WebFrameworkUtils.getLoginUserId()));
|
||||||
});
|
});
|
||||||
taskService.saveBatch(taskList);
|
taskService.saveBatch(taskList);
|
||||||
}
|
}
|
||||||
|
@ -60,8 +60,8 @@ public class StageServiceImpl extends ServiceImpl<PipStageDao, PipStage> impleme
|
|||||||
firstStage.setParentId("-1");
|
firstStage.setParentId("-1");
|
||||||
firstStage.setPipelineId(pipelineId);
|
firstStage.setPipelineId(pipelineId);
|
||||||
|
|
||||||
firstStage.setCreateUserId(loginUserId);
|
firstStage.setCreator(String.valueOf(loginUserId));
|
||||||
firstStage.setUpdateUserId(loginUserId);
|
firstStage.setUpdater(String.valueOf(loginUserId));
|
||||||
firstStage.setUpdateTime(LocalDateTime.now());
|
firstStage.setUpdateTime(LocalDateTime.now());
|
||||||
PipStage stageQuery = new PipStage();
|
PipStage stageQuery = new PipStage();
|
||||||
stageQuery.setPipelineId(pipelineId);
|
stageQuery.setPipelineId(pipelineId);
|
||||||
@ -102,10 +102,10 @@ public class StageServiceImpl extends ServiceImpl<PipStageDao, PipStage> impleme
|
|||||||
}
|
}
|
||||||
secondStage.setCreateTime(LocalDateTime.now());
|
secondStage.setCreateTime(LocalDateTime.now());
|
||||||
secondStage.setUpdateTime(LocalDateTime.now());
|
secondStage.setUpdateTime(LocalDateTime.now());
|
||||||
secondStage.setCreateUserId(loginUserId);
|
secondStage.setCreator(String.valueOf(loginUserId));
|
||||||
secondStage.setParentId(firstStageId);
|
secondStage.setParentId(firstStageId);
|
||||||
secondStage.setPipelineId(pipelineId);
|
secondStage.setPipelineId(pipelineId);
|
||||||
secondStage.setUpdateUserId(loginUserId);
|
secondStage.setUpdater(String.valueOf(loginUserId));
|
||||||
save(secondStage);
|
save(secondStage);
|
||||||
taskSort=1;
|
taskSort=1;
|
||||||
secondStageId = secondStage.getId();
|
secondStageId = secondStage.getId();
|
||||||
@ -125,8 +125,8 @@ public class StageServiceImpl extends ServiceImpl<PipStageDao, PipStage> impleme
|
|||||||
pipTask.setTaskProperties(taskProperties);
|
pipTask.setTaskProperties(taskProperties);
|
||||||
pipTask.setPipelineId(pipelineId);
|
pipTask.setPipelineId(pipelineId);
|
||||||
pipTask.setUpdateTime(LocalDateTime.now());
|
pipTask.setUpdateTime(LocalDateTime.now());
|
||||||
pipTask.setCreateUserId(loginUserId);
|
pipTask.setCreator(String.valueOf(loginUserId));
|
||||||
pipTask.setUpdateUserId(loginUserId);
|
pipTask.setUpdater(String.valueOf(loginUserId));
|
||||||
taskService.save(pipTask);
|
taskService.save(pipTask);
|
||||||
return pipTask.getId();
|
return pipTask.getId();
|
||||||
}
|
}
|
||||||
@ -258,7 +258,7 @@ public class StageServiceImpl extends ServiceImpl<PipStageDao, PipStage> impleme
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
updateStage.setUpdateUserId(loginUserId);
|
updateStage.setUpdater(String.valueOf(loginUserId));
|
||||||
updateStage.setUpdateTime(LocalDateTime.now());
|
updateStage.setUpdateTime(LocalDateTime.now());
|
||||||
if (currStageSort == null) {
|
if (currStageSort == null) {
|
||||||
updateStage.setStageName(stageName);
|
updateStage.setStageName(stageName);
|
||||||
@ -339,10 +339,10 @@ public class StageServiceImpl extends ServiceImpl<PipStageDao, PipStage> impleme
|
|||||||
List<PipTask> taskList = taskService.listByIds(stageIdList);
|
List<PipTask> taskList = taskService.listByIds(stageIdList);
|
||||||
Map<String, List<PipTask>> stageIdMap = taskList.stream().collect(Collectors.groupingBy(PipTask::getStageId));
|
Map<String, List<PipTask>> stageIdMap = taskList.stream().collect(Collectors.groupingBy(PipTask::getStageId));
|
||||||
for (PipStage secondStage : secondStageList) {
|
for (PipStage secondStage : secondStageList) {
|
||||||
secondStage.setCreateUserId(loginUserId);
|
secondStage.setCreator(String.valueOf(loginUserId));
|
||||||
secondStage.setCreateTime(LocalDateTime.now());
|
secondStage.setCreateTime(LocalDateTime.now());
|
||||||
secondStage.setUpdateTime(LocalDateTime.now());
|
secondStage.setUpdateTime(LocalDateTime.now());
|
||||||
secondStage.setUpdateUserId(loginUserId);
|
secondStage.setUpdater(String.valueOf(loginUserId));
|
||||||
secondStage.setParentId(firstStage.getId());
|
secondStage.setParentId(firstStage.getId());
|
||||||
String secondStageId = secondStage.getId();
|
String secondStageId = secondStage.getId();
|
||||||
List<PipTask> childTask = stageIdMap.get(secondStageId);
|
List<PipTask> childTask = stageIdMap.get(secondStageId);
|
||||||
@ -351,10 +351,10 @@ public class StageServiceImpl extends ServiceImpl<PipStageDao, PipStage> impleme
|
|||||||
for (PipTask pipTask : childTask) {
|
for (PipTask pipTask : childTask) {
|
||||||
pipTask.setStageId(secondStage.getId());
|
pipTask.setStageId(secondStage.getId());
|
||||||
pipTask.setId(null);
|
pipTask.setId(null);
|
||||||
pipTask.setCreateUserId(loginUserId);
|
pipTask.setCreator(String.valueOf(loginUserId));
|
||||||
pipTask.setCreateTime(LocalDateTime.now());
|
pipTask.setCreateTime(LocalDateTime.now());
|
||||||
pipTask.setUpdateTime(LocalDateTime.now());
|
pipTask.setUpdateTime(LocalDateTime.now());
|
||||||
pipTask.setUpdateUserId(loginUserId);
|
pipTask.setUpdater(String.valueOf(loginUserId));
|
||||||
}
|
}
|
||||||
taskService.saveBatch(childTask);
|
taskService.saveBatch(childTask);
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,32 @@
|
|||||||
|
package cd.casic.ci.process.process.service.target;
|
||||||
|
|
||||||
|
import cd.casic.ci.common.pipeline.req.target.TargetManagerCreateReq;
|
||||||
|
import cd.casic.ci.common.pipeline.req.target.TargetManagerUpdateReq;
|
||||||
|
import cd.casic.ci.common.pipeline.req.target.TargetQueryReq;
|
||||||
|
import cd.casic.ci.common.pipeline.resp.target.TargetManagerResp;
|
||||||
|
import cd.casic.ci.common.pipeline.utils.PageResult;
|
||||||
|
import cd.casic.ci.process.process.dataObject.base.BaseIdReq;
|
||||||
|
import cd.casic.ci.process.process.dataObject.target.TargetManager;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import jakarta.validation.Valid;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author HopeLi
|
||||||
|
* @version v1.0
|
||||||
|
* @ClassName TargetManagerService
|
||||||
|
* @Date: 2025/5/17 10:20
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
public interface TargetManagerService extends IService<TargetManager> {
|
||||||
|
void createTarget(@Valid TargetManagerCreateReq req);
|
||||||
|
|
||||||
|
void updateTarget(@Valid TargetManagerUpdateReq req);
|
||||||
|
|
||||||
|
void deleteTarget(@Valid BaseIdReq req);
|
||||||
|
|
||||||
|
PageResult<TargetManagerResp> findTargetPage(@Valid TargetQueryReq query);
|
||||||
|
|
||||||
|
List<TargetManagerResp> findTargetList(@Valid TargetQueryReq query);
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package cd.casic.ci.process.process.service.target;
|
||||||
|
|
||||||
|
import cd.casic.ci.process.process.dataObject.target.TargetVersion;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author HopeLi
|
||||||
|
* @version v1.0
|
||||||
|
* @ClassName TargetVersionService
|
||||||
|
* @Date: 2025/5/17 10:20
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
public interface TargetVersionService extends IService<TargetVersion> {
|
||||||
|
List<TargetVersion> selectListByManagerId(String targetId);
|
||||||
|
}
|
@ -0,0 +1,176 @@
|
|||||||
|
package cd.casic.ci.process.process.service.target.impl;
|
||||||
|
|
||||||
|
import cd.casic.ci.common.pipeline.req.target.TargetManagerCreateReq;
|
||||||
|
import cd.casic.ci.common.pipeline.req.target.TargetManagerUpdateReq;
|
||||||
|
import cd.casic.ci.common.pipeline.req.target.TargetQueryReq;
|
||||||
|
import cd.casic.ci.common.pipeline.resp.target.TargetManagerResp;
|
||||||
|
import cd.casic.ci.common.pipeline.utils.PageResult;
|
||||||
|
import cd.casic.ci.process.process.converter.TargetConverter;
|
||||||
|
import cd.casic.ci.process.process.dal.pipeline.TargetManagerDao;
|
||||||
|
import cd.casic.ci.process.process.dal.pipeline.TargetVersionDao;
|
||||||
|
import cd.casic.ci.process.process.dataObject.base.BaseIdReq;
|
||||||
|
import cd.casic.ci.process.process.dataObject.target.TargetManager;
|
||||||
|
import cd.casic.ci.process.process.dataObject.target.TargetVersion;
|
||||||
|
import cd.casic.ci.process.process.service.target.TargetManagerService;
|
||||||
|
import cd.casic.framework.commons.exception.ServiceException;
|
||||||
|
import cd.casic.framework.commons.exception.enums.GlobalErrorCodeConstants;
|
||||||
|
import cd.casic.framework.commons.util.object.BeanUtils;
|
||||||
|
import cd.casic.framework.commons.util.util.WebFrameworkUtils;
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.util.ObjectUtils;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author HopeLi
|
||||||
|
* @version v1.0
|
||||||
|
* @ClassName TargetManagerServiceImpl
|
||||||
|
* @Date: 2025/5/17 15:19
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Slf4j
|
||||||
|
public class TargetManagerServiceImpl extends ServiceImpl<TargetManagerDao, TargetManager> implements TargetManagerService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private TargetVersionServiceImpl targetVersionService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private TargetManagerDao targetManagerDao;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private TargetVersionDao targetVersionDao;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void createTarget(TargetManagerCreateReq req) {
|
||||||
|
TargetManager targetManager = new TargetManager();
|
||||||
|
BeanUtils.copyProperties(req, targetManager);
|
||||||
|
targetManager.setCreator(String.valueOf(WebFrameworkUtils.getLoginUserId()));
|
||||||
|
targetManager.setCreateTime(LocalDateTime.now());
|
||||||
|
this.save(targetManager);
|
||||||
|
|
||||||
|
//保存第一个版本
|
||||||
|
TargetVersion targetVersion = new TargetVersion();
|
||||||
|
BeanUtil.copyProperties(targetManager,targetVersion);
|
||||||
|
targetVersion.setTargetId(targetManager.getId());
|
||||||
|
targetVersion.setFilePath(req.getFilePath());
|
||||||
|
targetVersion.setCreator(String.valueOf(WebFrameworkUtils.getLoginUserId()));
|
||||||
|
targetVersion.setCreateTime(LocalDateTime.now());
|
||||||
|
targetVersion.setFileSize(targetManager.getTotalSize());
|
||||||
|
targetVersionService.save(targetVersion);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void updateTarget(TargetManagerUpdateReq req) {
|
||||||
|
if (StringUtils.isEmpty(req.getId())){
|
||||||
|
throw new ServiceException(GlobalErrorCodeConstants.INTERNAL_SERVER_ERROR.getCode(),"id不能为空");
|
||||||
|
}
|
||||||
|
|
||||||
|
TargetManager targetManager = targetManagerDao.selectById(req.getId());
|
||||||
|
if (ObjectUtils.isEmpty(targetManager)){
|
||||||
|
throw new ServiceException(GlobalErrorCodeConstants.INTERNAL_SERVER_ERROR.getCode(),"数据错误,请联系管理员");
|
||||||
|
}
|
||||||
|
|
||||||
|
BeanUtils.copyProperties(req,targetManager);
|
||||||
|
targetManager.setUpdater(String.valueOf(WebFrameworkUtils.getLoginUserId()));
|
||||||
|
targetManager.setUpdateTime(LocalDateTime.now());
|
||||||
|
targetManagerDao.updateById(targetManager);
|
||||||
|
|
||||||
|
//新增一条版本信息
|
||||||
|
TargetVersion targetVersion = new TargetVersion();
|
||||||
|
BeanUtil.copyProperties(targetManager,targetVersion);
|
||||||
|
targetVersion.setTargetId(targetManager.getId());
|
||||||
|
targetVersion.setFilePath(req.getFilePath());
|
||||||
|
targetVersion.setCreator(String.valueOf(WebFrameworkUtils.getLoginUserId()));
|
||||||
|
targetVersion.setCreateTime(LocalDateTime.now());
|
||||||
|
targetVersion.setFileSize(targetManager.getTotalSize());
|
||||||
|
targetVersionService.save(targetVersion);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void deleteTarget(BaseIdReq req) {
|
||||||
|
if (StringUtils.isEmpty(req.getId())){
|
||||||
|
throw new ServiceException(GlobalErrorCodeConstants.INTERNAL_SERVER_ERROR.getCode(),"id不能为空");
|
||||||
|
}
|
||||||
|
|
||||||
|
TargetManager targetManager = targetManagerDao.selectById(req.getId());
|
||||||
|
if (ObjectUtils.isEmpty(targetManager)){
|
||||||
|
throw new ServiceException(GlobalErrorCodeConstants.INTERNAL_SERVER_ERROR.getCode(),"数据错误,请联系管理员");
|
||||||
|
}
|
||||||
|
targetManagerDao.deleteById(targetManager.getId());
|
||||||
|
|
||||||
|
//删除对应的version版本
|
||||||
|
List<TargetVersion> versionList = targetVersionService.selectListByManagerId(targetManager.getId());
|
||||||
|
List<String> versionIdList = versionList.stream().map(TargetVersion::getId).toList();
|
||||||
|
targetVersionDao.deleteByIds(versionIdList);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<TargetManagerResp> findTargetPage(TargetQueryReq query) {
|
||||||
|
Page<TargetManagerResp> respPage = new Page<>();
|
||||||
|
|
||||||
|
QueryWrapper<TargetManager> wrapper = new QueryWrapper<>();
|
||||||
|
if (!ObjectUtils.isEmpty(query.getId())){
|
||||||
|
wrapper.eq("id",query.getId());
|
||||||
|
}
|
||||||
|
if (!ObjectUtils.isEmpty(query.getIdList())){
|
||||||
|
wrapper.in("id",query.getId());
|
||||||
|
}
|
||||||
|
if (!ObjectUtils.isEmpty(query.getTargetName())){
|
||||||
|
wrapper.like("target_name",query.getTargetName());
|
||||||
|
}
|
||||||
|
if (!ObjectUtils.isEmpty(query.getCreator())){
|
||||||
|
wrapper.eq("creator",query.getCreator());
|
||||||
|
}
|
||||||
|
|
||||||
|
Page<TargetManager> targetManagerPage = targetManagerDao.selectPage(new Page<>(query.getPageNo(), query.getPageSize()), wrapper);
|
||||||
|
|
||||||
|
if (ObjectUtils.isEmpty(targetManagerPage)){
|
||||||
|
return new PageResult<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
List<TargetManagerResp> respList = TargetConverter.INSTANCE.toRespList(targetManagerPage.getRecords());
|
||||||
|
|
||||||
|
respPage.setRecords(respList);
|
||||||
|
PageResult<TargetManagerResp> pageResult = new PageResult<>(respPage);
|
||||||
|
return pageResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<TargetManagerResp> findTargetList(TargetQueryReq query) {
|
||||||
|
QueryWrapper<TargetManager> wrapper = new QueryWrapper<>();
|
||||||
|
if (!ObjectUtils.isEmpty(query.getId())){
|
||||||
|
wrapper.eq("id",query.getId());
|
||||||
|
}
|
||||||
|
if (!ObjectUtils.isEmpty(query.getIdList())){
|
||||||
|
wrapper.in("id",query.getId());
|
||||||
|
}
|
||||||
|
if (!ObjectUtils.isEmpty(query.getTargetName())){
|
||||||
|
wrapper.like("target_name",query.getTargetName());
|
||||||
|
}
|
||||||
|
if (!ObjectUtils.isEmpty(query.getCreator())){
|
||||||
|
wrapper.eq("creator",query.getCreator());
|
||||||
|
}
|
||||||
|
List<TargetManager> targetManagerList = targetManagerDao.selectList(wrapper);
|
||||||
|
if (ObjectUtils.isEmpty(targetManagerList)){
|
||||||
|
return new ArrayList<>(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
List<TargetManagerResp> respList = TargetConverter.INSTANCE.toRespList(targetManagerList);
|
||||||
|
|
||||||
|
return respList;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,39 @@
|
|||||||
|
package cd.casic.ci.process.process.service.target.impl;
|
||||||
|
|
||||||
|
import cd.casic.ci.process.process.dal.pipeline.TargetVersionDao;
|
||||||
|
import cd.casic.ci.process.process.dataObject.target.TargetVersion;
|
||||||
|
import cd.casic.ci.process.process.service.target.TargetVersionService;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author HopeLi
|
||||||
|
* @version v1.0
|
||||||
|
* @ClassName TargetVersionServiceImpl
|
||||||
|
* @Date: 2025/5/17 15:20
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Slf4j
|
||||||
|
public class TargetVersionServiceImpl extends ServiceImpl<TargetVersionDao, TargetVersion> implements TargetVersionService {
|
||||||
|
@Resource
|
||||||
|
private TargetVersionDao targetVersionDao;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<TargetVersion> selectListByManagerId(String targetId) {
|
||||||
|
QueryWrapper<TargetVersion> wrapper = new QueryWrapper<>();
|
||||||
|
wrapper.eq("target_id",targetId);
|
||||||
|
List<TargetVersion> versionList = targetVersionDao.selectList(wrapper);
|
||||||
|
if (CollectionUtils.isEmpty(versionList)){
|
||||||
|
return new ArrayList<>(0);
|
||||||
|
}
|
||||||
|
return versionList;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,80 @@
|
|||||||
|
package cd.casic.server.controller;
|
||||||
|
|
||||||
|
import cd.casic.ci.common.pipeline.req.target.TargetManagerCreateReq;
|
||||||
|
import cd.casic.ci.common.pipeline.req.target.TargetManagerUpdateReq;
|
||||||
|
import cd.casic.ci.common.pipeline.req.target.TargetQueryReq;
|
||||||
|
import cd.casic.ci.common.pipeline.resp.target.TargetManagerResp;
|
||||||
|
import cd.casic.ci.common.pipeline.utils.PageResult;
|
||||||
|
import cd.casic.ci.process.process.dataObject.base.BaseIdReq;
|
||||||
|
import cd.casic.ci.process.process.service.target.TargetManagerService;
|
||||||
|
import cd.casic.ci.process.process.service.target.TargetVersionService;
|
||||||
|
import cd.casic.framework.commons.pojo.CommonResult;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import jakarta.validation.Valid;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author HopeLi
|
||||||
|
* @version v1.0
|
||||||
|
* @ClassName TargetController
|
||||||
|
* @Date: 2025/5/17 10:15
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/target")
|
||||||
|
public class TargetController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private TargetManagerService targetManagerService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private TargetVersionService targetVersionService;
|
||||||
|
|
||||||
|
@PostMapping(value = "/createTarget")
|
||||||
|
public CommonResult<Void> createTarget(@RequestBody @Valid TargetManagerCreateReq req) {
|
||||||
|
|
||||||
|
targetManagerService.createTarget(req);
|
||||||
|
return CommonResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping(value = "/updateTarget")
|
||||||
|
public CommonResult<Void> updateTarget(@RequestBody @Valid TargetManagerUpdateReq req) {
|
||||||
|
|
||||||
|
targetManagerService.updateTarget(req);
|
||||||
|
return CommonResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping(value = "/deleteTarget")
|
||||||
|
public CommonResult<Void> deleteTarget(@RequestBody @Valid BaseIdReq req) {
|
||||||
|
|
||||||
|
targetManagerService.deleteTarget(req);
|
||||||
|
return CommonResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping(path="/findTargetPage")
|
||||||
|
public CommonResult<PageResult<TargetManagerResp>> findTargetPage(@RequestBody @NotNull @Valid TargetQueryReq query){
|
||||||
|
|
||||||
|
PageResult<TargetManagerResp> respPage = targetManagerService.findTargetPage(query);
|
||||||
|
|
||||||
|
return CommonResult.success(respPage);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping(path="/findTargetList")
|
||||||
|
public CommonResult<List<TargetManagerResp>> findTargetList(@RequestBody @Valid TargetQueryReq query){
|
||||||
|
|
||||||
|
List<TargetManagerResp> respList = targetManagerService.findTargetList(query);
|
||||||
|
|
||||||
|
return CommonResult.success(respList);
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user