Browse Source

...

master
wugang 8 years ago
parent
commit
4825cbf5dd
5 changed files with 56 additions and 32 deletions
  1. +16
    -8
      CowOutputClient/OperateWindow.xaml
  2. +36
    -20
      CowOutputClient/OperateWindow.xaml.cs
  3. +1
    -1
      WeighBusiness/BL/ProductCatalogBL.cs
  4. +1
    -1
      WeighBusiness/BL/ProductPlanBL.cs
  5. +2
    -2
      WeighBusiness/BL/WeightInfoBL.cs

+ 16
- 8
CowOutputClient/OperateWindow.xaml View File

@ -16,20 +16,28 @@
<RadioButton x:Name="rbFixedNum" GroupName="W" FontSize="17" Margin="0,0,0,0">固定数量双计量</RadioButton>
<RadioButton x:Name="rbSelectedNum" GroupName="W" FontSize="17" Margin="0,0,0,0">选数双计量</RadioButton>
</StackPanel>
<WrapPanel Name="ProductCatalogPanel" ItemHeight="45" ItemWidth="110" Width="350" Height="100" Margin="30,150,0,0" HorizontalAlignment="Left" VerticalAlignment="Top">
<!--<Button Focusable="False" Content="鲜品" Name="btn4" Click="btnCreateBill_Click" FontSize="20" Margin="10,10,0,0" />
<Button Focusable="False" Content="鲜品" Name="btn3" Click="btnCreateBill_Click" FontSize="20" Margin="10,10,0,0" />
<Button Focusable="False" Content="鲜品" Name="btn2" Click="btnCreateBill_Click" FontSize="20" Margin="10,10,0,0" />
<Button Focusable="False" Content="鲜品" Name="btn5" Click="btnCreateBill_Click" FontSize="20" Margin="10,10,0,0" />
<Button Focusable="False" Content="鲜品" Name="btn6" Click="btnCreateBill_Click" FontSize="20" Margin="10,0,0,0" />
<Button Focusable="False" Content="鲜品" Name="btn8" Click="btnCreateBill_Click" FontSize="20" Margin="10,0,0,0" />-->
</WrapPanel>
<ScrollViewer x:Name="scrList2" Margin="30,150,0,0" VerticalScrollBarVisibility="Auto" Width="350" Height="100" HorizontalAlignment="Left" VerticalAlignment="Top">
<WrapPanel Name="ProductCatalogPanel" ItemHeight="45" ItemWidth="110" Margin="0" Width="{Binding ElementName=scrList, Path=Width, Mode=OneWay}" >
<Button Focusable="False" Content="鲜品" Name="btn4" FontSize="20" Margin="10,10,0,0" />
<Button Focusable="False" Content="鲜品" Name="btn3" FontSize="20" Margin="10,10,0,0" />
<Button Focusable="False" Content="鲜品" Name="btn2" FontSize="20" Margin="10,10,0,0" />
<Button Focusable="False" Content="鲜品" Name="btn5" FontSize="20" Margin="10,10,0,0" />
<Button Focusable="False" Content="鲜品" Name="btn6" FontSize="20" Margin="10,0,0,0" />
<Button Focusable="False" Content="鲜品" Name="btn8" FontSize="20" Margin="10,0,0,0" />
<Button Focusable="False" Content="鲜品" Name="btn9" FontSize="20" Margin="10,0,0,0" />
<Button Focusable="False" Content="鲜品" Name="btn10" FontSize="20" Margin="10,0,0,0" />
<Button Focusable="False" Content="鲜品" Name="btn11" FontSize="20" Margin="10,0,0,0" />
<Button Focusable="False" Content="鲜品" Name="btn12" FontSize="20" Margin="10,0,0,0" />
</WrapPanel>
</ScrollViewer>
<Grid Name="Grid1" Margin="30,260,0,0" Width="350" Height="480" HorizontalAlignment="Left" VerticalAlignment="Top">
<Border BorderThickness="1" BorderBrush="Black">
</Border>
<ScrollViewer x:Name="scrList" Margin="0" VerticalScrollBarVisibility="Auto">
<!--<WrapPanel Name="CatalogDetails" ItemHeight="45" ItemWidth="110" Width="350" Height="540" >-->
<WrapPanel Name="CatalogDetails" ItemHeight="50" ItemWidth="160" Margin="0" Width="{Binding ElementName=scrList, Path=Width, Mode=OneWay}">
</WrapPanel>
</ScrollViewer>
</Grid>


+ 36
- 20
CowOutputClient/OperateWindow.xaml.cs View File

@ -60,6 +60,7 @@ namespace CowOutputClient
ProductTeamBL.SyncProductTeam();
BindCombProductBatch();
BindGridProductPlan();
BindProductCatalogs();
WindowUtil.Inf("同步成功");
}
@ -90,7 +91,7 @@ namespace CowOutputClient
details.Add(inputDetail);
}
output.Set("Details", details);
var list = RpcFacade.Call<List<long?>>("/MainSystem/B3_HaoYue/Rpcs/B3CowButcherManageRpc/CreateOutput", output,mTeam.ProductTeam_ID);
var list = RpcFacade.Call<List<long?>>("/MainSystem/B3_HaoYue/Rpcs/B3CowButcherManageRpc/CreateOutput", output,mTeam.ProductTeam_ID,false,null);
if (list.Count() > 0) {
var outputId = list[0].Value;
WeightInfoBL.UpdateOutputId(selectedItems.Select(x => x.ID).ToArray(),outputId);
@ -372,25 +373,40 @@ namespace CowOutputClient
if (combProductBatch.SelectedValue == null)
throw new ApplicationException("请选择分割生产批次");
var netWeight = WeightInfoBL.GetButcDetailIDWeight(selectedItem.DetailID);
var output = new RpcObject("/MainSystem/B3CowButcherManage/BO/Output");
output.Set<long?>("AccountingUnit_ID", long.Parse(accountingUnit_ID));
output.Set<long?>("Department_ID", wpfUser.Department_ID);
output.Set<long?>("Domain_ID", long.Parse(domain_ID));
output.Set<long?>("Employee_ID", wpfUser.Employee_ID ?? 0);
var batch = (ProductBatch)combProductBatch.SelectedItem;
output.Set<long?>("ProductBatch_ID", batch.Batch_ID);
output.Set<string>("Product_Batch", batch.Batch);
output.Set<DateTime?>("Date", DateTime.Now);
var details = new ManyList("/MainSystem/B3CowButcherManage/BO/Output_Detail");
var inputDetail = new RpcObject("/MainSystem/B3CowButcherManage/BO/Output_Detail");
inputDetail.Set<long?>("Goods_ID", selectedItem.Goods_ID);
inputDetail.Set<decimal?>("Number", netWeight);
inputDetail.Set<long?>("ButcDetailID", selectedItem.DetailID);
details.Add(inputDetail);
output.Set("Details", details);
var list = RpcFacade.Call<List<long?>>("/MainSystem/B3_HaoYue/Rpcs/B3CowButcherManageRpc/CreateOutput", output, mTeam.ProductTeam_ID);
if (list.Count() > 0) {
RpcObject output = null;
if (netWeight != null) {
output = new RpcObject("/MainSystem/B3CowButcherManage/BO/Output");
output.Set<long?>("AccountingUnit_ID", long.Parse(accountingUnit_ID));
output.Set<long?>("Department_ID", wpfUser.Department_ID);
output.Set<long?>("Domain_ID", long.Parse(domain_ID));
output.Set<long?>("Employee_ID", wpfUser.Employee_ID ?? 0);
var batch = (ProductBatch)combProductBatch.SelectedItem;
output.Set<long?>("ProductBatch_ID", batch.Batch_ID);
output.Set<string>("Product_Batch", batch.Batch);
output.Set<DateTime?>("Date", DateTime.Now);
var details = new ManyList("/MainSystem/B3CowButcherManage/BO/Output_Detail");
var inputDetail = new RpcObject("/MainSystem/B3CowButcherManage/BO/Output_Detail");
inputDetail.Set<long?>("Goods_ID", selectedItem.Goods_ID);
inputDetail.Set<decimal?>("Number", netWeight);
inputDetail.Set<long?>("ButcDetailID", selectedItem.DetailID);
details.Add(inputDetail);
output.Set("Details", details);
}
var list = RpcFacade.Call<List<long?>>("/MainSystem/B3_HaoYue/Rpcs/B3CowButcherManageRpc/CreateOutput", output, mTeam.ProductTeam_ID, true, selectedItem.DetailID);
if (list == null) {
ProductPlanBL.UpdateButhcerDetailFinish(selectedItem.DetailID);
var butDetails = gridProductPlan.ItemsSource as List<ButcherDetailData>;
var result = butDetails.Where(x => x.DetailID == selectedItem.DetailID);
butDetails.Remove(result.First());
var resultList = new List<ButcherDetailData>();
foreach (var item in butDetails) {
resultList.Add(item);
}
gridProductPlan.ItemsSource = null;
gridProductPlan.ItemsSource = resultList;
}
else if (list.Count() > 0) {
var outputId = list[0].Value;
WeightInfoBL.UpdateOutputIdByButcDetailID(selectedItem.DetailID, outputId);
BindGridWeightInfo();


+ 1
- 1
WeighBusiness/BL/ProductCatalogBL.cs View File

@ -226,7 +226,7 @@ namespace WeighBusiness.BL
public static List<ProCataGoods> GetProductCatalogDetails(bool? isSelected = null)
{
var table = SqlHelperEx.DoQuery("select a.ProductCatalog_ID,a.CatalogDetail_ID,a.Goods_Name,a.Goods_ID,b.Goods_ID,a.UnitConvertDirection,a.MainUnitRatio,a.SecondUnitRatio,a.Goods_Spec from {0} a left outer join {1} b on a.Goods_ID = b.Goods_ID where 1=1 {2}".FormatWith(TableNames., TableNames., isSelected == true ? "and b.Goods_ID is not null" : string.Empty));
var table = SqlHelperEx.DoQuery("select a.ProductCatalog_ID,a.CatalogDetail_ID,a.Goods_Name,a.Goods_ID,b.Goods_ID,a.UnitConvertDirection,a.MainUnitRatio,a.SecondUnitRatio,a.Goods_Spec from {0} a left outer join {1} b on a.ProductCatalog_ID = b.ProductCatalog_ID and a.Goods_ID = b.Goods_ID where 1=1 {2}".FormatWith(TableNames., TableNames., isSelected == true ? "and b.Goods_ID is not null" : string.Empty));
if (table.Rows.Count == 0)
return new List<ProCataGoods>();
var list = new List<ProCataGoods>();


+ 1
- 1
WeighBusiness/BL/ProductPlanBL.cs View File

@ -316,7 +316,7 @@ namespace WeighBusiness.BL
public static List<ButcherDetailData> GetButcherDetails(DateTime date,DateTime startDate,long planTeamID)
{
var list = new List<ButcherDetailData>();
var sql = "select a.Goods_ID, a.Goods_Name,a.Goods_Spec,a.Goods_MainUnit,a.PlanNumber,a.DetailID,e.FinishNumber,a.Department_Name,a.Remark from {0} a inner join {1} b on a.ProductPlan_ID = b.ProductPlan_ID inner join {2} c on c.Goods_ID = a.Goods_ID inner join {3} d on c.ProductTeam_ID = d.ProductTeam_ID left outer join {4} e on a.DetailID = e.DetailID where b.PlanDate >='{5}' and b.PlanDate < '{6}' and a.IsFinish = 0 and d.ProductTeam_ID = {7}".FormatWith(TableNames., TableNames., TableNames., TableNames., TableNames., startDate, date.AddDays(1), planTeamID);
var sql = "select a.Goods_ID, a.Goods_Name,a.Goods_Spec,a.Goods_MainUnit,a.PlanNumber,a.DetailID,e.FinishNumber,a.Department_Name,a.Remark from {0} a inner join {1} b on a.ProductPlan_ID = b.ProductPlan_ID inner join {2} c on c.Goods_ID = a.Goods_ID inner join {3} d on c.ProductTeam_ID = d.ProductTeam_ID left outer join {4} e on a.DetailID = e.DetailID where a.IsFinish = 0 and d.ProductTeam_ID = {5}".FormatWith(TableNames., TableNames., TableNames., TableNames., TableNames.,planTeamID);
if (!string.IsNullOrEmpty(sql)) {
var table = SqlHelperEx.DoQuery(sql);
foreach (DataRow row in table.Rows) {


+ 2
- 2
WeighBusiness/BL/WeightInfoBL.cs View File

@ -100,7 +100,7 @@ namespace WeighBusiness.BL
public static decimal? GetButcDetailIDWeight(long? butcDetailID,SqlHelperEx she2 = null)
{
if (butcDetailID != null) {
var sql = "select sum(NetWeight) from {0} where ButcDetailID = {1}".FormatWith(TableNames., butcDetailID);
var sql = "select sum(NetWeight) from {0} where ButcDetailID = {1} and Output_ID is null".FormatWith(TableNames., butcDetailID);
DataTable table;
if (she2 == null) {
using (var she = new SqlHelperEx()) {
@ -112,7 +112,7 @@ namespace WeighBusiness.BL
if (table.Rows.Count == 0) {
return null;
}
return (decimal?)table.Rows[0][0];
return DataTypeUtil.GetDecimalNullNum(table.Rows[0][0]);
}
return null;
}


Loading…
Cancel
Save