Browse Source

一系列的调整。

master
yibo 7 years ago
parent
commit
8af06dddfe
11 changed files with 74 additions and 51 deletions
  1. +1
    -1
      ButcherFactory.BO/LocalBL/CarcassSaleOutBL.cs
  2. +2
    -2
      ButcherFactory.BO/LocalBL/SegmentProductionBL.cs
  3. +2
    -0
      ButcherFactory.BO/Utils/AppContext.cs
  4. +1
    -1
      ButcherFactory.Form/CarcassSaleOut2_/CarcassSaleOutForm.Designer.cs
  5. +5
    -3
      ButcherFactory.Form/Dialogs/ClientGoodsSetDialog.Designer.cs
  6. +1
    -1
      ButcherFactory.Form/Dialogs/ClientGoodsSetDialog.cs
  7. +1
    -1
      ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint.cs
  8. +26
    -27
      ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint.html
  9. +3
    -3
      ButcherFactory.Form/SegmentSaleOut_/DiscontSetDialog.Designer.cs
  10. +12
    -9
      ButcherFactory.Tools/MainWindow.xaml
  11. +20
    -3
      ButcherFactory.Tools/MainWindow.xaml.cs

+ 1
- 1
ButcherFactory.BO/LocalBL/CarcassSaleOutBL.cs View File

@ -196,7 +196,7 @@ namespace ButcherFactory.BO.LocalBL
public static void SubmitDetails(IEnumerable<CarcassSaleOut_Detail> details, SaleOutStore_Detail detail) public static void SubmitDetails(IEnumerable<CarcassSaleOut_Detail> details, SaleOutStore_Detail detail)
{ {
var arr = details.Select(x => new WeightRecord { Flag = x.BarCode.StartsWith("P") ? -1 : 0, ID = x.ID, WeightTime = x.Time, MainUnitNum = x.Weight, SecondNumber = x.Number, ProductBatch_ID = x.ProductBatch_ID, BarCode = x.BarCode });
var arr = details.Select(x => new WeightRecord { Flag = (!string.IsNullOrEmpty(x.BarCode) && x.BarCode.StartsWith("P")) ? -1 : 0, ID = x.ID, WeightTime = x.Time, MainUnitNum = x.Weight, SecondNumber = x.Number, ProductBatch_ID = x.ProductBatch_ID, BarCode = x.BarCode });
var json = RpcFacade.Call<string>(RpcPath + "SaleOutStoreRpc/SaveWeightRecord", JsonConvert.SerializeObject(arr), detail.ID); var json = RpcFacade.Call<string>(RpcPath + "SaleOutStoreRpc/SaveWeightRecord", JsonConvert.SerializeObject(arr), detail.ID);
var back = JsonConvert.DeserializeObject<List<ExtensionObj>>(json); var back = JsonConvert.DeserializeObject<List<ExtensionObj>>(json);
using (var session = DmoSession.New()) using (var session = DmoSession.New())


+ 2
- 2
ButcherFactory.BO/LocalBL/SegmentProductionBL.cs View File

@ -69,7 +69,7 @@ namespace ButcherFactory.BO.LocalBL
entity.WorkUnit_ID = workUnitID; entity.WorkUnit_ID = workUnitID;
entity.ProductBatch_ID = productBatchID; entity.ProductBatch_ID = productBatchID;
entity.RowIndex = GenerateRowIndex(productBatchID, session); entity.RowIndex = GenerateRowIndex(productBatchID, session);
entity.BarCode = string.Format("260912011{0:yyyyMMdd}{1:00000}", batchDate, entity.RowIndex);
entity.BarCode = string.Format("260912011{0:yyyyMMdd}{1}{2:00000}", batchDate,AppContext.ConnectInfo.ClientCode, entity.RowIndex);
session.Insert(entity); session.Insert(entity);
session.Commit(); session.Commit();
return entity; return entity;
@ -87,7 +87,7 @@ namespace ButcherFactory.BO.LocalBL
entity.WorkUnit_ID = workUnitID; entity.WorkUnit_ID = workUnitID;
entity.ProductBatch_ID = productBatchID; entity.ProductBatch_ID = productBatchID;
entity.RowIndex = GenerateRowIndex(productBatchID, session); entity.RowIndex = GenerateRowIndex(productBatchID, session);
entity.BarCode = string.Format("260912011{0:yyyyMMdd}{1:00000}", batchDate, entity.RowIndex);
entity.BarCode = string.Format("260912011{0:yyyyMMdd}{1}{2:00000}", batchDate, AppContext.ConnectInfo.ClientCode, entity.RowIndex);
entity.Submited = true; entity.Submited = true;
session.Insert(entity); session.Insert(entity);
FillGroupIDAsID(session, entity.ID); FillGroupIDAsID(session, entity.ID);


+ 2
- 0
ButcherFactory.BO/Utils/AppContext.cs View File

@ -44,6 +44,8 @@ namespace ButcherFactory.BO.Utils
[XmlIgnore] [XmlIgnore]
public string SecondUrl { get { return ServerMode == 0 ? B3Url : MESUrl; } } public string SecondUrl { get { return ServerMode == 0 ? B3Url : MESUrl; } }
public string ClientCode { get; set; }
public string SqlConnection { get; set; } public string SqlConnection { get; set; }
private string _traceBackUrl = "default"; private string _traceBackUrl = "default";


+ 1
- 1
ButcherFactory.Form/CarcassSaleOut2_/CarcassSaleOutForm.Designer.cs View File

@ -1069,7 +1069,7 @@
this.scanCodeBtn.Size = new System.Drawing.Size(84, 35); this.scanCodeBtn.Size = new System.Drawing.Size(84, 35);
this.scanCodeBtn.StateHold = true; this.scanCodeBtn.StateHold = true;
this.scanCodeBtn.TabIndex = 30; this.scanCodeBtn.TabIndex = 30;
this.scanCodeBtn.Text = "自动发货";
this.scanCodeBtn.Text = "扫码发货";
this.scanCodeBtn.UseVisualStyleBackColor = false; this.scanCodeBtn.UseVisualStyleBackColor = false;
this.scanCodeBtn.Click += new System.EventHandler(this.scanCodeBtn_Click); this.scanCodeBtn.Click += new System.EventHandler(this.scanCodeBtn_Click);
// //


+ 5
- 3
ButcherFactory.Form/Dialogs/ClientGoodsSetDialog.Designer.cs View File

@ -38,20 +38,22 @@
this.flowLayoutPanel2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) this.flowLayoutPanel2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.flowLayoutPanel2.AutoScroll = true;
this.flowLayoutPanel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.flowLayoutPanel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.flowLayoutPanel2.Location = new System.Drawing.Point(10, 130);
this.flowLayoutPanel2.Location = new System.Drawing.Point(10, 215);
this.flowLayoutPanel2.Name = "flowLayoutPanel2"; this.flowLayoutPanel2.Name = "flowLayoutPanel2";
this.flowLayoutPanel2.Size = new System.Drawing.Size(797, 384);
this.flowLayoutPanel2.Size = new System.Drawing.Size(797, 299);
this.flowLayoutPanel2.TabIndex = 24; this.flowLayoutPanel2.TabIndex = 24;
// //
// flowLayoutPanel1 // flowLayoutPanel1
// //
this.flowLayoutPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) this.flowLayoutPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.flowLayoutPanel1.AutoScroll = true;
this.flowLayoutPanel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.flowLayoutPanel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.flowLayoutPanel1.Location = new System.Drawing.Point(10, 52); this.flowLayoutPanel1.Location = new System.Drawing.Point(10, 52);
this.flowLayoutPanel1.Name = "flowLayoutPanel1"; this.flowLayoutPanel1.Name = "flowLayoutPanel1";
this.flowLayoutPanel1.Size = new System.Drawing.Size(797, 70);
this.flowLayoutPanel1.Size = new System.Drawing.Size(797, 157);
this.flowLayoutPanel1.TabIndex = 22; this.flowLayoutPanel1.TabIndex = 22;
// //
// colseBtn // colseBtn


+ 1
- 1
ButcherFactory.Form/Dialogs/ClientGoodsSetDialog.cs View File

@ -28,7 +28,7 @@ namespace ButcherFactory.Dialogs
foreach (var item in goodsSetDic) foreach (var item in goodsSetDic)
{ {
var btn = new ColorButton() { Width = 100, Height = 62, Text = item.Key, Font = new Font("宋体", 15), Margin = new Padding(15, 3, 15, 0), EnableGroup = true };
var btn = new ColorButton() { Width = 100, Height = 62, Text = item.Key, Font = new Font("宋体", 15), Margin = new Padding(15, 5, 15, 5), EnableGroup = true };
btn.Click += GroupBtnClick; btn.Click += GroupBtnClick;
flowLayoutPanel1.Controls.Add(btn); flowLayoutPanel1.Controls.Add(btn);
} }


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

@ -27,7 +27,7 @@ namespace ButcherFactory.SegmentProduction_
dic.Add("$Date", dt.Value.ToString("yyyy/MM/dd")); dic.Add("$Date", dt.Value.ToString("yyyy/MM/dd"));
var imgUrl = string.Format(IMGFILE, id); var imgUrl = string.Format(IMGFILE, id);
var url = string.Format(AppContext.ConnectInfo.TraceBackUrl + "?code={0}", entity.BarCode); var url = string.Format(AppContext.ConnectInfo.TraceBackUrl + "?code={0}", entity.BarCode);
BwpClientPrint.BwpClientWebPrint.Create2DPic(url, imgUrl, 100);
BwpClientPrint.BwpClientWebPrint.Create2DPic(url, imgUrl, 80);
dic.Add("$ImageUrl", imgUrl); dic.Add("$ImageUrl", imgUrl);
BwpClientPrint.BwpClientWebPrint.Print(PRINTFILE, dic); BwpClientPrint.BwpClientWebPrint.Print(PRINTFILE, dic);
AfterPrint(); AfterPrint();


+ 26
- 27
ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint.html View File

@ -1,29 +1,28 @@
<html> <html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<style type='text/css'>
table tr td {
font-size:12px;
font-weight:bold;
}
.big{
font-family:黑体;
font-size:16px;
font-weight:bold;
}
</style>
</head>
<body style='margin-left:15px;'>
<div class='big'>
<div>品名:$Goods_Name</div>
<div style='margin-top:10px'>规格:$Goods_Spec &nbsp;&nbsp;生产日期:$Date</div>
</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:-13px 0px -10px 25px;'/></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>
</table>
</body>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<style type='text/css'>
table tr td {
font-size: 12px;
font-weight: bold;
}
body {
font-family: 微软雅黑;
font-weight: bold;
margin-left: 15px;
}
</style>
</head>
<body>
<div style='font-size:16px;'>品名:$Goods_Name</div>
<div style='margin-top:10px;font-size:14px;'>规格:$Goods_Spec &nbsp;&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>
<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>
</table>
</body>
</html> </html>

+ 3
- 3
ButcherFactory.Form/SegmentSaleOut_/DiscontSetDialog.Designer.cs View File

@ -57,7 +57,7 @@
this.label2.Name = "label2"; this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(56, 16); this.label2.Size = new System.Drawing.Size(56, 16);
this.label2.TabIndex = 1; this.label2.TabIndex = 1;
this.label2.Text = "扣重";
this.label2.Text = "扣重";
// //
// label3 // label3
// //
@ -67,7 +67,7 @@
this.label3.Name = "label3"; this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(56, 16); this.label3.Size = new System.Drawing.Size(56, 16);
this.label3.TabIndex = 2; this.label3.TabIndex = 2;
this.label3.Text = "扣重";
this.label3.Text = "扣重";
// //
// label4 // label4
// //
@ -77,7 +77,7 @@
this.label4.Name = "label4"; this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(56, 16); this.label4.Size = new System.Drawing.Size(56, 16);
this.label4.TabIndex = 3; this.label4.TabIndex = 3;
this.label4.Text = "扣重";
this.label4.Text = "扣重";
// //
// lbl1 // lbl1
// //


+ 12
- 9
ButcherFactory.Tools/MainWindow.xaml View File

@ -1,18 +1,21 @@
<Window x:Class="ButcherFactory.Tools.MainWindow"
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="BWP_Tools" Height="450" Width="525" ResizeMode="NoResize" >
xmlns:local="clr-namespace:ButcherFactory.Tools" x:Class="ButcherFactory.Tools.MainWindow"
Title="BWP_Tools" Height="500" Width="525" ResizeMode="NoResize" >
<Grid Margin="0,0,2,0"> <Grid Margin="0,0,2,0">
<Label Content="MES地址" HorizontalAlignment="Left" VerticalContentAlignment="Center" FontSize="18px" Margin="84,30,0,0" VerticalAlignment="Top" Height="47"/> <Label Content="MES地址" HorizontalAlignment="Left" VerticalContentAlignment="Center" FontSize="18px" Margin="84,30,0,0" VerticalAlignment="Top" Height="47"/>
<TextBox Name="mesUrlBox" HorizontalAlignment="Left" Height="65" Margin="179,34,0,0" TextWrapping="Wrap" FontSize="15px" Text="" VerticalAlignment="Top" Width="229" PreviewMouseLeftButtonDown="UrlTextBoxClick"/>
<TextBox x:Name="mesUrlBox" HorizontalAlignment="Left" Height="65" Margin="179,34,0,0" TextWrapping="Wrap" FontSize="15px" Text="" VerticalAlignment="Top" Width="229" PreviewMouseLeftButtonDown="UrlTextBoxClick"/>
<Label Content="B3地址" HorizontalAlignment="Left" VerticalContentAlignment="Center" FontSize="18px" Margin="84,118,0,0" VerticalAlignment="Top" Height="47"/> <Label Content="B3地址" HorizontalAlignment="Left" VerticalContentAlignment="Center" FontSize="18px" Margin="84,118,0,0" VerticalAlignment="Top" Height="47"/>
<TextBox Name="b3UrlBox" HorizontalAlignment="Left" Height="65" Margin="179,122,0,0" TextWrapping="Wrap" FontSize="15px" Text="" VerticalAlignment="Top" Width="229" PreviewMouseLeftButtonDown="UrlTextBoxClick"/>
<TextBox x:Name="b3UrlBox" HorizontalAlignment="Left" Height="65" Margin="179,122,0,0" TextWrapping="Wrap" FontSize="15px" Text="" VerticalAlignment="Top" Width="229" PreviewMouseLeftButtonDown="UrlTextBoxClick"/>
<Label Content="服务模式" HorizontalAlignment="Left" VerticalContentAlignment="Center" FontSize="18px" Margin="69,206,0,0" VerticalAlignment="Top" Height="47"/> <Label Content="服务模式" HorizontalAlignment="Left" VerticalContentAlignment="Center" FontSize="18px" Margin="69,206,0,0" VerticalAlignment="Top" Height="47"/>
<ComboBox Name="modeComboBox" HorizontalAlignment="Left" Margin="179,210,0,0" FontSize="18px" VerticalContentAlignment="Center" VerticalAlignment="Top" Width="229" Height="37"/>
<ComboBox x:Name="modeComboBox" HorizontalAlignment="Left" Margin="179,210,0,0" FontSize="18px" VerticalContentAlignment="Center" VerticalAlignment="Top" Width="229" Height="37"/>
<Label Content="数据库" HorizontalAlignment="Left" VerticalContentAlignment="Center" FontSize="18px" Margin="84,256,0,0" VerticalAlignment="Top" Height="47"/> <Label Content="数据库" HorizontalAlignment="Left" VerticalContentAlignment="Center" FontSize="18px" Margin="84,256,0,0" VerticalAlignment="Top" Height="47"/>
<ComboBox Name="dbComboBox" HorizontalAlignment="Left" Margin="179,262,0,0" FontSize="18px" VerticalContentAlignment="Center" VerticalAlignment="Top" Width="229" Height="37"/>
<Button Content="保存" FontSize="18px" Margin="72,337,0,0" Height="50" Width="94" HorizontalAlignment="Left" VerticalAlignment="Top" Click="SaveBtnClick"/>
<Button Content="升级" FontSize="18px" Margin="197,337,0,0" Height="50" Width="94" HorizontalAlignment="Left" VerticalAlignment="Top" Click="Button_Click"/>
<Button Content="关闭" FontSize="18px" Margin="320,337,0,0" Height="50" Width="94" HorizontalAlignment="Left" VerticalAlignment="Top" Click="CloseBtnClick"/>
<ComboBox x:Name="dbComboBox" HorizontalAlignment="Left" Margin="179,262,0,0" FontSize="18px" VerticalContentAlignment="Center" VerticalAlignment="Top" Width="229" Height="37"/>
<Label Content="机器码" HorizontalAlignment="Left" VerticalContentAlignment="Center" FontSize="18px" Margin="84,311,0,0" VerticalAlignment="Top" Height="47"/>
<TextBox x:Name="clientCodeBox" HorizontalAlignment="Left" Margin="179,320,0,0" FontSize="18px" VerticalContentAlignment="Center" VerticalAlignment="Top" Width="229" Height="37" PreviewMouseLeftButtonDown="UrlTextBoxClick"/>
<Button Content="保存" FontSize="18px" Margin="76,380,0,0" Height="50" Width="94" HorizontalAlignment="Left" VerticalAlignment="Top" Click="SaveBtnClick"/>
<Button Content="升级" FontSize="18px" Margin="201,380,0,0" Height="50" Width="94" HorizontalAlignment="Left" VerticalAlignment="Top" Click="Button_Click"/>
<Button Content="关闭" FontSize="18px" Margin="324,380,0,0" Height="50" Width="94" HorizontalAlignment="Left" VerticalAlignment="Top" Click="CloseBtnClick"/>
</Grid> </Grid>
</Window> </Window>

+ 20
- 3
ButcherFactory.Tools/MainWindow.xaml.cs View File

@ -42,6 +42,7 @@ namespace ButcherFactory.Tools
} }
this.mesUrlBox.Text = AppContext.ConnectInfo.MESUrl; this.mesUrlBox.Text = AppContext.ConnectInfo.MESUrl;
this.b3UrlBox.Text = AppContext.ConnectInfo.B3Url; this.b3UrlBox.Text = AppContext.ConnectInfo.B3Url;
this.clientCodeBox.Text = AppContext.ConnectInfo.ClientCode;
} }
catch (Exception ex) catch (Exception ex)
{ {
@ -65,6 +66,13 @@ namespace ButcherFactory.Tools
AppContext.ConnectInfo.B3Url = this.b3UrlBox.Text.Trim(); AppContext.ConnectInfo.B3Url = this.b3UrlBox.Text.Trim();
AppContext.ConnectInfo.SqlConnection = (string)dbComboBox.SelectedValue; AppContext.ConnectInfo.SqlConnection = (string)dbComboBox.SelectedValue;
AppContext.ConnectInfo.ServerMode = modeComboBox.SelectedIndex; AppContext.ConnectInfo.ServerMode = modeComboBox.SelectedIndex;
var code = this.clientCodeBox.Text.Trim();
if (!string.IsNullOrEmpty(code) && code.Length != 2)
{
MessageBox.Show("机器码长度必须为2位");
return;
}
AppContext.ConnectInfo.ClientCode = code;
AppContext.ConnectInfo.Save(); AppContext.ConnectInfo.Save();
MessageBox.Show("设置保存成功!"); MessageBox.Show("设置保存成功!");
@ -79,9 +87,18 @@ namespace ButcherFactory.Tools
{ {
var box = sender as TextBox; var box = sender as TextBox;
box.Focus(); box.Focus();
var keyBoard = new VirtualKeyPad();
if (keyBoard.ShowDialog() == true)
box.Text = keyBoard.Result;
if (box.Name == "mesUrlBox")
{
var keyBoard = new VirtualKeyPad();
if (keyBoard.ShowDialog() == true)
box.Text = keyBoard.Result;
}
else
{
var keyBoard = new NumberPad();
if (keyBoard.ShowDialog() == true)
box.Text = keyBoard.Result;
}
} }
} }


Loading…
Cancel
Save