Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
easy-affair-show
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
easy-affair-show
Commits
f2d5dbe5
Commit
f2d5dbe5
authored
Apr 20, 2023
by
廖旭伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
用户、作品统计接口
parent
75a53265
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
112 additions
and
3 deletions
+112
-3
eas-manager/src/main/java/com/mortals/xhx/module/customer/dao/CustomerDao.java
...java/com/mortals/xhx/module/customer/dao/CustomerDao.java
+9
-0
eas-manager/src/main/java/com/mortals/xhx/module/customer/dao/ibatis/CustomerDaoImpl.java
...rtals/xhx/module/customer/dao/ibatis/CustomerDaoImpl.java
+12
-0
eas-manager/src/main/java/com/mortals/xhx/module/customer/model/vo/CustomerCensusVo.java
...ortals/xhx/module/customer/model/vo/CustomerCensusVo.java
+16
-0
eas-manager/src/main/java/com/mortals/xhx/module/customer/model/vo/CustomerDesignCensusVo.java
.../xhx/module/customer/model/vo/CustomerDesignCensusVo.java
+14
-0
eas-manager/src/main/java/com/mortals/xhx/module/customer/service/CustomerService.java
.../mortals/xhx/module/customer/service/CustomerService.java
+8
-0
eas-manager/src/main/java/com/mortals/xhx/module/customer/service/impl/CustomerServiceImpl.java
...xhx/module/customer/service/impl/CustomerServiceImpl.java
+26
-3
eas-manager/src/main/java/com/mortals/xhx/module/customer/web/CustomerController.java
...m/mortals/xhx/module/customer/web/CustomerController.java
+8
-0
eas-manager/src/main/resources/sqlmap/module/customer/CustomerMapperExt.xml
...in/resources/sqlmap/module/customer/CustomerMapperExt.xml
+19
-0
No files found.
eas-manager/src/main/java/com/mortals/xhx/module/customer/dao/CustomerDao.java
View file @
f2d5dbe5
...
...
@@ -5,6 +5,11 @@ import com.mortals.framework.model.PageInfo;
import
com.mortals.framework.model.Result
;
import
com.mortals.xhx.module.customer.model.CustomerEntity
;
import
com.mortals.xhx.module.customer.model.CustomerEntityExt
;
import
com.mortals.xhx.module.customer.model.vo.CustomerCensusVo
;
import
com.mortals.xhx.module.customer.model.vo.CustomerDesignCensusVo
;
import
java.util.List
;
/**
* 客户管理Dao
* 客户管理 DAO接口
...
...
@@ -15,4 +20,8 @@ import com.mortals.xhx.module.customer.model.CustomerEntityExt;
public
interface
CustomerDao
extends
ICRUDDao
<
CustomerEntity
,
Long
>{
Result
<
CustomerEntityExt
>
getListExt
(
CustomerEntity
params
,
PageInfo
pageInfo
);
List
<
CustomerCensusVo
>
getCensus
();
CustomerDesignCensusVo
getDesignCensus
();
}
eas-manager/src/main/java/com/mortals/xhx/module/customer/dao/ibatis/CustomerDaoImpl.java
View file @
f2d5dbe5
...
...
@@ -5,6 +5,8 @@ import com.mortals.framework.model.PageInfo;
import
com.mortals.framework.model.ParamDto
;
import
com.mortals.framework.model.Result
;
import
com.mortals.xhx.module.customer.model.CustomerEntityExt
;
import
com.mortals.xhx.module.customer.model.vo.CustomerCensusVo
;
import
com.mortals.xhx.module.customer.model.vo.CustomerDesignCensusVo
;
import
org.apache.ibatis.session.RowBounds
;
import
org.springframework.stereotype.Repository
;
import
com.mortals.xhx.module.customer.dao.CustomerDao
;
...
...
@@ -59,4 +61,14 @@ public class CustomerDaoImpl extends BaseCRUDDaoMybatis<CustomerEntity,Long> imp
return
result
;
}
@Override
public
List
<
CustomerCensusVo
>
getCensus
()
{
return
this
.
getSqlSession
().
selectList
(
this
.
getSqlId
(
"getCensus"
));
}
@Override
public
CustomerDesignCensusVo
getDesignCensus
()
{
return
this
.
getSqlSession
().
selectOne
(
this
.
getSqlId
(
"getDesignCensus"
));
}
}
eas-manager/src/main/java/com/mortals/xhx/module/customer/model/vo/CustomerCensusVo.java
0 → 100644
View file @
f2d5dbe5
package
com.mortals.xhx.module.customer.model.vo
;
import
lombok.Data
;
/**
* 用户分类统计
*/
@Data
public
class
CustomerCensusVo
{
/**
* 会员等级,,0:未开启,1:试用客户,2:VIP,3:设计师,默认0
*/
private
Integer
memberLevel
;
/** 统计结果 **/
private
Integer
customerCount
;
}
eas-manager/src/main/java/com/mortals/xhx/module/customer/model/vo/CustomerDesignCensusVo.java
0 → 100644
View file @
f2d5dbe5
package
com.mortals.xhx.module.customer.model.vo
;
import
lombok.Data
;
/**
* 用户作品统计
*/
@Data
public
class
CustomerDesignCensusVo
{
/** 图片数 **/
private
Integer
picturesCount
;
/** 视频数 **/
private
Integer
videosCount
;
}
eas-manager/src/main/java/com/mortals/xhx/module/customer/service/CustomerService.java
View file @
f2d5dbe5
...
...
@@ -8,6 +8,8 @@ import com.mortals.framework.service.ICRUDService;
import
com.mortals.xhx.module.customer.model.CustomerEntity
;
import
com.mortals.xhx.module.customer.model.CustomerEntityExt
;
import
java.util.Map
;
/**
* CustomerService
*
...
...
@@ -57,4 +59,10 @@ public interface CustomerService extends ICRUDService<CustomerEntity,Long>{
* @throws AppException
*/
void
changePasswordByAdmin
(
CustomerEntity
params
,
Context
context
)
throws
AppException
;
/**
* 用户情况统计
* @return
*/
Map
<
String
,
Object
>
getCustomerCensus
();
}
\ No newline at end of file
eas-manager/src/main/java/com/mortals/xhx/module/customer/service/impl/CustomerServiceImpl.java
View file @
f2d5dbe5
...
...
@@ -15,14 +15,14 @@ import com.mortals.xhx.module.customer.dao.CustomerDao;
import
com.mortals.xhx.module.customer.model.CustomerEntity
;
import
com.mortals.xhx.module.customer.model.CustomerEntityExt
;
import
com.mortals.xhx.module.customer.model.CustomerQuery
;
import
com.mortals.xhx.module.customer.model.vo.CustomerCensusVo
;
import
com.mortals.xhx.module.customer.model.vo.CustomerDesignCensusVo
;
import
com.mortals.xhx.module.customer.service.CustomerService
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.*
;
/**
* CustomerService
...
...
@@ -199,4 +199,27 @@ public class CustomerServiceImpl extends AbstractCRUDServiceImpl<CustomerDao, Cu
update
.
setPassword
(
newPwd
);
this
.
update
(
update
,
context
);
}
@Override
public
Map
<
String
,
Object
>
getCustomerCensus
()
{
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
List
<
CustomerCensusVo
>
customerCensusVos
=
dao
.
getCensus
();
CustomerDesignCensusVo
designCensusVo
=
dao
.
getDesignCensus
();
if
(
CollectionUtils
.
isNotEmpty
(
customerCensusVos
)){
for
(
CustomerCensusVo
item:
customerCensusVos
){
if
(
item
.
getMemberLevel
()==
1
){
result
.
put
(
"trial"
,
item
.
getCustomerCount
());
}
if
(
item
.
getMemberLevel
()==
2
){
result
.
put
(
"vip"
,
item
.
getCustomerCount
());
}
if
(
item
.
getMemberLevel
()==
3
){
result
.
put
(
"designer"
,
item
.
getCustomerCount
());
}
}
}
result
.
put
(
"picturesCount"
,
designCensusVo
.
getPicturesCount
());
result
.
put
(
"videosCount"
,
designCensusVo
.
getVideosCount
());
return
result
;
}
}
\ No newline at end of file
eas-manager/src/main/java/com/mortals/xhx/module/customer/web/CustomerController.java
View file @
f2d5dbe5
package
com.mortals.xhx.module.customer.web
;
import
com.alibaba.fastjson.JSONObject
;
import
com.mortals.framework.annotation.UnAuth
;
import
com.mortals.framework.common.IBaseEnum
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.exception.AppException
;
...
...
@@ -53,6 +54,7 @@ public class CustomerController extends BaseCRUDJsonBodyMappingController<Custom
}
@Override
@UnAuth
public
Rest
<
Object
>
list
(
@RequestBody
(
required
=
false
)
CustomerEntity
query
)
{
Map
<
String
,
Object
>
model
=
new
HashMap
();
Rest
<
Object
>
ret
=
new
Rest
();
...
...
@@ -64,8 +66,14 @@ public class CustomerController extends BaseCRUDJsonBodyMappingController<Custom
PageInfo
pageInfo
=
this
.
buildPageInfo
(
query
);
this
.
doListBefore
(
query
,
model
,
context
);
Result
result
=
this
.
getService
().
findExt
(
query
,
pageInfo
,
context
);
Map
<
String
,
Object
>
census
=
service
.
getCustomerCensus
();
model
.
put
(
"data"
,
result
.
getList
());
model
.
put
(
"pageInfo"
,
result
.
getPageInfo
());
model
.
put
(
"trial"
,
census
.
get
(
"trial"
));
model
.
put
(
"vip"
,
census
.
get
(
"vip"
));
model
.
put
(
"designer"
,
census
.
get
(
"designer"
));
model
.
put
(
"picturesCount"
,
census
.
get
(
"picturesCount"
));
model
.
put
(
"videosCount"
,
census
.
get
(
"videosCount"
));
this
.
parsePageInfo
(
model
,
result
.
getPageInfo
());
code
=
this
.
doListAfter
(
query
,
model
,
context
);
this
.
recordSysLog
(
this
.
request
,
busiDesc
+
" 【成功】"
);
...
...
eas-manager/src/main/resources/sqlmap/module/customer/CustomerMapperExt.xml
View file @
f2d5dbe5
...
...
@@ -67,4 +67,23 @@
</trim>
</select>
<!-- 用户统计 -->
<select
id=
"getCensus"
parameterType=
"paramDto"
resultType=
"com.mortals.xhx.module.customer.model.vo.CustomerCensusVo"
>
SELECT
memberLevel,
count(id) AS customerCount
FROM
mortals_xhx_customer t
GROUP BY
t.memberLevel
</select>
<!-- 用户统计 -->
<select
id=
"getDesignCensus"
parameterType=
"paramDto"
resultType=
"com.mortals.xhx.module.customer.model.vo.CustomerDesignCensusVo"
>
SELECT
sum(customerDesignPictures) AS picturesCount,
sum(customerDesignVideos) AS videosCount
FROM
mortals_xhx_customer_work_design_stat
</select>
</mapper>
\ No newline at end of file
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