コード例 #1
0
 private string GetShortString(GoodsState state)
 {
     if (state == GoodsState.NONE)
     {
         return("");
     }
     if (state == GoodsState.WAITPROCESSIMAGE)
     {
         return("");
     }
     if (state == GoodsState.WAITREVIEW)
     {
         return("(图)");
     }
     if (state == GoodsState.WAITUPLOADED)
     {
         return("(审)");
     }
     if (state == GoodsState.UPLOADED)
     {
         return("(上)");
     }
     if (state == GoodsState.NOTSALE)
     {
         return("(下)");
     }
     return("(ERR)");
 }
コード例 #2
0
 public DataCollectionResponse <Goods> GetByAll(long shopId, GoodsState state, int timeType, DateTime start, DateTime end, string vendor, string number, GoodsType type, string comment, ColorFlag flag, GoodsVideoType videoType, string order, string vendorAdd, string shipper, int pageIndex, int pageSize)
 {
     try
     {
         return(this.dao.GetByAll(shopId, state, timeType, start, end, vendor, number, type, comment, flag, videoType, order, vendorAdd, shipper, pageIndex, pageSize));
     }
     catch (Exception ex)
     {
         throw new WebFaultException <ResponseBase>(new ResponseBase(ex.Message), System.Net.HttpStatusCode.OK);
     }
 }
コード例 #3
0
ファイル: Goods.cs プロジェクト: qdjx/C5
 //设置商品状态
 private static GoodsInfo SetGoodsState(long GoodsID, GoodsState goodsState)
 {
     using (var EF = new EF())
     {
         var goodsInfo = EF.GoodsInfos.Where(i => i.ID == GoodsID).FirstOrDefault();
         if (goodsInfo != null)
         {
             goodsInfo.StateID = (int)goodsState;
             EF.SaveChanges();
         }
         return(goodsInfo);
     }
 }
コード例 #4
0
ファイル: Goods.cs プロジェクト: qdjx/C5
        //设置上、下架
        public static void SetPublicSales(long GoodsID, GoodsState goodsState, out AlertMessage alertMessage)
        {
            alertMessage = null;

            //权限检查
            if (!AUTH.PermissionCheck(ModuleInfo, ActionInfos.Where(i => i.Name == (goodsState == GoodsState.架 ? "PublicSales"
                : goodsState == GoodsState.架 ? "StopSales" : null)).FirstOrDefault(), out string Message))
            {
                alertMessage = new AlertMessage {
                    Message = Message, Type = AlertType.warning
                };
                return;
            }

            var goodsInfo = SetGoodsState(GoodsID, goodsState);

            alertMessage = new AlertMessage
            {
                Message = (goodsInfo == null ? "商品[" + GoodsID + "]不存在!" : "商品[" + goodsInfo.Name + "]" + goodsState + "成功!"),
                Type    = AlertType.success
            };
        }
コード例 #5
0
ファイル: GoodsService.cs プロジェクト: RyanFu/shoperp
        public DataCollectionResponse <Goods> GetByAll(long shopId, GoodsState state, int timeType, DateTime start, DateTime end, string vendor, string number, GoodsType type, string comment, ColorFlag flag, GoodsVideoType videoType, string order, string vendorAdd, string shipper, int pageIndex, int pageSize)
        {
            Dictionary <string, object> para = new Dictionary <string, object>();

            para["shopId"]    = shopId;
            para["state"]     = state;
            para["timeType"]  = timeType;
            para["start"]     = start;
            para["end"]       = end;
            para["vendor"]    = vendor;
            para["number"]    = number;
            para["type"]      = type;
            para["comment"]   = comment;
            para["flag"]      = flag;
            para["videoType"] = videoType;
            para["order"]     = order;
            para["vendorAdd"] = vendorAdd;
            para["shipper"]   = shipper;
            para["pageIndex"] = pageIndex;
            para["pageSize"]  = pageSize;
            return(DoPost <DataCollectionResponse <Goods> >(para));
        }
コード例 #6
0
ファイル: MonoGoods.cs プロジェクト: slb1988/agame
        protected override void Update()
        {
            float num;

            if (!this.actDropAnim)
            {
                num = (Time.deltaTime * 100f) * this.TimeScale;
            }
            else if (this.actDropAnim && !this.dropAnimFinished)
            {
                num = (Time.deltaTime * this._selfRotateSpeed) * this.TimeScale;
                this.CheckBarrierCollider();
            }
            else
            {
                this._selfRotateAcceleration = (this._selfRotateAcceleration >= 10f) ? (this._selfRotateAcceleration - 3f) : 10f;
                this._selfRotateSpeed        = (this._selfRotateSpeed >= 100f) ? (this._selfRotateSpeed - this._selfRotateAcceleration) : 100f;
                num = (Time.deltaTime * this._selfRotateSpeed) * this.TimeScale;
            }
            base.transform.Rotate(base.transform.up, num);
            if (this._state == GoodsState.Appear)
            {
                this._state = GoodsState.Idle;
            }
            else if (((this._state == GoodsState.Idle) && (base.transform.position.y <= 0.3f)) && ((this._rigidbody != null) && (this._rigidbody.velocity.y <= 0f)))
            {
                if (this.reboundTimes > 0)
                {
                    this._rigidbody.velocity = new Vector3(this._rigidbody.velocity.x, -0.8f * this._rigidbody.velocity.y, this._rigidbody.velocity.z);
                    this.reboundTimes--;
                }
                else if (!this.dropAnimFinished)
                {
                    this.dropAnimFinished = true;
                    UnityEngine.Object.Destroy(this._rigidbody);
                    this._rigidbody = null;
                    base.transform.SetLocalPositionY(0.3f);
                    if (!string.IsNullOrEmpty(this.AttachEffectPattern) && (Singleton <EventManager> .Instance.GetActor <EquipItemActor>(base.GetRuntimeID()) != null))
                    {
                        bool flag = true;
                        switch (GraphicsSettingData.GetGraphicsRecommendGrade())
                        {
                        case GraphicsRecommendGrade.Off:
                        case GraphicsRecommendGrade.Low:
                        {
                            ConfigGraphicsPersonalSetting personalGraphicsSetting = Singleton <MiHoYoGameData> .Instance.GeneralLocalData.PersonalGraphicsSetting;
                            if (!personalGraphicsSetting.IsUserDefinedGrade)
                            {
                                flag = false;
                            }
                            else if (personalGraphicsSetting.RecommendGrade != GraphicsRecommendGrade.High)
                            {
                                flag = false;
                            }
                            break;
                        }
                        }
                        if (flag)
                        {
                            int rarity = Singleton <EventManager> .Instance.GetActor <EquipItemActor>(base.GetRuntimeID()).rarity;

                            this.effects = Singleton <EffectManager> .Instance.TriggerEntityEffectPatternReturnValue(this.AttachEffectPattern, this, true);

                            int num3  = 0;
                            int count = this.OutsideEffects.Count;
                            while (num3 < count)
                            {
                                this.SetOutsideParticleColorByRarity(this.OutsideEffects[num3].gameObject, rarity);
                                num3++;
                            }
                        }
                    }
                }
            }
            BaseMonoAvatar localAvatar = Singleton <AvatarManager> .Instance.GetLocalAvatar();

            if (this._state == GoodsState.Idle)
            {
                if (this.dropAnimFinished || (this.reboundTimes <= 0))
                {
                    float property = localAvatar.GetProperty("Actor_GoodsAttrackRadius");
                    property           = Mathf.Clamp(property, 0f, property);
                    this.attractRadius = localAvatar.config.CommonArguments.GoodsAttractRadius * property;
                    if (Vector3.Distance(this.XZPosition, localAvatar.XZPosition) < this.attractRadius)
                    {
                        this._state = GoodsState.Attract;
                        this.attractTimer.SetActive(false);
                        if (!string.IsNullOrEmpty(this.AttachEffectPattern) && (Singleton <EventManager> .Instance.GetActor <EquipItemActor>(base.GetRuntimeID()) != null))
                        {
                            foreach (MonoEffect effect in this.effects)
                            {
                                if (effect != null)
                                {
                                    effect.SetDestroyImmediately();
                                }
                            }
                        }
                    }
                }
            }
            else if ((this._state == GoodsState.Attract) || this.forceFlyToAvatar)
            {
                this.speed += (this.acceleration * this.TimeScale) * Time.deltaTime;
                this.speed  = (this.speed >= 20f) ? 20f : this.speed;
                Vector3   vector7   = localAvatar.RootNodePosition - base.transform.position;
                Vector3   vector    = (Vector3)((vector7.normalized * this.speed) * this.TimeScale);
                Transform transform = base.transform;
                transform.position += (Vector3)(vector * Time.deltaTime);
                this.attractTimer.Core(1f);
                if ((Vector3.Distance(this.XZPosition, localAvatar.XZPosition) < localAvatar.config.CommonArguments.CollisionRadius) || this.attractTimer.isTimeUp)
                {
                    this.OnTriggerEnter(localAvatar.hitbox);
                }
            }
            base.Update();
        }
コード例 #7
0
ファイル: GoodsDao.cs プロジェクト: RyanFu/shoperp
        public DataCollectionResponse <Goods> GetByAll(long shopId, GoodsState state, int timeType, DateTime start, DateTime end, string vendor, string number, GoodsType type, string comment, ColorFlag flag, GoodsVideoType videoType, string order, string vendorAdd, string shipper, int pageIndex, int pageSize)
        {
            List <object> para           = new List <object>();
            string        dataHsqlHeader = " select distinct  G  from " + this.GetEntiyName() + " as  G left join fetch G.Vendor as V left join  G.Shops as GS ";
            //对于count统计sql语句left join 不能使用 fetch,不然会产生错误的sql语句,!!!!!
            string countHsqlHeader = " select count( distinct G.Id)  from " + this.GetEntiyName() + " as  G left join G.Vendor as V left join G.Shops as GS  ";

            string where = "";

            //店铺查询条件
            if (shopId <= -1)
            {
                where += "  G.Id not in (select distinct GoodsId from GS group by GoodsId having count(GoodsId) >=1 ) and ";
            }
            else if (shopId > 0)
            {
                where += " GS.ShopId=" + shopId + " and ";
            }
            where += this.MakeQuery("GS.State", (int)state, (int)GoodsState.NONE);
            where += this.MakeQuery("G.Type", (int)type, (int)GoodsType.GOODS_SHOES_NONE);
            if (timeType <= 0)
            {
                where += this.MakeQuery("G." + TIME_TYPES[timeType], start, true);
                where += this.MakeQuery("G." + TIME_TYPES[timeType], end, false);
            }
            else
            {
                where += this.MakeQuery("GS." + TIME_TYPES[timeType], start, true);
                where += this.MakeQuery("GS." + TIME_TYPES[timeType], end, false);
            }

            if (string.IsNullOrWhiteSpace(vendor) == false)
            {
                where += " (V.Name like ? or V.PingyingName like ?) and ";
                para.Add('%' + vendor + '%');
                para.Add('%' + vendor + '%');
            }
            where += this.MakeQueryLike("V.MarketAddress", vendorAdd, para);
            where += this.MakeQueryLike("G.Number", number, para);
            where += this.MakeQueryLike("G.Comment", comment, para);
            where += this.MakeQuery("G.Flag", (int)flag, (int)ColorFlag.None);
            where += this.MakeQuery("G.VideoType", (int)videoType, (int)GoodsVideoType.NONE);
            where += this.MakeQueryLike("G.Shipper", shipper, para);
            string dataHsql = dataHsqlHeader + this.TrimHSql("where " + where) + " order by ";

            if (string.IsNullOrWhiteSpace(order))
            {
                dataHsql += " G.Id desc ";
            }
            else if (order.Contains("State"))
            {
                dataHsql += " GS.State " + (order.Contains("asc") ? "asc " : "desc");
            }
            else if (order.Contains("UploadTime"))
            {
                dataHsql += " GS.UploadTime " + (order.Contains("asc") ? "asc " : "desc");
            }
            else if (order.Contains("Vendor"))
            {
                dataHsql += order.Contains("Vendor") ? (" V.Name " + (order.Contains("asc") ? "asc " : "desc")) : ("G." + order);
            }
            else
            {
                dataHsql += "G." + order;
            }
            return(this.GetPageEx(dataHsql, this.TrimHSql(countHsqlHeader + " where " + where), pageIndex, pageSize, para.ToArray()));
        }
コード例 #8
0
        private void ChangeState(GoodsState from, GoodsState to)
        {
            try
            {
                var gu = this.GetSelctedItem();
                if (gu == null)
                {
                    return;
                }

                if (gu.Source.Shops == null || gu.Source.Shops.Count < 1)
                {
                    throw new Exception("没有相关的上货店铺");
                }

                string webDir = LocalConfigService.GetValue(SystemNames.CONFIG_WEB_IMAGE_DIR, "");

                //检查图片状态
                if (from == GoodsState.WAITPROCESSIMAGE && to == GoodsState.WAITREVIEW)
                {
                    //YT
                    string yt = webDir + "\\" + gu.Source.ImageDir + "\\YT";
                    if (System.IO.Directory.Exists(yt) == false)
                    {
                        if (MessageBox.Show("YT 文件夹不存,是否继续", "错误", MessageBoxButton.YesNo) != MessageBoxResult.Yes)
                        {
                            return;
                        }
                    }
                    else
                    {
                        if (System.IO.Directory.GetFiles(yt).Length == 0 && System.IO.Directory.GetDirectories(yt).Length == 0)
                        {
                            if (MessageBox.Show("YT 文件夹下面为空,是否继续", "错误", MessageBoxButton.YesNo) != MessageBoxResult.Yes)
                            {
                                return;
                            }
                        }
                    }

                    //PT
                    string pt = webDir + "\\" + gu.Source.ImageDir + "\\PT";
                    if (System.IO.Directory.Exists(pt) == false)
                    {
                        if (MessageBox.Show("PT 文件夹不存,是否继续", "错误", MessageBoxButton.YesNo) != MessageBoxResult.Yes)
                        {
                            return;
                        }
                    }
                    else
                    {
                        string zt = pt + "\\ZT";
                        if (System.IO.Directory.Exists(zt) == false)
                        {
                            if (MessageBox.Show("ZT 文件夹不存,是否继续", "错误", MessageBoxButton.YesNo) != MessageBoxResult.Yes)
                            {
                                return;
                            }
                        }
                        else
                        {
                            var files = System.IO.Directory.GetFiles(zt);
                            foreach (var file in files)
                            {
                                int    lastSlashIndex = file.LastIndexOf('\\');
                                int    lastDotIndex   = file.LastIndexOf('.');
                                string name           = file.Substring(lastSlashIndex + 1, lastDotIndex - lastSlashIndex - 1);
                                if (name.All(c => Char.IsDigit(c)))
                                {
                                    Size size = GetImageFileSize(file);
                                    if (size.Width != size.Height || size.Width > 800 || (new FileInfo(file)).Length > 500 * 1024)
                                    {
                                        if (MessageBox.Show(file + "长宽不相等,或者长宽超过800,或者大小超过500KB是否继续", "错误", MessageBoxButton.YesNo) != MessageBoxResult.Yes)
                                        {
                                            return;
                                        }
                                    }
                                }
                            }
                        }

                        string yst = pt + "\\YST";
                        if (System.IO.Directory.Exists(yst) == false)
                        {
                            if (MessageBox.Show("YST 文件夹不存,是否继续", "错误", MessageBoxButton.YesNo) != MessageBoxResult.Yes)
                            {
                                return;
                            }
                        }
                        else
                        {
                            var files = System.IO.Directory.GetFiles(yst);
                            foreach (var file in files)
                            {
                                Size size = GetImageFileSize(file);
                                if (size.Width != size.Height || size.Width > 800 || (new FileInfo(file)).Length > 500 * 1024)
                                {
                                    if (MessageBox.Show(file + "长宽不相等,或者长宽超过800,或者大小超过500KB是否继续", "错误", MessageBoxButton.YesNo) != MessageBoxResult.Yes)
                                    {
                                        return;
                                    }
                                }
                            }
                        }

                        string xqt = pt + "\\XQT";
                        if (System.IO.Directory.Exists(yst) == false)
                        {
                            if (MessageBox.Show("xqt 文件夹不存,是否继续", "错误", MessageBoxButton.YesNo) != MessageBoxResult.Yes)
                            {
                                return;
                            }
                        }
                        else
                        {
                            var files = System.IO.Directory.GetFiles(xqt);
                            foreach (var file in files)
                            {
                                Size size = GetImageFileSize(file);
                                if (size.Width > 790 || size.Height > 1500)
                                {
                                    if (MessageBox.Show(file + "宽超过790 或者高超过1500", "错误", MessageBoxButton.YesNo) != MessageBoxResult.Yes)
                                    {
                                        return;
                                    }
                                }
                            }
                        }
                    }
                }


                var win = new GoodsShopSelectWindow
                {
                    Goods = gu.Source,
                    InitSelectedShopIds = gu.Source.Shops.Where(obj => obj.State == to).Select(obj => obj.ShopId).ToArray()
                };
                var ret = win.ShowDialog();
                if (ret == null || ret.Value == false)
                {
                    return;
                }

                int afCount = 0;

                foreach (var v in gu.Source.Shops)
                {
                    bool isChecked = win.SelectedShops.Contains(v.ShopId);

                    if (v.State == from && isChecked)
                    {
                        v.State = to;
                        if (v.State == GoodsState.UPLOADED)
                        {
                            v.UploadTime     = DateTime.Now;
                            v.UploadOperator = OperatorService.LoginOperator.Number;
                        }
                        if (v.State == GoodsState.WAITREVIEW)
                        {
                            v.ProcessImageTime     = DateTime.Now;
                            v.ProcessImageOperator = OperatorService.LoginOperator.Number;
                        }
                        afCount++;
                    }

                    //撤消回滚状态
                    if (v.State == to && isChecked == false)
                    {
                        v.State = from;
                        if (v.State == GoodsState.WAITREVIEW)
                        {
                            v.UploadTime     = ServiceContainer.GetService <GoodsService>().GetDBMinTime();
                            v.UploadOperator = "";
                        }
                        if (v.State == GoodsState.WAITPROCESSIMAGE)
                        {
                            v.ProcessImageTime     = ServiceContainer.GetService <GoodsService>().GetDBMinTime();
                            v.ProcessImageOperator = "";
                        }
                        afCount++;
                    }
                    ServiceContainer.GetService <GoodsShopService>().Update(v);
                }
                if (afCount > 0)
                {
                    MessageBox.Show("已标记成功");
                }
                else
                {
                    MessageBox.Show("未更新任何数据");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }