|
|
|
@ -4,11 +4,7 @@ import au.com.royalpay.payment.core.PaymentApi;
|
|
|
|
|
import au.com.royalpay.payment.core.exceptions.InvalidShortIdException;
|
|
|
|
|
import au.com.royalpay.payment.core.tasksupport.SettlementSupport;
|
|
|
|
|
import au.com.royalpay.payment.manage.management.clearing.core.CleanService;
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.log.ClearingDetailAnalysisMapper;
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.log.ClearingDetailMapper;
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.log.ClearingLogMapper;
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.log.LogSettleMailMapper;
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.log.ValidationLogMapper;
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.log.*;
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.payment.TaskManualSettleMapper;
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper;
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.*;
|
|
|
|
@ -34,16 +30,15 @@ import au.com.royalpay.payment.tools.locale.LocaleSupport;
|
|
|
|
|
import au.com.royalpay.payment.tools.lock.Locker;
|
|
|
|
|
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
|
|
|
|
|
import au.com.royalpay.payment.tools.tasksupport.TaskFinishNotifyEvent;
|
|
|
|
|
import au.com.royalpay.payment.tools.utils.DateVaildUtil;
|
|
|
|
|
import au.com.royalpay.payment.tools.utils.PageListUtils;
|
|
|
|
|
import au.com.royalpay.payment.tools.utils.TimeZoneUtils;
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.github.miemiedev.mybatis.paginator.domain.Order;
|
|
|
|
|
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
|
|
|
|
|
import com.github.miemiedev.mybatis.paginator.domain.PageList;
|
|
|
|
|
|
|
|
|
|
import org.apache.commons.codec.binary.Base64;
|
|
|
|
|
import org.apache.commons.csv.CSVFormat;
|
|
|
|
|
import org.apache.commons.csv.CSVPrinter;
|
|
|
|
@ -52,12 +47,7 @@ import org.apache.commons.lang3.RandomStringUtils;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import org.apache.commons.lang3.time.DateFormatUtils;
|
|
|
|
|
import org.apache.commons.lang3.time.DateUtils;
|
|
|
|
|
import org.apache.poi.ss.usermodel.Cell;
|
|
|
|
|
import org.apache.poi.ss.usermodel.CellStyle;
|
|
|
|
|
import org.apache.poi.ss.usermodel.Font;
|
|
|
|
|
import org.apache.poi.ss.usermodel.Row;
|
|
|
|
|
import org.apache.poi.ss.usermodel.Sheet;
|
|
|
|
|
import org.apache.poi.ss.usermodel.Workbook;
|
|
|
|
|
import org.apache.poi.ss.usermodel.*;
|
|
|
|
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
|
|
|
import org.joda.time.DateTime;
|
|
|
|
|
import org.joda.time.Days;
|
|
|
|
@ -75,37 +65,20 @@ import org.springframework.util.CollectionUtils;
|
|
|
|
|
import org.thymeleaf.context.Context;
|
|
|
|
|
import org.thymeleaf.spring4.SpringTemplateEngine;
|
|
|
|
|
|
|
|
|
|
import java.io.BufferedWriter;
|
|
|
|
|
import java.io.ByteArrayOutputStream;
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
import java.io.OutputStream;
|
|
|
|
|
import java.io.OutputStreamWriter;
|
|
|
|
|
import java.io.PrintWriter;
|
|
|
|
|
import java.io.Writer;
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
import java.io.*;
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
|
import java.math.RoundingMode;
|
|
|
|
|
import java.net.URISyntaxException;
|
|
|
|
|
import java.text.DecimalFormat;
|
|
|
|
|
import java.text.NumberFormat;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Calendar;
|
|
|
|
|
import java.util.Currency;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.GregorianCalendar;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Locale;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.Objects;
|
|
|
|
|
import java.util.TreeMap;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
import java.util.zip.ZipEntry;
|
|
|
|
|
import java.util.zip.ZipOutputStream;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
|
|
|
|
import static au.com.royalpay.payment.manage.permission.utils.OrgCheckUtils.checkOrgPermission;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -163,7 +136,7 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private ClientDeviceMapper clientDeviceMapper;
|
|
|
|
|
|
|
|
|
|
private static final int MAX_TRACK_DAYS = 31;
|
|
|
|
|
@Value("${app.settlement.email-to}")
|
|
|
|
|
private String settlementEmailTo;
|
|
|
|
|
@Value("${app.settlement.email-cc}")
|
|
|
|
@ -627,9 +600,9 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
|
|
|
|
|
@Override
|
|
|
|
|
public JSONObject getCleanLogsInClients(ClearingLogQuery query, JSONObject manager) {
|
|
|
|
|
JSONObject params = query.toParams();
|
|
|
|
|
DateVaildUtil.validDateDuration(params.getDate("from"), params.getDate("to"), MAX_TRACK_DAYS);
|
|
|
|
|
if (query.getClientMoniker() != null && !query.getClientMoniker().isEmpty()) {
|
|
|
|
|
JSONObject client = clientManager.getClientInfoByMoniker(query.getClientMoniker());
|
|
|
|
|
Assert.notNull(client);
|
|
|
|
|
}
|
|
|
|
|
if (manager.getInteger("org_id") != null) {
|
|
|
|
|
params.put("org_id", manager.getIntValue("org_id"));
|
|
|
|
@ -642,9 +615,9 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
|
|
|
|
|
@Override
|
|
|
|
|
public JSONObject analysisCleanLogs(ClearingLogQuery query, JSONObject manager) {
|
|
|
|
|
JSONObject params = query.toParams();
|
|
|
|
|
DateVaildUtil.validDateDuration(params.getDate("from"), params.getDate("to"), MAX_TRACK_DAYS);
|
|
|
|
|
if (query.getClientMoniker() != null && !query.getClientMoniker().isEmpty()) {
|
|
|
|
|
JSONObject client = clientManager.getClientInfoByMoniker(query.getClientMoniker());
|
|
|
|
|
Assert.notNull(client);
|
|
|
|
|
}
|
|
|
|
|
if (manager.getInteger("org_id") != null) {
|
|
|
|
|
params.put("org_id", manager.getIntValue("org_id"));
|
|
|
|
|