Browse Source

增加分割扫码入库功能。

master
yibo 7 years ago
parent
commit
59bbd1fb0a
12 changed files with 322 additions and 6 deletions
  1. +9
    -0
      B3ClientService.Web/B3ClientService.Web.csproj
  2. +24
    -0
      B3ClientService.Web/Pages/B3ClientService/BaseInfos/Store_/StoreEdit.cs
  3. +13
    -0
      B3ClientService.Web/Pages/B3ClientService/BaseInfos/Store_/StoreList.cs
  4. +43
    -0
      B3ClientService.Web/Pages/B3ClientService/BaseInfos/Store_/StoreList.xml
  5. +2
    -0
      B3ClientService/B3ClientService.csproj
  6. +20
    -0
      B3ClientService/BL/BaseInfo/StoreBL.cs
  7. +12
    -4
      B3ClientService/BO/BaseInfo/Store.cs
  8. +7
    -0
      B3ClientService/BO/Bill/SegmentProductionInfo.cs
  9. +6
    -0
      B3ClientService/OfflinRpc/BaseInfoRpc.cs
  10. +175
    -0
      B3ClientService/OfflinRpc/SegmentInStoreRpc.cs
  11. +0
    -2
      B3ClientService/OfflinRpc/SegmentProductionRpc.cs
  12. +11
    -0
      WebFolder/config/plugins/B3ClientService.plugin

+ 9
- 0
B3ClientService.Web/B3ClientService.Web.csproj View File

@ -83,6 +83,12 @@
<Compile Include="Pages\B3ClientService\BaseInfos\ClientGoodsSet_\ClientGoodsSetList.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Pages\B3ClientService\BaseInfos\Store_\StoreEdit.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Pages\B3ClientService\BaseInfos\Store_\StoreList.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Pages\B3ClientService\BaseInfos\WorkUnit_\WorkUnitEdit.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
@ -201,6 +207,9 @@
<ItemGroup>
<EmbeddedResource Include="Pages\B3ClientService\Bills\CarcassInventory_\CarcassInventoryList.xml" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Pages\B3ClientService\BaseInfos\Store_\StoreList.xml" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.


+ 24
- 0
B3ClientService.Web/Pages/B3ClientService/BaseInfos/Store_/StoreEdit.cs View File

@ -0,0 +1,24 @@
using BWP.B3ClientService.BL;
using BWP.B3ClientService.BO;
using BWP.Web.Layout;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BWP.Web.Pages.B3ClientService.BaseInfos.Store_
{
class StoreEdit : BaseInfoEditPage<Store, IStoreBL>
{
protected override void BuildBody(System.Web.UI.Control parent)
{
var layoutManager = new LayoutManager("main", mDFInfo, mDFContainer);
var config = new AutoLayoutConfig() { Cols = 8 };
config.Add("Name");
config.Add("Code");
config.Add("Remark");
layoutManager.Config = config;
parent.Controls.Add(layoutManager.CreateLayout());
}
}
}

+ 13
- 0
B3ClientService.Web/Pages/B3ClientService/BaseInfos/Store_/StoreList.cs View File

@ -0,0 +1,13 @@
using BWP.B3ClientService.BL;
using BWP.B3ClientService.BO;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BWP.Web.Pages.B3ClientService.BaseInfos.Store_
{
class StoreList : BaseInfoListPage<Store, IStoreBL>
{
}
}

+ 43
- 0
B3ClientService.Web/Pages/B3ClientService/BaseInfos/Store_/StoreList.xml View File

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8" ?>
<Select xmlns="urn:XDQuery">
<Columns>
<Field name="ID"/>
</Columns>
<From>
<DmoClass class="BWP.B3ClientService.BO.Store, B3ClientService"/>
</From>
<Where>
<And>
<EQ>
<Field name="ID"/>
<QBE paramName="ID"/>
</EQ>
<Contains>
<Field name="Code"/>
<QBE paramName="Code"/>
</Contains>
<Or>
<Contains>
<Field name="Name"/>
<QBE paramName="Name"/>
</Contains>
<Contains>
<Field name="Spell"/>
<QBE paramName="Name"/>
</Contains>
</Or>
<EQ>
<Field name="Stopped"/>
<QBE paramName="Stopped"/>
</EQ>
<EQ>
<Field name="IsLocked"/>
<QBE paramName="IsLocked"/>
</EQ>
<Contains>
<Field name="Remark"/>
<QBE paramName="Remark"/>
</Contains>
</And>
</Where>
</Select>

+ 2
- 0
B3ClientService/B3ClientService.csproj View File

@ -109,6 +109,7 @@
<Compile Include="BL\BaseInfo\ClientGoodsSetBL.cs" />
<Compile Include="BL\BaseInfo\GoodsBL.cs" />
<Compile Include="BL\BaseInfo\ProductBatchBL.cs" />
<Compile Include="BL\BaseInfo\StoreBL.cs" />
<Compile Include="BL\BaseInfo\WorkerBL.cs" />
<Compile Include="BL\BaseInfo\WorkUnitBL.cs" />
<Compile Include="BL\Bill\CarcassInventoryBL.cs" />
@ -208,6 +209,7 @@
<Compile Include="OfflinRpc\GradeAndWeightBL.cs" />
<Compile Include="OfflinRpc\LoginRpc.cs" />
<Compile Include="OfflinRpc\SectionStoreDetailRpc.cs" />
<Compile Include="OfflinRpc\SegmentInStoreRpc.cs" />
<Compile Include="OfflinRpc\SegmentProductionRpc.cs" />
<Compile Include="OfflinRpc\MiniProgramRpc.cs" />
<Compile Include="Rpcs\BillRpc\BaseInfoRpc.cs" />


+ 20
- 0
B3ClientService/BL/BaseInfo/StoreBL.cs View File

@ -0,0 +1,20 @@
using BWP.B3ClientService.BO;
using BWP.B3Frameworks.BL;
using Forks.EnterpriseServices;
using Forks.EnterpriseServices.BusinessInterfaces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BWP.B3ClientService.BL
{
[LogicName("仓库")]
[BusinessInterface(typeof(StoreBL))]
public interface IStoreBL : IBaseInfoBL<Store>
{ }
public class StoreBL : BaseInfoBL<Store>, IStoreBL
{
}
}

+ 12
- 4
B3ClientService/BO/BaseInfo/Store.cs View File

@ -1,13 +1,21 @@
using System;
using Forks.EnterpriseServices;
using Forks.EnterpriseServices.DataForm;
using Forks.EnterpriseServices.DomainObjects2;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
namespace BWP.B3ClientService.BO
{
[Serializable]
public class Store: BaseInfo
[DFClass, Serializable]
[LogicName("存货")]
public class Store: B3Frameworks.BO.BaseInfo, B3Frameworks.BO.IWithCodeBaseInfo
{
[LogicName("编码")]
[DFNotEmpty]
[DbColumn(DbType = SqlDbType.NVarChar, AllowNull = false, Unique = true)]
public string Code { get; set; }
}
}

+ 7
- 0
B3ClientService/BO/Bill/SegmentProductionInfo.cs View File

@ -54,9 +54,16 @@ namespace BWP.B3ClientService.BO
[LogicName("入库时间")]
[DbColumn(DbType = SqlDbType.DateTime)]
public DateTime? InStoreTime { get; set; }
[LogicName("仓库")]
public long? Store_ID { get; set; }
#endregion
#region 领用信息
#endregion
public bool IsDelete { get; set; }
public bool IsSync { get; set; }
}
}

+ 6
- 0
B3ClientService/OfflinRpc/BaseInfoRpc.cs View File

@ -131,6 +131,12 @@ namespace BWP.B3ClientService.Rpcs
return JsonConvert.SerializeObject(list);
}
[Rpc(RpcFlags.SkipAuth)]
public static string SyncStore()
{
return GetBaseInfoJosn<Store>();
}
class MinBaseInfo
{
public long ID { get; set; }


+ 175
- 0
B3ClientService/OfflinRpc/SegmentInStoreRpc.cs View File

@ -0,0 +1,175 @@
using BWP.B3ClientService.BO;
using Forks.EnterpriseServices.DomainObjects2;
using Forks.EnterpriseServices.DomainObjects2.DQuery;
using Forks.EnterpriseServices.JsonRpc;
using Forks.EnterpriseServices.SqlDoms;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TSingSoft.WebPluginFramework;
namespace BWP.B3ClientService.Rpcs
{
[Rpc]
public static class SegmentInStoreRpc
{
[Rpc(RpcFlags.SkipAuth)]
public static string GetSegmentProductInfo(string barCode)
{
var main = new JoinAlias(typeof(SegmentProductionInfo));
var goods = new JoinAlias(typeof(Goods));
var query = new DQueryDom(main);
query.From.AddJoin(JoinType.Left, new DQDmoSource(goods), DQCondition.EQ(main, "Goods_ID", goods, "ID"));
query.Where.Conditions.Add(DQCondition.EQ("BarCode", barCode));
query.Columns.Add(DQSelectColumn.Field("Code", goods));
query.Columns.Add(DQSelectColumn.Field("Name", goods));
query.Columns.Add(DQSelectColumn.Field("Spec", goods));
query.Columns.Add(DQSelectColumn.Field("ProductTime"));
query.Columns.Add(DQSelectColumn.Field("Weight"));
using (var session = Dmo.NewSession())
{
using (var reader = session.ExecuteReader(query))
{
if (reader.Read())
{
var entity = new SegmentProductObj();
entity.Goods_Code = (string)reader[0];
entity.Goods_Name = (string)reader[1];
entity.Goods_Spec = (string)reader[2];
entity.ProductTime = (DateTime?)reader[3];
entity.Weight = (decimal?)reader[4];
return JsonConvert.SerializeObject(entity);
}
}
}
return string.Empty;
}
[Rpc(RpcFlags.SkipAuth)]
public static int UploadSegmentInStoreInfo(string json)
{
var list = JsonConvert.DeserializeObject<List<SegmentInStoreObj>>(json);
using (var session = Dmo.NewSession())
{
/* BarCode InStoreTime Store_ID State */
foreach (var item in list)
{
var id = Exist(session, item.BarCode);
if (id == null)
{
if (item.Delete)
continue;
var entity = new SegmentProductionInfo();
entity.BarCode = item.BarCode;
if (item.State == 2)
{
entity.InStoreTime = item.InStoreTime;
entity.Store_ID = item.Store_ID;
entity.IsDelete = true;
}
else
{
entity.InStoreTime = item.InStoreTime;
entity.Store_ID = item.Store_ID;
}
session.Insert(entity);
}
else
Update(session, id.Value, item);
}
session.Commit();
}
return 1;
}
static long? Exist(IDmoSession session, string barCode)
{
var query = new DQueryDom(new JoinAlias(typeof(SegmentProductionInfo)));
query.Columns.Add(DQSelectColumn.Field("ID"));
query.Where.Conditions.Add(DQCondition.EQ("BarCode", barCode));
return query.EExecuteScalar<long?>(session);
}
private static void Update(IDmoSession session, long id, SegmentInStoreObj entity)
{
var update = new DQUpdateDom(typeof(SegmentProductionInfo));
if (entity.Delete || entity.State == 2)
{
update.Columns.Add(new DQUpdateColumn("InStoreTime", DQExpression.NULL));
update.Columns.Add(new DQUpdateColumn("Store_ID", DQExpression.NULL));
if (entity.State == 2)
update.Columns.Add(new DQUpdateColumn("IsDelete", true));
}
else
{
update.Columns.Add(new DQUpdateColumn("InStoreTime", entity.InStoreTime));
update.Columns.Add(new DQUpdateColumn("Store_ID", entity.Store_ID));
}
update.Columns.Add(new DQUpdateColumn("IsSync", false));
update.Where.Conditions.Add(DQCondition.EQ("ID", id));
session.ExecuteNonQuery(update);
}
[Rpc(RpcFlags.SkipAuth)]
public static string GetUnInStoreList()
{
var main = new JoinAlias(typeof(SegmentProductionInfo));
var goods = new JoinAlias(typeof(Goods));
var query = new DQueryDom(main);
query.From.AddJoin(JoinType.Left, new DQDmoSource(goods), DQCondition.EQ(main, "Goods_ID", goods, "ID"));
query.Where.Conditions.Add(DQCondition.And(DQCondition.IsNull(DQExpression.Field("InStoreTime")), DQCondition.EQ("IsDelete", false)));
query.Columns.Add(DQSelectColumn.Field("BarCode"));
query.Columns.Add(DQSelectColumn.Field("Code", goods));
query.Columns.Add(DQSelectColumn.Field("Name", goods));
query.Columns.Add(DQSelectColumn.Field("Spec", goods));
query.Columns.Add(DQSelectColumn.Field("ProductTime"));
query.Columns.Add(DQSelectColumn.Field("Weight"));
query.OrderBy.Expressions.Add(DQOrderByExpression.Create("ID"));
var list = new List<SegmentProductObj>();
using (var session = Dmo.NewSession())
{
using (var reader = session.ExecuteReader(query))
{
while (reader.Read())
{
var obj = new SegmentProductObj();
obj.BarCode = (string)reader[0];
obj.Goods_Code = (string)reader[1];
obj.Goods_Name = (string)reader[2];
obj.Goods_Spec = (string)reader[3];
obj.ProductTime = (DateTime?)reader[4];
obj.Weight = (decimal?)reader[5];
list.Add(obj);
}
}
}
return JsonConvert.SerializeObject(list);
}
}
class SegmentInStoreObj
{
public string BarCode { get; set; }
public DateTime InStoreTime { get; set; }
public long? Store_ID { get; set; }
public int State { get; set; }
public bool Delete { get; set; }
}
class SegmentProductObj
{
public string BarCode { get; set; }
public string Goods_Name { get; set; }
public string Goods_Code { get; set; }
public string Goods_Spec { get; set; }
public decimal? Weight { get; set; }
public DateTime? ProductTime { get; set; }
}
}

+ 0
- 2
B3ClientService/OfflinRpc/SegmentProductionRpc.cs View File

@ -33,8 +33,6 @@ namespace BWP.B3ClientService.Rpcs
entity.BarCode = item.BarCode;
foreach (var f in ProductInfoFields)
dmoType.GetProperty(f).SetValue(entity, MinDmoType.GetProperty(f).GetValue(item, null), null);
//还没做入库客户端,先这么搞
entity.InStoreTime = entity.ProductTime;
session.Insert(entity);
}
else


+ 11
- 0
WebFolder/config/plugins/B3ClientService.plugin View File

@ -90,6 +90,16 @@
<Function index="6" name="锁定" />
<Function index="7" name="解锁" />
</FunctionGroup>
<FunctionGroup name="仓库" roleSchemas="default">
<Function index="0" name="访问" />
<Function index="1" name="新建" />
<Function index="2" name="编辑" />
<Function index="3" name="删除" />
<Function index="4" name="停用" />
<Function index="5" name="启用" />
<Function index="6" name="锁定" />
<Function index="7" name="解锁" />
</FunctionGroup>
<FunctionGroup name="客户端存货配置" roleSchemas="default">
<Function index="0" name="访问" />
<Function index="1" name="新建" />
@ -128,6 +138,7 @@
<Menu id="0011" name="MES系统/基础信息/生产批次" roles="B3ClientService.生产批次.访问" url="B3ClientService/BaseInfos/ProductBatch_/ProductBatchList.aspx"/>
<Menu id="0012" name="MES系统/系统管理/存货配置" roles="B3ClientService.客户端存货配置.访问" url="B3ClientService/BaseInfos/ClientGoodsSet_/ClientGoodsSetList.aspx"/>
<Menu id="0013" name="MES系统/系统管理/条段配置" roles="B3ClientService.系统管理.条段配置" url="B3ClientService/Bills/SectionConfigPage.aspx"/>
<Menu id="0014" name="MES系统/基础信息/仓库" roles="B3ClientService.仓库.访问" url="B3ClientService/BaseInfos/Store_/StoreList.aspx"/>
<Menu id="0020" name="MES系统/业务单据/盘点单" roles="B3ClientService.盘点单.访问" url="B3ClientService/Bills/CarcassInventory_/CarcassInventoryList.aspx"/>


Loading…
Cancel
Save