抽奖弹窗

master
taylor.dang 6 years ago
parent c0690d1307
commit db7f25ec81

@ -23,6 +23,8 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.TimeZone;
@ -284,8 +286,19 @@ public class CustomerPointsServiceImp implements CustomerPointsService {
public BigDecimal checkLotteryAfterPay(String order_id) {
JSONObject order = transactionAnalysisMapper.getOrderClearAmount(order_id);
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 BigDecimal.valueOf(0);
}
if (newDay.compareTo(sdf.parse("2018-10-15 00:00:00")) > 0) {
return BigDecimal.valueOf(0);
}
} catch (ParseException e) {
}
}
return order.getBigDecimal("clearing_amount");
}

Loading…
Cancel
Save