parent
0681a81bb4
commit
4901bd8b1c
@ -0,0 +1,26 @@
|
||||
package au.com.royalpay.payment.manage.management.clearing.handlers;
|
||||
|
||||
import au.com.royalpay.payment.core.events.SettleNotifySendingEvent;
|
||||
import au.com.royalpay.payment.manage.management.clearing.core.SettleDelayConfigurer;
|
||||
import org.apache.commons.lang3.time.DateUtils;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* Create by yixian at 2017-12-25 13:48
|
||||
*/
|
||||
@Service
|
||||
public class SendWeekendDelayCashbackSaver implements ApplicationListener<SettleNotifySendingEvent> {
|
||||
@Resource
|
||||
private SettleDelayConfigurer settleDelayConfigurer;
|
||||
|
||||
@Override
|
||||
public void onApplicationEvent(SettleNotifySendingEvent event) {
|
||||
Date eventTime = new Date(event.getEventTime());
|
||||
settleDelayConfigurer.addCashback(DateUtils.truncate(eventTime, Calendar.DATE));
|
||||
}
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
package au.com.royalpay.payment.manage.management.clearing.core;
|
||||
|
||||
import au.com.royalpay.payment.manage.appclient.core.RetailAppService;
|
||||
import au.com.royalpay.payment.manage.cashback.core.CashbackService;
|
||||
import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper;
|
||||
import au.com.royalpay.payment.manage.mappers.system.ClientSettleDelayConfMapper;
|
||||
import au.com.royalpay.payment.manage.merchants.core.ClientManager;
|
||||
import au.com.royalpay.payment.tools.CommonConsts;
|
||||
import au.com.royalpay.payment.tools.env.PlatformEnvironment;
|
||||
import au.com.royalpay.payment.tools.utils.CurrencyAmountUtils;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
|
||||
import org.apache.commons.lang3.RandomStringUtils;
|
||||
import org.apache.commons.lang3.time.DateFormatUtils;
|
||||
import org.apache.commons.lang3.time.DateUtils;
|
||||
import org.joda.time.DateTime;
|
||||
import org.junit.Test;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.test.annotation.Commit;
|
||||
import org.springframework.test.context.ActiveProfiles;
|
||||
import org.springframework.test.context.TestPropertySource;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.text.ParseException;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* Create by yixian at 2018-01-15 16:03
|
||||
*/
|
||||
@ActiveProfiles("proxy")
|
||||
@TestPropertySource(properties = "app.debug=false")
|
||||
@Commit
|
||||
public class SettleDelayCashbackForNewYearDay {
|
||||
|
||||
@Resource
|
||||
private ClientManager clientManager;
|
||||
@Resource
|
||||
private TransactionMapper transactionMapper;
|
||||
@Resource
|
||||
private CashbackService cashbackService;
|
||||
@Resource
|
||||
private RetailAppService retailAppService;
|
||||
@Resource
|
||||
private ClientSettleDelayConfMapper clientSettleDelayConfMapper;
|
||||
private Logger logger = LoggerFactory.getLogger(getClass());
|
||||
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void addCashback() throws ParseException {
|
||||
}
|
||||
|
||||
private void processCashback(Date date, List<JSONObject> cashbackNotices, String clientMoniker, int clientId, List<JSONObject> transactions) {
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package au.com.royalpay.payment.manage.management.clearing.core;
|
||||
|
||||
import org.joda.time.DateTime;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.annotation.Commit;
|
||||
import org.springframework.test.context.ActiveProfiles;
|
||||
import org.springframework.test.context.TestPropertySource;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Create by yixian at 2018-01-15 15:59
|
||||
*/
|
||||
@SpringBootTest
|
||||
@RunWith(SpringRunner.class)
|
||||
@ActiveProfiles("proxy")
|
||||
@TestPropertySource(properties = "app.debug=false")
|
||||
@Commit
|
||||
public class SettleDelayConfigurerTest {
|
||||
@Resource
|
||||
private SettleDelayConfigurer settleDelayConfigurer;
|
||||
|
||||
@Test
|
||||
public void addCashback() {
|
||||
settleDelayConfigurer.addCashback(DateTime.parse("2018-01-09").toDate());
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in new issue