Ejemplo n.º 1
0
        public ActionResult GetFormJson(string keyValue)
        {
            DataItemDetailBLL itemBll = new DataItemDetailBLL();

            ERCHTMS.Entity.SystemManage.DataItemDetailEntity entity = itemBll.GetEntity(keyValue);
            return(ToJsonResult(entity));
        }
Ejemplo n.º 2
0
        public ActionResult SaveForm(string keyValue, string score)
        {
            Operator          user    = ERCHTMS.Code.OperatorProvider.Provider.Current();
            DataItemDetailBLL itemBll = new DataItemDetailBLL();

            ERCHTMS.Entity.SystemManage.DataItemDetailEntity entity = itemBll.GetEntity(keyValue);
            if (entity != null)
            {
                entity.ItemCode  = user.OrganizeCode;
                entity.ItemName  = user.OrganizeName;
                entity.ItemId    = "1234567890";
                entity.ItemValue = score;
                itemBll.SaveForm(keyValue, entity);
            }
            else
            {
                entity = new Entity.SystemManage.DataItemDetailEntity();
                entity.ItemDetailId = user.OrganizeId;
                entity.ParentId     = "0";
                entity.ItemName     = user.OrganizeName;
                entity.ItemCode     = user.OrganizeCode;
                entity.ItemId       = "1234567890";
                entity.ItemValue    = score;
                itemBll.SaveForm(keyValue, entity);
            }

            return(Success("操作成功。"));
        }
Ejemplo n.º 3
0
        public ActionResult GetRankListJson(Pagination pagination, string queryJson, string year)
        {
            var watch = CommonHelper.TimerStart();

            pagination.p_kid         = "u.USERID";
            pagination.p_fields      = "u.account,senddeptid,REALNAME,MOBILE,OrganizeName,DEPTNAME,DUTYNAME,POSTNAME,usertype,GENDER,u.OrganizeCode,u.CreateDate,isblack,identifyid,nvl(score,0) score,BIRTHDAY";
            pagination.p_tablename   = "v_userinfo u left join (select a.userid,nvl(sum(score),0) as score from base_user a left join bis_userscore b on a.userid=b.userid where year='" + year + "' group by a.userid) t on u.userid=t.userid";
            pagination.conditionJson = "1=1";
            Operator user = ERCHTMS.Code.OperatorProvider.Provider.Current();

            if (user.IsSystem)
            {
                pagination.conditionJson = "1=1";
            }
            else
            {
                string where = new AuthorizeBLL().GetModuleDataAuthority(ERCHTMS.Code.OperatorProvider.Provider.Current(), HttpContext.Request.Cookies["currentmoduleId"].Value, "departmentcode", "organizecode");
                if (!string.IsNullOrEmpty(where))
                {
                    pagination.conditionJson += " and " + where;
                }
            }


            DataItemDetailBLL itemBll = new DataItemDetailBLL();

            ERCHTMS.Entity.SystemManage.DataItemDetailEntity entity = itemBll.GetEntity(user.OrganizeId);
            var data     = userscorebll.GetPageJsonList(pagination, queryJson);
            var JsonData = new
            {
                rows     = data,
                total    = pagination.total,
                page     = pagination.page,
                records  = pagination.records,
                costtime = CommonHelper.TimerEnd(watch),
                userdata = new { score = entity == null ? "100" : entity.ItemValue }
            };

            return(Content(JsonData.ToJson()));
        }
Ejemplo n.º 4
0
        public object IntegralInfo([FromBody] JObject json)
        {
            try
            {
                string  res    = json.Value <string>("json");
                dynamic dy     = JsonConvert.DeserializeObject <ExpandoObject>(res);
                string  userId = dy.userid;
                string  uId    = dy.data.uid;        //人员Id
                OperatorProvider.AppUserId = userId; //设置当前用户
                UserEntity user = new UserBLL().GetEntity(uId);
                DataTable  dt   = new UserScoreBLL().GetList(uId);

                DataItemDetailBLL itemBll = new DataItemDetailBLL();
                ERCHTMS.Entity.SystemManage.DataItemDetailEntity entity = itemBll.GetEntity("csjf");
                decimal score = new UserScoreBLL().GetUserScore(uId, DateTime.Now.Year.ToString());
                score = entity == null ? score : int.Parse(entity.ItemValue) + score;
                return(new { Code = 0, Count = 0, Info = "操作成功", data = new { score = score, Details = dt } });
            }
            catch (Exception ex)
            {
                return(new { Code = -1, Count = 0, Info = ex.Message });
            }
        }