/// <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));
    }
Ejemplo n.º 2
0
    private void printLocal(string strTaskId, string strSubTaskID, string strIsLocal, string strSheetType)
    {
        //动态生成列名
        string strPreColumnName = "";
        //动态生成列名编码
        string strPreColumnName_Src = "";

        TMisMonitorTaskVo objTask      = new TMisMonitorTaskLogic().Details(strTaskId);
        string            strMonitorID = "";

        if (!string.IsNullOrEmpty(strSubTaskID) && strSubTaskID.Length > 0)
        {
            strMonitorID = new TMisMonitorSubtaskLogic().Details(strSubTaskID).MONITOR_ID;
        }

        //标题数组
        ArrayList arrTitle = getPrintLocalTitle(strMonitorID, objTask, strSheetType, ref strPreColumnName, ref strPreColumnName_Src);
        //结尾数组
        ArrayList arrEnd = getPrintLocalEnd();

        //行转列 前数据表
        DataTable dtResultTotal = new TMisMonitorResultLogic().getTotalItemInfoByTaskID_ForSummary(strTaskId, "", strMonitorID, strIsLocal == "1");

        //特殊表的数据处理
        doWithDataForSheet(strSheetType, ref dtResultTotal);
        GetRemarkData(ref dtResultTotal);
        //行转列 后数据表
        DataTable dtNew = getDatatable("", strPreColumnName, strPreColumnName_Src, dtResultTotal);


        //项目列名数组
        ArrayList arrData = getPrintLocalData(dtNew);

        new ExcelHelper().RenderDataTableToExcel(dtNew, "监测数据汇总表.xls", "../../../../TempFile/DataTotal.xls", "监测数据汇总表", 5, true, arrTitle, arrData, arrEnd);
    }
    /// <summary>
    /// 修改项目复制人
    /// </summary>
    /// <param name="strPlanId"></param>
    private void ModifTaskSampleDutyUser(string strPlanId)
    {
        if (!String.IsNullOrEmpty(strPlanId))
        {
            TMisMonitorTaskVo objTaskDetail = new TMisMonitorTaskLogic().Details(new TMisMonitorTaskVo {
                PLAN_ID = strPlanId
            });
            TMisMonitorSubtaskVo objSubTask = new TMisMonitorSubtaskVo();
            objSubTask.TASK_ID = objTaskDetail.ID;
            DataTable dt = new TMisMonitorSubtaskLogic().SelectByTable(objSubTask, 0, 0);

            TMisContractUserdutyVo objUserDuty = new TMisContractUserdutyVo();
            objUserDuty.CONTRACT_PLAN_ID = strPlanId;
            DataTable dtDuty = new TMisContractUserdutyLogic().SelectByTable(objUserDuty, 0, 0);

            if (dt.Rows.Count > 0 && dtDuty.Rows.Count > 0)
            {
                foreach (DataRow dr in dt.Rows)
                {
                    foreach (DataRow drr in dtDuty.Rows)
                    {
                        if (dr["MONITOR_ID"].ToString() == drr["MONITOR_TYPE_ID"].ToString())
                        {
                            TMisMonitorSubtaskVo objUpSubTask = new TMisMonitorSubtaskVo();
                            objUpSubTask.ID = dr["ID"].ToString();
                            objUpSubTask.SAMPLING_MANAGER_ID = drr["SAMPLING_MANAGER_ID"].ToString();
                            new TMisMonitorSubtaskLogic().Edit(objUpSubTask);
                        }
                    }
                }
            }
        }
    }
    /// <summary>
    /// 获取备注
    /// </summary>
    /// <param name="strTaskID">监测任务</param>
    /// <returns></returns>
    protected string GetRemark(string strTaskID)
    {
        string            strRemark   = "";
        TMisMonitorTaskVo objTask     = new TMisMonitorTaskLogic().Details(strTaskID);
        TMisContractVo    objContract = new TMisContractLogic().Details(objTask.CONTRACT_ID);

        //备注信息 同意分包
        if (!string.IsNullOrEmpty(objContract.AGREE_OUTSOURCING))
        {
            strRemark += new TSysDictLogic().GetDictNameByDictCodeAndType("accept_subpackage", "Contract_Remarks") + ";";
        }
        //备注信息 是否同意使用的监测方法
        if (!string.IsNullOrEmpty(objContract.AGREE_METHOD))
        {
            strRemark += new TSysDictLogic().GetDictNameByDictCodeAndType("accept_useMonitorMethod", "Contract_Remarks") + ";";
        }
        //是否同意使用非标准方法
        if (!string.IsNullOrEmpty(objContract.AGREE_NONSTANDARD))
        {
            strRemark += new TSysDictLogic().GetDictNameByDictCodeAndType("accept_usenonstandard", "Contract_Remarks") + ";";
        }
        //是否同意其他
        if (!string.IsNullOrEmpty(objContract.AGREE_OTHER))
        {
            strRemark += new TSysDictLogic().GetDictNameByDictCodeAndType("accept_other", "Contract_Remarks") + ";";
        }
        return(strRemark);
    }
Ejemplo n.º 5
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();
    }
Ejemplo n.º 6
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();
    }
Ejemplo n.º 7
0
    //获取指定点位的监测项目信息
    private string getItemList()
    {
        string strSampleID  = Request.Params["strSampleID"];
        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 strSelPointID = (Request.Params["selPointID"] != null) ? Request.Params["selPointID"] : "";

        if (strSelPointID.Length <= 0)
        {
            //return "";
        }

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

        TMisMonitorResultVo objResult = new TMisMonitorResultVo();

        if (strSampleID == null)
        {
            strSampleID = strSelPointID;
        }
        objResult.SAMPLE_ID  = strSampleID;
        objResult.SORT_FIELD = strSortname;
        objResult.SORT_TYPE  = strSortorder;
        DataTable dt = new TMisMonitorResultLogic().SelectByTable(objResult, intPageIdx, intPagesize);

        TMisMonitorSampleInfoVo SampleInfoVo = new TMisMonitorSampleInfoLogic().Details(strSampleID);
        TMisMonitorSubtaskVo    SubtaskVo    = new TMisMonitorSubtaskLogic().Details(SampleInfoVo.SUBTASK_ID);
        TMisMonitorTaskVo       TaskVo       = new TMisMonitorTaskLogic().Details(SubtaskVo.TASK_ID);

        DataColumn dcP;

        dcP = new DataColumn("TASK_POINT_ID", Type.GetType("System.String"));
        dt.Columns.Add(dcP);
        for (int i = 0; i < dt.Rows.Count; i++)
        {
            dt.Rows[i]["TASK_POINT_ID"] = strSelPointID;
            dt.Rows[i]["REMARK_1"]      = TaskVo.TEST_PURPOSE;
        }
        int intTotalCount = new TMisMonitorResultLogic().GetSelectResultCount(objResult);

        //TMisMonitorTaskItemVo objPointItem = new TMisMonitorTaskItemVo();
        //objPointItem.IS_DEL = "0";
        //objPointItem.TASK_POINT_ID = strSelPointID;
        //objPointItem.SORT_FIELD = strSortname;
        //objPointItem.SORT_TYPE = strSortorder;
        //TMisMonitorTaskItemLogic logicPointItem = new TMisMonitorTaskItemLogic();

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

        string strJson = CreateToJson(dt, intTotalCount);

        return(strJson);
    }
    /// <summary>
    /// 获取任务信息
    /// </summary>
    /// <returns></returns>
    private string getOneGridInfo()
    {
        string strSortname  = Request.Params["sortname"];
        string strSortorder = Request.Params["sortorder"];
        //当前页面
        int intPageIndex = Convert.ToInt32(Request.Params["page"]);
        //每页记录数
        int intPageSize = Convert.ToInt32(Request.Params["pagesize"]);

        DataTable dt = new TMisMonitorTaskLogic().SelectSampleTaskForWithSampleAnalysisQY(LogInfo.UserInfo.ID, "sample_result_check", "'02','022'", "0", "50", intPageIndex, intPageSize);

        //退回意见
        for (int i = 0; i < dt.Rows.Count; i++)
        {
            //分析审核退回到复核的意见
            TMisReturnInfoVo objReturnInfoVo = new TMisReturnInfoVo();
            objReturnInfoVo.TASK_ID        = dt.Rows[i]["ID"].ToString();
            objReturnInfoVo.CURRENT_STATUS = SerialType.Monitor_003;
            objReturnInfoVo.BACKTO_STATUS  = SerialType.Monitor_010;
            objReturnInfoVo       = new TMisReturnInfoLogic().Details(objReturnInfoVo);
            dt.Rows[i]["REMARK1"] = objReturnInfoVo.SUGGESTION;
        }

        int    intTotalCount = new TMisMonitorTaskLogic().SelectSampleTaskForWithSampleAnalysisCountQY(LogInfo.UserInfo.ID, "sample_result_check", "'02','022'", "0", "50");
        string strJson       = CreateToJson(dt, intTotalCount);

        return(strJson);
    }
    private string GetCompany_UnderTask(string strTaskID)
    {
        TMisMonitorTaskVo        objTask    = new TMisMonitorTaskLogic().Details(strTaskID);
        TMisMonitorTaskCompanyVo objCompany = new TMisMonitorTaskCompanyLogic().Details(objTask.TESTED_COMPANY_ID);

        return(objCompany.COMPANY_NAME);
    }
Ejemplo n.º 10
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></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);
        }
    }
Ejemplo n.º 12
0
    void IWFStepRules.CreatAndRegisterBusinessData()
    {
        string strBtnType = this.btnType.Value;//触发按键类型

        if (strBtnType == "send")
        {
            #region 初始化环节信息
            TMisMonitorTaskVo objTask = new TMisMonitorTaskLogic().Details(this.ID.Value);
            wfControl.ServiceCode = objTask.CONTRACT_CODE;
            wfControl.ServiceName = objTask.PROJECT_NAME;
            #endregion
            //更改监测任务状态
            objTask.TASK_STATUS = "10";
            new TMisMonitorTaskLogic().Edit(objTask);
            //这里是产生和注册业务数据的地方
            wfControl.SaveInstStepServiceData("报告流程", "task_id", this.ID.Value);
        }
        else if (strBtnType == "back")
        {
            //回退到质控审核 修改任务和子任务状态
            if (new TMisMonitorSubtaskLogic().CombackTaskToAnalyse(this.ID.Value))
            {
                WriteLog("报告编制回退", "", LogInfo.UserInfo.USER_NAME + "回退报告编制任务" + this.ID.Value);
            }
        }
    }
    /// <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("");
        }
    }
Ejemplo n.º 14
0
    /// <summary>
    /// 获取任务信息
    /// </summary>
    /// <returns></returns>
    private string getOneGridInfo(string strSample)
    {
        string strSubTaskID = Request["strSubTaskID"].ToString();
        string strSortname  = Request.Params["sortname"];
        string strSortorder = Request.Params["sortorder"];
        //当前页面
        int intPageIndex = Convert.ToInt32(Request.Params["page"]);
        //每页记录数
        int intPageSize = Convert.ToInt32(Request.Params["pagesize"]);

        DataTable dt = new TMisMonitorTaskLogic().SelectSampleTaskForMAS(strSubTaskID, strSample == "1" ? true : false, intPageIndex, intPageSize);

        //huangjinjun add 2016.1.26
        TMisMonitorTaskVo tm = new TMisMonitorTaskLogic().Details(dt.Rows[0]["ID"].ToString());

        if (tm.REMARK3 == "true")
        {
            bool bl = new TBaseItemInfoLogic().EditItemTypeFX();
        }
        else
        {
            bool bl = new TBaseItemInfoLogic().EditItemTypeXC();
        }

        int    intTotalCount = new TMisMonitorTaskLogic().SelectSampleTaskCountForMAS(strSubTaskID, strSample == "1" ? true : false);
        string strJson       = CreateToJson(dt, intTotalCount);

        return(strJson);
    }
Ejemplo n.º 15
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));
    }
    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);
    }
    /// <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));
    }
    /// <summary>
    /// 获取监测类别信息
    /// </summary>
    /// <param name="strOneGridId"></param>
    /// <returns></returns>
    private string getTwoGridInfo(string strOneGridId, string strResultID)
    {
        DataTable dt      = new TMisMonitorTaskLogic().SelectSampleSubTaskForWithSampleAnalysisMAS(strOneGridId, strResultID);
        string    strJson = CreateToJson(dt, dt.Rows.Count);

        return(strJson);
    }
    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";
    }
Ejemplo n.º 20
0
    /// <summary>
    /// 获得委托书信息
    /// </summary>
    /// <returns>Json</returns>
    protected string GetContractInfo()
    {
        TMisMonitorSubtaskVo objSubtask = new TMisMonitorSubtaskLogic().Details(this.SUBTASK_ID.Value);
        TMisMonitorTaskVo    objTask    = new TMisMonitorTaskLogic().Details(objSubtask.TASK_ID);

        TMisMonitorTaskCompanyVo objConCompany = new TMisMonitorTaskCompanyVo();

        objConCompany.TASK_ID          = objTask.ID;
        objConCompany                  = new TMisMonitorTaskCompanyLogic().Details(objConCompany);
        objSubtask.MONITOR_ID          = getMonitorTypeName(objSubtask.MONITOR_ID);
        objSubtask.SAMPLING_MANAGER_ID = new TSysUserLogic().Details(LogInfo.UserInfo.ID).REAL_NAME;
        objSubtask.REMARK1             = objTask.CONTRACT_CODE;
        objSubtask.REMARK2             = getDictName(objTask.CONTRACT_TYPE, "Contract_Type");
        objSubtask.REMARK3             = objConCompany.COMPANY_NAME;
        objSubtask.REMARK4             = objConCompany.CONTACT_NAME;
        objSubtask.REMARK5             = objConCompany.LINK_PHONE;
        if (!String.IsNullOrEmpty(objSubtask.SAMPLE_ASK_DATE))
        {
            objSubtask.SAMPLE_ASK_DATE = DateTime.Parse(objSubtask.SAMPLE_ASK_DATE).ToString("yyyy-MM-dd");
        }
        if (!String.IsNullOrEmpty(objSubtask.SAMPLE_FINISH_DATE))
        {
            objSubtask.SAMPLE_FINISH_DATE = DateTime.Parse(objSubtask.SAMPLE_FINISH_DATE).ToString("yyyy-MM-dd");
        }
        return(ToJson(objSubtask));
    }
    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);
        }
    }
Ejemplo n.º 22
0
    protected string getPlanID()
    {
        TMisMonitorSubtaskVo objSubtask = new TMisMonitorSubtaskLogic().Details(this.SUBTASK_ID.Value);
        TMisMonitorTaskVo    objTask    = new TMisMonitorTaskLogic().Details(objSubtask.TASK_ID);

        return(objTask.PLAN_ID);
    }
    /// <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");
    }
Ejemplo n.º 24
0
    public static string getContractType(string strTaskId)
    {
        TMisMonitorTaskVo objTask = new TMisMonitorTaskVo();

        objTask.ID = strTaskId;
        objTask    = new TMisMonitorTaskLogic().Details(objTask);
        return(objTask.CONTRACT_TYPE);
    }
    /// <summary>
    /// 产生和注册业务数据
    /// </summary>
    void IWFStepRules.CreatAndRegisterBusinessData()
    {
        TMisMonitorTaskVo objTask = new TMisMonitorTaskLogic().Details(this.ID.Value);

        wfControl.ServiceCode = objTask.CONTRACT_CODE;
        wfControl.ServiceName = objTask.PROJECT_NAME;
        //这里是产生和注册业务数据的地方
        wfControl.SaveInstStepServiceData("报告流程", "task_id", this.ID.Value);
    }
Ejemplo n.º 26
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();
    }
Ejemplo n.º 27
0
    protected void btnExportSamplesOrder_Click(object sender, EventArgs e)
    {
        string    strPrintId = this.strPrintId.Value;
        DataTable dt         = new TMisMonitorResultLogic().getSampleOrderInfo_ZZ(strPrintId);

        FileStream   file         = new FileStream(HttpContext.Current.Server.MapPath("../../Result/ZZ/template/样品分析通知单.xls"), FileMode.Open, FileAccess.Read);
        HSSFWorkbook hssfworkbook = new HSSFWorkbook(file);
        ISheet       sheet        = hssfworkbook.GetSheet("Sheet1");

        int i = 0;

        foreach (DataRow row in dt.Rows)
        {
            string strId = row["ID"] == null ? "" : row["ID"].ToString();

            string strTaskDate    = row["TASK_DATE"] == null ? "" : DateTime.Parse(row["TASK_DATE"].ToString()).ToString("yyyy.MM.dd");
            string strSampleCode  = row["SAMPLE_CODE"] == null ? "" : row["SAMPLE_CODE"].ToString();
            string strCompanyName = row["COMPANY_NAME"] == null ? "" : row["COMPANY_NAME"].ToString();
            string strSampleName  = row["SAMPLE_NAME"] == null ? "" : row["SAMPLE_NAME"].ToString();
            string strSampleAddr  = strCompanyName + strSampleName;
            string strSampleType  = row["SAMPLE_TYPE"] == null ? "" : row["SAMPLE_TYPE"].ToString();
            string strItemName    = row["ITEM_NAME"] == null ? "" : row["ITEM_NAME"].ToString();
            string strAskingDate  = row["ASKING_DATE"] == null ? "" : row["ASKING_DATE"].ToString();
            string strProjectName = row["PROJECT_NAME"] == null ? "" : row["PROJECT_NAME"].ToString();

            sheet.GetRow(i + 4).GetCell(0).SetCellValue(strTaskDate);
            sheet.GetRow(i + 4).GetCell(1).SetCellValue(strSampleCode);
            if (this.hidden.Value == "1")
            {
                sheet.GetRow(i + 4).GetCell(2).SetCellValue(strSampleAddr);
            }
            sheet.GetRow(i + 4).GetCell(3).SetCellValue(strSampleType);
            sheet.GetRow(i + 4).GetCell(4).SetCellValue(strItemName);
            sheet.GetRow(i + 4).GetCell(5).SetCellValue(strAskingDate);
            sheet.GetRow(i + 4).GetCell(6).SetCellValue(strProjectName);
            i++;
        }

        string strTaskNum = new TMisMonitorTaskLogic().Details(strPrintId).TICKET_NUM;

        sheet.GetRow(2).GetCell(6).SetCellValue(strTaskNum);

        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("样品分析通知单.xls", Encoding.UTF8));
            curContext.Response.BinaryWrite(stream.GetBuffer());
            curContext.Response.End();
        }
    }
Ejemplo n.º 28
0
    protected void btnImportCode_Click(object sender, EventArgs e)
    {
        string strPrintId = this.strPrintId_code.Value;

        TMisMonitorSubtaskVo objSubTask = new TMisMonitorSubtaskLogic().Details(strPrintId);
        string strCompanyName           = GetCompany_UnderTask(objSubTask.TASK_ID);
        //objSubTask.TASK_ID = strPrintId;
        //DataTable dtSub = new TMisMonitorSubtaskLogic().SelectByTable(objSubTask);
        TMisMonitorTaskVo objTaskVo    = new TMisMonitorTaskLogic().Details(objSubTask.TASK_ID);
        string            strSampleIDs = "";

        //for (int i = 0; i < dtSub.Rows.Count; i++)
        //{
        //    GetPoint_UnderTask(dtSub.Rows[i]["ID"].ToString(), ref strSampleIDs);
        //}
        GetPoint_UnderTask(strPrintId, ref strSampleIDs);

        //获取基本信息
        DataTable dt = new TMisMonitorSampleInfoLogic().getSamplingAllocationSheetInfoBySampleId(strSampleIDs, "02,021", "1");

        FileStream   file         = new FileStream(HttpContext.Current.Server.MapPath("template/SamplingCodingSheet.xls"), FileMode.Open, FileAccess.Read);
        HSSFWorkbook hssfworkbook = new HSSFWorkbook(file);
        ISheet       sheet        = hssfworkbook.GetSheet("Sheet1");

        sheet.GetRow(2).GetCell(1).SetCellValue(DateTime.Now.ToString("yyyy年MM月dd日"));

        for (int i = 0; i < dt.Rows.Count; i++)
        {
            int j = i + 1;
            sheet.GetRow(i + 6).GetCell(0).SetCellValue(j.ToString());
            if (objTaskVo.TASK_TYPE == "1")  //常规任务
            {
                sheet.GetRow(i + 6).GetCell(1).SetCellValue(dt.Rows[i]["SAMPLE_NAME"].ToString());
            }
            else
            {
                sheet.GetRow(i + 6).GetCell(1).SetCellValue(strCompanyName + dt.Rows[i]["SAMPLE_NAME"].ToString());
            }
            //sheet.GetRow(i + 6).GetCell(3).SetCellValue("1");
            sheet.GetRow(i + 6).GetCell(5).SetCellValue(dt.Rows[i]["SAMPLE_CODE"].ToString());
        }
        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("样品编码表.xls", Encoding.UTF8));
            curContext.Response.BinaryWrite(stream.GetBuffer());
            curContext.Response.End();
        }
    }
Ejemplo n.º 29
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;
     }
 }