package weaver.interfaces.htxc.contract.action;

import com.engine.htxc.workflow.create.business.contract.util.ContractUpdateStatus;
import com.engine.integration.util.StringUtils;
import com.weaver.general.BaseBean;
import weaver.hrm.User;
import weaver.interfaces.workflow.action.Action;
import weaver.soa.workflow.request.RequestInfo;


/**
 * <p>合同废弃流程办结</p>
 * @author K1810015
 * @version 1.0.0
 * @ClassName ContractDiscardEndAction.java
 * @createTime 2022年07月25日 18:17:00
 */
public class ContractDiscardEndAction  extends BaseBean implements Action {

    @Override
    public String execute(RequestInfo requestInfo) {
        String requestid=requestInfo.getRequestid();
        User user =requestInfo.getRequestManager().getUser();

        if(StringUtils.isBlank(requestid) || user==null ){
            return Action.FAILURE_AND_CONTINUE;
        }
        try {
            ContractUpdateStatus.createContractUpdateStatus(requestid,user).discardend();
            return Action.SUCCESS;
        }catch (Exception e){
            return Action.FAILURE_AND_CONTINUE;
        }
    }


}
