Browse Source

打印调整。

master
yibo 7 years ago
parent
commit
fb5d3d0e1c
6 changed files with 366 additions and 1234 deletions
  1. +0
    -6
      BO/BO.csproj
  2. +0
    -43
      BO/BO/Bill/CarcassStateWeight/CarcassStateWeight.cs
  3. +0
    -42
      BO/Utils/BillRpc/CarcassStateWeightRpc.cs
  4. +338
    -1112
      Setup/Setup.vdproj
  5. +3
    -0
      WeighAndGrading/GradeFrom.cs
  6. +25
    -31
      WeighAndGrading/WeightGradePrint.cs

+ 0
- 6
BO/BO.csproj View File

@ -30,10 +30,6 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="B3ClientService, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\tsref\Debug\B3ClientService.dll</HintPath>
</Reference>
<Reference Include="Forks.EnterpriseServices, Version=3.1.0.0, Culture=neutral, PublicKeyToken=7254430f49d10aae, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\tsref\Debug\Forks.EnterpriseServices.dll</HintPath>
@ -70,7 +66,6 @@
<Compile Include="BO\BaseInfo\Customer.cs" />
<Compile Include="BO\BaseInfo\DeliverGoodsLine.cs" />
<Compile Include="BO\BaseInfo\Farmer.cs" />
<Compile Include="BO\Bill\CarcassStateWeight\CarcassStateWeight.cs" />
<Compile Include="BO\Bill\GradeAndWeight\DataConfirmList.cs" />
<Compile Include="BO\Bill\GradeAndWeight\GradeAndWeight.cs" />
<Compile Include="BO\Bill\GradeAndWeight\DetailLastIndex.cs" />
@ -109,7 +104,6 @@
<Compile Include="Utils\BillRpc\HouseAndSanctionRpc.cs" />
<Compile Include="Utils\BillRpc\OrderDetailRpc.cs" />
<Compile Include="Utils\BillRpc\SecondOrderRpc.cs" />
<Compile Include="Utils\BillRpc\CarcassStateWeightRpc.cs" />
<Compile Include="Utils\ButcherAppContext.cs" />
<Compile Include="BO\Bill\WeightBill\WeightBill.cs" />
<Compile Include="BO\Bill\WeightBill\WeightBill_Detail.cs" />


+ 0
- 43
BO/BO/Bill/CarcassStateWeight/CarcassStateWeight.cs View File

@ -1,43 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Forks.Utils;
using BWP.B3ClientService.NamedValueTemplate;
namespace BO.BO.Bill
{
public class CarcassStateWeight
{
public long GradeAndWeight_ID { get; set; }
public long? Code { get; set; }
public long? Product_ID { get; set; }
public string Product_Name { get; set; }
public decimal? Nubmber { get; set; }
public decimal? State1Weight { get; set; }
public decimal? State2Weight { get; set; }
public decimal? State3Weight { get; set; }
public decimal? State4Weight { get; set; }
public decimal? State5Weight { get; set; }
public NamedValue<>? CurrentState { get; set; }
public decimal? CurrentWeight { get; set; }
public DateTime? Time { get; set; }
}
}

+ 0
- 42
BO/Utils/BillRpc/CarcassStateWeightRpc.cs View File

@ -1,42 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BO.BO.BaseInfo;
using BO.BO.Bill;
using Forks.JsonRpc.Client;
using System.Web.Script.Serialization;
namespace BO.Utils.BillRpc
{
public static class CarcassStateWeightRpc
{
static JavaScriptSerializer serializer = new JavaScriptSerializer();
public static List<CarcassStateWeight> GetCarcassStateWeightList(DateTime date, long? maxID = null)
{
const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/CarcassStateWeightRpc/GetCarcassStateWeightList";
var result = RpcFacade.Call<string>(method, date, maxID);
return serializer.Deserialize<List<CarcassStateWeight>>(result);
}
public static List<GradeAndWeight_Detail> GetGradeAndWeight_DetailByCode(long code)
{
const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/CarcassStateWeightRpc/GetGradeAndWeight_DetailByCode";
var obj = RpcFacade.Call<string>(method, code);
obj = obj.ESerializeDateTime();
return serializer.Deserialize<List<GradeAndWeight_Detail>>(obj);
}
public static void UpdateOrInsertDetail(CarcassStateWeight detail, bool fillTechnics = false)
{
const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/CarcassStateWeightRpc/UpdateOrInsertDetail";
detail.GradeAndWeight_ID = RpcFacade.Call<long>(method, serializer.Serialize(detail), fillTechnics);
}
}
}

+ 338
- 1112
Setup/Setup.vdproj
File diff suppressed because it is too large
View File


+ 3
- 0
WeighAndGrading/GradeFrom.cs View File

@ -70,6 +70,9 @@ namespace WeighAndGrading
public GradeFrom()
{
InitializeComponent();
if (!Directory.Exists("TempImg"))
Directory.CreateDirectory("TempImg");
butcherTimeInput.Date = DateTime.Today;
tangGridView.AutoGenerateColumns = false;
tangGridView.DataSource = null;


+ 25
- 31
WeighAndGrading/WeightGradePrint.cs View File

@ -7,6 +7,7 @@ using System.Threading.Tasks;
using BO.Utils;
using BO.Utils.BillRpc;
using BO.BO.Bill;
using System.IO;
namespace WeighAndGrading
{
@ -33,9 +34,9 @@ namespace WeighAndGrading
entity.TelNumber = "0532-88488888";
if (string.IsNullOrWhiteSpace(detail.BarCode))
{
// int order = LocalGradeAndWeightBL.GetOrderIndex(date, detail);
// if (add)
// order += 1;
// int order = LocalGradeAndWeightBL.GetOrderIndex(date, detail);
// if (add)
// order += 1;
entity.BarCode = string.Format("260912011{0:yyyyMMdd}{1:000}{2:000}", entity.Date, detail.Order, detail.OrderIndex);
}
else
@ -46,40 +47,33 @@ namespace WeighAndGrading
return entity;
}
//public static void Print(PrintEntity entity)
//{
// PrintAPI.B_GetUSBBufferLen();
// PrintAPI.B_EnumUSB(new byte[128]);
// PrintAPI.B_CreateUSBPort(1);
// PrintAPI.B_Prn_Text_TrueType(110, 26, 31, "宋体", 1, 700, 0, 0, 0, "C1", entity.AccountingUnit_Name);
// PrintAPI.B_Prn_Text_TrueType(42, 70, 31, "宋体", 1, 700, 0, 0, 0, "C2", "合格证");
// PrintAPI.B_Prn_Text_TrueType(440, 70, 31, "宋体", 1, 700, 0, 0, 0, "C3", entity.Goods_Name);
// PrintAPI.B_Prn_Text_TrueType(42, 120, 27, "宋体", 1, 400, 0, 0, 0, "C4", string.Format("生产日期:{0}", entity.Date.ToString("yyyy/MM/dd")));
// PrintAPI.B_Prn_Text_TrueType(42, 160, 27, "宋体", 1, 400, 0, 0, 0, "C5", string.Format("检 验 员:{0}", entity.Checker));
// PrintAPI.B_Prn_Text_TrueType(42, 200, 27, "宋体", 1, 400, 0, 0, 0, "C6", string.Format("保 质 期:{0}", entity.StoreCondition));
// PrintAPI.B_Prn_Text_TrueType(42, 240, 23, "宋体", 1, 400, 0, 0, 0, "C7", string.Format("电话:{0}", entity.TelNumber));
// PrintAPI.B_Prn_Text_TrueType(42, 280, 23, "宋体", 1, 400, 0, 0, 0, "C8", string.Format("产地:{0}", entity.Place));
// PrintAPI.B_Prn_Barcode(42, 320, 0, "1", 3, 22, 35, 'N', entity.BarCode);
// PrintAPI.B_Prn_Text_TrueType(173, 360, 25, "宋体", 1, 500, 0, 0, 0, "C9", entity.BarCode);
// PrintAPI.B_Bar2d_QR(430, 105, 2, 6, 'M', 'A', 0, 0, 0, entity._2DQRCode);
// PrintAPI.B_Set_Direction('B');
// PrintAPI.B_Print_Out(1);
// PrintAPI.B_ClosePrn();
//}
static int id = 1;
public static void Print(PrintEntity entity)
{
var dic = new Dictionary<string, string>();
dic.Add("$Goods_Name", entity.Goods_Name);
dic.Add("$Date", entity.Date.ToString("yyyy/MM/dd"));
BwpClientPrint.BwpClientWebPrint.Create2DPic(entity._2DQRCode, "ImageUrl.png", 120);
dic.Add("$ImageUrl", "ImageUrl.png");
var imgUrl = string.Format("TempImg\\_img{0}.png", id);
BwpClientPrint.BwpClientWebPrint.Create2DPic(entity._2DQRCode, imgUrl, 120);
dic.Add("$ImageUrl", imgUrl);
BwpClientPrint.BwpClientWebPrint.Print("GradeWeightPrint.html", dic);
if (id == 20)
id = 0;
id++;
AfterPrint();
}
static DirectoryInfo TempImage = null;
private static void AfterPrint()
{
if (TempImage == null)
TempImage = new DirectoryInfo("TempImg");
var files = TempImage.GetFiles();
if (files.Length > 10)
{
var last = files.OrderBy(x => x.CreationTime).First().FullName;
File.Delete(last);
}
}
}


Loading…
Cancel
Save