Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Education
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
黄奎
Education
Commits
99a145d4
Commit
99a145d4
authored
Dec 03, 2021
by
罗超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增自定义查询保存
parent
9d100207
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
261 additions
and
32 deletions
+261
-32
Edu.Aop.csproj.nuget.g.targets
Edu.Aop/obj/Edu.Aop.csproj.nuget.g.targets
+1
-5
Edu.Cache.csproj.nuget.g.targets
Edu.Cache/obj/Edu.Cache.csproj.nuget.g.targets
+1
-5
Edu.Common.csproj.nuget.g.targets
Edu.Common/obj/Edu.Common.csproj.nuget.g.targets
+1
-5
RB_CustomQuery.cs
Edu.Model/Entity/WeChat/RB_CustomQuery.cs
+41
-0
Edu.Model.csproj.nuget.g.targets
Edu.Model/obj/Edu.Model.csproj.nuget.g.targets
+1
-5
QYCustomerModule.cs
Edu.Module.QYWeChat/QYCustomerModule.cs
+100
-0
Edu.Module.User.csproj.nuget.g.targets
Edu.Module.User/obj/Edu.Module.User.csproj.nuget.g.targets
+1
-5
RB_CustomQueryRepository.cs
Edu.Repository/WeChat/RB_CustomQueryRepository.cs
+30
-0
RB_WeChat_CustomerInfoRepository.cs
Edu.Repository/WeChat/RB_WeChat_CustomerInfoRepository.cs
+2
-2
Edu.Repository.csproj.nuget.g.targets
Edu.Repository/obj/Edu.Repository.csproj.nuget.g.targets
+1
-5
QYCustomerController.cs
Edu.WebApi/Controllers/QYWeChat/QYCustomerController.cs
+82
-0
No files found.
Edu.Aop/obj/Edu.Aop.csproj.nuget.g.targets
View file @
99a145d4
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project
ToolsVersion=
"14.0"
xmlns=
"http://schemas.microsoft.com/developer/msbuild/2003"
>
<Project
ToolsVersion=
"14.0"
xmlns=
"http://schemas.microsoft.com/developer/msbuild/2003"
/>
<PropertyGroup>
\ No newline at end of file
<MSBuildAllProjects>
$(MSBuildAllProjects);$(MSBuildThisFileFullPath)
</MSBuildAllProjects>
</PropertyGroup>
</Project>
\ No newline at end of file
Edu.Cache/obj/Edu.Cache.csproj.nuget.g.targets
View file @
99a145d4
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project
ToolsVersion=
"14.0"
xmlns=
"http://schemas.microsoft.com/developer/msbuild/2003"
>
<Project
ToolsVersion=
"14.0"
xmlns=
"http://schemas.microsoft.com/developer/msbuild/2003"
/>
<PropertyGroup>
\ No newline at end of file
<MSBuildAllProjects>
$(MSBuildAllProjects);$(MSBuildThisFileFullPath)
</MSBuildAllProjects>
</PropertyGroup>
</Project>
\ No newline at end of file
Edu.Common/obj/Edu.Common.csproj.nuget.g.targets
View file @
99a145d4
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project
ToolsVersion=
"14.0"
xmlns=
"http://schemas.microsoft.com/developer/msbuild/2003"
>
<Project
ToolsVersion=
"14.0"
xmlns=
"http://schemas.microsoft.com/developer/msbuild/2003"
/>
<PropertyGroup>
\ No newline at end of file
<MSBuildAllProjects>
$(MSBuildAllProjects);$(MSBuildThisFileFullPath)
</MSBuildAllProjects>
</PropertyGroup>
</Project>
\ No newline at end of file
Edu.Model/Entity/WeChat/RB_CustomQuery.cs
0 → 100644
View file @
99a145d4
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
VT.FW.DB
;
namespace
Edu.Model.Entity.WeChat
{
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_CustomQuery
{
public
int
Id
{
get
;
set
;
}
/// <summary>
/// 页面编号
/// </summary>
public
String
Code
{
get
;
set
;
}
/// <summary>
/// 查询名称
/// </summary>
public
String
Name
{
get
;
set
;
}
/// <summary>
/// 链接方式 AND | OR
/// </summary>
public
int
AddCondition
{
get
;
set
;
}
/// <summary>
/// 自定义信息
/// </summary>
public
string
SelectList
{
get
;
set
;
}
/// <summary>
/// 创建人
/// </summary>
public
int
CreateBy
{
get
;
set
;
}
}
}
Edu.Model/obj/Edu.Model.csproj.nuget.g.targets
View file @
99a145d4
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project
ToolsVersion=
"14.0"
xmlns=
"http://schemas.microsoft.com/developer/msbuild/2003"
>
<Project
ToolsVersion=
"14.0"
xmlns=
"http://schemas.microsoft.com/developer/msbuild/2003"
/>
<PropertyGroup>
\ No newline at end of file
<MSBuildAllProjects>
$(MSBuildAllProjects);$(MSBuildThisFileFullPath)
</MSBuildAllProjects>
</PropertyGroup>
</Project>
\ No newline at end of file
Edu.Module.QYWeChat/QYCustomerModule.cs
View file @
99a145d4
...
@@ -10,6 +10,7 @@ using Edu.Common.API;
...
@@ -10,6 +10,7 @@ using Edu.Common.API;
using
Edu.Common.Enum.Finance
;
using
Edu.Common.Enum.Finance
;
using
Edu.Common.Plugin
;
using
Edu.Common.Plugin
;
using
Edu.Model.CacheModel
;
using
Edu.Model.CacheModel
;
using
Edu.Model.Entity.WeChat
;
using
Edu.Model.Public
;
using
Edu.Model.Public
;
using
Edu.Model.ViewModel.User
;
using
Edu.Model.ViewModel.User
;
using
Edu.Model.ViewModel.WeChat
;
using
Edu.Model.ViewModel.WeChat
;
...
@@ -77,6 +78,11 @@ namespace Edu.Module.QYWeChat
...
@@ -77,6 +78,11 @@ namespace Edu.Module.QYWeChat
/// </summary>
/// </summary>
private
RB_AccountRepository
accountRepository
=
new
RB_AccountRepository
();
private
RB_AccountRepository
accountRepository
=
new
RB_AccountRepository
();
/// <summary>
/// 自定义查询
/// </summary>
private
RB_CustomQueryRepository
customQueryRepository
=
new
RB_CustomQueryRepository
();
#
region
客户字段
#
region
客户字段
/// <summary>
/// <summary>
/// 获取客户字段列表
/// 获取客户字段列表
...
@@ -4015,6 +4021,100 @@ namespace Edu.Module.QYWeChat
...
@@ -4015,6 +4021,100 @@ namespace Edu.Module.QYWeChat
}
}
#
endregion
#
endregion
#
region
自定义查询
/// <summary>
/// 保存查询条件
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public
bool
SaveCustomQuery
(
RB_CustomQuery
model
)
{
if
(
model
.
Id
==
0
)
{
return
customQueryRepository
.
Insert
(
model
)
>
0
;
}
else
{
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_CustomQuery
.
Name
),
model
.
Name
},
{
nameof
(
RB_CustomQuery
.
SelectList
),
model
.
SelectList
},
{
nameof
(
RB_CustomQuery
.
AddCondition
),
model
.
AddCondition
}
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_CustomQuery
.
Id
),
FiledValue
=
model
.
Id
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
return
customQueryRepository
.
Update
(
keyValues
,
wheres
);
}
}
/// <summary>
/// 物理删除指定的查询条件
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public
bool
DeleteCustomQuery
(
int
id
,
int
uid
)
{
List
<
WhereHelper
>
whereHelpers
=
new
List
<
WhereHelper
>();
whereHelpers
.
Add
(
new
WhereHelper
()
{
FiledName
=
nameof
(
RB_CustomQuery
.
Id
),
FiledValue
=
id
,
OperatorEnum
=
OperatorEnum
.
Equal
});
whereHelpers
.
Add
(
new
WhereHelper
()
{
FiledName
=
nameof
(
RB_CustomQuery
.
CreateBy
),
FiledValue
=
uid
,
OperatorEnum
=
OperatorEnum
.
Equal
});
return
customQueryRepository
.
Delete
(
whereHelpers
);
}
/// <summary>
/// 查询用户所有的自定义查询信息
/// </summary>
/// <param name="uid"></param>
/// <param name="code"></param>
/// <returns></returns>
public
object
GetUserCustomQuery
(
int
uid
,
string
code
)
{
var
list
=
customQueryRepository
.
GetUserCustomQuery
(
uid
,
code
);
object
result
=
null
;
if
(
list
!=
null
&&
list
.
Count
>
0
)
{
result
=
list
.
Select
(
x
=>
new
{
x
.
Id
,
x
.
Name
}).
ToList
();
}
return
result
;
}
/// <summary>
/// 查询指定ID的查询条件
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public
RB_CustomQuery
GetCustomQueryById
(
int
id
,
int
uid
)
{
var
model
=
customQueryRepository
.
GetEntity
(
id
);
RB_CustomQuery
result
=
null
;
if
(
model
!=
null
&&
model
.
Id
==
id
&&
model
.
CreateBy
==
uid
)
{
result
=
model
;
}
return
result
;
}
#
endregion
}
}
}
}
Edu.Module.User/obj/Edu.Module.User.csproj.nuget.g.targets
View file @
99a145d4
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project
ToolsVersion=
"14.0"
xmlns=
"http://schemas.microsoft.com/developer/msbuild/2003"
>
<Project
ToolsVersion=
"14.0"
xmlns=
"http://schemas.microsoft.com/developer/msbuild/2003"
/>
<PropertyGroup>
\ No newline at end of file
<MSBuildAllProjects>
$(MSBuildAllProjects);$(MSBuildThisFileFullPath)
</MSBuildAllProjects>
</PropertyGroup>
</Project>
\ No newline at end of file
Edu.Repository/WeChat/RB_CustomQueryRepository.cs
0 → 100644
View file @
99a145d4
using
Edu.Model.Entity.WeChat
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
VT.FW.DB.Dapper
;
namespace
Edu.Repository.WeChat
{
public
class
RB_CustomQueryRepository
:
BaseRepository
<
RB_CustomQuery
>
{
/// <summary>
/// 查询指定用户的自定义内容
/// </summary>
/// <param name="uid"></param>
/// <param name="code"></param>
/// <returns></returns>
public
List
<
RB_CustomQuery
>
GetUserCustomQuery
(
int
uid
,
string
code
)
{
string
sql
=
$"select Id,Name from RB_CustomQuery where CreateBy=@uid and Code=@code"
;
DynamicParameters
parameters
=
new
DynamicParameters
();
parameters
.
Add
(
"uid"
,
uid
);
parameters
.
Add
(
"code"
,
code
);
return
Get
<
RB_CustomQuery
>(
sql
,
parameters
).
ToList
();
}
}
}
Edu.Repository/WeChat/RB_WeChat_CustomerInfoRepository.cs
View file @
99a145d4
...
@@ -296,12 +296,12 @@ namespace Edu.Repository.WeChat
...
@@ -296,12 +296,12 @@ namespace Edu.Repository.WeChat
where
+=
")"
;
where
+=
")"
;
break
;
break
;
case
3
:
//日期
case
3
:
//日期
List
<
string
>
vList
=
Newtonsoft
.
Json
.
JsonConvert
.
DeserializeObject
<
List
<
string
>>(
item
.
StartValue
);
List
<
string
>
vList
=
item
.
StartValue
.
Split
(
','
,
StringSplitOptions
.
RemoveEmptyEntries
).
ToList
(
);
string
vstr
=
"'"
+
string
.
Join
(
"','"
,
vList
)
+
"'"
;
string
vstr
=
"'"
+
string
.
Join
(
"','"
,
vList
)
+
"'"
;
if
(
item
.
IsCustom
==
1
)
if
(
item
.
IsCustom
==
1
)
{
{
//where += $@" DATE_FORMAT(r.CustomContent -> '$.{item.Name}','%m月%d号') in({vstr}) ";
//where += $@" DATE_FORMAT(r.CustomContent -> '$.{item.Name}','%m月%d号') in({vstr}) ";
where
+=
" date_format(REPLACE( r.CustomContent -> '$."
+
item
.
Name
+
"
', '\"', ''), '%m月%d号') in({vstr}) "
;
where
+=
$" date_format(REPLACE( r.CustomContent -> '$.
{
item
.
Name
}
', '\"', ''), '%m月%d号') in(
{
vstr
}
) "
;
}
}
else
else
{
{
...
...
Edu.Repository/obj/Edu.Repository.csproj.nuget.g.targets
View file @
99a145d4
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project
ToolsVersion=
"14.0"
xmlns=
"http://schemas.microsoft.com/developer/msbuild/2003"
>
<Project
ToolsVersion=
"14.0"
xmlns=
"http://schemas.microsoft.com/developer/msbuild/2003"
/>
<PropertyGroup>
\ No newline at end of file
<MSBuildAllProjects>
$(MSBuildAllProjects);$(MSBuildThisFileFullPath)
</MSBuildAllProjects>
</PropertyGroup>
</Project>
\ No newline at end of file
Edu.WebApi/Controllers/QYWeChat/QYCustomerController.cs
View file @
99a145d4
...
@@ -8,6 +8,7 @@ using Edu.Common.API;
...
@@ -8,6 +8,7 @@ using Edu.Common.API;
using
Edu.Common.Enum.Finance
;
using
Edu.Common.Enum.Finance
;
using
Edu.Common.Enum.WeChat
;
using
Edu.Common.Enum.WeChat
;
using
Edu.Common.Plugin
;
using
Edu.Common.Plugin
;
using
Edu.Model.Entity.WeChat
;
using
Edu.Model.ViewModel.WeChat
;
using
Edu.Model.ViewModel.WeChat
;
using
Edu.Module.QYWeChat
;
using
Edu.Module.QYWeChat
;
using
Edu.Module.User
;
using
Edu.Module.User
;
...
@@ -34,6 +35,7 @@ namespace Edu.WebApi.Controllers.QYWeChat
...
@@ -34,6 +35,7 @@ namespace Edu.WebApi.Controllers.QYWeChat
/// </summary>
/// </summary>
private
readonly
QYCustomerModule
customerModule
=
new
QYCustomerModule
();
private
readonly
QYCustomerModule
customerModule
=
new
QYCustomerModule
();
#
region
客户字段
#
region
客户字段
/// <summary>
/// <summary>
...
@@ -1776,5 +1778,85 @@ namespace Edu.WebApi.Controllers.QYWeChat
...
@@ -1776,5 +1778,85 @@ namespace Edu.WebApi.Controllers.QYWeChat
return
ApiResult
.
Success
(
""
,
pmodel
);
return
ApiResult
.
Success
(
""
,
pmodel
);
}
}
#
endregion
#
endregion
#
region
自定义查询
[
HttpPost
]
public
ApiResult
SaveCustomQuery
()
{
RB_CustomQuery
model
=
JsonHelper
.
DeserializeObject
<
RB_CustomQuery
>(
base
.
RequestParm
.
Msg
.
ToString
());
if
(
model
!=
null
)
{
if
(
string
.
IsNullOrEmpty
(
model
.
Name
)
||
string
.
IsNullOrEmpty
(
model
.
SelectList
)
||
string
.
IsNullOrEmpty
(
model
.
Code
)
||
model
.
AddCondition
==
0
)
{
return
ApiResult
.
Failed
(
"参数信息不完整"
);
}
else
{
model
.
CreateBy
=
base
.
UserInfo
.
AccountId
;
if
(
customerModule
.
SaveCustomQuery
(
model
))
{
return
ApiResult
.
Success
(
"保存成功"
);
}
else
{
return
ApiResult
.
Failed
(
"保存失败,请联系技术管理员"
);
}
}
}
else
{
return
ApiResult
.
Failed
(
"未获取到有效参数信息,请重新发起保存或刷新页面"
);
}
}
[
HttpPost
]
public
ApiResult
DeleteCustomQuery
()
{
int
uid
=
base
.
UserInfo
.
AccountId
;
var
parms
=
JObject
.
Parse
(
base
.
RequestParm
.
Msg
.
ToString
());
int
id
=
parms
.
GetInt
(
"id"
,
0
);
if
(
id
!=
0
&&
customerModule
.
DeleteCustomQuery
(
id
,
uid
))
{
return
ApiResult
.
Success
(
"删除成功"
);
}
else
{
return
ApiResult
.
Failed
(
"删除失败"
);
}
}
[
HttpPost
]
public
ApiResult
GetUserCustomQuery
()
{
int
uid
=
base
.
UserInfo
.
AccountId
;
var
parms
=
JObject
.
Parse
(
base
.
RequestParm
.
Msg
.
ToString
());
var
code
=
parms
.
GetStringValue
(
"code"
);
if
(!
string
.
IsNullOrEmpty
(
code
))
{
var
data
=
customerModule
.
GetUserCustomQuery
(
uid
,
code
);
return
ApiResult
.
Success
(
message
:
"查询成功"
,
data
:
data
);
}
return
ApiResult
.
Failed
(
"缺失必要的参数"
);
}
[
HttpPost
]
public
ApiResult
GetCustomQueryById
()
{
int
uid
=
base
.
UserInfo
.
AccountId
;
var
parms
=
JObject
.
Parse
(
base
.
RequestParm
.
Msg
.
ToString
());
var
id
=
parms
.
GetInt
(
"id"
,
0
);
if
(
id
!=
0
)
{
var
data
=
customerModule
.
GetCustomQueryById
(
id
,
uid
);
return
ApiResult
.
Success
(
message
:
"查询成功"
,
data
:
data
);
}
return
ApiResult
.
Failed
(
"缺失必要的参数"
);
}
#
endregion
}
}
}
}
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