Commit 7222814e by guanzhenshan

增加半成品产品类型数据获取

parent 21eac031
using System;
using System.Collections.Generic;
using System.Text;
namespace Bailun.DC.Models
{
public class dc_semi_stock_log
{
/// <summary>
///
/// </summary>
public int id { get; set; }
/// <summary>
/// 流水ID
/// </summary>
public int log_id { get; set; }
/// <summary>
/// 原料sku编码
/// </summary>
public string sku_code { get; set; }
/// <summary>
/// 原料sku名称
/// </summary>
public string sku_name { get; set; }
/// <summary>
/// 流水类型ID
/// </summary>
public int log_type_id { get; set; }
/// <summary>
/// 流水类型名称
/// </summary>
public string log_type { get; set; }
/// <summary>
/// 流水数量
/// </summary>
public int log_quantity { get; set; }
/// <summary>
/// 当前库存
/// </summary>
public decimal final_stock { get; set; }
/// <summary>
/// 仓库ID
/// </summary>
public int warehouse_id { get; set; }
/// <summary>
/// 仓库名称
/// </summary>
public string warehouse_name { get; set; }
/// <summary>
/// 半成品仓流水创建日期
/// </summary>
public DateTime create_time { get; set; }
/// <summary>
/// 冗余库存
/// </summary>
public decimal? redundancy_stock { get; set; }
/// <summary>
/// 仓库类型:1-jit仓,2-计划仓
/// </summary>
public int warehouse_type { get; set; }
/// <summary>
/// 取数时间
/// </summary>
public DateTime update_time { get; set; }
/// <summary>
/// 产品大类id
/// </summary>
public int product_category_id { get; set; }
/// <summary>
/// 产品大类
/// </summary>
public string product_category_name { get; set; }
/// <summary>
/// 产品小类id
/// </summary>
public int type_id { get; set; }
/// <summary>
/// 产品小类
/// </summary>
public string type_name { get; set; }
}
}
...@@ -334,6 +334,26 @@ join dc_base_sku t2 on t1.bailuncategoryid = t2.bailun_category_id and t2.bailun ...@@ -334,6 +334,26 @@ join dc_base_sku t2 on t1.bailuncategoryid = t2.bailun_category_id and t2.bailun
} }
} }
/// <summary>
/// 获取财务分类列表
/// </summary>
/// <returns></returns>
public List<dc_semi_stock_log> ListSemiSkuCategory()
{
var sql = $@"select product_category_id,product_category_name from dc_semi_stock_log where product_category_name!='缺失' group by product_category_name";
using (var cn = new MySqlConnection(Common.GlobalConfig.ConnectionString_read))
{
if (cn.State == System.Data.ConnectionState.Closed)
{
cn.Open();
}
return cn.Query<dc_semi_stock_log>(sql).ToList();
}
}
/// <summary> /// <summary>
/// 获取SKU的所有品牌列表 /// 获取SKU的所有品牌列表
......
...@@ -58,6 +58,21 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers ...@@ -58,6 +58,21 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
} }
/// <summary> /// <summary>
/// 获取半成品产品大类
/// </summary>
/// <returns></returns>
[HttpPost]
public JsonResult ListSemiSkuCategory()
{
var list = new Services.SkuInfoServices().ListSemiSkuCategory();
return Json(list.Select(a=>new {
a.product_category_id,
a.product_category_name
}));
}
/// <summary>
/// 逻辑仓库 库存列表 /// 逻辑仓库 库存列表
/// </summary> /// </summary>
/// <param name="parameter">分页信息</param> /// <param name="parameter">分页信息</param>
......
...@@ -235,8 +235,8 @@ ...@@ -235,8 +235,8 @@
$('#category').html('<option value="">产品类型</option>'); $('#category').html('<option value="">产品类型</option>');
@*$.submit({ $.submit({
url: '@Url.Content("~/Reports/Warehouse/ListFinanceCategory")', url: '@Url.Content("~/Reports/Warehouse/ListSemiSkuCategory")',
paramData: '', paramData: '',
type: 'POST', type: 'POST',
func: function (result) { func: function (result) {
...@@ -245,16 +245,16 @@ ...@@ -245,16 +245,16 @@
$('#category').html('<option value="">产品类型</option>'); $('#category').html('<option value="">产品类型</option>');
for (var i in semiCategory) { for (var i in semiCategory) {
$('#category').append('<option value="' + semiCategory[i].financecategoryid + '">' + semiCategory[i].financecategoryname + '</option>'); $('#category').append('<option value="' + semiCategory[i].product_category_name + '">' + semiCategory[i].product_category_name + '</option>');
} }
} }
} }
})*@ })
} }
else { else {
$('#category').html('<option value="">产品类型</option>'); $('#category').html('<option value="">产品类型</option>');
for (var i in semiCategory) { for (var i in semiCategory) {
$('#category').append('<option value="' + semiCategory[i].financecategoryname + '">' + semiCategory[i].financecategoryname + '</option>'); $('#category').append('<option value="' + semiCategory[i].product_category_name + '">' + semiCategory[i].product_category_name + '</option>');
} }
} }
} }
......
...@@ -412,8 +412,8 @@ ...@@ -412,8 +412,8 @@
$('#category').html('<option value="">产品类型</option>'); $('#category').html('<option value="">产品类型</option>');
@*$.submit({ $.submit({
url: '@Url.Content("~/Reports/Warehouse/ListFinanceCategory")', url: '@Url.Content("~/Reports/Warehouse/ListSemiSkuCategory")',
paramData: '', paramData: '',
type: 'POST', type: 'POST',
func: function (result) { func: function (result) {
...@@ -422,16 +422,16 @@ ...@@ -422,16 +422,16 @@
$('#category').html('<option value="">产品类型</option>'); $('#category').html('<option value="">产品类型</option>');
for (var i in semiCategory) { for (var i in semiCategory) {
$('#category').append('<option value="' + semiCategory[i].financecategoryid + '">' + semiCategory[i].financecategoryname + '</option>'); $('#category').append('<option value="' + semiCategory[i].product_category_name + '">' + semiCategory[i].product_category_name + '</option>');
} }
} }
} }
})*@ })
} }
else { else {
$('#category').html('<option value="">产品类型</option>'); $('#category').html('<option value="">产品类型</option>');
for (var i in semiCategory) { for (var i in semiCategory) {
$('#category').append('<option value="' + semiCategory[i].financecategoryname + '">' + semiCategory[i].financecategoryname + '</option>'); $('#category').append('<option value="' + semiCategory[i].product_category_name + '">' + semiCategory[i].product_category_name + '</option>');
} }
} }
} }
......
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