Commit 21de4655 authored by 吴春's avatar 吴春

提交

parent 06e0b0cc
......@@ -397,6 +397,17 @@ namespace Mall.Common
}
}
/// <summary>
/// 生成付款成本财务单据
/// </summary>
public static string PaymentFinanceApi
{
get
{
return new ConfigurationBuilder().Add(new JsonConfigurationSource { Path = "appsettings.json" }).Build().GetSection("PaymentFinanceApi").Value;
}
}
}
}
\ No newline at end of file
......@@ -295,5 +295,7 @@ namespace Mall.Model.Entity.Product
/// 拒绝取消订单得备注
/// </summary>
public string RejectRemark { get; set; }
}
}
......@@ -198,5 +198,11 @@ namespace Mall.Model.Entity.Product
/// 供应商id
/// </summary>
public int SupplierId { get; set; }
/// <summary>
/// 成本单据ID
/// </summary>
public int CostFinanceId { get; set; }
}
}
......@@ -110,5 +110,17 @@ namespace Mall.Model.Extend.Product
/// </summary>
public int FinanceType { get; set; }
#endregion
#region 供应商商品信息
public string StartTime { get; set; }
public string EndTime { get; set; }
/// <summary>
/// 是否制单
/// </summary>
public int IsFinance { get; set; }
#endregion
}
}
......@@ -6509,5 +6509,21 @@ namespace Mall.Module.Product
return OrderId > 0;
}
#endregion
#region 供应商订单商品信息
/// <summary>
/// 获取订单商品分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="count"></param>
/// <param name="dmodel"></param>
/// <returns></returns>
public List<RB_Goods_OrderDetail_Extend> GetSupplierOrderPageList(int pageIndex, int pageSize, out long count, RB_Goods_OrderDetail_Extend dmodel)
{
return goods_OrderDetailRepository.GetSupplierOrderPageList(pageIndex, pageSize, out count, dmodel);
}
#endregion
}
}
......@@ -33,7 +33,7 @@ namespace Mall.Repository.Product
{
where += $@" and {nameof(RB_Goods_OrderDetail.MallBaseId)}={dmodel.MallBaseId}";
}
if (!string.IsNullOrEmpty(dmodel.OrderDetailIds))
if (!string.IsNullOrEmpty(dmodel.OrderDetailIds))
{
where += $@" and {nameof(RB_Goods_OrderDetail.Id)} in({dmodel.OrderDetailIds})";
}
......@@ -45,7 +45,8 @@ namespace Mall.Repository.Product
{
where += $@" and {nameof(RB_Goods_OrderDetail.OrderType)}={(int)dmodel.OrderType}";
}
if (dmodel.IsComment > 0) {
if (dmodel.IsComment > 0)
{
where += $@" and {nameof(RB_Goods_OrderDetail.IsComment)}={(int)dmodel.IsComment}";
}
if (!string.IsNullOrEmpty(dmodel.GoodsName))
......@@ -56,7 +57,7 @@ namespace Mall.Repository.Product
{
where += $@" and {nameof(RB_Goods_OrderDetail.ProductCode)} like '%{dmodel.ProductCode}%'";
}
if (!string.IsNullOrEmpty(dmodel.OrderIds))
if (!string.IsNullOrEmpty(dmodel.OrderIds))
{
where += $@" and {nameof(RB_Goods_OrderDetail.OrderId)} in({dmodel.OrderIds})";
}
......@@ -64,5 +65,77 @@ namespace Mall.Repository.Product
string sql = $@"SELECT * FROM rb_goods_orderdetail where {where} order by Id asc";
return Get<RB_Goods_OrderDetail_Extend>(sql).ToList();
}
/// <summary>
/// 获取订单商品分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="count"></param>
/// <param name="dmodel"></param>
/// <returns></returns>
public List<RB_Goods_OrderDetail_Extend> GetSupplierOrderPageList(int pageIndex, int pageSize, out long count, RB_Goods_OrderDetail_Extend dmodel)
{
string where = $" 1=1 and o.{nameof(RB_Goods_Order.Status)}=0 and o.OrderStatus in(2,3,4,5,6) ";
if (dmodel.TenantId > 0)
{
where += $@" and o.{nameof(RB_Goods_Order.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and o.{nameof(RB_Goods_Order.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.OrderType > 0)
{
where += $@" and od.{nameof(RB_Goods_OrderDetail.OrderType)}={dmodel.OrderType}";
}
if (dmodel.SupplierId > 0)
{
where += $@" and od.{nameof(RB_Goods_OrderDetail.SupplierId)}={dmodel.SupplierId}";
}
if (dmodel.IsFinance > 0)
{
if (dmodel.IsFinance == 1)
{
where += $@" and od.{nameof(RB_Goods_OrderDetail.CostFinanceId)}>0";
}
else
{
where += $@" and od.{nameof(RB_Goods_OrderDetail.CostFinanceId)}<=0";
}
}
if (!string.IsNullOrEmpty(dmodel.StartTime))
{
where += $@" and o.{nameof(RB_Goods_Order.CreateDate)} >='{dmodel.StartTime}'";
}
if (!string.IsNullOrEmpty(dmodel.EndTime))
{
where += $@" and o.{nameof(RB_Goods_Order.CreateDate)} <='{dmodel.EndTime} 23:59:59'";
}
if (!string.IsNullOrEmpty(dmodel.OrderNo))
{
where += $@" and o.{nameof(RB_Goods_Order.OrderNo)} like '%{dmodel.OrderNo}%'";
}
if (!string.IsNullOrEmpty(dmodel.GoodsName))
{
where += $@" and od.{nameof(RB_Goods_OrderDetail.GoodsName)} like '%{dmodel.GoodsName}%'";
}
if (!string.IsNullOrEmpty(dmodel.ProductCode))
{
where += $@" and od.{nameof(RB_Goods_OrderDetail.ProductCode)} like '%{dmodel.ProductCode}%'";
}
string sql = $@"SELECT od.*,o.OrderNo FROM rb_goods_orderdetail od
INNER JOIN rb_goods_order o on o.OrderId=od.OrderId
where {where} order by o.CreateDate desc";
return GetPage<RB_Goods_OrderDetail_Extend>(pageIndex, pageSize, out count, sql).ToList();
}
}
}
......@@ -5,7 +5,9 @@ using System.Threading.Tasks;
using Mall.Common;
using Mall.Common.API;
using Mall.Common.Plugin;
using Mall.Model.Extend.Product;
using Mall.Model.Extend.User;
using Mall.Module.Product;
using Mall.Module.User;
using Mall.WebApi.Filter;
using Microsoft.AspNetCore.Cors;
......@@ -22,8 +24,12 @@ namespace Mall.WebApi.Controllers.User
public class SupplierController : BaseController
{
private readonly SupplierModule supplierModule = new SupplierModule();
/// <summary>
/// 订单
/// </summary>
private readonly OrderModule orderModule = new OrderModule();
#region 供应商管理
[HttpPost]
public ApiResult GetSupplierList()
{
......@@ -163,5 +169,59 @@ namespace Mall.WebApi.Controllers.User
return ApiResult.Failed();
}
}
/// <summary>
/// 获取详情
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetSupplierAllList()
{
var parms = RequestParm;
var query = JsonConvert.DeserializeObject<RB_Supplier_Extend>(RequestParm.msg.ToString());
query.TenantId = UserInfo.TenantId;
query.MallBaseId = parms.MallBaseId;
var oldLogisticsList = supplierModule.GetList(query);
return ApiResult.Success("", oldLogisticsList);
}
#endregion
#region 供应商采购商品信息
/// <summary>
/// 供应商商品信息
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetSupplierGoodsList()
{
var parms = RequestParm;
ResultPageModel pagelist = JsonConvert.DeserializeObject<ResultPageModel>(RequestParm.msg.ToString());
RB_Goods_OrderDetail_Extend demodel = JsonConvert.DeserializeObject<RB_Goods_OrderDetail_Extend>(RequestParm.msg.ToString());
demodel.TenantId = UserInfo.TenantId;
demodel.MallBaseId = parms.MallBaseId;
var list = orderModule.GetSupplierOrderPageList(pagelist.pageIndex, pagelist.pageSize, out long count, demodel);
pagelist.count = Convert.ToInt32(count);
pagelist.pageData = list.Select(x => new
{
x.SupplierId,
x.OrderNo,
x.GoodsName,
x.Original_Price,
x.CostMoney,
x.FreightCostMoney,
x.CostFinanceId,
x.Id,
x.OrderId
});
return ApiResult.Success("", pagelist);
}
#endregion
}
}
\ No newline at end of file
......@@ -32,6 +32,7 @@
"RB_Branch_Id": 49, //所属公司id
"RebornDMC": "reborn_dmc",
"IncomeFinanceApi": "http://192.168.2.16:8083/api/Mall/InsertFinanceBatchForMallIn",
"PaymentFinanceApi": "http://192.168.2.16:8083/api/Mall/InsertFinanceBatchForMallOut",
"FinanceKey": "FinanceMallInsertToERPViitto2020",
"RedisSetting": {
"RedisServer": "192.168.2.214",
......
......@@ -32,6 +32,7 @@
"RB_Branch_Id": 49, //所属公司id
"RebornDMC": "reborn_dmc",
"IncomeFinanceApi": "http://192.168.2.16:8083/api/Mall/InsertFinanceBatchForMallIn",
"PaymentFinanceApi": "http://192.168.2.16:8083/api/Mall/InsertFinanceBatchForMallOut",
//"FinanceKey": "FinanceMallInsertToERPViitto2020",
"FinanceKey": "FinanceMallInsertToERPViitto2020",
"RedisSetting": {
......
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