Commit bf783e16 authored by 吴春's avatar 吴春

提交扫码出库

parent b7731e90
......@@ -128,7 +128,7 @@ namespace REBORN.Common
}
}
/// <summary>
/// 读取配置文件key的值
......@@ -237,5 +237,37 @@ namespace REBORN.Common
return new ConfigurationBuilder().Add(new JsonConfigurationSource { Path = "appsettings.json" }).Build().GetSection("ViewFileSiteUrl").Value;
}
}
/// <summary>
/// 出库申请币种
/// </summary>
public static string OutCurrencyId
{
get
{
return new ConfigurationBuilder().Add(new JsonConfigurationSource { Path = "appsettings.json" }).Build().GetSection("OutCurrencyId").Value;
}
}
/// <summary>
/// 财务单据请求参数Key
/// </summary>
public static string FinanceKey
{
get
{
return new ConfigurationBuilder().Add(new JsonConfigurationSource { Path = "appsettings.json" }).Build().GetSection("FinanceKey").Value;
}
}
/// <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
......@@ -229,6 +229,34 @@ namespace REBORN.Common
#endregion
#region AES加密算法
/// <summary>
/// AES 加密
/// </summary>
/// <param name="str">明文(待加密)</param>
/// <param name="key">密文</param>
/// <returns></returns>
public static string AesEncrypt(string str, string key)
{
if (string.IsNullOrEmpty(str)) return null;
Byte[] toEncryptArray = Encoding.UTF8.GetBytes(str);
RijndaelManaged rm = new RijndaelManaged
{
Key = Encoding.UTF8.GetBytes(key),
Mode = CipherMode.ECB,
Padding = PaddingMode.PKCS7
};
ICryptoTransform cTransform = rm.CreateEncryptor();
Byte[] resultArray = cTransform.TransformFinalBlock(toEncryptArray, 0, toEncryptArray.Length);
return Convert.ToBase64String(resultArray, 0, resultArray.Length);
}
/// <summary>
/// AES加密
/// </summary>
......
using REBORN.Common.AOP;
using System;
using System.Collections.Generic;
using System.Text;
namespace Property.Model.Entity.Mall
{
/// <summary>
/// 商品订单明细表实体
/// </summary>
[Serializable]
[DB(ConnectionName = "MallConnection")]
public class RB_Goods_OrderDetail
{
/// <summary>
/// Id
/// </summary>
public int Id
{
get;
set;
}
/// <summary>
/// 订单id
/// </summary>
public int? OrderId
{
get;
set;
}
/// <summary>
/// 商品id
/// </summary>
public int? GoodsId
{
get;
set;
}
/// <summary>
/// 订单类型 枚举
/// </summary>
public int OrderType
{
get;
set;
}
/// <summary>
/// 商品名称
/// </summary>
public string GoodsName
{
get;
set;
}
/// <summary>
/// 封面图
/// </summary>
public string CoverImage
{
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 decimal? Unit_Price
{
get;
set;
}
/// <summary>
/// 数量
/// </summary>
public int? Number
{
get;
set;
}
/// <summary>
/// 原价 (=单价*数量)
/// </summary>
public decimal? Original_Price
{
get;
set;
}
/// <summary>
/// 最终价格(不包含运费)
/// </summary>
public decimal? Final_Price
{
get;
set;
}
/// <summary>
/// 折扣
/// </summary>
public decimal? DiscountRate
{
get;
set;
}
/// <summary>
/// 是否商品单独会员价购买 1是 2否
/// </summary>
public int? IsMemberPrice
{
get;
set;
}
/// <summary>
/// 商户号
/// </summary>
public int TenantId
{
get;
set;
}
/// <summary>
/// 小程序id
/// </summary>
public int MallBaseId
{
get;
set;
}
/// <summary>
/// CreateDate
/// </summary>
public DateTime? CreateDate
{
get;
set;
}
/// <summary>
/// UpdateDate
/// </summary>
public DateTime? UpdateDate
{
get;
set;
}
/// <summary>
/// 成本价
/// </summary>
public decimal? CostMoney { get; set; }
/// <summary>
/// 是否评论 1是 2否
/// </summary>
public int? IsComment { get; set; }
/// <summary>
/// 运费
/// </summary>
public decimal? FreightMoney { get; set; }
/// <summary>
/// 使用积分数量
/// </summary>
public int? IntegralNumber { get; set; }
/// <summary>
/// 积分抵扣金额
/// </summary>
public decimal? IntegralMoney { get; set; }
/// <summary>
/// 优惠券使用金额
/// </summary>
public decimal? CouponMoney { get; set; }
/// <summary>
/// 运费成本
/// </summary>
public decimal? FreightCostMoney { get; set; }
/// <summary>
/// 供应商id
/// </summary>
public int SupplierId { get; set; }
/// <summary>
/// 成本单据ID
/// </summary>
public int CostFinanceId { get; set; }
/// <summary>
/// 积分赠送
/// </summary>
public int? IntegralGoodsPresent { get; set; }
}
}
......@@ -134,9 +134,9 @@ namespace Property.Model.Entity.Mall
}
/// <summary>
/// 供应商id
/// 出库单id
/// </summary>
public int SupplierId
public int StockInId
{
get;
set;
......
......@@ -14,6 +14,11 @@ namespace Property.Model.Entity.Mall
{
/// <summary>
/// 入库单id
/// </summary>
public int StockInId { get; set; }
/// <summary>
/// 物料id
/// </summary>
......
This diff is collapsed.
using Property.Model.Entity.Mall;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Property.Repository.Mall
{
/// <summary>
/// 商品订单明细仓储层
/// </summary>
public class RB_Goods_OrderDetailRepository : RepositoryBase<RB_Goods_OrderDetail>
{
/// <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> GetOrderDetailList(RB_Goods_OrderDetail dmodel)
{
string where = $" 1=1 ";
if (dmodel.TenantId > 0)
{
where += $@" and a.{nameof(RB_Goods_OrderDetail.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and a.{nameof(RB_Goods_OrderDetail.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.OrderId > 0)
{
where += $@" and a.{nameof(RB_Goods_OrderDetail.OrderId)}={dmodel.OrderId}";
}
if (dmodel.OrderType > 0)
{
where += $@" and a.{nameof(RB_Goods_OrderDetail.OrderType)}={(int)dmodel.OrderType}";
}
if (dmodel.IsComment > 0)
{
where += $@" and a.{nameof(RB_Goods_OrderDetail.IsComment)}={(int)dmodel.IsComment}";
}
if (!string.IsNullOrEmpty(dmodel.GoodsName))
{
where += $@" and a.{nameof(RB_Goods_OrderDetail.GoodsName)} like '%{dmodel.GoodsName}%'";
}
if (!string.IsNullOrEmpty(dmodel.ProductCode))
{
where += $@" and a.{nameof(RB_Goods_OrderDetail.ProductCode)} like '%{dmodel.ProductCode}%'";
}
string sql = $@"SELECT a.*,b.`Name` as SupplierName FROM rb_goods_orderdetail as a LEFT JOIN rb_supplier as b on a.SupplierId=b.ID where {where} order by a.Id asc";
return Get<RB_Goods_OrderDetail>(sql).ToList();
}
}
}
using Property.Model.Entity.Mall;
using Property.Model.Extend.Mall;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Property.Repository.Mall
{
public class RB_WarehouseOut_FinanceRepository : RepositoryBase<RB_WarehouseOut_Finance>
{
/// <summary>
/// 表名称
/// </summary>
public string TableName { get { return nameof(RB_WarehouseOut_Finance); } }
/// <summary>
/// 出库申请列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="query">查询条件</param>
/// <returns></returns>
public List<RB_WarehouseOut_Finance> GetApplyPageList(int pageIndex, int pageSize, out long rowCount, RB_WarehouseOut_Finance query)
{
StringBuilder builder = new StringBuilder();
builder.Append(@$" select a.* from {TableName} as a where a.Status=0 ");
if (query != null)
{
if (query.ID > 0)
{
builder.Append($" AND a.{nameof(RB_WarehouseOut_Finance.ID)}={query.ID}");
}
if (query.TenantId > 0)
{
builder.Append($" AND a.{nameof(RB_WarehouseOut_Finance.TenantId)}={query.TenantId}");
}
if (query.MallBaseId > 0)
{
builder.Append($" AND a.{nameof(RB_WarehouseOut_Finance.MallBaseId)}={query.MallBaseId}");
}
if (query.RB_Group_Id > 0)
{
builder.Append($" AND a.{nameof(RB_WarehouseOut_Finance.RB_Group_Id)}={query.RB_Group_Id}");
}
if (query.RB_Branch_Id > -1)
{
builder.Append($" AND a.{nameof(RB_WarehouseOut_Finance.RB_Branch_Id)}={query.RB_Branch_Id}");
}
}
return GetPage<RB_WarehouseOut_Finance>(pageIndex, pageSize, out rowCount, builder.ToString()).ToList();
}
/// <summary>
/// 出库申请列表
/// </summary>
/// <param name="query">查询条件</param>
/// <returns></returns>
public List<RB_WarehouseOut_Finance> GetApplyList(RB_WarehouseOut_Finance query)
{
StringBuilder builder = new StringBuilder();
builder.Append($" select * from {TableName} as a where a.Status=0 ");
if (query != null)
{
if (query.ID > 0)
{
builder.Append($" AND a.{nameof(RB_WarehouseOut_Finance.ID)}={query.ID}");
}
if (query.TenantId > 0)
{
builder.Append($" AND a.{nameof(RB_WarehouseOut_Finance.TenantId)}={query.TenantId}");
}
if (query.MallBaseId > 0)
{
builder.Append($" AND a.{nameof(RB_WarehouseOut_Finance.MallBaseId)}={query.MallBaseId}");
}
}
return Get<RB_WarehouseOut_Finance>(builder.ToString()).ToList();
}
}
}
using Property.Model.Entity.Mall;
using Property.Model.Extend.Mall;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Property.Repository.Mall
{
public class RB_WarehouseOut_GoodsDetailRepository : RepositoryBase<RB_WarehouseOut_GoodsDetail>
{
/// <summary>
/// 表名称
/// </summary>
public string TableName { get { return nameof(RB_WarehouseOut_GoodsDetail); } }
/// <summary>
/// 出库申请列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="query">查询条件</param>
/// <returns></returns>
public List<RB_WarehouseOut_GoodsDetail> GetApplyPageList(int pageIndex, int pageSize, out long rowCount, RB_WarehouseOut_GoodsDetail query)
{
StringBuilder builder = new StringBuilder();
builder.Append(@$" select a.* from {TableName} as a where a.Status=0 ");
if (query != null)
{
if (query.ID > 0)
{
builder.Append($" AND a.{nameof(RB_WarehouseOut_GoodsDetail.ID)}={query.ID}");
}
if (query.TenantId > 0)
{
builder.Append($" AND a.{nameof(RB_WarehouseOut_GoodsDetail.TenantId)}={query.TenantId}");
}
if (query.MallBaseId > 0)
{
builder.Append($" AND a.{nameof(RB_WarehouseOut_GoodsDetail.MallBaseId)}={query.MallBaseId}");
}
}
return GetPage<RB_WarehouseOut_GoodsDetail>(pageIndex, pageSize, out rowCount, builder.ToString()).ToList();
}
/// <summary>
/// 出库申请列表
/// </summary>
/// <param name="query">查询条件</param>
/// <returns></returns>
public List<RB_WarehouseOut_GoodsDetail> GetApplyList(RB_WarehouseOut_GoodsDetail query)
{
StringBuilder builder = new StringBuilder();
builder.Append($" select * from {TableName} as a where a.Status=0 ");
if (query != null)
{
if (query.ID > 0)
{
builder.Append($" AND a.{nameof(RB_WarehouseOut_GoodsDetail.ID)}={query.ID}");
}
if (query.TenantId > 0)
{
builder.Append($" AND a.{nameof(RB_WarehouseOut_GoodsDetail.TenantId)}={query.TenantId}");
}
if (query.MallBaseId > 0)
{
builder.Append($" AND a.{nameof(RB_WarehouseOut_GoodsDetail.MallBaseId)}={query.MallBaseId}");
}
}
return Get<RB_WarehouseOut_GoodsDetail>(builder.ToString()).ToList();
}
}
}
......@@ -53,9 +53,9 @@ namespace Property.Repository.Mall
{
builder.Append($" AND a.{nameof(RB_WarehouseOut_Goods_Extend.GoodsName)} like '%{query.GoodsName}%'");
}
if (query.SupplierId > 0)
if (query.StockInId > 0)
{
builder.Append($" AND a.{nameof(RB_WarehouseOut_Goods_Extend.SupplierId)}={query.SupplierId}");
builder.Append($" AND a.{nameof(RB_WarehouseOut_Goods_Extend.StockInId)}={query.StockInId}");
}
if (!string.IsNullOrWhiteSpace(query.OrderGoodsIds))
{
......@@ -98,9 +98,9 @@ namespace Property.Repository.Mall
{
builder.Append($" AND a.{nameof(RB_WarehouseOut_Goods_Extend.GoodsName)} like '%{query.GoodsName}%'");
}
if (query.SupplierId > 0)
if (query.StockInId > 0)
{
builder.Append($" AND a.{nameof(RB_WarehouseOut_Goods_Extend.SupplierId)}={query.SupplierId}");
builder.Append($" AND a.{nameof(RB_WarehouseOut_Goods_Extend.StockInId)}={query.StockInId}");
}
}
return Get<RB_WarehouseOut_Goods_Extend>(builder.ToString()).ToList();
......@@ -142,9 +142,9 @@ namespace Property.Repository.Mall
{
builder.Append($" AND a.{nameof(RB_WarehouseOut_Goods_Extend.GoodsName)} like '%{query.GoodsName}%'");
}
if (query.SupplierId > 0)
if (query.StockInId > 0)
{
builder.Append($" AND a.{nameof(RB_WarehouseOut_Goods_Extend.SupplierId)}={query.SupplierId}");
builder.Append($" AND a.{nameof(RB_WarehouseOut_Goods_Extend.StockInId)}={query.StockInId}");
}
}
return Get<RB_WarehouseOut_Goods_Extend>(builder.ToString()).ToList();
......
......@@ -28,6 +28,12 @@
"ViewFileSiteUrl": "http://192.168.2.214:8130",
"ImKey": "b612b31e837c79c68f141aeb719d2b20",
"ImSecret": "66000451fb72",
"FinanceKey": "FinanceMallInsertToERPViitto2020",
"OutCurrencyId": 1,
"PaymentFinanceApi": "http://testapi.oytour.com/api/Mall/InsertFinanceBatchForMallOut",
"ExpendDirector": 1756, //财务支出创建人
"ExpendBranchId": 49, //财务支出创建人公司
"ExpendDepartment": 331,
"RedisSetting": {
"RedisServer": "192.168.2.214",
"RedisPort": "6379",
......
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