package weaver.interfaces.htsc.gwlc;

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

import org.apache.commons.lang.StringUtils;

import cn.hutool.core.date.DateUtil;
import weaver.general.Util;
import weaver.interfaces.htsc.GlobatTools.JAVATools;
import weaver.interfaces.workflow.action.Action;
import weaver.soa.workflow.request.RequestInfo;

/**
 * @author xf
 * @version 1.0.0
 * @ClassName GwfirstnumberAction.java
 * @createTime 2022年01月05日 13:52:00
 */
public class SendSealDateAction implements Action {

    @Override
    public String execute(RequestInfo requestInfo) {
        String requestid= Util.null2String(requestInfo.getRequestid());
        if("".equals(requestid)){
            JAVATools.SetCmdwritelog("流程修改排版的requestid获取失败"+requestid);
            return Action.SUCCESS;
        }
        String tablename=JAVATools.getMaintable(requestid);
        String unnumber=JAVATools.getmainunnumber(requestid);
        if("".equals(tablename)){
            JAVATools.SetCmdwritelog("流程修改排版的表明获取获取失败"+requestid);
            return Action.SUCCESS;
        }
        String qfrq= DateUtil.format(new Date(),"yyyy-MM-dd");
        Map<String,String> wheremap=new HashMap<>(1);
        wheremap.put("requestid",requestid);
        Map<String,String> setmap=new HashMap<>(1);
        setmap.put("qfrq",qfrq);
        boolean flag=JAVATools.Updatesql(setmap,tablename,wheremap);
        if(flag){
            JAVATools.SetCmdwritelog("流程修改改印发日期成功"+requestid);
        }else{
            JAVATools.SetCmdwritelog("流程修改改印发日期失败"+requestid);
        }


        return Action.SUCCESS;
    }


}
