From 6c9f121f5bc7a3ab733e69a79b8374b4f6ce9442 Mon Sep 17 00:00:00 2001 From: yibo <361071264@qq.com> Date: Tue, 11 Sep 2018 09:06:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=98=E8=B4=A7=E5=8A=A0=E6=A0=87=E8=AF=86?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../B3ClientService/BaseInfos/Goods_/GoodsEdit.cs | 1 + .../B3ClientService/BaseInfos/Goods_/GoodsList.cs | 9 +++++++++ .../B3ClientService/BaseInfos/Goods_/GoodsList.xml | 4 ++++ B3ClientService/BO/BaseInfo/Goods.cs | 7 ++++++- B3ClientService/NamedValueTemplate.cs | 6 ++++++ B3ClientService/OfflinRpc/BaseInfoRpc.cs | 14 ++++++++++++-- WebFolder/config/NamedValue/B3ClientService.xml | 4 ++++ 7 files changed, 42 insertions(+), 3 deletions(-) diff --git a/B3ClientService.Web/Pages/B3ClientService/BaseInfos/Goods_/GoodsEdit.cs b/B3ClientService.Web/Pages/B3ClientService/BaseInfos/Goods_/GoodsEdit.cs index 1cca119..0ef75f5 100644 --- a/B3ClientService.Web/Pages/B3ClientService/BaseInfos/Goods_/GoodsEdit.cs +++ b/B3ClientService.Web/Pages/B3ClientService/BaseInfos/Goods_/GoodsEdit.cs @@ -19,6 +19,7 @@ namespace BWP.Web.Pages.B3ClientService.BaseInfos.Goods_ config.Add("Spec"); config.Add("MainUnit"); config.Add("SecondUnit"); + config.Add("GoodsType"); config.Add("Remark"); layoutManager.Config = config; parent.Controls.Add(layoutManager.CreateLayout()); diff --git a/B3ClientService.Web/Pages/B3ClientService/BaseInfos/Goods_/GoodsList.cs b/B3ClientService.Web/Pages/B3ClientService/BaseInfos/Goods_/GoodsList.cs index eb887ca..354d38e 100644 --- a/B3ClientService.Web/Pages/B3ClientService/BaseInfos/Goods_/GoodsList.cs +++ b/B3ClientService.Web/Pages/B3ClientService/BaseInfos/Goods_/GoodsList.cs @@ -10,6 +10,14 @@ namespace BWP.Web.Pages.B3ClientService.BaseInfos.Goods_ { public class GoodsList : BaseInfoListPage { + protected override void AddQueryControls(VLayoutPanel vPanel) + { + vPanel.Add(CreateDefaultBaseInfoQueryControls((panel, config) => + { + config.AddAfter("GoodsType", "Name"); + })); + } + protected override void AddDFBrowseGridColumn(DFBrowseGrid grid, string field) { base.AddDFBrowseGridColumn(grid, field); @@ -17,6 +25,7 @@ namespace BWP.Web.Pages.B3ClientService.BaseInfos.Goods_ { AddDFBrowseGridColumn(grid, "Spec"); AddDFBrowseGridColumn(grid, "MainUnit"); + AddDFBrowseGridColumn(grid, "GoodsType"); } } } diff --git a/B3ClientService.Web/Pages/B3ClientService/BaseInfos/Goods_/GoodsList.xml b/B3ClientService.Web/Pages/B3ClientService/BaseInfos/Goods_/GoodsList.xml index 7f1a4d9..6ea8e0e 100644 --- a/B3ClientService.Web/Pages/B3ClientService/BaseInfos/Goods_/GoodsList.xml +++ b/B3ClientService.Web/Pages/B3ClientService/BaseInfos/Goods_/GoodsList.xml @@ -12,6 +12,10 @@ + + + + diff --git a/B3ClientService/BO/BaseInfo/Goods.cs b/B3ClientService/BO/BaseInfo/Goods.cs index d3385ac..6e7e2dd 100644 --- a/B3ClientService/BO/BaseInfo/Goods.cs +++ b/B3ClientService/BO/BaseInfo/Goods.cs @@ -1,6 +1,8 @@ -using Forks.EnterpriseServices; +using BWP.B3ClientService.NamedValueTemplate; +using Forks.EnterpriseServices; using Forks.EnterpriseServices.DataForm; using Forks.EnterpriseServices.DomainObjects2; +using Forks.Utils; using System; using System.Collections.Generic; using System.Data; @@ -28,5 +30,8 @@ namespace BWP.B3ClientService.BO [LogicName("辅单位")] [DFNotEmpty] public string SecondUnit { get; set; } + + [LogicName("存货类别")] + public NamedValue<存货类别>? GoodsType { get; set; } } } diff --git a/B3ClientService/NamedValueTemplate.cs b/B3ClientService/NamedValueTemplate.cs index 9d788b4..e0663b8 100644 --- a/B3ClientService/NamedValueTemplate.cs +++ b/B3ClientService/NamedValueTemplate.cs @@ -50,4 +50,10 @@ namespace BWP.B3ClientService.NamedValueTemplate public static readonly NamedValue<批次类型> 屠宰 = new NamedValue<批次类型>(0); public static readonly NamedValue<批次类型> 分割 = new NamedValue<批次类型>(1); } + + public sealed class 存货类别 + { + public static readonly NamedValue<存货类别> 鲜品 = new NamedValue<存货类别>(0); + public static readonly NamedValue<存货类别> 冻品 = new NamedValue<存货类别>(1); + } } diff --git a/B3ClientService/OfflinRpc/BaseInfoRpc.cs b/B3ClientService/OfflinRpc/BaseInfoRpc.cs index 85841a7..fedeab9 100644 --- a/B3ClientService/OfflinRpc/BaseInfoRpc.cs +++ b/B3ClientService/OfflinRpc/BaseInfoRpc.cs @@ -1,8 +1,10 @@ using BWP.B3ClientService.BO; +using BWP.B3ClientService.NamedValueTemplate; using Forks.EnterpriseServices.DomainObjects2; using Forks.EnterpriseServices.DomainObjects2.DQuery; using Forks.EnterpriseServices.JsonRpc; using Forks.EnterpriseServices.SqlDoms; +using Forks.Utils; using Newtonsoft.Json; using System; using System.Collections.Generic; @@ -63,6 +65,7 @@ namespace BWP.B3ClientService.Rpcs } [Rpc(RpcFlags.SkipAuth)] + //类别、本地客户端配置、本地存货配置 public static string SyncClientGoodsSetByClient(short type, string par, string p2) { var local = JsonConvert.DeserializeObject>>(par); @@ -89,6 +92,7 @@ namespace BWP.B3ClientService.Rpcs query.Columns.Add(DQSelectColumn.Field("Code", goods)); query.Columns.Add(DQSelectColumn.Field("Spec", goods)); query.Columns.Add(DQSelectColumn.Field("MainUnit", goods)); + query.Columns.Add(DQSelectColumn.Field("GoodsType", goods)); query.Columns.Add(DQSelectColumn.Field("RowVersion", goods)); var insert = new List(); @@ -150,11 +154,12 @@ namespace BWP.B3ClientService.Rpcs if (!gsID.Contains(goodsID)) gsID.Add(goodsID); - var gVersion = (int)reader[12]; + var gVersion = (int)reader[13]; if (!g2.Any(x => x.Item1 == goodsID))//insert { if (!gInsert.Any(x => x.ID == goodsID)) { + var gt = (NamedValue<存货类别>?)reader[12]; gInsert.Add(new MinGoods { ID = goodsID, @@ -162,6 +167,7 @@ namespace BWP.B3ClientService.Rpcs Code = (string)reader[9], Spec = (string)reader[10], MainUnit = (string)reader[11], + GoodsType = (NamedValue<存货类别>?)reader[12], RowVersion = gVersion }); } @@ -177,6 +183,7 @@ namespace BWP.B3ClientService.Rpcs Code = (string)reader[9], Spec = (string)reader[10], MainUnit = (string)reader[11], + GoodsType = (NamedValue<存货类别>?)reader[12], RowVersion = gVersion }); } @@ -202,7 +209,7 @@ namespace BWP.B3ClientService.Rpcs query.Range = SelectRange.Top(top); query.OrderBy.Expressions.Add(DQOrderByExpression.Create("Date", true)); query.Where.Conditions.Add(DQCondition.And(DQCondition.EQ("BatchType", type), DQCondition.EQ("Stopped", false))); - var result= query.EExecuteList().Select(x => new { ID = x.Item1, Name = x.Item2, Date = x.Item3 }); + var result = query.EExecuteList().Select(x => new { ID = x.Item1, Name = x.Item2, Date = x.Item3 }); return JsonConvert.SerializeObject(result); } @@ -239,6 +246,9 @@ namespace BWP.B3ClientService.Rpcs public string Code { get; set; } public string Spec { get; set; } public string MainUnit { get; set; } + + [JsonConverter(typeof(NameValueJsonConverter<存货类别>))] + public NamedValue<存货类别>? GoodsType { get; set; } } class MinClientGoodsSet : MinBaseInfo diff --git a/WebFolder/config/NamedValue/B3ClientService.xml b/WebFolder/config/NamedValue/B3ClientService.xml index 44682e0..d731dbe 100644 --- a/WebFolder/config/NamedValue/B3ClientService.xml +++ b/WebFolder/config/NamedValue/B3ClientService.xml @@ -33,4 +33,8 @@ + + + + \ No newline at end of file