Beispiel #1
0
        public object getItems([FromBody] JObject json)
        {
            try
            {
                string  res    = json.Value <string>("json");
                dynamic dy     = JsonConvert.DeserializeObject <ExpandoObject>(res);
                string  userId = dy.userid;
                OperatorProvider.AppUserId = userId;  //设置当前用户
                Pagination pagination = new Pagination();
                pagination.page          = 1;
                pagination.rows          = 100;
                pagination.p_kid         = "id as itemid";
                pagination.p_fields      = "ItemName,itemtype,score";
                pagination.p_tablename   = "BIS_SCORESET";
                pagination.conditionJson = "isauto=0";
                Operator user = ERCHTMS.Code.OperatorProvider.Provider.Current();
                if (user.IsSystem)
                {
                    pagination.conditionJson += " and deptcode='00'";
                }
                else
                {
                    pagination.conditionJson += string.Format(" and (deptcode='00' or deptcode='{0}')", user.OrganizeCode);
                }

                var data = new UserScoreBLL().GetPageJsonList(pagination, "");

                return(new { Code = 0, Count = 0, Info = "操作成功", data = data });
            }
            catch (Exception ex)
            {
                return(new { Code = -1, Count = 0, Info = ex.Message });
            }
        }
Beispiel #2
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 });
            }
        }