|
|
|
@ -22,6 +22,7 @@ import org.apache.poi.hssf.usermodel.HSSFFont;
|
|
|
|
|
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
|
|
|
|
import org.apache.poi.hssf.util.HSSFColor;
|
|
|
|
|
import org.apache.poi.ss.usermodel.*;
|
|
|
|
|
import org.joda.time.DateTime;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
|
@ -259,10 +260,10 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService {
|
|
|
|
|
@Transactional
|
|
|
|
|
public void generateold(String monthStr) {
|
|
|
|
|
Date mon = checkMonth(monthStr);
|
|
|
|
|
Calendar monthCal = Calendar.getInstance();
|
|
|
|
|
monthCal.setTime(mon);
|
|
|
|
|
int year = monthCal.get(Calendar.YEAR);
|
|
|
|
|
int month = monthCal.get(Calendar.MONTH) + 1;
|
|
|
|
|
DateTime begin = new DateTime(mon);
|
|
|
|
|
DateTime end = begin.plusMonths(1);
|
|
|
|
|
int year = begin.getYear();
|
|
|
|
|
int month = begin.getMonthOfYear();
|
|
|
|
|
|
|
|
|
|
JSONObject sysConfig = sysConfigManager.getSysConfig();
|
|
|
|
|
BigDecimal alipayChargeRate = new BigDecimal("0.6");
|
|
|
|
@ -286,7 +287,7 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService {
|
|
|
|
|
channelMap.put("Wechat", "Wechat");
|
|
|
|
|
channelMap.put("AlipayOnline", "AlipayOnline");
|
|
|
|
|
Set<Integer> orgIds = new HashSet<>();
|
|
|
|
|
List<JSONObject> transactionAnalysis = transactionMapper.listTransactionsForCityPartnerCommission(year, month);
|
|
|
|
|
List<JSONObject> transactionAnalysis = transactionMapper.listTransactionsForCityPartnerCommission(begin.toDate(), end.toDate());
|
|
|
|
|
Map<String, CityPartnerCommissionAnalysis> results = new HashMap<>();
|
|
|
|
|
for (JSONObject analysisDay : transactionAnalysis) {
|
|
|
|
|
int orgId = analysisDay.getIntValue("org_id");
|
|
|
|
@ -339,10 +340,10 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService {
|
|
|
|
|
@Transactional
|
|
|
|
|
public void generate(String monthStr) {
|
|
|
|
|
Date mon = checkMonth(monthStr);
|
|
|
|
|
Calendar monthCal = Calendar.getInstance();
|
|
|
|
|
monthCal.setTime(mon);
|
|
|
|
|
int year = monthCal.get(Calendar.YEAR);
|
|
|
|
|
int month = monthCal.get(Calendar.MONTH) + 1;
|
|
|
|
|
DateTime begin = new DateTime(mon);
|
|
|
|
|
DateTime end = begin.plusMonths(1);
|
|
|
|
|
int year = begin.getYear();
|
|
|
|
|
int month = begin.getMonthOfYear();
|
|
|
|
|
|
|
|
|
|
// List<JSONObject> list = financialPartnerCommissionMapper.list(year, month);
|
|
|
|
|
// if (list != null && !list.isEmpty()) {
|
|
|
|
@ -374,8 +375,7 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService {
|
|
|
|
|
channelCharge.put("wechatChargeRate", wechatChargeRate);
|
|
|
|
|
channelCharge.put("jdChargeRate", jdChargeRate);
|
|
|
|
|
channelCharge.put("alipayonlineChargeRate", alipayonlineChargeRate);
|
|
|
|
|
|
|
|
|
|
List<JSONObject> transactionDetail = transactionMapper.listTransactionForCityPartnerCommissionByDate(year, month);
|
|
|
|
|
List<JSONObject> transactionDetail = transactionMapper.listTransactionForCityPartnerCommissionByDate(begin.toDate(), end.toDate());
|
|
|
|
|
transactionDetail.forEach(item -> {
|
|
|
|
|
if (StringUtils.equalsIgnoreCase("AlipayPlus", item.getString("channel"))) {
|
|
|
|
|
item.put("channel", item.getString("pay_type"));
|
|
|
|
@ -763,15 +763,15 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService {
|
|
|
|
|
@Transactional
|
|
|
|
|
public void generateReferrer(String monthStr) {
|
|
|
|
|
Date mon = checkMonth(monthStr);
|
|
|
|
|
Calendar monthCal = Calendar.getInstance();
|
|
|
|
|
monthCal.setTime(mon);
|
|
|
|
|
int year = monthCal.get(Calendar.YEAR);
|
|
|
|
|
int month = monthCal.get(Calendar.MONTH) + 1;
|
|
|
|
|
DateTime begin = new DateTime(mon);
|
|
|
|
|
DateTime end = begin.plusMonths(1);
|
|
|
|
|
int year = begin.getYear();
|
|
|
|
|
int month = begin.getMonthOfYear();
|
|
|
|
|
|
|
|
|
|
financialReferrerCommissionDetailMapper.clearData(year, month);
|
|
|
|
|
financialReferrerCommissionMapper.clearData(year, month);
|
|
|
|
|
|
|
|
|
|
List<JSONObject> transactionAnalysis = transactionMapper.listTransactionsForReferrerCommission(year, month);
|
|
|
|
|
List<JSONObject> transactionAnalysis = transactionMapper.listTransactionsForReferrerCommission(begin.toDate(), end.toDate());
|
|
|
|
|
Map<Integer, ReferrerCommissionAnalysis> results = new HashMap<>();
|
|
|
|
|
for (JSONObject analysisDay : transactionAnalysis) {
|
|
|
|
|
Integer orgId = analysisDay.getInteger("org_id");
|
|
|
|
@ -850,14 +850,15 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService {
|
|
|
|
|
public void generateAgent(String monthStr, JSONObject channelCharge) {
|
|
|
|
|
|
|
|
|
|
Date mon = checkMonth(monthStr);
|
|
|
|
|
Calendar monthCal = Calendar.getInstance();
|
|
|
|
|
monthCal.setTime(mon);
|
|
|
|
|
int year = monthCal.get(Calendar.YEAR);
|
|
|
|
|
int month = monthCal.get(Calendar.MONTH) + 1;
|
|
|
|
|
DateTime begin = new DateTime(mon);
|
|
|
|
|
DateTime end = begin.plusMonths(1);
|
|
|
|
|
int year = begin.getYear();
|
|
|
|
|
int month = begin.getMonthOfYear();
|
|
|
|
|
|
|
|
|
|
financialAgentCommissionMapper.clearData(year, month);
|
|
|
|
|
financialAgentCommissionDetailMapper.clearData(year, month);
|
|
|
|
|
List<JSONObject> transactionDetail = transactionMapper.listTransactionForCityPartnerAgentCommissionByDate(year, month);
|
|
|
|
|
|
|
|
|
|
List<JSONObject> transactionDetail = transactionMapper.listTransactionForCityPartnerAgentCommissionByDate(begin.toDate(), end.toDate());
|
|
|
|
|
transactionDetail.forEach(item -> {
|
|
|
|
|
if (StringUtils.equalsIgnoreCase("AlipayPlus", item.getString("channel"))) {
|
|
|
|
|
item.put("channel", item.getString("pay_type"));
|
|
|
|
|