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
1ee93933
Commit
1ee93933
authored
Jan 10, 2025
by
吴迪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
编辑字段 最后编辑字段 修改提交
parent
138975e0
Show whitespace changes
Inline
Side-by-side
Showing
34 changed files
with
949 additions
and
153 deletions
+949
-153
IPUtils.java
src/main/java/io/office/common/utils/IPUtils.java
+16
-0
IpReturnVo.java
src/main/java/io/office/common/utils/IpReturnVo.java
+167
-0
CheckGroup.java
...ain/java/io/office/common/validator/group/CheckGroup.java
+9
-0
CasesController.java
.../io/office/modules/manage/controller/CasesController.java
+12
-12
CodeagentController.java
...office/modules/manage/controller/CodeagentController.java
+7
-15
GlossaryController.java
.../office/modules/manage/controller/GlossaryController.java
+7
-14
HomePopupController.java
...office/modules/manage/controller/HomePopupController.java
+181
-0
KnowledgecategoryController.java
...odules/manage/controller/KnowledgecategoryController.java
+20
-18
KnowledgeinfoController.java
...ce/modules/manage/controller/KnowledgeinfoController.java
+9
-0
LogisticsController.java
...office/modules/manage/controller/LogisticsController.java
+8
-13
NewsController.java
...a/io/office/modules/manage/controller/NewsController.java
+3
-0
NewsMovieController.java
...office/modules/manage/controller/NewsMovieController.java
+2
-0
NewtopicController.java
.../office/modules/manage/controller/NewtopicController.java
+2
-0
PartnersController.java
.../office/modules/manage/controller/PartnersController.java
+12
-11
PlanBranchController.java
...ffice/modules/manage/controller/PlanBranchController.java
+1
-1
RetailController.java
...io/office/modules/manage/controller/RetailController.java
+11
-13
HomePopupDao.java
src/main/java/io/office/modules/manage/dao/HomePopupDao.java
+17
-0
HomePopupEntity.java
...java/io/office/modules/manage/entity/HomePopupEntity.java
+70
-0
ImportEntity.java
...in/java/io/office/modules/manage/entity/ImportEntity.java
+41
-0
WebsiteHitCountDetailEntity.java
...ce/modules/manage/entity/WebsiteHitCountDetailEntity.java
+18
-0
HomePopupForm.java
...ain/java/io/office/modules/manage/form/HomePopupForm.java
+80
-0
HomePopupService.java
...va/io/office/modules/manage/service/HomePopupService.java
+31
-0
AnnounceServiceImpl.java
...fice/modules/manage/service/impl/AnnounceServiceImpl.java
+8
-10
HomePopupServiceImpl.java
...ice/modules/manage/service/impl/HomePopupServiceImpl.java
+85
-0
NewtopicServiceImpl.java
...fice/modules/manage/service/impl/NewtopicServiceImpl.java
+1
-0
PolicyServiceImpl.java
...office/modules/manage/service/impl/PolicyServiceImpl.java
+4
-5
RetailpictureServiceImpl.java
...modules/manage/service/impl/RetailpictureServiceImpl.java
+9
-12
TopicnewsServiceImpl.java
...ice/modules/manage/service/impl/TopicnewsServiceImpl.java
+1
-0
WebsiteHitCountDetailServiceImpl.java
...manage/service/impl/WebsiteHitCountDetailServiceImpl.java
+14
-4
SearchLimitUtil.java
.../java/io/office/modules/manage/utils/SearchLimitUtil.java
+5
-1
HomePopupDao.xml
src/main/resources/mapper/manage/HomePopupDao.xml
+23
-0
DynamicDataSourceTest.java
src/test/java/io/renren/DynamicDataSourceTest.java
+7
-3
JwtTest.java
src/test/java/io/renren/JwtTest.java
+68
-7
RedisTest.java
src/test/java/io/renren/RedisTest.java
+0
-14
No files found.
src/main/java/io/office/common/utils/IPUtils.java
View file @
1ee93933
...
...
@@ -7,6 +7,7 @@ package io.office.common.utils;
import
com.alibaba.druid.util.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.web.client.RestTemplate
;
import
javax.servlet.http.HttpServletRequest
;
...
...
@@ -57,4 +58,19 @@ public class IPUtils {
return
ip
;
}
public
static
IpReturnVo
getIpLocation
(
String
ip
)
{
RestTemplate
restTemplate
=
new
RestTemplate
();
IpReturnVo
ipReturnVo
=
restTemplate
.
getForObject
(
"http://ip-api.com/json/"
+
ip
,
IpReturnVo
.
class
);
return
ipReturnVo
;
}
}
src/main/java/io/office/common/utils/IpReturnVo.java
0 → 100644
View file @
1ee93933
package
io
.
office
.
common
.
utils
;
import
java.io.Serializable
;
/**
* @author wudi
* @date 2025/1/6
* @comment
*/
public
class
IpReturnVo
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* query : 54.71.187.124
* status : success
* country : United States
* countryCode : US
* region : OR
* regionName : Oregon
* city : Portland
* zip : 97207
* lat : 45.5235
* lon : -122.676
* timezone : America/Los_Angeles
* isp : Amazon.com, Inc.
* org : AWS EC2 (us-west-2)
* as : AS16509 Amazon.com, Inc.
*/
private
String
query
;
private
String
status
;
private
String
message
;
private
String
country
;
private
String
countryCode
;
private
String
region
;
private
String
regionName
;
private
String
city
;
private
String
zip
;
private
double
lat
;
private
double
lon
;
private
String
timezone
;
private
String
isp
;
private
String
org
;
private
String
as
;
public
String
getMessage
()
{
return
message
;
}
public
void
setMessage
(
String
message
)
{
this
.
message
=
message
;
}
public
String
getQuery
()
{
return
query
;
}
public
void
setQuery
(
String
query
)
{
this
.
query
=
query
;
}
public
String
getStatus
()
{
return
status
;
}
public
void
setStatus
(
String
status
)
{
this
.
status
=
status
;
}
public
String
getCountry
()
{
return
country
;
}
public
void
setCountry
(
String
country
)
{
this
.
country
=
country
;
}
public
String
getCountryCode
()
{
return
countryCode
;
}
public
void
setCountryCode
(
String
countryCode
)
{
this
.
countryCode
=
countryCode
;
}
public
String
getRegion
()
{
return
region
;
}
public
void
setRegion
(
String
region
)
{
this
.
region
=
region
;
}
public
String
getRegionName
()
{
return
regionName
;
}
public
void
setRegionName
(
String
regionName
)
{
this
.
regionName
=
regionName
;
}
public
String
getCity
()
{
return
city
;
}
public
void
setCity
(
String
city
)
{
this
.
city
=
city
;
}
public
String
getZip
()
{
return
zip
;
}
public
void
setZip
(
String
zip
)
{
this
.
zip
=
zip
;
}
public
double
getLat
()
{
return
lat
;
}
public
void
setLat
(
double
lat
)
{
this
.
lat
=
lat
;
}
public
double
getLon
()
{
return
lon
;
}
public
void
setLon
(
double
lon
)
{
this
.
lon
=
lon
;
}
public
String
getTimezone
()
{
return
timezone
;
}
public
void
setTimezone
(
String
timezone
)
{
this
.
timezone
=
timezone
;
}
public
String
getIsp
()
{
return
isp
;
}
public
void
setIsp
(
String
isp
)
{
this
.
isp
=
isp
;
}
public
String
getOrg
()
{
return
org
;
}
public
void
setOrg
(
String
org
)
{
this
.
org
=
org
;
}
public
String
getAs
()
{
return
as
;
}
public
void
setAs
(
String
as
)
{
this
.
as
=
as
;
}
}
src/main/java/io/office/common/validator/group/CheckGroup.java
0 → 100644
View file @
1ee93933
package
io
.
office
.
common
.
validator
.
group
;
/**
* @author wudi
* @date 2025/1/1
* @comment
*/
public
interface
CheckGroup
{
}
src/main/java/io/office/modules/manage/controller/CasesController.java
View file @
1ee93933
package
io
.
office
.
modules
.
manage
.
controller
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
cn.hutool.core.collection.CollectionUtil
;
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.common.utils.PageUtils
;
import
io.office.common.utils.R
;
import
io.office.modules.app.annotation.Login
;
import
io.office.modules.manage.entity.
Partner
sEntity
;
import
io.office.modules.manage.entity.
Case
sEntity
;
import
io.office.modules.manage.entity.TokenCount
;
import
io.office.modules.manage.entity.dto.NewsParams
;
import
io.office.modules.manage.service.CasesService
;
import
io.office.modules.manage.service.TokenCountService
;
import
io.office.modules.sys.controller.AbstractController
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -21,12 +19,14 @@ 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
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
io.office.modules.manage.entity.CasesEntity
;
import
io.office.modules.manage.service.CasesService
;
import
io.office.common.utils.PageUtils
;
import
io.office.common.utils.R
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -107,7 +107,7 @@ public class CasesController extends AbstractController {
@RequestMapping
(
"/update"
)
@RequiresPermissions
(
"standard:cases:update"
)
public
R
update
(
@RequestBody
CasesEntity
cases
){
cases
.
setEditor
(
getUser
().
getUsername
());
//
cases.setEditor(getUser().getUsername());
cases
.
setLasteditor
(
getUser
().
getUsername
());
cases
.
setUpdatedate
(
new
Date
());
casesService
.
updateById
(
cases
);
...
...
src/main/java/io/office/modules/manage/controller/CodeagentController.java
View file @
1ee93933
package
io
.
office
.
modules
.
manage
.
controller
;
import
java.util.Arrays
;
import
java.util.Map
;
import
com.baomidou.mybatisplus.core.conditions.Wrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
io.office.modules.manage.entity.CodeagentEntity
;
import
io.office.modules.manage.service.CodeagentService
;
import
io.office.common.utils.PageUtils
;
import
io.office.common.utils.R
;
import
io.office.modules.manage.entity.CodeagentEntity
;
import
io.office.modules.manage.service.CodeagentService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.Arrays
;
import
java.util.Map
;
...
...
src/main/java/io/office/modules/manage/controller/GlossaryController.java
View file @
1ee93933
package
io
.
office
.
modules
.
manage
.
controller
;
import
java.util.Arrays
;
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.common.utils.IPUtils
;
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.ProductEntity
;
import
io.office.modules.manage.entity.GlossaryEntity
;
import
io.office.modules.manage.entity.SearchgtinlogEntity
;
import
io.office.modules.manage.service.GlossaryService
;
import
io.office.modules.manage.service.SearchgtinlogService
;
import
io.office.modules.manage.vo.request.TerminologyVo
;
import
io.office.modules.manage.vo.request.TopicNewsPartyRequestVo
;
import
io.office.modules.sys.controller.AbstractController
;
import
io.office.modules.sys.service.SysCaptchaService
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -26,12 +21,10 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.*
;
import
io.office.modules.manage.entity.GlossaryEntity
;
import
io.office.modules.manage.service.GlossaryService
;
import
io.office.common.utils.PageUtils
;
import
io.office.common.utils.R
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
/**
...
...
@@ -98,7 +91,7 @@ public class GlossaryController extends AbstractController {
@RequestMapping
(
"/update"
)
@RequiresPermissions
(
"plate:glossary:update"
)
public
R
update
(
@RequestBody
GlossaryEntity
glossary
)
{
glossary
.
setEditor
(
getUser
().
getUsername
());
//
glossary.setEditor(getUser().getUsername());
glossary
.
setLasteditor
(
getUser
().
getUsername
());
glossary
.
setUpdatedate
(
new
Date
());
glossaryService
.
updateById
(
glossary
);
...
...
src/main/java/io/office/modules/manage/controller/HomePopupController.java
0 → 100644
View file @
1ee93933
package
io
.
office
.
modules
.
manage
.
controller
;
import
cn.afterturn.easypoi.excel.ExcelImportUtil
;
import
cn.afterturn.easypoi.excel.entity.ImportParams
;
import
cn.hutool.core.bean.BeanUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
io.office.common.annotation.SysLog
;
import
io.office.common.utils.PageUtils
;
import
io.office.common.utils.R
;
import
io.office.common.validator.ValidatorUtils
;
import
io.office.common.validator.group.AddGroup
;
import
io.office.common.validator.group.CheckGroup
;
import
io.office.common.validator.group.UpdateGroup
;
import
io.office.modules.manage.dao.WebsiteHitCountDetailDao
;
import
io.office.modules.manage.entity.HomePopupEntity
;
import
io.office.modules.manage.entity.ImportEntity
;
import
io.office.modules.manage.form.HomePopupForm
;
import
io.office.modules.manage.service.HomePopupService
;
import
io.office.modules.sys.controller.AbstractController
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.io.File
;
import
java.io.FileInputStream
;
import
java.io.IOException
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Map
;
/**
* 首页弹窗表
*
* @author wudi
* @email 632132852@qq.com
* @date 2025-01-01 13:34:37
*/
@Slf4j
@RestController
@RequestMapping
(
"/homepopup"
)
public
class
HomePopupController
extends
AbstractController
{
@Autowired
private
HomePopupService
homePopupService
;
@Autowired
private
WebsiteHitCountDetailDao
websiteHitCountDetailDao
;
/**
* 列表
*/
@RequestMapping
(
"/list"
)
//@RequiresPermissions("manage:homepopup:list")
public
R
list
(
@RequestBody
Map
<
String
,
Object
>
params
)
{
PageUtils
page
=
homePopupService
.
queryPage
(
params
);
return
R
.
ok
().
put
(
"data"
,
page
);
}
/**
* 信息
*/
@RequestMapping
(
"/info/{id}"
)
//@RequiresPermissions("manage:homepopup:info")
public
R
info
(
@PathVariable
(
"id"
)
Long
id
)
{
HomePopupEntity
homePopup
=
homePopupService
.
getById
(
id
);
return
R
.
ok
().
put
(
"data"
,
homePopup
);
}
/**
* 保存
*/
@SysLog
(
"保存首页弹窗表"
)
@RequestMapping
(
"/save"
)
//@RequiresPermissions("manage:homepopup:save")
public
R
save
(
@RequestBody
HomePopupForm
homePopup
)
{
//校验参数
ValidatorUtils
.
validateEntity
(
homePopup
,
AddGroup
.
class
);
//转化实体对象
HomePopupEntity
homePopupEntity
=
new
HomePopupEntity
();
BeanUtil
.
copyProperties
(
homePopup
,
homePopupEntity
);
homePopupService
.
saveHomePopup
(
homePopupEntity
,
getUser
());
return
R
.
ok
();
}
/**
* 修改
*/
@SysLog
(
"修改首页弹窗表"
)
@RequestMapping
(
"/update"
)
//@RequiresPermissions("manage:homepopup:update")
public
R
update
(
@RequestBody
HomePopupForm
homePopup
)
{
ValidatorUtils
.
validateEntity
(
homePopup
,
UpdateGroup
.
class
);
//转化实体对象
HomePopupEntity
homePopupEntity
=
new
HomePopupEntity
();
BeanUtil
.
copyProperties
(
homePopup
,
homePopupEntity
);
homePopupService
.
updateHomePopupById
(
homePopupEntity
,
getUser
());
return
R
.
ok
();
}
/**
* 删除
*/
@SysLog
(
"删除首页弹窗表"
)
@RequestMapping
(
"/delete"
)
//@RequiresPermissions("manage:homepopup:delete")
public
R
delete
(
@RequestBody
String
[]
ids
)
{
homePopupService
.
removeByIds
(
Arrays
.
asList
(
ids
));
return
R
.
ok
();
}
@SysLog
(
"审核首页弹窗表"
)
@Transactional
@RequestMapping
(
"/verify"
)
public
R
verify
(
@RequestBody
HomePopupForm
homePopup
)
{
ValidatorUtils
.
validateEntity
(
homePopup
,
CheckGroup
.
class
);
homePopupService
.
verifyHomePopup
(
homePopup
,
getUser
());
return
R
.
ok
();
}
@RequestMapping
(
"/api/getHomePopup"
)
public
R
getHomePopup
()
{
// 使用 Wrapper 来定义查询条件
QueryWrapper
<
HomePopupEntity
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"status"
,
1
);
HomePopupEntity
homePopup
=
homePopupService
.
getOne
(
queryWrapper
);
return
R
.
ok
().
put
(
"data"
,
homePopup
);
}
@RequestMapping
(
"/api/test"
)
public
R
getHomePopupList
()
throws
IOException
{
File
file
=
new
File
(
"/Users/wudi/Desktop/副本英文页面访问量.xlsx"
);
if
(!
file
.
exists
())
{
throw
new
IOException
(
"文件不存在"
);
}
ImportParams
params
=
new
ImportParams
();
params
.
setTitleRows
(
1
);
// 如果有标题行,指定标题行数
params
.
setHeadRows
(
1
);
// 指定表头行数
try
{
FileInputStream
fis
=
new
FileInputStream
(
file
);
List
<
ImportEntity
>
users
=
ExcelImportUtil
.
importExcel
(
fis
,
ImportEntity
.
class
,
params
);
// 将User实体转换为WebsiteHitCountDetail实体(假设需要这种转换)
for
(
ImportEntity
user
:
users
)
{
System
.
out
.
println
(
user
);
System
.
out
.
println
(
"成功导入 "
+
users
.
size
()
+
" 条记录并保存到数据库"
);
//IpReturnVo ipReturnVo = IPUtils.getIpLocation(user.getIp());
//if (ipReturnVo.getStatus().equals("success")) {
//
//
//
//}
}
System
.
out
.
println
(
"成功导入 "
+
users
.
size
()
+
" 条记录并保存到数据库"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
R
.
ok
();
}
}
src/main/java/io/office/modules/manage/controller/KnowledgecategoryController.java
View file @
1ee93933
...
...
@@ -13,7 +13,6 @@ import java.util.List;
import
java.util.Map
;
/**
* ${comments}
*
...
...
@@ -32,7 +31,7 @@ public class KnowledgecategoryController {
*/
@RequestMapping
(
"/list"
)
// @RequiresPermissions("manage:knowledgecategory:list")
public
R
list
(
@RequestParam
Map
<
String
,
Object
>
params
){
public
R
list
(
@RequestParam
Map
<
String
,
Object
>
params
)
{
PageUtils
page
=
knowledgecategoryService
.
queryPage
(
params
);
return
R
.
ok
().
put
(
"data"
,
page
);
...
...
@@ -44,7 +43,7 @@ public class KnowledgecategoryController {
*/
@RequestMapping
(
"/info/{knowledgecategoryid}"
)
// @RequiresPermissions("manage:knowledgecategory:info")
public
R
info
(
@PathVariable
(
"knowledgecategoryid"
)
Integer
knowledgecategoryid
){
public
R
info
(
@PathVariable
(
"knowledgecategoryid"
)
Integer
knowledgecategoryid
)
{
KnowledgecategoryEntity
knowledgecategory
=
knowledgecategoryService
.
getById
(
knowledgecategoryid
);
return
R
.
ok
().
put
(
"data"
,
knowledgecategory
);
...
...
@@ -55,7 +54,7 @@ public class KnowledgecategoryController {
*/
@RequestMapping
(
"/save"
)
// @RequiresPermissions("manage:knowledgecategory:save")
public
R
save
(
@RequestBody
KnowledgecategoryEntity
knowledgecategory
){
public
R
save
(
@RequestBody
KnowledgecategoryEntity
knowledgecategory
)
{
knowledgecategoryService
.
save
(
knowledgecategory
);
return
R
.
ok
();
...
...
@@ -66,7 +65,7 @@ public class KnowledgecategoryController {
*/
@RequestMapping
(
"/update"
)
// @RequiresPermissions("manage:knowledgecategory:update")
public
R
update
(
@RequestBody
KnowledgecategoryEntity
knowledgecategory
){
public
R
update
(
@RequestBody
KnowledgecategoryEntity
knowledgecategory
)
{
knowledgecategoryService
.
updateById
(
knowledgecategory
);
return
R
.
ok
();
...
...
@@ -77,7 +76,7 @@ public class KnowledgecategoryController {
*/
@RequestMapping
(
"/delete"
)
// @RequiresPermissions("manage:knowledgecategory:delete")
public
R
delete
(
@RequestBody
Integer
[]
knowledgecategoryids
){
public
R
delete
(
@RequestBody
Integer
[]
knowledgecategoryids
)
{
knowledgecategoryService
.
removeByIds
(
Arrays
.
asList
(
knowledgecategoryids
));
return
R
.
ok
();
...
...
@@ -89,20 +88,26 @@ public class KnowledgecategoryController {
*/
@RequestMapping
(
"/getFirstLevelCategory"
)
// @RequiresPermissions("manage:knowledgecategory:getFirstLevelCategory")
public
R
getFirstLevelCategory
(){
public
R
getFirstLevelCategory
()
{
QueryWrapper
<
KnowledgecategoryEntity
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"categorylevels"
,
"1"
);
return
R
.
ok
().
put
(
"data"
,
knowledgecategoryService
.
list
(
queryWrapper
));
queryWrapper
.
eq
(
"categorylevels"
,
"1"
);
return
R
.
ok
().
put
(
"data"
,
knowledgecategoryService
.
list
(
queryWrapper
));
}
@RequestMapping
(
"/getSecondLevelCategory"
)
// @RequiresPermissions("manage:knowledgecategory:getFirstLevelCategory")
public
R
getSecondLevelCategory
(
@RequestBody
KnowledgecategoryEntity
knowledgecategory
){
public
R
getSecondLevelCategory
(
@RequestBody
KnowledgecategoryEntity
knowledgecategory
)
{
QueryWrapper
<
KnowledgecategoryEntity
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"categorylevels"
,
"2"
);
queryWrapper
.
eq
(
"parentCategoryID"
,
knowledgecategory
.
getParentcategoryid
());
queryWrapper
.
eq
(
"categorylevels"
,
"2"
);
queryWrapper
.
eq
(
"parentCategoryID"
,
knowledgecategory
.
getParentcategoryid
());
if
(
knowledgecategory
.
getParentcategoryid
()
==
104
)
{
queryWrapper
.
orderByAsc
(
"orderNum"
);
queryWrapper
.
isNotNull
(
"orderNum"
);
}
return
R
.
ok
().
put
(
"data"
,
knowledgecategoryService
.
list
(
queryWrapper
));
return
R
.
ok
().
put
(
"data"
,
knowledgecategoryService
.
list
(
queryWrapper
));
}
...
...
@@ -110,13 +115,10 @@ public class KnowledgecategoryController {
* 给前端显示使用
*/
@RequestMapping
(
"/api/getSecondCategoryList"
)
public
R
getCategoryList
(
@RequestBody
KnowledgecategoryEntity
knowledgecategory
){
public
R
getCategoryList
(
@RequestBody
KnowledgecategoryEntity
knowledgecategory
)
{
List
<
KnowledgecategoryEntity
>
categoryList
=
knowledgecategoryService
.
getCategoryList
(
knowledgecategory
);
return
R
.
ok
().
put
(
"data"
,
categoryList
);
return
R
.
ok
().
put
(
"data"
,
categoryList
);
}
}
src/main/java/io/office/modules/manage/controller/KnowledgeinfoController.java
View file @
1ee93933
...
...
@@ -150,4 +150,13 @@ public class KnowledgeinfoController extends AbstractController {
return
R
.
ok
().
put
(
"data"
,
knowledgeInfoList
);
}
@RequestMapping
(
"/api/info/{knowledgeinfoid}"
)
// @RequiresPermissions("manage:knowledgeinfo:info")
public
R
apiInfo
(
@PathVariable
(
"knowledgeinfoid"
)
Integer
knowledgeinfoid
){
KnowledgeinfoEntity
knowledgeinfo
=
knowledgeinfoService
.
knowledgeinfoById
(
knowledgeinfoid
);
return
R
.
ok
().
put
(
"data"
,
knowledgeinfo
);
}
}
src/main/java/io/office/modules/manage/controller/LogisticsController.java
View file @
1ee93933
package
io
.
office
.
modules
.
manage
.
controller
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.sitech.idworkstarter.IdWorkService
;
import
io.office.common.annotation.SysLog
;
import
io.office.modules.manage.entity.NewsEntity
;
import
io.office.modules.manage.entity.ProductEntity
;
import
io.office.common.utils.PageUtils
;
import
io.office.common.utils.R
;
import
io.office.modules.manage.entity.LogisticsEntity
;
import
io.office.modules.manage.service.LogisticsService
;
import
io.office.modules.manage.service.NewsService
;
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.shiro.authz.annotation.RequiresPermissions
;
...
...
@@ -21,10 +17,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.*
;
import
io.office.modules.manage.entity.LogisticsEntity
;
import
io.office.modules.manage.service.LogisticsService
;
import
io.office.common.utils.PageUtils
;
import
io.office.common.utils.R
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
/**
...
...
@@ -91,7 +86,7 @@ public class LogisticsController extends AbstractController {
@RequiresPermissions
(
"manage:logistics:update"
)
public
R
update
(
@RequestBody
LogisticsEntity
logistics
){
String
username
=
getUser
().
getUsername
();
logistics
.
setEditor
(
username
);
//
logistics.setEditor(username);
logistics
.
setLasteditor
(
username
);
logistics
.
setUpdatetime
(
new
Date
());
logisticsService
.
updateById
(
logistics
);
...
...
src/main/java/io/office/modules/manage/controller/NewsController.java
View file @
1ee93933
...
...
@@ -97,6 +97,8 @@ public class NewsController extends AbstractController {
@RequiresPermissions
(
"manage:news:save"
)
public
R
save
(
@RequestBody
NewsEntity
news
)
{
try
{
news
.
setLasteditor
(
getUser
().
getUsername
());
news
.
setEditor
(
getUser
().
getUsername
());
R
r
=
this
.
newsService
.
insertNews
(
news
,
getUser
());
return
r
;
}
catch
(
Exception
e
)
{
...
...
@@ -114,6 +116,7 @@ public class NewsController extends AbstractController {
@RequiresPermissions
(
"manage:news:update"
)
public
R
update
(
@RequestBody
NewsEntity
news
)
{
try
{
news
.
setLasteditor
(
getUser
().
getUsername
());
R
r
=
this
.
newsService
.
updateNews
(
news
,
getUser
());
return
r
;
}
catch
(
Exception
e
)
{
...
...
src/main/java/io/office/modules/manage/controller/NewsMovieController.java
View file @
1ee93933
...
...
@@ -72,6 +72,8 @@ public class NewsMovieController extends AbstractController {
@RequiresPermissions
(
"manage:newsmovie:save"
)
public
R
save
(
@RequestBody
NewsMovieEntityVo
newsMovieEntityVo
)
{
SysUserEntity
user
=
getUser
();
newsMovieEntityVo
.
setEditor
(
user
.
getUsername
());
newsMovieEntityVo
.
setLasteditor
(
user
.
getUsername
());
newsMovieService
.
insert
(
newsMovieEntityVo
,
user
);
return
R
.
ok
();
}
...
...
src/main/java/io/office/modules/manage/controller/NewtopicController.java
View file @
1ee93933
...
...
@@ -70,6 +70,8 @@ public class NewtopicController extends AbstractController {
@RequestMapping
(
"/save"
)
@RequiresPermissions
(
"manage:newtopic:save"
)
public
R
save
(
@RequestBody
NewtopicEntityVo
newtopicVo
)
{
newtopicVo
.
setEditor
(
getUser
().
getUsername
());
newtopicVo
.
setLasteditor
(
getUser
().
getUsername
());
newtopicService
.
insert
(
newtopicVo
,
getUser
());
return
R
.
ok
(
"新增成功"
);
}
...
...
src/main/java/io/office/modules/manage/controller/PartnersController.java
View file @
1ee93933
package
io
.
office
.
modules
.
manage
.
controller
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
cn.hutool.core.collection.CollectionUtil
;
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.common.utils.PageUtils
;
import
io.office.common.utils.R
;
import
io.office.modules.app.annotation.Login
;
import
io.office.modules.manage.entity.
Retailpicture
Entity
;
import
io.office.modules.manage.entity.
Partners
Entity
;
import
io.office.modules.manage.entity.TokenCount
;
import
io.office.modules.manage.entity.dto.NewsParams
;
import
io.office.modules.manage.service.PartnersService
;
import
io.office.modules.manage.service.TokenCountService
;
import
io.office.modules.sys.controller.AbstractController
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -20,12 +19,14 @@ 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
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
io.office.modules.manage.entity.PartnersEntity
;
import
io.office.modules.manage.service.PartnersService
;
import
io.office.common.utils.PageUtils
;
import
io.office.common.utils.R
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -104,7 +105,7 @@ public class PartnersController extends AbstractController {
@RequestMapping
(
"/update"
)
@RequiresPermissions
(
"standard:partners:update"
)
public
R
update
(
@RequestBody
PartnersEntity
partners
){
partners
.
setEditor
(
getUser
().
getUsername
());
//
partners.setEditor(getUser().getUsername());
partners
.
setLasteditor
(
getUser
().
getUsername
());
partners
.
setUpdatedate
(
new
Date
());
partnersService
.
updateById
(
partners
);
...
...
src/main/java/io/office/modules/manage/controller/PlanBranchController.java
View file @
1ee93933
...
...
@@ -8,7 +8,6 @@ import io.office.modules.manage.entity.PlanBranchEntity;
import
io.office.modules.manage.service.PlanBranchService
;
import
io.office.modules.manage.vo.request.PlanBranchVo
;
import
io.office.modules.sys.controller.AbstractController
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.PathVariable
;
...
...
@@ -76,6 +75,7 @@ public class PlanBranchController extends AbstractController {
@RequestMapping
(
"/update"
)
// @RequiresPermissions("manage:planbranch:update")
public
R
update
(
@RequestBody
PlanBranchEntity
planBranch
){
planBranch
.
setLasteditor
(
getUser
().
getUsername
());
planBranchService
.
updateById
(
planBranch
);
return
R
.
ok
();
...
...
src/main/java/io/office/modules/manage/controller/RetailController.java
View file @
1ee93933
package
io
.
office
.
modules
.
manage
.
controller
;
import
java.util.Arrays
;
import
java.util.Map
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
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.NewsEntity
;
import
io.office.modules.manage.entity.dto.NewsParams
;
import
io.office.modules.manage.vo.request.RetailEntityVo
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
io.office.modules.manage.entity.RetailEntity
;
import
io.office.modules.manage.service.RetailService
;
import
io.office.modules.sys.controller.AbstractController
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
io.office.modules.manage.entity.RetailEntity
;
import
io.office.modules.manage.service.RetailService
;
import
io.office.common.utils.PageUtils
;
import
io.office.common.utils.R
;
import
java.util.Arrays
;
import
java.util.Map
;
/**
...
...
@@ -27,7 +22,7 @@ import io.office.common.utils.R;
*/
@RestController
@RequestMapping
(
"/retail"
)
public
class
RetailController
{
public
class
RetailController
extends
AbstractController
{
@Autowired
private
RetailService
retailService
;
...
...
@@ -60,6 +55,8 @@ public class RetailController {
@RequestMapping
(
"/save"
)
// @RequiresPermissions("manage:retail:save")
public
R
save
(
@RequestBody
RetailEntity
retail
)
{
retail
.
setEditor
(
getUser
().
getUsername
());
retail
.
setLasteditor
(
getUser
().
getUsername
());
retail
.
setStatus
(
0
);
retailService
.
save
(
retail
);
...
...
@@ -72,6 +69,7 @@ public class RetailController {
@RequestMapping
(
"/update"
)
// @RequiresPermissions("manage:retail:update")
public
R
update
(
@RequestBody
RetailEntity
retail
)
{
retail
.
setLasteditor
(
getUser
().
getUsername
());
retailService
.
updateById
(
retail
);
return
R
.
ok
();
...
...
src/main/java/io/office/modules/manage/dao/HomePopupDao.java
0 → 100644
View file @
1ee93933
package
io
.
office
.
modules
.
manage
.
dao
;
import
io.office.modules.manage.entity.HomePopupEntity
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Mapper
;
/**
* 首页弹窗表
*
* @author wudi
* @email 632132852@qq.com
* @date 2025-01-01 13:34:37
*/
@Mapper
public
interface
HomePopupDao
extends
BaseMapper
<
HomePopupEntity
>
{
}
src/main/java/io/office/modules/manage/entity/HomePopupEntity.java
0 → 100644
View file @
1ee93933
package
io
.
office
.
modules
.
manage
.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* 首页弹窗表
*
* @author wudi
* @email 632132852@qq.com
* @date 2025-01-01 13:34:37
*/
@Data
@TableName
(
"t_home_popup"
)
public
class
HomePopupEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 主键
*/
@TableId
(
type
=
IdType
.
INPUT
)
private
String
id
;
/**
* 弹窗标题
*/
private
String
title
;
/**
* 弹窗内容
*/
private
String
content
;
/**
* 显示时间戳
*/
private
String
showtime
;
/**
* 作者
*/
private
String
author
;
/**
* 编辑
*/
private
String
editor
;
/**
* 最后编辑
*/
private
String
lastEditor
;
/**
* 审核人
*/
private
String
checker
;
/**
* 状态 -1 失败 0 待审核 1成功
*/
private
Integer
status
;
/**
* 创建时间
*/
private
String
createTime
;
/**
* 修改时间
*/
private
String
updateTime
;
private
String
checkTime
;
}
src/main/java/io/office/modules/manage/entity/ImportEntity.java
0 → 100644
View file @
1ee93933
package
io
.
office
.
modules
.
manage
.
entity
;
import
cn.afterturn.easypoi.excel.annotation.Excel
;
/**
* @author wudi
* @date 2025/1/6
* @comment
*/
public
class
ImportEntity
{
@Excel
(
name
=
"ip"
,
orderNum
=
"0"
)
private
String
ip
;
@Excel
(
name
=
"route"
,
orderNum
=
"2"
)
private
String
route
;
public
String
getIp
()
{
return
ip
;
}
public
void
setIp
(
String
ip
)
{
this
.
ip
=
ip
;
}
public
String
getRoute
()
{
return
route
;
}
public
void
setRoute
(
String
route
)
{
this
.
route
=
route
;
}
@Override
public
String
toString
()
{
return
"ImportEntity{"
+
"ip='"
+
ip
+
'\''
+
", route='"
+
route
+
'\''
+
'}'
;
}
}
src/main/java/io/office/modules/manage/entity/WebsiteHitCountDetailEntity.java
View file @
1ee93933
package
io
.
office
.
modules
.
manage
.
entity
;
import
cn.afterturn.easypoi.excel.annotation.Excel
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
...
...
@@ -28,18 +29,35 @@ public class WebsiteHitCountDetailEntity implements Serializable {
/**
* ip地址
*/
@Excel
(
name
=
"ip"
,
orderNum
=
"0"
)
private
String
ip
;
/**
* 点击时间
*/
private
Date
createTime
;
/**
* 路由地址
*/
@Excel
(
name
=
"route"
,
orderNum
=
"2"
)
private
String
route
;
/**
* 访问具体路径
*/
private
String
path
;
private
String
ipCountry
;
private
String
ipCountryCode
;
private
String
resultJson
;
private
String
isAnalysis
;
}
src/main/java/io/office/modules/manage/form/HomePopupForm.java
0 → 100644
View file @
1ee93933
package
io
.
office
.
modules
.
manage
.
form
;
import
io.office.common.validator.group.AddGroup
;
import
io.office.common.validator.group.CheckGroup
;
import
io.office.common.validator.group.UpdateGroup
;
import
lombok.Data
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
java.io.Serializable
;
/**
* 首页弹窗表
*
* @author wudi
* @email 632132852@qq.com
* @date 2025-01-01 13:34:37
*/
@Data
public
class
HomePopupForm
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 主键
*/
@NotBlank
(
message
=
"主键不能为空"
,
groups
=
{
UpdateGroup
.
class
,
CheckGroup
.
class
})
private
String
id
;
/**
* 弹窗标题
*/
@NotBlank
(
message
=
"标题不能为空"
,
groups
=
{
UpdateGroup
.
class
,
AddGroup
.
class
})
private
String
title
;
/**
* 弹窗内容
*/
@NotBlank
(
message
=
"内容不能为空"
,
groups
=
{
UpdateGroup
.
class
,
AddGroup
.
class
})
private
String
content
;
/**
* 显示时间戳
*/
@NotBlank
(
message
=
"显示时间不能为空"
,
groups
=
{
UpdateGroup
.
class
,
AddGroup
.
class
})
private
String
showtime
;
/**
* 作者
*/
@NotBlank
(
message
=
"作者不能为空"
,
groups
=
{
UpdateGroup
.
class
,
AddGroup
.
class
})
private
String
author
;
/**
* 编辑
*/
private
String
editor
;
/**
* 最后编辑
*/
private
String
lastEditor
;
/**
* 审核人
*/
@NotBlank
(
message
=
"审核人不能为空"
)
private
String
checker
;
/**
* 状态 -1 失败 0 待审核 1成功
*/
@NotNull
(
message
=
"审核人不能为空"
,
groups
=
{
CheckGroup
.
class
})
private
Integer
status
;
/**
* 创建时间
*/
private
String
createTime
;
/**
* 修改时间
*/
private
String
updateTime
;
/**
* 审核时间
*/
private
String
checkTime
;
}
src/main/java/io/office/modules/manage/service/HomePopupService.java
0 → 100644
View file @
1ee93933
package
io
.
office
.
modules
.
manage
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
io.office.common.utils.PageUtils
;
import
io.office.modules.manage.entity.HomePopupEntity
;
import
io.office.modules.manage.form.HomePopupForm
;
import
io.office.modules.sys.entity.SysUserEntity
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.Map
;
/**
* 首页弹窗表
*
* @author wudi
* @email 632132852@qq.com
* @date 2025-01-01 13:34:37
*/
public
interface
HomePopupService
extends
IService
<
HomePopupEntity
>
{
PageUtils
queryPage
(
Map
<
String
,
Object
>
params
);
@Transactional
void
saveHomePopup
(
HomePopupEntity
homePopupEntity
,
SysUserEntity
loginUser
);
@Transactional
void
updateHomePopupById
(
HomePopupEntity
homePopupEntity
,
SysUserEntity
loginUser
);
void
verifyHomePopup
(
HomePopupForm
homePopup
,
SysUserEntity
user
);
}
src/main/java/io/office/modules/manage/service/impl/AnnounceServiceImpl.java
View file @
1ee93933
package
io
.
office
.
modules
.
manage
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
io.office.common.utils.PageUtils
;
import
io.office.common.utils.Query
;
import
io.office.common.utils.R
;
import
io.office.modules.manage.entity.NewsEntity
;
import
io.office.modules.manage.dao.AnnounceDao
;
import
io.office.modules.manage.entity.AnnounceEntity
;
import
io.office.modules.manage.entity.dto.NewsParams
;
import
io.office.modules.manage.service.AnnounceService
;
import
io.office.modules.sys.entity.SysUserEntity
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -11,15 +18,6 @@ import org.springframework.stereotype.Service;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
io.office.common.utils.PageUtils
;
import
io.office.common.utils.Query
;
import
io.office.modules.manage.dao.AnnounceDao
;
import
io.office.modules.manage.entity.AnnounceEntity
;
import
io.office.modules.manage.service.AnnounceService
;
@Service
(
"announceService"
)
...
...
src/main/java/io/office/modules/manage/service/impl/HomePopupServiceImpl.java
0 → 100644
View file @
1ee93933
package
io
.
office
.
modules
.
manage
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.sitech.idworkstarter.IdWorkService
;
import
io.office.common.utils.DateUtils
;
import
io.office.common.utils.PageUtils
;
import
io.office.common.utils.Query
;
import
io.office.modules.manage.dao.HomePopupDao
;
import
io.office.modules.manage.entity.HomePopupEntity
;
import
io.office.modules.manage.form.HomePopupForm
;
import
io.office.modules.manage.service.HomePopupService
;
import
io.office.modules.manage.utils.IdKeysConstant
;
import
io.office.modules.sys.entity.SysUserEntity
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
import
java.util.Map
;
@Service
(
"homePopupService"
)
public
class
HomePopupServiceImpl
extends
ServiceImpl
<
HomePopupDao
,
HomePopupEntity
>
implements
HomePopupService
{
@Autowired
IdWorkService
idWorkService
;
@Override
public
PageUtils
queryPage
(
Map
<
String
,
Object
>
params
)
{
IPage
<
HomePopupEntity
>
page
=
this
.
page
(
new
Query
<
HomePopupEntity
>().
getPage
(
params
),
new
QueryWrapper
<
HomePopupEntity
>()
.
like
(
StringUtils
.
isNotBlank
(
params
.
get
(
"title"
)!=
null
?
params
.
get
(
"title"
).
toString
():
""
),
"title"
,
params
.
get
(
"title"
).
toString
())
.
like
(
StringUtils
.
isNotBlank
(
params
.
get
(
"content"
)!=
null
?
params
.
get
(
"content"
).
toString
():
""
),
"content"
,
params
.
get
(
"content"
).
toString
())
.
eq
(
params
.
get
(
"status"
)!=
null
&&
StringUtils
.
isNotBlank
(
params
.
get
(
"status"
).
toString
()),
"status"
,
params
.
get
(
"status"
))
);
return
new
PageUtils
(
page
);
}
@Override
public
void
updateHomePopupById
(
HomePopupEntity
homePopupEntity
,
SysUserEntity
loginUser
)
{
homePopupEntity
.
setUpdateTime
(
DateUtils
.
format
(
new
Date
(),
DateUtils
.
DATE_TIME_PATTERN
));
homePopupEntity
.
setLastEditor
(
loginUser
.
getUsername
());
homePopupEntity
.
setUpdateTime
(
DateUtils
.
format
(
new
Date
(),
DateUtils
.
DATE_TIME_PATTERN
));
baseMapper
.
updateById
(
homePopupEntity
);
}
@Override
public
void
verifyHomePopup
(
HomePopupForm
homePopup
,
SysUserEntity
user
)
{
UpdateWrapper
<
HomePopupEntity
>
wrapper
=
new
UpdateWrapper
<>();
wrapper
.
set
(
"checker"
,
user
.
getUsername
())
.
set
(
"check_time"
,
DateUtils
.
format
(
new
Date
(),
DateUtils
.
DATE_TIME_PATTERN
))
.
set
(
"status"
,
homePopup
.
getStatus
())
.
eq
(
"id"
,
homePopup
.
getId
())
;
baseMapper
.
update
(
null
,
wrapper
);
//其余成功状态的都设置为失败
if
(
homePopup
.
getStatus
()==
1
){
UpdateWrapper
<
HomePopupEntity
>
wrapper1
=
new
UpdateWrapper
<>();
wrapper1
.
set
(
"status"
,
-
1
)
.
eq
(
"status"
,
1
)
.
ne
(
"id"
,
homePopup
.
getId
())
;
baseMapper
.
update
(
null
,
wrapper1
);
}
}
@Override
public
void
saveHomePopup
(
HomePopupEntity
homePopupEntity
,
SysUserEntity
loginUser
)
{
homePopupEntity
.
setId
(
idWorkService
.
getSEQByKey
(
IdKeysConstant
.
ID_SEQ_KEY
));
homePopupEntity
.
setAuthor
(
loginUser
.
getUsername
());
homePopupEntity
.
setStatus
(
0
);
homePopupEntity
.
setCreateTime
(
DateUtils
.
format
(
new
Date
(),
DateUtils
.
DATE_TIME_PATTERN
));
homePopupEntity
.
setUpdateTime
(
DateUtils
.
format
(
new
Date
(),
DateUtils
.
DATE_TIME_PATTERN
));
baseMapper
.
insert
(
homePopupEntity
);
}
}
src/main/java/io/office/modules/manage/service/impl/NewtopicServiceImpl.java
View file @
1ee93933
...
...
@@ -95,6 +95,7 @@ public class NewtopicServiceImpl extends ServiceImpl<NewtopicDao, NewtopicEntity
newtopicEntityVo
.
setTime
(
date
);
//newtopicEntityVo.setLasteditor(user.getUsername());
newtopicEntityVo
.
setEditor
(
user
.
getUsername
());
newtopicEntityVo
.
setLasteditor
(
user
.
getUsername
());
newtopicEntityVo
.
setLastupdate
(
date
);
NewtopicEntity
newtopicEntity
=
new
NewtopicEntity
();
BeanUtils
.
copyProperties
(
newtopicEntityVo
,
newtopicEntity
);
...
...
src/main/java/io/office/modules/manage/service/impl/PolicyServiceImpl.java
View file @
1ee93933
package
io
.
office
.
modules
.
manage
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.office.common.utils.DateUtils
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
io.office.common.utils.PageUtils
;
import
io.office.common.utils.Query
;
import
io.office.common.utils.R
;
...
...
@@ -19,9 +21,6 @@ import org.springframework.stereotype.Service;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
@Service
(
"policyService"
)
...
...
@@ -62,7 +61,7 @@ public class PolicyServiceImpl extends ServiceImpl<PolicyDao, PolicyEntity> impl
}
QueryWrapper
<
PolicyEntity
>
newsEntityQueryWrapper
=
new
QueryWrapper
<>();
newsEntityQueryWrapper
.
eq
(
"id"
,
policy
.
getId
());
policy
.
setEditor
(
user
.
getUsername
());
//
policy.setEditor(user.getUsername());
policy
.
setLasteditor
(
user
.
getUsername
());
policy
.
setUpdatedate
(
new
Date
());
int
update
=
baseMapper
.
update
(
policy
,
newsEntityQueryWrapper
);
...
...
src/main/java/io/office/modules/manage/service/impl/RetailpictureServiceImpl.java
View file @
1ee93933
package
io
.
office
.
modules
.
manage
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
io.office.common.utils.PageUtils
;
import
io.office.common.utils.Query
;
import
io.office.common.utils.R
;
import
io.office.modules.manage.
entity.PictureEntity
;
import
io.office.modules.manage.entity.
dto.NewsParams
;
import
io.office.modules.manage.
dao.RetailpictureDao
;
import
io.office.modules.manage.entity.
RetailpictureEntity
;
import
io.office.modules.manage.entity.dto.RetailPictureParams
;
import
io.office.modules.manage.service.RetailpictureService
;
import
io.office.modules.sys.entity.SysUserEntity
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -12,15 +18,6 @@ import org.springframework.stereotype.Service;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
io.office.common.utils.PageUtils
;
import
io.office.common.utils.Query
;
import
io.office.modules.manage.dao.RetailpictureDao
;
import
io.office.modules.manage.entity.RetailpictureEntity
;
import
io.office.modules.manage.service.RetailpictureService
;
@Service
(
"retailpictureService"
)
...
...
@@ -59,7 +56,7 @@ public class RetailpictureServiceImpl extends ServiceImpl<RetailpictureDao, Reta
}
QueryWrapper
<
RetailpictureEntity
>
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
){
...
...
src/main/java/io/office/modules/manage/service/impl/TopicnewsServiceImpl.java
View file @
1ee93933
...
...
@@ -54,6 +54,7 @@ public class TopicnewsServiceImpl extends ServiceImpl<TopicnewsDao, TopicnewsEnt
news
.
setClassid
(
35
);
news
.
setStatus
(
0
);
news
.
setEditor
(
user
.
getUsername
());
news
.
setLasteditor
(
user
.
getUsername
());
newsService
.
insertNews
(
news
,
user
);
topicnewsEntity
.
setNewsid
(
news
.
getId
());
topicnewsEntity
.
setNewslevels
(
news
.
getLevels
());
...
...
src/main/java/io/office/modules/manage/service/impl/WebsiteHitCountDetailServiceImpl.java
View file @
1ee93933
package
io
.
office
.
modules
.
manage
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.sitech.idworkstarter.IdWorkService
;
import
io.office.common.utils.IPUtils
;
import
io.office.common.utils.IpReturnVo
;
import
io.office.common.utils.PageUtils
;
import
io.office.common.utils.Query
;
import
io.office.modules.manage.dao.WebsiteHitCountDetailDao
;
...
...
@@ -31,6 +33,9 @@ public class WebsiteHitCountDetailServiceImpl extends ServiceImpl<WebsiteHitCoun
@Autowired
IdWorkService
idWorkService
;
@Value
(
"${ipStart}"
)
private
String
ipStart
;
@Override
public
PageUtils
queryPage
(
Map
<
String
,
Object
>
params
)
{
IPage
<
WebsiteHitCountDetailEntity
>
page
=
this
.
page
(
...
...
@@ -41,7 +46,6 @@ public class WebsiteHitCountDetailServiceImpl extends ServiceImpl<WebsiteHitCoun
return
new
PageUtils
(
page
);
}
@Override
public
void
updateWebsiteHitCountDetailById
(
WebsiteHitCountDetailEntity
websiteHitCountDetailEntity
,
SysUserEntity
loginUser
)
{
//websiteHitCountDetailEntity.setUpdateTime(new Date());
...
...
@@ -50,9 +54,6 @@ public class WebsiteHitCountDetailServiceImpl extends ServiceImpl<WebsiteHitCoun
//baseMapper.updateById(websiteHitCountDetailEntity);
}
@Value
(
"${ipStart}"
)
private
String
ipStart
;
@Override
public
Page
<
WebsiteHitCountDetailForm
>
getListPage
(
WebsiteHitCountDetailForm
websiteHitCountDetailForm
,
Page
page
)
{
//page.setTotal(baseMapper.getListPageCount(websiteHitCountDetailForm));
...
...
@@ -71,11 +72,20 @@ public class WebsiteHitCountDetailServiceImpl extends ServiceImpl<WebsiteHitCoun
return
baseMapper
.
getTotalCount
(
websiteHitCountDetailForm
);
}
@Override
public
void
saveWebsiteHitCountDetail
(
WebsiteHitCountDetailEntity
websiteHitCountDetailEntity
,
SysUserEntity
loginUser
,
HttpServletRequest
request
)
{
websiteHitCountDetailEntity
.
setId
(
idWorkService
.
getSEQByKey
(
"id_seq"
));
websiteHitCountDetailEntity
.
setIp
(
IPUtils
.
getIpAddr
(
request
));
websiteHitCountDetailEntity
.
setCreateTime
(
new
Date
());
IpReturnVo
ipReturnVo
=
IPUtils
.
getIpLocation
(
websiteHitCountDetailEntity
.
getIp
());
if
(
ipReturnVo
.
getStatus
().
equals
(
"success"
))
{
websiteHitCountDetailEntity
.
setIpCountry
(
ipReturnVo
.
getCountry
());
websiteHitCountDetailEntity
.
setIpCountryCode
(
ipReturnVo
.
getCountryCode
());
websiteHitCountDetailEntity
.
setResultJson
(
JSON
.
toJSONString
(
ipReturnVo
));
websiteHitCountDetailEntity
.
setIsAnalysis
(
"1"
);
}
baseMapper
.
insert
(
websiteHitCountDetailEntity
);
}
...
...
src/main/java/io/office/modules/manage/utils/SearchLimitUtil.java
View file @
1ee93933
...
...
@@ -2,12 +2,13 @@ package io.office.modules.manage.utils;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
io.office.common.utils.IPUtils
;
import
io.office.common.utils.
R
;
import
io.office.common.utils.
IpReturnVo
;
import
io.office.modules.manage.entity.SearchgtinlogEntity
;
import
io.office.modules.manage.service.SearchgtinlogService
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
org.springframework.web.client.RestTemplate
;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletRequest
;
...
...
@@ -74,4 +75,7 @@ public class SearchLimitUtil {
}
}
src/main/resources/mapper/manage/HomePopupDao.xml
0 → 100644
View file @
1ee93933
<?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.HomePopupDao"
>
<!-- 可根据自己的需求,是否要使用 -->
<resultMap
type=
"io.office.modules.manage.entity.HomePopupEntity"
id=
"homePopupMap"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"title"
column=
"title"
/>
<result
property=
"content"
column=
"content"
/>
<result
property=
"showtime"
column=
"showtime"
/>
<result
property=
"author"
column=
"author"
/>
<result
property=
"editor"
column=
"editor"
/>
<result
property=
"lastEditor"
column=
"last_editor"
/>
<result
property=
"checker"
column=
"checker"
/>
<result
property=
"status"
column=
"status"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"updateTime"
column=
"update_time"
/>
</resultMap>
</mapper>
\ No newline at end of file
src/test/java/io/renren/DynamicDataSourceTest.java
View file @
1ee93933
...
...
@@ -9,12 +9,10 @@
package
io
.
renren
;
import
com.sitech.idworkstarter.IdWorkAutoConfiguration
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.SpringBootConfiguration
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.context.ConfigurableApplicationContext
;
import
org.springframework.context.annotation.Import
;
import
org.springframework.test.context.junit4.SpringRunner
;
...
...
@@ -32,6 +30,12 @@ public class DynamicDataSourceTest {
@Test
public
void
contextLoads
()
{
System
.
out
.
println
(
"test"
);
}
}
src/test/java/io/renren/JwtTest.java
View file @
1ee93933
package
io
.
renren
;
import
cn.afterturn.easypoi.excel.ExcelImportUtil
;
import
cn.afterturn.easypoi.excel.entity.ImportParams
;
import
com.alibaba.fastjson.JSON
;
import
com.sitech.idworkstarter.IdWorkAutoConfiguration
;
import
com.sitech.idworkstarter.IdWorkService
;
import
io.office.modules.manage.utils.IdKeysConstant
;
import
io.office.common.utils.IPUtils
;
import
io.office.common.utils.IpReturnVo
;
import
io.office.modules.manage.dao.WebsiteHitCountDetailDao
;
import
io.office.modules.manage.entity.WebsiteHitCountDetailEntity
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.context.annotation.Import
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
javax.annotation.Resource
;
import
java.io.File
;
import
java.io.FileInputStream
;
import
java.io.IOException
;
import
java.util.List
;
@RunWith
(
SpringRunner
.
class
)
...
...
@@ -20,14 +28,67 @@ import javax.annotation.Resource;
public
class
JwtTest
{
//@Resource
//IdWorkService idWorkService;
//@Test
//public void test() throws IllegalArgumentException {
// for (int i = 0; i < 100; i++) {
// System.out.println(idWorkService.getSEQByKey(IdKeysConstant.ID_SEQ_KEY));
// }
//
//}
@Resource
IdWorkService
idWorkService
;
WebsiteHitCountDetailDao
websiteHitCountDetailDao
;
//@Test
//public void contextLoads() throws IOException {
//
// try ( IPLocationService ipLocationService = new IPLocationService("path/to/GeoLite2-Country.mmdb") ) {
// System.out.println(ipLocationService.getCountryByIp("8.8.8.8")); // 示例IP地址
// } catch (IOException | GeoIp2Exception e) {
// e.printStackTrace();
// }
//}
//
@Test
public
void
test
()
throws
IllegalArgumentException
{
for
(
int
i
=
0
;
i
<
100
;
i
++)
{
System
.
out
.
println
(
idWorkService
.
getSEQByKey
(
IdKeysConstant
.
ID_SEQ_KEY
));
public
void
contextLoads
()
throws
IOException
{
File
file
=
new
File
(
"/Users/wudi/Desktop/副本英文页面访问量.xlsx"
);
if
(!
file
.
exists
())
{
throw
new
IOException
(
"文件不存在"
);
}
ImportParams
params
=
new
ImportParams
();
params
.
setTitleRows
(
1
);
// 如果有标题行,指定标题行数
params
.
setHeadRows
(
1
);
// 指定表头行数
try
(
FileInputStream
fis
=
new
FileInputStream
(
file
))
{
List
<
WebsiteHitCountDetailEntity
>
users
=
ExcelImportUtil
.
importExcel
(
fis
,
WebsiteHitCountDetailEntity
.
class
,
params
);
// 将User实体转换为WebsiteHitCountDetail实体(假设需要这种转换)
for
(
WebsiteHitCountDetailEntity
user
:
users
)
{
IpReturnVo
ipReturnVo
=
IPUtils
.
getIpLocation
(
user
.
getIp
());
if
(
ipReturnVo
.
getStatus
().
equals
(
"success"
))
{
user
.
setIpCountry
(
ipReturnVo
.
getCountry
());
user
.
setIpCountryCode
(
ipReturnVo
.
getCountryCode
());
user
.
setResultJson
(
JSON
.
toJSONString
(
ipReturnVo
));
user
.
setIsAnalysis
(
"1"
);
websiteHitCountDetailDao
.
insert
(
user
);
}
}
System
.
out
.
println
(
"成功导入 "
+
users
.
size
()
+
" 条记录并保存到数据库"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
new
IOException
(
"导入失败: "
+
e
.
getMessage
());
}
}
}
src/test/java/io/renren/RedisTest.java
View file @
1ee93933
package
io
.
renren
;
import
io.office.common.utils.RedisUtils
;
import
io.office.modules.sys.entity.SysUserEntity
;
import
org.apache.commons.lang.builder.ToStringBuilder
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.junit4.SpringRunner
;
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
public
class
RedisTest
{
@Autowired
private
RedisUtils
redisUtils
;
@Test
public
void
contextLoads
()
{
SysUserEntity
user
=
new
SysUserEntity
();
user
.
setEmail
(
"qqq@qq.com"
);
redisUtils
.
set
(
"user"
,
user
);
System
.
out
.
println
(
ToStringBuilder
.
reflectionToString
(
redisUtils
.
get
(
"user"
,
SysUserEntity
.
class
)));
}
}
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