feat(软件发展新技术课题联调): 产品库逻辑调整
产品版本(原产品库)新增产品版本号和关联产品标识字段 Signed-off-by: OTTO <731554297@qq.com>
This commit is contained in:
parent
ec209cb0e0
commit
a53437d060
|
|
@ -54,7 +54,7 @@ public class PmsProductLibraryController extends BaseController {
|
|||
// @RequiresPermissions("pms:pmsProductLibraryRepositories:list")
|
||||
@GetMapping("/byRepoName/{repoName}")
|
||||
@ApiOperation(value = "获取产品库详情")
|
||||
public GenericsAjaxResult<PmsProductLibraryRepositoriesDataVo> getByRepoName(@PathVariable String enterpriseIdentifier,
|
||||
public GenericsAjaxResult<PmsProductLibraryDataVo> getByRepoName(@PathVariable String enterpriseIdentifier,
|
||||
@ApiParam(value = "产品库标识", required = true) @PathVariable String repoName) {
|
||||
return GenericsAjaxResult.success(pmsProductLibraryService.selectPmsProductLibraryDataByName(enterpriseIdentifier, repoName));
|
||||
}
|
||||
|
|
@ -67,9 +67,10 @@ public class PmsProductLibraryController extends BaseController {
|
|||
@ApiOperation(value = "查询产品库列表")
|
||||
public GenericsTableDataInfo<PmsProductLibrarySimpleVo> list(
|
||||
@PathVariable String enterpriseIdentifier,
|
||||
@ApiParam("模糊搜索产品库标识") String name) {
|
||||
@ApiParam("产品库搜索条件") PmsProductLibrarySearchVo pmsProductLibrarySearchVo) {
|
||||
pmsProductLibrarySearchVo.setPmsEnterpriseIdentifier(enterpriseIdentifier);
|
||||
startPage();
|
||||
return pmsProductLibraryService.selectPmsProductLibraryPageList(enterpriseIdentifier, name);
|
||||
return pmsProductLibraryService.selectPmsProductLibraryPageList(pmsProductLibrarySearchVo);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -91,6 +91,14 @@ public class PmsProductLibraryRepositories extends BaseEntity {
|
|||
@ApiModelProperty(value = "打包的文件标识")
|
||||
private String packagedFileIdentifier;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "关联产品标识")
|
||||
private String productIdentifier;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "产品版本号")
|
||||
private String version;
|
||||
|
||||
public RepoAttributesVo getRepoAttributes() {
|
||||
return JSONObject.parseObject(this.attributes, RepoAttributesVo.class);
|
||||
}
|
||||
|
|
@ -102,6 +110,13 @@ public class PmsProductLibraryRepositories extends BaseEntity {
|
|||
return target;
|
||||
}
|
||||
|
||||
public PmsProductLibraryDataVo toPmsProductLibraryDataVo() {
|
||||
PmsProductLibraryDataVo target = new PmsProductLibraryDataVo();
|
||||
BeanUtils.copyProperties(this, target);
|
||||
target.setAttributes(JSONObject.parseObject(attributes));
|
||||
return target;
|
||||
}
|
||||
|
||||
public PmsProductLibraryRepositoriesSimpleVo toPmsProductLibraryRepositoriesSimpleVo() {
|
||||
PmsProductLibraryRepositoriesSimpleVo target = new PmsProductLibraryRepositoriesSimpleVo();
|
||||
BeanUtils.copyProperties(this, target);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,58 @@
|
|||
package com.microservices.pms.productLibrary.domain.vo;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 制品库数据对象
|
||||
*
|
||||
* @author otto
|
||||
* @date 2024-07-11
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("产品库数据对象")
|
||||
public class PmsProductLibraryDataVo {
|
||||
|
||||
/**
|
||||
* 制品仓库ID
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "产品版本标识")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "产品版本名称")
|
||||
private String alias;
|
||||
|
||||
/**
|
||||
* 制品仓库名称类型
|
||||
*/
|
||||
@ApiModelProperty(value = "制品库类型")
|
||||
private String type;
|
||||
|
||||
@ApiModelProperty(value = "制品库格式")
|
||||
private String format;
|
||||
|
||||
/**
|
||||
* 制品仓库访问路径
|
||||
*/
|
||||
@ApiModelProperty(value = "制品仓库访问路径")
|
||||
private String url;
|
||||
|
||||
|
||||
/**
|
||||
* 其他属性
|
||||
*/
|
||||
@ApiModelProperty(value = "其他属性")
|
||||
private JSONObject attributes;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "关联产品标识")
|
||||
private String productIdentifier;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "产品版本号")
|
||||
private String version;
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
package com.microservices.pms.productLibrary.domain.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 制品库数据对象
|
||||
*
|
||||
* @author otto
|
||||
* @date 2024-07-11
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("产品库搜索对象")
|
||||
public class PmsProductLibrarySearchVo {
|
||||
|
||||
@ApiModelProperty(value = "产品版本标识")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "产品版本名称")
|
||||
private String alias;
|
||||
|
||||
@ApiModelProperty(value = "关联产品标识")
|
||||
private String productIdentifier;
|
||||
|
||||
@ApiModelProperty(value = "关联企业标识", hidden = true)
|
||||
private String pmsEnterpriseIdentifier;
|
||||
}
|
||||
|
|
@ -19,4 +19,11 @@ public class PmsProductLibrarySimpleVo extends PmsProductLibraryRepositoriesSimp
|
|||
*/
|
||||
@ApiModelProperty(value = "其他属性")
|
||||
private JSONObject attributes;
|
||||
|
||||
@ApiModelProperty(value = "关联产品标识")
|
||||
private String productIdentifier;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "产品版本号")
|
||||
private String version;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,15 +17,24 @@ import javax.validation.constraints.Pattern;
|
|||
@Data
|
||||
@ApiModel("产品库输入对象")
|
||||
public class ProductRepositoriesInputVo extends ProductRepositoriesOperateVo {
|
||||
@ApiModelProperty(value = "产品库标识")
|
||||
@ApiModelProperty(value = "产品库标识", required = true)
|
||||
@NotBlank(message = "产品库标识不能为空")
|
||||
@Pattern(regexp = "^[A-Za-z0-9](?!_)(?!\\.)[A-Za-z0-9_\\-.]*$", message = "产品库标识不符合规范")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "产品库名称")
|
||||
@ApiModelProperty(value = "产品库名称", required = true)
|
||||
@NotBlank(message = "产品库名称不能为空")
|
||||
private String alias;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "关联产品标识", required = true)
|
||||
@NotBlank(message = "关联产品标识不能为空")
|
||||
private String productIdentifier;
|
||||
|
||||
@ApiModelProperty(value = "产品版本号", required = true)
|
||||
@NotBlank(message = "产品版本号不能为空")
|
||||
private String version;
|
||||
|
||||
@Override
|
||||
public NexusHostedRepoInputVo toNexusRepoDataVo() {
|
||||
NexusHostedRepoInputVo target = super.toNexusRepoDataVo();
|
||||
|
|
@ -38,6 +47,8 @@ public class ProductRepositoriesInputVo extends ProductRepositoriesOperateVo {
|
|||
PmsProductLibraryRepositories target = super.toPmsProductLibraryRepositories();
|
||||
target.setName(name);
|
||||
target.setAlias(alias);
|
||||
target.setProductIdentifier(productIdentifier);
|
||||
target.setVersion(version);
|
||||
return target;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,6 +33,12 @@ public class ProductRepositoriesOperateVo {
|
|||
@ApiModelProperty(value = "产品库描述")
|
||||
private String describe;
|
||||
|
||||
@ApiModelProperty(value = "关联产品标识")
|
||||
private String productIdentifier;
|
||||
|
||||
@ApiModelProperty(value = "产品版本号")
|
||||
private String version;
|
||||
|
||||
|
||||
public NexusHostedRepoInputVo toNexusRepoDataVo() {
|
||||
NexusHostedRepoInputVo target = new NexusHostedRepoInputVo();
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.microservices.pms.productLibrary.mapper;
|
||||
|
||||
import com.microservices.pms.productLibrary.domain.PmsProductLibraryRepositories;
|
||||
import com.microservices.pms.productLibrary.domain.vo.PmsProductLibrarySearchVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
|
|
@ -121,11 +122,10 @@ public interface PmsProductLibraryRepositoriesMapper {
|
|||
/**
|
||||
* 查询产品库列表
|
||||
*
|
||||
* @param pmsEnterpriseIdentifier 组织标识
|
||||
* @param name 产品库标识
|
||||
* @param searchVo 产品库标识
|
||||
* @return 产品库列表
|
||||
*/
|
||||
List<PmsProductLibraryRepositories> selectPmsProductLibraryList(@Param("pmsEnterpriseIdentifier") String pmsEnterpriseIdentifier, @Param("name") String name);
|
||||
List<PmsProductLibraryRepositories> selectPmsProductLibraryList(PmsProductLibrarySearchVo searchVo);
|
||||
|
||||
List<PmsProductLibraryRepositories> selectPmsProductLibrarySnapshotPageList(@Param("pmsEnterpriseIdentifier") String pmsEnterpriseIdentifier, @Param("repoName") String repoName, @Param("snapshotName") String snapshotName);
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ public interface IPmsProductLibraryService {
|
|||
|
||||
GenericsTableDataInfo<PmsProductLibraryComponentDataVo> selectComponentList(PmsProductLibraryComponentSearchVo search);
|
||||
|
||||
PmsProductLibraryRepositoriesDataVo selectPmsProductLibraryDataByName(String enterpriseIdentifier, String repoName);
|
||||
PmsProductLibraryDataVo selectPmsProductLibraryDataByName(String enterpriseIdentifier, String repoName);
|
||||
|
||||
/**
|
||||
* 根据组织标识和名称查找产品库
|
||||
|
|
@ -28,11 +28,10 @@ public interface IPmsProductLibraryService {
|
|||
/**
|
||||
* 查询产品库列表
|
||||
*
|
||||
* @param enterpriseIdentifier 组织标识
|
||||
* @param name 产品库标识
|
||||
* @param searchVo 产品库标识
|
||||
* @return 产品库列表
|
||||
*/
|
||||
GenericsTableDataInfo<PmsProductLibrarySimpleVo> selectPmsProductLibraryPageList(String enterpriseIdentifier, String name);
|
||||
GenericsTableDataInfo<PmsProductLibrarySimpleVo> selectPmsProductLibraryPageList(PmsProductLibrarySearchVo searchVo);
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -105,9 +105,9 @@ public class PmsProductLibraryServiceImpl implements IPmsProductLibraryService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public PmsProductLibraryRepositoriesDataVo selectPmsProductLibraryDataByName(String enterpriseIdentifier, String repoName) {
|
||||
public PmsProductLibraryDataVo selectPmsProductLibraryDataByName(String enterpriseIdentifier, String repoName) {
|
||||
PmsProductLibraryRepositories pmsProductLibraryRepositories = selectPmsProductLibraryByName(enterpriseIdentifier, repoName);
|
||||
return pmsProductLibraryRepositories.toPmsProductLibraryRepositoriesDataVo();
|
||||
return pmsProductLibraryRepositories.toPmsProductLibraryDataVo();
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -121,8 +121,8 @@ public class PmsProductLibraryServiceImpl implements IPmsProductLibraryService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public GenericsTableDataInfo<PmsProductLibrarySimpleVo> selectPmsProductLibraryPageList(String enterpriseIdentifier, String name) {
|
||||
return PageUtils.toPage(pmsProductLibraryRepositoriesMapper.selectPmsProductLibraryList(enterpriseIdentifier, name), this::toPmsProductLibrarySimpleVo);
|
||||
public GenericsTableDataInfo<PmsProductLibrarySimpleVo> selectPmsProductLibraryPageList(PmsProductLibrarySearchVo searchVo) {
|
||||
return PageUtils.toPage(pmsProductLibraryRepositoriesMapper.selectPmsProductLibraryList(searchVo), this::toPmsProductLibrarySimpleVo);
|
||||
}
|
||||
|
||||
private PmsProductLibrarySimpleVo toPmsProductLibrarySimpleVo(PmsProductLibraryRepositories pmsProductLibraryRepositories) {
|
||||
|
|
|
|||
|
|
@ -22,6 +22,8 @@
|
|||
<result property="format" column="format"/>
|
||||
<result property="pmsEnterpriseIdentifier" column="enterprise_identifier"/>
|
||||
<result property="packagedFileIdentifier" column="packaged_file_identifier"/>
|
||||
<result property="productIdentifier" column="product_identifier"/>
|
||||
<result property="version" column="version"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectPmsProductLibraryRepositoriesAliasVo">
|
||||
|
|
@ -41,6 +43,8 @@
|
|||
pplr.snapshot_name,
|
||||
pplr.format,
|
||||
pplr.packaged_file_identifier,
|
||||
pplr.product_identifier,
|
||||
pplr.version,
|
||||
pe.enterprise_identifier
|
||||
from pms_product_library_repositories pplr
|
||||
left join pms_enterprise as pe on pplr.pms_enterprise_id = pe.id
|
||||
|
|
@ -53,6 +57,9 @@
|
|||
<if test="name != null and name != ''">and pplr.name like concat('%', #{name}, '%')</if>
|
||||
<if test="type != null and type != ''">and pplr.type = #{type}</if>
|
||||
<if test="format != null and format != ''">and pplr.format = #{format}</if>
|
||||
<if test="productIdentifier != null and productIdentifier != ''">and pplr.product_identifier =
|
||||
#{productIdentifier}
|
||||
</if>
|
||||
<if test="url != null and url != ''">and pplr.url = #{url}</if>
|
||||
<if test="deptId != null ">and pplr.dept_id = #{deptId}</if>
|
||||
<if test="pmsEnterpriseId != null ">and pplr.pms_enterprise_id = #{pmsEnterpriseId}</if>
|
||||
|
|
@ -65,7 +72,11 @@
|
|||
<select id="selectPmsProductLibraryList" resultMap="PmsProductLibraryRepositoriesResult">
|
||||
<include refid="selectPmsProductLibraryRepositoriesAliasVo"/>
|
||||
<where>
|
||||
<if test="productIdentifier != null and productIdentifier != ''">and pplr.product_identifier =
|
||||
#{productIdentifier}
|
||||
</if>
|
||||
<if test="name != null and name != ''">and pplr.name like concat('%', #{name}, '%')</if>
|
||||
<if test="alias != null and alias != ''">and pplr.alias like concat('%', #{alias}, '%')</if>
|
||||
<if test="pmsEnterpriseIdentifier != null ">and pe.enterprise_identifier = #{pmsEnterpriseIdentifier}</if>
|
||||
and pplr.format = 'product'
|
||||
</where>
|
||||
|
|
@ -176,6 +187,8 @@
|
|||
<if test="snapshotName != null">snapshot_name,</if>
|
||||
<if test="packagedFileIdentifier != null">packaged_file_identifier,</if>
|
||||
<if test="format != null">format,</if>
|
||||
<if test="productIdentifier != null">product_identifier,</if>
|
||||
<if test="version != null">version,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">#{name},</if>
|
||||
|
|
@ -193,6 +206,8 @@
|
|||
<if test="snapshotName != null">#{snapshotName},</if>
|
||||
<if test="packagedFileIdentifier != null">#{packagedFileIdentifier},</if>
|
||||
<if test="format != null">#{format},</if>
|
||||
<if test="productIdentifier != null">#{productIdentifier},</if>
|
||||
<if test="version != null">#{version},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
|
@ -214,6 +229,8 @@
|
|||
<if test="snapshotName != null">snapshot_name = #{snapshotName},</if>
|
||||
<if test="packagedFileIdentifier != null">packaged_file_identifier = #{packagedFileIdentifier},</if>
|
||||
<if test="format != null">format = #{format},</if>
|
||||
<if test="productIdentifier != null">product_identifier = #{productIdentifier},</if>
|
||||
<if test="version != null">version = #{version},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
|
|
|||
Loading…
Reference in New Issue