empsHuiqian=BP.DA.DBAccess.RunSQLReturnString("select wm_concat(emptot) from ND2TRACK where workID ="+gwf.WorkID+" AND ndfrom IN('201', '205') AND ACTIONTYPE != 22");
empsShengHe=BP.DA.DBAccess.RunSQLReturnString("select wm_concat(emptot) from ND2TRACK where workID ="+gwf.WorkID+" AND ndfrom IN('203') AND ACTIONTYPE != 22");
empsJiaoDui=BP.DA.DBAccess.RunSQLReturnString("select EmpName from wf_generworkerlist where WorkID="+gwf.WorkID+" AND FK_Node IN('206')");
empsPiZhun=BP.DA.DBAccess.RunSQLReturnString("select EmpName from wf_generworkerlist where WorkID="+gwf.WorkID+" AND FK_Node IN('207')");
ptable=BP.DA.DBAccess.RunSQLReturnString("select PTable from WF_Flow where No="+lcbh+"");
BP.WF.GERpthisGERpt2=newBP.WF.GERpt(ptable);
GERptrpt2=hisGERpt2;
rpt2.OID=gwf.WorkID;
rpt2.RetrieveFromDBSources();
stringsh=rpt2.GetValStrByKey("SH");//审核
stringxd=rpt2.GetValStrByKey("XD");//校对
stringpz=rpt2.GetValStrByKey("PZ");//批准
ptable=BP.DA.DBAccess.RunSQLReturnString("select PTable from WF_Flow where No="+lcbh+"");
intnum=BP.DA.DBAccess.RunSQLReturnValInt("select oid from "+dtlNo+" WHERE RefPK = "+bfoid);
stringstarter=BP.DA.DBAccess.RunSQLReturnString("select startername from wf_generworkflow where workid ="+bfoid);
starter=starter+",";
if(num==0)
{
BP.DA.DBAccess.RunSQL("INSERT INTO "+dtlNo+" (BZSHR, PZR,) VALUES("+starter+empsShengHe+", "+empsPiZhun+"");
}
}
//工艺卡审批
if(gwf.FlowNo=="021")
{
empsShengHe=BP.DA.DBAccess.RunSQLReturnString("SELECT EmptoT FROM ND21TRACK WHERE WorkID="+gwf.WorkID+" AND ndfrom ='2101'AND ndto = '2102' ");
empsJiaoDui=BP.DA.DBAccess.RunSQLReturnString("select wm_concat(emptot) from ND21TRACK where workID ="+gwf.WorkID+" AND ndfrom ='2103' AND ACTIONTYPE != 22");
empsPiZhun=BP.DA.DBAccess.RunSQLReturnString("select EmpName from wf_generworkerlist where WorkID="+gwf.WorkID+" AND FK_Node = '2105'");
ptable=BP.DA.DBAccess.RunSQLReturnString("select PTable from WF_Flow where No="+lcbh+"");
BP.WF.GERpthisGERpt2=newBP.WF.GERpt(ptable);
GERptrpt2=hisGERpt2;
rpt2.OID=gwf.WorkID;
rpt2.RetrieveFromDBSources();
stringsh=rpt2.GetValStrByKey("RIVIEWER");//审核
stringxd=rpt2.GetValStrByKey("APPROVER");//校对
stringpz=rpt2.GetValStrByKey("PROOFREADER");//批准
stringpc_NO=rpt2.GetValStrByKey("RC_NO");//工艺卡编号
stringqp_NO=rpt2.GetValStrByKey("QP_NO");//质量要点编号
ptable=BP.DA.DBAccess.RunSQLReturnString("select PTable from WF_Flow where No="+lcbh+"");