package weaver.interfaces.htxc.cgty;

import weaver.conn.RecordSet;
import weaver.general.BaseBean;
import weaver.interfaces.workflow.action.Action;
import weaver.soa.workflow.request.RequestInfo;

/**
 * @Title: ecology-9
 * @Company: 泛微软件
 * @author: K1810027
 * @version: 1.0
 * @CreateDate: 2022-08-22 14:00
 * @Description:这个action是用来出来7条通用流程办结后更新建模采购相信明细表1
 * @ModifyLog:
 **/
public class EndingUpdateDetail1Action extends BaseBean implements Action {
    @Override
    public String execute(RequestInfo requestinfo) {
        try{
            String requestId = requestinfo.getRequestid();//请求ID
            String nodeName = "办结";
            RecordSet rs = new RecordSet();
            BaseBean bb = new BaseBean();
            bb.writeLog("EndingUpdateDetail1Action"+"开始了");
            String dt1Sql = "select * from  uf_cgxq_dt1 where lcmc = "+requestId;
            bb.writeLog("EndingUpdateDt1-dt1Sql"+dt1Sql);
            rs.execute(dt1Sql);
            if(rs.next()){
                String updateDt1Sql = "update uf_cgxq_dt1 set dqcljd ='"+nodeName+"',dqclr= '',dqclsc='',lczt = 1,dqjdqssj='' where lcmc = "+requestId;
                bb.writeLog("EndingUpdateDt1-updateDt1Sql"+updateDt1Sql);
                rs.execute(updateDt1Sql);
            }

            return Action.SUCCESS;
        }catch (Exception e){
            return Action.FAILURE_AND_CONTINUE;
        }

    }
}