feat(制品库功能完善): 受控库和产品库 均增加 名称和标识字段
从受控库移入制品到产品库时,文件夹路径前缀由受控库标识调整为受控库名称
This commit is contained in:
parent
61fab7489f
commit
7fc3070728
|
|
@ -49,7 +49,7 @@ public class PmsProductLibraryRepositoriesController extends BaseController {
|
|||
@GetMapping("/byRepoName/{repoName}")
|
||||
@ApiOperation(value = "获取制品库详情")
|
||||
public GenericsAjaxResult<PmsProductLibraryRepositoriesDataVo> getByRepoName(@PathVariable String enterpriseIdentifier,
|
||||
@ApiParam(value = "制品库名称", required = true) @PathVariable String repoName) {
|
||||
@ApiParam(value = "制品库标识", required = true) @PathVariable String repoName) {
|
||||
return GenericsAjaxResult.success(pmsProductLibraryRepositoriesService.selectPmsProductLibraryRepositoriesDataByName(enterpriseIdentifier, repoName));
|
||||
}
|
||||
|
||||
|
|
@ -61,7 +61,7 @@ public class PmsProductLibraryRepositoriesController extends BaseController {
|
|||
@ApiOperation(value = "查询制品库列表")
|
||||
public GenericsTableDataInfo<PmsProductLibraryRepositoriesSimpleVo> list(
|
||||
@PathVariable String enterpriseIdentifier,
|
||||
@ApiParam("制品库格式") PmsProductLibraryRepositoriesSearchVo searchVo) {
|
||||
@ApiParam("制品库搜索") PmsProductLibraryRepositoriesSearchVo searchVo) {
|
||||
startPage();
|
||||
return pmsProductLibraryRepositoriesService.selectPmsProductLibraryRepositoriesPageList(enterpriseIdentifier, searchVo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,9 +31,9 @@ public class PmsProductLibraryRepositories extends BaseEntity {
|
|||
private Long id;
|
||||
|
||||
/**
|
||||
* 制品仓库名称
|
||||
* 制品仓库标识
|
||||
*/
|
||||
@ApiModelProperty(value = "制品仓库名称")
|
||||
@ApiModelProperty(value = "制品仓库标识")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
|
|
@ -83,11 +83,10 @@ public class PmsProductLibraryRepositories extends BaseEntity {
|
|||
private String attributes;
|
||||
|
||||
/**
|
||||
* 预留字段1
|
||||
* 制品仓库名称
|
||||
*/
|
||||
@ApiModelProperty(value = "预留字段1")
|
||||
@JsonInclude(JsonInclude.Include.NON_EMPTY)
|
||||
private String reservedField1;
|
||||
@ApiModelProperty(value = "制品仓库名称")
|
||||
private String alias;
|
||||
|
||||
/**
|
||||
* 预留字段2
|
||||
|
|
|
|||
|
|
@ -17,10 +17,14 @@ import javax.validation.constraints.Pattern;
|
|||
@Data
|
||||
@ApiModel("虚拟仓库输入对象")
|
||||
public class GroupRepositoriesInputVo extends GroupRepositoriesOperateVo {
|
||||
@ApiModelProperty(value = "虚拟仓库标识")
|
||||
@NotBlank(message = "虚拟仓库标识不能为空")
|
||||
@Pattern(regexp = "^[A-Za-z0-9](?!_)(?!\\.)[A-Za-z0-9_\\-.]*$", message = "虚拟仓库标识不符合规范")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "虚拟仓库名称")
|
||||
@NotBlank(message = "虚拟仓库名称不能为空")
|
||||
@Pattern(regexp = "^[A-Za-z0-9](?!_)(?!\\.)[A-Za-z0-9_\\-.]*$", message = "虚拟仓库名称不符合规范")
|
||||
private String name;
|
||||
private String alias;
|
||||
|
||||
@Override
|
||||
public NexusGroupRepoInputVo toNexusGroupRepoInputVo() {
|
||||
|
|
@ -33,6 +37,7 @@ public class GroupRepositoriesInputVo extends GroupRepositoriesOperateVo {
|
|||
public PmsProductLibraryRepositories toPmsProductLibraryRepositories() {
|
||||
PmsProductLibraryRepositories target = super.toPmsProductLibraryRepositories();
|
||||
target.setName(name);
|
||||
target.setAlias(alias);
|
||||
return target;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,8 +22,10 @@ import javax.validation.constraints.NotNull;
|
|||
public class GroupRepositoriesOperateVo {
|
||||
@ApiModelProperty(value = "制品库Id", hidden = true)
|
||||
private Long id;
|
||||
@ApiModelProperty(value = "虚拟仓库名称", hidden = true)
|
||||
@ApiModelProperty(value = "虚拟仓库标识", hidden = true)
|
||||
private String name;
|
||||
@ApiModelProperty(value = "虚拟仓库名称")
|
||||
private String alias;
|
||||
@ApiModelProperty(value = "企业标识", hidden = true)
|
||||
private String enterpriseIdentifier;
|
||||
@ApiModelProperty(value = "制品库类型", hidden = true)
|
||||
|
|
|
|||
|
|
@ -17,15 +17,19 @@ import javax.validation.constraints.Pattern;
|
|||
@Data
|
||||
@ApiModel("托管制品库输入对象")
|
||||
public class HostedRepositoriesInputVo extends HostedRepositoriesOperateVo {
|
||||
@ApiModelProperty(value = "制品仓库名称")
|
||||
@NotBlank(message = "制品库名称不能为空")
|
||||
@Pattern(regexp = "^[A-Za-z0-9](?!_)(?!\\.)[A-Za-z0-9_\\-.]*$", message = "制品库名称不符合规范")
|
||||
@ApiModelProperty(value = "制品库标识")
|
||||
@NotBlank(message = "制品库标识不能为空")
|
||||
@Pattern(regexp = "^[A-Za-z0-9](?!_)(?!\\.)[A-Za-z0-9_\\-.]*$", message = "制品库标识不符合规范")
|
||||
private String name;
|
||||
@ApiModelProperty(value = "制品库名称")
|
||||
@NotBlank(message = "制品库名称不能为空")
|
||||
private String alias;
|
||||
|
||||
@Override
|
||||
public PmsProductLibraryRepositories toPmsProductLibraryRepositories() {
|
||||
PmsProductLibraryRepositories target = super.toPmsProductLibraryRepositories();
|
||||
target.setName(name);
|
||||
target.setAlias(alias);
|
||||
return target;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,9 @@ import javax.validation.Valid;
|
|||
public class HostedRepositoriesOperateVo {
|
||||
@ApiModelProperty(value = "制品库Id", hidden = true)
|
||||
private Long id;
|
||||
@ApiModelProperty(value = "制品库名称", hidden = true)
|
||||
@ApiModelProperty(value = "制品库名称")
|
||||
private String alias;
|
||||
@ApiModelProperty(value = "制品库标识", hidden = true)
|
||||
private String name;
|
||||
@ApiModelProperty(value = "企业标识", hidden = true)
|
||||
private String enterpriseIdentifier;
|
||||
|
|
|
|||
|
|
@ -20,12 +20,12 @@ public class PmsProductLibraryRepositoriesDataVo {
|
|||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 制品仓库名称
|
||||
*/
|
||||
@ApiModelProperty(value = "制品仓库名称")
|
||||
@ApiModelProperty(value = "制品仓库标识")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "制品仓库名称")
|
||||
private String alias;
|
||||
|
||||
/**
|
||||
* 制品仓库名称类型
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -15,11 +15,11 @@ import lombok.Data;
|
|||
public class PmsProductLibraryRepositoriesSearchVo {
|
||||
|
||||
|
||||
/**
|
||||
* 制品仓库名称
|
||||
*/
|
||||
@ApiModelProperty(value = "模糊搜索制品库名称")
|
||||
@ApiModelProperty(value = "模糊搜索制品库标识")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "模糊搜索制品库标识")
|
||||
private String alias;
|
||||
/**
|
||||
* 制品仓库名称类型
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -22,12 +22,12 @@ public class PmsProductLibraryRepositoriesSimpleVo {
|
|||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 制品仓库名称
|
||||
*/
|
||||
@ApiModelProperty(value = "制品仓库名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "制品仓库名称")
|
||||
private String alias;
|
||||
|
||||
/**
|
||||
* 制品仓库名称类型
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -17,10 +17,14 @@ import javax.validation.constraints.Pattern;
|
|||
@Data
|
||||
@ApiModel("产品库输入对象")
|
||||
public class ProductRepositoriesInputVo extends ProductRepositoriesOperateVo {
|
||||
@ApiModelProperty(value = "产品库标识")
|
||||
@NotBlank(message = "产品库标识不能为空")
|
||||
@Pattern(regexp = "^[A-Za-z0-9](?!_)(?!\\.)[A-Za-z0-9_\\-.]*$", message = "产品库标识不符合规范")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "产品库名称")
|
||||
@NotBlank(message = "产品库名称不能为空")
|
||||
@Pattern(regexp = "^[A-Za-z0-9](?!_)(?!\\.)[A-Za-z0-9_\\-.]*$", message = "产品库名称不符合规范")
|
||||
private String name;
|
||||
private String alias;
|
||||
|
||||
@Override
|
||||
public NexusHostedRepoInputVo toNexusRepoDataVo() {
|
||||
|
|
@ -33,6 +37,7 @@ public class ProductRepositoriesInputVo extends ProductRepositoriesOperateVo {
|
|||
public PmsProductLibraryRepositories toPmsProductLibraryRepositories() {
|
||||
PmsProductLibraryRepositories target = super.toPmsProductLibraryRepositories();
|
||||
target.setName(name);
|
||||
target.setAlias(alias);
|
||||
return target;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,9 +18,11 @@ import lombok.Data;
|
|||
@Data
|
||||
@ApiModel("产品库操作对象")
|
||||
public class ProductRepositoriesOperateVo {
|
||||
@ApiModelProperty(value = "产品库标识", hidden = true)
|
||||
@ApiModelProperty(value = "产品库Id", hidden = true)
|
||||
private Long id;
|
||||
@ApiModelProperty(value = "产品库名称", hidden = true)
|
||||
@ApiModelProperty(value = "产品库名称")
|
||||
private String alias;
|
||||
@ApiModelProperty(value = "产品库标识", hidden = true)
|
||||
private String name;
|
||||
@ApiModelProperty(value = "企业标识", hidden = true)
|
||||
private String enterpriseIdentifier;
|
||||
|
|
@ -31,6 +33,7 @@ public class ProductRepositoriesOperateVo {
|
|||
@ApiModelProperty(value = "产品库描述")
|
||||
private String describe;
|
||||
|
||||
|
||||
public NexusHostedRepoInputVo toNexusRepoDataVo() {
|
||||
NexusHostedRepoInputVo target = new NexusHostedRepoInputVo();
|
||||
BeanUtils.copyProperties(this, target);
|
||||
|
|
|
|||
|
|
@ -258,7 +258,7 @@ public class PmsProductLibraryAsyncServiceImpl implements IPmsProductLibraryAsyn
|
|||
componentRawInputVo.setAttributes(nexusAssetResultDataVo.getAttributes().getJSONObject("customAttribute").toJSONString());
|
||||
}
|
||||
componentRawInputVo.setAssetList(assetRawInputVoList);
|
||||
componentRawInputVo.setDirectory(String.format("/%s/%s", repo.getName(), nexusAssetResultDataVo.getDirectory()));
|
||||
componentRawInputVo.setDirectory(String.format("/%s/%s", repo.getAlias(), nexusAssetResultDataVo.getDirectory()));
|
||||
pmsProductLibraryComponentService.insertRawComponent(componentRawInputVo);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ import com.microservices.pms.productLibrary.service.IPmsProductLibraryProductRep
|
|||
import com.microservices.pms.productLibrary.service.IPmsProductLibraryRepositoriesService;
|
||||
import com.microservices.pms.utils.NexusRequestHelper;
|
||||
import com.microservices.pms.utils.NexusRequestUrl;
|
||||
import com.microservices.pms.utils.PmsUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
|
@ -252,7 +253,7 @@ public class PmsProductLibraryProductRepoServiceImpl implements IPmsProductLibra
|
|||
nexusResultDataVoList.forEach(x -> {
|
||||
String decodeId = ServletUtils.urlDecode(x.getId());
|
||||
// 去除多余连接符
|
||||
String nexusComponentId = repo.getName() + "/" + decodeId.replaceAll("/-/", "/");
|
||||
String nexusComponentId = PmsUtils.encodeChineseCharacters(repo.getAlias()) + "/" + decodeId.replaceAll("/-/", "/");
|
||||
String componentPath = component.getPath().replaceAll("/-/", "/");
|
||||
if (nexusComponentId.equals(componentPath)) {
|
||||
x.setIsChoose(true);
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<result property="createBy" column="create_by"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="attributes" column="attributes"/>
|
||||
<result property="reservedField1" column="reserved_field_1"/>
|
||||
<result property="alias" column="alias"/>
|
||||
<result property="snapshotName" column="snapshot_name"/>
|
||||
<result property="format" column="format"/>
|
||||
<result property="pmsEnterpriseIdentifier" column="enterprise_identifier"/>
|
||||
|
|
@ -36,7 +36,7 @@
|
|||
pplr.create_by,
|
||||
pplr.del_flag,
|
||||
pplr.attributes,
|
||||
pplr.reserved_field_1,
|
||||
pplr.alias,
|
||||
pplr.snapshot_name,
|
||||
pplr.format,
|
||||
pe.enterprise_identifier
|
||||
|
|
@ -151,7 +151,7 @@
|
|||
<if test="createBy != null">create_by,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="attributes != null">attributes,</if>
|
||||
<if test="reservedField1 != null">reserved_field_1,</if>
|
||||
<if test="alias != null">alias,</if>
|
||||
<if test="snapshotName != null">snapshot_name,</if>
|
||||
<if test="format != null">format,</if>
|
||||
</trim>
|
||||
|
|
@ -167,7 +167,7 @@
|
|||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="attributes != null">#{attributes},</if>
|
||||
<if test="reservedField1 != null">#{reservedField1},</if>
|
||||
<if test="alias != null">#{alias},</if>
|
||||
<if test="snapshotName != null">#{snapshotName},</if>
|
||||
<if test="format != null">#{format},</if>
|
||||
</trim>
|
||||
|
|
@ -187,7 +187,7 @@
|
|||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="attributes != null">attributes = #{attributes},</if>
|
||||
<if test="reservedField1 != null">reserved_field_1 = #{reservedField1},</if>
|
||||
<if test="alias != null">alias = #{alias},</if>
|
||||
<if test="snapshotName != null">snapshot_name = #{snapshotName},</if>
|
||||
<if test="format != null">format = #{format},</if>
|
||||
</trim>
|
||||
|
|
|
|||
Loading…
Reference in New Issue