Merge branch 'develop'

# Conflicts:
#	pom.xml
master
yixian 4 years ago
commit 40b4d7b18e

@ -5,11 +5,11 @@
<parent>
<groupId>au.com.royalpay.payment</groupId>
<artifactId>payment-parent</artifactId>
<version>2.1.49</version>
<version>2.2.3</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>manage</artifactId>
<version>2.3.34</version>
<version>2.3.38</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jib-maven-plugin.version>2.4.0</jib-maven-plugin.version>

@ -97,6 +97,8 @@ info:
servers:
- url: https://mpay.royalpay.com.au/api/v1.0
description: production
- url: https://au.rpaygroup.com/api/v1.0
description: proxy
- url: https://sandbox.royalpay.com.au/api/v1.0
description: sandbox
tags:
@ -610,7 +612,7 @@ paths:
summary: 卡支付下单
x-sort-order: 0
description: |
商户可在页面引入https://channel.rpayplus.com/channel/v1/view/card_input_frame.js
商户可在页面引入https://channel-gateway.royalpay.com.au/channel/v1/view/card_input_frame.js
并通过回调取得key_id和secret信息并将其作为卡信息提交给royalpay直接完成下单支付。
js引用案例

@ -107,4 +107,6 @@ public interface CleanService {
ByteArrayResource downloadBatchSettleReportXlsx(int batchId);
JSONObject findSettleLog(int clearingId);
JSONObject findClearingDetail(int clearingId, String clientMoniker);
}

@ -84,6 +84,7 @@ import java.text.NumberFormat;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
@ -236,7 +237,6 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
total.put("tax_amount", 0);
total.put("charge_cashback", 0);
List<JSONObject> details = new ArrayList<>();
for (JSONObject log : logs) {
addBigDecimal(total, log, "total_credit");
addBigDecimal(total, log, "total_debit");
@ -249,22 +249,38 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
addBigDecimal(total, log, "tax_amount");
int clearingId = log.getIntValue("clearing_id");
List<JSONObject> logDetails = clearingDetailMapper.listReportsOfSettlement(clearingId);
details.addAll(logDetails);
List<String> banks = logDetails.stream().map(detail -> detail.getString("settle_bank")).distinct().collect(Collectors.toList());
List<JSONObject> bankStatistics = banks.stream().map(bank -> {
JSONObject data = new JSONObject();
data.put("bank", bank);
data.put("total_settle", logDetails.stream()
List<JSONObject> bankCleanLogs = logDetails.stream()
.filter(detail -> bank.equals(detail.getString("settle_bank")))
.collect(Collectors.toList());
data.put("total_settle", bankCleanLogs.stream()
.map(detail -> detail.getBigDecimal("clearing_amount"))
.reduce(BigDecimal::add)
.orElse(BigDecimal.ZERO)
);
data.put("clients", logDetails.stream()
.filter(detail -> bank.equals(detail.getString("settle_bank")))
.count());
data.put("clients", bankCleanLogs.size());
return data;
}).collect(Collectors.toList());
log.put("bank_statistics", bankStatistics);
Map<String, JSONObject> cleanDaysStatistics = Stream.of(1, 2, 3).map(cleanDays -> {
JSONObject data = new JSONObject();
List<JSONObject> cleanDaysDetails = logDetails.stream()
.filter(detail -> detail.getIntValue("clear_days") == cleanDays)
.collect(Collectors.toList());
data.put("clean_days", cleanDays);
data.put("total_settle", cleanDaysDetails.stream()
.map(detail -> detail.getBigDecimal("clearing_amount"))
.reduce(BigDecimal::add)
.orElse(BigDecimal.ZERO));
data.put("clients", cleanDaysDetails.size());
data.put("reports", cleanDaysDetails.size() < 20 ? cleanDaysDetails : cleanDaysDetails.subList(0, 20));
return data;
}).collect(HashMap::new, (map, data) -> map.put("T+" + data.getIntValue("clean_days"), data), Map::putAll);
log.put("clean_days", cleanDaysStatistics);
if (StringUtils.isNotEmpty(log.getString("plan_detail"))) {
try {
log.put("plan_detail", JSON.parseObject(log.getString("plan_detail")));
@ -274,8 +290,15 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
log.put("editable", DateUtils.isSameDay(log.getDate("settle_date"), new Date()) && log.getBooleanValue("editable"));
log.put("channel_analysis", clearingDetailAnalysisMapper.analysisChannelReport(clearingId));
}
Map<String, JSONObject> totalCleanDaysSatistics = Stream.of(1, 2, 3).map(cleanDays -> {
JSONObject cleanDaysReport = new JSONObject();
cleanDaysReport.put("clean_days", "T+" + cleanDays);
cleanDaysReport.put("clients", logs.stream().mapToInt(log -> log.getJSONObject("clean_days").getJSONObject("T+" + cleanDays).getIntValue("clients")).sum());
cleanDaysReport.put("amount", logs.stream().map(log -> log.getJSONObject("clean_days").getJSONObject("T+" + cleanDays).getBigDecimal("total_settle")).reduce(BigDecimal::add).orElse(BigDecimal.ZERO));
return cleanDaysReport;
}).collect(HashMap::new, (map, report) -> map.put(report.getString("clean_days"), report), Map::putAll);
total.put("logs", logs);
total.put("details", details);
total.put("clean_days", totalCleanDaysSatistics);
List<JSONObject> channels = clearingDetailAnalysisMapper.analysisChannelReportDaily(settleDate);
total.put("channel_analysis", channels);
return total;
@ -1048,7 +1071,7 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
Sheet sheet = wb.createSheet("Merchant_Settlement_Info_" + DateFormatUtils.format(reportDate, "yyyyMMdd"));
int rowNum = 0;
Row row = sheet.createRow(rowNum);
String[] title = {"process date","description","order Id", "Client Order Id", "Transaction Time", "Channel", "Gateway", "Exchange Rate", "Transaction Type", "Currency",
String[] title = {"process date", "description", "order Id", "Client Order Id", "Transaction Time", "Channel", "Gateway", "Exchange Rate", "Transaction Type", "Currency",
"Input Amount", "Total Amount", "Clearing Amount(AUD)", "Sruchange Rate", "Surcharge(AUD)", "GST(AUD)", "Settle Amount(AUD)", "Remark", "Dev No", "Dev Remark"};
String[] analysis = {"Total Credit(AUD)", "Total Debit(AUD)", "Gross Amount(AUD)", "Total GST(AUD)", "Total Charge(AUD)", "Net Amount(AUD)"};
for (int i = 0; i < title.length; i++) {
@ -1656,6 +1679,13 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
return clearing;
}
@Override
public JSONObject findClearingDetail(int clearingId, String clientMoniker) {
List<JSONObject> reports = clearingDetailMapper.listReportsOfSettlement(clearingId);
return reports.stream().filter(report -> report.getString("client_moniker").equals(clientMoniker)).findFirst()
.orElseThrow(() -> new NotFoundException("No clearing log found for " + clientMoniker));
}
private void releaseDistributedSurcharge(JSONObject clearingDetail) {
int clientId = clearingDetail.getIntValue("client_id");
BigDecimal distributedSurcharge = clearingDetail.getBigDecimal("distributed_surcharge");

@ -10,7 +10,6 @@ import au.com.royalpay.payment.tools.merchants.beans.BalanceGroup;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import com.alibaba.fastjson.JSONObject;
import org.springframework.core.io.ByteArrayResource;
import org.springframework.core.io.InputStreamResource;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
@ -68,6 +67,11 @@ public class SettlementDevController {
return res;
}
@GetMapping("/clearing/{clearingId}/client_detail/{clientMoniker}")
public JSONObject getClientSettleDetail(@PathVariable int clearingId, @PathVariable String clientMoniker) {
return cleanService.findClearingDetail(clearingId, clientMoniker);
}
@PutMapping("/reports/{date}/clearings/{clearingId}/bank_distribution")
public void modifyClearingBank(@PathVariable String date, @PathVariable int clearingId, @RequestBody JSONObject bankDistribution) {
try {

@ -0,0 +1,28 @@
package au.com.royalpay.payment.manage.management.sysconfig.beans;
import au.com.royalpay.payment.tools.holiday.beans.SettlementRegion;
import javax.validation.constraints.NotEmpty;
public class HolidayConfig {
@NotEmpty
private String description;
@NotEmpty
private SettlementRegion[] regions;
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public SettlementRegion[] getRegions() {
return regions;
}
public void setRegions(SettlementRegion[] regions) {
this.regions = regions;
}
}

@ -1,5 +1,8 @@
package au.com.royalpay.payment.manage.management.sysconfig.core;
import au.com.royalpay.payment.manage.management.sysconfig.beans.HolidayConfig;
import com.alibaba.fastjson.JSONObject;
import java.util.List;
/**
@ -7,7 +10,9 @@ import java.util.List;
*/
public interface ClearDateManager {
List<String> listClearingDays(String monthPattern);
List<JSONObject> listClearingDays(String monthPattern);
void configHoliday(String date, HolidayConfig config);
void setMonthClearDays(String monthPattern, List<String> days);
void removeHolidayConfig(String date);
}

@ -1,18 +1,19 @@
package au.com.royalpay.payment.manage.management.sysconfig.core.impls;
import au.com.royalpay.payment.manage.management.sysconfig.beans.HolidayConfig;
import au.com.royalpay.payment.manage.management.sysconfig.core.ClearDateManager;
import au.com.royalpay.payment.manage.mappers.system.CalendarMapper;
import au.com.royalpay.payment.tools.exceptions.BadRequestException;
import au.com.royalpay.payment.manage.mappers.system.HolidayDAO;
import au.com.royalpay.payment.manage.mappers.system.HolidayMapper;
import au.com.royalpay.payment.tools.holiday.beans.HolidayDefinition;
import au.com.royalpay.payment.tools.holiday.beans.SettlementRegion;
import com.alibaba.fastjson.JSONObject;
import org.joda.time.DateTime;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
/**
* Created by yixian on 2017-01-06.
@ -20,38 +21,37 @@ import java.util.List;
@Service
public class ClearDateManagerImpl implements ClearDateManager {
@Resource
private CalendarMapper calendarMapper;
private DateFormat monthFormat = new SimpleDateFormat("yyyyMM");
private DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd");
private HolidayMapper holidayMapper;
@Override
public List<String> listClearingDays(String monthPattern) {
try {
Date month = monthFormat.parse(monthPattern);
List<Date> dates = calendarMapper.listClearingDates(month);
List<String> dateStrings = new ArrayList<>();
for (Date dt : dates) {
dateStrings.add(dateFormat.format(dt));
}
return dateStrings;
} catch (ParseException e) {
throw new BadRequestException("error.payment.valid.invalid_date_format");
}
public List<JSONObject> listClearingDays(String monthPattern) {
List<HolidayDAO> dates = holidayMapper.listMonthly(monthPattern);
List<HolidayDefinition> definitions = dates.stream().map(HolidayDAO::toHolidayDefine).collect(Collectors.toList());
return definitions.stream().map(this::serializeHolidayDef).collect(Collectors.toList());
}
private JSONObject serializeHolidayDef(HolidayDefinition def) {
JSONObject holiday = new JSONObject();
holiday.put("holiday", new DateTime(def.getHoliday()).toString("yyyy/MM/dd"));
holiday.put("description", def.getDescription());
holiday.put("regions", def.getRegions());
return holiday;
}
@Override
@Transactional
public void setMonthClearDays(String monthPattern, List<String> days) {
try {
Date month = monthFormat.parse(monthPattern);
calendarMapper.resetClearDaysInMonth(month);
List<Date> dates = new ArrayList<>();
for (String day:days){
dates.add(dateFormat.parse(day));
}
calendarMapper.setClearingDays(dates);
} catch (ParseException e) {
throw new BadRequestException("error.payment.valid.invalid_date_format");
public void configHoliday(String date, HolidayConfig config) {
HolidayDAO dao = holidayMapper.findDefine(date);
if (dao == null) {
HolidayDefinition define = new HolidayDefinition(0, new DateTime(date).toDate(), config.getDescription(), config.getRegions());
holidayMapper.saveHoliday(new HolidayDAO(define));
} else {
holidayMapper.updateHolidayDescription(config.getDescription(),
Arrays.stream(config.getRegions()).map(SettlementRegion::toString).collect(Collectors.joining(",")), dao.getHolidayId());
}
}
@Override
public void removeHolidayConfig(String date) {
holidayMapper.deleteHoliday(date);
}
}

@ -1,19 +1,20 @@
package au.com.royalpay.payment.manage.management.sysconfig.web;
import au.com.royalpay.payment.manage.management.sysconfig.beans.HolidayConfig;
import au.com.royalpay.payment.manage.management.sysconfig.core.ClearDateManager;
import au.com.royalpay.payment.manage.management.sysconfig.core.SysPaymentConfig;
import au.com.royalpay.payment.manage.permission.manager.ManagerMapping;
import au.com.royalpay.payment.tools.CommonConsts;
import au.com.royalpay.payment.tools.env.SysConfigManager;
import au.com.royalpay.payment.tools.http.HttpUtils;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import com.alibaba.fastjson.JSONObject;
import org.springframework.validation.Errors;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.List;
/**
* Created by yixian on 2017-01-06.
@ -39,13 +40,19 @@ public class SysConfigController {
}
@ManagerMapping(value = "/clear_days/months/{monthPattern}", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.FINANCIAL_STAFF, ManagerRole.OPERATOR})
public List<String> listClearDays(@PathVariable String monthPattern) {
public List<JSONObject> listClearDays(@PathVariable String monthPattern) {
return clearDateManager.listClearingDays(monthPattern);
}
@ManagerMapping(value = "/clear_days/months/{monthPattern}", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.FINANCIAL_STAFF, ManagerRole.OPERATOR})
public void updateMonthClearDays(@PathVariable String monthPattern, @RequestBody List<String> days) {
clearDateManager.setMonthClearDays(monthPattern, days);
@ManagerMapping(value = "/holidays/{date}", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.FINANCIAL_STAFF})
public void configHoliday(@PathVariable String date, @RequestBody @Valid HolidayConfig config, Errors errors) {
HttpUtils.handleValidErrors(errors);
clearDateManager.configHoliday(date, config);
}
@ManagerMapping(value = "/holidays/{date}", method = RequestMethod.DELETE)
public void deleteHoliday(@PathVariable String date) {
clearDateManager.removeHolidayConfig(date);
}
@ManagerMapping(value = "/payment/config", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.FINANCIAL_STAFF, ManagerRole.OPERATOR})

@ -0,0 +1,61 @@
package au.com.royalpay.payment.manage.mappers.system;
import au.com.royalpay.payment.tools.holiday.beans.HolidayDefinition;
import au.com.royalpay.payment.tools.holiday.beans.SettlementRegion;
import org.joda.time.DateTime;
import java.util.Arrays;
import java.util.stream.Collectors;
public class HolidayDAO {
private int holidayId;
private String holiday;
private String description;
private String regions;
public HolidayDAO() {
}
public HolidayDAO(HolidayDefinition define) {
holiday = new DateTime(define.getHoliday()).toString("yyyy-MM-dd");
description = define.getDescription();
regions = Arrays.stream(define.getRegions()).map(SettlementRegion::toString).collect(Collectors.joining(","));
}
public HolidayDefinition toHolidayDefine() {
return new HolidayDefinition(holidayId, DateTime.parse(holiday).toDate(), description,
Arrays.stream(regions.split(",")).map(SettlementRegion::valueOf).toArray(SettlementRegion[]::new));
}
public int getHolidayId() {
return holidayId;
}
public void setHolidayId(int holidayId) {
this.holidayId = holidayId;
}
public String getHoliday() {
return holiday;
}
public void setHoliday(String holiday) {
this.holiday = holiday;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getRegions() {
return regions;
}
public void setRegions(String regions) {
this.regions = regions;
}
}

@ -0,0 +1,26 @@
package au.com.royalpay.payment.manage.mappers.system;
import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper;
import com.yixsoft.support.mybatis.autosql.annotations.AutoSql;
import com.yixsoft.support.mybatis.autosql.annotations.SqlType;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator;
import java.util.List;
@AutoMapper(tablename = "sys_holidays", pkName = "holiday_id", keyGenerator = Jdbc3KeyGenerator.class)
public interface HolidayMapper {
@AutoSql(SqlType.INSERT)
void saveHoliday(HolidayDAO dao);
List<HolidayDAO> listMonthly(@Param("month") String monthPattern);
@AutoSql(SqlType.DELETE)
void deleteHoliday(@Param("holiday") String holiday);
@AutoSql(SqlType.SELECT)
HolidayDAO findDefine(@Param("holiday") String holiday);
@AutoSql(SqlType.UPDATE)
void updateHolidayDescription(@Param("description") String description, @Param("regions") String regions, @Param("holiday_id") int holidayId);
}

@ -1953,7 +1953,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}};
newConfig.put("ext_rates", extRateParams.toJSONString());
}
clientRateMapper.saveRate(newConfig);
if(newConfig.getBigDecimal("cb_bankpay_rate_value") != null){
clientRateMapper.saveRate(newConfig);
}
logger.info(clientId + "的" + channel + "费率设置成功");
}
}

@ -28,7 +28,11 @@ public class OrgInfo {
private Double wechat_rate_value;
private Double alipayonline_rate_value;
private Double cb_bankpay_rate_value;
private Double rpaypmt_card_rate_value;
// private Double rpaypmt_card_rate_value;
//卡支付-国内卡费率配置
private Double rpaypmt_domestic_card_rate_value;
//卡支付-国际卡费率配置
private Double rpaypmt_overseas_card_rate_value;
private Double rpaypmt_dd_rate_value;
private int is_valid;
private String search_text;
@ -42,6 +46,8 @@ public class OrgInfo {
private Double min_alipayonline_rate;
private Double min_cb_bankpay_rate;
private Double min_rpaypmt_card_rate;
private Double min_rpaypmt_domestic_card_rate;
private Double min_rpaypmt_overseas_card_rate;
private Double min_rpaypmt_dd_rate;
private String state;
private String senior_parent_org_id;
@ -292,17 +298,17 @@ public class OrgInfo {
this.min_cb_bankpay_rate = min_cb_bankpay_rate;
}
public Double getRpaypmt_card_rate_value() {
return rpaypmt_card_rate_value;
}
public Double getRpaypmt_dd_rate_value() {
return rpaypmt_dd_rate_value;
}
/* public Double getRpaypmt_card_rate_value() {
return rpaypmt_card_rate_value;
}
public void setRpaypmt_card_rate_value(Double rpaypmt_card_rate_value) {
this.rpaypmt_card_rate_value = rpaypmt_card_rate_value;
}
}*/
public void setRpaypmt_dd_rate_value(Double rpaypmt_dd_rate_value) {
this.rpaypmt_dd_rate_value = rpaypmt_dd_rate_value;
@ -323,4 +329,38 @@ public class OrgInfo {
public void setMin_rpaypmt_dd_rate(Double min_rpaypmt_dd_rate) {
this.min_rpaypmt_dd_rate = min_rpaypmt_dd_rate;
}
public Double getRpaypmt_domestic_card_rate_value() {
return rpaypmt_domestic_card_rate_value;
}
public void setRpaypmt_domestic_card_rate_value(Double rpaypmt_domestic_card_rate_value) {
this.rpaypmt_domestic_card_rate_value = rpaypmt_domestic_card_rate_value;
}
public Double getRpaypmt_overseas_card_rate_value() {
return rpaypmt_overseas_card_rate_value;
}
public void setRpaypmt_overseas_card_rate_value(Double rpaypmt_overseas_card_rate_value) {
this.rpaypmt_overseas_card_rate_value = rpaypmt_overseas_card_rate_value;
}
public Double getMin_rpaypmt_domestic_card_rate() {
return min_rpaypmt_domestic_card_rate;
}
public void setMin_rpaypmt_domestic_card_rate(Double min_rpaypmt_domestic_card_rate) {
this.min_rpaypmt_domestic_card_rate = min_rpaypmt_domestic_card_rate;
}
public Double getMin_rpaypmt_overseas_card_rate() {
return min_rpaypmt_overseas_card_rate;
}
public void setMin_rpaypmt_overseas_card_rate(Double min_rpaypmt_overseas_card_rate) {
this.min_rpaypmt_overseas_card_rate = min_rpaypmt_overseas_card_rate;
}
}

@ -571,6 +571,7 @@ public class TradeLogServiceImpl implements TradeLogService {
params.put("client_id", clientId);
JSONObject mchConfig = merchantInfoProvider.getMchExtParams(partner.getIntValue("client_id"));
params.put("hide_sub_mch", mchConfig.getBooleanValue("hide_sub_mch"));
params.put("channel", channels);
clientManager.queryModifyClientIds(clientId, params);
List<JSONObject> logs = transactionMapper.listTransFlow(params);
TimeZoneUtils.switchTimeZoneToString(logs, timezone, "dd/MM/yyyy HH:mm:ss", Collections.singletonList("transaction_time"));
@ -775,7 +776,7 @@ public class TradeLogServiceImpl implements TradeLogService {
) {
List<JSONObject> dataList = transFlow.getJSONArray("data").toJavaList(JSONObject.class);
JSONObject parmerters = new JSONObject();
parmerters.put("records",dataList.size());
parmerters.put("records", dataList.size());
parmerters.put("dateFrom", StringUtils.isNotBlank(query.getDatefrom())
? DateFormatUtils.format(DateUtils.parseDate(query.getDatefrom(), "yyyyMMdd"), "dd/MM/yyyy") : "");
parmerters.put("dateTo",

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="au.com.royalpay.payment.manage.mappers.system.HolidayMapper">
<select id="listMonthly" resultType="au.com.royalpay.payment.manage.mappers.system.HolidayDAO">
select * from sys_holidays where holiday like concat(#{month},'-%')
order by holiday
</select>
</mapper>

@ -1,7 +1,7 @@
define(['angular', 'decimal', 'uiBootstrap', 'uiRouter', 'angularEcharts'], function (angular, Decimal) {
'use strict';
var colors = ['#00c0ef', '#00a65a', '#ff851b', '#f39c12', '#d81b60', '#605ca8', '#dd4b39', '#008080', '#8B008B', '#D2691E', '#708090'];
var app = angular.module('clearingLogs', ['ui.bootstrap', 'ui.router', 'ngEcharts']);
let colors = ['#00c0ef', '#00a65a', '#ff851b', '#f39c12', '#d81b60', '#605ca8', '#dd4b39', '#008080', '#8B008B', '#D2691E', '#708090'];
let app = angular.module('clearingLogs', ['ui.bootstrap', 'ui.router', 'ngEcharts']);
app.config(['$stateProvider', function ($stateProvider) {
$stateProvider.state('clearingLogs', {
url: '/analysis/clearing_logs',
@ -54,7 +54,7 @@ define(['angular', 'decimal', 'uiBootstrap', 'uiRouter', 'angularEcharts'], func
app.controller('clearingLogsCtrl', ['$scope', '$http', '$filter', '$timeout', '$uibModal', 'commonDialog', 'chartParser',
function ($scope, $http, $filter, $timeout, $uibModal, commonDialog, chartParser) {
$scope.loadMonthLog = function (month) {
var monthStr = $filter('date')(month, 'yyyyMM');
let monthStr = $filter('date')(month, 'yyyyMM');
$http.get('/sys/settlement/month/' + monthStr + '/settled_dates').then(function (resp) {
$scope.settledDates = resp.data;
});
@ -68,39 +68,39 @@ define(['angular', 'decimal', 'uiBootstrap', 'uiRouter', 'angularEcharts'], func
$scope.loadClearingLogs(1);
};
$scope.chooseYesterday = function () {
var yesterday = new Date();
let yesterday = new Date();
yesterday.setDate(yesterday.getDate() - 1);
$scope.params.begin = $scope.params.end = yesterday;
$scope.loadClearingLogs(1);
};
$scope.chooseLast7Days = function () {
$scope.params.end = new Date();
var day = new Date();
let day = new Date();
day.setDate(day.getDate() - 7);
$scope.params.begin = day;
$scope.loadClearingLogs(1);
};
$scope.thisMonth = function () {
$scope.params.end = new Date();
var monthBegin = new Date();
let monthBegin = new Date();
monthBegin.setDate(1);
$scope.params.begin = monthBegin;
$scope.loadClearingLogs(1);
};
$scope.lastMonth = function () {
var monthFinish = new Date();
let monthFinish = new Date();
monthFinish.setDate(0);
$scope.params.end = monthFinish;
var monthBegin = new Date();
let monthBegin = new Date();
monthBegin.setDate(0);
monthBegin.setDate(1);
$scope.params.begin = monthBegin;
$scope.loadClearingLogs(1);
};
$scope.thisYear = function () {
var yearFinish = new Date();
let yearFinish = new Date();
$scope.params.end = yearFinish;
var currentYearFirstDate = new Date(new Date().getFullYear(), 0, 1);
let currentYearFirstDate = new Date(new Date().getFullYear(), 0, 1);
$scope.params.begin = currentYearFirstDate;
$scope.loadClearingLogs(1);
};
@ -124,7 +124,7 @@ define(['angular', 'decimal', 'uiBootstrap', 'uiRouter', 'angularEcharts'], func
};
$scope.loadClearingLogs = function (page) {
var params = angular.copy($scope.params);
let params = angular.copy($scope.params);
params.page = page || $scope.pagination.page || 1;
if (params.begin) {
params.begin = $filter('date')(params.begin, 'yyyyMMdd');
@ -140,15 +140,15 @@ define(['angular', 'decimal', 'uiBootstrap', 'uiRouter', 'angularEcharts'], func
});
analysisLog(params);
};
var analysisLog = function (params) {
let analysisLog = function (params) {
$http.get('/sys/clean_logs/analysis', {params: params}).then(function (resp) {
$scope.analysis = resp.data;
})
};
$scope.loadClearingLogsHistory = function (days) {
var endDate = new Date();
var startDate = new Date();
let endDate = new Date();
let startDate = new Date();
startDate.setDate(startDate.getDate() - days);
$http.get('/sys/clean_logs/logs', {
params: {
@ -160,7 +160,7 @@ define(['angular', 'decimal', 'uiBootstrap', 'uiRouter', 'angularEcharts'], func
})
};
$scope.loadClearingLogsHistory(7);
var clearingHistoryConfig = {
let clearingHistoryConfig = {
chart: {
tooltip: {
trigger: 'axis',
@ -224,7 +224,7 @@ define(['angular', 'decimal', 'uiBootstrap', 'uiRouter', 'angularEcharts'], func
$scope.generateRate = function (client) {
commonDialog.confirm({title: 'Confirm Required', content: '根据上季度总交易额自动计算下周期费率,确定执行?'}).then(function () {
$http.put('/manage/clearing/clients/' + client.client_moniker + '/auto_rate').then(function (resp) {
var content = 'New Rate value=' + resp.data.rate_value + '; expiry_time=' + $filter('date')(resp.data.expiry_time, 'dd/MMM/yyyy');
let content = 'New Rate value=' + resp.data.rate_value + '; expiry_time=' + $filter('date')(resp.data.expiry_time, 'dd/MMM/yyyy');
commonDialog.alert({
type: 'success',
title: 'New Rate Generated',
@ -248,77 +248,28 @@ define(['angular', 'decimal', 'uiBootstrap', 'uiRouter', 'angularEcharts'], func
$scope.analysisFilter = {};
$scope.currentAnalysis = $scope.detail;
$scope.pageCtrl = {visible: {}};
$scope.searchingClient = null;
function getAnalysisTemplate() {
return [
{settleDays: 1, clients: 0, settleAmount: 0, settles: []},
{settleDays: 2, clients: 0, settleAmount: 0, settles: []},
{settleDays: 3, clients: 0, settleAmount: 0, settles: []}
];
}
$scope.search = {client_moniker: null};
$scope.reloadPage = function () {
$state.reload();
};
$scope.settleAnalysis = getAnalysisTemplate();
$scope.batchAnalysis = {
'All': $scope.settleAnalysis
};
angular.forEach($scope.detail.logs, function (batch) {
$scope.batchAnalysis[batch.clearing_id + ''] = getAnalysisTemplate();
});
$scope.endIndexMap = {};
$scope.initEndIndex = 20;
$scope.more = function (key) {
var endIndex = $scope.endIndexMap[key] + $scope.initEndIndex;
$scope.endIndexMap[key] = endIndex;
if (endIndex > $scope.clientsMap[key].clients) {
$scope.endIndexMap[key] = $scope.clientsMap[key].clients;
$scope.searchClient = function () {
if (!$scope.search.client_moniker) {
$scope.searchingClient = null;
}
if ($scope.currentAnalysis.clearing_id) {
$http.get('/sys/settlement/clearing/' + $scope.currentAnalysis.clearing_id + '/client_detail/' + $scope.search.client_moniker).then(function (resp) {
$scope.searchingClient = resp.data;
}, function (resp) {
commonDialog.alert({type: 'error', title: 'Error', content: resp.data.message});
})
}
};
$scope.packup = function (key) {
$scope.endIndexMap[key] = $scope.initEndIndex;
var length = $scope.clientsMap[key].clients;
if (length <= $scope.initEndIndex)
$scope.endIndexMap[key] = length;
};
$scope.displayAll = function (key) {
var length = $scope.clientsMap[key].clients;
$scope.endIndexMap[key] = length;
$scope.reloadPage = function () {
$state.reload();
};
angular.forEach($scope.detail.details, function (settleItem) {
var settleDays = settleItem.clear_days;
attachAnalysis($scope.settleAnalysis[Math.min(settleDays - 1, 2)]);
attachAnalysis($scope.batchAnalysis[settleItem.clearing_id + ''][Math.min(settleDays - 1, 2)]);
function attachAnalysis(analysisItem) {
analysisItem.settles.push(settleItem);
analysisItem.clients++;
analysisItem.settleAmount = Decimal.add(analysisItem.settleAmount, settleItem.clearing_amount).toFixed(2, Decimal.ROUND_FLOOR);
}
});
$scope.clientsMap = $scope.settleAnalysis;
for (var key in $scope.clientsMap) {
$scope.endIndexMap[key] = $scope.initEndIndex;
var length = $scope.clientsMap[key].clients;
if (length <= $scope.initEndIndex)
$scope.endIndexMap[key] = length;
}
var nowStr = $filter('date')(new Date(), "yyyy-MM-dd");
let nowStr = $filter('date')(new Date(), "yyyy-MM-dd");
$scope.datePattern = $stateParams.date;
if ($scope.datePattern == nowStr) {
$scope.sendNotice = true;
@ -336,6 +287,8 @@ define(['angular', 'decimal', 'uiBootstrap', 'uiRouter', 'angularEcharts'], func
};
$scope.switchSettleBatch = function (batch) {
$scope.search.client_moniker = null;
$scope.searchingClient = null;
if (batch == null) {
$scope.currentAnalysis = $scope.detail;
$scope.analysisFilter.clearing_id = null;
@ -408,10 +361,11 @@ define(['angular', 'decimal', 'uiBootstrap', 'uiRouter', 'angularEcharts'], func
};
$scope.rollbackSettlement = function () {
var log = $scope.getCurrentLog();
commonDialog.confirm({
let log = $scope.getCurrentLog();
commonDialog.dangerConfirm({
title: '确认操作',
content: '回滚当前清算id=' + log.clearing_id + ',确认?'
operation: '回滚当前清算id=' + log.clearing_id + ',确认?',
content: 'Undo Settlement'
}).then(function () {
$http.delete('/sys/settlement/reports/' + $stateParams.date + '/clearings/' + log.clearing_id).then(function () {
$state.reload();
@ -436,7 +390,7 @@ define(['angular', 'decimal', 'uiBootstrap', 'uiRouter', 'angularEcharts'], func
}
});
$scope.remainingAmount = function () {
var total = clearingBatch.net_amount;
let total = clearingBatch.net_amount;
angular.forEach($scope.bankData, function (config) {
total = Decimal.sub(total, config.amount);
});
@ -444,7 +398,7 @@ define(['angular', 'decimal', 'uiBootstrap', 'uiRouter', 'angularEcharts'], func
};
$scope.submitDistribution = function () {
$scope.errmsg = null;
var data = {};
let data = {};
angular.forEach($scope.bankData, function (config) {
data[config.bank] = config.amount;
});
@ -456,41 +410,72 @@ define(['angular', 'decimal', 'uiBootstrap', 'uiRouter', 'angularEcharts'], func
}
}]);
app.controller('settleDateConfigCtrl', ['$scope', '$http', '$filter', 'commonDialog', function ($scope, $http, $filter, commonDialog) {
app.controller('settleDateConfigCtrl', ['$scope', '$http', '$filter', '$uibModal', 'commonDialog', function ($scope, $http, $filter, $uibModal, commonDialog) {
$scope.loadMonthPlan = function (mon) {
$http.get('/sysconfig/clear_days/months/' + $filter('date')(mon, 'yyyyMM')).then(function (resp) {
$http.get('/sysconfig/clear_days/months/' + $filter('date')(mon, 'yyyy-MM')).then(function (resp) {
$scope.activeDates = resp.data;
});
$scope.currentMonth = mon;
};
$scope.triggerDate = function (date) {
if (date.getFullYear() != $scope.currentMonth.getFullYear() || date.getMonth() != $scope.currentMonth.getMonth()) {
return;
}
var str = $filter('date')(date, 'yyyy/MM/dd');
var idx = $scope.activeDates.indexOf(str);
if (idx < 0) {
$scope.activeDates.push(str);
} else {
$scope.activeDates.splice(idx, 1);
}
};
$scope.isDateOn = function (date) {
if ($scope.activeDates != null) {
return $scope.activeDates.indexOf($filter('date')(date, 'yyyy/MM/dd')) >= 0
} else {
return false;
$scope.configHoliday = function (date) {
let holiday = $scope.getHoliday(date);
if (holiday == null) {
holiday = {'holiday': date, regions: []}
}
};
$scope.submitMonthPlan = function () {
$http.put('/sysconfig/clear_days/months/' + $filter('date')($scope.currentMonth, 'yyyyMM'), $scope.activeDates).then(function () {
$scope.loadMonthPlan($scope.currentMonth);
commonDialog.alert({title: 'Success', content: 'Modified plan successful', type: 'success'})
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
$uibModal.open({
templateUrl: '/static/analysis/templates/dialog_holiday_config.html',
controller: ['$scope', 'holiday', function (scope, holiday) {
scope.holiday = angular.copy(holiday);
scope.regionActive = function (region) {
return scope.holiday.regions.indexOf(region) >= 0
};
scope.toggleRegion = function (region) {
let index = scope.holiday.regions.indexOf(region);
if (index >= 0) {
scope.holiday.regions.splice(index, 1);
} else {
scope.holiday.regions.push(region)
}
};
scope.commitHoliday = function () {
scope.$close({operation: 'modify', holiday: scope.holiday})
}
scope.deleteHoliday = function () {
scope.$close({operation: 'delete', holiday: scope.holiday.holiday.replace('/', '-')})
}
}],
resolve: {
holiday: function () {
return holiday;
}
}
}).result.then(function (operation) {
if (operation.operation === 'modify') {
$http.put('/sysconfig/clear_days/holidays/' + (operation.holiday.holiday.replace('/', '-')), operation.holiday).then(function () {
$scope.loadMonthPlan($scope.currentMonth);
commonDialog.alert({title: 'Success', content: 'Modified Holiday successful', type: 'success'})
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
})
} else if (operation.operation === 'delete') {
$http['delete']('/sysconfig/clear_days/holidays/' + operation.holiday).then(function () {
$scope.loadMonthPlan($scope.currentMonth);
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
})
}
})
};
$scope.getHoliday = function (date) {
let dateStr = $filter('date')(date, 'yyyy/MM/dd');
for (let holiday of $scope.activeDates) {
if (holiday.holiday === dateStr) {
return holiday;
}
}
return null;
};
}]);
app.controller('settlementSendCheckCodeCtrl', ['$scope', '$http', '$rootScope', '$stateParams', 'settleLogs', function ($scope, $http, $rootScope, $stateParams, settleLogs) {
$scope.settleLogs = settleLogs.map(log => {

@ -0,0 +1,38 @@
<div class="modal-header">Holiday Config: {{holiday.holiday}}</div>
<div class="modal-body">
<div class="row">
<div class="col-md-12">
<div class="form-group">
<input title="Description" placeholder="Description" ng-model="holiday.description">
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<ul class="list-group">
<li class="list-group-item disabled">Affected Regions</li>
<li class="list-group-item" ng-class="{'active':regionActive('CN_MAINLAND')}"
ng-click="toggleRegion('CN_MAINLAND')">CN MainLand
</li>
<li class="list-group-item" ng-class="{'active':regionActive('CN_HONGKONG')}"
ng-click="toggleRegion('CN_HONGKONG')">CN Hongkong
</li>
<li class="list-group-item" ng-class="{'active':regionActive('AU_VIC')}"
ng-click="toggleRegion('AU_VIC')">AU VIC
</li>
<li class="list-group-item" ng-class="{'active':regionActive('AU_NSW')}"
ng-click="toggleRegion('AU_NSW')">AU NSW
</li>
</ul>
</div>
</div>
</div>
<div class="modal-footer">
<div class="btn-group">
<button ng-click="commitHoliday()" type="button" class="btn btn-primary">Commit</button>
<button ng-click="deleteHoliday()" type="button" class="btn btn-danger" ng-if="holiday.holiday_id">Delete
</button>
<button ng-click="$dismiss()" type="button" class="btn btn-warning">Cancel</button>
</div>
</div>

@ -11,8 +11,14 @@
<div class="row">
<div class="col-xs-12">
<div royal-calendar month-change="loadMonthPlan($month)">
<div class="rc-full" style="font-size: 40px" ng-click="triggerDate(day)">
<i class="fa fa-check-circle text-green" ng-if="isDateOn(day)"></i>
<div class="rc-full" style="color: green" ng-click="configHoliday(day)">
<dl ng-init="holiday=getHoliday(day)" ng-if="holiday!=null">
<dt ng-bind="holiday.description"></dt>
<dd>
<span class="label label-success" ng-repeat="region in holiday.regions"
ng-bind="region"></span>
</dd>
</dl>
</div>
</div>
</div>

@ -81,13 +81,13 @@
</div>
</div>
</div>
<div class="row" ng-if="analysisFilter.clearing_id!=null">
<div class="row" ng-if="currentAnalysis.clearing_id!=null">
<div class="col-xs-12">
<ul class="list-group">
<li class="list-group-item">
<span class="list-group-item-heading">Bank Statistics</span>
</li>
<li class="list-group-item" ng-repeat="bank in getCurrentLog().bank_statistics">
<li class="list-group-item" ng-repeat="bank in currentAnalysis.bank_statistics">
<div class="row">
<span class="col-xs-1 text-bold" ng-bind="bank.bank"></span>
<span class="col-xs-11">
@ -181,15 +181,73 @@
</div>
</div>
<div class="box box-success settle-result-box" ng-if="currentAnalysis.clean_days">
<div class="box-header">
<div class="form-inline">
<div class="input-group">
<input class="form-control" ng-model="search.client_moniker">
<div class="input-group-addon">
<button class="input-group-btn" type="button" ng-click="searchClient()"><i
class="fa fa-search"></i></button>
</div>
</div>
</div>
</div>
<div class="box-body table-responsive" ng-if="searchingClient">
<table class="table table-bordered table-striped table-hover settle-result-table">
<thead>
<tr>
<th>Client Moniker</th>
<th>Transaction Date</th>
<th>Gross Amount</th>
<th>Rate</th>
<th>Total Charge</th>
<th>Net Amount</th>
<th>Tax Amount</th>
<th>Settle Days</th>
<th>Transactions</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<img ng-src="/static/images/bank/{{searchingClient.settle_bank|uppercase}}.png"
class="bank-logo" title="{{searchingClient.settle_bank}}">
<span ng-bind="searchingClient.client_moniker"></span>
</td>
<td>
{{searchingClient.settle_date_from|limitTo:10}}
~
{{searchingClient.settle_date_to|limitTo:10}}
</td>
<td ng-bind="searchingClient.gross_amount|currency:''"></td>
<td ng-bind="searchingClient.rate"></td>
<td ng-bind="searchingClient.total_charge|currency:''"></td>
<td ng-bind="searchingClient.clearing_amount|currency:''"></td>
<td ng-bind="searchingClient.tax_amount"></td>
<td ng-bind="'T+'+searchingClient.clear_days"></td>
<td>
<a ui-sref=".transactions({detailId:searchingClient.clear_detail_id})"
title="View Transactions">
<i class="fa fa-eye"></i>
</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="box box-success settle-result-box"
ng-repeat=" (key, group) in batchAnalysis[analysisFilter.clearing_id==null?'All':analysisFilter.clearing_id+'']">
<div class="box-header" ng-click="pageCtrl.visible[group.settleDays]=!pageCtrl.visible[group.settleDays]">
T+{{group.settleDays}}: Clients:{{group.clients}}
Amount:{{group.settleAmount|currency:''}}
<span class="pull-right" ng-if="pageCtrl.visible[group.settleDays]">Click to show</span>
<span class="pull-right" ng-if="!pageCtrl.visible[group.settleDays]">Click to hide</span>
ng-repeat=" (key, group) in currentAnalysis.clean_days">
<div class="box-header" ng-click="pageCtrl.visible[group.clean_days]=!pageCtrl.visible[group.clean_days]">
{{group.clean_days}}: Clients:{{group.clients}}
Amount:{{group.total_settle|currency:''}}
<span class="pull-right" ng-if="pageCtrl.visible[group.clean_days]">Click to show</span>
<span class="pull-right" ng-if="!pageCtrl.visible[group.clean_days]">Click to hide</span>
</div>
<div class="box-body table-responsive" ng-hide="pageCtrl.visible[group.settleDays]">
<div class="box-body table-responsive" ng-if="currentAnalysis.clearing_id"
ng-hide="pageCtrl.visible[group.clean_days]">
<table class="table table-bordered table-striped table-hover settle-result-table">
<thead>
<tr>
@ -205,9 +263,10 @@
</tr>
</thead>
<tbody>
<tr ng-repeat="settleItem in group.settles.slice(0, endIndexMap[key])">
<tr ng-repeat="settleItem in group.reports">
<td>
<img ng-src="/static/images/bank/{{settleItem.settle_bank|uppercase}}.png" class="bank-logo" title="{{settleItem.settle_bank}}">
<img ng-src="/static/images/bank/{{settleItem.settle_bank|uppercase}}.png" class="bank-logo"
title="{{settleItem.settle_bank}}">
<span ng-bind="settleItem.client_moniker"></span>
</td>
<td>
@ -229,23 +288,6 @@
</tr>
</tbody>
</table>
<a ng-if="group.clients > initEndIndex" class="list-group-item col-sm-12 col-xs-12 text-center" style="width: 49.5%;border: 0;" >
<span style="cursor: pointer;" class="small-box-footer cursor" ng-click="more(key)" ng-if="endIndexMap[key]< group.clients">
更多 <i class="fa fa-arrow-circle-down"></i>
</span>
</a>
<a ng-if="endIndexMap[key]< group.clients" class="list-group-item col-sm-12 col-xs-12 text-center" style="width: 1%;color: #ddd;border: 0;font-size: 30px;padding: 0">|</a>
<a class="list-group-item col-sm-12 col-xs-12 text-center" style="width: 49.5%;border: 0;">
<span style="cursor: pointer;" class="small-box-footer cursor" ng-click="displayAll(key)" ng-if="endIndexMap[key]< group.clients">
全部 <i class="fa fa-arrow-circle-down"></i>
</span>
<span style="cursor: pointer;" class="small-box-footer cursor pull-right"
ng-click="packup(key)"
ng-if="endIndexMap[key] > initEndIndex">
收起 <i class="fa fa-arrow-circle-up"></i>
</span>
</a>
</div>
</div>
</section>

@ -4,7 +4,7 @@
*/
define(['../app', 'angular'], function (app, angular) {
'use strict';
var defaultCfg = {
let defaultCfg = {
size: null,
backdrop: true,
type: 'default'
@ -12,8 +12,8 @@ define(['../app', 'angular'], function (app, angular) {
app.factory('commonDialog', ['$q', '$uibModal', function ($q, $uibModal) {
return {
alert: function (cfg) {
var choises = [{label: 'OK', className: 'btn-default', key: '1'}];
var config = {
let choises = [{label: 'OK', className: 'btn-default', key: '1'}];
let config = {
title: cfg.title,
content: cfg.content,
contentHtml: cfg.contentHtml,
@ -22,7 +22,7 @@ define(['../app', 'angular'], function (app, angular) {
choises: choises,
type: cfg.type
};
var defer = $q.defer();
let defer = $q.defer();
showModalDialog(config).then(function () {
defer.resolve();
}, function () {
@ -31,18 +31,18 @@ define(['../app', 'angular'], function (app, angular) {
return defer.promise;
},
confirm: function (cfg) {
var choises = [{label: 'OK', className: 'btn-success', key: '1'},
let choises = [{label: 'OK', className: 'btn-success', key: '1'},
{label: 'Cancel', className: 'btn-danger', key: '2', dismiss: true}];
var config = {
let config = {
title: cfg.title,
content: cfg.content,
contentHtml: cfg.contentHtml,
json:cfg.json,
json: cfg.json,
backdrop: cfg.backdrop,
size: cfg.size,
choises: cfg.choises || choises
};
var deferred = $q.defer();
let deferred = $q.defer();
showModalDialog(config).then(function (choice) {
if (choice.dismiss) {
deferred.reject();
@ -54,6 +54,29 @@ define(['../app', 'angular'], function (app, angular) {
});
return deferred.promise;
},
dangerConfirm: function (cfg) {
return $uibModal.open({
backdrop: 'static', keyboard: false,
templateUrl: '/static/commons/templates/danger_confirm.html',
size: cfg.size || 'sm',
resolve: {
cfg: function () {
return cfg;
}
},
controller: ['$scope', 'cfg', function ($scope, cfg) {
$scope.title = cfg.title || 'Confirm Operation';
$scope.operation = cfg.operation;
$scope.content = cfg.content || 'Confirm Operation';
$scope.data = {};
$scope.submit = function () {
if ($scope.content === $scope.data.text) {
$scope.$close();
}
};
}]
}).result;
},
inputNum: function (cfg) {
return $uibModal.open({
templateUrl: '/static/commons/templates/num_input.html',
@ -109,12 +132,12 @@ define(['../app', 'angular'], function (app, angular) {
}
}]);
app.controller('commonModalCtrl', ['$scope', '$timeout', 'cfg', function ($scope, $timeout, cfg) {
var bgClasses = {
let bgClasses = {
success: 'bg-success',
error: 'bg-warning',
info: 'bg-info'
};
var glyIcons = {
let glyIcons = {
success: 'glyphicon-ok-circle',
error: 'glyphicon-remove-circle',
info: 'glyphicon-info-sign'

@ -0,0 +1,25 @@
<div class="modal-header">
<h4 ng-bind="title"></h4>
</div>
<div class="modal-body">
<p ng-bind="operation" ng-if="operation"></p>
<p class="text-danger">
Dangerous operation! Please type in <span class="text-bold" ng-bind="content"></span> to confirm
</p>
<div class="form-group">
<input type="text" class="form-control" ng-model="data.text" placeholder="Confirm">
</div>
</div>
<div class="modal-footer">
<div class="pull-right">
<div class="btn-group">
<button class="btn btn-danger" ng-disabled="data.text===content" ng-click="submit()"><i
class="glyphicon glyphicon-ok"></i> OK
</button>
</div>
<div class="btn-group">
<button class="btn btn-default" ng-click="$dismiss()"><i class="glyphicon glyphicon-remove"></i> Cancel
</button>
</div>
</div>
</div>

@ -156,17 +156,17 @@
</div>
<div class="form-group"
ng-class="{'has-error':org_form.cb_bankpay_rate_value.$invalid && org_form.cb_bankpay_rate_value.$dirty}">
<label class="control-label col-sm-2" for="cb_bankpay_rate_value_input">CB BankPay Rate *</label>
<label class="control-label col-sm-2" for="cb_bankpay_rate_value_input">CB BankPay Rate</label>
<div class="col-sm-8">
<div class="input-group">
<input class="form-control" type="number" ng-model="org.cb_bankpay_rate_value"
id="cb_bankpay_rate_value_input" name="cb_bankpay_rate_value"
max="100" min="0" required>
max="100" min="0">
<span class="input-group-addon">%</span>
</div>
</div>
</div>
<div class="form-group"
<!-- <div class="form-group"
ng-class="{'has-error':org_form.rpaypmt_card_rate_value.$invalid && org_form.rpaypmt_card_rate_value.$dirty}">
<label class="control-label col-sm-2" for="rpaypmt_card_rate_value_input">Card Payment Rate *</label>
<div class="col-sm-8">
@ -177,15 +177,44 @@
<span class="input-group-addon">%</span>
</div>
</div>
</div>-->
<!-- 卡支付-国内卡费率配置 -->
<div class="form-group"
ng-class="{'has-error':org_form.rpaypmt_domestic_card_rate_value.$invalid && org_form.rpaypmt_domestic_card_rate_value.$dirty}">
<label class="control-label col-sm-2" for="rpaypmt_domestic_card_rate_value_input">Domestic Card Payment Rate *</label>
<div class="col-sm-8">
<div class="input-group">
<input class="form-control" type="number" ng-model="org.rpaypmt_domestic_card_rate_value"
id="rpaypmt_domestic_card_rate_value_input" name="rpaypmt_domestic_card_rate_value"
max="100" min="0" required>
<span class="input-group-addon">%</span>
</div>
</div>
</div>
<!-- 卡支付-国际卡费率配置 -->
<div class="form-group"
ng-class="{'has-error':org_form.rpaypmt_overseas_card_rate_value.$invalid && org_form.rpaypmt_overseas_card_rate_value.$dirty}">
<label class="control-label col-sm-2" for="rpaypmt_overseas_card_rate_value_input">International Card Payment Rate *</label>
<div class="col-sm-8">
<div class="input-group">
<input class="form-control" type="number" ng-model="org.rpaypmt_overseas_card_rate_value"
id="rpaypmt_overseas_card_rate_value_input" name="rpaypmt_overseas_card_rate_value"
max="100" min="0" required>
<span class="input-group-addon">%</span>
</div>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':org_form.rpaypmt_dd_rate_value.$invalid && org_form.rpaypmt_dd_rate_value.$dirty}">
<label class="control-label col-sm-2" for="rpaypmt_dd_rate_value_input">Direct Debit Rate *</label>
<label class="control-label col-sm-2" for="rpaypmt_dd_rate_value_input">Direct Debit Rate</label>
<div class="col-sm-8">
<div class="input-group">
<input class="form-control" type="number" ng-model="org.rpaypmt_dd_rate_value"
id="rpaypmt_dd_rate_value_input" name="rpaypmt_dd_rate_value"
max="100" min="0" required>
max="100" min="0">
<span class="input-group-addon">%</span>
</div>
</div>
@ -239,7 +268,7 @@
</div>
</div>
</div>
<div class="form-group"
<!-- <div class="form-group"
ng-class="{'has-error':org_form.min_rpaypmt_card_rate.$invalid && org_form.min_rpaypmt_card_rate.$dirty}">
<label class="control-label col-sm-2" for="min_rpaypmt_card_rate_input">Min Card Payment Rate</label>
<div class="col-sm-8">
@ -251,6 +280,35 @@
</div>
</div>
</div>
-->
<!-- 卡支付-国内卡最小费率配置 -->
<div class="form-group"
ng-class="{'has-error':org_form.min_rpaypmt_domestic_card_rate.$invalid && org_form.min_rpaypmt_domestic_card_rate.$dirty}">
<label class="control-label col-sm-2" for="min_rpaypmt_domestic_card_rate_input">Min Domestic Card Payment Rate</label>
<div class="col-sm-8">
<div class="input-group">
<input class="form-control" type="number" ng-model="org.min_rpaypmt_domestic_card_rate"
id="min_rpaypmt_domestic_card_rate_input" name="min_rpaypmt_domestic_card_rate" max="100"
min="0">
<span class="input-group-addon">%</span>
</div>
</div>
</div>
<!-- 卡支付-国内卡最小费率配置 -->
<div class="form-group"
ng-class="{'has-error':org_form.min_rpaypmt_overseas_card_rate.$invalid && org_form.min_rpaypmt_overseas_card_rate.$dirty}">
<label class="control-label col-sm-2" for="min_rpaypmt_overseas_card_rate_input">Min International Card Payment Rate</label>
<div class="col-sm-8">
<div class="input-group">
<input class="form-control" type="number" ng-model="org.min_rpaypmt_overseas_card_rate"
id="min_rpaypmt_overseas_card_rate_input" name="min_rpaypmt_overseas_card_rate" max="100"
min="0">
<span class="input-group-addon">%</span>
</div>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':org_form.min_rpaypmt_dd_rate.$invalid && org_form.min_rpaypmt_dd_rate.$dirty}">
<label class="control-label col-sm-2" for="min_rpaypmt_dd_rate_input">Min Direct Debit Rate</label>

@ -137,23 +137,42 @@
</div>
</div>
<div class="form-group" ng-class="{'has-error':org_form.cb_bankpay_rate_value.$invalid && org_form.cb_bankpay_rate_value.$dirty}">
<label class="control-label col-sm-2" for="cb_bankpay_rate_value_input">CB BankPay Rate *</label>
<label class="control-label col-sm-2" for="cb_bankpay_rate_value_input">CB BankPay Rate</label>
<div class="col-sm-8">
<input class="form-control form-control-float" type="number" ng-model="org.cb_bankpay_rate_value" id="cb_bankpay_rate_value_input" name="cb_bankpay_rate_value" max="100" min="0" required>
<input class="form-control form-control-float" type="number" ng-model="org.cb_bankpay_rate_value" id="cb_bankpay_rate_value_input" name="cb_bankpay_rate_value" max="100" min="0">
<span class="input-group-addon form-control-span">%</span>
</div>
</div>
<div class="form-group" ng-class="{'has-error':org_form.rpaypmt_card_rate_value.$invalid && org_form.rpaypmt_card_rate_value.$dirty}">
<!--<div class="form-group" ng-class="{'has-error':org_form.rpaypmt_card_rate_value.$invalid && org_form.rpaypmt_card_rate_value.$dirty}">
<label class="control-label col-sm-2" for="rpaypmt_card_rate_value_input">Card Payment Rate *</label>
<div class="col-sm-8">
<input class="form-control form-control-float" type="number" ng-model="org.rpaypmt_card_rate_value" id="rpaypmt_card_rate_value_input" name="rpaypmt_card_rate_value" max="100" min="0" required>
<span class="input-group-addon form-control-span">%</span>
</div>
</div>-->
<!-- 卡支付-国内卡费率配置 -->
<div class="form-group" ng-class="{'has-error':org_form.rpaypmt_domestic_card_rate_value.$invalid && org_form.rpaypmt_domestic_card_rate_value.$dirty}">
<label class="control-label col-sm-2" for="rpaypmt_domestic_card_rate_value_input">Domestic Card Payment Rate *</label>
<div class="col-sm-8">
<input class="form-control form-control-float" type="number" ng-model="org.rpaypmt_domestic_card_rate_value" id="rpaypmt_domestic_card_rate_value_input" name="rpaypmt_card_rate_value" max="100" min="0" required>
<span class="input-group-addon form-control-span">%</span>
</div>
</div>
<!-- 卡支付-国际卡费率配置 -->
<div class="form-group" ng-class="{'has-error':org_form.rpaypmt_overseas_card_rate_value.$invalid && org_form.rpaypmt_overseas_card_rate_value.$dirty}">
<label class="control-label col-sm-2" for="rpaypmt_overseas_card_rate_value_input">International Card Payment Rate *</label>
<div class="col-sm-8">
<input class="form-control form-control-float" type="number" ng-model="org.rpaypmt_overseas_card_rate_value" id="rpaypmt_overseas_card_rate_value_input" name="rpaypmt_card_rate_value" max="100" min="0" required>
<span class="input-group-addon form-control-span">%</span>
</div>
</div>
<div class="form-group" ng-class="{'has-error':org_form.rpaypmt_dd_rate_value.$invalid && org_form.rpaypmt_dd_rate_value.$dirty}">
<label class="control-label col-sm-2" for="rpaypmt_dd_rate_value_input">Direct Debit Rate *</label>
<label class="control-label col-sm-2" for="rpaypmt_dd_rate_value_input">Direct Debit Rate</label>
<div class="col-sm-8">
<input class="form-control form-control-float" type="number" ng-model="org.rpaypmt_dd_rate_value" id="rpaypmt_dd_rate_value_input" name="rpaypmt_dd_rate_value" max="100" min="0" required>
<input class="form-control form-control-float" type="number" ng-model="org.rpaypmt_dd_rate_value" id="rpaypmt_dd_rate_value_input" name="rpaypmt_dd_rate_value" max="100" min="0">
<span class="input-group-addon form-control-span">%</span>
</div>
</div>
@ -198,7 +217,7 @@
<span class="input-group-addon form-control-span">%</span>
</div>
</div>
<div class="form-group"
<!-- <div class="form-group"
ng-class="{'has-error':org_form.min_rpaypmt_card_rate.$invalid && org_form.min_rpaypmt_card_rate.$dirty}">
<label class="control-label col-sm-2" for="min_rpaypmt_card_rate_input">Min Card Payment Rate</label>
<div class="col-sm-8">
@ -206,6 +225,28 @@
id="min_rpaypmt_card_rate_input" name="min_rpaypmt_card_rate" max="100" min="0">
<span class="input-group-addon form-control-span">%</span>
</div>
</div>-->
<!-- 卡支付-国内卡最小费率配置 -->
<div class="form-group"
ng-class="{'has-error':org_form.min_rpaypmt_domestic_card_rate.$invalid && org_form.min_rpaypmt_domestic_card_rate.$dirty}">
<label class="control-label col-sm-2" for="min_rpaypmt_domestic_card_rate_input">Min Domestic Card Payment Rate</label>
<div class="col-sm-8">
<input class="form-control form-control-float" type="number" ng-model="org.min_rpaypmt_domestic_card_rate"
id="min_rpaypmt_domestic_card_rate_input" name="min_rpaypmt_domestic_card_rate" max="100" min="0">
<span class="input-group-addon form-control-span">%</span>
</div>
</div>
<!-- 卡支付-国内卡最小费率配置 -->
<div class="form-group"
ng-class="{'has-error':org_form.min_rpaypmt_overseas_card_rate.$invalid && org_form.min_rpaypmt_overseas_card_rate.$dirty}">
<label class="control-label col-sm-2" for="min_rpaypmt_overseas_card_rate_input">Min International Card Payment Rate</label>
<div class="col-sm-8">
<input class="form-control form-control-float" type="number" ng-model="org.min_rpaypmt_overseas_card_rate"
id="min_rpaypmt_overseas_card_rate_input" name="min_rpaypmt_overseas_card_rate" max="100" min="0">
<span class="input-group-addon form-control-span">%</span>
</div>
</div>
<div class="form-group"

@ -230,12 +230,12 @@
<li role="presentation" ng-class="{active:bankCtrl.rate_name=='AlipayOnline'}"><a role="button"
ng-click="bankCtrl.rate_name='AlipayOnline'">Alipay(Online)</a>
</li>
<li role="presentation" ng-class="{active:bankCtrl.rate_name=='Bestpay'}"><a role="button"
<!-- <li role="presentation" ng-class="{active:bankCtrl.rate_name=='Bestpay'}"><a role="button"
ng-click="bankCtrl.rate_name='Bestpay'">Bestpay</a>
</li>
<li role="presentation" ng-class="{active:bankCtrl.rate_name=='jd'}"><a role="button"
ng-click="bankCtrl.rate_name='jd'">JDpay</a>
</li>
</li>-->
<!--<li role="presentation" ng-class="{active:bankCtrl.rate_name=='hf'}"><a role="button" ng-click="bankCtrl.rate_name='hf'">HFpay</a></li>-->
<li role="presentation" ng-class="{active:bankCtrl.rate_name=='Rpay'}"><a role="button"
ng-click="bankCtrl.rate_name='Rpay'">Rpay+</a>

@ -143,7 +143,7 @@
<div class="col-sm-6">
<div class="input-group">
<input type="number" name="cb_bankpay_rate_value" stringToNumber2 class="form-control" ng-model="rate.cb_bankpay_rate_value"
min="0.6" max="5" step="0.1" id="cb_bankpay_rate_value_input" required>
min="0.6" max="5" step="0.1" id="cb_bankpay_rate_value_input">
<div class="input-group-addon">%</div>
</div>
<div ng-messages="rate_form.cb_bankpay_rate_value.$error" ng-if="rate_form.cb_bankpay_rate_value.$dirty">
@ -153,9 +153,9 @@
<div class="small text-danger" ng-message="min">
<i class="glyphicon glyphicon-alert"></i> No less than 0.6%
</div>
<div class="small text-danger" ng-message="required">
<!--<div class="small text-danger" ng-message="required">
<i class="glyphicon glyphicon-alert"></i> Required Field
</div>
</div>-->
</div>
</div>

Loading…
Cancel
Save