开放其他商户参与活动

master
yangkai 6 years ago
parent e6564c9ada
commit 351efaaec2

@ -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,9 +42,20 @@ 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) {
return;
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");

Loading…
Cancel
Save