Commit a81f35e7 by 泽锋 李

新增是否优先分配库容的功能

parent f9cf02eb
......@@ -2227,5 +2227,16 @@ where 1=1 ";
}).Where(s => s.title != null && (!s.title.Contains("刷新"))).OrderByDescending(s => s.create_time).ToList();
}
/// <summary>
/// 修改库容是否需要优先
/// </summary>
public static void UpdatePriorityStorageCapacity(SetPriorityStorageCapacityInputDto data)
{
_connection.Execute(" update dc_auto_purchase_advise_detailed set is_priority_storage_capacity=@is_priority_storage_capacity where id=@id ",new {
is_priority_storage_capacity = data.status,
id = data.id
});
}
}
}
......@@ -61,6 +61,10 @@ namespace AutoTurnOver.Models.ApiDto
///SKU
///</summary>
public string bd_sku { get; set; }
/// <summary>
/// 是否优先分配库容
/// </summary>
public int is_priority_storage_capacity { get; set; }
public int sys_source { get; set; }
......
......@@ -17,4 +17,14 @@ namespace AutoTurnOver.Models
{
public List<BatchSetQuantityActualInputDto> datas { get; set; }
}
/// <summary>
/// 设置是否优先匹配库存
/// </summary>
public class SetPriorityStorageCapacityInputDto
{
public int id { get; set; }
public int status { get; set; }
}
}
......@@ -49,6 +49,10 @@ namespace AutoTurnOver.Models
{
public int id { get; set; }
/// <summary>
/// 是否需要优先匹配库容
/// </summary>
public int? is_priority_storage_capacity { get; set; }
/// <summary>
/// sku
......
......@@ -237,6 +237,15 @@ namespace AutoTurnOver.Services
{
purchase_advise.BatchSetQuantityActual(datas);
}
/// <summary>
/// 批量设置采购数量
/// </summary>
/// <param name="id"></param>
public static void UpdatePriorityStorageCapacity(SetPriorityStorageCapacityInputDto data)
{
purchase_advise.UpdatePriorityStorageCapacity(data);
}
/// <summary>
......@@ -413,6 +422,8 @@ namespace AutoTurnOver.Services
bd_price = s.Max(g=>g.unit_price),
bd_sku = s.Key,
sys_source = s.Any(g => g.type == 2) ? 2 : s.Any(g => g.type == 1) ? 1 : 3,
is_priority_storage_capacity = s.Max(v=>v.is_priority_storage_capacity??0)
}).ToList();
if(datas==null || datas.Count <= 0)
{
......
......@@ -172,6 +172,33 @@ namespace AutoTurnOver.Controllers
});
}
}
/// <summary>
/// 批量设置采购数量
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpPost]
[BrowseLog("Bailun_aims", "触发【百伦自动周转系统】->【自动下单管理】->【采购建议列表】->【设置是否需要优先】操作", 1)]
public JsonResult UpdatePriorityStorageCapacity([FromBody] SetPriorityStorageCapacityInputDto data)
{
try
{
PurchaseAdviseServices.UpdatePriorityStorageCapacity(data);
return new JsonResult(new
{
success = true
});
}
catch (Exception ex)
{
return new JsonResult(new
{
success = false,
message = ex.Message
});
}
}
/// <summary>
/// 推送采购计划
......
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