master
eason 6 years ago
parent 630e7940d5
commit 5dfcefeeaa

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

Loading…
Cancel
Save