protected string SaveData()
 {
     if (!string.IsNullOrEmpty(this.ID.Value))
     {
         //监测结论
         string strConclusion = !string.IsNullOrEmpty(Request.QueryString["conclusion"]) ? Request.QueryString["conclusion"].ToString() : "";
         //报告单号
         string strReportCode = !string.IsNullOrEmpty(Request.QueryString["report_code"]) ? Request.QueryString["report_code"].ToString() : "";
         //保存报告单号
         TMisMonitorReportVo objReport = new TMisMonitorReportLogic().Details(new TMisMonitorReportVo()
         {
             TASK_ID = this.ID.Value
         });
         objReport.REPORT_CODE      = strReportCode;
         objReport.REPORT_SCHEDULER = LogInfo.UserInfo.ID;
         new TMisMonitorReportLogic().Edit(objReport);
         //保存监测结论 寄存到监测任务备注1
         //监测任务对象
         TMisMonitorTaskVo objTask = new TMisMonitorTaskVo();
         objTask.ID      = this.ID.Value;
         objTask.REMARK5 = strConclusion;
         if (new TMisMonitorTaskLogic().Edit(objTask))
         {
             WriteLog("修改监测任务", "", LogInfo.UserInfo.USER_NAME + "修改监测任务" + objTask.ID + "成功");
             return("1");
         }
     }
     return("");
 }
Example #2
0
    /// <summary>
    /// 创建任务基本信息
    /// </summary>
    /// <param name="objTaskVo">任务实体对象</param>
    protected void CreateStyleForBaseInfo(TMisMonitorTaskVo objTaskVo)
    {
        Table tb = new Table();

        TableRow  row1    = new TableRow();  //第一行
        TableCell cell1_1 = new TableCell(); //第一行的第一格
        TableCell cell1_2 = new TableCell(); //第一行的第二格

        cell1_1.Text       = "项目名称:" + objTaskVo.PROJECT_NAME;
        cell1_1.CssClass   = "td1";
        cell1_1.ColumnSpan = 2;
        //cell1_2.Text = "委托类型:" + new TSysDictLogic().GetDictNameByDictCodeAndType(objTaskVo.CONTRACT_TYPE, "Contract_Type");
        //cell1_2.CssClass = "td1";
        row1.Cells.AddAt(0, cell1_1);
        //row1.Cells.AddAt(1, cell1_2);

        TableRow  row2    = new TableRow();  //第二行
        TableCell cell2_1 = new TableCell(); //第二行的第一格
        TableCell cell2_2 = new TableCell(); //第二行的第二格

        cell2_1.Text     = "任务单号:" + objTaskVo.TICKET_NUM;
        cell2_1.CssClass = "td1";
        cell2_2.Text     = "委托单号:" + objTaskVo.CONTRACT_CODE;
        cell2_2.CssClass = "td1";
        row2.Cells.AddAt(0, cell2_1);
        row2.Cells.AddAt(1, cell2_2);

        tb.Rows.AddAt(0, row1);
        tb.Rows.AddAt(1, row2);

        this.divTaskInfo.Controls.Add(tb);
    }
Example #3
0
    /// <summary>
    /// 获取监测任务列表信息
    /// </summary>
    /// <returns></returns>
    protected void selectTask()
    {
        string strSortname  = Request.Params["sortname"];
        string strSortorder = Request.Params["sortorder"];
        int    intPageIdx   = Convert.ToInt32(Request.Params["page"]);
        int    intPagesize  = Convert.ToInt32(Request.Params["pagesize"]);

        //任务单号
        string strTICKET_NUM = !string.IsNullOrEmpty(Request.QueryString["SrhTICKET_NUM"]) ? Request.QueryString["SrhTICKET_NUM"].ToString() : "";

        //构造查询对象
        TMisMonitorTaskVo    objTask      = new TMisMonitorTaskVo();
        TMisMonitorTaskLogic objTaskLogic = new TMisMonitorTaskLogic();

        if (strSortname == null || strSortname.Length == 0)
        {
            strSortname = TMisMonitorTaskVo.ID_FIELD;
        }

        objTask.SORT_FIELD = "ID";
        objTask.SORT_TYPE  = "desc";
        objTask.TICKET_NUM = strTICKET_NUM;

        string    strJson       = "";
        int       intTotalCount = objTaskLogic.GetSelectResultCount_ForSummary(objTask, true);//总计的数据条数
        DataTable dt            = objTaskLogic.SelectByTable_ForSummary(objTask, true, intPageIdx, intPagesize);

        strJson = CreateToJson(dt, intTotalCount);

        Response.Write(strJson);
        Response.End();
    }
    /// <summary>
    /// 获得委托书信息
    /// </summary>
    /// <returns>Json</returns>
    protected string GetContractInfo()
    {
        if (this.PLAN_ID.Value.Length == 0)
        {
            return("");
        }
        TMisContractPlanVo objPlan = new TMisContractPlanLogic().Details(this.PLAN_ID.Value);
        TMisMonitorTaskVo  objTask = new TMisMonitorTaskVo();

        objTask.PLAN_ID = this.PLAN_ID.Value;
        objTask         = new TMisMonitorTaskLogic().Details(objTask);
        //如果是验收监测
        if (objTask.CONTRACT_TYPE == "05")
        {
            //获取方案编制人信息
            string strProjectId = objTask.PROJECT_ID;
            //将方案编制人信息写入监测子任务表中
            TMisMonitorSubtaskVo TMisMonitorSubtaskVo = new TMisMonitorSubtaskVo();
            TMisMonitorSubtaskVo.TASK_ID = objTask.ID;
            DataTable objTable = new TMisMonitorSubtaskLogic().SelectByTable(TMisMonitorSubtaskVo);
            foreach (DataRow row in objTable.Rows)
            {
                string strSubTaskId = row["ID"].ToString();
                TMisMonitorSubtaskVo TMisMonitorSubtaskVoTemp = new TMisMonitorSubtaskVo();
                TMisMonitorSubtaskVoTemp.ID = strSubTaskId;
                TMisMonitorSubtaskVoTemp.SAMPLING_MANAGER_ID = strProjectId;
                new TMisMonitorSubtaskLogic().Edit(TMisMonitorSubtaskVoTemp);
            }
        }
        objTask.TESTED_COMPANY_ID = new TMisMonitorTaskCompanyLogic().Details(objTask.TESTED_COMPANY_ID).COMPANY_NAME;
        objTask.CONTRACT_TYPE     = new TSysDictLogic().GetDictNameByDictCodeAndType(objTask.CONTRACT_TYPE, "Contract_Type");


        return(ToJson(objTask));
    }
Example #5
0
    /// <summary>
    /// 获取监测任务列表信息
    /// </summary>
    /// <returns></returns>
    protected string getTaskInfoForJson()
    {
        string strSortname  = Request.Params["sortname"];
        string strSortorder = Request.Params["sortorder"];
        int    intPageIdx   = Convert.ToInt32(Request.Params["page"]);
        int    intPagesize  = Convert.ToInt32(Request.Params["pagesize"]);

        //构造查询对象
        TMisMonitorTaskVo    objTask      = new TMisMonitorTaskVo();
        TMisMonitorTaskLogic objTaskLogic = new TMisMonitorTaskLogic();

        if (strSortname == null || strSortname.Length == 0)
        {
            strSortname = TMisMonitorTaskVo.ID_FIELD;
        }

        objTask.SORT_FIELD  = strSortname;
        objTask.SORT_TYPE   = strSortorder;
        objTask.CONTRACT_ID = !string.IsNullOrEmpty(Request.QueryString["contract_id"]) ? Request.QueryString["contract_id"].ToString() : "";

        int       intTotalCount = objTaskLogic.GetSelectResultCount(objTask);//总计的数据条数
        DataTable dt            = objTaskLogic.SelectByTable(objTask, intPageIdx, intPagesize);

        return(CreateToJson(dt, intTotalCount));
    }
    /// <summary>
    /// 获得委托书信息
    /// </summary>
    /// <returns>Json</returns>
    protected string GetContractInfo()
    {
        //if (!String.IsNullOrEmpty(strTask_Id))
        //{
        //    TMisContractVo objContracDetial = new TMisContractLogic().Details(strTask_Id);
        //    return ToJson(objContracDetial);
        //}
        //else {
        //    return "";
        //}

        if (!String.IsNullOrEmpty(strPlanId))
        {
            //TMisContractVo objContracDetial = new TMisContractLogic().Details(strTask_Id);
            TMisMonitorTaskVo objTask = new TMisMonitorTaskVo();
            objTask.PLAN_ID = strPlanId;
            objTask         = new TMisMonitorTaskLogic().Details(objTask);
            //TMisMonitorTaskVo objContracDetial = new TMisMonitorTaskLogic().Details(strTask_Id);
            return(ToJson(objTask));
        }
        else
        {
            return("");
        }
    }
    public static string GoToBack(string strTaskId)
    {
        TMisMonitorTaskVo TMisMonitorTaskVo = new TMisMonitorTaskVo();
        TMisMonitorTaskVo.ID = strTaskId;
        TMisMonitorTaskVo.QC_STATUS = "NULL";
        bool IsTaskEditSuccess = new TMisMonitorTaskLogic().Edit(TMisMonitorTaskVo);

        TMisMonitorSubtaskVo TMisMonitorSubtaskVo = new TMisMonitorSubtaskVo();
        TMisMonitorSubtaskVo.TASK_ID = strTaskId;
        TMisMonitorSubtaskVo.TASK_STATUS = "04";

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

        bool IsSubTaskEditSuccess = true;

        foreach (DataRow row in dt.Rows)
        {
            string strSubTaskId = row["ID"].ToString();
            TMisMonitorSubtaskVo TMisMonitorSubtaskVoTemp = new TMisMonitorSubtaskVo();
            TMisMonitorSubtaskVoTemp.ID = strSubTaskId;
            TMisMonitorSubtaskVoTemp.TASK_STATUS = "01";
            IsSubTaskEditSuccess = new TMisMonitorSubtaskLogic().Edit(TMisMonitorSubtaskVoTemp);
        }
        return IsTaskEditSuccess && IsSubTaskEditSuccess == true ? "1" : "0";
    }
    /// <summary>
    /// 获取样品信息
    /// </summary>
    /// <returns></returns>
    private string getSampleGridInfo(string strTaskID, string strSubTaskID)
    {
        //huangjinjun add 2016.1.26 如果REMARK3等于true,将ph值、电导率、溶解氧设为分析项目
        TMisMonitorTaskVo    tm    = new TMisMonitorTaskVo();
        TMisMonitorSubtaskVo tmsub = new TMisMonitorSubtaskVo();

        tmsub = new TMisMonitorSubtaskLogic().Details(strSubTaskID);
        tm.ID = tmsub.TASK_ID;
        DataTable dtRemark = new TMisMonitorTaskLogic().SelectByTable(tm);

        if (dtRemark.Rows[0]["REMARK3"].ToString() == "true")
        {
            bool bl = new TBaseItemInfoLogic().EditItemTypeFX();
        }
        else
        {
            bool bl = new TBaseItemInfoLogic().EditItemTypeXC();
        }

        var strCCflowWorkId = Request.QueryString["strCCflowWorkId"];
        var identification  = CCFlowFacade.GetFlowIdentification(LogInfo.UserInfo.USER_NAME, Convert.ToInt64(strCCflowWorkId));

        var sampleIdList = identification.Split(new string[] { "|" }, StringSplitOptions.RemoveEmptyEntries).ToList();

        if (sampleIdList.Count > 0)
        {
            sampleIdList.RemoveAt(0);
        }

        if (sampleIdList.Count == 0)
        {
            DataTable dt      = new TMisMonitorResultLogic().getSampleCodeInAlloction_MAS(strTaskID, strSubTaskID);
            string    strJson = CreateToJson(dt, 0);
            return(strJson);
        }
        else
        {
            DataTable dt = new TMisMonitorResultLogic().getSampleCodeInAlloction_MAS(strTaskID, strSubTaskID);

            var newDT = new DataTable();

            foreach (DataColumn column in dt.Columns)
            {
                newDT.Columns.Add(column.ColumnName);
            }

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                if (!sampleIdList.Contains(dt.Rows[i]["ID"].ToString()))
                {
                    continue;
                }

                newDT.Rows.Add(dt.Rows[i].ItemArray);
            }

            string strJson = CreateToJson(newDT, 0);
            return(strJson);
        }
    }
Example #9
0
    /// <summary>
    /// 饼图绑定
    /// </summary>
    public void FillChart()
    {
        TMisMonitorTaskVo objItems = new TMisMonitorTaskVo();

        objItems.REMARK3       = strYear;
        objItems.REMARK4       = strMonth;
        objItems.REMARK5       = strQuarter;
        objItems.CONTRACT_CODE = strContractCode;
        TMisMonitorTaskCompanyVo objComItems = new TMisMonitorTaskCompanyVo();

        objComItems.AREA         = strArea;
        objComItems.COMPANY_NAME = strTestCompany;

        dt = new TMisMonitorTaskLogic().GetTaskChartCountWithStatus(objItems, objComItems, strDept);
        if (dt.Rows.Count == 0)
        {
            DataRow dr = dt.NewRow();
            dr["FINISHSUM"]  = "0";
            dr["FINISHTYPE"] = "无数据集";

            dt.Rows.Add(dr);
            dt.AcceptChanges();
        }
        ReportDataSource rds = new ReportDataSource("DataSet2", dt);

        this.reportViewer1.LocalReport.DataSources.Add(rds);
        this.reportViewer1.LocalReport.Refresh();

        this.reportViewer2.LocalReport.DataSources.Add(rds);
        this.reportViewer2.LocalReport.Refresh();
    }
Example #10
0
    /// <summary>
    /// 获取监测任务列表信息
    /// </summary>
    /// <returns></returns>
    protected void selectTask()
    {
        string strSortname  = Request.Params["sortname"];
        string strSortorder = Request.Params["sortorder"];
        int    intPageIdx   = Convert.ToInt32(Request.Params["page"]);
        int    intPagesize  = Convert.ToInt32(Request.Params["pagesize"]);

        //构造查询对象
        TMisMonitorTaskVo    objTask      = new TMisMonitorTaskVo();
        TMisMonitorTaskLogic objTaskLogic = new TMisMonitorTaskLogic();

        if (strSortname == null || strSortname.Length == 0)
        {
            strSortname = TMisMonitorTaskVo.ID_FIELD;
        }

        //任务类型
        string strContractType = !string.IsNullOrEmpty(Request.QueryString["SrhContractType"]) ? Request.QueryString["SrhContractType"].ToString() : "";

        objTask.CONTRACT_TYPE = strContractType;
        objTask.SORT_FIELD    = strSortname;
        objTask.SORT_TYPE     = strSortorder;
        objTask.CONTRACT_ID   = !string.IsNullOrEmpty(Request.QueryString["contract_id"]) ? Request.QueryString["contract_id"].ToString() : "";

        string strJson = "";
        //int intTotalCount = objTaskLogic.GetSelectResultCount(objTask);//总计的数据条数
        DataTable dt = objTaskLogic.SelectByTable(objTask, 0, 0);

        strJson = CreateToJson(dt, dt.Rows.Count);

        Response.Write(strJson);
        Response.End();
    }
    protected string getData()
    {
        string result        = "";
        int    intTotalCount = 0;
        //页数
        int pageIndex = Int32.Parse(Request.Params["page"].ToString());
        //分页数
        int       pageSize = Int32.Parse(Request.Params["pagesize"].ToString());
        DataTable dtEval   = new DataTable();
        //监测任务对象
        TMisMonitorTaskVo objTask = new TMisMonitorTaskVo();

        //创建标准JSON数据
        objTask.SORT_FIELD = Request.Params["sortname"];
        objTask.SORT_TYPE  = Request.Params["sortorder"];
        //过滤条件
        //委托类型
        objTask.CONTRACT_TYPE = !String.IsNullOrEmpty(Request.Params["srhContractType"]) ? Request.Params["srhContractType"].ToString() : "";
        //委托书编号
        objTask.CONTRACT_CODE = !String.IsNullOrEmpty(Request.Params["srhContractCode"]) ? Request.Params["srhContractCode"].ToString() : "";
        //项目名称
        objTask.PROJECT_NAME = !String.IsNullOrEmpty(Request.Params["srhProjectName"]) ? Request.Params["srhProjectName"].ToString() : "";
        //任务单号
        objTask.TICKET_NUM = !String.IsNullOrEmpty(Request.Params["srhTaskCode"]) ? Request.Params["srhTaskCode"].ToString() : "";
        dtEval             = new TMisMonitorTaskLogic().SelectByTable(objTask, pageIndex, pageSize);

        intTotalCount = new TMisMonitorTaskLogic().GetSelectResultCount(objTask);
        //处理现场项目任务 现场项目任务未审核完成时将报告任务移除
        result = LigerGridDataToJson(dtEval, intTotalCount);
        return(result);
    }
Example #12
0
    /// <summary>
    /// 获取任务信息Json
    /// </summary>
    /// <returns></returns>
    protected string getTaskInfo()
    {
        //任务ID
        string              strTaskID = Request.Params.AllKeys.Contains("task_id") ? Request.QueryString["task_id"].ToString() : this.TASK_ID.Value;
        TMisMonitorTaskVo   objTaskVo = new TMisMonitorTaskVo();
        TMisMonitorReportVo objReport = new TMisMonitorReportVo();

        if (!string.IsNullOrEmpty(strTaskID))
        {
            objTaskVo = new TMisMonitorTaskLogic().GetContractTaskInfo(strTaskID);
            objReport = new TMisMonitorReportLogic().Details(new TMisMonitorReportVo()
            {
                TASK_ID = strTaskID
            });
        }
        if (objTaskVo != null)
        {
            try
            {
                objTaskVo.CONSIGN_DATE = DateTime.Parse(objTaskVo.CONSIGN_DATE.ToString()).ToString("yyyy-MM-dd");
            }
            catch { }
        }
        //定制数据
        objTaskVo.REMARK1 = objReport.REPORT_CODE;//报告编号
        return(ToJson(objTaskVo));
    }
    /// <summary>
    /// 饼图绑定
    /// </summary>
    public void FillChart()
    {
        dt = new DataTable();
        TMisContractVo objItems = new TMisContractVo();

        objItems.CONTRACT_CODE     = strContractCode;
        objItems.CONTRACT_TYPE     = strContractType;
        objItems.TESTED_COMPANY_ID = strTestCompany;
        objItems.REMARK5           = strDept;
        TMisMonitorTaskVo objMvo = new TMisMonitorTaskVo();

        objMvo.REMARK3 = strYear;
        objMvo.REMARK4 = strMonth;
        objMvo.REMARK5 = strQuarter;
        dt             = new TMisMonitorTaskLogic().SeletByTableReportFinishedCount(objMvo, objItems);
        if (dt.Rows.Count == 0)
        {
            DataRow dr = dt.NewRow();
            dr["FINISHSUM"]  = "0";
            dr["FINISHTYPE"] = "无数据集";

            dt.Rows.Add(dr);
            dt.AcceptChanges();
        }
        ReportDataSource rds = new ReportDataSource("DataSet2", dt);

        this.reportViewer1.LocalReport.DataSources.Add(rds);
        this.reportViewer1.LocalReport.Refresh();

        this.reportViewer2.LocalReport.DataSources.Add(rds);
        this.reportViewer2.LocalReport.Refresh();
    }
    /// <summary>
    /// 获得委托书基本信息
    /// </summary>
    /// <returns>Json</returns>
    protected string GetContractInfo()
    {
        TMisMonitorTaskVo   objTask   = new TMisMonitorTaskVo();
        TMisMonitorReportVo objReport = new TMisMonitorReportVo();

        if (!string.IsNullOrEmpty(this.ID.Value))
        {
            objTask   = new TMisMonitorTaskLogic().GetContractTaskInfo(this.ID.Value);
            objReport = new TMisMonitorReportLogic().Details(new TMisMonitorReportVo()
            {
                TASK_ID = this.ID.Value
            });
        }
        if (objTask != null)
        {
            try
            {
                objTask.CONSIGN_DATE = DateTime.Parse(objTask.CONSIGN_DATE.ToString()).ToString("yyyy-MM-dd");
            }
            catch { }
        }
        //定制数据
        objTask.REMARK1 = objReport.REPORT_CODE;         //报告编号
        //objTask.REMARK2 = objTask.REMARK5.Length > 0 ? objTask.REMARK5 : AutoSaveConclusion(this.ID.Value);//总监测任务的监测结论
        objTask.REMARK2 = objTask.REMARK5;               //总监测任务的监测结论
        objTask.REMARK3 = GetMonitorType(this.ID.Value); //报告类别 废水,废气...
        objTask.REMARK4 = GetRemark(this.ID.Value);      //委托书备注信息 四个同意
        return(ToJson(objTask));
    }
    private void GetInfoForPrint(ref string strMonitorNames, ref string strPointNames, ref string strFREQ, ref string strItemS)
    {
        if (this.hidPlanId.Value.Length == 0)
        {
            return;
        }

        TMisMonitorTaskVo objTask = new TMisMonitorTaskVo();

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

        TMisMonitorSubtaskVo objSubtask = new TMisMonitorSubtaskVo();

        objSubtask.TASK_ID = objTask.ID;

        DataTable dt = new TMisMonitorSubtaskLogic().SelectByTable(objSubtask, 0, 0);

        for (int i = 0; i < dt.Rows.Count; i++)
        {
            TBaseMonitorTypeInfoVo objMonitorTypeInfoVo = new TBaseMonitorTypeInfoLogic().Details(dt.Rows[i]["MONITOR_ID"].ToString());
            strMonitorNames += objMonitorTypeInfoVo.MONITOR_TYPE_NAME + "\n";
            GetPoint_UnderTask(objTask.CONTACT_ID, dt.Rows[i]["ID"].ToString(), ref strPointNames, ref strFREQ, ref strItemS);
        }
    }
    /// <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");
    }
Example #17
0
    public static string getContractType(string strTaskId)
    {
        TMisMonitorTaskVo objTask = new TMisMonitorTaskVo();

        objTask.ID = strTaskId;
        objTask    = new TMisMonitorTaskLogic().Details(objTask);
        return(objTask.CONTRACT_TYPE);
    }
        public string GetPlanIDByContractID(string strContractID)
        {
            TMisMonitorTaskVo obj = new TMisMonitorTaskVo();

            obj.CONTACT_ID = strContractID;
            obj            = access.Details(obj);

            return(obj.PLAN_ID);
        }
Example #19
0
    /// <summary>
    /// 获取监测任务列表信息
    /// </summary>
    /// <returns></returns>
    protected void selectTask()
    {
        string strSortname  = Request.Params["sortname"];
        string strSortorder = Request.Params["sortorder"];
        int    intPageIdx   = Convert.ToInt32(Request.Params["page"]);
        int    intPagesize  = Convert.ToInt32(Request.Params["pagesize"]);

        //任务单号
        string strTICKET_NUM = !string.IsNullOrEmpty(Request.QueryString["SrhTICKET_NUM"]) ? Request.QueryString["SrhTICKET_NUM"].ToString() : "";
        //项目名称
        string strProjectName = !string.IsNullOrEmpty(Request.QueryString["SrhProjectName"]) ? Request.QueryString["SrhProjectName"].ToString() : "";

        //构造查询对象
        TMisMonitorTaskVo    objTask      = new TMisMonitorTaskVo();
        TMisMonitorTaskLogic objTaskLogic = new TMisMonitorTaskLogic();

        if (strSortname == null || strSortname.Length == 0)
        {
            strSortname = TMisMonitorTaskVo.ID_FIELD;
        }

        //objTask.SORT_FIELD = strSortname;
        //objTask.SORT_TYPE = strSortorder;
        objTask.CONTRACT_TYPE = "07";
        objTask.SORT_FIELD    = "CREATE_DATE";
        objTask.SORT_TYPE     = "desc";
        //objTask.CONTRACT_YEAR = strYear;
        //objTask.CONTRACT_TYPE = strContractType;
        objTask.TICKET_NUM   = strTICKET_NUM;
        objTask.PROJECT_NAME = strProjectName;
        //objTask.CONTRACT_TYPE = contract_type;

        //string strJson = "";
        //int intTotalCount = objTaskLogic.GetSelectResultCount(objTask);//总计的数据条数
        //DataTable dt = objTaskLogic.SelectByTable(objTask, intPageIdx, intPagesize);

        //strJson = CreateToJson(dt, intTotalCount);


        DataTable dt            = objTaskLogic.SelectByTable(objTask, 0, 0);
        int       intTotalCount = dt.Rows.Count;
        //int intTotalCount = objContractLogic.GetSelectResultCountEx(objContract, strStatus);//总计的数据条数
        //DataTable dt = objContractLogic.SelectByTableEx(objContract, strStatus, intPageIdx, intPagesize);
        //string strJson = CreateToJson(dt, intTotalCount);

        //by lhm
        //int intTotalCount;
        //DataTable dt = objContractLogic.SelectByTable(objContract);

        var ccflowDt = CCFlowFacade.GetCCFLowStatus(this.LogInfo.UserInfo.USER_NAME, dt, null, intPageIdx, intPagesize, out intTotalCount);

        string strJson = CreateToJson(ccflowDt, intTotalCount);


        Response.Write(strJson);
        Response.End();
    }
Example #20
0
    protected void SetReport(string strContractID)
    {
        //获取委托书信息
        TMisContractVo objContract = new TMisContractLogic().Details(strContractID);

        #region 构造监测任务对象
        TMisMonitorTaskVo objTask = new TMisMonitorTaskVo();
        CopyObject(objContract, objTask);
        objTask.ID             = GetSerialNumber("t_mis_monitor_taskId");
        objTask.CONTRACT_ID    = objContract.ID;
        objTask.PLAN_ID        = "";
        objTask.CONSIGN_DATE   = objContract.ASKING_DATE;
        objTask.CREATOR_ID     = LogInfo.UserInfo.ID;
        objTask.CREATE_DATE    = DateTime.Now.ToString();
        objTask.TASK_STATUS    = "09";
        objTask.COMFIRM_STATUS = "0";
        #endregion

        #region 构造监测任务委托企业信息
        //委托企业信息
        TMisContractCompanyVo objContractClient = new TMisContractCompanyLogic().Details(objContract.CLIENT_COMPANY_ID);
        //受检企业信息
        TMisContractCompanyVo objContractTested = new TMisContractCompanyLogic().Details(objContract.TESTED_COMPANY_ID);
        //构造监测任务委托企业信息
        TMisMonitorTaskCompanyVo objTaskClient = new TMisMonitorTaskCompanyVo();
        CopyObject(objContractClient, objTaskClient);//复制对象
        objTaskClient.ID         = GetSerialNumber("t_mis_monitor_taskcompanyId");
        objTaskClient.TASK_ID    = objTask.ID;
        objTaskClient.COMPANY_ID = objContract.CLIENT_COMPANY_ID;
        //构造监测任务受检企业信息
        TMisMonitorTaskCompanyVo objTaskTested = new TMisMonitorTaskCompanyVo();
        CopyObject(objContractTested, objTaskTested);//复制对象
        objTaskTested.ID         = GetSerialNumber("t_mis_monitor_taskcompanyId");
        objTaskTested.TASK_ID    = objTask.ID;
        objTaskTested.COMPANY_ID = objContract.TESTED_COMPANY_ID;

        //重新赋值监测任务企业ID
        objTask.CLIENT_COMPANY_ID = objTaskClient.ID;
        objTask.TESTED_COMPANY_ID = objTaskTested.ID;
        #endregion


        #region 构造监测报告
        TMisMonitorReportVo objReportVo = new TMisMonitorReportVo();
        objReportVo.ID                   = GetSerialNumber("t_mis_monitor_report_id");
        objReportVo.TASK_ID              = objTask.ID;
        objReportVo.REPORT_CODE          = objTask.CONTRACT_CODE;
        objReportVo.REPORT_EX_ATTACHE_ID = GetAttID(objTask.CONTRACT_ID, "AcceptanceContract");
        objReportVo.IF_GET               = "0";

        if (new TMisMonitorTaskLogic().SaveTrans(objTask, objTaskClient, objTaskTested, objReportVo))
        {
            WriteLog("生成验收委托监测任务", "", LogInfo.UserInfo.USER_NAME + "生成验收委托监测任务" + objTask.ID + "成功");
        }
        #endregion
    }
    protected void btnImport_Click(object sender, EventArgs e)
    {
        FileStream   file         = new FileStream(HttpContext.Current.Server.MapPath("template/QcSheet.xls"), FileMode.Open, FileAccess.Read);
        HSSFWorkbook hssfworkbook = new HSSFWorkbook(file);
        ISheet       sheet        = hssfworkbook.GetSheet("Sheet1");
        string       strTaskType  = "";
        //DataTable dt = GetPendingPlanDataTable();
        //if (dt.Rows.Count > 0)
        //{
        //    sheet.GetRow(2).GetCell(5).SetCellValue(dt.Rows[0]["TICKET_NUM"].ToString());
        //    sheet.GetRow(4).GetCell(1).SetCellValue(dt.Rows[0]["COMPANY_NAME"].ToString());
        //    strTaskType = getDictName(dt.Rows[0]["CONTRACT_TYPE"].ToString(), "Contract_Type");
        //    sheet.GetRow(4).GetCell(5).SetCellValue(strTaskType);
        //    sheet.GetRow(5).GetCell(1).SetCellValue(dt.Rows[0]["PROJECT_NAME"].ToString());
        //    sheet.GetRow(6).GetCell(1).SetCellValue(strTaskType + "表");
        //    sheet.GetRow(6).GetCell(5).SetCellValue(dt.Rows[0]["COMPANY_NAME"].ToString());
        //    sheet.GetRow(8).GetCell(0).SetCellValue(dt.Rows[0]["QC_STEP"].ToString());
        //}
        TMisMonitorTaskVo        objTask    = new TMisMonitorTaskVo();
        TMisMonitorTaskCompanyVo objCompany = new TMisMonitorTaskCompanyVo();
        int isOk = 0;

        getPrintQcInfo_pan(ref objTask, ref objCompany, ref isOk);
        if (isOk == 1)
        {
            sheet.GetRow(2).GetCell(5).SetCellValue(objTask.TICKET_NUM);
            sheet.GetRow(4).GetCell(1).SetCellValue(objCompany.COMPANY_NAME);
            strTaskType = getDictName(objTask.CONTRACT_TYPE, "Contract_Type");
            sheet.GetRow(4).GetCell(5).SetCellValue(strTaskType);
            sheet.GetRow(5).GetCell(1).SetCellValue(objTask.PROJECT_NAME);
            if (objTask.CONTRACT_TYPE == "02" || objTask.CONTRACT_TYPE == "03")
            {
                sheet.GetRow(6).GetCell(1).SetCellValue("监测表");
            }
            else
            {
                sheet.GetRow(6).GetCell(1).SetCellValue("监测报告");
            }
            sheet.GetRow(6).GetCell(5).SetCellValue(objCompany.COMPANY_NAME);
            sheet.GetRow(8).GetCell(0).SetCellValue(objTask.REMARK1);
        }

        using (MemoryStream stream = new MemoryStream())
        {
            hssfworkbook.Write(stream);
            HttpContext curContext = HttpContext.Current;
            // 设置编码和附件格式
            curContext.Response.ContentType     = "application/vnd.ms-excel";
            curContext.Response.ContentEncoding = Encoding.UTF8;
            curContext.Response.Charset         = "";
            curContext.Response.AppendHeader("Content-Disposition",
                                             "attachment;filename=" + HttpUtility.UrlEncode("监测质控通知单-" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".xls", Encoding.UTF8));
            curContext.Response.BinaryWrite(stream.GetBuffer());
            curContext.Response.End();
        }
    }
Example #22
0
    private void getPrintQcInfo_pan(ref TMisMonitorTaskVo objTask, ref TMisMonitorTaskCompanyVo objCompany, ref int isOk)
    {
        string strTaskId = hidTaskId.Value;

        if (!String.IsNullOrEmpty(strTaskId) && strTaskId.Length > 0)
        {
            objTask    = new TMisMonitorTaskLogic().Details(strTaskId);
            objCompany = new TMisMonitorTaskCompanyLogic().Details(objTask.TESTED_COMPANY_ID);
            isOk       = 1;
        }
    }
 private void getPrintQcInfo_pan(ref TMisMonitorTaskVo objTask, ref TMisMonitorTaskCompanyVo objCompany, ref int isOk)
 {
     if (!String.IsNullOrEmpty(strPlanId))
     {
         TMisMonitorTaskVo objTaskWhere = new TMisMonitorTaskVo();
         objTaskWhere.PLAN_ID = strPlanId;
         objTask    = new TMisMonitorTaskLogic().Details(objTaskWhere);
         objCompany = new TMisMonitorTaskCompanyLogic().Details(objTask.TESTED_COMPANY_ID);
         isOk       = 1;
     }
 }
    public static void ComleteTask(string strValue)
    {
        //任务ID
        TMisMonitorTaskVo objTaskVo = new TMisMonitorTaskVo();

        objTaskVo.COMFIRM_STATUS = "2";
        objTaskVo.ID             = !string.IsNullOrEmpty(strValue) ? strValue : "";
        if (new TMisMonitorTaskLogic().Edit(objTaskVo))
        {
            new PageBase().WriteLog("监测任务办理", "", new PageBase().LogInfo.UserInfo.ID + "对监测任务" + objTaskVo.ID + "办理成功!");
        }
    }
    public static string BackTask(string strValue)
    {
        TMisMonitorTaskVo objTaskVo = new TMisMonitorTaskVo();

        objTaskVo.ID             = strValue;
        objTaskVo.COMFIRM_STATUS = "0";
        if (new TMisMonitorTaskLogic().Edit(objTaskVo))
        {
            new PageBase().WriteLog("回退监测数据汇总表", "", new PageBase().LogInfo.UserInfo.ID + "回退监测数据汇总表" + strValue + "成功!");
        }
        return("");
    }
Example #26
0
    /// <summary>
    /// 采样任务分配信息
    /// </summary>
    /// <returns></returns>
    private string getTwoGridInfo(string strTaskID)
    {
        if (this.PLAN_ID.Value.Length == 0)
        {
            return("");
        }
        TMisMonitorTaskVo objTask = new TMisMonitorTaskVo();

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

        string strSortname  = Request.Params["sortname"];
        string strSortorder = Request.Params["sortorder"];
        //当前页面
        int intPageIndex = Convert.ToInt32(Request.Params["page"]);
        //每页记录数
        int intPageSize = Convert.ToInt32(Request.Params["pagesize"]);

        TMisMonitorSubtaskVo objSubtask = new TMisMonitorSubtaskVo();

        objSubtask.TASK_ID     = objTask.ID;
        objSubtask.TASK_STATUS = "01";
        DataTable dt = new TMisMonitorSubtaskLogic().SelectByTable(objSubtask, intPageIndex, intPageSize);

        for (int i = 0; i < dt.Rows.Count; i++)
        {
            if (dt.Rows[i]["SAMPLING_MANAGER_ID"].ToString().Length > 0)
            {
                dt.Rows[i]["SAMPLING_MANAGER_ID"] = new TSysUserLogic().Details(dt.Rows[i]["SAMPLING_MANAGER_ID"].ToString()).REAL_NAME;
            }
            else
            {
                dt.Rows[i]["SAMPLING_MANAGER_ID"] = "请选择";
            }

            //退回意见
            TMisReturnInfoVo objReturnInfoVo = new TMisReturnInfoVo();
            objReturnInfoVo.TASK_ID        = dt.Rows[i]["TASK_ID"].ToString();
            objReturnInfoVo.SUBTASK_ID     = dt.Rows[i]["ID"].ToString();
            objReturnInfoVo.CURRENT_STATUS = SerialType.Monitor_002;
            objReturnInfoVo.BACKTO_STATUS  = SerialType.Monitor_001;
            objReturnInfoVo       = new TMisReturnInfoLogic().Details(objReturnInfoVo);
            dt.Rows[i]["REMARK1"] = objReturnInfoVo.SUGGESTION;
        }
        dt.DefaultView.Sort = "MONITOR_ID ASC";
        DataTable dtTemp        = dt.DefaultView.ToTable();
        int       intTotalCount = new TMisMonitorSubtaskLogic().GetSelectResultCount(objSubtask);
        string    strJson       = CreateToJson(dtTemp, intTotalCount);

        return(strJson);
    }
Example #27
0
    /// <summary>
    /// 无需编制报告,要结束该任务
    /// </summary>
    protected void finishTask()
    {
        string            strTaskId = Request.QueryString["taskid"];//任务ID
        TMisMonitorTaskVo objTask   = new TMisMonitorTaskVo();

        objTask.ID          = strTaskId;
        objTask.TASK_STATUS = "11";
        objTask.FINISH_DATE = DateTime.Now.ToString();
        if (new TMisMonitorTaskLogic().Edit(objTask))
        {
            WriteLog("结束报告编制任务", "", LogInfo.UserInfo.USER_NAME + "结束报告编制任务" + strTaskId);
        }
    }
    public static string SendToNext(string strTaskID, string strUserID)
    {
        TMisMonitorTaskVo TMisMonitorTaskVo = new TMisMonitorTaskVo();

        TMisMonitorTaskVo.ID            = strTaskID;
        TMisMonitorTaskVo.REPORT_HANDLE = strUserID;
        if (new TMisMonitorTaskLogic().Edit(TMisMonitorTaskVo))
        {
            return("true");
        }
        else
        {
            return("false");
        }
    }
        /// <summary>
        /// 报告领取信息 行数
        /// </summary>
        /// <param name="tMisMonitorReport">报告对象</param>
        /// <param name="tMisMonitorTask">监测任务对象</param>
        /// <returns>返回影响行数</returns>
        public int GetSelectResultCount(TMisMonitorReportVo tMisMonitorReport, TMisMonitorTaskVo tMisMonitorTask)
        {
            string strSQL = "select count(*)" +
                            " from (select * from T_MIS_MONITOR_REPORT {0}) report " +
                            " join (select * from T_MIS_MONITOR_TASK {1}) task on report.TASK_ID=task.ID";

            #region 监测任务查询条件构造 strTaskWhere
            string strTaskWhere = " where 1=1";
            //委托书编号
            if (!string.IsNullOrEmpty(tMisMonitorTask.CONTRACT_CODE))
            {
                strTaskWhere += string.Format(" and CONTRACT_CODE='{0}'", tMisMonitorTask.CONTRACT_CODE);
            }
            //委托类型
            if (!string.IsNullOrEmpty(tMisMonitorTask.CONTRACT_TYPE))
            {
                strTaskWhere += string.Format(" and CONTRACT_TYPE='{0}'", tMisMonitorTask.CONTRACT_TYPE);
            }
            //项目名称
            if (!string.IsNullOrEmpty(tMisMonitorTask.PROJECT_NAME))
            {
                strTaskWhere += string.Format(" and PROJECT_NAME like '%{0}%'", tMisMonitorTask.PROJECT_NAME);
            }
            //委托单位
            if (!string.IsNullOrEmpty(tMisMonitorTask.CLIENT_COMPANY_ID))
            {
                strTaskWhere += string.Format(" and CLIENT_COMPANY_ID='{0}'", tMisMonitorTask.CLIENT_COMPANY_ID);
            }
            //签订日期
            if (!string.IsNullOrEmpty(tMisMonitorTask.CONSIGN_DATE))
            {
                if (tMisMonitorTask.CONSIGN_DATE.Contains("|"))
                {
                    string[] arrDate = tMisMonitorTask.CONSIGN_DATE.Split('|');
                    if (!string.IsNullOrEmpty(arrDate[0].ToString()))
                    {
                        strTaskWhere += string.Format(" and CONSIGN_DATE>='{0}'", arrDate[0].ToString());
                    }
                    if (!string.IsNullOrEmpty(arrDate[1].ToString()))
                    {
                        strTaskWhere += string.Format(" and CONSIGN_DATE<='{0}'", arrDate[1].ToString());
                    }
                }
            }
            #endregion
            strSQL = string.Format(strSQL, BuildWhereStatement(tMisMonitorReport), strTaskWhere);
            return(Int32.Parse(SqlHelper.ExecuteScalar(strSQL).ToString()));
        }
    /// <summary>
    /// 获得委托书信息
    /// </summary>
    /// <returns>Json</returns>
    protected string GetContractInfo()
    {
        if (this.PLAN_ID.Value.Length == 0)
        {
            return("");
        }
        TMisContractPlanVo objPlan = new TMisContractPlanLogic().Details(this.PLAN_ID.Value);
        TMisMonitorTaskVo  objTask = new TMisMonitorTaskVo();

        objTask.PLAN_ID           = this.PLAN_ID.Value;
        objTask                   = new TMisMonitorTaskLogic().Details(objTask);
        objTask.TESTED_COMPANY_ID = new TMisMonitorTaskCompanyLogic().Details(objTask.TESTED_COMPANY_ID).COMPANY_NAME;
        objTask.CONTRACT_TYPE     = new TSysDictLogic().GetDictNameByDictCodeAndType(objTask.CONTRACT_TYPE, "Contract_Type");

        return(ToJson(objTask));
    }