fix:仿真策划版本记录
This commit is contained in:
@@ -41,7 +41,7 @@ public interface SimulationTaskMapper extends BaseMapper<SimulationTask> {
|
||||
|
||||
int updateTask(@Param("task") SpdmTaskVo task);
|
||||
|
||||
List<SpdmTaskVo> getUserExecTaskWithinTimeFrame(@Param("req") UserWorkloadReq req);
|
||||
List<SpdmTaskVo> getUserExecTaskWithinTimeFrame(@Param("req") UserWorkloadReq req, @Param("tenantId") Long tenantId);
|
||||
|
||||
SpdmTaskVo getTaskById(@Param("id") Long id);
|
||||
|
||||
|
||||
@@ -2585,7 +2585,10 @@ public class ProjectServiceImpl extends BaseService implements IProjectService {
|
||||
SdmResponse treeRespond = getTaskTree(getTaskTreeReq);
|
||||
if (treeRespond.getData() != null) {
|
||||
String viewContents = JSONObject.toJSONString(treeRespond.getData());
|
||||
List<SimulationDesignVersions> designVersions = simulationDesignVersionsService.lambdaQuery().eq(SimulationDesignVersions::getProjectId, req.getProjectNodeId()).list();
|
||||
List<SimulationDesignVersions> designVersions = simulationDesignVersionsService.lambdaQuery()
|
||||
.eq(SimulationDesignVersions::getProjectId, req.getProjectNodeId())
|
||||
.eq(SimulationDesignVersions::getPhaseId, req.getPhaseNodeId())
|
||||
.list();
|
||||
if (CollectionUtils.isNotEmpty(designVersions)) {
|
||||
// 根据最新版本升版
|
||||
SimulationDesignVersions latestVersion = designVersions.stream().sorted(Comparator.comparing(SimulationDesignVersions::getCreateTime).reversed()).collect(Collectors.toList()).get(0);
|
||||
@@ -2626,11 +2629,17 @@ public class ProjectServiceImpl extends BaseService implements IProjectService {
|
||||
SdmResponse treeRespond = getTaskTree(getTaskTreeReq);
|
||||
if (treeRespond.getData() != null) {
|
||||
String viewContents = JSONObject.toJSONString(treeRespond.getData());
|
||||
if (StringUtils.isNotEmpty(req.getCurrentVersion())) {
|
||||
List<SimulationDesignVersions> designVersions = simulationDesignVersionsService.lambdaQuery()
|
||||
.eq(SimulationDesignVersions::getProjectId, req.getProjectNodeId())
|
||||
.eq(SimulationDesignVersions::getPhaseId, req.getPhaseNodeId())
|
||||
.list();
|
||||
if (CollectionUtils.isNotEmpty(designVersions)) {
|
||||
// 根据最新版本升版
|
||||
SimulationDesignVersions latestVersion = designVersions.stream().sorted(Comparator.comparing(SimulationDesignVersions::getCreateTime).reversed()).collect(Collectors.toList()).get(0);
|
||||
simulationDesignVersionsService.lambdaUpdate()
|
||||
.eq(SimulationDesignVersions::getProjectId, req.getProjectNodeId())
|
||||
.eq(SimulationDesignVersions::getPhaseId, req.getPhaseNodeId())
|
||||
.eq(SimulationDesignVersions::getCurrentVersion, req.getCurrentVersion())
|
||||
.eq(SimulationDesignVersions::getCurrentVersion, latestVersion)
|
||||
.set(SimulationDesignVersions::getVersionContents, viewContents)
|
||||
.set(SimulationDesignVersions::getBeforeContents, beforeContents)
|
||||
.update();
|
||||
@@ -2826,7 +2835,7 @@ public class ProjectServiceImpl extends BaseService implements IProjectService {
|
||||
if(req != null) {
|
||||
// 清除上次评审标记
|
||||
req.setBApprove(false);
|
||||
modify(req);
|
||||
modifyWithApprove(req);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("convert modify req error:{}", e.getMessage());
|
||||
|
||||
@@ -1649,7 +1649,6 @@ public class SimulationRunServiceImpl extends ServiceImpl<SimulationRunMapper, S
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public SdmResponse editReport(EditReportReq req) {
|
||||
Long userId = ThreadLocalContext.getUserId();
|
||||
log.info("编辑报告参数为:{}", req);
|
||||
@@ -1977,7 +1976,6 @@ public class SimulationRunServiceImpl extends ServiceImpl<SimulationRunMapper, S
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void editReportAndDownload(EditReportReq req, HttpServletResponse response) {
|
||||
Long userId = ThreadLocalContext.getUserId();
|
||||
log.info("编辑报告参数为:{}", req);
|
||||
|
||||
@@ -2079,6 +2079,7 @@ public class TaskServiceImpl implements ITaskService {
|
||||
|
||||
@Override
|
||||
public SdmResponse<List<UserWorkloadResp>> listUserWorkloadsWithinTimeFrame(UserWorkloadReq req) {
|
||||
Long tenantId = ThreadLocalContext.getTenantId();
|
||||
List<UserWorkloadResp> userWorkloadRespList = new ArrayList<>();
|
||||
List<CIDUserResp> userList = new ArrayList<>();
|
||||
|
||||
@@ -2116,7 +2117,7 @@ public class TaskServiceImpl implements ITaskService {
|
||||
CIDUserResp::getNickname
|
||||
));
|
||||
req.setUserIdList(userIds);
|
||||
List<SpdmTaskVo> taskList = mapper.getUserExecTaskWithinTimeFrame(req);
|
||||
List<SpdmTaskVo> taskList = mapper.getUserExecTaskWithinTimeFrame(req, tenantId);
|
||||
if (CollectionUtils.isNotEmpty(taskList)) {
|
||||
Map<String, List<SpdmTaskVo>> userTaskMap = taskList.stream().collect(Collectors.groupingBy(SpdmTaskVo::getEUserId));
|
||||
for (String eUserId : userTaskMap.keySet()) {
|
||||
|
||||
@@ -504,6 +504,7 @@
|
||||
inner join simulation_task_member stm on st.uuid = stm.task_id
|
||||
where
|
||||
stm.type = 1
|
||||
and st.tenant_id = #{tenantId}
|
||||
and stm.user_id in (
|
||||
<foreach collection='req.userIdList' item='userId' index='index' separator=','>
|
||||
#{userId}
|
||||
|
||||
Reference in New Issue
Block a user