Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
soss
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
hooloo
ms
soss
Commits
9189e722
Commit
9189e722
authored
Apr 10, 2023
by
weijiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加错误日志
parent
bff74782
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
1 deletions
+53
-1
soss-system/src/main/java/com/soss/system/mapper/SysBannerMapper.java
+2
-0
soss-system/src/main/java/com/soss/system/service/impl/SysBannerServiceImpl.java
+47
-1
soss-system/src/main/resources/mapper/system/SysBannerMapper.xml
+4
-0
No files found.
soss-system/src/main/java/com/soss/system/mapper/SysBannerMapper.java
View file @
9189e722
...
...
@@ -13,6 +13,8 @@ import java.util.List;
* @date 2022-04-28
*/
public
interface
SysBannerMapper
{
SysBanner
getBannerById
(
Long
bannerId
);
List
<
SysBanner
>
selectBanner
(
BannerListPo
banner
);
Long
createBanner
(
SysBanner
banner
);
...
...
soss-system/src/main/java/com/soss/system/service/impl/SysBannerServiceImpl.java
View file @
9189e722
package
com
.
soss
.
system
.
service
.
impl
;
import
com.alibaba.fastjson.JSONObject
;
import
com.soss.common.exception.ServiceException
;
import
com.soss.common.utils.StringUtils
;
import
com.soss.system.domain.Shop
;
...
...
@@ -7,6 +8,8 @@ import com.soss.system.domain.SysBanner;
import
com.soss.system.domain.po.BannerListPo
;
import
com.soss.system.domain.po.BannerPo
;
import
com.soss.system.domain.vo.BannerVo
;
import
com.soss.system.domain.vo.PushBean
;
import
com.soss.system.jiguang.JiGuangPushService
;
import
com.soss.system.mapper.ShopMapper
;
import
com.soss.system.mapper.SysBannerMapper
;
import
com.soss.system.service.ISysBannerService
;
...
...
@@ -38,6 +41,8 @@ public class SysBannerServiceImpl implements ISysBannerService {
private
ShopMapper
shopMapper
;
@Autowired
private
AreaUtil
areaUtil
;
@Autowired
private
JiGuangPushService
jiGuangPushService
;
@Override
public
List
<
SysBanner
>
selectBanner
(
BannerListPo
banner
)
{
...
...
@@ -70,6 +75,14 @@ public class SysBannerServiceImpl implements ISysBannerService {
banner
.
setUpdatedAt
(
new
Date
());
banner
.
setState
(
0
);
long
i
=
sysBannerMapper
.
createBanner
(
banner
);
try
{
if
(
banner
.
getType
()
==
2
)
{
pushBannerChanged
();
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
banner
.
getId
();
}
...
...
@@ -99,11 +112,27 @@ public class SysBannerServiceImpl implements ISysBannerService {
}
banner
.
setUpdatedAt
(
new
Date
());
long
i
=
sysBannerMapper
.
updateBanner
(
banner
);
try
{
if
(
banner
.
getType
()
==
2
)
{
pushBannerChanged
();
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
i
>
0
?
true
:
false
;
}
private
void
pushBannerChanged
()
{
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"action"
,
"BANNER_CHANGED"
);
jsonObject
.
put
(
"timestamp"
,
System
.
currentTimeMillis
());
PushBean
pushBean
=
new
PushBean
();
pushBean
.
setMessageCount
(
jsonObject
);
jiGuangPushService
.
pushAll
(
pushBean
);
}
private
SysBanner
copyBanner
(
BannerPo
bannerPo
)
{
SysBanner
banner
=
new
SysBanner
();
banner
.
setId
(
bannerPo
.
getId
());
...
...
@@ -218,12 +247,29 @@ public class SysBannerServiceImpl implements ISysBannerService {
}
long
i
=
sysBannerMapper
.
updateState
(
banner
);
try
{
SysBanner
sysBanner
=
sysBannerMapper
.
getBannerById
(
bannerId
);
if
(
sysBanner
.
getType
()
==
2
)
{
pushBannerChanged
();
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
i
>
0
?
true
:
false
;
}
@Override
public
Boolean
delete
(
Long
bannerId
)
{
long
i
=
sysBannerMapper
.
delete
(
bannerId
);
try
{
SysBanner
sysBanner
=
sysBannerMapper
.
getBannerById
(
bannerId
);
if
(
sysBanner
.
getType
()
==
2
)
{
pushBannerChanged
();
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
i
>
0
?
true
:
false
;
}
...
...
soss-system/src/main/resources/mapper/system/SysBannerMapper.xml
View file @
9189e722
...
...
@@ -19,6 +19,10 @@
<result
property=
"updatedAt"
column=
"updated_at"
/>
</resultMap>
<select
id=
"getBannerById"
resultMap=
"BannerResult"
>
select * from sys_banner where id = #{bannerId}
</select>
<select
id=
"selectBanner"
resultMap=
"BannerResult"
parameterType=
"BannerListPo"
>
select * from sys_banner
<where>
...
...
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