Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
Project
Project
Details
Activity
Releases
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
youjj
cloud-platform
Commits
0d078b55
Commit
0d078b55
authored
Jul 19, 2019
by
周健威
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/base-modify' into base-modify
parents
1fb89b3c
81940ccc
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
98 additions
and
29 deletions
+98
-29
bootstrap.yml
ace-gate/src/main/resources/bootstrap.yml
+2
-1
AppUserRelationController.java
...xiaoqi/security/admin/rest/AppUserRelationController.java
+1
-1
bootstrap.yml
ace-modules/ace-admin/src/main/resources/bootstrap.yml
+1
-1
IntegralUserRecord.java
...com/xxfc/platform/activity/entity/IntegralUserRecord.java
+0
-1
IntegralUserRecordDto.java
.../com/xxfc/platform/activity/vo/IntegralUserRecordDto.java
+1
-1
UserCouponVo.java
...main/java/com/xxfc/platform/activity/vo/UserCouponVo.java
+6
-0
IntegralMQHandler.java
...com/xxfc/platform/activity/handler/IntegralMQHandler.java
+1
-2
IntegralUserRecordMapper.xml
...er/src/main/resources/mapper/IntegralUserRecordMapper.xml
+1
-1
UserCouponMapper.xml
...ity-server/src/main/resources/mapper/UserCouponMapper.xml
+1
-0
pom.xml
xx-im/xx-im-api/pom.xml
+6
-1
ImCommentBiz.java
.../src/main/java/com/xxfc/platform/im/biz/ImCommentBiz.java
+12
-1
ImQuestionBiz.java
...src/main/java/com/xxfc/platform/im/biz/ImQuestionBiz.java
+13
-1
MsgBiz.java
...server/src/main/java/com/xxfc/platform/im/biz/MsgBiz.java
+6
-2
bootstrap.yml
xx-im/xx-im-server/src/main/resources/bootstrap.yml
+2
-1
MQconstant.java
...java/com/xxfc/platform/universal/constant/MQconstant.java
+8
-0
MQSenderFeign.java
...java/com/xxfc/platform/universal/feign/MQSenderFeign.java
+2
-2
MQServiceBiZ.java
...in/java/com/xxfc/platform/universal/biz/MQServiceBiZ.java
+5
-2
OrderPayBiz.java
...ain/java/com/xxfc/platform/universal/biz/OrderPayBiz.java
+30
-11
No files found.
ace-gate/src/main/resources/bootstrap.yml
View file @
0d078b55
...
@@ -17,7 +17,8 @@ spring:
...
@@ -17,7 +17,8 @@ spring:
nacos
:
nacos
:
config
:
config
:
server-addr
:
127.0.0.1:8848
server-addr
:
127.0.0.1:8848
#共用配置,暂定一个
shared-dataids
:
common-dev.yaml,mongodb-log-dev.yaml
---
---
spring
:
spring
:
profiles
:
pro
profiles
:
pro
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/AppUserRelationController.java
View file @
0d078b55
...
@@ -38,7 +38,7 @@ public class AppUserRelationController extends BaseController<AppUserRelationBiz
...
@@ -38,7 +38,7 @@ public class AppUserRelationController extends BaseController<AppUserRelationBiz
}
}
@ApiOperation
(
"查询邀请的成员"
)
@ApiOperation
(
"查询邀请的成员"
)
@GetMapping
(
"/page"
)
@GetMapping
(
"/page
s
"
)
public
ObjectRestResponse
<
InviteMemberVo
>
findInviteMemberByActivitState
(
@RequestParam
(
value
=
"state"
,
required
=
false
)
Integer
state
,
public
ObjectRestResponse
<
InviteMemberVo
>
findInviteMemberByActivitState
(
@RequestParam
(
value
=
"state"
,
required
=
false
)
Integer
state
,
@RequestParam
(
"page"
)
Integer
page
,
@RequestParam
(
"page"
)
Integer
page
,
@RequestParam
(
"limit"
)
Integer
limit
,
@RequestParam
(
"limit"
)
Integer
limit
,
...
...
ace-modules/ace-admin/src/main/resources/bootstrap.yml
View file @
0d078b55
...
@@ -17,7 +17,7 @@ spring:
...
@@ -17,7 +17,7 @@ spring:
config
:
config
:
server-addr
:
127.0.0.1:8848
server-addr
:
127.0.0.1:8848
#共用配置,暂定一个
#共用配置,暂定一个
shared-dataids
:
common-dev.yaml
shared-dataids
:
common-dev.yaml
,mongodb-log-dev.yaml
---
---
spring
:
spring
:
...
...
xx-activity/xx-activity-api/src/main/java/com/xxfc/platform/activity/entity/IntegralUserRecord.java
View file @
0d078b55
package
com
.
xxfc
.
platform
.
activity
.
entity
;
package
com
.
xxfc
.
platform
.
activity
.
entity
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.Data
;
import
javax.persistence.Column
;
import
javax.persistence.Column
;
...
...
xx-activity/xx-activity-api/src/main/java/com/xxfc/platform/activity/vo/IntegralUserRecordDto.java
View file @
0d078b55
...
@@ -14,7 +14,7 @@ public class IntegralUserRecordDto extends PageParam {
...
@@ -14,7 +14,7 @@ public class IntegralUserRecordDto extends PageParam {
/**
/**
* 0-获取积分;1-抵扣积分
* 0-获取积分;1-抵扣积分
*/
*/
private
Integer
type
;
private
Integer
type
=
0
;
/**
/**
* 积分数
* 积分数
...
...
xx-activity/xx-activity-api/src/main/java/com/xxfc/platform/activity/vo/UserCouponVo.java
View file @
0d078b55
...
@@ -77,6 +77,12 @@ public class UserCouponVo {
...
@@ -77,6 +77,12 @@ public class UserCouponVo {
@ApiModelProperty
(
value
=
"优惠券标题(有图片则显示图片):无门槛50元优惠券 | 单品最高减2000元"
)
@ApiModelProperty
(
value
=
"优惠券标题(有图片则显示图片):无门槛50元优惠券 | 单品最高减2000元"
)
private
String
title
;
private
String
title
;
/**
* 副标题
*/
@ApiModelProperty
(
value
=
"副标题"
)
private
String
subtitle
;
/**
/**
* 图片
* 图片
*/
*/
...
...
xx-activity/xx-activity-server/src/main/java/com/xxfc/platform/activity/handler/IntegralMQHandler.java
View file @
0d078b55
...
@@ -4,7 +4,6 @@ package com.xxfc.platform.activity.handler;
...
@@ -4,7 +4,6 @@ package com.xxfc.platform.activity.handler;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.rabbitmq.client.Channel
;
import
com.rabbitmq.client.Channel
;
import
com.xxfc.platform.activity.biz.IntegralUserRecordBiz
;
import
com.xxfc.platform.activity.biz.IntegralUserRecordBiz
;
import
com.xxfc.platform.activity.config.RabbitActivityConfig
;
import
com.xxfc.platform.activity.vo.IntegralUserRecordDto
;
import
com.xxfc.platform.activity.vo.IntegralUserRecordDto
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
@@ -27,7 +26,7 @@ public class IntegralMQHandler {
...
@@ -27,7 +26,7 @@ public class IntegralMQHandler {
@Autowired
@Autowired
IntegralUserRecordBiz
integralUserRecordBiz
;
IntegralUserRecordBiz
integralUserRecordBiz
;
@RabbitListener
(
queues
=
RabbitActivityConfig
.
INTEGRAL_QUEUE
)
@RabbitListener
(
queues
=
"integral_handle_queue"
)
public
void
integralHandler
(
Message
message
,
@Headers
Map
<
String
,
Object
>
headers
,
Channel
channel
)
{
public
void
integralHandler
(
Message
message
,
@Headers
Map
<
String
,
Object
>
headers
,
Channel
channel
)
{
ExecutorService
executorService
=
Executors
.
newCachedThreadPool
();
ExecutorService
executorService
=
Executors
.
newCachedThreadPool
();
executorService
.
execute
(
new
Runnable
()
{
executorService
.
execute
(
new
Runnable
()
{
...
...
xx-activity/xx-activity-server/src/main/resources/mapper/IntegralUserRecordMapper.xml
View file @
0d078b55
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
<result
column=
"user_id"
property=
"userId"
jdbcType=
"INTEGER"
/>
<result
column=
"user_id"
property=
"userId"
jdbcType=
"INTEGER"
/>
<result
column=
"type"
property=
"type"
jdbcType=
"INTEGER"
/>
<result
column=
"type"
property=
"type"
jdbcType=
"INTEGER"
/>
<result
column=
"point"
property=
"point"
jdbcType=
"INTEGER"
/>
<result
column=
"point"
property=
"point"
jdbcType=
"INTEGER"
/>
<result
column=
"integral_rule_code"
property=
"integralRuleCode"
jdbcType=
"
INTEGE
R"
/>
<result
column=
"integral_rule_code"
property=
"integralRuleCode"
jdbcType=
"
VARCHA
R"
/>
<result
column=
"crt_time"
property=
"crtTime"
jdbcType=
"BIGINT"
/>
<result
column=
"crt_time"
property=
"crtTime"
jdbcType=
"BIGINT"
/>
<result
column=
"is_valid"
property=
"isValid"
jdbcType=
"BIT"
/>
<result
column=
"is_valid"
property=
"isValid"
jdbcType=
"BIT"
/>
<result
column=
"isdel"
property=
"isdel"
jdbcType=
"BIT"
/>
<result
column=
"isdel"
property=
"isdel"
jdbcType=
"BIT"
/>
...
...
xx-activity/xx-activity-server/src/main/resources/mapper/UserCouponMapper.xml
View file @
0d078b55
...
@@ -15,6 +15,7 @@
...
@@ -15,6 +15,7 @@
<result
property=
"expireTime"
column=
"expire_time"
/>
<result
property=
"expireTime"
column=
"expire_time"
/>
<result
property=
"useTime"
column=
"use_time"
/>
<result
property=
"useTime"
column=
"use_time"
/>
<result
property=
"title"
column=
"title"
/>
<result
property=
"title"
column=
"title"
/>
<result
property=
"subtitle"
column=
"subtitle"
/>
<result
property=
"icon"
column=
"icon"
/>
<result
property=
"icon"
column=
"icon"
/>
<result
property=
"used"
column=
"used"
/>
<result
property=
"used"
column=
"used"
/>
<result
property=
"channel"
column=
"channel"
/>
<result
property=
"channel"
column=
"channel"
/>
...
...
xx-im/xx-im-api/pom.xml
View file @
0d078b55
...
@@ -23,7 +23,12 @@
...
@@ -23,7 +23,12 @@
<artifactId>
ace-auth-client
</artifactId>
<artifactId>
ace-auth-client
</artifactId>
<version>
2.0-SNAPSHOT
</version>
<version>
2.0-SNAPSHOT
</version>
</dependency>
</dependency>
<dependency>
<groupId>
com.xxfc.platform
</groupId>
<artifactId>
xx-universal-api
</artifactId>
<version>
2.0-SNAPSHOT
</version>
<scope>
compile
</scope>
</dependency>
<!-- 自己项目 -->
<!-- 自己项目 -->
...
...
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/biz/ImCommentBiz.java
View file @
0d078b55
package
com
.
xxfc
.
platform
.
im
.
biz
;
package
com
.
xxfc
.
platform
.
im
.
biz
;
import
com.alibaba.fastjson.JSONObject
;
import
com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO
;
import
com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
...
@@ -8,6 +9,8 @@ import com.xxfc.platform.im.dto.UpdateTypeEnum;
...
@@ -8,6 +9,8 @@ import com.xxfc.platform.im.dto.UpdateTypeEnum;
import
com.xxfc.platform.im.entity.ImComment
;
import
com.xxfc.platform.im.entity.ImComment
;
import
com.xxfc.platform.im.entity.ImQuestion
;
import
com.xxfc.platform.im.entity.ImQuestion
;
import
com.xxfc.platform.im.mapper.ImCommentMapper
;
import
com.xxfc.platform.im.mapper.ImCommentMapper
;
import
com.xxfc.platform.universal.constant.MQconstant
;
import
com.xxfc.platform.universal.feign.MQSenderFeign
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -20,7 +23,8 @@ public class ImCommentBiz extends BaseBiz<ImCommentMapper, ImComment> {
...
@@ -20,7 +23,8 @@ public class ImCommentBiz extends BaseBiz<ImCommentMapper, ImComment> {
ImQuestionBiz
imQuestionBiz
;
ImQuestionBiz
imQuestionBiz
;
@Autowired
@Autowired
UserBiz
userBiz
;
UserBiz
userBiz
;
@Autowired
MQSenderFeign
mqSenderFeign
;
/**
/**
* 添加评论
* 添加评论
*
*
...
@@ -43,8 +47,15 @@ public class ImCommentBiz extends BaseBiz<ImCommentMapper, ImComment> {
...
@@ -43,8 +47,15 @@ public class ImCommentBiz extends BaseBiz<ImCommentMapper, ImComment> {
return
ObjectRestResponse
.
createDefaultFail
();
return
ObjectRestResponse
.
createDefaultFail
();
}
}
insertSelective
(
imComment
);
insertSelective
(
imComment
);
ImQuestion
newValue
=
imQuestionBiz
.
selectById
(
imComment
.
getQuestionId
());
//修改评论数
//修改评论数
imQuestionBiz
.
update
(
imComment
.
getQuestionId
(),
MsgTypeEnum
.
comment
,
UpdateTypeEnum
.
add
);
imQuestionBiz
.
update
(
imComment
.
getQuestionId
(),
MsgTypeEnum
.
comment
,
UpdateTypeEnum
.
add
);
//评论添加积分
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"userId"
,
appUserDTO
.
getUserid
());
jsonObject
.
put
(
"channelId"
,
newValue
.
getId
());
jsonObject
.
put
(
"integralRuleCode"
,
"COMMENTPUBLISH"
);
mqSenderFeign
.
sendMessage
(
MQconstant
.
INTEGRAL_EXCHANGE
,
MQconstant
.
INTEGRAL_ROUTING_KEY
,
jsonObject
.
toJSONString
());
return
ObjectRestResponse
.
succ
();
return
ObjectRestResponse
.
succ
();
}
}
...
...
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/biz/ImQuestionBiz.java
View file @
0d078b55
package
com
.
xxfc
.
platform
.
im
.
biz
;
package
com
.
xxfc
.
platform
.
im
.
biz
;
import
com.alibaba.fastjson.JSONObject
;
import
com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO
;
import
com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
...
@@ -10,6 +11,8 @@ import com.xxfc.platform.im.dto.QuestionParamDto;
...
@@ -10,6 +11,8 @@ import com.xxfc.platform.im.dto.QuestionParamDto;
import
com.xxfc.platform.im.dto.UpdateTypeEnum
;
import
com.xxfc.platform.im.dto.UpdateTypeEnum
;
import
com.xxfc.platform.im.entity.ImQuestion
;
import
com.xxfc.platform.im.entity.ImQuestion
;
import
com.xxfc.platform.im.mapper.ImQuestionMapper
;
import
com.xxfc.platform.im.mapper.ImQuestionMapper
;
import
com.xxfc.platform.universal.constant.MQconstant
;
import
com.xxfc.platform.universal.feign.MQSenderFeign
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -22,6 +25,9 @@ public class ImQuestionBiz extends BaseBiz<ImQuestionMapper, ImQuestion> {
...
@@ -22,6 +25,9 @@ public class ImQuestionBiz extends BaseBiz<ImQuestionMapper, ImQuestion> {
@Autowired
@Autowired
UserBiz
userBiz
;
UserBiz
userBiz
;
@Autowired
MQSenderFeign
mqSenderFeign
;
/**
/**
* 获取列表
* 获取列表
*
*
...
@@ -58,7 +64,13 @@ public class ImQuestionBiz extends BaseBiz<ImQuestionMapper, ImQuestion> {
...
@@ -58,7 +64,13 @@ public class ImQuestionBiz extends BaseBiz<ImQuestionMapper, ImQuestion> {
if
(
imQuestion
==
null
)
{
if
(
imQuestion
==
null
)
{
return
ObjectRestResponse
.
paramIsEmpty
();
return
ObjectRestResponse
.
paramIsEmpty
();
}
}
insertSelective
(
imQuestion
);
insertSelective
(
imQuestion
);
ImQuestion
newValue
=
mapper
.
selectOne
(
imQuestion
);
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"userId"
,
appUserDTO
.
getUserid
());
jsonObject
.
put
(
"channelId"
,
newValue
.
getId
());
jsonObject
.
put
(
"integralRuleCode"
,
"PUBLISH"
);
mqSenderFeign
.
sendMessage
(
MQconstant
.
INTEGRAL_EXCHANGE
,
MQconstant
.
INTEGRAL_ROUTING_KEY
,
jsonObject
.
toJSONString
());
return
ObjectRestResponse
.
succ
();
return
ObjectRestResponse
.
succ
();
}
}
...
...
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/biz/MsgBiz.java
View file @
0d078b55
...
@@ -67,8 +67,12 @@ public class MsgBiz {
...
@@ -67,8 +67,12 @@ public class MsgBiz {
ids
.
add
(
2
);
ids
.
add
(
2
);
ids
.
add
(
4
);
ids
.
add
(
4
);
query
=
new
Query
(
Criteria
.
where
(
"body.type"
).
in
(
ids
));
query
=
new
Query
(
Criteria
.
where
(
"body.type"
).
in
(
ids
));
List
<
Msg
>
list
=
mongoTemplate
.
find
(
query
,
Msg
.
class
,
"s_msg"
);
if
(
appUserDTO
!=
null
)
{
msgList
=
fetchAndAttach
(
list
,
appUserDTO
.
getImUserid
());
msgList
=
fetchAndAttach
(
mongoTemplate
.
find
(
query
,
Msg
.
class
,
"s_msg"
),
appUserDTO
.
getImUserid
());
PageInfo
<
MsgVo
>
goodPageInfo
=
new
PageInfo
<>(
replaceMsgResult
(
msgList
));
return
ObjectRestResponse
.
succ
(
goodPageInfo
);
}
msgList
=
mongoTemplate
.
find
(
query
,
Msg
.
class
,
"s_msg"
);
PageInfo
<
MsgVo
>
goodPageInfo
=
new
PageInfo
<>(
replaceMsgResult
(
msgList
));
PageInfo
<
MsgVo
>
goodPageInfo
=
new
PageInfo
<>(
replaceMsgResult
(
msgList
));
return
ObjectRestResponse
.
succ
(
goodPageInfo
);
return
ObjectRestResponse
.
succ
(
goodPageInfo
);
}
}
...
...
xx-im/xx-im-server/src/main/resources/bootstrap.yml
View file @
0d078b55
...
@@ -24,7 +24,8 @@ spring:
...
@@ -24,7 +24,8 @@ spring:
nacos
:
nacos
:
config
:
config
:
server-addr
:
127.0.0.1:8848
server-addr
:
127.0.0.1:8848
#共用配置,暂定一个
shared-dataids
:
common-dev.yaml,mongodb-log-dev.yaml
---
---
spring
:
spring
:
profiles
:
pro
profiles
:
pro
...
...
xx-universal/xx-universal-api/src/main/java/com/xxfc/platform/universal/constant/MQconstant.java
0 → 100644
View file @
0d078b55
package
com
.
xxfc
.
platform
.
universal
.
constant
;
public
class
MQconstant
{
public
static
final
String
INTEGRAL_EXCHANGE
=
"integral_exchange"
;
public
static
final
String
INTEGRAL_ROUTING_KEY
=
"integral_routing_key"
;
}
xx-universal/xx-universal-api/src/main/java/com/xxfc/platform/universal/feign/MQSe
r
derFeign.java
→
xx-universal/xx-universal-api/src/main/java/com/xxfc/platform/universal/feign/MQSe
n
derFeign.java
View file @
0d078b55
...
@@ -6,9 +6,9 @@ import org.springframework.web.bind.annotation.GetMapping;
...
@@ -6,9 +6,9 @@ import org.springframework.web.bind.annotation.GetMapping;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RequestParam
;
@FeignClient
(
value
=
"xx-universal"
,
contextId
=
"sendMessage"
)
@FeignClient
(
value
=
"xx-universal"
,
contextId
=
"sendMessage"
)
public
interface
MQSe
r
derFeign
{
public
interface
MQSe
n
derFeign
{
@GetMapping
(
value
=
"/message/sendMessage"
)
@GetMapping
(
value
=
"/message/sendMessage"
)
public
ObjectRestResponse
sendMessage
(
@RequestParam
(
value
=
"exchange"
)
String
exchange
,
@RequestParam
(
value
=
"rout
ingKey"
)
String
routKey
,
@RequestParam
(
value
=
"jsonParam"
)
String
jsonParam
);
public
ObjectRestResponse
sendMessage
(
@RequestParam
(
value
=
"exchange"
)
String
exchange
,
@RequestParam
(
value
=
"rout
Key"
)
String
routKey
,
@RequestParam
(
value
=
"json"
)
String
json
);
}
}
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/biz/MQServiceBiZ.java
View file @
0d078b55
package
com
.
xxfc
.
platform
.
universal
.
biz
;
package
com
.
xxfc
.
platform
.
universal
.
biz
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
lombok.
AllArgsConstructor
;
import
lombok.
extern.slf4j.Slf4j
;
import
org.springframework.amqp.core.Message
;
import
org.springframework.amqp.core.Message
;
import
org.springframework.amqp.core.MessageBuilder
;
import
org.springframework.amqp.core.MessageBuilder
;
import
org.springframework.amqp.core.MessageProperties
;
import
org.springframework.amqp.core.MessageProperties
;
import
org.springframework.amqp.rabbit.core.RabbitTemplate
;
import
org.springframework.amqp.rabbit.core.RabbitTemplate
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.UUID
;
import
java.util.UUID
;
@Service
@Service
@
AllArgsConstructor
@
Slf4j
public
class
MQServiceBiZ
{
public
class
MQServiceBiZ
{
@Autowired
private
RabbitTemplate
rabbitTemplate
;
private
RabbitTemplate
rabbitTemplate
;
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ObjectRestResponse
sendMessage
(
String
exchange
,
String
routKey
,
String
json
)
{
public
ObjectRestResponse
sendMessage
(
String
exchange
,
String
routKey
,
String
json
)
{
log
.
info
(
"发送消息到消息队列:exchange = {}, routingKey = {}, json = {}"
,
exchange
,
routKey
,
json
);
Message
message
=
MessageBuilder
.
withBody
(
json
.
getBytes
())
Message
message
=
MessageBuilder
.
withBody
(
json
.
getBytes
())
.
setContentType
(
MessageProperties
.
CONTENT_TYPE_JSON
).
setContentEncoding
(
"utf-8"
)
.
setContentType
(
MessageProperties
.
CONTENT_TYPE_JSON
).
setContentEncoding
(
"utf-8"
)
.
setMessageId
(
UUID
.
randomUUID
()
+
""
).
build
();
.
setMessageId
(
UUID
.
randomUUID
()
+
""
).
build
();
...
...
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/biz/OrderPayBiz.java
View file @
0d078b55
...
@@ -17,6 +17,7 @@ import com.github.wxiaoqi.security.common.util.OrderUtil;
...
@@ -17,6 +17,7 @@ import com.github.wxiaoqi.security.common.util.OrderUtil;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.util.process.SystemConfig
;
import
com.github.wxiaoqi.security.common.util.process.SystemConfig
;
import
com.github.wxiaoqi.security.common.util.result.JsonResultUtil
;
import
com.github.wxiaoqi.security.common.util.result.JsonResultUtil
;
import
com.xxfc.platform.universal.constant.MQconstant
;
import
com.xxfc.platform.universal.entity.Dictionary
;
import
com.xxfc.platform.universal.entity.Dictionary
;
import
com.xxfc.platform.universal.entity.OrderPay
;
import
com.xxfc.platform.universal.entity.OrderPay
;
import
com.xxfc.platform.universal.mapper.OrderPayMapper
;
import
com.xxfc.platform.universal.mapper.OrderPayMapper
;
...
@@ -57,6 +58,9 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper,OrderPay> {
...
@@ -57,6 +58,9 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper,OrderPay> {
@Autowired
@Autowired
HttpServletRequest
request
;
HttpServletRequest
request
;
@Autowired
MQServiceBiZ
mqServiceBiZ
;
public
JSONObject
preparepay
(
OrderPayVo
orderPayVo
)
{
public
JSONObject
preparepay
(
OrderPayVo
orderPayVo
)
{
if
(
null
==
orderPayVo
)
{
if
(
null
==
orderPayVo
)
{
log
.
error
(
"-----参数为空-----------"
);
log
.
error
(
"-----参数为空-----------"
);
...
@@ -69,20 +73,20 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper,OrderPay> {
...
@@ -69,20 +73,20 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper,OrderPay> {
if
(
StringUtils
.
isBlank
(
orderPayVo
.
getOrderNo
()))
{
if
(
StringUtils
.
isBlank
(
orderPayVo
.
getOrderNo
()))
{
log
.
error
(
"-----订单不能为空-----------"
);
log
.
error
(
"-----订单不能为空-----------"
);
return
JsonResultUtil
.
createFailedResult
(
ResultCode
.
NULL_CODE
,
"订单不能为空"
);
return
JsonResultUtil
.
createFailedResult
(
ResultCode
.
NULL_CODE
,
"订单不能为空"
);
}
}
String
trade_no
=
OrderUtil
.
GetOrderNumber
(
""
);
String
trade_no
=
OrderUtil
.
GetOrderNumber
(
""
);
String
order_no
=
orderPayVo
.
getOrderNo
();
String
order_no
=
orderPayVo
.
getOrderNo
();
Integer
amount
=
orderPayVo
.
getAmount
();
Integer
amount
=
orderPayVo
.
getAmount
();
log
.
error
(
"---下单---order_no====="
+
order_no
+
"--支付订单号--trade_no===="
+
trade_no
+
"--金额---amount===="
+
amount
);
log
.
error
(
"---下单---order_no====="
+
order_no
+
"--支付订单号--trade_no===="
+
trade_no
+
"--金额---amount===="
+
amount
);
//报名费回调路径
//报名费回调路径
//临时处理
//临时处理
Map
<
String
,
Dictionary
>
dictionaryMap
=
dictionaryBiz
.
getAll4Map
();
Map
<
String
,
Dictionary
>
dictionaryMap
=
dictionaryBiz
.
getAll4Map
();
Integer
demotion
=
Integer
.
valueOf
(
dictionaryMap
.
get
(
UNIVERSAL_PAY
+
"_"
+
PAY_DEMOTION
).
getDetail
());
Integer
demotion
=
Integer
.
valueOf
(
dictionaryMap
.
get
(
UNIVERSAL_PAY
+
"_"
+
PAY_DEMOTION
).
getDetail
());
amount
=
amount
/
demotion
;
amount
=
amount
/
demotion
;
if
(
amount
<=
0
)
{
if
(
amount
<=
0
)
{
amount
=
1
;
amount
=
1
;
}
}
Integer
type
=
orderPayVo
.
getType
();
Integer
type
=
orderPayVo
.
getType
();
String
jsParam
=
""
;
String
jsParam
=
""
;
String
notify_url
=
"https://"
+
SystemConfig
.
weixinHost
+
"/api/universal/pay/app/unauth/notify"
;
String
notify_url
=
"https://"
+
SystemConfig
.
weixinHost
+
"/api/universal/pay/app/unauth/notify"
;
...
@@ -144,6 +148,21 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper,OrderPay> {
...
@@ -144,6 +148,21 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper,OrderPay> {
result
=
HTTPUtils
.
doGet
(
url
);
result
=
HTTPUtils
.
doGet
(
url
);
}
}
log
.
error
(
"---支付回调处理---orderNo======="
+
orderNo
+
"---result==="
+
result
);
log
.
error
(
"---支付回调处理---orderNo======="
+
orderNo
+
"---result==="
+
result
);
//支付成功,添加积分
if
(
pay
.
getStatus
()
==
1
)
{
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"userId"
,
pay
.
getUserId
());
jsonObject
.
put
(
"amount"
,
pay
.
getAmount
());
jsonObject
.
put
(
"channelId"
,
pay
.
getOrderNo
());
if
(
pay
.
getChannel
()
==
1
)
{
//租车
jsonObject
.
put
(
"integralRuleCode"
,
"RENTRV"
);
}
else
if
(
pay
.
getChannel
()
==
2
)
{
//旅游
jsonObject
.
put
(
"integralRuleCode"
,
"BUYROUT"
);
}
else
if
(
pay
.
getChannel
()
==
3
)
{
//会员
jsonObject
.
put
(
"integralRuleCode"
,
"BUYMEMBER"
);
}
mqServiceBiZ
.
sendMessage
(
MQconstant
.
INTEGRAL_EXCHANGE
,
MQconstant
.
INTEGRAL_ROUTING_KEY
,
jsonObject
.
toJSONString
());
}
}
}
}
}
}
}
...
...
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