Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
O
on-site-service
Project
Project
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
external
on-site-service
Commits
c455b30a
Commit
c455b30a
authored
Jul 28, 2022
by
qiaobin
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
7b9ed6b9
6f26e03b
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
34 additions
and
12 deletions
+34
-12
BannerController.java
...siteservice/admin/controller/banner/BannerController.java
+3
-2
BannerService.java
...com/onsiteservice/admin/service/banner/BannerService.java
+5
-2
AdminWeixinService.java
...nsiteservice/admin/service/weixin/AdminWeixinService.java
+1
-1
ServiceOrderService.java
.../com/onsiteservice/service/order/ServiceOrderService.java
+1
-1
Banner.java
...src/main/java/com/onsiteservice/entity/banner/Banner.java
+5
-1
BannerVO.java
...nsiteservice/miniapp/controller/category/vo/BannerVO.java
+4
-1
WechatNotifyController.java
...vice/miniapp/controller/weixn/WechatNotifyController.java
+1
-1
WeiXinService.java
...m/onsiteservice/miniapp/service/weixin/WeiXinService.java
+13
-2
pom.xml
pom.xml
+1
-1
No files found.
admin/src/main/java/com/onsiteservice/admin/controller/banner/BannerController.java
View file @
c455b30a
package
com
.
onsiteservice
.
admin
.
controller
.
banner
;
package
com
.
onsiteservice
.
admin
.
controller
.
banner
;
import
com.onsiteservice.common.annotation.user.CurrentUserId
;
import
com.onsiteservice.entity.banner.Banner
;
import
com.onsiteservice.entity.banner.Banner
;
import
com.onsiteservice.admin.service.banner.BannerService
;
import
com.onsiteservice.admin.service.banner.BannerService
;
...
@@ -51,8 +52,8 @@ public class BannerController {
...
@@ -51,8 +52,8 @@ public class BannerController {
@ApiOperation
(
value
=
"新增或修改"
,
notes
=
"作者: 商天翔"
)
@ApiOperation
(
value
=
"新增或修改"
,
notes
=
"作者: 商天翔"
)
@PostMapping
(
"/save-or-update"
)
@PostMapping
(
"/save-or-update"
)
public
Result
saveOrUpdate
(
@RequestBody
@NonNull
@Validated
Banner
banner
)
{
public
Result
saveOrUpdate
(
@RequestBody
@NonNull
@Validated
Banner
banner
,
@CurrentUserId
Long
userId
)
{
return
success
(
bannerService
.
saveOrUpdate
(
banner
),
banner
.
getId
()
==
null
?
"新增成功"
:
"修改成功"
);
return
success
(
bannerService
.
saveOrUpdate
(
banner
,
userId
),
banner
.
getId
()
==
null
?
"新增成功"
:
"修改成功"
);
}
}
@PutMapping
(
"/enable"
)
@PutMapping
(
"/enable"
)
...
...
admin/src/main/java/com/onsiteservice/admin/service/banner/BannerService.java
View file @
c455b30a
package
com
.
onsiteservice
.
admin
.
service
.
banner
;
package
com
.
onsiteservice
.
admin
.
service
.
banner
;
import
com.onsiteservice.dao.util.EntityUtils
;
import
com.onsiteservice.entity.banner.Banner
;
import
com.onsiteservice.entity.banner.Banner
;
import
com.onsiteservice.dao.mapper.banner.BannerMapper
;
import
com.onsiteservice.dao.mapper.banner.BannerMapper
;
import
com.onsiteservice.admin.mapper.banner.BannerBizMapper
;
import
com.onsiteservice.admin.mapper.banner.BannerBizMapper
;
...
@@ -43,11 +44,13 @@ public class BannerService extends AbstractMapper<Banner> {
...
@@ -43,11 +44,13 @@ public class BannerService extends AbstractMapper<Banner> {
/**
/**
* 保存或更新方法
* 保存或更新方法
*/
*/
public
int
saveOrUpdate
(
Banner
banner
)
{
public
int
saveOrUpdate
(
Banner
banner
,
Long
userId
)
{
if
(
banner
.
getId
()
==
null
)
{
if
(
banner
.
getId
()
==
null
)
{
EntityUtils
.
insert
(
banner
,
userId
);
return
this
.
insertSelective
(
banner
);
return
this
.
insertSelective
(
banner
);
}
else
{
}
else
{
return
this
.
updateByPrimaryKeySelective
(
banner
);
EntityUtils
.
update
(
banner
,
userId
);
return
this
.
updateByPrimaryKeySelectiveForce
(
banner
,
List
.
of
(
"mpArticle"
));
}
}
}
}
...
...
admin/src/main/java/com/onsiteservice/admin/service/weixin/AdminWeixinService.java
View file @
c455b30a
...
@@ -26,7 +26,7 @@ public class AdminWeixinService {
...
@@ -26,7 +26,7 @@ public class AdminWeixinService {
try
{
try
{
// 获取base64数据
// 获取base64数据
byte
[]
qrCode
=
wxMaService
.
getQrcodeService
().
createWxaCodeUnlimitBytes
(
miniQrCodeDTO
.
getScene
(),
byte
[]
qrCode
=
wxMaService
.
getQrcodeService
().
createWxaCodeUnlimitBytes
(
miniQrCodeDTO
.
getScene
(),
miniQrCodeDTO
.
getPath
(),
miniQrCodeDTO
.
getWidth
(),
false
,
new
WxMaCodeLineColor
(
"0"
,
"0"
,
"0"
),
false
);
miniQrCodeDTO
.
getPath
(),
false
,
"release"
,
miniQrCodeDTO
.
getWidth
(),
false
,
new
WxMaCodeLineColor
(
"0"
,
"0"
,
"0"
),
false
);
return
success
(
qrCode
,
"获取微信小程序码成功"
);
return
success
(
qrCode
,
"获取微信小程序码成功"
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
new
ServiceException
(
"获取微信小程序码失败"
);
throw
new
ServiceException
(
"获取微信小程序码失败"
);
...
...
common/src/main/java/com/onsiteservice/service/order/ServiceOrderService.java
View file @
c455b30a
...
@@ -190,7 +190,7 @@ public class ServiceOrderService extends AbstractMapper<ServiceOrder> {
...
@@ -190,7 +190,7 @@ public class ServiceOrderService extends AbstractMapper<ServiceOrder> {
if
(
result
==
1
)
{
if
(
result
==
1
)
{
String
description
=
String
.
format
(
ServiceOrderStatusEnum
.
SEND
.
getMsg
(),
(
user
.
getIsAdmin
()
?
ServiceUserTypeEnum
.
ADMIN
.
getName
()
:
ServiceUserTypeEnum
.
VALUATOR
.
getName
())
+
user
.
getName
());
String
description
=
String
.
format
(
ServiceOrderStatusEnum
.
SEND
.
getMsg
(),
(
user
.
getIsAdmin
()
?
ServiceUserTypeEnum
.
ADMIN
.
getName
()
:
ServiceUserTypeEnum
.
VALUATOR
.
getName
())
+
user
.
getName
());
recordComponent
.
recordProcess
(
serviceOrder
.
getId
(),
ServiceOrderStatusEnum
.
SEND
.
getStatus
(),
description
,
sourceEnum
,
null
,
null
,
null
);
recordComponent
.
recordProcess
(
serviceOrder
.
getId
(),
ServiceOrderStatusEnum
.
SEND
.
getStatus
(),
description
,
sourceEnum
,
userId
,
null
,
null
);
}
}
return
result
;
return
result
;
...
...
entity/src/main/java/com/onsiteservice/entity/banner/Banner.java
View file @
c455b30a
...
@@ -35,10 +35,14 @@ public class Banner implements Serializable {
...
@@ -35,10 +35,14 @@ public class Banner implements Serializable {
@ApiModelProperty
(
"图片地址"
)
@ApiModelProperty
(
"图片地址"
)
private
String
url
;
private
String
url
;
@Column
(
name
=
"mp_article"
)
@ApiModelProperty
(
"文章连接"
)
private
String
mpArticle
;
/**
/**
* 跳转类型 0 不跳转 1 图片 ,其他业务
* 跳转类型 0 不跳转 1 图片 ,其他业务
*/
*/
@ApiModelProperty
(
"跳转类型 0 不跳转 1 图片
,其他业务
"
)
@ApiModelProperty
(
"跳转类型 0 不跳转 1 图片
2 文章
"
)
private
Integer
type
;
private
Integer
type
;
/**
/**
...
...
mini-app/src/main/java/com/onsiteservice/miniapp/controller/category/vo/BannerVO.java
View file @
c455b30a
...
@@ -19,9 +19,12 @@ public class BannerVO {
...
@@ -19,9 +19,12 @@ public class BannerVO {
@ApiModelProperty
(
"图片地址"
)
@ApiModelProperty
(
"图片地址"
)
private
String
url
;
private
String
url
;
@ApiModelProperty
(
"跳转类型 0 不跳转 1 图片 ,
其他业务
"
)
@ApiModelProperty
(
"跳转类型 0 不跳转 1 图片 ,
2 文章
"
)
private
Integer
type
;
private
Integer
type
;
@ApiModelProperty
(
"文章链接"
)
private
String
mpArticle
;
@ApiModelProperty
(
"跳转内容 如果是图片存url如果是资讯存id"
)
@ApiModelProperty
(
"跳转内容 如果是图片存url如果是资讯存id"
)
private
String
target
;
private
String
target
;
...
...
mini-app/src/main/java/com/onsiteservice/miniapp/controller/weixn/WechatNotifyController.java
View file @
c455b30a
...
@@ -93,7 +93,7 @@ public class WechatNotifyController {
...
@@ -93,7 +93,7 @@ public class WechatNotifyController {
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"notify() Exception exception:
{}"
,
e
.
getMessage
()
);
log
.
error
(
"notify() Exception exception:
"
,
e
);
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
}
}
...
...
mini-app/src/main/java/com/onsiteservice/miniapp/service/weixin/WeiXinService.java
View file @
c455b30a
...
@@ -7,6 +7,7 @@ import cn.binarywang.wx.miniapp.bean.WxMaPhoneNumberInfo;
...
@@ -7,6 +7,7 @@ import cn.binarywang.wx.miniapp.bean.WxMaPhoneNumberInfo;
import
cn.binarywang.wx.miniapp.bean.WxMaUserInfo
;
import
cn.binarywang.wx.miniapp.bean.WxMaUserInfo
;
import
com.google.common.collect.ImmutableMap
;
import
com.google.common.collect.ImmutableMap
;
import
com.onsiteservice.common.service.dto.MiniQrCodeDTO
;
import
com.onsiteservice.common.service.dto.MiniQrCodeDTO
;
import
com.onsiteservice.constant.enums.EnvironmentEnum
;
import
com.onsiteservice.constant.enums.ServiceUserTypeEnum
;
import
com.onsiteservice.constant.enums.ServiceUserTypeEnum
;
import
com.onsiteservice.core.exception.ServiceException
;
import
com.onsiteservice.core.exception.ServiceException
;
import
com.onsiteservice.core.result.Result
;
import
com.onsiteservice.core.result.Result
;
...
@@ -21,6 +22,7 @@ import io.micrometer.core.instrument.util.StringUtils;
...
@@ -21,6 +22,7 @@ import io.micrometer.core.instrument.util.StringUtils;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
me.chanjar.weixin.common.error.WxErrorException
;
import
me.chanjar.weixin.common.error.WxErrorException
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
...
@@ -49,6 +51,8 @@ public class WeiXinService {
...
@@ -49,6 +51,8 @@ public class WeiXinService {
private
UserService
userService
;
private
UserService
userService
;
@Resource
@Resource
private
ServicePromoteService
promoteService
;
private
ServicePromoteService
promoteService
;
@Value
(
"${spring.profiles.active:dev}"
)
private
String
env
;
/**
/**
...
@@ -61,6 +65,7 @@ public class WeiXinService {
...
@@ -61,6 +65,7 @@ public class WeiXinService {
// 获取openid、unionid、session_key等
// 获取openid、unionid、session_key等
sessionResult
=
wxMaService
.
getUserService
().
getSessionInfo
(
loginDTO
.
getCode
());
sessionResult
=
wxMaService
.
getUserService
().
getSessionInfo
(
loginDTO
.
getCode
());
}
catch
(
WxErrorException
e
)
{
}
catch
(
WxErrorException
e
)
{
e
.
printStackTrace
();
throw
new
ServiceException
(
"微信小程序登录失败:"
+
e
.
getMessage
());
throw
new
ServiceException
(
"微信小程序登录失败:"
+
e
.
getMessage
());
}
}
String
unionId
=
sessionResult
.
getUnionid
();
// unionId需要先在微信开放平台绑定平台
String
unionId
=
sessionResult
.
getUnionid
();
// unionId需要先在微信开放平台绑定平台
...
@@ -157,10 +162,16 @@ public class WeiXinService {
...
@@ -157,10 +162,16 @@ public class WeiXinService {
public
Result
getQrCode
(
MiniQrCodeDTO
miniQrCodeDTO
)
{
public
Result
getQrCode
(
MiniQrCodeDTO
miniQrCodeDTO
)
{
try
{
try
{
// 获取base64数据
// 获取base64数据
byte
[]
qrCode
=
wxMaService
.
getQrcodeService
().
createWxaCodeUnlimitBytes
(
miniQrCodeDTO
.
getScene
(),
byte
[]
qrCode
=
wxMaService
.
getQrcodeService
().
createWxaCodeUnlimitBytes
(
miniQrCodeDTO
.
getPath
(),
miniQrCodeDTO
.
getWidth
(),
false
,
new
WxMaCodeLineColor
(
"0"
,
"0"
,
"0"
),
false
);
miniQrCodeDTO
.
getScene
(),
miniQrCodeDTO
.
getPath
(),
false
,
"release"
,
miniQrCodeDTO
.
getWidth
(),
false
,
new
WxMaCodeLineColor
(
"0"
,
"0"
,
"0"
),
false
);
return
success
(
qrCode
,
"获取微信小程序码成功"
);
return
success
(
qrCode
,
"获取微信小程序码成功"
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"{}"
,
e
);
throw
new
ServiceException
(
"获取微信小程序码失败"
);
throw
new
ServiceException
(
"获取微信小程序码失败"
);
}
}
}
}
...
...
pom.xml
View file @
c455b30a
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
<project.reporting.outputEncoding>
UTF-8
</project.reporting.outputEncoding>
<project.reporting.outputEncoding>
UTF-8
</project.reporting.outputEncoding>
<mapstruct.version>
1.3.1.Final
</mapstruct.version>
<mapstruct.version>
1.3.1.Final
</mapstruct.version>
<lombok.version>
1.18.12
</lombok.version>
<lombok.version>
1.18.12
</lombok.version>
<weixin.version>
4.
2
.0
</weixin.version>
<weixin.version>
4.
3
.0
</weixin.version>
</properties>
</properties>
<!-- 项目子模块 -->
<!-- 项目子模块 -->
...
...
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