|
|
|
@ -28,6 +28,8 @@ import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
|
|
|
|
|
import org.apache.commons.lang3.time.DateFormatUtils;
|
|
|
|
|
import org.apache.commons.lang3.time.DateUtils;
|
|
|
|
|
import org.joda.time.DateTime;
|
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
@ -79,6 +81,7 @@ public class BDPrizeServiceImpl implements BDPrizeService {
|
|
|
|
|
private static BigDecimal percent = new BigDecimal(100);
|
|
|
|
|
|
|
|
|
|
private static String[] channels = new String[]{"Wechat", "Alipay", "Bestpay", "jd", "AlipayOnline","hf"};
|
|
|
|
|
private static Logger logger = LoggerFactory.getLogger(BDPrizeServiceImpl.class);
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void generateRecord(String month) {
|
|
|
|
@ -125,10 +128,12 @@ public class BDPrizeServiceImpl implements BDPrizeService {
|
|
|
|
|
.clientsWithBDAwayDeterminor(new DefaultClientWithBDAwayDeterminor(clientsWithBDAway)).rateConfig(rateConfig);
|
|
|
|
|
calculator.calculate();
|
|
|
|
|
List<JSONObject> report = calculator.getReport(now.get(Calendar.YEAR),now.get(Calendar.MONTH) + 1);
|
|
|
|
|
logger.info("======calculator.report=========="+channel+"===="+report.toString());
|
|
|
|
|
for (JSONObject log : report) {
|
|
|
|
|
log.put("record_id", record.getString("record_id"));
|
|
|
|
|
log.put("channel", channel);
|
|
|
|
|
log.remove("prize_log_id");
|
|
|
|
|
logger.info("=========financialBDPrizeLogMapper.save======="+log.toString());
|
|
|
|
|
financialBDPrizeLogMapper.save(log);
|
|
|
|
|
List<JSONObject> details = (List<JSONObject>) log.get("details");
|
|
|
|
|
for (JSONObject detail : details) {
|
|
|
|
|