Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
site-project
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hqzhdj
site-project
Commits
69ccf164
Commit
69ccf164
authored
Jan 09, 2025
by
阳浪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
信箱收集功能
parent
e7da5a36
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
476 additions
and
11 deletions
+476
-11
cloud-site-api/src/main/java/com/yizhi/site/application/feign/api/SystemMailboxClients.java
+32
-0
cloud-site-api/src/main/java/com/yizhi/site/application/vo/domain/SystemMailboxConditionVo.java
+36
-0
cloud-site-api/src/main/java/com/yizhi/site/application/vo/domain/SystemMailboxVo.java
+89
-0
cloud-site-service/src/main/java/com/yizhi/site/application/controller/api/SystemMailboxController.java
+43
-0
cloud-site-service/src/main/java/com/yizhi/site/application/domain/SystemMailbox.java
+122
-0
cloud-site-service/src/main/java/com/yizhi/site/application/mapper/SystemMailboxMapper.java
+13
-0
cloud-site-service/src/main/java/com/yizhi/site/application/service/SystemMailboxService.java
+24
-0
cloud-site-service/src/main/java/com/yizhi/site/application/service/impl/PublicationServiceImpl.java
+9
-11
cloud-site-service/src/main/java/com/yizhi/site/application/service/impl/SystemMailboxServiceImpl.java
+103
-0
cloud-site-service/src/main/resources/mapper/SystemMailboxMapper.xml
+5
-0
No files found.
cloud-site-api/src/main/java/com/yizhi/site/application/feign/api/SystemMailboxClients.java
0 → 100644
View file @
69ccf164
package
com
.
yizhi
.
site
.
application
.
feign
.
api
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
com.yizhi.site.application.vo.domain.SystemMailboxConditionVo
;
import
com.yizhi.site.application.vo.domain.SystemMailboxVo
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestParam
;
/**
* com.yizhi.site.application.feign.api
*
* @author yanglang
* @create 2025-01-09 14:27:21
*/
@FeignClient
(
name
=
"portal"
,
contextId
=
"SystemMailboxClients"
)
public
interface
SystemMailboxClients
{
@PostMapping
(
"/systemMailbox/selectPage"
)
Page
<
SystemMailboxVo
>
selectPage
(
@RequestBody
SystemMailboxConditionVo
conditionVo
);
@PostMapping
(
"/systemMailbox/save"
)
Long
save
(
@RequestBody
SystemMailboxVo
systemMailBoxVo
);
@GetMapping
(
"/systemMailbox/getById"
)
SystemMailboxVo
getById
(
@RequestParam
(
"id"
)
Long
id
);
@GetMapping
(
"/systemMailbox/removeById"
)
Boolean
removeById
(
@RequestParam
(
"id"
)
Long
id
);
}
cloud-site-api/src/main/java/com/yizhi/site/application/vo/domain/SystemMailboxConditionVo.java
0 → 100644
View file @
69ccf164
package
com
.
yizhi
.
site
.
application
.
vo
.
domain
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* com.yizhi.site.application.vo.domain
*
* @author yanglang
* @create 2025-01-09 14:01:44
*/
@Data
public
class
SystemMailboxConditionVo
{
@ApiModelProperty
(
value
=
"要跳转的页数"
)
private
Integer
pageNo
;
@ApiModelProperty
(
value
=
"每页显示的条数"
)
private
Integer
pageSize
;
@ApiModelProperty
(
value
=
"信箱标题"
)
private
String
fileName
;
private
Integer
anonymousFlag
;
private
String
targetFrom
;
@ApiModelProperty
(
value
=
"信箱类型 1: 纪检 2: 书记"
)
private
Integer
type
;
@ApiModelProperty
(
value
=
"联系人名称"
)
private
String
contactName
;
@ApiModelProperty
(
value
=
"联系人手机号/邮箱"
)
private
String
contactNumber
;
}
cloud-site-api/src/main/java/com/yizhi/site/application/vo/domain/SystemMailboxVo.java
0 → 100644
View file @
69ccf164
package
com
.
yizhi
.
site
.
application
.
vo
.
domain
;
import
com.baomidou.mybatisplus.annotations.TableField
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* com.yizhi.site.application.vo.domain
*
* @author yanglang
* @create 2025-01-09 13:52:53
*/
@Data
public
class
SystemMailboxVo
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"主鍵"
)
private
Long
id
;
@ApiModelProperty
(
value
=
"信箱标题"
)
private
String
fileName
;
@ApiModelProperty
(
value
=
"信箱类型 1: 纪检 2: 书记"
)
private
Integer
type
;
@ApiModelProperty
(
value
=
"联系人名称"
)
private
String
contactName
;
@ApiModelProperty
(
value
=
"联系人手机号/邮箱"
)
private
String
contactNumber
;
@ApiModelProperty
(
value
=
"提交时间"
)
private
Date
submitTime
;
@ApiModelProperty
(
value
=
"内容"
)
private
String
content
;
private
Integer
anonymousFlag
;
private
String
targetFrom
;
@ApiModelProperty
(
value
=
"备注"
)
private
String
remark
;
@ApiModelProperty
(
value
=
"审核时间"
)
private
Date
approveTime
;
@ApiModelProperty
(
value
=
"审批人"
)
private
Long
approveById
;
@ApiModelProperty
(
value
=
"状态 0 删除 1 草稿 2 待审核 3 待发布 4 已发布 5 不通过"
)
private
Integer
state
;
@ApiModelProperty
(
value
=
"站点ID"
)
private
Long
siteId
;
@ApiModelProperty
(
value
=
"创建时间"
)
private
Date
createTime
;
@ApiModelProperty
(
value
=
"创建人"
)
private
Long
createById
;
@ApiModelProperty
(
value
=
"创建人姓名"
)
private
String
createByName
;
@ApiModelProperty
(
value
=
"修改时间"
)
private
Date
updateTime
;
@ApiModelProperty
(
value
=
"修改人"
)
private
Long
updateById
;
@ApiModelProperty
(
value
=
"修改人姓名"
)
private
String
updateByName
;
@ApiModelProperty
(
value
=
"图片链接地址"
)
private
String
ossPicUrl
;
@ApiModelProperty
(
value
=
"视频链接地址"
)
private
String
ossVideoUrl
;
protected
Serializable
pkVal
()
{
return
this
.
id
;
}
}
cloud-site-service/src/main/java/com/yizhi/site/application/controller/api/SystemMailboxController.java
0 → 100644
View file @
69ccf164
package
com
.
yizhi
.
site
.
application
.
controller
.
api
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
com.yizhi.site.application.domain.SystemMailbox
;
import
com.yizhi.site.application.service.SystemMailboxService
;
import
com.yizhi.site.application.vo.domain.SystemMailboxConditionVo
;
import
com.yizhi.site.application.vo.domain.SystemMailboxVo
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
/**
* com.yizhi.site.application.controller.api
*
* @author yanglang
* @create 2025-01-09 14:24:07
*/
@RestController
@RequestMapping
(
"/systemMailbox"
)
public
class
SystemMailboxController
{
@Autowired
private
SystemMailboxService
systemMailboxService
;
@PostMapping
(
"selectPage"
)
public
Page
<
SystemMailbox
>
selectPage
(
@RequestBody
SystemMailboxConditionVo
conditionVo
){
return
systemMailboxService
.
selectPage
(
conditionVo
);
}
@PostMapping
(
"save"
)
public
Long
save
(
@RequestBody
SystemMailboxVo
systemMailBoxVo
){
return
systemMailboxService
.
save
(
systemMailBoxVo
);
}
@GetMapping
(
"getById"
)
public
SystemMailboxVo
getById
(
@RequestParam
(
"id"
)
Long
id
){
return
systemMailboxService
.
getById
(
id
);
}
@GetMapping
(
"removeById"
)
public
Boolean
removeById
(
@RequestParam
(
"id"
)
Long
id
){
return
systemMailboxService
.
removeById
(
id
);
}
}
cloud-site-service/src/main/java/com/yizhi/site/application/domain/SystemMailbox.java
0 → 100644
View file @
69ccf164
package
com
.
yizhi
.
site
.
application
.
domain
;
import
com.baomidou.mybatisplus.annotations.TableField
;
import
com.baomidou.mybatisplus.annotations.TableLogic
;
import
com.baomidou.mybatisplus.annotations.TableName
;
import
com.yizhi.site.application.vo.domain.InformationClassify
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.Date
;
import
java.util.List
;
/**
* com.yizhi.site.application.domain
*
* @author yanglang
* @create 2024-01-09 13:48:46
*/
@ApiModel
(
value
=
"SystemMailbox"
,
description
=
"信箱"
)
@Data
@TableName
(
"system_mailbox"
)
public
class
SystemMailbox
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"主鍵"
)
private
Long
id
;
@ApiModelProperty
(
value
=
"信箱标题"
)
@TableField
(
"file_name"
)
private
String
fileName
;
@ApiModelProperty
(
value
=
"信箱类型 1: 纪检 2: 书记"
)
@TableField
(
"type"
)
private
Integer
type
;
@ApiModelProperty
(
value
=
"联系人名称"
)
@TableField
(
"contact_name"
)
private
String
contactName
;
@ApiModelProperty
(
value
=
"联系人手机号/邮箱"
)
@TableField
(
"contact_number"
)
private
String
contactNumber
;
@ApiModelProperty
(
value
=
"提交时间"
)
@TableField
(
"submit_time"
)
private
Date
submitTime
;
@ApiModelProperty
(
value
=
"内容"
)
@TableField
(
"content"
)
private
String
content
;
@ApiModelProperty
(
value
=
"备注"
)
@TableField
(
"remark"
)
private
String
remark
;
@ApiModelProperty
(
value
=
"审核时间"
)
@TableField
(
"approve_time"
)
private
Date
approveTime
;
@ApiModelProperty
(
value
=
"审批人"
)
@TableField
(
"approve_by_id"
)
private
Long
approveById
;
@ApiModelProperty
(
value
=
"状态 0 删除 1 草稿 2 待审核 3 待发布 4 已发布 5 不通过"
)
@TableField
(
"state"
)
private
Integer
state
;
@ApiModelProperty
(
value
=
"站点ID"
)
@TableField
(
"site_id"
)
private
Long
siteId
;
@ApiModelProperty
(
value
=
"创建时间"
)
@TableField
(
"create_time"
)
private
Date
createTime
;
@ApiModelProperty
(
value
=
"创建人"
)
@TableField
(
"create_by_id"
)
private
Long
createById
;
@ApiModelProperty
(
value
=
"创建人姓名"
)
@TableField
(
"create_by_name"
)
private
String
createByName
;
@ApiModelProperty
(
value
=
"修改时间"
)
@TableField
(
"update_time"
)
private
Date
updateTime
;
@ApiModelProperty
(
value
=
"修改人"
)
@TableField
(
"update_by_id"
)
private
Long
updateById
;
@ApiModelProperty
(
value
=
"修改人姓名"
)
@TableField
(
"update_by_name"
)
private
String
updateByName
;
@ApiModelProperty
(
value
=
"图片链接地址"
)
@TableField
(
"oss_pic_url"
)
private
String
ossPicUrl
;
@ApiModelProperty
(
value
=
"来信目的"
)
@TableField
(
"target_from"
)
private
String
targetFrom
;
@ApiModelProperty
(
value
=
"是否匿名:0否1是"
)
@TableField
(
"anonymous_flag"
)
private
Integer
anonymousFlag
;
@ApiModelProperty
(
value
=
"视频链接地址"
)
@TableField
(
"oss_video_url"
)
private
String
ossVideoUrl
;
@ApiModelProperty
(
value
=
"1:已删除,0未删除"
)
@TableLogic
private
Integer
deleted
;
protected
Serializable
pkVal
()
{
return
this
.
id
;
}
}
cloud-site-service/src/main/java/com/yizhi/site/application/mapper/SystemMailboxMapper.java
0 → 100644
View file @
69ccf164
package
com
.
yizhi
.
site
.
application
.
mapper
;
import
com.baomidou.mybatisplus.mapper.BaseMapper
;
import
com.yizhi.site.application.domain.SystemMailbox
;
/**
* com.yizhi.site.application.mapper
*
* @author yanglang
* @create 2025-01-09 13:55:24
*/
public
interface
SystemMailboxMapper
extends
BaseMapper
<
SystemMailbox
>
{
}
cloud-site-service/src/main/java/com/yizhi/site/application/service/SystemMailboxService.java
0 → 100644
View file @
69ccf164
package
com
.
yizhi
.
site
.
application
.
service
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
com.baomidou.mybatisplus.service.IService
;
import
com.yizhi.site.application.domain.SystemMailbox
;
import
com.yizhi.site.application.vo.domain.SystemMailboxVo
;
import
com.yizhi.site.application.vo.domain.SystemMailboxConditionVo
;
/**
* com.yizhi.site.application.service
*
* @author yanglang
* @create 2025-01-09 13:57:30
*/
public
interface
SystemMailboxService
extends
IService
<
SystemMailbox
>
{
Page
<
SystemMailbox
>
selectPage
(
SystemMailboxConditionVo
conditionVo
);
Long
save
(
SystemMailboxVo
systemMailBoxVo
);
SystemMailboxVo
getById
(
Long
id
);
Boolean
removeById
(
Long
id
);
}
cloud-site-service/src/main/java/com/yizhi/site/application/service/impl/PublicationServiceImpl.java
View file @
69ccf164
...
@@ -46,8 +46,6 @@ public class PublicationServiceImpl extends ServiceImpl<PublicationMapper, Publi
...
@@ -46,8 +46,6 @@ public class PublicationServiceImpl extends ServiceImpl<PublicationMapper, Publi
@Autowired
@Autowired
private
IdGenerator
idGenerator
;
private
IdGenerator
idGenerator
;
@Autowired
@Autowired
private
PublicationMapper
publicationMapper
;
@Autowired
private
DataClassificationService
dataClassificationService
;
private
DataClassificationService
dataClassificationService
;
@Autowired
@Autowired
private
ProtalPlateService
protalPlateService
;
private
ProtalPlateService
protalPlateService
;
...
@@ -117,7 +115,7 @@ public class PublicationServiceImpl extends ServiceImpl<PublicationMapper, Publi
...
@@ -117,7 +115,7 @@ public class PublicationServiceImpl extends ServiceImpl<PublicationMapper, Publi
}
}
}
}
}
}
list
=
publication
Mapper
.
publicationFirstList
(
vo
,
page
);
//新闻分类列表
list
=
this
.
base
Mapper
.
publicationFirstList
(
vo
,
page
);
//新闻分类列表
if
(
list
.
size
()
>
0
&&
list
!=
null
)
{
if
(
list
.
size
()
>
0
&&
list
!=
null
)
{
for
(
Publication
info
:
list
)
{
for
(
Publication
info
:
list
)
{
if
(
info
.
getTypeOne
()
!=
null
&&
info
.
getTypeOne
()
==
0
){
if
(
info
.
getTypeOne
()
!=
null
&&
info
.
getTypeOne
()
==
0
){
...
@@ -194,7 +192,7 @@ public class PublicationServiceImpl extends ServiceImpl<PublicationMapper, Publi
...
@@ -194,7 +192,7 @@ public class PublicationServiceImpl extends ServiceImpl<PublicationMapper, Publi
public
Page
<
PublicationStudentVO
>
publicationList
(
Long
typeOne
,
Integer
pageNo
,
Integer
pageSize
,
Long
siteId
)
{
public
Page
<
PublicationStudentVO
>
publicationList
(
Long
typeOne
,
Integer
pageNo
,
Integer
pageSize
,
Long
siteId
)
{
Page
<
PublicationStudentVO
>
page
=
new
Page
<
PublicationStudentVO
>(
pageNo
,
pageSize
);
Page
<
PublicationStudentVO
>
page
=
new
Page
<
PublicationStudentVO
>(
pageNo
,
pageSize
);
Integer
state
=
2
;
Integer
state
=
2
;
List
<
PublicationStudentVO
>
list
=
publication
Mapper
.
selectpublicationVO
(
typeOne
,
siteId
,
state
,
page
);
List
<
PublicationStudentVO
>
list
=
this
.
base
Mapper
.
selectpublicationVO
(
typeOne
,
siteId
,
state
,
page
);
page
.
setRecords
(
list
);
page
.
setRecords
(
list
);
return
page
;
return
page
;
}
}
...
@@ -214,7 +212,7 @@ public class PublicationServiceImpl extends ServiceImpl<PublicationMapper, Publi
...
@@ -214,7 +212,7 @@ public class PublicationServiceImpl extends ServiceImpl<PublicationMapper, Publi
if
(
info
.
getSiteId
()==
null
)
{
if
(
info
.
getSiteId
()==
null
)
{
info
.
setSiteId
(
ContextHolder
.
get
().
getSiteId
());
info
.
setSiteId
(
ContextHolder
.
get
().
getSiteId
());
}
}
return
publication
Mapper
.
searchpublication
(
page
,
info
);
return
this
.
base
Mapper
.
searchpublication
(
page
,
info
);
}
}
@Override
@Override
...
@@ -223,7 +221,7 @@ public class PublicationServiceImpl extends ServiceImpl<PublicationMapper, Publi
...
@@ -223,7 +221,7 @@ public class PublicationServiceImpl extends ServiceImpl<PublicationMapper, Publi
info
.
setFileName
(
name
);
info
.
setFileName
(
name
);
info
.
setSiteId
(
siteId
);
info
.
setSiteId
(
siteId
);
info
.
setState
(
SiteConstant
.
FOUR
);
info
.
setState
(
SiteConstant
.
FOUR
);
return
publication
Mapper
.
searchpublication
(
info
);
return
this
.
base
Mapper
.
searchpublication
(
info
);
}
}
@Override
@Override
...
@@ -289,7 +287,7 @@ public class PublicationServiceImpl extends ServiceImpl<PublicationMapper, Publi
...
@@ -289,7 +287,7 @@ public class PublicationServiceImpl extends ServiceImpl<PublicationMapper, Publi
@Override
@Override
public
List
<
Publication
>
getRelationAnnouncementPC
(
Long
terminalId
)
{
public
List
<
Publication
>
getRelationAnnouncementPC
(
Long
terminalId
)
{
return
publication
Mapper
.
getRelationAnnouncementPC
(
terminalId
);
return
this
.
base
Mapper
.
getRelationAnnouncementPC
(
terminalId
);
}
}
@Override
@Override
...
@@ -321,7 +319,7 @@ public class PublicationServiceImpl extends ServiceImpl<PublicationMapper, Publi
...
@@ -321,7 +319,7 @@ public class PublicationServiceImpl extends ServiceImpl<PublicationMapper, Publi
//公告的一级信息 公告没有二级标题
//公告的一级信息 公告没有二级标题
DataClassification
dataClassification2
=
dataClassificationService
.
selectOne
(
wrapper
);
DataClassification
dataClassification2
=
dataClassificationService
.
selectOne
(
wrapper
);
//已经关联的公告具体信息
//已经关联的公告具体信息
List
<
Publication
>
listInformations
=
publication
Mapper
.
getRelationAnnouncementPC
(
terminalId
);
List
<
Publication
>
listInformations
=
this
.
base
Mapper
.
getRelationAnnouncementPC
(
terminalId
);
List
<
Long
>
listIds
=
null
;
List
<
Long
>
listIds
=
null
;
if
(
CollectionUtils
.
isNotEmpty
(
listInformations
))
{
if
(
CollectionUtils
.
isNotEmpty
(
listInformations
))
{
listIds
=
new
ArrayList
<
Long
>();
listIds
=
new
ArrayList
<
Long
>();
...
@@ -354,7 +352,7 @@ public class PublicationServiceImpl extends ServiceImpl<PublicationMapper, Publi
...
@@ -354,7 +352,7 @@ public class PublicationServiceImpl extends ServiceImpl<PublicationMapper, Publi
Long
id
=
dataClassification2
.
getId
();
Long
id
=
dataClassification2
.
getId
();
//已经关联的新闻除外
//已经关联的新闻除外
// Long templateId = informationMapper.informationRelationGetInformationIds(terminalId);
// Long templateId = informationMapper.informationRelationGetInformationIds(terminalId);
List
<
Long
>
relationNnews
=
publication
Mapper
.
selectRelationIds
(
terminalId
);
List
<
Long
>
relationNnews
=
this
.
base
Mapper
.
selectRelationIds
(
terminalId
);
// if (templateId != null) {
// if (templateId != null) {
// relationNnews = informationMapper.getRelationInformationIds(templateId);
// relationNnews = informationMapper.getRelationInformationIds(templateId);
// }
// }
...
@@ -458,7 +456,7 @@ public class PublicationServiceImpl extends ServiceImpl<PublicationMapper, Publi
...
@@ -458,7 +456,7 @@ public class PublicationServiceImpl extends ServiceImpl<PublicationMapper, Publi
if
(
publicationParamVO
.
getSiteId
()==
null
)
{
if
(
publicationParamVO
.
getSiteId
()==
null
)
{
publicationParamVO
.
setSiteId
(
ContextHolder
.
get
().
getSiteId
());
publicationParamVO
.
setSiteId
(
ContextHolder
.
get
().
getSiteId
());
}
}
List
<
Publication
>
list
=
publication
Mapper
.
publicationFirstList
(
publicationParamVO
,
page
);
List
<
Publication
>
list
=
this
.
base
Mapper
.
publicationFirstList
(
publicationParamVO
,
page
);
if
(
list
.
size
()
>
0
&&
list
!=
null
)
{
if
(
list
.
size
()
>
0
&&
list
!=
null
)
{
for
(
Publication
info
:
list
)
{
for
(
Publication
info
:
list
)
{
...
@@ -498,7 +496,7 @@ public class PublicationServiceImpl extends ServiceImpl<PublicationMapper, Publi
...
@@ -498,7 +496,7 @@ public class PublicationServiceImpl extends ServiceImpl<PublicationMapper, Publi
formatter
.
setMinimumIntegerDigits
(
4
);
formatter
.
setMinimumIntegerDigits
(
4
);
formatter
.
setGroupingUsed
(
false
);
formatter
.
setGroupingUsed
(
false
);
String
idStr
=
formatter
.
format
(
numVal
);
String
idStr
=
formatter
.
format
(
numVal
);
return
String
.
join
(
DateUtil
.
format
(
new
Date
(),
"yyyy"
),
publication
Mapper
.
getNumberByCode
(
"publication_number"
),
idStr
);
return
String
.
join
(
DateUtil
.
format
(
new
Date
(),
"yyyy"
),
this
.
base
Mapper
.
getNumberByCode
(
"publication_number"
),
idStr
);
}
}
/**
/**
...
...
cloud-site-service/src/main/java/com/yizhi/site/application/service/impl/SystemMailboxServiceImpl.java
0 → 100644
View file @
69ccf164
package
com
.
yizhi
.
site
.
application
.
service
.
impl
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.baomidou.mybatisplus.mapper.EntityWrapper
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
com.baomidou.mybatisplus.service.impl.ServiceImpl
;
import
com.yizhi.application.orm.id.IdGenerator
;
import
com.yizhi.core.application.context.ContextHolder
;
import
com.yizhi.core.application.context.RequestContext
;
import
com.yizhi.course.application.eum.DeletedEnum
;
import
com.yizhi.site.application.constant.SiteConstant
;
import
com.yizhi.site.application.domain.SystemMailbox
;
import
com.yizhi.site.application.mapper.SystemMailboxMapper
;
import
com.yizhi.site.application.service.SystemMailboxService
;
import
com.yizhi.site.application.vo.domain.SystemMailboxVo
;
import
com.yizhi.site.application.vo.domain.SystemMailboxConditionVo
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
/**
* com.yizhi.site.application.service.impl
*
* @author yanglang
* @create 2025-01-09 13:58:12
*/
@Service
public
class
SystemMailboxServiceImpl
extends
ServiceImpl
<
SystemMailboxMapper
,
SystemMailbox
>
implements
SystemMailboxService
{
@Autowired
private
IdGenerator
idGenerator
;
@Override
public
Page
<
SystemMailbox
>
selectPage
(
SystemMailboxConditionVo
conditionVo
){
Page
<
SystemMailbox
>
page
=
new
Page
<>(
conditionVo
.
getPageNo
(),
conditionVo
.
getPageSize
());
EntityWrapper
<
SystemMailbox
>
entityWrapper
=
new
EntityWrapper
();
if
(
ObjectUtil
.
isNotEmpty
(
conditionVo
.
getContactName
())){
entityWrapper
.
like
(
"contact_name"
,
conditionVo
.
getContactName
());
}
if
(
ObjectUtil
.
isNotEmpty
(
conditionVo
.
getContactNumber
())){
entityWrapper
.
like
(
"contact_number"
,
conditionVo
.
getContactNumber
());
}
if
(
ObjectUtil
.
isNotEmpty
(
conditionVo
.
getAnonymousFlag
())){
entityWrapper
.
eq
(
"anonymous_flag"
,
conditionVo
.
getAnonymousFlag
());
}
if
(
ObjectUtil
.
isNotEmpty
(
conditionVo
.
getTargetFrom
())){
entityWrapper
.
eq
(
"target_from"
,
conditionVo
.
getTargetFrom
());
}
if
(
ObjectUtil
.
isNotEmpty
(
conditionVo
.
getFileName
())){
entityWrapper
.
like
(
"file_name"
,
conditionVo
.
getFileName
());
}
if
(
ObjectUtil
.
isNotEmpty
(
conditionVo
.
getType
())){
entityWrapper
.
eq
(
"type"
,
conditionVo
.
getType
());
}
List
<
String
>
list
=
new
ArrayList
<
String
>();
list
.
add
(
"submitTime"
);
entityWrapper
.
orderDesc
(
list
);
return
this
.
selectPage
(
page
,
entityWrapper
);
}
@Override
public
Long
save
(
SystemMailboxVo
systemMailBoxVo
)
{
SystemMailbox
systemMailBox
=
new
SystemMailbox
();
RequestContext
res
=
ContextHolder
.
get
();
systemMailBoxVo
.
setUpdateById
(
res
.
getAccountId
());
systemMailBoxVo
.
setUpdateByName
(
res
.
getAccountName
());
systemMailBoxVo
.
setUpdateTime
(
new
Date
());
Long
id
=
systemMailBoxVo
.
getId
();
if
(
id
==
null
||
id
==
0L
)
{
id
=
idGenerator
.
generate
();
systemMailBoxVo
.
setId
(
id
);
systemMailBoxVo
.
setSubmitTime
(
new
Date
());
systemMailBoxVo
.
setState
(
SiteConstant
.
TWO
);
systemMailBoxVo
.
setCreateById
(
res
.
getAccountId
());
systemMailBoxVo
.
setCreateByName
(
res
.
getAccountName
());
systemMailBoxVo
.
setCreateTime
(
new
Date
());
}
BeanUtils
.
copyProperties
(
systemMailBoxVo
,
systemMailBox
);
systemMailBox
.
setDeleted
(
DeletedEnum
.
NO
.
getValue
());
this
.
insert
(
systemMailBox
);
return
id
;
}
@Override
public
SystemMailboxVo
getById
(
Long
id
)
{
SystemMailbox
systemMailBox
=
this
.
selectById
(
id
);
if
(
systemMailBox
==
null
){
return
null
;
}
SystemMailboxVo
systemMailBoxVo
=
new
SystemMailboxVo
();
BeanUtils
.
copyProperties
(
systemMailBox
,
systemMailBoxVo
);
return
systemMailBoxVo
;
}
@Override
public
Boolean
removeById
(
Long
id
)
{
return
this
.
removeById
(
id
);
}
}
cloud-site-service/src/main/resources/mapper/SystemMailboxMapper.xml
0 → 100644
View file @
69ccf164
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yizhi.site.application.mapper.SystemMailboxMapper"
>
</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