コード例 #1
0
        public string GetDateNote(DateTime time, string state)
        {
            Operator user = OperatorProvider.Provider.Current();

            if (state == "1")
            {
                List <SafeNoteEntity> noteList = safenotebll.GetList().Where(x => (x.Time.Value.ToString("yyyy-MM-dd") == time.ToString("yyyy-MM-dd") && x.CreateUserId == user.UserId)).ToList();
                DataTable             dt       = new DesktopBLL().GetWorkInfoByTime(user, time.ToString("yyyy-MM-dd"));
                foreach (DataRow dr in dt.Rows)
                {
                    SafeNoteEntity enity = new SafeNoteEntity
                    {
                        Id    = dr[0].ToString(),
                        Time  = time,
                        Value = dr[1].ToString(),
                        Type  = dr[2].ToString()
                    };
                    noteList.Add(enity);
                }
                return(Newtonsoft.Json.JsonConvert.SerializeObject(noteList));
            }
            else
            {
                var date = safenotebll.GetList().Where(x => x.CreateUserId == user.UserId).ToList().Select(x => new
                {
                    Type  = x.Type,
                    Time  = x.Time.Value.Month >= 10 ? (x.Time.Value.Day >= 10 ? x.Time.Value.ToString("yyyy-MM-dd") : x.Time.Value.ToString("yyyy-M-d")) : (x.Time.Value.Day < 10 ? x.Time.Value.ToString("yyyy-M-d") : x.Time.Value.ToString("yyyy-M-dd")),
                    Value = x.Value
                });
                return(Newtonsoft.Json.JsonConvert.SerializeObject(date));
            }
        }
コード例 #2
0
ファイル: tableMain.aspx.cs プロジェクト: zxl881203/src
    protected void btndel_Click(object sender, EventArgs e)
    {
        DesktopBLL desktopBLL = new DesktopBLL();

        using (SqlConnection sqlConnection = new SqlConnection(SqlHelper.ConnectionString))
        {
            sqlConnection.Open();
            SqlTransaction sqlTransaction = sqlConnection.BeginTransaction();
            desktopBLL.DeleteModel(base.UserCode, this.hdnmkid.Value.ToString(), sqlTransaction);
            sqlTransaction.Commit();
        }
        this.tblData_Draw();
    }
コード例 #3
0
        public ActionResult GetListJson(Pagination pagination, string queryJson, int mode = 0)
        {
            Operator user = OperatorProvider.Provider.Current();

            try
            {
                if (mode == 1)
                {
                    DesktopBLL    deskBll = new DesktopBLL();
                    List <string> list    = deskBll.GetThreeCount(user);
                    string        ids     = string.Join(",", list);
                    pagination.p_kid         = "t.ID";
                    pagination.p_fields      = string.Format("status,isover,issumbit,t.CreateUserId,t.useraccount,belongdept,applysno,t.applytype,t.createusername,t.createtime,flowname,t.createuserdeptid,checkroleid,'{0}' checkdeptid", user.DeptId);
                    pagination.p_tablename   = string.Format("BIS_THREEPEOPLECHECK t left join bis_manypowercheck c on t.nodeid=c.id");
                    pagination.conditionJson = string.Format("t.id in('{0}')", ids.Replace(",", "','"));
                }
                else
                {
                    pagination.p_kid         = "t.ID";
                    pagination.p_fields      = "t.status,t.isover,issumbit,t.CreateUserId,t.useraccount,t.belongdept,t.applysno,t.applytype,t.createusername,t.createtime,c.flowname,t.createuserdeptid,c.checkdeptid,c.checkroleid";
                    pagination.p_tablename   = "BIS_THREEPEOPLECHECK t left join bis_manypowercheck c on t.nodeid=c.id";
                    pagination.conditionJson = "1=1";
                    string where             = new AuthorizeBLL().GetModuleDataAuthority(ERCHTMS.Code.OperatorProvider.Provider.Current(), HttpContext.Request.Cookies["currentmoduleId"].Value, "t.createuserdeptcode", "t.createuserorgcode");
                    if (!string.IsNullOrEmpty(where))
                    {
                        pagination.conditionJson += " and " + where;
                    }
                }
                var       watch    = CommonHelper.TimerStart();
                DataTable data     = threepeoplecheckbll.GetPageList(pagination, queryJson);
                var       JsonData = new
                {
                    rows     = data,
                    total    = pagination.total,
                    page     = pagination.page,
                    records  = pagination.records,
                    costtime = CommonHelper.TimerEnd(watch)
                };
                return(Content(JsonData.ToJson()));
            }
            catch (Exception ex)
            {
                return(Error(ex.Message));
            }
        }
コード例 #4
0
ファイル: UserSet.aspx.cs プロジェクト: zxl881203/src
    public void GetModel(string userCode)
    {
        DesktopBLL desktopBLL = new DesktopBLL();
        DataTable  userSet    = desktopBLL.GetUserSet(base.UserCode, base.Request["deskwidth"].ToString());

        if (userSet.Rows.Count > 0)
        {
            if (userSet.Rows[0]["userCode"] != null && userSet.Rows[0]["userCode"].ToString() != "")
            {
                this.usercode = userSet.Rows[0]["userCode"].ToString();
            }
            if (userSet.Rows[0]["GirdColNum"] != null && userSet.Rows[0]["GirdColNum"].ToString() != "")
            {
                this.GirdColNum.Items.FindByValue(userSet.Rows[0]["GirdColNum"].ToString()).Selected = true;
            }
            if (userSet.Rows[0]["RowInGrid"] != null && userSet.Rows[0]["RowInGrid"].ToString() != "")
            {
                this.RowInGrid.Items.FindByValue(userSet.Rows[0]["RowInGrid"].ToString()).Selected = true;
            }
            if (userSet.Rows[0]["GirdWidth"] != null && userSet.Rows[0]["GirdWidth"].ToString() != "")
            {
                this.GirdWidth.Items.FindByValue(userSet.Rows[0]["GirdWidth"].ToString()).Selected = true;
            }
            if (userSet.Rows[0]["ColGapWidth"] != null && userSet.Rows[0]["ColGapWidth"].ToString() != "")
            {
                this.ColGapWidth.Items.FindByValue(userSet.Rows[0]["ColGapWidth"].ToString()).Selected = true;
            }
            if (userSet.Rows[0]["RowGapWidth"] != null && userSet.Rows[0]["RowGapWidth"].ToString() != "")
            {
                this.RowGapWidth.Items.FindByValue(userSet.Rows[0]["RowGapWidth"].ToString()).Selected = true;
            }
            if (userSet.Rows[0]["HideNullGrid"] != null && userSet.Rows[0]["HideNullGrid"].ToString() != "")
            {
                if (userSet.Rows[0]["HideNullGrid"].ToString() == "y")
                {
                    this.CheckBox1.Checked = true;
                    return;
                }
                this.CheckBox1.Checked = false;
            }
        }
    }
コード例 #5
0
        public void Down(string keyValue)
        {
            DesktopBLL dbll = new DesktopBLL();
            bool       flag = dbll.IsGeneric();
            //查询数据
            var           entity = bulletinbll.GetEntity(keyValue);
            DepartmentBLL orgbll = new DepartmentBLL();
            var           org    = orgbll.GetEntity(ERCHTMS.Code.OperatorProvider.Provider.Current().OrganizeId);

            //数据合并
            string[] text = new string[] { "SGHSJLX", "ORGNAME", "ORGADDRESS", "ORGTEL", "HAPPENTIME",
                                           "AREANAME",
                                           "SGTYPENAME",
                                           "SGLEVELNAME", "JYJG", "SWNUM", "SZNUM", "ZSNUM", "SHQKSHJE", "TDQK", "CBYY", "HFQK", "DEPARTMENTNAME", "SGKBUSERNAME", "MOBILE" };
            string[] value;
            var      tempPath   = Server.MapPath("~/Resource/Temp/电力事故(事件)即时报告单.doc");
            var      outputPath = Server.MapPath("~/Resource/ExcelTemplate/电力事故(事件)即时报告单.doc");

            //是否是通用行业版
            if (flag)
            {
                value = new string[] {
                    (entity.SGTYPENAME.Contains("事故") ? "事故报告 √            事件报告 □" : " 事故报告 □            事件报告 √"),
                    org.FullName,
                    "",
                    org.OuterPhone,
                    entity.HAPPENTIME.Value.ToString(),
                    entity.AREANAME,
                    entity.RSSHSGTYPENAME,
                    entity.SGLEVELNAME,
                    entity.JYJG,
                    entity.SWNUM.ToString(),
                    entity.SZNUM.ToString(),
                    entity.ZSNUM.ToString(),
                    entity.SHQKSHJE.ToString(),
                    entity.TDQK,
                    entity.CBYY,
                    entity.HFQK,
                    entity.DEPARTMENTNAME,
                    entity.SGKBUSERNAME,
                    entity.MOBILE
                };
                tempPath   = Server.MapPath("~/Resource/Temp/事故(事件)即时报告单.doc");
                outputPath = Server.MapPath("~/Resource/ExcelTemplate/事故(事件)即时报告单.doc");
            }
            else
            {
                value = new string[] {
                    (entity.SGTYPENAME.Contains("事故") ? "事故报告 √            事件报告 □" : " 事故报告 □            事件报告 √"),
                    org.FullName,
                    "",
                    org.OuterPhone,
                    entity.HAPPENTIME.Value.ToString(),
                    entity.AREANAME,
                    entity.SGTYPENAME,
                    entity.SGLEVELNAME,
                    entity.JYJG,
                    entity.SWNUM.ToString(),
                    entity.SZNUM.ToString(),
                    entity.ZSNUM.ToString(),
                    entity.SHQKSHJE.ToString(),
                    entity.TDQK,
                    entity.CBYY,
                    entity.HFQK,
                    entity.DEPARTMENTNAME,
                    entity.SGKBUSERNAME,
                    entity.MOBILE
                };
            }



            Aspose.Words.Document doc = new Aspose.Words.Document(tempPath);
            //数据合并
            doc.MailMerge.Execute(text, value);
            doc.Save(outputPath);
            //调用导出方法
            var docStream = new MemoryStream();

            doc.Save(docStream, SaveOptions.CreateSaveOptions(Aspose.Words.SaveFormat.Doc));
            Response.ContentType = "application/msword";
            if (flag)
            {
                Response.AddHeader("content-disposition", "attachment;filename=事故(事件)即时报告单.doc");
            }
            else
            {
                Response.AddHeader("content-disposition", "attachment;filename=电力事故(事件)即时报告单.doc");
            }

            Response.BinaryWrite(docStream.ToArray());
            Response.End();
        }
コード例 #6
0
        public object getHomeWarning([FromBody] JObject json)
        {
            string  res    = json.Value <string>("json");
            dynamic dy     = JsonConvert.DeserializeObject <ExpandoObject>(res);
            string  userId = dy.userid;

            //获取用户基本信息
            OperatorProvider.AppUserId = userId;  //设置当前用户
            Operator user = OperatorProvider.Provider.Current();

            DesktopBLL desktopbll                = new DesktopBLL();
            RiskBLL    riskBLL                   = new RiskBLL();                 //安全风险
            SaftyCheckDataRecordBLL     saBLL    = new SaftyCheckDataRecordBLL(); //安全检查
            HTBaseInfoBLL               htBLL    = new HTBaseInfoBLL();           //事故隐患
            ClassificationBLL           classBLL = new ClassificationBLL();
            DataItemDetailBLL           itemBLL  = new DataItemDetailBLL();
            List <ClassificationEntity> list     = classBLL.GetList(user.OrganizeId).ToList();

            if (list.Count == 0)
            {
                list = classBLL.GetList("0").ToList();
            }
            decimal totalScore     = 0;
            decimal yhscore        = 0;
            decimal aqjcscore      = 0;
            decimal aqfxscore      = 0;
            decimal yhzlstardard   = 0;
            decimal aqjcstardard   = 0;
            decimal aqfxstardard   = 0;
            decimal qualifiedscore = 0;

            decimal yhscore1   = 0;
            decimal aqjcscore1 = 0;
            decimal aqfxscore1 = 0;

            string val   = itemBLL.GetItemValue("基础预警区间分值设置");
            int    count = 0;

            if (user.RoleName.Contains("省级"))
            {
                DataTable dtDepts = new DepartmentBLL().GetAllFactory(user);
                foreach (DataRow dr in dtDepts.Rows)
                {
                    user = new Operator
                    {
                        OrganizeId   = dr[2].ToString(),
                        OrganizeCode = dr[0].ToString(),
                    };
                    totalScore += desktopbll.GetScore(user, "");


                    //计算事故隐患总得分
                    decimal score = htBLL.GetHiddenWarning(user, "");
                    totalScore   += score * decimal.Parse(list[0].WeightCoeffcient);
                    yhscore1     += score * decimal.Parse(list[0].WeightCoeffcient);
                    yhzlstardard += score;
                    //计算安全检查总得分
                    score         = saBLL.GetSafeCheckSumCount(user);
                    totalScore   += score * decimal.Parse(list[1].WeightCoeffcient);
                    aqjcscore1   += score * decimal.Parse(list[1].WeightCoeffcient);
                    aqjcstardard += score;
                    //计算安全风险总得分
                    score         = riskBLL.GetRiskValueByTime(user, "");
                    totalScore   += score * decimal.Parse(list[2].WeightCoeffcient);
                    aqfxscore1   += score * decimal.Parse(list[2].WeightCoeffcient);
                    aqfxstardard += score;
                }

                totalScore = totalScore / dtDepts.Rows.Count;
                yhscore    = yhscore1 / dtDepts.Rows.Count;
                aqjcscore  = aqjcscore1 / dtDepts.Rows.Count;
                aqfxscore  = aqfxscore1 / dtDepts.Rows.Count;

                yhzlstardard = yhzlstardard / dtDepts.Rows.Count;
                aqjcstardard = aqjcstardard / dtDepts.Rows.Count;
                aqfxstardard = aqfxstardard / dtDepts.Rows.Count;
            }
            else
            {
                //计算事故隐患总得分
                decimal score = htBLL.GetHiddenWarning(user, "");
                totalScore   = score * decimal.Parse(list[0].WeightCoeffcient);
                yhscore      = score * decimal.Parse(list[0].WeightCoeffcient);
                yhzlstardard = score;
                //计算安全检查总得分
                score        = saBLL.GetSafeCheckSumCount(user);
                totalScore  += score * decimal.Parse(list[1].WeightCoeffcient);
                aqjcscore    = score * decimal.Parse(list[1].WeightCoeffcient);
                aqjcstardard = score;
                //计算安全风险总得分
                score        = riskBLL.GetRiskValueByTime(user, "");
                totalScore  += score * decimal.Parse(list[2].WeightCoeffcient);
                aqfxscore    = score * decimal.Parse(list[2].WeightCoeffcient);
                aqfxstardard = score;
            }
            count = 0;
            if (!string.IsNullOrEmpty(val))
            {
                string[] arr = val.Split('|');
                int      j   = 0;
                foreach (string str in arr)
                {
                    string[] arrVal = str.Split(',');

                    if (totalScore > decimal.Parse(arrVal[0]) && totalScore <= decimal.Parse(arrVal[1]))
                    {
                        count = j;
                        break;
                    }
                    j++;
                }
                qualifiedscore = decimal.Parse(arr[2].Split(',')[0].ToString());
            }
            string warningtext = string.Empty;

            switch (count)
            {
            case 0:
                warningtext = "危险";
                break;

            case 1:
                warningtext = "较危险";
                break;

            case 2:
                warningtext = "较安全";
                break;

            case 3:
                warningtext = "安全";
                break;
            }
            bool isyhzlsucess = Math.Round(yhzlstardard, 1) >= qualifiedscore ? true : false;
            bool isaqjcsucess = Math.Round(aqjcstardard, 1) >= qualifiedscore ? true : false;
            bool isaqfxsucess = Math.Round(aqfxstardard, 1) >= qualifiedscore ? true : false;

            return(new { code = 0, data = new { score = Math.Round(totalScore, 1), yhscore = Math.Round(yhscore, 1), aqjcscore = Math.Round(aqjcscore, 1), aqfxscore = Math.Round(aqfxscore, 1), index = count, warningtext = warningtext, isyhzlsucess = isyhzlsucess, isaqjcsucess = isaqjcsucess, isaqfxsucess = isaqfxsucess }, count = 0 });
        }
コード例 #7
0
        public object GetIndexTarget([FromBody] JObject json)
        {
            try
            {
                string  res    = json.Value <string>("json");
                dynamic dy     = JsonConvert.DeserializeObject <ExpandoObject>(res);
                string  userId = dy.userid;
                //获取用户基本信息
                OperatorProvider.AppUserId = userId;  //设置当前用户
                Operator currUser = OperatorProvider.Provider.Current();
                if (null == currUser)
                {
                    return(new { code = -1, count = 0, info = "请求失败,请登录!" });
                }
                //int pageSize = res.Contains("pagesize") ? int.Parse(dy.pagesize.ToString()) : 10; //每页的记录数

                //int pageIndex = res.Contains("pageindex") ? int.Parse(dy.pageindex.ToString()) : 1;  //当前页索引

                int       actiontype = res.Contains("actiontype") ? int.Parse(dy.data.actiontype.ToString()) : 0; //查询类型
                DataTable dt         = new DataTable();
                switch (actiontype)
                {
                case 1:
                    dt = riskassessbll.GetIndexRiskTarget("重大风险", currUser, 1);
                    break;

                case 2:
                    dt = riskassessbll.GetIndexRiskTarget("较大风险", currUser, 2);
                    break;

                case 3:
                    dt = riskassessbll.GetIndexRiskTarget("重大风险", currUser, 3);
                    break;

                case 4:      //重大隐患-按电厂排列(省级)
                    dt = htbaseinfobll.GetImportantIndexForProvincial(1, currUser);
                    break;

                case 5:     //逾期未整改隐患-按电厂排列(省级)
                    dt = htbaseinfobll.GetImportantIndexForProvincial(2, currUser);
                    break;

                case 6:     //省公司发现的隐患-按电厂排列(省级)
                    dt = htbaseinfobll.GetImportantIndexForProvincial(3, currUser);
                    break;

                case 7:     //违章数量-按电厂排列(省级)
                    dt = htbaseinfobll.GetImportantIndexForProvincial(4, currUser);
                    break;

                case 8:     //安全检查次数(省级)
                    dt = new DesktopBLL().GetFactoryCheckListForGroup(currUser);
                    break;

                default:
                    break;
                }
                return(new { code = 0, count = dt.Rows.Count, info = "获取成功", data = dt });
            }
            catch (Exception ex)
            {
                return(new { Code = -1, Count = 0, Info = ex.Message });
            }
        }
コード例 #8
0
        public object getDelayItemsForGroup([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 modifypostphoneproblemnum = 0; //待延期审(核)批
                int reviewproblemnum          = 0; //待验收隐患
                int modifyproblemnum          = 0; //待复查验证隐患
                int assessproblemnum          = 0; //待整改效果评估

                int illegalNum       = 0;          //违章次数
                int reviewIllegalNum = 0;          //待验收的违章数

                //SaftyCheckDataBLL saftbll = new SaftyCheckDataBLL();
                //int[] countcheck = saftbll.GetCheckCount(user, 0);
                //safechecknum = countcheck.Sum();
                //隐患待办事项
                var data = new HTBaseInfoBLL().QueryHidBacklogRecord("0", user.UserId);
                if (data.Rows.Count == 8)
                {
                    appoveproblemnum          = int.Parse(data.Rows[0]["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()); //待整改效果评估
                    modifyproblemnum          = int.Parse(data.Rows[6]["pnum"].ToString()); //待复查验证隐患
                }
                List <int> list = new DesktopBLL().GetSafetyCheckForGroup(user);

                int deptNum    = 0; //一级风险超过3个的电厂数量
                int oneRiskNum = 0; //重大风险总数
                int twoRiskNum = 0; //较大风险总数
                if (user.RoleName.Contains("省级用户"))
                {
                    DataTable dt  = riskassessbll.GetIndexRiskTarget("重大风险", user, 1);
                    DataTable dt1 = riskassessbll.GetIndexRiskTarget("较大风险", user, 2);
                    DataTable dt2 = riskassessbll.GetIndexRiskTarget("重大风险", user, 3);
                    deptNum = dt2.Rows.Count;
                    if (dt.Rows.Count > 0)
                    {
                        oneRiskNum = Convert.ToInt32(dt.Compute("Sum(num)", ""));
                    }
                    else
                    {
                        oneRiskNum = 0;
                    }
                    if (dt1.Rows.Count > 0)
                    {
                        twoRiskNum = Convert.ToInt32(dt1.Compute("Sum(num)", ""));
                    }
                    else
                    {
                        twoRiskNum = 0;
                    }
                }
                int bigHtNum     = 0; //重大隐患数量
                int overdueHtNum = 0; //逾期未整改隐患数量
                int htNum        = 0; //省公司发现隐患
                int checkNum     = 0; //检查次数
                checkNum     = list[0];
                safechecknum = list[1];
                List <decimal> list1            = new DesktopBLL().GetWarnItems(user);
                decimal        reformPercentNum = list1[1]; //隐患整改率低于80%的电厂数
                decimal        bigHtFactoryNum  = list1[3]; //存在重大隐患电厂数
                //重要指标之重大隐患、逾期未整改隐患、省公司发现的隐患
                list             = new DesktopBLL().GetHtForGroup(user);
                bigHtNum         = list[0]; //重大隐患数
                overdueHtNum     = list[2]; //逾期未整改隐患数
                htNum            = list[3]; //省公司排查的隐患数量
                illegalNum       = list[6]; //违章次数
                reviewIllegalNum = list[5]; //待验收违章
                return(new
                {
                    Code = 0,
                    Count = -1,
                    Info = "获取数据成功",
                    data = new
                    {
                        safeCheckNum = safechecknum,                 //待执行安全检查数
                        appoveProblemNum = appoveproblemnum,         //待评估隐患
                        delayProblemNum = modifypostphoneproblemnum, //待延期审(核)批
                        reviewProblemNum = reviewproblemnum,         //待验收隐患
                        modifyProblemNum = modifyproblemnum,         //待复查验证隐患
                        assessProblemNum = assessproblemnum,         //待整改效果评估

                        bigHtNum = bigHtNum,                         //重大隐患数量
                        overdueHtNum = overdueHtNum,                 //逾期未整改隐患数量
                        htNum = htNum,                               //省公司发现隐患
                        checkNum = checkNum,                         //检查次数

                        reformPercentNum = reformPercentNum,         //隐患整改率低于80%的电厂数
                        bigHtFactoryNum = bigHtFactoryNum,           //存在重大隐患电厂数

                        reviewIllegalNum = reviewIllegalNum,         //待验收违章
                        illegalNum = illegalNum,                     //违章次数

                        deptNum = deptNum,
                        oneRiskNum = oneRiskNum,
                        twoRiskNum = twoRiskNum
                    }
                });
            }
            catch (Exception ex)
            {
                return(new { Code = -1, Count = 0, Info = ex.Message });
            }
        }
コード例 #9
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 });
            }
        }
コード例 #10
0
ファイル: PersonController.cs プロジェクト: paddy235/ERCHTMS
        public object GetInfo([FromBody] JObject json)
        {
            try
            {
                string  res          = json.Value <string>("json");
                dynamic dy           = JsonConvert.DeserializeObject <ExpandoObject>(res);
                string  userId       = dy.userid;
                string  id           = dy.data.uid;
                bool    IsPermission = false;             //是否有权限
                OperatorProvider.AppUserId = userId;      //设置当前用户
                var user = userBll.GetUserInfoEntity(id); //获取用户基本信息

                DataItemDetailBLL itemBll = new DataItemDetailBLL();
                string            path    = itemBll.GetItemValue("imgUrl");
                var cert   = new ERCHTMS.Busines.PersonManage.CertificateBLL().GetList(id).Select(t => new { t.CertName, t.CertNum, SendDate = t.SendDate.Value.ToString("yyyy-MM-dd"), t.Years, t.SendOrgan, FilePath = path + t.FilePath }).ToList(); //获取人员证书信息
                var wzInfo = new DesktopBLL().GetWZInfoByUserId(id);                                                                                                                                                                                    //违章信息
                var health = new ERCHTMS.Busines.OccupationalHealthManage.OccupationalstaffdetailBLL().GetUserTable(id);                                                                                                                                //职业病信息
                //20190326 fwz 新增查询个人接触职业危害因素
                string Hazardfactor = "";
                //判断是否是本人\厂领导\EHS部与人力资源部的人
                if (userId == id)
                {
                    IsPermission = true;
                }
                //获取当前操作用户
                var Appuser = userBll.GetUserInfoEntity(userId);   //获取用户基本信息
                //EHS部与人力资源部配置在字典中 通过字典查找
                var Perdeptname = Appuser.DepartmentCode;
                DataItemDetailBLL dataItemDetailBLL = new DataItemDetailBLL();
                var data = dataItemDetailBLL.GetDataItemListByItemCode("'SelectDept'").ToList();
                if (data != null)
                {
                    foreach (var Peritem in data)
                    {
                        string   value  = Peritem.ItemValue;
                        string[] values = value.Split('|');
                        for (int i = 0; i < values.Length; i++)
                        {
                            if (values[i] == Perdeptname) //如果部门编码对应则是有权限的人
                            {
                                IsPermission = true;
                                break;
                            }
                        }
                    }
                }

                //如果是厂领导也有权限
                if (Appuser.RoleName.Contains("厂级部门用户") && Appuser.RoleName.Contains("公司领导"))
                {
                    IsPermission = true;
                }

                if (IsPermission)
                {
                    Hazardfactor = new HazardfactoruserBLL().GetUserHazardfactor(user.Account);
                }

                var    work        = new WorkRecordBLL().GetList(id).Select(t => new { EnterDate = t.EnterDate.ToString().Contains("0001") ? "" : t.EnterDate.ToString("yyyy-MM-dd"), LeaveTime = t.LeaveTime.ToString().Contains("0001") ? "" : t.LeaveTime.ToString("yyyy-MM-dd"), t.DeptName, t.PostName, t.OrganizeName, t.JobName }).ToList();//工作记录
                string deptname    = new TransferBLL().GetDeptName(user.DepartmentId);
                string projectName = "";
                if (!string.IsNullOrEmpty(user.ProjectId))
                {
                    OutsouringengineerEntity entity = new OutsouringengineerBLL().GetEntity(user.ProjectId);
                    if (entity != null)
                    {
                        projectName = entity.ENGINEERNAME;
                    }
                }

                string photo = "";
                if (!string.IsNullOrEmpty(user.HeadIcon))
                {
                    if (!string.IsNullOrEmpty(path))
                    {
                        photo = path + user.HeadIcon;
                    }
                }
                int score = 100;
                var item  = itemBll.GetEntity("csjf");
                if (item != null)
                {
                    score = int.Parse(item.ItemValue);
                }

                int    point    = 0;
                string argValue = new DataItemDetailBLL().GetItemValue("Point");
                if (!string.IsNullOrEmpty(argValue) && argValue == "point")
                {
                    dynamic pointdata = UpdatePoint(user.Account);
                    if (pointdata != null && pointdata.Qualitydata.Count > 0)
                    {
                        point = pointdata.Qualitydata[0].point;
                    }
                }


                //2019-03-08 Fwz修改 加入职务字段 部门显示改为层级显示
                return(new { Code = 0, Count = 1, Info = "获取数据成功", data = new { realname = user.RealName, point = point, sex = user.Gender, identifyid = user.IdentifyID, deptname = deptname, postname = user.DutyName, dutyname = user.PostName, organizename = user.OrganizeName, native = user.Native, nation = user.Nation, isSpecial = user.IsSpecial, isSpecialEqu = user.IsSpecialEqu, isBlack = user.IsBlack, mobile = user.Mobile, usertype = user.UserType, isEpiboly = user.isEpiboly, enterDate = user.EnterTime == null ? "" : user.EnterTime.Value.ToString("yyyy-MM-dd"), leaveTime = user.DepartureTime == null ? "" : user.DepartureTime.Value.ToString("yyyy-MM-dd"), isPresence = user.isPresence, score = new UserScoreBLL().GetUserScore(user.UserId, DateTime.Now.Year.ToString()) + score, projectName = projectName, faceUrl = photo, CertInfo = cert, IllInfo = health, Hazardfactor = Hazardfactor, IsPermission = IsPermission, WorkInfo = work, IllegalInfo = wzInfo, isfourperson = user.IsFourPerson, fourpersontype = user.FourPersonType } });
            }
            catch (Exception ex)
            {
                return(new { Code = -1, Count = 0, Info = ex.Message });
            }
        }
コード例 #11
0
        public ActionResult Update(string keyValue, TransferEntity entity)
        {
            Operator curuser = ERCHTMS.Code.OperatorProvider.Provider.Current();

            transferbll.Update(keyValue, entity);
            SyZg(entity, true);
            HikUpdateUserInfo(entity);
            string     uid     = entity.UserId;//获取到需要转岗的用户id
            UserEntity ue      = userBLL.GetEntity(uid);
            string     GdhcUrl = new DataItemDetailBLL().GetItemValue("GdhcUrl");
            string     pcrul   = "http://" + Request.Url.Host + ":" + Request.Url.Port + "/" + Request.ApplicationPath;
            string     LogUrl  = Server.MapPath("~/logs/RYZG");

            try
            {
                DesktopBLL deskBll      = new DesktopBLL();
                string[]   receiverList = userBLL.GetList().Where(t => ((t.RoleName.Contains("负责人") || t.RoleName.Contains("公司领导") || t.RoleName.Contains("厂级部门用户")) && entity.OutDeptCode.StartsWith(t.DepartmentCode)) || (entity.OutDeptCode.StartsWith(t.DepartmentCode) && entity.OutDeptCode != t.DepartmentCode) && t.Account != "System" && !string.IsNullOrWhiteSpace(t.EnCode)).Select(t => t.EnCode).ToArray();
                if (!string.IsNullOrWhiteSpace(GdhcUrl))
                {
                    Task.Factory.StartNew(() =>
                    {
                        GdhcDbsxEntity DbEntity = new GdhcDbsxEntity();
                        DbEntity.syscode        = "GSI";
                        DbEntity.flowid         = entity.TID;
                        DbEntity.requestname    = ue.RealName + "转岗申请";
                        DbEntity.workflowname   = "RYZG";
                        DbEntity.nodename       = "人员转岗审批完成";
                        DbEntity.receiver       = string.Join(",", receiverList);
                        DbEntity.requestlevel   = "0";
                        DbEntity.GdhcUrl        = GdhcUrl;
                        DbEntity.LogUrl         = LogUrl;
                        deskBll.GdhcDbsxSyncYB(DbEntity);
                        DbEntity.receiver = string.Join(",", receiverList);
                        DbEntity.nodename = "人员转岗审批完成";
                        deskBll.GdhcDbsxSyncBJ(DbEntity);
                    });
                }
            }
            catch (Exception ex)
            {
                if (!string.IsNullOrWhiteSpace(LogUrl))
                {
                    if (!System.IO.Directory.Exists(LogUrl))
                    {
                        System.IO.Directory.CreateDirectory(LogUrl);
                    }
                }
                System.IO.File.AppendAllText(LogUrl + "/" + DateTime.Now.ToString("yyyyMMdd") + ".txt", "异常信息:" + ex.ToString());
            }
            DataItemDetailBLL di            = new DataItemDetailBLL();
            string            way           = di.GetItemValue("WhatWay");
            DepartmentBLL     departmentBLL = new DepartmentBLL();
            DepartmentEntity  org           = departmentBLL.GetEntity(ue.OrganizeId);

            if (org.IsTrain == 1)
            {
                //对接.net培训平台
                if (way == "0")
                {
                }
                //对接java培训平台
                if (way == "1")
                {
                    var user = ERCHTMS.Code.OperatorProvider.Provider.Current();
                    DepartmentEntity dept = departmentBLL.GetEntity(entity.OutDeptId);
                    if (dept != null)
                    {
                        string deptId = dept.DepartmentId;
                        string enCode = dept.EnCode;
                        if (!string.IsNullOrWhiteSpace(dept.DeptKey))
                        {
                            string[] arr = dept.DeptKey.Split('|');
                            deptId = arr[0];
                            if (arr.Length > 1)
                            {
                                enCode = arr[1];
                            }
                        }
                        Task.Factory.StartNew(() =>
                        {
                            object obj = new
                            {
                                action     = "edit",
                                time       = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
                                userId     = ue.UserId,
                                userName   = ue.RealName,
                                account    = ue.Account,
                                deptId     = deptId,
                                deptCode   = enCode,
                                password   = "", //为null时不要修改密码!
                                sex        = ue.Gender,
                                idCard     = ue.IdentifyID,
                                email      = ue.Email,
                                mobile     = ue.Mobile,
                                birth      = ue.Birthday == null ? "" : ue.Birthday.Value.ToString("yyyy-MM-dd"), //生日
                                postId     = entity.OutPostId,
                                postName   = entity.OutPostName,                                                  //岗位
                                age        = ue.Age,                                                              //年龄
                                native     = ue.Native,                                                           //籍贯
                                nation     = ue.Nation,                                                           //民族
                                encode     = ue.EnCode,                                                           //工号
                                jobTitle   = entity.OutJobName,
                                techLevel  = ue.TechnicalGrade,
                                workType   = ue.Craft,
                                companyId  = org.InnerPhone,
                                trainRoles = ue.TrainRoleId,
                                role       = ue.IsTrainAdmin == null ? 0 : ue.IsTrainAdmin //角色(0:学员,1:培训管理员)
                            };
                            List <object> list = new List <object>();
                            list.Add(obj);
                            Busines.JPush.JPushApi.PushMessage(list, 1);

                            LogEntity logEntity      = new LogEntity();
                            logEntity.CategoryId     = 5;
                            logEntity.OperateTypeId  = ((int)OperationType.Update).ToString();
                            logEntity.OperateType    = "人员转岗";
                            logEntity.OperateAccount = user.Account + "(" + user.UserName + ")";
                            logEntity.OperateUserId  = user.UserId;

                            logEntity.ExecuteResult     = 1;
                            logEntity.ExecuteResultJson = string.Format("同步人员(转岗)到java培训平台,同步信息:\r\n{0}", list.ToJson());
                            logEntity.Module            = "人员档案";
                            logEntity.ModuleId          = "ea93dc6b-83fc-4ac2-a1b7-56ef6909445c";
                            logEntity.WriteLog();
                        });
                    }
                }
            }
            return(Success("操作成功。"));
        }