yibo 7 years ago
parent
commit
000490475e
33 changed files with 3392 additions and 756 deletions
  1. +3
    -0
      ButcherFactory.BO/Bill/CarcassSaleOut_Detail.cs
  2. +4
    -1
      ButcherFactory.BO/Bill/SegmentInStore.cs
  3. +12
    -4
      ButcherFactory.BO/Bill/StockUpEntity.cs
  4. +1
    -0
      ButcherFactory.BO/Enums/DriveType.cs
  5. +108
    -10
      ButcherFactory.BO/LocalBL/CarcassSaleOutBL.cs
  6. +120
    -104
      ButcherFactory.BO/LocalBL/SegmentInStoreBL.cs
  7. +13
    -16
      ButcherFactory.BO/LocalBL/SegmentProductionBL.cs
  8. +51
    -61
      ButcherFactory.BO/LocalBL/SegmentStockUpBL.cs
  9. +22
    -3
      ButcherFactory.BO/Rpcs/BaseInfoSyncRpc.cs
  10. +13
    -0
      ButcherFactory.Form/ButcherFactory.Form.csproj
  11. +1214
    -0
      ButcherFactory.Form/CarcassSaleOut2_/CarcassSaleOutReadForm.Designer.cs
  12. +555
    -0
      ButcherFactory.Form/CarcassSaleOut2_/CarcassSaleOutReadForm.cs
  13. +198
    -0
      ButcherFactory.Form/CarcassSaleOut2_/CarcassSaleOutReadForm.resx
  14. +2
    -0
      ButcherFactory.Form/CarcassSaleOut_/CarcassSaleOutFormConfig.cs
  15. +3
    -3
      ButcherFactory.Form/Controls/InfoBox.cs
  16. +40
    -0
      ButcherFactory.Form/SegmentInStore_/InStoreSummaryView.cs
  17. +185
    -176
      ButcherFactory.Form/SegmentInStore_/SegmentInStoreForm.Designer.cs
  18. +157
    -64
      ButcherFactory.Form/SegmentInStore_/SegmentInStoreForm.cs
  19. +0
    -9
      ButcherFactory.Form/SegmentInStore_/SegmentInStoreForm.resx
  20. +67
    -84
      ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.Designer.cs
  21. +69
    -29
      ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.cs
  22. +2
    -1
      ButcherFactory.Form/SegmentProduction_/SegmentProductionForm.cs
  23. +6
    -1
      ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint.cs
  24. +4
    -3
      ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint.html
  25. +4
    -3
      ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint1.html
  26. +174
    -52
      ButcherFactory.Form/SegmentStockUp_/SegmentStockUpForm.Designer.cs
  27. +251
    -66
      ButcherFactory.Form/SegmentStockUp_/SegmentStockUpForm.cs
  28. +18
    -0
      ButcherFactory.Form/SegmentStockUp_/SegmentStockUpForm.resx
  29. +2
    -2
      ButcherFactory.Form/SegmentStockUp_/SegmentStockUpPrint.cs
  30. +4
    -4
      ButcherFactory.Form/SegmentStockUp_/SegmentStockUpPrint.txt
  31. +30
    -0
      ButcherFactory.Form/Utils/ControlsUtil.cs
  32. +58
    -58
      SelfHelpClient/MainForm.Designer.cs
  33. +2
    -2
      SelfHelpClient/Template.Designer.cs

+ 3
- 0
ButcherFactory.BO/Bill/CarcassSaleOut_Detail.cs View File

@ -85,6 +85,9 @@ namespace ButcherFactory.BO
public long? ScanRecord_ID { get; set; }
public string Operator { get; set; }
[DbColumn(DefaultValue = false)]
public bool IsBack { get; set; }
}
public class SaleOutStore


+ 4
- 1
ButcherFactory.BO/Bill/SegmentInStore.cs View File

@ -52,13 +52,16 @@ namespace ButcherFactory.BO
//1 正在退库
//2 已退库
public int State { get; set; }
[NonDmoProperty]//同步未入库信息时用于增量查询
public long? SID { get; set; }
}
[MapToTable("Butcher_SegmentCodeError")]
[KeyField("ID", KeyGenType.identity)]
public class SegmentCodeError
{
public long ID { get; set; }
public long ID { get; set; }
public string BarCode { get; set; }


+ 12
- 4
ButcherFactory.BO/Bill/StockUpEntity.cs View File

@ -28,9 +28,9 @@ namespace ButcherFactory.BO
{
get
{
if (StandardPic)
//if (StandardPic)
return (UnitNum ?? 0) <= (SUnitNum ?? 0);
return (SecondNumber ?? 0) <= (SSecondNumber ?? 0);
//return (SecondNumber ?? 0) <= (SSecondNumber ?? 0);
}
}
}
@ -69,13 +69,21 @@ namespace ButcherFactory.BO
}
}
[NonDmoProperty]
public string Goods_Name { get; set; }
[NonDmoProperty]
public string DeliverGoodsLine_Name { get; set; }
[NonDmoProperty]
public long BillID { get; set; }
}
public class AlreadyStockUp
{
public int State { get; set; }
public long DetailID { get; set; }
public long MaxID { get; set; }
//public bool StandardPic { get; set; }
public decimal? UnitNum { get; set; }
public decimal? SecondNumber { get; set; }
}
}

+ 1
- 0
ButcherFactory.BO/Enums/DriveType.cs View File

@ -18,6 +18,7 @@ namespace ButcherFactory.BO
= 51,
= 52,
= 53,
= 54,
//101-200是留给屠宰车间使用


+ 108
- 10
ButcherFactory.BO/LocalBL/CarcassSaleOutBL.cs View File

@ -74,6 +74,7 @@ namespace ButcherFactory.BO.LocalBL
var query = new DQueryDom(new JoinAlias(typeof(CarcassSaleOut_Detail)));
query.Where.Conditions.Add(DQCondition.EQ("BarCode", barCode));
query.Columns.Add(DQSelectColumn.Create(DQExpression.Value(1), "c"));
query.Having.Conditions.Add(DQCondition.EQ(DQExpression.Sum(DQExpression.LogicCase(DQCondition.EQ("IsBack", true), DQExpression.Value(-1), DQExpression.Value(1))), DQExpression.Value(0)));
return query.EExecuteScalar() != null;
}
@ -116,18 +117,22 @@ namespace ButcherFactory.BO.LocalBL
}
else
{
var json = ButcherFactoryUtil.SecondUrlCall<string>(MESPath + "CarcassSaleOutStoreRpc/GetCarcassInstoreInfo", barCode);
var mesInfo = JsonConvert.DeserializeObject<SaleOutCarcassObj>(json);
if (!string.IsNullOrEmpty(mesInfo.Goods_Code))
try
{
if (mesInfo.Goods_Code == "X002")//特殊处理,有个存货编码不存在。
mesInfo.Goods_Code = "0001";
var gInfo = GetGoodsInfo(mesInfo.Goods_Code);
first.Goods_Code = mesInfo.Goods_Code;
first.InStoreWeight = mesInfo.InStoreWeight;
first.Goods_ID = gInfo.Item1;
first.Goods_Name = gInfo.Item2;
var json = ButcherFactoryUtil.SecondUrlCall<string>(MESPath + "CarcassSaleOutStoreRpc/GetCarcassInstoreInfo", barCode);
var mesInfo = JsonConvert.DeserializeObject<SaleOutCarcassObj>(json);
if (!string.IsNullOrEmpty(mesInfo.Goods_Code))
{
if (mesInfo.Goods_Code == "X002")//特殊处理,有个存货编码不存在。
mesInfo.Goods_Code = "0001";
var gInfo = GetGoodsInfo(mesInfo.Goods_Code);
first.Goods_Code = mesInfo.Goods_Code;
first.InStoreWeight = mesInfo.InStoreWeight;
first.Goods_ID = gInfo.Item1;
first.Goods_Name = gInfo.Item2;
}
}
catch { };
first.BarCode = barCode;
list.Add(new Tuple<string, object>("BarCode", first.BarCode));
list.Add(new Tuple<string, object>("InStoreWeight", first.InStoreWeight));
@ -312,6 +317,99 @@ namespace ButcherFactory.BO.LocalBL
}
return new BindingList<CarcassSaleOut_Delete>(list);
}
#region 静态称发货
//插入包括条码的记录 条码、批次、数量为1 、重量为0 Fill为否
public static CarcassSaleOut_Detail ReadBarCode(string barCode, long? batchID, bool isBack)
{
using (var session = DmoSession.New())
{
var detail = new CarcassSaleOut_Detail();
if (barCode.StartsWith("G"))
{
var arr = barCode.TrimStart('G').Split(new char[] { '&' }, StringSplitOptions.RemoveEmptyEntries);
var gid = long.Parse(arr[0]);
var gInfo = GetGoodsInfo(gid);
detail.Goods_ID = gid;
detail.Goods_Name = gInfo.Item1;
detail.Goods_Code = gInfo.Item2;
detail.ProductBatch_ID = batchID;
if (arr.Length == 2)
detail.Number = 0.5m;
else
detail.Number = 1;
}
else
{
var json = ButcherFactoryUtil.SecondUrlCall<string>(MESPath + "CarcassSaleOutStoreRpc/GetCarcassInstoreInfo", barCode);
var mesInfo = JsonConvert.DeserializeObject<SaleOutCarcassObj>(json);
if (!string.IsNullOrEmpty(mesInfo.Goods_Code))
{
if (mesInfo.Goods_Code == "X002")//特殊处理,有个存货编码不存在。
mesInfo.Goods_Code = "0001";
var gInfo = GetGoodsInfo(mesInfo.Goods_Code);
detail.Goods_Code = mesInfo.Goods_Code;
detail.InStoreWeight = mesInfo.InStoreWeight;
detail.Goods_ID = gInfo.Item1;
detail.Goods_Name = gInfo.Item2;
detail.Number = 1;
}
detail.BarCode = barCode;
}
session.Insert(detail);
session.Commit();
return detail;
}
}
//为一组重量为空(或加个标识)的数据赋值重量
public static void InsertWeight(List<long> ids, decimal weight)
{
var last = ids.Last();
ids.Remove(last);
using (var session = DmoSession.New())
{
Update(session, last, new Tuple<string, object>("Filled", true), new Tuple<string, object>("Weight", weight));
if (ids.Any())
BatchUpdate(session, ids, new Tuple<string, object>("Filled", true), new Tuple<string, object>("Weight", 0));
session.Commit();
}
}
static void BatchUpdate(IDmoSession session, IEnumerable<long> ids, params Tuple<string, object>[] pops)
{
var update = new DQUpdateDom(typeof(CarcassSaleOut_Detail));
foreach (var item in pops)
update.Columns.Add(new DQUpdateColumn(item.Item1, item.Item2));
update.Where.Conditions.Add(DQCondition.InList(DQExpression.Field("ID"), ids.Select(x => DQExpression.Value(x)).ToArray()));
session.ExecuteNonQuery(update);
}
//自动发货,包括重量,默认码。只有一条数据
public static CarcassSaleOut_Detail AutoFill(string barCode, long? batchID, decimal weight)
{
using (var session = DmoSession.New())
{
var detail = new CarcassSaleOut_Detail();
var gid = long.Parse(barCode.TrimStart('G'));
var gInfo = GetGoodsInfo(gid);
detail.Goods_ID = gid;
detail.Goods_Name = gInfo.Item1;
detail.Goods_Code = gInfo.Item2;
detail.ProductBatch_ID = batchID;
detail.Number = 1;
detail.Filled = true;
detail.Weight = weight;
session.Insert(detail);
session.Commit();
return detail;
}
}
#endregion
}
class SaleOutCarcassObj


+ 120
- 104
ButcherFactory.BO/LocalBL/SegmentInStoreBL.cs View File

@ -6,9 +6,9 @@ using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ButcherFactory.BO.LocalBL
{
@ -22,7 +22,6 @@ namespace ButcherFactory.BO.LocalBL
query.Columns.Add(DQSelectColumn.Field("ID"));
query.Columns.Add(DQSelectColumn.Field("RowIndex"));
query.Columns.Add(DQSelectColumn.Field("BarCode"));
query.Columns.Add(DQSelectColumn.Field("Goods_Code"));
query.Columns.Add(DQSelectColumn.Field("Goods_Name"));
query.Columns.Add(DQSelectColumn.Field("Goods_Spec"));
query.Columns.Add(DQSelectColumn.Field("Weight"));
@ -36,7 +35,7 @@ namespace ButcherFactory.BO.LocalBL
query.Where.Conditions.Add(DQCondition.EQ("State", state));
if (state == 0)
query.Where.Conditions.Add(DQCondition.Between("InStoreTime", DateTime.Today, DateTime.Today + new TimeSpan(23, 59, 59)));
query.OrderBy.Expressions.Add(DQOrderByExpression.Create("RowIndex"));
query.OrderBy.Expressions.Add(DQOrderByExpression.Create("RowIndex", true));
var list = new List<SegmentInStore>();
using (var session = DmoSession.New())
{
@ -48,14 +47,13 @@ namespace ButcherFactory.BO.LocalBL
entity.ID = (long)reader[0];
entity.RowIndex = (int?)reader[1];
entity.BarCode = (string)reader[2];
entity.Goods_Code = (string)reader[3];
entity.Goods_Name = (string)reader[4];
entity.Goods_Spec = (string)reader[5];
entity.Weight = (decimal?)reader[6];
entity.Goods_Name = (string)reader[3];
entity.Goods_Spec = (string)reader[4];
entity.Weight = (decimal?)reader[5];
if (state == 0)
entity.InStoreTime = (DateTime)reader[7];
entity.InStoreTime = (DateTime)reader[6];
else
entity.ProductTime = (DateTime?)reader[7];
entity.ProductTime = (DateTime?)reader[6];
list.Add(entity);
}
}
@ -66,79 +64,55 @@ namespace ButcherFactory.BO.LocalBL
public static BindingList<SegmentCodeError> GetExceptionList()
{
var query = new DmoQuery(typeof(SegmentCodeError));
query.OrderBy.Expressions.Add(DQOrderByExpression.Create("ID"));
query.OrderBy.Expressions.Add(DQOrderByExpression.Create("ID", true));
query.Range = SelectRange.Top(10);
using (var session = DmoSession.New())
{
return new BindingList<SegmentCodeError>(session.ExecuteList(query).Cast<SegmentCodeError>().ToList());
}
}
public static BindingList<SegmentInStore> GetUnInStoreList()
public static void InsertSegmentCodeError(SegmentCodeError entity)
{
using (var session = DmoSession.New())
{
session.Insert(entity);
session.Commit();
}
}
public static List<SegmentInStore> GetUnInStoreList(long? maxID = null)
{
try
{
var json = RpcFacade.Call<string>(RpcPath + "GetUnInStoreList");
var json = RpcFacade.Call<string>(RpcPath + "GetUnInStoreList", 50, maxID, "[_goods].[Name] not like '%冻%'");
var list = JsonConvert.DeserializeObject<List<SegmentInStore>>(json);
//var inStored = GetInstoredList(list.Select(x => x.BarCode));
// var result = list.Where(x => !inStored.Any(y => x.BarCode == y)).ToList();
var idx = 1;
foreach (var item in list)
{
item.RowIndex = idx;
idx++;
}
return new BindingList<SegmentInStore>(list);
return list;
}
catch
{
#if DEBUG
throw;
#endif
return null;
return new List<SegmentInStore>();
}
}
static List<string> GetInstoredList(IEnumerable<string> barCodes)
public static string InsertInStore(SegmentInStore entity)
{
var query = new DQueryDom(new JoinAlias(typeof(SegmentInStore)));
query.Columns.Add(DQSelectColumn.Field("BarCode"));
query.Where.Conditions.Add(DQCondition.And(DQCondition.InList(DQExpression.Field("BarCode"), barCodes.Select(x => DQExpression.Value(x)).ToArray()), DQCondition.InEQ("State", -1)));
using (var session = DmoSession.New())
{
return query.EExecuteList<string>(session);
}
}
public static SegmentInStore InsertInStore(string barCode, long? storeID, int rowIndex, out string msg)
{
using (var session = DmoSession.New())
{
var entity = new SegmentInStore();
entity.BarCode = barCode;
entity.Store_ID = storeID;
var localData = GetLocalData(session, entity.BarCode);
entity.InStoreTime = DateTime.Now;
entity.RowIndex = rowIndex;
var localData = GetLocalData(session, barCode);
if (localData == null) //if not exist LoadFromServer
if (localData == null)
{
try
{
var json = RpcFacade.Call<string>(RpcPath + "GetSegmentProductInfo", barCode);
var obj = JsonConvert.DeserializeObject<SegmentProductObj>(json);
entity.Goods_Code = obj.Goods_Code;
entity.Goods_Name = obj.Goods_Name;
entity.Goods_Spec = obj.Goods_Spec;
entity.ProductTime = obj.ProductTime;
entity.Weight = obj.Weight;
session.Insert(entity);
}
catch
{
#if DEBUG
throw;
#endif
}
session.Insert(entity);
}
else
{
@ -149,32 +123,52 @@ namespace ButcherFactory.BO.LocalBL
Update(session, entity.ID,
new Tuple<string, object>("Store_ID", entity.Store_ID),
new Tuple<string, object>("InStoreTime", entity.InStoreTime),
new Tuple<string, object>("RowIndex", rowIndex),
new Tuple<string, object>("RowIndex", entity.RowIndex),
new Tuple<string, object>("State", 0)
);
FillFromLocal(session, entity);
}
else
{
//if inStored Error 已入库
//if isBacking Error 正在退库
//if back Error 已退库
var append = "已入库";
var msg = "重复入库";
switch (localData.Item2)
{
case 1:
append = "正在退库";
msg = "正在退库";
break;
case 2:
append = "已退库";
msg = "已退库";
break;
}
msg = string.Format("入库失败!当前条码{0}", append);
return null;
return msg;
}
}
session.Commit();
msg = string.Empty;
return entity;
return null;
}
}
static void FillFromLocal(IDmoSession session, SegmentInStore obj)
{
var query = new DQueryDom(new JoinAlias(typeof(SegmentInStore)));
query.Columns.Add(DQSelectColumn.Field("Goods_Name"));
query.Columns.Add(DQSelectColumn.Field("Goods_Spec"));
query.Columns.Add(DQSelectColumn.Field("Weight"));
query.Columns.Add(DQSelectColumn.Field("ProductTime"));
query.Range = SelectRange.Top(1);
query.Where.Conditions.Add(DQCondition.EQ("ID", obj.ID));
using (var reader = session.ExecuteReader(query))
{
if (reader.Read())
{
obj.Goods_Name = (string)reader[0];
obj.Goods_Spec = (string)reader[1];
obj.Weight = (decimal?)reader[2];
obj.ProductTime = (DateTime?)reader[3];
}
}
}
@ -199,7 +193,7 @@ namespace ButcherFactory.BO.LocalBL
switch (localData.Item2)
{
case -1:
return "已删除,无法退库";
return "已删除,无法退库";
case 1:
return "已在退库中,等待提交";
case 2:
@ -219,8 +213,8 @@ namespace ButcherFactory.BO.LocalBL
using (var session = DmoSession.New())
{
Update(session, id, new Tuple<string, object>("State", -1),
new Tuple<string, object>("InStoreTime", DQExpression.NULL),
new Tuple<string, object>("Store_ID", DQExpression.NULL));
new Tuple<string, object>("InStoreTime", null),
new Tuple<string, object>("Store_ID", null));
session.Commit();
}
}
@ -260,15 +254,6 @@ namespace ButcherFactory.BO.LocalBL
session.ExecuteNonQuery(update);
}
public static void InsertScanException(SegmentCodeError error)
{
using (var session = DmoSession.New())
{
session.Insert(error);
session.Commit();
}
}
public static BindingList<SegmentInStore> GetInStoreSummary()
{
var query = new DQueryDom(new JoinAlias("_main", typeof(SegmentInStore)));
@ -310,26 +295,17 @@ namespace ButcherFactory.BO.LocalBL
public static void UploadSegmentInstoreInfo()
{
try
{
using (var session = DmoSession.New())
{
var needUpload = GetUnSyncData(session);
if (needUpload.Count == 0)
return;
var json = JsonConvert.SerializeObject(needUpload);
RpcFacade.Call<int>(RpcPath + "UploadSegmentInStoreInfo", json);
foreach (var item in needUpload)
SetLocalAsSyncd(item, session);
session.Commit();
}
}
catch
using (var session = DmoSession.New())
{
#if DEBUG
throw;
#endif
var needUpload = GetUnSyncData(session);
if (needUpload.Count == 0)
return;
var json = JsonConvert.SerializeObject(needUpload);
RpcFacade.Call<int>(RpcPath + "UploadSegmentInStoreInfo", json);
foreach (var item in needUpload)
SetLocalAsSyncd(item, session);
session.Commit();
}
}
@ -342,7 +318,7 @@ namespace ButcherFactory.BO.LocalBL
query.Columns.Add(DQSelectColumn.Field("InStoreTime"));
query.Columns.Add(DQSelectColumn.Field("Store_ID"));
query.Columns.Add(DQSelectColumn.Field("BackStoreTime"));
query.Where.Conditions.Add(DQCondition.And(DQCondition.InEQ("State", 1), DQCondition.EQ("Sync", false)));
query.Where.Conditions.Add(DQCondition.And(DQCondition.InEQ("State", 1), DQCondition.EQ("Sync", false), DQCondition.IsNotNull(DQExpression.Field("Weight"))));
query.Range = SelectRange.Top(10);
query.OrderBy.Expressions.Add(DQOrderByExpression.Create("ID"));
@ -355,7 +331,7 @@ namespace ButcherFactory.BO.LocalBL
obj.ID = (long)reader[0];
obj.RowVersion = (int)reader[1];
obj.BarCode = (string)reader[2];
obj.InStoreTime = (DateTime)reader[3];
obj.InStoreTime = (DateTime?)reader[3];
obj.Store_ID = (long?)reader[4];
obj.BackStoreTime = (DateTime?)reader[5];
upload.Add(obj);
@ -371,6 +347,56 @@ namespace ButcherFactory.BO.LocalBL
update.Columns.Add(new DQUpdateColumn("Sync", true));
session.ExecuteNonQuery(update);
}
public static void ClearErrorMsg()
{
var sql = string.Format(@"truncate table [{0}]", DmoInfo.Get(typeof(SegmentCodeError)).MappedDBObject);
using (var session = DmoSession.New())
{
session.ExecuteSqlNonQuery(sql);
session.Commit();
}
}
public static void RefreshFromServer(SegmentInStore entity)
{
try
{
var json = RpcFacade.Call<string>(RpcPath + "GetBarInfoByCode", entity.BarCode);
if (string.IsNullOrEmpty(json))
return;
var obj = JsonConvert.DeserializeObject<SegmentInStore>(json);
entity.Goods_Name = obj.Goods_Name;
entity.Goods_Spec = obj.Goods_Spec;
entity.ProductTime = obj.ProductTime;
entity.Weight = obj.Weight;
SimpleUpdate(entity);
}
catch
{
#if DEBUG
throw;
#endif
}
}
public static void SimpleUpdate(SegmentInStore entity)
{
var update = new DQUpdateDom(typeof(SegmentInStore));
update.Where.Conditions.Add(DQCondition.EQ("ID", entity.ID));
update.Columns.Add(new DQUpdateColumn("Goods_Name", entity.Goods_Name));
update.Columns.Add(new DQUpdateColumn("Goods_Spec", entity.Goods_Spec));
update.Columns.Add(new DQUpdateColumn("ProductTime", entity.ProductTime));
update.Columns.Add(new DQUpdateColumn("Weight", entity.Weight));
update.EExecute();
}
public static void DeleteEmpty(long id)
{
var delete = new DQDeleteDom(typeof(SegmentInStore));
delete.Where.Conditions.Add(DQCondition.EQ("ID", id));
delete.EExecute();
}
}
class SegmentInStoreObj
@ -383,20 +409,10 @@ namespace ButcherFactory.BO.LocalBL
public string BarCode { get; set; }
public DateTime InStoreTime { get; set; }
public DateTime? InStoreTime { get; set; }
public long? Store_ID { get; set; }
public DateTime? BackStoreTime { 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; }
}
}

+ 13
- 16
ButcherFactory.BO/LocalBL/SegmentProductionBL.cs View File

@ -16,7 +16,7 @@ namespace ButcherFactory.BO.LocalBL
public static class SegmentProductionBL
{
const string RpcPath = @"/MainSystem/B3ClientService/Rpcs/SegmentProductionRpc/";
const string ProductTaskRpc = @"/MainSystem/B3ButcherManage/Rpcs/ProductTaskRpc/GetProductTaskNumber";
const string ProductTaskRpc = @"/MainSystem/B3Sale/Rpcs/SaleOutStoreRpc/GetSaleOutStoreNumber";
public static BindingList<SegmentProduction> GetListByState(bool submited)
{
@ -81,7 +81,7 @@ namespace ButcherFactory.BO.LocalBL
}
}
public static SegmentProduction InsertAndSetGroupID(SegmentProduction entity,DateTime batchDate, bool test)
public static SegmentProduction InsertAndSetGroupID(SegmentProduction entity, DateTime batchDate)
{
using (var session = DmoSession.New())
{
@ -89,12 +89,9 @@ namespace ButcherFactory.BO.LocalBL
entity.RowIndex = GenerateRowIndex(entity.ProductBatch_ID, session);
entity.BarCode = string.Format("260912011{0:yyyyMMdd}{1}{2:00000}", batchDate, AppContext.ConnectInfo.ClientCode, entity.RowIndex);
entity.Submited = true;
if (!test)
{
session.Insert(entity);
FillGroupIDAsID(session, entity.ID);
session.Commit();
}
session.Insert(entity);
FillGroupIDAsID(session, entity.ID);
session.Commit();
return entity;
}
}
@ -155,13 +152,6 @@ namespace ButcherFactory.BO.LocalBL
}
}
public static void Delete(long id)
{
var delete = new DQDeleteDom(typeof(SegmentProduction));
delete.Where.Conditions.Add(DQCondition.EQ("ID", id));
delete.EExecute();
}
public static List<string> GetInStoreState(List<string> codeArr)
{
try
@ -169,7 +159,7 @@ namespace ButcherFactory.BO.LocalBL
var json = RpcFacade.Call<string>(RpcPath + "CheckInStored", JsonConvert.SerializeObject(codeArr));
return JsonConvert.DeserializeObject<List<string>>(json);
}
catch(Exception ex)
catch (Exception ex)
{
#if DEBUG
throw;
@ -333,6 +323,13 @@ namespace ButcherFactory.BO.LocalBL
return null;
}
}
public static void DeleteBefore()
{
var delete = new DQDeleteDom(typeof(SegmentProduction));
delete.Where.Conditions.Add(DQCondition.LessThan("CreateTime", new DateTime(2018, 10, 15)));
delete.EExecute();
}
}
class SegmentProductionMin


+ 51
- 61
ButcherFactory.BO/LocalBL/SegmentStockUpBL.cs View File

@ -29,92 +29,82 @@ namespace ButcherFactory.BO.LocalBL
public static List<SaleOutStoreInfo> GetSaleOutStoreList(DateTime date)
{
var json = RpcFacade.Call<string>(RpcPath + "SaleOutStoreRpc/GetSaleOutStoreByDate", date);
var list = JsonConvert.DeserializeObject<List<SaleOutStoreInfo>>(json);
foreach (var item in list)
item.Date = date;
return list;
try
{
var json = RpcFacade.Call<string>(RpcPath + "SaleOutStoreRpc/GetSaleOutStoreByDate", date);
var list = JsonConvert.DeserializeObject<List<SaleOutStoreInfo>>(json);
foreach (var item in list)
item.Date = date;
return list;
}
catch
{
#if DEBUG
throw;
#endif
return new List<SaleOutStoreInfo>();
}
}
public static List<SegmentStockUp> GetLocalList(DateTime date)
{
var query = new DmoQuery(typeof(SegmentStockUp));
query.Where.Conditions.Add(DQCondition.EQ("Date", date));
return query.EExecuteList().Cast<SegmentStockUp>().ToList();
using (var session = DmoSession.New())
{
DeleteOld(session);
var query = new DmoQuery(typeof(SegmentStockUp));
query.Where.Conditions.Add(DQCondition.EQ("Date", date));
return session.ExecuteList(query).Cast<SegmentStockUp>().ToList();
}
}
public static void DeleteOld()
static void DeleteOld(IDmoSession session)
{
var delete = new DQDeleteDom(typeof(SegmentStockUp));
delete.Where.Conditions.Add(DQCondition.And(DQCondition.LessThan("Date", DateTime.Today.AddDays(-2)), DQCondition.EQ("Sync", true)));
delete.EExecute();
delete.Where.Conditions.Add(DQCondition.LessThan("Date", DateTime.Today.AddDays(-1)));
session.ExecuteNonQuery(delete);
}
public static void SyncToServer()
//当明细备完后,要返回该明细已备数量。
public static AlreadyStockUp Insert(SegmentStockUp detail, AlreadyStockUp already, decimal totalNumber)
{
try
{
using (var session = DmoSession.New())
var json = JsonConvert.SerializeObject(new { DetailID = detail.DetailID, StandardPic = detail.StandardPic, BarCode = detail.BarCode, SecondNumber = detail.SecondNumber, UnitNumber = detail.UnitNumber });
var r = RpcFacade.Call<string>(RpcPath + "SaleOutStoreRpc/InsertStockUpDetail", json, JsonConvert.SerializeObject(already), totalNumber);
var outSide = JsonConvert.DeserializeObject<AlreadyStockUp>(r);
if (outSide.State == 1)
{
var list = GetUnSyncList(session);
if (list.Count == 0)
return;
var arr = JsonConvert.SerializeObject(list.Select(x => new { DetailID = x.DetailID, BarCode = x.BarCode, SecondNumber=x.SecondNumber,UnitNumber=x.UnitNumber }));
RpcFacade.Call<int>(RpcPath + "SaleOutStoreRpc/InsertStockUpDetail", arr);
SetLocalSync(session, list.First().ID, list.Last().ID);
session.Commit();
using (var session = DmoSession.New())
{
session.Insert(detail);
session.Commit();
}
}
return outSide;
}
catch
{
#if DEBUG
throw;
#endif
return null;
}
}
static List<SegmentStockUp> GetUnSyncList(IDmoSession session)
public static List<AlreadyStockUp> SyncAlreadyNumber(IEnumerable<long> detailIDs, long? maxID)
{
var query = new DQueryDom(new JoinAlias(typeof(SegmentStockUp)));
query.Where.Conditions.Add(DQCondition.EQ("Sync", false));
query.Columns.Add(DQSelectColumn.Field("ID"));
query.Columns.Add(DQSelectColumn.Field("DetailID"));
query.Columns.Add(DQSelectColumn.Field("BarCode"));
query.Columns.Add(DQSelectColumn.Field("SecondNumber"));
query.Columns.Add(DQSelectColumn.Field("UnitNumber"));
query.OrderBy.Expressions.Add(DQOrderByExpression.Create("ID"));
query.Range = SelectRange.Top(50);
var list = new List<SegmentStockUp>();
using (var reader = session.ExecuteReader(query))
if (detailIDs.Count() == 0 && maxID == null)
return new List<AlreadyStockUp>();
var json = JsonConvert.SerializeObject(detailIDs);
try
{
while (reader.Read())
{
var entity = new SegmentStockUp();
entity.ID = (long)reader[0];
entity.DetailID = (long)reader[1];
entity.BarCode = (string)reader[2];
entity.SecondNumber = (decimal?)reader[3];
entity.UnitNumber = (decimal?)reader[4];
list.Add(entity);
}
var result = RpcFacade.Call<string>(RpcPath + "SaleOutStoreRpc/GetStockNumber", json, maxID);
return JsonConvert.DeserializeObject<List<AlreadyStockUp>>(result);
}
return list;
}
static void SetLocalSync(IDmoSession session, long min, long max)
{
var update = new DQUpdateDom(typeof(SegmentStockUp));
update.Columns.Add(new DQUpdateColumn("Sync", true));
update.Where.Conditions.Add(DQCondition.Between("ID", min, max));
session.ExecuteNonQuery(update);
}
public static void Insert(SegmentStockUp detail)
{
using (var session = DmoSession.New())
catch
{
session.Insert(detail);
session.Commit();
#if DEBUG
throw;
#endif
return new List<AlreadyStockUp>();
}
}
}


+ 22
- 3
ButcherFactory.BO/Rpcs/BaseInfoSyncRpc.cs View File

@ -16,7 +16,7 @@ namespace ButcherFactory.BO.Rpcs
{
const string baseInfoRpcPath = @"/MainSystem/B3ClientService/Rpcs/SyncBaseInfoRpc/";
public static void SyncBaseInfo<T>(string methodName = null)
public static bool SyncBaseInfo<T>(string methodName = null)
where T : BaseInfo
{
var type = typeof(T);
@ -27,6 +27,8 @@ namespace ButcherFactory.BO.Rpcs
var localVersion = GetLocalVersion<T>(session);
var json = RpcFacade.Call<string>(baseInfoRpcPath + methodName, JsonConvert.SerializeObject(localVersion));
var result = JsonConvert.DeserializeObject<Tuple<List<T>, List<T>, List<long>>>(json);//insert,update,delete
if (result.Item1.Count == 0 && result.Item2.Count == 0 && result.Item3.Count == 0)
return false;
foreach (var item in result.Item1)
session.Insert(item);
foreach (var item in result.Item2)
@ -35,6 +37,7 @@ namespace ButcherFactory.BO.Rpcs
Delete<T>(session, result.Item3);
session.Commit();
}
return true;
}
static void Delete<T>(IDmoSession session, List<long> ids)
@ -54,7 +57,7 @@ namespace ButcherFactory.BO.Rpcs
return query.EExecuteList<long, int>(session);
}
public static void SyncProductBatch(int batchType)
public static bool SyncProductBatch(int batchType)
{
using (var session = DmoSession.New())
{
@ -62,6 +65,8 @@ namespace ButcherFactory.BO.Rpcs
var json = RpcFacade.Call<string>(baseInfoRpcPath + "SyncProductBatchByType", batchType, JsonConvert.SerializeObject(local));
var result = JsonConvert.DeserializeObject<Tuple<List<ProductBatch>, List<ProductBatch>, List<long>>>(json);//insert,update,delete
if (result.Item1.Count == 0 && result.Item2.Count == 0 && result.Item3.Count == 0)
return false;
foreach (var item in result.Item1)
session.Insert(item);
foreach (var item in result.Item2)
@ -71,9 +76,10 @@ namespace ButcherFactory.BO.Rpcs
session.Commit();
}
return true;
}
public static void SyncGoodsByTag(ApplyClient applyClient)
public static bool SyncGoodsByTag(ApplyClient applyClient)
{
using (var session = DmoSession.New())
{
@ -82,10 +88,15 @@ namespace ButcherFactory.BO.Rpcs
var json = RpcFacade.Call<string>(baseInfoRpcPath + "SyncClientGoodsSetByClient", (short)applyClient, JsonConvert.SerializeObject(local), JsonConvert.SerializeObject(g2));
var result = JsonConvert.DeserializeObject<Tuple<List<ClientGoodsSet>, List<ClientGoodsSet>, List<long>, List<Goods>, List<Goods>, List<long>>>(json);//insert,update,delete
if (result.Item1.Count == 0 && result.Item2.Count == 0 && result.Item3.Count == 0 && result.Item4.Count == 0 && result.Item5.Count == 0 && result.Item6.Count == 0)
return false;
foreach (var item in result.Item1)
Insert(item, session);
foreach (var item in result.Item2)
{
DeleteNotExistDetail(item, session);
Update(item, session);
}
foreach (var item in result.Item3)
DeleteClientSet(item, session);
@ -98,6 +109,7 @@ namespace ButcherFactory.BO.Rpcs
session.Commit();
}
return true;
}
static void DeleteClientSet(long id, IDmoSession session)
@ -124,5 +136,12 @@ namespace ButcherFactory.BO.Rpcs
foreach (var detail in entity.Details)
session.AddUpdateOrInsert(detail);
}
static void DeleteNotExistDetail(ClientGoodsSet entity, IDmoSession session)
{
var delete = new DQDeleteDom(typeof(ClientGoodsSet_Detail));
delete.Where.Conditions.Add(DQCondition.And(DQCondition.EQ("ClientGoodsSet_ID", entity.ID), DQCondition.NotInList(DQExpression.Field("ID"), entity.Details.Select(x => DQExpression.Value(x.ID)).ToArray())));
session.ExecuteNonQuery(delete);
}
}
}

+ 13
- 0
ButcherFactory.Form/ButcherFactory.Form.csproj View File

@ -38,11 +38,15 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\tsref\Debug\BwpClientPrint.dll</HintPath>
</Reference>
<Reference Include="HidLibrary">
<HintPath>..\..\WinFormControl\HidLibrary\bin\Release\HidLibrary.dll</HintPath>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Speech" />
<Reference Include="System.Windows" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xaml" />
@ -68,6 +72,12 @@
<Compile Include="CarcassSaleOut2_\CarcassSaleOutForm.Designer.cs">
<DependentUpon>CarcassSaleOutForm.cs</DependentUpon>
</Compile>
<Compile Include="CarcassSaleOut2_\CarcassSaleOutReadForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="CarcassSaleOut2_\CarcassSaleOutReadForm.Designer.cs">
<DependentUpon>CarcassSaleOutReadForm.cs</DependentUpon>
</Compile>
<Compile Include="Controls\ColorButton.cs">
<SubType>Component</SubType>
</Compile>
@ -276,6 +286,9 @@
<EmbeddedResource Include="CarcassSaleOut2_\CarcassSaleOutForm.resx">
<DependentUpon>CarcassSaleOutForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="CarcassSaleOut2_\CarcassSaleOutReadForm.resx">
<DependentUpon>CarcassSaleOutReadForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Controls\FormTemplate.resx">
<DependentUpon>FormTemplate.cs</DependentUpon>
</EmbeddedResource>


+ 1214
- 0
ButcherFactory.Form/CarcassSaleOut2_/CarcassSaleOutReadForm.Designer.cs
File diff suppressed because it is too large
View File


+ 555
- 0
ButcherFactory.Form/CarcassSaleOut2_/CarcassSaleOutReadForm.cs View File

@ -0,0 +1,555 @@
using ButcherFactory.BO;
using ButcherFactory.BO.LocalBL;
using ButcherFactory.BO.Utils;
using ButcherFactory.CarcassSaleOut_;
using ButcherFactory.Controls;
using ButcherFactory.Dialogs;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace ButcherFactory.CarcassSaleOut2_
{
public partial class CarcassSaleOutReadForm : FormTemplate, IWithRoleForm
{
#region IWithRoleForm
public List<short> RoleName
{
get { return new List<short> { (short). }; }
}
public Form Generate()
{
return this;
}
#endregion
BindingList<SaleOutStore> saleOutStoreList;
BindingList<SaleOutStore_Detail> details;
BindingList<CarcassSaleOut_Detail> weightRecord;
Thread checkWeight;
string strErrorWeight = "";
List<int> errorWeight = new List<int>();
internal DateTime sendTime = DateTime.Today;
internal long? deliverGoodsLineID;
internal long? customerID;
internal int billState;
internal CarcassSaleOutFormConfig config;
internal long? storeID;
long? batchID;
bool already = false;
bool scanCode = true;
public CarcassSaleOutReadForm()
{
InitializeComponent();
this.FormClosing += delegate
{
if (checkWeight != null && checkWeight.IsAlive)
checkWeight.Abort();
};
//weightControl1.ReceivedValue += weightControl1_ReceivedValue;
uScanPanel1.AfterScan += uScanPanel1_AfterScan;
productBatchSelect.SelectedIndexChanged += delegate
{
if (productBatchSelect.SelectedValue == null)
batchID = null;
else
batchID = (long)productBatchSelect.SelectedValue;
};
sendGridView.CellFormatting += sendGridView_CellFormatting;
}
static Image CheckImg = System.Drawing.Image.FromFile("Images\\check.png");
static Image UnCheckImg = System.Drawing.Image.FromFile("Images\\uCheck.png");
void sendGridView_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
{
if (e.RowIndex < 0 || e.ColumnIndex != 2)
return;
var v = (bool)sendGridView.Rows[e.RowIndex].Cells[1].Value;
e.Value = v ? CheckImg : UnCheckImg;
}
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
BLUtil.DeleteSaleOutStoreInfo<CarcassSaleOut_Delete>();
BLUtil.DeleteSaleOutStoreInfo<CarcassSaleOut_Detail>();
billState = 0;
billStateBox.Text = "未审核";
sendDateBox.Text = sendTime.ToString("yyyy-MM-dd");
config = XmlUtil.DeserializeFromFile<CarcassSaleOutFormConfig>();
storeID = config.Store_ID;
if (config.Store_ID.HasValue)
{
storeBox.Text = config.Store_Name;
}
if (!string.IsNullOrEmpty(config.Weight))
{
strErrorWeight = config.Weight;
var arr = strErrorWeight.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries).Select(x => int.Parse(x)).OrderBy(x => x);
errorWeight.AddRange(arr);
}
BindWeightRecord();
BindProductBatch();
}
void BindWeightRecord()
{
weightRecord = CarcassSaleOutBL.GetUnSubmitWeightRecord();
sendGridView.DataSource = weightRecord;
sendGridView.Refresh();
}
private void BindProductBatch()
{
var batchs = CarcassSaleOutBL.GetBatchFromEMS(0);
productBatchSelect.DisplayMember = "Name";
productBatchSelect.ValueMember = "ID";
productBatchSelect.DataSource = batchs;
var idx = batchs.FindIndex(x => x.Date == DateTime.Today);
if (idx > 0)
productBatchSelect.SelectedIndex = idx;
productBatchSelect.Refresh();
}
static object _lock = new object();
//void weightControl1_ReceivedValue(decimal weight)
//{
// lock (_lock)
// {
// this.Invoke(new Action(() =>
// {
// var detail = CarcassSaleOutBL.Insert(weight);
// if (weightRecord.Any())
// detail.Idx = weightRecord.First().Idx + 1;
// else
// detail.Idx = 1;
// weightRecord.Insert(0, detail);
// sendGridView.FirstDisplayedScrollingRowIndex = 0;
// if (!scanCode)
// AfterScan("G8536");
// else
// sendGridView.Refresh();
// checkWeight = new Thread(new ParameterizedThreadStart(CheckWeight));
// checkWeight.Start(weight);
// }));
// }
//}
void CheckWeight(object objWeight)
{
decimal weight = (decimal)objWeight;
var first = errorWeight.FirstOrDefault(x => x > weight);
if (first != 0)
WinFormControl.SoundPalyUtil.PlaySound(string.Format("Sounds\\l{0}.wav", first));
}
void uScanPanel1_AfterScan()
{
var barCode = uScanPanel1.TextBox.Text.Trim();
if (!barCode.StartsWith("G") && !barCode.StartsWith("P"))
{
if (backStoreCheck.Checked)
{
if (weightRecord.Where(x => x.BarCode == barCode).Sum(x => x.IsBack ? -1 : 1) != 1)
{
if (weightRecord.Any(x => x.BarCode == barCode))
throw new Exception("失败,条码已退库");
throw new Exception("失败,称重记录中无该条码信息");
}
}
else
{
if (weightRecord.Any(x => x.BarCode == barCode))//未提交队列里重复码
throw new Exception("扫码重复");
if (CarcassSaleOutBL.BarCodeUsed(barCode))
throw new Exception("扫码重复");
}
}
AfterScan(barCode);
}
void AfterScan(string barCode)
{
if (string.IsNullOrEmpty(barCode))
throw new Exception("条码错误");
if (barCode.StartsWith("P"))
{
if (orderGridView.CurrentRow == null)
throw new Exception("请选择发货明细");
var detail = new CarcassSaleOut_Detail();
var bind = orderGridView.CurrentRow.DataBoundItem as SaleOutStore_Detail;
detail.Weight = detail.Number = bind.Number ?? 0;
detail.BarCode = barCode;
detail.BillID = bind.SaleOutStore_ID;
detail.DetailID = bind.ID;
detail.Filled = true;
detail.Goods_ID = long.Parse(barCode.TrimStart('P'));
CarcassSaleOutBL.InsertPackage(detail);
if (weightRecord.Any())
detail.Idx = weightRecord.First().Idx + 1;
else
detail.Idx = 1;
weightRecord.Insert(0, detail);
sendGridView.FirstDisplayedScrollingRowIndex = 0;
}
else
{
var detail = CarcassSaleOutBL.ReadBarCode(barCode, batchID, backStoreCheck.Checked);
if (weightRecord.Any())
detail.Idx = weightRecord.First().Idx + 1;
else
detail.Idx = 1;
weightRecord.Insert(0, detail);
sendGridView.FirstDisplayedScrollingRowIndex = 0;
}
WinFormControl.SoundPalyUtil.PlaySound(WinFormControl.SoundType.Click);
sendGridView.Refresh();
}
private void refreshBtn_Click(object sender, EventArgs e)
{
already = false;
Refersh();
}
private void weightRecordBtn_Click(object sender, EventArgs e)
{
if (orderGridView.CurrentRow == null)
throw new Exception("请选择配货明细");
var detail = orderGridView.CurrentRow.DataBoundItem as SaleOutStore_Detail;
var dg = new WeightRecordDialog(details.First(x => x.ID == detail.ID), already, batchID);
dg.ShowDialog();
if (dg.Changed)
BindOrderGrid(detail.SaleOutStore_ID);
if (dg.rolBack)
BindWeightRecord();
}
private void goodsFinishBtn_Click(object sender, EventArgs e)
{
if (mainGridView.CurrentRow == null)
throw new Exception("请选择要配货完成的发货单");
var id = (long)mainGridView.CurrentRow.Cells[0].Value;
var hasNoAssignDetail = CarcassSaleOutBL.HasNoAssignDetail(id);
if (hasNoAssignDetail)
{
if (MessageBox.Show("有未配货的明细,确认配货完成?", "配货完成确认", MessageBoxButtons.OKCancel) != DialogResult.OK)
return;
}
CarcassSaleOutBL.SetGoodsFinish(id);
AfterChangeFinishGoods(id);
MessageBox.Show("配货完成!");
}
private void unFinishBtn_Click(object sender, EventArgs e)
{
if (mainGridView.CurrentRow == null)
throw new Exception("请选择要撤销完毕的发货单");
var id = (long)mainGridView.CurrentRow.Cells[0].Value;
CarcassSaleOutBL.SetGoodsUnFinish(id);
AfterChangeFinishGoods(id);
MessageBox.Show("撤销成功!");
}
private void AfterChangeFinishGoods(long id)
{
saleOutStoreList.Remove(saleOutStoreList.First(x => x.ID == id));
mainGridView.Refresh();
if (details != null)
details.Clear();
orderGridView.Refresh();
billIDLabel.Text = string.Empty;
customerLabel.Text = string.Empty;
addressLabel.Text = string.Empty;
carNumberLabel.Text = string.Empty;
}
private void commitBtn_Click(object sender, EventArgs e)
{
if (orderGridView.CurrentRow == null)
throw new Exception("请选择配货明细");
var subList = weightRecord.Where(x => x.Selected).ToList();
if (subList.Count() == 0)
throw new Exception("没有发货明细");
if (subList.Any(x => !x.Filled))
throw new Exception("有未扫码的明细");
var detailID = (long)orderGridView.CurrentRow.Cells[0].Value;
var detail = details.First(x => x.ID == detailID);
CarcassSaleOutBL.SubmitDetails(subList, detail);
foreach (var item in subList)
weightRecord.Remove(item);
var idx = weightRecord.Count;
foreach (var item in weightRecord)
{
item.Idx = idx;
idx--;
}
sendGridView.Refresh();
orderGridView.Refresh();
MessageBox.Show("提交成功!");
}
private void queryControl_MouseDown(object sender, MouseEventArgs e)
{
var simpleLbl = sender as Label;
switch (simpleLbl.Name)
{
case "sendDateBox":
var cs = new CalendarSelecter();
if (cs.ShowDialog() == true)
{
sendTime = cs.Result;
sendDateBox.Text = sendTime.ToString("yyyy-MM-dd");
}
break;
case "deliverGoodsLineBox":
var dgl = new SelectDeliverGoodsLineDialog();
if (dgl.ShowDialog() == DialogResult.OK)
{
simpleLbl.Text = dgl.Result.Item1;
deliverGoodsLineID = dgl.Result.Item2;
}
break;
case "customerBox":
var cb = new SelectCustomerDialog();
if (cb.ShowDialog() == DialogResult.OK)
{
simpleLbl.Text = cb.Result.Item1;
customerID = cb.Result.Item2;
}
break;
case "billStateBox":
var bs = new SelectBillStateDialog();
if (bs.ShowDialog() == DialogResult.OK)
{
simpleLbl.Text = bs.Result.Item1;
billState = bs.Result.Item2;
}
break;
case "storeBox":
var sb = new SelectStoreDialog();
if (sb.ShowDialog() == DialogResult.OK)
{
simpleLbl.Text = sb.Result.Item1;
config.Store_Name = simpleLbl.Text;
config.Store_ID = sb.Result.Item2;
storeID = config.Store_ID;
XmlUtil.SerializerObjToFile(config);
}
break;
}
}
private void clearBtn_Click(object sender, EventArgs e)
{
billState = 0;
billStateBox.Text = "未审核";
sendTime = DateTime.Today;
sendDateBox.Text = sendTime.ToString("yyyy-MM-dd");
deliverGoodsLineBox.Text = string.Empty;
deliverGoodsLineID = null;
customerBox.Text = string.Empty;
customerID = null;
storeBox.Text = string.Empty;
storeID = null;
}
private void mainGridView_CellClick(object sender, DataGridViewCellEventArgs e)
{
var id = (long)mainGridView.CurrentRow.Cells[0].Value;
var first = saleOutStoreList.First(x => x.ID == id);
billIDLabel.Text = id.ToString();
customerLabel.Text = first.Customer_Name;
addressLabel.Text = first.Address;
carNumberLabel.Text = first.CarNumber;
BindOrderGrid(null);
}
void BindOrderGrid(long? detailID)
{
var id = long.Parse(billIDLabel.Text);
details = CarcassSaleOutBL.GetSaleOutStoreDetailList(id);
foreach (var item in details)
{
item.SaleOutStore_ID = id;
item.Customer_Name = customerLabel.Text;
}
orderGridView.DataSource = details;
if (detailID.HasValue)
{
foreach (DataGridViewRow row in orderGridView.Rows)
{
if ((long)row.Cells[0].Value == detailID)
{
row.Selected = true;
break;
}
}
}
else
{
if (details.Any())
orderGridView.FirstDisplayedScrollingRowIndex = 0;
}
orderGridView.Refresh();
}
private void alreadyViewBtn_Click(object sender, EventArgs e)
{
already = true;
Refersh();
}
void Refersh()
{
commitBtn.Enabled = !already;
goodsFinishBtn.Enabled = !already;
unFinishBtn.Enabled = already;
if (details != null)
{
details.Clear();
orderGridView.Refresh();
}
saleOutStoreList = CarcassSaleOutBL.GetSaleOutStoreList(sendTime, deliverGoodsLineID, customerID, billState, storeID, already);
mainGridView.DataSource = saleOutStoreList;
mainGridView.Refresh();
}
private void deleteBtn_Click(object sender, EventArgs e)
{
if (sendGridView.CurrentRow == null)
return;
var id = (long)sendGridView.CurrentRow.Cells[0].Value;
CarcassSaleOutBL.Delete(id);
var tag = weightRecord.First(x => x.ID == id);
weightRecord.Remove(tag);
foreach (var item in weightRecord.Where(x => x.Idx > tag.Idx))
item.Idx -= 1;
sendGridView.Refresh();
}
private void orderGridView_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e)
{
DataGridViewRow dgrSingle = orderGridView.Rows[e.RowIndex];
var v = (decimal?)dgrSingle.Cells["D_SNumber"].Value;
if (v.HasValue && v > 0)
{
dgrSingle.DefaultCellStyle.BackColor = Color.YellowGreen;
}
}
private void sendGridView_CellClick(object sender, DataGridViewCellEventArgs e)
{
if (e.RowIndex == -1 && e.ColumnIndex == 2)
{
foreach (var item in weightRecord)
item.Selected = !item.Selected;
sendGridView.Refresh();
return;
}
if (e.RowIndex < 0)
return;
var id = (long)sendGridView.CurrentRow.Cells[0].Value;
var first = weightRecord.First(x => x.ID == id);
first.Selected = !first.Selected;
sendGridView.Refresh();
}
private void halfBtn_Click(object sender, EventArgs e)
{
SetWeightNumber(0.5m);
}
private void fullBtn_Click(object sender, EventArgs e)
{
SetWeightNumber(1);
}
private void SetWeightNumber(decimal number)
{
if (sendGridView.CurrentRow == null)
return;
var id = (long)sendGridView.CurrentRow.Cells[0].Value;
CarcassSaleOutBL.UpdateWeightNumber(id, number);
var first = weightRecord.First(x => x.ID == id);
first.Selected = true;
first.Number = number;
sendGridView.Refresh();
}
private void scanCodeBtn_Click(object sender, EventArgs e)
{
scanCode = !scanCode;
//scanCodeBtn.Text = scanCode ? "扫码发货" : "自动发货";
}
private void readBtn_Click(object sender, EventArgs e)
{
lock (_lock)
{
var weight = weightControl1.Weight;
if (!scanCode)
{
weight -= (config.DiscontWeight ?? 0);
if (weight <= 0)
throw new Exception("重量不能为0");
var detail = CarcassSaleOutBL.AutoFill("G8536", batchID, weight);
if (weightRecord.Any())
detail.Idx = weightRecord.First().Idx + 1;
else
detail.Idx = 1;
weightRecord.Insert(0, detail);
sendGridView.FirstDisplayedScrollingRowIndex = 0;
}
else
{
var tags = weightRecord.Where(x => !x.Filled);
if (tags.Count() == 0)
throw new Exception("没有等待读入重量的明细");
var ids = tags.Select(x => x.ID).ToList();
weight -= (config.DiscontWeight * ids.Count ?? 0);
if (weight <= 0)
throw new Exception("重量不能为0");
var last = ids.Last();
CarcassSaleOutBL.InsertWeight(ids, weight);
foreach (var item in tags)
{
if (item.ID == last)
item.Weight = weight;
else
item.Weight = 0;
item.Filled = true;
}
}
sendGridView.Refresh();
checkWeight = new Thread(new ParameterizedThreadStart(CheckWeight));
checkWeight.Start(weight);
}
}
}
}

+ 198
- 0
ButcherFactory.Form/CarcassSaleOut2_/CarcassSaleOutReadForm.resx View File

@ -0,0 +1,198 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="F_ID.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="F_Selected.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="F_Image.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="F_Idx.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="F_BarCode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="F_GoodsCode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="F_Goods_Name.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="F_Number.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="F_InStoreWeight.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="F_Weight.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="F_DiffWeight.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="F_Time.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="D_ID.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="D_SaleOutStore_ID.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="D_Customer_Name.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="D_Goods_Code.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="D_Goods_Name.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="D_SecondNumber.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="D_Number.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="D_SSecondNumber.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="D_SNumber.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="D_DiffNumber.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="M_ID.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="M_Customer_Name.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="M_SendTime.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="M_DeliverGoodsLine_Name.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>

+ 2
- 0
ButcherFactory.Form/CarcassSaleOut_/CarcassSaleOutFormConfig.cs View File

@ -13,5 +13,7 @@ namespace ButcherFactory.CarcassSaleOut_
public string Store_Name { get; set; }
public string Weight { get; set; }
public decimal? DiscontWeight { get; set; }
}
}

+ 3
- 3
ButcherFactory.Form/Controls/InfoBox.cs View File

@ -60,10 +60,10 @@ namespace ButcherFactory.Controls
}));
}
public static void Show(string title, string msg,Color foreColor, int closeSec = 0)
public static void Show(string title, string msg, Color foreColor, int closeSec, IWin32Window owner)
{
var d = new InfoBox(title, msg,foreColor, closeSec);
d.ShowDialog();
var d = new InfoBox(title, msg, foreColor, closeSec);
d.ShowDialog(owner);
}
private void button1_Click(object sender, EventArgs e)


+ 40
- 0
ButcherFactory.Form/SegmentInStore_/InStoreSummaryView.cs View File

@ -18,16 +18,56 @@ namespace ButcherFactory.SegmentInStore_
public InStoreSummaryView()
{
InitializeComponent();
inStoreGrid.RowPrePaint += uDataGridView1_RowPrePaint;
inStoreGrid.CellPainting += uDataGridView1_CellPainting;
}
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
list = SegmentInStoreBL.GetInStoreSummary();
list.Add(new SegmentInStore { Number = list.Sum(x => x.Number ?? 0), Weight = list.Sum(x => x.Weight ?? 0) });
inStoreGrid.DataSource = list;
inStoreGrid.Refresh();
}
private void uDataGridView1_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e)
{
if (e.RowIndex == inStoreGrid.Rows.Count - 1)
{
var row = inStoreGrid.Rows[e.RowIndex];
row.DefaultCellStyle.SelectionForeColor = Color.Black;
row.DefaultCellStyle.BackColor = Color.Khaki;
row.DefaultCellStyle.SelectionBackColor = Color.Khaki;
}
}
private void uDataGridView1_CellPainting(object sender, DataGridViewCellPaintingEventArgs e)
{
var last = inStoreGrid.Rows.Count - 1;
if (e.RowIndex == last)
{
if (e.ColumnIndex == 2)
{
e.PaintBackground(e.ClipBounds, false);
e.Handled = true;
}
else if (e.ColumnIndex == 3)
{
using (Brush foreColor = new SolidBrush(e.CellStyle.ForeColor))
{
e.PaintBackground(e.ClipBounds, false);
StringFormat drawFormat = new StringFormat();
drawFormat.LineAlignment = StringAlignment.Center;
drawFormat.Alignment = System.Drawing.StringAlignment.Center;
e.Graphics.DrawString("合计", e.CellStyle.Font, foreColor, e.CellBounds, drawFormat);
e.Handled = true;
}
}
}
}
private void closeBtn_Click(object sender, EventArgs e)
{
this.Close();


+ 185
- 176
ButcherFactory.Form/SegmentInStore_/SegmentInStoreForm.Designer.cs View File

@ -28,36 +28,36 @@
/// </summary>
private void InitializeComponent()
{
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle37 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle38 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle41 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle39 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle40 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle42 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle43 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle46 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle44 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle45 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle47 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle48 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle51 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle49 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle50 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle52 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle53 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle54 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle19 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle20 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle23 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle21 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle22 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle24 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle25 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle28 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle26 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle27 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle29 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle30 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle33 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle31 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle32 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle34 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle35 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle36 = new System.Windows.Forms.DataGridViewCellStyle();
this.panel1 = new System.Windows.Forms.Panel();
this.barCodeBox = new System.Windows.Forms.TextBox();
this.uLabel1 = new WinFormControl.ULabel();
this.inStoreViewBtn = new WinFormControl.NButton();
this.netStateWatch1 = new WinFormControl.NetStateWatch();
this.storeSelect = new System.Windows.Forms.ComboBox();
this.uLabel3 = new WinFormControl.ULabel();
this.uScanPanel1 = new WinFormControl.UScanPanel();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.inStoreGrid = new WinFormControl.UDataGridView();
this.I_ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.I_RowIndex = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.I_ShortCode = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.I_Goods_Code = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.I_Goods_Name = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.I_Goods_Spec = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.I_Weight = new System.Windows.Forms.DataGridViewTextBoxColumn();
@ -70,7 +70,6 @@
this.B_ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.B_RowIndex = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.B_ShortCode = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.B_Goods_Code = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.B_Goods_Name = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.B_Goods_Spec = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.B_Weight = new System.Windows.Forms.DataGridViewTextBoxColumn();
@ -78,12 +77,10 @@
this.uLabel5 = new WinFormControl.ULabel();
this.backBtn = new WinFormControl.NButton();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.refreshBtn = new WinFormControl.NButton();
this.unInstoreGrid = new WinFormControl.UDataGridView();
this.dataGridViewTextBoxColumn8 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.U_RowIndex = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.U_ShortCode = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.U_Goods_Code = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.U_Goods_Name = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.U_Goods_Spec = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.U_Weight = new System.Windows.Forms.DataGridViewTextBoxColumn();
@ -96,6 +93,8 @@
this.E_BarCode = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.E_ExceptionInfo = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.uLabel4 = new WinFormControl.ULabel();
this.clearErrorBtn = new WinFormControl.NButton();
this.refreshBtn = new WinFormControl.NButton();
this.panel1.SuspendLayout();
this.groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.inStoreGrid)).BeginInit();
@ -109,23 +108,43 @@
//
// panel1
//
this.panel1.Controls.Add(this.barCodeBox);
this.panel1.Controls.Add(this.uLabel1);
this.panel1.Controls.Add(this.inStoreViewBtn);
this.panel1.Controls.Add(this.netStateWatch1);
this.panel1.Controls.Add(this.storeSelect);
this.panel1.Controls.Add(this.uLabel3);
this.panel1.Controls.Add(this.uScanPanel1);
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(611, 140);
this.panel1.Size = new System.Drawing.Size(583, 140);
this.panel1.TabIndex = 0;
//
// barCodeBox
//
this.barCodeBox.Font = new System.Drawing.Font("宋体", 14F);
this.barCodeBox.Location = new System.Drawing.Point(83, 33);
this.barCodeBox.Name = "barCodeBox";
this.barCodeBox.Size = new System.Drawing.Size(391, 29);
this.barCodeBox.TabIndex = 20;
//
// uLabel1
//
this.uLabel1.AutoSize = true;
this.uLabel1.BackColor = System.Drawing.Color.Transparent;
this.uLabel1.Font = new System.Drawing.Font("宋体", 15F);
this.uLabel1.Location = new System.Drawing.Point(16, 37);
this.uLabel1.Name = "uLabel1";
this.uLabel1.Size = new System.Drawing.Size(69, 20);
this.uLabel1.TabIndex = 21;
this.uLabel1.Text = "条码:";
//
// inStoreViewBtn
//
this.inStoreViewBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(136)))), ((int)(((byte)(255)))));
this.inStoreViewBtn.ClickColor = System.Drawing.Color.YellowGreen;
this.inStoreViewBtn.Font = new System.Drawing.Font("宋体", 12F);
this.inStoreViewBtn.ForeColor = System.Drawing.Color.White;
this.inStoreViewBtn.Location = new System.Drawing.Point(323, 76);
this.inStoreViewBtn.Location = new System.Drawing.Point(379, 76);
this.inStoreViewBtn.Name = "inStoreViewBtn";
this.inStoreViewBtn.PlaySound = false;
this.inStoreViewBtn.Size = new System.Drawing.Size(95, 45);
@ -139,7 +158,7 @@
// netStateWatch1
//
this.netStateWatch1.BackColor = System.Drawing.Color.Transparent;
this.netStateWatch1.Location = new System.Drawing.Point(499, 3);
this.netStateWatch1.Location = new System.Drawing.Point(489, 3);
this.netStateWatch1.Name = "netStateWatch1";
this.netStateWatch1.Size = new System.Drawing.Size(90, 39);
this.netStateWatch1.TabIndex = 18;
@ -148,9 +167,9 @@
//
this.storeSelect.Font = new System.Drawing.Font("宋体", 15F);
this.storeSelect.FormattingEnabled = true;
this.storeSelect.Location = new System.Drawing.Point(85, 83);
this.storeSelect.Location = new System.Drawing.Point(83, 84);
this.storeSelect.Name = "storeSelect";
this.storeSelect.Size = new System.Drawing.Size(170, 28);
this.storeSelect.Size = new System.Drawing.Size(240, 28);
this.storeSelect.TabIndex = 16;
//
// uLabel3
@ -158,20 +177,12 @@
this.uLabel3.AutoSize = true;
this.uLabel3.BackColor = System.Drawing.Color.Transparent;
this.uLabel3.Font = new System.Drawing.Font("宋体", 15F);
this.uLabel3.Location = new System.Drawing.Point(23, 87);
this.uLabel3.Location = new System.Drawing.Point(16, 88);
this.uLabel3.Name = "uLabel3";
this.uLabel3.Size = new System.Drawing.Size(69, 20);
this.uLabel3.TabIndex = 17;
this.uLabel3.Text = "仓库:";
//
// uScanPanel1
//
this.uScanPanel1.BackColor = System.Drawing.Color.Transparent;
this.uScanPanel1.Location = new System.Drawing.Point(20, 33);
this.uScanPanel1.Name = "uScanPanel1";
this.uScanPanel1.Size = new System.Drawing.Size(303, 32);
this.uScanPanel1.TabIndex = 9;
//
// groupBox1
//
this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
@ -181,7 +192,7 @@
this.groupBox1.Controls.Add(this.goodsNameLbl);
this.groupBox1.Location = new System.Drawing.Point(11, 159);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(600, 434);
this.groupBox1.Size = new System.Drawing.Size(627, 434);
this.groupBox1.TabIndex = 1;
this.groupBox1.TabStop = false;
//
@ -191,39 +202,38 @@
this.inStoreGrid.AllowUserToDeleteRows = false;
this.inStoreGrid.AllowUserToResizeColumns = false;
this.inStoreGrid.AllowUserToResizeRows = false;
dataGridViewCellStyle37.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
this.inStoreGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle37;
dataGridViewCellStyle19.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
this.inStoreGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle19;
this.inStoreGrid.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.inStoreGrid.BackgroundColor = System.Drawing.Color.White;
this.inStoreGrid.BorderStyle = System.Windows.Forms.BorderStyle.None;
dataGridViewCellStyle38.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle38.Font = new System.Drawing.Font("宋体", 12F);
dataGridViewCellStyle38.ForeColor = System.Drawing.Color.White;
dataGridViewCellStyle38.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.inStoreGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle38;
dataGridViewCellStyle20.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle20.Font = new System.Drawing.Font("宋体", 12F);
dataGridViewCellStyle20.ForeColor = System.Drawing.Color.White;
dataGridViewCellStyle20.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.inStoreGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle20;
this.inStoreGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.inStoreGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.I_ID,
this.I_RowIndex,
this.I_ShortCode,
this.I_Goods_Code,
this.I_Goods_Name,
this.I_Goods_Spec,
this.I_Weight,
this.I_InStoreTime});
this.inStoreGrid.Location = new System.Drawing.Point(3, 60);
this.inStoreGrid.Location = new System.Drawing.Point(3, 33);
this.inStoreGrid.MultiSelect = false;
this.inStoreGrid.Name = "inStoreGrid";
this.inStoreGrid.ReadOnly = true;
this.inStoreGrid.RowHeadersVisible = false;
dataGridViewCellStyle41.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle41.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218)))));
this.inStoreGrid.RowsDefaultCellStyle = dataGridViewCellStyle41;
dataGridViewCellStyle23.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle23.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218)))));
this.inStoreGrid.RowsDefaultCellStyle = dataGridViewCellStyle23;
this.inStoreGrid.RowTemplate.Height = 23;
this.inStoreGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.inStoreGrid.Size = new System.Drawing.Size(595, 371);
this.inStoreGrid.Size = new System.Drawing.Size(618, 398);
this.inStoreGrid.TabIndex = 9;
//
// I_ID
@ -244,26 +254,20 @@
//
// I_ShortCode
//
this.I_ShortCode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
this.I_ShortCode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.I_ShortCode.DataPropertyName = "ShortCode";
this.I_ShortCode.HeaderText = "条码";
this.I_ShortCode.MinimumWidth = 120;
this.I_ShortCode.Name = "I_ShortCode";
this.I_ShortCode.ReadOnly = true;
this.I_ShortCode.Width = 60;
//
// I_Goods_Code
//
this.I_Goods_Code.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.I_Goods_Code.DataPropertyName = "Goods_Code";
this.I_Goods_Code.HeaderText = "产品编号";
this.I_Goods_Code.Name = "I_Goods_Code";
this.I_Goods_Code.ReadOnly = true;
//
// I_Goods_Name
//
this.I_Goods_Name.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.I_Goods_Name.DataPropertyName = "Goods_Name";
this.I_Goods_Name.FillWeight = 110F;
this.I_Goods_Name.HeaderText = "产品名称";
this.I_Goods_Name.MinimumWidth = 120;
this.I_Goods_Name.Name = "I_Goods_Name";
this.I_Goods_Name.ReadOnly = true;
//
@ -278,8 +282,8 @@
// I_Weight
//
this.I_Weight.DataPropertyName = "Weight";
dataGridViewCellStyle39.Format = "#0.######";
this.I_Weight.DefaultCellStyle = dataGridViewCellStyle39;
dataGridViewCellStyle21.Format = "#0.######";
this.I_Weight.DefaultCellStyle = dataGridViewCellStyle21;
this.I_Weight.HeaderText = "重量";
this.I_Weight.Name = "I_Weight";
this.I_Weight.ReadOnly = true;
@ -287,15 +291,14 @@
//
// I_InStoreTime
//
this.I_InStoreTime.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
this.I_InStoreTime.DataPropertyName = "InStoreTime";
dataGridViewCellStyle40.Format = "T";
dataGridViewCellStyle40.NullValue = null;
this.I_InStoreTime.DefaultCellStyle = dataGridViewCellStyle40;
dataGridViewCellStyle22.Format = "T";
dataGridViewCellStyle22.NullValue = null;
this.I_InStoreTime.DefaultCellStyle = dataGridViewCellStyle22;
this.I_InStoreTime.HeaderText = "入库时间";
this.I_InStoreTime.Name = "I_InStoreTime";
this.I_InStoreTime.ReadOnly = true;
this.I_InStoreTime.Width = 60;
this.I_InStoreTime.Width = 110;
//
// goodsNameLbl
//
@ -317,9 +320,9 @@
this.groupBox2.Controls.Add(this.backStoreGrid);
this.groupBox2.Controls.Add(this.uLabel5);
this.groupBox2.Controls.Add(this.backBtn);
this.groupBox2.Location = new System.Drawing.Point(631, 159);
this.groupBox2.Location = new System.Drawing.Point(656, 159);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(655, 241);
this.groupBox2.Size = new System.Drawing.Size(630, 241);
this.groupBox2.TabIndex = 2;
this.groupBox2.TabStop = false;
//
@ -363,21 +366,20 @@
this.backStoreGrid.AllowUserToDeleteRows = false;
this.backStoreGrid.AllowUserToResizeColumns = false;
this.backStoreGrid.AllowUserToResizeRows = false;
dataGridViewCellStyle42.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
this.backStoreGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle42;
dataGridViewCellStyle24.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
this.backStoreGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle24;
this.backStoreGrid.BackgroundColor = System.Drawing.Color.White;
this.backStoreGrid.BorderStyle = System.Windows.Forms.BorderStyle.None;
dataGridViewCellStyle43.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle43.Font = new System.Drawing.Font("宋体", 12F);
dataGridViewCellStyle43.ForeColor = System.Drawing.Color.White;
dataGridViewCellStyle43.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.backStoreGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle43;
dataGridViewCellStyle25.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle25.Font = new System.Drawing.Font("宋体", 12F);
dataGridViewCellStyle25.ForeColor = System.Drawing.Color.White;
dataGridViewCellStyle25.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.backStoreGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle25;
this.backStoreGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.backStoreGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.B_ID,
this.B_RowIndex,
this.B_ShortCode,
this.B_Goods_Code,
this.B_Goods_Name,
this.B_Goods_Spec,
this.B_Weight,
@ -388,12 +390,12 @@
this.backStoreGrid.Name = "backStoreGrid";
this.backStoreGrid.ReadOnly = true;
this.backStoreGrid.RowHeadersVisible = false;
dataGridViewCellStyle46.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle46.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218)))));
this.backStoreGrid.RowsDefaultCellStyle = dataGridViewCellStyle46;
dataGridViewCellStyle28.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle28.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218)))));
this.backStoreGrid.RowsDefaultCellStyle = dataGridViewCellStyle28;
this.backStoreGrid.RowTemplate.Height = 23;
this.backStoreGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.backStoreGrid.Size = new System.Drawing.Size(649, 178);
this.backStoreGrid.Size = new System.Drawing.Size(624, 178);
this.backStoreGrid.TabIndex = 8;
//
// B_ID
@ -414,26 +416,21 @@
//
// B_ShortCode
//
this.B_ShortCode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
this.B_ShortCode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.B_ShortCode.DataPropertyName = "ShortCode";
this.B_ShortCode.FillWeight = 120F;
this.B_ShortCode.HeaderText = "条码";
this.B_ShortCode.MinimumWidth = 120;
this.B_ShortCode.Name = "B_ShortCode";
this.B_ShortCode.ReadOnly = true;
this.B_ShortCode.Width = 60;
//
// B_Goods_Code
//
this.B_Goods_Code.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.B_Goods_Code.DataPropertyName = "Goods_Code";
this.B_Goods_Code.HeaderText = "产品编号";
this.B_Goods_Code.Name = "B_Goods_Code";
this.B_Goods_Code.ReadOnly = true;
//
// B_Goods_Name
//
this.B_Goods_Name.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.B_Goods_Name.DataPropertyName = "Goods_Name";
this.B_Goods_Name.FillWeight = 140F;
this.B_Goods_Name.HeaderText = "产品名称";
this.B_Goods_Name.MinimumWidth = 140;
this.B_Goods_Name.Name = "B_Goods_Name";
this.B_Goods_Name.ReadOnly = true;
//
@ -448,24 +445,23 @@
// B_Weight
//
this.B_Weight.DataPropertyName = "Weight";
dataGridViewCellStyle44.Format = "#0.######";
this.B_Weight.DefaultCellStyle = dataGridViewCellStyle44;
dataGridViewCellStyle26.Format = "#0.######";
this.B_Weight.DefaultCellStyle = dataGridViewCellStyle26;
this.B_Weight.HeaderText = "重量";
this.B_Weight.Name = "B_Weight";
this.B_Weight.ReadOnly = true;
this.B_Weight.Width = 70;
this.B_Weight.Width = 80;
//
// B_ProductTime
//
this.B_ProductTime.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
this.B_ProductTime.DataPropertyName = "ProductTime";
dataGridViewCellStyle45.Format = "T";
dataGridViewCellStyle45.NullValue = null;
this.B_ProductTime.DefaultCellStyle = dataGridViewCellStyle45;
dataGridViewCellStyle27.Format = "T";
dataGridViewCellStyle27.NullValue = null;
this.B_ProductTime.DefaultCellStyle = dataGridViewCellStyle27;
this.B_ProductTime.HeaderText = "生产时间";
this.B_ProductTime.Name = "B_ProductTime";
this.B_ProductTime.ReadOnly = true;
this.B_ProductTime.Width = 60;
this.B_ProductTime.Width = 110;
//
// uLabel5
//
@ -501,70 +497,51 @@
//
this.groupBox3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBox3.Controls.Add(this.refreshBtn);
this.groupBox3.Controls.Add(this.unInstoreGrid);
this.groupBox3.Controls.Add(this.uLabel6);
this.groupBox3.Location = new System.Drawing.Point(631, 421);
this.groupBox3.Location = new System.Drawing.Point(656, 428);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(655, 172);
this.groupBox3.Size = new System.Drawing.Size(630, 165);
this.groupBox3.TabIndex = 3;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "groupBox3";
//
// refreshBtn
//
this.refreshBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(136)))), ((int)(((byte)(255)))));
this.refreshBtn.ClickColor = System.Drawing.Color.YellowGreen;
this.refreshBtn.Font = new System.Drawing.Font("宋体", 12F);
this.refreshBtn.ForeColor = System.Drawing.Color.White;
this.refreshBtn.Location = new System.Drawing.Point(122, 11);
this.refreshBtn.Name = "refreshBtn";
this.refreshBtn.PlaySound = false;
this.refreshBtn.Size = new System.Drawing.Size(95, 45);
this.refreshBtn.SoundType = WinFormControl.SoundType.Click;
this.refreshBtn.TabIndex = 10;
this.refreshBtn.Text = "刷新";
this.refreshBtn.ToColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(136)))), ((int)(((byte)(255)))));
this.refreshBtn.UseVisualStyleBackColor = false;
this.refreshBtn.Click += new System.EventHandler(this.refreshBtn_Click);
//
// unInstoreGrid
//
this.unInstoreGrid.AllowUserToAddRows = false;
this.unInstoreGrid.AllowUserToDeleteRows = false;
this.unInstoreGrid.AllowUserToResizeColumns = false;
this.unInstoreGrid.AllowUserToResizeRows = false;
dataGridViewCellStyle47.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
this.unInstoreGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle47;
this.unInstoreGrid.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)));
dataGridViewCellStyle29.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
this.unInstoreGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle29;
this.unInstoreGrid.BackgroundColor = System.Drawing.Color.White;
this.unInstoreGrid.BorderStyle = System.Windows.Forms.BorderStyle.None;
dataGridViewCellStyle48.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle48.Font = new System.Drawing.Font("宋体", 12F);
dataGridViewCellStyle48.ForeColor = System.Drawing.Color.White;
dataGridViewCellStyle48.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.unInstoreGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle48;
dataGridViewCellStyle30.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle30.Font = new System.Drawing.Font("宋体", 12F);
dataGridViewCellStyle30.ForeColor = System.Drawing.Color.White;
dataGridViewCellStyle30.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.unInstoreGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle30;
this.unInstoreGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.unInstoreGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.dataGridViewTextBoxColumn8,
this.U_RowIndex,
this.U_ShortCode,
this.U_Goods_Code,
this.U_Goods_Name,
this.U_Goods_Spec,
this.U_Weight,
this.U_ProductTime});
this.unInstoreGrid.Location = new System.Drawing.Point(3, 60);
this.unInstoreGrid.Dock = System.Windows.Forms.DockStyle.Fill;
this.unInstoreGrid.Location = new System.Drawing.Point(3, 17);
this.unInstoreGrid.MultiSelect = false;
this.unInstoreGrid.Name = "unInstoreGrid";
this.unInstoreGrid.ReadOnly = true;
this.unInstoreGrid.RowHeadersVisible = false;
dataGridViewCellStyle51.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle51.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218)))));
this.unInstoreGrid.RowsDefaultCellStyle = dataGridViewCellStyle51;
dataGridViewCellStyle33.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle33.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218)))));
this.unInstoreGrid.RowsDefaultCellStyle = dataGridViewCellStyle33;
this.unInstoreGrid.RowTemplate.Height = 23;
this.unInstoreGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.unInstoreGrid.Size = new System.Drawing.Size(649, 109);
this.unInstoreGrid.Size = new System.Drawing.Size(624, 145);
this.unInstoreGrid.TabIndex = 9;
//
// dataGridViewTextBoxColumn8
@ -585,26 +562,21 @@
//
// U_ShortCode
//
this.U_ShortCode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
this.U_ShortCode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.U_ShortCode.DataPropertyName = "ShortCode";
this.U_ShortCode.FillWeight = 120F;
this.U_ShortCode.HeaderText = "条码";
this.U_ShortCode.MinimumWidth = 120;
this.U_ShortCode.Name = "U_ShortCode";
this.U_ShortCode.ReadOnly = true;
this.U_ShortCode.Width = 60;
//
// U_Goods_Code
//
this.U_Goods_Code.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.U_Goods_Code.DataPropertyName = "Goods_Code";
this.U_Goods_Code.HeaderText = "产品编号";
this.U_Goods_Code.Name = "U_Goods_Code";
this.U_Goods_Code.ReadOnly = true;
//
// U_Goods_Name
//
this.U_Goods_Name.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.U_Goods_Name.DataPropertyName = "Goods_Name";
this.U_Goods_Name.FillWeight = 140F;
this.U_Goods_Name.HeaderText = "产品名称";
this.U_Goods_Name.MinimumWidth = 140;
this.U_Goods_Name.Name = "U_Goods_Name";
this.U_Goods_Name.ReadOnly = true;
//
@ -619,24 +591,24 @@
// U_Weight
//
this.U_Weight.DataPropertyName = "Weight";
dataGridViewCellStyle49.Format = "#0.######";
this.U_Weight.DefaultCellStyle = dataGridViewCellStyle49;
dataGridViewCellStyle31.Format = "#0.######";
this.U_Weight.DefaultCellStyle = dataGridViewCellStyle31;
this.U_Weight.HeaderText = "重量";
this.U_Weight.Name = "U_Weight";
this.U_Weight.ReadOnly = true;
this.U_Weight.Width = 70;
this.U_Weight.Width = 80;
//
// U_ProductTime
//
this.U_ProductTime.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
this.U_ProductTime.DataPropertyName = "ProductTime";
dataGridViewCellStyle50.Format = "T";
dataGridViewCellStyle50.NullValue = null;
this.U_ProductTime.DefaultCellStyle = dataGridViewCellStyle50;
dataGridViewCellStyle32.Format = "T";
dataGridViewCellStyle32.NullValue = null;
this.U_ProductTime.DefaultCellStyle = dataGridViewCellStyle32;
this.U_ProductTime.HeaderText = "生产时间";
this.U_ProductTime.MinimumWidth = 2;
this.U_ProductTime.Name = "U_ProductTime";
this.U_ProductTime.ReadOnly = true;
this.U_ProductTime.Width = 60;
this.U_ProductTime.Width = 110;
//
// uLabel6
//
@ -655,9 +627,9 @@
this.groupBox4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.groupBox4.Controls.Add(this.exceptionGrid);
this.groupBox4.Controls.Add(this.uLabel4);
this.groupBox4.Location = new System.Drawing.Point(631, 16);
this.groupBox4.Location = new System.Drawing.Point(656, 16);
this.groupBox4.Name = "groupBox4";
this.groupBox4.Size = new System.Drawing.Size(655, 124);
this.groupBox4.Size = new System.Drawing.Size(630, 124);
this.groupBox4.TabIndex = 4;
this.groupBox4.TabStop = false;
this.groupBox4.Text = "groupBox4";
@ -668,15 +640,15 @@
this.exceptionGrid.AllowUserToDeleteRows = false;
this.exceptionGrid.AllowUserToResizeColumns = false;
this.exceptionGrid.AllowUserToResizeRows = false;
dataGridViewCellStyle52.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
this.exceptionGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle52;
dataGridViewCellStyle34.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
this.exceptionGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle34;
this.exceptionGrid.BackgroundColor = System.Drawing.Color.White;
this.exceptionGrid.BorderStyle = System.Windows.Forms.BorderStyle.None;
dataGridViewCellStyle53.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle53.Font = new System.Drawing.Font("宋体", 12F);
dataGridViewCellStyle53.ForeColor = System.Drawing.Color.White;
dataGridViewCellStyle53.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.exceptionGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle53;
dataGridViewCellStyle35.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle35.Font = new System.Drawing.Font("宋体", 12F);
dataGridViewCellStyle35.ForeColor = System.Drawing.Color.White;
dataGridViewCellStyle35.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.exceptionGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle35;
this.exceptionGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.exceptionGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.E_ID,
@ -689,12 +661,12 @@
this.exceptionGrid.Name = "exceptionGrid";
this.exceptionGrid.ReadOnly = true;
this.exceptionGrid.RowHeadersVisible = false;
dataGridViewCellStyle54.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle54.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218)))));
this.exceptionGrid.RowsDefaultCellStyle = dataGridViewCellStyle54;
dataGridViewCellStyle36.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle36.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218)))));
this.exceptionGrid.RowsDefaultCellStyle = dataGridViewCellStyle36;
this.exceptionGrid.RowTemplate.Height = 23;
this.exceptionGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.exceptionGrid.Size = new System.Drawing.Size(649, 104);
this.exceptionGrid.Size = new System.Drawing.Size(624, 104);
this.exceptionGrid.TabIndex = 9;
//
// E_ID
@ -707,8 +679,8 @@
//
// E_RowIndex
//
this.E_RowIndex.DataPropertyName = "RowIndex";
this.E_RowIndex.HeaderText = "号";
this.E_RowIndex.DataPropertyName = "ID";
this.E_RowIndex.HeaderText = "异常号";
this.E_RowIndex.Name = "E_RowIndex";
this.E_RowIndex.ReadOnly = true;
//
@ -740,12 +712,50 @@
this.uLabel4.TabIndex = 5;
this.uLabel4.Text = "异常记录";
//
// clearErrorBtn
//
this.clearErrorBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.clearErrorBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(136)))), ((int)(((byte)(255)))));
this.clearErrorBtn.ClickColor = System.Drawing.Color.YellowGreen;
this.clearErrorBtn.Font = new System.Drawing.Font("宋体", 12F);
this.clearErrorBtn.ForeColor = System.Drawing.Color.White;
this.clearErrorBtn.Location = new System.Drawing.Point(1191, 134);
this.clearErrorBtn.Name = "clearErrorBtn";
this.clearErrorBtn.PlaySound = false;
this.clearErrorBtn.Size = new System.Drawing.Size(95, 32);
this.clearErrorBtn.SoundType = WinFormControl.SoundType.Click;
this.clearErrorBtn.TabIndex = 5;
this.clearErrorBtn.Text = "清理异常";
this.clearErrorBtn.ToColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(136)))), ((int)(((byte)(255)))));
this.clearErrorBtn.UseVisualStyleBackColor = false;
this.clearErrorBtn.Click += new System.EventHandler(this.clearErrorBtn_Click);
//
// refreshBtn
//
this.refreshBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.refreshBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(136)))), ((int)(((byte)(255)))));
this.refreshBtn.ClickColor = System.Drawing.Color.YellowGreen;
this.refreshBtn.Font = new System.Drawing.Font("宋体", 12F);
this.refreshBtn.ForeColor = System.Drawing.Color.White;
this.refreshBtn.Location = new System.Drawing.Point(1191, 401);
this.refreshBtn.Name = "refreshBtn";
this.refreshBtn.PlaySound = false;
this.refreshBtn.Size = new System.Drawing.Size(95, 32);
this.refreshBtn.SoundType = WinFormControl.SoundType.Click;
this.refreshBtn.TabIndex = 6;
this.refreshBtn.Text = "刷新";
this.refreshBtn.ToColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(136)))), ((int)(((byte)(255)))));
this.refreshBtn.UseVisualStyleBackColor = false;
this.refreshBtn.Click += new System.EventHandler(this.refreshBtn_Click);
//
// SegmentInStoreForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.White;
this.ClientSize = new System.Drawing.Size(1305, 611);
this.Controls.Add(this.refreshBtn);
this.Controls.Add(this.clearErrorBtn);
this.Controls.Add(this.groupBox4);
this.Controls.Add(this.panel1);
this.Controls.Add(this.groupBox3);
@ -777,7 +787,6 @@
#endregion
private System.Windows.Forms.Panel panel1;
private WinFormControl.UScanPanel uScanPanel1;
private System.Windows.Forms.GroupBox groupBox1;
private WinFormControl.ULabel goodsNameLbl;
private System.Windows.Forms.GroupBox groupBox2;
@ -794,17 +803,17 @@
private WinFormControl.UDataGridView unInstoreGrid;
private WinFormControl.UDataGridView inStoreGrid;
private WinFormControl.NButton backBtn;
private WinFormControl.NButton submitBtn;
private WinFormControl.NButton deleteBtn;
private WinFormControl.NButton inStoreViewBtn;
private System.Windows.Forms.DataGridViewTextBoxColumn E_ID;
private System.Windows.Forms.DataGridViewTextBoxColumn E_RowIndex;
private System.Windows.Forms.DataGridViewTextBoxColumn E_BarCode;
private System.Windows.Forms.DataGridViewTextBoxColumn E_ExceptionInfo;
private WinFormControl.NButton submitBtn;
private WinFormControl.NButton deleteBtn;
private WinFormControl.NButton refreshBtn;
private WinFormControl.NButton clearErrorBtn;
private System.Windows.Forms.DataGridViewTextBoxColumn B_ID;
private System.Windows.Forms.DataGridViewTextBoxColumn B_RowIndex;
private System.Windows.Forms.DataGridViewTextBoxColumn B_ShortCode;
private System.Windows.Forms.DataGridViewTextBoxColumn B_Goods_Code;
private System.Windows.Forms.DataGridViewTextBoxColumn B_Goods_Name;
private System.Windows.Forms.DataGridViewTextBoxColumn B_Goods_Spec;
private System.Windows.Forms.DataGridViewTextBoxColumn B_Weight;
@ -812,19 +821,19 @@
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn8;
private System.Windows.Forms.DataGridViewTextBoxColumn U_RowIndex;
private System.Windows.Forms.DataGridViewTextBoxColumn U_ShortCode;
private System.Windows.Forms.DataGridViewTextBoxColumn U_Goods_Code;
private System.Windows.Forms.DataGridViewTextBoxColumn U_Goods_Name;
private System.Windows.Forms.DataGridViewTextBoxColumn U_Goods_Spec;
private System.Windows.Forms.DataGridViewTextBoxColumn U_Weight;
private System.Windows.Forms.DataGridViewTextBoxColumn U_ProductTime;
private WinFormControl.NButton inStoreViewBtn;
private System.Windows.Forms.DataGridViewTextBoxColumn I_ID;
private System.Windows.Forms.DataGridViewTextBoxColumn I_RowIndex;
private System.Windows.Forms.DataGridViewTextBoxColumn I_ShortCode;
private System.Windows.Forms.DataGridViewTextBoxColumn I_Goods_Code;
private System.Windows.Forms.DataGridViewTextBoxColumn I_Goods_Name;
private System.Windows.Forms.DataGridViewTextBoxColumn I_Goods_Spec;
private System.Windows.Forms.DataGridViewTextBoxColumn I_Weight;
private System.Windows.Forms.DataGridViewTextBoxColumn I_InStoreTime;
private System.Windows.Forms.TextBox barCodeBox;
private WinFormControl.ULabel uLabel1;
private WinFormControl.NButton refreshBtn;
}
}

+ 157
- 64
ButcherFactory.Form/SegmentInStore_/SegmentInStoreForm.cs View File

@ -14,6 +14,7 @@ using System.Windows.Forms;
using ButcherFactory.Utils;
using ButcherFactory.BO.LocalBL;
using ButcherFactory.Controls;
using HidLibrary.Honeywell1902Series;
namespace ButcherFactory.SegmentInStore_
{
@ -32,22 +33,31 @@ namespace ButcherFactory.SegmentInStore_
#endregion
Thread uploadData;
Thread checkHasData;
BindingList<SegmentInStore> inStoreList;
BindingList<SegmentInStore> unInstoreList;
BindingList<SegmentCodeError> exceptionList;
BindingList<SegmentInStore> backStoreList;
private static Scanner1902 _scanner;
long? storeID;
bool isBack = false;
public SegmentInStoreForm()
{
InitializeComponent();
netStateWatch1.GetConnectState = () => LoginUtil.TestConnection(500);
uScanPanel1.AfterScan += uScanPanel1_AfterScan;
this.FormClosing += delegate
{
if (uploadData != null && uploadData.IsAlive)
uploadData.Abort();
if (checkHasData != null && checkHasData.IsAlive)
checkHasData.Abort();
if (_scanner != null)
{
_scanner.StopListen();
_scanner.Dispose();
}
};
storeSelect.SelectedIndexChanged += delegate
@ -63,45 +73,74 @@ namespace ButcherFactory.SegmentInStore_
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
inStoreList = new BindingList<SegmentInStore>();
var initTask = new Thread(LoadBind);
initTask.Start();
uploadData = new Thread(UpLoadLocalData);
uploadData.Start();
var vid = Int32.Parse("0C2E", System.Globalization.NumberStyles.HexNumber);
var pid = Int32.Parse("0927", System.Globalization.NumberStyles.HexNumber);
_scanner = Scanner1902.Enumerate(vid, pid).FirstOrDefault();
if (_scanner != null)
{
_scanner.DataRecieved += ScannerDataRecieved;
_scanner.StartListen();
}
else
{
MessageBox.Show("请连接扫码枪后重新启动程序!");
}
}
private void LoadBind()
{
BLUtil.DeleteLocalDb<SegmentInStore>();
if (netStateWatch1.NetState)
{
BaseInfoSyncRpc.SyncBaseInfo<WorkUnit>();
BaseInfoSyncRpc.SyncProductBatch(1);
BaseInfoSyncRpc.SyncBaseInfo<Store>();
}
this.Invoke(new Action(() =>
{
BLUtil.DeleteLocalDb<SegmentInStore>();
if (netStateWatch1.NetState)
{
BaseInfoSyncRpc.SyncBaseInfo<WorkUnit>();
BaseInfoSyncRpc.SyncProductBatch(1);
BaseInfoSyncRpc.SyncBaseInfo<Store>();
}
var config = XmlUtil.DeserializeFromFile<SegmentInStoreFormConfig>();
var m = config.StoreID;
storeSelect.EBindComboBox<Store>(x => x.ID == m);
BindInStoreGrid();
BindExceptionGrid();
BindBackGrid();
BindUnInStoreGrid();
BindUnInstall();
}));
}
private void BindUnInstall()
{
unInstoreList = new BindingList<SegmentInStore>(SegmentInStoreBL.GetUnInStoreList());
unInstoreGrid.DataSource = unInstoreList;
RefreshUnInStore();
}
object _lockUn = new object();
void RefreshUnInStore()
{
lock (_lockUn)
unInstoreGrid.Refresh();
}
private void BindInStoreGrid()
{
inStoreList = SegmentInStoreBL.GetInStoreByStateList(0);
inStoreGrid.DataSource = inStoreList;
inStoreGrid.Refresh();
RefreshInStore();
}
private void BindExceptionGrid()
{
//exceptionList = SegmentInStoreBL.GetExceptionList();
//exceptionGrid.DataSource = exceptionList;
//exceptionGrid.Refresh();
exceptionList = SegmentInStoreBL.GetExceptionList();
exceptionGrid.DataSource = exceptionList;
exceptionGrid.Refresh();
}
private void BindBackGrid()
@ -111,73 +150,123 @@ namespace ButcherFactory.SegmentInStore_
backStoreGrid.Refresh();
}
private void BindUnInStoreGrid()
{
unInstoreList = SegmentInStoreBL.GetUnInStoreList();
if (unInstoreList == null)
unInstoreList = new BindingList<SegmentInStore>();
unInstoreGrid.DataSource = unInstoreList;
unInstoreGrid.Refresh();
}
private void UpLoadLocalData()
{
while (true)
{
try
{
this.Invoke(new Action(() =>
{
if (netStateWatch1.NetState)
SegmentInStoreBL.UploadSegmentInstoreInfo();
}));
if (netStateWatch1.NetState)
SegmentInStoreBL.UploadSegmentInstoreInfo();
}
catch { }
Thread.Sleep(1000);
}
}
private void uScanPanel1_AfterScan()
private void ScannerDataRecieved(byte[] data)
{
if (isBack)
var code = ControlsUtil.ParseCode(Encoding.ASCII.GetString(data));
if (string.IsNullOrEmpty(code))
return;
this.Invoke(new Action(() =>
{
var idx = backStoreList.Any() ? backStoreList.First().RowIndex.Value : 0;
var msg = SegmentInStoreBL.SetAsBacking(uScanPanel1.TextBox.Text, idx + 1);
if (!string.IsNullOrEmpty(msg))
barCodeBox.Text = code;
if (isBack)
{
InfoBox.Show("错误", msg, Color.Red, 2);
return;
var idx = backStoreList.Any() ? backStoreList.First().RowIndex.Value : 0;
var msg = SegmentInStoreBL.SetAsBacking(code, idx + 1);
if (!string.IsNullOrEmpty(msg))
{
InsertExceptionInfo(code, msg);
ControlsUtil.PlanVoice(msg);
InfoBox.Show("错误", msg, Color.Red, 1, this);
return;
}
BindBackGrid();
var fir = inStoreList.FirstOrDefault(x => x.BarCode == code);
if (fir != null)
{
inStoreList.Remove(fir);
RefreshInStore();
}
}
BindBackGrid();
var fir = inStoreList.FirstOrDefault(x => x.BarCode == uScanPanel1.TextBox.Text);
if (fir != null)
else
{
inStoreList.Remove(fir);
inStoreGrid.Refresh();
var idx = inStoreList.Any() ? inStoreList.First().RowIndex.Value : 0;
var first = new SegmentInStore() { Store_ID = storeID, BarCode = code, RowIndex = idx + 1 };
var msg = SegmentInStoreBL.InsertInStore(first);
if (!string.IsNullOrEmpty(msg))
{
InsertExceptionInfo(code, msg);
ControlsUtil.PlanVoice(msg);
InfoBox.Show("错误", msg, Color.Red, 1, this);
return;
}
inStoreList.Insert(0, first);
if (inStoreList.Count > 30)
inStoreList.RemoveAt(30);
if (first.Weight == null)
{
checkHasData = new Thread(new ParameterizedThreadStart(GetInfoFromServer));
checkHasData.Start(first);
}
}
}));
}
private void GetInfoFromServer(object obj)
{
var entity = obj as SegmentInStore;
SegmentInStoreBL.RefreshFromServer(entity);
if (entity.Weight == null)
{
this.Invoke(new Action(() =>
{
var msg = "条码无效";
InsertExceptionInfo(entity.BarCode, msg);
SegmentInStoreBL.Delete(entity.ID);
inStoreList.Remove(entity);
ControlsUtil.PlanVoice(msg);
InfoBox.Show("错误", msg, Color.Red, 1, this);
}));
}
else
this.Invoke(new Action(() =>
{
var idx = inStoreList.Any() ? inStoreList.First().RowIndex.Value : 0;
string msg;
var entity = SegmentInStoreBL.InsertInStore(uScanPanel1.TextBox.Text, storeID, idx + 1,out msg);
if (!string.IsNullOrEmpty(msg))
RefreshInStore();
var first = unInstoreList.FirstOrDefault(x => x.BarCode == entity.BarCode);
if (first != null)
{
InfoBox.Show("错误", msg, Color.Red, 2);
return;
try
{
unInstoreList.Remove(first);
RefreshUnInStore();
}
catch { }
}
inStoreList.Insert(0, entity);
if (inStoreList.Count >= 30)
inStoreList.RemoveAt(30);
}));
}
object lc = new object();
void RefreshInStore()
{
lock (lc)
inStoreGrid.Refresh();
var f = unInstoreList.FirstOrDefault(x => x.BarCode == entity.BarCode);
if (f != null)
{
unInstoreList.Remove(f);
unInstoreGrid.Refresh();
}
}
uScanPanel1.TextBox.Clear();
}
void InsertExceptionInfo(string barCode, string msg)
{
var error = new SegmentCodeError()
{
BarCode = barCode,
ExceptionInfo = msg
};
SegmentInStoreBL.InsertSegmentCodeError(error);
exceptionList.Insert(0, error);
if (exceptionList.Count > 20)
exceptionList.RemoveAt(20);
exceptionGrid.Refresh();
}
private void backBtn_Click(object sender, EventArgs e)
@ -197,9 +286,6 @@ namespace ButcherFactory.SegmentInStore_
var tag = backStoreList.First(x => x.ID == id);
backStoreList.Remove(tag);
backStoreGrid.Refresh();
tag.RowIndex = unInstoreList.Any() ? unInstoreList.Last().RowIndex + 1 : 1;
unInstoreList.Add(tag);
unInstoreGrid.Refresh();
}
private void submitBtn_Click(object sender, EventArgs e)
@ -212,14 +298,21 @@ namespace ButcherFactory.SegmentInStore_
backStoreGrid.Refresh();
}
private void refreshBtn_Click(object sender, EventArgs e)
private void inStoreViewBtn_Click(object sender, EventArgs e)
{
BindUnInStoreGrid();
new InStoreSummaryView().ShowDialog();
}
private void inStoreViewBtn_Click(object sender, EventArgs e)
private void clearErrorBtn_Click(object sender, EventArgs e)
{
new InStoreSummaryView().ShowDialog();
SegmentInStoreBL.ClearErrorMsg();
exceptionList.Clear();
exceptionGrid.Refresh();
}
private void refreshBtn_Click(object sender, EventArgs e)
{
BindUnInstall();
}
}
}

+ 0
- 9
ButcherFactory.Form/SegmentInStore_/SegmentInStoreForm.resx View File

@ -120,27 +120,18 @@
<metadata name="I_RowIndex.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="I_Goods_Code.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="I_InStoreTime.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="B_RowIndex.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="B_Goods_Code.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="B_ProductTime.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="U_RowIndex.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="U_Goods_Code.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="U_ProductTime.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>


+ 67
- 84
ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.Designer.cs View File

@ -28,16 +28,16 @@
/// </summary>
private void InitializeComponent()
{
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle16 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle13 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle14 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle15 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle17 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle18 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle20 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle19 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle();
this.uLabel3 = new WinFormControl.ULabel();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.taskDataGrid = new WinFormControl.UDataGridView();
@ -47,10 +47,9 @@
this.T_Last = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.GoodsLabel = new WinFormControl.ULabel();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.templateBtn = new ButcherFactory.Controls.ColorButton();
this.msglbl = new System.Windows.Forms.Label();
this.closeBtn = new ButcherFactory.Controls.ColorButton();
this.uWeightControl1 = new ButcherFactory.Controls.WeightControl();
this.testCkBox = new System.Windows.Forms.CheckBox();
this.barPrintCheck = new System.Windows.Forms.CheckBox();
this.uTimerLabel1 = new WinFormControl.UTimerLabel();
this.productBatchSelect = new System.Windows.Forms.ComboBox();
@ -62,6 +61,7 @@
this.goodsSetBtn = new ButcherFactory.Controls.ColorButton();
this.flowLayoutPanel2 = new System.Windows.Forms.FlowLayoutPanel();
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
this.deleteBtn = new ButcherFactory.Controls.ColorButton();
this.rePrintBtn = new ButcherFactory.Controls.ColorButton();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.historyDataGrid = new WinFormControl.UDataGridView();
@ -70,7 +70,6 @@
this.H_BarCode = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.H_Goods_Name = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.H_Weight = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.deleteBtn = new ButcherFactory.Controls.ColorButton();
this.groupBox2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.taskDataGrid)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
@ -113,15 +112,15 @@
this.taskDataGrid.AllowUserToDeleteRows = false;
this.taskDataGrid.AllowUserToResizeColumns = false;
this.taskDataGrid.AllowUserToResizeRows = false;
dataGridViewCellStyle11.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
this.taskDataGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle11;
dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
this.taskDataGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
this.taskDataGrid.BackgroundColor = System.Drawing.Color.White;
this.taskDataGrid.BorderStyle = System.Windows.Forms.BorderStyle.None;
dataGridViewCellStyle12.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle12.Font = new System.Drawing.Font("宋体", 12F);
dataGridViewCellStyle12.ForeColor = System.Drawing.Color.White;
dataGridViewCellStyle12.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.taskDataGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle12;
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle2.Font = new System.Drawing.Font("宋体", 12F);
dataGridViewCellStyle2.ForeColor = System.Drawing.Color.White;
dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.taskDataGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2;
this.taskDataGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.taskDataGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.T_Item,
@ -134,9 +133,9 @@
this.taskDataGrid.Name = "taskDataGrid";
this.taskDataGrid.ReadOnly = true;
this.taskDataGrid.RowHeadersVisible = false;
dataGridViewCellStyle16.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle16.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218)))));
this.taskDataGrid.RowsDefaultCellStyle = dataGridViewCellStyle16;
dataGridViewCellStyle6.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle6.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218)))));
this.taskDataGrid.RowsDefaultCellStyle = dataGridViewCellStyle6;
this.taskDataGrid.RowTemplate.Height = 23;
this.taskDataGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.taskDataGrid.Size = new System.Drawing.Size(442, 96);
@ -153,8 +152,8 @@
//
this.T_Need.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.T_Need.DataPropertyName = "Need";
dataGridViewCellStyle13.Format = "#0.######";
this.T_Need.DefaultCellStyle = dataGridViewCellStyle13;
dataGridViewCellStyle3.Format = "#0.######";
this.T_Need.DefaultCellStyle = dataGridViewCellStyle3;
this.T_Need.HeaderText = "订货";
this.T_Need.Name = "T_Need";
this.T_Need.ReadOnly = true;
@ -163,8 +162,8 @@
//
this.T_Done.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.T_Done.DataPropertyName = "Done";
dataGridViewCellStyle14.Format = "#0.######";
this.T_Done.DefaultCellStyle = dataGridViewCellStyle14;
dataGridViewCellStyle4.Format = "#0.######";
this.T_Done.DefaultCellStyle = dataGridViewCellStyle4;
this.T_Done.HeaderText = "完工";
this.T_Done.Name = "T_Done";
this.T_Done.ReadOnly = true;
@ -173,8 +172,8 @@
//
this.T_Last.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.T_Last.DataPropertyName = "Last";
dataGridViewCellStyle15.Format = "#0.######";
this.T_Last.DefaultCellStyle = dataGridViewCellStyle15;
dataGridViewCellStyle5.Format = "#0.######";
this.T_Last.DefaultCellStyle = dataGridViewCellStyle5;
this.T_Last.HeaderText = "剩余";
this.T_Last.Name = "T_Last";
this.T_Last.ReadOnly = true;
@ -203,10 +202,9 @@
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.templateBtn);
this.splitContainer1.Panel1.Controls.Add(this.msglbl);
this.splitContainer1.Panel1.Controls.Add(this.closeBtn);
this.splitContainer1.Panel1.Controls.Add(this.uWeightControl1);
this.splitContainer1.Panel1.Controls.Add(this.testCkBox);
this.splitContainer1.Panel1.Controls.Add(this.barPrintCheck);
this.splitContainer1.Panel1.Controls.Add(this.uTimerLabel1);
this.splitContainer1.Panel1.Controls.Add(this.productBatchSelect);
@ -222,19 +220,15 @@
this.splitContainer1.SplitterDistance = 87;
this.splitContainer1.TabIndex = 1;
//
// templateBtn
// msglbl
//
this.templateBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(144)))), ((int)(((byte)(98)))), ((int)(((byte)(222)))));
this.templateBtn.Font = new System.Drawing.Font("宋体", 15F);
this.templateBtn.ForeColor = System.Drawing.Color.White;
this.templateBtn.Location = new System.Drawing.Point(648, 35);
this.templateBtn.Name = "templateBtn";
this.templateBtn.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(158)))), ((int)(((byte)(234)))), ((int)(((byte)(106)))));
this.templateBtn.Size = new System.Drawing.Size(111, 41);
this.templateBtn.TabIndex = 23;
this.templateBtn.Text = "选择标签";
this.templateBtn.UseVisualStyleBackColor = false;
this.templateBtn.Click += new System.EventHandler(this.templateBtn_Click);
this.msglbl.AutoSize = true;
this.msglbl.ForeColor = System.Drawing.Color.Red;
this.msglbl.Location = new System.Drawing.Point(458, 14);
this.msglbl.Name = "msglbl";
this.msglbl.Size = new System.Drawing.Size(101, 12);
this.msglbl.TabIndex = 24;
this.msglbl.Text = "正在获取基础信息";
//
// closeBtn
//
@ -260,17 +254,6 @@
this.uWeightControl1.TabIndex = 17;
this.uWeightControl1.WeightFalg = null;
//
// testCkBox
//
this.testCkBox.AutoSize = true;
this.testCkBox.Font = new System.Drawing.Font("宋体", 15F);
this.testCkBox.Location = new System.Drawing.Point(648, 9);
this.testCkBox.Name = "testCkBox";
this.testCkBox.Size = new System.Drawing.Size(108, 24);
this.testCkBox.TabIndex = 16;
this.testCkBox.Text = "生产测试";
this.testCkBox.UseVisualStyleBackColor = true;
//
// barPrintCheck
//
this.barPrintCheck.AutoSize = true;
@ -408,6 +391,21 @@
this.flowLayoutPanel1.Size = new System.Drawing.Size(640, 70);
this.flowLayoutPanel1.TabIndex = 22;
//
// deleteBtn
//
this.deleteBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.deleteBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(0)))), ((int)(((byte)(25)))));
this.deleteBtn.Font = new System.Drawing.Font("宋体", 15F);
this.deleteBtn.ForeColor = System.Drawing.Color.White;
this.deleteBtn.Location = new System.Drawing.Point(178, 129);
this.deleteBtn.Name = "deleteBtn";
this.deleteBtn.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(158)))), ((int)(((byte)(234)))), ((int)(((byte)(106)))));
this.deleteBtn.Size = new System.Drawing.Size(111, 41);
this.deleteBtn.TabIndex = 23;
this.deleteBtn.Text = "删除";
this.deleteBtn.UseVisualStyleBackColor = false;
this.deleteBtn.Click += new System.EventHandler(this.deleteBtn_Click);
//
// rePrintBtn
//
this.rePrintBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(144)))), ((int)(((byte)(98)))), ((int)(((byte)(222)))));
@ -441,15 +439,15 @@
this.historyDataGrid.AllowUserToDeleteRows = false;
this.historyDataGrid.AllowUserToResizeColumns = false;
this.historyDataGrid.AllowUserToResizeRows = false;
dataGridViewCellStyle17.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
this.historyDataGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle17;
dataGridViewCellStyle7.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
this.historyDataGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle7;
this.historyDataGrid.BackgroundColor = System.Drawing.Color.White;
this.historyDataGrid.BorderStyle = System.Windows.Forms.BorderStyle.None;
dataGridViewCellStyle18.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle18.Font = new System.Drawing.Font("宋体", 12F);
dataGridViewCellStyle18.ForeColor = System.Drawing.Color.White;
dataGridViewCellStyle18.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.historyDataGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle18;
dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle8.Font = new System.Drawing.Font("宋体", 12F);
dataGridViewCellStyle8.ForeColor = System.Drawing.Color.White;
dataGridViewCellStyle8.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.historyDataGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle8;
this.historyDataGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.historyDataGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.H_ID,
@ -463,13 +461,14 @@
this.historyDataGrid.Name = "historyDataGrid";
this.historyDataGrid.ReadOnly = true;
this.historyDataGrid.RowHeadersVisible = false;
dataGridViewCellStyle20.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle20.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218)))));
this.historyDataGrid.RowsDefaultCellStyle = dataGridViewCellStyle20;
dataGridViewCellStyle10.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle10.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218)))));
this.historyDataGrid.RowsDefaultCellStyle = dataGridViewCellStyle10;
this.historyDataGrid.RowTemplate.Height = 23;
this.historyDataGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.historyDataGrid.Size = new System.Drawing.Size(437, 308);
this.historyDataGrid.TabIndex = 2;
this.historyDataGrid.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.historyDataGrid_CellClick);
//
// H_ID
//
@ -506,27 +505,12 @@
// H_Weight
//
this.H_Weight.DataPropertyName = "Weight";
dataGridViewCellStyle19.Format = "#0.######";
this.H_Weight.DefaultCellStyle = dataGridViewCellStyle19;
dataGridViewCellStyle9.Format = "#0.######";
this.H_Weight.DefaultCellStyle = dataGridViewCellStyle9;
this.H_Weight.HeaderText = "重量";
this.H_Weight.Name = "H_Weight";
this.H_Weight.ReadOnly = true;
//
// deleteBtn
//
this.deleteBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.deleteBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(0)))), ((int)(((byte)(25)))));
this.deleteBtn.Font = new System.Drawing.Font("宋体", 15F);
this.deleteBtn.ForeColor = System.Drawing.Color.White;
this.deleteBtn.Location = new System.Drawing.Point(178, 129);
this.deleteBtn.Name = "deleteBtn";
this.deleteBtn.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(158)))), ((int)(((byte)(234)))), ((int)(((byte)(106)))));
this.deleteBtn.Size = new System.Drawing.Size(111, 41);
this.deleteBtn.TabIndex = 23;
this.deleteBtn.Text = "删除";
this.deleteBtn.UseVisualStyleBackColor = false;
this.deleteBtn.Click += new System.EventHandler(this.deleteBtn_Click);
//
// SegmentProductionAutoForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@ -567,7 +551,6 @@
private System.Windows.Forms.DataGridViewTextBoxColumn T_Last;
private WinFormControl.ULabel GoodsLabel;
private System.Windows.Forms.SplitContainer splitContainer1;
private System.Windows.Forms.CheckBox barPrintCheck;
private WinFormControl.UTimerLabel uTimerLabel1;
private System.Windows.Forms.ComboBox productBatchSelect;
private System.Windows.Forms.ComboBox workUnitSelect;
@ -588,8 +571,8 @@
private Controls.ColorButton rePrintBtn;
private Controls.ColorButton closeBtn;
private Controls.ColorButton goodsSetBtn;
private System.Windows.Forms.CheckBox testCkBox;
private Controls.ColorButton templateBtn;
private Controls.ColorButton deleteBtn;
private System.Windows.Forms.Label msglbl;
private System.Windows.Forms.CheckBox barPrintCheck;
}
}

+ 69
- 29
ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.cs View File

@ -35,6 +35,7 @@ namespace ButcherFactory.SegmentProductionAuto_
Thread uploadData;
Thread checkInStoreState;
Thread initTask;
BindingList<SegmentProduction> historyList;
Dictionary<string, List<ClientGoodsSet_Detail>> goodsSetDic;
long? batchID;
@ -47,6 +48,8 @@ namespace ButcherFactory.SegmentProductionAuto_
netStateWatch1.GetConnectState = () => LoginUtil.TestConnection(500);
this.FormClosing += delegate
{
if (initTask != null && initTask.IsAlive)
initTask.Abort();
if (uploadData != null && uploadData.IsAlive)
uploadData.Abort();
if (checkInStoreState != null && checkInStoreState.IsAlive)
@ -79,7 +82,7 @@ namespace ButcherFactory.SegmentProductionAuto_
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
var initTask = new Thread(LoadBind);
initTask = new Thread(LoadBind);
initTask.Start();
checkInStoreState = new Thread(CheckInStored);
@ -91,15 +94,46 @@ namespace ButcherFactory.SegmentProductionAuto_
void LoadBind()
{
this.Invoke(new Action(() =>
BLUtil.DeleteLocalDb<SegmentProduction>();
SegmentProductionBL.DeleteBefore();
GetBasicInfo();
}
bool ok = false;
bool bind = false;
void GetBasicInfo()
{
while (!ok)
{
BLUtil.DeleteLocalDb<SegmentProduction>();
if (netStateWatch1.NetState)
try
{
var changed = BaseInfoSyncRpc.SyncGoodsByTag(ApplyClient.);
changed = BaseInfoSyncRpc.SyncBaseInfo<WorkUnit>() || changed;
changed = BaseInfoSyncRpc.SyncProductBatch(1) || changed;
ok = true;
if (changed || !bind)
BindBasicInfo();
this.Invoke(new Action(() =>
{
msglbl.Text = string.Empty;
}));
}
catch
{
BaseInfoSyncRpc.SyncGoodsByTag(ApplyClient.);
BaseInfoSyncRpc.SyncBaseInfo<WorkUnit>();
BaseInfoSyncRpc.SyncProductBatch(1);
if (!bind)
{
BindBasicInfo();
bind = true;
}
}
Thread.Sleep(500);
}
}
void BindBasicInfo()
{
this.Invoke(new Action(() =>
{
productBatchSelect.EBindComboBox<ProductBatch>(null, 6, "Date");
config = XmlUtil.DeserializeFromFile<NotAuto.SegmentProductionFormConfig>();
var m = config.WorkUnitID;
@ -158,20 +192,18 @@ namespace ButcherFactory.SegmentProductionAuto_
entity.WorkUnit_ID = config.WorkUnitID;
entity.ProductBatch_ID = batchID.Value;
entity.StandardPic = detail.StandardPic;
SegmentProductionBL.InsertAndSetGroupID(entity, batchDate.Value, testCkBox.Checked);
SegmentProductionBL.InsertAndSetGroupID(entity, batchDate.Value);
entity.Goods_Code = detail.Goods_Code;
entity.Goods_Name = detail.Goods_Name;
entity.Goods_Spec = detail.Goods_Spec;
GoodsLabel.Text = entity.Goods_Name;
if (!testCkBox.Checked)
{
historyList.Insert(0, entity);
if (historyList.Count > 30)
historyList.RemoveAt(30);
historyDataGrid.FirstDisplayedScrollingRowIndex = 0;
historyDataGrid.Rows[0].Selected = true;
historyDataGrid.Refresh();
}
historyList.Insert(0, entity);
if (historyList.Count > 30)
historyList.RemoveAt(30);
historyDataGrid.FirstDisplayedScrollingRowIndex = 0;
historyDataGrid.Rows[0].Selected = true;
historyDataGrid.Refresh();
if (barPrintCheck.Checked)
{
var template = config.Template;
@ -179,19 +211,17 @@ namespace ButcherFactory.SegmentProductionAuto_
template = detail.GoodsType == 0 ? "SegmentProductionPrint.html" : "SegmentProductionPrint1.html";
NotAuto.SegmentProductionPrint.Print(entity, batchDate, template);
}
if (!testCkBox.Checked)
{
var thd = new Thread(new ParameterizedThreadStart(RefreshTask));
thd.Start(entity);
}
var thd = new Thread(new ParameterizedThreadStart(RefreshTask));
thd.Start(entity);
}
void RefreshTask(object obj)
{
var entity = obj as SegmentProduction;
taskDataGrid.DataSource = SegmentProductionBL.GetProductTask(batchDate ?? DateTime.Today, entity);
var list = SegmentProductionBL.GetProductTask(batchDate ?? DateTime.Today, entity);
this.Invoke(new Action(() =>
{
taskDataGrid.DataSource = list;
taskDataGrid.Refresh();
}));
}
@ -234,7 +264,7 @@ namespace ButcherFactory.SegmentProductionAuto_
{
if (historyList.Any())
{
var arr = historyList.Reverse().Take(20).ToList();
var arr = historyList.Reverse().Take(20);
var inStored = SegmentProductionBL.GetInStoreState(arr.Select(x => x.BarCode).ToList());
var tag = arr.Where(x => inStored.Contains(x.BarCode));
if (tag.Any())
@ -282,22 +312,32 @@ namespace ButcherFactory.SegmentProductionAuto_
new TemplateSelector(config).ShowDialog();
}
long id = 0;
private void deleteBtn_Click(object sender, EventArgs e)
{
if (historyDataGrid.CurrentRow == null)
if (id == 0)
return;
var first = historyList.FirstOrDefault(x => x.ID == id);
if (first == null)
return;
if (MessageBox.Show("确定删除选中记录?", "删除确认", MessageBoxButtons.OKCancel) != DialogResult.OK)
return;
var item = historyDataGrid.CurrentRow.DataBoundItem as SegmentProduction;
SegmentProductionBL.SetAsDelete(item.ID, item.BarCode);
historyList.Remove(item);
SegmentProductionBL.SetAsDelete(first.ID, first.BarCode);
historyList.Remove(first);
historyDataGrid.DataSource = historyList;
if (historyList.Any())
historyDataGrid.Rows[0].Selected = true;
historyDataGrid.Refresh();
var thd = new Thread(new ParameterizedThreadStart(RefreshTask));
thd.Start(item);
thd.Start(first);
}
private void historyDataGrid_CellClick(object sender, DataGridViewCellEventArgs e)
{
if (historyDataGrid.CurrentRow == null)
return;
id = (long)historyDataGrid.CurrentRow.Cells["H_ID"].Value;
}
}
}

+ 2
- 1
ButcherFactory.Form/SegmentProduction_/SegmentProductionForm.cs View File

@ -292,7 +292,8 @@ namespace ButcherFactory.SegmentProduction_
throw new Exception("已结束,无法删除");
if (MessageBox.Show(string.Format("确认删除{0} {1}的记录?", first.RowIndex, first.Goods_Name), "删除确认", MessageBoxButtons.OKCancel) == DialogResult.OK)
{
SegmentProductionBL.Delete(id);
var item = historyDataGrid.CurrentRow.DataBoundItem as SegmentProduction;
SegmentProductionBL.SetAsDelete(item.ID, item.BarCode);
unSubmitList.Remove(first);
historyList.Remove(first);
historyDataGrid.Refresh();


+ 6
- 1
ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint.cs View File

@ -30,9 +30,14 @@ namespace ButcherFactory.SegmentProduction_
info = string.Format("重量:{0:#0.##}KG", entity.Weight);
dic.Add("$Info", info);
dic.Add("$Date", dt.Value.ToString("yyyy/MM/dd"));
var code = entity.BarCode;
if (code.Length > 17)
code = code.Substring(17);
dic.Add("$Code", code);
var imgUrl = string.Format(IMGFILE, id);
var url = string.Format(AppContext.ConnectInfo.TraceBackUrl + "?code={0}", entity.BarCode);
BwpClientPrint.BwpClientWebPrint.Create2DPic(url, imgUrl, 80);
BwpClientPrint.BwpClientWebPrint.Create2DPic(url, imgUrl, 120);
dic.Add("$ImageUrl", imgUrl);
BwpClientPrint.BwpClientWebPrint.Print(PRINTFILE + template, dic);
AfterPrint();


+ 4
- 3
ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint.html View File

@ -3,7 +3,7 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<style type='text/css'>
table tr td {
font-size: 12px;
font-size: 9px;
font-weight: bold;
}
@ -17,12 +17,13 @@
<body>
<div style='font-size:16px;'>品名:$Goods_Name</div>
<div style='margin-top:10px;font-size:14px;'>$Info &nbsp;生产日期:$Date</div>
<table align='center' style='width:100%;margin-top:5px;border-collapse:collapse;border-width:1px;line-height:15px;'>
<tr><td>执行标准:</td><td>GB/T9959.2-2008</td><td rowspan='3'><img src='$ImageUrl' style='margin:-5px 0px -5px 20px;' /></td></tr>
<table align='center' style='width:100%;margin-top:5px;border-collapse:collapse;border-width:1px;'>
<tr><td>执行标准:</td><td>GB/T9959.2-2008</td><td rowspan='6'><img src='$ImageUrl' style='margin:-5px 0px -5px 20px;' /></td></tr>
<tr><td>储存条件:</td><td>0~4℃保存</td></tr>
<tr><td>保 质 期:</td><td>7天</td></tr>
<tr><td>生产厂家:</td><td colspan='2'>青岛万福集团股份有限公司</td></tr>
<tr><td>生产厂址:</td><td colspan='2'>青岛莱西市珠海路五号</td></tr>
<tr><td>&nbsp;</td><td colspan='2' style='font-size:12px;'>$Code</td></tr>
</table>
</body>
</html>

+ 4
- 3
ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint1.html View File

@ -3,7 +3,7 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<style type='text/css'>
table tr td {
font-size: 12px;
font-size: 9px;
font-weight: bold;
}
@ -17,12 +17,13 @@
<body>
<div style='font-size:16px;'>品名:$Goods_Name</div>
<div style='margin-top:10px;font-size:14px;'>$Info &nbsp;生产日期:$Date</div>
<table align='center' style='width:100%;margin-top:5px;border-collapse:collapse;border-width:1px;line-height:15px;'>
<tr><td>执行标准:</td><td>GB/T9959.2-2008</td><td rowspan='3'><img src='$ImageUrl' style='margin:-5px 0px -5px 20px;' /></td></tr>
<table align='center' style='width:100%;margin-top:5px;border-collapse:collapse;border-width:1px;'>
<tr><td>执行标准:</td><td>GB/T9959.2-2008</td><td rowspan='6'><img src='$ImageUrl' style='margin:-5px 0px -5px 20px;' /></td></tr>
<tr><td>储存条件:</td><td>-18℃以下保存</td></tr>
<tr><td>保 质 期:</td><td>18个月</td></tr>
<tr><td>生产厂家:</td><td colspan='2'>青岛万福集团股份有限公司</td></tr>
<tr><td>生产厂址:</td><td colspan='2'>青岛莱西市珠海路五号</td></tr>
<tr><td>&nbsp;</td><td colspan='2' style='font-size:12px;'>$Code</td></tr>
</table>
</body>
</html>

+ 174
- 52
ButcherFactory.Form/SegmentStockUp_/SegmentStockUpForm.Designer.cs View File

@ -28,18 +28,25 @@
/// </summary>
private void InitializeComponent()
{
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle13 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle14 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle19 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle15 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle16 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle17 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle18 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
this.uScanPanel1 = new WinFormControl.UScanPanel();
this.panel4 = new System.Windows.Forms.Panel();
this.goodsLbl = new System.Windows.Forms.Label();
@ -58,6 +65,13 @@
this.D_SUnitNum = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.label12 = new System.Windows.Forms.Label();
this.panel6 = new System.Windows.Forms.Panel();
this.finishGrid = new WinFormControl.UDataGridView();
this.F_RowIndex = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.F_Name = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.F_UnitNum = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.F_SecondNumber = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.F_SUnitNum = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.F_SSecondNumber = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.label13 = new System.Windows.Forms.Label();
this.detailGridView = new WinFormControl.UDataGridView();
this.B_DeliverGoodsLine_Name = new System.Windows.Forms.DataGridViewTextBoxColumn();
@ -79,6 +93,7 @@
this.panel5.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.mainGridView)).BeginInit();
this.panel6.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.finishGrid)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.detailGridView)).BeginInit();
this.panel7.SuspendLayout();
this.SuspendLayout();
@ -181,8 +196,8 @@
this.mainGridView.AllowUserToDeleteRows = false;
this.mainGridView.AllowUserToResizeColumns = false;
this.mainGridView.AllowUserToResizeRows = false;
dataGridViewCellStyle6.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(217)))), ((int)(((byte)(238)))), ((int)(((byte)(255)))));
this.mainGridView.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle6;
dataGridViewCellStyle13.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(217)))), ((int)(((byte)(238)))), ((int)(((byte)(255)))));
this.mainGridView.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle13;
this.mainGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
@ -190,12 +205,12 @@
this.mainGridView.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.mainGridView.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None;
this.mainGridView.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.None;
dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle7.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(77)))), ((int)(((byte)(135)))), ((int)(((byte)(245)))));
dataGridViewCellStyle7.Font = new System.Drawing.Font("宋体", 10F);
dataGridViewCellStyle7.ForeColor = System.Drawing.Color.White;
dataGridViewCellStyle7.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.mainGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle7;
dataGridViewCellStyle14.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle14.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(77)))), ((int)(((byte)(135)))), ((int)(((byte)(245)))));
dataGridViewCellStyle14.Font = new System.Drawing.Font("宋体", 10F);
dataGridViewCellStyle14.ForeColor = System.Drawing.Color.White;
dataGridViewCellStyle14.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.mainGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle14;
this.mainGridView.ColumnHeadersHeight = 30;
this.mainGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
this.mainGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
@ -213,10 +228,10 @@
this.mainGridView.Name = "mainGridView";
this.mainGridView.ReadOnly = true;
this.mainGridView.RowHeadersVisible = false;
dataGridViewCellStyle12.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(234)))), ((int)(((byte)(243)))), ((int)(((byte)(250)))));
dataGridViewCellStyle12.Font = new System.Drawing.Font("宋体", 9F);
dataGridViewCellStyle12.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(77)))), ((int)(((byte)(135)))), ((int)(((byte)(245)))));
this.mainGridView.RowsDefaultCellStyle = dataGridViewCellStyle12;
dataGridViewCellStyle19.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(234)))), ((int)(((byte)(243)))), ((int)(((byte)(250)))));
dataGridViewCellStyle19.Font = new System.Drawing.Font("宋体", 9F);
dataGridViewCellStyle19.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(77)))), ((int)(((byte)(135)))), ((int)(((byte)(245)))));
this.mainGridView.RowsDefaultCellStyle = dataGridViewCellStyle19;
this.mainGridView.RowTemplate.Height = 40;
this.mainGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.mainGridView.Size = new System.Drawing.Size(545, 320);
@ -262,8 +277,8 @@
// D_SecondNumber
//
this.D_SecondNumber.DataPropertyName = "SecondNumber";
dataGridViewCellStyle8.Format = "#0.######";
this.D_SecondNumber.DefaultCellStyle = dataGridViewCellStyle8;
dataGridViewCellStyle15.Format = "#0.######";
this.D_SecondNumber.DefaultCellStyle = dataGridViewCellStyle15;
this.D_SecondNumber.HeaderText = "订货数量";
this.D_SecondNumber.Name = "D_SecondNumber";
this.D_SecondNumber.ReadOnly = true;
@ -272,8 +287,8 @@
// D_UnitNum
//
this.D_UnitNum.DataPropertyName = "UnitNum";
dataGridViewCellStyle9.Format = "#0.######";
this.D_UnitNum.DefaultCellStyle = dataGridViewCellStyle9;
dataGridViewCellStyle16.Format = "#0.######";
this.D_UnitNum.DefaultCellStyle = dataGridViewCellStyle16;
this.D_UnitNum.HeaderText = "订货重量";
this.D_UnitNum.Name = "D_UnitNum";
this.D_UnitNum.ReadOnly = true;
@ -282,8 +297,8 @@
// D_SSecondNumber
//
this.D_SSecondNumber.DataPropertyName = "SSecondNumber";
dataGridViewCellStyle10.Format = "#0.######";
this.D_SSecondNumber.DefaultCellStyle = dataGridViewCellStyle10;
dataGridViewCellStyle17.Format = "#0.######";
this.D_SSecondNumber.DefaultCellStyle = dataGridViewCellStyle17;
this.D_SSecondNumber.HeaderText = "备货数量";
this.D_SSecondNumber.Name = "D_SSecondNumber";
this.D_SSecondNumber.ReadOnly = true;
@ -292,8 +307,8 @@
// D_SUnitNum
//
this.D_SUnitNum.DataPropertyName = "SUnitNum";
dataGridViewCellStyle11.Format = "#0.######";
this.D_SUnitNum.DefaultCellStyle = dataGridViewCellStyle11;
dataGridViewCellStyle18.Format = "#0.######";
this.D_SUnitNum.DefaultCellStyle = dataGridViewCellStyle18;
this.D_SUnitNum.HeaderText = "备货重量";
this.D_SUnitNum.Name = "D_SUnitNum";
this.D_SUnitNum.ReadOnly = true;
@ -315,6 +330,7 @@
this.panel6.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Right)));
this.panel6.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(247)))), ((int)(((byte)(247)))), ((int)(((byte)(247)))));
this.panel6.Controls.Add(this.finishGrid);
this.panel6.Controls.Add(this.label13);
this.panel6.Controls.Add(this.detailGridView);
this.panel6.Location = new System.Drawing.Point(580, 142);
@ -322,6 +338,104 @@
this.panel6.Size = new System.Drawing.Size(600, 362);
this.panel6.TabIndex = 13;
//
// finishGrid
//
this.finishGrid.AllowUserToAddRows = false;
this.finishGrid.AllowUserToDeleteRows = false;
this.finishGrid.AllowUserToResizeColumns = false;
this.finishGrid.AllowUserToResizeRows = false;
dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(254)))), ((int)(((byte)(228)))), ((int)(((byte)(203)))));
this.finishGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
this.finishGrid.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.finishGrid.BackgroundColor = System.Drawing.Color.White;
this.finishGrid.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.finishGrid.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None;
this.finishGrid.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.None;
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(129)))), ((int)(((byte)(213)))), ((int)(((byte)(68)))));
dataGridViewCellStyle2.Font = new System.Drawing.Font("宋体", 10F);
dataGridViewCellStyle2.ForeColor = System.Drawing.Color.White;
dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.finishGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2;
this.finishGrid.ColumnHeadersHeight = 30;
this.finishGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
this.finishGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.F_RowIndex,
this.F_Name,
this.F_UnitNum,
this.F_SecondNumber,
this.F_SUnitNum,
this.F_SSecondNumber});
this.finishGrid.EnableHeadersVisualStyles = false;
this.finishGrid.Location = new System.Drawing.Point(10, 314);
this.finishGrid.MultiSelect = false;
this.finishGrid.Name = "finishGrid";
this.finishGrid.ReadOnly = true;
this.finishGrid.RowHeadersVisible = false;
dataGridViewCellStyle7.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(247)))), ((int)(((byte)(240)))));
dataGridViewCellStyle7.Font = new System.Drawing.Font("宋体", 10F);
dataGridViewCellStyle7.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(129)))), ((int)(((byte)(213)))), ((int)(((byte)(68)))));
this.finishGrid.RowsDefaultCellStyle = dataGridViewCellStyle7;
this.finishGrid.RowTemplate.Height = 40;
this.finishGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.finishGrid.Size = new System.Drawing.Size(580, 37);
this.finishGrid.TabIndex = 8;
//
// F_RowIndex
//
this.F_RowIndex.DataPropertyName = "RowIndex";
this.F_RowIndex.HeaderText = "序号";
this.F_RowIndex.Name = "F_RowIndex";
this.F_RowIndex.ReadOnly = true;
this.F_RowIndex.Width = 80;
//
// F_Name
//
this.F_Name.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.F_Name.DataPropertyName = "Name";
this.F_Name.HeaderText = "线路名称";
this.F_Name.MinimumWidth = 100;
this.F_Name.Name = "F_Name";
this.F_Name.ReadOnly = true;
//
// F_UnitNum
//
this.F_UnitNum.DataPropertyName = "UnitNum";
dataGridViewCellStyle3.Format = "#0.######";
this.F_UnitNum.DefaultCellStyle = dataGridViewCellStyle3;
this.F_UnitNum.HeaderText = "订货重量";
this.F_UnitNum.Name = "F_UnitNum";
this.F_UnitNum.ReadOnly = true;
//
// F_SecondNumber
//
this.F_SecondNumber.DataPropertyName = "SecondNumber";
dataGridViewCellStyle4.Format = "#0.######";
this.F_SecondNumber.DefaultCellStyle = dataGridViewCellStyle4;
this.F_SecondNumber.HeaderText = "订货数量";
this.F_SecondNumber.Name = "F_SecondNumber";
this.F_SecondNumber.ReadOnly = true;
//
// F_SUnitNum
//
this.F_SUnitNum.DataPropertyName = "SUnitNum";
dataGridViewCellStyle5.Format = "#0.######";
this.F_SUnitNum.DefaultCellStyle = dataGridViewCellStyle5;
this.F_SUnitNum.HeaderText = "备货重量";
this.F_SUnitNum.Name = "F_SUnitNum";
this.F_SUnitNum.ReadOnly = true;
//
// F_SSecondNumber
//
this.F_SSecondNumber.DataPropertyName = "SSecondNumber";
dataGridViewCellStyle6.Format = "#0.######";
this.F_SSecondNumber.DefaultCellStyle = dataGridViewCellStyle6;
this.F_SSecondNumber.HeaderText = "备货数量";
this.F_SSecondNumber.Name = "F_SSecondNumber";
this.F_SSecondNumber.ReadOnly = true;
//
// label13
//
this.label13.AutoSize = true;
@ -339,21 +453,20 @@
this.detailGridView.AllowUserToDeleteRows = false;
this.detailGridView.AllowUserToResizeColumns = false;
this.detailGridView.AllowUserToResizeRows = false;
dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(254)))), ((int)(((byte)(228)))), ((int)(((byte)(203)))));
this.detailGridView.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
this.detailGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
dataGridViewCellStyle8.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(254)))), ((int)(((byte)(228)))), ((int)(((byte)(203)))));
this.detailGridView.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle8;
this.detailGridView.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.detailGridView.BackgroundColor = System.Drawing.Color.White;
this.detailGridView.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.detailGridView.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None;
this.detailGridView.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.None;
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(236)))), ((int)(((byte)(148)))), ((int)(((byte)(74)))));
dataGridViewCellStyle2.Font = new System.Drawing.Font("宋体", 10F);
dataGridViewCellStyle2.ForeColor = System.Drawing.Color.White;
dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.detailGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2;
dataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle9.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(236)))), ((int)(((byte)(148)))), ((int)(((byte)(74)))));
dataGridViewCellStyle9.Font = new System.Drawing.Font("宋体", 10F);
dataGridViewCellStyle9.ForeColor = System.Drawing.Color.White;
dataGridViewCellStyle9.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.detailGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle9;
this.detailGridView.ColumnHeadersHeight = 30;
this.detailGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
this.detailGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
@ -369,13 +482,13 @@
this.detailGridView.Name = "detailGridView";
this.detailGridView.ReadOnly = true;
this.detailGridView.RowHeadersVisible = false;
dataGridViewCellStyle5.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(247)))), ((int)(((byte)(240)))));
dataGridViewCellStyle5.Font = new System.Drawing.Font("宋体", 10F);
dataGridViewCellStyle5.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(236)))), ((int)(((byte)(148)))), ((int)(((byte)(74)))));
this.detailGridView.RowsDefaultCellStyle = dataGridViewCellStyle5;
dataGridViewCellStyle12.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(247)))), ((int)(((byte)(240)))));
dataGridViewCellStyle12.Font = new System.Drawing.Font("宋体", 10F);
dataGridViewCellStyle12.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(236)))), ((int)(((byte)(148)))), ((int)(((byte)(74)))));
this.detailGridView.RowsDefaultCellStyle = dataGridViewCellStyle12;
this.detailGridView.RowTemplate.Height = 40;
this.detailGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.detailGridView.Size = new System.Drawing.Size(580, 320);
this.detailGridView.Size = new System.Drawing.Size(580, 268);
this.detailGridView.TabIndex = 6;
//
// B_DeliverGoodsLine_Name
@ -411,12 +524,13 @@
this.B_SaleOutStoreID.HeaderText = "销售出库单";
this.B_SaleOutStoreID.Name = "B_SaleOutStoreID";
this.B_SaleOutStoreID.ReadOnly = true;
this.B_SaleOutStoreID.Visible = false;
//
// B_SecondNumber
//
this.B_SecondNumber.DataPropertyName = "SecondNumber";
dataGridViewCellStyle3.Format = "#0.######";
this.B_SecondNumber.DefaultCellStyle = dataGridViewCellStyle3;
dataGridViewCellStyle10.Format = "#0.######";
this.B_SecondNumber.DefaultCellStyle = dataGridViewCellStyle10;
this.B_SecondNumber.HeaderText = "数量";
this.B_SecondNumber.Name = "B_SecondNumber";
this.B_SecondNumber.ReadOnly = true;
@ -425,8 +539,8 @@
// B_UnitNumber
//
this.B_UnitNumber.DataPropertyName = "UnitNumber";
dataGridViewCellStyle4.Format = "#0.######";
this.B_UnitNumber.DefaultCellStyle = dataGridViewCellStyle4;
dataGridViewCellStyle11.Format = "#0.######";
this.B_UnitNumber.DefaultCellStyle = dataGridViewCellStyle11;
this.B_UnitNumber.HeaderText = "重量";
this.B_UnitNumber.Name = "B_UnitNumber";
this.B_UnitNumber.ReadOnly = true;
@ -545,6 +659,7 @@
((System.ComponentModel.ISupportInitialize)(this.mainGridView)).EndInit();
this.panel6.ResumeLayout(false);
this.panel6.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.finishGrid)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.detailGridView)).EndInit();
this.panel7.ResumeLayout(false);
this.panel7.PerformLayout();
@ -576,12 +691,6 @@
private System.Windows.Forms.Panel panel7;
private Controls.ColorButton refresh;
private System.Windows.Forms.CheckBox printCk;
private System.Windows.Forms.DataGridViewTextBoxColumn B_DeliverGoodsLine_Name;
private System.Windows.Forms.DataGridViewTextBoxColumn B_ShortCode;
private System.Windows.Forms.DataGridViewTextBoxColumn B_Goods_Name;
private System.Windows.Forms.DataGridViewTextBoxColumn B_SaleOutStoreID;
private System.Windows.Forms.DataGridViewTextBoxColumn B_SecondNumber;
private System.Windows.Forms.DataGridViewTextBoxColumn B_UnitNumber;
private System.Windows.Forms.DataGridViewTextBoxColumn D_Finishd;
private System.Windows.Forms.DataGridViewTextBoxColumn D_DeliverGoodsLine_Name;
private System.Windows.Forms.DataGridViewTextBoxColumn D_Goods_Name;
@ -590,5 +699,18 @@
private System.Windows.Forms.DataGridViewTextBoxColumn D_UnitNum;
private System.Windows.Forms.DataGridViewTextBoxColumn D_SSecondNumber;
private System.Windows.Forms.DataGridViewTextBoxColumn D_SUnitNum;
private WinFormControl.UDataGridView finishGrid;
private System.Windows.Forms.DataGridViewTextBoxColumn F_RowIndex;
private System.Windows.Forms.DataGridViewTextBoxColumn F_Name;
private System.Windows.Forms.DataGridViewTextBoxColumn F_UnitNum;
private System.Windows.Forms.DataGridViewTextBoxColumn F_SecondNumber;
private System.Windows.Forms.DataGridViewTextBoxColumn F_SUnitNum;
private System.Windows.Forms.DataGridViewTextBoxColumn F_SSecondNumber;
private System.Windows.Forms.DataGridViewTextBoxColumn B_DeliverGoodsLine_Name;
private System.Windows.Forms.DataGridViewTextBoxColumn B_ShortCode;
private System.Windows.Forms.DataGridViewTextBoxColumn B_Goods_Name;
private System.Windows.Forms.DataGridViewTextBoxColumn B_SaleOutStoreID;
private System.Windows.Forms.DataGridViewTextBoxColumn B_SecondNumber;
private System.Windows.Forms.DataGridViewTextBoxColumn B_UnitNumber;
}
}

+ 251
- 66
ButcherFactory.Form/SegmentStockUp_/SegmentStockUpForm.cs View File

@ -31,91 +31,207 @@ namespace ButcherFactory.SegmentStockUp_
#endregion
DateTime sendTime = DateTime.Today;
List<SaleOutStoreInfo> allMain;
List<SegmentStockUp> allDetail;
BindingList<SaleOutStoreInfo> mainList;
BindingList<SegmentStockUp> detailList;
Thread uploadData;
BindingList<DeliverGoodsLineTemp> finishList;
List<SaleOutStoreInfo> allMain;
List<SegmentStockUp> allDetail;
List<AlreadyStockUp> alreadyList;
Thread syncStockdNumber;
Thread refreshFromServer;
Thread loadBindTask;//onetime
public SegmentStockUpForm()
{
InitializeComponent();
finishList = new BindingList<DeliverGoodsLineTemp>();
allMain = new List<SaleOutStoreInfo>();
allDetail = new List<SegmentStockUp>();
// dataPicker.Text = sendTime.ToString("yyyy-MM-dd");
alreadyList = new List<AlreadyStockUp>();
// dataPicker.Text = sendTime.ToString("yyyy-MM-dd");
uScanPanel1.AfterScan += uScanPanel1_AfterScan;
this.FormClosing += delegate
{
if (uploadData != null && uploadData.IsAlive)
uploadData.Abort();
if (refreshFromServer != null && refreshFromServer.IsAlive)
refreshFromServer.Abort();
AbortTask();
};
}
void AbortTask()
{
if (loadBindTask != null && loadBindTask.IsAlive)
loadBindTask.Abort();
if (syncStockdNumber != null && syncStockdNumber.IsAlive)
syncStockdNumber.Abort();
if (refreshFromServer != null && refreshFromServer.IsAlive)
refreshFromServer.Abort();
}
protected override void OnLoad(EventArgs e)
{
var initTask = new Thread(LoadBind);
initTask.Start();
uploadData = new Thread(UpLoadLocalData);
uploadData.Start();
StartTask();
base.OnLoad(e);
}
void StartTask()
{
allDetail = SegmentStockUpBL.GetLocalList(sendTime);
loadBindTask = new Thread(LoadBind);
loadBindTask.Start();
syncStockdNumber = new Thread(SyncStockdNumber);
syncStockdNumber.Start();
refreshFromServer = new Thread(RefreshFromServer);
refreshFromServer.Start();
base.OnLoad(e);
}
private void LoadBind()
{
this.Invoke(new Action(() =>
var mainList = SegmentStockUpBL.GetSaleOutStoreList(sendTime);
var appendAlready = SegmentStockUpBL.SyncAlreadyNumber(mainList.Select(x => x.DetailID), null);
ReBind(mainList, appendAlready);
}
object _lock = new object();
//loadBind,Refresh, taskMain,taskAlready,Scan
void ReBind(List<SaleOutStoreInfo> mainList, List<AlreadyStockUp> appendAlready)
{
lock (_lock)
{
SegmentStockUpBL.DeleteOld();
allDetail = SegmentStockUpBL.GetLocalList(sendTime);
}));
AppendData(mainList, appendAlready);
var needRefresh = PrepareFinishList();
if (needRefresh)
BindFinishGrid();
}
}
private void UpLoadLocalData()
void AppendData(List<SaleOutStoreInfo> mainList, List<AlreadyStockUp> appendAlready)
{
while (true)
if (mainList.Any())
allMain = mainList;
foreach (var item in appendAlready)
{
this.Invoke(new Action(() =>
var first = alreadyList.FirstOrDefault(x => x.DetailID == item.DetailID);
if (first == null)
{
first = item;
alreadyList.Add(item);
}
else if (first.MaxID < item.MaxID)
{
SegmentStockUpBL.SyncToServer();
}));
Thread.Sleep(5000);
first.MaxID = item.MaxID;
first.UnitNum = (first.UnitNum ?? 0) + (item.UnitNum ?? 0);
first.SecondNumber = (first.SecondNumber ?? 0) + (item.SecondNumber ?? 0);
}
else
continue;
//局部更新
if (!mainList.Any())
UpdateMainInfo(first);
}
//全量更新
if (mainList.Any())
{
foreach (var item in alreadyList)
UpdateMainInfo(item);
}
}
private void RefreshFromServer()
void UpdateMainInfo(AlreadyStockUp item)
{
while (true)
var mainFirst = allMain.FirstOrDefault(x => x.DetailID == item.DetailID);
if (mainFirst != null)
{
RefreshData();
Thread.Sleep(2 * 60 * 1000);
mainFirst.StandardPic = false;//item.StandardPic;
mainFirst.SUnitNum = item.UnitNum;
mainFirst.SSecondNumber = item.SecondNumber;
}
}
//返回是否需要更新Grid;
bool PrepareFinishList()
{
var old = finishList.ToList();
var append = new List<DeliverGoodsLineTemp>();
finishList = new BindingList<DeliverGoodsLineTemp>();
var idx = 0;
foreach (var item in allMain.GroupBy(x => x.DeliverGoodsLine_Name).Where(x => x.All(y => y.Finishd)))
{
var detail = new DeliverGoodsLineTemp();
detail.RowIndex = ++idx;
detail.Name = item.Key;
detail.UnitNum = item.Sum(x => x.UnitNum ?? 0);
detail.SecondNumber = item.Sum(x => x.SecondNumber ?? 0);
detail.SUnitNum = item.Sum(x => x.SUnitNum ?? 0);
detail.SSecondNumber = item.Sum(x => x.SSecondNumber ?? 0);
if (!old.Any(x => x.Name == item.Key))
{
idx--;
append.Add(detail);
}
else
finishList.Insert(0, detail);
}
foreach (var item in append)
{
item.RowIndex = ++idx;
finishList.Insert(0, item);
}
if (old.Count != finishList.Count)
return true;
return old.Except(finishList).Count() != 0;
}
void BindFinishGrid()
{
this.Invoke(new Action(() =>
{
finishGrid.DataSource = finishList;
if (finishList.Any())
finishGrid.Rows[0].Selected = true;
finishGrid.Refresh();
}));
}
void RefreshData()
private void SyncStockdNumber()
{
try
while (true)
{
allMain = SegmentStockUpBL.GetSaleOutStoreList(sendTime);
foreach (var g in allDetail.GroupBy(x => x.DetailID))
Thread.Sleep(2000);
IEnumerable<long> tags = new List<long>();
long? maxID = null;
if (alreadyList.Any())
maxID = alreadyList.Max(x => x.MaxID);
else
tags = allMain.Select(x => x.DetailID);
if (maxID.HasValue || tags.Any())
{
var first = allMain.FirstOrDefault(x => x.DetailID == g.Key);
if (first != null)
var temp = SegmentStockUpBL.SyncAlreadyNumber(tags, maxID);
if (temp.Any())
{
first.StandardPic = g.First().StandardPic;
first.SUnitNum = g.Sum(x => x.UnitNumber ?? 0);
first.SSecondNumber = g.Sum(x => x.SecondNumber ?? 0);
ReBind(new List<SaleOutStoreInfo>(), temp);
}
}
}
catch
}
private void RefreshFromServer()
{
while (true)
{
#if DEBUG
throw;
#endif
Thread.Sleep(2 * 60 * 1000);
var temp = SegmentStockUpBL.GetSaleOutStoreList(sendTime);
if (temp.Any())
{
ReBind(temp, new List<AlreadyStockUp>());
}
}
}
@ -126,46 +242,81 @@ namespace ButcherFactory.SegmentStockUp_
return;
if (allDetail.Any(x => x.BarCode == code))
{
InfoBox.Show("错误", "条码已使用过", Color.Green, 1);
InfoBox.Show("错误", "条码已使用过", Color.Green, 1, this);
return;
}
var info = SegmentStockUpBL.StockUpScan(code);
if (info == null)
{
InfoBox.Show("错误", "条码未入库", Color.Blue, 1);
InfoBox.Show("错误", "条码未入库", Color.Blue, 1, this);
return;
}
var first = allMain.FirstOrDefault(x => !x.Finishd && x.Goods_Code == info.Item1);
if (first == null)
{
InfoBox.Show("提示", "没有订单", Color.Red, 1);
return;
}
InsertDetail(info, first);
InsertDetail(info);
}
void InsertDetail(Tuple<string,decimal?,bool> scan,SaleOutStoreInfo saleOutStore)
void InsertDetail(Tuple<string, decimal?, bool> scan)
{
var saleOutStore = allMain.FirstOrDefault(x => !x.Finishd && x.Goods_Code == scan.Item1);
if (saleOutStore == null)
{
InfoBox.Show("提示", "没有订单", Color.Red, 1, this);
return;
}
var detail = new SegmentStockUp();
detail.BarCode = uScanPanel1.TextBox.Text;
detail.Date = sendTime;
detail.DetailID = saleOutStore.DetailID;
detail.DeliverGoodsLine_Name = saleOutStore.DeliverGoodsLine_Name;
detail.Goods_Name = saleOutStore.Goods_Name;
detail.BillID = saleOutStore.BillID;
//detail.BillID = saleOutStore.BillID;
detail.UnitNumber = scan.Item2;
detail.StandardPic = scan.Item3;
if (detail.UnitNumber.HasValue && saleOutStore.Rate.HasValue)
detail.SecondNumber = detail.UnitNumber * saleOutStore.Rate;
else
detail.SecondNumber = 1;
SegmentStockUpBL.Insert(detail);
var number =saleOutStore.UnitNum ;
var already = alreadyList.FirstOrDefault(x => x.DetailID == detail.DetailID);
if (already == null)
already = new AlreadyStockUp() { DetailID = detail.DetailID };//StandardPic = detail.StandardPic
var back = SegmentStockUpBL.Insert(detail, already, number.Value);
if (back == null)
{
InfoBox.Show("提示", "网络错误!", Color.Red, 1, this);
return;
}
if (back.State == -1)
{
InfoBox.Show("提示", "条码已使用过", Color.Green, 1, this);
return;
}
//back.StandardPic = detail.StandardPic;
back.DetailID = detail.DetailID;
if (back.State == 0)
{
ReBind(new List<SaleOutStoreInfo>(), new List<AlreadyStockUp> { back });
InsertDetail(scan);
return;
}
if (back.State != 1)
{
InfoBox.Show("提示", "未知状态" + back.State, Color.Green, 1, this);
return;
}
ReBind(new List<SaleOutStoreInfo>(), new List<AlreadyStockUp> { back });
allDetail.Add(detail);
if (printCk.Checked)
SegmentStockUpPrint.Print(detail, saleOutStore.Customer_Name);
saleOutStore.StandardPic = detail.StandardPic;
saleOutStore.SSecondNumber = (saleOutStore.SSecondNumber ?? 0) + (detail.SecondNumber ?? 0);
saleOutStore.SUnitNum = (saleOutStore.SUnitNum ?? 0) + (detail.UnitNumber ?? 0);
{
var last = allMain.Where(x => x.Goods_Name == saleOutStore.Goods_Name && x.DeliverGoodsLine_Name == saleOutStore.DeliverGoodsLine_Name)
.Sum(x => ((x.UnitNum ?? 0) - (x.SUnitNum ?? 0)) < 0 ? 0 : ((x.UnitNum ?? 0) - (x.SUnitNum ?? 0)));
if (last < 0)
last = 0;
SegmentStockUpPrint.Print(detail,last, saleOutStore.Customer_Name);
}
BindMainGrid(saleOutStore);
}
@ -196,15 +347,15 @@ namespace ButcherFactory.SegmentStockUp_
{
//if (first != null)
//{
driveLineLbl.Text = first.DeliverGoodsLine_Name;
goodsLbl.Text = first.Goods_Name;
dhNumberLbl.Text = string.Format("{0:#0.##}", first.SecondNumber);
dhUnitNumLbl.Text = string.Format("{0:#0.##}", first.UnitNum);
bhNumberLbl.Text = string.Format("{0:#0.##}", first.SSecondNumber);
bhUnitNumLbl.Text = string.Format("{0:#0.##}", first.SUnitNum);
var detail = allDetail.Where(x => x.DeliverGoodsLine_Name == first.DeliverGoodsLine_Name && x.Goods_Name == first.Goods_Name).OrderByDescending(x => x.ID);
detailList = new BindingList<SegmentStockUp>(detail.ToList());
driveLineLbl.Text = first.DeliverGoodsLine_Name;
goodsLbl.Text = first.Goods_Name;
dhNumberLbl.Text = string.Format("{0:#0.##}", first.SecondNumber);
dhUnitNumLbl.Text = string.Format("{0:#0.##}", first.UnitNum);
bhNumberLbl.Text = string.Format("{0:#0.##}", first.SSecondNumber);
bhUnitNumLbl.Text = string.Format("{0:#0.##}", first.SUnitNum);
var detail = allDetail.Where(x => x.DeliverGoodsLine_Name == first.DeliverGoodsLine_Name && x.Goods_Name == first.Goods_Name).OrderByDescending(x => x.ID);
detailList = new BindingList<SegmentStockUp>(detail.ToList());
//}
//else
//{
@ -223,7 +374,9 @@ namespace ButcherFactory.SegmentStockUp_
private void refresh_Click(object sender, EventArgs e)
{
RefreshData();
AbortTask();
StartTask();
//SegmentStockUpPrint.Print(new SegmentStockUp { DeliverGoodsLine_Name = "莱阳线商品线", Date = DateTime.Today, BarCode = "260912011201810160800008" }, 123.5m, "");
}
//private void dataPicker_Click(object sender, EventArgs e)
@ -254,4 +407,36 @@ namespace ButcherFactory.SegmentStockUp_
}
}
}
class DeliverGoodsLineTemp
{
public string Name { get; set; }
public int RowIndex { get; set; }
public decimal? SecondNumber { get; set; }
public decimal? UnitNum { get; set; }
public decimal? SSecondNumber { get; set; }
public decimal? SUnitNum { get; set; }
public override bool Equals(object obj)
{
var tag = obj as DeliverGoodsLineTemp;
return tag.Name == this.Name
&& tag.UnitNum == this.UnitNum
&& tag.SecondNumber == this.SecondNumber
&& tag.SUnitNum == this.SUnitNum
&& tag.SSecondNumber == this.SSecondNumber;
}
public override int GetHashCode()
{
var hc1 = Name.GetHashCode();
var hc2 = UnitNum.GetHashCode();
var hc3 = SecondNumber.GetHashCode();
var hc4 = SUnitNum.GetHashCode();
var hc5 = SSecondNumber.GetHashCode();
return hc1 ^ hc2 ^ hc3 ^ hc4 ^ hc5;
}
}
}

+ 18
- 0
ButcherFactory.Form/SegmentStockUp_/SegmentStockUpForm.resx View File

@ -117,6 +117,24 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="F_RowIndex.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="F_Name.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="F_UnitNum.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="F_SecondNumber.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="F_SUnitNum.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="F_SSecondNumber.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="B_DeliverGoodsLine_Name.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>


+ 2
- 2
ButcherFactory.Form/SegmentStockUp_/SegmentStockUpPrint.cs View File

@ -40,11 +40,11 @@ namespace ButcherFactory.SegmentStockUp_
// PrintAPI.B_ClosePrn();
//}
public static void Print(SegmentStockUp entity, string customer)
public static void Print(SegmentStockUp entity,decimal last, string customer)
{
var templateString = File.ReadAllText("PrintTemplate\\SegmentStockUpPrint.txt", Encoding.UTF8);
var str = string.Format(templateString, customer, entity.DeliverGoodsLine_Name, entity.Date, entity.BarCode);
var str = string.Format(templateString, customer, entity.DeliverGoodsLine_Name, entity.Date, entity.BarCode, last);
var printName = GetZebraPrintName();


+ 4
- 4
ButcherFactory.Form/SegmentStockUp_/SegmentStockUpPrint.txt View File

@ -3,9 +3,9 @@
^SEE:GB18030.DAT^FS
^CWJ,E:MSUNG24.FNT^FS
^CI26
^FT20,80^AJN,36,36 ^FH\^FD客户:{0}^FS
^FT20,160^AJN,36,36 ^FH\^FD线路:{1}^FS
^FT20,240^AJN,36,36 ^FH\^FD日期:{2:yyyy/MM/dd}^FS
^FT10,350^BCN,80^FD{3}^FS
^FT20,80^AJN,36,36 ^FH\^FD线路:{1}^FS
^FT20,180^AJN,36,36 ^FH\^FD日期:{2:yyyy/MM/dd}^FS
^FT10,320^BCN,80^FD{3}^FS
^FT450,380^AJN,36,36 ^FH\^FD{4:#0.###}^FS
^PQ1,0,1,Y
^XZ

+ 30
- 0
ButcherFactory.Form/Utils/ControlsUtil.cs View File

@ -3,6 +3,7 @@ using ButcherFactory.BO.LocalBL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Speech.Synthesis;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
@ -52,5 +53,34 @@ namespace ButcherFactory.Utils
}
return control as Form;
}
public static string ParseCode(string url)
{
if (url.Contains("?"))
{
var arr = url.Split(new char[] { '?' });
if (arr.Length > 1)
{
var list = arr[1].Split(new char[] { '&' }, StringSplitOptions.RemoveEmptyEntries);
foreach (var item in list)
{
var l = item.Split(new char[] { '=' }, StringSplitOptions.RemoveEmptyEntries);
if (l.Length == 2 && l[0].ToUpper() == "CODE")
return l[1].Trim();
}
return string.Empty;
}
return string.Empty;
}
return url.Trim();
}
private static readonly SpeechSynthesizer _speechSynthesizer = new SpeechSynthesizer() { Rate = 1, Volume = 100 };
public static void PlanVoice(string text)
{
if (!string.IsNullOrEmpty(text))
_speechSynthesizer.SpeakAsync(text);
}
}
}

+ 58
- 58
SelfHelpClient/MainForm.Designer.cs View File

@ -29,21 +29,21 @@
private void InitializeComponent()
{
this.panel1 = new System.Windows.Forms.Panel();
this.weightBtn = new System.Windows.Forms.Panel();
this.weightBtnLbl = new System.Windows.Forms.Label();
this.selfBtn = new System.Windows.Forms.Panel();
this.selfBtnLbl = new System.Windows.Forms.Label();
this.panel2 = new System.Windows.Forms.Panel();
this.label2 = new System.Windows.Forms.Label();
this.titlePanel = new System.Windows.Forms.Panel();
this.closeBtn = new System.Windows.Forms.Panel();
this.label1 = new System.Windows.Forms.Label();
this.logoPanel = new System.Windows.Forms.Panel();
this.weightBtn = new System.Windows.Forms.Panel();
this.weightBtnLbl = new System.Windows.Forms.Label();
this.selfBtn = new System.Windows.Forms.Panel();
this.selfBtnLbl = new System.Windows.Forms.Label();
this.panel1.SuspendLayout();
this.panel2.SuspendLayout();
this.titlePanel.SuspendLayout();
this.weightBtn.SuspendLayout();
this.selfBtn.SuspendLayout();
this.panel2.SuspendLayout();
this.titlePanel.SuspendLayout();
this.SuspendLayout();
//
// panel1
@ -56,6 +56,54 @@
this.panel1.Size = new System.Drawing.Size(644, 271);
this.panel1.TabIndex = 0;
//
// weightBtn
//
this.weightBtn.BackgroundImage = global::SelfHelpClient.Properties.Resources.guobang;
this.weightBtn.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.weightBtn.Controls.Add(this.weightBtnLbl);
this.weightBtn.Location = new System.Drawing.Point(388, 64);
this.weightBtn.Name = "weightBtn";
this.weightBtn.Size = new System.Drawing.Size(235, 128);
this.weightBtn.TabIndex = 3;
//
// weightBtnLbl
//
this.weightBtnLbl.BackColor = System.Drawing.Color.Transparent;
this.weightBtnLbl.Dock = System.Windows.Forms.DockStyle.Fill;
this.weightBtnLbl.Font = new System.Drawing.Font("黑体", 23.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.weightBtnLbl.ForeColor = System.Drawing.Color.White;
this.weightBtnLbl.Location = new System.Drawing.Point(0, 0);
this.weightBtnLbl.Name = "weightBtnLbl";
this.weightBtnLbl.Size = new System.Drawing.Size(235, 128);
this.weightBtnLbl.TabIndex = 0;
this.weightBtnLbl.Text = "送猪过磅";
this.weightBtnLbl.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.weightBtnLbl.Click += new System.EventHandler(this.weightBtn_Click);
//
// selfBtn
//
this.selfBtn.BackgroundImage = global::SelfHelpClient.Properties.Resources.zizhufuwu;
this.selfBtn.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.selfBtn.Controls.Add(this.selfBtnLbl);
this.selfBtn.Location = new System.Drawing.Point(20, 64);
this.selfBtn.Name = "selfBtn";
this.selfBtn.Size = new System.Drawing.Size(235, 128);
this.selfBtn.TabIndex = 2;
//
// selfBtnLbl
//
this.selfBtnLbl.BackColor = System.Drawing.Color.Transparent;
this.selfBtnLbl.Dock = System.Windows.Forms.DockStyle.Fill;
this.selfBtnLbl.Font = new System.Drawing.Font("黑体", 23.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.selfBtnLbl.ForeColor = System.Drawing.Color.White;
this.selfBtnLbl.Location = new System.Drawing.Point(0, 0);
this.selfBtnLbl.Name = "selfBtnLbl";
this.selfBtnLbl.Size = new System.Drawing.Size(235, 128);
this.selfBtnLbl.TabIndex = 0;
this.selfBtnLbl.Text = "自助服务";
this.selfBtnLbl.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.selfBtnLbl.Click += new System.EventHandler(this.selfBtn_Click);
//
// panel2
//
this.panel2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(55)))), ((int)(((byte)(60)))), ((int)(((byte)(203)))));
@ -110,9 +158,9 @@
this.label1.ForeColor = System.Drawing.Color.White;
this.label1.Location = new System.Drawing.Point(72, 28);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(210, 24);
this.label1.Size = new System.Drawing.Size(351, 24);
this.label1.TabIndex = 1;
this.label1.Text = "屠宰自助服务系统";
this.label1.Text = "BWP B5 智慧生猪进厂管理系统";
//
// logoPanel
//
@ -124,54 +172,6 @@
this.logoPanel.Size = new System.Drawing.Size(42, 42);
this.logoPanel.TabIndex = 0;
//
// weightBtn
//
this.weightBtn.BackgroundImage = global::SelfHelpClient.Properties.Resources.guobang;
this.weightBtn.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.weightBtn.Controls.Add(this.weightBtnLbl);
this.weightBtn.Location = new System.Drawing.Point(388, 64);
this.weightBtn.Name = "weightBtn";
this.weightBtn.Size = new System.Drawing.Size(235, 128);
this.weightBtn.TabIndex = 3;
//
// weightBtnLbl
//
this.weightBtnLbl.BackColor = System.Drawing.Color.Transparent;
this.weightBtnLbl.Dock = System.Windows.Forms.DockStyle.Fill;
this.weightBtnLbl.Font = new System.Drawing.Font("黑体", 23.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.weightBtnLbl.ForeColor = System.Drawing.Color.White;
this.weightBtnLbl.Location = new System.Drawing.Point(0, 0);
this.weightBtnLbl.Name = "weightBtnLbl";
this.weightBtnLbl.Size = new System.Drawing.Size(235, 128);
this.weightBtnLbl.TabIndex = 0;
this.weightBtnLbl.Text = "送猪过磅";
this.weightBtnLbl.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.weightBtnLbl.Click += new System.EventHandler(this.weightBtn_Click);
//
// selfBtn
//
this.selfBtn.BackgroundImage = global::SelfHelpClient.Properties.Resources.zizhufuwu;
this.selfBtn.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.selfBtn.Controls.Add(this.selfBtnLbl);
this.selfBtn.Location = new System.Drawing.Point(20, 64);
this.selfBtn.Name = "selfBtn";
this.selfBtn.Size = new System.Drawing.Size(235, 128);
this.selfBtn.TabIndex = 2;
//
// selfBtnLbl
//
this.selfBtnLbl.BackColor = System.Drawing.Color.Transparent;
this.selfBtnLbl.Dock = System.Windows.Forms.DockStyle.Fill;
this.selfBtnLbl.Font = new System.Drawing.Font("黑体", 23.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.selfBtnLbl.ForeColor = System.Drawing.Color.White;
this.selfBtnLbl.Location = new System.Drawing.Point(0, 0);
this.selfBtnLbl.Name = "selfBtnLbl";
this.selfBtnLbl.Size = new System.Drawing.Size(235, 128);
this.selfBtnLbl.TabIndex = 0;
this.selfBtnLbl.Text = "自助服务";
this.selfBtnLbl.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.selfBtnLbl.Click += new System.EventHandler(this.selfBtn_Click);
//
// MainForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@ -186,12 +186,12 @@
this.Text = "Form1";
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
this.panel1.ResumeLayout(false);
this.weightBtn.ResumeLayout(false);
this.selfBtn.ResumeLayout(false);
this.panel2.ResumeLayout(false);
this.panel2.PerformLayout();
this.titlePanel.ResumeLayout(false);
this.titlePanel.PerformLayout();
this.weightBtn.ResumeLayout(false);
this.selfBtn.ResumeLayout(false);
this.ResumeLayout(false);
}


+ 2
- 2
SelfHelpClient/Template.Designer.cs View File

@ -55,9 +55,9 @@
this.label1.ForeColor = System.Drawing.Color.White;
this.label1.Location = new System.Drawing.Point(72, 28);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(210, 24);
this.label1.Size = new System.Drawing.Size(351, 24);
this.label1.TabIndex = 1;
this.label1.Text = "屠宰自助服务系统";
this.label1.Text = "BWP B5 智慧生猪进厂管理系统";
//
// logoPanel
//


Loading…
Cancel
Save