Merge remote-tracking branch 'origin/develop' into develop

master
todking 6 years ago
commit bbf2aa3519

@ -10,6 +10,11 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>manage</artifactId>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jib-maven-plugin.version>1.1.2</jib-maven-plugin.version>
<docker-image.version>1.0.3</docker-image.version>
</properties>
<dependencies>
<dependency>
@ -197,6 +202,28 @@
<executable>true</executable>
</configuration>
</plugin>
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<version>${jib-maven-plugin.version}</version>
<configuration>
<from>
<image>hkccr.ccs.tencentyun.com/cross-payment/base:v1.0</image>
</from>
<to>
<image>hkccr.ccs.tencentyun.com/cross-payment-dev/manage-dev:${docker-image.version}</image>
</to>
<allowInsecureRegistries>true</allowInsecureRegistries>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>build</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>

@ -7,13 +7,15 @@ import cn.yixblog.support.mybatis.autosql.annotations.SqlType;
import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator;
import java.util.Date;
import java.util.List;
/**
* Created by davep on 2016-07-28.
*/
@AutoMapper(tablename = "sys_clients", pkName = "client_id", pkAutoIncrement = true)
@AutoMapper(tablename = "sys_clients", pkName = "client_id", keyGenerator = Jdbc3KeyGenerator.class)
public interface ClientAnalysisMapper {
int countNewClients(JSONObject params);
@ -44,5 +46,7 @@ public interface ClientAnalysisMapper {
List<JSONObject> notTradeSubMerchantId();
List<JSONObject> tradeSubMerchantIdBy60Days(@Param("begin") Date begin);
List<JSONObject> countClientsSettlementCycle(JSONObject params);
}

@ -1,7 +1,9 @@
package au.com.royalpay.payment.manage.analysis.mappers;
import cn.yixblog.support.mybatis.autosql.annotations.AutoMapper;
import cn.yixblog.support.mybatis.autosql.annotations.AutoSql;
import cn.yixblog.support.mybatis.autosql.annotations.SqlType;
import cn.yixblog.support.mybatis.paginator.annotations.CountRef;
import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
@ -12,7 +14,7 @@ import java.util.List;
/**
* Created by yishuqian on 09/11/2016.
*/
@AutoMapper(tablename = "statistics_customer_order",pkName = "id")
@AutoMapper(tablename = "statistics_customer_order", pkName = "id")
public interface CustomerAndOrdersStatisticsMapper {
@AutoSql(type = SqlType.INSERT)
void save(JSONObject jsonObject);
@ -50,8 +52,11 @@ public interface CustomerAndOrdersStatisticsMapper {
JSONObject getCommonCount(JSONObject params);
@CountRef(".countAreaMerchantTradeAnalysis")
PageList<JSONObject> getAreaMerchantTradeAnalysis(JSONObject params, PageBounds pageBounds);
int countAreaMerchantTradeAnalysis(JSONObject params);
List<JSONObject> countTradedClientsByDate(JSONObject parasm);
List<JSONObject> getAreaMerchantTradeByLastCycle(JSONObject parasm);

@ -1,5 +1,6 @@
package au.com.royalpay.payment.manage.analysis.mappers;
import cn.yixblog.support.mybatis.paginator.annotations.CountRef;
import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
@ -21,7 +22,10 @@ public interface OrderAnalysisMapper {
JSONObject analysisOrderSuccessRateDetailOfGlobal(@Param("date") Date date);
@CountRef(".countCustomersData")
PageList<JSONObject> listCustomersData(JSONObject params, PageBounds pageBounds);
int countCustomersData(JSONObject params);
JSONObject listCustomersDataAnalysis(JSONObject params);
}

@ -1,6 +1,7 @@
package au.com.royalpay.payment.manage.analysis.mappers;
import cn.yixblog.support.mybatis.autosql.annotations.AutoMapper;
import cn.yixblog.support.mybatis.paginator.annotations.CountRef;
import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
@ -65,22 +66,29 @@ public interface TransactionAnalysisMapper {
JSONObject getAmountRangeAnalysis(JSONObject params);
@CountRef(".countAmountRangeOrders")
PageList<JSONObject> listAmountRangeOrders(JSONObject params, PageBounds pagination);
int countAmountRangeOrders(JSONObject params);
BigDecimal getOneOrder(@Param("order_id") String order_id);
int getCountCustomers(@Param("date") Date date);
JSONObject getClientTransaction(JSONObject params);
PageList<JSONObject> getAreaMerchantAmountAnalysis(JSONObject params,PageBounds pagination);
@CountRef(".countAreaMerchantAmountAnalysis")
PageList<JSONObject> getAreaMerchantAmountAnalysis(JSONObject params, PageBounds pagination);
int countAreaMerchantAmountAnalysis(JSONObject params);
List<JSONObject> getAreaMerchantAmountByCycle(JSONObject params);
JSONObject getOrderClearAmount(@Param("order_id") String order_id);
JSONObject getOrderClearAmount(@Param("order_id") String orderId);
/**
* cny_amount
*
* @param params
* @return
*/

@ -156,7 +156,7 @@ public class BDPrizeServiceImpl implements BDPrizeService {
//todo 10月开始悉尼分公司经理不享受悉尼销售组提成
List<JSONObject> bdLeaders = managerMapper.listByRole(1, ManagerRole.BD_LEADER.getMask());
for (JSONObject leader : bdLeaders) {
BigDecimal groupAmount = transactionMapper.TotalAmountForBDLeaderPrize(now.get(Calendar.YEAR), now.get(Calendar.MONTH) + 1,leader.getString("manager_id"));
BigDecimal groupAmount = transactionMapper.totalAmountForBDLeaderPrize(now.get(Calendar.YEAR), now.get(Calendar.MONTH) + 1,leader.getString("manager_id"));
JSONObject bdConfig = financialBDConfigMapper.getBdConfig(leader.getString("manager_id"));
int bd_type = bdConfig ==null?2:("Sydney").equals(bdConfig.getString("city"))?2:1;//sydney leader 即悉尼大客户经理
JSONObject rateJson = financialBDCommissionConfigMapper.findCurrentCommissionRate(month, groupAmount.toString(), bd_type);
@ -269,7 +269,7 @@ public class BDPrizeServiceImpl implements BDPrizeService {
try {
List<JSONObject> prizeLogList = new ArrayList<>();
JSONObject sydneyPrizeLog = new JSONObject();
BigDecimal sydneyAmount = transactionMapper.TotalAmountForSydneyGMPrize(monthDate.getYear(), monthDate.getMonthOfYear());
BigDecimal sydneyAmount = transactionMapper.totalAmountForSydneyGMPrize(monthDate.getYear(), monthDate.getMonthOfYear());
sydneyPrizeLog.put("total_amount",sydneyAmount);
sydneyPrizeLog.put("bd_type", 3);
JSONObject sydneyGMRate = financialBDCommissionConfigMapper.findCurrentCommissionRate(month, sydneyAmount.toString(), 3);
@ -693,7 +693,20 @@ public class BDPrizeServiceImpl implements BDPrizeService {
@Override
public List<JSONObject> getBDTeamKpiCompletionDegree(String month) {
List<JSONObject> prizeAmountAndBdTypeList = financialBDPrizeLogMapper.findBdPrizeAmountAndBdType(getReportByMonth(month));
JSONObject report = financialBDPrizeRecordMapper.findByMonth(month);
List<JSONObject> prizeAmountAndBdTypeList = new ArrayList<>();
if (report == null) {
try {
Date start_date = DateUtils.parseDate(month+"-01","yyyy-MM-dd");
Date end_date = DateUtils.addMonths(start_date,1);
prizeAmountAndBdTypeList = financialBDPrizeLogMapper.findBdPrizeAmountRealTime(start_date,end_date);
} catch (ParseException e) {
e.printStackTrace();
}
}else{
prizeAmountAndBdTypeList = financialBDPrizeLogMapper.findBdPrizeAmountAndBdType(getReportByMonth(month));
}
for (JSONObject prize : prizeAmountAndBdTypeList) {
BigDecimal kpi = financialBDCommissionConfigMapper.findCurrentCommissionMaxAmount(month, prize.getIntValue("bd_type"));
prize.put("kpi", kpi);
@ -707,12 +720,36 @@ public class BDPrizeServiceImpl implements BDPrizeService {
@Override
public List<JSONObject> getBDProportionByTeamType(String month, String teamType) {
return financialBDConfigMapper.findManagerByTeamType(teamType, getReportByMonth(month));
JSONObject report = financialBDPrizeRecordMapper.findByMonth(month);
if (report == null) {
try {
Date start_date = DateUtils.parseDate(month+"-01","yyyy-MM-dd");
Date end_date = DateUtils.addMonths(start_date,1);
return financialBDConfigMapper.findManagerByTeamTypeRealTime(teamType,start_date,end_date);
} catch (ParseException e) {
e.printStackTrace();
throw new BadRequestException("Month is wrong");
}
}else {
return financialBDConfigMapper.findManagerByTeamType(teamType, getReportByMonth(month));
}
}
@Override
public JSONObject getBDKpiByManagerId(String month, String manager_id) {
return financialBDPrizeLogMapper.findByReportAndBDTotal(getReportByMonth(month), manager_id);
JSONObject report = financialBDPrizeRecordMapper.findByMonth(month);
if (report == null) {
try {
Date start_date = DateUtils.parseDate(month+"-01","yyyy-MM-dd");
Date end_date = DateUtils.addMonths(start_date,1);
return financialBDPrizeLogMapper.findByReportAndBDTotalRealTime(manager_id,start_date,end_date);
} catch (ParseException e) {
e.printStackTrace();
throw new BadRequestException("Month is wrong");
}
}else {
return financialBDPrizeLogMapper.findByReportAndBDTotal(getReportByMonth(month), manager_id);
}
}
public String getReportByMonth(String month) {

@ -96,7 +96,7 @@ public class BDPrizeCalculatorDefaultImpl implements BDPrizeCalculator {
log.put("total_amount", 0);
log.put("total_prize", 0);
log.put("total_donation", 0);
BigDecimal totalAmount = transactionMapper.TotalAmountForBDPrize(year,month1,bd.getString("bd_id"));
BigDecimal totalAmount = transactionMapper.totalAmountForBDPrize(year,month1,bd.getString("bd_id"));
List<JSONObject> details = new ArrayList<>();
for (Map.Entry<String, JSONObject> detail : resultItem.getValue().entrySet()) {
JSONObject detailItem = detail.getValue();

@ -4,15 +4,14 @@ import au.com.royalpay.payment.core.risk.bean.RiskTypeEnum;
import au.com.royalpay.payment.manage.logview.beans.LogRiskQueryBean;
import au.com.royalpay.payment.manage.mappers.log.LogRiskMapper;
import au.com.royalpay.payment.manage.permission.manager.ManagerMapping;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import au.com.royalpay.payment.manage.tradelog.beans.PreRefundQueryBean;
import au.com.royalpay.payment.manage.tradelog.core.TradeLogService;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import au.com.royalpay.payment.tools.utils.PageListUtils;
import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
@ -30,14 +29,14 @@ public class LogRiskController {
@Resource
private TradeLogService tradeLogService;
@RequestMapping(value = "/risk_log/list", method = RequestMethod.GET)
@GetMapping(value = "/risk_log/list")
public JSONObject listLogRisk(LogRiskQueryBean logRiskQueryBean) {
return PageListUtils.buildPageListResult(
logRiskMapper.listWithClientInfo(logRiskQueryBean.toParams(), new PageBounds(logRiskQueryBean.getPage(), logRiskQueryBean.getLimit())));
}
@RequestMapping(value = "/risk_log/typeCharts", method = RequestMethod.GET)
@GetMapping(value = "/risk_log/typeCharts")
public JSONObject typeCharts(LogRiskQueryBean logRiskQueryBean) {
List<JSONObject> statisticsRiskLogList = logRiskMapper.statisticsRiskLog(logRiskQueryBean.toParams());
if (CollectionUtils.isEmpty(statisticsRiskLogList)) {
@ -84,8 +83,8 @@ public class LogRiskController {
return result;
}
@RequestMapping(value = "/pre_refund/list", method = RequestMethod.GET)
@GetMapping(value = "/pre_refund/list")
public JSONObject listPreRefund(PreRefundQueryBean preRefundQueryBean) {
return PageListUtils.buildPageListResult(tradeLogService.listPreRefundClients(preRefundQueryBean));
return tradeLogService.listPreRefundClients(preRefundQueryBean);
}
}

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

@ -4,9 +4,7 @@ import au.com.royalpay.payment.manage.mappers.log.ValidationLogMapper;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import netscape.javascript.JSObject;
import org.apache.commons.lang3.time.DateUtils;
import org.apache.xerces.impl.validation.ValidationManager;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

@ -8,13 +8,14 @@ import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator;
import java.util.List;
/**
* Created by yixian on 2017-03-21.
*/
@AutoMapper(tablename = "act_diet_attend", pkName = "attend_id", pkAutoIncrement = true)
@AutoMapper(tablename = "act_diet_attend", pkName = "attend_id", keyGenerator = Jdbc3KeyGenerator.class)
public interface ActDietAttendMapper {
@AutoSql(type = SqlType.SELECT)

@ -1,11 +1,13 @@
package au.com.royalpay.payment.manage.mappers.client;
import cn.yixblog.support.mybatis.autosql.annotations.AdvanceSelect;
import cn.yixblog.support.mybatis.autosql.annotations.AutoMapper;
import cn.yixblog.support.mybatis.autosql.annotations.AutoSql;
import cn.yixblog.support.mybatis.autosql.annotations.SqlType;
import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
@ -14,6 +16,8 @@ public interface ClientSubMerchantIdMapper {
@AutoSql(type = SqlType.SELECT)
List<JSONObject> listSubMerchantId(PageBounds pageBounds);
List<JSONObject> listSubMerchantIdByDiffDays(@Param("begin") int begin,@Param("end") int end);
@AutoSql(type = SqlType.INSERT)
void save(JSONObject subMerchantId);
@ -22,4 +26,7 @@ public interface ClientSubMerchantIdMapper {
@AutoSql(type = SqlType.DELETE)
void delete(@Param("sub_merchant_id") String sub_merchant_id);
@AutoSql(type = SqlType.DELETE)
void deleteAll();
}

@ -1,17 +1,13 @@
package au.com.royalpay.payment.manage.mappers.custom;
import cn.yixblog.support.mybatis.autosql.annotations.AutoMapper;
import cn.yixblog.support.mybatis.autosql.annotations.AutoSql;
import cn.yixblog.support.mybatis.autosql.annotations.SqlType;
import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import cn.yixblog.support.mybatis.autosql.annotations.AutoMapper;
import cn.yixblog.support.mybatis.autosql.annotations.AutoSql;
import cn.yixblog.support.mybatis.autosql.annotations.SqlType;
/**
* Created by yishuqian on 9/1/16.
*/

@ -7,6 +7,7 @@ import com.alibaba.fastjson.JSONObject;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
@ -39,4 +40,6 @@ public interface FinancialBDConfigMapper {
JSONObject listCityCommission(@Param("city") String city, @Param("record_id") String record_id);
List<JSONObject> findManagerByTeamType(@Param("bd_type") String bdType, @Param("record_id") String record_id);
List<JSONObject> findManagerByTeamTypeRealTime(@Param("bd_type") String bdType, @Param("start_date") Date start_date, @Param("end_date") Date end_date);
}

@ -9,6 +9,7 @@ import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.Date;
import java.util.List;
/**
@ -39,6 +40,27 @@ public interface FinancialBDPrizeLogMapper {
"GROUP BY fbpl.manager_id")
JSONObject findByReportAndBDTotal(@Param("record_id") String recordId, @Param("manager_id") String managerId);
@Select("SELECT\n" +
"\tc.bd_name,\n" +
"\tc.manager_id,\n" +
"\tc.kpi_amount,\n" +
"\tsum( o.total * d.proportion ) AS total_amount \n" +
"FROM\n" +
"\tstatistics_customer_order o\n" +
"\tINNER JOIN sys_clients sc ON sc.client_id = o.client_id\n" +
"\tINNER JOIN sys_client_bd d ON o.client_id = d.client_id\n" +
"\tINNER JOIN financial_bd_config c ON d.bd_id = c.manager_id \n" +
"WHERE\n" +
"\tsc.org_id = 1 \n" +
"\tAND o.date >= #{start_date} \n" +
"\tAND o.date < #{end_date} \n" +
"\tAND d.start_date <= o.date AND d.is_valid = 1 AND ( d.end_date IS NULL OR d.end_date > o.date \n" +
"\t) \n" +
"\tAND c.get_prize = 1 \n" +
"\tAND c.manager_id = #{manager_id}")
JSONObject findByReportAndBDTotalRealTime(@Param("manager_id") String manage_id, @Param("start_date") Date start_date, @Param("end_date") Date end_date);
@Select("SELECT prize_log_id,record_id,manager_id,bd_name,bd_level,SUM(total_amount) total_amount," +
"SUM(total_prize) total_prize,SUM(total_donation) total_donation, SUM(send_prize) send_prize," +
"SUM(hold_prize) hold_prize,last_punish,prize_type FROM financial_bd_prize_log fbpl " +
@ -67,4 +89,23 @@ public interface FinancialBDPrizeLogMapper {
"WHERE prize_type = 1 AND record_id = #{record_id}\n" +
"GROUP BY l.manager_id")
List<JSONObject> findBdPrizeAmountAndBdType(@Param("record_id") String recordId);
@Select("SELECT\n" +
"\tc.*,\n" +
"\tsum( ( o.total ) * d.proportion ) AS total_amount\n" +
"FROM\n" +
"\tstatistics_customer_order o\n" +
"\tINNER JOIN sys_clients sc ON sc.client_id = o.client_id\n" +
"\tINNER JOIN sys_client_bd d ON o.client_id = d.client_id\n" +
"\tINNER JOIN financial_bd_config c ON d.bd_id = c.manager_id \n" +
"WHERE\n" +
"\tsc.org_id = 1 \n" +
"\tAND o.date >= #{start_date} \n" +
"\tAND o.date < #{end_date} \n" +
"\tAND d.start_date <= o.date AND d.is_valid = 1 AND ( d.end_date IS NULL OR d.end_date > o.date \n" +
"\t) \n" +
"\tAND c.bd_group IS NOT NULL \n" +
"GROUP BY\n" +
"\tc.bd_group")
List<JSONObject> findBdPrizeAmountRealTime(@Param("start_date") Date start_date, @Param("end_date") Date end_date);
}

@ -4,13 +4,14 @@ import cn.yixblog.support.mybatis.autosql.annotations.AutoMapper;
import cn.yixblog.support.mybatis.autosql.annotations.AutoSql;
import cn.yixblog.support.mybatis.autosql.annotations.SqlType;
import com.alibaba.fastjson.JSONObject;
import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator;
import java.util.List;
/**
* Created by yixian on 2017-02-07.
*/
@AutoMapper(tablename = "financial_bd_prize_rate_config", pkName = "config_id", pkAutoIncrement = true)
@AutoMapper(tablename = "financial_bd_prize_rate_config", pkName = "config_id", keyGenerator = Jdbc3KeyGenerator.class)
public interface FinancialBDRateConfigMapper {
@AutoSql(type = SqlType.SELECT)
List<JSONObject> listAllConfig();

@ -5,6 +5,7 @@ import cn.yixblog.support.mybatis.autosql.annotations.AutoSql;
import cn.yixblog.support.mybatis.autosql.annotations.SqlType;
import com.alibaba.fastjson.JSONObject;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator;
import java.math.BigDecimal;
import java.util.Date;
@ -13,7 +14,7 @@ import java.util.List;
/**
* Created by yixian on 2017-03-21.
*/
@AutoMapper(tablename = "log_clearing_detail_analysis", pkName = "detail_id", pkAutoIncrement = true)
@AutoMapper(tablename = "log_clearing_detail_analysis", pkName = "detail_id", keyGenerator = Jdbc3KeyGenerator.class)
public interface ClearingDetailAnalysisMapper {
@AutoSql(type = SqlType.INSERT)
void save(JSONObject channel);

@ -7,6 +7,7 @@ import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator;
import java.util.Date;
import java.util.List;
@ -14,7 +15,7 @@ import java.util.List;
/**
* Created by davep on 2016-09-05.
*/
@AutoMapper(tablename = "log_clearing_detail", pkAutoIncrement = true, pkName = "clear_detail_id")
@AutoMapper(tablename = "log_clearing_detail", keyGenerator = Jdbc3KeyGenerator.class, pkName = "clear_detail_id")
public interface ClearingDetailMapper {
@AutoSql(type = SqlType.INSERT)
void save(JSONObject detail);

@ -5,6 +5,7 @@ import cn.yixblog.support.mybatis.autosql.annotations.AutoSql;
import cn.yixblog.support.mybatis.autosql.annotations.SqlType;
import com.alibaba.fastjson.JSONObject;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator;
import java.util.Date;
import java.util.List;
@ -12,7 +13,7 @@ import java.util.List;
/**
* Created by davep on 2016-09-04.
*/
@AutoMapper(tablename = "log_clearing", pkName = "clearing_id", pkAutoIncrement = true)
@AutoMapper(tablename = "log_clearing", pkName = "clearing_id", keyGenerator = Jdbc3KeyGenerator.class)
public interface ClearingLogMapper {
@AutoSql(type = SqlType.INSERT)

@ -22,7 +22,7 @@ public interface NotifyErrorLogMapper {
void saveLog(JSONObject log);
@AutoSql(type = SqlType.SELECT)
@AdvanceSelect(addonWhereClause = "success=0 and addtime(`addtime`,'24:00:00')>now()")
@AdvanceSelect(addonWhereClause = "success=0 and `addtime`>addtime(now(),'-24:00:00')")
List<JSONObject> listErrorLogsInOneHour();
@AutoSql(type = SqlType.UPDATE)

@ -5,6 +5,7 @@ import cn.yixblog.support.mybatis.autosql.annotations.AutoSql;
import cn.yixblog.support.mybatis.autosql.annotations.SqlType;
import com.alibaba.fastjson.JSONObject;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator;
import java.util.Date;
import java.util.List;
@ -12,7 +13,7 @@ import java.util.List;
/**
* Created by yixian on 2016-09-19.
*/
@AutoMapper(tablename = "log_order_validation", pkName = "valid_id", pkAutoIncrement = true)
@AutoMapper(tablename = "log_order_validation", pkName = "valid_id", keyGenerator = Jdbc3KeyGenerator.class)
public interface ValidationLogMapper {
@AutoSql(type = SqlType.INSERT)

@ -38,14 +38,6 @@ public interface OrderMapper {
JSONObject getOrderDetail(@Param("order_id") String orderId);
@AutoSql(type = SqlType.SELECT)
@AdvanceSelect(addonWhereClause = "(status=2 or status=0) and addtime(create_time,'0:05:00')<now()")
List<JSONObject> listUnConfirmedOrders();
@AutoSql(type = SqlType.SELECT)
@AdvanceSelect(addonWhereClause = "(status=2 or status=0) and addtime(create_time,'1:00:00')>now()")
List<JSONObject> listRecentUnconfirmedOrders();
@AutoSql(type = SqlType.SELECT)
PageList<JSONObject> list(JSONObject params, PageBounds pagination);
@ -58,17 +50,7 @@ public interface OrderMapper {
void updateOrderCreationError(@Param("order_id") String orderId, @Param("status") int status, @Param("error_code") String errorCode, @Param("error_message") String errorMessage);
@AutoSql(type = SqlType.UPDATE)
void setWechatMsgSendStatus(@Param("order_id") String orderId, @Param("wechat_notify") int status);
@AutoSql(type = SqlType.UPDATE)
void setIOSMsgSendStatus(@Param("order_id") String orderId, @Param("ios_notify") int status);
@AutoSql(type = SqlType.SELECT)
@AdvanceSelect(addonWhereClause = "status>4 and wechat_notify=1 and addtime(confirm_time,'12:00:00')>now()")
List<JSONObject> listOrdersWithWechatNotifyFailedToday();
int getOldOrdersPoints(@Param("customer_id") String open_id);
int getOldOrdersPoints(@Param("customer_id") String openId);
PageList<JSONObject> listOrderByCustomer(JSONObject params, PageBounds pagination);

@ -4,10 +4,12 @@ import cn.yixblog.support.mybatis.autosql.annotations.AdvanceSelect;
import cn.yixblog.support.mybatis.autosql.annotations.AutoMapper;
import cn.yixblog.support.mybatis.autosql.annotations.AutoSql;
import cn.yixblog.support.mybatis.autosql.annotations.SqlType;
import cn.yixblog.support.mybatis.paginator.annotations.CountRef;
import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator;
import java.math.BigDecimal;
import java.util.Date;
@ -16,50 +18,34 @@ import java.util.List;
/**
* Created by yixian on 2016-07-01.
*/
@AutoMapper(tablename = "pmt_transactions", pkName = "transaction_id", pkAutoIncrement = true)
@AutoMapper(tablename = "pmt_transactions", pkName = "transaction_id", keyGenerator = Jdbc3KeyGenerator.class)
public interface TransactionMapper {
@AutoSql(type = SqlType.INSERT)
void save(JSONObject transaction);
@CountRef(".countTransFlowPage")
PageList<JSONObject> listTransFlowPage(JSONObject params, PageBounds pagination);
int countTransFlowPage(JSONObject params);
List<JSONObject> listTransFlow(JSONObject params);
JSONObject analysisTransFlow(JSONObject params);
Double analysisBalance(JSONObject params);
@AutoSql(type = SqlType.SELECT)
JSONObject findTransById(@Param("transaction_id") String transactionId);
@AutoSql(type = SqlType.SELECT)
@AdvanceSelect(addonWhereClause = "refund_id is null and system_generate=0 and transaction_type = 'Credit'")
JSONObject findIncomeByOrderId(@Param("order_id") String orderId);
@AutoSql(type = SqlType.SELECT)
@AdvanceSelect(addonWhereClause = "transaction_type = 'Credit'")
JSONObject findByOrderId(@Param("order_id") String orderId);
@AutoSql(type = SqlType.SELECT)
@AdvanceSelect(addonWhereClause = "refund_id is null and system_generate=1")
JSONObject findSystemIncomeByOrderId(@Param("order_id") String orderId);
@AutoSql(type = SqlType.UPDATE)
void update(JSONObject transaction);
@AutoSql(type = SqlType.SELECT)
@AdvanceSelect(addonWhereClause = "transaction_type='Debit' and system_generate = 0")
JSONObject findRefundLog(@Param("order_id") String orderId, @Param("refund_id") String refundId);
@AutoSql(type = SqlType.SELECT)
@AdvanceSelect(addonWhereClause = "transaction_type='Credit'")
JSONObject findRefundPayback(@Param("order_id") String orderId, @Param("refund_id") String refundId);
JSONObject findLastIncome();
double getClientUnClearedAmount(@Param("client_id") int clientId);
List<JSONObject> getClientsUnClearedAmount(@Param("client_ids") List<Integer> client_ids);
List<JSONObject> getClientsUnClearedAmount(@Param("client_ids") List<Integer> clientIds);
JSONObject getClientAmountAnalysis(JSONObject params);
@ -75,8 +61,11 @@ public interface TransactionMapper {
PageList<JSONObject> listSettlementLog(JSONObject params, PageBounds pagination);
@CountRef(".countSettlementLogInClients")
PageList<JSONObject> listSettlementLogInClients(JSONObject params, PageBounds pagination);
int countSettlementLogInClients(JSONObject params);
JSONObject analysisSettlementLog(JSONObject params);
List<JSONObject> listSettlementLogTotal(JSONObject params);
@ -97,11 +86,11 @@ public interface TransactionMapper {
List<JSONObject> listTransactionsForBDPrize(@Param("year") int year, @Param("month") int month, @Param("channel") String channel);
BigDecimal TotalAmountForBDPrize(@Param("year") int year, @Param("month") int month, @Param("bd_id") String bd_id);
BigDecimal totalAmountForBDPrize(@Param("year") int year, @Param("month") int month, @Param("bd_id") String bd_id);
BigDecimal TotalAmountForBDLeaderPrize(@Param("year") int year, @Param("month") int month, @Param("bd_group") String bd_group);
BigDecimal totalAmountForBDLeaderPrize(@Param("year") int year, @Param("month") int month, @Param("bd_group") String bd_group);
BigDecimal TotalAmountForSydneyGMPrize(@Param("year") int year, @Param("month") int month);
BigDecimal totalAmountForSydneyGMPrize(@Param("year") int year, @Param("month") int month);
List<JSONObject> listTransactionForCityPartnerCommissionByDate(@Param("year") int year, @Param("month") int month);
@ -117,7 +106,7 @@ public interface TransactionMapper {
@AutoSql(type = SqlType.COUNT)
@AdvanceSelect(addonWhereClause = "transaction_type='Credit'")
int countOrders(@Param("client_id") int client_id);
int countOrders(@Param("client_id") int clientId);
List<JSONObject> listDailyTransactions(@Param("from") Date from, @Param("to") Date to, @Param("dev_id") String devId, @Param("client_id") int clientId, @Param("client_ids") String[] client_ids);
@ -127,16 +116,8 @@ public interface TransactionMapper {
@AdvanceSelect(addonWhereClause = "system_generate=1")
List<JSONObject> findTransactionsBySysGen(@Param("order_id") String orderId);
@AutoSql(type = SqlType.SELECT)
List<JSONObject> findFixTransaction(@Param("order_id") String orderId, @Param("refund_id") String refundId, @Param("system_transaction_id") String systemTransactionId);
BigDecimal analysisCustomerPaid(@Param("customer_id") String customerId, @Param("startDate") Date startDate, @Param("endDate") Date endDate);
@AutoSql(type = SqlType.UPDATE)
void updateTransactionSurcharge(@Param("transaction_id") String transactionId, @Param("surcharge_rate") BigDecimal surchargeRate,
@Param("settle_amount") BigDecimal settleAmount, @Param("total_surcharge") BigDecimal surcharge,
@Param("channel_surcharge") BigDecimal channelSurcharge, @Param("royal_surcharge") BigDecimal royalSurcharge);
List<JSONObject> getSettleDelayAnalysis(@Param("begin") Date begin, @Param("end") Date end);
List<JSONObject> getSettleDelayTotalTransaction(@Param("begin") Date begin, @Param("end") Date end);

@ -11,8 +11,9 @@ import java.util.List;
import cn.yixblog.support.mybatis.autosql.annotations.AutoMapper;
import cn.yixblog.support.mybatis.autosql.annotations.AutoSql;
import cn.yixblog.support.mybatis.autosql.annotations.SqlType;
import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator;
@AutoMapper(tablename = "sys_client_pre_apply", pkName = "client_pre_apply_id",pkAutoIncrement = true)
@AutoMapper(tablename = "sys_client_pre_apply", pkName = "client_pre_apply_id",keyGenerator = Jdbc3KeyGenerator.class)
public interface SysClientPreMapperMapper {
@AutoSql(type = SqlType.UPDATE)
void update(JSONObject data);

@ -11,7 +11,7 @@ import java.util.List;
/**
* Created by yishuqian on 04/01/2017.
*/
@AutoMapper(tablename = "act_black_list")
@AutoMapper(tablename = "act_black_list", pkName = {"act_id", "client_id"})
public interface ActBlackListMapper {
@AutoSql(type = SqlType.INSERT)
void save(JSONObject blackObj);

@ -16,12 +16,15 @@ public interface ClearingDistributedSurchargeMapper {
List<JSONObject> findTransactions(@Param("client_id") int clientId);
@AutoSql(type = SqlType.UPDATE)
void update(JSONObject transaction);
@AutoSql(type = SqlType.INSERT)
void save(JSONObject transactions);
List<JSONObject> getMonthDetailByClientId(@Param("datefrom") Date datefrom, @Param("dateto") Date dateto);
List<JSONObject> findTransactionsByDate(JSONObject params);
List<JSONObject> findSurchargeTransactionsByDetailId(@Param("client_id") int clientId, @Param("detailId") String detailId);
List<JSONObject> listUnClearedByMonth(@Param("dateto") DateTime dateTo);
}

@ -5,13 +5,14 @@ import cn.yixblog.support.mybatis.autosql.annotations.AutoSql;
import cn.yixblog.support.mybatis.autosql.annotations.SqlType;
import com.alibaba.fastjson.JSONObject;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator;
import java.util.List;
/**
* Created by davep on 2016-08-16.
*/
@AutoMapper(tablename = "sys_bank_accounts", pkAutoIncrement = true, pkName = "bank_account_id")
@AutoMapper(tablename = "sys_bank_accounts", keyGenerator = Jdbc3KeyGenerator.class, pkName = "bank_account_id")
public interface ClientBankAccountMapper {
@AutoSql(type = SqlType.SELECT)

@ -10,6 +10,7 @@ import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator;
import java.util.Date;
import java.util.List;
@ -17,7 +18,7 @@ import java.util.List;
/**
* Created by yixian on 2016-06-25.
*/
@AutoMapper(tablename = "sys_clients", pkName = "client_id", pkAutoIncrement = true)
@AutoMapper(tablename = "sys_clients", pkName = "client_id", keyGenerator = Jdbc3KeyGenerator.class)
public interface ClientMapper {
@AutoSql(type = SqlType.SELECT)
@AdvanceSelect(addonWhereClause = "is_valid=1")

@ -5,6 +5,7 @@ import cn.yixblog.support.mybatis.autosql.annotations.AutoSql;
import cn.yixblog.support.mybatis.autosql.annotations.SqlType;
import com.alibaba.fastjson.JSONObject;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator;
import java.util.Date;
import java.util.List;
@ -12,7 +13,7 @@ import java.util.List;
/**
* Created by davep on 2016-08-16.
*/
@AutoMapper(tablename = "sys_client_rates", pkName = "client_rate_id", pkAutoIncrement = true)
@AutoMapper(tablename = "sys_client_rates", pkName = "client_rate_id", keyGenerator = Jdbc3KeyGenerator.class)
public interface ClientRateMapper {
List<JSONObject> listCurrentClientRates(@Param("client_id") int clientId, @Param("date") Date date, @Param("rate_name") String rateName);

@ -6,11 +6,12 @@ import cn.yixblog.support.mybatis.autosql.annotations.AutoSql;
import cn.yixblog.support.mybatis.autosql.annotations.SqlType;
import com.alibaba.fastjson.JSONObject;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator;
/**
* Created by davep on 2016-08-03.
*/
@AutoMapper(tablename = "sys_customer_relation", pkName = "relation_id", pkAutoIncrement = true)
@AutoMapper(tablename = "sys_customer_relation", pkName = "relation_id", keyGenerator = Jdbc3KeyGenerator.class)
public interface CustomerMapper {
@AutoSql(type = SqlType.INSERT)

@ -8,13 +8,14 @@ import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator;
import java.util.List;
/**
* Created by yixian on 2016-10-18.
*/
@AutoMapper(tablename = "sys_org", pkName = "org_id", pkAutoIncrement = true)
@AutoMapper(tablename = "sys_org", pkName = "org_id", keyGenerator = Jdbc3KeyGenerator.class)
public interface OrgMapper {
@AutoSql(type = SqlType.SELECT)
@AdvanceSelect(addonWhereClause = "type != 1")

@ -1,20 +1,18 @@
package au.com.royalpay.payment.manage.mappers.system;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.alibaba.fastjson.JSONObject;
import cn.yixblog.support.mybatis.autosql.annotations.AdvanceSelect;
import cn.yixblog.support.mybatis.autosql.annotations.AutoMapper;
import cn.yixblog.support.mybatis.autosql.annotations.AutoSql;
import cn.yixblog.support.mybatis.autosql.annotations.SqlType;
import com.alibaba.fastjson.JSONObject;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator;
import java.util.List;
/**
* Created by yixian on 2017-02-28.
*/
@AutoMapper(tablename = "sys_permission_partner_modules", pkName = "id",pkAutoIncrement = true)
@AutoMapper(tablename = "sys_permission_partner_modules", pkName = "id",keyGenerator = Jdbc3KeyGenerator.class)
public interface PermissionPartnerModuleMapper {
@AutoSql(type = SqlType.INSERT)
void save(JSONObject module);

@ -5,13 +5,14 @@ import cn.yixblog.support.mybatis.autosql.annotations.AutoSql;
import cn.yixblog.support.mybatis.autosql.annotations.SqlType;
import com.alibaba.fastjson.JSONObject;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator;
import java.util.List;
/**
* Created by yishuqian on 11/11/2016.
*/
@AutoMapper(tablename = "austrac_report_config", pkName = "pkid", pkAutoIncrement = true)
@AutoMapper(tablename = "austrac_report_config", pkName = "pkid", keyGenerator = Jdbc3KeyGenerator.class)
public interface ReportConfigMapper {
@AutoSql(type = SqlType.UPDATE)
void update(JSONObject jsonObject);

@ -13,7 +13,7 @@ public interface MerchantIdManageService {
void generateClientsSunMerchantId();
JSONObject listNotTradeSubMerchantId(JSONObject manager);
JSONObject listNotTradeSubMerchantId(int type, JSONObject manager);
List<JSONObject> showClientMoniker(JSONObject manager,String sub_merchant_id);

@ -19,19 +19,18 @@ import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.lang3.RandomStringUtils;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMethod;
import javax.annotation.Resource;
import java.io.IOException;
import java.net.URISyntaxException;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
/**
@ -66,22 +65,41 @@ public class MerchantIdManageServiceImpl implements MerchantIdManageService {
return getClientMap(clients);
}
@Override
public JSONObject listNotTradeSubMerchantId(JSONObject manager) {
List<JSONObject> clients = clientSubMerchantIdMapper.listSubMerchantId(new PageBounds(Order.formString("create_time.desc")));
public JSONObject listNotTradeSubMerchantId(int type, JSONObject manager) {
List<JSONObject> clients = new ArrayList<>();
switch (type) {
case 0: //all
clients = clientSubMerchantIdMapper.listSubMerchantId(new PageBounds(Order.formString("diff_days.desc")));
break;
case 1://0~15天
clients = clientSubMerchantIdMapper.listSubMerchantIdByDiffDays(0,15);
break;
case 2://15~30天
clients = clientSubMerchantIdMapper.listSubMerchantIdByDiffDays(15,30);
break;
case 3://30~45天
clients = clientSubMerchantIdMapper.listSubMerchantIdByDiffDays(30,45);
break;
case 4://45~60天
clients = clientSubMerchantIdMapper.listSubMerchantIdByDiffDays(45,60);
break;
default:
break;
}
Map<String, List<JSONObject>> merchantIdMap = clients.stream().filter(t->t.containsKey("merchant_id")).filter(t->t.containsKey("sub_merchant_id")).collect(Collectors.groupingBy(t->t.getString("merchant_id")));
JSONObject returnJason = new JSONObject();
returnJason.put("merchant_id_map",merchantIdMap);
returnJason.put("refresh_time",clients.size()>0?clients.get(0).getDate("create_time"):"");
return returnJason;
}
@Override
public void generateClientsSunMerchantId() {
//重构未交易商户号逻辑
String tempSubMerchantIds = sysConfigManager.getSysConfig().getString("temp_sub_mch_id");
List<JSONObject> clients = clientAnalysisMapper.notTradeSubMerchantId();
List<JSONObject> clientSubMerchantId = clientSubMerchantIdMapper.listSubMerchantId(new PageBounds(Order.formString("create_time.desc")));
Map<String, JSONObject> subMerchantIdMapFromDB = new HashMap<>();
for (JSONObject id : clientSubMerchantId) {
subMerchantIdMapFromDB.put(id.getString("sub_merchant_id"), id);
List<JSONObject> clients = clientAnalysisMapper.tradeSubMerchantIdBy60Days(DateUtils.addDays(new Date(), -60));
if (clients.size() > 0) {
clientSubMerchantIdMapper.deleteAll();
}
for (JSONObject client: clients) {
String subMerchantId = client.getString("sub_merchant_id");
@ -90,15 +108,7 @@ public class MerchantIdManageServiceImpl implements MerchantIdManageService {
}
String id = client.getString("sub_merchant_id");
client.put("create_time",new Date());
if (subMerchantIdMapFromDB.containsKey(id)) {
subMerchantIdMapFromDB.remove(id);
clientSubMerchantIdMapper.update(client);
} else {
clientSubMerchantIdMapper.save(client);
}
}
for (String id : subMerchantIdMapFromDB.keySet()) {
clientSubMerchantIdMapper.delete(id);
clientSubMerchantIdMapper.save(client);
}
}

@ -38,8 +38,8 @@ public class MerchantIdManageController {
@RequestMapping(method = RequestMethod.GET,value = "/trade")
@RequireManager(role = {ManagerRole.OPERATOR})
public JSONObject listNotTradeSubMerchantId(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
return merchantIdManageService.listNotTradeSubMerchantId(manager);
public JSONObject listNotTradeSubMerchantId(int type,@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
return merchantIdManageService.listNotTradeSubMerchantId(type, manager);
}
@RequestMapping(method = RequestMethod.POST,value = "/refresh")

@ -3,33 +3,23 @@ package au.com.royalpay.payment.manage.merchants.core;
import au.com.royalpay.payment.core.exceptions.EmailException;
import au.com.royalpay.payment.manage.appclient.beans.AppClientBean;
import au.com.royalpay.payment.manage.appclient.beans.AppMerchantBean;
import au.com.royalpay.payment.manage.merchants.beans.BankAccountInfo;
import au.com.royalpay.payment.manage.merchants.beans.ClientAuthFilesInfo;
import au.com.royalpay.payment.manage.merchants.beans.ClientRateConfig;
import au.com.royalpay.payment.manage.merchants.beans.ClientRegisterInfo;
import au.com.royalpay.payment.manage.merchants.beans.NewAccountBean;
import au.com.royalpay.payment.manage.merchants.beans.PartnerQuery;
import au.com.royalpay.payment.manage.merchants.beans.SubMerchantIdApply;
import au.com.royalpay.payment.manage.merchants.beans.*;
import au.com.royalpay.payment.manage.tradelog.beans.TradeLogQuery;
import au.com.royalpay.payment.tools.merchants.beans.QRCodeConfig;
import au.com.royalpay.payment.tools.merchants.beans.UpdateSurchargeDTO;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.apache.ibatis.annotations.Param;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.OutputStream;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
/**
* Created by yixian on 2016-06-25.
*/
@ -287,7 +277,7 @@ public interface ClientManager {
List<JSONObject> getAccountDetailByMonths(JSONObject account,String clientMoniker);
List<JSONObject> getAccountTransactionsByDate(JSONObject account,String clientMoniker, String date);
List<JSONObject> getAccountTransactionsByDetailId(JSONObject account,String clientMoniker, String detailId);
List<JSONObject> getAccountMonthDetails(JSONObject account,String clientMoniker);
@ -432,4 +422,6 @@ public interface ClientManager {
void resetRefundPasswordByManage(String clientMoniker,JSONObject manage, JSONObject json);
List<Integer> listLevel3Client(int client_id);
void updateRefundCreditLine(JSONObject manager, String clientMoniker, JSONObject refundLineInfo);
}

@ -16,7 +16,6 @@ import au.com.royalpay.payment.channels.yeepay.runtime.YeePayClient;
import au.com.royalpay.payment.core.PaymentChannelApi;
import au.com.royalpay.payment.core.exceptions.EmailException;
import au.com.royalpay.payment.core.exceptions.InvalidShortIdException;
import au.com.royalpay.payment.core.exceptions.ParamInvalidException;
import au.com.royalpay.payment.core.utils.OrderExpiryRuleResolver;
import au.com.royalpay.payment.manage.analysis.mappers.TransactionAnalysisMapper;
import au.com.royalpay.payment.manage.appclient.beans.AppClientBean;
@ -25,30 +24,16 @@ import au.com.royalpay.payment.manage.application.core.SimpleClientApplyService;
import au.com.royalpay.payment.manage.device.core.DeviceManager;
import au.com.royalpay.payment.manage.management.sysconfig.core.impls.PermissionPartnerManagerImpl;
import au.com.royalpay.payment.manage.mappers.financial.FinancialBDConfigMapper;
import au.com.royalpay.payment.manage.mappers.log.ClearingDetailMapper;
import au.com.royalpay.payment.manage.mappers.log.ClearingLogMapper;
import au.com.royalpay.payment.manage.mappers.log.ClientsOperationLogMapper;
import au.com.royalpay.payment.manage.mappers.log.LogClientSubMerchantIdMapper;
import au.com.royalpay.payment.manage.mappers.log.LogSettleMailMapper;
import au.com.royalpay.payment.manage.mappers.log.*;
import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper;
import au.com.royalpay.payment.manage.mappers.redpack.ActClientInvitationCodeMapper;
import au.com.royalpay.payment.manage.mappers.risk.RiskAttentionMerchantsMapper;
import au.com.royalpay.payment.manage.mappers.system.*;
import au.com.royalpay.payment.manage.merchants.beans.ActivityPosterBuilder;
import au.com.royalpay.payment.manage.merchants.beans.BankAccountInfo;
import au.com.royalpay.payment.manage.merchants.beans.ClientAuthFilesInfo;
import au.com.royalpay.payment.manage.merchants.beans.ClientRateConfig;
import au.com.royalpay.payment.manage.merchants.beans.ClientRegisterInfo;
import au.com.royalpay.payment.manage.merchants.beans.NewAccountBean;
import au.com.royalpay.payment.manage.merchants.beans.PartnerQuery;
import au.com.royalpay.payment.manage.merchants.beans.SubMerchantIdApply;
import au.com.royalpay.payment.manage.merchants.core.ClientComplyValidator;
import au.com.royalpay.payment.manage.merchants.core.ClientConfigService;
import au.com.royalpay.payment.manage.merchants.core.ClientInfoCacheSupport;
import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import au.com.royalpay.payment.manage.merchants.core.ClientModifySupport;
import au.com.royalpay.payment.manage.merchants.beans.*;
import au.com.royalpay.payment.manage.merchants.core.*;
import au.com.royalpay.payment.manage.merchants.entity.impls.*;
import au.com.royalpay.payment.manage.notice.core.MailService;
import au.com.royalpay.payment.manage.permission.utils.OrgCheckUtils;
import au.com.royalpay.payment.manage.signin.beans.TodoNotice;
import au.com.royalpay.payment.manage.signin.core.ManagerTodoNoticeProvider;
import au.com.royalpay.payment.manage.signin.core.SignInAccountService;
@ -72,7 +57,6 @@ import au.com.royalpay.payment.tools.inspiry.core.InspiryPOSFinder;
import au.com.royalpay.payment.tools.locale.LocaleSupport;
import au.com.royalpay.payment.tools.lock.Locker;
import au.com.royalpay.payment.tools.mail.SendMail;
import org.apache.commons.codec.binary.Base64;
import au.com.royalpay.payment.tools.merchants.beans.QRCodeConfig;
import au.com.royalpay.payment.tools.merchants.beans.UpdateSurchargeDTO;
import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider;
@ -80,31 +64,24 @@ import au.com.royalpay.payment.tools.merchants.qrboard.QRBoard;
import au.com.royalpay.payment.tools.merchants.qrboard.QRBoardProvider;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import au.com.royalpay.payment.tools.permission.enums.PartnerRole;
import au.com.royalpay.payment.tools.utils.ImageUtils;
import au.com.royalpay.payment.tools.utils.PageListUtils;
import au.com.royalpay.payment.tools.utils.PasswordUtils;
import au.com.royalpay.payment.tools.utils.PdfUtils;
import au.com.royalpay.payment.tools.utils.QRCodeUtils;
import au.com.royalpay.payment.tools.utils.TimeZoneUtils;
import au.com.royalpay.payment.tools.utils.*;
import au.com.royalpay.payment.tools.websocket.notify.PartnerPageEvent;
import cn.yixblog.platform.http.HttpRequestGenerator;
import cn.yixblog.platform.http.HttpRequestResult;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.Order;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import com.yeepay.yop.sdk.service.kj.model.SubmerchantRegisterResult;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.RandomStringUtils;
import org.apache.commons.lang3.RandomUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.apache.el.parser.AstNot;
import org.apache.http.client.utils.URLEncodedUtils;
import org.dom4j.Element;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -124,6 +101,13 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.thymeleaf.context.Context;
import org.thymeleaf.spring4.SpringTemplateEngine;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import javax.crypto.*;
import javax.crypto.spec.SecretKeySpec;
import javax.imageio.ImageIO;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.*;
@ -131,34 +115,18 @@ import java.math.BigDecimal;
import java.math.RoundingMode;
import java.net.URISyntaxException;
import java.net.URL;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.security.InvalidKeyException;
import java.security.InvalidParameterException;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.List;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import javax.crypto.*;
import javax.crypto.spec.DESKeySpec;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import javax.imageio.ImageIO;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import cn.yixblog.platform.http.HttpRequestGenerator;
import cn.yixblog.platform.http.HttpRequestResult;
import sun.misc.BASE64Encoder;
import static au.com.royalpay.payment.manage.permission.utils.OrgCheckUtils.checkOrgPermission;
/**
@ -1896,7 +1864,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
JSONObject clientInfo = getClientInfo(Integer.parseInt(currentClientId));
if (clientInfo.containsKey("parent_client_id")) {
int parentClientId = clientInfo.getIntValue("parent_client_id");
if (parentClientId != client_id && !listLevel3Client(client_id).contains(parentClientId)) {
if (parentClientId != client_id && client_id!= Integer.parseInt(currentClientId) && !listLevel3Client(client_id).contains(parentClientId)) {
throw new Exception("partner has no permission");
}
}
@ -1910,6 +1878,22 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
return clientMapper.childClientId(clientId);
}
@Override
public void updateRefundCreditLine(JSONObject manager, String clientMoniker, JSONObject refundLineInfo) {
JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) {
throw new InvalidShortIdException();
}
OrgCheckUtils.checkOrgPermission(manager, client);
JSONObject update = new JSONObject();
int clientId = client.getIntValue("client_id");
BigDecimal refundCreditLine = refundLineInfo.getBigDecimal("refund_credit_line");
update.put("client_id", clientId);
update.put("refund_credit_line", refundCreditLine);
clientMapper.update(update);
clientInfoCacheSupport.clearClientCache(clientId);
}
@Override
@Transactional
public void updateClientBDUsers(JSONObject manager, String clientMoniker, JSONObject data) throws Exception {
@ -3510,7 +3494,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
List<JSONObject> transactions = clearingDistributedSurchargeMapper.findTransactions(client.getIntValue("client_id"));
transactions.forEach(e -> {
if ("Credit".equals(e.getString("type"))) {
if ("Credit".equals(e.getString("type")) && !"settle revoke".equals(e.getString("remark"))) {
JSONObject manager = managerMapper.findDetail(e.getString("operation"));
e.put("operator_displayname", manager.getString("display_name"));
}
@ -3528,24 +3512,12 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
@Override
public List<JSONObject> getAccountTransactionsByDate(JSONObject account, String clientMoniker, String date) {
public List<JSONObject> getAccountTransactionsByDetailId(JSONObject account, String clientMoniker, String detailId) {
JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) {
throw new InvalidShortIdException();
}
JSONObject params = new JSONObject();
params.put("client_id", client.getIntValue("client_id"));
params.put("year", date.substring(0, 4));
params.put("month", date.substring(date.length() - 2, date.length()));
List<JSONObject> transactions = clearingDistributedSurchargeMapper.findTransactionsByDate(params);
transactions.forEach(e -> {
if ("Credit".equals(e.getString("type"))) {
JSONObject manager = managerMapper.findDetail(e.getString("operation"));
e.put("operator_displayname", manager.getString("display_name"));
}
});
return transactions;
return clearingDistributedSurchargeMapper.findSurchargeTransactionsByDetailId(client.getIntValue("client_id"),detailId);
}
@Override
@ -3554,8 +3526,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
if (client == null) {
throw new InvalidShortIdException();
}
List<JSONObject> details = financialSurchargeAccountDetailMapper.findDetailsByClientId(client.getIntValue("client_id"));
return details;
return financialSurchargeAccountDetailMapper.findDetailsByClientId(client.getIntValue("client_id"));
}
@Override
@ -3573,19 +3544,19 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
throw new ServerErrorException("Processing task, wait for a moment");
}
try {
JSONObject surcharge_account = clientsSurchargeAccountsMapper.find(client.getIntValue("client_id"));
JSONObject surchargeAccount = clientsSurchargeAccountsMapper.find(client.getIntValue("client_id"));
transaction.put("client_id", client.getIntValue("client_id"));
transaction.put("type", "Credit");
transaction.put("total_surcharge", BigDecimal.ZERO);
transaction.put("tax_amount", BigDecimal.ZERO);
transaction.put("post_balance", surcharge_account.getBigDecimal("balance").add(transaction.getBigDecimal("amount")));
transaction.put("post_balance", surchargeAccount.getBigDecimal("balance").add(transaction.getBigDecimal("amount")));
transaction.put("operation", account.getString("manager_id"));
transaction.put("create_time", new Date());
clearingDistributedSurchargeMapper.save(transaction);
surcharge_account.put("balance", surcharge_account.getBigDecimal("balance").add(transaction.getBigDecimal("amount")));
clientsSurchargeAccountsMapper.update(surcharge_account);
surchargeAccount.put("balance", surchargeAccount.getBigDecimal("balance").add(transaction.getBigDecimal("amount")));
clientsSurchargeAccountsMapper.update(surchargeAccount);
} finally {
locker.unlock(clientMoniker + "_surcharge_account_save");
@ -5054,21 +5025,11 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
byte[] enCodeFormat = secretKey.getEncoded();
SecretKeySpec key = new SecretKeySpec(enCodeFormat, "AES");
Cipher cipher = Cipher.getInstance("AES");
byte[] byteContent = content.getBytes("utf-8");
byte[] byteContent = content.getBytes(StandardCharsets.UTF_8);
cipher.init(Cipher.ENCRYPT_MODE, key);
byte[] result = cipher.doFinal(byteContent);
return Base64.encodeBase64String(result);
} catch (NoSuchPaddingException e) {
e.printStackTrace();
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
} catch (InvalidKeyException e) {
e.printStackTrace();
} catch (IllegalBlockSizeException e) {
e.printStackTrace();
} catch (BadPaddingException e) {
} catch (NoSuchPaddingException | NoSuchAlgorithmException | InvalidKeyException | IllegalBlockSizeException | BadPaddingException e) {
e.printStackTrace();
}
return null;

@ -1,13 +1,7 @@
package au.com.royalpay.payment.manage.merchants.web;
import au.com.royalpay.payment.manage.dev.core.MerchantLocationService;
import au.com.royalpay.payment.manage.merchants.beans.BankAccountInfo;
import au.com.royalpay.payment.manage.merchants.beans.ClientAuthFilesInfo;
import au.com.royalpay.payment.manage.merchants.beans.ClientRateConfig;
import au.com.royalpay.payment.manage.merchants.beans.ClientRegisterInfo;
import au.com.royalpay.payment.manage.merchants.beans.NewAccountBean;
import au.com.royalpay.payment.manage.merchants.beans.PartnerQuery;
import au.com.royalpay.payment.manage.merchants.beans.SubMerchantIdApply;
import au.com.royalpay.payment.manage.merchants.beans.*;
import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import au.com.royalpay.payment.manage.permission.manager.ManagerMapping;
import au.com.royalpay.payment.manage.permission.manager.RequireManager;
@ -19,21 +13,14 @@ import au.com.royalpay.payment.tools.merchants.beans.QRCodeConfig;
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.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.io.IOException;
import java.io.OutputStream;
import java.util.List;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.IOException;
import java.io.OutputStream;
import java.util.List;
/**
* Created by yixian on 2016-06-27.
@ -182,6 +169,11 @@ public class PartnerManageController {
clientManager.updateClientPaymentConfig(manager, clientMoniker, subMerchantInfo);
}
@ManagerMapping(value = "/{clientMoniker}/refund_credit_line", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER})
public void updateRefundCreditLine(@PathVariable String clientMoniker, @RequestBody JSONObject refundLineInfo, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
clientManager.updateRefundCreditLine(manager, clientMoniker, refundLineInfo);
}
@ManagerMapping(value = "/{clientMoniker}/rpay_payment_config", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER})
public void updatePartnerRpayPaymentConfig(@PathVariable String clientMoniker, @RequestBody JSONObject rpaySubMerchantInfo, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
clientManager.updateClientRpayPaymentConfig(manager, clientMoniker, rpaySubMerchantInfo);
@ -415,9 +407,10 @@ public class PartnerManageController {
public List<JSONObject> accountTransactions(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker) {
return clientManager.getAccountTransactions(manager, clientMoniker);
}
@ManagerMapping(value = "/{clientMoniker}/account/transactions/date", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR})
public List<JSONObject> accountTransactionsByDate(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker,@RequestParam String date) {
return clientManager.getAccountTransactionsByDate(manager, clientMoniker, date);
public List<JSONObject> accountTransactionsByDate(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker, @RequestParam String detailId) {
return clientManager.getAccountTransactionsByDetailId(manager, clientMoniker, detailId);
}
@ManagerMapping(value = "/{clientMoniker}/account/save", method = RequestMethod.POST, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR})

@ -7,7 +7,6 @@ import au.com.royalpay.payment.manage.merchants.beans.ClientRegisterInfo;
import au.com.royalpay.payment.manage.merchants.beans.NewAccountBean;
import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import au.com.royalpay.payment.manage.merchants.core.ClientSignEventSupport;
import au.com.royalpay.payment.manage.permission.manager.ManagerMapping;
import au.com.royalpay.payment.manage.permission.manager.PartnerMapping;
import au.com.royalpay.payment.manage.permission.manager.RequirePartner;
import au.com.royalpay.payment.manage.support.wechatclients.KangaLandWechatApiImpl;
@ -21,31 +20,21 @@ import au.com.royalpay.payment.tools.exceptions.BadRequestException;
import au.com.royalpay.payment.tools.exceptions.ForbiddenException;
import au.com.royalpay.payment.tools.http.HttpUtils;
import au.com.royalpay.payment.tools.merchants.beans.QRCodeConfig;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import au.com.royalpay.payment.tools.permission.enums.PartnerRole;
import au.com.royalpay.payment.tools.permission.wechat.WechatMapping;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.Errors;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import java.io.IOException;
import java.io.OutputStream;
import java.util.List;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.IOException;
import java.io.OutputStream;
import java.util.List;
/**
* view for partner client
@ -182,7 +171,6 @@ public class PartnerViewController {
clientManager.setOrderExpiryConfig(account,clientMoniker, config.getString("order_expiry_config"));
}
@PartnerMapping(value = "/{clientMoniker}/surcharge_account", method = RequestMethod.GET, roles = {PartnerRole.ADMIN, PartnerRole.MANAGER})
@ResponseBody
public JSONObject surchargeAccount(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject manager, @PathVariable String clientMoniker) {
@ -198,7 +186,7 @@ public class PartnerViewController {
@PartnerMapping(value = "/{clientMoniker}/account/transactions/date", method = RequestMethod.GET, roles = {PartnerRole.ADMIN, PartnerRole.MANAGER})
@ResponseBody
public List<JSONObject> accountTransactionsByDate(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject manager, @PathVariable String clientMoniker,@RequestParam String date) {
return clientManager.getAccountTransactionsByDate(manager, clientMoniker, date);
return clientManager.getAccountTransactionsByDetailId(manager, clientMoniker, date);
}
@PartnerMapping(value = "/{clientMoniker}/account/months", method = RequestMethod.GET, roles = {PartnerRole.ADMIN, PartnerRole.MANAGER})
@ -255,7 +243,7 @@ public class PartnerViewController {
return "wechat_bind";
}
@RequestMapping(value = "/account_receive_notice", method = RequestMethod.PUT)
@PutMapping(value = "/account_receive_notice")
@ResponseBody
public JSONObject toggleReceiveNotice(@ModelAttribute(CommonConsts.WECHATINFO) JSONObject user, @RequestBody JSONObject enable) {
if (user == null) {

@ -54,7 +54,7 @@ public class ManagerPermissionScanner implements BeanPostProcessor, PermissionRe
PermissionNode node = new PermissionNode(controller.getSimpleName(), method.getName());
getRequestInfo(node, clazzRequestMapping, methodMapping);
node.setPermissions(clazzPermission, methodPermission);
logger.debug("register permission:" + node.getFuncName() + ":" + node.getRequestId());
logger.trace("register permission:{}:{}", node.getFuncName(), node.getRequestId());
if (permissionNodes.containsKey(node.getFuncId())) {
throw new RuntimeException("Duplicated permission function ID:" + controller.getName() + "." + method.getName());
}

@ -4,11 +4,7 @@ import au.com.royalpay.payment.core.exceptions.EmailException;
import au.com.royalpay.payment.core.exceptions.InvalidShortIdException;
import au.com.royalpay.payment.manage.device.core.DeviceManager;
import au.com.royalpay.payment.manage.management.sysconfig.core.PermissionManager;
import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientMapper;
import au.com.royalpay.payment.manage.mappers.system.ManagerMapper;
import au.com.royalpay.payment.manage.mappers.system.OrgMapper;
import au.com.royalpay.payment.manage.mappers.system.SysCustomerServiceMapper;
import au.com.royalpay.payment.manage.mappers.system.*;
import au.com.royalpay.payment.manage.merchants.core.ClientConfigService;
import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import au.com.royalpay.payment.manage.notice.core.MailService;
@ -29,10 +25,7 @@ import au.com.royalpay.payment.tools.locale.LocaleSupport;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import au.com.royalpay.payment.tools.threadpool.RoyalThreadPoolExecutor;
import au.com.royalpay.payment.tools.utils.PasswordUtils;
import com.alibaba.fastjson.JSONObject;
import com.sun.xml.internal.bind.v2.TODO;
import org.apache.commons.lang3.RandomStringUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateUtils;
@ -44,19 +37,17 @@ import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert;
import org.springframework.web.servlet.ModelAndView;
import org.thymeleaf.context.Context;
import org.thymeleaf.spring4.SpringTemplateEngine;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
/**
* account service for sign in Created by yixian on 2016-06-29.
*/

@ -2,7 +2,6 @@ package au.com.royalpay.payment.manage.surchargeAccount.core;
import com.alibaba.fastjson.JSONObject;
import java.util.Date;
import java.util.List;
public interface SurchargeAccountService {
@ -11,6 +10,6 @@ public interface SurchargeAccountService {
List<JSONObject> listSettledDatesInMonth(String mon);
void fillMothsSurcharge(JSONObject manager, String detail_id);
void fillMothsSurcharge(JSONObject manager, String detailId);
}

@ -36,12 +36,11 @@ public class SurchargeAccountServiceImpl implements SurchargeAccountService {
private Locker locker;
@Resource
private ClientsSurchargeAccountsMapper clientsSurchargeAccountsMapper;
Logger logger = LoggerFactory.getLogger(ClientContractServiceImpl.class);
private Logger logger = LoggerFactory.getLogger(ClientContractServiceImpl.class);
@Override
@Transactional
@Transactional(rollbackFor = Exception.class)
public void generatorMonthDetail() {
DateTime dateTo = DateTime.now().withMillisOfDay(0).withDayOfMonth(1);
logger.info("===============Start generator surcharge account month detail==============={}", new Date());
@ -53,7 +52,7 @@ public class SurchargeAccountServiceImpl implements SurchargeAccountService {
surchargeTrans.sort(Comparator.comparing(trans -> trans.getDate("create_time")));
JSONObject detail = new JSONObject();
detail.put("client_id", clientId);
detail.put("settle_month", dateTo.toString("yyyy-MM"));
detail.put("settle_month", dateTo.plusMonths(-1).toString("yyyy-MM"));
BigDecimal creditAmount = surchargeTrans.stream()
.filter(trans -> "Credit".equals(trans.getString("type")))
.map(trans -> trans.getBigDecimal("amount"))
@ -64,6 +63,7 @@ public class SurchargeAccountServiceImpl implements SurchargeAccountService {
.reduce(BigDecimal::add).orElse(BigDecimal.ZERO);
detail.put("credit_amount", creditAmount);
detail.put("debit_amount", debitAmount);
detail.put("total_surcharge", creditAmount.add(debitAmount));
JSONObject lastTrans = surchargeTrans.stream().max(Comparator.comparing(trans -> trans.getDate("create_time")))
.orElse(null);
BigDecimal postBalance;
@ -77,8 +77,13 @@ public class SurchargeAccountServiceImpl implements SurchargeAccountService {
detail.put("send_mail", 0);
detail.put("wx_send", 0);
detail.put("create_time", new Date());
detail.put("is_valid", 0);
detail.put("checkout", 0);
financialSurchargeAccountDetailMapper.save(detail);
//更新手续费明细中的账单id
surchargeTrans.forEach(trans -> {
trans.put("bill_id", detail.getString("detail_id"));
clearingDistributedSurchargeMapper.update(trans);
});
}
logger.info("===============generator OVER==============={}", new Date());
}
@ -89,35 +94,36 @@ public class SurchargeAccountServiceImpl implements SurchargeAccountService {
}
@Override
public void fillMothsSurcharge(JSONObject manager, String detail_id) {
public void fillMothsSurcharge(JSONObject manager, String detailId) {
if (!(ManagerRole.ADMIN.hasRole(manager.getIntValue("role")) || ManagerRole.OPERATOR.hasRole(manager.getIntValue("role")) || ManagerRole.FINANCIAL_STAFF.hasRole(manager.getIntValue("role")))) {
throw new ForbiddenException("无法执行平账操作,权限不足");
}
JSONObject detail = financialSurchargeAccountDetailMapper.findByDetailId(detail_id);
if (detail.getBooleanValue("is_valid")) {
JSONObject detail = financialSurchargeAccountDetailMapper.findByDetailId(detailId);
if (detail.getBooleanValue("checkout")) {
throw new BadRequestException("该记录已结清");
}
if (!locker.lock(detail.getIntValue("client_id") + "_" + detail.getString("settle_month") + "_fill", 120_000)) {
throw new ServerErrorException("Processing task, wait for a moment");
}
try {
JSONObject surcharge_account = clientsSurchargeAccountsMapper.find(detail.getIntValue("client_id"));
JSONObject surchargeAccount = clientsSurchargeAccountsMapper.find(detail.getIntValue("client_id"));
JSONObject transaction = new JSONObject();
transaction.put("client_id", detail.getIntValue("client_id"));
transaction.put("type", "Credit");
transaction.put("bill_id", detailId);
transaction.put("total_surcharge", BigDecimal.ZERO);
transaction.put("tax_amount", BigDecimal.ZERO);
transaction.put("amount", detail.getBigDecimal("debit_amount").negate());
transaction.put("post_balance", surcharge_account.getBigDecimal("balance").add(transaction.getBigDecimal("amount")));
transaction.put("post_balance", surchargeAccount.getBigDecimal("balance").add(transaction.getBigDecimal("amount")));
transaction.put("operation", manager.getString("manager_id"));
transaction.put("create_time", new Date());
transaction.put("remark", detail.getString("settle_month") + "冲正");
clearingDistributedSurchargeMapper.save(transaction);
surcharge_account.put("balance", surcharge_account.getBigDecimal("balance").add(transaction.getBigDecimal("amount")));
clientsSurchargeAccountsMapper.update(surcharge_account);
detail.put("is_valid", 1);
detail.put("operator_id", manager.getString("manager_id"));
surchargeAccount.put("balance", surchargeAccount.getBigDecimal("balance").add(transaction.getBigDecimal("amount")));
clientsSurchargeAccountsMapper.update(surchargeAccount);
detail.put("checkout", 1);
detail.put("operator_id", manager.getString("display_name"));
financialSurchargeAccountDetailMapper.update(detail);
} finally {
locker.unlock(detail.getIntValue("client_id") + "_" + detail.getString("settle_month") + "_fill");

@ -3,16 +3,11 @@ package au.com.royalpay.payment.manage.surchargeAccount.web;
import au.com.royalpay.payment.manage.permission.manager.ManagerMapping;
import au.com.royalpay.payment.manage.surchargeAccount.core.SurchargeAccountService;
import au.com.royalpay.payment.tools.CommonConsts;
import au.com.royalpay.payment.tools.exceptions.BadRequestException;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import com.alibaba.fastjson.JSONObject;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
@RequestMapping("/sys/surcharge_account")
@ -27,8 +22,8 @@ public class SurchargeAccountController {
return surchargeAccountService.listSettledDatesInMonth(month);
}
@ManagerMapping(value = "/fill/{detail_id}", role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.FINANCIAL_STAFF}, method = RequestMethod.PUT)
public void fillMothsSurcharge(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String detail_id) {
surchargeAccountService.fillMothsSurcharge(manager, detail_id);
@ManagerMapping(value = "/fill/{detailId}", role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.FINANCIAL_STAFF}, method = RequestMethod.PUT)
public void fillMothsSurcharge(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String detailId) {
surchargeAccountService.fillMothsSurcharge(manager, detailId);
}
}

@ -3,7 +3,6 @@ package au.com.royalpay.payment.manage.tradelog.core;
import au.com.royalpay.payment.manage.tradelog.beans.PreRefundQueryBean;
import au.com.royalpay.payment.manage.tradelog.beans.TradeLogQuery;
import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import org.springframework.ui.Model;
import javax.servlet.http.HttpServletResponse;
@ -49,7 +48,7 @@ public interface TradeLogService {
void fullReleasePreAuthorization(JSONObject account, TradeLogQuery query)throws Exception;
PageList<JSONObject> listPreRefundClients(PreRefundQueryBean params);
JSONObject listPreRefundClients(PreRefundQueryBean params);
void exportSettlementLog(TradeLogQuery query, JSONObject partner, HttpServletResponse response);

@ -10,16 +10,13 @@ import au.com.royalpay.payment.core.exceptions.InvalidShortIdException;
import au.com.royalpay.payment.core.exceptions.OrderNotMatchException;
import au.com.royalpay.payment.core.exceptions.ParamInvalidException;
import au.com.royalpay.payment.manage.mappers.client.ClientCustomersMapper;
import au.com.royalpay.payment.manage.mappers.log.ClearingDetailAnalysisMapper;
import au.com.royalpay.payment.manage.mappers.log.ClearingDetailMapper;
import au.com.royalpay.payment.manage.mappers.log.ClearingLogMapper;
import au.com.royalpay.payment.manage.mappers.log.LogSettleMailMapper;
import au.com.royalpay.payment.manage.mappers.payment.AustracDataMapper;
import au.com.royalpay.payment.manage.mappers.payment.OrderMapper;
import au.com.royalpay.payment.manage.mappers.payment.RefundAuditionMapper;
import au.com.royalpay.payment.manage.mappers.payment.RefundMapper;
import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper;
import au.com.royalpay.payment.manage.mappers.system.*;
import au.com.royalpay.payment.manage.mappers.payment.*;
import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientDeviceMapper;
import au.com.royalpay.payment.manage.mappers.system.CustomerMapper;
import au.com.royalpay.payment.manage.mappers.system.ManagerCustomerRelationAlipayMapper;
import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import au.com.royalpay.payment.manage.organizations.core.OrgManager;
import au.com.royalpay.payment.manage.tradelog.beans.PreRefundQueryBean;
@ -33,13 +30,11 @@ import au.com.royalpay.payment.tools.permission.enums.PartnerRole;
import au.com.royalpay.payment.tools.utils.CurrencyAmountUtils;
import au.com.royalpay.payment.tools.utils.PageListUtils;
import au.com.royalpay.payment.tools.utils.TimeZoneUtils;
import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.Order;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import com.github.miemiedev.mybatis.paginator.domain.Paginator;
import net.sf.jasperreports.engine.JRDataSource;
import net.sf.jasperreports.engine.JasperFillManager;
import net.sf.jasperreports.engine.JasperPrint;
@ -47,34 +42,25 @@ import net.sf.jasperreports.engine.JasperRunManager;
import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource;
import net.sf.jasperreports.engine.export.JRXlsExporter;
import net.sf.jasperreports.engine.export.ooxml.JRXlsxExporter;
import net.sf.jasperreports.export.ExporterInput;
import net.sf.jasperreports.export.OutputStreamExporterOutput;
import net.sf.jasperreports.export.SimpleExporterInput;
import net.sf.jasperreports.export.SimpleOutputStreamExporterOutput;
import net.sf.jasperreports.export.SimpleXlsxReportConfiguration;
import net.sf.jasperreports.export.*;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringEscapeUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFFont;
import org.apache.poi.hssf.usermodel.HSSFRichTextString;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.hssf.util.HSSFColor;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.ui.Model;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.OutputStream;
@ -87,13 +73,11 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import static au.com.royalpay.payment.manage.permission.utils.OrgCheckUtils.checkOrgPermission;
@ -118,8 +102,6 @@ public class TradeLogServiceImpl implements TradeLogService {
@Resource
private ClearingDetailMapper clearingDetailMapper;
@Resource
private ClearingDetailAnalysisMapper clearingDetailAnalysisMapper;
@Resource
private MpPaymentApi mpPaymentApi;
@Resource
private TransactionMapper transactionMapper;
@ -134,10 +116,9 @@ public class TradeLogServiceImpl implements TradeLogService {
@Resource
private ClientCustomersMapper clientCustomersMapper;
@Resource
LogSettleMailMapper logSettleMailMapper;
@Resource
private ClearingLogMapper clearingLogMapper;
@Resource
private StringRedisTemplate stringRedisTemplate;
@Resource
private OrgManager orgManager;
@ -1181,7 +1162,6 @@ public class TradeLogServiceImpl implements TradeLogService {
int count = 0;
for (JSONObject object : logs) {
if (object.getIntValue("clearing_status") == 2 && object.getIntValue("client_id") == client.getIntValue("client_id")) {
System.out.println(object.getString("order_id"));
JSONObject updation = new JSONObject();
updation.put("transaction_id", object.getString("transaction_id"));
updation.put("clearing_status", 0);
@ -1199,8 +1179,15 @@ public class TradeLogServiceImpl implements TradeLogService {
}
@Override
public PageList<JSONObject> listPreRefundClients(PreRefundQueryBean params) {
return transactionMapper.listPreRefundClients(new PageBounds(params.getPage(), params.getLimit()));
public JSONObject listPreRefundClients(PreRefundQueryBean params) {
String preRefundDataStr = stringRedisTemplate.boundValueOps("payment:pre_refund_data").get();
if (StringUtils.isEmpty(preRefundDataStr)) {
JSONObject preRefundData = PageListUtils.buildPageListResult(transactionMapper.listPreRefundClients(new PageBounds(params.getPage(), params.getLimit())));
stringRedisTemplate.boundValueOps("payment:pre_refund_data").set(preRefundData.toJSONString(), 1, TimeUnit.HOURS);
return preRefundData;
} else {
return JSONObject.parseObject(preRefundDataStr);
}
}
@Override

@ -221,7 +221,8 @@ public class RefundServiceImpl implements RefundService, ApplicationEventPublish
if (type == OperatorType.PARTNER) {
int accountClientId = partnerAccount.getIntValue("client_id");
Assert.isTrue(accountClientId == client.getIntValue("client_id") || accountClientId == client.getIntValue("parent_client_id"),
Assert.isTrue(accountClientId == client.getIntValue("client_id") || accountClientId == client.getIntValue("parent_client_id")
||clientManager.listLevel3Client(accountClientId).contains(client.getIntValue("parent_client_id")),
"This order is not belong to current merchant");
operator.put("operator_id", partnerAccount.getString("account_id"));
operator.put("operator", partnerAccount.getString("display_name"));

@ -252,6 +252,26 @@
GROUP by c.sub_merchant_id
</select>
<select id="tradeSubMerchantIdBy60Days" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[
SELECT COUNT(DISTINCT c.client_id) client_count,
c.sub_merchant_id,
c.merchant_id,
tmp.create_time last_trade_time,
datediff(now(), tmp.create_time) diff_days
FROM sys_clients c INNER JOIN (SELECT sub_merchant_id, max(create_time) create_time
FROM pmt_orders where status>=5 and create_time>=#{begin} and create_time<=now()
and channel='Wechat'
GROUP BY sub_merchant_id
) tmp on c.sub_merchant_id = tmp.sub_merchant_id
WHERE
c.sub_merchant_id IS not null AND c.merchant_id IS NOT NULL
AND (c.approve_result = 1 OR c.approve_result= 2) AND c.is_valid = 1
AND c.enable_wechat = 1
]]>
GROUP BY c.sub_merchant_id ORDER BY diff_days desc
</select>
<select id="countClientsSettlementCycle" resultType="com.alibaba.fastjson.JSONObject">
SELECT COUNT(DISTINCT c.client_id) client_count,
CASE c.clean_days

@ -400,17 +400,50 @@
ifnull(sum(if(s.channel='Alipay'OR s.channel='AlipayOnline',s.orders,0)),0) alipay_order,
ifnull(sum(if(s.channel='Wechat',s.total,0)),0) wechat_toatl,
ifnull(sum(if(s.channel='Wechat',s.orders,0)),0) wechat_order
FROM statistics_customer_order s
RIGHT JOIN sys_clients c ON c.client_id = s.client_id and c.is_valid=1
FROM sys_clients c
]]>
LEFT JOIN (
select ss.client_id,ss.channel,ss.orders,ss.total
from
statistics_customer_order ss
<where>
<if test="begin!=null">and ss.date &gt;= #{begin}</if>
<if test="end!=null">and ss.date &lt; #{end}</if>
</where>
) s ON c.client_id = s.client_id
<if test="bd_user!=null">
INNER JOIN sys_client_bd d ON c.client_id = d.client_id AND d.bd_id = #{bd_user} and
date(d.start_date)&lt;= #{begin} and (d.end_date is null or date(d.end_date)&gt;= #{end}) and
d.is_valid=1
</if>
where c.is_valid=1
<if test="org_id!=null">and c.org_id = #{org_id}</if>
<if test="state!=null">and c.state = #{state}</if>
<if test="org_id!=null and org_ids==null">and c.org_id=#{org_id}</if>
<if test="org_ids!=null">and c.org_id in
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
<if test="client_monikers!=null">
AND c.client_moniker IN
<foreach collection="client_monikers" open="(" close=")" separator="," item="client_moniker">
#{client_moniker}
</foreach>
</if>
GROUP BY c.client_id ORDER BY total DESC
</select>
<select id="countAreaMerchantTradeAnalysis" resultType="int">
<![CDATA[
SELECT count(distinct c.client_id)
FROM sys_clients c
]]>
<if test="bd_user!=null">
INNER JOIN sys_client_bd d ON c.client_id = d.client_id AND d.bd_id = #{bd_user} and
date(d.start_date)&lt;= #{begin} and (d.end_date is null or date(d.end_date)&gt;= #{end}) and
d.is_valid=1
</if>
<where>
<if test="begin!=null">and s.date &gt;= #{begin}</if>
<if test="end!=null">and s.date &lt; #{end}</if>
where c.is_valid=1
<if test="org_id!=null">and c.org_id = #{org_id}</if>
<if test="state!=null">and c.state = #{state}</if>
<if test="org_id!=null and org_ids==null">and c.org_id=#{org_id}</if>
@ -422,8 +455,6 @@
#{client_moniker}
</foreach>
</if>
</where>
GROUP BY s.client_id ORDER BY total DESC
</select>

@ -234,6 +234,36 @@
GROUP BY o.customer_id
</select>
<select id="countCustomersData" resultType="int">
SELECT count(distinct o.customer_id)
FROM pmt_orders o
<where>
<if test="begin!=null">and o.create_time &gt;= #{begin}</if>
<if test="end!=null">and o.create_time &lt; #{end}</if>
<if test="openid_type==0">
AND o.customer_id LIKE 'o32%' and o.channel='Wechat'
</if>
<if test="openid_type==1">
AND o.customer_id LIKE 'obJ%' and o.channel='Wechat'
</if>
<if test="openid_type==2">
and o.channel='Alipay'
</if>
<if test="openid_type==3">
and o.channel='Bestpay'
</if>
<if test="openid_type==4">
AND o.customer_id LIKE 'olH%' and o.channel='Wechat'
</if>
<if test="customer_id!=null">
and o.customer_id=#{customer_id}
</if>
<if test="org_id!=null and org_ids==null">and o.org_id=#{org_id}</if>
<if test="org_ids!=null">and o.org_id in
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
</where>
</select>
<select id="listCustomersDataAnalysis" resultType="com.alibaba.fastjson.JSONObject">
SELECT sum(if(o.status='5',o.customer_payment_amount,0)) total_amount
FROM pmt_orders o

@ -13,7 +13,8 @@
<select id="getEarliestOrder" resultType="com.alibaba.fastjson.JSONObject">
SELECT *
FROM pmt_transactions
WHERE client_id = #{client_id} AND clearing_amount > 1
WHERE client_id = #{client_id}
AND clearing_amount > 1
ORDER BY transaction_time
LIMIT 1;
</select>
@ -55,7 +56,8 @@
</if>
<if test="org_id!=null and org_ids==null">and l.org_id=#{org_id}</if>
<if test="org_ids!=null">and l.org_id in
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach>
</if>
</select>
<select id="analysisTotalAmount" resultType="java.math.BigDecimal">
@ -77,7 +79,8 @@
</if>
<if test="org_id!=null and org_ids==null">and l.org_id=#{org_id}</if>
<if test="org_ids!=null">and l.org_id in
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach>
</if>
</select>
<select id="analysisTotalCount" resultType="java.lang.Double">
@ -184,7 +187,8 @@
</if>
<if test="org_id!=null and org_ids==null">and o.org_id=#{org_id}</if>
<if test="org_ids!=null">and o.org_id in
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach>
</if>
<![CDATA[
GROUP BY o.order_id ORDER BY aud_fee DESC limit 1
]]>
@ -244,7 +248,8 @@
<if test="end!=null">and o.create_time &lt;= #{end}</if>
<if test="org_id!=null and org_ids==null">and l.org_id=#{org_id}</if>
<if test="org_ids!=null">and l.org_id in
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach>
</if>
GROUP BY gateway_label
</select>
@ -274,7 +279,8 @@
</if>
<if test="org_id!=null and org_ids==null">and l.org_id=#{org_id}</if>
<if test="org_ids!=null">and l.org_id in
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach>
</if>
<if test="bd_group!=null">and l.client_id in
(SELECT b.client_id FROM sys_client_bd b
INNER JOIN financial_bd_config c ON c.manager_id=b.bd_id
@ -311,7 +317,8 @@
</if>
<if test="org_id!=null and org_ids==null">and l.org_id=#{org_id}</if>
<if test="org_ids!=null">and l.org_id in
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach>
</if>
<![CDATA[
GROUP BY date(o.create_time)
ORDER BY date(o.create_time)
@ -339,7 +346,8 @@
</if>
<if test="org_id!=null and org_ids==null">and l.org_id=#{org_id}</if>
<if test="org_ids!=null">and l.org_id in
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach>
</if>
</select>
<select id="countCustomers" resultType="java.lang.Integer">
<![CDATA[
@ -360,7 +368,8 @@
</if>
<if test="org_id!=null and org_ids==null">and o.org_id=#{org_id}</if>
<if test="org_ids!=null">and o.org_id in
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach>
</if>
<![CDATA[
GROUP BY o.customer_id) p
]]>
@ -385,8 +394,9 @@
</if>
<if test="org_id!=null and org_ids==null">and t.org_id=#{org_id}</if>
<if test="org_ids!=null">and t.org_id in
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
<if test="channel !=null"> and o.channel = #{channel}</if>
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach>
</if>
<if test="channel !=null">and o.channel = #{channel}</if>
<![CDATA[
GROUP BY o.customer_id) p
where p.customer_id NOT IN (SELECT o.customer_id FROM pmt_transactions t INNER JOIN pmt_orders o ON o.order_id = t.order_id
@ -426,8 +436,9 @@
</if>
<if test="org_id!=null and org_ids==null">and t.org_id=#{org_id}</if>
<if test="org_ids!=null">and t.org_id in
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
<if test="channel !=null"> and o.channel = #{channel}</if>
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach>
</if>
<if test="channel !=null">and o.channel = #{channel}</if>
<![CDATA[
GROUP BY o.customer_id) p
where p.customer_id IN (SELECT o.customer_id FROM pmt_transactions t INNER JOIN pmt_orders o ON o.order_id = t.order_id
@ -451,9 +462,11 @@
<select id="getCountCustomers" resultType="java.lang.Integer">
<![CDATA[
SELECT count(DISTINCT o.customer_id) FROM pmt_orders o where
o.create_time < #{date} and o.status>=5
]]>
SELECT count(DISTINCT o.customer_id)
FROM pmt_orders o
where o.create_time < #{date}
and o.status >= 5
]]>
</select>
<select id="getTradePartnersInTypes" resultType="com.alibaba.fastjson.JSONObject">
@ -499,7 +512,8 @@
]]>
<if test="org_id!=null and org_ids==null">and l.org_id=#{org_id}</if>
<if test="org_ids!=null">and l.org_id in
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach>
</if>
<if test="bd_group!=null">and l.client_id in
(SELECT b.client_id FROM sys_client_bd b
INNER JOIN financial_bd_config c ON c.manager_id=b.bd_id
@ -558,7 +572,8 @@
</if>
<if test="org_id!=null and org_ids==null">and l.org_id=#{org_id}</if>
<if test="org_ids!=null">and l.org_id in
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach>
</if>
<if test="bd_group!=null">and l.client_id in
(SELECT b.client_id FROM sys_client_bd b
INNER JOIN financial_bd_config c ON c.manager_id=b.bd_id
@ -650,18 +665,19 @@
</if>
<if test="org_id!=null and org_ids==null">and ptran.org_id=#{org_id}</if>
<if test="org_ids!=null">and ptran.org_id in
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach>
</if>
</select>
<select id="listExchangeRates" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[
SELECT max(t.transaction_time) mx,t.exchange_rate,date(t.transaction_time) `date`
FROM
pmt_transactions t
WHERE date(t.transaction_time) >= #{begin} And date(t.transaction_time) <= #{end} AND
t.transaction_type ='Credit' AND t.channel =#{channel}
GROUP BY
date(t.transaction_time)
order by `date` asc
SELECT max(t.transaction_time) mx, t.exchange_rate, date(t.transaction_time) `date`
FROM pmt_transactions t
WHERE date(t.transaction_time) >= #{begin}
And date(t.transaction_time) <= #{end}
AND t.transaction_type = 'Credit'
AND t.channel = #{channel}
GROUP BY date(t.transaction_time)
order by `date` asc
]]>
</select>
@ -693,8 +709,9 @@
</if>
<if test="org_id!=null and org_ids==null">and o.org_id=#{org_id}</if>
<if test="org_ids!=null">and o.org_id in
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
GROUP BY date , channel ORDER BY date DESC
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach>
</if>
GROUP BY date , channel ORDER BY date DESC
</select>
<select id="getOrgTransactionAnalysis" resultType="com.alibaba.fastjson.JSONObject">
@ -710,7 +727,8 @@
<if test="end!=null">and t.transaction_time &lt;= #{end}</if>
<if test="org_id!=null and org_ids==null">and o.org_id=#{org_id}</if>
<if test="org_ids!=null">and o.org_id in
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach>
</if>
GROUP BY o.org_id order by amount desc
</select>
@ -749,7 +767,8 @@
<if test="channel!=null">and o.channel=#{channel}</if>
<if test="org_id!=null and org_ids==null">and l.org_id=#{org_id}</if>
<if test="org_ids!=null">and l.org_id in
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach>
</if>
</select>
<select id="countAmountRangeAnalysis" resultType="java.lang.Integer">
@ -766,7 +785,8 @@
<select id="listAmountRangeOrders" resultType="com.alibaba.fastjson.JSONObject">
select c.client_moniker,c.short_name,t.order_id,t.clearing_amount,t.transaction_time,t.channel,o.customer_id,o.customer_ip,o.gateway
select
c.client_moniker,c.short_name,t.order_id,t.clearing_amount,t.transaction_time,t.channel,o.customer_id,o.customer_ip,o.gateway
FROM pmt_transactions t
LEFT JOIN pmt_orders o on o.order_id=t.order_id
INNER JOIN sys_clients c on c.client_id = t.client_id
@ -778,6 +798,19 @@
<if test="amount_from!=null">and t.clearing_amount &gt;= #{amount_from}</if>
<if test="amount_to!=null">and t.clearing_amount &lt; #{amount_to}</if>
</select>
<select id="countAmountRangeOrders" resultType="int">
select count(1)
FROM pmt_transactions t
<if test="client_moniker!=null">
inner join sys_clients c on c.client_id=t.client_id and c.client_moniker=#{client_moniker}
</if>
where t.transaction_type = 'Credit' and t.refund_id is null and t.channel != 'Settlement'
<if test="begin!=null">and t.transaction_time &gt;= #{begin}</if>
<if test="end!=null">and t.transaction_time &lt;= #{end}</if>
<if test="channel!=null">and t.channel=#{channel}</if>
<if test="amount_from!=null">and t.clearing_amount &gt;= #{amount_from}</if>
<if test="amount_to!=null">and t.clearing_amount &lt; #{amount_to}</if>
</select>
<!--交易金额分析 饼图 -->
<!--不更改-->
@ -804,13 +837,13 @@
<select id="getClientTransaction" resultType="com.alibaba.fastjson.JSONObject">
SELECT
IFNULL(sum(if(l.transaction_type='Credit',l.clearing_amount,0)),0) trade_amount,
IFNULL(sum(if(l.transaction_type='Debit',l.clearing_amount,0)),0) refund_amount,
IFNULL(sum(if(l.transaction_type='Credit',1,0)),0) trade_count,
IFNULL(sum(if(l.transaction_type='Debit',1,0)),0) refund_orders
FROM pmt_transactions l
where l.channel!='Settlement' and l.system_generate=0
SELECT
IFNULL(sum(if(l.transaction_type='Credit',l.clearing_amount,0)),0) trade_amount,
IFNULL(sum(if(l.transaction_type='Debit',l.clearing_amount,0)),0) refund_amount,
IFNULL(sum(if(l.transaction_type='Credit',1,0)),0) trade_count,
IFNULL(sum(if(l.transaction_type='Debit',1,0)),0) refund_orders
FROM pmt_transactions l
where l.channel!='Settlement' and l.system_generate=0
<if test="client_ids!=null">
AND l.client_id IN
<foreach collection="client_ids" open="(" close=")" separator="," item="client_id">
@ -824,31 +857,39 @@
<if test="end!=null">and l.transaction_time &lt; #{end}</if>
<if test="org_id!=null and org_ids==null">and l.org_id=#{org_id}</if>
<if test="org_ids!=null">and l.org_id in
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach>
</if>
</select>
<select id="getAreaMerchantAmountAnalysis" resultType="com.alibaba.fastjson.JSONObject">
SELECT c.client_moniker,c.short_name,c.bd_user_name,sum(if(t.transaction_type='Credit',t.clearing_amount,0)) total,
SELECT c.client_moniker,c.short_name,c.bd_user_name,sum(if(t.transaction_type='Credit',t.clearing_amount,0))
total,
COUNT(DISTINCT t.order_id) orders,
c.suburb,c.state,c.royalpayindustry,sum(if(t.channel='Alipay' OR t.channel='AlipayOnline',t.clearing_amount,0)) alipay_total,
sum(if(t.channel='Alipay'OR t.channel='AlipayOnline',1,0)) alipay_order,sum(if(t.channel='Wechat',t.clearing_amount,0)) wechat_toatl,
c.suburb,c.state,c.royalpayindustry,sum(if(t.channel='Alipay' OR t.channel='AlipayOnline',t.clearing_amount,0))
alipay_total,
sum(if(t.channel='Alipay'OR t.channel='AlipayOnline',1,0))
alipay_order,sum(if(t.channel='Wechat',t.clearing_amount,0)) wechat_toatl,
sum(if(t.channel='Wechat',1,0)) wechat_order
FROM pmt_transactions t
INNER JOIN pmt_orders ord on ord.order_id = t.order_id
RIGHT JOIN sys_clients c on t.client_id = c.client_id and c.is_valid = 1
FROM sys_clients c
LEFT JOIN (select
tt.client_id,tt.order_id,tt.transaction_type,tt.clearing_amount, tt.channel
from pmt_transactions tt where tt.transaction_type = 'Credit'
and tt.system_generate=0
<if test="begin!=null">and tt.transaction_time &gt;= #{begin}</if>
<if test="end!=null">and tt.transaction_time &lt;= #{end}</if>
)t on t.client_id = c.client_id
<if test="bd_user!=null">
INNER JOIN sys_client_bd d ON c.client_id = d.client_id AND d.bd_id = #{bd_user} and
date(d.start_date)&lt;= #{begin} and (d.end_date is null or date(d.end_date)&gt;= #{end}) and
d.is_valid=1
</if>
where (t.transaction_type = 'Credit')
<if test="begin!=null">and t.transaction_time &gt;= #{begin}</if>
<if test="end!=null">and t.transaction_time &lt;= #{end}</if>
where (c.is_valid = 1 )
<if test="state!=null">and c.state &lt;= #{state}</if>
<if test="org_id!=null and org_ids==null">and c.org_id=#{org_id}</if>
<if test="org_ids!=null">and c.org_id in
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach>
</if>
<if test="client_monikers!=null">
AND c.client_moniker IN
<foreach collection="client_monikers" open="(" close=")" separator="," item="client_moniker">
@ -858,6 +899,29 @@
GROUP BY c.client_id order by total desc
</select>
<select id="countAreaMerchantAmountAnalysis" resultType="int">
SELECT count(distinct c.client_id) clients
FROM sys_clients c
<if test="bd_user!=null">
INNER JOIN sys_client_bd d ON c.client_id = d.client_id AND d.bd_id = #{bd_user} and
date(d.start_date)&lt;= #{begin} and (d.end_date is null or date(d.end_date)&gt;= #{end}) and
d.is_valid=1
</if>
where (c.is_valid = 1)
<if test="state!=null">and c.state &lt;= #{state}</if>
<if test="org_id!=null and org_ids==null">and c.org_id=#{org_id}</if>
<if test="org_ids!=null">and c.org_id in
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach>
</if>
<if test="client_monikers!=null">
AND c.client_moniker IN
<foreach collection="client_monikers" open="(" close=")" separator="," item="client_moniker">
#{client_moniker}
</foreach>
</if>
</select>
<select id="getAreaMerchantAmountByCycle" resultType="com.alibaba.fastjson.JSONObject">
SELECT c.client_moniker,sum(if(t.transaction_type='Credit',t.clearing_amount,0)) old_total,
@ -868,16 +932,20 @@
RIGHT JOIN sys_clients c on t.client_id = c.client_id and c.is_valid = 1
<if test="bd_user!=null">
INNER JOIN sys_client_bd d ON c.client_id = d.client_id AND d.bd_id = #{bd_user} and
date(d.start_date)&lt;= DATE_ADD(#{begin},INTERVAL -datediff( #{end},#{begin}) DAY) and (d.end_date is null or date(d.end_date)&gt;= #{begin}) and
date(d.start_date)&lt;= DATE_ADD(#{begin},INTERVAL -datediff( #{end},#{begin}) DAY) and (d.end_date is null
or date(d.end_date)&gt;= #{begin}) and
d.is_valid=1
</if>
where (t.transaction_type = 'Credit')
<if test="begin!=null">and t.transaction_time &gt;= DATE_ADD(#{begin},INTERVAL -datediff( #{end},#{begin}) DAY)</if>
<if test="begin!=null">and t.transaction_time &gt;= DATE_ADD(#{begin},INTERVAL -datediff( #{end},#{begin})
DAY)
</if>
<if test="end!=null">and t.transaction_time &lt;= #{begin}</if>
<if test="state!=null">and c.state &lt;= #{state}</if>
<if test="org_id!=null and org_ids==null">and c.org_id=#{org_id}</if>
<if test="org_ids!=null">and c.org_id in
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach>
</if>
<if test="client_monikers!=null">
AND c.client_moniker IN
<foreach collection="client_monikers" open="(" close=")" separator="," item="client_moniker">
@ -888,9 +956,9 @@
</select>
<select id="getOrderClearAmount" resultType="com.alibaba.fastjson.JSONObject">
SELECT clearing_amount,o.client_id
SELECT clearing_amount, o.client_id
FROM pmt_orders o
INNER JOIN pmt_transactions pt ON o.order_id = pt.order_id
INNER JOIN pmt_transactions pt ON o.order_id = pt.order_id
WHERE o.order_id = #{order_id}
LIMIT 1;
</select>

@ -0,0 +1,11 @@
<?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.client.ClientSubMerchantIdMapper">
<select id="listSubMerchantIdByDiffDays" resultType="com.alibaba.fastjson.JSONObject">
select * from cli_sub_merchant_id
where diff_days >=#{begin}
and diff_days &lt;=#{end}
order by diff_days desc
</select>
</mapper>

@ -8,12 +8,10 @@
t.cny_amount cny_amount ,r.report_status report_status,r.report_id report_id,o.channel channel
from
pmt_orders o
left join
pmt_transactions t
on o.order_id = t.order_id
left join
pmt_custom_report r
on r.order_id = o.order_id
inner join pmt_transactions t on o.order_id = t.order_id and t.transaction_type = 'Credit'
<if test="from!=null">and t.transaction_time &gt;= #{from}</if>
<if test="to!=null">and t.transaction_time &lt; #{to}</if>
left join pmt_custom_report r on r.order_id = o.order_id
where
o.channel in (
<foreach collection="channels" separator="," item="item">
@ -22,7 +20,7 @@
)
and o.client_id = #{client_id}
and transaction_type = 'Credit'
and
o.status in (
<foreach collection="orderStatus" item="item" separator=",">
@ -33,8 +31,7 @@
<!--<if test="channel!=null">-->
<!--and o.channel = #{channel}-->
<!--</if>-->
<if test="from!=null">and t.transaction_time &gt;= #{from}</if>
<if test="to!=null">and t.transaction_time &lt; #{to}</if>
<if test="report_status!=null">
and r.report_status = #{report_status}
</if>

@ -125,4 +125,27 @@
group by manager_id
) log ON log.manager_id = config.manager_id
</select>
</mapper>
<select id="findManagerByTeamTypeRealTime" resultType="com.alibaba.fastjson.JSONObject">
SELECT
c.bd_name,
c.manager_id,
c.kpi_amount,
sum( o.total * d.proportion ) AS total_amount
FROM
statistics_customer_order o
INNER JOIN sys_clients sc ON sc.client_id = o.client_id
INNER JOIN sys_client_bd d ON o.client_id = d.client_id
INNER JOIN financial_bd_config c ON d.bd_id = c.manager_id
WHERE
sc.org_id = 1
AND o.date &gt;= #{start_date}
AND o.date &lt; #{end_date}
AND d.start_date &lt;= o.date AND d.is_valid = 1 AND ( d.end_date IS NULL OR d.end_date &gt; o.date
)
AND c.get_prize = 1
AND c.bd_group = ( SELECT fc.bd_group FROM financial_bd_config fc WHERE fc.bd_type = #{bd_type} )
GROUP BY
c.manager_id
</select>
</mapper>

@ -139,16 +139,66 @@
</update>
<select id="listOrders" resultType="com.alibaba.fastjson.JSONObject">
<if test="bd_user != null">
SELECT temp.* FROM (
</if>
<if test="gateway">
<include refid="gateway_keys"/>
</if>
<if test="!gateway">
<include refid="tradelog_list_keys"/>
</if>
FROM pmt_orders o
FROM (
select oo.order_id,oo.client_id,oo.total_amount,oo.display_amount,
oo.customer_payment_amount,oo.coupon_payment_amount,oo.currency,
oo.create_time,oo.confirm_time,oo.status,oo.order_description,oo.order_detail,
oo.client_order_id,oo.gateway,oo.channel,oo.pre_authorization,oo.refund_amount,oo.customer_id
from pmt_orders oo
<where>
<if test="search_text != null">
<bind name="name_pattern" value="'%' + search_text + '%'"/>
<if test="text_type == 'remark'">
AND oo.order_detail LIKE #{name_pattern}
</if>
<if test="text_type == 'channel'">
AND oo.channel = #{search_text}
</if>
<if test="text_type == 'order_id'">
AND oo.order_id = #{search_text}
</if>
</if>
<if test="order_id != null">
AND oo.order_id = #{order_id}
</if>
<if test="trade_type != null">
AND oo.gateway IN
<foreach collection="trade_type" item="gateway" open="(" close=")" separator=",">
#{gateway}
</foreach>
</if>
<if test="from != null">
AND oo.create_time &gt;= #{from}
</if>
<if test="to != null">
AND oo.create_time &lt; #{to}
</if>
<if test="date != null">
AND oo.transaction_date = DATE(#{date})
</if>
<if test="dev_id != null">
AND oo.dev_id = #{dev_id}
</if>
<if test="status != null">
AND
<foreach collection="status" item="std" open="(" close=")" separator=" or ">
oo.status = #{std}
</foreach>
</if>
<if test="channel != null">
AND
<foreach collection="channel" item="chan" open="(" close=")" separator=" or ">
oo.channel = #{chan}
</foreach>
</if>
</where>
) o
INNER JOIN sys_clients p
ON p.client_id = o.client_id
AND p.is_valid = 1
@ -175,7 +225,7 @@
OR o.order_detail LIKE #{name_pattern}
OR t.system_transaction_id = #{search_text}
OR o.channel = #{search_text}
OR t.order_id = #{search_text}
OR o.order_id = #{search_text}
)
</if>
<if test="text_type == 'client_moniker'">
@ -184,27 +234,9 @@
<if test="text_type == 'client_name'">
AND p.short_name LIKE #{name_pattern}
</if>
<if test="text_type == 'remark'">
AND o.order_detail LIKE #{name_pattern}
</if>
<if test="text_type == 'channel'">
AND o.channel = #{search_text}
</if>
<if test="text_type == 'sys_trans_id'">
AND t.system_transaction_id = #{search_text}
</if>
<if test="text_type == 'order_id'">
AND o.order_id = #{search_text}
</if>
</if>
<if test="order_id != null">
AND o.order_id = #{order_id}
</if>
<if test="trade_type != null">
AND o.gateway IN
<foreach collection="trade_type" item="gateway" open="(" close=")" separator=",">
#{gateway}
</foreach>
</if>
<if test="org_id != null and org_ids == null">
AND p.org_id = #{org_id}
@ -215,33 +247,10 @@
#{org_id}
</foreach>
</if>
<if test="from != null">
AND o.create_time &gt;= #{from}
</if>
<if test="to != null">
AND o.create_time &lt; #{to}
</if>
<if test="date != null">
AND DATE(o.create_time) = DATE(#{date})
</if>
<if test="dev_id != null">
AND o.dev_id = #{dev_id}
</if>
<if test="status != null">
AND
<foreach collection="status" item="std" open="(" close=")" separator=" or ">
o.status = #{std}
</foreach>
</if>
<if test="channel != null">
AND
<foreach collection="channel" item="chan" open="(" close=")" separator=" or ">
o.channel = #{chan}
</foreach>
</if>
<if test="bd_group != null">
AND p.client_id IN(
SELECT b.client_id
SELECT distinct b.client_id
FROM sys_client_bd b
INNER JOIN financial_bd_config c
ON c.manager_id = b.bd_id
@ -254,19 +263,19 @@
</if>
)
</if>
<if test="bd_user != null">
AND p.client_id in(select distinct d.client_id
from sys_client_bd d
where d.bd_id = #{bd_user}
AND d.is_valid = 1
AND DATE(d.start_date) &lt;= curdate()
AND (d.end_date IS NULL OR DATE(d.end_date) &gt;= curdate()))
</if>
</where>
GROUP BY o.order_id, t.refund_id
<if test="bd_user != null">
) temp
INNER JOIN sys_client_bd d
ON temp.client_id = d.client_id
AND d.bd_id = #{bd_user}
AND d.is_valid = 1
AND DATE(d.start_date) &lt;= DATE(now())
AND (d.end_date IS NULL OR DATE(d.end_date) &gt;= DATE(now()))
</if>
GROUP BY o.order_id
</select>
<select id="listOrdersNoPage" resultType="com.alibaba.fastjson.JSONObject">
<if test="gateway">
<include refid="gateway_keys"/>
@ -293,7 +302,7 @@
<if test="from!=null">and o.create_time &gt;= #{from}</if>
<if test="to!=null">and o.create_time &lt; #{to}</if>
</where>
GROUP BY o.order_id,t.refund_id
GROUP BY o.order_id
order by o.create_time
</select>
@ -371,7 +380,7 @@
</foreach>
</if>
</where>
GROUP BY o.order_id,t.refund_id
GROUP BY o.order_id
</select>

@ -57,6 +57,42 @@
</if>
</where>
</select>
<select id="countTransFlowPage" resultType="int">
SELECT count(1)
FROM pmt_transactions t
<if test="dev_id!=null or ">
INNER JOIN (select o.order_id from pmt_orders o<where>
<if test="dev_id!=null">and o.dev_id = #{dev_id}</if>
<if test="
channel!=null">and
<foreach collection="channel" item="chan" open="(" close=")" separator=" or ">
o.channel=#{chan}
</foreach>
</if>
</where>)oo ON oo.order_id=t.order_id
</if>
<where>
<if test="client_ids!=null">
AND t.client_id IN
<foreach collection="client_ids" open="(" close=")" separator="," item="client_id">
#{client_id}
</foreach>
</if>
<if test="client_ids==null">
and t.client_id=#{client_id}
</if>
<if test="from!=null">and t.transaction_time &gt;= #{from}</if>
<if test="to!=null">and t.transaction_time &lt; #{to}</if>
<if test="transaction_type!=null">and t.transaction_type=#{transaction_type}</if>
<if test="date!=null">and date(t.transaction_time)=date(#{date})</if>
<if test="clearing_status!=null">and t.clearing_status=#{clearing_status}</if>
<if test="trans_type==1">and t.transaction_type = 'Credit'</if>
<if test="trans_type==2">and t.refund_id is NOT NULL</if>
<if test="trans_type==3">and t.transaction_type='Debit' and t.refund_id is NULL</if>
</where>
</select>
<select id="listTransFlow" resultType="com.alibaba.fastjson.JSONObject">
SELECT t.*,
@ -271,16 +307,16 @@
<if test="to!=null">and t.transaction_time &lt; #{to}</if>
</select>
<select id="listPreRefundClients" resultType="com.alibaba.fastjson.JSONObject">
SELECT *
FROM (SELECT ifnull(sum(if(transaction_type = 'Credit', clearing_amount, -clearing_amount)), 0) amount,
c.client_id client_id,
max(t.transaction_time) transation_time,
c.client_moniker client_moniker
FROM pmt_transactions t
INNER JOIN sys_clients c ON t.client_id = c.client_id
INNER JOIN sys_client_config cc on cc.client_id = c.client_id AND cc.enable_refund_auth = 1
GROUP BY c.client_id) a
WHERE a.amount &lt; 0
SELECT sc.client_id,
sc.client_moniker,
IFNULL(SUM(IF(pt.transaction_type = 'Credit', pt.clearing_amount, -pt.clearing_amount)), 0) amount,
IFNULL(MAX(pt.create_time), sc.approve_time) transation_time
FROM pmt_transactions pt,
sys_clients sc
WHERE clearing_status = 0
AND pt.client_id = sc.client_id
GROUP BY client_id
HAVING amount &lt; 0
</select>
<select id="validAnalysis" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[
@ -398,19 +434,41 @@
SELECT c.short_name,SUM(t.clearing_amount) total,
sum(if(LOCATE('MERCHANT',t.system_transaction_id),t.clearing_amount,0)) income,
sum(if(LOCATE('SURCHARGE',t.system_transaction_id),t.clearing_amount,0)) fee
FROM pmt_transactions t
RIGHT JOIN sys_clients c ON t.client_id = c.client_id
WHERE t.channel='Settlement'
]]>
<if test="from!=null">and t.transaction_time &gt;= #{from}</if>
<if test="to!=null">and t.transaction_time &lt; #{to}</if>
FROM sys_clients c
]]>
INNER JOIN (select system_transaction_id,clearing_amount,client_id
from pmt_transactions
where channel='Settlement'
<if test="from!=null">and transaction_time &gt;= #{from}</if>
<if test="to!=null">and transaction_time &lt; #{to}</if>
) t ON t.client_id = c.client_id
<where>
<if test="client_moniker!=null">and c.client_moniker=#{client_moniker}</if>
<if test="org_id!=null and org_ids==null">and c.org_id = #{org_id}</if>
<if test="org_ids!=null">and c.org_id in
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach>
</if>
</where>
GROUP BY c.client_id
order by total desc
</select>
<select id="countSettlementLogInClients" resultType="int">
<![CDATA[
SELECT count(1)
FROM sys_clients c
]]>
<where>
<if test="client_moniker!=null">and c.client_moniker=#{client_moniker}</if>
<if test="org_id!=null and org_ids==null">and c.org_id = #{org_id}</if>
<if test="org_ids!=null">and c.org_id in
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach>
</if>
and exists (select client_id from pmt_transactions t where channel='Settlement'
<if test="from!=null">and transaction_time &gt;= #{from}</if>
<if test="to!=null">and transaction_time &lt; #{to}</if>
and client_id=c.client_id
)
</where>
exists
</select>
<select id="analysisSettlementLog" resultType="com.alibaba.fastjson.JSONObject">
@ -563,7 +621,7 @@
ORDER BY trade_date ASC, o.client_id ASC
</select>
<select id="TotalAmountForBDPrize" resultType="java.math.BigDecimal">
<select id="totalAmountForBDPrize" resultType="java.math.BigDecimal">
<![CDATA[
select sum(if(temp.transaction_type = 'Credit', temp.clearing_amount * d.proportion,
-temp.clearing_amount * d.proportion))
@ -583,7 +641,7 @@
</select>
<select id="TotalAmountForBDLeaderPrize" resultType="java.math.BigDecimal">
<select id="totalAmountForBDLeaderPrize" resultType="java.math.BigDecimal">
SELECT ifnull(sum(t.total), 0)
total
FROM statistics_customer_order t
@ -600,7 +658,7 @@
or c.manager_id = #{bd_group})
</select>
<select id="TotalAmountForSydneyGMPrize" resultType="java.math.BigDecimal">
<select id="totalAmountForSydneyGMPrize" resultType="java.math.BigDecimal">
SELECT ifnull(sum(t.total), 0)
total
FROM statistics_customer_order t

@ -2,48 +2,40 @@
<!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.ClearingDistributedSurchargeMapper">
<select id="getMonthDetailByClientId" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[
SELECT d.client_id,
c.client_moniker,
c.company_name,
SUM(IF(d.type = 'Debit', total_surcharge, -total_surcharge)) total_surcharge,
SUM(IF(d.type = 'Credit', amount, 0)) credit_amount,
SUM(IF(d.type = 'Debit', amount, 0)) debit_amount,
SUM(IF(d.type = 'Debit', total_surcharge, 0)) total_surcharge
FROM log_clearing_distributed_surcharge d
INNER JOIN sys_clients c ON c.client_id = d.client_id
WHERE d.create_time >= #{datefrom}
AND d.create_time < #{dateto}
AND c.is_valid = 1
GROUP BY d.client_id
]]>
SELECT d.client_id,
c.client_moniker,
c.company_name,
SUM(IF(d.type = 'Debit', total_surcharge, -total_surcharge)) total_surcharge,
SUM(IF(d.type = 'Credit', amount, 0)) credit_amount,
SUM(IF(d.type = 'Debit', amount, 0)) debit_amount,
SUM(IF(d.type = 'Debit', total_surcharge, 0)) total_surcharge
FROM log_clearing_distributed_surcharge d
INNER JOIN sys_clients c ON c.client_id = d.client_id
WHERE d.create_time >= #{datefrom}
AND #{dateto} > d.create_time
AND c.is_valid = 1
GROUP BY d.client_id
</select>
<select id="findTransactions" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[
SELECT *
FROM log_clearing_distributed_surcharge
WHERE client_id = #{client_id}
ORDER BY create_time DESC
]]>
SELECT *
FROM log_clearing_distributed_surcharge
WHERE client_id = #{client_id}
ORDER BY create_time DESC
</select>
<select id="findTransactionsByDate" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[
SELECT *
FROM log_clearing_distributed_surcharge
WHERE client_id = #{client_id}
AND year(create_time) = #{year}
AND month(create_time) = #{month}
ORDER BY create_time DESC
]]>
<select id="findSurchargeTransactionsByDetailId" resultType="com.alibaba.fastjson.JSONObject">
SELECT client_id,clearing_detail_id, settle_date,total_surcharge,tax_amount, type, amount,create_time,operation,remark
FROM log_clearing_distributed_surcharge
WHERE client_id = #{client_id}
AND bill_id = #{detailId}
ORDER BY create_time
DESC
</select>
<select id="listUnClearedByMonth" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[
select d.*
from log_clearing_distributed_surcharge d
where d.bill_id is null
and d.create_time < #{dateto}
]]>
select d.*
from log_clearing_distributed_surcharge d
where d.bill_id is null
and #{dateto} > d.create_time
</select>
</mapper>

@ -113,13 +113,19 @@
locate(c.client_moniker,#{temp_mch_id_source})&lt;=0
</if>
<if test="approving">
and ((c.approve_result=4 and c.open_status is null) or (c.approve_result=3 and c.open_status is null) or
c.open_status=1 or c.open_status=2 or c.open_status=4)
</if>
<if test="quickPass">
and c.source=4
</if>
<if test="greenChannelBdTodo">
and ((c.source=1 or c.source=2) and c.approve_result=2 and (c.open_status is null or c.open_status=3))
</if>
<if test="search_text!=null">
<bind name="name_pattern" value="'%'+search_text+'%'"/>
<if test="text_type=='all'">

@ -2,37 +2,35 @@
<!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.FinancialSurchargeAccountDetailMapper">
<select id="findDetailsByMonth" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[
SELECT d.*,c.client_moniker,c.short_name,c.company_name
FROM financial_surcharge_account_detail d INNER JOIN sys_clients c ON c.client_id=d.client_id
WHERE d.settle_month = #{settle_month}
]]>
SELECT d.*,c.client_moniker,c.short_name,c.company_name
FROM financial_surcharge_account_detail d INNER JOIN sys_clients c ON c.client_id=d.client_id
WHERE d.settle_month = #{settle_month}
</select>
<select id="findDetailsByClientId" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[
SELECT d.*,c.client_moniker,c.short_name,c.company_name
FROM financial_surcharge_account_detail d INNER JOIN sys_clients c ON c.client_id=d.client_id
WHERE d.client_id = #{client_id} ORDER BY create_time desc
]]>
SELECT d.*,c.client_moniker,c.short_name,c.company_name
FROM financial_surcharge_account_detail d INNER JOIN sys_clients c ON c.client_id=d.client_id
WHERE d.client_id = #{client_id} ORDER BY create_time desc
</select>
<select id="listSettlementDatesInMonth" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[
SELECT d.*,c.client_moniker,c.short_name,c.company_name,s.balance
FROM financial_surcharge_account_detail d INNER JOIN sys_clients c ON c.client_id=d.client_id
LEFT JOIN sys_clients_surcharge_accounts s ON s.client_id = d.client_id
WHERE
d.settle_month= #{month}
ORDER BY s.balance ASC
]]>
SELECT fsad.detail_id,
fsad.settle_month,
fsad.total_surcharge,
fsad.credit_amount,
fsad.debit_amount,
sc.client_moniker,
sc.short_name,
sc.company_name
FROM financial_surcharge_account_detail fsad,
sys_clients sc
WHERE fsad.client_id = sc.client_id
AND fsad.settle_month = #{month}
</select>
<select id="listSettlementDatesByClientId" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[
SELECT d.*,c.client_moniker,c.short_name,c.company_name,s.balance
FROM financial_surcharge_account_detail d INNER JOIN sys_clients c ON c.client_id=d.client_id
LEFT JOIN sys_clients_surcharge_accounts s ON s.client_id = d.client_id
WHERE
s.client_id = #{client_id}
ORDER BY s.create_time DESC
]]>
SELECT d.*,c.client_moniker,c.short_name,c.company_name,s.balance
FROM financial_surcharge_account_detail d INNER JOIN sys_clients c ON c.client_id=d.client_id
LEFT JOIN sys_clients_surcharge_accounts s ON s.client_id = d.client_id
WHERE
s.client_id = #{client_id}
ORDER BY s.create_time DESC
</select>
</mapper>

@ -1,5 +1,5 @@
<!DOCTYPE html>
<html>
<html style="height: 100%;">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
@ -30,7 +30,7 @@
<!-- Theme style -->
<link rel="stylesheet" href="./static/lib/dist/css/AdminLTE.min.css">
<link rel="stylesheet" href="./static/css/main.css">
<link rel="stylesheet" href="./static/css/login.css">
<!--[if lt IE 9]>
@ -46,34 +46,66 @@
a:link {
color: #08c;
}
@media (min-width: 768px) {
.qrcode-target-show {
background-position: -201px -199px;
}
.qrcode-target-show {
background-position: -201px -199px;
}
.qrcode-target-hide {
background-position: -260px -260px;
}
.qrcode-target-hide {
background-position: -260px -260px;
.qrcode-target {
/*position: absolute;*/
width: 60px;
height: 80px;
margin-left: 93%;
margin-top: 0%;
margin-bottom: -8%;
display: block;
top: 0;
right: 0;
_right: 1px;
background-image: url(https://file.royalpay.com.au/open/2017/08/24/1503560419337_eiPHQHQRxGymVPaRHKCPndIO87zRWQ.png);
background-repeat: no-repeat;
cursor: pointer;
z-index: 101;
-webkit-transition: background-position .2s cubic-bezier(0.25, .5, .5, .9);
-moz-transition: background-position .2s cubic-bezier(0.25, .5, .5, .9);
transition: background-position .2s cubic-bezier(0.25, .5, .5, .9);
}
}
@media (max-width: 768px) {
.qrcode-target-show {
background-position: -201px -199px;
}
.qrcode-target-hide {
background-position: -260px -260px;
}
.qrcode-target {
/*position: absolute;*/
width: 60px;
height: 60px;
margin-left: 87%;
margin-top: -6%;
margin-bottom: -6%;
display: block;
top: 0;
right: 0;
_right: 1px;
background-image: url(https://file.royalpay.com.au/open/2017/08/24/1503560419337_eiPHQHQRxGymVPaRHKCPndIO87zRWQ.png);
background-repeat: no-repeat;
cursor: pointer;
z-index: 101;
-webkit-transition: background-position .2s cubic-bezier(0.25, .5, .5, .9);
-moz-transition: background-position .2s cubic-bezier(0.25, .5, .5, .9);
transition: background-position .2s cubic-bezier(0.25, .5, .5, .9);
.qrcode-target {
/*position: absolute;*/
width: 60px;
height: 60px;
margin-left: 87%;
margin-top: -7%;
margin-bottom: -8%;
display: block;
top: 0;
right: 0;
_right: 1px;
background-image: url(https://file.royalpay.com.au/open/2017/08/24/1503560419337_eiPHQHQRxGymVPaRHKCPndIO87zRWQ.png);
background-repeat: no-repeat;
cursor: pointer;
z-index: 101;
-webkit-transition: background-position .2s cubic-bezier(0.25, .5, .5, .9);
-moz-transition: background-position .2s cubic-bezier(0.25, .5, .5, .9);
transition: background-position .2s cubic-bezier(0.25, .5, .5, .9);
}
}
</style>
</head>
<body class="hold-transition login-page login-page-bg">
@ -121,44 +153,44 @@
</div>
</div>
<div class="login-box login-box-right divloginbox">
<div class="login-box-right">
<!-- /.login-logo -->
<div class="login-box-body login-box-bg">
<div class="login-container login-box-bg">
<a href="#" class="qrcode-target qrcode-target-show" id="app-btn" title="扫码登录" seed="authcenter-qrshow"></a>
<p style="text-align: center;"><img src="static/images/rp_logo_vertical.svg"
style="width: 80%;margin-top: -15%;margin-bottom: -10%;"></p>
<p style="text-align: center;"><img src="static/images/rp_login_logo.png"
style="width: 18%;margin-top: 14.1%"></p>
<p style="text-align: center;font-size:20px;">Easy BusinessEasy Payment</p>
<div id="qrdiv" hidden style="width: 70%;margin-left: 13%;">
<p class="ad">Easy BusinessEasy Payment</p>
<div id="qrdiv" hidden class="qrdiv">
<img style="width: 100%" id="qrimgdev">
<span style="margin-left: 13%">打开RoyalPay App扫码登录</span>
<span>打开RoyalPay App扫码登录</span>
</div>
<form action="" method="post" id="loginForm" visible>
<form action="" method="post" id="loginForm" visible class="form">
<div class="form-group has-feedback">
<input type="text" id="loginid-input" class="form-control" placeholder="Login ID">
<span class="glyphicon glyphicon-user form-control-feedback"></span>
<input type="text" id="loginid-input" class="form-control login-info" placeholder="Login ID">
<!--<span class="glyphicon glyphicon-user form-control-feedback"></span>-->
</div>
<div class="form-group has-feedback">
<input type="password" id="pwd-input" class="form-control" placeholder="Password">
<span class="glyphicon glyphicon-lock form-control-feedback"></span>
<input type="password" id="pwd-input" class="form-control login-info" placeholder="Password">
<!--<span class="glyphicon glyphicon-lock form-control-feedback"></span>-->
</div>
<!--<span style="padding-left: 70%;font-size: smaller" id="forgetPassword">Forgot Password</span>-->
<!--<br/>-->
<div class="row">
<div class="form-group col-xs-12">
<input type="text" name="verifyCode" class="form-control" style="width: 70%;display: inline"
<input type="text" name="verifyCode" class="form-control login-info" style="width: 70%;display: inline"
id="verifyCode" placeholder="Verification Code">
<img style="width:30%;display:inline;height: 34px;float: right" id="kaptcha"
<img class="captcha" id="kaptcha"
src="/global/userstatus/captcha-login"
title="点击更换"/>
</div>
<!-- /.col -->
<div class="col-xs-12 margin-bottom">
<button type="button" id="login-btn" style="background-color: #f06010"
class="btn btn-warning btn-block btn-flat">Sign In
<div class="col-xs-12 login-submit-margin">
<button type="button" id="login-btn"
class="btn btn-warning btn-block btn-flat login-submit">Sign In
</button>
</div>
<div class="col-xs-12" id="wechat-btn-div" hidden>
@ -166,33 +198,20 @@
<i class="fa fa-wechat"></i> WeChat Sign In
</button>
</div>
<a href="#" id="forgetPassword-btn">I forgot my password</a>
<a href="#" id="forgetPassword-btn" class="forget">I forgot my password</a>
</div>
</form>
<!--<div tabindex="-1" role="dialog" class="modal fade ng-isolate-scope in" style="z-index: 1050; display: none;"-->
<!--id="qrmodal">-->
<!--<div class="modal-dialog modal-sm">-->
<!--<div class="modal-content" uib-modal-transclude="">-->
<!--<div style="width: 100%;padding: 10px;" class="ng-scope">-->
<!--Use Royalpay App Scan<br>-->
<!--<img style="width: 100%" id="qrimg">-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<!---->
<!-- /* border-radius: 0; */
box-shadow: none;
border-color: #d2d6de;
height: 34px;
padding: 6px 12px;
font-size: 14px;
line-height: 1.42857143;
color: #555;
/* background-color: #fff; */
/* background-image: none; */
border: 1px solid #ccc;-->
<div class="row">
<div class="login-submit-margin">
<div class="col-sm-12 download-app">Download Royalpay App:
&nbsp;&nbsp;
<a href="https://itunes.apple.com/cn/app/royalpay/id1049566852?l=en&mt=8"><img src="/static/images/Bitmap.png"></a>
<a href="https://royalpay-1256684202.cos.ap-chengdu.myqcloud.com/royalpay_release_2.1.3_20190420_google.apk"><img src="/static/images/Bitmap1.png"></a></div>
<!--<div class="col-sm-6">-->
<!---->
<!--</div>-->
</div>
</div>
</div>
<!-- /.login-box-body -->
</div>

@ -0,0 +1,374 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="apple-touch-icon" sizes="57x57" href="ico/apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="ico/apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="ico/apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="ico/apple-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="ico/apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="ico/apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="ico/apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="ico/apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="ico/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192" href="ico/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="ico/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="ico/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="ico/favicon-16x16.png">
<link rel="manifest" href="ico/manifest.json">
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-TileImage" content="/ms-icon-144x144.png">
<meta name="theme-color" content="#ffffff">
<title>RoyalPay | Sign in</title>
<!-- Tell the browser to be responsive to screen width -->
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<!-- Bootstrap 3.3.5 -->
<link href="static/lib/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- Font Awesome -->
<link href="static/lib/font-awesome-4.6.3/css/font-awesome.min.css" rel="stylesheet">
<!-- Theme style -->
<link rel="stylesheet" href="./static/lib/dist/css/AdminLTE.min.css">
<link rel="stylesheet" href="./static/css/main.css">
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<style>
a:hover {
color: #08c;
text-decoration: underline;
}
a:link {
color: #08c;
}
.qrcode-target-show {
background-position: -201px -199px;
}
.qrcode-target-hide {
background-position: -260px -260px;
}
.qrcode-target {
/*position: absolute;*/
width: 60px;
height: 60px;
margin-left: 87%;
margin-top: -6%;
margin-bottom: -6%;
display: block;
top: 0;
right: 0;
_right: 1px;
background-image: url(https://file.royalpay.com.au/open/2017/08/24/1503560419337_eiPHQHQRxGymVPaRHKCPndIO87zRWQ.png);
background-repeat: no-repeat;
cursor: pointer;
z-index: 101;
-webkit-transition: background-position .2s cubic-bezier(0.25, .5, .5, .9);
-moz-transition: background-position .2s cubic-bezier(0.25, .5, .5, .9);
transition: background-position .2s cubic-bezier(0.25, .5, .5, .9);
}
</style>
</head>
<body class="hold-transition login-page login-page-bg">
<div tabindex="-100" role="dialog" class="modal fade ng-isolate-scope in" style="z-index: 1055; display: none;"
id="findPassword">
<div class="modal-dialog modal-sm">
<div class="modal-content" uib-modal-transclude="">
<div style="width: 100%;padding: 10px;" class="ng-scope">
<p class="login-box-msg">Reset Password</p>
<form action="" method="post">
<div class="form-group has-feedback">
<input type="text" id="partner_code" class="form-control" placeholder="Partner Code">
<span class="glyphicon glyphicon-user form-control-feedback"></span>
</div>
<div class="row">
<div class="form-group col-xs-12">
<input type="text" name="verifyCode" class="form-control" style="width: 70%;display: inline"
id="email—verifyCode" placeholder="Verification Code">
<img style="width:30%;display:inline;height: 34px;float: right" id="email-kaptcha"
src="/global/userstatus/captcha-login"
title="点击更换"/>
</div>
<div class="col-xs-6">
<div class="checkbox icheck">
<label class="" style="font-size: smaller">
Please enter your partner code
</label>
</div>
</div>
<!-- /.col -->
<div class="col-xs-6">
<button type="button" id="submitEmail-btn" class="btn btn-primary btn-flat col-xs-6">
Submit
</button>
<button type="button" id="cancel-btn" class="btn btn-default btn-flat col-xs-6">Cancel
</button>
</div>
<!-- /.col -->
</div>
</form>
</div>
</div>
</div>
</div>
<div class="login-box login-box-right divloginbox">
<!-- /.login-logo -->
<div class="login-box-body login-box-bg">
<a href="#" class="qrcode-target qrcode-target-show" id="app-btn" title="扫码登录" seed="authcenter-qrshow"></a>
<p style="text-align: center;"><img src="static/images/rp_logo_vertical.svg"
style="width: 80%;margin-top: -15%;margin-bottom: -10%;"></p>
<p style="text-align: center;font-size:20px;">Easy BusinessEasy Payment</p>
<div id="qrdiv" hidden style="width: 70%;margin-left: 13%;">
<img style="width: 100%" id="qrimgdev">
<span style="margin-left: 13%">打开RoyalPay App扫码登录</span>
</div>
<form action="" method="post" id="loginForm" visible>
<div class="form-group has-feedback">
<input type="text" id="loginid-input" class="form-control" placeholder="Login ID">
<span class="glyphicon glyphicon-user form-control-feedback"></span>
</div>
<div class="form-group has-feedback">
<input type="password" id="pwd-input" class="form-control" placeholder="Password">
<span class="glyphicon glyphicon-lock form-control-feedback"></span>
</div>
<!--<span style="padding-left: 70%;font-size: smaller" id="forgetPassword">Forgot Password</span>-->
<!--<br/>-->
<div class="row">
<div class="form-group col-xs-12">
<input type="text" name="verifyCode" class="form-control" style="width: 70%;display: inline"
id="verifyCode" placeholder="Verification Code">
<img style="width:30%;display:inline;height: 34px;float: right" id="kaptcha"
src="/global/userstatus/captcha-login"
title="点击更换"/>
</div>
<!-- /.col -->
<div class="col-xs-12 margin-bottom">
<button type="button" id="login-btn" style="background-color: #f06010"
class="btn btn-warning btn-block btn-flat">Sign In
</button>
</div>
<div class="col-xs-12" id="wechat-btn-div" hidden>
<button type="button" id="wechat-btn" style="background-color: #f06010" class="btn btn-warning btn-block btn-flat">
<i class="fa fa-wechat"></i> WeChat Sign In
</button>
</div>
<a href="#" id="forgetPassword-btn">I forgot my password</a>
</div>
</form>
<!--<div tabindex="-1" role="dialog" class="modal fade ng-isolate-scope in" style="z-index: 1050; display: none;"-->
<!--id="qrmodal">-->
<!--<div class="modal-dialog modal-sm">-->
<!--<div class="modal-content" uib-modal-transclude="">-->
<!--<div style="width: 100%;padding: 10px;" class="ng-scope">-->
<!--Use Royalpay App Scan<br>-->
<!--<img style="width: 100%" id="qrimg">-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<!---->
<!-- /* border-radius: 0; */
box-shadow: none;
border-color: #d2d6de;
height: 34px;
padding: 6px 12px;
font-size: 14px;
line-height: 1.42857143;
color: #555;
/* background-color: #fff; */
/* background-image: none; */
border: 1px solid #ccc;-->
</div>
<!-- /.login-box-body -->
</div>
<!-- /.login-box -->
<!-- jQuery 2.1.4 -->
<script src="static/lib/jquery/jquery-2.1.4.min.js"></script>
<script src="static/lib/jquery/jquery.cookie.js"></script>
<!-- Bootstrap 3.3.5 -->
<script src="static/lib/bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
if (window.console) {
var cons = console;
if (cons) {
cons.log("%c ", "padding:0px 300px;font-size:75px;background:url('https://file.royalpay.com.au/open/2017/08/24/1503558671611_yFZRCWzH7m3CVz2EJj2tu8jlmjS9PQ.png') no-repeat");
cons.log("%c温馨提示请不要调皮地在此粘贴执行任何内容这可能会导致您的账户受到攻击给您带来损失 ^_^'", " text-shadow: 0 1px 0 #ccc,0 2px 0 #c9c9c9,0 3px 0 #bbb,0 4px 0 #b9b9b9,0 5px 0 #aaa,0 6px 1px rgba(0,0,0,.1),0 0 5px rgba(0,0,0,.1),0 1px 3px rgba(0,0,0,.3),0 3px 5px rgba(0,0,0,.2),0 5px 10px rgba(0,0,0,.25),0 10px 10px rgba(0,0,0,.2),0 20px 20px rgba(0,0,0,.15);font-size:20px")
cons.log("做地球上最具互联网性、创新性、专业有爱的支付团队。 https://www.royalpay.com.au")
}
}
var ua = navigator.userAgent.toLowerCase();
if (ua.indexOf('micromessenger') >= 0) {
$('#wechat-btn-div').show();
$('#app-btn').hide();
$('#wechat-btn').click(function () {
location.href = '/global/userstatus/partner_signin_wechat';
});
}
function getUrlParam(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
var r = window.location.search.substr(1).match(reg); //匹配目标参数
if (r != null) {
return unescape(r[2]);
} else {
return null; //返回参数值
}
}
$('input').keypress(function (evt) {
if (evt.keyCode == 13) {
$('#login-btn').click();
}
});
$('#verifyCode').focus(function () {
var expire = $.cookie('code_expire_time');
if(expire!=null && new Date(parseInt(expire))<new Date()){
$('#kaptcha').click();
}
});
$('#login-btn').click(function () {
var loginid = $('#loginid-input').val();
if (loginid == null || loginid.length == 0) {
alert('请填写账号');
return;
}
var pwd = $('#pwd-input').val();
if (pwd == null || pwd.length == 0) {
alert('请填写密码');
return;
}
var verifyCode = $('#verifyCode').val();
if (verifyCode == null || verifyCode.length == 0) {
alert('请填写验证码');
return;
}
$.ajax({
url: '/global/userstatus/partner_signin',
method: 'post',
data: JSON.stringify({loginId: loginid, password: pwd, verifyCode: verifyCode}),
contentType: 'application/json',
dataType: 'text',
success: function () {
var from = getUrlParam("f");
location.href = from ? decodeURIComponent(from) : 'index.html'
},
error: function (jqXHR) {
alert(JSON.parse(jqXHR.responseText).message);
$('#kaptcha').attr("src", "/global/userstatus/captcha-login?" + Math.floor(Math.random() * 100));
}
})
});
$('#kaptcha').click(function () {
$(this).attr("src", "/global/userstatus/captcha-login?" + Math.floor(Math.random() * 100));
});
$('#email-kaptcha').click(function () {
$(this).attr("src", "/global/userstatus/captcha-login?" + Math.floor(Math.random() * 100));
});
$('#app-btn').click(function () {
if ($('#qrdiv').is(":visible")) {
$('#app-btn').attr('class', 'qrcode-target qrcode-target-show');
$('#loginForm').show();
$('#qrdiv').hide();
return;
}
if ($('#qrdiv').is(":hidden")) {
$('#app-btn').attr('class', 'qrcode-target qrcode-target-hide');
getNewQRCode();
}
});
function getNewQRCode() {
$.ajax({
url: '/global/userstatus/partner_signin_app_qrcode',
method: 'get',
dataType: 'json',
success: function (data) {
$('#qrimgdev').attr('src', data.code_img);
$('#qrdiv').show();
$('#loginForm').hide();
setTimeout(function () {
checkQRStatus(data.code_id)
}, 2000);
},
error: function (jqXHR) {
alert(jqXHR.responseJSON.message);
}
})
}
function checkQRStatus(codeId) {
$.ajax({
url: '/global/userstatus/partner_signin_app_qrcode/' + codeId + '/check',
method: 'get',
success: function () {
location.href = '/index.html'
},
error: function () {
if ($('#qrdiv').is(":visible")) {
setTimeout(function () {
checkQRStatus(codeId)
}, 2000)
}
}
})
}
$('#forgetPassword-btn').click(function () {
// $('#findPassword').show();
location.href = 'forget_password.html'
});
$('#cancel-btn').click(function () {
$('#findPassword').hide();
});
$('#submitEmail-btn').click(function () {
var partner_code = $('#partner_code').val();
if (partner_code == null || partner_code.length == 0) {
alert('请填入商户编码');
return;
}
var verifyCode = $('#email—verifyCode').val();
if (verifyCode == null || verifyCode.length == 0) {
alert('请填写验证码');
return;
}
$.ajax({
url: '/global/userstatus/partner_forgetpassword',
method: 'post',
data: JSON.stringify({partner_code: partner_code, verifyCode: verifyCode}),
contentType: 'application/json',
dataType: 'text',
success: function () {
alert("Reset password email has send your");
$('#findPassword').hide();
},
error: function (jqXHR) {
alert(JSON.parse(jqXHR.responseText).message);
$('#email-kaptcha').attr("src", "/global/userstatus/captcha-login?" + Math.floor(Math.random() * 100));
}
})
})
})
</script>
</body>
</html>

@ -1,5 +1,5 @@
<!DOCTYPE html>
<html>
<html style="height: 100%;">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
@ -30,70 +30,158 @@
<!-- Theme style -->
<link rel="stylesheet" href="./static/lib/dist/css/AdminLTE.min.css">
<link rel="stylesheet" href="./static/css/main.css">
<link rel="stylesheet" href="./static/css/m_login.css">
<!-->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body class="hold-transition login-page login-page-bg">
<div tabindex="-1" role="dialog" class="modal fade ng-isolate-scope in" style="z-index: 1050; display: none;"
id="qrmodal">
<div class="modal-dialog modal-sm">
<div class="modal-content" uib-modal-transclude="">
<div style="width: 100%;padding: 10px;" class="ng-scope">
请使用微信扫描<br>
<img style="width: 100%" id="qrimg">
</div>
</div>
</div>
</div>
<div class="login-box login-box-right divloginbox">
<style>
@media (min-width: 768px) {
.qrcode-target-show {
background-position: -199px -199px;
}
<!-- /.login-logo -->
<div class="login-box-body login-box-bg">
.qrcode-target-hide {
background-position: -260px -260px;
}
<p style="text-align: center;"><img src="static/images/rp_logo_vertical.svg" style="width: 80%;margin-top: -15%;margin-bottom: -10%;"></p>
.qrcode-target {
/*position: absolute;*/
width: 60px;
height: 80px;
margin-left: 96%;
margin-top: 0%;
margin-bottom: -8%;
display: block;
top: 0;
right: 0;
_right: 1px;
background-image: url(https://file.royalpay.com.au/open/2017/08/24/1503560419337_eiPHQHQRxGymVPaRHKCPndIO87zRWQ.png);
background-repeat: no-repeat;
cursor: pointer;
z-index: 101;
-webkit-transition: background-position .2s cubic-bezier(0.25, .5, .5, .9);
-moz-transition: background-position .2s cubic-bezier(0.25, .5, .5, .9);
transition: background-position .2s cubic-bezier(0.25, .5, .5, .9);
}
}
@media (max-width: 768px) {
.qrcode-target-show {
background-position: -201px -199px;
}
<p style="text-align: center;font-size:20px;">Easy BusinessEasy Payment</p>
.qrcode-target-hide {
background-position: -260px -260px;
}
.qrcode-target {
/*position: absolute;*/
width: 60px;
height: 60px;
margin-left: 87%;
margin-top: -7%;
margin-bottom: -8%;
display: block;
top: 0;
right: 0;
_right: 1px;
background-image: url(https://file.royalpay.com.au/open/2017/08/24/1503560419337_eiPHQHQRxGymVPaRHKCPndIO87zRWQ.png);
background-repeat: no-repeat;
cursor: pointer;
z-index: 101;
-webkit-transition: background-position .2s cubic-bezier(0.25, .5, .5, .9);
-moz-transition: background-position .2s cubic-bezier(0.25, .5, .5, .9);
transition: background-position .2s cubic-bezier(0.25, .5, .5, .9);
}
}
<form action="" method="post">
<div class="form-group has-feedback">
<input type="text" id="loginid-input" class="form-control" placeholder="账号">
<span class="glyphicon glyphicon-user form-control-feedback"></span>
</div>
<div class="form-group has-feedback">
<input type="password" id="pwd-input" class="form-control" placeholder="密码">
<span class="glyphicon glyphicon-lock form-control-feedback"></span>
</div>
<div class="row">
<div class="form-group col-xs-12">
<input type="text" name="verifyCode" class="form-control" style="width: 70%;display: inline"
id="verifyCode" placeholder="验证码">
<img style="width:30%;display:inline;height: 34px;float: right" id="kaptcha"
src="/global/userstatus/captcha-login"
title="点击更换"/>
</style>
</head>
<body class="hold-transition login-page login-page-bg">
<!--<div tabindex="-1" role="dialog" class="modal fade ng-isolate-scope in" style="z-index: 1050; display: none;"-->
<!--id="qrmodal">-->
<!--<div class="modal-dialog modal-sm">-->
<!--<div class="modal-content" uib-modal-transclude="">-->
<!--<div style="width: 100%;padding: 10px;" class="ng-scope">-->
<!--请使用微信扫描<br>-->
<!--<img style="width: 100%" id="qrimg">-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<div class="row" style="text-align: center">
<a href="#" class="qrcode-target qrcode-target-show" id="app-btn" title="扫码登录" seed="authcenter-qrshow"></a>
<div class="login-container text-center">
<!-- /.login-logo -->
<div class="login-box-bg">
<div class="col-md-6">
<p style="text-align: center;"><img src="static/images/rp_login_logo.png" style="width: 40%;margin-top: 10%"></p>
<p class="ad">Easy BusinessEasy Payment</p>
</div>
<!-- /.col -->
<div class="col-xs-12 margin-bottom">
<button type="button" id="login-btn" style="background-color: #f06010" class="btn btn-warning btn-block btn-flat">Sign In</button>
<div class="col-md-6">
<div id="qrdiv" hidden class="qrdiv">
<img style="width: 60%" id="qrimgdev"><br>
<span>请使用微信扫描</span>
</div>
<form action="" method="post" id="loginForm">
<div class="form-group has-feedback">
<input type="text" id="loginid-input" class="form-control login-info" placeholder="Login ID">
<!--<span class="glyphicon glyphicon-user form-control-feedback"></span>-->
</div>
<div class="form-group has-feedback">
<input type="password" id="pwd-input" class="form-control login-info" placeholder="Password">
<!--<span class="glyphicon glyphicon-lock form-control-feedback"></span>-->
</div>
<div class="row">
<div class="form-group col-xs-12">
<input type="text" name="verifyCode" class="form-control login-info" style="width: 70%;display: inline"
id="verifyCode" placeholder="Verification Code">
<img style="width:30%;display:inline;height: 34px;float: right" id="kaptcha"
src="/global/userstatus/captcha-login"
title="点击更换"/>
</div>
<!-- /.col -->
<div class="col-xs-12 margin-bottom">
<button type="button" id="login-btn" class="btn btn-info btn-block btn-flat login-submit">Sign In</button>
</div>
<div class="col-xs-12" hidden id="wechat-btn-div">
<button type="button" id="wechat-btn" class="btn btn-warning btn-block btn-flat">
<i class="fa fa-wechat"></i> WeChat Sign In
</button>
</div>
<!-- /.col -->
</div>
</form>
</div>
<div class="col-xs-12">
<button type="button" id="wechat-btn" style="background-color: #f06010" class="btn btn-warning btn-block btn-flat">
<i class="fa fa-wechat"></i> WeChat Sign In
</button>
<div class="row">
<div class="login-submit-margin">
<div class="col-md-12 download-app">
Download Royalpay App:
&nbsp;&nbsp;
<a href="https://itunes.apple.com/cn/app/royalpay/id1049566852?l=en&mt=8"><img src="/static/images/Bitmap.png"></a>
<a href="https://royalpay-1256684202.cos.ap-chengdu.myqcloud.com/royalpay_release_2.1.3_20190420_google.apk"><img src="/static/images/Bitmap1.png"></a>
</div>
<!--<div class="col-sm-6">-->
<!---->
<!--</div>-->
</div>
</div>
<!-- /.col -->
</div>
</form>
<!-- /.login-box-body -->
</div>
</div>
<!-- /.login-box-body -->
</div>
<!-- /.login-box -->
<!-- jQuery 2.1.4 -->
@ -162,26 +250,53 @@
$(this).attr("src", "/global/userstatus/captcha-login?" + Math.floor(Math.random() * 100));
});
var ua = navigator.userAgent.toLowerCase();
if (ua.indexOf('micromessenger') >= 0) {
$('#wechat-btn-div').show();
$('#app-btn').hide();
$('#wechat-btn').click(function () {
location.href = '/global/userstatus/partner_signin_wechat';
});
}
$('#app-btn').click(function () {
if ($('#qrdiv').is(":visible")) {
$('#app-btn').attr('class', 'qrcode-target qrcode-target-show');
$('#loginForm').show();
$('#qrdiv').hide();
return;
}
if ($('#qrdiv').is(":hidden")) {
$('#app-btn').attr('class', 'qrcode-target qrcode-target-hide');
getNewQRCode();
}
});
function getNewQRCode() {
$.ajax({
url: '/global/userstatus/manager_signin_wechat_qrcode',
method: 'get',
dataType: 'json',
success: function (data) {
$('#qrimgdev').attr('src', data.code_img);
$('#qrdiv').show();
$('#loginForm').hide();
setTimeout(function () {
checkQRStatus(data.code_id)
}, 2000);
},
error: function (jqXHR) {
alert(jqXHR.responseJSON.message);
}
})
}
$('#wechat-btn').click(function () {
var ua = navigator.userAgent.toLowerCase();
if (ua.indexOf('micromessenger') >= 0) {
location.href = '/global/userstatus/manager_signin_wechat'
} else {
$.ajax({
url: '/global/userstatus/manager_signin_wechat_qrcode',
method: 'get',
dataType: 'json',
success: function (data) {
$('#qrmodal').find('img#qrimg').attr('src', data.code_img);
$('#qrmodal').show();
setTimeout(function () {
checkQRStatus(data.code_id)
}, 2000);
},
error: function (jqXHR) {
alert(jqXHR.responseJSON.message);
}
})
getNewQRCode();
}
});
$('#qrmodal').click(function () {

@ -0,0 +1,208 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="apple-touch-icon" sizes="57x57" href="ico/apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="ico/apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="ico/apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="ico/apple-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="ico/apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="ico/apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="ico/apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="ico/apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="ico/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192" href="ico/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="ico/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="ico/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="ico/favicon-16x16.png">
<link rel="manifest" href="ico/manifest.json">
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-TileImage" content="/ms-icon-144x144.png">
<meta name="theme-color" content="#ffffff">
<title>RoyalPay | 管理登录</title>
<!-- Tell the browser to be responsive to screen width -->
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<!-- Bootstrap 3.3.5 -->
<link href="static/lib/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- Font Awesome -->
<link href="static/lib/font-awesome-4.6.3/css/font-awesome.min.css" rel="stylesheet">
<!-- Theme style -->
<link rel="stylesheet" href="./static/lib/dist/css/AdminLTE.min.css">
<link rel="stylesheet" href="./static/css/main.css">
<!-->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body class="hold-transition login-page login-page-bg">
<div tabindex="-1" role="dialog" class="modal fade ng-isolate-scope in" style="z-index: 1050; display: none;"
id="qrmodal">
<div class="modal-dialog modal-sm">
<div class="modal-content" uib-modal-transclude="">
<div style="width: 100%;padding: 10px;" class="ng-scope">
请使用微信扫描<br>
<img style="width: 100%" id="qrimg">
</div>
</div>
</div>
</div>
<div class="login-box login-box-right divloginbox">
<!-- /.login-logo -->
<div class="login-box-body login-box-bg">
<p style="text-align: center;"><img src="static/images/rp_logo_vertical.svg" style="width: 80%;margin-top: -15%;margin-bottom: -10%;"></p>
<p style="text-align: center;font-size:20px;">Easy BusinessEasy Payment</p>
<form action="" method="post">
<div class="form-group has-feedback">
<input type="text" id="loginid-input" class="form-control" placeholder="账号">
<span class="glyphicon glyphicon-user form-control-feedback"></span>
</div>
<div class="form-group has-feedback">
<input type="password" id="pwd-input" class="form-control" placeholder="密码">
<span class="glyphicon glyphicon-lock form-control-feedback"></span>
</div>
<div class="row">
<div class="form-group col-xs-12">
<input type="text" name="verifyCode" class="form-control" style="width: 70%;display: inline"
id="verifyCode" placeholder="验证码">
<img style="width:30%;display:inline;height: 34px;float: right" id="kaptcha"
src="/global/userstatus/captcha-login"
title="点击更换"/>
</div>
<!-- /.col -->
<div class="col-xs-12 margin-bottom">
<button type="button" id="login-btn" style="background-color: #f06010" class="btn btn-warning btn-block btn-flat">Sign In</button>
</div>
<div class="col-xs-12">
<button type="button" id="wechat-btn" style="background-color: #f06010" class="btn btn-warning btn-block btn-flat">
<i class="fa fa-wechat"></i> WeChat Sign In
</button>
</div>
<!-- /.col -->
</div>
</form>
</div>
<!-- /.login-box-body -->
</div>
<!-- /.login-box -->
<!-- jQuery 2.1.4 -->
<script src="static/lib/jquery/jquery-2.1.4.min.js"></script>
<script src="static/lib/jquery/jquery.cookie.js"></script>
<!-- Bootstrap 3.3.5 -->
<script src="static/lib/bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
function getUrlParam(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
var r = window.location.search.substr(1).match(reg); //匹配目标参数
if (r != null) {
return unescape(r[2]);
}else {
return null; //返回参数值
}
}
$('input').keypress(function (evt) {
if (evt.keyCode == 13) {
$('#login-btn').click();
}
});
$('#verifyCode').focus(function () {
var expire = $.cookie('code_expire_time');
if(expire!=null && new Date(parseInt(expire))<new Date()){
$('#kaptcha').click();
}
});
$('#login-btn').click(function () {
var loginid = $('#loginid-input').val();
if (loginid == null || loginid.length == 0) {
alert('请填写账号');
return;
}
var pwd = $('#pwd-input').val();
if (pwd == null || pwd.length == 0) {
alert('请填写密码');
return;
}
var verifyCode = $('#verifyCode').val();
if (verifyCode == null || verifyCode.length == 0) {
alert('请填写验证码');
return;
}
$.ajax({
url: '/global/userstatus/manager_signin',
method: 'post',
data: JSON.stringify({loginId: loginid, password: pwd, verifyCode: verifyCode}),
contentType: 'application/json',
dataType: 'text',
success: function () {
var from = getUrlParam("f");
location.href = from ? decodeURIComponent(from) : 'managev2.html'
},
error: function (jqXHR) {
alert(JSON.parse(jqXHR.responseText).message);
$('#kaptcha').attr("src", "/global/userstatus/captcha-login?" + Math.floor(Math.random() * 100));
}
})
});
$('#kaptcha').click(function () {
$(this).attr("src", "/global/userstatus/captcha-login?" + Math.floor(Math.random() * 100));
});
$('#wechat-btn').click(function () {
var ua = navigator.userAgent.toLowerCase();
if (ua.indexOf('micromessenger') >= 0) {
location.href = '/global/userstatus/manager_signin_wechat'
} else {
$.ajax({
url: '/global/userstatus/manager_signin_wechat_qrcode',
method: 'get',
dataType: 'json',
success: function (data) {
$('#qrmodal').find('img#qrimg').attr('src', data.code_img);
$('#qrmodal').show();
setTimeout(function () {
checkQRStatus(data.code_id)
}, 2000);
},
error: function (jqXHR) {
alert(jqXHR.responseJSON.message);
}
})
}
});
$('#qrmodal').click(function () {
$(this).hide()
});
function checkQRStatus(codeId) {
$.ajax({
url: '/global/userstatus/manager_signin_wechat_qrcode/' + codeId + '/check',
method: 'get',
success: function () {
location.href = '/managev2.html'
},
error: function () {
setTimeout(function () {
checkQRStatus(codeId)
}, 2000)
}
})
}
})
</script>
</body>
</html>

@ -605,7 +605,7 @@ margin-bottom: 10%;"/>
</li>
<li ui-sref-active="active" ng-if="('preRefund'|withModule)">
<a ui-sref="analysis_monitoring.pre_refund" ui-sref-opts="{reload:true}">
<i class="fa fa-tv"></i> <span>商户欠款|Pre Refund</span>
<i class="fa fa-tv"></i> <span>授信退款|Credit refund</span>
</a>
</li>
<li ui-sref-active="active">

@ -113,7 +113,7 @@ define(['angular', 'decimal', 'uiBootstrap', 'uiRouter', 'angularEcharts'], func
}
$scope.chooseOrg = function (org) {
if (org == 'all') {
if (org === 'all') {
delete $scope.params.org_id;
$scope.showOrg = 'All'
} else {
@ -135,6 +135,8 @@ define(['angular', 'decimal', 'uiBootstrap', 'uiRouter', 'angularEcharts'], func
$http.get('/sys/clean_logs/clients', {params: params}).then(function (resp) {
$scope.clearing_logs = resp.data.data;
$scope.pagination = resp.data.pagination;
}, function (resp) {
commonDialog.alert({type: 'error', title: 'Error', content: resp.data.message});
});
analysisLog(params);
};
@ -144,8 +146,6 @@ define(['angular', 'decimal', 'uiBootstrap', 'uiRouter', 'angularEcharts'], func
})
};
$scope.loadClearingLogs(1);
$scope.loadClearingLogsHistory = function (days) {
var endDate = new Date();
var startDate = new Date();

@ -18,16 +18,6 @@
</ol>
</section>
<div class="content">
<!--<div class="row margin-bottom">
<div class="col-sm-12">
<button class="btn btn-danger" type="button" ui-sref=".rate_warnings">
<i class="fa fa-bell"></i> Rate Expire Warnings
</button>
<button class="btn btn-primary" type="button" ui-sref=".date_setting">
<i class="fa fa-cog"></i> Settlement Date Config
</button>
</div>
</div>-->
<div class="box box-warning">
<div class="box-header">Settlement Dates</div>
<div class="box-body">
@ -39,151 +29,5 @@
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="box-solid">
<div class="box box-warning">
<div class="box-header">
<div class="row">
<div class="col-sm-12">
<div class="form-horizontal">
<div class="form-group col-sm-12">
<div class="form-inline">
<label class="control-label col-sm-2" for="sub-merchant-search">Partner
Code</label>
<div class="col-sm-10">
<input type="text" class="form-control"
id="sub-merchant-search"
ng-model="params.clientMoniker">
</div>
</div>
</div>
<div class="form-group col-xs-12 col-sm-12">
<label class="control-label col-xs-4 col-sm-2">Date Range</label>
<div class="col-sm-10">
<div class="form-control-static form-inline">
<div style="display: inline-block">
<input class="form-control" id="date-from-input"
ng-model="params.begin"
uib-datepicker-popup size="10" placeholder="From"
is-open="dateBegin.open" ng-click="dateBegin.open=true"
datepicker-options="{maxDate:params.end||today}">
</div>
~
<div style="display: inline-block">
<input class="form-control" id="date-to-input"
ng-model="params.end"
uib-datepicker-popup size="10" placeholder="To"
is-open="dateTo.open" ng-click="dateTo.open=true"
datepicker-options="{minDate:params.begin,maxDate:today}">
</div>
<div class="btn-group">
<a role="button" class="btn btn-default btn-sm"
ng-click="chooseToday()">Today</a>
</div>
<div class="btn-group">
<a role="button" class="btn btn-default btn-sm"
ng-click="chooseYesterday()">Yesterday</a>
</div>
<div class="btn-group">
<a role="button" class="btn btn-default btn-sm"
ng-click="chooseLast7Days()">Last 7 Days</a>
</div>
<div class="btn-group">
<a role="button" class="btn btn-default btn-sm"
ng-click="thisMonth()">This Month</a>
</div>
<div class="btn-group">
<a role="button" class="btn btn-default btn-sm"
ng-click="lastMonth()">Last Month</a>
</div>
<div class="btn-group">
<a role="button" class="btn btn-default btn-sm"
ng-click="thisYear()">This Year</a>
</div>
<div uib-dropdown ng-if="orgs" class="btn-group">
<button id="single-button" type="button" class="btn btn-default"
uib-dropdown-toggle ng-disabled="disabled">
{{showOrg}} <span class="caret"></span>
</button>
<ul class="dropdown-menu" uib-dropdown-menu
aria-labelledby="single-button">
<li><a ng-click="chooseOrg('all')">All</a></li>
<li ng-repeat="org in orgs"><a ng-click="chooseOrg(org)">{{org.name}}</a>
</li>
</ul>
</div>
<button class="btn btn-success" type="button"
ng-click="loadClearingLogs()">
<i class="fa fa-search"></i>
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="box box-warning">
<div class="box-header">
<h3 class="box-title">
<span ng-if="clearing_logs.length">Total | Clearing Amount: {{analysis.total|currency:'AUD '}},
Transfer to Merchant: {{analysis.income|currency:'AUD '}}, Merchant Service Fee: {{analysis.fee|currency:'AUD '}}</span>
</h3>
</div>
<div class="box-body">
<div class="row cen col-sm-12">
<div class="table-responsive">
<table class="table table-bordered table-hover table-striped">
<thead>
<tr>
<th>Partner Name</th>
<th>Total Amount</th>
<th>Transfer to Merchant</th>
<th>Merchant Service Fee</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="log in clearing_logs">
<td ng-bind="log.short_name"></td>
<td ng-bind="log.total|currency:'AUD '"></td>
<td ng-bind="log.income|currency:'AUD '"></td>
<td ng-bind="log.fee|currency:'AUD '"></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="box-footer" ng-if="clearing_logs.length">
<uib-pagination class="pagination"
total-items="pagination.totalCount"
boundary-links="true"
ng-model="pagination.page"
items-per-page="pagination.limit"
max-size="10"
ng-change="loadClearingLogs()"
previous-text="&lsaquo;"
next-text="&rsaquo;"
first-text="&laquo;"
last-text="&raquo;"></uib-pagination>
<div class="row">
<div class="col-xs-12">Total Records:{{pagination.totalCount}};Total Pages:{{pagination.totalPages}}</div>
</div>
</div>
</div>
<div class="box box-warning">
<div class="box-header with-border">清算金额趋势</div>
<div class="box-body">
<div class="chart" echarts="clearingHistory" style="height: 300px"
ng-class="{nodata:clearingHistory.nodata}"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

@ -1,10 +1,10 @@
<section class="content-header">
<h1>Pre Refund</h1>
<h1>授信退款|Credit refund</h1>
<ol class="breadcrumb">
<li>
<i class="fa fa-list-alt"></i> Transaction
</li>
<li class="active">Pre Refund</li>
<li class="active">授信退款|Credit refund</li>
</ol>
</section>
<section class="content">
@ -14,19 +14,17 @@
<table class="table table-bordered table-hover table-striped">
<thead>
<tr>
<th>Partner</th>
<th>Amount</th>
<th>Last Refund Time</th>
<th>商户编码</th>
<th>欠费金额(AUD)</th>
<th>最后交易时间</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="log in log_risk" ng-class="{warning:trade.clearing_status==2}">
<td>
{{log.client_moniker}}
<tr ng-repeat="log in log_risk">
<td ng-bind="log.client_moniker">
</td>
<td>{{log.amount}}</td>
<td>{{log.transation_time}}</td>
<td ng-bind="log.amount"></td>
<td ng-bind="log.transation_time |date:'yyyy-MM-dd HH:mm:ss'"></td>
</tr>
</tbody>
</table>
@ -43,7 +41,9 @@
first-text="&laquo;"
last-text="&raquo;"></uib-pagination>
<div class="row">
<div class="col-xs-12">Total Records:{{pagination.totalCount}};Total Pages:{{pagination.totalPages}}</div>
<div class="col-xs-12">Total Records:{{pagination.totalCount}};Total
Pages:{{pagination.totalPages}}
</div>
</div>
</div>
</div>

@ -193,7 +193,7 @@
</div>
<div class="col-sm-2 col-xs-6">
<div class="description-block">
<div class="description-header text-bold"><img src="/static/images/alipay_sign.png"/>AlipayOnline</div>
<div class="description-header text-bold"><small><img src="/static/images/alipay_sign.png"/>AlipayOnline</small></div>
<div class="description-text">
<label class="description-text text-red"
ng-bind="totalChannelAmount.alipayonlineamount|currency: ' $ '"></label></br>
@ -226,7 +226,9 @@
</div>
</div>
</div>
</div>
<div class="row">
<!-- 显示Rpay+交易额分析-->
<div class="col-sm-2 col-xs-6">
<div class="description-block">
@ -252,7 +254,7 @@
</div>
<div class="col-sm-2 col-xs-6">
<div class="description-block">
<div class="description-header text-bold"><img src="/static/images/lakalapay_sign.png"/>LakalaPay</div>
<div class="description-header text-bold"><small><img src="/static/images/lakalapay_sign.png"/>LakalaPay</small></div>
<div class="description-text">
<label class="description-text text-red"
ng-bind="totalChannelAmount.lakalapayamount|currency: ' $ '"></label></br>
@ -261,7 +263,6 @@
</div>
</div>
</div>
</div>
<!--<table class="table">
<tr>

@ -0,0 +1,253 @@
/***login***/
@media (min-width: 768px) {
.login-box-right {
width: 42.2%;
height: 100%;
background-color: black;
opacity: 0.8;
position: relative;
left: 57.8%
}
.login-page-bg {
width: 100%;
height: 100%;
background-color: #d2d6de;
background: url(../images/bg2.png);
/*background: url(../images/logonbg.jpg) ;*/
position: relative;
background-size: 100% 100%;
}
.login-container {
text-align: center;
}
.ad {
text-align: center;
font-size: 20px;
color: #FFFFFF;
}
.qrdiv {
width: 50%;
margin-left: 26%;
color: #FFFFFF;
}
.form {
padding: 4% 25%
}
.login-box-bg {
/*background-color: rgba(255,255,255,0.5);*/
/*box-shadow: 0px 2px 20px 2px rgba(0, 0, 0, 0.3);*/
/*filter: alpha(opacity=40);*/
/*opacity: 0.8;*/
}
.login-info{
/*height: 45px;*/
background-color: black;
font-size: 18px;
color: white;
}
.captcha {
width: 30%;
display: inline;
height: 34px;
float: right
}
.login-submit{
background-color: #f06010;
font-size: 18px;
}
.login-submit-margin{
margin-top: 10%;
}
.forget{
color: #f06010;
font-size: 18px;
}
.download-app{
color: #FFFFFF;
font-size: 15px;
}
.download-app img{
width: 100px;
}
.divloginbox {
animation: loginbox 1s;
-moz-animation: loginbox 1s;
-webkit-animation: loginbox 1s;
-o-animation: loginbox 1s;
}
@keyframes loginbox {
from {
margin-right: -30%
}
to {
margin-right: 35%
}
}
@-moz-keyframes loginbox {
from {
margin-right: -30%
}
to {
margin-right: 35%
}
}
@-webkit-keyframes loginbox {
from {
margin-right: -30%
}
to {
margin-right: 35%
}
}
@-o-keyframes loginbox {
from {
margin-right: -30%
}
to {
margin-right: 35%
}
}
}
@media (max-width: 768px) {
.login-page-bg {
background: url('');
background-color: #d2d6de;
}
.login-box-right {
margin-top: 20%;
margin: 7% auto;
width: 90%;
}
.login-box-bg {
/*background-color: rgba(255,255,255,0.5);*/
box-shadow: 0px 2px 20px 2px rgba(0, 0, 0, 0.3);
filter: alpha(opacity=40);
opacity: 0.7;
}
.login-container {
text-align: center;
background: #fff;
padding: 20px;
border-top: 0;
color: #666;
}
.ad {
text-align: center;
font-size: 20px;
color: #000000;
}
.qrdiv {
width: 50%;
margin-left: 26%;
}
.form {
}
.login-info{
}
.captcha {
width: 30%;
display: inline;
height: 34px;
float: right
}
.login-submit{
background-color: #f06010;
}
.login-submit-margin{
margin-bottom: 20px;
margin-top:20px;
}
.forget{
}
.download-app{
color: #000000;
font-size: 15px;
}
.download-app img{
width: 50px;
}
.divloginbox {
animation: loginboxtop 1s;
-moz-animation: loginboxtop 1s;
-webkit-animation: loginboxtop 1s;
-o-animation: loginboxtop 1s;
}
@keyframes loginboxtop {
from {
margin-top: 0
}
to {
margin-top: 20%
}
}
@-moz-keyframes loginboxtop {
from {
margin-top: 0
}
to {
margin-top: 20%
}
}
@-webkit-keyframes loginboxtop {
from {
margin-top: 0
}
to {
margin-top: 20%
}
}
@-o-keyframes loginboxtop {
from {
margin-top: 0
}
to {
margin-top: 20%
}
}
}
/***login***/

@ -0,0 +1,215 @@
/***login***/
@media (min-width: 768px) {
.login-container {
width: 800px;
margin: 12% auto;
margin-bottom: 0;
}
.login-info{
background-color: black;
opacity: 0.8;
color: white;
border-radius:4px
}
.login-box-right {
margin-right: 35%;
}
.login-page-bg {
width: 100%;
height: 100%;
background-color: #d2d6de;
background: url(../images/bg3.png);
/*background: url(../images/logonbg.jpg) ;*/
position: relative;
background-size: 100% 100%;
}
.login-box-bg {
/*background-color: rgba(255,255,255,0.5);*/
/*box-shadow: 0px 2px 20px 2px rgba(0, 0, 0, 0.3);*/
filter: alpha(opacity=40);
opacity: 0.8;
}
.ad {
text-align: center;
font-size: 20px;
color: #FFFFFF;
}
.login-submit{
background-color: #54C7FF;
border-color: #54C7FF;
margin-top: 10%;
color: white;
}
.qrdiv {
color: #FFFFFF;
}
.login-submit-margin{
margin-top: 45%;
color: #FFFFFF;
}
.download-app {
font-size: 15px;
}
.download-app img{
width: 100px;
}
.divloginbox {
animation: loginbox 1s;
-moz-animation: loginbox 1s;
-webkit-animation: loginbox 1s;
-o-animation: loginbox 1s;
}
@keyframes loginbox {
from {
margin-right: -30%
}
to {
margin-right: 35%
}
}
@-moz-keyframes loginbox {
from {
margin-right: -30%
}
to {
margin-right: 35%
}
}
@-webkit-keyframes loginbox {
from {
margin-right: -30%
}
to {
margin-right: 35%
}
}
@-o-keyframes loginbox {
from {
margin-right: -30%
}
to {
margin-right: 35%
}
}
}
@media (max-width: 768px) {
.login-container {
width: 90%;
margin: 7% auto;
}
.login-info{
}
.login-page-bg {
background: url('');
background-color: #d2d6de;
}
.login-box-right {
margin-top: 20%;
margin-right: auto;
}
.login-box-bg {
/*background-color: rgba(255,255,255,0.5);*/
box-shadow: 0px 2px 20px 2px rgba(0, 0, 0, 0.3);
filter: alpha(opacity=40);
opacity: 0.7;
background-color: white;
}
.login-submit{
background-color: #e08e0b;
border-color: #e08e0b;
}
.ad {
text-align: center;
font-size: 20px;
color: #000000;
}
.qrdiv {
color: #000000;
}
.login-submit-margin{
margin-top: 10%;
}
.download-app {
font-size: 15px;
}
.download-app img{
width: 50px;
}
.divloginbox {
animation: loginboxtop 1s;
-moz-animation: loginboxtop 1s;
-webkit-animation: loginboxtop 1s;
-o-animation: loginboxtop 1s;
}
@keyframes loginboxtop {
from {
margin-top: 0
}
to {
margin-top: 20%
}
}
@-moz-keyframes loginboxtop {
from {
margin-top: 0
}
to {
margin-top: 20%
}
}
@-webkit-keyframes loginboxtop {
from {
margin-top: 0
}
to {
margin-top: 20%
}
}
@-o-keyframes loginboxtop {
from {
margin-top: 0
}
to {
margin-top: 20%
}
}
}
/***login***/

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

@ -826,7 +826,7 @@
<div class="description-block">
<img src="/static/images/main_menu/transaction_arrears_green.png"/>
<div class="description-text">
<span class="description-text">商户欠</span>
<span class="description-text">授信退</span>
</div>
</div>
</a>

@ -265,6 +265,10 @@ angular.module('applyPartnerApp', ['ngMessages']).controller('applyPartnerCtrl',
$scope.submit = true;
}
$scope.initParam();
if ($scope.partner.company_name.indexOf("Migration") != -1) {
alert("Company Name包含敏感词汇请检查后重新提交");
return;
}
$http.post('/register/info/update/' + $scope.partner.username, $scope.partner).then(function (resp) {
if (index == 3) {
$scope.getRateConfig();

@ -92,9 +92,10 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
// 初始化索引是30
$scope.initEndIndex = 30;
$scope.loadNotTradeClient = function () {
$scope.loadNotTradeClient = function (type) {
$scope.disable_button = true;
$http.get('/sys/merchant_id/trade').then(function (resp) {
$http.get('/sys/merchant_id/trade?type=' + type).then(function (resp) {
$scope.notTradeClientsMap = resp.data.merchant_id_map;
$scope.refresh_time = resp.data.refresh_time;
$scope.disable_button = false;
@ -110,12 +111,12 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
}
});
};
$scope.loadNotTradeClient();
$scope.loadNotTradeClient(0);
$scope.refresh = function () {
$scope.disable_button = true;
$http.post('/sys/merchant_id/refresh').then(function () {
$scope.loadNotTradeClient();
$scope.loadNotTradeClient(0);
});
};

@ -67,7 +67,7 @@
<a ui-sref="merchant_id_manage">商户号列表</a>
</li>
<li ui-sref-active="active">
<a ui-sref=".no_trace_list">25天未交易商户号</a>
<a ui-sref=".no_trace_list">60天未交易商户号</a>
</li>
<li ui-sref-active="active">
<a ui-sref=".temp_list">通用子商户号</a>

@ -2,6 +2,26 @@
<div class="box-body">
<div class="col-sm-12 col-xs-12" style="padding-right: 30px;margin-bottom: 5px">
<div class="pull-right">
<div class="btn-group">
<a role="button" class="btn btn-default btn-sm"
ng-click="loadNotTradeClient(0)">ALL</a>
</div>
<div class="btn-group">
<a role="button" class="btn btn-default btn-sm"
ng-click="loadNotTradeClient(1)">0-15天</a>
</div>
<div class="btn-group">
<a role="button" class="btn btn-default btn-sm"
ng-click="loadNotTradeClient(2)">15-30天</a>
</div>
<div class="btn-group">
<a role="button" class="btn btn-default btn-sm"
ng-click="loadNotTradeClient(3)">30-45天</a>
</div>
<div class="btn-group">
<a role="button" class="btn btn-default btn-sm"
ng-click="loadNotTradeClient(4)">45-60天</a>
</div>
<span ng-if="refresh_time">
<span>上次刷新时间:</span><span><em><b>{{refresh_time}}</b></em></span>
</span>&nbsp;&nbsp;
@ -26,9 +46,9 @@
</a>
-->
<a class="list-group-item col-sm-2 col-xs-6 cursor"
ng-repeat="client in clients.slice(0, endIndexMap[key]) | orderBy:'client_count':true"
ng-repeat="client in clients.slice(0, endIndexMap[key]) | orderBy:'-diff_days'"
ng-click="showClient(client.sub_merchant_id)">
<span>{{client.sub_merchant_id}}&nbsp;
<span>{{client.sub_merchant_id}}&nbsp;<span style="color:green">(last_trade:{{client.last_trade_time|limitTo:10}})</span>
<i class="fa fa-clock-o text-danger"
title="Temp Sub Merchant ID"
ng-if="client.temp_sub_merchant">

@ -699,10 +699,6 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
};
$scope.showFile();
$scope.passClient = function () {
if (!$scope.partner.wechat_institution_merchant_id) {
commonDialog.alert({title: 'info', content: 'HF Institution Merchant Id not Refresh', type: 'info'});
return;
}
if ($scope.partner.enable_hf) {
if ($scope.partner.hfindustry == null) {
alert("已开启HF支付通道HF行业不可为空!");
@ -775,14 +771,6 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
});
};
$scope.pass2GreenChannel = function () {
if (!$scope.partner.wechat_institution_merchant_id) {
commonDialog.alert({
title: 'info',
content: 'Wechat Institution Merchant Id not Refresh',
type: 'info'
});
return;
}
commonDialog.confirm({
title: 'Green Channel Audit Partner',
content: 'Are you sure to mark partner ' + $scope.partner.company_name + ' green channel audited '
@ -1434,6 +1422,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
$scope.ctrl.editMaxOrderAmount = false;
$scope.ctrl.editOrderExpiryConfig = false;
$scope.ctrl.editRefundPwd = false;
$scope.ctrl.editRefundCreditLine = false;
})
};
$scope.qrConfig = {currency: 'AUD'};
@ -1514,6 +1503,17 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
})
};
$scope.setRefundCreditLine = function () {
if (!$scope.paymentInfo) {
return;
}
$http.put('/sys/partners/' + $scope.partner.client_moniker + '/refund_credit_line', {refund_credit_line: $scope.paymentInfo.refund_credit_line}).then(function (resp) {
$scope.loadPartnerPaymentInfo();
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
});
};
$scope.updateClientQRCodePaySurCharge = function () {
if (!$scope.paymentInfo) {
return;
@ -1559,20 +1559,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
$scope.ctrl = {};
$scope.saveSubMerchantId = function () {
$http.put('/sys/partners/' + $scope.partner.client_moniker + '/payment_config', {sub_merchant_id: $scope.paymentInfo.sub_merchant_id}).then(function (resp) {
$scope.refreshInstitutionAfterSaveMerchantId();
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
});
};
$scope.refreshInstitutionAfterSaveMerchantId = function () {
$http.put('/sys/partners/' + $scope.partner.client_moniker + '/wechat_institution_merchant_id', {wechat_institution_merchant_id: $scope.paymentInfo.wechat_institution_merchant_id}).then(function (resp) {
commonDialog.alert({
title: 'Success',
content: 'Modify Wechat Sub Merchant ID And Refresh Wechat Institution Merchant Id successfully',
type: 'success'
});
$scope.loadPartnerPaymentInfo();
$scope.refreshWechatInstitutionMerchantId();
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
});
@ -1580,11 +1567,6 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
$scope.refreshWechatInstitutionMerchantId = function () {
$http.put('/sys/partners/' + $scope.partner.client_moniker + '/wechat_institution_merchant_id', {wechat_institution_merchant_id: $scope.paymentInfo.wechat_institution_merchant_id}).then(function (resp) {
commonDialog.alert({
title: 'Success',
content: 'Refresh Wechat Institution Merchant Id successfully',
type: 'success'
});
$scope.loadPartnerPaymentInfo();
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
@ -1610,7 +1592,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
content: '是否使用该商户的现有信息进件?',
json:$scope.alipay_gms_json
}).then(function () {
if ($scope.partner.business_structure == "Company") {
if ($scope.partner.business_structure === "Company") {
$http.post('/sys/partners/' + $scope.partner.client_moniker + '/register/alipay_gms', {representative_id: ""}).then(function () {
commonDialog.alert({title: 'Success', content: 'Alipay进件成功', type: 'success'});
}, function (resp) {
@ -1634,7 +1616,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
}, function (resp) {
commonDialog.alert({title: 'Error', content: "查询失败:" + resp.data.message, type: 'error'});
})
}
};
$scope.submitAlipayOnlineSubId = function () {
$http.get('/sys/partners/' + $scope.partner.client_moniker + '/query/alipayOnline_gms_json').then(function (resp) {
$scope.alipayOnline_gms_json = resp.data;
@ -2337,7 +2319,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
});
};
$scope.getBankInfo = function (bsb_no) {
if (bsb_no != null && bsb_no != "") {
if (bsb_no != null && bsb_no !== "") {
$http.get('/sys/partners/' + $scope.partner.client_moniker + '/bank_account/bank_info/' + bsb_no).then(function (resp) {
$scope.bankInfo = resp.data;
$scope.bankaccount.bank = $scope.bankInfo.bank;

@ -495,6 +495,33 @@
</div>
</div>
<!--授信退款额度-->
<div class="form-group" ng-if="('100000000'|withRole)&& paymentInfo.enable_pre_refund">
<label class="col-sm-2 control-label">Refund Credit Line</label>
<div class="col-sm-9">
<p ng-if="!ctrl.editRefundCreditLine" class="form-control-static">
{{paymentInfo.refund_credit_line||'Not Configure'}}
<a role="button" ng-click="ctrl.editRefundCreditLine=true" ng-if="'01'|withRole"><i
class="fa fa-edit"></i></a>
</p>
<div class="input-group" ng-if="ctrl.editRefundCreditLine">
<input type="number" maxlength="6" class="form-control"
ng-model="paymentInfo.refund_credit_line">
<div class="input-group-btn">
<button class="btn btn-success"
ng-click="setRefundCreditLine()">
<i class="fa fa-check"></i>
</button>
</div>
<div class="input-group-btn">
<button class="btn btn-danger" ng-click="ctrl.editRefundCreditLine=false">
<i class="fa fa-remove"></i>
</button>
</div>
</div>
</div>
</div>
<div class="form-group" ng-if="('100000000'|withRole)">
<label class="col-sm-2 control-label">Reset Refund Password</label>
<div class="col-sm-9">

@ -357,11 +357,9 @@
</div>
</div>
</div>
<!--status-->
<!--商户合规位置转移到合规模块的商户合规模块下-->
<!--<div class="form-group col-sm-12" ng-if="'10'|withRole">
<div class="form-group col-sm-12">
<label class="control-label col-xs-4 col-sm-2">Status</label>
&lt;!&ndash;<div class="col-xs-8 col-sm-4">&ndash;&gt;
<!--<div class="col-xs-8 col-sm-4">-->
<span class="col-xs-8 col-sm-10">
<span class="checkbox-inline">
<label>
@ -380,36 +378,9 @@
<input type="checkbox" ng-model="params.quickPass"> 自助开通
</label>
</span>
<span class="checkbox-inline">
<label>
<input type="checkbox" ng-model="params.greenChannel"> 绿色通道
</label>
</span>
<span class="checkbox-inline">
<label>
<input type="checkbox" ng-model="params.pass"> 通过
</label>
</span>
<span class="checkbox-inline">
<label>
<input type="checkbox" ng-model="params.completed_contract"> 资料完善中
</label>
</span>
<span class="checkbox-inline">
<label>
<input type="checkbox" ng-model="params.apply_to_back"> 申请打回
</label>
</span>
<span class="checkbox-inline">
<label>
<input type="checkbox" ng-model="params.bd_upload_material"> 等待BD上传材料审核
</label>
</span>
</span>
&lt;!&ndash;</div>&ndash;&gt;
</div>-->
<!--</div>-->
</div>
<div class="col-xs-12">
<button class="btn btn-primary" type="button"
ng-click="loadPartners(1)"><i

@ -3,7 +3,6 @@
*/
define(['angular', 'decimal', 'uiBootstrap', 'uiRouter', 'angularEcharts'], function (angular) {
'use strict';
var colors = ['#00c0ef', '#00a65a', '#ff851b', '#f39c12', '#d81b60', '#605ca8', '#dd4b39', '#008080', '#8B008B', '#D2691E', '#708090'];
var app = angular.module('surchargeAccountApp', ['ui.bootstrap', 'ui.router', 'ngEcharts']);
app.config(['$stateProvider', function ($stateProvider) {
$stateProvider.state('surcharge_account', {
@ -22,27 +21,16 @@ define(['angular', 'decimal', 'uiBootstrap', 'uiRouter', 'angularEcharts'], func
})
}]);
app.controller('clientSurchargeAccountCtrl', ['$scope', '$http','$state','$filter', 'commonDialog','partner','$uibModal', function ($scope, $http,$state,$filter, commonDialog, partner,$uibModal) {
$scope.partner = angular.copy(partner.data);
$scope.getBalance = function () {
$scope.surcharge = {};
if ($scope.partner.surcharge_mode != undefined && $scope.partner.surcharge_mode == "distributed") {
if ($scope.partner.surcharge_mode !== undefined && $scope.partner.surcharge_mode === "distributed") {
$http.get('/client/partner_info/' + $scope.partner.client_moniker + '/surcharge_account').then(function (resp) {
$scope.surcharge = resp.data;
})
}
};
$scope.getTransactions = function () {
$http.get('/client/partner_info/' + $scope.partner.client_moniker + '/account/transactions').then(function (resp) {
$scope.transactions = resp.data;
})
}
$scope.getBalance();
$scope.getTransactions();
$scope.getDetailByMonths = function () {
$http.get('/client/partner_info/' + $scope.partner.client_moniker + '/account/months').then(function (resp) {
$scope.report = resp.data;
@ -67,9 +55,6 @@ define(['angular', 'decimal', 'uiBootstrap', 'uiRouter', 'angularEcharts'], func
}
});
};
}]);
app.controller('surchargeAccountMonthCtrl', ['$scope', '$http', '$filter', '$timeout', '$uibModal', 'commonDialog', 'chartParser','$sce',
function ($scope, $http, $filter, $timeout, $uibModal, commonDialog, chartParser, $sce) {
@ -98,20 +83,17 @@ define(['angular', 'decimal', 'uiBootstrap', 'uiRouter', 'angularEcharts'], func
};
})
};
$scope.surchargeAccountDetail = function (client_moniker,mon) {
$scope.surchargeAccountDetail = function (detail) {
$uibModal.open({
templateUrl: '/static/payment/surchargeaccount/templates/partner_surcharge_account_dialog.html',
templateUrl: '/static/payment/surchargeaccount/templates/partner_surcharge_account_month_dialog.html',
controller: 'accountDetailCtrl',
size: 'lg',
resolve: {
client_moniker: function () {
return client_moniker;
},
month: function () {
return mon;
detail: function(){
return detail;
},
transactions: ['$http', function ($http) {
return $http.get('/sys/partners/' + client_moniker + '/account/transactions/date?date='+mon);
surchargeDetailData: ['$http', function ($http) {
return $http.get('/sys/partners/' + detail.client_moniker + '/account/transactions/date?detailId=' + detail.detail_id);
}]
}
}).result.then(function () {
@ -120,9 +102,8 @@ define(['angular', 'decimal', 'uiBootstrap', 'uiRouter', 'angularEcharts'], func
$scope.loadReport($scope.report.month);
});
};
$scope.fillMonthsSurcharge = function (details) {
var contentHtml = $sce.trustAsHtml('即将为[' + details.short_name + ']冲正,<span style="color: red">请确认商户信息</span>');
$scope.fillMonthsSurcharge = function (detail) {
var contentHtml = $sce.trustAsHtml('请确认商户[' + detail.short_name + ']已线下付款,再执行此操作</span>');
commonDialog.confirm({
title: '后付费账户冲正',
content: '',
@ -130,7 +111,7 @@ define(['angular', 'decimal', 'uiBootstrap', 'uiRouter', 'angularEcharts'], func
{label: 'Cancel', className: 'btn-danger', key: '2', dismiss: true}],
contentHtml: contentHtml
}).then(function () {
$http.put('/sys/surcharge_account/fill/' + details.detail_id).then(function () {
$http.put('/sys/surcharge_account/fill/' + detail.detail_id).then(function () {
commonDialog.alert({title: 'Success', content: '冲正成功', type: 'success'});
$scope.loadReport($scope.report.month);
}, function (resp) {
@ -141,51 +122,10 @@ define(['angular', 'decimal', 'uiBootstrap', 'uiRouter', 'angularEcharts'], func
};
}]);
app.controller('accountDetailCtrl', ['$scope','$http','transactions','client_moniker','commonDialog','month', function ($scope, $http, transactions,client_moniker,commonDialog,month) {
$scope.transactions = angular.copy(transactions.data);
$scope.canAddDetail = false;
$scope.params = {};
$scope.month = angular.copy(month);
$scope.getBalance = function () {
$http.get('/sys/partners/' + client_moniker + '/surcharge_account').then(function (resp) {
$scope.surcharge = resp.data;
})
};
$scope.getBalance();
$scope.getTransactions = function () {
$http.get('/sys/partners/' + client_moniker + '/account/transactions/date?date=' + $scope.month).then(function (resp) {
$scope.transactions = resp.data;
});
}
$scope.addDetail = function () {
$scope.canAddDetail = true;
};
$scope.cancel = function () {
$scope.canAddDetail = false;
$scope.params = {};
}
$scope.save = function () {
$http.post('/sys/partners/' + client_moniker + '/account/save', {amount:$scope.params.amount,remark:$scope.params.remark}).then(function (resp) {
$scope.getTransactions();
$scope.getBalance();
$scope.canAddDetail = false;
$scope.params = {};
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});
});
}
app.controller('accountDetailCtrl', ['$scope', '$http', 'detail', 'surchargeDetailData', function ($scope, $http, detail, surchargeDetailData) {
$scope.surchargeDetailData = angular.copy(surchargeDetailData.data);
$scope.month = angular.copy(detail.settle_month);
}]);
return app;
});

@ -10,13 +10,6 @@
<section class="content">
<div class="box box-default">
<div class="box-header">
<!-- <div uib-dropdown>
<button class="btn btn-primary" uib-dropdown-toggle type="button" ng-bind="params.year"></button>
<ul class="dropdown-menu" uib-dropdown-menu role="menu">
<li ng-repeat="year in availableYears" role="menuitem"><a role="button" ng-click="initMonth(year)" ng-bind="year"></a></li>
</ul>
</div>-->
<div ng-repeat="year in availableYears" style="display: inline">
<button class="btn btn-info"
ng-click="initMonth(year)"
@ -27,7 +20,7 @@
</div>
<div class="box-body">
<div class="row">
<div class="col-xs-3" ng-repeat="mon in months">
<div class="col-xs-1" ng-repeat="mon in months">
<a class="text-success" role="button" ng-click="loadReport(mon)" ng-if="hasReport(mon)">
<h2 ng-bind="mon.substring(5,7)"></h2>
</a>
@ -44,41 +37,32 @@
<table class="table table-striped">
<thead>
<tr>
<th>商户编号</th>
<th>Short Name</th>
<th>Total Surcharge</th>
<th>充值总额</th>
<th>支出总额</th>
<th>商户编码</th>
<th>商户简称</th>
<th>总手续费</th>
<th>是否结清</th>
<!--<th>余额</th>-->
<th>操作</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="details in report.details">
<tr ng-repeat="detail in report.details">
<td style="vertical-align:middle">
<a class="text-primary" role="button" title="Detail"
ui-sref="partners.detail({clientMoniker:details.client_moniker})">
<span ng-bind="details.client_moniker"></span></a>
ui-sref="partners.detail({clientMoniker:detail.client_moniker})">
<span ng-bind="detail.client_moniker"></span></a>
</td>
<td ng-bind="details.short_name" style="vertical-align:middle"></td>
<td ng-bind="details.total_surcharge | currency:'$'"></td>
<td ng-bind="details.credit_amount|currency:'$'" style="color: green;vertical-align:middle" ></td>
<td ng-bind="details.debit_amount|currency:'$'" style="color: red;vertical-align:middle"></td>
<td ng-bind="detail.short_name" style="vertical-align:middle"></td>
<td ng-bind="detail.total_surcharge | currency:'AUD'"></td>
<td style="vertical-align:middle">
<span ng-if="details.is_valid">已结清</span>
<span ng-if="!details.is_valid">未付款</span>
<span ng-if="detail.checkout">已结清</span>
<span ng-if="!detail.checkout">未付款</span>
</td>
<!--<td>-->
<!--<span ng-if="details.balance>=0" style="color: green">{{details.balance|currency:'$'}}</span>-->
<!--<span ng-if="details.balance<0" style="color: red">{{details.balance|currency:'$'}}</span>-->
<!--</td>-->
<td style="vertical-align:middle">
<!-- 等待邮件和微信推送模板 -->
<!--<a style="cursor: pointer" > 催款</a>-->
<!--<a style="cursor: pointer" ng-click="showDetail()">充值</a>-->
<button class="btn btn-warning" ng-if="!details.is_valid" type="button" ng-click="fillMonthsSurcharge(details)">冲正</button>
<i class="fa fa-bars" style="font-size: 15px;color: #3c8dbc;cursor: pointer;padding-left: 15px" ng-click="surchargeAccountDetail(details.client_moniker,details.settle_month)"></i>
<button class="btn btn-warning" ng-if="!detail.checkout" type="button"
ng-click="fillMonthsSurcharge(detail)">冲正
</button>
<i class="fa fa-bars" style="font-size: 15px;color: #3c8dbc;cursor: pointer;padding-left: 15px"
ng-click="surchargeAccountDetail(detail)"></i>
</td>
</tr>
</tbody>

@ -1,110 +1,8 @@
<section class="content-header">
<h1>
Client Surcharge Account
</h1>
<ol class="breadcrumb">
<li class="active"><i class="fa fa-dashboard"></i> Surcharge Account</li>
</ol>
</section>
<div class="content">
<div class="row">
<div class="col-sm-12">
<div class="box-solid">
<div class="box box-warning">
<div class="box-header">
<div class="form-horizontal col-sm-8" style="margin-top: 30px">
<div class="form-group">
<label class="control-label col-xs-4 col-sm-3">手续费账户余额</label>
<div class="col-sm-6" style="font-size: 25px">
<p>{{surcharge.balance|currency:'AUD'}}</p>
</div>
</div>
<!--<div class="form-group" ng-if="partner.surcharge_mode=='distributed'">-->
<!--<label class="control-label col-xs-4 col-sm-3">允许手续费账户欠款</label>-->
<!--<div class="col-sm-6">-->
<!--<input type="checkbox" ng-model="partner.allow_surcharge_credit" bs-switch-->
<!--switch-change="allowSurchargeCredit(partner.allow_surcharge_credit)" switch-readonly="true">-->
<!--</div>-->
<!--</div>-->
<!--<div class="form-group">-->
<!--<label class="control-label col-xs-4 col-sm-3" style="padding-top:0px">Surcharge Mode:</label>-->
<!--<div class="col-xs-8 col-sm-6">-->
<!--<span class="control-label" ng-bind="partner.surcharge_mode"></span>-->
<!--<p class="text-info">-->
<!--<i class="fa fa-info"></i>启用到收支分离(distributed)模式,将使消费者支付手续费模式失效-->
<!--</p>-->
<!--</div>-->
<!--</div>-->
</div>
</div>
</div>
<div class="box">
<div class="box box-default">
<div class="box-header">Credits</div>
<div class="box-body">
<div class="table-responsive col-sm-12">
<table class="table table-bordered table-striped table-hover">
<thead>
<tr>
<th>Num</th>
<th>Create Time</th>
<th>Amount</th>
<th>Remark</th>
<th>Operator</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="tr in transactions|propsFilter:{type:'Credit',create_time:ctrl.day}:true">
<td>{{$index+1}}</td>
<td ng-bind="tr.create_time|date:'yyyy-MM-dd HH:mm:ss'"></td>
<td ng-bind="tr.amount|currency:'AUD'"></td>
<td ng-bind="tr.remark"></td>
<td ng-bind="tr.operator_displayname"></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="box box-default">
<div class="box-header">Debits</div>
<div class="box-body">
<div class="table-responsive col-sm-12">
<table class="table table-bordered table-striped table-hover">
<thead>
<tr>
<th>Num</th>
<th>Settle Date</th>
<th>Amount</th>
<th>Total Surcharge</th>
<th>Tax Amount</th>
<th>Remark</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="tr in transactions|propsFilter:{type:'Debit',create_time:ctrl.day}:true">
<td>{{$index+1}}</td>
<td ng-bind="tr.settle_date|date:'yyyy-MM-dd'"></td>
<td ng-bind="tr.amount|currency:'AUD'"></td>
<td ng-bind="tr.total_surcharge|currency:'AUD'"></td>
<td ng-bind="tr.tax_amount|currency:'AUD'"></td>
<td ng-bind="tr.remark"></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<section class="content-header">
<h1>
每月手续费
Monthly Surcharge
<span style="float: right">Merchant Surcharge (<span
style="color: red">{{surcharge.balance|currency:'AUD'}}</span>)</span>
</h1>
</section>
<div class="content">
@ -115,22 +13,20 @@
<table class="table table-bordered table-striped table-hover">
<thead>
<tr>
<th>清算月份</th>
<th>Settle Month</th>
<th>Total Surcharge</th>
<th>支出总额</th>
<th>是否结清</th>
<th>操作</th>
<th>Whether Settle</th>
<th>Detail</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="details in report">
<td ng-bind="details.settle_month"></td>
<td ng-bind="details.total_surcharge | currency:'$'"></td>
<td ng-bind="details.debit_amount|currency:'$'"
<td ng-bind="details.total_surcharge|currency:'$'"
style="color: red;vertical-align:middle"></td>
<td style="vertical-align:middle">
<span ng-if="details.is_valid">已结清</span>
<span ng-if="!details.is_valid">未付款</span>
<span ng-if="details.is_valid">Yes</span>
<span ng-if="!details.is_valid">No</span>
</td>
<td style="vertical-align:middle">
<i class="fa fa-bars"

@ -1,38 +1,37 @@
<div class="modal-header">
<h4>Surcharge Account Detail{{partner.client_moniker?'('+partner.client_moniker+')':''}}</h4>
<h4>Surcharge Accountdddd Detail{{partner.client_moniker?'('+partner.client_moniker+')':''}}</h4>
</div>
<div class="modal-body">
<div class="box box-default">
<div class="box-header">Debits</div>
<div class="box-body">
<div class="table-responsive col-sm-12">
<table class="table table-bordered table-striped table-hover">
<thead>
<tr>
<th>Num</th>
<th>Settle Date</th>
<th>Amount</th>
<th>Total Surcharge</th>
<th>Tax Amount</th>
<th>Remark</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="tr in transactions|propsFilter:{type:'Debit'}:true">
<td>{{$index+1}}</td>
<td ng-bind="tr.settle_date|date:'yyyy-MM-dd'"></td>
<td ng-bind="tr.amount|currency:'AUD'"></td>
<td ng-bind="tr.total_surcharge|currency:'AUD'"></td>
<td ng-bind="tr.tax_amount|currency:'AUD'"></td>
<td>
{{tr.remark}}
<a ng-href="/client/clean_logs/{{tr.client_id}}/settlement_logs/{{tr.clearing_detail_id}}/export" target="_blank" title="Download">
<i class="fa fa-download"></i>
</a>
</td>
</tr>
</tbody>
</table>
<table class="table table-bordered table-striped table-hover">
<thead>
<tr>
<th>Settle Date</th>
<th>Amount</th>
<th>Total Surcharge</th>
<th>Tax Amount</th>
<th>Remark</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="detail in surchargeDetailData">
<td ng-bind="detail.settle_date|date:'yyyy-MM-dd'"></td>
<td ng-bind="detail.amount|currency:'AUD'"></td>
<td ng-bind="detail.total_surcharge|currency:'AUD'"></td>
<td ng-bind="detail.tax_amount|currency:'AUD'"></td>
<td>
{{detail.remark}}
<a ng-href="/client/clean_logs/{{tr.client_id}}/settlement_logs/{{tr.clearing_detail_id}}/export"
target="_blank" title="Download">
<i class="fa fa-download"></i>
</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>

@ -1,58 +1,29 @@
<div class="modal-header">
<h4>Surcharge Account Detail{{partner.client_moniker?'('+partner.client_moniker+')':''}}</h4>
<h4>Surcharge Account Detail</h4>
</div>
<div class="modal-body">
<div class="box box-warning">
<div class="box-body" style="font-size: 35px;text-align: right">
{{surcharge.balance|currency:'AUD'}}<i class="fa fa-plus-square-o" style="font-size: 15px;padding-left: 15px;cursor: pointer" ng-click="addDetail()"></i>
</div>
</div>
<div class="box box-warning" ng-if="canAddDetail">
<div class="box-body">
<div class="row" style="margin-left: 20px;">
<div class="form-group">
<label>
Amount:
</label>
<input type="number" ng-model="params.amount">
<label>
remark:
</label>
<input type="text" ng-model="params.remark">
<div class="btn-group">
<a class="btn btn-success" role="button" ng-click="save()">Submit</a>
</div>
<div class="btn-group">
<a class="btn btn-danger" ng-click="cancel()" >Cancel</a>
</div>
</div>
</div>
</div>
</div>
<div class="box box-default">
<div class="box-header">Credits</div>
<div class="box-body">
<div class="table-responsive col-sm-12">
<table class="table table-bordered table-striped table-hover">
<thead>
<tr>
<th>Num</th>
<th>Create Time</th>
<th>Amount</th>
<th>Remark</th>
<th>Operator</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="tr in transactions|propsFilter:{type:'Credit'}:true">
<td>{{$index+1}}</td>
<td ng-bind="tr.create_time|date:'yyyy-MM-dd HH:mm:ss'"></td>
<td ng-bind="tr.amount|currency:'AUD'"></td>
<td ng-bind="tr.remark"></td>
<td ng-bind="tr.operator_displayname"></td>
</tr>
</tbody>
</table>
<table class="table table-bordered table-striped table-hover">
<thead>
<tr>
<th>Create Time</th>
<th>Amount</th>
<th>Remark</th>
<th>Operator</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="surcharge in surchargeDetailData|propsFilter:{type:'Credit'}:true">
<td ng-bind="surcharge.create_time|date:'yyyy-MM-dd HH:mm:ss'"></td>
<td ng-bind="surcharge.amount|currency:'AUD'"></td>
<td ng-bind="surcharge.remark"></td>
<td ng-bind="surcharge.operator"></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
@ -60,33 +31,32 @@
<div class="box-header">Debits</div>
<div class="box-body">
<div class="table-responsive col-sm-12">
<table class="table table-bordered table-striped table-hover">
<thead>
<tr>
<th>Num</th>
<th>Settle Date</th>
<th>Amount</th>
<th>Total Surcharge</th>
<th>Tax Amount</th>
<th>Remark</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="tr in transactions|propsFilter:{type:'Debit'}:true">
<td>{{$index+1}}</td>
<td ng-bind="tr.settle_date|date:'yyyy-MM-dd'"></td>
<td ng-bind="tr.amount|currency:'AUD'"></td>
<td ng-bind="tr.total_surcharge|currency:'AUD'"></td>
<td ng-bind="tr.tax_amount|currency:'AUD'"></td>
<td>
{{tr.remark}}
<a ng-href="/sys/clean_logs/{{tr.client_id}}/settlement_logs/{{tr.clearing_detail_id}}/export" target="_blank" title="Download">
<i class="fa fa-download"></i>
</a>
</td>
</tr>
</tbody>
</table>
<table class="table table-bordered table-striped table-hover">
<thead>
<tr>
<th>Settle Date</th>
<th>Amount</th>
<th>Total Surcharge</th>
<th>Tax Amount</th>
<th>Remark</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="surcharge in surchargeDetailData|propsFilter:{type:'Debit'}:true">
<td ng-bind="surcharge.settle_date|date:'yyyy-MM-dd'"></td>
<td ng-bind="surcharge.amount|currency:'AUD'"></td>
<td ng-bind="surcharge.total_surcharge|currency:'AUD'"></td>
<td ng-bind="surcharge.tax_amount|currency:'AUD'"></td>
<td>
{{surcharge.remark}}
<a ng-href="/sys/clean_logs/{{surcharge.client_id}}/settlement_logs/{{surcharge.clearing_detail_id}}/export"
target="_blank" title="Download">
<i class="fa fa-download"></i>
</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>

@ -0,0 +1,65 @@
<div class="modal-header">
<h4>Surcharge Account Detail</h4>
</div>
<div class="modal-body">
<div class="box box-default">
<div class="box-header">Credits</div>
<div class="box-body">
<div class="table-responsive col-sm-12">
<table class="table table-bordered table-striped table-hover">
<thead>
<tr>
<th>Create Time</th>
<th>Amount</th>
<th>Remark</th>
<th>Operator</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="surcharge in surchargeDetailData|propsFilter:{type:'Credit'}:true">
<td ng-bind="surcharge.create_time|date:'yyyy-MM-dd HH:mm:ss'"></td>
<td ng-bind="surcharge.amount|currency:'AUD'"></td>
<td ng-bind="surcharge.remark"></td>
<td ng-bind="surcharge.operation"></td>
</tr>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="box box-default">
<div class="box-header">Debits</div>
<div class="box-body">
<div class="table-responsive col-sm-12">
<table class="table table-bordered table-striped table-hover">
<thead>
<tr>
<th>Settle Date</th>
<th>Amount</th>
<th>Total Surcharge</th>
<th>Tax Amount</th>
<th>Remark</th>
<th>Details</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="surcharge in surchargeDetailData|propsFilter:{type:'Debit'}:true">
<td ng-bind="surcharge.settle_date|date:'yyyy-MM-dd'"></td>
<td ng-bind="surcharge.amount|currency:'AUD'"></td>
<td ng-bind="surcharge.total_surcharge|currency:'AUD'"></td>
<td ng-bind="surcharge.tax_amount|currency:'AUD'"></td>
<td ng-bind="surcharge.remark"></td>
<td>
<a ng-href="/sys/clean_logs/{{surcharge.client_id}}/settlement_logs/{{surcharge.clearing_detail_id}}/export"
target="_blank" title="Download">
<i class="fa fa-download"></i>
</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>

@ -202,7 +202,6 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
//console.log($rootScope.currentUser.client.clientList);
})
}else{
$scope.loadTradeLogs(1);
}

@ -25,24 +25,6 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
$scope.params.client_ids = [$scope.currentUser.client.client_id];
$scope.showLevel3Clients = false;
if ($scope.currentUser.client.has_children) {
$http.get('/client/partner_info/sub_partners').then(function (resp) {
var clientList = resp.data;
clientList.forEach(function (client) {
$scope.clients.push(client);
});
$scope.clientIds = [];
$scope.clients.forEach(function (client) {
$scope.clientIds.push(client.client_id);
if (client.level3Clients) {
client.level3Clients.forEach(function (level3Client) {
$scope.clientIds.push(level3Client.client_id);
});
}
});
$scope.params.client_ids = angular.copy($scope.clientIds);
})
}
$scope.today = new Date();
$scope.chooseToday = function () {
$scope.params.datefrom = $scope.params.dateto = new Date();
@ -59,7 +41,7 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
var day = new Date();
day.setDate(day.getDate() - 7);
$scope.params.datefrom = day;
$scope.loadTradeLogs(1);
$scope.chooseClient('all');
};
$scope.thisMonth = function () {
$scope.params.dateto = new Date();
@ -114,7 +96,6 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
$scope.analysis.refund_fee = angular.copy(Math.abs($scope.analysis.refund_fee));
});
};
$scope.chooseLast7Days();
$scope.chooseClient = function (client) {
if (client == 'all') {
$scope.params.client_ids = angular.copy($scope.clientIds);
@ -189,6 +170,9 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
url += connectSymbol + 'dev_id=' + params.dev_id;
connectSymbol = '&'
}
if (!params.client_ids) {
$scope.params.client_ids = [$scope.currentUser.client.client_id]
}
params.client_ids.forEach(function (i) {
url += connectSymbol + 'client_ids=' + i;
connectSymbol = '&';
@ -209,6 +193,27 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
return url;
}
if ($scope.currentUser.client.has_children) {
$http.get('/client/partner_info/sub_partners').then(function (resp) {
var clientList = resp.data;
clientList.forEach(function (client) {
$scope.clients.push(client);
});
$scope.clientIds = [];
$scope.clients.forEach(function (client) {
$scope.clientIds.push(client.client_id);
if (client.level3Clients) {
client.level3Clients.forEach(function (level3Client) {
$scope.clientIds.push(level3Client.client_id);
});
}
});
$scope.params.client_ids = angular.copy($scope.clientIds);
$scope.chooseLast7Days();
})
}else {
$scope.chooseLast7Days();
}
}]);
return app;

Loading…
Cancel
Save