Commit af745662 authored by liudong1993's avatar liudong1993

入库增加财务单据

parent ba692afa
......@@ -44,5 +44,9 @@ namespace Property.Model.Extend
/// 账户类型
/// </summary>
public int IsPublic { get; set; }
/// <summary>
/// 采购单ids
/// </summary>
public string ProcurementIds { get; set; }
}
}
\ No newline at end of file
......@@ -56,5 +56,9 @@ namespace Property.Model.Extend
/// 类型 1入库 2出库
/// </summary>
public int? Type { get; set; }
/// <summary>
/// 财务单据id
/// </summary>
public int? FinanceId { get; set; }
}
}
\ No newline at end of file
......@@ -61,5 +61,45 @@ GROUP BY p.Id order by p.Id desc";
return GetPage<RB_Procurement_Extend>(pageIndex, pageSize, out count, sql).ToList();
}
/// <summary>
/// 获取列表
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public List<RB_Procurement_Extend> GetList(RB_Procurement_Extend dmodel)
{
string where = " where 1=1 ";
where += string.Format(" AND p.{0}={1}", nameof(RB_Procurement_Extend.Status), 0);
where += $@" and p.RB_Group_Id={dmodel.RB_Group_Id}";
if (dmodel.TenantId > 0)
{
where += " and p." + nameof(RB_Procurement_Extend.TenantId) + "=" + dmodel.TenantId;
}
if (dmodel.MallBaseId > 0)
{
where += " and p." + nameof(RB_Procurement_Extend.MallBaseId) + "=" + dmodel.MallBaseId;
}
if (!string.IsNullOrEmpty(dmodel.StartTime))
{
where += " and p.CreateTime >='" + dmodel.StartTime + "'";
}
if (!string.IsNullOrEmpty(dmodel.EndTime))
{
where += " and p.CreateTime <='" + dmodel.EndTime + " 23:59:59'";
}
if (dmodel.StockInStatus > 0)
{
where += " and p." + nameof(RB_Procurement_Extend.StockInStatus) + "=" + dmodel.StockInStatus;
}
if (!string.IsNullOrEmpty(dmodel.ProcurementIds))
{
where += " and p." + nameof(RB_Procurement_Extend.Id) + " in(" + dmodel.ProcurementIds + ")";
}
string sql = $@" SELECT p.* FROM rb_procurement p {where} order by p.Id desc";
return Get<RB_Procurement_Extend>(sql).ToList();
}
}
}
......@@ -53,11 +53,15 @@ namespace Property.Repository
if (dmodel.WarehouseId > 0) {
where += " and ss." + nameof(RB_Supplies_StockIn_Extend.WarehouseId) + "=" + dmodel.WarehouseId;
}
if (dmodel.FinanceId > 0) {
where += " and p.FinanceId =" + dmodel.FinanceId;
}
string sql = $@" select distinct ss.*,sw.Name as WareHouseName from RB_Supplies_StockIn ss
string sql = $@" select distinct ss.*,sw.Name as WareHouseName,p.FinanceId from RB_Supplies_StockIn ss
left join rb_supplies_warehouse sw on ss.WarehouseId=sw.Id
left join rb_supplies_stockindetail ssd on ss.Id=ssd.StockInId
left join rb_supplies_material sm on ssd.SuppliesId=sm.Id
left join RB_Procurement p on ss.ProcurementId=p.Id
{where} order by ss.Id desc";
return GetPage<RB_Supplies_StockIn_Extend>(pageIndex, pageSize, out count, sql).ToList();
}
......
......@@ -313,6 +313,7 @@ namespace Property.WebApi.Controllers.User
x.Remark,
x.Money,
x.SupplierName,
x.FinanceId,
DetailList = x.DetailList.Select(z => new
{
z.Id,
......
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