Commit 4849b387 authored by 吴春's avatar 吴春

提交

parent 8fc11fff
......@@ -8767,6 +8767,63 @@ namespace Mall.Module.Product
return flag;
}
/// <summary>
/// 修改商品订单成本价
/// </summary>
/// <param name="orderId"></param>
/// <param name="income"></param>
/// <param name="freightMoney"></param>
/// <param name="tenantId"></param>
/// <param name="mallBaseId"></param>
/// <returns></returns>
public bool SetOrderSupplierId(int orderId, int SupplierId, int tenantId, int mallBaseId)
{
var orderModel = goods_OrderDetailRepository.GetEntity(orderId);
if (orderModel == null)
{
return false;
}
Dictionary<string, object> keyValues1 = new Dictionary<string, object>() {
{ nameof(RB_Goods_OrderDetail.SupplierId),SupplierId }
};
List<WhereHelper> wheres1 = new List<WhereHelper>() {
new WhereHelper(){
FiledName=nameof(RB_Goods_OrderDetail.Id),
FiledValue=orderModel.Id,
OperatorEnum=OperatorEnum.Equal
},
new WhereHelper(){
FiledName=nameof(RB_Goods_OrderDetail.TenantId),
FiledValue=tenantId,
OperatorEnum=OperatorEnum.Equal
},
new WhereHelper(){
FiledName=nameof(RB_Goods_OrderDetail.MallBaseId),
FiledValue=mallBaseId,
OperatorEnum=OperatorEnum.Equal
}
};
var flag = goods_OrderDetailRepository.Update(keyValues1, wheres1);
if (flag)
{
//记录日志
Task.Run(() => goods_LogRepository.Insert(new RB_Goods_Log()
{
Content = "修改订单商品:" + orderModel.GoodsName + "供应商ID:" + SupplierId + ";供应商历史ID:" + orderModel.SupplierId.ToString(),
CreateDate = DateTime.Now,
Id = 0,
MallBaseId = mallBaseId,
SourceId = orderModel.OrderId,
TenantId = tenantId,
Type = 1
}));
}
return flag;
}
/// <summary>
/// 根据订单好获取物流id
/// </summary>
......
......@@ -288,6 +288,8 @@ namespace Mall.Module.User
CanRemitMoney,
basicsModel.MaxWithdrawal,
basicsModel.WithdrawalFree,
basicsModel.IsAllCommission,
basicsModel.MinWithdrawal,
IsWithdrawAll = 1,
WithdrawWayList = WayList.Select(x => new
{
......
......@@ -79,6 +79,7 @@ namespace Mall.WebApi.Controllers.MallBase
PaymentWayName = x.PaymentWay.GetEnumName(),
DetailList = x.DetailList.Select(y => new
{
y.SupplierId,
y.SupplierName,
y.FreightCostMoney,
y.FreightMoney,
......@@ -944,7 +945,7 @@ namespace Mall.WebApi.Controllers.MallBase
#region 修改运费成本以及商品成本
#region 修改运费成本以及商品成本、供应商
/// <summary>
/// 修改订单商品成本运费
/// </summary>
......@@ -1007,7 +1008,35 @@ namespace Mall.WebApi.Controllers.MallBase
}
}
/// <summary>
/// 修改订单供应商
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetOrderSupplierId()
{
var req = RequestParm;
JObject parms = JObject.Parse(req.msg.ToString());
int OrderId = parms.GetInt("Id", 0);
int SupplierId = parms.GetInt("SupplierId", 0);
if (OrderId <= 0)
{
return ApiResult.ParamIsNull("请传递订单明细id");
}
if (SupplierId < 0)
{
return ApiResult.ParamIsNull("请传递供应商信息");
}
bool flag = orderModule.SetOrderSupplierId(OrderId, SupplierId, req.TenantId, req.MallBaseId);
if (flag)
{
return ApiResult.Success();
}
else
{
return ApiResult.Failed();
}
}
#endregion
#endregion
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment