Пример #1
0
        public JsonResult qryRoleItemHis(string roleId, string aplyNo, string authType)
        {
            CodeRoleItemHisDao codeRoleItemHisDao = new CodeRoleItemHisDao();

            try
            {
                List <CodeRoleItemModel> rows = new List <CodeRoleItemModel>();

                rows = codeRoleItemHisDao.qryByAplyNo(aplyNo, authType);

                if (rows.Count == 0)
                {
                    CodeRoleItemDao codeRoleItemDao = new CodeRoleItemDao();
                    rows = codeRoleItemDao.qryForAppr(roleId, authType);
                }

                var jsonData = new { success = true, rows };
                return(Json(jsonData, JsonRequestBehavior.AllowGet));
            }
            catch (Exception e)
            {
                logger.Error("其它錯誤:" + e.ToString());
                return(Json(new { success = false, err = "其它錯誤,請洽系統管理員!!" }));
            }
        }
Пример #2
0
        /// <summary>
        /// 處理角色存取項目異動
        /// </summary>
        /// <param name="roleId"></param>
        /// <param name="aplyNO"></param>
        /// <param name="conn"></param>
        /// <param name="transaction"></param>
        private void procRoleItemHis(string roleId, string aplyNo, SqlConnection conn, SqlTransaction transaction)
        {
            CodeRoleItemHisDao       codeRoleItemHisDao = new CodeRoleItemHisDao();
            List <CodeRoleItemModel> cRoleItemList      = codeRoleItemHisDao.qryByAplyNo(aplyNo, "");

            if (cRoleItemList != null)
            {
                if (cRoleItemList.Count > 0)
                {
                    CodeRoleItemDao codeRoleItemDao = new CodeRoleItemDao();

                    foreach (CodeRoleItemModel d in cRoleItemList)
                    {
                        CODE_ROLE_ITEM dItem = new CODE_ROLE_ITEM();
                        Log            log   = new Log();

                        switch (d.execAction)
                        {
                        case "A":
                            dItem.ROLE_ID         = roleId;
                            dItem.ITEM_ID         = d.itemId;
                            dItem.AUTH_TYPE       = d.authType;
                            dItem.LAST_UPDATE_UID = Session["UserID"].ToString();
                            dItem.LAST_UPDATE_DT  = DateTime.Now;


                            //新增資料
                            codeRoleItemDao.Insert(dItem, conn, transaction);


                            //新增LOG
                            log.CFUNCTION = "角色管理(存取項目)-新增";
                            log.CACTION   = "A";
                            log.CCONTENT  = codeRoleItemDao.logContent(dItem);
                            LogDao.Insert(log, Session["UserID"].ToString());

                            break;

                        case "D":
                            dItem = codeRoleItemDao.getRoleItemByKey(roleId, d.itemId, d.authType);

                            //新增LOG
                            log.CFUNCTION = "角色管理(存取項目)-刪除";
                            log.CACTION   = "D";
                            log.CCONTENT  = codeRoleItemDao.logContent(dItem);
                            LogDao.Insert(log, Session["UserID"].ToString());

                            //刪除資料
                            codeRoleItemDao.Delete(dItem, conn, transaction);

                            break;

                        default:
                            break;
                        }
                    }
                }
            }
        }
Пример #3
0
        public ActionResult updateRole(RoleMgrModel roleMgrModel, String authFunc
                                       , List <CodeRoleEquipModel> equipData, List <CodeRoleItemModel> itemData, List <CodeRoleItemModel> formAplyData)
        {
            string roleId       = StringUtil.toString(roleMgrModel.cRoleID);
            bool   bChgRole     = false;
            bool   bChgFunc     = false;
            bool   bChgEquip    = false;
            bool   bChgItem     = false;
            bool   bChgFormAply = false;
            bool   bNewRole     = false;


            CodeRoleDao codeRoleDao = new CodeRoleDao();
            CODE_ROLE   codeRoleO   = new CODE_ROLE();

            bool bDupRoleName = codeRoleDao.dupRoleName(StringUtil.toString(roleMgrModel.cRoleID),
                                                        StringUtil.toString(roleMgrModel.roleAuthType), StringUtil.toString(roleMgrModel.cRoleName));

            if (bDupRoleName)
            {
                return(Json(new { success = false, errors = "相同角色群組下,不能建置相同的角色名稱!!" }, JsonRequestBehavior.AllowGet));
            }


            //比對是否有異動"角色資訊"
            if ("".Equals(roleId))
            {
                bNewRole = true;
                bChgRole = true;
                SysSeqDao sysSeqDao = new SysSeqDao();

                var cId = sysSeqDao.qrySeqNo("F1", "").ToString();
                roleId = "F1" + cId.ToString().PadLeft(8, '0');
            }
            else
            {
                codeRoleO = codeRoleDao.qryRoleByKey(roleId);
                if (!(
                        StringUtil.toString(roleMgrModel.cRoleName).Equals(StringUtil.toString(codeRoleO.ROLE_NAME)) &&
                        StringUtil.toString(roleMgrModel.isDisabled).Equals(StringUtil.toString(codeRoleO.IS_DISABLED)) &&
                        StringUtil.toString(roleMgrModel.vMemo).Equals(StringUtil.toString(codeRoleO.MEMO))
                        ))
                {
                    bChgRole = true;
                }
            }



            //比對是否有異動"授權功能"
            List <FuncRoleModel> funcList = new List <FuncRoleModel>();

            string[] funcData = authFunc.Split('|');

            if ("F".Equals(roleMgrModel.roleAuthType))
            {
                CodeRoleFunctionDao  CodeRoleFunctionDao = new CodeRoleFunctionDao();
                List <FuncRoleModel> roleFuncListO       = CodeRoleFunctionDao.qryForRoleMgr(roleId);
                foreach (string item in funcData)
                {
                    if (!"".Equals(StringUtil.toString(item)))
                    {
                        FuncRoleModel funcRoleModel = new FuncRoleModel();
                        funcRoleModel.cRoleId     = roleId;
                        funcRoleModel.cFunctionID = item;
                        if (roleFuncListO.Exists(x => x.cFunctionID == item))
                        {
                            funcRoleModel.execAction = "";
                        }

                        else
                        {
                            bChgFunc = true;
                            funcRoleModel.execAction = "A";
                        }
                        funcList.Add(funcRoleModel);
                    }
                }

                foreach (FuncRoleModel oItem in roleFuncListO)
                {
                    if (!funcList.Exists(x => x.cFunctionID == oItem.cFunctionID))
                    {
                        bChgFunc = true;
                        FuncRoleModel funcRoleModel = new FuncRoleModel();
                        funcRoleModel.cRoleId     = roleId;
                        funcRoleModel.cFunctionID = oItem.cFunctionID;
                        funcRoleModel.execAction  = "D";
                        funcList.Add(funcRoleModel);
                    }
                }
            }



            //比對是否有異動"金庫設備權限"
            List <CodeRoleEquipModel> equipList           = new List <CodeRoleEquipModel>();
            CodeRoleTreaItemDao       codeRoleTreaItemDao = new CodeRoleTreaItemDao();

            if ("E".Equals(roleMgrModel.roleAuthType))
            {
                List <CodeRoleEquipModel> roleEquipListO = codeRoleTreaItemDao.qryForRoleMgr(roleId);

                if (equipData != null)
                {
                    foreach (CodeRoleEquipModel item in equipData)
                    {
                        CodeRoleEquipModel codeRoleEquipModel = new CodeRoleEquipModel();
                        codeRoleEquipModel.roleId      = roleId;
                        codeRoleEquipModel.treaEquipId = StringUtil.toString(item.treaEquipId);
                        //codeRoleEquipModel.controlMode = StringUtil.toString(item.controlMode);
                        codeRoleEquipModel.custodyMode   = StringUtil.toString(item.custodyMode);
                        codeRoleEquipModel.custodyOrder  = StringUtil.toString(item.custodyOrder);
                        codeRoleEquipModel.custodyModeB  = "";
                        codeRoleEquipModel.custodyOrderB = "";
                        codeRoleEquipModel.execAction    = "";
                        if (roleEquipListO.Exists(x => x.treaEquipId == item.treaEquipId))
                        {
                            CodeRoleEquipModel itemO = roleEquipListO.Find(x => x.treaEquipId == item.treaEquipId);

                            if (!(
                                    //item.controlMode.Equals(itemO.controlMode) &&
                                    item.custodyMode.Equals(itemO.custodyMode) && item.custodyOrder.Equals(itemO.custodyOrder)))
                            {
                                codeRoleEquipModel.execAction    = "U";
                                codeRoleEquipModel.custodyModeB  = itemO.custodyMode;
                                codeRoleEquipModel.custodyOrderB = itemO.custodyOrder;
                                bChgEquip = true;
                            }
                        }
                        else
                        {
                            codeRoleEquipModel.execAction = "A";
                            bChgEquip = true;
                        }
                        equipList.Add(codeRoleEquipModel);
                    }
                }


                foreach (CodeRoleEquipModel oItem in roleEquipListO)
                {
                    if (equipList != null)
                    {
                        if (!equipList.Exists(x => x.treaEquipId == oItem.treaEquipId))
                        {
                            bChgEquip = true;
                            CodeRoleEquipModel codeRoleEquipModel = new CodeRoleEquipModel();
                            codeRoleEquipModel.roleId       = roleId;
                            codeRoleEquipModel.treaEquipId  = StringUtil.toString(oItem.treaEquipId);
                            codeRoleEquipModel.controlMode  = StringUtil.toString(oItem.controlMode);
                            codeRoleEquipModel.custodyMode  = StringUtil.toString(oItem.custodyMode);
                            codeRoleEquipModel.custodyOrder = StringUtil.toString(oItem.custodyOrder);
                            codeRoleEquipModel.execAction   = "D";
                            equipList.Add(codeRoleEquipModel);
                        }
                    }
                    else
                    {
                        bChgEquip = true;
                        CodeRoleEquipModel codeRoleEquipModel = new CodeRoleEquipModel();
                        codeRoleEquipModel.roleId       = roleId;
                        codeRoleEquipModel.treaEquipId  = StringUtil.toString(oItem.treaEquipId);
                        codeRoleEquipModel.controlMode  = StringUtil.toString(oItem.controlMode);
                        codeRoleEquipModel.custodyMode  = StringUtil.toString(oItem.custodyMode);
                        codeRoleEquipModel.custodyOrder = StringUtil.toString(oItem.custodyOrder);
                        codeRoleEquipModel.execAction   = "D";
                        equipList.Add(codeRoleEquipModel);
                    }
                }
            }


            //比對是否有異動"存取項目權限"
            CodeRoleItemDao          codeRoleItemDao = new CodeRoleItemDao();
            List <CodeRoleItemModel> itemList        = new List <CodeRoleItemModel>();

            if ("I".Equals(roleMgrModel.roleAuthType))
            {
                List <CodeRoleItemModel> itemDataO = codeRoleItemDao.qryForRoleMgr(roleId, "1");

                if (itemData != null)
                {
                    foreach (CodeRoleItemModel item in itemData)
                    {
                        CodeRoleItemModel codeRoleItemModel = new CodeRoleItemModel();
                        codeRoleItemModel.roleId   = roleId;
                        codeRoleItemModel.itemId   = StringUtil.toString(item.itemId);
                        codeRoleItemModel.authType = "1";

                        if (itemDataO.Exists(x => x.itemId == item.itemId))
                        {
                            codeRoleItemModel.execAction = "";
                        }
                        else
                        {
                            bChgItem = true;
                            codeRoleItemModel.execAction = "A";
                        }
                        itemList.Add(codeRoleItemModel);
                    }
                }


                foreach (CodeRoleItemModel oItem in itemDataO)
                {
                    if (itemList != null)
                    {
                        if (!itemList.Exists(x => x.itemId == oItem.itemId))
                        {
                            bChgItem = true;
                            CodeRoleItemModel codeRoleItemModel = new CodeRoleItemModel();
                            codeRoleItemModel.roleId     = roleId;
                            codeRoleItemModel.itemId     = StringUtil.toString(oItem.itemId);
                            codeRoleItemModel.authType   = "1";
                            codeRoleItemModel.execAction = "D";
                            itemList.Add(codeRoleItemModel);
                        }
                    }
                    else
                    {
                        bChgItem = true;
                        CodeRoleItemModel codeRoleItemModel = new CodeRoleItemModel();
                        codeRoleItemModel.roleId     = roleId;
                        codeRoleItemModel.itemId     = StringUtil.toString(oItem.itemId);
                        codeRoleItemModel.authType   = "1";
                        codeRoleItemModel.execAction = "D";
                        itemList.Add(codeRoleItemModel);
                    }
                }
            }



            //比對是否有異動"表單申請權限"

            List <CodeRoleItemModel> formAplyList = new List <CodeRoleItemModel>();

            if ("A".Equals(roleMgrModel.roleAuthType))
            {
                List <CodeRoleItemModel> formAplyDataO = codeRoleItemDao.qryForRoleMgr(roleId, "2");
                if (formAplyData != null)
                {
                    foreach (CodeRoleItemModel item in formAplyData)
                    {
                        CodeRoleItemModel codeRoleItemModel = new CodeRoleItemModel();
                        codeRoleItemModel.roleId   = roleId;
                        codeRoleItemModel.itemId   = StringUtil.toString(item.itemId);
                        codeRoleItemModel.authType = "2";

                        if (formAplyDataO.Exists(x => x.itemId == item.itemId))
                        {
                            codeRoleItemModel.execAction = "";
                        }
                        else
                        {
                            bChgFormAply = true;
                            codeRoleItemModel.execAction = "A";
                        }
                        formAplyList.Add(codeRoleItemModel);
                    }
                }


                foreach (CodeRoleItemModel oItem in formAplyDataO)
                {
                    if (formAplyList != null)
                    {
                        if (!formAplyList.Exists(x => x.itemId == oItem.itemId))
                        {
                            bChgFormAply = true;
                            CodeRoleItemModel codeRoleItemModel = new CodeRoleItemModel();
                            codeRoleItemModel.roleId     = roleId;
                            codeRoleItemModel.itemId     = StringUtil.toString(oItem.itemId);
                            codeRoleItemModel.authType   = "2";
                            codeRoleItemModel.execAction = "D";
                            formAplyList.Add(codeRoleItemModel);
                        }
                    }
                    else
                    {
                        bChgFormAply = true;
                        CodeRoleItemModel codeRoleItemModel = new CodeRoleItemModel();
                        codeRoleItemModel.roleId     = roleId;
                        codeRoleItemModel.itemId     = StringUtil.toString(oItem.itemId);
                        codeRoleItemModel.authType   = "2";
                        codeRoleItemModel.execAction = "D";
                        formAplyList.Add(codeRoleItemModel);
                    }
                }
            }



            if (bChgRole == false && bChgFunc == false && bChgEquip == false && bChgItem == false && bChgFormAply == false)
            {
                return(Json(new { success = false, errors = "未異動畫面資料,將不進行修改覆核作業!!" }, JsonRequestBehavior.AllowGet));
            }



            /*------------------ DB處理   begin------------------*/
            string strConn = DbUtil.GetDBTreasuryConnStr();

            using (SqlConnection conn = new SqlConnection(strConn))
            {
                conn.Open();

                SqlTransaction transaction = conn.BeginTransaction("Transaction");
                try
                {
                    roleMgrModel.cRoleID = roleId;

                    AuthApprDao authApprDao = new AuthApprDao();
                    AUTH_APPR   authAppr    = new AUTH_APPR();
                    authAppr.AUTH_APLY_TYPE   = "R";
                    authAppr.APPR_STATUS      = "1";
                    authAppr.APPR_MAPPING_KEY = roleId;
                    authAppr.CREATE_UID       = Session["UserID"].ToString();


                    //新增"覆核資料檔"
                    string aplyNo = authApprDao.insert(authAppr, conn, transaction);


                    //異動"角色資料檔"覆核狀態
                    if (bNewRole == false)
                    {
                        updateRole(roleMgrModel, codeRoleO, conn, transaction);
                    }


                    //處理角色資料檔的異動
                    if (bChgRole)
                    {
                        //新增"角色資料異動檔"
                        CodeRoleHisDao codeRoleHisDao = new CodeRoleHisDao();
                        CODE_ROLE_HIS  codeRoleHis    = new CODE_ROLE_HIS();
                        codeRoleHis.APLY_NO        = aplyNo;
                        codeRoleHis.ROLE_ID        = StringUtil.toString(roleMgrModel.cRoleID);
                        codeRoleHis.ROLE_NAME      = StringUtil.toString(roleMgrModel.cRoleName);
                        codeRoleHis.ROLE_AUTH_TYPE = StringUtil.toString(roleMgrModel.roleAuthType);
                        codeRoleHis.IS_DISABLED    = StringUtil.toString(roleMgrModel.isDisabled);
                        codeRoleHis.MEMO           = StringUtil.toString(roleMgrModel.vMemo);

                        if (codeRoleO != null)
                        {
                            codeRoleHis.ROLE_NAME_B   = StringUtil.toString(codeRoleO.ROLE_NAME);
                            codeRoleHis.IS_DISABLED_B = StringUtil.toString(codeRoleO.IS_DISABLED);
                            codeRoleHis.MEMO_B        = StringUtil.toString(codeRoleO.MEMO);
                        }
                        else
                        {
                            codeRoleHis.ROLE_NAME_B   = "";
                            codeRoleHis.IS_DISABLED_B = "";
                            codeRoleHis.MEMO_B        = "";
                        }


                        if (bNewRole)
                        {
                            codeRoleHis.EXEC_ACTION = "A";
                        }
                        else
                        {
                            codeRoleHis.EXEC_ACTION = "U";
                        }

                        codeRoleHisDao.insert(codeRoleHis, conn, transaction);
                    }



                    //處理功能角色資料檔的異動
                    if (bChgFunc)
                    {
                        CodeRoleFuncHisDao codeRoleFuncHisDao = new CodeRoleFuncHisDao();
                        foreach (FuncRoleModel func in funcList)
                        {
                            codeRoleFuncHisDao.insert(aplyNo, "Treasury", func, conn, transaction);

                            //if (!"".Equals(func.execAction)) {
                            //    codeRoleFuncHisDao.insert(aplyNo, "Treasury", func, conn, transaction);
                            //}
                        }
                    }


                    //處理角色金庫設備資料檔的異動
                    if (bChgEquip)
                    {
                        CodeRoleTreaItemHisDao codeRoleTreaItemHisDao = new CodeRoleTreaItemHisDao();
                        foreach (CodeRoleEquipModel equip in equipList)
                        {
                            codeRoleTreaItemHisDao.insert(aplyNo, equip, conn, transaction);
                            //if (!"".Equals(equip.execAction))
                            //{
                            //    codeRoleTreaItemHisDao.insert(aplyNo, equip, conn, transaction);
                            //}
                        }
                    }


                    //處理角色存取項目資料檔的異動(存取項目)
                    if (bChgItem)
                    {
                        CodeRoleItemHisDao codeRoleItemHisDao = new CodeRoleItemHisDao();
                        foreach (CodeRoleItemModel item in itemList)
                        {
                            codeRoleItemHisDao.insert(aplyNo, item, conn, transaction);
                            //if (!"".Equals(item.execAction))
                            //{
                            //    codeRoleItemHisDao.insert(aplyNo, item, conn, transaction);
                            //}
                        }
                    }


                    //處理角色存取項目資料檔的異動(表單申請)
                    if (bChgFormAply)
                    {
                        CodeRoleItemHisDao codeRoleItemHisDao = new CodeRoleItemHisDao();
                        foreach (CodeRoleItemModel item in formAplyList)
                        {
                            codeRoleItemHisDao.insert(aplyNo, item, conn, transaction);
                            //if (!"".Equals(item.execAction))
                            //{
                            //    codeRoleItemHisDao.insert(aplyNo, item, conn, transaction);
                            //}
                        }
                    }


                    transaction.Commit();

                    /*------------------ DB處理   end------------------*/
                    return(Json(new { success = true, aplyNo = aplyNo }));
                }
                catch (Exception e)
                {
                    transaction.Rollback();
                    logger.Error("[updateRole]其它錯誤:" + e.ToString());

                    return(Json(new { success = false, errors = "其它錯誤,請洽系統管理員!!" }, JsonRequestBehavior.AllowGet));
                }
            }
        }
Пример #4
0
        public ActionResult qryRoleHisData(string cRoleID, string apprStatus, string updDateB, string updDateE)
        {
            if ("".Equals(StringUtil.toString(cRoleID)))
            {
                return(Json(new { success = false, err = "角色代號未輸入!!" }));
            }

            SysCodeDao sysCodeDao = new SysCodeDao();
            Dictionary <string, string> dicExecAction = sysCodeDao.qryByTypeDic("EXEC_ACTION");
            Dictionary <string, string> dicYNFlag     = sysCodeDao.qryByTypeDic("YN_FLAG");
            Dictionary <string, string> dicApprStatus = sysCodeDao.qryByTypeDic("APPR_STATUS");
            Dictionary <string, string> dicIsDisabled = sysCodeDao.qryByTypeDic("IS_DISABLED");


            List <CodeRoleModel>      roleHisList         = new List <CodeRoleModel>();
            List <RoleFuncHisModel>   roleFuncHisList     = new List <RoleFuncHisModel>();
            List <CodeRoleEquipModel> roleEquipHisList    = new List <CodeRoleEquipModel>();
            List <CodeRoleItemModel>  roleRoleItemHisList = new List <CodeRoleItemModel>();

            List <CodeRoleItemModel> roleItemHisList     = new List <CodeRoleItemModel>();
            List <CodeRoleItemModel> roleFormAplyHisList = new List <CodeRoleItemModel>();

            CodeRoleHisDao         codeRoleHisDao         = new CodeRoleHisDao();
            CodeRoleFuncHisDao     codeRoleFuncHisDao     = new CodeRoleFuncHisDao();
            CodeRoleTreaItemHisDao codeRoleTreaItemHisDao = new CodeRoleTreaItemHisDao();
            CodeRoleItemHisDao     codeRoleItemHisDao     = new CodeRoleItemHisDao();

            try
            {
                using (new TransactionScope(
                           TransactionScopeOption.Required,
                           new TransactionOptions
                {
                    IsolationLevel = System.Transactions.IsolationLevel.ReadUncommitted
                }))
                {
                    using (dbTreasuryEntities db = new dbTreasuryEntities())
                    {
                        roleHisList = codeRoleHisDao.qryForRoleMgrHis(db, cRoleID, apprStatus, updDateB, updDateE);

                        roleFuncHisList = codeRoleFuncHisDao.qryForRoleMgrHis(db, cRoleID, apprStatus, updDateB, updDateE);

                        roleEquipHisList = codeRoleTreaItemHisDao.qryForRoleMgrHis(db, cRoleID, apprStatus, updDateB, updDateE);

                        roleRoleItemHisList = codeRoleItemHisDao.qryForRoleMgrHis(db, cRoleID, apprStatus, updDateB, updDateE);
                    }
                }


                using (DB_INTRAEntities dbIntra = new DB_INTRAEntities())
                {
                    Dictionary <string, string> userNameMap = new Dictionary <string, string>();
                    OaEmpDao oaEmpDao = new OaEmpDao();
                    string   apprUid  = "";
                    string   userId   = "";


                    //處理角色資訊人員&代碼
                    if (roleHisList != null)
                    {
                        foreach (CodeRoleModel role in roleHisList)
                        {
                            role.execActionDesc = dicExecAction.ContainsKey(StringUtil.toString(role.execAction)) ? dicExecAction[StringUtil.toString(role.execAction)]:"";
                            role.apprStatusDesc = dicApprStatus.ContainsKey(StringUtil.toString(role.apprStatus)) ? dicApprStatus[StringUtil.toString(role.apprStatus)]:"";

                            role.isDisabledDesc  = dicIsDisabled.ContainsKey(StringUtil.toString(role.isDisabled)) ? dicIsDisabled[StringUtil.toString(role.isDisabled)]:"";
                            role.isDisabledDescB = dicIsDisabled.ContainsKey(StringUtil.toString(role.isDisabledB)) ?  dicIsDisabled[StringUtil.toString(role.isDisabledB)]:"";

                            userId = StringUtil.toString(role.updateUid);
                            if (!"".Equals(userId))
                            {
                                if (!userNameMap.ContainsKey(userId))
                                {
                                    userNameMap = oaEmpDao.qryUsrName(userNameMap, userId, dbIntra);
                                }
                                role.updateUid = userNameMap[userId];
                            }

                            apprUid = StringUtil.toString(role.apprUid);
                            if (!"".Equals(apprUid))
                            {
                                if (!userNameMap.ContainsKey(apprUid))
                                {
                                    userNameMap = oaEmpDao.qryUsrName(userNameMap, apprUid, dbIntra);
                                }
                                role.apprUid = userNameMap[apprUid];
                            }
                        }
                    }


                    //處理授權功能人員&代碼
                    if (roleFuncHisList != null)
                    {
                        foreach (RoleFuncHisModel d in roleFuncHisList)
                        {
                            d.execActionDesc = dicExecAction.ContainsKey(StringUtil.toString(d.execAction)) ? dicExecAction[StringUtil.toString(d.execAction)] : "";
                            d.apprStatusDesc = dicApprStatus.ContainsKey(StringUtil.toString(d.apprStatus)) ? dicApprStatus[StringUtil.toString(d.apprStatus)] : "";

                            userId = StringUtil.toString(d.updateUid);
                            if (!"".Equals(userId))
                            {
                                if (!userNameMap.ContainsKey(userId))
                                {
                                    userNameMap = oaEmpDao.qryUsrName(userNameMap, userId, dbIntra);
                                }
                                d.updateUid = userNameMap[userId];
                            }

                            apprUid = StringUtil.toString(d.apprUid);
                            if (!"".Equals(apprUid))
                            {
                                if (!userNameMap.ContainsKey(apprUid))
                                {
                                    userNameMap = oaEmpDao.qryUsrName(userNameMap, apprUid, dbIntra);
                                }
                                d.apprUid = userNameMap[apprUid];
                            }
                        }
                    }


                    //處理金庫設備人員&代碼
                    if (roleEquipHisList != null)
                    {
                        foreach (CodeRoleEquipModel d in roleEquipHisList)
                        {
                            d.execActionDesc = dicExecAction.ContainsKey(StringUtil.toString(d.execAction)) ? dicExecAction[StringUtil.toString(d.execAction)] : "";
                            d.apprStatusDesc = dicApprStatus.ContainsKey(StringUtil.toString(d.apprStatus)) ? dicApprStatus[StringUtil.toString(d.apprStatus)] : "";

                            userId = StringUtil.toString(d.updateUid);
                            if (!"".Equals(userId))
                            {
                                if (!userNameMap.ContainsKey(userId))
                                {
                                    userNameMap = oaEmpDao.qryUsrName(userNameMap, userId, dbIntra);
                                }
                                d.updateUid = userNameMap[userId];
                            }

                            apprUid = StringUtil.toString(d.apprUid);
                            if (!"".Equals(apprUid))
                            {
                                if (!userNameMap.ContainsKey(apprUid))
                                {
                                    userNameMap = oaEmpDao.qryUsrName(userNameMap, apprUid, dbIntra);
                                }
                                d.apprUid = userNameMap[apprUid];
                            }
                        }
                    }


                    //處理"存取項目/表單申請"人員&代碼
                    if (roleRoleItemHisList != null)
                    {
                        foreach (CodeRoleItemModel d in roleRoleItemHisList)
                        {
                            d.execActionDesc = dicExecAction.ContainsKey(StringUtil.toString(d.execAction)) ? dicExecAction[StringUtil.toString(d.execAction)] : "";
                            d.apprStatusDesc = dicApprStatus.ContainsKey(StringUtil.toString(d.apprStatus)) ? dicApprStatus[StringUtil.toString(d.apprStatus)] : "";

                            userId = StringUtil.toString(d.updateUid);
                            if (!"".Equals(userId))
                            {
                                if (!userNameMap.ContainsKey(userId))
                                {
                                    userNameMap = oaEmpDao.qryUsrName(userNameMap, userId, dbIntra);
                                }
                                d.updateUid = userNameMap[userId];
                            }

                            apprUid = StringUtil.toString(d.apprUid);
                            if (!"".Equals(apprUid))
                            {
                                if (!userNameMap.ContainsKey(apprUid))
                                {
                                    userNameMap = oaEmpDao.qryUsrName(userNameMap, apprUid, dbIntra);
                                }
                                d.apprUid = userNameMap[apprUid];
                            }
                        }


                        roleItemHisList     = roleRoleItemHisList.Where(x => x.authType == "1").ToList();
                        roleFormAplyHisList = roleRoleItemHisList.Where(x => x.authType == "2").ToList();
                    }
                }
                return(Json(new { success = true, roleHisList = roleHisList, roleFuncHisList = roleFuncHisList, roleEquipHisList = roleEquipHisList
                                  ,
                                  roleItemHisList = roleItemHisList,
                                  roleFormAplyHisList = roleFormAplyHisList }));
            }
            catch (Exception e)
            {
                logger.Error("[qryEquip]:" + e.ToString());
                return(Json(new { success = false, err = "其它錯誤,請洽系統管理員!!" }));
            }
        }