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
a393bc9e
Commit
a393bc9e
authored
May 04, 2023
by
廖旭伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
用户导出功能
parent
f2d5dbe5
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
80 additions
and
8 deletions
+80
-8
eas-manager/src/main/java/com/mortals/xhx/module/customer/model/CustomerEntity.java
...com/mortals/xhx/module/customer/model/CustomerEntity.java
+18
-0
eas-manager/src/main/java/com/mortals/xhx/module/customer/model/CustomerEntityExt.java
.../mortals/xhx/module/customer/model/CustomerEntityExt.java
+2
-8
eas-manager/src/main/java/com/mortals/xhx/module/customer/model/vo/CustomerVo.java
.../com/mortals/xhx/module/customer/model/vo/CustomerVo.java
+25
-0
eas-manager/src/main/java/com/mortals/xhx/module/customer/web/CustomerController.java
...m/mortals/xhx/module/customer/web/CustomerController.java
+30
-0
eas-manager/src/main/resources/application.yml
eas-manager/src/main/resources/application.yml
+5
-0
No files found.
eas-manager/src/main/java/com/mortals/xhx/module/customer/model/CustomerEntity.java
View file @
a393bc9e
...
...
@@ -3,10 +3,16 @@ package com.mortals.xhx.module.customer.model;
import
java.util.Date
;
import
java.util.List
;
import
java.util.ArrayList
;
import
com.alibaba.fastjson.annotation.JSONField
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.mortals.framework.annotation.Excel
;
import
com.mortals.framework.model.BaseEntityLong
;
import
com.mortals.framework.service.IUser
;
import
com.mortals.framework.util.DataUtil
;
import
com.mortals.framework.util.DateUtils
;
import
com.mortals.xhx.common.code.CustomerSatusEnum
;
import
com.mortals.xhx.common.code.MemberLevelEnum
;
import
com.mortals.xhx.common.key.Constant
;
import
com.mortals.xhx.module.customer.model.vo.CustomerVo
;
/**
...
...
@@ -34,14 +40,17 @@ public class CustomerEntity extends CustomerVo implements IUser {
/**
* 客户真实名称
*/
@Excel
(
name
=
"真实名称姓名"
)
private
String
custName
;
/**
* 单位名称
*/
@Excel
(
name
=
"单位名称"
)
private
String
organization
;
/**
* 联系电话
*/
@Excel
(
name
=
"联系电话"
)
private
String
contactTelphone
;
/**
* 企业顾问
...
...
@@ -128,6 +137,9 @@ public class CustomerEntity extends CustomerVo implements IUser {
*/
public
void
setMemberLevel
(
Integer
memberLevel
){
this
.
memberLevel
=
memberLevel
;
if
(
memberLevel
!=
null
&&
MemberLevelEnum
.
getByValue
(
memberLevel
)!=
null
)
{
this
.
setLevelName
(
MemberLevelEnum
.
getByValue
(
memberLevel
).
getDesc
());
}
}
/**
* 获取 客户真实名称
...
...
@@ -282,6 +294,9 @@ public class CustomerEntity extends CustomerVo implements IUser {
*/
public
void
setStatus
(
Integer
status
){
this
.
status
=
status
;
if
(
status
!=
null
&&
CustomerSatusEnum
.
getByValue
(
status
)!=
null
)
{
this
.
setStatusName
(
CustomerSatusEnum
.
getByValue
(
status
).
getDesc
());
}
}
/**
* 获取 最后一次登录时间
...
...
@@ -296,6 +311,9 @@ public class CustomerEntity extends CustomerVo implements IUser {
*/
public
void
setLastLoginTime
(
Date
lastLoginTime
){
this
.
lastLoginTime
=
lastLoginTime
;
if
(
lastLoginTime
!=
null
)
{
this
.
setLastLoginTimeStr
(
DateUtils
.
getDateTimeStr
(
lastLoginTime
,
"yyyy-MM-dd HH:mm:ss"
));
}
}
/**
* 获取 最后一次登录地址
...
...
eas-manager/src/main/java/com/mortals/xhx/module/customer/model/CustomerEntityExt.java
View file @
a393bc9e
package
com.mortals.xhx.module.customer.model
;
import
com.mortals.framework.annotation.Excel
;
import
lombok.Data
;
@Data
public
class
CustomerEntityExt
extends
CustomerEntity
{
/**
* 客户设计图片数量
*/
private
Integer
customerDesignPictures
;
/**
* 客户设计视频数量
*/
private
Integer
customerDesignVideos
;
private
String
createTimeStr
;
...
...
eas-manager/src/main/java/com/mortals/xhx/module/customer/model/vo/CustomerVo.java
View file @
a393bc9e
package
com.mortals.xhx.module.customer.model.vo
;
import
com.alibaba.fastjson.annotation.JSONField
;
import
com.mortals.framework.annotation.Excel
;
import
com.mortals.framework.model.BaseEntityLong
;
import
com.mortals.xhx.module.customer.model.CustomerEntity
;
import
lombok.Data
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
/**
* 客户管理视图对象
...
...
@@ -38,4 +40,27 @@ public class CustomerVo extends BaseEntityLong {
private
String
oldPassword
;
private
String
newPassword
;
/**
* 客户设计图片数量
*/
@Excel
(
name
=
"图片作品数"
)
private
Integer
customerDesignPictures
;
/**
* 客户设计视频数量
*/
@Excel
(
name
=
"视频作品数"
)
private
Integer
customerDesignVideos
;
@Excel
(
name
=
"会员等级"
)
private
String
levelName
;
@Excel
(
name
=
"使用状态"
)
private
String
statusName
;
/**
* 最后一次登录时间
*/
@Excel
(
name
=
"最近登录时间"
)
private
String
lastLoginTimeStr
;
}
\ No newline at end of file
eas-manager/src/main/java/com/mortals/xhx/module/customer/web/CustomerController.java
View file @
a393bc9e
...
...
@@ -10,6 +10,8 @@ import com.mortals.framework.model.PageInfo;
import
com.mortals.framework.model.Result
;
import
com.mortals.framework.service.IUser
;
import
com.mortals.framework.util.StringUtils
;
import
com.mortals.framework.utils.ReflectUtils
;
import
com.mortals.framework.utils.poi.ExcelUtil
;
import
com.mortals.framework.web.BaseCRUDJsonBodyMappingController
;
import
com.mortals.xhx.common.code.CustomerSatusEnum
;
import
com.mortals.xhx.common.code.CustomerSrcEnum
;
...
...
@@ -17,6 +19,7 @@ import com.mortals.xhx.common.code.MemberLevelEnum;
import
com.mortals.xhx.common.code.SexEnum
;
import
com.mortals.xhx.common.key.Constant
;
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.service.CustomerService
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -308,4 +311,31 @@ public class CustomerController extends BaseCRUDJsonBodyMappingController<Custom
return
ret
.
toJSONString
();
}
@Override
@UnAuth
public
void
exportExcel
(
@RequestBody
CustomerEntity
query
)
{
Context
context
=
this
.
getContext
();
String
busiDesc
=
"导出"
+
this
.
getModuleDesc
();
try
{
this
.
doExportBefore
(
context
,
query
);
String
name
=
StringUtils
.
trim
(
this
.
moduleDesc
);
if
(
StringUtils
.
isEmpty
(
name
))
{
name
=
System
.
currentTimeMillis
()
+
""
;
}
String
fileName
=
name
+
".xlsx"
;
PageInfo
pageInfo
=
new
PageInfo
(-
1
);
List
<
CustomerEntityExt
>
list
=
this
.
service
.
findExt
(
query
,
pageInfo
,
this
.
getContext
()).
getList
();
Class
<
CustomerEntityExt
>
tClass
=
ReflectUtils
.
getClassGenricType
(
this
.
getClass
(),
1
);
ExcelUtil
<
CustomerEntityExt
,
Long
>
util
=
new
ExcelUtil
(
tClass
);
byte
[]
data
=
util
.
exportExcel
(
list
,
name
);
this
.
responseStream
(
this
.
response
,
data
,
fileName
);
this
.
recordSysLog
(
this
.
request
,
busiDesc
+
" 【成功】"
);
}
catch
(
Exception
var11
)
{
this
.
doException
(
this
.
request
,
"导出异常"
,
new
HashMap
(),
var11
);
}
}
}
\ No newline at end of file
eas-manager/src/main/resources/application.yml
View file @
a393bc9e
spring
:
main
:
allow-bean-definition-overriding
:
true
application
:
log
:
level
:
@
profiles.log.level@
path
:
@
profiles.log.path@
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