|
|
@ -17,6 +17,7 @@ import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
|
|
|
|
import com.github.miemiedev.mybatis.paginator.domain.PageList;
|
|
|
|
import com.github.miemiedev.mybatis.paginator.domain.PageList;
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
import org.apache.commons.lang3.time.DateFormatUtils;
|
|
|
|
import org.apache.commons.lang3.time.DateFormatUtils;
|
|
|
|
|
|
|
|
import org.apache.commons.lang3.time.DateUtils;
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
@ -174,7 +175,7 @@ public class PlatformClearAnalysisServiceImpl implements PlatformClearService {
|
|
|
|
params.put("settlement_fee", settleFee.getBigDecimal("settlement_fee"));
|
|
|
|
params.put("settlement_fee", settleFee.getBigDecimal("settlement_fee"));
|
|
|
|
params.put("channel", channel);
|
|
|
|
params.put("channel", channel);
|
|
|
|
params.put("last_update_date", new Date());
|
|
|
|
params.put("last_update_date", new Date());
|
|
|
|
JSONObject sysClearData = getSystemClearingAmount(dateStr, null, channel);
|
|
|
|
JSONObject sysClearData = getSystemClearingAmount(dateStr, aliSettleLog, channel);
|
|
|
|
if (sysClearData != null && sysClearData.size() > 0) {
|
|
|
|
if (sysClearData != null && sysClearData.size() > 0) {
|
|
|
|
params.put("sys_pay_fee", sysClearData.getBigDecimal("sys_pay_fee"));
|
|
|
|
params.put("sys_pay_fee", sysClearData.getBigDecimal("sys_pay_fee"));
|
|
|
|
params.put("sys_refund_fee", sysClearData.getBigDecimal("sys_refund_fee"));
|
|
|
|
params.put("sys_refund_fee", sysClearData.getBigDecimal("sys_refund_fee"));
|
|
|
@ -292,22 +293,26 @@ public class PlatformClearAnalysisServiceImpl implements PlatformClearService {
|
|
|
|
return alipaySettleLog;
|
|
|
|
return alipaySettleLog;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public JSONObject getSystemClearingAmount(Date settle_date, SettlementLog settlementLog, String channel) throws Exception {
|
|
|
|
public JSONObject getSystemClearingAmount(Date settle_date, Object settlementLog, String channel) throws Exception {
|
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd 02:00:00");
|
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd 02:00:00");
|
|
|
|
JSONObject sysLogs = new JSONObject();
|
|
|
|
JSONObject sysLogs = new JSONObject();
|
|
|
|
String start_date = null;
|
|
|
|
String start_date = null;
|
|
|
|
String end_date = null;
|
|
|
|
String end_date = null;
|
|
|
|
if (StringUtils.equals("Alipay", channel)) {
|
|
|
|
if (StringUtils.equals("Alipay", channel)) {
|
|
|
|
|
|
|
|
|
|
|
|
JSONObject lastClearDay = estimateAnalysisMapper.findLastCleanDays(sdfClear.format(settle_date), 1);
|
|
|
|
JSONObject lastClearDay = estimateAnalysisMapper.findLastCleanDays(sdfClear.format(settle_date), 1);
|
|
|
|
start_date = sdf.format(lastClearDay.getDate("date_str"));
|
|
|
|
start_date = sdf.format(lastClearDay.getDate("date_str"));
|
|
|
|
end_date = sdf.format(settle_date);
|
|
|
|
end_date = sdf.format(settle_date);
|
|
|
|
logger.info("Alipay System Settle Logs:"+start_date+"<====>" +end_date);
|
|
|
|
logger.info("Alipay System Settle Logs:" + start_date + "<====>" + end_date);
|
|
|
|
|
|
|
|
|
|
|
|
} else if (StringUtils.equals("Wechat", channel)) {
|
|
|
|
} else if (StringUtils.equals("Wechat", channel)) {
|
|
|
|
start_date = sdf.format(settlementLog.getStart());
|
|
|
|
SettlementLog wechatSettleLog = (SettlementLog) settlementLog;
|
|
|
|
end_date = sdf.format(settlementLog.getEnd());
|
|
|
|
start_date = sdf.format(wechatSettleLog.getStart());
|
|
|
|
logger.info("Wechat System Settle Logs:"+start_date+"<====>" +end_date);
|
|
|
|
end_date = sdf.format(wechatSettleLog.getEnd());
|
|
|
|
|
|
|
|
logger.info("Wechat System Settle Logs:" + start_date + "<====>" + end_date);
|
|
|
|
|
|
|
|
} else if (StringUtils.equals("AlipayOnline", channel)) {
|
|
|
|
|
|
|
|
JSONObject alipayOnlineSettleLog = (JSONObject) settlementLog;
|
|
|
|
|
|
|
|
logger.info("AlipayOnline System Settle Logs:" + alipayOnlineSettleLog.getDate("min_time") + "<====>" + alipayOnlineSettleLog.getDate("max_time"));
|
|
|
|
|
|
|
|
start_date = sdf.format(alipayOnlineSettleLog.getDate("min_time"));
|
|
|
|
|
|
|
|
end_date = sdf.format(DateUtils.addDays(alipayOnlineSettleLog.getDate("max_time"), 1));
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|