Commit 099c42e0 authored by yuanshuo's avatar yuanshuo

1.版本号问题=>当子任务通过之后 会获取当前关联的standard的最新版本为version字段赋值

parent 369c11da
...@@ -178,4 +178,7 @@ public class CarReviewTask implements Serializable { ...@@ -178,4 +178,7 @@ public class CarReviewTask implements Serializable {
@ApiModelProperty("企业名称") @ApiModelProperty("企业名称")
private String enterpriseName; private String enterpriseName;
@ApiModelProperty("版本")
private String version;
} }
...@@ -64,4 +64,10 @@ public class Standard { ...@@ -64,4 +64,10 @@ public class Standard {
@ApiModelProperty("展示状态") @ApiModelProperty("展示状态")
private Long status; private Long status;
@ApiModelProperty("原始版本")
private String originalVersion;
@ApiModelProperty("最新版本")
private String currentVersion;
} }
...@@ -182,4 +182,7 @@ public class SystemReviewTask { ...@@ -182,4 +182,7 @@ public class SystemReviewTask {
@ApiModelProperty("企业名称") @ApiModelProperty("企业名称")
private String enterpriseName; private String enterpriseName;
@ApiModelProperty("版本")
private String version;
} }
...@@ -26,4 +26,6 @@ public interface StandardMapper extends BaseMapper<Standard> { ...@@ -26,4 +26,6 @@ public interface StandardMapper extends BaseMapper<Standard> {
* @return * @return
*/ */
List<Standard> findStandardList(StandardListRequest request); List<Standard> findStandardList(StandardListRequest request);
Standard getById(@Param("standardId") Long standardId);
} }
...@@ -83,6 +83,8 @@ public class StrategyCarReviewTaskPending implements StrategyCarReviewTask, Init ...@@ -83,6 +83,8 @@ public class StrategyCarReviewTaskPending implements StrategyCarReviewTask, Init
@Autowired @Autowired
private ISysUserService sysUserService; private ISysUserService sysUserService;
@Autowired
private StandardMapper standardMapper;
// PENDING状态下 // PENDING状态下
// 1.standard字段查询当前最新问卷 // 1.standard字段查询当前最新问卷
...@@ -147,6 +149,11 @@ public class StrategyCarReviewTaskPending implements StrategyCarReviewTask, Init ...@@ -147,6 +149,11 @@ public class StrategyCarReviewTaskPending implements StrategyCarReviewTask, Init
setDetailsResult(standardTree, results,carReviewTask); setDetailsResult(standardTree, results,carReviewTask);
carReviewTask.setStandard(standardTree); carReviewTask.setStandard(standardTree);
//问卷全部完成,那么设置任务的版本
Long standardId = carReviewTask.getStandardId();
Standard standard = standardMapper.getById(standardId);
carReviewTask.setVersion(standard.getCurrentVersion());
carReviewTaskMapper.updateById(carReviewTask);
// 4. 修改任务状态为 SIGNED 待签字 // 4. 修改任务状态为 SIGNED 待签字
carReviewTask.setTaskStatus(CarReviewTask.TASK_STATUS_SIGNED); carReviewTask.setTaskStatus(CarReviewTask.TASK_STATUS_SIGNED);
......
...@@ -73,6 +73,9 @@ public class StrategySystemReviewTaskPending implements StrategySystemReviewTask ...@@ -73,6 +73,9 @@ public class StrategySystemReviewTaskPending implements StrategySystemReviewTask
@Autowired @Autowired
private ISysUserService sysUserService; private ISysUserService sysUserService;
@Autowired
private StandardMapper standardMapper;
@Override @Override
public void doStart(SystemReviewTask systemReviewTask) { public void doStart(SystemReviewTask systemReviewTask) {
throw new ServiceException("不能开始一个已经开始的任务", HttpStatus.ERROR); throw new ServiceException("不能开始一个已经开始的任务", HttpStatus.ERROR);
...@@ -110,6 +113,11 @@ public class StrategySystemReviewTaskPending implements StrategySystemReviewTask ...@@ -110,6 +113,11 @@ public class StrategySystemReviewTaskPending implements StrategySystemReviewTask
systemReviewTask.setStandard(standardTree); systemReviewTask.setStandard(standardTree);
//问卷全部完成,那么设置任务的版本
Long standardId = systemReviewTask.getStandardId();
Standard standard = standardMapper.getById(standardId);
systemReviewTask.setVersion(standard.getCurrentVersion());
systemReviewTaskMapper.updateById(systemReviewTask);
// 4. 修改任务状态为 SIGNED 待签字 // 4. 修改任务状态为 SIGNED 待签字
systemReviewTask.setTaskStatus(SystemReviewTask.STATUS_SIGNED); systemReviewTask.setTaskStatus(SystemReviewTask.STATUS_SIGNED);
......
package com.ruoyi.web; package com.ruoyi.web;
import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.annotation.Log; import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.domain.R;
......
...@@ -62,4 +62,9 @@ ...@@ -62,4 +62,9 @@
</if> </if>
</where> </where>
</select> </select>
<select id="getById" resultType="com.ruoyi.domain.Standard">
select *
from t_standard
where id = #{standardId}
</select>
</mapper> </mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment