Browse Source

存货加标识。

master
yibo 7 years ago
parent
commit
6c9f121f5b
7 changed files with 42 additions and 3 deletions
  1. +1
    -0
      B3ClientService.Web/Pages/B3ClientService/BaseInfos/Goods_/GoodsEdit.cs
  2. +9
    -0
      B3ClientService.Web/Pages/B3ClientService/BaseInfos/Goods_/GoodsList.cs
  3. +4
    -0
      B3ClientService.Web/Pages/B3ClientService/BaseInfos/Goods_/GoodsList.xml
  4. +6
    -1
      B3ClientService/BO/BaseInfo/Goods.cs
  5. +6
    -0
      B3ClientService/NamedValueTemplate.cs
  6. +12
    -2
      B3ClientService/OfflinRpc/BaseInfoRpc.cs
  7. +4
    -0
      WebFolder/config/NamedValue/B3ClientService.xml

+ 1
- 0
B3ClientService.Web/Pages/B3ClientService/BaseInfos/Goods_/GoodsEdit.cs View File

@ -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());


+ 9
- 0
B3ClientService.Web/Pages/B3ClientService/BaseInfos/Goods_/GoodsList.cs View File

@ -10,6 +10,14 @@ namespace BWP.Web.Pages.B3ClientService.BaseInfos.Goods_
{
public class GoodsList : BaseInfoListPage<Goods, IGoodsBL>
{
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");
}
}
}


+ 4
- 0
B3ClientService.Web/Pages/B3ClientService/BaseInfos/Goods_/GoodsList.xml View File

@ -12,6 +12,10 @@
<Field name="ID"/>
<QBE paramName="ID"/>
</EQ>
<EQ>
<Field name="GoodsType"/>
<QBE paramName="GoodsType"/>
</EQ>
<Contains>
<Field name="Code"/>
<QBE paramName="Code"/>


+ 6
- 1
B3ClientService/BO/BaseInfo/Goods.cs View File

@ -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; }
}
}

+ 6
- 0
B3ClientService/NamedValueTemplate.cs View File

@ -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);
}
}

+ 12
- 2
B3ClientService/OfflinRpc/BaseInfoRpc.cs View File

@ -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<List<Tuple<long, int>>>(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<MinClientGoodsSet>();
@ -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<long, string, DateTime?>().Select(x => new { ID = x.Item1, Name = x.Item2, Date = x.Item3 });
var result = query.EExecuteList<long, string, DateTime?>().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


+ 4
- 0
WebFolder/config/NamedValue/B3ClientService.xml View File

@ -33,4 +33,8 @@
<Word name="屠宰" value="0"/>
<Word name="分割" value="1"/>
</NamedValue>
<NamedValue type="BWP.B3ClientService.NamedValueTemplate.存货类别, B3ClientService">
<Word name="鲜品" value="0"/>
<Word name="冻品" value="1"/>
</NamedValue>
</NamedValueSettings>

Loading…
Cancel
Save