记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
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
董敬伟
liquidnet-bus-v1
Commits
401111aa
Commit
401111aa
authored
Mar 21, 2022
by
Administrator
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'pre' into 'master'
Pre See merge request
!194
parents
736e916a
4358b898
Changes
34
Hide whitespace changes
Inline
Side-by-side
Showing
34 changed files
with
796 additions
and
340 deletions
+796
-340
ICandyCouponService.java
.../liquidnet/service/candy/service/ICandyCouponService.java
+1
-1
CandyUseResultVo.java
...java/com/liquidnet/service/candy/vo/CandyUseResultVo.java
+4
-0
GoblinUseResultVo.java
...om/liquidnet/service/goblin/dto/vo/GoblinUseResultVo.java
+3
-0
GoblinUserCouponVo.java
...m/liquidnet/service/goblin/dto/vo/GoblinUserCouponVo.java
+3
-0
CouponCanUse2Param.java
...om/liquidnet/service/goblin/param/CouponCanUse2Param.java
+33
-0
CouponCanUseAllParam.java
.../liquidnet/service/goblin/param/CouponCanUseAllParam.java
+32
-0
CouponCanUseParam.java
...com/liquidnet/service/goblin/param/CouponCanUseParam.java
+35
-0
CouponHelpUseParam.java
...om/liquidnet/service/goblin/param/CouponHelpUseParam.java
+37
-0
CouponHelpUseVo.java
...a/com/liquidnet/service/goblin/param/CouponHelpUseVo.java
+39
-0
GoblinOrderPreParam.java
...m/liquidnet/service/goblin/param/GoblinOrderPreParam.java
+3
-0
GoblinCouponService.java
...liquidnet/service/goblin/service/GoblinCouponService.java
+13
-1
BusinessType.java
...com/liquidnet/client/admin/common/enums/BusinessType.java
+5
-0
KylinPerformancesController.java
...ontroller/zhengzai/kylin/KylinPerformancesController.java
+9
-4
GoblinFrontCubeServiceImpl.java
...ngzai/goblin/service/impl/GoblinFrontCubeServiceImpl.java
+9
-0
CandyCouponController.java
...idnet/service/candy/controller/CandyCouponController.java
+5
-2
CandyCouponServiceImpl.java
...et/service/candy/service/impl/CandyCouponServiceImpl.java
+13
-5
CouponBaseUtil.java
...java/com/liquidnet/service/candy/util/CouponBaseUtil.java
+19
-5
bootstrap-service-consumer-goblin.yml
.../src/main/resources/bootstrap-service-consumer-goblin.yml
+0
-17
DragonOrderRefundsServiceImpl.java
...ce/dragon/service/impl/DragonOrderRefundsServiceImpl.java
+2
-0
GoblinCouponController.java
...net/service/goblin/controller/GoblinCouponController.java
+52
-18
GoblinFrontController.java
...dnet/service/goblin/controller/GoblinFrontController.java
+0
-4
GoblinCouponImpl.java
...quidnet/service/goblin/service/impl/GoblinCouponImpl.java
+261
-5
GoblinFrontServiceImpl.java
...t/service/goblin/service/impl/GoblinFrontServiceImpl.java
+13
-2
GoblinOrderAppServiceImpl.java
...ervice/goblin/service/impl/GoblinOrderAppServiceImpl.java
+2
-2
GoblinStoreOrderServiceImpl.java
...blin/service/impl/manage/GoblinStoreOrderServiceImpl.java
+1
-1
GoblinMongoUtils.java
...a/com/liquidnet/service/goblin/util/GoblinMongoUtils.java
+1
-1
GoblinOrderUtils.java
...a/com/liquidnet/service/goblin/util/GoblinOrderUtils.java
+9
-131
GoblinRedisUtils.java
...a/com/liquidnet/service/goblin/util/GoblinRedisUtils.java
+2
-1
RedisStreamConfig.java
...om/liquidnet/service/dragon/config/RedisStreamConfig.java
+0
-66
DragonOrderRefundsServiceImpl.java
...ce/dragon/service/impl/DragonOrderRefundsServiceImpl.java
+2
-0
GoblinOrderServiceImpl.java
...et/service/order/service/impl/GoblinOrderServiceImpl.java
+71
-33
KylinOrderTicketsServiceImpl.java
...vice/order/service/impl/KylinOrderTicketsServiceImpl.java
+0
-4
GoblinOrderUtils.java
...a/com/liquidnet/service/order/utils/GoblinOrderUtils.java
+111
-37
OrderUtils.java
...in/java/com/liquidnet/service/order/utils/OrderUtils.java
+6
-0
No files found.
liquidnet-bus-api/liquidnet-service-candy-api/src/main/java/com/liquidnet/service/candy/service/ICandyCouponService.java
View file @
401111aa
...
...
@@ -48,5 +48,5 @@ public interface ICandyCouponService {
ResponseDto
<
CandyCouponVo
>
receiveCouponDetails
(
String
ccode
);
ResponseDto
<
List
<
CandyCouponVo
>>
couponListById
(
String
uCouponIds
);
ResponseDto
<
List
<
CandyCouponVo
>>
couponListById
(
String
uCouponIds
,
String
uid
);
}
liquidnet-bus-api/liquidnet-service-candy-api/src/main/java/com/liquidnet/service/candy/vo/CandyUseResultVo.java
View file @
401111aa
...
...
@@ -17,6 +17,10 @@ public class CandyUseResultVo implements Serializable, Cloneable {
private
BigDecimal
value
;
@ApiModelProperty
(
value
=
"券类型[-1-不可用 | 1-代金券|2-满减券|3-兑换券|4-折扣券|101-优先券]"
,
example
=
"1"
)
private
Integer
couType
;
@ApiModelProperty
(
value
=
"目标数组"
)
private
List
<
String
>
targetIds
;
@ApiModelProperty
(
value
=
"满减金额[满多少]"
)
private
BigDecimal
fullValue
;
private
static
final
CandyUseResultVo
obj
=
new
CandyUseResultVo
();
...
...
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/vo/GoblinUseResultVo.java
View file @
401111aa
...
...
@@ -6,6 +6,7 @@ import lombok.Data;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.util.List
;
@Data
@ApiModel
...
...
@@ -16,6 +17,8 @@ public class GoblinUseResultVo implements Serializable, Cloneable {
private
BigDecimal
value
;
@ApiModelProperty
(
value
=
"券类型[1-代金券|2-折扣券|3-满减券]"
,
example
=
"1"
)
private
String
couType
;
@ApiModelProperty
(
value
=
"适用spu范围"
)
private
List
<
String
>
spuIds
;
private
static
final
GoblinUseResultVo
obj
=
new
GoblinUseResultVo
();
...
...
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/vo/GoblinUserCouponVo.java
View file @
401111aa
...
...
@@ -9,6 +9,7 @@ import lombok.Data;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.time.LocalDateTime
;
import
java.util.List
;
/**
* 商城:用户优惠券展示信息(缓存)
...
...
@@ -61,6 +62,8 @@ public class GoblinUserCouponVo implements Serializable, Cloneable {
@ApiModelProperty
(
position
=
35
,
value
=
"店铺ID"
)
private
String
storeId
;
@ApiModelProperty
(
position
=
36
,
value
=
"spuIds"
)
private
List
<
String
>
spuIds
;
/* -------------------------------------------------------------------- */
...
...
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/param/CouponCanUse2Param.java
0 → 100644
View file @
401111aa
package
com
.
liquidnet
.
service
.
goblin
.
param
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
@Api
@Data
public
class
CouponCanUse2Param
implements
Serializable
,
Cloneable
{
@ApiModelProperty
(
dataType
=
"String"
,
name
=
"spuId"
,
value
=
"spuId"
,
example
=
"1"
,
required
=
true
)
@NotNull
@NotBlank
private
String
spuId
;
@ApiModelProperty
(
dataType
=
"Number"
,
name
=
"price"
,
value
=
"当前spu总价"
,
example
=
"10"
,
required
=
true
)
@NotNull
@NotBlank
private
BigDecimal
price
;
private
static
final
CouponCanUse2Param
obj
=
new
CouponCanUse2Param
();
public
static
CouponCanUse2Param
getNew
()
{
try
{
return
(
CouponCanUse2Param
)
obj
.
clone
();
}
catch
(
CloneNotSupportedException
e
)
{
e
.
printStackTrace
();
}
return
new
CouponCanUse2Param
();
}
}
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/param/CouponCanUseAllParam.java
0 → 100644
View file @
401111aa
package
com
.
liquidnet
.
service
.
goblin
.
param
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
java.io.Serializable
;
import
java.util.List
;
@Api
@Data
public
class
CouponCanUseAllParam
implements
Serializable
,
Cloneable
{
@ApiModelProperty
(
name
=
"spuIds"
,
value
=
"spuId集合"
,
required
=
true
)
@NotNull
@NotBlank
private
List
<
String
>
spuIds
;
@ApiModelProperty
(
dataType
=
"String"
,
name
=
"uid"
,
value
=
"用户id"
,
example
=
"10"
,
required
=
true
)
private
String
uid
;
private
static
final
CouponCanUseAllParam
obj
=
new
CouponCanUseAllParam
();
public
static
CouponCanUseAllParam
getNew
()
{
try
{
return
(
CouponCanUseAllParam
)
obj
.
clone
();
}
catch
(
CloneNotSupportedException
e
)
{
e
.
printStackTrace
();
}
return
new
CouponCanUseAllParam
();
}
}
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/param/CouponCanUseParam.java
0 → 100644
View file @
401111aa
package
com
.
liquidnet
.
service
.
goblin
.
param
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
java.io.Serializable
;
import
java.util.List
;
@Api
@Data
public
class
CouponCanUseParam
implements
Serializable
,
Cloneable
{
@ApiModelProperty
(
name
=
"param"
,
value
=
"对象"
,
required
=
true
)
@NotNull
@NotBlank
private
List
<
CouponCanUse2Param
>
param
;
@ApiModelProperty
(
dataType
=
"String"
,
name
=
"uid"
,
value
=
"用户id"
,
example
=
"10"
,
required
=
false
)
private
String
uid
;
@ApiModelProperty
(
dataType
=
"String"
,
name
=
"storeId"
,
value
=
"店铺id"
,
example
=
"10"
,
required
=
false
)
private
String
storeId
;
private
static
final
CouponCanUseParam
obj
=
new
CouponCanUseParam
();
public
static
CouponCanUseParam
getNew
()
{
try
{
return
(
CouponCanUseParam
)
obj
.
clone
();
}
catch
(
CloneNotSupportedException
e
)
{
e
.
printStackTrace
();
}
return
new
CouponCanUseParam
();
}
}
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/param/CouponHelpUseParam.java
0 → 100644
View file @
401111aa
package
com
.
liquidnet
.
service
.
goblin
.
param
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
java.io.Serializable
;
import
java.util.List
;
@Api
@Data
public
class
CouponHelpUseParam
implements
Serializable
,
Cloneable
{
@ApiModelProperty
(
name
=
"param"
,
value
=
"对象"
,
required
=
true
)
@NotNull
@NotBlank
private
List
<
CouponCanUse2Param
>
param
;
@ApiModelProperty
(
dataType
=
"String"
,
name
=
"uid"
,
value
=
"用户id"
,
example
=
"10"
,
required
=
false
)
private
String
uid
;
@ApiModelProperty
(
dataType
=
"String"
,
name
=
"ucouponId"
,
value
=
"店铺券id"
,
required
=
false
)
private
String
ucouponId
;
@ApiModelProperty
(
dataType
=
"String"
,
name
=
"platformUcouponId"
,
value
=
"平台券id"
,
required
=
false
)
private
String
platformUcouponId
;
private
static
final
CouponHelpUseParam
obj
=
new
CouponHelpUseParam
();
public
static
CouponHelpUseParam
getNew
()
{
try
{
return
(
CouponHelpUseParam
)
obj
.
clone
();
}
catch
(
CloneNotSupportedException
e
)
{
e
.
printStackTrace
();
}
return
new
CouponHelpUseParam
();
}
}
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/param/CouponHelpUseVo.java
0 → 100644
View file @
401111aa
package
com
.
liquidnet
.
service
.
goblin
.
param
;
import
com.liquidnet.service.goblin.dto.vo.GoblinUserCouponVo
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.util.List
;
@Api
@Data
public
class
CouponHelpUseVo
implements
Serializable
,
Cloneable
{
// @ApiModelProperty(name = "param", value = "对象")
// private List<CouponCanUse2Param> param;
// @ApiModelProperty(name = "couponVo", value = "券vo")
// private GoblinUserCouponVo couponVo;
@ApiModelProperty
(
dataType
=
"String"
,
name
=
"ucouponId"
,
value
=
"券id"
,
required
=
true
)
private
String
ucouponId
;
@ApiModelProperty
(
dataType
=
"String"
,
name
=
"platformUcouponId"
,
value
=
"平台券id"
,
required
=
true
)
private
String
platformUcouponId
;
@ApiModelProperty
(
dataType
=
"number"
,
name
=
"price"
,
value
=
"优惠金额"
,
required
=
true
)
private
BigDecimal
price
;
private
static
final
CouponHelpUseVo
obj
=
new
CouponHelpUseVo
();
public
static
CouponHelpUseVo
getNew
()
{
try
{
return
(
CouponHelpUseVo
)
obj
.
clone
();
}
catch
(
CloneNotSupportedException
e
)
{
e
.
printStackTrace
();
}
return
new
CouponHelpUseVo
();
}
}
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/param/GoblinOrderPreParam.java
View file @
401111aa
...
...
@@ -43,6 +43,9 @@ public class GoblinOrderPreParam implements Cloneable{
private
GoblinStoreOrder
storeOrder
;
private
GoblinOrderAttr
orderAttr
;
private
List
<
GoblinOrderSku
>
orderSkuList
;
private
List
<
String
>
storeSpuIds
;
private
List
<
String
>
platformSpuIds
;
private
static
final
GoblinOrderPreParam
obj
=
new
GoblinOrderPreParam
();
...
...
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/service/GoblinCouponService.java
View file @
401111aa
...
...
@@ -3,7 +3,7 @@ package com.liquidnet.service.goblin.service;
import
com.liquidnet.service.goblin.dto.vo.GoblinStoreCouponVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinUseResultVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinUserCouponVo
;
import
com.liquidnet.service.goblin.param.
BackCouponParam
;
import
com.liquidnet.service.goblin.param.
*
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
...
...
@@ -28,9 +28,21 @@ public interface GoblinCouponService {
//可用券列表 [价格] [spuId逗号隔开] [uid]
List
<
GoblinUserCouponVo
>
useList
(
BigDecimal
totalPrice
,
String
spuId
,
String
uid
);
//可用券列表[可用券列表[返回商品下所有券]]
List
<
GoblinUserCouponVo
>
useList3
(
CouponCanUseAllParam
param
);
List
<
GoblinUserCouponVo
>
useList2
(
CouponCanUseParam
param
);
//使用券 [券id] [消费内容] [价格] [spuId逗号隔开]
GoblinUseResultVo
useCoupon
(
String
ucouponId
,
String
content
,
BigDecimal
totalPrice
,
String
spuId
,
String
uid
);
//回退券 [list<Data>] [券id , 用户id]
Boolean
backCoupon
(
List
<
BackCouponParam
>
params
);
/**
* 帮前端写选择券逻辑
* @param params
* @return
*/
CouponHelpUseVo
helpUseCoupon
(
CouponHelpUseParam
params
);
}
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-common/src/main/java/com/liquidnet/client/admin/common/enums/BusinessType.java
View file @
401111aa
...
...
@@ -134,4 +134,9 @@ public enum BusinessType
* 会员订单退款
*/
MORDER_REFUND
,
/**
* 修改
*/
PERFORMANCE_SAVE
,
}
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/java/com/liquidnet/client/admin/web/controller/zhengzai/kylin/KylinPerformancesController.java
View file @
401111aa
...
...
@@ -84,7 +84,7 @@ public class KylinPerformancesController extends BaseController {
return
prefix
+
"/details"
;
}
@Log
(
title
=
"演出
列表
"
,
businessType
=
BusinessType
.
AUDIT
)
@Log
(
title
=
"演出
审核
"
,
businessType
=
BusinessType
.
AUDIT
)
@PostMapping
(
value
=
"/audit"
)
//@RequiresPermissions("kylin:performances:view")
@ResponseBody
...
...
@@ -96,11 +96,12 @@ public class KylinPerformancesController extends BaseController {
//@RequiresPermissions("kylin:performances:view")
@PostMapping
(
value
=
"/isShow"
)
@ResponseBody
@Log
(
title
=
"演出管理:是否显示"
,
businessType
=
BusinessType
.
PERFORMANCE_SAVE
)
public
AjaxResult
setIsShow
(
String
performancesId
,
Integer
isShow
)
{
return
toAjax
(
kylinPerformancesService
.
setIsShow
(
performancesId
,
isShow
));
}
@Log
(
title
=
"演出列表"
,
businessType
=
BusinessType
.
DETAIL
)
//
@Log(title = "演出列表", businessType = BusinessType.DETAIL)
//@RequiresPermissions("kylin:performances:view")
@GetMapping
(
value
=
"/memberInfo/{performancesId}"
)
public
String
memberInfo
(
@PathVariable
(
"performancesId"
)
String
performancesId
,
ModelMap
mmap
)
{
...
...
@@ -109,7 +110,7 @@ public class KylinPerformancesController extends BaseController {
return
prefix
+
"/memberInfo"
;
}
@Log
(
title
=
"演出
列表"
,
businessType
=
BusinessType
.
UPDAT
E
)
@Log
(
title
=
"演出
管理:提交会员信息"
,
businessType
=
BusinessType
.
PERFORMANCE_SAV
E
)
//@RequiresPermissions("kylin:performances:view")
@PostMapping
(
value
=
"/memberInfo/submit"
)
@ResponseBody
...
...
@@ -118,7 +119,7 @@ public class KylinPerformancesController extends BaseController {
return
toAjax
(
result
);
}
@Log
(
title
=
"演出列表-演出数据"
,
businessType
=
BusinessType
.
LIST
)
//
@Log(title = "演出列表-演出数据", businessType = BusinessType.LIST)
//@RequiresPermissions("kylin:performances:view")
@GetMapping
(
value
=
"/performanceStatic/{performancesId}"
)
public
String
performanceStatic
(
@PathVariable
(
"performancesId"
)
String
performancesId
,
ModelMap
mmap
)
{
...
...
@@ -172,6 +173,7 @@ public class KylinPerformancesController extends BaseController {
//@RequiresPermissions("kylin:performances:view")
@PostMapping
(
value
=
"/agent/change"
)
@ResponseBody
@Log
(
title
=
"演出管理:票种代理"
,
businessType
=
BusinessType
.
PERFORMANCE_SAVE
)
public
AjaxResult
changeTicketAgent
(
@RequestParam
(
"performancesId"
)
String
performancesId
,
@RequestParam
(
"ticketsId"
)
String
ticketsId
,
@RequestParam
(
"status"
)
Integer
status
)
{
boolean
result
=
kylinPerformancesService
.
changeTicketAgent
(
performancesId
,
ticketsId
,
status
);
return
toAjax
(
result
);
...
...
@@ -179,6 +181,7 @@ public class KylinPerformancesController extends BaseController {
@PostMapping
(
value
=
"/payTxt/change"
)
@ResponseBody
@Log
(
title
=
"演出管理:支付文案"
,
businessType
=
BusinessType
.
PERFORMANCE_SAVE
)
public
AjaxResult
changeTicketPayTxt
(
@RequestParam
(
"performancesId"
)
String
performancesId
,
@RequestParam
(
"ticketsId"
)
String
ticketsId
,
@RequestParam
(
"payTxt"
)
String
payTxt
)
{
boolean
result
=
kylinPerformancesService
.
changeTicketPayTxt
(
performancesId
,
ticketsId
,
payTxt
);
return
toAjax
(
result
);
...
...
@@ -213,6 +216,7 @@ public class KylinPerformancesController extends BaseController {
//@RequiresPermissions("kylin:performances:view")
@PostMapping
(
value
=
"/refundConfig/change"
)
@ResponseBody
@Log
(
title
=
"演出管理:退款配置"
,
businessType
=
BusinessType
.
PERFORMANCE_SAVE
)
public
AjaxResult
changeRefundConfig
(
@RequestParam
(
"performancesId"
)
String
performancesId
,
@RequestParam
(
"isCanRefund"
)
Integer
isCanRefund
,
@RequestParam
(
"refundOpenTime"
)
String
refundOpenTime
,
...
...
@@ -249,6 +253,7 @@ public class KylinPerformancesController extends BaseController {
@PostMapping
(
value
=
"/transferConfig/change"
)
@ResponseBody
@Log
(
title
=
"演出管理:转赠配置"
,
businessType
=
BusinessType
.
PERFORMANCE_SAVE
)
public
AjaxResult
changeTransferConfig
(
@RequestParam
(
"performancesId"
)
String
performancesId
,
@RequestParam
(
"isCanTransfer"
)
Integer
isCanTransfer
,
@RequestParam
(
"transferStartTime"
)
String
transferStartTime
,
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/goblin/service/impl/GoblinFrontCubeServiceImpl.java
View file @
401111aa
...
...
@@ -71,6 +71,15 @@ public class GoblinFrontCubeServiceImpl extends ServiceImpl<GoblinFrontCubeMappe
}
else
{
goblinFrontCube
.
setUpdateTime
(
LocalDateTime
.
now
());
//数据库修改
String
spuIds
=
""
;
for
(
String
spuId:
goblinFrontCube
.
getSpuId
().
split
(
","
)){
if
(
spuId
.
equals
(
""
)||
spuId
.
equals
(
"undefined"
)){
}
else
{
spuIds
=
spuIds
.
concat
(
spuId
).
concat
(
","
);
}
}
goblinFrontCube
.
setSpuId
(
spuIds
);
goblinFrontCubeMapper
.
updateById
(
goblinFrontCube
);
}
}
...
...
liquidnet-bus-service/liquidnet-service-candy/liquidnet-service-candy-impl/src/main/java/com/liquidnet/service/candy/controller/CandyCouponController.java
View file @
401111aa
...
...
@@ -346,8 +346,11 @@ public class CandyCouponController {
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"uCouponIds"
,
value
=
"券id(逗号隔开的字符串)"
,
required
=
true
),
})
public
ResponseDto
<
List
<
CandyCouponVo
>>
couponListById
(
@RequestParam
(
"uCouponIds"
)
@NotNull
@NotBlank
String
uCouponIds
)
{
return
candyCouponService
.
couponListById
(
uCouponIds
);
public
ResponseDto
<
List
<
CandyCouponVo
>>
couponListById
(
@RequestParam
(
"uCouponIds"
)
@NotNull
@NotBlank
String
uCouponIds
,
@RequestParam
(
value
=
"uid"
,
required
=
false
)
String
uid
)
{
if
(
uid
==
null
||
uid
.
equals
(
""
))
{
uid
=
CurrentUtil
.
getCurrentUid
();
}
return
candyCouponService
.
couponListById
(
uCouponIds
,
uid
);
// if (result != null) {
// return ResponseDto.success(result);
// } else {
...
...
liquidnet-bus-service/liquidnet-service-candy/liquidnet-service-candy-impl/src/main/java/com/liquidnet/service/candy/service/impl/CandyCouponServiceImpl.java
View file @
401111aa
...
...
@@ -206,7 +206,7 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
}
@Override
public
CandyMyCouponListVo
preUseGoodCoupon
(
BigDecimal
priceTotal
,
String
goodId
,
Integer
type
,
String
uid
)
{
public
CandyMyCouponListVo
preUseGoodCoupon
(
BigDecimal
priceTotal
,
String
goodId
,
Integer
type
,
String
uid
)
{
LocalDateTime
userCreateTime
;
try
{
userCreateTime
=
DateUtil
.
Formatter
.
yyyyMMddHHmmssTrim
.
parse
(
CurrentUtil
.
getTokenClaims
().
get
(
CurrentUtil
.
TOKEN_UCREATED
).
toString
());
...
...
@@ -248,7 +248,7 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
}
@Override
public
Integer
preCanUseGoodCoupon
(
BigDecimal
priceTotal
,
String
goodId
,
String
uid
)
{
public
Integer
preCanUseGoodCoupon
(
BigDecimal
priceTotal
,
String
goodId
,
String
uid
)
{
LocalDateTime
userCreateTime
;
try
{
userCreateTime
=
DateUtil
.
Formatter
.
yyyyMMddHHmmssTrim
.
parse
(
CurrentUtil
.
getTokenClaims
().
get
(
CurrentUtil
.
TOKEN_UCREATED
).
toString
());
...
...
@@ -315,7 +315,7 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
}
@Override
public
CandyUseResultVo
useCoupon
(
String
uCouponId
,
String
content
,
String
totalPrice
,
String
performanceId
,
String
timesId
,
String
ticketId
,
String
goodId
,
String
uid
)
{
public
CandyUseResultVo
useCoupon
(
String
uCouponId
,
String
content
,
String
totalPrice
,
String
performanceId
,
String
timesId
,
String
ticketId
,
String
goodId
,
String
uid
)
{
LocalDateTime
userCreateTime
;
try
{
userCreateTime
=
DateUtil
.
Formatter
.
yyyyMMddHHmmssTrim
.
parse
(
CurrentUtil
.
getTokenClaims
().
get
(
CurrentUtil
.
TOKEN_UCREATED
).
toString
());
...
...
@@ -323,6 +323,8 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
userCreateTime
=
null
;
}
CandyUseResultVo
vo
=
CandyUseResultVo
.
getNew
();
List
<
String
>
targetIds
=
CollectionUtil
.
linkedListString
();
BigDecimal
fullValue
=
BigDecimal
.
ZERO
;
List
<
CandyUserCouponBasicDto
>
dtoList
=
CouponBaseUtil
.
useCoupon
(
redisDataUtils
.
getCouponByUid
(
uid
,
userCreateTime
),
uCouponId
,
content
);
if
(
dtoList
==
null
)
{
vo
.
setCouType
(-
1
);
...
...
@@ -342,6 +344,7 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
case
2
:
if
(
dto
.
getValOver
().
compareTo
(
new
BigDecimal
(
totalPrice
))
<=
0
)
{
vo
.
setValue
(
dto
.
getValMinus
());
fullValue
=
dto
.
getValOver
();
}
else
{
vo
.
setCouType
(-
1
);
vo
.
setValue
(
BigDecimal
.
ZERO
);
...
...
@@ -383,6 +386,10 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
if
(
dto
.
getUseRules
().
size
()
>
1
&&
dto
.
getCouType
().
equals
(
4
))
{
isTarget
=
false
;
}
if
(
isTarget
&&
!
ruleItem
.
getBusiId
().
equals
(
""
))
{
targetIds
.
add
(
ruleItem
.
getBusiId
());
}
}
if
(
dto
.
getBusiType
().
equals
(
0
))
{
...
...
@@ -415,6 +422,8 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
}
}
}
vo
.
setFullValue
(
fullValue
);
vo
.
setTargetIds
(
targetIds
);
return
vo
;
}
...
...
@@ -526,8 +535,7 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
}
@Override
public
ResponseDto
<
List
<
CandyCouponVo
>>
couponListById
(
String
uCouponIds
)
{
String
uid
=
CurrentUtil
.
getCurrentUid
();
public
ResponseDto
<
List
<
CandyCouponVo
>>
couponListById
(
String
uCouponIds
,
String
uid
)
{
LocalDateTime
userCreateTime
;
try
{
userCreateTime
=
DateUtil
.
Formatter
.
yyyyMMddHHmmssTrim
.
parse
(
CurrentUtil
.
getTokenClaims
().
get
(
CurrentUtil
.
TOKEN_UCREATED
).
toString
());
...
...
liquidnet-bus-service/liquidnet-service-candy/liquidnet-service-candy-impl/src/main/java/com/liquidnet/service/candy/util/CouponBaseUtil.java
View file @
401111aa
...
...
@@ -252,15 +252,29 @@ public class CouponBaseUtil {
BigDecimal
valOver
)
{
boolean
isTarget
=
false
;
ArrayList
<
String
>
targetIdList
=
new
ArrayList
(
Arrays
.
asList
(
targetId
.
split
(
","
)));
if
(
targetIdList
.
contains
(
busiId
))
{
//判断id 对应
if
(
couType
.
equals
(
2
))
{
if
(
priceTotal
.
compareTo
(
valOver
)
>=
0
)
{
for
(
String
item
:
targetIdList
)
{
if
(
item
.
contains
(
"ZZ"
))
{
item
=
item
.
split
(
"ZZ"
)[
0
];
}
if
(
item
.
equals
(
busiId
))
{
//判断id 对应
if
(
couType
.
equals
(
2
))
{
if
(
priceTotal
.
compareTo
(
valOver
)
>=
0
)
{
isTarget
=
true
;
}
}
else
{
isTarget
=
true
;
}
}
else
{
isTarget
=
true
;
}
}
// if (targetIdList.contains(busiId)) {//判断id 对应
// if (couType.equals(2)) {
// if (priceTotal.compareTo(valOver) >= 0) {
// isTarget = true;
// }
// } else {
// isTarget = true;
// }
// }
return
isTarget
;
}
...
...
liquidnet-bus-service/liquidnet-service-consumer-all/liquidnet-service-consumer-goblin/src/main/resources/bootstrap-service-consumer-goblin.yml
deleted
100644 → 0
View file @
736e916a
#eurekaServer配置
eureka
:
client
:
register-with-eureka
:
true
fetch-registry
:
true
serviceUrl
:
defaultZone
:
http://${liquidnet.security.username}:${liquidnet.security.password}@${liquidnet.eureka.host}/eureka-server/eureka
#configServer配置
spring
:
cloud
:
config
:
# uri: http://39.107.71.112:7002/support-config
profile
:
${liquidnet.cloudConfig.profile}
name
:
${spring.application.name}
#默认为spring.application.name
discovery
:
enabled
:
true
service-id
:
liquidnet-support-config
liquidnet-bus-service/liquidnet-service-dragon/liquidnet-service-dragon-impl/src/main/java/com/liquidnet/service/dragon/service/impl/DragonOrderRefundsServiceImpl.java
View file @
401111aa
...
...
@@ -416,6 +416,8 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
parameters
.
put
(
"appid"
,
PayWepayUtils
.
getInstance
().
getAPPLET_APP_ID
());
}
else
if
(
paymentType
.
equalsIgnoreCase
(
DragonConstant
.
PayTypeEnum
.
PAYMENT_TYPE_WAP_WEPAY
.
getCode
()))
{
parameters
.
put
(
"appid"
,
PayWepayUtils
.
getInstance
().
getWAP_APP_ID
());
}
else
if
(
paymentType
.
equalsIgnoreCase
(
DragonConstant
.
PayTypeEnum
.
PAYMENT_TYPE_MICROPAY_WEPAY
.
getCode
())){
parameters
.
put
(
"appid"
,
PayWepayUtils
.
getInstance
().
getAPP_ID
());
}
parameters
.
put
(
"nonce_str"
,
nonceStr
);
parameters
.
put
(
"out_refund_no"
,
refundCode
);
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/GoblinCouponController.java
View file @
401111aa
...
...
@@ -6,7 +6,7 @@ import com.liquidnet.service.base.ResponseDto;
import
com.liquidnet.service.goblin.dto.vo.GoblinStoreCouponVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinUseResultVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinUserCouponVo
;
import
com.liquidnet.service.goblin.param.
BackCouponParam
;
import
com.liquidnet.service.goblin.param.
*
;
import
com.liquidnet.service.goblin.service.GoblinCouponService
;
import
com.liquidnet.service.goblin.util.GoblinRedisUtils
;
import
com.liquidnet.service.goblin.util.ObjectUtil
;
...
...
@@ -181,11 +181,11 @@ public class GoblinCouponController {
if
(
uid
==
null
)
{
uid
=
CurrentUtil
.
getCurrentUid
();
}
return
ResponseDto
.
success
(
goblinCouponService
.
canUse
(
totalPrice
,
spuId
,
uid
,
storeId
));
return
ResponseDto
.
success
(
goblinCouponService
.
canUse
(
totalPrice
,
spuId
,
uid
,
storeId
));
}
@PostMapping
(
"useList"
)
@ApiOperation
(
"可用券列表"
)
@ApiOperation
(
"可用券列表
[不判断部分商品]
"
)
@ApiResponse
(
code
=
200
,
message
=
"接口返回对象参数"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"Number"
,
name
=
"totalPrice"
,
value
=
"应付价格"
),
...
...
@@ -201,24 +201,44 @@ public class GoblinCouponController {
return
ResponseDto
.
success
(
goblinCouponService
.
useList
(
totalPrice
,
spuId
,
uid
));
}
@PostMapping
(
"use
Coupon
"
)
@ApiOperation
(
"
用券
"
)
@PostMapping
(
"use
List2
"
)
@ApiOperation
(
"
可用券列表[判断部分商品]
"
)
@ApiResponse
(
code
=
200
,
message
=
"接口返回对象参数"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"ucouponId"
,
value
=
"券id"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"content"
,
value
=
"消费内容"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"Number"
,
name
=
"totalPrice"
,
value
=
"总价格"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"spuId"
,
value
=
"spuId逗号隔开"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"uid"
,
value
=
"uid"
),
})
public
ResponseDto
<
GoblinUseResultVo
>
checkOrderResult
(
@RequestParam
(
"ucouponId"
)
@Valid
String
ucouponId
,
@RequestParam
(
"content"
)
@Valid
String
content
,
@RequestParam
(
"totalPrice"
)
@Valid
BigDecimal
totalPrice
,
@RequestParam
(
"spuId"
)
@Valid
String
spuId
,
@RequestParam
(
"uid"
)
@Valid
String
uid
)
{
return
ResponseDto
.
success
(
goblinCouponService
.
useCoupon
(
ucouponId
,
content
,
totalPrice
,
spuId
,
uid
));
public
ResponseDto
<
List
<
GoblinUserCouponVo
>>
useList2
(
@RequestBody
CouponCanUseParam
param
)
{
if
(
param
.
getUid
()
==
null
)
{
param
.
setUid
(
CurrentUtil
.
getCurrentUid
());
}
return
ResponseDto
.
success
(
goblinCouponService
.
useList2
(
param
));
}
@PostMapping
(
"useList3"
)
@ApiOperation
(
"可用券列表[返回商品下所有券]"
)
@ApiResponse
(
code
=
200
,
message
=
"接口返回对象参数"
)
public
ResponseDto
<
List
<
GoblinUserCouponVo
>>
useList3
(
@RequestBody
CouponCanUseAllParam
param
)
{
if
(
param
.
getUid
()
==
null
)
{
param
.
setUid
(
CurrentUtil
.
getCurrentUid
());
}
return
ResponseDto
.
success
(
goblinCouponService
.
useList3
(
param
));
}
// @PostMapping("useCoupon")
// @ApiOperation("用券")
// @ApiResponse(code = 200, message = "接口返回对象参数")
// @ApiImplicitParams({
// @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "ucouponId", value = "券id"),
// @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "content", value = "消费内容"),
// @ApiImplicitParam(type = "form", required = true, dataType = "Number", name = "totalPrice", value = "总价格"),
// @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "spuId", value = "spuId逗号隔开"),
// @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "uid", value = "uid"),
// })
// public ResponseDto<GoblinUseResultVo> checkOrderResult(@RequestParam("ucouponId") @Valid String ucouponId,
// @RequestParam("content") @Valid String content,
// @RequestParam("totalPrice") @Valid BigDecimal totalPrice,
// @RequestParam("spuId") @Valid String spuId,
// @RequestParam("uid") @Valid String uid) {
// return ResponseDto.success(goblinCouponService.useCoupon(ucouponId, content, totalPrice, spuId, uid));
// }
@PostMapping
(
"backCoupon"
)
@ApiOperation
(
"退券"
)
@ApiResponse
(
code
=
200
,
message
=
"接口返回对象参数"
)
...
...
@@ -228,4 +248,18 @@ public class GoblinCouponController {
}
return
ResponseDto
.
success
(
goblinCouponService
.
backCoupon
(
backCouponParam
));
}
@PostMapping
(
"helpUseCoupon"
)
@ApiOperation
(
"帮助用券"
)
@ApiResponse
(
code
=
200
,
message
=
"接口返回对象参数"
)
public
ResponseDto
<
CouponHelpUseVo
>
helpUseCoupon
(
@RequestBody
CouponHelpUseParam
param
)
{
if
(
param
.
getUid
()
==
null
||
param
.
getUid
().
equals
(
""
))
{
param
.
setUid
(
CurrentUtil
.
getCurrentUid
());
}
CouponHelpUseVo
vo
=
goblinCouponService
.
helpUseCoupon
(
param
);
if
(
vo
==
null
){
return
ResponseDto
.
failure
(
"券不存在"
);
}
return
ResponseDto
.
success
(
vo
);
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/GoblinFrontController.java
View file @
401111aa
...
...
@@ -29,10 +29,6 @@ import java.util.List;
@RestController
@RequestMapping
(
"/front"
)
public
class
GoblinFrontController
{
@Autowired
private
RedisUtil
redisUtil
;
@Autowired
private
GoblinRedisUtils
goblinRedisUtils
;
@Autowired
private
GoblinFrontServiceImpl
goblinFrontService
;
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/GoblinCouponImpl.java
View file @
401111aa
...
...
@@ -4,14 +4,14 @@ import com.liquidnet.commons.lang.util.CollectionUtil;
import
com.liquidnet.commons.lang.util.CurrentUtil
;
import
com.liquidnet.service.base.SqlMapping
;
import
com.liquidnet.service.base.constant.MQConst
;
import
com.liquidnet.service.candy.vo.CandyCouponRulesVo
;
import
com.liquidnet.service.candy.vo.CandyCouponVo
;
import
com.liquidnet.service.goblin.constant.GoblinStatusConst
;
import
com.liquidnet.service.goblin.dto.vo.*
;
import
com.liquidnet.service.goblin.param.BackCouponParam
;
import
com.liquidnet.service.goblin.entity.GoblinOrderSku
;
import
com.liquidnet.service.goblin.param.*
;
import
com.liquidnet.service.goblin.service.GoblinCouponService
;
import
com.liquidnet.service.goblin.util.GoblinMongoUtils
;
import
com.liquidnet.service.goblin.util.GoblinRedisUtils
;
import
com.liquidnet.service.goblin.util.ObjectUtil
;
import
com.liquidnet.service.goblin.util.QueueUtils
;
import
com.liquidnet.service.goblin.util.*
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -29,6 +29,8 @@ public class GoblinCouponImpl implements GoblinCouponService {
GoblinMongoUtils
goblinMongoUtils
;
@Autowired
QueueUtils
queueUtils
;
@Autowired
GoblinOrderUtils
orderUtils
;
@Override
public
ArrayList
<
String
>
getSpuType
(
String
spuId
,
String
storeId
)
{
...
...
@@ -124,14 +126,17 @@ public class GoblinCouponImpl implements GoblinCouponService {
// }
if
(
"1"
.
equals
(
type
))
{
if
(
vo
.
getDuedAt
().
isAfter
(
now
)
&&
vo
.
getState
().
equals
(
1
))
{
vo
.
setSpuIds
(
goblinRedisUtils
.
getStoreCouponSpuIds
(
vo
.
getStoreCouponId
()));
returnList
.
add
(
vo
);
}
}
else
{
if
(
vo
.
getDuedAt
().
isBefore
(
now
)
||
vo
.
getState
().
equals
(
3
))
{
vo
.
setState
(
3
);
vo
.
setSpuIds
(
goblinRedisUtils
.
getStoreCouponSpuIds
(
vo
.
getStoreCouponId
()));
returnList
.
add
(
vo
);
}
if
(
vo
.
getState
().
equals
(
5
))
{
vo
.
setSpuIds
(
goblinRedisUtils
.
getStoreCouponSpuIds
(
vo
.
getStoreCouponId
()));
returnList
.
add
(
vo
);
}
}
...
...
@@ -208,6 +213,7 @@ public class GoblinCouponImpl implements GoblinCouponService {
//判断券状态 和 触发金额
if
(
vo
.
getDuedAt
().
isAfter
(
now
)
&&
vo
.
getState
().
equals
(
1
)
&&
vo
.
getTriggers
().
compareTo
(
totalPrice
)
<=
0
)
{
if
(
vo
.
getUseScope
().
equals
(
"0"
))
{
vo
.
setSpuIds
(
CollectionUtil
.
linkedListString
());
returnList
.
add
(
vo
);
}
else
{
List
<
String
>
spuIds
=
goblinRedisUtils
.
getStoreCouponSpuIds
(
vo
.
getStoreCouponId
());
...
...
@@ -218,6 +224,37 @@ public class GoblinCouponImpl implements GoblinCouponService {
for
(
String
item
:
spuIds
)
{
List
<
String
>
spuList
=
Arrays
.
asList
(
spuId
.
split
(
","
));
if
(
spuList
.
contains
(
item
))
{
vo
.
setSpuIds
(
spuIds
);
returnList
.
add
(
vo
);
break
;
}
}
}
}
}
returnList
.
sort
(
Comparator
.
comparing
(
GoblinUserCouponVo:
:
getState
));
return
returnList
;
}
@Override
public
List
<
GoblinUserCouponVo
>
useList3
(
CouponCanUseAllParam
param
)
{
List
<
GoblinUserCouponVo
>
voList
=
goblinRedisUtils
.
getUserCouponVos
(
param
.
getUid
());
List
<
GoblinUserCouponVo
>
returnList
=
ObjectUtil
.
getGoblinUserCouponVo
();
LocalDateTime
now
=
LocalDateTime
.
now
();
for
(
GoblinUserCouponVo
vo
:
voList
)
{
//判断券状态 和 触发金额
if
(
vo
.
getDuedAt
().
isAfter
(
now
)
&&
vo
.
getState
().
equals
(
1
))
{
if
(
vo
.
getUseScope
().
equals
(
"0"
))
{
vo
.
setSpuIds
(
CollectionUtil
.
linkedListString
());
returnList
.
add
(
vo
);
}
else
{
List
<
String
>
spuIds
=
goblinRedisUtils
.
getStoreCouponSpuIds
(
vo
.
getStoreCouponId
());
//判断是否在可用商品内
for
(
String
item
:
spuIds
)
{
List
<
String
>
spuList
=
param
.
getSpuIds
();
if
(
spuList
.
contains
(
item
))
{
vo
.
setSpuIds
(
spuIds
);
returnList
.
add
(
vo
);
break
;
}
...
...
@@ -229,6 +266,56 @@ public class GoblinCouponImpl implements GoblinCouponService {
return
returnList
;
}
@Override
public
List
<
GoblinUserCouponVo
>
useList2
(
CouponCanUseParam
param
)
{
List
<
GoblinUserCouponVo
>
voList
=
goblinRedisUtils
.
getUserCouponVos
(
param
.
getUid
());
List
<
GoblinUserCouponVo
>
returnList
=
ObjectUtil
.
getGoblinUserCouponVo
();
BigDecimal
totalPrice
=
BigDecimal
.
ZERO
;
for
(
CouponCanUse2Param
param2
:
param
.
getParam
())
{
totalPrice
=
totalPrice
.
add
(
param2
.
getPrice
());
}
LocalDateTime
now
=
LocalDateTime
.
now
();
for
(
GoblinUserCouponVo
vo
:
voList
)
{
//判断券状态 和 触发金额
if
(
vo
.
getDuedAt
().
isAfter
(
now
)
&&
vo
.
getState
().
equals
(
1
))
{
//&& vo.getTriggers().compareTo(totalPrice) <= 0
if
(
param
.
getStoreId
()
!=
null
&&
!
param
.
getStoreId
().
equals
(
""
))
{
if
(!
vo
.
getStoreId
().
equals
(
param
.
getStoreId
()))
{
continue
;
}
}
if
(
vo
.
getUseScope
().
equals
(
"0"
)
&&
vo
.
getTriggers
().
compareTo
(
totalPrice
)
<=
0
)
{
vo
.
setSpuIds
(
CollectionUtil
.
linkedListString
());
returnList
.
add
(
vo
);
}
else
{
List
<
String
>
spuIds
=
goblinRedisUtils
.
getStoreCouponSpuIds
(
vo
.
getStoreCouponId
());
if
(
spuIds
==
null
||
spuIds
.
size
()
==
0
)
{
break
;
}
//判断是否在可用商品内
BigDecimal
contentPrice
=
BigDecimal
.
ZERO
;
for
(
String
item
:
spuIds
)
{
for
(
CouponCanUse2Param
param2
:
param
.
getParam
())
{
String
pre
=
GoblinStatusConst
.
MarketPreStatus
.
getPre
(
param2
.
getSpuId
());
String
spuId
=
param2
.
getSpuId
();
if
(
pre
!=
null
)
{
spuId
=
param2
.
getSpuId
().
split
(
pre
)[
0
];
}
if
(
spuId
.
equals
(
item
))
{
contentPrice
=
contentPrice
.
add
(
param2
.
getPrice
());
}
}
}
if
(
vo
.
getTriggers
().
compareTo
(
contentPrice
)
<=
0
)
{
vo
.
setSpuIds
(
spuIds
);
returnList
.
add
(
vo
);
}
}
}
}
returnList
.
sort
(
Comparator
.
comparing
(
GoblinUserCouponVo:
:
getState
));
return
returnList
;
}
@Override
public
GoblinUseResultVo
useCoupon
(
String
ucouponId
,
String
content
,
BigDecimal
totalPrice
,
String
spuId
,
String
uid
)
{
List
<
GoblinUserCouponVo
>
voList
=
goblinRedisUtils
.
getUserCouponVos
(
uid
);
...
...
@@ -329,4 +416,173 @@ public class GoblinCouponImpl implements GoblinCouponService {
return
false
;
}
}
@Override
public
CouponHelpUseVo
helpUseCoupon
(
CouponHelpUseParam
params
)
{
LocalDateTime
now
=
LocalDateTime
.
now
();
CouponHelpUseVo
vo
=
CouponHelpUseVo
.
getNew
();
GoblinUseResultVo
returnVo
;
String
ucouponId
=
params
.
getUcouponId
();
String
platformUcouponId
=
params
.
getPlatformUcouponId
();
vo
.
setPrice
(
BigDecimal
.
ZERO
);
//店铺券
if
(
ucouponId
!=
null
&&
!
ucouponId
.
equals
(
""
))
{
List
<
GoblinUserCouponVo
>
voList
=
goblinRedisUtils
.
getUserCouponVos
(
params
.
getUid
());
for
(
GoblinUserCouponVo
itemVo
:
voList
)
{
if
(
itemVo
.
getUcouponId
().
equals
(
ucouponId
))
{
if
(
itemVo
.
getUcouponId
().
equals
(
ucouponId
)
&&
itemVo
.
getDuedAt
().
isAfter
(
now
)
&&
itemVo
.
getState
().
equals
(
1
))
{
BigDecimal
contentPrice
=
BigDecimal
.
ZERO
;
if
(
itemVo
.
getUseScope
().
equals
(
"0"
))
{
//全部
for
(
CouponCanUse2Param
item
:
params
.
getParam
())
{
contentPrice
=
contentPrice
.
add
(
item
.
getPrice
());
}
returnVo
=
mathCouponPrice
(
itemVo
,
contentPrice
);
}
else
{
//部分
List
<
String
>
spuIds
=
goblinRedisUtils
.
getStoreCouponSpuIds
(
itemVo
.
getStoreCouponId
());
if
(
spuIds
==
null
||
spuIds
.
size
()
==
0
)
{
break
;
}
//判断是否在可用商品内
for
(
String
spuItem
:
spuIds
)
{
for
(
CouponCanUse2Param
item
:
params
.
getParam
())
{
String
spuId
=
item
.
getSpuId
();
String
pre
=
GoblinStatusConst
.
MarketPreStatus
.
getPre
(
spuId
);
if
(
pre
!=
null
)
{
spuId
=
spuId
.
split
(
pre
)[
0
];
}
if
(
spuId
.
equals
(
spuItem
))
{
contentPrice
=
contentPrice
.
add
(
item
.
getPrice
());
}
}
}
returnVo
=
mathCouponPrice
(
itemVo
,
contentPrice
);
// returnVo.setSpuIds(spuIds);
}
// List<String> spuIdList = returnVo.getSpuIds();
BigDecimal
voucherPrice
=
returnVo
.
getValue
();
// if (spuIdList.size() > 0) {
// for (String spuId : spuIdList) {
// for (CouponCanUse2Param paramItem : params.getParam()) {
// if (paramItem.getSpuId().contains(spuId)) {
// if (voucherPrice.compareTo(BigDecimal.ZERO) >= 0) {
// voucherPrice = voucherPrice.subtract(paramItem.getPrice());
// if (voucherPrice.compareTo(BigDecimal.ZERO) >= 0) {
// paramItem.setPrice(paramItem.getPrice());
// } else {
// paramItem.setPrice(voucherPrice.add(paramItem.getPrice()));
// }
// }
// }
// }
// }
// } else {
// for (CouponCanUse2Param paramItem : params.getParam()) {
// if (voucherPrice.compareTo(BigDecimal.ZERO) >= 0) {
// voucherPrice = voucherPrice.subtract(paramItem.getPrice());
// if (voucherPrice.compareTo(BigDecimal.ZERO) >= 0) {
// paramItem.setPrice(paramItem.getPrice());
// } else {
// paramItem.setPrice(voucherPrice.add(paramItem.getPrice()));
// }
// }
// }
// }
// vo.setParam(params.getParam());
// vo.setCouponVo(itemVo);
vo
.
setPrice
(
voucherPrice
);
break
;
}
}
}
}
else
if
(
platformUcouponId
!=
null
&&
!
platformUcouponId
.
equals
(
""
))
{
CandyCouponVo
candyCouponVo
=
orderUtils
.
getCouponDetails
(
platformUcouponId
,
params
.
getUid
());
if
(
candyCouponVo
==
null
)
{
return
null
;
}
if
(
candyCouponVo
.
getState
().
equals
(
1
)
&&
(
candyCouponVo
.
getBusiType
().
equals
(
0
)
||
candyCouponVo
.
getBusiType
().
equals
(
2
)))
{
BigDecimal
voucherPrice
;
BigDecimal
contentPrice
=
BigDecimal
.
ZERO
;
for
(
CouponCanUse2Param
item
:
params
.
getParam
())
{
contentPrice
=
contentPrice
.
add
(
item
.
getPrice
());
}
switch
(
candyCouponVo
.
getCouType
())
{
case
1
:
//代金
voucherPrice
=
mathPlatformPrice
(
candyCouponVo
,
params
.
getParam
(),
contentPrice
);
vo
.
setPrice
(
candyCouponVo
.
getValFace
().
compareTo
(
voucherPrice
)
>=
0
?
voucherPrice
:
candyCouponVo
.
getValFace
());
break
;
case
2
:
//满减
voucherPrice
=
mathPlatformPrice
(
candyCouponVo
,
params
.
getParam
(),
contentPrice
);
if
(
voucherPrice
.
compareTo
(
candyCouponVo
.
getValOver
())
>=
0
)
{
vo
.
setPrice
(
candyCouponVo
.
getValMinus
());
}
break
;
case
4
:
//折扣
voucherPrice
=
mathPlatformPrice
(
candyCouponVo
,
params
.
getParam
(),
contentPrice
);
vo
.
setPrice
(
voucherPrice
.
subtract
(
voucherPrice
.
multiply
(
candyCouponVo
.
getDiscount
())));
break
;
}
}
}
vo
.
setUcouponId
(
ucouponId
);
vo
.
setPlatformUcouponId
(
platformUcouponId
);
return
vo
;
}
//用券计算金额 返回优惠金额和类型
private
GoblinUseResultVo
mathCouponPrice
(
GoblinUserCouponVo
vo
,
BigDecimal
contentPrice
)
{
GoblinUseResultVo
returnVo
=
GoblinUseResultVo
.
getNew
();
returnVo
.
setValue
(
BigDecimal
.
ZERO
);
if
(
vo
.
getTriggers
().
compareTo
(
contentPrice
)
<=
0
)
{
if
(
vo
.
getType
().
equals
(
"1"
))
{
//代金券
if
(
vo
.
getValFace
().
compareTo
(
contentPrice
)
>
0
)
{
returnVo
.
setValue
(
contentPrice
);
}
else
{
returnVo
.
setValue
(
vo
.
getValFace
());
}
returnVo
.
setCouType
(
vo
.
getType
());
}
else
if
(
vo
.
getType
().
equals
(
"2"
))
{
//折扣
BigDecimal
tempPrice
=
contentPrice
.
multiply
(
vo
.
getDiscount
()).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
);
if
(
tempPrice
.
compareTo
(
vo
.
getDeduction
())
>
0
)
{
tempPrice
=
vo
.
getDeduction
();
}
returnVo
.
setValue
(
contentPrice
.
subtract
(
tempPrice
));
returnVo
.
setCouType
(
vo
.
getType
());
}
else
if
(
vo
.
getType
().
equals
(
"3"
))
{
//满减
if
(
vo
.
getValMinus
().
compareTo
(
contentPrice
)
>
0
)
{
returnVo
.
setValue
(
contentPrice
);
}
else
{
returnVo
.
setValue
(
vo
.
getValMinus
());
}
returnVo
.
setCouType
(
vo
.
getType
());
}
}
return
returnVo
;
}
//计算平台券金额
private
BigDecimal
mathPlatformPrice
(
CandyCouponVo
candyCouponVo
,
List
<
CouponCanUse2Param
>
param
,
BigDecimal
contentPrice
)
{
BigDecimal
voucherPrice
=
BigDecimal
.
ZERO
;
if
(
candyCouponVo
.
getUseRules
().
size
()
==
0
)
{
return
contentPrice
;
}
for
(
CandyCouponRulesVo
couponRulesVo
:
candyCouponVo
.
getUseRules
())
{
if
(
couponRulesVo
.
getUseScope
().
equals
(
100
))
{
voucherPrice
=
contentPrice
;
}
if
(
couponRulesVo
.
getUseScope
().
equals
(
80
))
{
for
(
CouponCanUse2Param
couponCanUse2Param
:
param
)
{
String
orderVoSpuId
=
couponCanUse2Param
.
getSpuId
();
String
pre
=
GoblinStatusConst
.
MarketPreStatus
.
getPre
(
orderVoSpuId
);
if
(
pre
!=
null
)
{
orderVoSpuId
=
orderVoSpuId
.
split
(
pre
)[
0
];
}
if
(
couponRulesVo
.
getBusiId
().
equals
(
orderVoSpuId
))
{
voucherPrice
=
voucherPrice
.
add
(
couponCanUse2Param
.
getPrice
());
}
}
}
}
return
voucherPrice
;
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/GoblinFrontServiceImpl.java
View file @
401111aa
...
...
@@ -853,14 +853,25 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
}
}
}
else
{
//查看是否有 配置的 spuid的顺序
/*
//查看是否有 配置的 spuid的顺序
String selectGoodsSpuids= getRedisKey(GoblinRedisConst.SELECT_GOODS_PAGE1);
if(StringUtil.isBlank(selectGoodsSpuids)){
List<GoblinFrontSelectGoods> list= (List<GoblinFrontSelectGoods>) redisUtil.get(GoblinRedisConst.SELECT_GOODS);
setPage1AndSpu(list,pageSize);
this.getSelectGoods(page,pageSize);
}
String
[]
spuidss
=
selectGoodsSpuids
.
split
(
","
);
String[] spuidss=selectGoodsSpuids.split(",");*/
//查看是否有 配置的 spuid的顺序
/* String selectGoodsSpuids= getRedisKey(GoblinRedisConst.SELECT_GOODS_PAGE1);*/
if
(!
redisUtil
.
hasKey
(
GoblinRedisConst
.
SELECT_GOODS_SPUIDS
)){
List
<
GoblinFrontSelectGoods
>
list
=
(
List
<
GoblinFrontSelectGoods
>)
redisUtil
.
get
(
GoblinRedisConst
.
SELECT_GOODS
);
setPage1AndSpu
(
list
,
pageSize
);
this
.
getSelectGoods
(
page
,
pageSize
);
}
String
[]
spuidss
=
redisUtil
.
get
(
GoblinRedisConst
.
SELECT_GOODS_SPUIDS
).
toString
().
split
(
","
);
//String[] spuidss=selectGoodsSpuids.split(",");
//找到对应的spuid
int
start
=
page
*
pageSize
;
int
end
=(
page
+
1
)*
pageSize
;
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/GoblinOrderAppServiceImpl.java
View file @
401111aa
...
...
@@ -557,7 +557,7 @@ public class GoblinOrderAppServiceImpl implements IGoblinOrderAppService {
logVo
.
setOrderCode
(
orderVo
.
getOrderCode
());
logVo
.
setPayCode
(
orderVo
.
getPayCode
());
logVo
.
setStoreId
(
orderVo
.
getStoreId
());
if
(
orderSkuVo
.
getSkuId
().
indexOf
(
GoblinStatusConst
.
MarketPreStatus
.
MARKET_PRE_
PURCHASE
.
getValue
())
>
0
)
{
if
(
orderSkuVo
.
getSkuId
().
indexOf
(
GoblinStatusConst
.
MarketPreStatus
.
MARKET_PRE_
ZHENGZAI
.
getValue
())
>
0
)
{
logVo
.
setOrderType
(
"zhengzai"
);
}
else
{
logVo
.
setOrderType
(
"order"
);
...
...
@@ -627,7 +627,7 @@ public class GoblinOrderAppServiceImpl implements IGoblinOrderAppService {
logVo
.
setOrderId
(
orderVo
.
getOrderId
());
logVo
.
setOrderCode
(
orderVo
.
getOrderCode
());
logVo
.
setPayCode
(
orderVo
.
getPayCode
());
if
(
orderSkuVo
.
getSkuId
().
indexOf
(
GoblinStatusConst
.
MarketPreStatus
.
MARKET_PRE_
PURCHASE
.
getValue
())
>
0
)
{
if
(
orderSkuVo
.
getSkuId
().
indexOf
(
GoblinStatusConst
.
MarketPreStatus
.
MARKET_PRE_
ZHENGZAI
.
getValue
())
>
0
)
{
logVo
.
setOrderType
(
"zhengzai"
);
}
else
{
logVo
.
setOrderType
(
"order"
);
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/manage/GoblinStoreOrderServiceImpl.java
View file @
401111aa
...
...
@@ -138,7 +138,7 @@ public class GoblinStoreOrderServiceImpl implements IGoblinStoreOrderService {
vo
.
setPayTime
(
orderVo
.
getPayTime
());
vo
.
setPriceExpress
(
orderVo
.
getPriceExpress
());
if
(!(
orderVo
.
getUcouponId
()
==
null
||
orderVo
.
getUcouponId
().
equals
(
""
)))
{
CandyCouponVo
candyCouponVo
=
orderUtils
.
getCouponDetails
(
orderVo
.
getUcouponId
());
CandyCouponVo
candyCouponVo
=
orderUtils
.
getCouponDetails
(
orderVo
.
getUcouponId
()
,
orderVo
.
getUserId
()
);
vo
.
setPlatformUcouponId
(
candyCouponVo
.
getUcouponId
());
vo
.
setPlatformUcouponName
(
candyCouponVo
.
getTitle
());
vo
.
setPlatformUcouponPrice
(
orderVo
.
getPriceCoupon
());
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/util/GoblinMongoUtils.java
View file @
401111aa
...
...
@@ -948,7 +948,7 @@ public class GoblinMongoUtils {
);
}
Query
query
=
Query
.
query
(
criteria
);
query
.
skip
(
skipCount
).
limit
(
size
);
query
.
skip
(
skipCount
).
limit
(
size
)
.
with
(
Sort
.
by
(
Sort
.
Order
.
desc
(
"createdAt"
)))
;
List
<
GoblinOrderLogVo
>
dataList
=
mongoTemplate
.
find
(
query
,
GoblinOrderLogVo
.
class
,
GoblinOrderLogVo
.
class
.
getSimpleName
());
//查询总数量
Query
countQuery
=
Query
.
query
(
criteria
);
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/util/GoblinOrderUtils.java
View file @
401111aa
...
...
@@ -21,6 +21,7 @@ import org.springframework.util.MultiValueMap;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
@Component
@Slf4j
...
...
@@ -35,119 +36,6 @@ public class GoblinOrderUtils {
@Autowired
GoblinRedisUtils
redisUtils
;
public
AdamRscPolymer01Vo
adamAddressEnterMember
(
String
uid
,
String
enterIds
,
String
addressId
)
{
try
{
MultiValueMap
<
String
,
String
>
header
=
CollectionUtil
.
linkedMultiValueMapStringString
();
header
.
add
(
"Accept"
,
"application/json;charset=UTF-8"
);
MultiValueMap
<
String
,
String
>
params
=
CollectionUtil
.
linkedMultiValueMapStringString
();
params
.
add
(
"addressId"
,
addressId
);
params
.
add
(
"entersIds"
,
enterIds
);
params
.
add
(
"uid"
,
uid
);
String
resultData
=
HttpUtil
.
post
(
adamUrl
+
"/adam/rsc/inquire/of_buy_ticket"
,
params
,
header
);
ResponseDto
<
AdamRscPolymer01Vo
>
vo
=
JsonUtils
.
fromJson
(
resultData
,
new
TypeReference
<
ResponseDto
<
AdamRscPolymer01Vo
>>()
{
});
if
(
null
!=
vo
.
getData
())
{
return
vo
.
getData
();
}
else
{
return
null
;
}
}
catch
(
Exception
e
)
{
log
.
error
(
"获取用户信息,e:{}"
,
e
);
e
.
printStackTrace
();
return
null
;
}
}
//判断 数量限购
public
String
judgeOrderLimit
(
String
uid
,
String
skuId
,
int
number
,
int
limitCount
)
{
int
buyCount
=
redisUtils
.
getSkuCountByUid
(
uid
,
skuId
);
if
(
buyCount
+
number
>
limitCount
)
{
return
"已超出限购数量"
;
}
else
{
int
a
=
redisUtils
.
incrSkuCountByUid
(
uid
,
skuId
,
number
);
return
""
;
}
}
//判断指定人群购买
public
Boolean
judgeOrderRose
(
Boolean
isMember
,
String
skuId
,
String
mobile
,
int
buyFactor
)
{
Boolean
result
=
false
;
switch
(
buyFactor
)
{
case
0
:
result
=
true
;
break
;
case
1
:
result
=
isMember
;
break
;
case
2
:
result
=
redisUtils
.
getSkuCanBuyByUid
(
mobile
,
skuId
);
break
;
}
return
result
;
}
/**
* 使用优惠券
*
* @param uCouponId 券id
* @param content 消费内容
* @param totalPrice 订单总价
* @return
*/
public
HashMap
<
String
,
Object
>
useCoupon
(
String
uCouponId
,
String
content
,
BigDecimal
totalPrice
,
String
spuId
,
String
uid
)
{
HashMap
<
String
,
Object
>
hashMap
=
CollectionUtil
.
mapStringObject
();
try
{
MultiValueMap
<
String
,
String
>
params
=
CollectionUtil
.
linkedMultiValueMapStringString
();
params
.
add
(
"uCouponId"
,
uCouponId
);
params
.
add
(
"content"
,
content
);
params
.
add
(
"totalPrice"
,
totalPrice
.
toString
());
params
.
add
(
"goodId"
,
spuId
);
params
.
add
(
"performanceId"
,
"null"
);
params
.
add
(
"timeId"
,
"null"
);
params
.
add
(
"ticketId"
,
"null"
);
params
.
add
(
"uid"
,
uid
);
MultiValueMap
<
String
,
String
>
header
=
CollectionUtil
.
linkedMultiValueMapStringString
();
header
.
add
(
"Authorization"
,
"Bearer "
+
CurrentUtil
.
getToken
());
header
.
add
(
"Accept"
,
"application/json;charset=UTF-8"
);
log
.
debug
(
"url="
+
candyUrl
+
"/candy-coupon/use"
);
String
returnData
=
HttpUtil
.
post
(
candyUrl
+
"/candy-coupon/use"
,
params
,
header
);
ResponseDto
<
CandyUseResultVo
>
innerReturnVo
=
JsonUtils
.
fromJson
(
returnData
,
new
TypeReference
<
ResponseDto
<
CandyUseResultVo
>>()
{
});
CandyUseResultVo
candyUseResultVo
=
innerReturnVo
.
getData
();
Integer
type
=
candyUseResultVo
.
getCouType
();
BigDecimal
value
=
candyUseResultVo
.
getValue
();
BigDecimal
voucher
=
BigDecimal
.
ZERO
;
switch
(
type
)
{
case
-
1
:
voucher
=
BigDecimal
.
valueOf
(-
1
);
break
;
case
1
:
voucher
=
voucher
.
add
(
value
);
break
;
case
2
:
voucher
=
voucher
.
add
(
value
);
break
;
case
3
:
voucher
=
voucher
.
add
(
totalPrice
);
break
;
case
4
:
voucher
=
totalPrice
.
subtract
(
totalPrice
.
multiply
(
value
));
break
;
default
:
voucher
=
BigDecimal
.
ZERO
;
break
;
}
hashMap
.
put
(
"type"
,
type
);
hashMap
.
put
(
"voucher"
,
voucher
.
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
));
return
hashMap
;
}
catch
(
Exception
e
)
{
log
.
error
(
"用券ERROR:{}"
,
e
);
hashMap
.
put
(
"type"
,
-
1
);
hashMap
.
put
(
"voucher"
,
0
);
return
hashMap
;
}
}
public
void
backCoupon
(
String
uCouponId
,
String
uid
)
{
try
{
BackCouponParam
param
=
BackCouponParam
.
getNew
();
...
...
@@ -166,7 +54,7 @@ public class GoblinOrderUtils {
}
}
public
CandyCouponVo
getCouponDetails
(
String
uCouponId
)
{
public
CandyCouponVo
getCouponDetails
(
String
uCouponId
,
String
uid
)
{
try
{
MultiValueMap
<
String
,
String
>
header
=
CollectionUtil
.
linkedMultiValueMapStringString
();
header
.
add
(
"Authorization"
,
"Bearer "
+
CurrentUtil
.
getToken
());
...
...
@@ -174,10 +62,15 @@ public class GoblinOrderUtils {
MultiValueMap
<
String
,
String
>
params
=
CollectionUtil
.
linkedMultiValueMapStringString
();
params
.
add
(
"uCouponIds"
,
uCouponId
);
params
.
add
(
"uid"
,
uid
);
String
returnData
=
HttpUtil
.
post
(
candyUrl
+
" /candy-coupon/receive/ListById"
,
params
,
header
);
ResponseDto
<
CandyCouponVo
>
innerReturnVo
=
JsonUtils
.
fromJson
(
returnData
,
new
TypeReference
<
ResponseDto
<
CandyCouponVo
>>()
{
ResponseDto
<
List
<
CandyCouponVo
>>
innerReturnVo
=
JsonUtils
.
fromJson
(
returnData
,
new
TypeReference
<
ResponseDto
<
List
<
CandyCouponVo
>
>>()
{
});
return
innerReturnVo
.
getData
();
if
(
innerReturnVo
.
getData
().
size
()>
0
){
return
innerReturnVo
.
getData
().
get
(
0
);
}
else
{
return
null
;
}
}
catch
(
Exception
e
)
{
log
.
error
(
"回退券ERROR:{}"
,
e
);
CandyCouponVo
vo
=
CandyCouponVo
.
getNew
();
...
...
@@ -201,19 +94,4 @@ public class GoblinOrderUtils {
e
.
printStackTrace
();
}
}
public
void
desTask
(
String
uid
,
BigDecimal
price
)
{
try
{
MultiValueMap
<
String
,
String
>
header
=
CollectionUtil
.
linkedMultiValueMapStringString
();
header
.
add
(
"Accept"
,
"application/json;charset=UTF-8"
);
MultiValueMap
<
String
,
String
>
params
=
CollectionUtil
.
linkedMultiValueMapStringString
();
params
.
add
(
"score"
,
price
.
intValue
()
+
""
);
params
.
add
(
"content"
,
"购买商品:"
);
params
.
add
(
"uid"
,
uid
);
String
resultData
=
HttpUtil
.
post
(
stoneUrl
+
"/user/logs/de2111"
,
params
,
header
);
}
catch
(
Exception
e
)
{
log
.
error
(
"添加积分失败,e:{}"
,
e
);
e
.
printStackTrace
();
}
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/util/GoblinRedisUtils.java
View file @
401111aa
...
...
@@ -22,6 +22,7 @@ import org.springframework.util.StringUtils;
import
java.time.LocalDateTime
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
static
com
.
liquidnet
.
service
.
goblin
.
constant
.
GoblinRedisConst
.
REDIS_GOBLIN_TEMP_COUPON_MARKET
;
...
...
@@ -104,7 +105,7 @@ public class GoblinRedisUtils {
if
(
obj
==
null
)
{
return
CollectionUtil
.
arrayListString
();
}
else
{
return
(
List
<
String
>)
obj
;
return
(
(
List
<
String
>)
obj
).
stream
().
distinct
().
collect
(
Collectors
.
toList
())
;
}
}
...
...
liquidnet-bus-service/liquidnet-service-notify/liquidnet-service-notify-impl/src/main/java/com/liquidnet/service/dragon/config/RedisStreamConfig.java
deleted
100644 → 0
View file @
736e916a
package
com
.
liquidnet
.
service
.
dragon
.
config
;
import
org.springframework.context.annotation.Configuration
;
@Configuration
public
class
RedisStreamConfig
{
// @Autowired
// private RedisPayNotifyReceiver redisPayNotifyReceiver;
// @Bean
// public Subscription subscriptionAlipayNotify0(RedisConnectionFactory factory) {
// var options = StreamMessageListenerContainer
// .StreamMessageListenerContainerOptions
// .builder()
// .pollTimeout(Duration.ofMillis(1))
// .build();
// var listenerContainer = StreamMessageListenerContainer.create(factory, options);
// var subscription = listenerContainer.receiveAutoAck(Consumer.from(DragonConstant.ChannelRedisQueueEnum.ALIPAY_PAY_GROUP.getCode(), "alipay-pay-notify-0"),
// StreamOffset.create(DragonConstant.ChannelRedisQueueEnum.ALIPAY_PAY_KEY.getCode(), ReadOffset.lastConsumed()), redisPayNotifyReceiver);
// listenerContainer.start();
// return subscription;
// }
//
// @Bean
// public Subscription subscriptionAlipayNotify1(RedisConnectionFactory factory) {
// var options = StreamMessageListenerContainer
// .StreamMessageListenerContainerOptions
// .builder()
// .pollTimeout(Duration.ofMillis(1))
// .build();
// var listenerContainer = StreamMessageListenerContainer.create(factory, options);
// var subscription = listenerContainer.receiveAutoAck(Consumer.from(DragonConstant.ChannelRedisQueueEnum.ALIPAY_PAY_GROUP.getCode(), "alipay-pay-notify-1"),
// StreamOffset.create(DragonConstant.ChannelRedisQueueEnum.ALIPAY_PAY_KEY.getCode(), ReadOffset.lastConsumed()), redisPayNotifyReceiver);
// listenerContainer.start();
// return subscription;
// }
//
// @Bean
// public Subscription subscriptionWepayNotify0(RedisConnectionFactory factory) {
// var options = StreamMessageListenerContainer
// .StreamMessageListenerContainerOptions
// .builder()
// .pollTimeout(Duration.ofMillis(1))
// .build();
// var listenerContainer = StreamMessageListenerContainer.create(factory, options);
// var subscription = listenerContainer.receiveAutoAck(Consumer.from(DragonConstant.ChannelRedisQueueEnum.WECHAT_PAY_GROUP.getCode(), "wepay-pay-notify-0"),
// StreamOffset.create(DragonConstant.ChannelRedisQueueEnum.WECHAT_PAY_KEY.getCode(), ReadOffset.lastConsumed()), redisPayNotifyReceiver);
// listenerContainer.start();
// return subscription;
// }
//
// @Bean
// public Subscription subscriptionWepayNotify1(RedisConnectionFactory factory) {
// var options = StreamMessageListenerContainer
// .StreamMessageListenerContainerOptions
// .builder()
// .pollTimeout(Duration.ofMillis(1))
// .build();
// var listenerContainer = StreamMessageListenerContainer.create(factory, options);
// var subscription = listenerContainer.receiveAutoAck(Consumer.from(DragonConstant.ChannelRedisQueueEnum.WECHAT_PAY_GROUP.getCode(), "wepay-pay-notify-1"),
// StreamOffset.create(DragonConstant.ChannelRedisQueueEnum.WECHAT_PAY_KEY.getCode(), ReadOffset.lastConsumed()), redisPayNotifyReceiver);
// listenerContainer.start();
// return subscription;
// }
}
liquidnet-bus-service/liquidnet-service-notify/liquidnet-service-notify-impl/src/main/java/com/liquidnet/service/dragon/service/impl/DragonOrderRefundsServiceImpl.java
View file @
401111aa
...
...
@@ -413,6 +413,8 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
parameters
.
put
(
"appid"
,
PayWepayUtils
.
getInstance
().
getAPPLET_APP_ID
());
}
else
if
(
paymentType
.
equalsIgnoreCase
(
DragonConstant
.
PayTypeEnum
.
PAYMENT_TYPE_WAP_WEPAY
.
getCode
()))
{
parameters
.
put
(
"appid"
,
PayWepayUtils
.
getInstance
().
getWAP_APP_ID
());
}
else
if
(
paymentType
.
equalsIgnoreCase
(
DragonConstant
.
PayTypeEnum
.
PAYMENT_TYPE_MICROPAY_WEPAY
.
getCode
())){
parameters
.
put
(
"appid"
,
PayWepayUtils
.
getInstance
().
getAPP_ID
());
}
parameters
.
put
(
"nonce_str"
,
nonceStr
);
parameters
.
put
(
"out_refund_no"
,
refundCode
);
...
...
liquidnet-bus-service/liquidnet-service-order/liquidnet-service-order-impl/src/main/java/com/liquidnet/service/order/service/impl/GoblinOrderServiceImpl.java
View file @
401111aa
...
...
@@ -113,9 +113,11 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
//下单
GoblinOrderPreParam
pre
=
order
(
param
,
storeParam
,
uid
,
isMember
,
addressesVo
,
orderMasterCode
,
orderId
,
orderCode
,
platformCodeList
,
storeCodeList
);
preParam
.
setPriceActual
(
preParam
.
getPriceActual
().
add
(
pre
.
getPriceActual
()));
preParam
.
setStoreName
(
pre
Param
.
getStoreName
()
+
","
+
pre
.
getStoreName
());
preParam
.
setStoreName
(
pre
.
getStoreName
()
+
","
+
preParam
.
getStoreName
());
preParam
.
setSkuName
(
preParam
.
getSkuName
()
+
","
+
pre
.
getSkuName
());
preParam
.
setOrderIdList
(
preParam
.
getOrderIdList
()
+
","
+
pre
.
getOrderIdList
());
preParam
.
setPlatformSpuIds
(
pre
.
getPlatformSpuIds
());
preParam
.
setStoreSpuIds
(
pre
.
getStoreSpuIds
());
GoblinOrderSqlParam
sqlParam
=
GoblinOrderSqlParam
.
getNew
();
sqlParam
.
setStoreOrder
(
pre
.
getStoreOrder
());
...
...
@@ -196,13 +198,14 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
String
source
=
headerCliSource
==
null
?
""
:
headerCliSource
;
String
version
=
headerCliVersion
==
null
?
""
:
headerCliVersion
;
LocalDateTime
now
=
LocalDateTime
.
now
();
log
.
debug
(
"当前系统时间="
+
now
);
String
skuName
=
""
;
BigDecimal
price
;
//sku应付价格
BigDecimal
priceBase
;
//sku原价
BigDecimal
storeTotalPrice
=
BigDecimal
.
ZERO
;
//订单总金额
String
writeOffCode
=
""
;
//取货码
List
<
GoblinOrderSku
>
goblinOrderSkuList
=
ObjectUtil
.
getGoblinOrderSkuArrayList
();
List
<
String
>
storeSpuIds
=
CollectionUtil
.
linkedListString
();
List
<
String
>
platformSpuIds
=
CollectionUtil
.
linkedListString
();
String
marketId
=
""
;
String
marketType
=
""
;
for
(
GoblinOrderSkuParam
skuParam
:
storeParam
.
getGoblinOrderSkuParamArrayList
())
{
...
...
@@ -302,7 +305,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
spuIds
=
spuIds
.
concat
(
item
.
getSpuId
()
+
","
);
}
}
HashMap
<
String
,
Object
>
hashMap
=
orderUtils
.
useCoupon
(
platVoucherCode
,
"购买商品["
+
orderCode
+
"]"
,
storeTotalPrice
,
spuIds
,
uid
);
HashMap
<
String
,
Object
>
hashMap
=
orderUtils
.
useCoupon
(
platVoucherCode
,
"购买商品["
+
orderCode
+
"]"
,
storeTotalPrice
,
spuIds
,
uid
,
goblinOrderSkuList
);
if
(
hashMap
!=
null
)
{
voucherPrice
=
(
BigDecimal
)
hashMap
.
get
(
"voucher"
);
Integer
typeVoucher
=
(
Integer
)
hashMap
.
get
(
"type"
);
...
...
@@ -310,22 +313,14 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
throw
new
Exception
(
"平台券不可用"
);
}
else
{
platformCodeList
.
add
(
platVoucherCode
);
platformSpuIds
=
(
List
<
String
>)
hashMap
.
get
(
"spuIds"
);
}
}
}
//商铺券
BigDecimal
storeVoucherPrice
=
BigDecimal
.
ZERO
;
if
(
storeVoucherCode
!=
null
&&
!
storeVoucherCode
.
equals
(
""
))
{
String
spuIds
=
""
;
for
(
GoblinOrderSkuParam
item
:
storeParam
.
getGoblinOrderSkuParamArrayList
())
{
String
pre
=
GoblinStatusConst
.
MarketPreStatus
.
getPre
(
item
.
getSpuId
());
if
(
pre
!=
null
)
{
spuIds
=
spuIds
.
concat
(
item
.
getSpuId
().
split
(
pre
)[
0
]
+
","
);
}
else
{
spuIds
=
spuIds
.
concat
(
item
.
getSpuId
()
+
","
);
}
}
GoblinUseResultVo
storeCouponVo
=
orderUtils
.
useStoreCoupon
(
storeVoucherCode
,
"购买商品["
+
orderCode
+
"]"
,
storeTotalPrice
,
spuIds
,
uid
);
GoblinUseResultVo
storeCouponVo
=
orderUtils
.
useStoreCoupon
(
storeVoucherCode
,
"购买商品["
+
orderCode
+
"]"
,
storeTotalPrice
,
goblinOrderSkuList
,
uid
);
String
typeVoucher
;
if
(
storeCouponVo
!=
null
)
{
storeVoucherPrice
=
storeCouponVo
.
getValue
();
...
...
@@ -334,6 +329,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
throw
new
Exception
(
"店铺券不可用"
);
}
else
{
storeCodeList
.
add
(
storeVoucherCode
);
storeSpuIds
=
storeCouponVo
.
getSpuIds
();
}
}
}
...
...
@@ -404,6 +400,8 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
preParam
.
setStoreOrder
(
storeOrder
);
preParam
.
setOrderAttr
(
orderAttr
);
preParam
.
setOrderSkuList
(
goblinOrderSkuList
);
preParam
.
setStoreSpuIds
(
storeSpuIds
);
preParam
.
setPlatformSpuIds
(
platformSpuIds
);
return
preParam
;
}
...
...
@@ -463,16 +461,6 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
payCode
=
payInnerResultVo
.
getCode
();
payInnerResultVo
.
setShowUrl
(
preParam
.
getShowUrl
());
payInnerResultVo
.
setReturnUrl
(
preParam
.
getReturnUrl
());
// payInnerResultVo = GoblinPayInnerResultVo.getNew();
// payInnerResultVo.setCode("压测 code");
// payInnerResultVo.setOrderCode(preParam.getOrderMasterCode());
// payInnerResultVo.setPayData(null);
// payInnerResultVo.setPayType(preParam.getPayType());
// payInnerResultVo.setPrice(preParam.getPriceActual());
// payCode = payInnerResultVo.getCode();
// payInnerResultVo.setShowUrl(preParam.getShowUrl());
// payInnerResultVo.setReturnUrl(preParam.getReturnUrl());
}
else
if
(
preParam
.
getPayType
()
==
null
)
{
isFree
=
true
;
preParam
.
setPayType
(
"FREE"
);
...
...
@@ -512,17 +500,58 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
for
(
int
i
=
0
;
i
<
item
.
getOrderSkuList
().
size
();
i
++)
{
GoblinOrderSku
orderSku
=
item
.
getOrderSkuList
().
get
(
i
);
if
(
item
.
getStoreOrder
().
getPriceVoucher
().
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
restVoucherPrice
=
restVoucherPrice
.
subtract
(
orderSku
.
getSkuPrice
());
if
(
restVoucherPrice
.
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
orderSku
.
setPriceVoucher
(
orderSku
.
getSkuPrice
());
BigDecimal
skuPriceActual
=
orderSku
.
getSkuPrice
().
subtract
(
orderSku
.
getSkuPrice
());
orderSku
.
setSkuPriceActual
(
skuPriceActual
.
compareTo
(
BigDecimal
.
ZERO
)
>
0
?
skuPriceActual
:
BigDecimal
.
ZERO
);
}
else
{
orderSku
.
setPriceVoucher
(
restVoucherPrice
.
add
(
orderSku
.
getSkuPrice
()));
BigDecimal
skuPriceActual
=
orderSku
.
getSkuPrice
().
subtract
(
orderSku
.
getPriceVoucher
());
orderSku
.
setSkuPriceActual
(
skuPriceActual
.
compareTo
(
BigDecimal
.
ZERO
)
>
0
?
skuPriceActual
:
BigDecimal
.
ZERO
);
if
(
preParam
.
getStoreSpuIds
().
size
()
>
0
||
preParam
.
getPlatformSpuIds
().
size
()
>
0
)
{
//指定范围商品券
String
spuId
=
orderSku
.
getSpuId
();
String
pre
=
GoblinStatusConst
.
MarketPreStatus
.
getPre
(
spuId
);
if
(
pre
!=
null
)
{
spuId
=
spuId
.
split
(
pre
)[
0
];
}
if
(
preParam
.
getStoreSpuIds
().
contains
(
spuId
)
||
preParam
.
getPlatformSpuIds
().
contains
(
spuId
))
{
if
(
restVoucherPrice
.
compareTo
(
BigDecimal
.
ZERO
)
<=
0
)
{
restVoucherPrice
=
BigDecimal
.
ZERO
;
}
if
(
restVoucherPrice
.
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
restVoucherPrice
=
restVoucherPrice
.
subtract
(
orderSku
.
getSkuPrice
());
if
(
restVoucherPrice
.
compareTo
(
BigDecimal
.
ZERO
)
>=
0
)
{
orderSku
.
setPriceVoucher
(
orderSku
.
getSkuPrice
());
}
else
{
orderSku
.
setPriceVoucher
(
restVoucherPrice
.
add
(
orderSku
.
getSkuPrice
()));
}
BigDecimal
skuPriceActual
=
orderSku
.
getSkuPrice
().
subtract
(
orderSku
.
getPriceVoucher
());
orderSku
.
setSkuPriceActual
(
skuPriceActual
.
compareTo
(
BigDecimal
.
ZERO
)
>
0
?
skuPriceActual
:
BigDecimal
.
ZERO
);
}
else
if
(
restVoucherPrice
.
compareTo
(
BigDecimal
.
ZERO
)
==
0
)
{
orderSku
.
setPriceVoucher
(
BigDecimal
.
ZERO
);
BigDecimal
skuPriceActual
=
orderSku
.
getSkuPrice
().
subtract
(
orderSku
.
getPriceVoucher
());
orderSku
.
setSkuPriceActual
(
skuPriceActual
.
compareTo
(
BigDecimal
.
ZERO
)
>
0
?
skuPriceActual
:
BigDecimal
.
ZERO
);
}
else
{
orderSku
.
setPriceVoucher
(
restVoucherPrice
.
add
(
orderSku
.
getSkuPrice
()));
BigDecimal
skuPriceActual
=
orderSku
.
getSkuPrice
().
subtract
(
orderSku
.
getPriceVoucher
());
orderSku
.
setSkuPriceActual
(
skuPriceActual
.
compareTo
(
BigDecimal
.
ZERO
)
>
0
?
skuPriceActual
:
BigDecimal
.
ZERO
);
}
}
}
else
{
//全部商品券
if
(
restVoucherPrice
.
compareTo
(
BigDecimal
.
ZERO
)
<=
0
)
{
restVoucherPrice
=
BigDecimal
.
ZERO
;
}
if
(
restVoucherPrice
.
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
restVoucherPrice
=
restVoucherPrice
.
subtract
(
orderSku
.
getSkuPrice
());
if
(
restVoucherPrice
.
compareTo
(
BigDecimal
.
ZERO
)
>=
0
)
{
orderSku
.
setPriceVoucher
(
orderSku
.
getSkuPrice
());
}
else
{
orderSku
.
setPriceVoucher
(
restVoucherPrice
.
add
(
orderSku
.
getSkuPrice
()));
}
BigDecimal
skuPriceActual
=
orderSku
.
getSkuPrice
().
subtract
(
orderSku
.
getPriceVoucher
());
orderSku
.
setSkuPriceActual
(
skuPriceActual
.
compareTo
(
BigDecimal
.
ZERO
)
>
0
?
skuPriceActual
:
BigDecimal
.
ZERO
);
}
else
if
(
restVoucherPrice
.
compareTo
(
BigDecimal
.
ZERO
)
==
0
)
{
orderSku
.
setPriceVoucher
(
BigDecimal
.
ZERO
);
BigDecimal
skuPriceActual
=
orderSku
.
getSkuPrice
().
subtract
(
orderSku
.
getPriceVoucher
());
orderSku
.
setSkuPriceActual
(
skuPriceActual
.
compareTo
(
BigDecimal
.
ZERO
)
>
0
?
skuPriceActual
:
BigDecimal
.
ZERO
);
}
else
{
orderSku
.
setPriceVoucher
(
restVoucherPrice
.
add
(
orderSku
.
getSkuPrice
()));
BigDecimal
skuPriceActual
=
orderSku
.
getSkuPrice
().
subtract
(
orderSku
.
getPriceVoucher
());
orderSku
.
setSkuPriceActual
(
skuPriceActual
.
compareTo
(
BigDecimal
.
ZERO
)
>
0
?
skuPriceActual
:
BigDecimal
.
ZERO
);
}
}
}
sqlDataSku
.
add
(
new
Object
[]{
orderSku
.
getOrderSkuId
(),
orderSku
.
getOrderId
(),
orderSku
.
getSpuId
(),
orderSku
.
getSpuName
(),
orderSku
.
getSpuPic
(),
orderSku
.
getSkuId
(),
orderSku
.
getNum
(),
orderSku
.
getSkuPrice
(),
orderSku
.
getSkuPriceActual
(),
orderSku
.
getSkuName
(),
...
...
@@ -578,6 +607,15 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
log
.
info
(
UserPathDto
.
setData
(
"下单(唤起支付)"
,
preParam
,
payInnerResultVo
));
if
(
isFree
&&
preParam
.
getPayType
().
equals
(
"huifu"
))
{
// SyncOrderParam syncOrderParam = SyncOrderParam.getNew();
// syncOrderParam.setOrderCode(preParam.getOrderMasterCode());
// syncOrderParam.setPaymentAt(DateUtil.format(LocalDateTime.now(), DateUtil.Formatter.yyyyMMddHHmmss));
// syncOrderParam.setCode(payCode);
// syncOrderParam.setPrice(preParam.getPriceActual());
// syncOrderParam.setPaymentId("FREE_PAYMENT_ID");
// syncOrderParam.setPaymentType(null);
// syncOrderParam.setStatus(1);
// syncOrder(syncOrderParam);
return
ResponseDto
.
success
(
payInnerResultVo
);
}
else
if
(
isFree
)
{
SyncOrderParam
syncOrderParam
=
SyncOrderParam
.
getNew
();
...
...
liquidnet-bus-service/liquidnet-service-order/liquidnet-service-order-impl/src/main/java/com/liquidnet/service/order/service/impl/KylinOrderTicketsServiceImpl.java
View file @
401111aa
...
...
@@ -322,11 +322,9 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
//限购判断 如果实名 则身份证维度限购 如果不实名则数量限购
if
(
entersVoList
.
size
()
>
0
)
{
for
(
int
i
=
0
;
i
<
entersVoList
.
size
();
i
++)
{
//todo 修改限购
dataUtils
.
changeBuyInfo
(
uid
,
entersVoList
.
get
(
i
).
getIdCard
(),
performanceData
.
getPerformancesId
(),
ticketData
.
getTicketsId
(),
1
);
String
res1
=
orderUtils
.
judgeOrderLimit
(
performanceData
.
getType
(),
uid
,
entersVoList
.
get
(
i
).
getIdCard
(),
payOrderParam
.
getPerformanceId
(),
payOrderParam
.
getTicketId
(),
performanceLimit
,
performanceMemberLimit
,
ticketLimit
,
ticketMemberLimit
,
1
,
1
,
memberType
,
isTrueName
);
if
(!
res1
.
equals
(
""
))
{
//todo 修改限购
dataUtils
.
changeBuyInfo
(
uid
,
entersVoList
.
get
(
i
).
getIdCard
(),
performanceData
.
getPerformancesId
(),
ticketData
.
getTicketsId
(),
-
1
);
orderUtils
.
changeSurplus
(
isPay
,
payOrderParam
.
getTicketId
(),
payOrderParam
.
getNumber
());
orderUtils
.
backAdvanceCoupon
(
payOrderParam
.
getAdvanceCode
(),
uid
);
...
...
@@ -334,11 +332,9 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
}
}
}
else
{
//todo 修改限购
dataUtils
.
changeBuyInfo
(
uid
,
""
,
performanceData
.
getPerformancesId
(),
ticketData
.
getTicketsId
(),
payOrderParam
.
getNumber
());
String
res1
=
orderUtils
.
judgeOrderLimit
(
performanceData
.
getType
(),
uid
,
""
,
payOrderParam
.
getPerformanceId
(),
payOrderParam
.
getTicketId
(),
performanceLimit
,
performanceMemberLimit
,
ticketLimit
,
ticketMemberLimit
,
payOrderParam
.
getNumber
(),
payOrderParam
.
getNumber
(),
memberType
,
isTrueName
);
if
(!
res1
.
equals
(
""
))
{
//todo 修改限购
dataUtils
.
changeBuyInfo
(
uid
,
""
,
performanceData
.
getPerformancesId
(),
ticketData
.
getTicketsId
(),
-
payOrderParam
.
getNumber
());
orderUtils
.
changeSurplus
(
isPay
,
payOrderParam
.
getTicketId
(),
payOrderParam
.
getNumber
());
orderUtils
.
backAdvanceCoupon
(
payOrderParam
.
getAdvanceCode
(),
uid
);
...
...
liquidnet-bus-service/liquidnet-service-order/liquidnet-service-order-impl/src/main/java/com/liquidnet/service/order/utils/GoblinOrderUtils.java
View file @
401111aa
...
...
@@ -3,21 +3,18 @@ package com.liquidnet.service.order.utils;
import
com.alibaba.fastjson.JSON
;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
com.liquidnet.commons.lang.util.*
;
import
com.liquidnet.service.adam.dto.vo.AdamRscPolymer01Vo
;
import
com.liquidnet.service.base.ErrorMapping
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.base.SqlMapping
;
import
com.liquidnet.service.base.constant.MQConst
;
import
com.liquidnet.service.candy.param.BackCouponParam
;
import
com.liquidnet.service.candy.vo.CandyCouponVo
;
import
com.liquidnet.service.candy.vo.CandyUseResultVo
;
import
com.liquidnet.service.goblin.constant.GoblinStatusConst
;
import
com.liquidnet.service.goblin.dto.vo.*
;
import
com.liquidnet.service.goblin.entity.GoblinBackOrder
;
import
com.liquidnet.service.goblin.entity.GoblinBackOrderLog
;
import
com.liquidnet.service.goblin.entity.GoblinOrder
OperationLog
;
import
com.liquidnet.service.goblin.entity.GoblinOrder
Sku
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
...
...
@@ -26,7 +23,6 @@ import org.springframework.util.MultiValueMap;
import
java.math.BigDecimal
;
import
java.time.LocalDateTime
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.HashMap
;
import
java.util.List
;
...
...
@@ -88,7 +84,7 @@ public class GoblinOrderUtils {
* @param totalPrice 订单总价
* @return
*/
public
HashMap
<
String
,
Object
>
useCoupon
(
String
uCouponId
,
String
content
,
BigDecimal
totalPrice
,
String
spuId
,
String
uid
)
{
public
HashMap
<
String
,
Object
>
useCoupon
(
String
uCouponId
,
String
content
,
BigDecimal
totalPrice
,
String
spuId
,
String
uid
,
List
<
GoblinOrderSku
>
goblinOrderSkuList
)
{
HashMap
<
String
,
Object
>
hashMap
=
CollectionUtil
.
mapStringObject
();
try
{
MultiValueMap
<
String
,
String
>
params
=
CollectionUtil
.
linkedMultiValueMapStringString
();
...
...
@@ -109,28 +105,86 @@ public class GoblinOrderUtils {
});
CandyUseResultVo
candyUseResultVo
=
innerReturnVo
.
getData
();
Integer
type
=
candyUseResultVo
.
getCouType
();
List
<
String
>
targetList
=
candyUseResultVo
.
getTargetIds
();
BigDecimal
fullValue
=
candyUseResultVo
.
getFullValue
();
BigDecimal
value
=
candyUseResultVo
.
getValue
();
BigDecimal
voucher
=
BigDecimal
.
ZERO
;
BigDecimal
targetPrice
=
BigDecimal
.
ZERO
;
switch
(
type
)
{
case
-
1
:
voucher
=
BigDecimal
.
valueOf
(-
1
);
break
;
case
1
:
voucher
=
voucher
.
add
(
value
);
if
(
targetList
.
size
()
==
0
)
{
targetPrice
=
totalPrice
;
}
else
{
for
(
String
targetId
:
targetList
)
{
for
(
GoblinOrderSku
skuOrderVo
:
goblinOrderSkuList
)
{
String
orderVoSpuId
=
skuOrderVo
.
getSpuId
();
String
pre
=
GoblinStatusConst
.
MarketPreStatus
.
getPre
(
orderVoSpuId
);
if
(
pre
!=
null
)
{
orderVoSpuId
=
orderVoSpuId
.
split
(
pre
)[
0
];
}
if
(
targetId
.
equals
(
orderVoSpuId
))
{
targetPrice
=
targetPrice
.
add
(
skuOrderVo
.
getSkuPriceActual
());
}
}
}
}
if
(
targetPrice
.
compareTo
(
value
)
>=
0
)
{
voucher
=
voucher
.
add
(
value
);
}
else
{
voucher
=
voucher
.
add
(
targetPrice
);
}
break
;
case
2
:
voucher
=
voucher
.
add
(
value
);
case
2
:
//满减
if
(
targetList
.
size
()
==
0
)
{
targetPrice
=
totalPrice
;
}
else
{
for
(
String
targetId
:
targetList
)
{
for
(
GoblinOrderSku
skuOrderVo
:
goblinOrderSkuList
)
{
String
orderVoSpuId
=
skuOrderVo
.
getSpuId
();
String
pre
=
GoblinStatusConst
.
MarketPreStatus
.
getPre
(
orderVoSpuId
);
if
(
pre
!=
null
)
{
orderVoSpuId
=
orderVoSpuId
.
split
(
pre
)[
0
];
}
if
(
targetId
.
equals
(
orderVoSpuId
))
{
targetPrice
=
targetPrice
.
add
(
skuOrderVo
.
getSkuPriceActual
());
}
}
}
}
if
(
fullValue
.
compareTo
(
targetPrice
)
<=
0
)
{
voucher
=
voucher
.
add
(
value
);
}
else
{
backCoupon
(
uCouponId
,
uid
);
hashMap
.
put
(
"type"
,
-
1
);
hashMap
.
put
(
"voucher"
,
BigDecimal
.
ZERO
);
return
hashMap
;
}
break
;
case
3
:
voucher
=
voucher
.
add
(
totalPrice
);
break
;
case
4
:
voucher
=
totalPrice
.
subtract
(
totalPrice
.
multiply
(
value
));
case
4
:
//折扣
if
(
targetList
.
size
()
==
0
)
{
targetPrice
=
totalPrice
;
}
else
{
for
(
String
targetId
:
targetList
)
{
for
(
GoblinOrderSku
skuOrderVo
:
goblinOrderSkuList
)
{
if
(
targetId
.
equals
(
skuOrderVo
.
getSpuId
()))
{
targetPrice
=
targetPrice
.
add
(
skuOrderVo
.
getSkuPriceActual
());
}
}
}
}
voucher
=
targetPrice
.
subtract
(
targetPrice
.
multiply
(
value
));
break
;
default
:
voucher
=
BigDecimal
.
ZERO
;
break
;
}
hashMap
.
put
(
"spuIds"
,
targetList
);
hashMap
.
put
(
"type"
,
type
);
hashMap
.
put
(
"voucher"
,
voucher
.
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
));
return
hashMap
;
...
...
@@ -188,18 +242,19 @@ public class GoblinOrderUtils {
}
}
public
GoblinUseResultVo
useStoreCoupon
(
String
ucouponId
,
String
content
,
BigDecimal
totalPrice
,
String
spuId
,
String
uid
)
{
public
GoblinUseResultVo
useStoreCoupon
(
String
ucouponId
,
String
content
,
BigDecimal
totalPrice
,
List
<
GoblinOrderSku
>
goblinOrderSkuList
,
String
uid
)
{
try
{
List
<
GoblinUserCouponVo
>
voList
=
redisUtils
.
getUserCouponVos
(
uid
);
GoblinUseResultVo
returnVo
=
GoblinUseResultVo
.
getNew
();
returnVo
.
setValue
(
BigDecimal
.
ZERO
);
returnVo
.
setCouType
(
"-1"
);
LocalDateTime
now
=
LocalDateTime
.
now
();
List
<
String
>
spuIds
=
CollectionUtil
.
linkedListString
();
for
(
GoblinUserCouponVo
vo
:
voList
)
{
if
(
vo
.
getUcouponId
().
equals
(
ucouponId
)
&&
vo
.
getDuedAt
().
isAfter
(
now
))
{
//判断券状态 和 触发金额
if
((
vo
.
getState
().
equals
(
1
))
&&
vo
.
getTriggers
().
compareTo
(
totalPrice
)
<=
0
)
{
if
(
vo
.
getUseScope
().
equals
(
"0"
))
{
if
((
vo
.
getState
().
equals
(
1
)))
{
if
(
vo
.
getUseScope
().
equals
(
"0"
)
&&
vo
.
getTriggers
().
compareTo
(
totalPrice
)
<=
0
)
{
if
(
vo
.
getType
().
equals
(
"1"
))
{
//代金券
returnVo
.
setValue
(
vo
.
getValFace
());
returnVo
.
setCouType
(
vo
.
getType
());
...
...
@@ -208,7 +263,7 @@ public class GoblinOrderUtils {
if
(
tempPrice
.
compareTo
(
vo
.
getDeduction
())
>
0
)
{
tempPrice
=
vo
.
getDeduction
();
}
returnVo
.
setValue
(
t
empPrice
);
returnVo
.
setValue
(
t
otalPrice
.
subtract
(
tempPrice
)
);
returnVo
.
setCouType
(
vo
.
getType
());
}
else
if
(
vo
.
getType
().
equals
(
"3"
)
&&
vo
.
getTriggers
().
compareTo
(
totalPrice
)
<=
0
)
{
//满减
returnVo
.
setValue
(
vo
.
getValMinus
());
...
...
@@ -221,36 +276,54 @@ public class GoblinOrderUtils {
SqlMapping
.
get
(
"goblin_user_coupon.updateState"
,
vo
.
getState
(),
vo
.
getUsedFor
(),
LocalDateTime
.
now
(),
vo
.
getUcouponId
()));
break
;
}
else
{
List
<
String
>
spuIds
=
redisUtils
.
getStoreCouponSpuIds
(
vo
.
getStoreCouponId
());
if
(
spuId
==
null
)
{
continue
;
spuIds
=
redisUtils
.
getStoreCouponSpuIds
(
vo
.
getStoreCouponId
());
if
(
spuId
s
==
null
||
spuIds
.
size
()
==
0
)
{
break
;
}
//判断是否在可用商品内
List
<
String
>
spuList
=
Arrays
.
asList
(
spuId
.
split
(
","
))
;
BigDecimal
contentPrice
=
BigDecimal
.
ZERO
;
for
(
String
item
:
spuIds
)
{
if
(
spuList
.
contains
(
item
))
{
if
(
vo
.
getType
().
equals
(
"1"
))
{
//代金券
for
(
GoblinOrderSku
param
:
goblinOrderSkuList
)
{
String
spuId
=
param
.
getSpuId
();
String
pre
=
GoblinStatusConst
.
MarketPreStatus
.
getPre
(
spuId
);
if
(
pre
!=
null
)
{
spuId
=
spuId
.
split
(
pre
)[
0
];
}
if
(
spuId
.
equals
(
item
))
{
contentPrice
=
contentPrice
.
add
(
param
.
getSkuPriceActual
());
}
}
}
if
(
vo
.
getTriggers
().
compareTo
(
contentPrice
)
<=
0
)
{
if
(
vo
.
getType
().
equals
(
"1"
))
{
//代金券
if
(
vo
.
getValFace
().
compareTo
(
contentPrice
)
>
0
)
{
returnVo
.
setValue
(
contentPrice
);
}
else
{
returnVo
.
setValue
(
vo
.
getValFace
());
returnVo
.
setCouType
(
vo
.
getType
());
}
else
if
(
vo
.
getType
().
equals
(
"2"
))
{
//折扣
BigDecimal
tempPrice
=
totalPrice
.
multiply
(
vo
.
getDiscount
()).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
);
if
(
tempPrice
.
compareTo
(
vo
.
getDeduction
())
>
0
)
{
tempPrice
=
vo
.
getDeduction
();
}
returnVo
.
setValue
(
tempPrice
);
returnVo
.
setCouType
(
vo
.
getType
());
}
else
if
(
vo
.
getType
().
equals
(
"3"
)
&&
vo
.
getTriggers
().
compareTo
(
totalPrice
)
<=
0
)
{
//满减
}
returnVo
.
setCouType
(
vo
.
getType
());
}
else
if
(
vo
.
getType
().
equals
(
"2"
))
{
//折扣
BigDecimal
tempPrice
=
contentPrice
.
multiply
(
vo
.
getDiscount
()).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
);
if
(
tempPrice
.
compareTo
(
vo
.
getDeduction
())
>
0
)
{
tempPrice
=
vo
.
getDeduction
();
}
returnVo
.
setValue
(
contentPrice
.
subtract
(
tempPrice
));
returnVo
.
setCouType
(
vo
.
getType
());
}
else
if
(
vo
.
getType
().
equals
(
"3"
))
{
//满减
if
(
vo
.
getValMinus
().
compareTo
(
contentPrice
)
>
0
)
{
returnVo
.
setValue
(
contentPrice
);
}
else
{
returnVo
.
setValue
(
vo
.
getValMinus
());
returnVo
.
setCouType
(
vo
.
getType
());
}
vo
.
setState
(
5
);
vo
.
setUsedFor
(
content
);
goblinMongoUtils
.
changeCouponVos
(
vo
.
getUcouponId
(),
vo
);
queueUtils
.
sendMsgByRedis
(
MQConst
.
GoblinQueue
.
SQL_COUPON
.
getKey
(),
SqlMapping
.
get
(
"goblin_user_coupon.updateState"
,
vo
.
getState
(),
vo
.
getUsedFor
(),
LocalDateTime
.
now
(),
vo
.
getUcouponId
()));
returnVo
.
setCouType
(
vo
.
getType
());
}
break
;
vo
.
setState
(
5
);
vo
.
setUsedFor
(
content
);
goblinMongoUtils
.
changeCouponVos
(
vo
.
getUcouponId
(),
vo
);
queueUtils
.
sendMsgByRedis
(
MQConst
.
GoblinQueue
.
SQL_COUPON
.
getKey
(),
SqlMapping
.
get
(
"goblin_user_coupon.updateState"
,
vo
.
getState
(),
vo
.
getUsedFor
(),
LocalDateTime
.
now
(),
vo
.
getUcouponId
()));
}
}
}
break
;
...
...
@@ -259,6 +332,7 @@ public class GoblinOrderUtils {
if
(!
returnVo
.
getCouType
().
equals
(
"-1"
))
{
redisUtils
.
setUserCouponVos
(
uid
,
voList
);
}
returnVo
.
setSpuIds
(
spuIds
);
return
returnVo
;
}
catch
(
Exception
e
)
{
log
.
error
(
"店铺券错误:{}"
,
e
);
...
...
liquidnet-bus-service/liquidnet-service-order/liquidnet-service-order-impl/src/main/java/com/liquidnet/service/order/utils/OrderUtils.java
View file @
401111aa
...
...
@@ -62,6 +62,8 @@ public class OrderUtils {
}
else
{
integers
=
roadShowOrderLimit
(
userId
,
idCard
,
performanceId
,
ticketId
,
performanceBuyCount
,
ticketBuyCount
,
isTrueName
);
}
log
.
debug
(
"演出购买数量="
+
integers
[
0
]);
log
.
debug
(
"票种购买数量="
+
integers
[
1
]);
return
judgeMemberType
(
performanceLimitCount
,
performanceMemberLimitCount
,
ticketLimitCount
,
ticketMemberLimitCount
,
memberType
,
integers
[
0
],
integers
[
1
],
isTrueName
);
}
...
...
@@ -111,6 +113,10 @@ public class OrderUtils {
}
public
String
judgeMemberType
(
int
performanceLimitCount
,
int
performanceMemberLimitCount
,
int
ticketLimitCount
,
int
ticketMemberLimitCount
,
int
memberType
,
int
performanceBuyCount
,
int
ticketBuyCount
,
int
isTrueName
)
{
log
.
debug
(
"会员限购演出="
+
performanceMemberLimitCount
);
log
.
debug
(
"限购演出="
+
performanceLimitCount
);
log
.
debug
(
"会员限购票种="
+
ticketMemberLimitCount
);
log
.
debug
(
"限购票种="
+
ticketLimitCount
);
if
(
memberType
==
1
||
memberType
==
2
)
{
if
(
performanceBuyCount
>
performanceMemberLimitCount
&&
performanceMemberLimitCount
!=
0
)
{
return
(
1
==
isTrueName
?
"实名制"
:
"本场"
)
+
"演出限购"
+
performanceMemberLimitCount
+
"张,已超出"
;
//超过演出维度购买量
...
...
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