Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mall.oytour.com
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄奎
mall.oytour.com
Commits
3d77e656
Commit
3d77e656
authored
Nov 11, 2020
by
吴春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
线下服务
parent
8eb0e9f5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
1402 additions
and
71 deletions
+1402
-71
UserReidsCache.cs
Mall.CacheManager/User/UserReidsCache.cs
+68
-0
UserModuleCacheKeyConfig.cs
Mall.CacheManager/keyManager/UserModuleCacheKeyConfig.cs
+8
-0
TransactionPriceInfo.cs
Mall.Common/API/TransactionPriceInfo.cs
+38
-0
RB_Goods.cs
Mall.Model/Entity/Product/RB_Goods.cs
+6
-0
RB_Goods_OrderDetail.cs
Mall.Model/Entity/Product/RB_Goods_OrderDetail.cs
+6
-0
RB_Invoice_Online_Trade.cs
Mall.Model/Entity/Product/RB_Invoice_Online_Trade.cs
+143
-0
RB_Invoice_RecordDetail.cs
Mall.Model/Entity/Product/RB_Invoice_RecordDetail.cs
+107
-0
RB_Member_User.cs
Mall.Model/Entity/User/RB_Member_User.cs
+6
-0
RB_Invoice_Online_Trade_Extend.cs
Mall.Model/Extend/Product/RB_Invoice_Online_Trade_Extend.cs
+41
-0
RB_Invoice_RecordDetail_Extend.cs
Mall.Model/Extend/Product/RB_Invoice_RecordDetail_Extend.cs
+18
-0
OrderModule.cs
Mall.Module.Product/OrderModule.cs
+139
-46
ProductModule.cs
Mall.Module.Product/ProductModule.cs
+1
-0
UserCommonModule.cs
Mall.Module.User/UserCommonModule.cs
+82
-15
UserModule.cs
Mall.Module.User/UserModule.cs
+17
-3
RB_Invoice_Online_TradeRepository.cs
Mall.Repository/Product/RB_Invoice_Online_TradeRepository.cs
+157
-0
RB_Invoice_RecordDetailRepository.cs
Mall.Repository/Product/RB_Invoice_RecordDetailRepository.cs
+46
-0
RB_Member_UserRepository.cs
Mall.Repository/User/RB_Member_UserRepository.cs
+56
-0
PayUtil.cs
Mall.WebApi/App_Code/PayUtil.cs
+65
-0
WeChatPayController.cs
Mall.WebApi/Controllers/AppletWeChat/WeChatPayController.cs
+9
-1
OrderController.cs
Mall.WebApi/Controllers/Product/OrderController.cs
+359
-5
ProductController.cs
Mall.WebApi/Controllers/Product/ProductController.cs
+5
-1
UserController.cs
Mall.WebApi/Controllers/User/UserController.cs
+25
-0
No files found.
Mall.CacheManager/User/UserReidsCache.cs
View file @
3d77e656
...
...
@@ -34,6 +34,10 @@ namespace Mall.CacheManager.User
}
}
/// <summary>
/// 获取缓存时长
/// </summary>
...
...
@@ -210,5 +214,69 @@ namespace Mall.CacheManager.User
}
return
null
;
}
#
region
不可开发票总金额
/// <summary>
/// 设置缓存
/// </summary>
/// <param name="model"></param>
public
static
void
TransactionPriceSet
(
string
cacheKey
,
TransactionPriceInfo
model
,
int
JwtExpirTime
)
{
try
{
TimeSpan
ts
=
GetExpirTime
(
JwtExpirTime
);
redis
.
StringSet
<
TransactionPriceInfo
>(
cacheKey
,
model
,
ts
);
}
catch
(
Exception
ex
)
{
Common
.
Plugin
.
LogHelper
.
Write
(
ex
,
"TransactionPriceSet缓存设置失败"
);
}
}
/// <summary>
/// 获取不可开发票总金额
/// </summary>
/// <param name="TenantId">商户Id</param>
/// <returns></returns>
public
static
TransactionPriceInfo
GetTransactionPriceInfo
(
int
MallBaseId
)
{
TransactionPriceInfo
transactionPriceInfo
=
null
;
if
(
MallBaseId
>
0
)
{
string
cacheKey
=
UserModuleCacheKeyConfig
.
Transaction_Price_
+
MallBaseId
.
ToString
();
try
{
transactionPriceInfo
=
redis
.
StringGet
<
TransactionPriceInfo
>(
cacheKey
);
}
catch
(
Exception
ex
)
{
LogHelper
.
Write
(
ex
,
"GetTransactionPriceInfo"
);
}
//if (transactionPriceInfo == null)
//{
// if (MallBaseId > 0 && TenantId > 0)
// {
// transactionPriceInfo = new TransactionPriceInfo
// {
// TenantId = (int)TenantId,
// MallBaseId = (int)MallBaseId,
// TotalPrice = TotalPrice
// };
// TransactionPriceSet(UserModuleCacheKeyConfig.Transaction_Price_ + MallBaseId, transactionPriceInfo, Config.JwtExpirTime);
// }
//}
}
else
{
transactionPriceInfo
=
new
TransactionPriceInfo
();
}
return
transactionPriceInfo
;
}
#
endregion
}
}
Mall.CacheManager/keyManager/UserModuleCacheKeyConfig.cs
View file @
3d77e656
...
...
@@ -40,5 +40,13 @@ namespace Mall.CacheKey
{
get
{
return
"ERP_Login_Info_"
;
}
}
/// <summary>
/// 2020-11-10 Add By:W 针对全部的不可开发票商品的金额
/// </summary>
public
static
string
Transaction_Price_
{
get
{
return
"Transaction_Price_"
;
}
}
}
}
Mall.Common/API/TransactionPriceInfo.cs
0 → 100644
View file @
3d77e656
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
Mall.Common
{
/// <summary>
/// 平台商品不可开票总金额缓存
/// </summary>
public
class
TransactionPriceInfo
{
/// <summary>
/// 商户号
/// </summary>
public
int
TenantId
{
get
;
set
;
}
/// <summary>
/// 小程序Id
/// </summary>
public
int
MallBaseId
{
get
;
set
;
}
/// <summary>
/// 总金额(运费+商品金额)
/// </summary>
public
decimal
TotalPrice
{
get
;
set
;
}
}
}
Mall.Model/Entity/Product/RB_Goods.cs
View file @
3d77e656
...
...
@@ -573,5 +573,11 @@ namespace Mall.Model.Entity.Product
/// 服务时长
/// </summary>
public
decimal
ServiceTime
{
get
;
set
;
}
/// <summary>
/// 是否为不可开发票商品,1-是
/// </summary>
public
int
IsNoTax
{
get
;
set
;
}
}
}
Mall.Model/Entity/Product/RB_Goods_OrderDetail.cs
View file @
3d77e656
...
...
@@ -372,5 +372,11 @@ namespace Mall.Model.Entity.Product
/// 商品服务时长
/// </summary>
public
decimal
GoodServiceTime
{
get
;
set
;
}
/// <summary>
/// 是否为可开发票商品,1-是
/// </summary>
public
int
IsNoTax
{
get
;
set
;
}
}
}
Mall.Model/Entity/Product/RB_Invoice_Online_Trade.cs
0 → 100644
View file @
3d77e656
using
VT.FW.DB
;
using
Mall.Common.Enum.User
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Mall.Model.Entity.Product
{
/// <summary>
/// 不开发票商品提现信息表实体
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Invoice_Online_Trade
{
/// <summary>
/// Id
/// </summary>
public
int
Id
{
get
;
set
;
}
/// <summary>
/// 用户id
/// </summary>
public
int
User_Id
{
get
;
set
;
}
/// <summary>
/// 订单号
/// </summary>
public
string
Out_Trade_No
{
get
;
set
;
}
/// <summary>
/// 微信支付订单号
/// </summary>
public
string
Transaction_Id
{
get
;
set
;
}
/// <summary>
/// 支付类型 枚举 1微信 2支付宝 3银行卡
/// </summary>
public
Common
.
Enum
.
Goods
.
OrderPayTypeEnum
?
PayWay
{
get
;
set
;
}
/// <summary>
/// 支付调用的是哪种api
/// </summary>
public
string
PayType
{
get
;
set
;
}
/// <summary>
/// 交易金额
/// </summary>
public
decimal
?
Money
{
get
;
set
;
}
/// <summary>
/// 备注附加信息
/// </summary>
public
string
Remarks
{
get
;
set
;
}
/// <summary>
/// 0-成功 其他-失败
/// </summary>
public
int
?
Pay_Result
{
get
;
set
;
}
/// <summary>
/// 交易日期
/// </summary>
public
DateTime
?
Pay_Date
{
get
;
set
;
}
/// <summary>
/// 绑定财务单据id
/// </summary>
public
int
?
FinanceId
{
get
;
set
;
}
/// <summary>
/// 创建人
/// </summary>
public
int
CreateBy
{
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
;
}
}
}
Mall.Model/Entity/Product/RB_Invoice_RecordDetail.cs
0 → 100644
View file @
3d77e656
using
VT.FW.DB
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Mall.Model.Entity.Product
{
/// <summary>
///不可开发票商品记录详情表实体
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Invoice_RecordDetail
{
/// <summary>
/// 编号
/// </summary>
public
int
ID
{
get
;
set
;
}
/// <summary>
/// 类型 1收款 2成本 3退款 4打款
/// </summary>
public
int
?
Type
{
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>
/// 商品名称
/// </summary>
public
string
Name
{
get
;
set
;
}
/// <summary>
/// 订单id
/// </summary>
public
int
OrderId
{
get
;
set
;
}
/// <summary>
/// 订单详情id
/// </summary>
public
int
OrderDetailId
{
get
;
set
;
}
/// <summary>
/// 商品价格
/// </summary>
public
decimal
GoodsPrice
{
get
;
set
;
}
/// <summary>
/// 单价
/// </summary>
public
decimal
?
Unit_Price
{
get
;
set
;
}
/// <summary>
/// 数量
/// </summary>
public
int
?
Number
{
get
;
set
;
}
/// <summary>
/// 运费
/// </summary>
public
decimal
FreightMoney
{
get
;
set
;
}
}
}
Mall.Model/Entity/User/RB_Member_User.cs
View file @
3d77e656
...
...
@@ -229,5 +229,11 @@ namespace Mall.Model.Entity.User
/// 2020-10-28号新增 (微信小程序获取的手机号码)
/// </summary>
public
string
PhoneNum
{
get
;
set
;
}
/// <summary>
/// 是否结算用户,1-是 2020-11-10 Addd By:w
/// </summary>
public
int
IsSettlement
{
get
;
set
;
}
}
}
Mall.Model/Extend/Product/RB_Invoice_Online_Trade_Extend.cs
0 → 100644
View file @
3d77e656
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
Mall.Model.Entity.Product
;
namespace
Mall.Model.Extend.Product
{
public
class
RB_Invoice_Online_Trade_Extend
:
RB_Invoice_Online_Trade
{
/// <summary>
/// 开始时间
/// </summary>
public
string
StartTime
{
get
;
set
;
}
/// <summary>
/// 结束时间
/// </summary>
public
string
EndTime
{
get
;
set
;
}
/// <summary>
/// 开始金额
/// </summary>
public
decimal
?
StartMoney
{
get
;
set
;
}
/// <summary>
/// 结束金额
/// </summary>
public
decimal
?
EndMoney
{
get
;
set
;
}
/// <summary>
/// 创建人姓名
/// </summary>
public
string
CreateByName
{
get
;
set
;
}
/// <summary>
/// 收款人姓名
/// </summary>
public
string
UserName
{
get
;
set
;
}
}
}
Mall.Model/Extend/Product/RB_Invoice_RecordDetail_Extend.cs
0 → 100644
View file @
3d77e656
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
Mall.Model.Entity.Product
;
using
VT.FW.DB
;
namespace
Mall.Model.Extend.Product
{
/// <summary>
///不可开发票商品记录扩展体
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Invoice_RecordDetail_Extend
:
RB_Invoice_RecordDetail
{
public
string
OrderDetailIds
{
get
;
set
;
}
}
}
Mall.Module.Product/OrderModule.cs
View file @
3d77e656
This diff is collapsed.
Click to expand it.
Mall.Module.Product/ProductModule.cs
View file @
3d77e656
...
...
@@ -7012,6 +7012,7 @@ namespace Mall.Module.Product
{
nameof
(
RB_Goods
.
IntegralCommentType
),
demodel
.
IntegralCommentType
},
{
nameof
(
RB_Goods
.
Remark
),
demodel
.
Remark
},
{
nameof
(
RB_Goods
.
GoodsPageType
),
demodel
.
GoodsPageType
},
{
nameof
(
RB_Goods
.
IsNoTax
),
demodel
.
IsNoTax
},
};
if
(
goodsModel
.
IsProcurement
==
1
)
{
...
...
Mall.Module.User/UserCommonModule.cs
View file @
3d77e656
This diff is collapsed.
Click to expand it.
Mall.Module.User/UserModule.cs
View file @
3d77e656
...
...
@@ -241,12 +241,26 @@ namespace Mall.Module.User
return
member_UserRepository
.
GetMemberUserDropDownList
(
pageIndex
,
pageSize
,
out
count
,
demodel
);
}
/// <summary>
/// 获取
用户信息
/// 获取
下拉列表
/// </summary>
/// <param name="userId"></param>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="count"></param>
/// <param name="dmodel"></param>
/// <returns></returns>
public
RB_Member_User_Extend
GetMemberUserInfo
(
int
userId
)
public
List
<
RB_Member_User_Extend
>
GetMemberUserDropDownList_V2
(
int
pageIndex
,
int
pageSize
,
out
long
count
,
RB_Member_User_Extend
dmodel
)
{
return
member_UserRepository
.
GetMemberUserDropDownList_V2
(
pageIndex
,
pageSize
,
out
count
,
dmodel
);
}
/// <summary>
/// 获取用户信息
/// </summary>
/// <param name="userId"></param>
/// <returns></returns>
public
RB_Member_User_Extend
GetMemberUserInfo
(
int
userId
)
{
return
member_UserRepository
.
GetEntity
(
userId
).
RefMapperTo
<
RB_Member_User_Extend
>();
}
...
...
Mall.Repository/Product/RB_Invoice_Online_TradeRepository.cs
0 → 100644
View file @
3d77e656
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
Mall.Model.Entity.Product
;
using
Mall.Model.Extend.Product
;
namespace
Mall.Repository.Product
{
public
class
RB_Invoice_Online_TradeRepository
:
BaseRepository
<
RB_Invoice_Online_Trade
>
{
/// <summary>
/// 表名称
/// </summary>
public
string
TableName
{
get
{
return
nameof
(
RB_Invoice_Online_Trade
);
}
}
/// <summary>
///
/// 获取列表
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public
List
<
RB_Invoice_Online_Trade_Extend
>
GetList
(
RB_Invoice_Online_Trade_Extend
dmodel
)
{
string
where
=
$" where 1=1 "
;
if
(
dmodel
.
TenantId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Invoice_Online_Trade_Extend
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
}
if
(
dmodel
.
MallBaseId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Invoice_Online_Trade_Extend
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
}
string
sql
=
$@"SELECT * FROM
{
TableName
}
{
where
}
order by Id asc"
;
return
Get
<
RB_Invoice_Online_Trade_Extend
>(
sql
).
ToList
();
}
/// <summary>
/// 获取不开发票商品提现记录
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="query">查询条件</param>
/// <returns></returns>
public
List
<
RB_Invoice_Online_Trade_Extend
>
GetInvoiceOnlineTradePageList
(
int
pageIndex
,
int
pageSize
,
out
long
rowCount
,
RB_Invoice_Online_Trade_Extend
query
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
Append
(
$@" SELECT a.*,b.`Name` as UserName,c.EmpName as CreateByName FROM
{
TableName
}
as a
LEFT JOIN rb_member_user as b on a.User_Id=b.Id
LEFT JOIN rb_employee as c on a.CreateBy=c.EmpId where 1=1 "
);
if
(
query
!=
null
)
{
if
(
query
.
TenantId
>
0
)
{
builder
.
Append
(
$" AND a.
{
nameof
(
RB_Invoice_Online_Trade_Extend
.
TenantId
)}
=
{
query
.
TenantId
}
"
);
}
if
(
query
.
TenantId
>
0
)
{
builder
.
Append
(
$" AND a.
{
nameof
(
RB_Invoice_Online_Trade_Extend
.
MallBaseId
)}
=
{
query
.
MallBaseId
}
"
);
}
if
(
query
.
CreateBy
>
0
)
{
builder
.
Append
(
$" AND a.
{
nameof
(
RB_Invoice_Online_Trade_Extend
.
CreateBy
)}
=
{
query
.
CreateBy
}
"
);
}
if
(
query
.
User_Id
>
0
)
{
builder
.
Append
(
$" AND a.
{
nameof
(
RB_Invoice_Online_Trade_Extend
.
User_Id
)}
=
{
query
.
User_Id
}
"
);
}
if
(!
string
.
IsNullOrWhiteSpace
(
query
.
Transaction_Id
))
{
builder
.
Append
(
$" AND a.
{
nameof
(
RB_Invoice_Online_Trade_Extend
.
Transaction_Id
)}
like '%
{
query
.
Transaction_Id
}
%'"
);
}
if
(!
string
.
IsNullOrEmpty
(
query
.
StartTime
))
{
builder
.
Append
(
$" and a.
{
nameof
(
RB_Invoice_Online_Trade_Extend
.
Pay_Date
)}
>='
{
query
.
StartTime
}
'"
);
}
if
(!
string
.
IsNullOrEmpty
(
query
.
EndTime
))
{
builder
.
Append
(
$" and a.
{
nameof
(
RB_Invoice_Online_Trade_Extend
.
Pay_Date
)}
<='
{
query
.
EndTime
}
23:59:59'"
);
}
if
(
query
.
StartMoney
.
HasValue
&&
query
.
StartMoney
.
Value
>
0
)
{
builder
.
Append
(
$" and a.
{
nameof
(
RB_Invoice_Online_Trade_Extend
.
Money
)}
>=
{
query
.
StartMoney
}
"
);
}
if
(
query
.
EndMoney
.
HasValue
&&
query
.
EndMoney
.
Value
>
0
)
{
builder
.
Append
(
$" and a.
{
nameof
(
RB_Invoice_Online_Trade_Extend
.
Money
)}
<=
{
query
.
EndMoney
}
"
);
}
}
return
GetPage
<
RB_Invoice_Online_Trade_Extend
>(
pageIndex
,
pageSize
,
out
rowCount
,
builder
.
ToString
()).
ToList
();
}
/// <summary>
/// 获取不开发票商品提现记录
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="query">查询条件</param>
/// <returns></returns>
public
List
<
RB_Invoice_Online_Trade_Extend
>
GetToDayInvoiceOnlineTradeList
(
RB_Invoice_Online_Trade_Extend
query
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
Append
(
$@" SELECT a.* from
{
TableName
}
as a where 1=1 "
);
if
(
query
!=
null
)
{
if
(
query
.
TenantId
>
0
)
{
builder
.
Append
(
$" AND a.
{
nameof
(
RB_Invoice_Online_Trade_Extend
.
TenantId
)}
=
{
query
.
TenantId
}
"
);
}
if
(
query
.
TenantId
>
0
)
{
builder
.
Append
(
$" AND a.
{
nameof
(
RB_Invoice_Online_Trade_Extend
.
MallBaseId
)}
=
{
query
.
MallBaseId
}
"
);
}
if
(
query
.
CreateBy
>
0
)
{
builder
.
Append
(
$" AND a.
{
nameof
(
RB_Invoice_Online_Trade_Extend
.
CreateBy
)}
=
{
query
.
CreateBy
}
"
);
}
if
(
query
.
User_Id
>
0
)
{
builder
.
Append
(
$" AND a.
{
nameof
(
RB_Invoice_Online_Trade_Extend
.
User_Id
)}
=
{
query
.
User_Id
}
"
);
}
if
(!
string
.
IsNullOrWhiteSpace
(
query
.
Transaction_Id
))
{
builder
.
Append
(
$" AND a.
{
nameof
(
RB_Invoice_Online_Trade_Extend
.
Transaction_Id
)}
like '%
{
query
.
Transaction_Id
}
%'"
);
}
if
(
query
.
Pay_Date
.
HasValue
)
{
builder
.
Append
(
$" and DATE_FORMAT(a.
{
nameof
(
RB_Invoice_Online_Trade_Extend
.
Pay_Date
)}
,'%Y-%m-%d' )=DATE_FORMAT('
{
query
.
Pay_Date
}
','%Y-%m-%d' )"
);
}
if
(!
string
.
IsNullOrEmpty
(
query
.
StartTime
))
{
builder
.
Append
(
$" and a.
{
nameof
(
RB_Invoice_Online_Trade_Extend
.
Pay_Date
)}
>='
{
query
.
StartTime
}
'"
);
}
if
(!
string
.
IsNullOrEmpty
(
query
.
EndTime
))
{
builder
.
Append
(
$" and a.
{
nameof
(
RB_Invoice_Online_Trade_Extend
.
Pay_Date
)}
<='
{
query
.
EndTime
}
23:59:59'"
);
}
if
(
query
.
StartMoney
.
HasValue
&&
query
.
StartMoney
.
Value
>
0
)
{
builder
.
Append
(
$" and a.
{
nameof
(
RB_Invoice_Online_Trade_Extend
.
Money
)}
>=
{
query
.
StartMoney
}
"
);
}
if
(
query
.
EndMoney
.
HasValue
&&
query
.
EndMoney
.
Value
>
0
)
{
builder
.
Append
(
$" and a.
{
nameof
(
RB_Invoice_Online_Trade_Extend
.
Money
)}
<=
{
query
.
EndMoney
}
"
);
}
}
return
Get
<
RB_Invoice_Online_Trade_Extend
>(
builder
.
ToString
()).
ToList
();
}
}
}
Mall.Repository/Product/RB_Invoice_RecordDetailRepository.cs
0 → 100644
View file @
3d77e656
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
Mall.Model.Entity.Product
;
using
Mall.Model.Extend.Product
;
namespace
Mall.Repository.Product
{
public
class
RB_Invoice_RecordDetailRepository
:
BaseRepository
<
RB_Invoice_RecordDetail
>
{
/// <summary>
/// 表名称
/// </summary>
public
string
TableName
{
get
{
return
nameof
(
RB_Invoice_RecordDetail
);
}
}
/// <summary>
///
/// 获取列表
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public
List
<
RB_Invoice_RecordDetail_Extend
>
GetList
(
RB_Invoice_RecordDetail_Extend
dmodel
)
{
string
where
=
$" where 1=1 "
;
if
(
dmodel
.
TenantId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Invoice_RecordDetail_Extend
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
}
if
(
dmodel
.
MallBaseId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Invoice_RecordDetail_Extend
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
}
if
(
dmodel
.
Type
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Invoice_RecordDetail_Extend
.
Type
)}
=
{
dmodel
.
Type
}
"
;
}
if
(!
string
.
IsNullOrWhiteSpace
(
dmodel
.
OrderDetailIds
))
{
where
+=
$@" and
{
nameof
(
RB_Invoice_RecordDetail_Extend
.
OrderDetailId
)}
in (
{
dmodel
.
OrderDetailIds
}
)"
;
}
string
sql
=
$@"SELECT * FROM
{
TableName
}
{
where
}
order by Id asc"
;
return
Get
<
RB_Invoice_RecordDetail_Extend
>(
sql
).
ToList
();
}
}
}
Mall.Repository/User/RB_Member_UserRepository.cs
View file @
3d77e656
...
...
@@ -1184,5 +1184,61 @@ FROM
return
""
;
}
}
/// <summary>
/// 获取下拉列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="count"></param>
/// <param name="dmodel"></param>
/// <returns></returns>
public
List
<
RB_Member_User_Extend
>
GetMemberUserDropDownList_V2
(
int
pageIndex
,
int
pageSize
,
out
long
count
,
RB_Member_User_Extend
dmodel
)
{
string
where
=
$" 1=1 and
{
nameof
(
RB_Member_User
.
IsSettlement
)}
=1 "
;
if
(
dmodel
.
TenantId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Member_User
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
}
if
(
dmodel
.
MallBaseId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Member_User
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
}
if
(
dmodel
.
Id
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Member_User
.
Id
)}
=
{
dmodel
.
Id
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
Name
))
{
where
+=
$@" and
{
nameof
(
RB_Member_User
.
Name
)}
like '%
{
dmodel
.
Name
}
%'"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
AliasName
))
{
where
+=
$@" and
{
nameof
(
RB_Member_User
.
AliasName
)}
like '%
{
dmodel
.
AliasName
}
%'"
;
}
if
(
dmodel
.
Source
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Member_User
.
Source
)}
=
{(
int
)
dmodel
.
Source
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
Moblie
))
{
where
+=
$@" and
{
nameof
(
RB_Member_User
.
Moblie
)}
like '%
{
dmodel
.
Moblie
}
%'"
;
}
if
(
dmodel
.
MemberGrade
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Member_User
.
MemberGrade
)}
=
{
dmodel
.
MemberGrade
}
"
;
}
if
(
dmodel
.
SuperiorId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Member_User
.
SuperiorId
)}
=
{
dmodel
.
SuperiorId
}
"
;
}
if
(
dmodel
.
IsDistributor
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Member_User
.
IsDistributor
)}
=
{
dmodel
.
IsDistributor
}
"
;
}
string
sql
=
$@"select Id,Name,AliasName from RB_Member_User where
{
where
}
order by CreateDate desc"
;
return
GetPage
<
RB_Member_User_Extend
>(
pageIndex
,
pageSize
,
out
count
,
sql
).
ToList
();
}
}
}
Mall.WebApi/App_Code/PayUtil.cs
View file @
3d77e656
...
...
@@ -362,6 +362,71 @@ namespace Mall.WebApi.App_Code
/// <summary>
/// 企业付款
/// </summary>
/// <param name="sOrderNo"></param>
/// <param name="sProductName"></param>
/// <param name="dPrice"></param>
/// <param name="CustomerId"></param>
/// <param name="openid"></param>
/// <returns></returns>
public
static
BaseResult
GetTransfersOrder_V2
(
string
sOrderNo
,
decimal
dPrice
,
string
CustomerId
,
string
openid
,
RB_MiniProgram_Extend
model
,
IHttpContextAccessor
_accessor
,
string
Remark
=
""
)
{
if
(!
System
.
IO
.
File
.
Exists
(
Path
.
Combine
(
AppDomain
.
CurrentDomain
.
BaseDirectory
,
"App_Data/Certs/WeChatApp/"
+
model
.
WeChatPayCertificateUrl
)))
{
return
new
BaseResult
()
{
IsSuccess
=
false
,
Message
=
"参数错误!"
};
}
var
req
=
new
Common
.
Pay
.
WeChatPat
.
RequestHandler
();
req
.
SetKey
(
model
.
WeChatApiSecret
);
//
req
.
SetParameter
(
"mch_appid"
,
model
.
MiniAppId
);
//微信开放平台审核通过的应用APPID
req
.
SetParameter
(
"mchid"
,
model
.
WeChatPayMerchants
);
//微信支付分配的商户号
req
.
SetParameter
(
"nonce_str"
,
GetNoncestr
());
//随机字符串,不长于32位
req
.
SetParameter
(
"partner_trade_no"
,
sOrderNo
);
//商户订单号,需保持唯一性(只能是字母或者数字,不能包含有其它字符)
req
.
SetParameter
(
"openid"
,
openid
);
req
.
SetParameter
(
"check_name"
,
"NO_CHECK"
);
req
.
SetParameter
(
"amount"
,
(
dPrice
*
100
).
ToString
(
"f0"
));
req
.
SetParameter
(
"desc"
,
Remark
==
""
?
"赞羊商城提现"
:
Remark
);
req
.
SetParameter
(
"sign"
,
req
.
CreateMd5Sign
(
_accessor
,
model
.
WeChatApiSecret
));
var
reqXml
=
req
.
ParseXml
();
var
result
=
Common
.
Pay
.
WeChatPat
.
HttpHelper
.
Post
(
new
HttpParam
()
{
Url
=
"https://api.mch.weixin.qq.com/mmpaymkttransfers/promotion/transfers"
,
PostParam
=
reqXml
,
Encoding
=
Common
.
Pay
.
WeChatPat
.
HttpHelper
.
GetRequestEncoding
(
_accessor
.
HttpContext
.
Request
),
CertPath
=
Path
.
Combine
(
AppDomain
.
CurrentDomain
.
BaseDirectory
,
"App_Data/Certs/WeChatApp/"
+
model
.
WeChatPayCertificateUrl
),
//"App_Data/Certs/WeChatApp/apiclient_cert.p12"),// model.WeChatPayCertificateUrl,
CertPwd
=
model
.
WeChatPayMerchants
//证书密码默认为您的商户ID
});
LogHelper
.
WriteInfo
(
"企业付款参数:"
+
req
.
ParseXml
());
var
xe
=
XElement
.
Parse
(
result
,
LoadOptions
.
SetLineInfo
);
LogHelper
.
WriteInfo
(
"企业付款结果:"
+
xe
);
var
returnCode
=
xe
.
GetElement
(
"return_code"
).
Value
;
var
resultCode
=
xe
.
GetElement
(
"result_code"
).
Value
;
if
(
returnCode
.
Equals
(
"SUCCESS"
)
&&
resultCode
.
Equals
(
"SUCCESS"
))
{
var
payment_no
=
xe
.
GetElement
(
"payment_no"
).
Value
;
var
payment_time
=
xe
.
GetElement
(
"payment_time"
).
Value
;
//在外面回写订单
return
new
BaseResult
()
{
IsSuccess
=
true
,
Data
=
new
Dictionary
<
string
,
string
>
{
{
"payment_no"
,
payment_no
},
//微信付款单号
{
"payment_time"
,
payment_time
},
//付款成功时间
}
};
}
var
errCodeDes
=
xe
.
GetElement
(
"err_code_des"
)
==
null
?
""
:
xe
.
GetElement
(
"err_code_des"
).
Value
;
var
returnMsg
=
xe
.
GetElement
(
"return_msg"
)
==
null
?
""
:
xe
.
GetElement
(
"return_msg"
).
Value
;
return
new
BaseResult
()
{
IsSuccess
=
false
,
Message
=
returnMsg
+
errCodeDes
};
}
/// <summary>
/// 企业付款
/// </summary>
...
...
Mall.WebApi/Controllers/AppletWeChat/WeChatPayController.cs
View file @
3d77e656
...
...
@@ -465,7 +465,7 @@ namespace Mall.WebApi.Controllers.AppletWeChat
RB_MiniProgram_Extend
miniProgram
=
new
RB_MiniProgram_Extend
();
//2020年5月26号新增
miniProgram
=
new
RB_MiniProgram_Extend
{
MiniAppId
=
"wxacd9f8cc3480d29e"
,
WeChatApiSecret
=
"936110e2c2214340b9829a3608bde6b0"
,
WeChatPayMerchants
=
"1562277941"
};
// programModule.GetMiniProgramModule(new RB_MiniProgram_Extend { MallBaseId = 1, TenantId =1 });
string
RefundOrderNo
=
System
.
DateTime
.
Now
.
ToString
(
"yyyyMMddHHmmssfff"
);
// var parmsInfo = RequestParm;
// var parmsInfo = RequestParm;
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
msg
.
ToString
());
string
orderNo
=
parms
.
GetStringValue
(
"orderNo"
);
int
orderId
=
parms
.
GetInt
(
"orderId"
);
...
...
@@ -474,6 +474,14 @@ namespace Mall.WebApi.Controllers.AppletWeChat
return
ApiResult
.
Success
(
""
,
Robj
);
}
public
ApiResult
InsertOrderPayInfo
()
{
var
request
=
RequestParm
;
var
userInfo
=
AppletUserInfo
;
RB_Goods_Order_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Goods_Order_Extend
>(
request
.
msg
.
ToString
());
userCommonModule
.
InsertOrderPayInfo
(
demodel
.
UserId
??
0
,
demodel
.
OrderId
,
demodel
.
OrderNo
,
"s1111111111111"
,
Common
.
Enum
.
Goods
.
OrderPayTypeEnum
.
WeChatPay
,
"test"
,
(
demodel
.
Income
??
0
),
System
.
DateTime
.
Now
,
0
);
return
ApiResult
.
Success
(
""
);
}
#
endregion
...
...
Mall.WebApi/Controllers/Product/OrderController.cs
View file @
3d77e656
This diff is collapsed.
Click to expand it.
Mall.WebApi/Controllers/Product/ProductController.cs
View file @
3d77e656
...
...
@@ -1196,7 +1196,8 @@ namespace Mall.WebApi.Controllers.MallBase
x
.
Remark
,
GoodsPageTypeStr
=
x
.
GoodsPageType
.
GetEnumName
(),
CarouselImageList
=
x
.
CarouselImageList
.
Select
(
qitem
=>
qitem
.
Path
).
ToList
(),
CreateDate
=
x
.
CreateDate
.
HasValue
?
x
.
CreateDate
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
:
""
CreateDate
=
x
.
CreateDate
.
HasValue
?
x
.
CreateDate
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
:
""
,
x
.
IsNoTax
});
return
ApiResult
.
Success
(
""
,
pagelist
);
}
...
...
@@ -1440,6 +1441,7 @@ namespace Mall.WebApi.Controllers.MallBase
x
.
SpecificationList
,
x
.
SpecificationPriceList
,
x
.
SendArea
,
x
.
IsNoTax
});
return
ApiResult
.
Success
(
""
,
pagelist
);
}
...
...
@@ -1533,6 +1535,7 @@ namespace Mall.WebApi.Controllers.MallBase
x
.
SpecificationList
,
x
.
SpecificationPriceList
,
x
.
SendArea
,
x
.
IsNoTax
});
return
ApiResult
.
Success
(
""
,
pagelist
);
}
...
...
@@ -1612,6 +1615,7 @@ namespace Mall.WebApi.Controllers.MallBase
model
?.
SendArea
,
model
?.
Remark
,
model
?.
GoodsPageType
,
model
?.
IsNoTax
,
CategoryList
=
model
?.
CategoryList
.
Select
(
x
=>
new
{
x
.
Id
,
...
...
Mall.WebApi/Controllers/User/UserController.cs
View file @
3d77e656
...
...
@@ -120,6 +120,31 @@ namespace Mall.WebApi.Controllers.User
return
ApiResult
.
Success
(
""
,
pagelist
);
}
/// <summary>
/// 获取结算用户下拉列表
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetMemberUserDropDownList_V2
()
{
var
parms
=
RequestParm
;
ResultPageModel
pagelist
=
JsonConvert
.
DeserializeObject
<
ResultPageModel
>(
parms
.
msg
.
ToString
());
RB_Member_User_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Member_User_Extend
>(
parms
.
msg
.
ToString
());
demodel
.
TenantId
=
Convert
.
ToInt32
(
parms
.
uid
);
demodel
.
MallBaseId
=
parms
.
MallBaseId
;
var
list
=
userModule
.
GetMemberUserDropDownList_V2
(
pagelist
.
pageIndex
,
pagelist
.
pageSize
,
out
long
count
,
demodel
);
pagelist
.
count
=
Convert
.
ToInt32
(
count
);
pagelist
.
pageData
=
list
.
Select
(
x
=>
new
{
x
.
Id
,
x
.
AliasName
,
x
.
Name
});
return
ApiResult
.
Success
(
""
,
pagelist
);
}
/// <summary>
/// 获取用户信息
/// </summary>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment