
package com.xtd.project.activiti.event.listener;

import com.xtd.common.utils.SpringUtil;
import com.xtd.project.activiti.service.impl.LeaveNewServiceImpl;
import com.xtd.project.assets.domain.DbAssetsStock;
import com.xtd.project.assets.domain.DbAssetsStockAllot;
import com.xtd.project.assets.mapper.DbAssetsStockMapper;
import com.xtd.project.assets.mapper.DbAssetsStockAllotMapper;
import org.activiti.engine.TaskService;
import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.ExecutionListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class AllotRejectListener implements ExecutionListener {
    protected final Logger logger = LoggerFactory.getLogger(LeaveNewServiceImpl.class);

    @Autowired
    private TaskService taskService;


    @Override
    public void notify(DelegateExecution delegateExecution) {
        DbAssetsStockAllot formData = (DbAssetsStockAllot)delegateExecution.getVariable("formData");
        DbAssetsStockAllotMapper dbAssetsStockOutMapper = SpringUtil.getBean(DbAssetsStockAllotMapper.class);
        //设置为审核通过
        formData.setState(1);
        dbAssetsStockOutMapper.updateDbAssetsStockAllot(formData);
        logger.info("更新出库状态");

    }

}

