参数清单-增加未收集状态,对应禅道BUG编号 64312

This commit is contained in:
wangzhijiang
2022-12-28 17:19:03 +08:00
parent 469265a730
commit 21a2dccbe7
4 changed files with 39 additions and 19 deletions
@@ -12,6 +12,7 @@ import java.util.Map;
*/ */
public enum ManifestStateEnum { public enum ManifestStateEnum {
COLLECTING("收集中","Collecting","收集中"), COLLECTING("收集中","Collecting","收集中"),
UNCOLLECTED("未收集","Uncollected","未收集"),
FINISHED("已完成","Finished","已完成"); FINISHED("已完成","Finished","已完成");
String name; String name;
@@ -2356,6 +2356,9 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
if(CollectionUtils.isNotEmpty(paramsCollectManifestLogEOList)){ if(CollectionUtils.isNotEmpty(paramsCollectManifestLogEOList)){
this.paramsCollectManifestLogEOService.saveBatch(paramsCollectManifestLogEOList); this.paramsCollectManifestLogEOService.saveBatch(paramsCollectManifestLogEOList);
} }
// 更新当前参数清单状态为收集中
paramsManifestEO.setState(ManifestStateEnum.COLLECTING.getValue());
this.paramsManifestEOService.updateById(paramsManifestEO);
} }
return getMsgOfIssueCollection(msgMapList, cut, "1"); return getMsgOfIssueCollection(msgMapList, cut, "1");
@@ -2531,6 +2534,9 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
if(CollectionUtils.isNotEmpty(paramsCollectManifestLogEOList)){ if(CollectionUtils.isNotEmpty(paramsCollectManifestLogEOList)){
this.paramsCollectManifestLogEOService.saveBatch(paramsCollectManifestLogEOList); this.paramsCollectManifestLogEOService.saveBatch(paramsCollectManifestLogEOList);
} }
// 更新当前参数清单状态为收集中
paramsManifestEO.setState(ManifestStateEnum.COLLECTING.getValue());
this.paramsManifestEOService.updateById(paramsManifestEO);
} }
return getMsgOfIssueCollection(msgMapList, cut, "1"); return getMsgOfIssueCollection(msgMapList, cut, "1");
@@ -170,7 +170,7 @@ public class ParamsManifestEOServiceImpl extends ServiceImpl<ParamsManifestEOMap
// 对应参数模板发布版本 前端传过来 // 对应参数模板发布版本 前端传过来
paramsManifestEO.setId(paramsManifestId); paramsManifestEO.setId(paramsManifestId);
paramsManifestEO.setProjectVersionId(projectVersionId); paramsManifestEO.setProjectVersionId(projectVersionId);
paramsManifestEO.setState(ManifestStateEnum.COLLECTING.getValue()); paramsManifestEO.setState(ManifestStateEnum.UNCOLLECTED.getValue());
paramsManifestEO.setVersion(1); // 默认版本为 1 paramsManifestEO.setVersion(1); // 默认版本为 1
Date now = new Date(); Date now = new Date();
paramsManifestEO.setCreateTime(now); paramsManifestEO.setCreateTime(now);
@@ -223,16 +223,21 @@ public class ParamsManifestEOServiceImpl extends ServiceImpl<ParamsManifestEOMap
*/ */
@Override @Override
public boolean deleteById(String id, String cut) { public boolean deleteById(String id, String cut) {
// 判断清单收集状态,已完成状态才可删除 ParamsManifestEO paramsManifestEO = this.paramsManifestEOMapper.selectById(id);
Map<String, Object> map = paramsCollectManifestEOService.isCollectFinished(id); // 如果该清单状态不是未收集,按照之前的逻辑判断是否能删除,如果是未收集 可以直接删
Boolean finish = (Boolean) map.get("finish"); if(!StringUtils.equals(ManifestStateEnum.UNCOLLECTED.getValue(),paramsManifestEO.getState())){
if (!finish) { // 判断清单收集状态,已完成状态才可删除
if (CutEnum.CN.getValue().equals(cut)) { Map<String, Object> map = paramsCollectManifestEOService.isCollectFinished(id);
throw new JeroBootException("清单收集中,无法删除!"); Boolean finish = (Boolean) map.get("finish");
} else { if (!finish) {
throw new JeroBootException("Manifest collection, and cannot be deleted!"); if (CutEnum.CN.getValue().equals(cut)) {
throw new JeroBootException("清单收集中,无法删除!");
} else {
throw new JeroBootException("Manifest collection, and cannot be deleted!");
}
} }
} }
// 关联删除配置 // 关联删除配置
LambdaQueryWrapper<ParamsConfigEO> configEOQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<ParamsConfigEO> configEOQueryWrapper = new LambdaQueryWrapper<>();
configEOQueryWrapper.eq(ParamsConfigEO::getParamsManifestId, id); configEOQueryWrapper.eq(ParamsConfigEO::getParamsManifestId, id);
@@ -269,15 +274,21 @@ public class ParamsManifestEOServiceImpl extends ServiceImpl<ParamsManifestEOMap
public boolean deleteByIds(List<String> ids, String cut) { public boolean deleteByIds(List<String> ids, String cut) {
// 判断清单收集状态,已完成状态才可删除 // 判断清单收集状态,已完成状态才可删除
ids.forEach(id-> { ids.forEach(id-> {
Map<String, Object> map = paramsCollectManifestEOService.isCollectFinished(id); ParamsManifestEO paramsManifestEO = this.paramsManifestEOMapper.selectById(id);
Boolean finish = (Boolean) map.get("finish"); if(paramsManifestEO != null){
if (!finish) { // 如果该清单状态不是未收集,按照之前的逻辑判断是否能删除,如果是未收集 可以直接删
ParamsManifestEO manifestEO = getById(id); if(!StringUtils.equals(ManifestStateEnum.UNCOLLECTED.getValue(),paramsManifestEO.getState())){
Map<String, Object> map = paramsCollectManifestEOService.isCollectFinished(id);
Boolean finish = (Boolean) map.get("finish");
if (!finish) {
ParamsManifestEO manifestEO = getById(id);
if (CutEnum.CN.getValue().equals(cut)) { if (CutEnum.CN.getValue().equals(cut)) {
throw new JeroBootException("清单:" + manifestEO.getTitle() + "收集中,无法删除!"); throw new JeroBootException("清单:" + manifestEO.getTitle() + "收集中,无法删除!");
} else { } else {
throw new JeroBootException("Manifest " + manifestEO.getTitle() + "collection, and cannot be deleted!"); throw new JeroBootException("Manifest " + manifestEO.getTitle() + "collection, and cannot be deleted!");
}
}
} }
} }
}); });
@@ -729,7 +740,7 @@ public class ParamsManifestEOServiceImpl extends ServiceImpl<ParamsManifestEOMap
// 添加参数清单 // 添加参数清单
paramsManifestEO.setId(addManifestId); paramsManifestEO.setId(addManifestId);
paramsManifestEO.setState(ManifestStateEnum.COLLECTING.getValue()); paramsManifestEO.setState(ManifestStateEnum.UNCOLLECTED.getValue());
paramsManifestEO.setVersion(1); // 默认版本为 1 paramsManifestEO.setVersion(1); // 默认版本为 1
save(paramsManifestEO); save(paramsManifestEO);
@@ -395,7 +395,7 @@
}) })
if (flag) { if (flag) {
let param = { let param = {
ids: this.selectedRowKeysArray ids: this.selectedRowKeys.join(',')
} }
if (this.selectedRowKeys.length > 0) { if (this.selectedRowKeys.length > 0) {
let _this = this let _this = this
@@ -408,6 +408,7 @@
_this.getlist() _this.getlist()
} else { } else {
_this.$message.warning(_this.$t('operationFailed')) _this.$message.warning(_this.$t('operationFailed'))
this.selectedRowKeys = []
} }
}) })
} }
@@ -432,6 +433,7 @@
this.getlist() this.getlist()
}, },
getlist() { getlist() {
this.selectedRowKeys = []
let query = { let query = {
projectId: this.$route.query.parentId ? this.$route.query.parentId : this.$route.query.id, projectId: this.$route.query.parentId ? this.$route.query.parentId : this.$route.query.id,
pageSize: this.pageSize, pageSize: this.pageSize,