Ejemplo n.º 1
0
        public ActionResult GetPageList(Pagination pagination, string queryJson)
        {
            pagination.p_kid         = "Id";
            pagination.p_fields      = "znetwneight/1000 znetwneight,zcount, ca.Numbers,ca.createdate,ca.GetData,ca.ProductType,ca.SupplyName,ca.PlateNumber,ca.Dress,ca.Remark,ca.transporttype,ca.takegoodsname,ca.PassRemark,ca.IsFirst,ca.IsTrajectory,ca.WeighingNum,ca.DataBaseNum,ca.OutDate,ca.StayTime,ca.Status,ca.OrderNum,ca.OutDatabaseTime";
            pagination.p_tablename   = "WL_OPERTICKETMANAGER ca left join (SELECT SUM(netwneight) znetwneight,COUNT(BASEID) zcount, BASEID FROM WL_CALCULATE WHERE ISDELETE='1' GROUP BY BASEID)  calculate on calculate.BASEID=ca.id   ";
            pagination.conditionJson = "1=1 and Isdelete='1' ";
            var watch    = CommonHelper.TimerStart();
            var data     = operticketmanagerbll.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()));
        }
Ejemplo n.º 2
0
        public ActionResult GetPageList(Pagination pagination, string queryJson)
        {
            pagination.p_kid         = "Id";
            pagination.p_fields      = "Numbers,createdate,GetData,ProductType,SupplyName,isdelete,PlateNumber,Dress,Remark,transporttype,takegoodsname,PassRemark,IsFirst,IsTrajectory,WeighingNum,DataBaseNum,OutDate,StayTime,Status,deletecontent";
            pagination.p_tablename   = "WL_OPERTICKETMANAGER";
            pagination.conditionJson = "1=1 ";
            var watch    = CommonHelper.TimerStart();
            var data     = operticketmanagerbll.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()));
        }
        public ActionResult GetPageList(Pagination pagination, string queryJson)
        {
            pagination.p_kid         = "Id";
            pagination.p_fields      = "Numbers,createdate,GetData,ProductType,SupplyName,PlateNumber,Dress,Remark,transporttype,takegoodsname,outdate,outcu,getstamptime,ORDERNUMR,drivername,drivertel";
            pagination.p_tablename   = "WL_OPERTICKETMANAGER";
            pagination.conditionJson = "1=1 and Isdelete='1' ";
            var watch    = CommonHelper.TimerStart();
            var data     = operticketmanagerbll.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()));
        }
Ejemplo n.º 4
0
        public object GetUserInformationList(string json)
        {
            try
            {
                //string res = //json.Value<string>("json");//[FromBody]JObject
                dynamic dy        = JsonConvert.DeserializeObject <ExpandoObject>(json);
                string  userId    = dy.userid;
                string  username  = dy.data.username;  //姓名
                string  jobnumber = dy.data.jobnumber; //手机号

                //获取用户基本信息
                OperatorProvider.AppUserId = userId;  //设置当前用户
                Operator curUser = OperatorProvider.Provider.Current();
                if (null == curUser)
                {
                    curUser = GetOperator(dy.userid);
                    if (curUser == null)
                    {
                        return(new { code = -1, count = 0, info = "当前用户不存在,请核对用户信息!" });
                    }
                }
                Pagination pagination = new Pagination();
                pagination.p_kid         = "id";
                pagination.p_fields      = @" d.username,d.vid,d.gpsid,d.gpsname,d.intime,d.outtime,d.state,'' as phone,'' as comname ";
                pagination.p_tablename   = "bis_persongps  d";
                pagination.conditionJson = " state=0 ";
                //pagination.sidx = pagination.sidx + " " + pagination.sord + ",id";

                if (!string.IsNullOrEmpty(username))
                { //姓名
                    pagination.conditionJson += " and username like '%" + username.Trim() + "%'";
                }
                if (!string.IsNullOrEmpty(dy.data.starttime))
                {//
                    pagination.conditionJson += " and username like '" + jobnumber.Trim() + "%'";
                }

                //获取页数和条数
                int page = Convert.ToInt32(dy.data.pagenum), rows = Convert.ToInt32(dy.data.pagesize);
                pagination.page = page;         //页数
                pagination.rows = rows;         //行数
                pagination.sidx = "createdate"; //排序字段
                pagination.sord = "desc";       //排序方式
                DataTable data = operticketmanagerbll.GetPageList(pagination, null);
                if (data.Rows.Count > 0)
                {
                    foreach (DataRow Rows in data.Rows)
                    {
                        string    pid  = Rows[2].ToString();
                        string    sql  = string.Format("select d.dirver,d.phone,CONCAT(CONCAT(d.visitdept,'/'),d.carno) as purpose from bis_usercar d where d.id='{0}' ", pid);
                        string    sql1 = string.Format("select d.dirver,d.phone,CONCAT(CONCAT(d.visitdept,'/'),d.carno) as purpose from bis_visitcar d where d.id='{0}' ", pid);
                        string    sql2 = string.Format("select Phone,TheCompany,d.dirver from bis_hazardouscar d  where d.id='{0}' ", pid);
                        DataTable dt   = operticketmanagerbll.GetDataTable(sql);
                        DataTable dt1  = operticketmanagerbll.GetDataTable(sql1);
                        DataTable dt2  = operticketmanagerbll.GetDataTable(sql2);
                        if (dt.Rows.Count > 0)
                        {//拜访(无车)
                            if (Rows[1].ToString() == dt.Rows[0][0].ToString())
                            {
                                Rows["phone"] = dt.Rows[0][1].ToString();
                            }
                            Rows["comname"] = dt.Rows[0][2].ToString();
                        }
                        else if (dt1.Rows.Count > 0)
                        {//拜访(有车)
                            if (Rows[1].ToString() == dt1.Rows[0][0].ToString())
                            {
                                Rows["phone"] = dt1.Rows[0][1].ToString();
                            }
                            Rows["comname"] = dt1.Rows[0][2].ToString();
                        }
                        else if (dt2.Rows.Count > 0)
                        {//拜访(危化品)
                            if (Rows[1].ToString() == dt2.Rows[0][2].ToString())
                            {
                                Rows["phone"] = dt2.Rows[0][0].ToString();
                            }
                            Rows["comname"] = dt2.Rows[0][1].ToString();
                        }
                        dt.Dispose(); dt1.Dispose(); dt2.Dispose();
                    }
                }
                return(new { code = 0, info = "获取数据成功", count = pagination.records, data = data.ToJson() });
            }
            catch (Exception ex)
            {
                return(new { code = -1, count = 0, info = ex.Message });
            }
        }