|
|
@ -7,7 +7,6 @@ using NetLibrary.Log;
|
|
|
|
using System.IO;
|
|
|
|
using System.IO;
|
|
|
|
using TradeModel;
|
|
|
|
using TradeModel;
|
|
|
|
using NetLibrary;
|
|
|
|
using NetLibrary;
|
|
|
|
using Org.BouncyCastle.Utilities.Encoders;
|
|
|
|
|
|
|
|
using System.Drawing;
|
|
|
|
using System.Drawing;
|
|
|
|
using LinqToDB;
|
|
|
|
using LinqToDB;
|
|
|
|
using TradeManageNew.Models.Shage;
|
|
|
|
using TradeManageNew.Models.Shage;
|
|
|
@ -1371,291 +1370,146 @@ namespace TradeManageNew.OuterService
|
|
|
|
md.Data = null;
|
|
|
|
md.Data = null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (Method == "OrderUsedSaleEntry")
|
|
|
|
if (Method == "GetOrderUsedSalePlatform")
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var input = JsonConvert.DeserializeObject<OrderUsedSaleEntryInput>(ResponseContent);
|
|
|
|
var input = JsonConvert.DeserializeObject<GetOrderUsedSalePlatformInput>(ResponseContent);
|
|
|
|
var validatedSuccess = true;
|
|
|
|
|
|
|
|
if (string.IsNullOrWhiteSpace(input.OrderCode))
|
|
|
|
if (string.IsNullOrWhiteSpace(input.SkuCode))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
md.Code = "400";
|
|
|
|
md.Code = "400";
|
|
|
|
md.Result = "Please enter order code";
|
|
|
|
md.Result = "Please enter sku code";
|
|
|
|
md.Data = null;
|
|
|
|
md.Data = null;
|
|
|
|
validatedSuccess = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (string.IsNullOrWhiteSpace(input.GoodsCode))
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
input.SkuCode = input.SkuCode.Trim();
|
|
|
|
|
|
|
|
using (var db = new ErpDbContext())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var sku = db.HW_GoodsDetail.FirstOrDefault(x => x.SKU1 == input.SkuCode ||
|
|
|
|
|
|
|
|
x.SKU2 == input.SkuCode ||
|
|
|
|
|
|
|
|
x.SKU3 == input.SkuCode ||
|
|
|
|
|
|
|
|
x.SKU4 == input.SkuCode ||
|
|
|
|
|
|
|
|
x.SKU5 == input.SkuCode);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (sku is null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
throw new Exception($"There is no SKU encoded as {input.SkuCode}");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var product = db.HW_GoodsInfo.FirstOrDefault(x => x.GoodsId == sku.GoodsId);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var result = new GetOrderUsedSalePlatformDto
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
ProductCode = product?.GoodsCode,
|
|
|
|
|
|
|
|
ProductDescription = product?.GoodsEnglisgName,
|
|
|
|
|
|
|
|
SkuId = sku.DetailId,
|
|
|
|
|
|
|
|
SkuCode = sku.SKU1
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
md.Code = "100";
|
|
|
|
|
|
|
|
md.Result = "Success";
|
|
|
|
|
|
|
|
md.Data = JsonConvert.SerializeObject(result);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (Method == "PostOrderUsedSalePlatform")
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var input = JsonConvert.DeserializeObject<OrderUsedSalePlatformInput>(ResponseContent);
|
|
|
|
|
|
|
|
var validatedSuccess = true;
|
|
|
|
|
|
|
|
if (input.SkuId<=0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
md.Code = "400";
|
|
|
|
md.Code = "400";
|
|
|
|
md.Result = "Please enter sku code";
|
|
|
|
md.Result = "Please enter sku code";
|
|
|
|
md.Data = null;
|
|
|
|
md.Data = null;
|
|
|
|
validatedSuccess = false;
|
|
|
|
validatedSuccess = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
input.GoodsCode = input.GoodsCode.Trim();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (string.IsNullOrWhiteSpace(input.TrackingCode))
|
|
|
|
if (string.IsNullOrWhiteSpace(input.WarehousePositionCode))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
md.Code = "400";
|
|
|
|
md.Code = "400";
|
|
|
|
md.Result = "Please enter tracking code";
|
|
|
|
md.Result = "Please enter the storage location";
|
|
|
|
md.Data = null;
|
|
|
|
md.Data = null;
|
|
|
|
validatedSuccess = false;
|
|
|
|
validatedSuccess = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
if (input.ImageUrls is null || !input.ImageUrls.Any())
|
|
|
|
input.TrackingCode = input.TrackingCode.Trim();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (input.Quantity<=0)
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
md.Code = "400";
|
|
|
|
md.Code = "400";
|
|
|
|
md.Result = "The quantity must be greater than 0";
|
|
|
|
md.Result = "Please upload photos";
|
|
|
|
md.Data = null;
|
|
|
|
md.Data = null;
|
|
|
|
validatedSuccess = false;
|
|
|
|
validatedSuccess = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (validatedSuccess)
|
|
|
|
if (validatedSuccess)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
using (var db = new ErpDbContext())
|
|
|
|
using (var db = new ErpDbContext())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//订单信息
|
|
|
|
var user = db.JC_UserInfo.FirstOrDefault(x => x.UserId == input.UserId);
|
|
|
|
var order = db.DT_OrderInfo.FirstOrDefault(x =>
|
|
|
|
|
|
|
|
x.PlatOrderCode == input.OrderCode || x.OrderCode == input.OrderCode);
|
|
|
|
if (user is null || (user.WorkDesc != "西仓" && user.WorkDesc != "东仓"))
|
|
|
|
if (order is null)
|
|
|
|
{
|
|
|
|
|
|
|
|
throw new Exception("Non warehouse staff");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var warehouseLocation = WarehouseLocation.East;
|
|
|
|
|
|
|
|
if (user.WorkDesc == "西仓")
|
|
|
|
{
|
|
|
|
{
|
|
|
|
throw new Exception($"There is no order with order number {input.OrderCode}");
|
|
|
|
warehouseLocation = WarehouseLocation.West;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//订单明细信息
|
|
|
|
var storePosition = db.CK_StorePostion.FirstOrDefault(x =>
|
|
|
|
var orderItem = db.DT_OrderGoods
|
|
|
|
x.PostionCode == input.WarehousePositionCode.Trim());
|
|
|
|
.FirstOrDefault(x => x.OrderId == order.OrderId && x.GoodsSKU == input.GoodsCode);
|
|
|
|
if (storePosition is null)
|
|
|
|
if (orderItem is null)
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
throw new Exception(
|
|
|
|
throw new Exception(
|
|
|
|
$"There is no SKU with code {input.GoodsCode} in order [{input.OrderCode}]");
|
|
|
|
$"There is no storage location encoded as {input.WarehousePositionCode}");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//SKU信息
|
|
|
|
var sku = db.HW_GoodsDetail.FirstOrDefault(x => x.DetailId == input.SkuId);
|
|
|
|
var sku = db.HW_GoodsDetail.FirstOrDefault(x => x.DetailId == orderItem.DetailId);
|
|
|
|
|
|
|
|
if (sku is null)
|
|
|
|
if (sku is null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
throw new Exception(
|
|
|
|
throw new Exception($"There is no SKU with ID {input.SkuId}");
|
|
|
|
$"There is no product information with ID {orderItem.DetailId}");
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//检查是否存在相同跟踪号不同订单号的订单
|
|
|
|
var product = db.HW_GoodsInfo.FirstOrDefault(x => x.GoodsId == sku.GoodsId);
|
|
|
|
var repeatTrackingCodeOrderIds = db.DT_OrderUsedSaleEntry
|
|
|
|
|
|
|
|
.Where(x => x.TrackingCode == input.TrackingCode)
|
|
|
|
if (product is null)
|
|
|
|
.Select(x => x.OrderId)
|
|
|
|
|
|
|
|
.Distinct();
|
|
|
|
|
|
|
|
if (repeatTrackingCodeOrderIds.Any() && !repeatTrackingCodeOrderIds.Contains(order.OrderId))
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
throw new Exception(
|
|
|
|
throw new Exception($"There is no product with ID {sku.GoodsId}");
|
|
|
|
$"The tracking number has already been linked to an order");
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
var newOrderUsedSalePlatform =
|
|
|
|
var newOrderUsedSaleEntry =
|
|
|
|
new TradeUsedSale.Repositories.Models.DT_OrderUsedSalePlatform
|
|
|
|
new TradeUsedSale.Repositories.Models.DT_OrderUsedSaleEntry
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
OrderId = order.OrderId,
|
|
|
|
ProductId = product.GoodsId,
|
|
|
|
OrderCode = order.OrderCode,
|
|
|
|
ProductCode = product.GoodsCode,
|
|
|
|
GoodsId = sku.DetailId,
|
|
|
|
SkuId = sku.DetailId,
|
|
|
|
GoodsCode = sku.SKU1,
|
|
|
|
SkuCode = sku.SKU1,
|
|
|
|
Quantity = input.Quantity,
|
|
|
|
BarCode =string.Empty,
|
|
|
|
TrackingCode = input.TrackingCode,
|
|
|
|
IsPrinted = false,
|
|
|
|
WarehouseLocation = input.WarehouseLocation,
|
|
|
|
Status = UsedSalePlatformStatus.NotListed,
|
|
|
|
|
|
|
|
WarehouseLocation = warehouseLocation,
|
|
|
|
|
|
|
|
WarehousePositionId = storePosition.PostionId,
|
|
|
|
|
|
|
|
WarehousePositionCode = storePosition.PostionCode,
|
|
|
|
|
|
|
|
ImageUrls = JsonConvert.SerializeObject(input.ImageUrls),
|
|
|
|
CreationTime = DateTime.Now,
|
|
|
|
CreationTime = DateTime.Now,
|
|
|
|
CreatorId = input.UserId
|
|
|
|
CreatorId = input.UserId,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
db.InsertWithInt32Identity(newOrderUsedSaleEntry);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
md.Code = "100";
|
|
|
|
|
|
|
|
md.Result = "Success";
|
|
|
|
|
|
|
|
md.Data = "";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (Method == "GetOrderUsedSale")
|
|
|
|
var newOrderUsedSalePlatformId = db.InsertWithInt32Identity(newOrderUsedSalePlatform);
|
|
|
|
{
|
|
|
|
var barCode =
|
|
|
|
var input = JsonConvert.DeserializeObject<GetOrderUsedSale>(ResponseContent);
|
|
|
|
$"{(warehouseLocation == WarehouseLocation.East ? "E" : "W")}{newOrderUsedSalePlatformId.ToString().PadLeft(7, '0')}";
|
|
|
|
if (string.IsNullOrWhiteSpace(input.TrackingCode))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
md.Code = "400";
|
|
|
|
|
|
|
|
md.Result = "Please enter tracking code";
|
|
|
|
|
|
|
|
md.Data = null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
input.TrackingCode = input.TrackingCode.Trim();
|
|
|
|
|
|
|
|
using (var db = new ErpDbContext())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var orderUsedSaleEntryList = db.DT_OrderUsedSaleEntry
|
|
|
|
|
|
|
|
.Where(x => x.TrackingCode == input.TrackingCode)
|
|
|
|
|
|
|
|
.ToList();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var groupOrderUsedSaleEntry = orderUsedSaleEntryList.GroupBy(x => x.GoodsId)
|
|
|
|
db.DT_OrderUsedSalePlatform.Where(x => x.Id == newOrderUsedSalePlatformId)
|
|
|
|
.Select(o => new
|
|
|
|
.Set(x => x.BarCode, barCode)
|
|
|
|
{
|
|
|
|
.Update();
|
|
|
|
o.Key,
|
|
|
|
|
|
|
|
Quantity = o.Sum(x => x.Quantity)
|
|
|
|
md.Code = "100";
|
|
|
|
}).ToList();
|
|
|
|
md.Result = "Success";
|
|
|
|
|
|
|
|
md.Data = JsonConvert.SerializeObject(newOrderUsedSalePlatform);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// if (Method == "ReturnUsedSale")
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// var input = JsonConvert.DeserializeObject<Sync_ReturnGoodsSave>(ResponseContent);
|
|
|
|
|
|
|
|
// var validatedSuccess = true;
|
|
|
|
|
|
|
|
// if (string.IsNullOrEmpty(input.StoreCode))
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// md.Code = "400";
|
|
|
|
|
|
|
|
// md.Result = "Please enter storage Location";
|
|
|
|
|
|
|
|
// md.Data = null;
|
|
|
|
|
|
|
|
// validatedSuccess = false;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// if (string.IsNullOrEmpty(input.TrackCode))
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// md.Code = "400";
|
|
|
|
|
|
|
|
// md.Result = "Please enter tracking code";
|
|
|
|
|
|
|
|
// md.Data = null;
|
|
|
|
|
|
|
|
// validatedSuccess = false;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// if (string.IsNullOrEmpty(input.OrderCode))
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// md.Code = "400";
|
|
|
|
|
|
|
|
// md.Result = "Please enter order no";
|
|
|
|
|
|
|
|
// md.Data = null;
|
|
|
|
|
|
|
|
// validatedSuccess = false;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// if (input.GoodsList==null || !input.GoodsList.Any())
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// md.Code = "400";
|
|
|
|
|
|
|
|
// md.Result = "Please enter goods information";
|
|
|
|
|
|
|
|
// md.Data = null;
|
|
|
|
|
|
|
|
// validatedSuccess = false;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// if (validatedSuccess)
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// var detailIds = input.GoodsList.Select(x => x.GoodsId).ToList();
|
|
|
|
|
|
|
|
// using (var db = new ErpDbContext())
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// var orderReturns = db.DT_OrderReturn.Where(x =>
|
|
|
|
|
|
|
|
// x.tracking_id == input.TrackCode &&
|
|
|
|
|
|
|
|
// x.ordercode==input.OrderCode &&
|
|
|
|
|
|
|
|
// (string.IsNullOrEmpty(x.InType) || x.InType == "6") &&
|
|
|
|
|
|
|
|
// (string.IsNullOrEmpty(x.ScanState) || x.ScanState == "1") &&
|
|
|
|
|
|
|
|
// x.detailid != null && detailIds.Contains(x.detailid.Value))
|
|
|
|
|
|
|
|
// .ToList();
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// var orderReturnIds = orderReturns.Select(x => x.id).ToList();
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// if (!orderReturnIds.Any())
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// throw new Exception("Return order information not obtained");
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// //二手平台上架信息
|
|
|
|
|
|
|
|
// var orderReturnUsedSales = db.DT_OrderReturnUsedSale
|
|
|
|
|
|
|
|
// .Where(x => orderReturnIds.Contains(x.OrderReturnId))
|
|
|
|
|
|
|
|
// .ToList();
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// foreach (var inputItem in input.GoodsList)
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// var returnItem = orderReturns.FirstOrDefault(x => x.detailid == inputItem.GoodsId);
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// if (returnItem is null)
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// throw new Exception(
|
|
|
|
|
|
|
|
// $"Return order information not obtained. tracking id {input.TrackCode},order no {input.OrderCode},sku {inputItem.GoodsId}");
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// //已上架二手平台的数量
|
|
|
|
|
|
|
|
// var usedSalesQuantity = orderReturnUsedSales
|
|
|
|
|
|
|
|
// .Where(x => x.OrderReturnId == returnItem.id)
|
|
|
|
|
|
|
|
// .Sum(x => x.Quantity);
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// //剩余可以上架二手平台的数量
|
|
|
|
|
|
|
|
// var remainingQuantity = returnItem.return_quantity - usedSalesQuantity;
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// if (inputItem.GoodsNum > remainingQuantity)
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// throw new Exception(
|
|
|
|
|
|
|
|
// $"sku {returnItem.merchant_sku} submitted quantity {inputItem.GoodsNum} exceeds the remaining submittable quantity {remainingQuantity}");
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// db.BeginTransaction();
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// try
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// #region 插入二手商品信息
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// foreach (var inputItem in input.GoodsList)
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// var returnItem = orderReturns.First(x => x.detailid == inputItem.GoodsId);
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// //更新退货订单表数据
|
|
|
|
|
|
|
|
// db.DT_OrderReturn.Where(x => x.id == returnItem.id)
|
|
|
|
|
|
|
|
// .Set(x => x.InType, "6")
|
|
|
|
|
|
|
|
// .Set(x => x.ScanState, "1")
|
|
|
|
|
|
|
|
// .Set(x => x.ScanDate, DateTime.Now)
|
|
|
|
|
|
|
|
// .Set(x => x.ScanUserId, input.UserId)
|
|
|
|
|
|
|
|
// .Set(x => x.PostionCode, input.StoreCode)
|
|
|
|
|
|
|
|
// .Set(x => x.ImgUrl, input.Photo1)
|
|
|
|
|
|
|
|
// .Set(x => x.ImgUrl2, input.Photo2)
|
|
|
|
|
|
|
|
// .Set(x => x.ImgUrl3, input.Photo3)
|
|
|
|
|
|
|
|
// .Set(x => x.ImgUrl4, input.Photo4)
|
|
|
|
|
|
|
|
// .Set(x => x.ImgUrl5, input.Photo5)
|
|
|
|
|
|
|
|
// .Update();
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// var newOrderReturnUsedSale =
|
|
|
|
|
|
|
|
// new TradeUsedSale.Repositories.Models.DT_OrderReturnUsedSale
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// OrderReturnId = returnItem.id,
|
|
|
|
|
|
|
|
// OrderId = returnItem.orderid,
|
|
|
|
|
|
|
|
// OrderCode = returnItem.ordercode,
|
|
|
|
|
|
|
|
// GoodsId = returnItem.detailid.Value,
|
|
|
|
|
|
|
|
// MerchantSku = returnItem.merchant_sku,
|
|
|
|
|
|
|
|
// Quantity = inputItem.GoodsNum,
|
|
|
|
|
|
|
|
// CreationTime = DateTime.Now,
|
|
|
|
|
|
|
|
// CreatorId = input.UserId
|
|
|
|
|
|
|
|
// };
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// var newOrderReturnUsedSaleId =
|
|
|
|
|
|
|
|
// db.InsertWithInt32Identity(newOrderReturnUsedSale);
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// for (var i = 1; i <= inputItem.GoodsNum; i++)
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// var newOrderReturnUsedSaleItem =
|
|
|
|
|
|
|
|
// new TradeUsedSale.Repositories.Models.DT_OrderReturnUsedSaleItem
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// OrderReturnUsedSaleId = newOrderReturnUsedSaleId,
|
|
|
|
|
|
|
|
// IsPublished = false,
|
|
|
|
|
|
|
|
// CreationTime = DateTime.Now,
|
|
|
|
|
|
|
|
// CreatorId = input.UserId,
|
|
|
|
|
|
|
|
// };
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// db.InsertWithInt32Identity(newOrderReturnUsedSaleItem);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// #endregion
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// db.CommitTransaction();
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// catch (Exception ex)
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// db.RollbackTransaction();
|
|
|
|
|
|
|
|
// throw;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (Exception ex)
|
|
|
|
catch (Exception ex)
|
|
|
|