Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gs1-office-web-sit
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
吴迪
gs1-office-web-sit
Commits
d0037d5e
Commit
d0037d5e
authored
May 21, 2023
by
吴迪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改bug 05.16-05.18
parent
dd142b7c
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
34 changed files
with
514 additions
and
90 deletions
+514
-90
CasesController.java
.../io/office/modules/manage/controller/CasesController.java
+30
-0
IndexCarouselManageController.java
...ules/manage/controller/IndexCarouselManageController.java
+55
-29
KnowledgeinfoController.java
...ce/modules/manage/controller/KnowledgeinfoController.java
+1
-1
LogisticsController.java
...office/modules/manage/controller/LogisticsController.java
+3
-3
MedicalController.java
...o/office/modules/manage/controller/MedicalController.java
+51
-7
NewsController.java
...a/io/office/modules/manage/controller/NewsController.java
+0
-0
NewsMovieController.java
...office/modules/manage/controller/NewsMovieController.java
+1
-1
NewtopicController.java
.../office/modules/manage/controller/NewtopicController.java
+1
-1
PartnersController.java
.../office/modules/manage/controller/PartnersController.java
+28
-1
PictureController.java
...o/office/modules/manage/controller/PictureController.java
+55
-14
PolicyController.java
...io/office/modules/manage/controller/PolicyController.java
+36
-2
ProductController.java
...o/office/modules/manage/controller/ProductController.java
+31
-0
RetailpictureController.java
...ce/modules/manage/controller/RetailpictureController.java
+32
-3
TokenController.java
.../io/office/modules/manage/controller/TokenController.java
+46
-0
TokenCountDao.java
...main/java/io/office/modules/manage/dao/TokenCountDao.java
+23
-0
MedicalEntity.java
...n/java/io/office/modules/manage/entity/MedicalEntity.java
+3
-0
TokenCount.java
...main/java/io/office/modules/manage/entity/TokenCount.java
+28
-0
TokenCountService.java
...a/io/office/modules/manage/service/TokenCountService.java
+24
-0
AnnounceServiceImpl.java
...fice/modules/manage/service/impl/AnnounceServiceImpl.java
+3
-3
CasesServiceImpl.java
.../office/modules/manage/service/impl/CasesServiceImpl.java
+1
-1
DocServiceImpl.java
...io/office/modules/manage/service/impl/DocServiceImpl.java
+1
-1
MedicalServiceImpl.java
...ffice/modules/manage/service/impl/MedicalServiceImpl.java
+5
-4
NewsServiceImpl.java
...o/office/modules/manage/service/impl/NewsServiceImpl.java
+3
-3
NewtopicServiceImpl.java
...fice/modules/manage/service/impl/NewtopicServiceImpl.java
+1
-1
PartnersServiceImpl.java
...fice/modules/manage/service/impl/PartnersServiceImpl.java
+1
-1
PictureServiceImpl.java
...ffice/modules/manage/service/impl/PictureServiceImpl.java
+6
-4
PolicyServiceImpl.java
...office/modules/manage/service/impl/PolicyServiceImpl.java
+2
-2
ProductServiceImpl.java
...ffice/modules/manage/service/impl/ProductServiceImpl.java
+1
-1
RetailpictureServiceImpl.java
...modules/manage/service/impl/RetailpictureServiceImpl.java
+3
-3
TokenCountServiceImpl.java
...ce/modules/manage/service/impl/TokenCountServiceImpl.java
+20
-0
TopicnewsServiceImpl.java
...ice/modules/manage/service/impl/TopicnewsServiceImpl.java
+2
-2
SysUserTokenServiceImpl.java
...ice/modules/sys/service/impl/SysUserTokenServiceImpl.java
+0
-1
application.yml
src/main/resources/application.yml
+1
-1
TokenCountDao.xml
src/main/resources/mapper/manage/TokenCountDao.xml
+16
-0
No files found.
src/main/java/io/office/modules/manage/controller/CasesController.java
View file @
d0037d5e
...
...
@@ -5,15 +5,20 @@ import java.util.Date;
import
java.util.List
;
import
java.util.Map
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.office.common.annotation.SysLog
;
import
io.office.modules.app.annotation.Login
;
import
io.office.modules.manage.entity.PartnersEntity
;
import
io.office.modules.manage.entity.TokenCount
;
import
io.office.modules.manage.entity.dto.NewsParams
;
import
io.office.modules.manage.service.TokenCountService
;
import
io.office.modules.sys.controller.AbstractController
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -139,6 +144,11 @@ public class CasesController extends AbstractController {
return
R
.
error
(
e
.
getMessage
());
}
}
@Autowired
private
TokenCountService
tokenCountService
;
@Value
(
"${token.count}"
)
private
int
tokenCountConfig
;
/**
* 信息
*/
...
...
@@ -147,6 +157,26 @@ public class CasesController extends AbstractController {
public
R
getDetailInfo
(
@RequestBody
Map
<
String
,
String
>
params
){
CasesEntity
casesEntity
=
casesService
.
getById
(
params
.
get
(
"id"
));
if
(
casesEntity
==
null
)
{
return
R
.
error
(
"没有可显示的内容"
);
}
if
(
params
.
get
(
"token"
)
!=
null
&&
StringUtils
.
isNotBlank
(
params
.
get
(
"token"
).
toString
()))
{
QueryWrapper
<
TokenCount
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"token"
,
params
.
get
(
"token"
).
toString
());
TokenCount
tokenCount
=
tokenCountService
.
getOne
(
queryWrapper
);
if
(
tokenCount
==
null
)
{
return
R
.
error
(
"非法请求,请获取正确的预览链接!"
);
}
if
(
tokenCount
.
getCountFlag
()
>
tokenCountConfig
)
{
//删除无用token
return
R
.
error
(
"预览链接次数已达上限,请联系相关人员重新获取预览链接!"
);
}
}
else
{
if
(
casesEntity
.
getStatus
()
!=
1
)
{
return
R
.
error
(
"没有可显示的内容"
);
}
}
return
R
.
ok
().
put
(
"data"
,
casesEntity
);
}
...
...
src/main/java/io/office/modules/manage/controller/IndexCarouselManageController.java
View file @
d0037d5e
This diff is collapsed.
Click to expand it.
src/main/java/io/office/modules/manage/controller/KnowledgeinfoController.java
View file @
d0037d5e
...
...
@@ -118,7 +118,7 @@ public class KnowledgeinfoController extends AbstractController {
@RequestMapping
(
"/verify"
)
@RequiresPermissions
(
"manage:knowledgeinfo:check"
)
public
R
verify
(
@RequestBody
KnowledgeinfoEntity
knowledgeinfo
){
knowledgeinfo
.
setAuditor
(
getUser
().
getUsername
());
//
knowledgeinfo.setAuditor(getUser().getUsername());
QueryWrapper
<
KnowledgeinfoEntity
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"knowledgeinfoid"
,
knowledgeinfo
.
getKnowledgeinfoid
());
knowledgeinfoService
.
update
(
knowledgeinfo
,
queryWrapper
);
...
...
src/main/java/io/office/modules/manage/controller/LogisticsController.java
View file @
d0037d5e
...
...
@@ -115,9 +115,9 @@ public class LogisticsController extends AbstractController {
@RequiresPermissions
(
"manage:logistics:check"
)
public
R
verifyMedical
(
@RequestBody
LogisticsEntity
logistics
){
String
username
=
getUser
().
getUsername
();
logistics
.
setEditor
(
username
);
logistics
.
setLasteditor
(
username
);
logistics
.
setUpdatetime
(
new
Date
());
//
logistics.setEditor(username);
//
logistics.setLasteditor(username);
//
logistics.setUpdatetime(new Date());
logistics
.
setCheckname
(
username
);
logistics
.
setChecktime
(
new
Date
());
QueryWrapper
<
LogisticsEntity
>
queryWrapper
=
new
QueryWrapper
<>();
...
...
src/main/java/io/office/modules/manage/controller/MedicalController.java
View file @
d0037d5e
...
...
@@ -6,13 +6,17 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import
io.office.common.annotation.SysLog
;
import
io.office.modules.app.annotation.Login
;
import
io.office.modules.manage.entity.MedicalEntity
;
import
io.office.modules.manage.entity.TokenCount
;
import
io.office.modules.manage.service.MedicalService
;
import
io.office.modules.manage.service.TokenCountService
;
import
io.office.modules.manage.utils.IdKeysConstant
;
import
io.office.modules.manage.utils.IdWorkerUtils
;
import
io.office.modules.sys.controller.AbstractController
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -85,7 +89,7 @@ public class MedicalController extends AbstractController {
@RequiresPermissions
(
"manage:medical:update"
)
public
R
update
(
@RequestBody
MedicalEntity
medical
)
{
String
username
=
getUser
().
getUsername
();
medical
.
setEditor
(
username
);
//
medical.setEditor(username);
medical
.
setLasteditor
(
username
);
medical
.
setUpdatetime
(
new
Date
());
dealMedicalTypeId
(
medical
.
getType
(),
medical
);
...
...
@@ -101,7 +105,24 @@ public class MedicalController extends AbstractController {
@RequestMapping
(
"/delete"
)
@RequiresPermissions
(
"manage:medical:delete"
)
public
R
delete
(
@RequestBody
List
<
String
>
ids
)
{
medicalService
.
removeByIds
(
ids
);
if
(
CollectionUtils
.
isNotEmpty
(
ids
))
{
for
(
String
id
:
ids
)
{
MedicalEntity
medicalServiceById
=
medicalService
.
getById
(
id
);
if
(
medicalServiceById
.
getLevel
()==
0
)
{
return
R
.
error
(
"当前级别为0不能删除!"
);
}
}
}
MedicalEntity
medical
=
new
MedicalEntity
();
String
username
=
getUser
().
getUsername
();
// medical.setEditor(username);
medical
.
setLasteditor
(
username
);
medical
.
setUpdatetime
(
new
Date
());
medical
.
setLevel
(
0
);
QueryWrapper
<
MedicalEntity
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
in
(
"id"
,
ids
);
medicalService
.
update
(
medical
,
queryWrapper
);
return
R
.
ok
(
"删除成功!"
);
}
...
...
@@ -117,9 +138,9 @@ public class MedicalController extends AbstractController {
@RequiresPermissions
(
"manage:medical:check"
)
public
R
verifyMedical
(
@RequestBody
MedicalEntity
medical
)
{
String
username
=
getUser
().
getUsername
();
medical
.
setEditor
(
username
);
medical
.
setLasteditor
(
username
);
medical
.
setUpdatetime
(
new
Date
());
//
medical.setEditor(username);
//
medical.setLasteditor(username);
//
medical.setUpdatetime(new Date());
medical
.
setCheckname
(
username
);
medical
.
setChecktime
(
new
Date
());
QueryWrapper
<
MedicalEntity
>
queryWrapper
=
new
QueryWrapper
<>();
...
...
@@ -155,12 +176,35 @@ public class MedicalController extends AbstractController {
queryWrapper
.
orderByDesc
(
"releaseTime"
);
return
R
.
ok
().
put
(
"data"
,
medicalService
.
list
(
queryWrapper
));
}
@Autowired
private
TokenCountService
tokenCountService
;
@Value
(
"${token.count}"
)
private
int
tokenCountConfig
;
@PostMapping
(
"/api/getDetailById"
)
public
R
getDetailById
(
@RequestBody
MedicalEntity
medical
)
{
MedicalEntity
medicalEntity
=
medicalService
.
getById
(
medical
.
getId
());
if
(
medicalEntity
==
null
)
{
return
R
.
error
(
"没有可显示的内容"
);
}
if
(
medical
.
getToken
()
!=
null
&&
org
.
apache
.
commons
.
lang
.
StringUtils
.
isNotBlank
(
medical
.
getToken
()))
{
QueryWrapper
<
TokenCount
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"token"
,
medical
.
getToken
()
);
TokenCount
tokenCount
=
tokenCountService
.
getOne
(
queryWrapper
);
if
(
tokenCount
==
null
)
{
return
R
.
error
(
"非法请求,请获取正确的预览链接!"
);
}
if
(
tokenCount
.
getCountFlag
()
>
tokenCountConfig
)
{
//删除无用token
return
R
.
error
(
"预览链接次数已达上限,请联系相关人员重新获取预览链接!"
);
}
}
else
{
if
(
medicalEntity
.
getStatus
()!=
null
&&
!
medicalEntity
.
getStatus
().
equals
(
"1"
))
{
return
R
.
error
(
"没有可显示的内容"
);
}
}
return
R
.
ok
().
put
(
"data"
,
medical
Service
.
getById
(
medical
.
getId
())
);
return
R
.
ok
().
put
(
"data"
,
medical
Entity
);
}
...
...
src/main/java/io/office/modules/manage/controller/NewsController.java
View file @
d0037d5e
This diff is collapsed.
Click to expand it.
src/main/java/io/office/modules/manage/controller/NewsMovieController.java
View file @
d0037d5e
...
...
@@ -121,7 +121,7 @@ public class NewsMovieController extends AbstractController {
SysUserEntity
user
=
getUser
();
NewsMovieEntity
newsMovieEntity
=
new
NewsMovieEntity
();
newsMovieEntity
.
setAuditor
(
user
.
getUsername
());
//
newsMovieEntity.setAuditor(user.getUsername());
BeanUtils
.
copyProperties
(
newsMovieEntityVo
,
newsMovieEntity
);
QueryWrapper
<
NewsMovieEntity
>
newsMovieEntityQueryWrapper
=
new
QueryWrapper
<>();
newsMovieEntityQueryWrapper
.
eq
(
"id"
,
newsMovieEntityVo
.
getId
());
...
...
src/main/java/io/office/modules/manage/controller/NewtopicController.java
View file @
d0037d5e
...
...
@@ -121,7 +121,7 @@ public class NewtopicController extends AbstractController {
Date
date
=
new
Date
();
SysUserEntity
user
=
getUser
();
NewtopicEntity
newtopicEntity
=
new
NewtopicEntity
();
newtopicEntity
.
setAuditor
(
user
.
getUsername
());
//
newtopicEntity.setAuditor(user.getUsername());
newtopicEntity
.
setCheckflag
(
Integer
.
valueOf
(
params
.
getStatus
()));
QueryWrapper
<
NewtopicEntity
>
newtopicEntityQueryWrapper
=
new
QueryWrapper
<>();
newtopicEntityQueryWrapper
.
eq
(
"classid"
,
newtopicEntity
.
getClassid
());
...
...
src/main/java/io/office/modules/manage/controller/PartnersController.java
View file @
d0037d5e
...
...
@@ -4,14 +4,19 @@ import java.util.Date;
import
java.util.List
;
import
java.util.Map
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.office.common.annotation.SysLog
;
import
io.office.modules.app.annotation.Login
;
import
io.office.modules.manage.entity.TokenCount
;
import
io.office.modules.manage.entity.dto.NewsParams
;
import
io.office.modules.manage.service.TokenCountService
;
import
io.office.modules.sys.controller.AbstractController
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -137,6 +142,10 @@ public class PartnersController extends AbstractController {
}
}
@Autowired
private
TokenCountService
tokenCountService
;
@Value
(
"${token.count}"
)
private
int
tokenCountConfig
;
/**
* 信息
...
...
@@ -145,7 +154,25 @@ public class PartnersController extends AbstractController {
// @RequiresPermissions("manage:partners:info")
public
R
getDetailInfo
(
@RequestBody
Map
<
String
,
String
>
params
){
PartnersEntity
partners
=
partnersService
.
getById
(
params
.
get
(
"id"
));
if
(
partners
==
null
)
{
return
R
.
error
(
"没有可显示的内容"
);
}
if
(
params
.
get
(
"token"
)
!=
null
&&
StringUtils
.
isNotBlank
(
params
.
get
(
"token"
).
toString
()))
{
QueryWrapper
<
TokenCount
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"token"
,
params
.
get
(
"token"
).
toString
());
TokenCount
tokenCount
=
tokenCountService
.
getOne
(
queryWrapper
);
if
(
tokenCount
==
null
)
{
return
R
.
error
(
"非法请求,请获取正确的预览链接!"
);
}
if
(
tokenCount
.
getCountFlag
()
>
tokenCountConfig
)
{
//删除无用token
return
R
.
error
(
"预览链接次数已达上限,请联系相关人员重新获取预览链接!"
);
}
}
else
{
if
(
partners
.
getStatus
()
!=
1
)
{
return
R
.
error
(
"没有可显示的内容"
);
}
}
return
R
.
ok
().
put
(
"data"
,
partners
);
}
...
...
src/main/java/io/office/modules/manage/controller/PictureController.java
View file @
d0037d5e
...
...
@@ -11,14 +11,20 @@ import io.office.common.annotation.SysLog;
import
io.office.common.utils.PageUtils
;
import
io.office.common.utils.R
;
import
io.office.modules.app.annotation.Login
;
import
io.office.modules.manage.entity.MedicalEntity
;
import
io.office.modules.manage.entity.PictureEntity
;
import
io.office.modules.manage.entity.TokenCount
;
import
io.office.modules.manage.entity.dto.NewsParams
;
import
io.office.modules.manage.entity.dto.PictureParams
;
import
io.office.modules.manage.service.PictureService
;
import
io.office.modules.manage.service.TokenCountService
;
import
io.office.modules.sys.controller.AbstractController
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -41,9 +47,9 @@ public class PictureController extends AbstractController {
*/
@RequestMapping
(
"/list"
)
@RequiresPermissions
(
"manage:picture:list"
)
public
R
list
(
@RequestBody
PictureParams
params
){
public
R
list
(
@RequestBody
PictureParams
params
)
{
Page
<
PictureEntity
>
page
=
this
.
pictureService
.
selectPictureList
(
params
,
new
Page
(
params
.
getPage
(),
params
.
getLimit
()));
new
Page
(
params
.
getPage
(),
params
.
getLimit
()));
PageUtils
pageUtils
=
new
PageUtils
(
page
);
return
R
.
ok
().
put
(
"page"
,
pageUtils
);
}
...
...
@@ -54,7 +60,7 @@ public class PictureController extends AbstractController {
*/
@RequestMapping
(
"/info/{pictureid}"
)
@RequiresPermissions
(
"manage:picture:info"
)
public
R
info
(
@PathVariable
(
"pictureid"
)
Integer
pictureid
){
public
R
info
(
@PathVariable
(
"pictureid"
)
Integer
pictureid
)
{
PictureEntity
picture
=
pictureService
.
getById
(
pictureid
);
return
R
.
ok
().
put
(
"picture"
,
picture
);
...
...
@@ -67,9 +73,9 @@ public class PictureController extends AbstractController {
@Transactional
@RequestMapping
(
"/save"
)
@RequiresPermissions
(
"manage:picture:save"
)
public
R
save
(
@RequestBody
PictureEntity
picture
){
public
R
save
(
@RequestBody
PictureEntity
picture
)
{
try
{
R
r
=
this
.
pictureService
.
insertPicture
(
picture
,
getUser
());
R
r
=
this
.
pictureService
.
insertPicture
(
picture
,
getUser
());
return
r
;
}
catch
(
Exception
e
)
{
log
.
error
(
"picture save error:"
,
e
);
...
...
@@ -84,7 +90,7 @@ public class PictureController extends AbstractController {
@Transactional
@RequestMapping
(
"/update"
)
@RequiresPermissions
(
"manage:picture:update"
)
public
R
update
(
@RequestBody
PictureEntity
picture
){
public
R
update
(
@RequestBody
PictureEntity
picture
)
{
try
{
R
r
=
this
.
pictureService
.
updatePicture
(
picture
,
getUser
());
return
r
;
...
...
@@ -101,8 +107,18 @@ public class PictureController extends AbstractController {
@SysLog
(
"删除图片资讯[picture]"
)
@RequestMapping
(
"/delete"
)
@RequiresPermissions
(
"manage:picture:delete"
)
public
R
delete
(
@RequestBody
List
<
Long
>
ids
){
public
R
delete
(
@RequestBody
List
<
Long
>
ids
)
{
try
{
if
(
CollectionUtils
.
isNotEmpty
(
ids
))
{
for
(
Long
id
:
ids
)
{
PictureEntity
pictureServiceById
=
pictureService
.
getById
(
id
);
//MedicalEntity medicalServiceById = (MedicalEntity) pictureServiceById;
if
(
pictureServiceById
.
getPiclevel
()
==
0
)
{
return
R
.
error
(
"当前级别为0不能删除!"
);
}
}
}
R
r
=
this
.
pictureService
.
deletePicture
(
ids
,
getUser
());
return
r
;
}
catch
(
Exception
e
)
{
...
...
@@ -120,7 +136,7 @@ public class PictureController extends AbstractController {
@RequiresPermissions
(
"manage:picture:check"
)
public
R
verify
(
@RequestBody
PictureEntity
picture
)
{
try
{
R
r
=
this
.
pictureService
.
verifyPicture
(
picture
,
getUser
());
R
r
=
this
.
pictureService
.
verifyPicture
(
picture
,
getUser
());
return
r
;
}
catch
(
Exception
e
)
{
log
.
error
(
"delete error:"
,
e
);
...
...
@@ -136,8 +152,8 @@ public class PictureController extends AbstractController {
QueryWrapper
<
PictureEntity
>
newsEntityQueryWrapper
=
new
QueryWrapper
<>();
newsEntityQueryWrapper
.
select
(
"TOP 3 *"
);
newsEntityQueryWrapper
.
eq
(
"status"
,
1
);
newsEntityQueryWrapper
.
gt
(
"PicLevel"
,
0
);
newsEntityQueryWrapper
.
eq
(
"status"
,
1
);
newsEntityQueryWrapper
.
gt
(
"PicLevel"
,
0
);
newsEntityQueryWrapper
.
orderByDesc
(
"PicLevel"
);
newsEntityQueryWrapper
.
orderByDesc
(
"showtime"
);
newsEntityQueryWrapper
.
orderByDesc
(
"inputDate"
);
...
...
@@ -158,7 +174,7 @@ public class PictureController extends AbstractController {
public
R
pictureList
(
@RequestBody
NewsParams
params
)
{
try
{
Page
<
PictureEntity
>
page
=
this
.
pictureService
.
selectPictureNewList
(
params
,
new
Page
(
params
.
getPage
(),
params
.
getLimit
()));
new
Page
(
params
.
getPage
(),
params
.
getLimit
()));
PageUtils
pageUtils
=
new
PageUtils
(
page
);
return
R
.
ok
().
put
(
"data"
,
pageUtils
);
}
catch
(
Exception
e
)
{
...
...
@@ -167,14 +183,39 @@ public class PictureController extends AbstractController {
}
}
@Autowired
private
TokenCountService
tokenCountService
;
@Value
(
"${token.count}"
)
private
int
tokenCountConfig
;
/**
* 信息
*/
@Login
@RequestMapping
(
"/api/info/{pictureid}"
)
@RequestMapping
({
"/api/info/{pictureid}"
,
"/api/info/{pictureid}/{token}"
})
// @RequiresPermissions("manage:picture:info")
public
R
getDetail
(
@PathVariable
(
"pictureid"
)
Integer
pictureid
)
{
public
R
getDetail
(
@PathVariable
(
"pictureid"
)
Integer
pictureid
,
@PathVariable
(
value
=
"token"
,
required
=
false
)
String
token
)
{
PictureEntity
picture
=
pictureService
.
getById
(
pictureid
);
if
(
picture
==
null
)
{
return
R
.
error
(
"没有可显示的内容"
);
}
if
(
token
!=
null
&&
StringUtils
.
isNotBlank
(
token
))
{
QueryWrapper
<
TokenCount
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"token"
,
token
);
TokenCount
tokenCount
=
tokenCountService
.
getOne
(
queryWrapper
);
if
(
tokenCount
==
null
)
{
return
R
.
error
(
"非法请求,请获取正确的预览链接!"
);
}
if
(
tokenCount
.
getCountFlag
()
>
tokenCountConfig
)
{
//删除无用token
return
R
.
error
(
"预览链接次数已达上限,请联系相关人员重新获取预览链接!"
);
}
}
else
{
if
(
picture
.
getStatus
()
!=
1
)
{
return
R
.
error
(
"没有可显示的内容"
);
}
}
return
R
.
ok
().
put
(
"data"
,
picture
);
}
...
...
@@ -185,7 +226,7 @@ public class PictureController extends AbstractController {
public
R
retailPictureList
(
@RequestBody
Map
<
String
,
String
>
params
)
{
try
{
Page
page
=
new
Page
(
Long
.
parseLong
(
params
.
get
(
"page"
)),
Long
.
parseLong
(
params
.
get
(
"size"
)));
Page
page
=
new
Page
(
Long
.
parseLong
(
params
.
get
(
"page"
)),
Long
.
parseLong
(
params
.
get
(
"size"
)));
Page
<
PictureEntity
>
pictureEntityPage
=
pictureService
.
selectRetailPicture
(
page
);
PageUtils
pageUtils
=
new
PageUtils
(
pictureEntityPage
);
...
...
src/main/java/io/office/modules/manage/controller/PolicyController.java
View file @
d0037d5e
...
...
@@ -2,6 +2,7 @@ package io.office.modules.manage.controller;
import
java.util.List
;
import
cn.hutool.core.util.StrUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.office.common.annotation.SysLog
;
...
...
@@ -10,13 +11,17 @@ import io.office.common.utils.R;
import
io.office.modules.app.annotation.Login
;
import
io.office.modules.manage.entity.PictureEntity
;
import
io.office.modules.manage.entity.PolicyEntity
;
import
io.office.modules.manage.entity.TokenCount
;
import
io.office.modules.manage.entity.dto.NewsParams
;
import
io.office.modules.manage.entity.dto.PolicyParams
;
import
io.office.modules.manage.service.PolicyService
;
import
io.office.modules.manage.service.TokenCountService
;
import
io.office.modules.sys.controller.AbstractController
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -175,11 +180,40 @@ public class PolicyController extends AbstractController {
return
R
.
ok
().
put
(
"data"
,
pageUtils
);
}
@Autowired
private
TokenCountService
tokenCountService
;
@Value
(
"${token.count}"
)
private
int
tokenCountConfig
;
@Login
@GetMapping
(
"/api/info/{id}"
)
@GetMapping
(
{
"/api/info/{id}"
,
"/api/info/{id}/{token}"
}
)
// @RequiresPermissions("manage:indexcarouselmanage:pictureImageList")
public
R
getDetail
(
@PathVariable
(
"id"
)
Integer
id
)
{
public
R
getDetail
(
@PathVariable
(
"id"
)
Integer
id
,
@PathVariable
(
value
=
"token"
,
required
=
false
)
String
token
)
{
PolicyEntity
policy
=
policyService
.
getById
(
id
);
if
(
policy
==
null
)
{
return
R
.
error
(
"没有可显示的内容"
);
}
if
(
token
!=
null
&&
StringUtils
.
isNotBlank
(
token
))
{
QueryWrapper
<
TokenCount
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"token"
,
token
);
TokenCount
tokenCount
=
tokenCountService
.
getOne
(
queryWrapper
);
if
(
tokenCount
==
null
)
{
return
R
.
error
(
"非法请求,请获取正确的预览链接!"
);
}
if
(
tokenCount
.
getCountFlag
()
>
tokenCountConfig
)
{
//删除无用token
return
R
.
error
(
"预览链接次数已达上限,请联系相关人员重新获取预览链接!"
);
}
}
else
{
if
(
StrUtil
.
equals
(
"0"
,
policy
.
getStatus
()))
{
return
R
.
error
(
"没有可显示的内容"
);
}
}
return
R
.
ok
().
put
(
"data"
,
policy
);
}
...
...
src/main/java/io/office/modules/manage/controller/ProductController.java
View file @
d0037d5e
...
...
@@ -2,13 +2,19 @@ package io.office.modules.manage.controller;
import
java.util.List
;
import
java.util.Map
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.office.common.annotation.SysLog
;
import
io.office.modules.app.annotation.Login
;
import
io.office.modules.manage.entity.TokenCount
;
import
io.office.modules.manage.service.TokenCountService
;
import
io.office.modules.sys.controller.AbstractController
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.*
;
import
io.office.modules.manage.entity.ProductEntity
;
...
...
@@ -120,6 +126,11 @@ public class ProductController extends AbstractController {
}
}
@Autowired
private
TokenCountService
tokenCountService
;
@Value
(
"${token.count}"
)
private
int
tokenCountConfig
;
/**
* 分页查图书
* @param param:分页参数
...
...
@@ -133,6 +144,26 @@ public class ProductController extends AbstractController {
new
Page
(
Integer
.
valueOf
(
param
.
get
(
"page"
)),
Integer
.
valueOf
(
param
.
get
(
"size"
))),
param
.
get
(
"id"
));
PageUtils
pageUtils
=
new
PageUtils
(
pag
);
if
(
pageUtils
.
getTotalCount
()
!=
0
)
{
return
R
.
error
(
"没有可显示的内容"
);
}
if
(
param
.
get
(
"token"
)
!=
null
&&
StringUtils
.
isNotBlank
(
param
.
get
(
"token"
).
toString
()))
{
QueryWrapper
<
TokenCount
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"token"
,
param
.
get
(
"token"
).
toString
());
TokenCount
tokenCount
=
tokenCountService
.
getOne
(
queryWrapper
);
if
(
tokenCount
==
null
)
{
return
R
.
error
(
"非法请求,请获取正确的预览链接!"
);
}
if
(
tokenCount
.
getCountFlag
()
>
tokenCountConfig
)
{
//删除无用token
return
R
.
error
(
"预览链接次数已达上限,请联系相关人员重新获取预览链接!"
);
}
}
else
{
ProductEntity
productEntity
=
(
ProductEntity
)
pageUtils
.
getList
().
get
(
0
);
if
(
productEntity
.
getStatus
()
!=
1
)
{
return
R
.
error
(
"没有可显示的内容"
);
}
}
return
R
.
ok
().
put
(
"page"
,
pageUtils
);
}
...
...
src/main/java/io/office/modules/manage/controller/RetailpictureController.java
View file @
d0037d5e
...
...
@@ -2,14 +2,19 @@ package io.office.modules.manage.controller;
import
java.util.List
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.office.common.annotation.SysLog
;
import
io.office.modules.app.annotation.Login
;
import
io.office.modules.manage.entity.TokenCount
;
import
io.office.modules.manage.entity.dto.RetailPictureParams
;
import
io.office.modules.manage.service.TokenCountService
;
import
io.office.modules.sys.controller.AbstractController
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -126,15 +131,39 @@ public class RetailpictureController extends AbstractController {
}
}
@Autowired
private
TokenCountService
tokenCountService
;
@Value
(
"${token.count}"
)
private
int
tokenCountConfig
;
/**
* 信息
*/
@Login
@RequestMapping
(
"/api/info/{pictureid}"
)
@RequestMapping
(
{
"/api/info/{pictureid}"
,
"/api/info/{pictureid}/{token}"
}
)
// @RequiresPermissions("generator:picture:info")
public
R
getDetail
(
@PathVariable
(
"pictureid"
)
Integer
pictureid
){
public
R
getDetail
(
@PathVariable
(
"pictureid"
)
Integer
pictureid
,
@PathVariable
(
value
=
"token"
,
required
=
false
)
String
token
){
RetailpictureEntity
picture
=
retailpictureService
.
getById
(
pictureid
);
if
(
picture
==
null
)
{
return
R
.
error
(
"没有可显示的内容"
);
}
if
(
token
!=
null
&&
StringUtils
.
isNotBlank
(
token
))
{
QueryWrapper
<
TokenCount
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"token"
,
token
);
TokenCount
tokenCount
=
tokenCountService
.
getOne
(
queryWrapper
);
if
(
tokenCount
==
null
)
{
return
R
.
error
(
"非法请求,请获取正确的预览链接!"
);
}
if
(
tokenCount
.
getCountFlag
()
>
tokenCountConfig
)
{
//删除无用token
return
R
.
error
(
"预览链接次数已达上限,请联系相关人员重新获取预览链接!"
);
}
}
else
{
if
(
picture
.
getStatus
()
!=
1
)
{
return
R
.
error
(
"没有可显示的内容"
);
}
}
picture
.
setFlag
(
"2"
);
return
R
.
ok
().
put
(
"data"
,
picture
);
}
...
...
src/main/java/io/office/modules/manage/controller/TokenController.java
0 → 100644
View file @
d0037d5e
package
io
.
office
.
modules
.
manage
.
controller
;
import
io.office.common.utils.PageUtils
;
import
io.office.common.utils.R
;
import
io.office.modules.manage.entity.TokenCount
;
import
io.office.modules.manage.service.TokenCountService
;
import
io.office.modules.manage.utils.DateUtils
;
import
io.office.modules.manage.utils.IdKeysConstant
;
import
io.office.modules.manage.utils.IdWorkerUtils
;
import
io.office.modules.sys.controller.AbstractController
;
import
io.office.modules.sys.entity.SysUserEntity
;
import
io.office.modules.sys.oauth2.TokenGenerator
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* @author wudi
* @date 2023/5/20
* @comment
*/
@RestController
@RequestMapping
(
"/token"
)
public
class
TokenController
extends
AbstractController
{
@Autowired
TokenCountService
tokenCountService
;
@RequestMapping
(
"/getToken"
)
// @RequiresPermissions("manage:searchgtinlog:list")
public
R
getToken
()
{
SysUserEntity
user
=
getUser
();
String
token
=
TokenGenerator
.
generateValue
();
TokenCount
tokenCount
=
new
TokenCount
();
tokenCount
.
setToken
(
token
);
tokenCount
.
setCreateUser
(
user
.
getUsername
());
tokenCount
.
setCreateTime
(
DateUtils
.
getCurrentTime
(
DateUtils
.
FORMAT1
));
tokenCount
.
setId
(
Long
.
parseLong
(
IdWorkerUtils
.
getSEQByKey
(
IdKeysConstant
.
ID_SEQ_KEY
)));
tokenCount
.
setCountFlag
(
0
);
return
R
.
ok
().
put
(
"data"
,
token
);
}
}
src/main/java/io/office/modules/manage/dao/TokenCountDao.java
0 → 100644
View file @
d0037d5e
package
io
.
office
.
modules
.
manage
.
dao
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.office.modules.manage.entity.AnnounceEntity
;
import
io.office.modules.manage.entity.TokenCount
;
import
io.office.modules.manage.entity.dto.NewsParams
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* ${comments}
*
* @author wudi
* @email
* @date 2021-12-07 15:26:10
*/
@Mapper
public
interface
TokenCountDao
extends
BaseMapper
<
TokenCount
>
{
}
src/main/java/io/office/modules/manage/entity/MedicalEntity.java
View file @
d0037d5e
...
...
@@ -96,4 +96,7 @@ public class MedicalEntity implements Serializable {
@TableField
(
"oldtitle"
)
private
String
titleOld
;
@TableField
(
exist
=
false
)
private
String
token
;
}
src/main/java/io/office/modules/manage/entity/TokenCount.java
0 → 100644
View file @
d0037d5e
package
io
.
office
.
modules
.
manage
.
entity
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* @author wudi
* @date 2023/5/20
* @comment
*/
@Data
@TableName
(
"token_count"
)
public
class
TokenCount
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
long
id
;
private
String
token
;
private
String
createUser
;
private
String
createTime
;
private
int
countFlag
;
}
src/main/java/io/office/modules/manage/service/TokenCountService.java
0 → 100644
View file @
d0037d5e
package
io
.
office
.
modules
.
manage
.
service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
io.office.common.utils.PageUtils
;
import
io.office.common.utils.R
;
import
io.office.modules.manage.entity.AnnounceEntity
;
import
io.office.modules.manage.entity.TokenCount
;
import
io.office.modules.manage.entity.dto.NewsParams
;
import
io.office.modules.sys.entity.SysUserEntity
;
import
java.util.Map
;
/**
* ${comments}
*
* @author wudi
* @email
* @date 2021-12-07 15:26:10
*/
public
interface
TokenCountService
extends
IService
<
TokenCount
>
{
}
src/main/java/io/office/modules/manage/service/impl/AnnounceServiceImpl.java
View file @
d0037d5e
...
...
@@ -56,9 +56,9 @@ public class AnnounceServiceImpl extends ServiceImpl<AnnounceDao, AnnounceEntity
@Override
public
R
verify
(
AnnounceEntity
announce
,
SysUserEntity
user
)
{
announce
.
setUpdatedate
(
new
Date
());
announce
.
setEditor
(
user
.
getUsername
());
announce
.
setAuditor
(
user
.
getUsername
());
//
announce.setUpdatedate(new Date());
//
announce.setEditor(user.getUsername());
//
announce.setAuditor(user.getUsername());
QueryWrapper
<
AnnounceEntity
>
newsEntityQueryWrapper
=
new
QueryWrapper
<>();
newsEntityQueryWrapper
.
eq
(
"id"
,
announce
.
getId
());
announceDao
.
update
(
announce
,
newsEntityQueryWrapper
);
...
...
src/main/java/io/office/modules/manage/service/impl/CasesServiceImpl.java
View file @
d0037d5e
...
...
@@ -88,7 +88,7 @@ public class CasesServiceImpl extends ServiceImpl<CasesDao, CasesEntity> impleme
public
R
verify
(
CasesEntity
casesEntity
,
SysUserEntity
user
)
{
QueryWrapper
<
CasesEntity
>
partnersEntityQueryWrapper
=
new
QueryWrapper
<>();
partnersEntityQueryWrapper
.
in
(
"id"
,
casesEntity
.
getId
());
casesEntity
.
setAuditor
(
user
.
getUsername
());
//
casesEntity.setAuditor(user.getUsername());
casesEntity
.
setCheckdate
(
new
Date
());
int
update
=
this
.
baseMapper
.
update
(
casesEntity
,
partnersEntityQueryWrapper
);
if
(
update
>
0
){
...
...
src/main/java/io/office/modules/manage/service/impl/DocServiceImpl.java
View file @
d0037d5e
...
...
@@ -55,7 +55,7 @@ public class DocServiceImpl extends ServiceImpl<DocDao, DocEntity> implements Do
public
void
verifyDoc
(
DocEntity
doc
,
SysUserEntity
user
)
{
QueryWrapper
<
DocEntity
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
in
(
"id"
,
doc
.
getId
());
doc
.
setAuditor
(
user
.
getUsername
());
//
doc.setAuditor(user.getUsername());
this
.
baseMapper
.
update
(
doc
,
queryWrapper
);
}
...
...
src/main/java/io/office/modules/manage/service/impl/MedicalServiceImpl.java
View file @
d0037d5e
...
...
@@ -5,6 +5,7 @@ import io.netty.util.internal.StringUtil;
import
io.office.modules.manage.dao.MedicalDao
;
import
io.office.modules.manage.entity.MedicalEntity
;
import
io.office.modules.manage.service.MedicalService
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -27,18 +28,18 @@ public class MedicalServiceImpl extends ServiceImpl<MedicalDao, MedicalEntity> i
@Override
public
PageUtils
queryPage
(
Map
<
String
,
Object
>
params
)
{
QueryWrapper
<
MedicalEntity
>
medicalEntityQueryWrapper
=
new
QueryWrapper
<>();
if
(
!
StringUtil
.
isNullOrEmpty
(
String
.
valueOf
(
params
.
get
(
"title"
)))){
if
(
params
.
get
(
"title"
)!=
null
&&
StringUtils
.
isNotBlank
(
String
.
valueOf
(
params
.
get
(
"title"
)))){
medicalEntityQueryWrapper
.
like
(
"title"
,
params
.
get
(
"title"
));
}
if
(
!
StringUtil
.
isNullOrEmpty
(
String
.
valueOf
(
params
.
get
(
"type"
)))){
if
(
params
.
get
(
"type"
)!=
null
&&
StringUtils
.
isNotBlank
(
String
.
valueOf
(
params
.
get
(
"type"
)))){
medicalEntityQueryWrapper
.
eq
(
"type"
,
params
.
get
(
"type"
));
}
if
(
!
StringUtil
.
isNullOrEmpty
(
String
.
valueOf
(
params
.
get
(
"level"
)))){
if
(
params
.
get
(
"level"
)!=
null
&&
StringUtils
.
isNotBlank
(
String
.
valueOf
(
params
.
get
(
"level"
)))){
medicalEntityQueryWrapper
.
eq
(
"level"
,
params
.
get
(
"level"
));
}
else
{
medicalEntityQueryWrapper
.
gt
(
"level"
,
0
);
}
if
(
!
StringUtil
.
isNullOrEmpty
(
String
.
valueOf
(
params
.
get
(
"sidx"
)))){
if
(
params
.
get
(
"sidx"
)!=
null
&&
StringUtils
.
isNotBlank
(
String
.
valueOf
(
params
.
get
(
"sidx"
)))){
if
(
String
.
valueOf
(
params
.
get
(
"sidx"
)).
equalsIgnoreCase
(
"type"
))
{
params
.
put
(
"sidx"
,
"typeid"
);
}
...
...
src/main/java/io/office/modules/manage/service/impl/NewsServiceImpl.java
View file @
d0037d5e
...
...
@@ -73,7 +73,7 @@ public class NewsServiceImpl extends ServiceImpl<NewsDao, NewsEntity> implements
}
QueryWrapper
<
NewsEntity
>
newsEntityQueryWrapper
=
new
QueryWrapper
<>();
newsEntityQueryWrapper
.
eq
(
"id"
,
news
.
getId
());
news
.
setEditor
(
user
.
getUsername
());
//
news.setEditor(user.getUsername());
news
.
setLasteditor
(
user
.
getUsername
());
if
(
news
.
getCclassid
()
!=
null
)
{
news
.
setClassid
(
news
.
getCclassid
());
...
...
@@ -102,9 +102,9 @@ public class NewsServiceImpl extends ServiceImpl<NewsDao, NewsEntity> implements
@Override
public
R
verifyNews
(
NewsEntity
news
,
SysUserEntity
user
)
{
news
.
setAuditor
(
user
.
getUsername
());
//
news.setAuditor(user.getUsername());
news
.
setCheckdate
(
new
Date
());
news
.
setLasteditor
(
user
.
getUsername
());
//
news.setLasteditor(user.getUsername());
QueryWrapper
<
NewsEntity
>
newsEntityQueryWrapper
=
new
QueryWrapper
<>();
newsEntityQueryWrapper
.
eq
(
"id"
,
news
.
getId
());
int
verify
=
baseMapper
.
update
(
news
,
newsEntityQueryWrapper
);
...
...
src/main/java/io/office/modules/manage/service/impl/NewtopicServiceImpl.java
View file @
d0037d5e
...
...
@@ -70,7 +70,7 @@ public class NewtopicServiceImpl extends ServiceImpl<NewtopicDao, NewtopicEntity
queryWrapper
.
like
(
"title"
,
params
.
get
(
"title"
));
}
}
queryWrapper
.
select
(
"classid,title,levels,categoryID,showtime,Time,Lastupdate,editor,lasteditor,auditor,checkflag"
);
queryWrapper
.
select
(
"classid,title,levels,categoryID,showtime,Time,Lastupdate,editor,lasteditor,auditor,checkflag
,directpath
"
);
IPage
<
NewtopicEntity
>
page
=
baseMapper
.
selectPage
(
new
Query
<
NewtopicEntity
>().
getPage
(
params
),
queryWrapper
);
List
<
NewtopicEntity
>
records
=
page
.
getRecords
();
records
.
stream
().
forEach
(
item
->{
...
...
src/main/java/io/office/modules/manage/service/impl/PartnersServiceImpl.java
View file @
d0037d5e
...
...
@@ -67,7 +67,7 @@ public class PartnersServiceImpl extends ServiceImpl<PartnersDao, PartnersEntity
public
R
verifyPartners
(
PartnersEntity
partnersEntity
,
SysUserEntity
user
)
{
QueryWrapper
<
PartnersEntity
>
partnersEntityQueryWrapper
=
new
QueryWrapper
<>();
partnersEntityQueryWrapper
.
in
(
"id"
,
partnersEntity
.
getId
());
partnersEntity
.
setAuditor
(
user
.
getUsername
());
//
partnersEntity.setAuditor(user.getUsername());
partnersEntity
.
setCheckdate
(
new
Date
());
int
update
=
this
.
baseMapper
.
update
(
partnersEntity
,
partnersEntityQueryWrapper
);
if
(
update
>
0
){
...
...
src/main/java/io/office/modules/manage/service/impl/PictureServiceImpl.java
View file @
d0037d5e
...
...
@@ -61,7 +61,7 @@ public class PictureServiceImpl extends ServiceImpl<PictureDao, PictureEntity> i
}
QueryWrapper
<
PictureEntity
>
newsEntityQueryWrapper
=
new
QueryWrapper
<>();
newsEntityQueryWrapper
.
eq
(
"pictureid"
,
picture
.
getPictureid
());
picture
.
setEditor
(
user
.
getUsername
());
//
picture.setEditor(user.getUsername());
picture
.
setLasteditor
(
user
.
getUsername
());
int
update
=
baseMapper
.
update
(
picture
,
newsEntityQueryWrapper
);
if
(
update
>
0
){
...
...
@@ -73,10 +73,12 @@ public class PictureServiceImpl extends ServiceImpl<PictureDao, PictureEntity> i
@Override
public
R
deletePicture
(
List
ids
,
SysUserEntity
user
)
{
PictureEntity
pictureEntity
=
new
PictureEntity
();
pictureEntity
.
setPiclevel
(
0
);
pictureEntity
.
setLasteditor
(
user
.
getUsername
());
pictureEntity
.
setEditor
(
user
.
getUsername
());
//
pictureEntity.setEditor(user.getUsername());
QueryWrapper
<
PictureEntity
>
newsEntityQueryWrapper
=
new
QueryWrapper
<>();
newsEntityQueryWrapper
.
in
(
"pictureid"
,
ids
);
int
delete
=
baseMapper
.
update
(
pictureEntity
,
newsEntityQueryWrapper
);
...
...
@@ -89,9 +91,9 @@ public class PictureServiceImpl extends ServiceImpl<PictureDao, PictureEntity> i
@Override
public
R
verifyPicture
(
PictureEntity
picture
,
SysUserEntity
user
)
{
picture
.
setAuditor
(
user
.
getUsername
());
//
picture.setAuditor(user.getUsername());
picture
.
setInputdate
(
new
Date
());
picture
.
setLasteditor
(
user
.
getUsername
());
//
picture.setLasteditor(user.getUsername());
QueryWrapper
<
PictureEntity
>
newsEntityQueryWrapper
=
new
QueryWrapper
<>();
newsEntityQueryWrapper
.
eq
(
"pictureid"
,
picture
.
getPictureid
());
int
verify
=
baseMapper
.
update
(
picture
,
newsEntityQueryWrapper
);
...
...
src/main/java/io/office/modules/manage/service/impl/PolicyServiceImpl.java
View file @
d0037d5e
...
...
@@ -91,8 +91,8 @@ public class PolicyServiceImpl extends ServiceImpl<PolicyDao, PolicyEntity> impl
@Override
public
R
verifyTopic
(
PolicyEntity
policyEntity
,
SysUserEntity
user
)
{
policyEntity
.
setAuditor
(
user
.
getUsername
());
policyEntity
.
setLasteditor
(
user
.
getUsername
());
//
policyEntity.setAuditor(user.getUsername());
//
policyEntity.setLasteditor(user.getUsername());
QueryWrapper
<
PolicyEntity
>
newsEntityQueryWrapper
=
new
QueryWrapper
<>();
newsEntityQueryWrapper
.
eq
(
"id"
,
policyEntity
.
getId
());
baseMapper
.
update
(
policyEntity
,
newsEntityQueryWrapper
);
...
...
src/main/java/io/office/modules/manage/service/impl/ProductServiceImpl.java
View file @
d0037d5e
...
...
@@ -62,7 +62,7 @@ public class ProductServiceImpl extends ServiceImpl<ProductDao, ProductEntity> i
@Override
public
R
verifyProduct
(
ProductEntity
product
,
SysUserEntity
user
)
{
product
.
setAuditor
(
user
.
getUsername
());
//
product.setAuditor(user.getUsername());
QueryWrapper
<
ProductEntity
>
newsEntityQueryWrapper
=
new
QueryWrapper
<>();
newsEntityQueryWrapper
.
in
(
"id"
,
product
.
getId
());
int
delete
=
baseMapper
.
update
(
product
,
newsEntityQueryWrapper
);
...
...
src/main/java/io/office/modules/manage/service/impl/RetailpictureServiceImpl.java
View file @
d0037d5e
...
...
@@ -87,9 +87,9 @@ public class RetailpictureServiceImpl extends ServiceImpl<RetailpictureDao, Reta
@Override
public
R
verifyPicture
(
RetailpictureEntity
picture
,
SysUserEntity
user
)
{
picture
.
setAuditor
(
user
.
getUsername
());
picture
.
setInputdate
(
new
Date
());
picture
.
setLasteditor
(
user
.
getUsername
());
//
picture.setAuditor(user.getUsername());
//
picture.setInputdate(new Date());
//
picture.setLasteditor(user.getUsername());
QueryWrapper
<
RetailpictureEntity
>
newsEntityQueryWrapper
=
new
QueryWrapper
<>();
newsEntityQueryWrapper
.
eq
(
"pictureid"
,
picture
.
getPictureid
());
int
verify
=
baseMapper
.
update
(
picture
,
newsEntityQueryWrapper
);
...
...
src/main/java/io/office/modules/manage/service/impl/TokenCountServiceImpl.java
0 → 100644
View file @
d0037d5e
package
io
.
office
.
modules
.
manage
.
service
.
impl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
io.office.modules.manage.dao.TimescodeRegiDao
;
import
io.office.modules.manage.dao.TokenCountDao
;
import
io.office.modules.manage.entity.TimescodeRegiEntity
;
import
io.office.modules.manage.entity.TokenCount
;
import
io.office.modules.manage.service.TokenCountService
;
import
org.springframework.stereotype.Service
;
/**
* @author wudi
* @date 2023/5/20
* @comment
*/
@Service
public
class
TokenCountServiceImpl
extends
ServiceImpl
<
TokenCountDao
,
TokenCount
>
implements
TokenCountService
{
}
src/main/java/io/office/modules/manage/service/impl/TopicnewsServiceImpl.java
View file @
d0037d5e
...
...
@@ -91,9 +91,9 @@ public class TopicnewsServiceImpl extends ServiceImpl<TopicnewsDao, TopicnewsEnt
@Override
public
R
verifyTopic
(
NewsEntity
news
,
SysUserEntity
user
)
{
news
.
setAuditor
(
user
.
getUsername
());
//
news.setAuditor(user.getUsername());
news
.
setCheckdate
(
new
Date
());
news
.
setLasteditor
(
user
.
getUsername
());
//
news.setLasteditor(user.getUsername());
QueryWrapper
<
NewsEntity
>
newsEntityQueryWrapper
=
new
QueryWrapper
<>();
newsEntityQueryWrapper
.
eq
(
"id"
,
news
.
getId
());
newsDao
.
update
(
news
,
newsEntityQueryWrapper
);
...
...
src/main/java/io/office/modules/sys/service/impl/SysUserTokenServiceImpl.java
View file @
d0037d5e
...
...
@@ -29,7 +29,6 @@ public class SysUserTokenServiceImpl extends ServiceImpl<SysUserTokenDao, SysUse
public
R
createToken
(
long
userId
)
{
//生成一个token
String
token
=
TokenGenerator
.
generateValue
();
//当前时间
Date
now
=
new
Date
();
//过期时间
...
...
src/main/resources/application.yml
View file @
d0037d5e
...
...
@@ -71,6 +71,6 @@ logging:
mybatis
:
debug
dao
:
debug
token.count
:
3
src/main/resources/mapper/manage/TokenCountDao.xml
0 → 100644
View file @
d0037d5e
<?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=
"io.office.modules.manage.dao.TokenCountDao"
>
<!-- 可根据自己的需求,是否要使用 -->
<resultMap
type=
"io.office.modules.manage.entity.TokenCount"
id=
"tokenMap"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"token"
column=
"token"
/>
<result
property=
"createUser"
column=
"create_user"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"countFlag"
column=
"count_flag"
/>
</resultMap>
</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