fix:仿真策划版本记录新增流程id
This commit is contained in:
@@ -1 +1,2 @@
|
|||||||
ALTER TABLE spdm_baseline.simulation_design_versions ADD beforeContents longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '上个版本内容(JSON字符串)';
|
ALTER TABLE spdm_baseline.simulation_design_versions ADD beforeContents longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '上个版本内容(JSON字符串)';
|
||||||
|
ALTER TABLE spdm_baseline.simulation_design_versions ADD cidFlowId varchar(255) NULL COMMENT 'cid流程实例id';
|
||||||
|
|||||||
@@ -64,4 +64,6 @@ public class ModifyProjectNode extends BaseEntity {
|
|||||||
*/
|
*/
|
||||||
public JSONObject approvePreviewInfo;
|
public JSONObject approvePreviewInfo;
|
||||||
|
|
||||||
|
public String cidFlowId;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,6 +53,10 @@ public class SimulationDesignVersions implements Serializable {
|
|||||||
@TableField("beforeContents")
|
@TableField("beforeContents")
|
||||||
private String beforeContents;
|
private String beforeContents;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "cid流程实例id")
|
||||||
|
@TableField("cidFlowId")
|
||||||
|
private String cidFlowId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "创建者")
|
@ApiModelProperty(value = "创建者")
|
||||||
@TableField("creator")
|
@TableField("creator")
|
||||||
private Long creator;
|
private Long creator;
|
||||||
|
|||||||
@@ -2559,7 +2559,7 @@ public class ProjectServiceImpl extends BaseService implements IProjectService {
|
|||||||
String approveContents = JSONObject.toJSONString(req);
|
String approveContents = JSONObject.toJSONString(req);
|
||||||
int approveAction = 2;
|
int approveAction = 2;
|
||||||
// 发起评审
|
// 发起评审
|
||||||
if(launchTaskPoolApprove(req.approveTemplateId,req.approveTemplateName,approveContents,approveAction)) {
|
if(launchDesignApprove(req.approveTemplateId,req.approveTemplateName,approveContents,approveAction)) {
|
||||||
return SdmResponse.success();
|
return SdmResponse.success();
|
||||||
} else {
|
} else {
|
||||||
return SdmResponse.failed("发起评审失败");
|
return SdmResponse.failed("发起评审失败");
|
||||||
@@ -2602,9 +2602,10 @@ public class ProjectServiceImpl extends BaseService implements IProjectService {
|
|||||||
newDesignVersion.setCreator(userId);
|
newDesignVersion.setCreator(userId);
|
||||||
newDesignVersion.setVersionContents(viewContents);
|
newDesignVersion.setVersionContents(viewContents);
|
||||||
newDesignVersion.setBeforeContents(beforeContents);
|
newDesignVersion.setBeforeContents(beforeContents);
|
||||||
|
newDesignVersion.setCidFlowId(req.getCidFlowId());
|
||||||
simulationDesignVersionsService.save(newDesignVersion);
|
simulationDesignVersionsService.save(newDesignVersion);
|
||||||
} else {
|
} else {
|
||||||
addNewVersion(req.getProjectNodeId(), req.getPhaseNodeId(), "V1.0", viewContents, userId);
|
addNewVersion(req.getProjectNodeId(), req.getPhaseNodeId(), "V1.0", viewContents, userId, req.getCidFlowId());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return SdmResponse.failed("获取不到任务树");
|
return SdmResponse.failed("获取不到任务树");
|
||||||
@@ -2642,9 +2643,10 @@ public class ProjectServiceImpl extends BaseService implements IProjectService {
|
|||||||
.eq(SimulationDesignVersions::getCurrentVersion, latestVersion)
|
.eq(SimulationDesignVersions::getCurrentVersion, latestVersion)
|
||||||
.set(SimulationDesignVersions::getVersionContents, viewContents)
|
.set(SimulationDesignVersions::getVersionContents, viewContents)
|
||||||
.set(SimulationDesignVersions::getBeforeContents, beforeContents)
|
.set(SimulationDesignVersions::getBeforeContents, beforeContents)
|
||||||
|
.set(ObjectUtils.isNotEmpty(req.getCidFlowId()), SimulationDesignVersions::getCidFlowId, req.getCidFlowId())
|
||||||
.update();
|
.update();
|
||||||
} else {
|
} else {
|
||||||
addNewVersion(req.getProjectNodeId(), req.getPhaseNodeId(),"V1.0", viewContents, userId);
|
addNewVersion(req.getProjectNodeId(), req.getPhaseNodeId(),"V1.0", viewContents, userId, req.getCidFlowId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2661,13 +2663,14 @@ public class ProjectServiceImpl extends BaseService implements IProjectService {
|
|||||||
getTaskTreeReq.setTagMap(tagList);
|
getTaskTreeReq.setTagMap(tagList);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addNewVersion(String projectId, String phaseId, String version, String viewContents, Long userId) {
|
private void addNewVersion(String projectId, String phaseId, String version, String viewContents, Long userId, String cidFlowId) {
|
||||||
SimulationDesignVersions designVersions = new SimulationDesignVersions();
|
SimulationDesignVersions designVersions = new SimulationDesignVersions();
|
||||||
designVersions.setProjectId(projectId);
|
designVersions.setProjectId(projectId);
|
||||||
designVersions.setPhaseId(phaseId);
|
designVersions.setPhaseId(phaseId);
|
||||||
designVersions.setCurrentVersion(version);
|
designVersions.setCurrentVersion(version);
|
||||||
designVersions.setVersionContents(viewContents);
|
designVersions.setVersionContents(viewContents);
|
||||||
designVersions.setCreator(userId);
|
designVersions.setCreator(userId);
|
||||||
|
designVersions.setCidFlowId(cidFlowId);
|
||||||
simulationDesignVersionsService.save(designVersions);
|
simulationDesignVersionsService.save(designVersions);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2798,7 +2801,7 @@ public class ProjectServiceImpl extends BaseService implements IProjectService {
|
|||||||
/**
|
/**
|
||||||
* 发起仿真策划评审
|
* 发起仿真策划评审
|
||||||
*/
|
*/
|
||||||
private boolean launchTaskPoolApprove(String templateId, String templateName,String approveContents,int approveAction)
|
private boolean launchDesignApprove(String templateId, String templateName,String approveContents,int approveAction)
|
||||||
{
|
{
|
||||||
LaunchApproveReq req = new LaunchApproveReq();
|
LaunchApproveReq req = new LaunchApproveReq();
|
||||||
req.templateId = templateId;
|
req.templateId = templateId;
|
||||||
@@ -2835,6 +2838,7 @@ public class ProjectServiceImpl extends BaseService implements IProjectService {
|
|||||||
if(req != null) {
|
if(req != null) {
|
||||||
// 清除上次评审标记
|
// 清除上次评审标记
|
||||||
req.setBApprove(false);
|
req.setBApprove(false);
|
||||||
|
req.setCidFlowId(approveReq.cidFlowId);
|
||||||
modifyWithApprove(req);
|
modifyWithApprove(req);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user