Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
caosy
/
fun-golf-service
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
1
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
044fdab5
authored
Nov 19, 2018
by
chongli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
不同的过期会员续费发送不同券功能开发
parent
ddc5f75f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
2 deletions
src/main/java/com/ctrip/fun/golf/service/basic/VoucherService.java
src/main/java/com/ctrip/fun/golf/service/order/CommuneOrderService.java
src/main/java/com/ctrip/fun/golf/service/payment/CommuneNotifyService.java
src/main/java/com/ctrip/fun/golf/service/basic/VoucherService.java
View file @
044fdab5
...
...
@@ -9,10 +9,14 @@ import java.util.Collections;
import
java.util.Comparator
;
import
java.util.Date
;
import
java.util.List
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.CollectionUtils
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.ctrip.fun.common.core.exceptions.service.ServiceException
;
import
com.ctrip.fun.common.core.util.BeanConverter
;
...
...
@@ -1056,6 +1060,36 @@ public class VoucherService {
String
commune_voucher
=
clientConfig
.
getMessage
();
this
.
sendVoucherForPlaceOrderByConfig
(
uid
,
orderId
,
myselfOrder
,
commune_voucher
);
}
/**
*
* @param uid
* @return
* @throws Exception
*/
public
void
sendVoucherFor360PlaceOrder
(
String
uid
,
String
orderId
)
throws
Exception
{
UserExt
userExt
=
this
.
userExtDao
.
getByUid
(
uid
);
Date
communeEnd
=
DateUtil
.
addDateField
(
userExt
.
getCommuneAgainTime
(),
Calendar
.
YEAR
,
1
);
String
rule_String
=
null
;
JSONObject
jsobj
=
JSONObject
.
parseObject
(
clientConfigDao
.
getByType
(
"chongzhiren_voucher_send_360"
).
getMessage
());
JSONArray
config_360
=
jsobj
.
getJSONArray
(
"rules"
);
for
(
int
i
=
0
;
i
<
config_360
.
size
();
i
++){
rule_String
=
config_360
.
get
(
i
).
toString
();
JSONObject
json_rule
=
JSONObject
.
parseObject
(
rule_String
);
Date
communeEnd_start
=
DateUtil
.
parseDateTime
(
json_rule
.
getString
(
"communeEnd_start"
));
Date
communeEnd_end
=
DateUtil
.
parseDateTime
(
json_rule
.
getString
(
"communeEnd_end"
));
if
(
communeEnd_start
.
getTime
()<
communeEnd
.
getTime
()&&
communeEnd
.
getTime
()<
communeEnd_end
.
getTime
()){
break
;
}
}
if
(
rule_String
!=
null
){
this
.
sendVoucherForPlaceOrderByConfig
(
uid
,
orderId
,
true
,
rule_String
);
}
}
/**
* 用于执行下单送券
* @param uid 得券人uid
...
...
src/main/java/com/ctrip/fun/golf/service/order/CommuneOrderService.java
View file @
044fdab5
...
...
@@ -361,7 +361,11 @@ public class CommuneOrderService extends AbstractOrderService<CommuneOrderBean,
}
else
{
getUserExtDao
().
setUserExtVipGradeRenewCommune
(
order
.
getUid
());
operationMessageService
.
executeSendMessageOfVipCommune
(
order
,
110
);
try
{
this
.
getVoucherService
().
sendVoucherFor360PlaceOrder
(
order
.
getUid
(),
order
.
getOrderId
()+
""
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}
...
...
src/main/java/com/ctrip/fun/golf/service/payment/CommuneNotifyService.java
View file @
044fdab5
...
...
@@ -8,6 +8,7 @@ import java.util.Map;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.CollectionUtils
;
import
com.ctrip.fun.common.core.util.DateUtil
;
import
com.ctrip.fun.common.vo.order.OrderCategoryEnum
;
import
com.ctrip.fun.golf.dao.market.CommuneInviteActivityDao
;
import
com.ctrip.fun.golf.dao.order.CommuneOrderItemDao
;
...
...
@@ -68,7 +69,7 @@ public class CommuneNotifyService extends AbstractNotifyService {
}
}
else
if
(
order
.
getAmount
().
intValue
()==
360
){
//1:执行续费人的小程序送券
voucherService
.
sendVoucherFor
PlaceOrder
(
uid
,
order
.
getOrderId
()+
""
,
true
,
"chongzhiren_voucher_send_360"
);
voucherService
.
sendVoucherFor
360PlaceOrder
(
order
.
getUid
(),
order
.
getOrderId
()+
""
);
}
}
}
...
...
@@ -113,6 +114,13 @@ public class CommuneNotifyService extends AbstractNotifyService {
}
else
{
getUserExtDao
().
setUserExtVipGradeRenewCommune
(
order
.
getUid
());
sendMessage
(
order
,
110
);
//1:执行续费送券逻辑
try
{
voucherService
.
sendVoucherFor360PlaceOrder
(
order
.
getUid
(),
order
.
getOrderId
()+
""
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}
...
...
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