Commit 484b5d74 authored by 吴春's avatar 吴春

提交出库

parent 3bbdec0b
......@@ -10,7 +10,7 @@ namespace Property.Model.Entity.Mall
/// 商品出库申请实体
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
[DB(ConnectionName = "PropertyConnection")]
public class RB_WarehouseOut_Apply
{
......@@ -62,15 +62,7 @@ namespace Property.Model.Entity.Mall
set;
}
/// <summary>
/// 供应商id
/// </summary>
public int SupplierId
{
get;
set;
}
/// <summary>
/// 出库状态 0-未出库,1-部分出库,2-全部出库
......
......@@ -10,7 +10,7 @@ namespace Property.Model.Entity.Mall
/// 商品出库申请财务实体
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
[DB(ConnectionName = "PropertyConnection")]
public class RB_WarehouseOut_Finance
{
......
......@@ -9,7 +9,7 @@ namespace Property.Model.Entity.Mall
/// 商品出库实体
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
[DB(ConnectionName = "PropertyConnection")]
public class RB_WarehouseOut_Goods
{
......
using REBORN.Common.AOP;
using System;
using System.Collections.Generic;
using System.Text;
namespace Property.Model.Entity.Mall
{
/// <summary>
/// 商品出库实体
/// </summary>
[Serializable]
[DB(ConnectionName = "PropertyConnection")]
public class RB_WarehouseOut_GoodsDetail
{
/// <summary>
/// 物料id
/// </summary>
public int MaterialId { get; set; }
/// <summary>
/// 出库id
/// </summary>
public int StockOutId { get; set; }
/// <summary>
/// 仓库id
/// </summary>
public int WarehouseId { get; set; }
/// <summary>
/// 申请id
/// </summary>
public int ApplyId { get; set; }
/// <summary>
/// Id
/// </summary>
public int ID
{
get;
set;
}
/// <summary>
/// OrderId
/// </summary>
public int OrderId
{
get;
set;
}
/// <summary>
/// 商品id
/// </summary>
public int GoodsId
{
get;
set;
}
/// <summary>
/// 删除状态0-否,1-是
/// </summary>
public int Status
{
get;
set;
}
/// <summary>
/// 订单商品id
/// </summary>
public int OrderGoodsId
{
get;
set;
}
/// <summary>
/// 商品名称
/// </summary>
public string GoodsName
{
get;
set;
}
/// <summary>
/// 规格
/// </summary>
public string Specification
{
get;
set;
}
/// <summary>
/// 规格key
/// </summary>
public string SpecificationSort { get; set; }
/// <summary>
/// 货号
/// </summary>
public string ProductCode
{
get;
set;
}
/// <summary>
/// 商户号
/// </summary>
public int TenantId
{
get;
set;
}
/// <summary>
/// 小程序id
/// </summary>
public int MallBaseId
{
get;
set;
}
/// <summary>
/// 成本价
/// </summary>
public decimal? CostMoney { get; set; }
}
}
......@@ -10,7 +10,7 @@ namespace Property.Model.Extend.Mall
/// 商品出库申请实体
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
[DB(ConnectionName = "PropertyConnection")]
public class RB_WarehouseOut_Apply_Extend : RB_WarehouseOut_Apply
{
/// <summary>
......@@ -19,10 +19,21 @@ namespace Property.Model.Extend.Mall
public List<RB_WarehouseOut_Goods_Extend> WarehouseOutGoodsList { get; set; }
/// <summary>
/// 出库商品详情
/// </summary>
public List<RB_WarehouseOut_GoodsDetail> WarehouseOutGoodsDetailList { get; set; }
/// <summary>
/// 财务信息
/// </summary>
public List<RB_WarehouseOut_Finance> WarehouseOutFinanceList { get; set; }
/// <summary>
/// 财务信息
/// </summary>
public List<RB_WarehouseOut_Finance> WarehouseOutFinance { get; set; }
public RB_WarehouseOut_Finance WarehouseOutFinanceModel { get; set; }
/// <summary>
/// 已出库
......
......@@ -10,7 +10,7 @@ namespace Property.Model.Extend.Mall
/// 商品出库申请扩展实体
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
[DB(ConnectionName = "PropertyConnection")]
public class RB_WarehouseOut_Goods_Extend : RB_WarehouseOut_Goods
{
/// <summary>
......
......@@ -58,10 +58,7 @@ LEFT JOIN (SELECT ApplyId,COUNT(*) as Delivered from rb_warehouseout_goods where
{
builder.Append($" AND a.{nameof(RB_WarehouseOut_Apply_Extend.OutStatus)}={query.OutStatus}");
}
if (query.SupplierId > 0)
{
builder.Append($" AND a.{nameof(RB_WarehouseOut_Apply_Extend.SupplierId)}={query.SupplierId}");
}
}
return GetPage<RB_WarehouseOut_Apply_Extend>(pageIndex, pageSize, out rowCount, builder.ToString()).ToList();
}
......@@ -98,10 +95,7 @@ LEFT JOIN (SELECT ApplyId,COUNT(*) as Delivered from rb_warehouseout_goods where
{
builder.Append($" AND a.{nameof(RB_WarehouseOut_Apply_Extend.ApplyStatus)}={query.ApplyStatus}");
}
if (query.SupplierId > 0)
{
builder.Append($" AND a.{nameof(RB_WarehouseOut_Apply_Extend.SupplierId)}={query.SupplierId}");
}
}
return Get<RB_WarehouseOut_Apply_Extend>(builder.ToString()).ToList();
}
......
......@@ -196,11 +196,6 @@ LEFT JOIN rb_supplies_inventory as d on d.SuppliesId=c.Id where a.`Status`=0 an
builder.Append($" AND b.{nameof(RB_WarehouseOut_Goods_Extend.MallBaseId)}={query.MallBaseId}");
builder.Append($" AND c.TenantId={query.TenantId}");
}
if (query.SupplierId > 0)
{
builder.Append($" AND b.{nameof(RB_WarehouseOut_Goods_Extend.SupplierId)}={query.SupplierId}");
}
}
return Get<RB_WarehouseOut_Goods_Extend>(builder.ToString()).ToList();
}
......
......@@ -49,7 +49,8 @@ namespace Property.WebApi.Controllers.Mall
x.OutNo,
x.Delivered,
x.NotOutStock,
x.CreateByName,
x.OutStatus,
CreateByName = CacheManager.User.UserReidsCache.GetUserLoginInfo(x.CreateBy.ToString())?.emName,
CreateDateStr = x.CreateDate.Value.ToString("yyyy-MM-dd HH:mm:ss")
});
return ApiResult.Success("", pagelist);
......@@ -102,6 +103,10 @@ namespace Property.WebApi.Controllers.Mall
{
return ApiResult.Failed("申请单审核,请勿重复审核");
}
if (demodel.ApplyStatus == 3 && String.IsNullOrWhiteSpace(demodel.ExamineReason))
{
return ApiResult.Failed("拒绝必须填写理由");
}
bool result = warehouseOutModule.UpdateWarehouseOutApply(demodel);
if (result)
......@@ -121,24 +126,6 @@ namespace Property.WebApi.Controllers.Mall
#region 申请单出库
/// <summary>
/// 获取出库申请列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetOutGoods()
{
var parms = GetRequestParm();
UserInfo userInfo = CacheManager.User.UserReidsCache.GetUserLoginInfo(parms.uid);
RB_WarehouseOut_Apply_Extend demodel = JsonConvert.DeserializeObject<RB_WarehouseOut_Apply_Extend>(parms.msg.ToString());
demodel.RB_Group_Id = userInfo.RB_Group_id;
demodel.RB_Branch_Id = -1;
return ApiResult.Success("");
}
/// <summary>
/// 根据仓库id和申请id获取申请单中的商品
/// </summary>
......@@ -167,12 +154,40 @@ namespace Property.WebApi.Controllers.Mall
{
var requestParm = GetRequestParm();
UserInfo userInfo = CacheManager.User.UserReidsCache.GetUserLoginInfo(requestParm.uid);
RB_Supplies_StockOut_Extend demodel = JsonConvert.DeserializeObject<RB_Supplies_StockOut_Extend>(requestParm.msg.ToString());
if (demodel.WarehouseId <= 0)
DateTime NowStr = System.DateTime.Now;
RB_WarehouseOut_Apply_Extend applyModel = JsonConvert.DeserializeObject<RB_WarehouseOut_Apply_Extend>(requestParm.msg.ToString());
if (applyModel.WarehouseId <= 0)
{
return ApiResult.ParamIsNull("请选择仓库");
}
RB_Supplies_StockOut_Extend demodel = new RB_Supplies_StockOut_Extend();//出库申请表,等会儿组装
if (applyModel.WarehouseOutGoodsDetailList == null && !applyModel.WarehouseOutGoodsDetailList.Any())
{
return ApiResult.ParamIsNull("请选择您要出库的商品");
}
applyModel.WarehouseOutGoodsDetailList.ForEach(x => x.ApplyId = applyModel.ID);//将申请赋值给出库商品详情表
applyModel.WarehouseOutGoodsDetailList.ForEach(x => x.WarehouseId = applyModel.WarehouseId);//将申请赋值给出库商品详情表
applyModel.WarehouseOutFinanceModel = new Model.Entity.Mall.RB_WarehouseOut_Finance();//财务id ,后面更新出库id与财务id
applyModel.WarehouseOutFinanceModel.ApplyId = applyModel.ID;
applyModel.WarehouseOutFinanceModel.Status = 0;
applyModel.WarehouseOutFinanceModel.TenantId = applyModel.TenantId;
applyModel.WarehouseOutFinanceModel.MallBaseId = applyModel.MallBaseId;
applyModel.WarehouseOutFinanceModel.CreateDate = NowStr;
applyModel.WarehouseOutFinanceModel.CreateBy = userInfo.EmployeeId;
applyModel.WarehouseOutFinanceModel.RB_Branch_Id = applyModel.RB_Branch_Id;
applyModel.WarehouseOutFinanceModel.RB_Group_Id = applyModel.RB_Group_Id;
demodel.WarehouseId = applyModel.WarehouseId;
demodel.EmployeeId = applyModel.CreateBy;
demodel.CreateBy = userInfo.EmployeeId;
demodel.StockOutDate = NowStr;
if (demodel.DetailList == null || !demodel.DetailList.Any())
{
return ApiResult.ParamIsNull("请选择物料");
......
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