StrategySystemReviewTaskClose.java 2.18 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
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

wdy's avatar
wdy committed
14 15
import java.util.List;

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

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

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

    @Override
wdy's avatar
wdy committed
31
    public void doSubmit(SystemReviewTask systemReviewTask, List<String> imagesUrl) {
王飞's avatar
王飞 committed
32 33 34 35 36 37 38 39
        throw new ServiceException("不能提交一个已关闭的任务", HttpStatus.ERROR);
    }

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

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

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

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

        return response;
    }
王飞's avatar
王飞 committed
57 58 59 60 61

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