diff --git a/pom.xml b/pom.xml index 0af9025e3..a3ca784e9 100644 --- a/pom.xml +++ b/pom.xml @@ -5,11 +5,11 @@ au.com.royalpay.payment payment-parent - 2.2.24 + 2.2.25 4.0.0 manage - 2.3.75 + 2.3.76-SNAPSHOT UTF-8 2.4.0 diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/PlatformClearAnalysisServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/PlatformClearAnalysisServiceImpl.java index 556e514d1..32ce78bd2 100644 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/PlatformClearAnalysisServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/PlatformClearAnalysisServiceImpl.java @@ -164,7 +164,7 @@ public class PlatformClearAnalysisServiceImpl implements PlatformClearService { @Transactional public void doVerifyAlipaySettleLog(Date dateStr) throws Exception { - JSONObject aliSettleLog = alipayClient.downloadRetailSettlements(dateStr); + JSONObject aliSettleLog = alipayClient.oldDownloadRetailSettlements(dateStr); saveAlipaySettleLog(dateStr, aliSettleLog, "Alipay"); } diff --git a/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/ChannelReconciliationFile.java b/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/ChannelReconciliationFile.java new file mode 100644 index 000000000..f1a26bf68 --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/ChannelReconciliationFile.java @@ -0,0 +1,123 @@ +package au.com.royalpay.payment.manage.management.channelreconciliationfile; + +import au.com.royalpay.payment.core.ChannelBillValidator; +import au.com.royalpay.payment.core.beans.ChannelBillPackage; +import au.com.royalpay.payment.core.exceptions.ChannelNotSupportedException; +import au.com.royalpay.payment.tools.defines.PayChannel; +import com.github.miemiedev.mybatis.paginator.domain.PageList; +import org.apache.commons.io.IOUtils; +import org.springframework.stereotype.Component; +import org.thymeleaf.util.ListUtils; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.stream.Collectors; +import java.util.zip.ZipEntry; +import java.util.zip.ZipOutputStream; + +/** + * @Description + * @title: 渠道对账文件 + * @Date 2020/11/5 15:06 + * @author: zhangTao + */ +@Component +public class ChannelReconciliationFile { + + private ChannelReconciliationFileTunnel tunnel; + private final Map validatorMap ; + + public ChannelReconciliationFile(ChannelReconciliationFileTunnel tunnel ,ChannelBillValidator[] validators) { + this.tunnel = tunnel; + validatorMap = Arrays.stream(validators).collect(Collectors.toMap(ChannelBillValidator::payChannel,channelBillValidator -> channelBillValidator)); + } + + public PageList list(ChannelReconciliationFileQueryParameter channelReconciliationFileQueryParameter) { + return this.tunnel.list(channelReconciliationFileQueryParameter); + } + + + public ChannelReconciliationFileContent download(ChannelReconciliationFileDownloadParameter from) { + Optional> channel = findChannels(from.getChannel()); + + if (!channel.isPresent()) { + throw new ChannelNotSupportedException(); + } + + Map.Entry channelChannelBillValidatorEntry = channel.get(); + + ChannelBillValidator channelBillValidator = channelChannelBillValidatorEntry.getValue(); + + List channelBillPackageList = selectTypeDown(from ,channelBillValidator); + + if (isNull(channelBillPackageList)) { + throw new ChannelReconciliationFileEmptyException(); + } + + + if (isMultiFile(channelBillPackageList)) { + return genMultiFile(channelBillPackageList); + } + + return genSingleFile(channelBillPackageList.get(0)); + } + + private List selectTypeDown(ChannelReconciliationFileDownloadParameter from, ChannelBillValidator channelBillValidator) { + + if (from.billType().equals("SETTLEMENT")){ + return channelBillValidator + .downloadRawSettlementFiles(from.pid(), from.billDate(), from.isUseCash()); + + } + return channelBillValidator.downloadRawTransactionFiles(from.pid(), from.billDate(), from.isUseCash()); + + } + + private boolean isMultiFile(List channelBillPackageList) { + return channelBillPackageList.size() > 1; + } + + private boolean isNull(List channelBillPackageList){ + return ListUtils.isEmpty(channelBillPackageList); + } + + private ChannelReconciliationFileContent genSingleFile(ChannelBillPackage channelBillPackage) { + return ChannelReconciliationFileContent.instance(channelBillPackage.getFilename(), + channelBillPackage.getBillContent()); + } + + private ChannelReconciliationFileContent genMultiFile(List channelBillPackageList) { + try (ByteArrayOutputStream stream = new ByteArrayOutputStream(); ZipOutputStream zipOutputStream = new ZipOutputStream(stream)) { + + channelBillPackageList.forEach(bill -> toZipOutputStream(bill, zipOutputStream)); + + zipOutputStream.close(); + stream.close(); + return ChannelReconciliationFileContent.instance("reconciliationFile.zip", stream.toByteArray()); + } catch (IOException e) { + throw new MultiFileChannelReconciliationException(); + } + } + + private void toZipOutputStream(ChannelBillPackage channelBillPackage ,ZipOutputStream zipOutputStream){ + try (ByteArrayInputStream fis = new ByteArrayInputStream(channelBillPackage.getBillContent())) { + ZipEntry zipEntryXtv = new ZipEntry(channelBillPackage.getFilename()); + zipOutputStream.putNextEntry(zipEntryXtv); + IOUtils.copy(fis, zipOutputStream); + } catch (Exception e) { + e.printStackTrace(); + } + } + + + private Optional> findChannels(String channel) { + return validatorMap.entrySet().stream().filter(entry -> channel.equals(entry.getKey().getChannelCode())).findAny(); + } + + +} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/ChannelReconciliationFileContent.java b/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/ChannelReconciliationFileContent.java new file mode 100644 index 000000000..78510f04b --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/ChannelReconciliationFileContent.java @@ -0,0 +1,66 @@ +package au.com.royalpay.payment.manage.management.channelreconciliationfile; + + +import org.apache.commons.io.FilenameUtils; + +/** + * 渠道对账文件内容 + * @Date 2020/11/5 17:21 + * @author: zhangTao + */ +public class ChannelReconciliationFileContent { + + private static String SUFFIX =".txt"; + private final FileName fileName; + private final byte[] content; + + private ChannelReconciliationFileContent(String fileName, byte[] content) { + this.fileName = new FileName(fileName) ; + this.content = content; + } + + public String name() { + return this.fileName.getName(); + } + + + public int length() { + return this.content.length; + } + + public byte[] content() { + return this.content; + } + + public static ChannelReconciliationFileContent instance(String fileName, byte[] billContent) { + if (!checkFileName(fileName)){ + fileName = fileName+SUFFIX; + // throw new ChannelReconciliationFileNameSuffixException(); + } + return new ChannelReconciliationFileContent(fileName, billContent); + } + + private static boolean checkFileName(String fileName) { + return fileName.contains("."); + } + + private class FileName { + + private final String name; + private final String type; + + public FileName(String name) { + this.name = name; + this.type = FilenameUtils.getExtension(name); + } + + public String getName() { + return name; + } + + public String getType() { + return type; + } + } + +} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/ChannelReconciliationFileDTO.java b/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/ChannelReconciliationFileDTO.java new file mode 100644 index 000000000..3cb10dfd4 --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/ChannelReconciliationFileDTO.java @@ -0,0 +1,49 @@ +package au.com.royalpay.payment.manage.management.channelreconciliationfile; + +import lombok.Data; + +/** + * @Description + * @title: + * @Date 2020/11/4 16:40 + * @author: zhangTao + */ +@Data +public class ChannelReconciliationFileDTO { + + + private String batchId; + /** + * + */ + private String channel; + /** + * + */ + private String pid; + /** + * + */ + private String billDate; + /** + * + */ + private String billType; + /** + * + */ + private String createTime; + + private String fileId; + + + private String filename; + + private String fileType; + + private String attachId; + /** + * + */ + private String attachUrl; +} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/ChannelReconciliationFileDownloadParameter.java b/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/ChannelReconciliationFileDownloadParameter.java new file mode 100644 index 000000000..2810248e9 --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/ChannelReconciliationFileDownloadParameter.java @@ -0,0 +1,51 @@ +package au.com.royalpay.payment.manage.management.channelreconciliationfile; + +import java.util.Date; + +/** + * @Description + * @title: + * @Date 2020/11/16 14:42 + * @author: zhangTao + */ +public class ChannelReconciliationFileDownloadParameter { + private DownloadParameter parameter; + private boolean useCashFlag; + + public ChannelReconciliationFileDownloadParameter(String pid, Date billDate, String channel, boolean isUseCash,String billType) { + this.parameter = new DownloadParameter(pid, billDate, channel,billType); + this.useCashFlag = isUseCash; + } + + public String getChannel() { + return this.parameter.channel; + } + + public boolean isUseCash() { + return this.useCashFlag; + } + + public String pid(){ + return this.parameter.pid; + } + public Date billDate(){ + return this.parameter.billDate; + } + public String billType(){ + return this.parameter.billType; + } + + + private static class DownloadParameter { + private String pid; + private String channel; + private Date billDate; + private String billType; + public DownloadParameter(String pid, Date billDate, String channel,String billType) { + this.pid = pid; + this.billDate = billDate; + this.channel = channel; + this.billType = billType; + } + } +} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/ChannelReconciliationFileEmptyException.java b/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/ChannelReconciliationFileEmptyException.java new file mode 100644 index 000000000..bed1072e1 --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/ChannelReconciliationFileEmptyException.java @@ -0,0 +1,15 @@ +package au.com.royalpay.payment.manage.management.channelreconciliationfile; + +/** + * @Description + * @title: + * @Date 2020/11/12 11:27 + * @author: zhangTao + */ +public class ChannelReconciliationFileEmptyException extends RuntimeException { + + public ChannelReconciliationFileEmptyException() { + super("渠道对账文件查询为空"); + } + +} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/ChannelReconciliationFileNameSuffixException.java b/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/ChannelReconciliationFileNameSuffixException.java new file mode 100644 index 000000000..bdcf5977d --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/ChannelReconciliationFileNameSuffixException.java @@ -0,0 +1,12 @@ +package au.com.royalpay.payment.manage.management.channelreconciliationfile; + +/** + * @Description + * @title: + * @Date 2020/11/19 18:35 + * @author: zhangTao + */ +public class ChannelReconciliationFileNameSuffixException extends RuntimeException { + + +} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/ChannelReconciliationFileQueryParameter.java b/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/ChannelReconciliationFileQueryParameter.java new file mode 100644 index 000000000..744f45446 --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/ChannelReconciliationFileQueryParameter.java @@ -0,0 +1,35 @@ +package au.com.royalpay.payment.manage.management.channelreconciliationfile; + + +import au.com.royalpay.payment.manage.management.channelreconciliationfile.common.TimeRangeAndPageSizeQueryParameter; + +/** + * @Description + * @title: 渠道对账文件查询参数 + * @Date 2020/11/16 11:54 + * @author: zhangTao + */ +public class ChannelReconciliationFileQueryParameter { + + private TimeRangeAndPageSizeQueryParameter timeRangeAndPageSizeQueryParameter; + private String channel; + private String billType; + + public ChannelReconciliationFileQueryParameter(TimeRangeAndPageSizeQueryParameter timeRangeAndPageSizeQueryParameter, String channel ,String billType) { + this.timeRangeAndPageSizeQueryParameter = timeRangeAndPageSizeQueryParameter; + this.channel = channel; + this.billType = billType; + } + + public String getChannel() { + return channel; + } + + public String getBillType() { + return billType; + } + + public TimeRangeAndPageSizeQueryParameter getTimeRangeAndPageSizeQueryParameter() { + return timeRangeAndPageSizeQueryParameter; + } +} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/ChannelReconciliationFileTunnel.java b/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/ChannelReconciliationFileTunnel.java new file mode 100644 index 000000000..99654c9f4 --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/ChannelReconciliationFileTunnel.java @@ -0,0 +1,15 @@ +package au.com.royalpay.payment.manage.management.channelreconciliationfile; + +import com.github.miemiedev.mybatis.paginator.domain.PageList; + +/** + * @Description + * @title: + * @Date 2020/11/5 16:50 + * @author: zhangTao + */ +public interface ChannelReconciliationFileTunnel { + + PageList list(ChannelReconciliationFileQueryParameter channelReconciliationFileQueryParameter); + +} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/FileDownloadException.java b/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/FileDownloadException.java new file mode 100644 index 000000000..cbe6c8897 --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/FileDownloadException.java @@ -0,0 +1,14 @@ +package au.com.royalpay.payment.manage.management.channelreconciliationfile; + +/** + * @Description + * @title: + * @Date 2020/11/6 11:24 + * @author: zhangTao + */ +public class FileDownloadException extends RuntimeException { + + public FileDownloadException() { + super("文件下载异常"); + } +} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/MultiFileChannelReconciliationException.java b/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/MultiFileChannelReconciliationException.java new file mode 100644 index 000000000..451cb4c92 --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/MultiFileChannelReconciliationException.java @@ -0,0 +1,14 @@ +package au.com.royalpay.payment.manage.management.channelreconciliationfile; + +/** + * @Description + * @title: + * @Date 2020/11/6 11:24 + * @author: zhangTao + */ +public class MultiFileChannelReconciliationException extends RuntimeException { + + public MultiFileChannelReconciliationException() { + super("渠道多文件异常"); + } +} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/common/PageSize.java b/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/common/PageSize.java new file mode 100644 index 000000000..8784a4162 --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/common/PageSize.java @@ -0,0 +1,29 @@ +package au.com.royalpay.payment.manage.management.channelreconciliationfile.common; + +/** + * @Description + * @title: + * @Date 2020/11/16 13:36 + * @author: zhangTao + */ +public class PageSize { + + private int page; + protected int rows; + + public PageSize(int page, int rows) { + this.page = page; + this.rows = rows; + } + + public int getPage() { + if (page == 0) { + return 1; + } + return page; + } + + public int getRows() { + return rows; + } +} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/common/TimeRange.java b/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/common/TimeRange.java new file mode 100644 index 000000000..4ad8d01ca --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/common/TimeRange.java @@ -0,0 +1,26 @@ +package au.com.royalpay.payment.manage.management.channelreconciliationfile.common; + +/** + * @Description + * @title: 时间区间 + * @Date 2020/11/16 11:59 + * @author: zhangTao + */ +public class TimeRange { + + private String startTime; + private String endTime; + + public TimeRange(String startTime, String endTime) { + this.startTime = startTime; + this.endTime = endTime; + } + + public String getStartTime() { + return startTime; + } + + public String getEndTime() { + return endTime; + } +} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/common/TimeRangeAndPageSizeQueryParameter.java b/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/common/TimeRangeAndPageSizeQueryParameter.java new file mode 100644 index 000000000..77187cf86 --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/management/channelreconciliationfile/common/TimeRangeAndPageSizeQueryParameter.java @@ -0,0 +1,26 @@ +package au.com.royalpay.payment.manage.management.channelreconciliationfile.common; + +/** + * @Description + * @title: + * @Date 2020/11/16 13:47 + * @author: zhangTao + */ +public class TimeRangeAndPageSizeQueryParameter { + + private TimeRange timeRange; + private PageSize pageSize; + + public TimeRangeAndPageSizeQueryParameter(TimeRange timeRange, PageSize pageSize) { + this.timeRange = timeRange; + this.pageSize = pageSize; + } + + public TimeRange getTimeRange() { + return timeRange; + } + + public PageSize getPageSize() { + return pageSize; + } +} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/clearing/beans/TransactionStatus.java b/src/main/java/au/com/royalpay/payment/manage/management/clearing/beans/TransactionStatus.java new file mode 100644 index 000000000..9c8a4bc1e --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/management/clearing/beans/TransactionStatus.java @@ -0,0 +1,60 @@ +package au.com.royalpay.payment.manage.management.clearing.beans; + +import com.alibaba.fastjson.annotation.JSONField; + + +/** + * Create by Todking at 2020-12-28 + */ +public class TransactionStatus { + + @JSONField(name = "status") + private Integer status; + + @JSONField(name = "time") + private String time; + + private String statusInfo; + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public String getTime() { + return time; + } + + public void setTime(String time) { + this.time = time; + } + + public String getStatusInfo() { + return statusInfo; + } + + public void setStatusInfo(String statusInfo) { + this.statusInfo = statusInfo; + } + + public TransactionStatus toSet() { + TransactionStatus transactionStatus = new TransactionStatus(); + switch (status) { + case 0: + transactionStatus.setStatusInfo("Ready To Clear"); + break; + case 1: + transactionStatus.setStatusInfo("Cleared"); + break; + case 2: + transactionStatus.setStatusInfo("Preauthorised"); + break; + } + transactionStatus.setStatus(status); + transactionStatus.setTime(time); + return transactionStatus; + } +} diff --git a/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/CleanService.java b/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/CleanService.java index 6ee1221d2..b4d478137 100644 --- a/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/CleanService.java +++ b/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/CleanService.java @@ -1,5 +1,7 @@ package au.com.royalpay.payment.manage.management.clearing.core; +import au.com.royalpay.payment.manage.management.channelreconciliationfile.ChannelReconciliationFileContent; +import au.com.royalpay.payment.manage.management.clearing.beans.TransactionStatus; import au.com.royalpay.payment.manage.support.abafile.ABAFile; import au.com.royalpay.payment.manage.tradelog.beans.ClearingLogQuery; import com.alibaba.fastjson.JSONObject; @@ -109,4 +111,8 @@ public interface CleanService { JSONObject findSettleLog(int clearingId); JSONObject findClearingDetail(int clearingId, String clientMoniker); + + ChannelReconciliationFileContent downloadChannelReconciliationFile(String pid, Date billDate, boolean noCache, String channel, String billType); + + TransactionStatus getTransactionStatus(String transactionId); } diff --git a/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/CleanServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/CleanServiceImpl.java index 8c9e43c1f..e6e295462 100644 --- a/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/CleanServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/CleanServiceImpl.java @@ -1,9 +1,17 @@ package au.com.royalpay.payment.manage.management.clearing.core.impl; import au.com.royalpay.payment.core.PaymentApi; +import au.com.royalpay.payment.core.beans.OrderValidationResult; import au.com.royalpay.payment.core.exceptions.InvalidShortIdException; +import au.com.royalpay.payment.core.exceptions.ParamInvalidException; +import au.com.royalpay.payment.core.impls.LogChannelValidationStorage; import au.com.royalpay.payment.core.tasksupport.SettlementSupport; import au.com.royalpay.payment.core.utils.ExtParamsUtils; +import au.com.royalpay.payment.core.validation.domain.ChannelValidationTask; +import au.com.royalpay.payment.manage.management.channelreconciliationfile.ChannelReconciliationFile; +import au.com.royalpay.payment.manage.management.channelreconciliationfile.ChannelReconciliationFileContent; +import au.com.royalpay.payment.manage.management.channelreconciliationfile.ChannelReconciliationFileDownloadParameter; +import au.com.royalpay.payment.manage.management.clearing.beans.TransactionStatus; import au.com.royalpay.payment.manage.management.clearing.core.CleanService; import au.com.royalpay.payment.manage.mappers.log.*; import au.com.royalpay.payment.manage.mappers.payment.TaskManualSettleMapper; @@ -147,6 +155,13 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider private Locker locker; @Resource private ClientIncrementalMapper clientIncrementalMapper; + @Resource + private ChannelReconciliationFile channelReconciliationFile; + @Resource + private ChannelValidationTask channelValidationTask; + + @Resource + private LogChannelValidationStorage logChannelValidationStorage; @Resource private ClientDeviceMapper clientDeviceMapper; @@ -159,11 +174,14 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider @Override public List listValidatedDays(Date month) { - List reports = validationLogMapper.listValidatedReports(month); - List topReports = new ArrayList<>(); - for (JSONObject report : reports) { + List originOriginReports = validationLogMapper.listValidatedDates(month); + List newReports = logChannelValidationStorage.listMonthReports(month); + Map reports = new TreeMap<>(); + for (JSONObject report : originOriginReports) { JSONObject item = new JSONObject(); - item.put("date", DateFormatUtils.format(report.getDate("valid_date"), "yyyy/MM/dd")); + String dateStr = DateFormatUtils.format(report.getDate("valid_date"), "yyyy/MM/dd"); + item.put("date", dateStr); + item.put("isOld", true); JSONObject result = JSON.parseObject(report.getString("result")); int warningLevel = result.getBooleanValue("valid") ? 0 : 1; if (!result.getJSONArray("not_exists").isEmpty()) { @@ -171,9 +189,18 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider } item.put("warning_level", warningLevel); item.put("success", result.getBooleanValue("valid")); - topReports.add(item); + reports.put(dateStr, item); } - return topReports; + for (OrderValidationResult res : newReports) { + JSONObject item = new JSONObject(); + String dateStr = DateFormatUtils.format(res.getTransDate(), "yyyy/MM/dd"); + item.put("date", dateStr); + item.put("isOld", false); + item.put("warning_level", res.getWarningLevel()); + item.put("success", res.getWarningLevel() == OrderValidationResult.LEVEL_SUCCESS); + reports.put(dateStr, item); + } + return new ArrayList<>(reports.values()); } @Override @@ -1528,14 +1555,14 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider return JSON.parseObject(reportItem.getString("result")); } } - JSONObject report = paymentApi.validTransactions(dt, fix); + OrderValidationResult report = channelValidationTask.validTransactions(dt); JSONObject log = new JSONObject(); log.put("valid_date", dt); log.put("create_time", new Date()); - log.put("result", report.toJSONString()); + log.put("result", report.getReport().toJSONString()); validationLogMapper.removeByDate(dt); validationLogMapper.save(log); - return report; + return JSON.parseObject(log.getString("result")); } @Override @@ -1688,6 +1715,20 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider .orElseThrow(() -> new NotFoundException("No clearing log found for " + clientMoniker)); } + @Override + public ChannelReconciliationFileContent downloadChannelReconciliationFile(String pid, Date billDate, boolean noCache, String channel, String billType) { + return channelReconciliationFile.download(new ChannelReconciliationFileDownloadParameter(pid, billDate, channel, noCache, billType)); + } + + @Override + public TransactionStatus getTransactionStatus(String transactionId) { + TransactionStatus transactionStatus = transactionMapper.getTransactionStatusById(transactionId); + if (transactionStatus == null) { + throw new ParamInvalidException("date","The transaction was not found"); + } + return transactionStatus.toSet(); + } + private void releaseDistributedSurcharge(JSONObject clearingDetail) { int clientId = clearingDetail.getIntValue("client_id"); BigDecimal distributedSurcharge = clearingDetail.getBigDecimal("distributed_surcharge"); diff --git a/src/main/java/au/com/royalpay/payment/manage/management/clearing/web/FinancialController.java b/src/main/java/au/com/royalpay/payment/manage/management/clearing/web/FinancialController.java index 6f259bcbd..dd7de3bc3 100644 --- a/src/main/java/au/com/royalpay/payment/manage/management/clearing/web/FinancialController.java +++ b/src/main/java/au/com/royalpay/payment/manage/management/clearing/web/FinancialController.java @@ -1,23 +1,36 @@ package au.com.royalpay.payment.manage.management.clearing.web; +import au.com.royalpay.payment.core.beans.OrderValidationChannelResult; import au.com.royalpay.payment.core.exceptions.ParamInvalidException; +import au.com.royalpay.payment.core.impls.LogChannelValidationStorage; +import au.com.royalpay.payment.core.validation.domain.ChannelValidationTask; +import au.com.royalpay.payment.manage.management.channelreconciliationfile.ChannelReconciliationFileContent; +import au.com.royalpay.payment.manage.management.channelreconciliationfile.FileDownloadException; +import au.com.royalpay.payment.manage.management.clearing.beans.TransactionStatus; import au.com.royalpay.payment.manage.management.clearing.core.CleanService; import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; import au.com.royalpay.payment.tools.permission.enums.ManagerRole; import au.com.royalpay.payment.tools.CommonConsts; import com.alibaba.fastjson.JSONObject; +import org.apache.commons.codec.Charsets; import org.apache.commons.lang3.time.DateFormatUtils; import org.apache.commons.lang3.time.DateUtils; import org.joda.time.DateTime; +import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; +import java.io.ByteArrayInputStream; import java.io.IOException; +import java.io.InputStream; import java.io.OutputStream; +import java.net.URLEncoder; import java.text.ParseException; import java.util.Date; import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; /** * Created by davep on 2016-09-02. @@ -28,6 +41,12 @@ public class FinancialController { @Resource private CleanService cleanService; + @Resource + private LogChannelValidationStorage logChannelValidationStorage; + + @Resource + private ChannelValidationTask channelValidationTask; + @GetMapping("/validated_dates/{month}") public List listMonthValidatedDays(@PathVariable String month) { try { @@ -49,6 +68,70 @@ public class FinancialController { } } + @GetMapping("/order_validation_new/{date}") + public Map> getCheckReportNew(@PathVariable String date) { + try { + Date dt = DateUtils.parseDate(date, "yyyyMMdd"); + List orderValidationChannelResults = logChannelValidationStorage.listDailyLogs(dt); + Map> collect = orderValidationChannelResults.stream().collect(Collectors.groupingBy(e -> e.getChannel().getChannelCode())); + return collect; + } catch (ParseException e) { + throw new ParamInvalidException("date", "error.payment.valid.invalid_date_format"); + } + } + + @PostMapping("/mark/resolve/message") + public void markResolveMessage(@RequestBody JSONObject jsonObject) { + logChannelValidationStorage.markResolveMessage(jsonObject.getString("log_id"), jsonObject.getString("message")); + } + + @PostMapping("/redo_channel_validation/{date}") + public void redoChannelValidation(@PathVariable String date, @RequestBody JSONObject jsonObject) { + try { + Date dt = DateUtils.parseDate(date, "yyyyMMdd"); + channelValidationTask.redoChannelValidation(dt, jsonObject.getString("channel"), jsonObject.getBoolean("cache")); + } catch (ParseException e) { + throw new ParamInvalidException("date", "error.payment.valid.invalid_date_format"); + } + } + + @GetMapping("/get/transaction/status/{transactionId}") + public TransactionStatus getTransactionStatus(@PathVariable String transactionId) { + if(transactionId.isEmpty()){ + throw new ParamInvalidException("date","Transaction flow is empty"); + } + return cleanService.getTransactionStatus(transactionId); + } + + @GetMapping("/downloadChannelReconciliationFile") + public JSONObject downloadChannelReconciliationFile(@RequestParam(value = "pid") String pid, + @RequestParam(value = "billDate") String billDate, + @RequestParam(value = "noCache") boolean noCache, + @RequestParam(value = "billType", required = false) String billType, + @RequestParam(value = "channel") String channel, + HttpServletResponse response) { + ChannelReconciliationFileContent file = cleanService.downloadChannelReconciliationFile(pid, au.com.royalpay.payment.tools.utils.DateUtils.parseDate(billDate) + , noCache, channel, billType); + + + + try (InputStream in = new ByteArrayInputStream(file.content())) { + response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(file.name(), Charsets.UTF_8.name())); + response.setContentLength(file.length()); + response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE); + OutputStream out = response.getOutputStream(); + byte[] buff = new byte[1024]; + int n; + while ((n = in.read(buff)) != -1) { + out.write(buff, 0, n); + } + } catch (IOException ex) { + throw new FileDownloadException(); + } + + return null; + } + @GetMapping("/clean_logs") public JSONObject getDailyTransactions(@RequestParam String date, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { try { diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/log/ChannelReconciliationFileTunnelMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/log/ChannelReconciliationFileTunnelMapper.java new file mode 100644 index 000000000..91fbc4899 --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/log/ChannelReconciliationFileTunnelMapper.java @@ -0,0 +1,37 @@ +package au.com.royalpay.payment.manage.mappers.log; + + +import au.com.royalpay.payment.manage.management.channelreconciliationfile.ChannelReconciliationFileDTO; +import au.com.royalpay.payment.manage.management.channelreconciliationfile.ChannelReconciliationFileQueryParameter; +import au.com.royalpay.payment.manage.management.channelreconciliationfile.ChannelReconciliationFileTunnel; +import au.com.royalpay.payment.manage.management.channelreconciliationfile.common.PageSize; +import au.com.royalpay.payment.manage.management.channelreconciliationfile.common.TimeRange; +import au.com.royalpay.payment.manage.management.channelreconciliationfile.common.TimeRangeAndPageSizeQueryParameter; +import com.github.miemiedev.mybatis.paginator.domain.PageBounds; +import com.github.miemiedev.mybatis.paginator.domain.PageList; +import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; + + +/** + * @Description + * @title: + * @Date 2020/11/4 14:25 + * @author: zhangTao + */ +@AutoMapper(tablename = "log_validation_attachment_batches", pkName = "batch_id") +public interface ChannelReconciliationFileTunnelMapper extends ChannelReconciliationFileTunnel { + + + PageList queryChannelReconciliationFile(String billType, String channel, String startTime, String endTime, PageBounds pagination); + + @Override + default PageList list(ChannelReconciliationFileQueryParameter channelReconciliationFileQueryParameter){ + TimeRangeAndPageSizeQueryParameter timeRangeAndPageSizeQueryParameter = channelReconciliationFileQueryParameter.getTimeRangeAndPageSizeQueryParameter(); + TimeRange timeRange = timeRangeAndPageSizeQueryParameter.getTimeRange(); + PageSize pageSize = timeRangeAndPageSizeQueryParameter.getPageSize(); + + String channel = channelReconciliationFileQueryParameter.getChannel(); + String billType = channelReconciliationFileQueryParameter.getBillType(); + return this.queryChannelReconciliationFile(billType,channel, timeRange.getStartTime(), timeRange.getEndTime() , new PageBounds(pageSize.getPage(), pageSize.getRows())); + } +} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/log/ValidationLogMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/log/ValidationLogMapper.java index ac05821b4..ad98d8d2a 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/log/ValidationLogMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/log/ValidationLogMapper.java @@ -24,4 +24,6 @@ public interface ValidationLogMapper { JSONObject findByDate(@Param("valid_date") Date validDate); List listValidatedReports(@Param("month") Date month); + + List listValidatedDates(Date month); } diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.java index ee28809df..828a5ca80 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.java @@ -1,5 +1,6 @@ package au.com.royalpay.payment.manage.mappers.payment; +import au.com.royalpay.payment.manage.management.clearing.beans.TransactionStatus; import com.alibaba.fastjson.JSONObject; import com.github.miemiedev.mybatis.paginator.domain.PageBounds; import com.github.miemiedev.mybatis.paginator.domain.PageList; @@ -167,4 +168,6 @@ public interface TransactionMapper { List getSettleDataDailyReport(@Param("beginTime") Date beginTime,@Param("endTime")Date endTime); List analysisByChannels(@Param("from") Date from, @Param("to") Date to, @Param("channels") List channels); + + TransactionStatus getTransactionStatusById(String transactionId); } diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index e75c109fc..671b83a4c 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -18,6 +18,8 @@ jetty: multipart: max-file-size: 10Mb app: + active: + channels: Wechat,Alipay,AlipayOnline,Gmo,UnionPay,AlipayPlus crossapp: enable: true agreetemplate: @@ -89,8 +91,9 @@ android: apple: message: apns: - file: '' - password: '' + file: src/main/resources/dev.p12 + password: HQeYblIajOb0 + saneboxMode: true customer: app: appid: customer diff --git a/src/main/resources/aps_productionA.p12 b/src/main/resources/aps_productionA.p12 new file mode 100644 index 000000000..525f4fbcd Binary files /dev/null and b/src/main/resources/aps_productionA.p12 differ diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/log/ChannelReconciliationFileTunnelMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/log/ChannelReconciliationFileTunnelMapper.xml new file mode 100644 index 000000000..b192eb741 --- /dev/null +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/log/ChannelReconciliationFileTunnelMapper.xml @@ -0,0 +1,25 @@ + + + + + diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/log/ValidationLogMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/log/ValidationLogMapper.xml index a022a7728..c6c49fe1f 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/log/ValidationLogMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/log/ValidationLogMapper.xml @@ -10,4 +10,7 @@ + \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml index 9b33ff4cf..c9a4b53ae 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml @@ -1490,4 +1490,11 @@ #{channel} group by o.merchant_id + diff --git a/src/main/resources/dev.p12 b/src/main/resources/dev.p12 new file mode 100644 index 000000000..5210b6fa4 Binary files /dev/null and b/src/main/resources/dev.p12 differ diff --git a/src/main/ui/static/images/alipay_direct_sign.png b/src/main/ui/static/images/alipay_direct_sign.png new file mode 100644 index 000000000..b305234fa Binary files /dev/null and b/src/main/ui/static/images/alipay_direct_sign.png differ diff --git a/src/main/ui/static/images/unionpay_sign.png b/src/main/ui/static/images/unionpay_sign.png new file mode 100644 index 000000000..bb3f6f1de Binary files /dev/null and b/src/main/ui/static/images/unionpay_sign.png differ diff --git a/src/main/ui/static/images/upop_sign.png b/src/main/ui/static/images/upop_sign.png new file mode 100644 index 000000000..56129f5d1 Binary files /dev/null and b/src/main/ui/static/images/upop_sign.png differ diff --git a/src/main/ui/static/payment/partner/partner-manage.js b/src/main/ui/static/payment/partner/partner-manage.js index f922956b4..18762a628 100644 --- a/src/main/ui/static/payment/partner/partner-manage.js +++ b/src/main/ui/static/payment/partner/partner-manage.js @@ -5431,24 +5431,65 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter } } }]); - // Merchant Id Management + // MID Management app.controller('subMerchantIdApplicaitonsCtrl', ['$scope', '$http', '$uibModal', '$state', 'commonDialog', '$sce', function ($scope, $http, $uibModal, $state, commonDialog, $sce) { + // 初始化子商户 + $scope.loadSubMerchantInfos = function () { + $http.get('/sys/partners/' + $scope.partner.client_moniker + '/list_sub_applices', { params: {} }).then(function (resp) { + $scope.subMerchantInfos = resp.data; + }); + // $http.get('/sys/partners/' + $scope.partner.client_moniker + '/list_rpay_sub_applices', {params: {}}).then(function (resp) { + // $scope.subRpayMerchantInfos = resp.data; + // }); + // + // $http.get('/sys/partners/' + $scope.partner.client_moniker + '/list_yeepay_sub_applices', {params: {}}).then(function (resp) { + // $scope.subYeepayMerchantInfos = resp.data; + // }); + // $http.get('/sys/partners/' + $scope.partner.client_moniker + '/queryMWMerchantIdStatus').then(function (resp) { + // $scope.partner.cardInfo = resp.data; + // }); + }; + $scope.loadSubMerchantInfos(); + // 加载卡支付信息 + $scope.loadCardInfos = function () { + $http.get('/sys/partners/' + $scope.partner.client_moniker + '/queryMWMerchantIdStatus').then(function (resp) { + $scope.cardInfo = resp.data; + }); + } + $scope.loadCardInfos(); + // 初始化信息 $scope.loadPartnerInfo = function () { $http.get('/sys/partners/' + $scope.partner.client_moniker).then(function (resp) { $scope.partnerInfo = resp.data; $scope.doSwitchCommonSubMerchantId(); }) }; - $scope.loadPartnerInfo() + $scope.loadPartnerInfo(); // 编辑Wechat Sub Merchant Id $scope.saveSubMerchantId = function () { $http.put('/sys/partners/' + $scope.partner.client_moniker + '/payment_config', { sub_merchant_id: $scope.partnerInfo.sub_merchant_id }).then(function (resp) { $scope.loadPartnerInfo(); - $scope.ctrl.editSubMerchant = false; }, function (resp) { commonDialog.alert({ title: 'Error', content: resp.data.message, type: 'error' }) }); }; + // Wechat-applay + $scope.applyWxSubMerchantId = function () { + $uibModal.open({ + templateUrl: '/static/payment/partner/templates/new_apply_wx_sub_merchant_id.html', + controller: 'newApplyWxSubMerchantIdCtrl', + resolve: { + subMerchantInfo: function () { + return $scope.partner; + }, + merchantIds: ['$http', '$stateParams', function ($http) { + return $http.get('/sys/partners/' + $scope.partner.client_moniker + '/get_merchant_ids'); + }] + } + }).result.then(function () { + $scope.loadSubMerchantInfos(); + }) + }; // 刷新Wechat Sub Merchant Id $scope.queryWechatSubMerchantIdStatus = function () { $http.get('/sys/partners/' + $scope.partner.client_moniker + '/get_merchant_ids/' + $scope.partnerInfo.sub_merchant_id + '/status').then(function (resp) { @@ -5458,6 +5499,8 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter type: 'info' }) $scope.loadPartnerInfo(); + }, function (resp) { + commonDialog.alert({ title: 'Error', content: resp.data.message, type: 'error' }) }) } // history @@ -5476,7 +5519,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter // 刷新Wechat Institution Merchant Id $scope.refreshWechatInstitutionMerchantId = function () { $http.put('/sys/partners/' + $scope.partner.client_moniker + '/wechat_institution_merchant_id', { wechat_institution_merchant_id: $scope.partnerInfo.wechat_institution_merchant_id }).then(function (resp) { - $scope.loadPartnerInfo() + $scope.loadPartnerInfo(); }, function (resp) { commonDialog.alert({ title: 'Error', content: resp.data.message, type: 'error' }) }); @@ -5542,6 +5585,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter }).then(function () { $http.post('/sys/partners/' + $scope.partner.client_moniker + '/register/alipay_gms').then(function () { commonDialog.alert({ title: 'Success', content: 'Alipay进件成功', type: 'success' }); + $scope.loadPartnerInfo(); }, function (resp) { commonDialog.alert({ title: 'Error', content: "进件失败:" + resp.data.message, type: 'error' }); }) @@ -5559,6 +5603,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter }).then(function () { $http.post('/sys/partners/' + $scope.partner.client_moniker + '/register/alipayOnline_gms').then(function () { commonDialog.alert({ title: 'Success', content: '提示:AlipayOnline进件成功', type: 'success' }); + $scope.loadPartnerInfo(); }, function (resp) { commonDialog.alert({ title: 'Error', content: "进件失败:" + resp.data.message, type: 'error' }); }); @@ -5573,7 +5618,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter content: 'Modify Wechat Sub Merchant ID successfully', type: 'success' }); - $state.reload(); + $scope.loadPartnerInfo(); }, function (resp) { commonDialog.alert({ title: 'Error', content: resp.data.message, type: 'error' }) }); @@ -5610,109 +5655,15 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter } } }).result.then(function () { - $state.reload(); commonDialog.alert({ title: 'Success', content: 'Modify successfully', type: 'success' }); + $scope.loadPartnerInfo(); }) } - - $scope.showMoreMerchantInfo = false; - $scope.hideMerchantInfo = function () { - $scope.showMoreMerchantInfo = !$scope.showMoreMerchantInfo; - }; - $scope.loadSubMerchantInfos = function () { - $http.get('/sys/partners/' + $scope.partner.client_moniker + '/list_sub_applices', { params: {} }).then(function (resp) { - $scope.subMerchantInfos = resp.data; - }); - // $http.get('/sys/partners/' + $scope.partner.client_moniker + '/list_rpay_sub_applices', {params: {}}).then(function (resp) { - // $scope.subRpayMerchantInfos = resp.data; - // }); - // - // $http.get('/sys/partners/' + $scope.partner.client_moniker + '/list_yeepay_sub_applices', {params: {}}).then(function (resp) { - // $scope.subYeepayMerchantInfos = resp.data; - // }); - $http.get('/sys/partners/' + $scope.partner.client_moniker + '/queryMWMerchantIdStatus').then(function (resp) { - $scope.partner.cardInfo = resp.data; - }); - }; - $scope.updateSubMerchantId = function (merchant_app_id) { - $uibModal.open({ - templateUrl: '/static/payment/partner/templates/update_apply_wx_sub_merchant_id.html', - controller: 'updateApplyWxSubMerchantIdCtrl', - resolve: { - merchantInfo: $scope.partner, - merchantIds: ['$http', '$stateParams', function ($http) { - return $http.get('/sys/partners/' + $scope.partner.client_moniker + '/get_merchant_ids'); - }], - subMerchantInfo: ['$http', '$stateParams', function ($http) { - return $http.get('/sys/partners/' + $scope.partner.client_moniker + '/get_merchant_ids/' + merchant_app_id); - }] - } - }).result.then(function () { - $scope.loadSubMerchantInfos(); - }) - } - $scope.useRpaySubMerchantId = function (sub_merchant_id) { - $http.put('/sys/partners/' + $scope.partner.client_moniker + '/rpay_payment_config', { rpay_enterprise_id: sub_merchant_id }).then(function (resp) { - commonDialog.alert({ - title: 'Success', - content: 'Modify Rpay+ Sub Merchant ID successfully', - type: 'success' - }); - $state.reload(); - }, function (resp) { - commonDialog.alert({ title: 'Error', content: resp.data.message, type: 'error' }) - }); - } - $scope.useYeepaySubMerchantId = function (sub_merchant_id) { - $http.put('/sys/partners/' + $scope.partner.client_moniker + '/yeepay_payment_config', { yeepay_sub_merchant_id: sub_merchant_id }).then(function (resp) { - commonDialog.alert({ - title: 'Success', - content: 'Modify Yeepay Sub Merchant ID successfully', - type: 'success' - }); - $state.reload(); - }, function (resp) { - commonDialog.alert({ title: 'Error', content: resp.data.message, type: 'error' }) - }); - } - /*$scope.applyWxSubMerchantId = function () { - $uibModal.open({ - templateUrl: '/static/payment/partner/templates/apply_wx_sub_merchant_id.html', - controller: 'applyWxSubMerchantIdCtrl', - resolve: { - subMerchantInfo: function () { - return $scope.partner; - }, - merchantIds: ['$http', '$stateParams', function ($http) { - return $http.get('/sys/partners/' + $scope.partner.client_moniker + '/get_merchant_ids'); - }] - } - }).result.then(function () { - $scope.loadSubMerchantInfos(); - }) - };*/ - - $scope.applyWxSubMerchantId = function () { - $uibModal.open({ - templateUrl: '/static/payment/partner/templates/new_apply_wx_sub_merchant_id.html', - controller: 'newApplyWxSubMerchantIdCtrl', - resolve: { - subMerchantInfo: function () { - return $scope.partner; - }, - merchantIds: ['$http', '$stateParams', function ($http) { - return $http.get('/sys/partners/' + $scope.partner.client_moniker + '/get_merchant_ids'); - }] - } - }).result.then(function () { - $scope.loadSubMerchantInfos(); - }) - }; - + // 卡支付apply $scope.applyMWSubMerchantId = function () { $http.get('/sys/partners/' + $scope.partner.client_moniker + '/query/mw_info').then(function (resp) { commonDialog.confirm({ @@ -5726,69 +5677,130 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter content: 'Apply Merchant Warrior Sub Merchant ID successfully', type: 'success' }); - $scope.partner.cardInfo = res.data; + $scope.cardInfo = res.data; }, function (resp) { commonDialog.alert({ title: 'Error', content: resp.data.message, type: 'error' }); }) }) }); }; - $scope.applyRpaySubMerchantId = function () { - $uibModal.open({ - templateUrl: '/static/payment/partner/templates/apply_rpay_sub_merchant_id.html', - controller: 'applyRpaySubMerchantIdCtrl', - resolve: { - subMerchantInfo: function () { - return $scope.partner; - } - } - }).result.then(function () { - $scope.loadSubMerchantInfos(); - }) - }; - $scope.applyYeepaySubMerchantId = function () { - $uibModal.open({ - templateUrl: '/static/payment/partner/templates/apply_yeepay_sub_merchant_id.html', - controller: 'applyYeepaySubMerchantIdCtrl', - resolve: { - subMerchantInfo: function () { - return $scope.partner; - } - } - }).result.then(function () { - $scope.loadSubMerchantInfos(); - }) - }; - $scope.addYeepaySubMerchantId = function () { - $uibModal.open({ - templateUrl: '/static/payment/partner/templates/add_yeepay_sub_merchant_id.html', - controller: 'addYeepaySubMerchantIdCtrl', - resolve: { - subMerchantInfo: function () { - return $scope.partner; - } - } - }).result.then(function () { - $scope.loadSubMerchantInfos(); - }) - }; - $scope.updateYeepaySubMerchantId = function (sub_merchant_id) { - $uibModal.open({ - templateUrl: '/static/payment/partner/templates/update_yeepay_sub_merchant_id.html', - controller: 'updateYeepaySubMerchantIdCtrl', - resolve: { - subMerchantInfo: function () { - return $scope.partner; - }, - subMerchantId: function () { - return sub_merchant_id; - } - } - }).result.then(function () { - $scope.loadSubMerchantInfos(); - }) - }; - $scope.loadSubMerchantInfos(); + + // $scope.showMoreMerchantInfo = false; + // $scope.hideMerchantInfo = function () { + // $scope.showMoreMerchantInfo = !$scope.showMoreMerchantInfo; + // }; + // $scope.updateSubMerchantId = function (merchant_app_id) { + // $uibModal.open({ + // templateUrl: '/static/payment/partner/templates/update_apply_wx_sub_merchant_id.html', + // controller: 'updateApplyWxSubMerchantIdCtrl', + // resolve: { + // merchantInfo: $scope.partner, + // merchantIds: ['$http', '$stateParams', function ($http) { + // return $http.get('/sys/partners/' + $scope.partner.client_moniker + '/get_merchant_ids'); + // }], + // subMerchantInfo: ['$http', '$stateParams', function ($http) { + // return $http.get('/sys/partners/' + $scope.partner.client_moniker + '/get_merchant_ids/' + merchant_app_id); + // }] + // } + // }).result.then(function () { + // $scope.loadSubMerchantInfos(); + // }) + // } + // $scope.useRpaySubMerchantId = function (sub_merchant_id) { + // $http.put('/sys/partners/' + $scope.partner.client_moniker + '/rpay_payment_config', { rpay_enterprise_id: sub_merchant_id }).then(function (resp) { + // commonDialog.alert({ + // title: 'Success', + // content: 'Modify Rpay+ Sub Merchant ID successfully', + // type: 'success' + // }); + // $state.reload(); + // }, function (resp) { + // commonDialog.alert({ title: 'Error', content: resp.data.message, type: 'error' }) + // }); + // } + // $scope.useYeepaySubMerchantId = function (sub_merchant_id) { + // $http.put('/sys/partners/' + $scope.partner.client_moniker + '/yeepay_payment_config', { yeepay_sub_merchant_id: sub_merchant_id }).then(function (resp) { + // commonDialog.alert({ + // title: 'Success', + // content: 'Modify Yeepay Sub Merchant ID successfully', + // type: 'success' + // }); + // $state.reload(); + // }, function (resp) { + // commonDialog.alert({ title: 'Error', content: resp.data.message, type: 'error' }) + // }); + // } + // $scope.applyWxSubMerchantId = function () { + // $uibModal.open({ + // templateUrl: '/static/payment/partner/templates/apply_wx_sub_merchant_id.html', + // controller: 'applyWxSubMerchantIdCtrl', + // resolve: { + // subMerchantInfo: function () { + // return $scope.partner; + // }, + // merchantIds: ['$http', '$stateParams', function ($http) { + // return $http.get('/sys/partners/' + $scope.partner.client_moniker + '/get_merchant_ids'); + // }] + // } + // }).result.then(function () { + // $scope.loadSubMerchantInfos(); + // }) + // }; + // $scope.applyRpaySubMerchantId = function () { + // $uibModal.open({ + // templateUrl: '/static/payment/partner/templates/apply_rpay_sub_merchant_id.html', + // controller: 'applyRpaySubMerchantIdCtrl', + // resolve: { + // subMerchantInfo: function () { + // return $scope.partner; + // } + // } + // }).result.then(function () { + // $scope.loadSubMerchantInfos(); + // }) + // }; + // $scope.applyYeepaySubMerchantId = function () { + // $uibModal.open({ + // templateUrl: '/static/payment/partner/templates/apply_yeepay_sub_merchant_id.html', + // controller: 'applyYeepaySubMerchantIdCtrl', + // resolve: { + // subMerchantInfo: function () { + // return $scope.partner; + // } + // } + // }).result.then(function () { + // $scope.loadSubMerchantInfos(); + // }) + // }; + // $scope.addYeepaySubMerchantId = function () { + // $uibModal.open({ + // templateUrl: '/static/payment/partner/templates/add_yeepay_sub_merchant_id.html', + // controller: 'addYeepaySubMerchantIdCtrl', + // resolve: { + // subMerchantInfo: function () { + // return $scope.partner; + // } + // } + // }).result.then(function () { + // $scope.loadSubMerchantInfos(); + // }) + // }; + // $scope.updateYeepaySubMerchantId = function (sub_merchant_id) { + // $uibModal.open({ + // templateUrl: '/static/payment/partner/templates/update_yeepay_sub_merchant_id.html', + // controller: 'updateYeepaySubMerchantIdCtrl', + // resolve: { + // subMerchantInfo: function () { + // return $scope.partner; + // }, + // subMerchantId: function () { + // return sub_merchant_id; + // } + // } + // }).result.then(function () { + // $scope.loadSubMerchantInfos(); + // }) + // }; }]); app.controller('applyWxSubMerchantIdCtrl', ['$scope', '$http', '$uibModal', '$state', 'subMerchantInfo', '$filter', 'merchantIds', 'commonDialog', function ($scope, $http, $uibModal, $state, subMerchantInfo, $filter, merchantIds, commonDialog) { $scope.wxIndustries = angular.copy(wxMerchantIndustries); @@ -5845,7 +5857,6 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter }]); // 修改sub_merchant_id app.controller('ModifysubMerchantIdCtrl', ['$scope', '$http', '$uibModal', '$state', 'commonDialog', 'clientMoniker', 'merchantId', 'channel', function ($scope, $http, $uibModal, $state, commonDialog, clientMoniker, merchantId, channel) { - console.log(merchantId, channel); $scope.merchantId = merchantId $scope.flag = false $scope.confirm = function () { @@ -5857,14 +5868,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter $scope.flag = false commonDialog.alert({ title: 'Error', content: resp.data.message, type: 'error' }) }); - } else if (channel === 'Alipay') { - $http.put('/sys/partners/' + clientMoniker + '/ali_sub_merchant_id', { ali_sub_merchant_id: $scope.merchantId }).then(function (resp) { - $scope.$close(); - }, function (resp) { - $scope.flag = false - commonDialog.alert({ title: 'Error', content: resp.data.message, type: 'error' }) - }); - } else if (channel = 'AlipayOnline') { + } else if (channel === 'Alipay' || channel === 'AlipayOnline') { $http.put('/sys/partners/' + clientMoniker + '/ali_sub_merchant_id', { ali_sub_merchant_id: $scope.merchantId }).then(function (resp) { $scope.$close(); }, function (resp) { diff --git a/src/main/ui/static/payment/partner/templates/sub_merchant_detail.html b/src/main/ui/static/payment/partner/templates/sub_merchant_detail.html index 0fc613ac1..38f862a07 100644 --- a/src/main/ui/static/payment/partner/templates/sub_merchant_detail.html +++ b/src/main/ui/static/payment/partner/templates/sub_merchant_detail.html @@ -29,71 +29,71 @@
  • Sub Merchant Id - {{subMerchantInfo.cardInfo.rpMerchantId}} + {{subMerchantInfo.rpMerchantId}}
  • Name - +
  • Company Name - {{subMerchantInfo.cardInfo.company_name}} + {{subMerchantInfo.company_name}}
  • Address - {{subMerchantInfo.cardInfo.address | newWxMerchants}} + {{subMerchantInfo.address | newWxMerchants}}
  • Suburb - {{subMerchantInfo.cardInfo.suburb}} + {{subMerchantInfo.suburb}}
  • Postcode - +
  • State - +
  • Abn - +
  • Email - +
  • Contact Name - +
  • Phone - +
  • BSB - +
  • Account No - +
  • Account Name - +
  • Website - +
  • Timezone - +
  • Category - +
diff --git a/src/main/ui/static/payment/partner/templates/sub_merchant_id_apply.html b/src/main/ui/static/payment/partner/templates/sub_merchant_id_apply.html index fbeb1b7d9..eb2493d70 100644 --- a/src/main/ui/static/payment/partner/templates/sub_merchant_id_apply.html +++ b/src/main/ui/static/payment/partner/templates/sub_merchant_id_apply.html @@ -45,8 +45,24 @@ min-height: unset; margin: unset; } + + .flex-container { + display: flex; + flex-wrap: wrap; + } + + @media (max-width:1400px) { + .flex-container { + display: flex; + flex-direction: column; + } + + .content-mine { + width: 100%; + } + } -
+
@@ -66,22 +82,6 @@ -
@@ -131,7 +131,7 @@
  • Sub Merchant Id : {{id_apply.sub_merchant_id}} - (当前使用) @@ -141,46 +141,6 @@
-
@@ -204,22 +164,6 @@ -
-
@@ -263,22 +204,6 @@ -
@@ -289,9 +214,6 @@ -
@@ -313,8 +235,8 @@
- Rpay+ Institution Merchant Id : - none + Rpay+ Institution Merchant Id : + none
@@ -339,14 +261,14 @@
Merchant Warrior : - - 审核通过 - + 审核通过 + 审核中 - 打回 - ({{partner.cardInfo.rpMerchantId}}) - 未申请 + ({{cardInfo.rpMerchantId}}) + 未申请
-
+
No Data
-
    +
    • - Sub Merchant Id : {{partner.cardInfo.rpMerchantId}} - detail + Sub Merchant Id : {{cardInfo.rpMerchantId}} + detail
    -
diff --git a/src/main/ui/static/payment/validation/order-validation.js b/src/main/ui/static/payment/validation/order-validation.js index 0a66b25cd..fc901dba7 100644 --- a/src/main/ui/static/payment/validation/order-validation.js +++ b/src/main/ui/static/payment/validation/order-validation.js @@ -2,83 +2,297 @@ * Created by davep on 2016-09-01. */ define(['angular', 'uiRouter'], function () { - 'use strict'; - var app = angular.module('orderValidApp', ['ui.router']); - app.config(['$stateProvider', function ($stateProvider) { - $stateProvider.state('order_valid', { - url: '/order_validation', - templateUrl: '/static/payment/validation/templates/valid-calendar.html', - controller: 'orderValidCalendarCtrl' - }).state('order_valid.report', { - url: '/{date}', - templateUrl: '/static/payment/validation/templates/valid.html', - controller: 'orderValidationCtrl' - }); - }]); - app.controller('orderValidCalendarCtrl', ['$scope', '$http', '$filter', function ($scope, $http, $filter) { - $scope.today = new Date(); - $scope.loadValidatedDates = function (month) { - let monthStr = $filter('date')(month, 'yyyyMM'); - $http.get('/sys/financial/validated_dates/' + monthStr).then(function (resp) { - $scope.validatedDates = resp.data; + 'use strict' + var app = angular.module('orderValidApp', ['ui.router']) + app.config([ + '$stateProvider', + function ($stateProvider) { + $stateProvider + .state('order_valid', { + url: '/order_validation', + templateUrl: '/static/payment/validation/templates/valid-calendar.html', + controller: 'orderValidCalendarCtrl', + }) + .state('order_valid.report', { + url: '/{date}', + templateUrl: '/static/payment/validation/templates/valid.html', + controller: 'orderValidationCtrl', + }) + .state('order_valid.report_new', { + url: '/new/{date}', + templateUrl: '/static/payment/validation/templates/valid_new.html', + controller: 'orderValidationNewCtrl', + }) + }, + ]) + app.controller('orderValidCalendarCtrl', [ + '$scope', + '$http', + '$filter', + '$state', + 'commonDialog', + function ($scope, $http, $filter, $state, commonDialog) { + $scope.today = new Date() + $scope.loadValidatedDates = function (month) { + let monthStr = $filter('date')(month, 'yyyyMM') + $http.get('/sys/financial/validated_dates/' + monthStr).then(function (resp) { + $scope.validatedDates = resp.data + }) + } + $scope.findReport = function (dateStr) { + if ($scope.validatedDates == null) { + return null + } + let filtered = $scope.validatedDates.filter(rp => rp.date === dateStr) + return filtered.length ? filtered[0] : null + } + $scope.checkDetail = function (date) { + const filterItem = $scope.validatedDates.filter(rp => rp.date === date) + const dateStr = date.replace(/\//g, '') + if (filterItem.length) { + if (filterItem[0].isOld) { + $state.go('order_valid.report', { date: dateStr }) + } else { + sessionStorage.setItem('warningLevel', filterItem[0].warning_level) + $state.go('order_valid.report_new', { date: dateStr }) + } + } else { + commonDialog + .confirm({ + title: 'Confirm', + content: '是否确认重新执行对账?', + }) + .then(function () { + $http + .get('/sys/financial/order_validations/' + dateStr, { + params: { + use_cache: false, + }, + timeout: 300000, + }) + .then( + function () { + $state.reload() + }, + function (resp) { + $state.reload() + } + ) }) - }; - $scope.findReport = function (dateStr) { - if ($scope.validatedDates == null) { - return null; - } - let filtered = $scope.validatedDates.filter(rp => rp.date === dateStr); - return filtered.length ? filtered[0] : null } - }]); - app.controller('orderValidationCtrl', ['$scope', '$http', '$filter', '$stateParams', 'commonDialog', - function ($scope, $http, $filter, $stateParams, commonDialog) { - $scope.date = $stateParams.date; - $scope.startValid = function (forceRebuild) { - $scope.report = {loading: true}; - $http.get('/sys/financial/order_validations/' + $scope.date, { - params: { - use_cache: !forceRebuild - }, - timeout: 300000 - }).then(function (resp) { - $scope.report = resp.data; - $scope.notExistsKeys = []; - $scope.notEqualsKeys = []; - angular.forEach($scope.report.not_exists, function (item) { - angular.forEach(item, function (val, key) { - if ($scope.notExistsKeys.indexOf(key) < 0) { - $scope.notExistsKeys.push(key); - } - }) - }); - angular.forEach($scope.report.not_equals, function (item) { - angular.forEach(item, function (val, key) { - if ($scope.notExistsKeys.indexOf(key) < 0) { - $scope.notExistsKeys.push(key); - } - }) - }); - }, function (resp) { - commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); - $scope.report = null; + } + }, + ]) + // old + app.controller('orderValidationCtrl', [ + '$scope', + '$http', + '$filter', + '$stateParams', + 'commonDialog', + function ($scope, $http, $filter, $stateParams, commonDialog) { + $scope.date = $stateParams.date + $scope.startValid = function (forceRebuild) { + $scope.report = { loading: true } + $http + .get('/sys/financial/order_validations/' + $scope.date, { + params: { + use_cache: !forceRebuild, + }, + timeout: 300000, + }) + .then( + function (resp) { + $scope.report = resp.data + $scope.notExistsKeys = [] + $scope.notEqualsKeys = [] + angular.forEach($scope.report.not_exists, function (item) { + angular.forEach(item, function (val, key) { + if ($scope.notExistsKeys.indexOf(key) < 0) { + $scope.notExistsKeys.push(key) + } + }) + }) + angular.forEach($scope.report.not_equals, function (item) { + angular.forEach(item, function (val, key) { + if ($scope.notExistsKeys.indexOf(key) < 0) { + $scope.notExistsKeys.push(key) + } }) - }; - $scope.startValid(false); + }) + }, + function (resp) { + commonDialog.alert({ title: 'Error', content: resp.data.message, type: 'error' }) + $scope.report = null + } + ) + } + $scope.startValid(false) - $scope.fixReport = function () { - var datePattern = $filter('date')($scope.valid.date, 'yyyyMMdd'); - $http.get('/sys/financial/order_validations', { - params: { - date: datePattern, - fix: true - } - }).then(function (resp) { - commonDialog.alert({title: 'Success', content: '修复完毕', type: 'success'}) - }, function (resp) { - commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}) + $scope.fixReport = function () { + var datePattern = $filter('date')($scope.valid.date, 'yyyyMMdd') + $http + .get('/sys/financial/order_validations', { + params: { + date: datePattern, + fix: true, + }, + }) + .then( + function (resp) { + commonDialog.alert({ title: 'Success', content: '修复完毕', type: 'success' }) + }, + function (resp) { + commonDialog.alert({ title: 'Error', content: resp.data.message, type: 'error' }) + } + ) + } + }, + ]) + // new + app.controller('orderValidationNewCtrl', [ + '$scope', + '$http', + '$stateParams', + 'commonDialog', + '$uibModal', + function ($scope, $http, $stateParams, commonDialog, $uibModal) { + // 清除sessionStorage + $scope.$on('$destroy', function () { + sessionStorage.clear() + }) + $scope.date = angular.copy($stateParams.date) + $scope.date = $scope.date.substr(0, 4) + '-' + $scope.date.substr(4, 2) + '-' + $scope.date.substr(6) + $scope.warningLevel = JSON.parse(sessionStorage.getItem('warningLevel')) + // 加载渠道信息 + $scope.startValid = function () { + $http + .get('/sys/financial/order_validation_new/' + $stateParams.date, { + timeout: 300000, + }) + .then( + function (resp) { + $scope.channelList = [] + for (let key in resp.data) { + const obj = {} + obj.key = key + obj.channel = resp.data[key] + obj.selected = false + $scope.channelList.push(obj) + } + $scope.channelList.map(item => { + const arr = item.channel.filter(f => { + return f.success === false + }) + item.status = arr.length ? 'FAILED' : 'SUCCESS' + item.success = arr.length ? false : true + }) + if (sessionStorage.getItem('channel')) { + const channel = JSON.parse(sessionStorage.getItem('channel')) + channel.map(item => { + $scope.channelList.filter(f => f.key === item.key)[0].selected = item.selected }) + } else { + $scope.channelList[0].selected = true + } + console.log($scope.channelList) + }, + function (resp) { + commonDialog.alert({ title: 'Error', content: resp.data.message, type: 'error' }) } - }]); - return app; -}); \ No newline at end of file + ) + } + $scope.startValid() + // 受否折叠 + $scope.fold = function (index) { + $scope.channelList[index].selected = !$scope.channelList[index].selected + } + // 是否清除缓存 + $scope.clear = function (channelName, flag) { + $http.post('/sys/financial/redo_channel_validation/' + $stateParams.date, { channel: channelName, cache: flag }).then( + function () { + $scope.startValid() + }, + function (resp) { + commonDialog.alert({ title: 'failed', content: resp.data.message, type: 'error' }) + } + ) + } + // 处理 + $scope.handle = function (merchant) { + sessionStorage.setItem('channel', JSON.stringify($scope.channelList)) + $uibModal + .open({ + templateUrl: '/static/payment/validation/templates/handle_desc.html', + controller: [ + '$scope', + '$http', + 'commonDialog', + 'merchantInfo', + function ($scope, $http, commonDialog, merchantInfo) { + if (merchantInfo.resolve_msg) { + $scope.message = merchantInfo.resolve_msg + } + $scope.confirm = function () { + $http.post('/sys/financial/mark/resolve/message', { log_id: merchantInfo.log_id, message: $scope.message }).then( + function () { + $scope.$close() + }, + function (resp) { + commonDialog.alert({ title: 'failed', content: resp.data.message, type: 'error' }) + } + ) + } + }, + ], + resolve: { + merchantInfo: [ + '$stateParams', + function () { + return merchant + }, + ], + }, + }) + .result.then(function () { + $scope.startValid() + }) + } + // 下载 + $scope.download = function (merchant, keyName) { + if (merchant != null) { + const params = {} + params.channel = keyName + params.pid = merchant.pid + params.billDate = merchant.bill_date + params.noCache = false + params.billType = '' + window.open( + '/sys/financial/downloadChannelReconciliationFile?billDate=' + + params.billDate + + '&channel=' + + params.channel + + '&noCache=' + + params.noCache + + '&pid=' + + params.pid + + '&billType=' + + params.billType + ) + } + } + // 查看what + $scope.checkStatus = function (transactionId) { + $http.get('/sys/financial/get/transaction/status/' + transactionId, {}).then( + function (resp) { + commonDialog.alert({ title: resp.data.statusInfo, content: '', type: 'success' }) + }, + function (resp) { + commonDialog.alert({ title: 'failed', content: resp.data.message, type: 'error' }) + } + ) + } + }, + ]) + return app +}) diff --git a/src/main/ui/static/payment/validation/templates/handle_desc.html b/src/main/ui/static/payment/validation/templates/handle_desc.html new file mode 100644 index 000000000..4c226da3b --- /dev/null +++ b/src/main/ui/static/payment/validation/templates/handle_desc.html @@ -0,0 +1,25 @@ + + + \ No newline at end of file diff --git a/src/main/ui/static/payment/validation/templates/valid-calendar.html b/src/main/ui/static/payment/validation/templates/valid-calendar.html index 232e60798..f7e6b4970 100644 --- a/src/main/ui/static/payment/validation/templates/valid-calendar.html +++ b/src/main/ui/static/payment/validation/templates/valid-calendar.html @@ -7,19 +7,35 @@
-
+
+
+ +  All channel transactions are reconciled successfully. +
+
+ + Yellow warning: There are some abnormal orders in a channel in the transaction reconciliation + result, such as the difference between the amount of an order in the system and the bill amount + of the corresponding channel. +
+
+ + There are some missing orders in a channel in the result of the transaction reconciliation, + for example, by comparing the statement of a channel, it is found that the payment order was not + found in the system on the same day. +
+
-
\ No newline at end of file diff --git a/src/main/ui/static/payment/validation/templates/valid_new.html b/src/main/ui/static/payment/validation/templates/valid_new.html new file mode 100644 index 000000000..38246adf3 --- /dev/null +++ b/src/main/ui/static/payment/validation/templates/valid_new.html @@ -0,0 +1,278 @@ +
+ +
+
+

{{date}}

+ + + +
+
+
+
+
+
+ + + + + + + + +

{{item.key}}

+
+
Status: {{item.status}} + + (UpdateTime : {{item.channel[0].valid_time}}) +
+
+ Revalidate + + clear + cache +
+
+
+
+
+

{{merchant.pid}}: + (Transaction Time Range : + {{merchant.valid_from_time}} ~ {{merchant.valid_to_time}}) +

+ handle +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Payment Amount in Local CurrencyPayment Transactions NumberRefund Amount in Local CurrencyRefund Transactions NumberTotal Payment NumberTotal Refund Number
+ + {{merchant.channel_analysis.total_paid || merchant.channel_analysis.total_paid + === 0 ? merchant.channel_analysis.total_paid : '-'}} + + {{merchant.channel_analysis.pay_count || merchant.channel_analysis.pay_count === + 0 ? merchant.channel_analysis.pay_count : '-'}} + + {{merchant.channel_analysis.total_refund || + merchant.channel_analysis.total_refund === 0 ? + merchant.channel_analysis.total_refund : '-'}} + + {{merchant.channel_analysis.refund_count || + merchant.channel_analysis.refund_count === 0 ? + merchant.channel_analysis.refund_count : '-'}} + + {{merchant.channel_analysis.total_paid_number || + merchant.channel_analysis.total_paid_number === 0 ? + merchant.channel_analysis.total_paid_number : '-'}} + + {{merchant.channel_analysis.total_refund_number || + merchant.channel_analysis.total_refund_number === 0 ? + merchant.channel_analysis.total_refund_number : '-'}} +
+ {{merchant.db_analysis.total_paid || merchant.db_analysis.total_paid === 0 ? + merchant.db_analysis.total_paid : '-'}} + + {{merchant.db_analysis.pay_count || merchant.db_analysis.pay_count === 0 ? + merchant.db_analysis.pay_count : '-'}} + + {{merchant.db_analysis.total_refund || merchant.db_analysis.total_refund === 0 ? + merchant.db_analysis.total_refund : '-'}} + + {{merchant.db_analysis.refund_count || merchant.db_analysis.refund_count === 0 ? + merchant.db_analysis.refund_count : '-'}} + + {{merchant.db_analysis.total_paid_number || + merchant.db_analysis.total_paid_number === 0 ? + merchant.db_analysis.total_paid_number : '-'}} + + {{merchant.db_analysis.total_refund_number || + merchant.db_analysis.total_refund_number === 0 ? + merchant.db_analysis.total_refund_number : '-'}} +
+ download +
+
+

Not Exists Transactions

+
+ + + + + + + + + + + + + + + + + + + + + + + +
Missing TypeTransaction TimeTransaction IDOrder IDTransaction TypeTransaction AmountOperation
{{ notExist.missing_side ? notExist.missing_side : '-' }}{{ notExist.transaction_time ? notExist.transaction_time : '-' }} + {{ notExist.channel_trans_id ? notExist.channel_trans_id : '-' }} + {{ notExist.order_id ? notExist.order_id : '-' }}{{ notExist.trans_type ? notExist.trans_type : '-' }}{{ notExist.amount || notExist.amount === 0 ? notExist.amount : '-' + }} + + + - + +
+
+
+ +
+

Not Equals Transactions

+
+ + + + + + + + + + + + + + + + + + + + + +
Transaction TimeTransaction IDOrder IDTransaction TypeTransaction AmountOperation
{{notEqual.trans_time ? notEqual.trans_time : '-'}}{{notEqual.transaction_id ? notEqual.transaction_id : '-'}}{{notEqual.order_id ? notEqual.order_id : '-'}}{{notEqual.trans_type ? notEqual.trans_type : '-'}}{{notEqual.channel_amount || notEqual.channel_amount === 0 ? + notEqual.channel_amount : '-'}} + + - + +
+
+
+
+
Handle Description:
+
{{ merchant.resolve_msg }}
+
+
+
+
+
+ + +
+ \ No newline at end of file