コード例 #1
0
        public object getDelayItems([FromBody] JObject json)
        {
            try
            {
                string  res    = json.Value <string>("json");
                dynamic dy     = JsonConvert.DeserializeObject <ExpandoObject>(res);
                string  userId = dy.userid;
                //获取用户基本信息
                OperatorProvider.AppUserId = userId;  //设置当前用户
                Operator user = OperatorProvider.Provider.Current();

                int safechecknum              = 0; //待执行的安全检查数
                int appoveproblemnum          = 0; //待评估隐患数
                int changeplanproblemnum      = 0; //待制定整改计划
                int modifyproblemnum          = 0; //待整改隐患数
                int modifypostphoneproblemnum = 0; //待审(核)批整改延期隐患数
                int reviewproblemnum          = 0; //待复查验收的隐患数
                int assessproblemnum          = 0; //待评估隐患数
                int overtimempnum             = 0; //逾期未整改隐患
                int uploadHtNum     = 0;           //我上传的隐患
                int planNum         = 0;           //进行中的风险辨识计划数
                int dailyexamineNum = 0;           //日常考核待审核数


                RiskPlanBLL planBll = new RiskPlanBLL();
                planNum = planBll.GetPlanCount(user, 10);
                SaftyCheckDataBLL saftbll    = new SaftyCheckDataBLL();
                int[]             countcheck = saftbll.GetCheckCount(user, 0);
                safechecknum = countcheck.Sum();
                DailyexamineBLL dailyexaminebll = new DailyexamineBLL();
                dailyexamineNum = dailyexaminebll.CountIndex(user);

                int awaitHtNum = 0;//待完善的隐患数量
                //隐患待办事项
                var data = new HTBaseInfoBLL().QueryHidBacklogRecord("0", user.UserId);
                if (data.Rows.Count == 8)
                {
                    appoveproblemnum          = int.Parse(data.Rows[0]["pnum"].ToString());
                    changeplanproblemnum      = int.Parse(data.Rows[7]["pnum"].ToString());
                    modifyproblemnum          = int.Parse(data.Rows[1]["pnum"].ToString());
                    modifypostphoneproblemnum = int.Parse(data.Rows[2]["pnum"].ToString());
                    reviewproblemnum          = int.Parse(data.Rows[3]["pnum"].ToString());
                    assessproblemnum          = int.Parse(data.Rows[4]["pnum"].ToString());
                    awaitHtNum = int.Parse(data.Rows[5]["pnum"].ToString());
                }

                var datas = new HTBaseInfoBLL().QueryHidBacklogRecord("10", user.UserId);
                if (datas.Rows.Count == 2)
                {
                    if (datas.Rows[0]["serialnumber"].ToString() == "1")
                    {
                        uploadHtNum = int.Parse(datas.Rows[0]["pnum"].ToString());
                    }
                    if (datas.Rows[1]["serialnumber"].ToString() == "2")
                    {
                        overtimempnum = int.Parse(datas.Rows[1]["pnum"].ToString());
                    }
                }
                DesktopBLL desktop              = new DesktopBLL();
                List <int> list                 = desktop.GetHtNum(user);
                int        htNum                = list[0]; //隐患数量
                int        bigHtNum             = list[1]; //重大隐患数量
                int        overdueHtCompleteNum = list[3]; //整改延期数量

                list = desktop.GetRiskNum(user);
                int bigRiskNum = list[1];//重大风险数量

                list = desktop.GetWorkNum(user);
                int waitconfirmationnum  = list[0]; //高风险通用待确认作业数量
                int waitapproveworknum   = list[1]; //高风险通用待审核(批)作业数量
                int monitordangerworknum = list[5]; //高风险待监督的数量
                int sidetaskallocation   = list[2]; //高风险待分配任务
                int sidesupervisionnum   = list[6]; //高风险待监管任务
                int dangerworknum        = list[3]; //高风险作业数量

                list = desktop.GetScaffoldNum(user);
                int waitscaffoldchecknum = list[0]; //脚手架待验收
                int waitscaffoldauditnum = list[1]; //脚手架待审核


                int specialEquNum    = desktop.GetEquimentNum(user); //特种设备数量
                int dangerProjectNum = desktop.GetProjectNum(user);  //施工中的危大工程数量

                list = desktop.GetlllegalNum(user);
                int     illegalNum           = list[0];                       //违章数量
                int     approveillegalnum    = list[1];                       //待核准的违章数量
                int     verifyillegalnum     = list[2];                       //待整改的违章数量
                int     reviewillegalnum     = list[3];                       //待验收的违章数量
                int     overdueIllegalNum    = list[4];                       //逾期未整改违章数量
                decimal illegalCompleteRatio = desktop.GetlllegalRatio(user); //违章整改率



                int meetnum = desktop.GetMeetNum(user.UserId);               //安全会议数量

                int safetynum    = desktop.GetSafetyChangeNum(user);         //安全设施变动审待核数量
                int risktrainnum = 0;                                        //风险预知训练

                list = new OutprojectblacklistBLL().ToAuditOutPeoject(user); //外包工程
                int wbscla = list[2];                                        //待审(核)批三措两案
                int wbrcsq = list[5];                                        //待审(核)批入厂许可
                int wbkgsq = list[6];                                        //待审(核)批开工申请
                //data.Add("WBDWZZ", wb[0]);//单位资质
                //data.Add("WBRYZZ", wb[1]);//人员资质
                //data.Add("WBSCLA", wb[2]);//三措两案
                //data.Add("WBDDSB", wb[3]);//特种设备
                //data.Add("WBTZSB", wb[4]);//电动设备
                //data.Add("WBRCSQ", wb[5]);//入场许可
                //data.Add("WBKGSQ", wb[6]);//开工申请


                return(new
                {
                    Code = 0,
                    Count = -1,
                    Info = "获取数据成功",
                    data = new
                    {
                        safeCheckNum = safechecknum,                 //安全检查数
                        meetNum = meetnum,                           ///安全会议数量
                        modifyProblemNum = modifyproblemnum,         //待整改隐患
                        appoveProblemNum = appoveproblemnum,         //待评估隐患
                        changeplanProblemNum = changeplanproblemnum, //待制定整改计划
                        reviewProblemNum = reviewproblemnum,         //待复查验收的隐患数
                        delayProblemNum = modifypostphoneproblemnum, //待审(核)批整改延期隐患数
                        assessProblemNum = assessproblemnum,         //待整改效果评估隐患
                        assessPlanNum = planNum,                     //待辨识的计划

                        dangerWorkNum = dangerworknum,               //高风险作业数量
                        monitorDangerworkNum = monitordangerworknum, //高风险作业监督数量
                        waitConfirmationNum = waitconfirmationnum,   //高风险通用待确认作业数量
                        waitApproveWorkNum = waitapproveworknum,     //高风险通用待审核(批)作业数量
                        sidetaskallocation = sidetaskallocation,     //待分配
                        sidesupervisionnum = sidesupervisionnum,     //待监管

                        waitscaffoldcheckNum = waitscaffoldchecknum, //脚手架待验收
                        waitscaffoldauditNum = waitscaffoldauditnum, //脚手架待审核

                        dangerTrainNum = risktrainnum,               //风险预知训练
                        approveIllegalNum = approveillegalnum,       //待核准的违章数量
                        verifyIllegalNum = verifyillegalnum,         //待整改的违章数量
                        reviewIllegalNum = reviewillegalnum,         //待验收的违章数量


                        htNum = htNum,                               //隐患数量
                        bigHtNum = bigHtNum,                         //重大隐患数量
                        overdueHtNum = overtimempnum,                //逾期未整改隐患数量
                        bigRiskNum = bigRiskNum,                     //重大风险数量
                        specialEquNum = specialEquNum,               //特种设备数量
                        dangerProjectNum = dangerProjectNum,         //施工中的危大工程数量
                        overdueIllegalNum = overdueIllegalNum,       //逾期未整改违章数量
                        illegalCompleteRatio = illegalCompleteRatio, //违章整改率
                        illegalNum = illegalNum,                     //违章数量
                        overdueHtCompleteNum = overdueHtCompleteNum, //整改延期隐患数量
                        uploadHtNum = uploadHtNum,                   //我上传隐患数量
                        safetynum = safetynum,                       //安全设施变动审待核数量
                        awaitHtNum = awaitHtNum,                     //待完善的隐患数量
                        wbsclaNum = wbscla,
                        wbrcsqNum = wbrcsq,
                        wbkgsqNum = wbkgsq,
                        dailyexamineNum = dailyexamineNum
                    }
                });
            }
            catch (Exception ex)
            {
                return(new { Code = -1, Count = 0, Info = ex.Message });
            }
        }