|
@@ -441,11 +441,11 @@ public class AWImplClient implements AWClint {
|
|
|
return UtilMap.map("result", "模板/复用项目");
|
|
|
}
|
|
|
String checkLink = UtilMap.getString(taskData, AWServer.TASK_CHECK_LINK);
|
|
|
- /// prd 7.17 预检项任务ID与当前任务ID不匹配,判定为非法, 无需重新刷新
|
|
|
+ /// prd 7.17 预检项任务ID与当前任务ID不匹配, 判定为非法, 无需重新刷新
|
|
|
if (isTask) {
|
|
|
- if (!(checkLink.contains("?taskId=") && !checkLink.contains(taskId))) {
|
|
|
+ if (!(checkLink.contains("taskId=") && !checkLink.contains(taskId))) {
|
|
|
/// prd 预检项持续维护需要重新匹配, 任务号和主数据判定为非法, 无需重新刷新
|
|
|
- if (StringUtils.isNotBlank(checkLink) && !AWServer.TASK_CHECK_LINK_OK.equals(checkLink)) {
|
|
|
+ if (StringUtils.isNotBlank(checkLink) && !"未配置预检项".equals(checkLink)) {
|
|
|
return UtilMap.map("result", "链接已加载");
|
|
|
}
|
|
|
}
|
|
@@ -485,17 +485,15 @@ public class AWImplClient implements AWClint {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- log.info("检查项结果, {},{}", resultTitle, resultUrl);
|
|
|
+ log.info("检查项结果, {}, {}", resultTitle, resultUrl);
|
|
|
String result = resultTitle.equals(AWServer.TASK_CHECK_LINK_OK) ? resultUrl : resultTitle;
|
|
|
if (isTask) {
|
|
|
if (!result.equals(checkLink)) {
|
|
|
Map body = TBConf.assembleCustomFieldName(AWServer.TASK_CHECK_LINK, result);
|
|
|
tbClient.updateTaskCustomField(taskId, tbConf.getOperatorId(), body);
|
|
|
// prd 7.17 技术检查项从未匹配到更新,刷新检查状态为空
|
|
|
- if (resultTitle.equals(AWServer.TASK_CHECK_LINK_OK) && (checkLink.equals("未配置预检项") || checkLink.equals(""))) {
|
|
|
- Map body2 = TBConf.assembleCustomFieldName(AWServer.TASK_CHECK_STATUS);
|
|
|
- tbClient.updateTaskCustomField(taskId, tbConf.getOperatorId(), body2);
|
|
|
- }
|
|
|
+ Map body2 = TBConf.assembleCustomFieldName(AWServer.TASK_CHECK_STATUS);
|
|
|
+ tbClient.updateTaskCustomField(taskId, tbConf.getOperatorId(), body2);
|
|
|
// _updateApproveField(taskId, new ArrayList<>(), resultUrl, resultTitle, "待提交", AWServer.TASK_CHECK_LINK);
|
|
|
}
|
|
|
// prd 未配置预检项更新为已检查, 避免完成任务完成触发必填校验 [ppExt 避免重复写入, 重复写入TB会重复记录日志
|
|
@@ -536,7 +534,8 @@ public class AWImplClient implements AWClint {
|
|
|
String title = UtilMap.getString(data, "title");
|
|
|
Map body = TBConf.assembleCustomFieldName(AWServer.TASK_CHECK_STATUS, "已检查");
|
|
|
tbClient.updateTaskCustomField(String.valueOf(data.get("taskId")), tbConf.getOperatorId(), body);
|
|
|
- String result = _matchFormUuid("DOMAIN") + ydConf.getAppType() + "/formDetail?formInstId=" + data.get("formInstId");
|
|
|
+ // prd 7.31 复制的任务若是检查项已提交的任务, 也要触发 7.17 预检项任务ID与当前任务ID不匹配 逻辑
|
|
|
+ String result = _matchFormUuid("DOMAIN") + ydConf.getAppType() + "/formDetail?formInstId=" + data.get("formInstId") + "&taskId=" + UtilMap.getString(data, "taskId");
|
|
|
Map body2 = TBConf.assembleCustomFieldName(AWServer.TASK_CHECK_LINK, result);
|
|
|
tbClient.updateTaskCustomField(String.valueOf(data.get("taskId")), tbConf.getOperatorId(), body2);
|
|
|
// _updateApproveField(UtilMap.getString(data, "taskId"), new ArrayList<>(), result, title, "已提交", AWServer.TASK_CHECK_LINK);
|
|
@@ -784,19 +783,13 @@ public class AWImplClient implements AWClint {
|
|
|
}
|
|
|
// prd 人员变更, 自动同步更新执行人: 仅触发存在执行人 & 未完成场景 [5.10 新增项目不执行, TB任务号宜搭回写有延迟, 避免异常]
|
|
|
if (!isCreate) {
|
|
|
- updateProjectRole(projectId, Arrays.asList("全部", "自动更新"));
|
|
|
+ updateProjectRole(projectId, Arrays.asList("全部", "自动更新"), "", "");
|
|
|
}
|
|
|
// prd 5.23 更新项目概览信息
|
|
|
if (isCreate) {
|
|
|
tbClient.updateProjectStatusField(projectId, tbConf.getOperatorId(), TBConf.assembleCustomFieldName("项目描述", UtilMap.getString(formData, "textareaField_lrj7vnxl")));
|
|
|
tbClient.updateProjectStatusField(projectId, tbConf.getOperatorId(), TBConf.assembleCustomFieldName("项目重要等级", UtilMap.getString(formData, "textField_lwj1r7n6")));
|
|
|
}
|
|
|
- /// 7.18 项目状态不一致执行概览字段更新, 避免tb重复更新造成操作记录
|
|
|
- if (UtilMap.isNotBlankString(formData, "src_state")) {
|
|
|
- tbClient.updateProjectStatusField(projectId, tbConf.getOperatorId(), TBConf.assembleCustomFieldName("状态", UtilMap.getString(formData, "textField_ltsdsti7")));
|
|
|
- }
|
|
|
- log.info("TB项目信息, {}, {}", projectId, roleIds.size());
|
|
|
-
|
|
|
// 项目添加到项目集
|
|
|
List<Map> groupList = tbClient.queryProgramList_all();
|
|
|
Optional optional = groupList.stream().filter(item -> groupName.equals(item.get("name"))).findAny();
|
|
@@ -804,6 +797,11 @@ public class AWImplClient implements AWClint {
|
|
|
Map item = (Map) optional.get(); // 权限
|
|
|
tbClient.upsertProgramProject(UtilMap.getString(item, "id"), Arrays.asList(projectId), UtilMap.getString(item, "creatorId"));
|
|
|
}
|
|
|
+ /// 7.18 项目状态不一致执行概览字段更新, 避免tb重复更新造成操作记录
|
|
|
+ if (UtilMap.isNotBlankString(formData, "src_state")) {
|
|
|
+ tbClient.updateProjectStatusField(projectId, tbConf.getOperatorId(), TBConf.assembleCustomFieldName("状态", UtilMap.getString(formData, "textField_ltsdsti7")));
|
|
|
+ }
|
|
|
+ log.info("TB项目信息, {}, {}", projectId, roleIds.size());
|
|
|
}
|
|
|
|
|
|
// fixme 提取方法, 参考 getProjectCFID 实现
|
|
@@ -819,7 +817,7 @@ public class AWImplClient implements AWClint {
|
|
|
*/
|
|
|
@Synchronized
|
|
|
@Override
|
|
|
- public void updateProjectRole(String projectId, List<String> trNode) {
|
|
|
+ public void updateProjectRole(String projectId, List<String> trNode, String production, String version) {
|
|
|
|
|
|
// 项目档案 [tb项目号查询, 避免模糊匹配]
|
|
|
List<Map> pList = ydService.queryDataList_FormData(_matchFormUuid("PROJECT"), UtilMap.map("textField_lqxtykce", projectId));
|
|
@@ -861,6 +859,19 @@ public class AWImplClient implements AWClint {
|
|
|
continue;
|
|
|
}
|
|
|
}
|
|
|
+ /// prd: 08.01 TR5 ~ TR6 有产品版本,为空则匹配所选 TR 下全部任务,否则按照所选产品、版本下达
|
|
|
+ if (UtilString.isNotBlankCompatNull(production)) {
|
|
|
+ Optional optional3 = customField.stream().filter(item -> AWServer.TASK_PRODUCT.equals(item.get("name"))).findAny();
|
|
|
+ if (!optional3.isPresent()) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (UtilString.isNotBlankCompatNull(version)) {
|
|
|
+ Optional optional3 = customField.stream().filter(item -> AWServer.TASK_PRODUCT_VERSION.equals(item.get("name"))).findAny();
|
|
|
+ if (!optional3.isPresent()) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }
|
|
|
log.info("tr节点控制, {}, {}", trName, trNode);
|
|
|
}
|
|
|
// prd 人员变更, 自动同步更新执行人: 仅触发存在执行人 & 未完成场景
|
|
@@ -1268,22 +1279,6 @@ public class AWImplClient implements AWClint {
|
|
|
log.info("同步预检项 ##, {}", type);
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 提供verifier数据读取服务
|
|
|
- */
|
|
|
- @Override
|
|
|
- public List<Map> syncVerifier(String projectCode) {
|
|
|
- List<Map> dataList = ydService.queryFormData_all(YDParam.builder()
|
|
|
- .formUuid("FORM-23B67983E91C4ED3B063F9B629D6E964SGHH")
|
|
|
- .searchCondition(JSON.toJSONString(UtilMap.map("textField_lt6xd8lm", projectCode)))
|
|
|
- .build());
|
|
|
-
|
|
|
- return dataList.stream().map(item -> {
|
|
|
- return item;
|
|
|
- }).collect(Collectors.toList());
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
@Autowired
|
|
|
private DDClient ddClient;
|
|
|
|
|
@@ -1489,23 +1484,25 @@ public class AWImplClient implements AWClint {
|
|
|
order += 1;
|
|
|
String docName = title + " v" + order + ".0";
|
|
|
DDR_New ddr_new;
|
|
|
+ Map formData;
|
|
|
try {
|
|
|
ddr_new = ddClient_storage.copyDentries(ddClient.getAccessToken(), unionId, workspaceId, UtilMap.getString(doc, "instanceId"), workspaceId, rootNodeId, docName);
|
|
|
String taskCode = UtilMap.getString(taskData, AWServer.TASK_CODE);
|
|
|
- //_updatePermission(taskCode, proType, ddr_new.getDentryUuid(), unionId, tName, subList); // 设置文件权限矩阵
|
|
|
+ formData = _updatePermission(taskCode, proType, title, ddr_new.getDentryUuid(), unionId, tName, subList); // 设置文件权限矩阵
|
|
|
} catch (McException e) {
|
|
|
// ppExt: 权限异常可能原因是重复授权, 依然执行复制操作, 再跳过
|
|
|
log.error(e.getMessage(), e);
|
|
|
continue;
|
|
|
}
|
|
|
// 更新最新版本记录, 叠加版本号
|
|
|
- Map formData = UtilMap.map("textField_lx36gdpp, numberField_lx36gdpz", fileName, order);
|
|
|
+ formData = UtilMap.putAll(formData, UtilMap.map("textField_lx36gdpp, numberField_lx36gdpz", fileName, order));
|
|
|
formData.put("textField_lx342bvd", ddr_new.getDentryId());
|
|
|
formData.put("textField_lx36gdpn", ddr_new.getDentryUuid());
|
|
|
formData.put("textField_lx36gdpo", ddr_new.getUrl());
|
|
|
ydClient.operateData(YDParam.builder()
|
|
|
.formInstanceId(UtilMap.getString(version, "formInstId"))
|
|
|
.updateFormDataJson(JSON.toJSONString(formData))
|
|
|
+ .useLatestVersion(true)
|
|
|
.build(), YDConf.FORM_OPERATION.update);
|
|
|
// 更新版本字段
|
|
|
Map meta = UtilMap.map("title, url, instanceId, workspaceId, image", docName, ddr_new.getUrl(), ddr_new.getDentryId(), ddr_new.getSpaceId(), doc.get("image"));
|
|
@@ -1538,13 +1535,18 @@ public class AWImplClient implements AWClint {
|
|
|
}
|
|
|
|
|
|
/// 交付件权限设置,包括TBManager账号设置为只读,针对文件. 移除非权限矩阵的项目成员
|
|
|
- private void _updatePermission(String taskCode, String proType, String dentryUuid, String creatorUnionId, String roleName, List<Map> details) {
|
|
|
+ private Map _updatePermission(String taskCode, String proType, String title, String dentryUuid, String creatorUnionId, String roleName, List<Map> details) {
|
|
|
|
|
|
boolean isAll = false;
|
|
|
|
|
|
- // 取值权限矩阵: 获取角色在项目主数据对应成员
|
|
|
- List<Map> tList = ydService.queryDataList_FormData(_matchFormUuid("PERMISSION"), UtilMap.map("selectField_lrncf4hk, radioField_lyvawhud", taskCode, "启用"));
|
|
|
- tList = tList.stream().filter(item -> taskCode.equals(item.get("selectField_lrncf4hk")) && UtilMap.getList(item, "multiSelectField_ltwjre9s").contains(proType)).collect(Collectors.toList());
|
|
|
+ // 取值权限矩阵: 获取角色在项目主数据对应成员 [prd: 7.25 通过文件名称模糊匹配, 方案调整]
|
|
|
+ //List<Map> tList = ydService.queryDataList_FormData(_matchFormUuid("PERMISSION"), UtilMap.map("selectField_lrncf4hk, radioField_lyvawhud", taskCode, "启用"));
|
|
|
+ //tList = tList.stream().filter(item -> taskCode.equals(item.get("selectField_lrncf4hk")) && UtilMap.getList(item, "multiSelectField_ltwjre9s").contains(proType)).collect(Collectors.toList());
|
|
|
+
|
|
|
+ Map search = YDConf.searchCondition_TextFiled("textField_lyv8g8sx", title, "like");
|
|
|
+ Map status = YDConf.searchCondition_TextFiled("radioField_lyvawhud", "启用", "eq");
|
|
|
+ List<Map> tList = ydService.queryFormData(_matchFormUuid("PERMISSION"), JSON.toJSONString(Arrays.asList(search, status)));
|
|
|
+ Map marker = UtilMap.map("textField_lz1jhtch", tList.size()); // 记录权限点, 模糊查询追溯
|
|
|
List<String> userIds = new ArrayList<>();
|
|
|
if (tList.size() > 0) {
|
|
|
List<String> roles = UtilMap.getList(tList.get(0), "multiSelectField_lyv8g8sy");
|
|
@@ -1562,6 +1564,7 @@ public class AWImplClient implements AWClint {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ marker.put("textField_lz1jhtcg", UtilMap.getString(tList.get(0), "serialNumberField_lqxu8std"));
|
|
|
} else {
|
|
|
isAll = true;
|
|
|
}
|
|
@@ -1599,6 +1602,7 @@ public class AWImplClient implements AWClint {
|
|
|
} catch (McException e) {
|
|
|
log.error(e.getMessage(), e);
|
|
|
}
|
|
|
+ return marker;
|
|
|
}
|
|
|
|
|
|
|
|
@@ -1674,6 +1678,23 @@ public class AWImplClient implements AWClint {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 提供verifier数据读取服务
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public List<Map> syncVerifier(String projectCode) {
|
|
|
+ List<Map> dataList = ydService.queryFormData_all(YDParam.builder()
|
|
|
+ .formUuid("FORM-23B67983E91C4ED3B063F9B629D6E964SGHH")
|
|
|
+ .searchCondition(JSON.toJSONString(UtilMap.map("textField_lt6xd8lm", projectCode)))
|
|
|
+ .build());
|
|
|
+
|
|
|
+ return dataList.stream().map(item -> {
|
|
|
+ return item;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public void test() {
|
|
|
approveVersion("659a681d44ade3345fdc0d39", "99999");
|