Beispiel #1
0
    public static List <object> GetMonitorItems(string strMonitor, string strUserId)
    {
        List <object> reslut = new List <object>();


        DataTable       dtSt  = new DataTable();
        TBaseItemInfoVo objtd = new TBaseItemInfoVo();

        objtd.IS_DEL     = "0";
        objtd.MONITOR_ID = strMonitor;
        dtSt             = new TBaseItemInfoLogic().SelectByTable(objtd);
        DataTable dtnew = new DataTable();

        dtnew = new TSysUserDutyLogic().GetExistMonitor(strMonitor, strUserId, false, false);
        for (int i = 0; i < dtnew.Rows.Count; i++)
        {
            DataRow[] drr = dtSt.Select("ID='" + dtnew.Rows[i]["ITEM_ID"] + "'");
            if (drr.Length > 0)
            {
                foreach (DataRow drow in drr)
                {
                    drow.Delete();
                }
            }
        }

        dtSt.AcceptChanges();

        reslut = LigerGridSelectDataToJson(dtSt, dtSt.Rows.Count);

        return(reslut);
    }
    public static string SetDefaultEx(string strUSERDUTYIDs)
    {
        string[] strUSERDUTYIDsArr = strUSERDUTYIDs.Split(';');
        foreach (string str in strUSERDUTYIDsArr)
        {
            TSysUserDutyVo objUserDuty = new TSysUserDutyLogic().Details(str);

            if (objUserDuty.IF_DEFAULT_EX == "0")
            {
                new TSysUserDutyLogic().Edit(new TSysUserDutyVo()
                {
                    IF_DEFAULT_EX = "1"
                }, new TSysUserDutyVo {
                    ID = str
                });
            }
            else
            {
                new TSysUserDutyLogic().Edit(new TSysUserDutyVo()
                {
                    IF_DEFAULT_EX = "0"
                }, new TSysUserDutyVo {
                    ID = str
                });
            }
        }

        return("1");
    }
Beispiel #3
0
    public static List <object> GetExistMonitorItems(string strMonitor, string strUserId, string strDefaultAu, string strDefaultEx)
    {
        List <object> reslut = new List <object>();

        DataTable dtnew = new DataTable();
        DataTable dtAll = new DataTable();

        //获取当前用户加载作为项目负责人的项目
        if (!String.IsNullOrEmpty(strDefaultAu))
        {
            dtnew = new TSysUserDutyLogic().GetExistMonitor(strMonitor, strUserId, true, false);
            //获取分析岗位职责中 设置监测类型为岗位职责的数据
            dtAll = new TSysUserDutyLogic().GetExistMonitorType(strMonitor, strUserId, true, false);
            for (int i = 0; i < dtAll.Rows.Count; i++)
            {
                if (i == 0)
                {
                    dtAll.Rows[0]["ITEM_NAME"] = "所有(" + dtAll.Rows[0]["ITEM_NAME"].ToString() + "类)";
                    dtAll.AcceptChanges();
                    dtnew.ImportRow(dtAll.Rows[0]);
                }
            }
        }
        //获取当前用户加载作为项目协同人的项目
        if (!String.IsNullOrEmpty(strDefaultEx))
        {
            dtnew = new TSysUserDutyLogic().GetExistMonitor(strMonitor, strUserId, false, true);
            dtAll = new TSysUserDutyLogic().GetExistMonitorType(strMonitor, strUserId, false, true);
            for (int i = 0; i < dtAll.Rows.Count; i++)
            {
                if (i == 0)
                {
                    dtAll.Rows[0]["ITEM_NAME"] = "所有(" + dtAll.Rows[0]["ITEM_NAME"].ToString() + "类)";
                    dtAll.AcceptChanges();
                    dtnew.ImportRow(dtAll.Rows[0]);
                }
            }
        }
        if (String.IsNullOrEmpty(strDefaultAu) && String.IsNullOrEmpty(strDefaultEx))
        {
            //获取当前用户已设置的监测项目
            dtnew = new TSysUserDutyLogic().GetExistMonitor(strMonitor, strUserId, false, false);
            dtAll = new TSysUserDutyLogic().GetExistMonitorType(strMonitor, strUserId, false, false);
            for (int i = 0; i < dtAll.Rows.Count; i++)
            {
                if (i == 0)
                {
                    dtAll.Rows[0]["ITEM_NAME"] = "所有(" + dtAll.Rows[0]["ITEM_NAME"].ToString() + "类)";
                    dtAll.AcceptChanges();
                    dtnew.ImportRow(dtAll.Rows[0]);
                }
            }
        }
        reslut = LigerGridSelectDataToJson(dtnew, dtnew.Rows.Count);
        return(reslut);
    }
    public static bool InsertSelectedUser(string strUserId, string strItemID, string strDutyType)
    {
        string strDutyID    = "";
        string strMonitorID = new TBaseItemInfoLogic().Details(strItemID).MONITOR_ID;

        TSysDutyVo objDutySrh = new TSysDutyVo();

        objDutySrh.MONITOR_TYPE_ID = strMonitorID;
        objDutySrh.MONITOR_ITEM_ID = strItemID;
        objDutySrh.DICT_CODE       = strDutyType;
        DataTable dtDuty = new TSysDutyLogic().SelectByTable(objDutySrh);

        if (dtDuty.Rows.Count == 0)
        {
            //如果不存在岗位配置,增加
            objDutySrh.ID = GetSerialNumber("duty_set_infor");
            if (new TSysDutyLogic().Create(objDutySrh))
            {
                strDutyID = objDutySrh.ID;
            }
        }
        else
        {
            strDutyID = dtDuty.Rows[0]["ID"].ToString();
        }

        TSysUserDutyVo objUserDutySrh = new TSysUserDutyVo();

        objUserDutySrh.DUTY_ID = strDutyID;
        DataTable dtUserDuty = new TSysUserDutyLogic().SelectByTable(objUserDutySrh);

        //删除移除的
        for (int i = 0; i < dtUserDuty.Rows.Count; i++)
        {
            string strTmpUserID = dtUserDuty.Rows[i]["USERID"].ToString();
            if (!strUserId.Contains(strTmpUserID))
            {
                new TSysUserDutyLogic().Delete(dtUserDuty.Rows[i]["ID"].ToString());
            }
        }

        string[] strUerArr = strUserId.Split(';');
        new TSysUserDutyLogic().InsertSelectedUser(strUerArr, strDutyID);


        return(true);
    }
    /// <summary>
    /// 获得指定职责的默认负责人,如果不存在则取第一个
    /// </summary>
    /// <param name="strDutyType">职责编码</param>
    /// <param name="strMonitorType">监测类别</param>
    /// <returns></returns>
    private string GetDefaultOrFirstDutyUser(string strDutyType, string strMonitorType)
    {
        DataTable dtDuty = new TSysUserDutyLogic().SelectUserDuty(strDutyType, strMonitorType);

        //过滤默认负责人
        DataRow[] drDuty = dtDuty.Select(" IF_DEFAULT");
        if (drDuty.Length > 0)
        {
            return(GetSampleManager(drDuty[0]["USERID"].ToString()));
        }
        else
        {
            if (dtDuty.Rows.Count > 0)
            {
                return(GetSampleManager(dtDuty.Rows[0]["USERID"].ToString()));
            }
        }
        return("");
    }
Beispiel #6
0
    public static List <object> GetSubUserItems(string strPost_Dept, string strMonitorId, string strDutyType)
    {
        List <object> listResult = new List <object>();
        DataTable     dt         = new DataTable();
        DataTable     dtDuty     = new DataTable();

        dt = new TSysUserLogic().SelectByTableUnderDept(strPost_Dept, 0, 0);

        dtDuty = new TSysUserDutyLogic().SelectUserDuty(strDutyType, strMonitorId);

        DataTable dtItems = new DataTable();

        dtItems = dt.Copy();
        dtItems.Clear();

        if (dtDuty.Rows.Count > 0)
        {
            for (int i = 0; i < dtDuty.Rows.Count; i++)
            {
                if (!String.IsNullOrEmpty(dtDuty.Rows[i]["USERID"].ToString()))
                {
                    DataRow[] dr = dt.Select("ID='" + dtDuty.Rows[i]["USERID"].ToString() + "'");
                    if (dr != null)
                    {
                        foreach (DataRow Temrow in dr)
                        {
                            Temrow.Delete();
                            dt.AcceptChanges();
                        }
                    }
                }
            }
        }

        dtItems = dt.Copy();

        listResult = LigerGridSelectDataToJson(dtItems, dtItems.Rows.Count);
        return(listResult);
    }
    public static string SetDefaultAu(string strUSERDUTYIDs)
    {
        string[] strUSERDUTYIDsArr = strUSERDUTYIDs.Split(';');
        foreach (string str in strUSERDUTYIDsArr)
        {
            TSysUserDutyVo objUserDuty = new TSysUserDutyLogic().Details(str);

            new TSysUserDutyLogic().Edit(new TSysUserDutyVo()
            {
                IF_DEFAULT = "1"
            }, new TSysUserDutyVo {
                DUTY_ID = objUserDuty.DUTY_ID
            });
            new TSysUserDutyLogic().Edit(new TSysUserDutyVo()
            {
                IF_DEFAULT = "0"
            }, new TSysUserDutyVo {
                ID = str
            });
        }

        return("1");
    }
    protected void ReturnAllTaskStep()
    {
        //任务对象
        TMisMonitorTaskVo objTask = new TMisMonitorTaskLogic().Details(this.TASK_ID.Value);
        //子任务信息
        TMisMonitorSubtaskVo objSubTask = new TMisMonitorSubtaskLogic().Details(new TMisMonitorSubtaskVo()
        {
            TASK_ID    = this.TASK_ID.Value,
            MONITOR_ID = this.dllMonitor.SelectedValue
        });
        //样品信息
        TMisMonitorSampleInfoVo objSample = new TMisMonitorSampleInfoLogic().Details(new TMisMonitorSampleInfoVo()
        {
            SUBTASK_ID = objSubTask.ID,
            QC_TYPE    = "0"
        });
        //样品结果信息
        DataTable dtResult = new TMisMonitorResultLogic().SelectResultAndAppWithSubtaskID(objSubTask.ID);
        //校阅
        //委托书对象
        TMisContractVo objContract = new TMisContractLogic().Details(objTask.CONTRACT_ID);
        //预约表
        TMisContractPlanVo objPlan = new TMisContractPlanLogic().Details(new TMisContractPlanVo()
        {
            CONTRACT_ID = objContract.ID
        });
        //预约频次表(已预约未办理数)
        int intIsPlanNoDo = new TMisContractPointFreqLogic().GetSelectResultCount(new TMisContractPointFreqVo()
        {
            CONTRACT_ID = objContract.ID,
            IF_PLAN     = "0"
        });

        #region 暂行的定制生成任务追踪方法 页面HTML构建
        //定义已处理DIV样式
        string strDivHas = "<div style='width:150px;height:50px;background-color:#5a8f5a;text-align: center;vertical-align: middle;'>{0}</div>";
        //定义待处理DIV样式
        string strDivWait = "<div style='width:150px;height:50px;background-color:#de9a1d;text-align: center;vertical-align: middle;'>{0}</div>";
        //定义特殊处理DIV样式
        //string strDivSepecial = "<div style='width:100px;height:50px;background-color:#e34323;text-align: center;vertical-align: middle;'>{0}</div";
        //定义未处理DIV样式
        //string strDivNo = "<div style='width:100px;height:50px;background-color:#a9a9a9;text-align: center;vertical-align: middle;'>{0}</div>";

        Table table1 = new Table();
        table1.CssClass = "tMain";
        TableRow  row1  = new TableRow();//委托流程连接
        TableCell cell1 = new TableCell();
        cell1.Text = string.Format(strDivHas, "<a href='#' onclick='ShowContract();'>委托流程</a>");
        row1.Cells.Add(cell1);
        table1.Rows.Add(row1);
        //是否已预约
        if (intIsPlanNoDo > 0)
        {
            table1 = GetCommonRow(table1, strDivHas, "采样预约", "");
        }
        else
        {
            table1 = GetCommonRow(table1, strDivWait, "采样预约", "");

            this.divSample.Controls.Add(table1);
            return;
        }
        //是否预约办理
        if (objPlan.HAS_DONE == "1")//已办理
        {
            table1 = GetCommonRow(table1, strDivHas, "预约办理", "");
        }
        else
        {
            table1 = GetCommonRow(table1, strDivWait, "预约办理", "");

            this.divSample.Controls.Add(table1);
            return;
        }
        //采样负责人
        string strSampleManager = GetSampleManager(objSubTask.SAMPLING_MANAGER_ID);
        //交接人
        string    strSampleAccept = string.Empty;
        DataTable dtSampleAccept  = new TSysUserDutyLogic().SelectUserDuty("sample_allocation_sheet", this.dllMonitor.SelectedValue);
        if (dtSampleAccept.Rows.Count > 0)
        {
            strSampleAccept = GetSampleManager(dtSampleAccept.Rows[0]["USERID"].ToString());
        }
        //是否采样
        if (objSubTask.TASK_STATUS == "02")
        {
            table1 = GetCommonRow(table1, strDivWait, "采样", strSampleManager);
        }
        //样品交接
        if (objSubTask.TASK_STATUS == "021")
        {
            table1 = GetCommonRow(table1, strDivHas, "采样", strSampleManager);
            table1 = GetCommonRow(table1, strDivWait, "样品交接", strSampleAccept);
        }
        //分析任务分配
        DataRow[] dr1 = dtResult.Select(" RESULT_STATUS='01'");//过滤过分析分配环节任务
        //分析结果录入
        DataRow[] dr2 = dtResult.Select(" RESULT_STATUS='20'");
        //数据审核
        DataRow[] dr3 = dtResult.Select(" RESULT_STATUS='30'");
        //分析室主任审核
        DataRow[] dr4 = dtResult.Select(" RESULT_STATUS='40'");
        //技术室主任审核
        DataRow[] dr5 = dtResult.Select(" RESULT_STATUS='50'");
        if (objSubTask.TASK_STATUS == "03")
        {
            if (dr1.Length > 0)//环节在分析任务分配
            {
                table1 = GetCommonRow(table1, strDivHas, "采样", strSampleManager);
                table1 = GetCommonRow(table1, strDivHas, "样品交接", strSampleAccept);
                table1 = GetCommonRow(table1, strDivWait, "分析任务分配", "");
            }
            else
            {
                table1 = GetCommonRow(table1, strDivHas, "采样", strSampleManager);
                table1 = GetCommonRow(table1, strDivHas, "样品交接", strSampleAccept);
                table1 = GetCommonRow(table1, strDivHas, "分析任务分配", "");
                table1 = GetResultRow(table1, strDivHas, strDivWait, "分析结果录入", dtResult);

                if (dr2.Length > 0)     //结果提交不完全时
                {
                    if (dr5.Length > 0) //流程已到技术室审核环节(最后环节)
                    {
                        table1 = GetCommonRow(table1, strDivWait, "数据审核", "");
                        table1 = GetCommonRow(table1, strDivWait, "分析室主任审核", "");
                        table1 = GetCommonRow(table1, strDivWait, "技术室主任审核", "");
                    }
                    else
                    {
                        if (dr4.Length > 0)//流程仅到分析室审核
                        {
                            table1 = GetCommonRow(table1, strDivWait, "数据审核", "");
                            table1 = GetCommonRow(table1, strDivWait, "分析室主任审核", "");
                        }
                        else
                        {
                            if (dr3.Length > 0)//流程仅到数据审核
                            {
                                table1 = GetCommonRow(table1, strDivWait, "数据审核", "");
                            }
                        }
                    }
                }
                else//结果提交完全时
                {
                    if (dr3.Length > 0)//数据审核不完全
                    {
                        table1 = GetCommonRow(table1, strDivWait, "数据审核", "");
                    }
                    else
                    {
                        table1 = GetCommonRow(table1, strDivHas, "数据审核", "");
                    }
                    if (dr4.Length > 0)//分析审核不完全
                    {
                        table1 = GetCommonRow(table1, strDivWait, "分析室主任审核", "");
                    }
                    else
                    {
                        table1 = GetCommonRow(table1, strDivHas, "分析室主任审核", "");
                    }
                    if (dr5.Length > 0)                                                    //流程已到技术室审核环节(最后环节)
                    {
                        if (objSubTask.TASK_STATUS == "09" && objTask.TASK_STATUS == "09") //分析流程完成
                        {
                            table1 = GetCommonRow(table1, strDivHas, "技术室主任审核", "");
                            TableRow  row  = new TableRow();//委托流程连接
                            TableCell cell = new TableCell();
                            cell.Text = string.Format(strDivHas, "<a href='#' onclick='ShowReport();'>报告流程</a>");
                            row.Cells.Add(cell);
                            table1.Rows.Add(row);
                        }
                        else
                        {
                            table1 = GetCommonRow(table1, strDivWait, "技术室主任审核", "");
                        }
                    }
                }
            }
        }
        this.divSample.Controls.Add(table1);
        #endregion
    }
    /// <summary>
    /// 获得指定职责的默认负责人,如果不存在则取第一个
    /// </summary>
    /// <param name="strDutyType">职责编码</param>
    /// <param name="strMonitorType">监测类别</param>
    /// <returns></returns>
    private DataTable GetDefaultOrFirstDutyUser(string strDutyType, string strMonitorType)
    {
        DataTable dtDuty = new TSysUserDutyLogic().SelectUserDuty(strDutyType, strMonitorType);

        return(dtDuty);
    }