Browse Source

增加部门、备注

master
wugang 8 years ago
parent
commit
d299623c2e
4 changed files with 16 additions and 5 deletions
  1. +3
    -1
      CowOutputClient/OperateWindow.xaml
  2. +9
    -4
      WeighBusiness/BL/ProductPlanBL.cs
  3. +2
    -0
      WeighBusiness/BO/ButcherDetail.cs
  4. +2
    -0
      WeighBusiness/BO/CreateTables/CreateButcherDetail.cs

+ 3
- 1
CowOutputClient/OperateWindow.xaml View File

@ -67,7 +67,9 @@ Property="HorizontalContentAlignment" Value="Center">
</Style>
</DataGrid.ColumnHeaderStyle>
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding Goods_Name}" IsReadOnly="True" Header="产品名称" Width="2*"/>
<DataGridTextColumn Binding="{Binding Department_Name}" IsReadOnly="True" Header="部门" Width="2*"/>
<DataGridTextColumn Binding="{Binding Remark}" IsReadOnly="True" Header="备注" Width="2*"/>
<DataGridTextColumn Binding="{Binding Goods_Name}" IsReadOnly="True" Header="产品名称" Width="2*"/>
<DataGridTextColumn Binding="{Binding Goods_Spec}" IsReadOnly="True" Header="规格" Width="2*"/>
<DataGridTextColumn IsReadOnly="True" Binding="{Binding PlanNumber}" Header="计划数量" Width="2*"/>
<DataGridTextColumn IsReadOnly="True" Binding="{Binding FinishNum}" Header="完工数量" Width="2*"/>


+ 9
- 4
WeighBusiness/BL/ProductPlanBL.cs View File

@ -67,8 +67,8 @@ namespace WeighBusiness.BL
if (butcherDetails.Count() > 0) {
foreach (var detail in butcherDetails) {
string insertSql = InsertUtil.GetInsertSql(TableNames.,
new string[] { "ProductPlan_ID", "DetailID", "Goods_Code", "Goods_Name", "Goods_Spec", "Goods_MainUnit", "Goods_ID", "PlanNumber", "IsFinish" },
new string[] { detail.ProductPlan_ID.ToString(), detail.DetailID.ToString(), detail.Goods_Code, detail.Goods_Name, detail.Goods_Spec, detail.Goods_MainUnit, detail.Goods_ID.ToString(), detail.PlanNumber == null ? "null" : detail.PlanNumber.Value.ToString(),detail.IsFinish?"1":"0" });
new string[] { "ProductPlan_ID", "DetailID", "Goods_Code", "Goods_Name", "Goods_Spec", "Goods_MainUnit", "Goods_ID", "PlanNumber", "IsFinish", "Department_Name", "Remark" },
new string[] { detail.ProductPlan_ID.ToString(), detail.DetailID.ToString(), detail.Goods_Code, detail.Goods_Name, detail.Goods_Spec, detail.Goods_MainUnit, detail.Goods_ID.ToString(), detail.PlanNumber == null ? "null" : detail.PlanNumber.Value.ToString(),detail.IsFinish?"1":"0",detail.Department_Name,detail.Remark });
she.ExecuteNonQuery(insertSql, out success, out errorMessage);
if (!success && !string.IsNullOrEmpty(errorMessage)) {
she.Rollback();
@ -239,6 +239,8 @@ namespace WeighBusiness.BL
butcherDetail.Goods_MainUnit = detail.Get<string>("Goods_MainUnit");
butcherDetail.Goods_ID = detail.Get<long>("Goods_ID");
butcherDetail.PlanNumber = detail.Get<decimal?>("PlanNumber");
butcherDetail.Department_Name = detail.Get<string>("Department_Name");
butcherDetail.Remark = detail.Get<string>("Remark");
butcherList.Add(butcherDetail);
}
}
@ -301,7 +303,7 @@ namespace WeighBusiness.BL
public static List<ButcherDetailData> GetButcherDetails(DateTime date, 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 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., date, 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 b.PlanDate >='{5}' and b.PlanDate < '{6}' and a.IsFinish = 0 and d.ProductTeam_ID = {7}".FormatWith(TableNames., TableNames., TableNames., TableNames., TableNames., date, date.AddDays(1), planTeamID);
if (!string.IsNullOrEmpty(sql)) {
var table = SqlHelperEx.DoQuery(sql);
foreach (DataRow row in table.Rows) {
@ -313,6 +315,8 @@ namespace WeighBusiness.BL
outDetail.PlanNumber = DataTypeUtil.GetDecimalNum(row[4]);
outDetail.DetailID = (long)((int)row[5]);
outDetail.FinishNum = DataTypeUtil.GetDecimalNum(row[6]);
outDetail.Department_Name = (string)row[7];
outDetail.Remark = (string)row[8];
list.Add(outDetail);
}
}
@ -328,7 +332,8 @@ namespace WeighBusiness.BL
public string Goods_Spec { get; set; }
public string Goods_MainUnit { get; set; }
public decimal? PlanNumber { get; set; }
public string Department_Name { get; set; }
public string Remark { get; set; }
private decimal? mFinishNum;
public decimal? FinishNum
{


+ 2
- 0
WeighBusiness/BO/ButcherDetail.cs View File

@ -21,5 +21,7 @@ namespace WeighBusiness.BO
public long Goods_ID { get; set; }
public decimal? PlanNumber { get; set; }
public bool IsFinish { get; set; }
public string Department_Name { get; set; }
public string Remark { get; set; }
}
}

+ 2
- 0
WeighBusiness/BO/CreateTables/CreateButcherDetail.cs View File

@ -22,6 +22,8 @@ namespace WeighBusiness.BO.CreateTables
cth.AddField(new FieldInfo() { FieldName = "Goods_ID", FieldType = FBType.Integer, IsNotNull = true });
cth.AddField(new FieldInfo() { FieldName = "PlanNumber", FieldType = FBType.Decimal, FieldTypeParams = "(18, 6)" });
cth.AddField(new FieldInfo() { FieldName = "IsFinish", FieldType = FBType.Boolean, IsNotNull = true });
cth.AddField(new FieldInfo() { FieldName = "Department_Name", FieldType = FBType.Varchar, FieldTypeParams = "(100)" });
cth.AddField(new FieldInfo() { FieldName = "Remark", FieldType = FBType.Varchar, FieldTypeParams = "(100)" });
base.AddFields(cth);
}
}


Loading…
Cancel
Save