/// <summary> /// 根据出库单明细获取包装器具的交易记录 /// </summary> /// <param name="outputDetailInfos"></param> /// <param name="loginUser"></param> /// <returns></returns> public static string CreatePackageTranDetailsSql(List <OutputDetailInfo> outputDetailInfos, string loginUser) { List <PackageApplianceInfo> packageApplianceInfos = new PackageApplianceDAL().GetList("" + "[PACKAGE_NO] in ('" + string.Join("','", outputDetailInfos.Select(d => d.PackageModel).ToArray()) + "')", string.Empty); string sql = string.Empty; foreach (OutputDetailInfo outputDetailInfo in outputDetailInfos) { /// PackageTranDetailInfo packageTranDetailInfo = CreatePackageTranDetailInfo(loginUser); /// GetPackageTranDetailInfo(outputDetailInfo, ref packageTranDetailInfo); /// PackageApplianceInfo packageApplianceInfo = packageApplianceInfos.FirstOrDefault(d => d.PackageNo == outputDetailInfo.PackageModel); GetPackageTranDetailInfo(packageApplianceInfo, ref packageTranDetailInfo); /// sql += PackageTranDetailDAL.CreatePackageTranDetailSql(packageTranDetailInfo); } return(sql); }
/// <summary> /// 根据入库单明细获取包装器具的交易记录 /// </summary> /// <param name="receiveDetailInfos"></param> /// <param name="logUser"></param> /// <param name="orderNo"></param> /// <param name="plant"></param> /// <param name="wmNo"></param> /// <param name="assemblyLine"></param> /// <returns></returns> public static string CreatePackageTranDetailsSql(List <ReceiveDetailInfo> receiveDetailInfos, string loginUser) { List <PackageApplianceInfo> packageApplianceInfos = new PackageApplianceDAL().GetList("" + "[PACKAGE_NO] in ('" + string.Join("','", receiveDetailInfos.Select(d => d.PackageModel).ToArray()) + "')", string.Empty); string sql = string.Empty; foreach (ReceiveDetailInfo receiveDetailInfo in receiveDetailInfos) { ///创建包装交易对象 PackageTranDetailInfo packageTranDetailInfo = CreatePackageTranDetailInfo(loginUser); ///填充入库明细数据 GetPackageTranDetailInfo(receiveDetailInfo, ref packageTranDetailInfo); ///包装基础数据 PackageApplianceInfo packageApplianceInfo = packageApplianceInfos.FirstOrDefault(d => d.PackageNo == receiveDetailInfo.PackageModel); ///填充包装基础数据 GetPackageTranDetailInfo(packageApplianceInfo, ref packageTranDetailInfo); /// sql += PackageTranDetailDAL.CreatePackageTranDetailSql(packageTranDetailInfo); } return(sql); }