/// <summary>
    /// 发送到下一环节
    /// </summary>
    /// <param name="strTaskId">任务ID</param>
    /// <returns></returns>
    public string SendToNext(string strSampleAskDate, string strSampleFinishDate)
    {
        bool IsSuccess            = true;
        TMisMonitorTaskVo objTask = new TMisMonitorTaskVo();

        objTask.PLAN_ID = this.PLAN_ID.Value;
        objTask         = new TMisMonitorTaskLogic().Details(objTask);

        TMisMonitorSubtaskVo objSubTask = new TMisMonitorSubtaskVo();

        objSubTask.TASK_ID = objTask.ID;

        DataTable dt = new TMisMonitorSubtaskLogic().SelectByTable(objSubTask);

        for (int i = 0; i < dt.Rows.Count; i++)
        {
            objSubTask.ID                 = dt.Rows[i]["ID"].ToString();
            objSubTask.TASK_STATUS        = "02";
            objSubTask.SAMPLE_ASK_DATE    = strSampleAskDate;
            objSubTask.SAMPLE_FINISH_DATE = strSampleFinishDate;
            if (!new TMisMonitorSubtaskLogic().Edit(objSubTask))
            {
                IsSuccess = false;
            }

            TMisMonitorSubtaskAppVo objSubApp = new TMisMonitorSubtaskAppVo();


            DataTable dtApp = new TMisMonitorSubtaskAppLogic().SelectByTable(new TMisMonitorSubtaskAppVo {
                SUBTASK_ID = dt.Rows[i]["ID"].ToString()
            });
            if (dtApp.Rows.Count > 0)
            {
                objSubApp.ID             = dtApp.Rows[0]["ID"].ToString();
                objSubApp.SUBTASK_ID     = dt.Rows[i]["ID"].ToString();
                objSubApp.QC_APP_USER_ID = new PageBase().LogInfo.UserInfo.ID;
                objSubApp.QC_APP_DATE    = DateTime.Now.ToString();
                new TMisMonitorSubtaskAppLogic().Edit(objSubApp);
            }
            else
            {
                objSubApp.ID             = GetSerialNumber("TMisMonitorSubtaskAppID");
                objSubApp.SUBTASK_ID     = dt.Rows[i]["ID"].ToString();
                objSubApp.QC_APP_USER_ID = new PageBase().LogInfo.UserInfo.ID;
                objSubApp.QC_APP_DATE    = DateTime.Now.ToString();

                new TMisMonitorSubtaskAppLogic().Create(objSubApp);
            }
        }

        if (IsSuccess)
        {
            TMisContractPlanVo objPlan = new TMisContractPlanLogic().Details(this.PLAN_ID.Value);
            objPlan.HAS_DONE = "1";
            new TMisContractPlanLogic().Edit(objPlan);
        }

        return(IsSuccess == true ? "1" : "0");
    }
    public static string UpdateSampleCheck(string strSubTaskID, string strCheckUser)
    {
        DataTable dtSampleItem           = new TMisMonitorResultLogic().SelectSampleItemWithSubtaskID(strSubTaskID);
        TMisMonitorSubtaskAppVo objWhere = new TMisMonitorSubtaskAppVo();

        objWhere.SUBTASK_ID = strSubTaskID;
        TMisMonitorSubtaskAppVo objSet = new TMisMonitorSubtaskAppVo();

        objSet.SAMPLING_CHECK = strCheckUser;

        bool bResult = new TMisMonitorSubtaskAppLogic().Edit(objSet, objWhere);

        return(bResult ? "1" : "0");
    }
Beispiel #3
0
    /// <summary>
    /// 根据监测天数拆分任务(验收监测) Create By:weilin 2014-12-04
    /// </summary>
    /// <param name="strTaskID"></param>
    /// <returns></returns>
    private static bool SplitAcceptTask(string strTaskID, TBaseSerialruleVo objSerial)
    {
        bool bResult = true;
        TMisMonitorTaskVo   objTaskVo   = new TMisMonitorTaskLogic().Details(strTaskID);
        TMisMonitorReportVo objReportVo = new TMisMonitorReportVo();

        if (objTaskVo.CONTRACT_TYPE == "05")  //验收监测
        {
            TMisContractVo      objContractVo      = new TMisContractLogic().Details(objTaskVo.CONTRACT_ID);
            TMisContractPointVo objContractPointVo = new TMisContractPointVo();
            objContractPointVo.CONTRACT_ID = objTaskVo.CONTRACT_ID;
            objContractPointVo.IS_DEL      = "0";
            objContractPointVo             = new TMisContractPointLogic().Details(objContractPointVo);
            if (objContractPointVo.SAMPLE_DAY != "" && IsNumeric(objContractPointVo.SAMPLE_DAY) && objContractVo.REMARK5 == "")
            {
                int iSampleDay = int.Parse(objContractPointVo.SAMPLE_DAY);
                TMisMonitorTaskCompanyVo objClient = new TMisMonitorTaskCompanyLogic().Details(objTaskVo.CLIENT_COMPANY_ID);
                TMisMonitorTaskCompanyVo objTested = new TMisMonitorTaskCompanyLogic().Details(objTaskVo.TESTED_COMPANY_ID);
                for (int i = 1; i < iSampleDay; i++)
                {
                    TMisMonitorTaskVo objTaskAddVo = new TMisMonitorTaskVo();
                    objTaskAddVo.ID             = GetSerialNumber("t_mis_monitor_taskId");
                    objTaskAddVo.CONTRACT_ID    = objTaskVo.CONTRACT_ID;
                    objTaskAddVo.PLAN_ID        = objTaskVo.PLAN_ID;
                    objTaskAddVo.CONTRACT_CODE  = objTaskVo.CONTRACT_CODE;
                    objTaskAddVo.TICKET_NUM     = objTaskVo.TICKET_NUM + "-" + (i + 1).ToString();
                    objTaskAddVo.PROJECT_NAME   = objTaskVo.PROJECT_NAME;
                    objTaskAddVo.CONTRACT_YEAR  = objTaskVo.CONTRACT_YEAR;
                    objTaskAddVo.CONTRACT_TYPE  = objTaskVo.CONTRACT_TYPE;
                    objTaskAddVo.TEST_TYPE      = objTaskVo.TEST_TYPE;
                    objTaskAddVo.TEST_PURPOSE   = objTaskVo.TEST_PURPOSE;
                    objTaskAddVo.ASKING_DATE    = objTaskVo.ASKING_DATE;
                    objTaskAddVo.SAMPLE_SOURCE  = objTaskVo.SAMPLE_SOURCE;
                    objTaskAddVo.CREATOR_ID     = objTaskVo.CREATOR_ID;
                    objTaskAddVo.CREATE_DATE    = objTaskVo.CREATE_DATE;
                    objTaskAddVo.TASK_STATUS    = objTaskVo.TASK_STATUS;
                    objTaskAddVo.REMARK1        = objTaskVo.REMARK1;
                    objTaskAddVo.REMARK2        = objTaskVo.REMARK2;
                    objTaskAddVo.REMARK3        = objTaskVo.REMARK3;
                    objTaskAddVo.QC_STATUS      = objTaskVo.QC_STATUS;
                    objTaskAddVo.COMFIRM_STATUS = objTaskVo.COMFIRM_STATUS;
                    objTaskAddVo.ALLQC_STATUS   = objTaskVo.ALLQC_STATUS;
                    objTaskAddVo.REPORT_HANDLE  = objTaskVo.REPORT_HANDLE;

                    //构造监测任务委托企业信息
                    TMisMonitorTaskCompanyVo objClientAdd = new TMisMonitorTaskCompanyVo();
                    PageBase.CopyObject(objClient, objClientAdd);//复制对象
                    objClientAdd.ID      = PageBase.GetSerialNumber("t_mis_monitor_taskcompanyId");
                    objClientAdd.TASK_ID = objTaskAddVo.ID;
                    //构造监测任务受检企业信息
                    TMisMonitorTaskCompanyVo objTestedAdd = new TMisMonitorTaskCompanyVo();
                    PageBase.CopyObject(objTested, objTestedAdd);//复制对象
                    objTestedAdd.ID      = PageBase.GetSerialNumber("t_mis_monitor_taskcompanyId");
                    objTestedAdd.TASK_ID = objTaskAddVo.ID;

                    objTaskAddVo.CLIENT_COMPANY_ID = objClientAdd.ID;
                    objTaskAddVo.TESTED_COMPANY_ID = objTestedAdd.ID;

                    TMisMonitorReportVo objReportAdd = new TMisMonitorReportVo();
                    objReportVo.ID          = GetSerialNumber("t_mis_monitor_report_id");
                    objReportVo.REPORT_CODE = objReportVo.REPORT_CODE + "-" + (i + 1).ToString();
                    objReportVo.TASK_ID     = objTaskAddVo.ID;
                    objReportVo.IF_GET      = "0";

                    //监测子任务信息 根据委托书监测类别进行构造
                    ArrayList arrSubTask         = new ArrayList(); //监测子任务集合
                    ArrayList arrSubTaskApp      = new ArrayList();
                    ArrayList arrTaskPoint       = new ArrayList(); //监测点位集合
                    ArrayList arrPointItem       = new ArrayList(); //监测点位明细集合
                    ArrayList arrSample          = new ArrayList(); //样品集合
                    ArrayList arrSampleResult    = new ArrayList(); //样品结果集合
                    ArrayList arrSampleResultApp = new ArrayList(); //样品分析执行表

                    List <TMisMonitorSubtaskVo> listSubTask = new TMisMonitorSubtaskLogic().SelectByObject(new TMisMonitorSubtaskVo()
                    {
                        TASK_ID = objTaskVo.ID
                    }, 0, 0);
                    for (int j = 0; j < listSubTask.Count; j++)
                    {
                        TMisMonitorSubtaskVo objSubTaskAdd = new TMisMonitorSubtaskVo();
                        CopyObject(listSubTask[j], objSubTaskAdd);
                        objSubTaskAdd.ID      = GetSerialNumber("t_mis_monitor_subtaskId");
                        objSubTaskAdd.TASK_ID = objTaskAddVo.ID;
                        arrSubTask.Add(objSubTaskAdd);

                        TMisMonitorSubtaskAppVo objSubTaskApp = new TMisMonitorSubtaskAppVo();
                        objSubTaskApp.SUBTASK_ID = listSubTask[j].ID;
                        objSubTaskApp            = new TMisMonitorSubtaskAppLogic().Details(objSubTaskApp);
                        TMisMonitorSubtaskAppVo objSubTaskAppAdd = new TMisMonitorSubtaskAppVo();
                        CopyObject(objSubTaskApp, objSubTaskAppAdd);
                        objSubTaskAppAdd.ID         = GetSerialNumber("TMisMonitorSubtaskAppID");
                        objSubTaskAppAdd.SUBTASK_ID = objSubTaskAdd.ID;
                        arrSubTaskApp.Add(objSubTaskAppAdd);

                        List <TMisMonitorTaskPointVo> listTaskPoint = new TMisMonitorTaskPointLogic().SelectByObject(new TMisMonitorTaskPointVo()
                        {
                            TASK_ID = objTaskVo.ID, SUBTASK_ID = listSubTask[j].ID, IS_DEL = "0"
                        }, 0, 0);
                        for (int k = 0; k < listTaskPoint.Count; k++)
                        {
                            TMisMonitorTaskPointVo objTaskPointAdd = new TMisMonitorTaskPointVo();
                            CopyObject(listTaskPoint[k], objTaskPointAdd);
                            objTaskPointAdd.ID      = GetSerialNumber("t_mis_monitor_taskpointId");
                            objTaskPointAdd.TASK_ID = objTaskAddVo.ID;
                            arrTaskPoint.Add(objTaskPointAdd);

                            TMisMonitorSampleInfoVo objSampleInfoVo = new TMisMonitorSampleInfoVo();
                            objSampleInfoVo.SUBTASK_ID = listSubTask[j].ID;
                            objSampleInfoVo.POINT_ID   = listTaskPoint[k].ID;
                            objSampleInfoVo            = new TMisMonitorSampleInfoLogic().Details(objSampleInfoVo);
                            TMisMonitorSampleInfoVo objSampleInfoAdd = new TMisMonitorSampleInfoVo();
                            CopyObject(objSampleInfoVo, objSampleInfoAdd);
                            objSampleInfoAdd.ID          = GetSerialNumber("MonitorSampleId");
                            objSampleInfoAdd.SUBTASK_ID  = objSubTaskAdd.ID;
                            objSampleInfoAdd.POINT_ID    = objTaskPointAdd.ID;
                            objSampleInfoAdd.SAMPLE_CODE = CreateBaseDefineCodeForSample(objSerial, objTaskAddVo, objSubTaskAdd);
                            arrSample.Add(objSampleInfoAdd);

                            List <TMisMonitorTaskItemVo> listTaskItem = new TMisMonitorTaskItemLogic().SelectByObject(new TMisMonitorTaskItemVo()
                            {
                                TASK_POINT_ID = listTaskPoint[k].ID, IS_DEL = "0"
                            }, 0, 0);
                            for (int l = 0; l < listTaskItem.Count; l++)
                            {
                                TMisMonitorTaskItemVo objTaskItemAdd = new TMisMonitorTaskItemVo();
                                CopyObject(listTaskItem[l], objTaskItemAdd);
                                objTaskItemAdd.ID            = GetSerialNumber("t_mis_monitor_task_item_id");
                                objTaskItemAdd.TASK_POINT_ID = objTaskPointAdd.ID;
                                arrPointItem.Add(objTaskItemAdd);
                            }

                            List <TMisMonitorResultVo> listResult = new TMisMonitorResultLogic().SelectByObject(new TMisMonitorResultVo()
                            {
                                SAMPLE_ID = objSampleInfoVo.ID
                            }, 0, 0);
                            for (int l = 0; l < listResult.Count; l++)
                            {
                                TMisMonitorResultVo objResultAdd = new TMisMonitorResultVo();
                                CopyObject(listResult[l], objResultAdd);
                                objResultAdd.ID        = GetSerialNumber("MonitorResultId");
                                objResultAdd.SAMPLE_ID = objSampleInfoAdd.ID;
                                arrSampleResult.Add(objResultAdd);

                                TMisMonitorResultAppVo objResultAppVo = new TMisMonitorResultAppVo();
                                objResultAppVo.RESULT_ID = listResult[l].ID;
                                objResultAppVo           = new TMisMonitorResultAppLogic().Details(objResultAppVo);
                                TMisMonitorResultAppVo objResultAppAdd = new TMisMonitorResultAppVo();
                                CopyObject(objResultAppVo, objResultAppAdd);
                                objResultAppAdd.ID        = GetSerialNumber("MonitorResultAppId");
                                objResultAppAdd.RESULT_ID = objResultAdd.ID;
                                arrSampleResultApp.Add(objResultAppAdd);
                            }
                        }
                    }
                    if (new TMisMonitorTaskLogic().SaveTrans(objTaskAddVo, objClientAdd, objTestedAdd, objReportVo, arrTaskPoint, arrSubTask, arrSubTaskApp, arrPointItem, arrSample, arrSampleResult, arrSampleResultApp))
                    {
                        bResult = true;
                    }
                }
                //更新任务单号
                objTaskVo.TICKET_NUM = objTaskVo.TICKET_NUM + "-1";
                new TMisMonitorTaskLogic().Edit(objTaskVo);
                //更新报告单号
                objReportVo.REPORT_CODE = objReportVo.REPORT_CODE + "-1";
                new TMisMonitorReportLogic().Edit(objReportVo);
                //更新验收委托书任务已经拆分任务的标志
                objContractVo.REMARK5 = "1";
                new TMisContractLogic().Edit(objContractVo);
            }
        }

        return(bResult);
    }
Beispiel #4
0
    public static string btnSendClick(string strWorkTask_Id, string strPlanID, string strSampleAskDate, string strSampleFinishDate, string strTicketNum, string strQCStatus)
    {
        bool IsSuccess            = true;
        TMisMonitorTaskVo objTask = new TMisMonitorTaskVo();

        objTask.ID      = strWorkTask_Id;
        objTask.PLAN_ID = strPlanID;
        objTask         = new TMisMonitorTaskLogic().Details(objTask);


        TMisMonitorSubtaskVo objSubTask = new TMisMonitorSubtaskVo();

        objSubTask.TASK_ID = objTask.ID;
        DataTable dt = new TMisMonitorSubtaskLogic().SelectByTable(objSubTask);

        //判断是否经过质控,如果经过质控,则将数据发送到质控环节
        if (!String.IsNullOrEmpty(strQCStatus) && strQCStatus == "1")
        {
            TMisMonitorTaskVo objTaskEdit = new TMisMonitorTaskVo();
            objTaskEdit.ID          = objTask.ID;
            objTaskEdit.QC_STATUS   = "2";
            objTaskEdit.TICKET_NUM  = strTicketNum;
            objTaskEdit.ASKING_DATE = strSampleFinishDate;//黄进军添加20140901
            //如果是环境质量类 将 SEND_STATUS 设置为1
            if (objTask.TASK_TYPE == "1")
            {
                objTaskEdit.SEND_STATUS = "1";
            }
            else
            {
                //分配任务报告编制人
                if (objTask.REPORT_HANDLE == "")
                {
                    objTaskEdit.REPORT_HANDLE = getNextReportUserID("Report_UserID");
                }
            }
            if (new TMisMonitorTaskLogic().Edit(objTaskEdit))
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    objSubTask.ID = dt.Rows[i]["ID"].ToString();
                    //objSubTask.SAMPLE_ASK_DATE = strSampleAskDate;
                    objSubTask.SAMPLE_FINISH_DATE = strSampleFinishDate;
                    if (!new TMisMonitorSubtaskLogic().Edit(objSubTask))
                    {
                        IsSuccess = false;
                    }
                }
            }
        }
        //如果不需要质控,则直接发送到采样环节
        else
        {
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                objSubTask.ID          = dt.Rows[i]["ID"].ToString();
                objSubTask.TASK_STATUS = "02";
                objSubTask.TASK_TYPE   = "发送";
                //objSubTask.SAMPLE_ASK_DATE = strSampleAskDate;
                objSubTask.SAMPLE_FINISH_DATE = strSampleFinishDate;
                if (!new TMisMonitorSubtaskLogic().Edit(objSubTask))
                {
                    IsSuccess = false;
                }
            }

            if (IsSuccess)
            {
                TMisMonitorTaskVo objTaskEdit = new TMisMonitorTaskVo();
                objTaskEdit.ID          = objTask.ID;
                objTaskEdit.TICKET_NUM  = strTicketNum;
                objTaskEdit.ASKING_DATE = strSampleFinishDate; //黄进军添加20140901
                objTaskEdit.QC_STATUS   = "8";                 //表示已经完成质控设置
                //如果是环境质量类 将 SEND_STATUS 设置为1
                if (objTask.TASK_TYPE == "1")
                {
                    objTaskEdit.SEND_STATUS = "1";
                }
                else
                {
                    //分配任务报告编制人
                    if (objTask.REPORT_HANDLE == "")
                    {
                        objTaskEdit.REPORT_HANDLE = getNextReportUserID("Report_UserID");
                    }
                }
                new TMisMonitorTaskLogic().Edit(objTaskEdit);

                TMisContractPlanVo objPlan = new TMisContractPlanLogic().Details(strPlanID);
                objPlan.HAS_DONE = "1";
                new TMisContractPlanLogic().Edit(objPlan);
            }
        }

        TMisMonitorSubtaskAppVo objSubApp = new TMisMonitorSubtaskAppVo();
        TMisMonitorSampleInfoVo objSample = new TMisMonitorSampleInfoVo();
        TBaseSerialruleVo       objSerial = new TBaseSerialruleVo();

        objSerial.SAMPLE_SOURCE = objTask.SAMPLE_SOURCE;
        objSerial.SERIAL_TYPE   = "2";
        List <TMisMonitorSampleInfoVo> list = new List <TMisMonitorSampleInfoVo>();

        for (int i = 0; i < dt.Rows.Count; i++)
        {
            DataTable dtApp = new TMisMonitorSubtaskAppLogic().SelectByTable(new TMisMonitorSubtaskAppVo {
                SUBTASK_ID = dt.Rows[i]["ID"].ToString()
            });
            if (dtApp.Rows.Count > 0)
            {
                objSubApp.ID                 = dtApp.Rows[0]["ID"].ToString();
                objSubApp.SUBTASK_ID         = dt.Rows[i]["ID"].ToString();
                objSubApp.SAMPLE_ASSIGN_ID   = new PageBase().LogInfo.UserInfo.ID;
                objSubApp.SAMPLE_ASSIGN_DATE = DateTime.Now.ToString();
                new TMisMonitorSubtaskAppLogic().Edit(objSubApp);
            }
            else
            {
                objSubApp.ID                 = GetSerialNumber("TMisMonitorSubtaskAppID");
                objSubApp.SUBTASK_ID         = dt.Rows[i]["ID"].ToString();
                objSubApp.SAMPLE_ASSIGN_ID   = new PageBase().LogInfo.UserInfo.ID;
                objSubApp.SAMPLE_ASSIGN_DATE = DateTime.Now.ToString();

                new TMisMonitorSubtaskAppLogic().Create(objSubApp);
            }
            //噪声除外的所有样品设置样品编号 Create By weilin 2014-03-19
            if (dt.Rows[i]["MONITOR_ID"].ToString() != "000000004" && dt.Rows[i]["MONITOR_ID"].ToString() != "FunctionNoise" && dt.Rows[i]["MONITOR_ID"].ToString() != "AreaNoise" && dt.Rows[i]["MONITOR_ID"].ToString() != "EnvRoadNoise")
            {
                objSubTask           = new TMisMonitorSubtaskLogic().Details(dt.Rows[i]["ID"].ToString());
                objSample            = new TMisMonitorSampleInfoVo();
                objSample.SUBTASK_ID = dt.Rows[i]["ID"].ToString();
                list = new TMisMonitorSampleInfoLogic().SelectByObject(objSample, 0, 0);
                for (int j = 0; j < list.Count; j++)
                {
                    if (list[j].SAMPLE_CODE.Length == 0)
                    {
                        objSample.ID = list[j].ID;

                        if (objTask.TASK_TYPE == "1")
                        {
                            objSample.SAMPLE_CODE = list[j].SAMPLE_NAME;
                        }
                        else
                        {
                            objSample.SAMPLE_CODE = CreateBaseDefineCodeForSample(objSerial, objTask, objSubTask);
                        }

                        new TMisMonitorSampleInfoLogic().Edit(objSample);
                    }
                }
            }
        }
        SplitAcceptTask(strWorkTask_Id, objSerial);
        return(IsSuccess == true ? "1" : "0");
        //bool IsSuccess = true;
        //TMisMonitorTaskVo objTask = new TMisMonitorTaskVo();
        //objTask.PLAN_ID = strPlanID;
        //objTask = new TMisMonitorTaskLogic().Details(objTask);

        //TMisMonitorSubtaskVo objSubTask = new TMisMonitorSubtaskVo();
        //objSubTask.TASK_ID = objTask.ID;

        //DataTable dt = new TMisMonitorSubtaskLogic().SelectByTable(objSubTask);
        //for (int i = 0; i < dt.Rows.Count; i++)
        //{
        //    objSubTask.ID = dt.Rows[i]["ID"].ToString();
        //    objSubTask.TASK_STATUS = "02";
        //    objSubTask.SAMPLE_ASK_DATE = strSampleAskDate;
        //    objSubTask.SAMPLE_FINISH_DATE = strSampleFinishDate;
        //    if (!new TMisMonitorSubtaskLogic().Edit(objSubTask))
        //        IsSuccess = false;

        //    //TMisMonitorSubtaskAppVo objSubtaskApp = new TMisMonitorSubtaskAppVo();

        //    //objSubtaskApp.ID = GetSerialNumber("TMisMonitorSubtaskAppID");
        //    //objSubtaskApp.SUBTASK_ID = objSubTask.ID;
        //    //objSubtaskApp.SAMPLE_ASSIGN_ID = LogInfo.UserInfo.ID;
        //    //objSubtaskApp.SAMPLE_ASSIGN_DATE = DateTime.Now.ToString();

        //    //new TMisMonitorSubtaskAppLogic().Create(objSubtaskApp);
        //}

        //if (IsSuccess)
        //{
        //    TMisContractPlanVo objPlan = new TMisContractPlanLogic().Details(strPlanID);
        //    objPlan.HAS_DONE = "1";
        //    new TMisContractPlanLogic().Edit(objPlan);
        //}
        //return IsSuccess == true ? "1" : "0";
    }
    public static string btnSendClick(string strPlanID, string strSampleAskDate, string strSampleFinishDate, string strTicketNum, string strQCStatus, string strALLQCSTATUS)
    {
        //huangjinjun 20140509
        if (strALLQCSTATUS == "是")
        {
            strALLQCSTATUS = "1";
        }
        else
        {
            strALLQCSTATUS = "0";
        }
        //end

        bool IsSuccess            = true;
        TMisMonitorTaskVo objTask = new TMisMonitorTaskVo();

        objTask.PLAN_ID = strPlanID;
        objTask         = new TMisMonitorTaskLogic().Details(objTask);


        TMisMonitorSubtaskVo objSubTask = new TMisMonitorSubtaskVo();

        objSubTask.TASK_ID = objTask.ID;
        DataTable dt = new TMisMonitorSubtaskLogic().SelectByTable(objSubTask);

        //判断是否经过质控,如果经过质控,则将数据发送到质控环节
        if (!String.IsNullOrEmpty(strQCStatus) && strQCStatus == "4")
        {
            TMisMonitorTaskVo objTaskEdit = new TMisMonitorTaskVo();
            objTaskEdit.ID         = objTask.ID;
            objTaskEdit.QC_STATUS  = "2";
            objTaskEdit.TICKET_NUM = strTicketNum;
            //huangjinun 20140509
            objTaskEdit.ALLQC_STATUS = strALLQCSTATUS;
            //end
            //如果是环境质量类 将 SEND_STATUS 设置为1
            if (objTask.TASK_TYPE == "1")
            {
                objTaskEdit.SEND_STATUS = "1";
                //objTaskEdit.QC_STATUS = "9";

                //TMisContractPlanVo objPlan = new TMisContractPlanLogic().Details(strPlanID);
                //objPlan.HAS_DONE = "1";
                //new TMisContractPlanLogic().Edit(objPlan);
            }
            if (new TMisMonitorTaskLogic().Edit(objTaskEdit))
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    objSubTask.ID = dt.Rows[i]["ID"].ToString();
                    objSubTask.SAMPLE_ASK_DATE    = strSampleAskDate;
                    objSubTask.SAMPLE_FINISH_DATE = strSampleFinishDate;
                    //如果是环境质量类
                    if (objTask.TASK_TYPE == "1")
                    {
                        //objSubTask.TASK_STATUS = "02";
                    }

                    if (!new TMisMonitorSubtaskLogic().Edit(objSubTask))
                    {
                        IsSuccess = false;
                    }
                }
            }
        }
        //如果不需要质控,则直接发送到采样环节
        else
        {
            TMisMonitorTaskVo objTaskEdit = new TMisMonitorTaskVo();
            objTaskEdit.ID         = objTask.ID;
            objTaskEdit.QC_STATUS  = "8";
            objTaskEdit.TICKET_NUM = strTicketNum;
            //如果是环境质量类 将 SEND_STATUS 设置为1
            if (objTask.TASK_TYPE == "1")
            {
                objTaskEdit.SEND_STATUS = "1";
            }
            if (new TMisMonitorTaskLogic().Edit(objTaskEdit))
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    objSubTask.ID                 = dt.Rows[i]["ID"].ToString();
                    objSubTask.TASK_STATUS        = "02";
                    objSubTask.SAMPLE_ASK_DATE    = strSampleAskDate;
                    objSubTask.SAMPLE_FINISH_DATE = strSampleFinishDate;
                    if (!new TMisMonitorSubtaskLogic().Edit(objSubTask))
                    {
                        IsSuccess = false;
                    }
                }
            }


            if (IsSuccess)
            {
                TMisContractPlanVo objPlan = new TMisContractPlanLogic().Details(strPlanID);
                objPlan.HAS_DONE = "1";
                new TMisContractPlanLogic().Edit(objPlan);
            }
        }

        TMisMonitorSubtaskAppVo objSubApp = new TMisMonitorSubtaskAppVo();

        for (int i = 0; i < dt.Rows.Count; i++)
        {
            DataTable dtApp = new TMisMonitorSubtaskAppLogic().SelectByTable(new TMisMonitorSubtaskAppVo {
                SUBTASK_ID = dt.Rows[i]["ID"].ToString()
            });
            if (dtApp.Rows.Count > 0)
            {
                objSubApp.ID             = dtApp.Rows[0]["ID"].ToString();
                objSubApp.SUBTASK_ID     = dt.Rows[i]["ID"].ToString();
                objSubApp.QC_APP_USER_ID = new PageBase().LogInfo.UserInfo.ID;
                objSubApp.QC_APP_DATE    = DateTime.Now.ToString();
                new TMisMonitorSubtaskAppLogic().Edit(objSubApp);
            }
            else
            {
                objSubApp.ID             = GetSerialNumber("TMisMonitorSubtaskAppID");
                objSubApp.SUBTASK_ID     = dt.Rows[i]["ID"].ToString();
                objSubApp.QC_APP_USER_ID = new PageBase().LogInfo.UserInfo.ID;
                objSubApp.QC_APP_DATE    = DateTime.Now.ToString();

                new TMisMonitorSubtaskAppLogic().Create(objSubApp);
            }
        }
        return(IsSuccess == true ? "1" : "0");
    }
Beispiel #6
0
    public static string btnSendClick(string strSubtaskID, string strAttribute)
    {
        bool isSuccess = true;
        TMisMonitorSubtaskVo objSubtask = new TMisMonitorSubtaskLogic().Details(strSubtaskID);
        string strTaskID = objSubtask.TASK_ID;

        if (objSubtask.MONITOR_ID == "000000004" || objSubtask.MONITOR_ID == "000000005")
        {
            objSubtask.TASK_STATUS = "023";//噪声、辐射现场监测项目进行 现场项目审核流程
            objSubtask.REMARK1     = objSubtask.ID;
        }
        else
        {
            objSubtask.TASK_STATUS = "021";//其它进行样品交接环节
        }
        //子任务所有项目都属于现场项目,跳过分析环节
        //DataTable dtSampleDept = new TMisMonitorResultLogic().SelectSampleDeptWithSubtaskID(strSubtaskID);
        //update by ssz QY 现场项目信息需要另外发送任务
        DataTable dtSampleItem = new TMisMonitorResultLogic().SelectSampleItemWithSubtaskID(strSubtaskID);

        //郑州'余氯','透明度','pH值','电导率','溶解氧'为现场项目
        //以上项目,环境质量由现场室监测,污染源由实验室监测(余氯除外)
        //这几个项目需要实验室填写,REMARK_4=1
        //string strEnvSampleItemID = "FS0000005,FS0000006,FS0000009,FS0000012,001000159";
        string strEnvSampleItemID = "FS0000005,FS0000006,FS0000009,FS0000012";
        //string strEnvType = "EnvRiver,EnvRiverCity,EnvRiverTarget,EnvRiverPlan,EnvReservoir,EnvRain,EnvMudRiver,EnvDrinkingSource,EnvDrinking";
        string strEnvType = "EnvRiver,EnvRiverCity,EnvRiverTarget,EnvRiverPlan,EnvReservoir,EnvMudRiver,EnvDrinkingSource,EnvDrinking";//降水除外

        for (int i = 0; i < dtSampleItem.Rows.Count; i++)
        {
            if (strEnvSampleItemID.Contains(dtSampleItem.Rows[i]["ITEM_ID"].ToString()))
            {
                if (!strEnvType.Contains(objSubtask.MONITOR_ID))
                {
                    TMisMonitorResultVo objResult = new TMisMonitorResultVo();
                    objResult.ID       = dtSampleItem.Rows[i]["ID"].ToString();
                    objResult.REMARK_4 = "1";
                    new TMisMonitorResultLogic().Edit(objResult);
                }
            }
        }

        //子任务所有项目都属于现场项目,跳过分析环节
        DataTable dtSampleDept = new TMisMonitorResultLogic().SelectSampleDeptWithSubtaskID(strSubtaskID);

        //update by ssz QY 现场项目信息需要另外发送任务
        dtSampleItem = new TMisMonitorResultLogic().SelectSampleItemWithSubtaskID(strSubtaskID);

        //郑州'余氯','透明度','pH值','电导率','溶解氧'为现场项目
        //以上项目,环境质量由现场室监测,污染源由实验室监测
        bool ifNeedNewSubTask = false;

        if (dtSampleItem.Rows.Count > 0 && dtSampleDept.Rows.Count > 0)//存在 非现场项目和现场项目
        {
            ifNeedNewSubTask = true;
        }

        //判定是否有现场室项目,或者是否有实验室项目
        bool isHasSampleItem = false;
        bool isHasDeptItem   = false;

        for (int i = 0; i < dtSampleItem.Rows.Count; i++)
        {
            if (dtSampleItem.Rows[i]["REMARK_4"].ToString() == "1")
            {
                isHasDeptItem = true;
            }
            if (dtSampleItem.Rows[i]["REMARK_4"].ToString() != "1")
            {
                isHasSampleItem = true;
            }
        }

        if (dtSampleItem.Rows.Count > 0)
        {
            if (!isHasDeptItem)                   //现场项目全是现场室填写
            {
                if (dtSampleDept.Rows.Count == 0) //而且无实验室项目
                {
                    objSubtask.TASK_STATUS = "023";
                    objSubtask.REMARK1     = objSubtask.ID;
                }
                else//但有实验室项目
                {
                    ifNeedNewSubTask = true;
                }
            }
            else if (!isHasSampleItem)//现场项目全是实验室填写
            {
                ifNeedNewSubTask = false;
            }
            else //现场项目有现场室和实验室填写内容
            {
                ifNeedNewSubTask = true;
            }
        }
        else
        {
            //全实验室项目,021
        }

        //if (dtSampleDept.Rows.Count == 0)//全是现场项目
        //{
        //    objSubtask.TASK_STATUS = "023";
        //    objSubtask.REMARK1 = objSubtask.ID;
        //}

        if (ifNeedNewSubTask)//存在 非现场项目和现场项目
        {
            TMisMonitorSubtaskVo objSampleSubtask = new TMisMonitorSubtaskVo();
            CopyObject(objSubtask, objSampleSubtask);
            objSampleSubtask.ID          = GetSerialNumber("t_mis_monitor_subtaskId");
            objSampleSubtask.REMARK1     = objSubtask.ID;
            objSampleSubtask.TASK_STATUS = "023";
            //创建一个新的任务 对现场项目流程
            new TMisMonitorSubtaskLogic().Create(objSampleSubtask);

            //创建监测子任务审核表 对现场项目流程
            TMisMonitorSubtaskAppVo objSubTaskApp = new TMisMonitorSubtaskAppLogic().Details(new TMisMonitorSubtaskAppVo()
            {
                SUBTASK_ID = objSubtask.ID,
            }
                                                                                             );
            TMisMonitorSubtaskAppVo objSampleSubTaskApp = new TMisMonitorSubtaskAppVo();
            CopyObject(objSubTaskApp, objSampleSubTaskApp);
            objSampleSubTaskApp.SUBTASK_ID = objSampleSubtask.ID;
            objSampleSubTaskApp.ID         = GetSerialNumber("TMisMonitorSubtaskAppID");
            new TMisMonitorSubtaskAppLogic().Create(objSampleSubTaskApp);
        }
        isSuccess = new TMisMonitorSubtaskLogic().Edit(objSubtask);

        #region 任务全部完成,修改任务表状态(注释)
        int iStatus = 0;
        objSubtask         = new TMisMonitorSubtaskVo();
        objSubtask.TASK_ID = strTaskID;
        DataTable dtTask = new TMisMonitorSubtaskLogic().SelectByTable(objSubtask);
        for (int j = 0; j < dtTask.Rows.Count; j++)
        {
            if (dtTask.Rows[j]["TASK_STATUS"].ToString() != "023")
            {
                iStatus += 1;
            }
        }
        if (iStatus == 0)
        {
            TMisMonitorTaskVo objTask = new TMisMonitorTaskVo();
            objTask.ID          = strTaskID;
            objTask.TASK_STATUS = "09";
            new TMisMonitorTaskLogic().Edit(objTask);
        }
        #endregion

        #region 现场信息
        //现场信息
        TMisMonitorSampleSkyVo objSampleSky = new TMisMonitorSampleSkyVo();

        for (int i = 0; i < strAttribute.Split('-').Length; i++)
        {
            if (strAttribute.Split('-')[i].Contains("|"))
            {
                objSampleSky.SUBTASK_ID   = strSubtaskID;
                objSampleSky.WEATHER_ITEM = strAttribute.Split('-')[i].Split('|')[0];
                objSampleSky = new TMisMonitorSampleSkyLogic().Details(objSampleSky);
                objSampleSky.WEATHER_INFO = strAttribute.Split('-')[i].Split('|')[1];
                objSampleSky.SUBTASK_ID   = strSubtaskID;
                objSampleSky.WEATHER_ITEM = strAttribute.Split('-')[i].Split('|')[0];
                if (objSampleSky.ID.Length > 0)
                {
                    isSuccess = new TMisMonitorSampleSkyLogic().Edit(objSampleSky);
                }
                else
                {
                    objSampleSky.ID = GetSerialNumber("TMisMonitorSampleSky");
                    isSuccess       = new TMisMonitorSampleSkyLogic().Create(objSampleSky);
                }
            }
        }
        #endregion
        return(isSuccess == true ? "1" : "0");
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        //定义结果
        string strResult = "";

        if (!IsPostBack)
        {
            if (Request.QueryString["type"] == "check")
            {
                var UserNo = Request.QueryString["UserNo"];//有两个UserNo???等解决
                UserNo = UserNo.Split(',').Count() > 1 ? UserNo.Split(',')[1] : UserNo;
                UserNo = UserNo.Trim(',');

                var workID = Convert.ToInt32(Request.QueryString["OID"]);//OID为流程ID

                var strSubTaskID = CCFlowFacade.GetFlowIdentification(UserNo, workID).Split('|')[0];

                //获取现场项目
                DataTable dtSampleItem = new TMisMonitorResultLogic().SelectSampleItemWithSubtaskID(strSubTaskID);

                if (dtSampleItem.Rows.Count > 0)
                {
                    TMisMonitorSubtaskAppVo objSubtaskAppVo = new TMisMonitorSubtaskAppVo();
                    objSubtaskAppVo.SUBTASK_ID = strSubTaskID;
                    objSubtaskAppVo            = new TMisMonitorSubtaskAppLogic().Details(objSubtaskAppVo);

                    //objSubtaskAppVo.SAMPLING_CHECK = "administrator";//临时测试

                    if (!string.IsNullOrEmpty(objSubtaskAppVo.SAMPLING_CHECK))
                    {
                        //TSysUserVo objUserVo = new TSysUserLogic().Details(objSubtaskAppVo.SAMPLING_CHECK);

                        //var childFlowID = System.Configuration.ConfigurationManager.AppSettings["XCSSH"].ToString().Trim(',');
                        //var childNodeID = Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["XCSSHJNode"]);

                        //CCFlowFacade.Node_CreateBlankWork(UserNo, childFlowID, UserNo, null, workID, fid, flowId, nodeId, UserNo, childNodeID, objUserVo.USER_NAME.Trim(','), "@GroupMark=" + strSubTaskID);
                    }
                    else
                    {
                        Response.Write("false没有指定现场项目复核人,不能发送");
                        Response.ContentType     = "text/plain";
                        Response.ContentEncoding = Encoding.UTF8;
                        Response.End();
                    }

                    //yinchengyi 2015-4-24 打开页面时 记录ccflow流程ID信息到业务系统数据库
                    //TMisMonitorSubtaskVo objSubtaskVo = new TMisMonitorSubtaskVo();
                    //objSubtaskVo.ID = strSubTaskID;
                    //objSubtaskVo.CCFLOW_ID1 = workID.ToString();
                    //objSubtaskVo.CCFLOW_ID2 = fid.ToString();
                    //if (!new TMisMonitorSubtaskLogic().Edit(objSubtaskVo))
                    //{
                    //    Response.Write("false流程ID更新失败,不能发送");
                    //    Response.ContentType = "text/plain";
                    //    Response.ContentEncoding = Encoding.UTF8;
                    //    Response.End();
                    //}
                }

                //分析类现场项目判断
                var strTaskID = "";
                var FID       = Convert.ToInt64(Request.QueryString["FID"]);

                TMisContractPlanVo objPlanVo = new TMisContractPlanVo();
                objPlanVo.CCFLOW_ID1 = FID.ToString();
                objPlanVo            = new TMisContractPlanLogic().Details(objPlanVo);
                if (objPlanVo.ID.Length > 0 && objPlanVo.REAMRK1 == "1")
                {
                    //当前流程属于送样的
                    strTaskID = new TMisMonitorTaskLogic().Details(new TMisMonitorTaskVo {
                        PLAN_ID = objPlanVo.ID
                    }).ID;
                    strSubTaskID = "";
                }
                else
                {
                    strTaskID    = "";
                    strSubTaskID = CCFlowFacade.GetFlowIdentification(UserNo, workID).Split('|')[0];
                }

                DataTable dtInfo = new TMisMonitorResultLogic().getItemInfoBySubTaskID_MAS(strTaskID, strSubTaskID, true);
                for (int i = 0; i < dtInfo.Rows.Count; i++)
                {
                    if (dtInfo.Rows[i]["IS_ANYSCENE_ITEM"].ToString() == "1")
                    {
                        if (dtInfo.Rows[i]["USER_NAME"].ToString() == "")
                        {
                            Response.Write("false分析负责人信息没有选择完整,请检查");

                            Response.ContentType = "text/plain";
                            Response.End();
                        }
                    }
                }

                Response.Write("true");
                Response.ContentEncoding = Encoding.UTF8;
                Response.ContentType     = "text/plain";
                Response.End();
            }

            if (Request.QueryString["type"] == "AfterSuccessSend")
            {
                Response.ContentEncoding = Encoding.GetEncoding("gb2312");

                var UserNo = Request.QueryString["UserNo"];//有两个UserNo???等解决
                UserNo = UserNo.Split(',').Count() > 1 ? UserNo.Split(',')[1] : UserNo;


                var workID = Convert.ToInt32(Request.QueryString["OID"]);//OID为流程ID

                var flowId = Request.QueryString["FK_Flow"];
                var nodeId = Convert.ToInt32(Request.QueryString["FK_Node"]);
                var fid    = Convert.ToInt32(Request.QueryString["FID"]);

                var strSubTaskID = CCFlowFacade.GetFlowIdentification(UserNo, workID).Split('|')[0];

                //获取现场项目
                DataTable dtSampleItem = new TMisMonitorResultLogic().SelectSampleItemWithSubtaskID(strSubTaskID);

                if (dtSampleItem.Rows.Count > 0)
                {
                    TMisMonitorSubtaskAppVo objSubtaskAppVo = new TMisMonitorSubtaskAppVo();
                    objSubtaskAppVo.SUBTASK_ID = strSubTaskID;
                    objSubtaskAppVo            = new TMisMonitorSubtaskAppLogic().Details(objSubtaskAppVo);



                    if (!string.IsNullOrEmpty(objSubtaskAppVo.SAMPLING_CHECK))
                    {
                        TSysUserVo objUserVo = new TSysUserLogic().Details(objSubtaskAppVo.SAMPLING_CHECK);

                        var childFlowID = System.Configuration.ConfigurationManager.AppSettings["XCSSH"].ToString();
                        var childNodeID = Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["XCSSHJNode"]);

                        var subTaskVo = new TMisMonitorSubtaskLogic().Details(strSubTaskID);

                        var taskVo = new TMisMonitorTaskLogic().Details(subTaskVo.TASK_ID);

                        var tempID = CCFlowFacade.Node_CreateBlankWork(UserNo, childFlowID, UserNo, null, workID, fid, flowId, nodeId, UserNo, childNodeID, objUserVo.USER_NAME, "@GroupMark=" + strSubTaskID);
                        CCFlowFacade.SetFlowTitle(UserNo, childFlowID, tempID, taskVo.PROJECT_NAME);
                    }
                }

                //创建分析类现场项目
                var strTaskID = "";
                var FID       = Convert.ToInt64(Request.QueryString["FID"]);

                UserNo = UserNo.Split(',').Count() > 1 ? UserNo.Split(',')[1] : UserNo;
                UserNo = UserNo.Trim(',');

                TMisContractPlanVo objPlanVo = new TMisContractPlanVo();
                objPlanVo.CCFLOW_ID1 = FID.ToString();
                objPlanVo            = new TMisContractPlanLogic().Details(objPlanVo);
                if (objPlanVo.ID.Length > 0 && objPlanVo.REAMRK1 == "1")
                {
                    //当前流程属于送样的
                    strTaskID = new TMisMonitorTaskLogic().Details(new TMisMonitorTaskVo {
                        PLAN_ID = objPlanVo.ID
                    }).ID;
                    strSubTaskID = "";
                }
                else
                {
                    strTaskID    = "";
                    strSubTaskID = CCFlowFacade.GetFlowIdentification(UserNo, workID).Split('|')[0];
                }

                var childFlowID3 = System.Configuration.ConfigurationManager.AppSettings["FXLXCXM"].ToString().Trim(',');
                var childNodeID3 = Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["FXLXCXMJNode"]);//配置为跳转到分析室审核流程的第三个节点by lhm

                DataTable dtInfo = new TMisMonitorResultLogic().getItemInfoBySubTaskID_MAS(strTaskID, strSubTaskID, true);
                for (int i = 0; i < dtInfo.Rows.Count; i++)
                {
                    if (dtInfo.Rows[i]["USER_NAME"].ToString() == "")
                    {
                        Response.Write("false分析负责人信息没有选择完整,请检查");

                        Response.ContentType = "text/plain";
                        Response.End();
                    }

                    var itemVo    = new TBaseItemInfoLogic().Details(dtInfo.Rows[i]["ITEM_ID"].ToString());
                    var sampleVo  = new TMisMonitorSampleInfoLogic().Details(dtInfo.Rows[i]["SAMPLE_ID"].ToString());
                    var subtaskVO = new TMisMonitorSubtaskLogic().Details(sampleVo.SUBTASK_ID);
                    var taskVo    = new TMisMonitorTaskLogic().Details(subtaskVO.TASK_ID);

                    long workid = 0;
                    var  title  = string.Format("{0} {1}", taskVo.PROJECT_NAME, itemVo.ITEM_NAME);

                    if (dtInfo.Rows[i]["IS_ANYSCENE_ITEM"].ToString() == "1")  //分析类现场项目
                    {
                        workid = CCFlowFacade.Node_CreateBlankWork(UserNo, childFlowID3, UserNo, null, workID, fid, flowId, nodeId, UserNo, childNodeID3, dtInfo.Rows[i]["USER_NAME"].ToString().Trim(','), "@GroupMark=" + dtInfo.Rows[i]["RESULTID"].ToString().Trim(','));

                        CCFlowFacade.SetFlowTitle(Request["UserNo"].ToString(), childFlowID3, workid, title);
                    }
                }

                Response.Write("发送成功");
                Response.ContentType = "text/plain";
                Response.End();
            }



            if (!string.IsNullOrEmpty(Request.QueryString["DirectionType"]))
            {
                var type      = Request.QueryString["DirectionType"];
                var direction = Request.QueryString["Direction"];
                var UserNo    = Request.QueryString["UserNo"];
                var workID    = Request.QueryString["WorkId"];



                var strSubTaskID = CCFlowFacade.GetFlowIdentification(UserNo, Convert.ToInt64(workID)).Split('|')[0];

                switch (type)
                {
                case "type1":

                    //分析类现场项目在该环节创建时,该逻辑需要更改为是否存在分析类项目 by lhm
                    //DataTable dtSampleDept = new TMisMonitorResultLogic().SelectSampleDeptWithSubtaskID(strSubTaskID);//存在分析类项目和分析类现场项目
                    DataTable dtSampleDept = new TMisMonitorResultLogic().SelectSampleDeptWithSubtaskID2(strSubTaskID);    //存在分析类项目

                    if (direction == "d1")
                    {
                        if (dtSampleDept.Rows.Count == 0)
                        {
                            Response.Write("1");
                        }
                        else
                        {
                            Response.Write("0");
                        }
                    }
                    else if (direction == "d2")
                    {
                        if (dtSampleDept.Rows.Count > 0)
                        {
                            Response.Write("1");
                        }
                        else
                        {
                            Response.Write("0");
                        }
                    }
                    Response.End();
                    break;

                default:
                    Response.Write("0");
                    Response.End();
                    break;
                }
            }



            if (Request.QueryString["WorkID"] != null)
            {
                var workID = Convert.ToInt64(Request.QueryString["WorkID"]);

                ccflowWorkId = workID.ToString();
                ccflowFid    = Request.QueryString["FID"];



                var identification = CCFlowFacade.GetFlowIdentification(LogInfo.UserInfo.USER_NAME, workID).Split('|')[0];

                this.SUBTASK_ID.Value = identification;
                strSubTaskID          = identification;
                strSourceID           = identification;

                TMisMonitorSubtaskVo objSubtaskVo = new TMisMonitorSubtaskLogic().Details(strSubTaskID);
                strMonitorID          = objSubtaskVo.MONITOR_ID;
                this.MONITOR_ID.Value = strMonitorID;

                TMisMonitorTaskVo objTask = new TMisMonitorTaskLogic().Details(objSubtaskVo.TASK_ID);
                this.PLAN_ID.Value = objTask.PLAN_ID;

                //yinchengyi 2015-4-24 打开页面时 记录ccflow流程ID信息到业务系统数据库
                //TMisMonitorSubtaskVo objSubtaskVo = new TMisMonitorSubtaskVo();
                //objSubtaskVo.ID = strSubTaskID;
                objSubtaskVo.CCFLOW_ID1 = workID.ToString();
                objSubtaskVo.CCFLOW_ID2 = ccflowFid.ToString();
                if (!new TMisMonitorSubtaskLogic().Edit(objSubtaskVo))
                {
                    //todo_yinchengyi:
                }
            }
            if (!string.IsNullOrEmpty(Request.QueryString["strSubtaskID"]))
            {
                //监测子任务ID
                this.SUBTASK_ID.Value = Request.QueryString["strSubtaskID"].ToString();
            }

            //点位动态属性信息拷贝
            AttributeValueCopy();
            //样品编号
            //SetSampleCode();

            //委托书信息
            if (!string.IsNullOrEmpty(Request.QueryString["type"]) && Request.QueryString["type"] == "getContractInfo")
            {
                strResult = GetContractInfo();
                Response.Write(strResult);
                Response.End();
            }
            //获取现场复核人信息
            if (Request["type"] != null && Request["type"].ToString() == "GetCheckUser")
            {
                strResult = GetCheckUser(Request.QueryString["MonitorID"].ToString());
                Response.Write(strResult);
                Response.End();
            }
        }
    }
    public static string btnBackSendClick(string strLink, string strSubtaskID, string strUserID, string strAttribute)
    {
        bool   isSuccess = true;
        string strMsg    = "";
        TMisMonitorSubtaskVo objSubtask = new TMisMonitorSubtaskLogic().Details(strSubtaskID);

        if (strLink == "Sample")   //采样环节发送事件
        {
            //判断是否存在样品没有设置项目的情况
            TMisMonitorSampleInfoVo SampleInfoVo = new TMisMonitorSampleInfoVo();
            SampleInfoVo.SUBTASK_ID = strSubtaskID;
            List <TMisMonitorSampleInfoVo> list = new List <TMisMonitorSampleInfoVo>();
            list = new TMisMonitorSampleInfoLogic().SelectByObject(SampleInfoVo, 0, 0);
            for (int i = 0; i < list.Count; i++)
            {
                TMisMonitorResultVo ResultVo = new TMisMonitorResultVo();
                ResultVo.SAMPLE_ID = list[i].ID;
                ResultVo           = new TMisMonitorResultLogic().SelectByObject(ResultVo);
                if (ResultVo.ID.Length == 0)
                {
                    isSuccess = false;
                    strMsg    = "样品[" + list[i].SAMPLE_NAME + "]还没设置监测项目";
                    break;
                }
            }
            if (isSuccess == false)
            {
                return("[{result:'0',msg:'" + strMsg + "'}]");
            }

            objSubtask.TASK_STATUS = "022";
            objSubtask.TASK_TYPE   = "发送";
            strMsg = "样品交接";
            //子任务所有项目都属于现场项目,跳过分析环节
            DataTable dtSampleDept = new TMisMonitorResultLogic().SelectSampleDeptWithSubtaskID(strSubtaskID);
            if (dtSampleDept.Rows.Count == 0)//全是现场项目
            {
                strMsg = "现场监测结果复核";

                //设置现场复核人
                TMisMonitorSubtaskAppVo objSubAppSet = new TMisMonitorSubtaskAppVo();
                objSubAppSet.SAMPLING_CHECK = strUserID;
                objSubAppSet.REMARK1        = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss"); //采样时间
                TMisMonitorSubtaskAppVo objSubAppWhere = new TMisMonitorSubtaskAppVo();
                objSubAppWhere.SUBTASK_ID = strSubtaskID;
                new TMisMonitorSubtaskAppLogic().Edit(objSubAppSet, objSubAppWhere);
            }

            DataTable dtSampleItem = new TMisMonitorResultLogic().SelectSampleItemWithSubtaskID(strSubtaskID);
            if (dtSampleItem.Rows.Count > 0 && dtSampleDept.Rows.Count > 0)//存在 非现场项目和现场项目
            {
                strMsg = "样品交接、现场监测结果复核";

                //设置现场复核人
                TMisMonitorSubtaskAppVo objSubAppSet = new TMisMonitorSubtaskAppVo();
                objSubAppSet.REMARK1        = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss"); //采样时间
                objSubAppSet.SAMPLING_CHECK = strUserID;
                TMisMonitorSubtaskAppVo objSubAppWhere = new TMisMonitorSubtaskAppVo();
                objSubAppWhere.SUBTASK_ID = strSubtaskID;
                new TMisMonitorSubtaskAppLogic().Edit(objSubAppSet, objSubAppWhere);
            }
            isSuccess = new TMisMonitorSubtaskLogic().Edit(objSubtask);

            //现场信息
            TMisMonitorSampleSkyVo objSampleSky = new TMisMonitorSampleSkyVo();

            for (int i = 0; i < strAttribute.Split('-').Length; i++)
            {
                if (strAttribute.Split('-')[i].Contains("|"))
                {
                    objSampleSky.SUBTASK_ID   = strSubtaskID;
                    objSampleSky.WEATHER_ITEM = strAttribute.Split('-')[i].Split('|')[0];
                    objSampleSky = new TMisMonitorSampleSkyLogic().Details(objSampleSky);
                    objSampleSky.WEATHER_INFO = strAttribute.Split('-')[i].Split('|')[1];
                    objSampleSky.SUBTASK_ID   = strSubtaskID;
                    objSampleSky.WEATHER_ITEM = strAttribute.Split('-')[i].Split('|')[0];
                    if (objSampleSky.ID.Length > 0)
                    {
                        isSuccess = new TMisMonitorSampleSkyLogic().Edit(objSampleSky);
                    }
                    else
                    {
                        objSampleSky.ID = GetSerialNumber("TMisMonitorSampleSky");
                        isSuccess       = new TMisMonitorSampleSkyLogic().Create(objSampleSky);
                    }
                }
            }
        }
        if (strLink == "Check") //现场结果复核发送事件
        {
            objSubtask.TASK_STATUS = "023";
            objSubtask.TASK_TYPE   = "发送";
            strMsg    = "现场监测结果审核";
            isSuccess = new TMisMonitorSubtaskLogic().Edit(objSubtask);
            //记录现场复核时间
            TMisMonitorSubtaskAppVo objSubAppSet = new TMisMonitorSubtaskAppVo();
            objSubAppSet.REMARK2           = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss");
            objSubAppSet.SAMPLING_QC_CHECK = strUserID;
            TMisMonitorSubtaskAppVo objSubAppWhere = new TMisMonitorSubtaskAppVo();
            objSubAppWhere.SUBTASK_ID = strSubtaskID;
            new TMisMonitorSubtaskAppLogic().Edit(objSubAppSet, objSubAppWhere);
        }
        if (strLink == "QcCheck") //现场结果审核发送事件
        {
            objSubtask.TASK_STATUS = "24";
            objSubtask.TASK_TYPE   = "发送";
            strMsg    = "发送成功";
            isSuccess = new TMisMonitorSubtaskLogic().Edit(objSubtask);
            //更新现场审核人
            TMisMonitorSubtaskAppVo SubtaskAppVo = new TMisMonitorSubtaskAppVo();
            SubtaskAppVo.SUBTASK_ID        = strSubtaskID;
            SubtaskAppVo                   = new TMisMonitorSubtaskAppLogic().SelectByObject(SubtaskAppVo);
            SubtaskAppVo.SAMPLING_QC_CHECK = new i3.View.PageBase().LogInfo.UserInfo.ID;
            SubtaskAppVo.REMARK3           = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss"); //现场审核时间
            new TMisMonitorSubtaskAppLogic().Edit(SubtaskAppVo);

            if (isSuccess == true)
            {
                bool IsFinish = false;
                IsFinish = new TMisMonitorSubtaskLogic().isFinishSubTask(objSubtask.TASK_ID, true);
                if (IsFinish == true)
                {
                    TMisMonitorTaskVo TMisMonitorTaskVo = new TMisMonitorTaskVo();
                    TMisMonitorTaskVo.ID            = objSubtask.TASK_ID;
                    TMisMonitorTaskVo.TASK_STATUS   = "09";
                    TMisMonitorTaskVo.REPORT_HANDLE = getNextReportUserID("Report_UserID");
                    new TMisMonitorTaskLogic().Edit(TMisMonitorTaskVo);
                    strMsg = "报告办理";
                }
            }
        }

        return(isSuccess == true ? "[{result:'1',msg:'" + strMsg + "'}]" : "[{result:'0',msg:'" + strMsg + "'}]");
    }
    public static string btnSendClick(string strLink, string strSubtaskID, string strUserID, string strAttribute)
    {
        bool   isSuccess = true;
        string strMsg    = "";
        TMisMonitorSubtaskVo objSubtask = new TMisMonitorSubtaskLogic().Details(strSubtaskID);

        if (strLink == "Sample")
        {
            #region 采样环节发送事件
            objSubtask.TASK_STATUS = "021";//其它进行样品交接环节
            strMsg = "样品交接";
            //判断是否存在样品没有设置项目的情况
            TMisMonitorSampleInfoVo SampleInfoVo = new TMisMonitorSampleInfoVo();
            SampleInfoVo.SUBTASK_ID = strSubtaskID;
            List <TMisMonitorSampleInfoVo> list = new List <TMisMonitorSampleInfoVo>();
            list = new TMisMonitorSampleInfoLogic().SelectByObject(SampleInfoVo, 0, 0);
            for (int i = 0; i < list.Count; i++)
            {
                TMisMonitorResultVo ResultVo = new TMisMonitorResultVo();
                ResultVo.SAMPLE_ID = list[i].ID;
                ResultVo           = new TMisMonitorResultLogic().SelectByObject(ResultVo);
                if (ResultVo.ID.Length == 0)
                {
                    isSuccess = false;
                    strMsg    = "样品[" + list[i].SAMPLE_NAME + "]还没设置监测项目";
                    break;
                }
            }
            if (isSuccess == false)
            {
                return("[{result:'0',msg:'" + strMsg + "'}]");
            }

            //子任务所有项目都属于现场项目,跳过分析环节
            DataTable dtSampleDept = new TMisMonitorResultLogic().SelectSampleDeptWithSubtaskID(strSubtaskID);
            if (dtSampleDept.Rows.Count == 0)//全是现场项目
            {
                objSubtask.TASK_STATUS = "022";
                objSubtask.REMARK1     = objSubtask.ID;
                strMsg = "现场监测结果复核";
                //设置现场复核人
                TMisMonitorSubtaskAppVo objSubAppSet = new TMisMonitorSubtaskAppVo();
                objSubAppSet.SAMPLING_CHECK = strUserID;
                objSubAppSet.REMARK1        = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss"); //采样时间
                TMisMonitorSubtaskAppVo objSubAppWhere = new TMisMonitorSubtaskAppVo();
                objSubAppWhere.SUBTASK_ID = strSubtaskID;
                new TMisMonitorSubtaskAppLogic().Edit(objSubAppSet, objSubAppWhere);
            }

            //update by ssz QY 现场项目信息需要另外发送任务
            DataTable dtSampleItem = new TMisMonitorResultLogic().SelectSampleItemWithSubtaskID(strSubtaskID);
            if (dtSampleItem.Rows.Count > 0 && dtSampleDept.Rows.Count > 0)//存在 非现场项目和现场项目
            {
                TMisMonitorSubtaskVo objSampleSubtask = new TMisMonitorSubtaskVo();
                CopyObject(objSubtask, objSampleSubtask);
                objSampleSubtask.ID          = GetSerialNumber("t_mis_monitor_subtaskId");
                objSampleSubtask.REMARK1     = objSubtask.ID;
                objSampleSubtask.TASK_STATUS = "022";
                //创建一个新的任务 对现场项目流程
                new TMisMonitorSubtaskLogic().Create(objSampleSubtask);

                //设置现场复核人
                TMisMonitorSubtaskAppVo objSubApp = new TMisMonitorSubtaskAppVo();
                objSubApp.ID             = GetSerialNumber("TMisMonitorSubtaskAppID");
                objSubApp.SUBTASK_ID     = objSampleSubtask.ID;
                objSubApp.SAMPLING_CHECK = strUserID;
                objSubApp.REMARK1        = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss"); //采样时间
                new TMisMonitorSubtaskAppLogic().Create(objSubApp);

                strMsg = "样品交接、现场监测结果复核";
            }
            isSuccess = new TMisMonitorSubtaskLogic().Edit(objSubtask);

            //现场信息
            TMisMonitorSampleSkyVo objSampleSky = new TMisMonitorSampleSkyVo();

            for (int i = 0; i < strAttribute.Split('-').Length; i++)
            {
                if (strAttribute.Split('-')[i].Contains("|"))
                {
                    objSampleSky.SUBTASK_ID   = strSubtaskID;
                    objSampleSky.WEATHER_ITEM = strAttribute.Split('-')[i].Split('|')[0];
                    objSampleSky = new TMisMonitorSampleSkyLogic().Details(objSampleSky);
                    objSampleSky.WEATHER_INFO = strAttribute.Split('-')[i].Split('|')[1];
                    objSampleSky.SUBTASK_ID   = strSubtaskID;
                    objSampleSky.WEATHER_ITEM = strAttribute.Split('-')[i].Split('|')[0];
                    if (objSampleSky.ID.Length > 0)
                    {
                        isSuccess = new TMisMonitorSampleSkyLogic().Edit(objSampleSky);
                    }
                    else
                    {
                        objSampleSky.ID = GetSerialNumber("TMisMonitorSampleSky");
                        isSuccess       = new TMisMonitorSampleSkyLogic().Create(objSampleSky);
                    }
                }
            }
            #endregion
        }
        if (strLink == "Check")
        {
            #region 现场监测结果复核环节发送事件
            objSubtask.TASK_STATUS = "023";
            objSubtask.TASK_TYPE   = "发送";
            strMsg    = "现场监测结果审核";
            isSuccess = new TMisMonitorSubtaskLogic().Edit(objSubtask);
            //记录现场复核时间
            TMisMonitorSubtaskAppVo objSubAppSet = new TMisMonitorSubtaskAppVo();
            objSubAppSet.REMARK2           = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss");
            objSubAppSet.SAMPLING_QC_CHECK = strUserID;
            TMisMonitorSubtaskAppVo objSubAppWhere = new TMisMonitorSubtaskAppVo();
            objSubAppWhere.SUBTASK_ID = strSubtaskID;
            new TMisMonitorSubtaskAppLogic().Edit(objSubAppSet, objSubAppWhere);
            #endregion
        }
        if (strLink == "QcCheck")
        {
            #region 现场监测结果审核环节发送事件
            objSubtask.TASK_STATUS = "24";
            objSubtask.TASK_TYPE   = "发送";
            strMsg    = "发送成功";
            isSuccess = new TMisMonitorSubtaskLogic().Edit(objSubtask);
            //更新现场审核人
            TMisMonitorSubtaskAppVo SubtaskAppVo = new TMisMonitorSubtaskAppVo();
            SubtaskAppVo.SUBTASK_ID        = strSubtaskID;
            SubtaskAppVo                   = new TMisMonitorSubtaskAppLogic().SelectByObject(SubtaskAppVo);
            SubtaskAppVo.SAMPLING_QC_CHECK = new i3.View.PageBase().LogInfo.UserInfo.ID;
            SubtaskAppVo.REMARK3           = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss"); //现场审核时间
            new TMisMonitorSubtaskAppLogic().Edit(SubtaskAppVo);

            if (isSuccess == true)
            {
                bool IsFinish = false;
                IsFinish = new TMisMonitorSubtaskLogic().isFinishSubTask(objSubtask.TASK_ID, true);
                if (IsFinish == true)
                {
                    TMisMonitorTaskVo TMisMonitorTaskVo = new TMisMonitorTaskLogic().Details(objSubtask.TASK_ID);
                    TMisMonitorTaskVo.TASK_STATUS = "09";

                    if (TMisMonitorTaskVo.TASK_TYPE == "1")
                    {
                        DataTable objTable = new TMisMonitorSubtaskLogic().SelectByTable(new TMisMonitorSubtaskVo()
                        {
                            TASK_ID = objSubtask.TASK_ID
                        });
                        //如果是环境质量将自动对数据进行填报
                        foreach (DataRow row in objTable.Rows)
                        {
                            string strSubTaskId  = row["ID"].ToString();
                            string strMonitorId  = row["MONITOR_ID"].ToString();
                            string strAskDate    = row["SAMPLE_ASK_DATE"].ToString();
                            string strSampleDate = row["SAMPLE_FINISH_DATE"].ToString();
                            TMisMonitorSubtaskVo TMisMonitorSubtaskVo = new TMisMonitorSubtaskVo();
                            TMisMonitorSubtaskVo.ID                 = strSubTaskId;
                            TMisMonitorSubtaskVo.MONITOR_ID         = strMonitorId;
                            TMisMonitorSubtaskVo.SAMPLE_ASK_DATE    = strAskDate;
                            TMisMonitorSubtaskVo.SAMPLE_FINISH_DATE = strSampleDate;
                            if (strMonitorId == "EnvRiver" || strMonitorId == "EnvReservoir" || strMonitorId == "EnvDrinking" || strMonitorId == "EnvDrinkingSource" || strMonitorId == "EnvStbc" || strMonitorId == "EnvMudRiver" || strMonitorId == "EnvPSoild" || strMonitorId == "EnvSoil" || strMonitorId == "EnvAir" || strMonitorId == "EnvSpeed" || strMonitorId == "EnvDust" || strMonitorId == "EnvRain")
                            {
                                new TMisMonitorSubtaskLogic().SetEnvFillData(TMisMonitorSubtaskVo, false, TMisMonitorTaskVo.SAMPLE_SEND_MAN);
                            }
                            if (strMonitorId == "AreaNoise" || strMonitorId == "EnvRoadNoise" || strMonitorId == "FunctionNoise")
                            {
                                new TMisMonitorSubtaskLogic().SetEnvFillData(TMisMonitorSubtaskVo, true, TMisMonitorTaskVo.SAMPLE_SEND_MAN);
                            }
                        }

                        strMsg = "数据填报";
                    }
                    else
                    {
                        if (TMisMonitorTaskVo.REPORT_HANDLE == "")
                        {
                            TMisMonitorTaskVo.REPORT_HANDLE = getNextReportUserID("Report_UserID");
                        }
                        strMsg = "报告办理";
                    }

                    new TMisMonitorTaskLogic().Edit(TMisMonitorTaskVo);
                }
            }
            #endregion
        }
        return(isSuccess == true ? "[{result:'1',msg:'" + strMsg + "'}]" : "[{result:'0',msg:'" + strMsg + "'}]");
    }
    public static bool btnSendClick(string strWorkTaskId)
    {
        bool flag = true;
        TMisMonitorTaskVo objTask = new TMisMonitorTaskVo();

        objTask.ID = strWorkTaskId;
        objTask    = new TMisMonitorTaskLogic().Details(strWorkTaskId);

        TMisMonitorSubtaskVo objSubTask = new TMisMonitorSubtaskVo();

        objSubTask.TASK_ID = objTask.ID;
        DataTable dt = new TMisMonitorSubtaskLogic().SelectByTable(objSubTask);

        for (int i = 0; i < dt.Rows.Count; i++)
        {
            TMisMonitorSubtaskAppVo objSubApp = new TMisMonitorSubtaskAppVo();


            DataTable dtApp = new TMisMonitorSubtaskAppLogic().SelectByTable(new TMisMonitorSubtaskAppVo {
                SUBTASK_ID = dt.Rows[i]["ID"].ToString()
            });
            if (dtApp.Rows.Count > 0)
            {
                objSubApp.ID             = dtApp.Rows[0]["ID"].ToString();
                objSubApp.SUBTASK_ID     = dt.Rows[i]["ID"].ToString();
                objSubApp.QC_APP_USER_ID = new PageBase().LogInfo.UserInfo.ID;
                objSubApp.QC_APP_DATE    = DateTime.Now.ToString();
                new TMisMonitorSubtaskAppLogic().Edit(objSubApp);
            }
            else
            {
                objSubApp.ID             = GetSerialNumber("TMisMonitorSubtaskAppID");
                objSubApp.SUBTASK_ID     = dt.Rows[i]["ID"].ToString();
                objSubApp.QC_APP_USER_ID = new PageBase().LogInfo.UserInfo.ID;
                objSubApp.QC_APP_DATE    = DateTime.Now.ToString();

                new TMisMonitorSubtaskAppLogic().Create(objSubApp);
            }

            objSubTask.ID          = dt.Rows[i]["ID"].ToString();
            objSubTask.TASK_STATUS = "02";
            if (!new TMisMonitorSubtaskLogic().Edit(objSubTask))
            {
                flag = false;
            }
        }

        if (flag)
        {
            TMisMonitorTaskVo objTaskEdit = new TMisMonitorTaskVo();
            objTaskEdit.ID        = objTask.ID;
            objTaskEdit.QC_STATUS = "9";//表示已经完成质控设置

            //如果是环境质量类 将 SEND_STATUS 设置为1
            if (objTask.TASK_TYPE == "1")
            {
                objTaskEdit.SEND_STATUS = "1";
            }
            new TMisMonitorTaskLogic().Edit(objTaskEdit);

            TMisContractPlanVo objPlan = new TMisContractPlanLogic().Details(objTask.PLAN_ID);
            objPlan.HAS_DONE = "1";
            new TMisContractPlanLogic().Edit(objPlan);
        }

        return(flag);
    }
    public static bool btnSendClick(string strWorkTaskId)
    {
        string            strConfigApp = ConfigurationManager.AppSettings["EnvQCsetting"].ToString();
        bool              flag         = true;
        TMisMonitorTaskVo objTask      = new TMisMonitorTaskVo();

        objTask.ID = strWorkTaskId;

        objTask = new TMisMonitorTaskLogic().Details(strWorkTaskId);
        TMisMonitorSubtaskVo objSubTask = new TMisMonitorSubtaskVo();

        objSubTask.TASK_ID = objTask.ID;
        DataTable dt = new TMisMonitorSubtaskLogic().SelectByTable(objSubTask);

        for (int i = 0; i < dt.Rows.Count; i++)
        {
            TMisMonitorSubtaskAppVo objSubApp = new TMisMonitorSubtaskAppVo();


            DataTable dtApp = new TMisMonitorSubtaskAppLogic().SelectByTable(new TMisMonitorSubtaskAppVo {
                SUBTASK_ID = dt.Rows[i]["ID"].ToString()
            });
            if (dtApp.Rows.Count > 0)
            {
                objSubApp.ID                 = dtApp.Rows[0]["ID"].ToString();
                objSubApp.SUBTASK_ID         = dt.Rows[i]["ID"].ToString();
                objSubApp.SAMPLE_ASSIGN_ID   = new PageBase().LogInfo.UserInfo.ID;
                objSubApp.SAMPLE_ASSIGN_DATE = DateTime.Now.ToString();
                new TMisMonitorSubtaskAppLogic().Edit(objSubApp);
            }
            else
            {
                objSubApp.ID                 = GetSerialNumber("TMisMonitorSubtaskAppID");
                objSubApp.SUBTASK_ID         = dt.Rows[i]["ID"].ToString();
                objSubApp.SAMPLE_ASSIGN_ID   = new PageBase().LogInfo.UserInfo.ID;
                objSubApp.SAMPLE_ASSIGN_DATE = DateTime.Now.ToString();

                new TMisMonitorSubtaskAppLogic().Create(objSubApp);
            }

            objSubTask.ID = dt.Rows[i]["ID"].ToString();
            ////如果是非环境质量类 将 TASK_STATUS 设置为02
            //if (objTask.TASK_TYPE != "1" || strConfigApp != "1")
            //{
            objSubTask.TASK_STATUS = "02";
            //}
            if (!new TMisMonitorSubtaskLogic().Edit(objSubTask))
            {
                flag = false;
            }
        }

        if (flag)
        {
            TMisMonitorTaskVo objTaskEdit = new TMisMonitorTaskVo();
            objTaskEdit.ID        = objTask.ID;
            objTaskEdit.QC_STATUS = "9";//表示已经完成质控设置
            //如果是环境质量类 将 SEND_STATUS 设置为1
            if (objTask.TASK_TYPE == "1")
            {
                objTaskEdit.SEND_STATUS = "1";
                //if (strConfigApp == "1")
                //    objTaskEdit.QC_STATUS = "1";  //环境质量类时,采样任务分配后到采样前质控环节
            }
            new TMisMonitorTaskLogic().Edit(objTaskEdit);

            TMisContractPlanVo objPlan = new TMisContractPlanLogic().Details(objTask.PLAN_ID);
            //if (objTask.TASK_TYPE != "1")
            objPlan.HAS_DONE = "1";
            new TMisContractPlanLogic().Edit(objPlan);
        }

        return(flag);
    }