@ -67,8 +67,8 @@ namespace WeighBusiness.BL
if ( butcherDetails . Count ( ) > 0 ) {
if ( butcherDetails . Count ( ) > 0 ) {
foreach ( var detail in butcherDetails ) {
foreach ( var detail in butcherDetails ) {
string insertSql = InsertUtil . GetInsertSql ( TableNames . 生 产 计 划 分 割 明 细 ,
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 ) ;
she . ExecuteNonQuery ( insertSql , out success , out errorMessage ) ;
if ( ! success & & ! string . IsNullOrEmpty ( errorMessage ) ) {
if ( ! success & & ! string . IsNullOrEmpty ( errorMessage ) ) {
she . Rollback ( ) ;
she . Rollback ( ) ;
@ -239,6 +239,8 @@ namespace WeighBusiness.BL
butcherDetail . Goods_MainUnit = detail . Get < string > ( "Goods_MainUnit" ) ;
butcherDetail . Goods_MainUnit = detail . Get < string > ( "Goods_MainUnit" ) ;
butcherDetail . Goods_ID = detail . Get < long > ( "Goods_ID" ) ;
butcherDetail . Goods_ID = detail . Get < long > ( "Goods_ID" ) ;
butcherDetail . PlanNumber = detail . Get < decimal? > ( "PlanNumber" ) ;
butcherDetail . PlanNumber = detail . Get < decimal? > ( "PlanNumber" ) ;
butcherDetail . Department_Name = detail . Get < string > ( "Department_Name" ) ;
butcherDetail . Remark = detail . Get < string > ( "Remark" ) ;
butcherList . Add ( butcherDetail ) ;
butcherList . Add ( butcherDetail ) ;
}
}
}
}
@ -301,7 +303,7 @@ namespace WeighBusiness.BL
public static List < ButcherDetailData > GetButcherDetails ( DateTime date , long planTeamID )
public static List < ButcherDetailData > GetButcherDetails ( DateTime date , long planTeamID )
{
{
var list = new List < ButcherDetailData > ( ) ;
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 ) ) {
if ( ! string . IsNullOrEmpty ( sql ) ) {
var table = SqlHelperEx . DoQuery ( sql ) ;
var table = SqlHelperEx . DoQuery ( sql ) ;
foreach ( DataRow row in table . Rows ) {
foreach ( DataRow row in table . Rows ) {
@ -313,6 +315,8 @@ namespace WeighBusiness.BL
outDetail . PlanNumber = DataTypeUtil . GetDecimalNum ( row [ 4 ] ) ;
outDetail . PlanNumber = DataTypeUtil . GetDecimalNum ( row [ 4 ] ) ;
outDetail . DetailID = ( long ) ( ( int ) row [ 5 ] ) ;
outDetail . DetailID = ( long ) ( ( int ) row [ 5 ] ) ;
outDetail . FinishNum = DataTypeUtil . GetDecimalNum ( row [ 6 ] ) ;
outDetail . FinishNum = DataTypeUtil . GetDecimalNum ( row [ 6 ] ) ;
outDetail . Department_Name = ( string ) row [ 7 ] ;
outDetail . Remark = ( string ) row [ 8 ] ;
list . Add ( outDetail ) ;
list . Add ( outDetail ) ;
}
}
}
}
@ -328,7 +332,8 @@ namespace WeighBusiness.BL
public string Goods_Spec { get ; set ; }
public string Goods_Spec { get ; set ; }
public string Goods_MainUnit { get ; set ; }
public string Goods_MainUnit { get ; set ; }
public decimal? PlanNumber { get ; set ; }
public decimal? PlanNumber { get ; set ; }
public string Department_Name { get ; set ; }
public string Remark { get ; set ; }
private decimal? mFinishNum ;
private decimal? mFinishNum ;
public decimal? FinishNum
public decimal? FinishNum
{
{