Browse Source

赶猪确认

master
yibo 7 years ago
parent
commit
185b82b49c
6 changed files with 91 additions and 12 deletions
  1. +1
    -0
      B3ClientService/B3ClientService.csproj
  2. +9
    -0
      B3ClientService/B3ClientServiceOnLineConfig.cs
  3. +1
    -0
      B3ClientService/NamedValueTemplate.cs
  4. +55
    -0
      B3ClientService/Rpcs/PickOutConfirmRpc.cs
  5. +24
    -12
      B3ClientService/Tasks/AutoCreateProductBatchTask.cs
  6. +1
    -0
      WebFolder/config/NamedValue/B3ClientService.xml

+ 1
- 0
B3ClientService/B3ClientService.csproj View File

@ -224,6 +224,7 @@
<Compile Include="Rpcs\BillRpc\TrunksIousOutInStoreRecord_\TrunksIousOutInStoreRecordRpc.cs" />
<Compile Include="Rpcs\BillRpc\WeChat.cs" />
<Compile Include="Rpcs\InterfaceRpc\GoodsRpc.cs" />
<Compile Include="Rpcs\PickOutConfirmRpc.cs" />
<Compile Include="Rpcs\RpcBO\Bill\ClientGoodsSetDto.cs" />
<Compile Include="Rpcs\RpcBO\Bill\GradeAndWeight\DataConfirmList.cs" />
<Compile Include="Rpcs\RpcBO\Bill\GradeAndWeight\GradeAndWeight.cs" />


+ 9
- 0
B3ClientService/B3ClientServiceOnLineConfig.cs View File

@ -27,6 +27,15 @@ namespace BWP.B3ClientService
set { _traceBackUrl = value; }
}
private StringConfigRef _productBatchRole = new StringConfigRef("");
[LogicName("自动生成批次模板")]
[ConfigurationItemGroup("MES系统")]
[ConfigurationItemDescription("自动生成批次 日期追加部分用英文半角逗号分开")]
public StringConfigRef ProductBatchRole
{
get { return _productBatchRole; }
set { _productBatchRole = value; }
}
}
}

+ 1
- 0
B3ClientService/NamedValueTemplate.cs View File

@ -21,6 +21,7 @@ namespace BWP.B3ClientService.NamedValueTemplate
public static readonly NamedValue<> = new NamedValue<>(1);
public static readonly NamedValue<> = new NamedValue<>(2);
public static readonly NamedValue<> = new NamedValue<>(3);
public static readonly NamedValue<> = new NamedValue<>(103);
}
public sealed class


+ 55
- 0
B3ClientService/Rpcs/PickOutConfirmRpc.cs View File

@ -0,0 +1,55 @@
using BWP.B3ClientService.BO;
using Forks.EnterpriseServices.DomainObjects2;
using Forks.EnterpriseServices.DomainObjects2.DQuery;
using Forks.EnterpriseServices.JsonRpc;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BWP.B3ClientService.Rpcs
{
[Rpc]
public static class PickOutConfirmRpc
{
[Rpc(RpcFlags.SkipAuth)]
public static string GetList(DateTime date)
{
var query = new DQueryDom(new JoinAlias(typeof(OrderDetail)));
query.Columns.Add(DQSelectColumn.Field("ID"));
query.Columns.Add(DQSelectColumn.Field("Order"));
query.Columns.Add(DQSelectColumn.Field("PlanNumber"));
query.Columns.Add(DQSelectColumn.Field("LiveColonyHouse_Name"));
query.Where.Conditions.Add(DQCondition.And(DQCondition.EQ("DeleteState", false), DQCondition.EQ("IsHurryButcher", false), DQCondition.EQ("Date", date)));
var list = new List<PickOutConfirmDmo>();
using (var session = Dmo.NewSession())
{
using (var reader = session.ExecuteReader(query))
{
while (reader.Read())
{
var entity = new PickOutConfirmDmo();
entity.ID = (long)reader[0];
entity.Order = (int)reader[1];
entity.PlanNumber = (int)reader[2];
entity.LiveColonyHouse_Name = (string)reader[3];
list.Add(entity);
}
}
}
return JsonConvert.SerializeObject(list);
}
class PickOutConfirmDmo
{
public long ID { get; set; }
public int Order { get; set; }
public int PlanNumber { get; set; }
public string LiveColonyHouse_Name { get; set; }
}
}
}

+ 24
- 12
B3ClientService/Tasks/AutoCreateProductBatchTask.cs View File

@ -16,22 +16,34 @@ namespace BWP.B3ClientService.Tasks
{
public void Execute()
{
var exist = Exist();
if (exist)
return;
var bl = BIFactory.Create<IProductBatchBL>();
var entity = new ProductBatch();
bl.InitNewDmo(entity);
entity.Name = DateTime.Today.ToString("yyyyMMdd"); ;
entity.Date = DateTime.Today;
bl.Insert(entity);
var role = new B3ClientServiceOnLineConfig().ProductBatchRole.Value;
var arr = role.Split(new char[] { ',' }).ToList();
if (arr.Count == 0)
arr.Add("");
using (var session = Dmo.NewSession())
{
var bl = BIFactory.Create<IProductBatchBL>(session);
foreach (var item in arr)
{
var name = DateTime.Today.ToString("yyyyMMdd") + item;
if (Exist(session, name))
continue;
var entity = new ProductBatch();
bl.InitNewDmo(entity);
entity.Name = name;
entity.Date = DateTime.Today;
bl.Insert(entity);
}
session.Commit();
}
}
bool Exist()
bool Exist(IDmoSession session, string name)
{
var query = new DQueryDom(new JoinAlias(typeof(ProductBatch)));
query.Where.Conditions.Add(DQCondition.EQ("Date", DateTime.Today));
return query.EExists();
query.Columns.Add(DQSelectColumn.Create(DQExpression.Value(1), "c"));
query.Where.Conditions.Add(DQCondition.EQ("Name", name));
return query.EExecuteScalar(session) != null;
}
public string Name


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

@ -12,6 +12,7 @@
<Word name="白条领用" value="1"/>
<Word name="分割生产" value="2"/>
<Word name="分割入库" value="3"/>
<Word name="赶猪确认" value="103"/>
</NamedValue>
<NamedValue type="BWP.B3ClientService.NamedValueTemplate.适用客户端, B3ClientService">
<Word name="白条出入库" value="0"/>


Loading…
Cancel
Save