|
|
|
@ -17,6 +17,9 @@ import org.springframework.web.util.UriComponentsBuilder;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
|
import java.text.ParseException;
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
|
|
|
|
|
@Service
|
|
|
|
|
public class CustomerLotteryCountServiceImpl implements ApplicationListener<AfterPaymentFinishEvent> {
|
|
|
|
@ -39,10 +42,21 @@ public class CustomerLotteryCountServiceImpl implements ApplicationListener<Afte
|
|
|
|
|
@Override
|
|
|
|
|
public void onApplicationEvent(AfterPaymentFinishEvent event) {
|
|
|
|
|
final JSONObject order = event.getFinishedEvent().getOrder();
|
|
|
|
|
//只允许pine商户参与该活动
|
|
|
|
|
//判断是否是pine测试商户,若不是则判断是否在活动时间
|
|
|
|
|
if (order.getIntValue("client_id") != 9) {
|
|
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
|
|
|
|
|
Date newDay = new Date();
|
|
|
|
|
try {
|
|
|
|
|
if (newDay.compareTo(sdf.parse("2018-09-24 00:00:00")) < 0) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (newDay.compareTo(sdf.parse("2018-10-15 00:00:00")) > 0) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
} catch (ParseException e) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
BigDecimal clearAmount = event.getFinishedEvent().getAudFee();
|
|
|
|
|
String channel = order.getString("channel");
|
|
|
|
|
if ("Wechat".equals(channel)) {
|
|
|
|
|