StrategySystemReviewTaskFinish.java 2.16 KB
Newer Older
王飞's avatar
王飞 committed
1 2
package com.ruoyi.service.impl;

王飞's avatar
王飞 committed
3 4
import com.ruoyi.common.constant.HttpStatus;
import com.ruoyi.common.exception.ServiceException;
王飞's avatar
王飞 committed
5 6 7
import com.ruoyi.domain.SystemReviewTask;
import com.ruoyi.service.StrategySystemReviewTask;
import com.ruoyi.web.response.SystemReviewTaskViewResponse;
王飞's avatar
王飞 committed
8 9 10
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
王飞's avatar
王飞 committed
11 12 13 14
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Transactional
王飞's avatar
王飞 committed
15 16 17 18 19 20 21
@Service
public class StrategySystemReviewTaskFinish implements StrategySystemReviewTask, InitializingBean {

    @Autowired
    private StrategySystemReviewTaskContext strategySystemReviewTaskContext;
    @Autowired
    private ApplicationContext applicationContext;
王飞's avatar
王飞 committed
22

王飞's avatar
王飞 committed
23 24 25 26 27 28
    @Override
    public void doStart(SystemReviewTask systemReviewTask) {
        throw new ServiceException("不能开始一个已完成的任务", HttpStatus.ERROR);
    }

    @Override
29
    public void doSubmit(SystemReviewTask systemReviewTask, String imagesUrl) {
王飞's avatar
王飞 committed
30 31 32 33 34 35 36 37
        throw new ServiceException("不能提交一个已完成的任务", HttpStatus.ERROR);
    }

    @Override
    public void doClose(SystemReviewTask systemReviewTask) {
        throw new ServiceException("不能关闭一个已完成的任务", HttpStatus.ERROR);
    }

38 39 40 41 42
    @Override
    public void doConfirm(SystemReviewTask systemReviewTask) {
        throw new ServiceException("不能确认一个已完成的任务", HttpStatus.ERROR);
    }

王飞's avatar
王飞 committed
43 44 45 46 47 48 49 50 51 52 53 54
    // FINISH状态下
    // 1.standard字段使用task中归档的问卷
    // 2.不查询场景变更任务
    // 3.无需联查问卷答案
    @Override
    public SystemReviewTaskViewResponse doView(SystemReviewTask systemReviewTask) {

        SystemReviewTaskViewResponse response = new SystemReviewTaskViewResponse();
        response.setSystemReviewTask(systemReviewTask);

        return response;
    }
王飞's avatar
王飞 committed
55 56 57 58 59

    @Override
    public void afterPropertiesSet() throws Exception {
        strategySystemReviewTaskContext.putResource(SystemReviewTask.STATUS_FINISH, applicationContext.getBean(this.getClass()));
    }
王飞's avatar
王飞 committed
60
}