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
3d00348c
Commit
3d00348c
authored
Jul 23, 2019
by
hanfeng
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'base-modify' of
http://10.5.52.3/youjj/cloud-platform
into base-modify
parents
a77ac7ed
e5ac89d1
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
117 additions
and
69 deletions
+117
-69
AppUserPositionBiz.java
...github/wxiaoqi/security/admin/biz/AppUserPositionBiz.java
+1
-1
AppUserSellingWaterBiz.java
...ub/wxiaoqi/security/admin/biz/AppUserSellingWaterBiz.java
+47
-34
MyWaterBiz.java
...ava/com/github/wxiaoqi/security/admin/biz/MyWaterBiz.java
+2
-1
AppUserPositionMapper.java
.../wxiaoqi/security/admin/mapper/AppUserPositionMapper.java
+1
-1
AppUserPositionMapper.xml
...admin/src/main/resources/mapper/AppUserPositionMapper.xml
+2
-2
QuestionListVo.java
...src/main/java/com/xxfc/platform/im/vo/QuestionListVo.java
+1
-0
ImPraiseBiz.java
...r/src/main/java/com/xxfc/platform/im/biz/ImPraiseBiz.java
+10
-0
ImQuestionBiz.java
...src/main/java/com/xxfc/platform/im/biz/ImQuestionBiz.java
+10
-2
ImPraiseMapper.java
...main/java/com/xxfc/platform/im/mapper/ImPraiseMapper.java
+3
-0
ImPraiseMapper.xml
...xx-im-server/src/main/resources/mapper/ImPraiseMapper.xml
+6
-0
BaseOrderBiz.java
...c/main/java/com/xxfc/platform/order/biz/BaseOrderBiz.java
+5
-5
OrderTourVerificationBiz.java
...com/xxfc/platform/order/biz/OrderTourVerificationBiz.java
+2
-2
OrderRefundController.java
...a/com/xxfc/platform/order/rest/OrderRefundController.java
+27
-21
No files found.
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/AppUserPositionBiz.java
View file @
3d00348c
...
@@ -28,7 +28,7 @@ public class AppUserPositionBiz extends BaseBiz<AppUserPositionMapper,AppUserPos
...
@@ -28,7 +28,7 @@ public class AppUserPositionBiz extends BaseBiz<AppUserPositionMapper,AppUserPos
//获取用户职位的折扣
//获取用户职位的折扣
public
Integer
getExtract
(
Integer
userId
){
public
AppUserPosition
getExtract
(
Integer
userId
){
return
mapper
.
getExtractByUserId
(
userId
);
return
mapper
.
getExtractByUserId
(
userId
);
}
}
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/AppUserSellingWaterBiz.java
View file @
3d00348c
...
@@ -103,6 +103,21 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A
...
@@ -103,6 +103,21 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A
Integer
parentId
=
relation
.
getParentId
();
Integer
parentId
=
relation
.
getParentId
();
log
.
info
(
"购买计算用户拥金----payOrderWater--------userId==="
+
userId
+
"---parentId==="
+
parentId
);
log
.
info
(
"购买计算用户拥金----payOrderWater--------userId==="
+
userId
+
"---parentId==="
+
parentId
);
Integer
positionId
=
6
;
Integer
level
=
0
;
AppUserPosition
position
=
positionBiz
.
getExtract
(
parentId
);
if
(
position
!=
null
){
positionId
=
position
.
getId
();
}
AppUserPosition
position1
=
positionBiz
.
getExtract
(
userId
);
if
(
position
!=
null
){
level
=
position1
.
getLevel
();
}
log
.
info
(
"购买计算用户拥金----payOrderWater--------userId==="
+
userId
+
"---positionId==="
+
positionId
+
"---level==="
+
level
);
if
(
level
!=
0
){
log
.
info
(
"购买计算用户拥金----payOrderWater--------userId==="
+
userId
+
"----无法享受拥金"
);
return
;
}
BigDecimal
amount
=
new
BigDecimal
(
"0.00"
);
BigDecimal
amount
=
new
BigDecimal
(
"0.00"
);
//商品类型
//商品类型
Integer
orderType
=
0
;
Integer
orderType
=
0
;
...
@@ -115,13 +130,9 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A
...
@@ -115,13 +130,9 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A
orderType
=
goodsDto
.
getType
();
orderType
=
goodsDto
.
getType
();
//商品比例
//商品比例
Integer
extract
=
commissionBiz
.
getExtract
(
orderType
,
goodId
);
Integer
extract
=
commissionBiz
.
getExtract
(
orderType
,
goodId
);
AppUserVo
userVo
=
detailBiz
.
getUserInfoById
(
parentId
);
Integer
positionId
=
6
;
if
(
userVo
!=
null
)
{
positionId
=
userVo
.
getPositionId
();
}
if
(
extract
==
null
||
extract
==
0
)
{
if
(
extract
==
null
||
extract
==
0
)
{
extract
=
position
Biz
.
getExtract
(
parentId
);
extract
=
position
.
getExtract
(
);
}
}
log
.
info
(
"购买计算用户拥金----payOrderWater--------userId==="
+
userId
+
"---extract==="
+
extract
);
log
.
info
(
"购买计算用户拥金----payOrderWater--------userId==="
+
userId
+
"---extract==="
+
extract
);
if
(
extract
!=
null
&&
extract
>
0
)
{
if
(
extract
!=
null
&&
extract
>
0
)
{
...
@@ -184,23 +195,25 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A
...
@@ -184,23 +195,25 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A
log
.
info
(
"订单完成计算用户拥金----finishOrderWater----id===="
+
id
+
"---commission=="
+
commission
+
"----orderType==="
+
orderType
);
log
.
info
(
"订单完成计算用户拥金----finishOrderWater----id===="
+
id
+
"---commission=="
+
commission
+
"----orderType==="
+
orderType
);
amount
=
amount
.
add
(
commission
);
amount
=
amount
.
add
(
commission
);
}
}
}
log
.
info
(
"订单完成计算用户拥金----finishOrderWater----orderId===="
+
orderId
+
"---amount=="
+
amount
);
int
r
=
amount
.
compareTo
(
BigDecimal
.
ZERO
);
//更新钱包
if
(
r
==
1
&&
userId
>
0
)
{
MyWalletDetail
detail
=
new
MyWalletDetail
();
detail
.
setUserId
(
userId
);
detail
.
setAmount
(
amount
);
detail
.
setCono
(
orderId
);
detail
.
setSource
(
1
);
myWaterBiz
.
updMyWater
(
detail
);
if
(
orderType
==
1
||
orderType
==
2
){
myWaterBiz
.
updMyWalletUnbooked
(
userId
,
amount
,
2
);
}
log
.
info
(
"订单完成计算用户拥金----finishOrderWater----orderId===="
+
orderId
+
"---amount=="
+
amount
);
int
r
=
amount
.
compareTo
(
BigDecimal
.
ZERO
);
//更新钱包
if
(
r
==
1
&&
userId
>
0
)
{
MyWalletDetail
detail
=
new
MyWalletDetail
();
detail
.
setUserId
(
userId
);
detail
.
setAmount
(
amount
);
detail
.
setCono
(
orderId
);
detail
.
setSource
(
1
);
myWaterBiz
.
updMyWater
(
detail
);
if
(
orderType
==
1
||
orderType
==
2
){
myWaterBiz
.
updMyWalletUnbooked
(
userId
,
amount
,
2
);
}
}
}
}
}
}
//订单退款计算用户拥金
//订单退款计算用户拥金
...
@@ -230,20 +243,20 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A
...
@@ -230,20 +243,20 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A
log
.
info
(
"订单完成计算用户拥金----refundOrderWater----id===="
+
id
+
"---commission=="
+
commission
+
"---orderType===="
+
orderType
);
log
.
info
(
"订单完成计算用户拥金----refundOrderWater----id===="
+
id
+
"---commission=="
+
commission
+
"---orderType===="
+
orderType
);
unbooked
=
unbooked
.
add
(
commission
);
unbooked
=
unbooked
.
add
(
commission
);
}
}
}
log
.
info
(
"订单完成计算用户拥金----refundOrderWater----orderId===="
+
orderId
+
"---amount=="
+
amount
+
"---unbooked==="
+
unbooked
);
log
.
info
(
"订单完成计算用户拥金----refundOrderWater----orderId===="
+
orderId
+
"---amount=="
+
amount
+
"---unbooked==="
+
unbooked
);
int
r
=
amount
.
compareTo
(
BigDecimal
.
ZERO
);
int
r
=
amount
.
compareTo
(
BigDecimal
.
ZERO
);
//更新钱包
//更新钱包
if
(
r
==
1
&&
userId
>
0
)
{
if
(
r
==
1
&&
userId
>
0
)
{
MyWalletDetail
detail
=
new
MyWalletDetail
();
MyWalletDetail
detail
=
new
MyWalletDetail
(
);
detail
.
setUserId
(
userId
);
detail
.
setUserId
(
userId
);
detail
.
setAmount
(
amount
);
detail
.
setAmount
(
amount
);
detail
.
setCono
(
orderId
);
detail
.
setCono
(
orderId
);
detail
.
setSource
(
1
);
detail
.
setSource
(
1
);
myWaterBiz
.
updMyWater
(
detail
);
myWaterBiz
.
updMyWater
(
detail
);
}
}
if
(
orderType
==
1
||
orderType
==
2
){
if
(
orderType
==
1
||
orderType
==
2
){
myWaterBiz
.
updMyWalletUnbooked
(
userId
,
unbooked
,
2
);
myWaterBiz
.
updMyWalletUnbooked
(
userId
,
unbooked
,
2
);
}
}
}
}
}
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/MyWaterBiz.java
View file @
3d00348c
...
@@ -113,7 +113,8 @@ public class MyWaterBiz extends BaseBiz<MyWalletMapper, MyWallet>{
...
@@ -113,7 +113,8 @@ public class MyWaterBiz extends BaseBiz<MyWalletMapper, MyWallet>{
//钱包未入账的处理type1-进;2-出
//钱包未入账的处理type1-进;2-出
public
void
updMyWalletUnbooked
(
Integer
userId
,
BigDecimal
amount
,
Integer
type
){
public
void
updMyWalletUnbooked
(
Integer
userId
,
BigDecimal
amount
,
Integer
type
){
log
.
info
(
"---钱包未入账的处理updMyWalletUnbooked----userId==="
+
userId
+
"----type==="
+
type
);
log
.
info
(
"---钱包未入账的处理updMyWalletUnbooked----userId==="
+
userId
+
"----type==="
+
type
+
"---amount==="
+
amount
);
MyWallet
wallet
=
new
MyWallet
();
MyWallet
wallet
=
new
MyWallet
();
wallet
.
setUserId
(
userId
);
wallet
.
setUserId
(
userId
);
wallet
=
selectOne
(
wallet
);
wallet
=
selectOne
(
wallet
);
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/mapper/AppUserPositionMapper.java
View file @
3d00348c
...
@@ -17,6 +17,6 @@ import java.util.List;
...
@@ -17,6 +17,6 @@ import java.util.List;
public
interface
AppUserPositionMapper
extends
Mapper
<
AppUserPosition
>
{
public
interface
AppUserPositionMapper
extends
Mapper
<
AppUserPosition
>
{
Integer
getExtractByUserId
(
@Param
(
"userId"
)
Integer
userId
);
AppUserPosition
getExtractByUserId
(
@Param
(
"userId"
)
Integer
userId
);
}
}
ace-modules/ace-admin/src/main/resources/mapper/AppUserPositionMapper.xml
View file @
3d00348c
...
@@ -16,8 +16,8 @@
...
@@ -16,8 +16,8 @@
<result
property=
"isDel"
column=
"is_del"
/>
<result
property=
"isDel"
column=
"is_del"
/>
</resultMap>
</resultMap>
<select
id=
"getExtractByUserId"
result
Type=
"Integer
"
>
<select
id=
"getExtractByUserId"
result
Map=
"appUserPositionMap
"
>
SELECT p.
extract
FROM app_user_detail d LEFT JOIN app_user_position p
SELECT p.
*
FROM app_user_detail d LEFT JOIN app_user_position p
ON d.position_id=p.id
ON d.position_id=p.id
WHERE d.userid=#{userId} LIMIT 1
WHERE d.userid=#{userId} LIMIT 1
</select>
</select>
...
...
xx-im/xx-im-api/src/main/java/com/xxfc/platform/im/vo/QuestionListVo.java
View file @
3d00348c
...
@@ -11,4 +11,5 @@ import java.util.List;
...
@@ -11,4 +11,5 @@ import java.util.List;
public
class
QuestionListVo
extends
ImQuestion
{
public
class
QuestionListVo
extends
ImQuestion
{
List
<
ImComment
>
imComment
;
List
<
ImComment
>
imComment
;
List
<
ImPraise
>
imPraise
;
List
<
ImPraise
>
imPraise
;
private
boolean
isPraise
;
}
}
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/biz/ImPraiseBiz.java
View file @
3d00348c
...
@@ -10,11 +10,13 @@ import com.xxfc.platform.im.entity.ImPraise;
...
@@ -10,11 +10,13 @@ import com.xxfc.platform.im.entity.ImPraise;
import
com.xxfc.platform.im.entity.ImQuestion
;
import
com.xxfc.platform.im.entity.ImQuestion
;
import
com.xxfc.platform.im.mapper.ImPraiseMapper
;
import
com.xxfc.platform.im.mapper.ImPraiseMapper
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections4.map.HashedMap
;
import
org.joda.time.DateTime
;
import
org.joda.time.DateTime
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
@Slf4j
@Slf4j
@Service
@Service
...
@@ -91,4 +93,12 @@ public class ImPraiseBiz extends BaseBiz<ImPraiseMapper, ImPraise> {
...
@@ -91,4 +93,12 @@ public class ImPraiseBiz extends BaseBiz<ImPraiseMapper, ImPraise> {
return
list
;
return
list
;
}
}
public
boolean
isExist
(
Integer
userId
,
Long
questionId
)
{
Map
<
String
,
Object
>
map
=
new
HashedMap
<>();
map
.
put
(
"userId"
,
userId
);
map
.
put
(
"questionId"
,
questionId
);
List
<
ImPraise
>
list
=
mapper
.
selectByUserIdAndQuestionId
(
map
);
return
list
.
size
()
>
0
?
true
:
false
;
}
}
}
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/biz/ImQuestionBiz.java
View file @
3d00348c
...
@@ -12,6 +12,7 @@ import com.xxfc.platform.im.dto.QuestionParamDto;
...
@@ -12,6 +12,7 @@ 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.im.vo.QuestionListVo
;
import
com.xxfc.platform.universal.feign.MQSenderFeign
;
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
;
...
@@ -28,6 +29,8 @@ public class ImQuestionBiz extends BaseBiz<ImQuestionMapper, ImQuestion> {
...
@@ -28,6 +29,8 @@ public class ImQuestionBiz extends BaseBiz<ImQuestionMapper, ImQuestion> {
@Autowired
@Autowired
MQSenderFeign
mqSenderFeign
;
MQSenderFeign
mqSenderFeign
;
@Autowired
ImPraiseBiz
imPraiseBiz
;
/**
/**
* 获取列表
* 获取列表
*
*
...
@@ -36,8 +39,13 @@ public class ImQuestionBiz extends BaseBiz<ImQuestionMapper, ImQuestion> {
...
@@ -36,8 +39,13 @@ public class ImQuestionBiz extends BaseBiz<ImQuestionMapper, ImQuestion> {
*/
*/
public
ObjectRestResponse
getList
(
QuestionParamDto
questionParamDto
)
{
public
ObjectRestResponse
getList
(
QuestionParamDto
questionParamDto
)
{
Query
query
=
new
Query
(
questionParamDto
);
Query
query
=
new
Query
(
questionParamDto
);
PageDataVO
pageDataVO
=
PageDataVO
.
pageInfo
(
query
,
()
->
mapper
.
getQuestionList
(
query
.
getSuper
()));
PageDataVO
<
QuestionListVo
>
pageDataVO
=
PageDataVO
.
pageInfo
(
query
,
()
->
mapper
.
getQuestionList
(
query
.
getSuper
()));
return
new
ObjectRestResponse
<>().
data
(
pageDataVO
);
AppUserDTO
appUserDTO
=
userBiz
.
getUserInfo
();
if
(
appUserDTO
!=
null
)
{
pageDataVO
.
getData
().
forEach
((
a
)
->
a
.
setPraise
(
imPraiseBiz
.
isExist
(
appUserDTO
.
getUserid
(),
a
.
getId
())));
}
return
new
ObjectRestResponse
<>().
data
(
pageDataVO
);
}
}
...
...
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/mapper/ImPraiseMapper.java
View file @
3d00348c
...
@@ -4,6 +4,7 @@ import com.xxfc.platform.im.entity.ImPraise;
...
@@ -4,6 +4,7 @@ import com.xxfc.platform.im.entity.ImPraise;
import
tk.mybatis.mapper.common.Mapper
;
import
tk.mybatis.mapper.common.Mapper
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
public
interface
ImPraiseMapper
extends
Mapper
<
ImPraise
>
{
public
interface
ImPraiseMapper
extends
Mapper
<
ImPraise
>
{
...
@@ -11,4 +12,6 @@ public interface ImPraiseMapper extends Mapper<ImPraise> {
...
@@ -11,4 +12,6 @@ public interface ImPraiseMapper extends Mapper<ImPraise> {
List
<
ImPraise
>
selectByQuestionIdAndTime
(
ImPraise
imPraise
);
List
<
ImPraise
>
selectByQuestionIdAndTime
(
ImPraise
imPraise
);
List
<
ImPraise
>
selectByUserIdAndQuestionId
(
Map
<
String
,
Object
>
param
);
}
}
\ No newline at end of file
xx-im/xx-im-server/src/main/resources/mapper/ImPraiseMapper.xml
View file @
3d00348c
...
@@ -24,4 +24,10 @@
...
@@ -24,4 +24,10 @@
where question_id = #{questionId} and is_del = 0 and visible = 1
where question_id = #{questionId} and is_del = 0 and visible = 1
and time between #{startTime} and #{endTime}
and time between #{startTime} and #{endTime}
</select>
</select>
<select
id=
"selectByUserIdAndQuestionId"
resultType=
"com.xxfc.platform.im.entity.ImPraise"
parameterType=
"java.util.Map"
>
select * from im_praise
where question_id = #{questionId} and is_del = 0 and visible = 1
and user_id = #{userId}
</select>
</mapper>
</mapper>
\ No newline at end of file
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/BaseOrderBiz.java
View file @
3d00348c
...
@@ -316,20 +316,20 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper,BaseOrder> {
...
@@ -316,20 +316,20 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper,BaseOrder> {
//计算退款金额
//计算退款金额
// 1、押金 + 租金(规则扣除)
// 1、押金 + 租金(规则扣除)
//BigDecimal refundGoodsAmount = baseOrder.getGoodsAmount();
//BigDecimal refundGoodsAmount = baseOrder.getGoodsAmount();
String
refundDesc
=
"取消订单退款:"
;
String
Builder
refundDescBuilder
=
new
StringBuilder
(
"取消订单退款:"
)
;
if
(
null
==
depositAmount
)
{
if
(
null
==
depositAmount
)
{
depositAmount
=
BigDecimal
.
ZERO
;
depositAmount
=
BigDecimal
.
ZERO
;
}
}
//商品价格 - 优惠券减免的价格
//商品价格 - 优惠券减免的价格
BigDecimal
refundGoodsAmount
=
calculateRefund
(
baseOrder
.
getGoodsAmount
().
subtract
(
baseOrder
.
getCouponAmount
()),
timeLag
,
dicParentKey
,
refundDesc
);
BigDecimal
refundGoodsAmount
=
calculateRefund
(
baseOrder
.
getGoodsAmount
().
subtract
(
baseOrder
.
getCouponAmount
()),
timeLag
,
dicParentKey
,
refundDesc
Builder
);
//退款金额
//退款金额
BigDecimal
refundAmount
=
depositAmount
.
add
(
refundGoodsAmount
);
BigDecimal
refundAmount
=
depositAmount
.
add
(
refundGoodsAmount
);
//退款子流程: 订单基础,退款描述,退款金额
//退款子流程: 订单基础,退款描述,退款金额
refundSubProcess
(
baseOrder
,
refundDesc
,
refundAmount
,
RefundTypeEnum
.
ORDER_FUND
.
getCode
(),
RefundStatusEnum
.
ALL
.
getCode
());
refundSubProcess
(
baseOrder
,
refundDesc
Builder
.
toString
()
,
refundAmount
,
RefundTypeEnum
.
ORDER_FUND
.
getCode
(),
RefundStatusEnum
.
ALL
.
getCode
());
}
}
public
BigDecimal
calculateRefund
(
BigDecimal
goodsAmount
,
Long
timeLag
,
String
dicParentKey
,
String
refundDesc
)
{
public
BigDecimal
calculateRefund
(
BigDecimal
goodsAmount
,
Long
timeLag
,
String
dicParentKey
,
String
Builder
refundDescBuilder
)
{
BigDecimal
refundGoodsAmount
=
goodsAmount
;
BigDecimal
refundGoodsAmount
=
goodsAmount
;
//根据时间处理goodsAmount
//根据时间处理goodsAmount
...
@@ -354,7 +354,7 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper,BaseOrder> {
...
@@ -354,7 +354,7 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper,BaseOrder> {
//ga : goodsAmount
//ga : goodsAmount
set
(
"ga"
,
goodsAmount
);
set
(
"ga"
,
goodsAmount
);
}})).
toString
());
}})).
toString
());
refundDesc
=
names
[
1
]+
","
+
refundDesc
;
refundDesc
Builder
=
refundDescBuilder
.
insert
(
0
,
names
[
1
]+
","
)
;
break
;
break
;
}
}
}
}
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/OrderTourVerificationBiz.java
View file @
3d00348c
...
@@ -92,7 +92,7 @@ public class OrderTourVerificationBiz{
...
@@ -92,7 +92,7 @@ public class OrderTourVerificationBiz{
}
}
// 出发时间 是否已经发车
// 出发时间 是否已经发车
Date
departureDate
=
tourFeign
.
selectDepartureDataBySpeId
(
tourDetail
.
getSpePriceId
());
/*
Date departureDate = tourFeign.selectDepartureDataBySpeId(tourDetail.getSpePriceId());
Long departureTime = tourFeign.selectDepartureTimeByStartCompanyIdAndRouteId(tourDetail.getStartCompanyId(), tourDetail.getGoodId());
Long departureTime = tourFeign.selectDepartureTimeByStartCompanyIdAndRouteId(tourDetail.getStartCompanyId(), tourDetail.getGoodId());
Integer departureStatus = tourFeign.selectDepartureStatusByVerificationId(verificationId);
Integer departureStatus = tourFeign.selectDepartureStatusByVerificationId(verificationId);
LocalTime localDepartureTime = LocalTime.ofSecondOfDay(departureTime);
LocalTime localDepartureTime = LocalTime.ofSecondOfDay(departureTime);
...
@@ -113,7 +113,7 @@ public class OrderTourVerificationBiz{
...
@@ -113,7 +113,7 @@ public class OrderTourVerificationBiz{
if (departureStatus==1){
if (departureStatus==1){
return ObjectRestResponse.createFailedResultWithObj(400,"已经发车",1);
return ObjectRestResponse.createFailedResultWithObj(400,"已经发车",1);
}
}
*/
baseOrder
=
new
BaseOrder
();
baseOrder
=
new
BaseOrder
();
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/OrderRefundController.java
View file @
3d00348c
...
@@ -24,6 +24,9 @@ import org.springframework.web.bind.annotation.ResponseBody;
...
@@ -24,6 +24,9 @@ import org.springframework.web.bind.annotation.ResponseBody;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
constant
.
CommonConstants
.
SYS_FALSE
;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
constant
.
CommonConstants
.
SYS_FALSE
;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
constant
.
CommonConstants
.
SYS_TRUE
;
import
static
com
.
xxfc
.
platform
.
universal
.
constant
.
DictionaryKey
.
TOUR_IN_REFUND
;
import
static
com
.
xxfc
.
platform
.
universal
.
constant
.
DictionaryKey
.
TOUR_REFUND
;
@Controller
@Controller
@RequestMapping
(
"orderRefund"
)
@RequestMapping
(
"orderRefund"
)
...
@@ -40,10 +43,10 @@ public class OrderRefundController extends BaseController<OrderRefundBiz,OrderRe
...
@@ -40,10 +43,10 @@ public class OrderRefundController extends BaseController<OrderRefundBiz,OrderRe
return
userFeign
;
return
userFeign
;
}
}
@RequestMapping
(
value
=
"/price/calculate/{
type}/{
no}"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/price/calculate/{no}"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
@ResponseBody
@IgnoreClientToken
@IgnoreClientToken
public
ObjectRestResponse
getPriceCalculate
(
@PathVariable
(
value
=
"type"
)
String
type
,
@PathVariable
(
value
=
"no"
)
String
no
)
{
public
ObjectRestResponse
<
BigDecimal
>
getPriceCalculate
(
@PathVariable
(
value
=
"no"
)
String
no
)
{
checkAppUser
();
checkAppUser
();
//根据no 查订单
//根据no 查订单
OrderPageVO
orderPageVO
=
baseOrderBiz
.
pageByParm
(
new
Query
(
new
PageParam
(){{
OrderPageVO
orderPageVO
=
baseOrderBiz
.
pageByParm
(
new
Query
(
new
PageParam
(){{
...
@@ -51,36 +54,38 @@ public class OrderRefundController extends BaseController<OrderRefundBiz,OrderRe
...
@@ -51,36 +54,38 @@ public class OrderRefundController extends BaseController<OrderRefundBiz,OrderRe
setPage
(
1
);
setPage
(
1
);
}}){{
put
(
"no"
,
no
);
}}.
getSuper
()).
get
(
0
);
}}){{
put
(
"no"
,
no
);
}}.
getSuper
()).
get
(
0
);
OrderRefundPriceVO
orp
=
new
OrderRefundPriceVO
(){{
setRealAmount
(
orderPageVO
.
getRealAmount
());
}};
OrderTypeEnum
orderTypeEnum
=
OrderTypeEnum
.
get
(
orderPageVO
.
getType
());
OrderTypeEnum
orderTypeEnum
=
OrderTypeEnum
.
get
(
orderPageVO
.
getType
());
BigDecimal
orderRefundAmount
=
BigDecimal
.
ZERO
;
StringBuilder
refundDescBuilder
=
new
StringBuilder
(
""
);
switch
(
orderTypeEnum
)
{
switch
(
orderTypeEnum
)
{
case
RENT_VEHICLE:
case
RENT_VEHICLE:
baseOrderBiz
.
calculateRefund
(
orderPageVO
.
getGoodsAmount
(
)
orderRefundAmount
=
baseOrderBiz
.
calculateRefund
(
orderPageVO
.
getGoodsAmount
().
subtract
(
orderPageVO
.
getCouponAmount
()
)
,
System
.
currentTimeMillis
()
-
orderPageVO
.
getOrderRentVehicleDetail
().
getStartTime
()
,
orderPageVO
.
getOrderRentVehicleDetail
().
getStartTime
()
-
System
.
currentTimeMillis
()
,
DictionaryKey
.
APP_ORDER
+
"_"
+
DictionaryKey
.
RENT_REFUND
,
DictionaryKey
.
APP_ORDER
+
"_"
+
DictionaryKey
.
RENT_REFUND
,
"取消订单退款:"
);
,
refundDescBuilder
);
break
;
break
;
case
TOUR:
case
TOUR:
// String dicParentKey = DictionaryKey.APP_ORDER+ "_"+ DictionaryKey.TOUR_REFUND;
//判断是省内还是省外
// //不是省外,
String
key
=
TOUR_IN_REFUND
;
// if(SYS_FALS
E.equals(orderPageVO.getOrderTourDetail().getIsOutside())) {
if
(
SYS_TRU
E
.
equals
(
orderPageVO
.
getOrderTourDetail
().
getIsOutside
()))
{
// dicParentKey = DictionaryKey.APP_ORDER+ "_"+ DictionaryKey.TOUR_IN
_REFUND;
key
=
TOUR
_REFUND
;
//
}
}
// orp.setRefundAmount(
baseOrderBiz.calculateRefund(orderPageVO.getGoodsAmount().subtract(orderPageVO.getCouponAmount())
orderRefundAmount
=
baseOrderBiz
.
calculateRefund
(
orderPageVO
.
getGoodsAmount
().
subtract
(
orderPageVO
.
getCouponAmount
())
// , System.currentTimeMillis() - orderPageVO.getOrderRentVehicleDetail().getStartTime
()
,
orderPageVO
.
getOrderTourDetail
().
getStartTime
()
-
System
.
currentTimeMillis
()
//
, DictionaryKey.APP_ORDER+ "_"+ DictionaryKey.RENT_REFUND
,
DictionaryKey
.
APP_ORDER
+
"_"
+
DictionaryKey
.
RENT_REFUND
// , "取消订单退款:")
);
,
refundDescBuilder
);
break
;
break
;
default
:
default
:
// orp.setRefundAmount(orderPageVO);
break
;
break
;
}
}
return
null
;
OrderRefundPriceVO
orpv
=
new
OrderRefundPriceVO
();
orpv
.
setRealAmount
(
orderPageVO
.
getRealAmount
());
orpv
.
setRefundAmount
(
orderRefundAmount
);
orpv
.
setRefundDesc
(
refundDescBuilder
.
toString
());
return
ObjectRestResponse
.
succ
(
orpv
);
}
}
@Data
@Data
...
@@ -88,10 +93,11 @@ public class OrderRefundController extends BaseController<OrderRefundBiz,OrderRe
...
@@ -88,10 +93,11 @@ public class OrderRefundController extends BaseController<OrderRefundBiz,OrderRe
BigDecimal
refundAmount
;
BigDecimal
refundAmount
;
BigDecimal
realAmount
;
BigDecimal
realAmount
;
BigDecimal
cutAmount
;
BigDecimal
cutAmount
;
String
refundDesc
;
public
void
setRefundAmount
(
BigDecimal
refundAmount
)
{
public
void
setRefundAmount
(
BigDecimal
refundAmount
)
{
this
.
refundAmount
=
refundAmount
;
this
.
refundAmount
=
refundAmount
;
this
.
cutAmount
=
realAmount
.
multiply
(
refundAmount
);
this
.
cutAmount
=
realAmount
.
subtract
(
refundAmount
);
}
}
}
}
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment