package weaver.interfaces.htxc.seal;

import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.htxc.eseal.service.SendSignetService;
import com.engine.htxc.eseal.service.impl.SendSignetServiceImpl;
import weaver.conn.RecordSet;
import weaver.general.BaseBean;
import weaver.general.Util;
import weaver.interfaces.htsc.gwlc.sendNewSignet;
import weaver.interfaces.workflow.action.Action;
import weaver.soa.workflow.request.RequestInfo;

import java.util.HashMap;
import java.util.Map;

public class SendSignetAction implements Action {

    private   String detailid;

    public String getDetailid() {
        return detailid;
    }

    public void setDetailid(String detailid) {
        this.detailid = detailid;
    }

    public String getSignetdetailid() {
        return Signetdetailid;
    }

    public void setSignetdetailid(String signetdetailid) {
        Signetdetailid = signetdetailid;
    }

    private   String Signetdetailid;

    @Override
    public String execute(RequestInfo requestInfo) {
        BaseBean bp=new BaseBean();
        RecordSet rs = new RecordSet();
        String requestid = requestInfo.getRequestid();
        String requestname=requestInfo.getRequestManager().getRequestname();

        bp.writeLog("系统办结玩之后触发用印流程！！！");
        bp.writeLog("requestid："+requestid);

        boolean message =false;
        if(!"".equals(requestid))
        {
            try{
                Map<String,Object> map=new HashMap<>();
                map.put("requestid",requestid);
                map.put("requestname",requestname);
                map.put("detailid",this.detailid);map.put("signetdetailid",this.Signetdetailid);

                //                sendNewSignet sendNewSignet = new sendNewSignet();
//                message = sendNewSignet.createFwToOldSignet(Util.getIntValue(requestid),Util.getIntValue(detailid),Signetdetailid ,requestname);
                ServiceUtil.getService(SendSignetServiceImpl.class).sendsealworkflow(map);
                //if(message){
                /**
                 * 成功失败不影响流程走向
                 * */
                return Action.SUCCESS;

            }catch (Exception e){
                new BaseBean().writeLog("测试返回数据："+message);
                return Action.SUCCESS;
            }
        }
        return Action.SUCCESS;
    }
}
