Merge branch 'develop'

# Conflicts:
#	pom.xml
master
luoyang 6 years ago
commit 97ea891948

@ -0,0 +1,11 @@
FROM nginx:alpine
COPY uidocker/conf.d /etc/nginx/conf.d
COPY src/main/ui /var/www/royalpay
COPY uidocker/upstream.conf.tpl /opt/upstream.conf.tpl
EXPOSE 80
CMD envsubst < /opt/upstream.conf.tpl > /etc/nginx/conf.d/upstream.conf && cat /etc/nginx/conf.d/upstream.conf && exec nginx -g 'daemon off;'

@ -9,7 +9,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>manage</artifactId>
<version>1.3.92</version>
<version>1.3.93</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jib-maven-plugin.version>1.8.0</jib-maven-plugin.version>

@ -155,6 +155,9 @@ public class DashboardServiceImpl implements DashboardService,DashboardAnalysisT
if(tradeInTypes != null){
return tradeInTypes;
}
if (params.containsKey("client_id")) {
clientManager.queryModifyClientIds(params.getInteger("client_id"), params);
}
List<JSONObject> res = transactionAnalysisMapper.getTradeAmountInTypes(params);
stringRedisTemplate.boundValueOps("tradeInTypes"+params.getString("org_id")+ params.getString("begin")).set(res.toString(), 5, TimeUnit.MINUTES);
return res;
@ -323,6 +326,7 @@ public class DashboardServiceImpl implements DashboardService,DashboardAnalysisT
JSONObject mchConfig = merchantInfoProvider.getMchExtParams(partner.getIntValue("client_id"));
params.put("hide_sub_mch", mchConfig.getBooleanValue("hide_sub_mch"));
params.put("client_id", partner.getIntValue("client_id"));
clientManager.queryModifyClientIds(partner.getIntValue("client_id"), params);
JSONObject today = getTransJSONO(params);
params.put("begin",DateUtils.addDays(params.getDate("begin"),-1));
params.put("end",DateUtils.addDays(params.getDate("end"),-1));
@ -450,6 +454,7 @@ public class DashboardServiceImpl implements DashboardService,DashboardAnalysisT
params.remove("client_ids");
}
params.put("client_id", partner.getIntValue("client_id"));
clientManager.queryModifyClientIds(partner.getIntValue("client_id"), params);
return customerAndOrdersStatisticsMapper.getSumCustomersAnalysis(params);
}
@ -619,6 +624,7 @@ public class DashboardServiceImpl implements DashboardService,DashboardAnalysisT
params.remove("client_ids");
}
params.put("client_id", partner.getIntValue("client_id"));
clientManager.queryModifyClientIds(partner.getIntValue("client_id"), params);
return customerAndOrdersStatisticsMapper.getAvgOrderAndCustomerStatistics(params);
}
@ -633,6 +639,7 @@ public class DashboardServiceImpl implements DashboardService,DashboardAnalysisT
params.remove("client_ids");
}
params.put("client_id", partner.getIntValue("client_id"));
clientManager.queryModifyClientIds(partner.getInteger("client_id"), params);
return customerAndOrdersStatisticsMapper.getPartnerCustomerAndOrderStatistics(params);
}
}

@ -52,32 +52,33 @@ public class PartnerCardDashboardServiceImp implements PartnerCardDashboardServi
private LogSettleMailMapper logSettleMailMapper;
@Resource
private PaymentApi paymentApi;
@Override
public JSONObject getCommonAnalysis(String client_moniker) {
JSONObject client = clientManager.getClientInfoByMoniker(client_moniker);
client.putAll(clientConfigService.find(client.getIntValue("client_id")));
JSONObject earlistOrder = transactionAnalysisMapper.getEarliestOrder(client.getIntValue("client_id"));
Date data = new Date();
if (earlistOrder != null){
client.put("transaction_time", DateFormatUtils.format(earlistOrder.getDate("transaction_time"),"yyyy-MM-dd"));
if (earlistOrder != null) {
client.put("transaction_time", DateFormatUtils.format(earlistOrder.getDate("transaction_time"), "yyyy-MM-dd"));
}
JSONObject res = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), data,"Wechat");
JSONObject best_pay = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), data,"Bestpay");
JSONObject ali_pay = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), data,"Alipay");
JSONObject res = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), data, "Wechat");
JSONObject best_pay = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), data, "Bestpay");
JSONObject ali_pay = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), data, "Alipay");
JSONObject rate_value = new JSONObject();
if (res!= null){
rate_value.put("wechat_rate_value",res.getBigDecimal("rate_value").setScale(1, BigDecimal.ROUND_DOWN));
if (res != null) {
rate_value.put("wechat_rate_value", res.getBigDecimal("rate_value").setScale(1, BigDecimal.ROUND_DOWN));
if (res.getInteger("clean_days") != null) {
client.put("clean_days", res.getIntValue("clean_days"));
}
}
if(best_pay != null){
rate_value.put("best_rate_value",best_pay.getBigDecimal("rate_value").setScale(1, BigDecimal.ROUND_DOWN));
if (best_pay != null) {
rate_value.put("best_rate_value", best_pay.getBigDecimal("rate_value").setScale(1, BigDecimal.ROUND_DOWN));
}
if(ali_pay != null){
rate_value.put("ali_rate_value",ali_pay.getBigDecimal("rate_value").setScale(1, BigDecimal.ROUND_DOWN));
if (ali_pay != null) {
rate_value.put("ali_rate_value", ali_pay.getBigDecimal("rate_value").setScale(1, BigDecimal.ROUND_DOWN));
}
client.put("rate_value",rate_value);
client.put("rate_value", rate_value);
return client;
}
@ -86,7 +87,7 @@ public class PartnerCardDashboardServiceImp implements PartnerCardDashboardServi
JSONObject client = clientManager.getClientInfoByMoniker(client_moniker);
Assert.notNull(client);
JSONObject params = new JSONObject();
params.put("client_id",client.getIntValue("client_id"));
params.put("client_id", client.getIntValue("client_id"));
return transactionAnalysisMapper.getTransactionCommonAnalysis(params);
}
@ -95,7 +96,7 @@ public class PartnerCardDashboardServiceImp implements PartnerCardDashboardServi
JSONObject client = clientManager.getClientInfoByMoniker(client_moniker);
Assert.notNull(client);
JSONObject params = new JSONObject();
params.put("client_id",client.getIntValue("client_id"));
params.put("client_id", client.getIntValue("client_id"));
return customerAndOrdersStatisticsMapper.getPartnerCustomerAndOrderStatistics(params);
}
@ -104,16 +105,16 @@ public class PartnerCardDashboardServiceImp implements PartnerCardDashboardServi
JSONObject client = clientManager.getClientInfoByMoniker(client_moniker);
Assert.notNull(client);
JSONObject params = new JSONObject();
params.put("client_id",client.getIntValue("client_id"));
params.put("client_id", client.getIntValue("client_id"));
return dashboardService.getTradeInTypes(params);
}
@Override
public JSONObject getOrderAndCustomerPerDay(String client_moniker){
public JSONObject getOrderAndCustomerPerDay(String client_moniker) {
JSONObject client = clientManager.getClientInfoByMoniker(client_moniker);
Assert.notNull(client);
JSONObject params = new JSONObject();
params.put("client_id",client.getIntValue("client_id"));
params.put("client_id", client.getIntValue("client_id"));
return customerAndOrdersStatisticsMapper.getAvgOrderAndCustomerStatistics(params);
}
@ -124,38 +125,38 @@ public class PartnerCardDashboardServiceImp implements PartnerCardDashboardServi
JSONObject earlistOrder = transactionAnalysisMapper.getEarliestOrder(client.getIntValue("client_id"));
String timezone = client.getString("timezone");
AnalysisBean analysisBean = new AnalysisBean();
if (earlistOrder != null){
analysisBean.setBegin(DateFormatUtils.format(earlistOrder.getDate("transaction_time"),"yyyyMMdd"));
if (earlistOrder != null) {
analysisBean.setBegin(DateFormatUtils.format(earlistOrder.getDate("transaction_time"), "yyyyMMdd"));
}
analysisBean.setEnd(DateFormatUtils.format(new Date(),"yyyyMMdd"));
analysisBean.setEnd(DateFormatUtils.format(new Date(), "yyyyMMdd"));
JSONObject params = analysisBean.toParams(timezone);
params.put("client_id",client.getIntValue("client_id"));
params.put("client_id", client.getIntValue("client_id"));
return dashboardService.getTradeAnalysisInHours(params);
}
@Override
public JSONObject getSettlementLog(String client_moniker,TradeLogQuery query) {
public JSONObject getSettlementLog(String client_moniker, TradeLogQuery query) {
JSONObject client = clientManager.getClientInfoByMoniker(client_moniker);
Assert.notNull(client);
int client_id = client.getIntValue("client_id");
String timezone = client.getString("timezone");
JSONObject earlistOrder = transactionAnalysisMapper.getEarliestOrder(client_id);
if (earlistOrder!= null){
query.setDatefrom(DateFormatUtils.format(earlistOrder.getDate("transaction_time"),"yyyyMMdd"));
if (earlistOrder != null) {
query.setDatefrom(DateFormatUtils.format(earlistOrder.getDate("transaction_time"), "yyyyMMdd"));
}
query.setDateto(DateFormatUtils.format(new Date(),"yyyyMMdd"));
query.setDateto(DateFormatUtils.format(new Date(), "yyyyMMdd"));
JSONObject params = query.toParams(timezone);
params.put("client_id", client_id);
PageList<JSONObject> logs = transactionMapper.listSettlementLog(params, new PageBounds(query.getPage(), query.getLimit(), Order.formString("clearing_time.desc")));
JSONObject result = PageListUtils.buildPageListResult(logs);
if (query.getPage()==1){
if (!logs.isEmpty() && logs.size()>0){
JSONObject sendMailLog = logSettleMailMapper.findByDate(logs.get(0).getDate("clearing_time"));
if (sendMailLog == null) {
result.put("padding",true);
if (query.getPage() == 1) {
if (!logs.isEmpty()) {
List<JSONObject> sendMailLogs = logSettleMailMapper.findByDate(logs.get(0).getDate("clearing_time"));
if (sendMailLogs.isEmpty()) {
result.put("padding", true);
}
if (sendMailLog!=null && sendMailLog.getIntValue("mail_status") != 1) {
result.put("padding",true);
if (!sendMailLogs.isEmpty() && sendMailLogs.stream().anyMatch(mail -> mail.getIntValue("mail_status") != 1)) {
result.put("padding", true);
}
}
}

@ -43,9 +43,11 @@ public interface CleanService {
void settlementXlsx(Date date, HttpServletResponse response) throws IOException;
List<JSONObject> getXlsx(Date dt, String bank) throws IOException;
List<JSONObject> getXlsx(Date dt, String bank, List<JSONObject> logs) throws IOException;
List<ABAFile> getAba(Date dt, String bank) throws IOException;
List<JSONObject> getSettleLogs(Date dt, List<String> clearIds);
List<ABAFile> getAba(Date dt, String bank, List<JSONObject> logs) throws IOException;
void settlementAba(Date date, HttpServletResponse response) throws IOException;
@ -79,11 +81,11 @@ public interface CleanService {
void getTodaySettlementLogs();
JSONObject sendSettlementMail(Date date, String checkCode);
JSONObject sendSettlementMail(Date date, List<String> clearIds, boolean autoMarkSent);
void sendCheckCode(Date date, JSONObject manager);
JSONObject findLogSettleByDate(Date date);
List<JSONObject> findLogSettleByDate(Date date);
JSONObject validTransactions(Date date, boolean fix, boolean b, boolean b1);

@ -64,7 +64,6 @@ import org.springframework.format.number.CurrencyStyleFormatter;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert;
import org.springframework.util.CollectionUtils;
import org.thymeleaf.context.Context;
import org.thymeleaf.spring5.SpringTemplateEngine;
@ -256,6 +255,12 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
return data;
}).collect(Collectors.toList());
log.put("bank_statistics", bankStatistics);
if (StringUtils.isNotEmpty(log.getString("plan_detail"))) {
try {
log.put("plan_detail", JSON.parseObject(log.getString("plan_detail")));
} catch (JSONException ignore) {
}
}
log.put("editable", DateUtils.isSameDay(log.getDate("settle_date"), new Date()) && log.getBooleanValue("editable"));
log.put("channel_analysis", clearingDetailAnalysisMapper.analysisChannelReport(clearingId));
}
@ -390,12 +395,7 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
}
@Override
public List<JSONObject> getXlsx(Date dt, String bank) throws IOException {
List<JSONObject> logs = clearingLogMapper.findByDate(dt);
logs = logs.stream().filter(log -> log.getBooleanValue("editable")).collect(Collectors.toList());
if (logs.isEmpty()) {
throw new NotFoundException();
}
public List<JSONObject> getXlsx(Date dt, String bank, List<JSONObject> logs) throws IOException {
List<JSONObject> result = new ArrayList<>();
int fileIndex = 1;
if (logs.size() > 1) {
@ -424,6 +424,18 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
return result;
}
@Override
public List<JSONObject> getSettleLogs(Date dt, List<String> clearIds) {
List<JSONObject> logs = clearingLogMapper.findByDate(dt);
logs = logs.stream().filter(log -> log.getBooleanValue("editable"))
.filter(log -> clearIds.isEmpty() || clearIds.contains(log.getString("clearing_id")))
.collect(Collectors.toList());
if (logs.isEmpty()) {
throw new NotFoundException();
}
return logs;
}
private List<JSONObject> mergeBatchSettleClients(List<JSONObject> details) {
Map<String, List<JSONObject>> sameBankDetails = details.stream()
.filter(this::detailEnabledMergeSettle)
@ -486,21 +498,24 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
}
@Override
public List<ABAFile> getAba(Date dt, String bank) {
List<JSONObject> logs = clearingLogMapper.findByDate(dt);
logs = logs.stream().filter(log -> log.getBooleanValue("editable")).collect(Collectors.toList());
if (logs.isEmpty()) {
throw new NotFoundException();
}
public List<ABAFile> getAba(Date dt, String bank, List<JSONObject> logs) {
List<ABAFile> files = new ArrayList<>();
for (JSONObject log : logs) {
List<JSONObject> details = clearingDetailMapper.listReportsOfSettlement(log.getIntValue("clearing_id"));
details = mergeBatchSettleClients(details);
files.addAll(generateSettleAbaFiles(dt, details, log.getDate("operate_time")));
String remark = extractSettleRemark(log);
files.addAll(generateSettleAbaFiles(dt, details, log.getDate("operate_time"), remark));
}
return files.stream().filter(file -> bank.equals(file.bank())).collect(Collectors.toList());
}
public String extractSettleRemark(JSONObject log) {
return Optional.ofNullable(StringUtils.defaultIfEmpty(log.getString("plan_detail"), null))
.map(JSON::parseObject)
.map(plan -> StringUtils.defaultIfEmpty(plan.getString("remark"), plan.getString("plan_id")))
.orElse("");
}
private byte[] generateSettleXlsxFile(Date dt, List<JSONObject> settlements, String bank) throws IOException {
try (Workbook wb = new XSSFWorkbook()) {
Sheet sheet = wb.createSheet("Merchant_Settlement_Info_" + DateFormatUtils.format(dt, "yyyyMMdd"));
@ -536,7 +551,7 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
for (JSONObject log : logs) {
List<JSONObject> details = clearingDetailMapper.listReportsOfSettlement(log.getIntValue("clearing_id"));
details = mergeBatchSettleClients(details);
files.addAll(generateSettleAbaFiles(dt, details, log.getDate("operate_time")));
files.addAll(generateSettleAbaFiles(dt, details, log.getDate("operate_time"), extractSettleRemark(log)));
}
OutputStream ous = resp.getOutputStream();
if (files.size() == 1) {
@ -580,7 +595,7 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
resp.addHeader("Content-Disposition", "attachment; filename=" + zipName);
OutputStream ous = resp.getOutputStream();
List<ABAFile> abaFiles = generateSettleAbaFiles(settleDate, details, opTime);
List<ABAFile> abaFiles = generateSettleAbaFiles(settleDate, details, opTime, extractSettleRemark(clearing));
try (ZipOutputStream zos = new ZipOutputStream(ous)) {
for (ABAFile aba : abaFiles) {
zos.putNextEntry(new ZipEntry(aba.filename()));
@ -591,9 +606,12 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
}
}
private List<ABAFile> generateSettleAbaFiles(Date dt, List<JSONObject> settlements, Date operateTime) {
private List<ABAFile> generateSettleAbaFiles(Date dt, List<JSONObject> settlements, Date operateTime, String remark) {
List<String> banks = settlements.stream().map(detail -> detail.getString("settle_bank")).distinct().collect(Collectors.toList());
return banks.stream().map(bank -> generateSettleAbaFile(bank, dt, settlements)).peek(file -> file.setOperateTime(operateTime)).collect(Collectors.toList());
return banks.stream().map(bank -> generateSettleAbaFile(bank, dt, settlements))
.peek(file -> file.setOperateTime(operateTime))
.peek(file -> file.setRemark(remark))
.collect(Collectors.toList());
}
private ABAFile generateSettleAbaFile(String bank, Date dt, List<JSONObject> settlements) {
@ -1092,36 +1110,17 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
}
@Override
public JSONObject sendSettlementMail(Date date, String checkCode) {
public JSONObject sendSettlementMail(Date date, List<String> clearIds, boolean autoMarkSent) {
JSONObject result = new JSONObject();
String redisCode = stringRedisTemplate.boundValueOps(reidsCheckCodeKey).get();
if (StringUtils.isEmpty(redisCode)) {
result.put("result", 1);
result.put("msg", "The verification code has expired Please send the verification code again");
return result;
}
if (!redisCode.equals(checkCode)) {
result.put("result", 1);
result.put("msg", "The verification code is incorrect");
return result;
}
JSONObject settleMail = logSettleMailMapper.findByDate(date);
if (settleMail != null) {
List<JSONObject> emailStatus = mailService.checkEmailStatus(settleMail.getString("email_id"));
if (!CollectionUtils.isEmpty(emailStatus) && emailStatus.get(0).getIntValue("status") == 1 && settleMail.getIntValue("mail_status") == 1) {
result.put("result", 0);
result.put("msg", "Excel has been sent");
return result;
}
}
try {
String title = "Royalpay Settlement File " + DateFormatUtils.format(date, "yyyyMMdd");
String title = (PlatformEnvironment.getEnv().isDebug() ? "[TEST]" : "") + "Royalpay Settlement File " + DateFormatUtils.format(date, "yyyyMMdd");
JSONObject model = new JSONObject();
model.put("date", DateFormatUtils.format(date, "dd-MM-yyyy"));
String fileName1 = "Merchant_Settlement_Info_xlsx_" + DateFormatUtils.format(date, "yyyyMMdd");
List<JSONObject> attachList = new ArrayList<>();
JSONObject attach1 = new JSONObject();
List<JSONObject> xlsxFileList = getXlsx(date, "CBA");
List<JSONObject> clearLogs = getSettleLogs(date, clearIds);
List<JSONObject> xlsxFileList = getXlsx(date, "CBA", clearLogs);
if (xlsxFileList.size() > 1) {
fileName1 += ".zip";
attach1.put("content", Base64.encodeBase64String(getZipByteArr(xlsxFileList)));
@ -1133,7 +1132,7 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
attachList.add(attach1);
JSONObject attach2 = new JSONObject();
List<ABAFile> abaFileList = getAba(date, "CBA");
List<ABAFile> abaFileList = getAba(date, "CBA", clearLogs);
String fileName2 = "Merchant_Settlement_Info_aba_" + DateFormatUtils.format(date, "yyyyMMdd");
if (abaFileList.size() > 1) {
fileName2 += ".zip";
@ -1157,6 +1156,7 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
Context ctx = new Context();
ctx.setVariable("date", DateFormatUtils.format(date, "dd-MM-yyyy"));
ctx.setVariable("abaFiles", abaFileList);
ctx.setVariable("totalAmount", abaFileList.stream().map(ABAFile::getTotalSettleAmount).reduce(BigDecimal::add));
final String content = thymeleaf.process("mail/settlement_mail", ctx);
// 测试用地址
// String mailId = mailService.sendEmail(title, "164851225@qq.com", "1029811920@qq.com", content,
@ -1164,38 +1164,30 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
JSONObject config = sysConfigManager.getSysConfig();
String mailId = mailService.sendEmail(title, config.getString("settle_mail_to"), config.getString("settle_mail_cc"), content, attachList);
if (settleMail == null) {
JSONObject settleMailRecord = new JSONObject();
settleMailRecord.put("send_date", new Date());
settleMailRecord.put("clearing_date", date);
settleMailRecord.put("email_id", mailId);
if (StringUtils.isEmpty(mailId)) {
result.put("result", 1);
result.put("msg", "System error");
settleMailRecord.put("mail_status", 0);
settleMailRecord.put("notice_status", 0);
logSettleMailMapper.save(settleMailRecord);
return result;
} else {
settleMailRecord.put("mail_status", 1);
settleMailRecord.put("notice_status", 0);
logSettleMailMapper.save(settleMailRecord);
}
JSONObject settleMailRecord = new JSONObject();
settleMailRecord.put("send_date", new Date());
settleMailRecord.put("clearing_date", date);
settleMailRecord.put("email_id", mailId);
if (StringUtils.isEmpty(mailId)) {
result.put("result", 1);
result.put("msg", "System error");
settleMailRecord.put("mail_status", 0);
settleMailRecord.put("notice_status", 0);
logSettleMailMapper.save(settleMailRecord);
return result;
} else {
if (!StringUtils.isEmpty(mailId)) {
JSONObject updateRecord = new JSONObject();
updateRecord.put("id", settleMail.getString("id"));
updateRecord.put("mail_status", 1);
updateRecord.put("email_id", mailId);
logSettleMailMapper.update(updateRecord);
settleMailRecord.put("mail_status", 1);
settleMailRecord.put("notice_status", 0);
logSettleMailMapper.save(settleMailRecord);
}
sendTaskFinishMessages(ManagerRole.FINANCIAL_STAFF, "清算文件已发送清算方", "发送清算通知");
if (autoMarkSent) {
if (!clearIds.isEmpty()) {
clearingLogMapper.lockSettlementsById(clearLogs.stream().map(log -> log.getString("clearing_id")).collect(Collectors.toList()));
} else {
result.put("result", 0);
result.put("msg", "System error");
return result;
clearingLogMapper.lockSettlements(date);
}
}
sendTaskFinishMessages(ManagerRole.FINANCIAL_STAFF, "清算文件已发送清算方", "发送清算通知");
clearingLogMapper.lockSettlements(date);
} catch (IOException e) {
logger.error("生成excel字节数组发生错误");
} catch (URISyntaxException e) {
@ -1246,7 +1238,7 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
}
@Override
public JSONObject findLogSettleByDate(Date date) {
public List<JSONObject> findLogSettleByDate(Date date) {
return logSettleMailMapper.findByDate(date);
}

@ -121,14 +121,16 @@ public class SettlementDevController {
}
}
@ManagerMapping(value = "/reports/{date}/send_settlement_xlsx/{checkCode}", role = {ManagerRole.FINANCIAL_STAFF})
public JSONObject sendSettlementMail(@PathVariable("date") String date, @PathVariable("checkCode") String checkCode) {
@ManagerMapping(value = "/reports/{date}/send_settlement_xlsx", role = {ManagerRole.FINANCIAL_STAFF}, method = RequestMethod.POST)
public JSONObject sendSettlementMail(@PathVariable("date") String date, @RequestBody JSONObject data) {
Date dt = null;
try {
dt = dateFormat.parse(date);
} catch (ParseException e) {
}
return cleanService.sendSettlementMail(dt, checkCode);
List<String> clearIds = data.getJSONArray("clearing_ids").toJavaList(String.class);
boolean autoMarkSent = data.getBooleanValue("mark_sent");
return cleanService.sendSettlementMail(dt, clearIds, autoMarkSent);
}
@ManagerMapping(value = "/reports/send_checkcode", role = {ManagerRole.FINANCIAL_STAFF})
@ -137,7 +139,7 @@ public class SettlementDevController {
}
@RequestMapping(value = "/reports/{date}/send_status")
public JSONObject sendStatus(@PathVariable String date) {
public List<JSONObject> sendStatus(@PathVariable String date) {
Date dt = null;
try {
dt = dateFormat.parse(date);

@ -42,6 +42,8 @@ public interface ClearingLogMapper {
void lockSettlements(@Param("date") Date date);
void lockSettlementsById(@Param("clearing_ids") List<String> clearingIds);
@AutoSql(type = SqlType.SELECT)
JSONObject findById(@Param("clearing_id") int clearingId);

@ -6,6 +6,7 @@ import cn.yixblog.support.mybatis.autosql.annotations.SqlType;
import com.alibaba.fastjson.JSONObject;
import java.util.Date;
import java.util.List;
/**
* Created by davep on 2016-09-04.
@ -16,7 +17,7 @@ public interface LogSettleMailMapper {
@AutoSql(type = SqlType.INSERT)
void save(JSONObject clearingLog);
JSONObject findByDate(Date date);
List<JSONObject> findByDate(Date date);
@AutoSql(type = SqlType.UPDATE)
void update(JSONObject update);

@ -82,10 +82,7 @@ public interface ClientMapper {
@AdvanceSelect(addonWhereClause = "is_valid=1")
List<JSONObject> listChildClients(@Param("parent_client_id") int parentClientId);
@AutoSql(type = SqlType.SELECT)
@AdvanceSelect(addonWhereClause = "is_valid=1")
PageList<JSONObject> listChildClientsByPage(@Param("parent_client_id") int parentClientId, PageBounds pageBounds);
PageList<JSONObject> listChildClientsByPage(JSONObject params, PageBounds pageBounds);
@AutoSql(type = SqlType.SELECT)
@AdvanceSelect(addonWhereClause = "is_valid=1")

@ -173,7 +173,7 @@ public interface ClientManager {
List<JSONObject> listSubClients(JSONObject manager, String clientMoniker);
JSONObject listSubClientsByPage(JSONObject manager, String clientMoniker,int page);
JSONObject listSubClientsByPage(JSONObject manager, String clientMoniker,String searchText, int page);
List<JSONObject> listSubClients(int clientId);
@ -557,4 +557,5 @@ public interface ClientManager {
RSvcMchBean findSvcMchByAccountId(String accountId);
void queryModifyClientIds(int clientId, JSONObject params);
}

@ -2097,7 +2097,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
if(mchConfig.getBooleanValue("hide_sub_mch")){
return new ArrayList<>();
}
if (!mchConfig.getBooleanValue("disable_level3_mch")) {
if (!mchConfig.getBooleanValue("disable_level3_mch") && listChildClients.size()<100) {
for (JSONObject partner : listChildClients) {
List<JSONObject> clients = clientMapper.listChildClients(partner.getIntValue("client_id"));
if (clients.size() > 0) {
@ -2111,9 +2111,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
return listChildClients;
}
@Override
public JSONObject listSubClientsByPage(JSONObject manager, String clientMoniker,int page) {
public JSONObject listSubClientsByPage(JSONObject manager, String clientMoniker,String searchText, int page) {
JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) {
throw new InvalidShortIdException();
@ -2121,9 +2120,23 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
checkOrgPermission(manager, client);
PageBounds pageBounds;
pageBounds= new PageBounds(page, 5, Order.formString("create_time.desc"));
PageList<JSONObject> childClients = clientMapper.listChildClientsByPage(client.getIntValue("client_id"), pageBounds);
pageBounds= new PageBounds(page, 20, Order.formString("create_time.desc"));
JSONObject params = new JSONObject() {{
put("parent_client_id", client.getIntValue("client_id"));
}};
if (StringUtils.isNotBlank(searchText)) {
params.put("search_text", searchText);
}
PageList<JSONObject> childClients = clientMapper.listChildClientsByPage(params, pageBounds);
for (JSONObject partner : childClients) {
List<JSONObject> clients = clientMapper.listChildClients(partner.getIntValue("client_id"));
if (clients.size() > 0) {
partner.put("level3Clients", clients);
clients.forEach(e -> {
e.put("parent_client_moniker", partner.getString("client_moniker"));
});
}
}
return PageListUtils.buildPageListResult(childClients);
}
@ -2209,7 +2222,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
throw new Exception("partner has no permission");
}
}
}
}
}
@ -2676,6 +2688,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
if (client_ids != null) {
params.put("client_ids", Arrays.asList(client_ids));
params.remove("client_id");
}else {
queryModifyClientIds(client.getIntValue("client_id"), params);
}
PageList<JSONObject> devices = clientDeviceMapper.listClientDevices(params, new PageBounds(page, limit, Order.formString("create_time.desc")));
return PageListUtils.buildPageListResult(devices);
@ -2695,6 +2709,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
if (client_ids != null) {
params.put("client_ids", Arrays.asList(client_ids));
params.remove("client_id");
}else {
queryModifyClientIds(client.getIntValue("client_id"), params);
}
List<JSONObject> deviceIds = clientDeviceMapper.listClientDeviceIds(params);
return new JSONObject() {{
@ -3969,6 +3985,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
JSONObject params = query.toParams(timezone);
params.put("client_id", client_id);
queryModifyClientIds(client_id, params);
PageList<JSONObject> logs = transactionMapper.listSettlementLog(params,
new PageBounds(query.getPage(), query.getLimit(), Order.formString("clearing_time.desc")));
JSONObject result = PageListUtils.buildPageListResult(logs);
@ -4011,6 +4028,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
JSONObject params = query.toParams(timezone);
params.put("client_id", client_id);
queryModifyClientIds(client_id, params);
PageList<JSONObject> logs = transactionMapper.listSettlementLog(params, new PageBounds(query.getPage(), 10000, Order.formString("clearing_time.desc")));
//Excel 多sheet导出
try (HSSFWorkbook workbook = new HSSFWorkbook()) {
@ -6621,6 +6639,26 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
return svcMchBean;
}
@Override
public void queryModifyClientIds(int clientId, JSONObject params) {
if (StringUtils.isBlank(params.getString("client_ids"))) {
String[] clientIds = getChildClientIds(clientId);
if (clientIds.length > 1) {
params.put("client_ids", clientIds);
}
}
}
private String[] getChildClientIds(int clientId) {
List<String> clientIds = new ArrayList<>();
List<JSONObject> childs = clientMapper.listChildClients(clientId);
clientIds.add(String.valueOf(clientId));
childs.forEach(p -> {
clientIds.add(p.getString("client_id"));
});
return clientIds.toArray(new String[]{});
}
private void clientApproveIdInfo(JSONObject params, JSONObject client) {
if (StringUtils.isBlank(params.getString("id_type"))) {
params.remove("id_type");

@ -500,9 +500,11 @@ public class PartnerManageController {
return clientManager.listSubClients(manager, clientMoniker);
}
@ManagerMapping(value = "/{clientMoniker}/sub_clients/{page}", method = RequestMethod.GET)
public JSONObject listSubClientsByPage(@PathVariable String clientMoniker,@PathVariable int page, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
return clientManager.listSubClientsByPage(manager, clientMoniker,page);
@ManagerMapping(value = "/{clientMoniker}/sub_clients/page", method = RequestMethod.GET)
public JSONObject listSubClientsByPage(@PathVariable String clientMoniker,@RequestParam(defaultValue = "1") int page,
@RequestParam(required = false) String searchText,
@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
return clientManager.listSubClientsByPage(manager, clientMoniker,searchText,page);
}
//创建子商户

@ -348,6 +348,14 @@ public class PartnerViewController {
return clientManager.listSubClients(null, account.getString("client_moniker"));
}
@PartnerMapping(value = "/sub_partners/page", method = RequestMethod.GET)
@ResponseBody
public JSONObject listSubPartnersByPage(@RequestParam(defaultValue = "1") int page,
@RequestParam(required = false) String searchText,
@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) {
return clientManager.listSubClientsByPage(null, account.getString("client_moniker"), searchText,page);
}
@PartnerMapping(value = "/devices", method = RequestMethod.GET, roles = PartnerRole.ADMIN)
@ResponseBody
public JSONObject listClientDevices(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestParam(required = false) String remark,

@ -21,6 +21,7 @@ public class ABAFile {
private List<SettleMerchantInfo> settlements;
private BigDecimal totalSettleAmount;
private Date operateTime;
private String remark;
public ABAFile(ABAConfig.ABABase base, Date settleDate) {
this.base = base;
@ -34,6 +35,15 @@ public class ABAFile {
totalSettleAmount = totalSettleAmount.add(settleAmount);
}
public String getRemark() {
return remark;
}
public ABAFile setRemark(String remark) {
this.remark = remark;
return this;
}
public boolean manualSending() {
return base.isManualSending();
}
@ -62,6 +72,10 @@ public class ABAFile {
return format.format(totalSettleAmount);
}
public BigDecimal getTotalSettleAmount(){
return totalSettleAmount;
}
private String generateFinalLine() {
StringBuilder lineBuilder = new StringBuilder(baseLine);
lineBuilder.replace(0, 1, "7");

@ -65,4 +65,5 @@ public interface TradeLogService {
void exportPDFSettlement(TradeLogQuery query, JSONObject partner, HttpServletResponse response);
void exportExcelAllPartner(TradeLogQuery query, JSONObject partner, HttpServletResponse httpResponse) throws Exception;
}

@ -157,6 +157,7 @@ public class TradeLogServiceImpl implements TradeLogService {
JSONObject params = query.toParams(timezone);
clientManager.validateClients(client.getIntValue("client_id"), params);
params.put("client_id", client.getIntValue("client_id"));
clientManager.queryModifyClientIds(client.getIntValue("client_id"), params);
if (manager != null && manager.getInteger("org_id") != null) {
params.put("org_id", manager.getIntValue("org_id"));
}
@ -529,9 +530,12 @@ public class TradeLogServiceImpl implements TradeLogService {
String timezone = partner.getJSONObject("client").getString("timezone");
JSONObject params = query.toParams(timezone);
clientManager.validateClients(client_id, params);
clientManager.queryModifyClientIds(client_id, params);
params.put("client_id", client_id);
JSONObject mchConfig = merchantInfoProvider.getMchExtParams(partner.getIntValue("client_id"));
params.put("hide_sub_mch", mchConfig.getBooleanValue("hide_sub_mch"));
List<JSONObject> logs = transactionMapper.listTransFlow(params);
TimeZoneUtils.switchTimeZone(logs, timezone, "create_time", "confirm_time", "transaction_time");
Paginator paginator = new Paginator(query.getPage(), query.getLimit(), logs.size());
@ -555,6 +559,7 @@ public class TradeLogServiceImpl implements TradeLogService {
JSONObject params = query.toParams(timezone);
clientManager.validateClients(clientId, params);
params.put("client_id", clientId);
clientManager.queryModifyClientIds(clientId, params);
List<JSONObject> logs = transactionMapper.listTransFlow(params);
TimeZoneUtils.switchTimeZoneToString(logs, timezone, "dd/MM/yyyy HH:mm:ss", Collections.singletonList("transaction_time"));
TimeZoneUtils.switchTimeZoneToString(logs, timezone, "dd/MM/yyyy", Collections.singletonList("clearing_time"));
@ -998,6 +1003,7 @@ public class TradeLogServiceImpl implements TradeLogService {
String timezone = partner.getJSONObject("client").getString("timezone");
JSONObject params = query.toParams(timezone);
params.put("client_id", clientId);
clientManager.queryModifyClientIds(clientId, params);
PageList<JSONObject> logs = transactionMapper.listSettlementLog(params,
new PageBounds(query.getPage(), query.getLimit(), Order.formString("clearing_time.desc")));
JSONObject result = PageListUtils.buildPageListResult(logs);
@ -1031,6 +1037,7 @@ public class TradeLogServiceImpl implements TradeLogService {
}
JSONObject params = query.toParams(timezone);
params.put("client_id", clientId);
clientManager.queryModifyClientIds(clientId, params);
PageList<JSONObject> logs = transactionMapper.listSettlementLog(params,
new PageBounds(1, 100000000, Order.formString("clearing_time.desc")));
try (HSSFWorkbook workbook = new HSSFWorkbook()) {
@ -1465,6 +1472,8 @@ public class TradeLogServiceImpl implements TradeLogService {
if (params.get("client_ids") == null) {
params.put("client_id", partner.getJSONObject("client").getString("client_id"));
}
clientManager.queryModifyClientIds(partner.getIntValue("client_id"), params);
List<JSONObject> clientOrderList = transactionMapper.getClientOrderByTransactionTime(params);
List<Integer> clientOrders = new ArrayList<>(clientOrderList.size());
clientOrderList.parallelStream().forEach(p -> clientOrders.add(p.getInteger("clearing_order")));
@ -1575,6 +1584,7 @@ public class TradeLogServiceImpl implements TradeLogService {
if (params.get("client_ids") == null) {
params.put("client_id", partner.getJSONObject("client").getString("client_id"));
}
clientManager.queryModifyClientIds(partner.getIntValue("client_id"), params);
List<JSONObject> clientOrderList = transactionMapper.getClientOrderByTransactionTime(params);
List<Integer> clientOrders = new ArrayList<>(clientOrderList.size());
clientOrderList.parallelStream().forEach(p -> clientOrders.add(p.getInteger("clearing_order")));
@ -1666,6 +1676,7 @@ public class TradeLogServiceImpl implements TradeLogService {
if (params.get("client_ids") == null) {
params.put("client_id", client.getString("client_id"));
}
clientManager.queryModifyClientIds(partner.getIntValue("client_id"), params);
List<JSONObject> clientOrderList = transactionMapper.getClientOrderByTransactionTime(params);
List<Integer> clientOrders = new ArrayList<>(clientOrderList.size());
clientOrderList.parallelStream().forEach(p -> clientOrders.add(p.getInteger("clearing_order")));
@ -1713,6 +1724,7 @@ public class TradeLogServiceImpl implements TradeLogService {
JSONObject params = query.toParams(timezone);
clientManager.validateClients(clientId1, params);
params.put("client_id", clientId1);
clientManager.queryModifyClientIds(clientId1, params);
List<JSONObject> logs = transactionMapper.listTransFlow(params);
TimeZoneUtils.switchTimeZoneToString(logs, timezone, "dd/MM/yyyy HH:mm:ss", Collections.singletonList("transaction_time"));
@ -1805,4 +1817,6 @@ public class TradeLogServiceImpl implements TradeLogService {
}
}
}
}

@ -2,15 +2,15 @@
spring.datasource.type = com.zaxxer.hikari.HikariDataSource
#数据源master
spring.datasource.master.schema-name=royalpay_dev
spring.datasource.master.host=127.0.0.1:3306
spring.datasource.master.schema-name=royalpay_production
spring.datasource.master.host=192.168.0.4:3306
spring.datasource.master.jdbc-url=jdbc:mysql://${spring.datasource.master.host}/${spring.datasource.master.schema-name}?useUnicode=true&characterEncoding=utf8&useSSL=false
spring.datasource.master.username=root
spring.datasource.master.password=root
spring.datasource.master.username=taylor
spring.datasource.master.password=taylor
#数据源salve
spring.datasource.slave.schema-name=royalpay_dev
spring.datasource.slave.host=127.0.0.1:3306
spring.datasource.slave.schema-name=royalpay_production
spring.datasource.slave.host=192.168.0.4:3306
spring.datasource.slave.jdbc-url=jdbc:mysql://${spring.datasource.slave.host}/${spring.datasource.slave.schema-name}?useUnicode=true&characterEncoding=utf8&useSSL=false
spring.datasource.slave.username=root
spring.datasource.slave.password=root
spring.datasource.slave.username=taylor
spring.datasource.slave.password=taylor

@ -1,12 +1,18 @@
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.master.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.schema-name=royalpay
spring.datasource.user=root
spring.datasource.pwd=rpayplus
spring.datasource.host=192.168.0.84:3306
spring.datasource.master.jdbc-url=jdbc:mysql://${spring.datasource.host}/${spring.datasource.schema-name}?useUnicode=true&characterEncoding=utf8&useSSL=false
spring.datasource.master.username=root
spring.datasource.master.password=rpayplus
spring.datasource.master.username=${spring.datasource.user}
spring.datasource.master.password=${spring.datasource.pwd}
spring.datasource.slave.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.slave.jdbc-url=jdbc:mysql://${spring.datasource.host}/${spring.datasource.schema-name}?useUnicode=true&characterEncoding=utf8&useSSL=false
spring.datasource.slave.username=root
spring.datasource.slave.password=rpayplus
spring.datasource.slave.username=${spring.datasource.user}
spring.datasource.slave.password=${spring.datasource.pwd}
spring.redis.host=192.168.0.84
spring.redis.port=6379
spring.redis.database=9

@ -2,7 +2,16 @@
<!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.log.ClearingLogMapper">
<update id="lockSettlements">
update log_clearing set editable=0 where settle_date=#{date}
update log_clearing
set editable=0
where settle_date = #{date}
</update>
<update id="lockSettlementsById">
update log_clearing set editable=0
where clearing_id in
<foreach collection="clearing_ids" item="id" separator="," open="(" close=")">
#{id}
</foreach>
</update>
<select id="findByDate" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[
@ -15,7 +24,8 @@
<![CDATA[
SELECT settle_date
FROM log_clearing
WHERE year(settle_date) = year(#{month}) AND month(settle_date) = month(#{month})
WHERE year(settle_date) = year(#{month})
AND month(settle_date) = month(#{month})
]]>
</select>
<select id="listLatestSettleDates" resultType="java.util.Date">
@ -28,28 +38,33 @@
</select>
<select id="getSettlementMonthReport" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[
SELECT
settle_date,
gross_amount,
gross_amount - wechat_charge wechat_settlement,
net_amount,
royalpay_charge
SELECT settle_date,
gross_amount,
gross_amount - wechat_charge wechat_settlement,
net_amount,
royalpay_charge
FROM log_clearing
WHERE year(settle_date) = #{year} AND month(settle_date) = #{month}
WHERE year(settle_date) = #{year}
AND month(settle_date) = #{month}
ORDER BY settle_date ASC
]]>
</select>
<select id="getSettlementChannelsMonthReport" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[
select sum(a.royalpay_charge) charge,a.channel channel from log_clearing_detail_analysis a left join log_clearing_detail d on d.clear_detail_id = a.clearing_detail_id and a.channel !='System'
WHERE year(d.report_date) = #{year} AND month(d.report_date) = #{month}
select sum(a.royalpay_charge) charge, a.channel channel
from log_clearing_detail_analysis a
left join log_clearing_detail d on d.clear_detail_id = a.clearing_detail_id and a.channel != 'System'
WHERE year(d.report_date) = #{year}
AND month(d.report_date) = #{month}
group by a.channel
]]>
</select>
<select id="getSettlementChannelsDailyReport" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[
select sum(a.royalpay_charge) charge,a.channel channel from log_clearing_detail_analysis a left join log_clearing_detail d on d.clear_detail_id = a.clearing_detail_id and a.channel !='System'
select sum(a.royalpay_charge) charge, a.channel channel
from log_clearing_detail_analysis a
left join log_clearing_detail d on d.clear_detail_id = a.clearing_detail_id and a.channel != 'System'
WHERE d.report_date = #{date}
group by a.channel
]]>
@ -57,17 +72,21 @@
<select id="getTotalPlatformCharge" resultType="com.alibaba.fastjson.JSONObject">
SELECT SUM(royalpay_charge) royalpay_charge
FROM log_clearing
WHERE year(settle_date) = #{year}
AND month(settle_date) = #{month}
FROM log_clearing
WHERE year(settle_date) = #{year}
AND month(settle_date) = #{month}
</select>
<select id="getMondayClearing" resultType="com.alibaba.fastjson.JSONObject">
select DATE_FORMAT(operate_time,'%Y%m%d') operate_time,net_amount from log_clearing
where operate_time &gt; #{begin} and operate_time &lt; #{end} and dayofweek(operate_time)=2
select DATE_FORMAT(operate_time, '%Y%m%d') operate_time, net_amount
from log_clearing
where operate_time &gt; #{begin}
and operate_time &lt; #{end}
and dayofweek(operate_time) = 2
</select>
<select id="getSettleDataDailyReport" resultType="com.alibaba.fastjson.JSONObject">
select ifnull(sum(net_amount),0) net_amount,ifnull(sum(royalpay_charge),0) royalpay_charge
FROM log_clearing WHERE settle_date = date(#{date})
select ifnull(sum(net_amount), 0) net_amount, ifnull(sum(royalpay_charge), 0) royalpay_charge
FROM log_clearing
WHERE settle_date = date(#{date})
</select>
</mapper>

@ -359,8 +359,16 @@
SUM(t.clearing_amount) total
FROM pmt_transactions t
WHERE t.channel='Settlement'
and t.client_id=#{client_id}
]]>
<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 client_id != 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>
</select>

@ -555,6 +555,17 @@
and contact_email = #{contact_email}
</if>
</select>
<select id="listChildClientsByPage" resultType="com.alibaba.fastjson.JSONObject">
select * from sys_clients
where
parent_client_id = #{parent_client_id}
and is_valid = 1
<if test="search_text!=null">
<bind name="name_pattern" value="'%'+search_text+'%'"/>
and (client_moniker=#{search_text} or short_name like #{name_pattern} or company_name like
#{name_pattern} or business_name like #{name_pattern} or contact_email=#{search_text})
</if>
</select>
<select id="listClientsWithTransactionsSettled" resultType="int">
select distinct t.client_id
from pmt_transactions t

@ -5,11 +5,12 @@
<br>
<br>
<p>Please find the attached settlement files data up to <span th:text="${date}"></span></p>
<p th:text="|Total Amount: ${totalAmount}|"></p>
<p></p>
<p>File Validation:</p>
<p>
<ul>
<li th:each="aba : ${abaFiles}" th:text="|${aba.filename()} : ${aba.getTotalSettleAmountStr()}|"></li>
<li th:each="aba : ${abaFiles}" th:text="|${aba.filename()}(${aba.getRemark()}) : ${aba.getTotalSettleAmountStr()}|"></li>
</ul>
</p>
<br>

@ -323,11 +323,15 @@ define(['angular', 'decimal', 'uiBootstrap', 'uiRouter', 'angularEcharts'], func
if ($scope.datePattern == nowStr) {
$scope.sendNotice = true;
}
$scope.displaySendCheckCode = function () {
$scope.displaySendCheck = function () {
$uibModal.open({
templateUrl: '/static/analysis/templates/settlement_send_check_code.html',
controller: 'settlementSendCheckCodeCtrl',
size: 'sm'
resolve: {
settleLogs: function () {
return $scope.detail.logs.filter(log => log.editable);
}
}
});
};
@ -348,15 +352,6 @@ define(['angular', 'decimal', 'uiBootstrap', 'uiRouter', 'angularEcharts'], func
})[0];
};
$http.get('/sys/settlement/reports/' + $stateParams.date + '/send_status/').then(function (resp) {
if (resp.data != null && resp.data.mail_status == 1) {
$scope.hasSentMail = true;
}
});
$scope.$on("sendMailSuccess",
function (event, msg) {
$scope.hasSentMail = true;
});
$scope.confirmSendSettlementMail = function () {
commonDialog.confirm({
@ -497,25 +492,29 @@ define(['angular', 'decimal', 'uiBootstrap', 'uiRouter', 'angularEcharts'], func
};
}]);
app.controller('settlementSendCheckCodeCtrl', ['$scope', '$http', '$rootScope', '$stateParams', function ($scope, $http, $rootScope, $stateParams) {
app.controller('settlementSendCheckCodeCtrl', ['$scope', '$http', '$rootScope', '$stateParams', 'settleLogs', function ($scope, $http, $rootScope, $stateParams, settleLogs) {
$scope.settleLogs = settleLogs.map(log => {
let info = {
'id': log.clearing_id,
'time':log.operate_time,
'amount':log.net_amount,
'remark': log.plan_detail.remark || log.plan_detail.plan_id,
'send': false
};
return info
});
$scope.config = {mark_sent: true};
$scope.switchSendFlag=function(info){
info.send=!info.send
};
$scope.sendCheckCodeButton = false;
$scope.sendMailButton = false;
$scope.check_code = '';
$scope.sendCheckCode = function () {
$scope.error_msg = '';
$http.get('/sys/settlement/reports/send_checkcode').then(function (resp) {
});
$scope.sendCheckCodeButton = true;
};
$scope.sendSettlementMail = function () {
$scope.error_msg = '正在发送,请稍后。';
if ($scope.check_code == '' || $scope.check_code == null) {
$scope.error_msg = '请输入验证码';
return;
}
$scope.sendMailButton = true;
$http.get('/sys/settlement/reports/' + $stateParams.date + '/send_settlement_xlsx/' + $scope.check_code).then(function (resp) {
$http.post('/sys/settlement/reports/' + $stateParams.date + '/send_settlement_xlsx',
{clearing_ids:$scope.settleLogs.filter(log=>log.send).map(log=>log.id),mark_sent:$scope.config.mark_sent}).then(function (resp) {
$scope.error_msg = resp.data.msg;
$scope.sendMailButton = false;
if (resp.data.result == 0) {

@ -104,6 +104,9 @@ define(['angular', 'uiBootstrap', 'uiRouter', 'angularEcharts'], function (angul
} else {
params.end = $filter('date')(new Date(), 'yyyyMMdd');
}
if ($scope.chooseShow === 'All') {
delete params.client_ids;
}
$http.get('/dashboard/partner/customers', {params: params}).then(function (resp) {
var dates = [];
var new_customers = [];
@ -118,7 +121,7 @@ define(['angular', 'uiBootstrap', 'uiRouter', 'angularEcharts'], function (angul
// $scope.customersHistory = chartParser.parse(customersHistoryConfig, resp.data.reverse());
$scope.perCustomerTransactionHistory = chartParser.parse(perCustomerTransactionHistoryConfig, resp.data);
//$scope.ordersHistory = chartParser.parse(ordersHistoryConfig, resp.data);
})
});
};
$scope.chooseLast7Days();

@ -104,6 +104,9 @@ define(['angular', 'uiBootstrap', 'uiRouter', 'angularEcharts'], function (angul
} else {
params.end = $filter('date')(new Date(), 'yyyyMMdd');
}
if ($scope.chooseShow === 'All') {
delete params.client_ids;
}
$http.get('/dashboard/partner/customers', {params: params}).then(function (resp) {
$scope.transactionAmountHistory = chartParser.parse(transactionAmountHistoryConfig, resp.data.reverse());
$scope.ordersHistory = chartParser.parse(ordersHistoryConfig, resp.data);

@ -29,7 +29,7 @@
<i class="fa fa-download"></i> Settlement.aba
</a>
<button type="button" class="btn btn-warning " ng-if="(('1000'|withRole) && !hasSentMail)&&sendNotice"
data-toggle="modal" ng-click="displaySendCheckCode()">
data-toggle="modal" ng-click="displaySendCheck()">
Send Settlement Mail
</button>
<button class="btn btn-success" ng-if="hasSentMail" disabled="true">
@ -60,7 +60,7 @@
ng-click="switchSettleBatch(log)"
ng-class="{active:analysisFilter.clearing_id==log.clearing_id}">
<i class="fa fa-lock" ng-if="!log.editable"></i>
<span ng-bind="log.operate_time"></span>
<span ng-bind="'['+(log.plan_detail.remark||log.plan_detail.plan_id)+']'+log.operate_time"></span>
</button>
</div>
</div>

@ -1,13 +1,21 @@
<div class="modal-header bg-success">
<h4>Send Check Code</h4>
<h4>Send Settlement Email</h4>
</div>
<div class="modal-body" style="height: 300px">
<div class="text-center" >
<div class="col-sm-12">
<input type="text" ng-model="check_code" class="col-sm-6" style="margin-right:7px" required>
<button type="button" class="btn btn-default col-sm-5" data-dismiss="modal"
ng-click="sendCheckCode()" ng-disabled="sendCheckCodeButton">发送验证码
</button>
<ul class="list-group">
<li class="list-group-item text-left" ng-repeat="log in settleLogs" ng-class="{'active':log.send}" ng-click="switchSendFlag(log)">
<span>[{{log.remark}}]{{log.id}}</span>
<span class="pull-right" ng-bind="log.amount|currency:''"></span>
</li>
</ul>
</div>
<div class="col-sm-12">
<label class="checkbox-inline">
<input type="checkbox" name="mark_sent" ng-model="config.mark_sent" class="checkbox">
同时标记为已发送
</label>
</div>
<div class="col-sm-12">
<button type="button" class="btn btn-primary" style="width: 100%; margin-top: 30px" data-dismiss="modal"

@ -651,8 +651,12 @@ define(['angular','decimal', 'uiRouter', 'uiBootstrap', 'angularEcharts'], funct
$scope.loadDashboard();
};
$scope.loadSettlementLogs = function (page) {
var params = {limit:10};
$http.get('/client/trans_flow/settlement/log', {params: angular.merge(params,$scope.params)}).then(function (resp) {
var params = angular.copy($scope.params);
params.limit = 10;
if ($scope.chooseShow = 'All') {
delete params.client_ids;
}
$http.get('/client/trans_flow/settlement/log', {params: params}).then(function (resp) {
$scope.settlementLogs = resp.data.data;
});
};
@ -671,6 +675,9 @@ define(['angular','decimal', 'uiRouter', 'uiBootstrap', 'angularEcharts'], funct
function loadTransCommon() {
var params = angular.copy($scope.params);
params = angular.merge(params, $scope.scales[0].params());
if ($scope.chooseShow === 'All') {
delete params.client_ids;
}
$http.get('/dashboard/partner/common_analysis',{params:params}).then(function (resp) {
$scope.transcommon = resp.data;
});
@ -733,6 +740,9 @@ define(['angular','decimal', 'uiRouter', 'uiBootstrap', 'angularEcharts'], funct
column: {key: 'aud_fee', name: 'gateway_label'}
}]
};
if ($scope.chooseShow === 'All') {
delete params.client_ids;
}
$http.get('/dashboard/partner/trans_type_analysis',{params:params}).then(function (resp) {
$scope.trade_type_chart = chartParser.parse(tradeInTypeConfig, resp.data);
});
@ -792,6 +802,9 @@ define(['angular','decimal', 'uiRouter', 'uiBootstrap', 'angularEcharts'], funct
}
]
};
if ($scope.chooseShow === 'All') {
delete params.client_ids;
}
$http.get('/dashboard/partner/fee_analysis', {params: params}).then(function (resp) {
$scope.trade_line = chartParser.parse(analysisConfig, resp.data);
})
@ -799,10 +812,17 @@ define(['angular','decimal', 'uiRouter', 'uiBootstrap', 'angularEcharts'], funct
function getOrderCustomerChartAnalysis(params) {
if ($scope.chooseShow === 'All') {
delete params.client_ids;
}
$http.get('/dashboard/partner/avg_order_customer',{params:params}).then(function (resp) {
$scope.avgOrderAndCustomer = resp.data;
});
$http.get('/dashboard/partner/fee_analysis',{params:angular.merge(params,$scope.params)}).then(function (resp) {
params = angular.merge(params, $scope.params);
if ($scope.chooseShow === 'All') {
delete params.client_ids;
}
$http.get('/dashboard/partner/fee_analysis',{params:params}).then(function (resp) {
var dates = [];
var new_customers = [];
var old_customers = [];

@ -2470,8 +2470,9 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
};
$scope.loadSubClients = function (page) {
$scope.page = page || $scope.pagination.page || 1;
$http.get('/sys/partners/' + $scope.partner.client_moniker + '/sub_clients/'+$scope.page).then(function (resp) {
var params = {};
params.page = page || $scope.pagination.page || 1;
$http.get('/sys/partners/' + $scope.partner.client_moniker + '/sub_clients/page',{params : params}).then(function (resp) {
$scope.subPartners = resp.data.data;
$scope.pagination = resp.data.pagination;
});
@ -3383,6 +3384,11 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
$scope.isLevel3All = true;
$scope.clients = [$scope.partner];
$scope.showLevel3Clients = false;
$scope.subClientTable1 = [$scope.partner];
$scope.subClientTable2 = [];
$scope.choseSubClientNow = 'chose';
$scope.more20ChoseSubClient = false;
$scope.subSearchText = '';
$scope.today = new Date();
$scope.chooseToday = function () {
@ -3450,6 +3456,9 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
delete params.gatewayChilds;
delete params.gatewayChild;
}
if ($scope.isAll) {
delete params.client_ids;
}
$http.get('/sys/partners/' + $scope.partner.client_moniker + '/trade_logs', {params: params}).then(function (resp) {
$scope.tradeLogs = resp.data.data;
$scope.pagination = resp.data.pagination;
@ -3484,6 +3493,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
});
$scope.chooseClient = function (client) {
if (client == 'all') {
$scope.choseSubClientNow = 'chose';
$scope.params.client_ids = angular.copy($scope.clientIds);
$scope.isAll = true;
$scope.chooseClientId = '';
@ -3520,10 +3530,24 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
}
$scope.loadTradeLogs();
};
if ($scope.partner.has_children && !$scope.partner.hide_sub_mch) {
$http.get('/sys/partners/' + $scope.partner.client_moniker + '/sub_clients').then(function (resp) {
var clientList = resp.data;
$scope.searchSubClients = function (subSearchText,page) {
$scope.subClientTable1 = [$scope.partner];
$scope.subClientTable2 = [];
var params = {};
params.page = page || $scope.subClientPagination.page || 1;
if (subSearchText != '') {
$scope.subSearchText = subSearchText;
params.searchText = subSearchText;
}
$http.get('/sys/partners/' + $scope.partner.client_moniker + '/sub_clients/page',{params: params}).then(function (resp) {
var clientList = resp.data.data;
$scope.subClientPagination = resp.data.pagination;
clientList.forEach(function (client) {
if ($scope.subClientTable1.length < 11) {
$scope.subClientTable1.push(client);
}else {
$scope.subClientTable2.push(client);
}
$scope.clients.push(client);
});
$scope.clientIds = [];
@ -3536,12 +3560,27 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
}
});
$scope.params.client_ids = angular.copy($scope.clientIds);
//console.log($rootScope.currentUser.client.clientList);
$scope.loadTradeLogs(1);
})
});
};
if ($scope.partner.has_children && !$scope.partner.hide_sub_mch) {
$scope.searchSubClients('',1);
$scope.loadTradeLogs(1);
} else {
$scope.loadTradeLogs(1);
}
$scope.checkSubClientChoseShow = function (client) {
$scope.more20ChoseSubClient = !$scope.more20ChoseSubClient;
if (client != '') {
$scope.choseSubClientNow = client.short_name;
}
}
$scope.clickDisplayChoseDiv = function (event) {
$scope.more20ChoseSubClient = false;
}
$scope.choseDivStopPropagation = function (event) {
event.stopPropagation()
};
}]);
app.controller('partnerPluginsCtrl', ['$scope', '$uibModal', function ($scope, $uibModal) {
$scope.configRedpack = function () {
@ -4355,29 +4394,58 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
$scope.isLevel3All = true;
$scope.clinet = {};
$scope.isAll = true;
$scope.more20ChoseSubClient = false;
$scope.choseSubClientNow = 'chose';
$scope.searchSubClients = function (subSearchText,page) {
$scope.subClientTable1 = [$scope.partner];
$scope.subClientTable2 = [];
var params = {};
params.page = page || $scope.subClientPagination.page || 1;
if (subSearchText != '') {
$scope.subSearchText = subSearchText;
params.searchText = subSearchText;
}
$http.get('/sys/partners/' + $scope.partner.client_moniker + '/sub_clients/page',{params: params}).then(function (resp) {
var clientList = resp.data.data;
$scope.subClientPagination = resp.data.pagination;
clientList.forEach(function (client) {
if ($scope.subClientTable1.length < 11) {
$scope.subClientTable1.push(client);
}else {
$scope.subClientTable2.push(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.initClientInfo = function(){
$http.get('/sys/partners/'+clientMoniker).then(function (resp) {
$scope.client = resp.data;
$scope.clients = [$scope.client];
if ($scope.client.has_children && !$scope.client.hide_sub_mch) {
$scope.params.client_ids = [$scope.client.client_id];
$http.get('/sys/partners/'+clientMoniker+'/sub_clients').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.loadSettlementLogs(1);
})
$scope.searchSubClients('',1);
$scope.params.dateto = new Date();
var day = new Date();
day.setDate(day.getDate() - 7);
$scope.params.datefrom = day;
$scope.chooseClient('all');
}else {
$scope.params.dateto = new Date();
var day = new Date();
day.setDate(day.getDate() - 7);
$scope.params.datefrom = day;
$scope.chooseClient('all');
}
});
}
@ -4396,7 +4464,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
params.dateto = $filter('date')(params.dateto, 'yyyyMMdd');
url += connectSymbol + 'dateto=' + params.dateto;
}
if (params.client_ids){
if (params.client_ids && !$scope.isAll){
params.client_ids.forEach(function (i) {
url += connectSymbol + 'client_ids=' + i;
connectSymbol = '&';
@ -4407,6 +4475,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
$scope.chooseClient = function (client) {
if (client == 'all') {
$scope.choseSubClientNow = 'chose';
$scope.params.client_ids = angular.copy($scope.clientIds);
$scope.isAll = true;
$scope.chooseClientId = '';
@ -4477,6 +4546,9 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
}
params.page = page || $scope.pagination.page || 1;
params.limit = 10;
if ($scope.isAll) {
delete params.client_ids;
}
$http.get('/sys/partners/' + clientMoniker + '/lists_settlements', {params: params}).then(function (resp) {
$scope.settlementLogs = resp.data.data;
$scope.padding = resp.data.padding;
@ -4496,7 +4568,19 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
size: 'lg'
});
};
$scope.chooseLast7Days();
$scope.checkSubClientChoseShow = function (client) {
$scope.more20ChoseSubClient = !$scope.more20ChoseSubClient;
if (client != '') {
$scope.choseSubClientNow = client.short_name;
}
}
$scope.clickDisplayChoseDiv = function (event) {
$scope.more20ChoseSubClient = false;
}
$scope.choseDivStopPropagation = function (event) {
event.stopPropagation()
};
}]);
app.controller('partnerSurchargeAccountCtrl', ['$scope', '$uibModal', '$http', 'clientMoniker', '$filter', function ($scope, $uibModal, $http, clientMoniker, $filter) {
$scope.params = {};

@ -1930,9 +1930,14 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload', 'uiBoo
}]);
app.controller('clientSubPartnersCtrl', ['$scope', '$http', 'partner', function ($scope, $http, partner) {
$scope.partner = partner.data;
$scope.loadSubPartners = function () {
$http.get('/client/partner_info/sub_partners').then(function (resp) {
$scope.subPartners = resp.data;
$scope.pagination = {};
$scope.params = {};
$scope.loadSubPartners = function (page) {
var params = angular.copy($scope.params);
params.page = page || $scope.pagination.page || 1;
$http.get('/client/partner_info/sub_partners/page',{params: params}).then(function (resp) {
$scope.subPartners = resp.data.data;
$scope.pagination = resp.data.pagination;
$scope.subPartners.forEach(function (client) {
if (client.level3Clients) {
client.level3Clients.forEach(function (level3Client) {

@ -9,6 +9,17 @@
</section>
<section class="content">
<div class="row">
<div class="row" style="margin-bottom: 30px;">
<div class="col-sm-4 col-xs-8" style="margin-left: 30%">
<input class="form-control" placeholder="Keyword"
ng-model="params.searchText">
</div>
<div class="col-sm-3">
<button class="btn btn-success" type="button" ng-click="loadSubPartners()">
<i class="fa fa-search"></i> Search
</button>
</div>
</div>
<div class="col-sm-12 table-responsive">
<table class="table table-bordered table-striped table-hover">
<thead>
@ -34,6 +45,24 @@
</tr>
</tbody>
</table>
<div class="box-footer" ng-if="subPartners.length" style="float: right;background-color: #efefef00;">
<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="loadSubPartners(pagination.page)"
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>
</section>

@ -1,4 +1,45 @@
<div class="row margin-bottom">
<style>
.white_content {
display: none;
position: absolute;
width: 80%;
height: 400px;
padding: 20px;
border: 1px solid orange;
background-color: white;
z-index:1002;
overflow: auto;
}
.white_content::-webkit-scrollbar:vertical {
width: 11px;
}
/*定义滚动条高宽及背景
高宽分别对应横竖滚动条的尺寸*/
.white_content::-webkit-scrollbar
{
-webkit-appearance: none;
width:16px;
height:16px;
background-color:#F5F5F5;
}
/*定义滚动条轨道
内阴影+圆角*/
.white_content::-webkit-scrollbar-track
{
-webkit-box-shadow:inset 0 0 6px rgba(0,0,0,0.3);
border-radius:10px;
background-color:#F5F5F5;
}
/*定义滑块
内阴影+圆角*/
.white_content::-webkit-scrollbar-thumb
{
border-radius:10px;
-webkit-box-shadow:inset 0 0 6px rgba(0,0,0,.3);
background-color:#555;
}
</style>
<div class="row margin-bottom" ng-click="clickDisplayChoseDiv($event)">
<div class="col-sm-12">
<div class="form-horizontal">
<div class="form-group col-xs-12">
@ -164,13 +205,110 @@
<div class="form-group col-xs-12" ng-if="partner.has_children && !partner.hide_sub_mch">
<label class="control-label col-xs-4 col-sm-2">Sub Partner</label>
<div class="col-sm-10 col-xs-8">
<p class="form-control-static">
<p class="form-control-static" ng-if="clients.length<50">
<a role="button" ng-class="{'bg-primary':isAll}" ng-click="chooseClient('all')">All</a>
<label ng-repeat="sub in clients">
|&nbsp;<a role="button" ng-class="{'bg-primary':sub.client_id==chooseClientId}"
ng-click="chooseClient(sub)">{{sub.short_name}}</a>&nbsp;
</label>
</p>
<p class="form-control-static" ng-if="clients.length>=50">
<a role="button" ng-class="{'bg-primary':isAll}"
ng-click="chooseClient('all')">All</a>
<label ng-click="checkSubClientChoseShow('');choseDivStopPropagation($event)" style="cursor: pointer;">
<input ng-model="choseSubClientNow" style="border:none;cursor: pointer;" readonly>
</label>
</p>
<div id="light" class="white_content" ng-if="more20ChoseSubClient" style="display: block;" ng-click="choseDivStopPropagation($event)">
<div class="row">
<div class="form-group col-xs-12">
<div class="col-sm-8 col-xs-8">
<input class="form-control" placeholder="Keyword"
ng-model="subSearchText">
</div>
<div class="col-sm-3">
<button class="btn btn-success" type="button" ng-click="searchSubClients(subSearchText,1)">
<i class="fa fa-search"></i> Search
</button>
</div>
</div>
<div class="col-sm-12 table-responsive">
<div class="col-sm-6" style="padding: 0 2px">
<table class="table table-bordered table-striped table-hover" style="padding: 6px">
<thead>
<tr>
<th>Partner Code</th>
<th>Partner Name</th>
<th>Operation</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="subPartner in subClientTable1">
<td ng-click="showClient(subPartner); toShow = !toShow" style="cursor:pointer">
{{subPartner.client_moniker}}
</td>
<td ng-bind="subPartner.short_name"></td>
<td>
<button role="button" class="btn btn-info" title="Add Search"
style="padding: 1px 6px;"
ng-click="chooseClient(subPartner);checkSubClientChoseShow(subPartner)">
<i class="fa fa-plus"></i>
</button>
</td>
</tr>
</tbody>
</table>
</div>
<div class="col-sm-6" style="padding: 0 2px">
<table class="table table-bordered table-striped table-hover" style="padding: 6px">
<thead>
<tr>
<th>Partner Code</th>
<th>Partner Name</th>
<th>Operation</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="subPartner in subClientTable2">
<td ng-click="showClient(subPartner); toShow = !toShow" style="cursor:pointer">
{{subPartner.client_moniker}}
</td>
<td ng-bind="subPartner.short_name"></td>
<td>
<button role="button" class="btn btn-info" title="Add Search"
style="padding: 1px 6px;"
ng-click="chooseClient(subPartner);checkSubClientChoseShow(subPartner)">
<i class="fa fa-plus"></i>
</button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="box-footer" ng-if="clients.length" style="float: right;">
<uib-pagination class="pagination"
total-items="subClientPagination.totalCount"
boundary-links="true"
ng-model="subClientPagination.page"
items-per-page="subClientPagination.limit"
max-size="10"
ng-change="searchSubClients('',subClientPagination.page)"
previous-text="&lsaquo;"
next-text="&rsaquo;"
first-text="&laquo;"
last-text="&raquo;"></uib-pagination>
<div class="row">
<div class="col-xs-12">
Total Records:{{subClientPagination.totalCount}};Total Pages:{{subClientPagination.totalPages}}
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-danger" ng-click="checkSubClientChoseShow('')">Cancel</button>
</div>
</div>
</div>
</div>
<div class="form-group col-xs-12" ng-if="level3Clients && showLevel3Clients">

@ -1,4 +1,45 @@
<div class="content">
<style>
.white_content {
display: none;
position: absolute;
width: 80%;
height: 400px;
padding: 20px;
border: 1px solid orange;
background-color: white;
z-index:1002;
overflow: auto;
}
.white_content::-webkit-scrollbar:vertical {
width: 11px;
}
/*定义滚动条高宽及背景
高宽分别对应横竖滚动条的尺寸*/
.white_content::-webkit-scrollbar
{
-webkit-appearance: none;
width:16px;
height:16px;
background-color:#F5F5F5;
}
/*定义滚动条轨道
内阴影+圆角*/
.white_content::-webkit-scrollbar-track
{
-webkit-box-shadow:inset 0 0 6px rgba(0,0,0,0.3);
border-radius:10px;
background-color:#F5F5F5;
}
/*定义滑块
内阴影+圆角*/
.white_content::-webkit-scrollbar-thumb
{
border-radius:10px;
-webkit-box-shadow:inset 0 0 6px rgba(0,0,0,.3);
background-color:#555;
}
</style>
<div class="content" ng-click="clickDisplayChoseDiv($event)">
<div class="row">
<div class="col-md-12">
<div class="box-solid">
@ -53,7 +94,7 @@
<div class="form-group col-xs-12" ng-if="client.has_children && !client.hide_sub_mch">
<label class="control-label col-xs-4 col-sm-2">Sub Partner</label>
<div class="col-sm-10 col-xs-8">
<p class="form-control-static">
<p class="form-control-static" ng-if="clients.length<50">
<a role="button" ng-class="{'bg-primary':isAll}"
ng-click="chooseClient('all')">All</a>
<label ng-repeat="sub in clients">
@ -62,6 +103,103 @@
ng-click="chooseClient(sub)">{{sub.short_name}}</a>&nbsp;
</label>
</p>
<p class="form-control-static" ng-if="clients.length>=50">
<a role="button" ng-class="{'bg-primary':isAll}"
ng-click="chooseClient('all')">All</a>
<label ng-click="checkSubClientChoseShow('');choseDivStopPropagation($event)" style="cursor: pointer;">
<input ng-model="choseSubClientNow" style="border:none;cursor: pointer;" readonly>
</label>
</p>
<div id="light" class="white_content" ng-if="more20ChoseSubClient" style="display: block;" ng-click="choseDivStopPropagation($event)">
<div class="row">
<div class="form-group col-xs-12">
<div class="col-sm-8 col-xs-8">
<input class="form-control" placeholder="Keyword"
ng-model="subSearchText">
</div>
<div class="col-sm-3">
<button class="btn btn-success" type="button" ng-click="searchSubClients(subSearchText,1)">
<i class="fa fa-search"></i> Search
</button>
</div>
</div>
<div class="col-sm-12 table-responsive">
<div class="col-sm-6" style="padding: 0 2px">
<table class="table table-bordered table-striped table-hover" style="padding: 6px">
<thead>
<tr>
<th>Partner Code</th>
<th>Partner Name</th>
<th>Operation</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="subPartner in subClientTable1">
<td ng-click="showClient(subPartner); toShow = !toShow" style="cursor:pointer">
{{subPartner.client_moniker}}
</td>
<td ng-bind="subPartner.short_name"></td>
<td>
<button role="button" class="btn btn-info" title="Add Search"
style="padding: 1px 6px;"
ng-click="chooseClient(subPartner);checkSubClientChoseShow(subPartner)">
<i class="fa fa-plus"></i>
</button>
</td>
</tr>
</tbody>
</table>
</div>
<div class="col-sm-6" style="padding: 0 2px">
<table class="table table-bordered table-striped table-hover" style="padding: 6px">
<thead>
<tr>
<th>Partner Code</th>
<th>Partner Name</th>
<th>Operation</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="subPartner in subClientTable2">
<td ng-click="showClient(subPartner); toShow = !toShow" style="cursor:pointer">
{{subPartner.client_moniker}}
</td>
<td ng-bind="subPartner.short_name"></td>
<td>
<button role="button" class="btn btn-info" title="Add Search"
style="padding: 1px 6px;"
ng-click="chooseClient(subPartner);checkSubClientChoseShow(subPartner)">
<i class="fa fa-plus"></i>
</button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="box-footer" ng-if="clients.length" style="float: right;">
<uib-pagination class="pagination"
total-items="subClientPagination.totalCount"
boundary-links="true"
ng-model="subClientPagination.page"
items-per-page="subClientPagination.limit"
max-size="10"
ng-change="searchSubClients('',subClientPagination.page)"
previous-text="&lsaquo;"
next-text="&rsaquo;"
first-text="&laquo;"
last-text="&raquo;"></uib-pagination>
<div class="row">
<div class="col-xs-12">
Total Records:{{subClientPagination.totalCount}};Total Pages:{{subClientPagination.totalPages}}
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-danger" ng-click="checkSubClientChoseShow('')">Cancel</button>
</div>
</div>
</div>
</div>
<button class="btn btn-success" type="button" ng-click="loadSettlementLogs(1)">

@ -25,12 +25,29 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
$scope.clients = [$scope.currentUser.client];
$scope.showLevel3Clients = false;
$scope.isLevel3All = true;
$scope.subClientTable1 = [$scope.currentUser.client];
$scope.subClientTable2 = [];
$scope.choseSubClientNow = 'chose';
$scope.subSearchText = '';
$scope.searchSubClients = function (subSearchText,page) {
if ($scope.currentUser.client.has_children && !$scope.currentUser.client.hide_sub_mch) {
$scope.params.client_ids = [$scope.currentUser.client.client_id];
$http.get('/client/partner_info/sub_partners').then(function (resp) {
var clientList = resp.data;
$scope.subClientTable1 = [$scope.currentUser.client];
$scope.subClientTable2 = [];
var params = {};
params.page = page || $scope.subClientPagination.page || 1;
if (subSearchText != '') {
$scope.subSearchText = subSearchText;
params.searchText = subSearchText;
}
$http.get('/client/partner_info/sub_partners/page',{params: params}).then(function (resp) {
var clientList = resp.data.data;
$scope.subClientPagination = resp.data.pagination;
clientList.forEach(function (client) {
if ($scope.subClientTable1.length < 11) {
$scope.subClientTable1.push(client);
}else {
$scope.subClientTable2.push(client);
}
$scope.clients.push(client);
});
$scope.clientIds = [];
@ -43,9 +60,8 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
}
});
$scope.params.client_ids = angular.copy($scope.clientIds);
})
}
});
};
$scope.today = new Date();
$scope.chooseToday = function () {
$scope.params.datefrom = $scope.params.dateto = new Date();
@ -90,6 +106,9 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
params.dateto = $filter('date')(params.dateto, 'yyyyMMdd');
}
params.page = page || $scope.pagination.page || 1;
if ($scope.isAll) {
delete params.client_ids;
}
$http.get('/client/trans_flow/settlement/log', {params: params}).then(function (resp) {
$scope.settlementLogs = resp.data.data;
$scope.pagination = resp.data.pagination;
@ -110,7 +129,7 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
params.dateto = $filter('date')(params.dateto, 'yyyyMMdd');
url += connectSymbol + 'dateto=' + params.dateto;
}
if (params.client_ids) {
if (params.client_ids && !$scope.isAll) {
params.client_ids.forEach(function (i) {
url += connectSymbol + 'client_ids=' + i;
connectSymbol = '&';
@ -118,7 +137,6 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
}
return url;
};
$scope.chooseLast7Days();
$scope.exportSettlementLogs = function (pattern) {
let params = angular.copy($scope.params);
@ -138,7 +156,7 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
params.dateto = $filter('date')(params.dateto, 'yyyyMMdd');
url += connectSymbol + 'dateto=' + params.dateto;
}
if (params.client_ids) {
if (params.client_ids && !$scope.isAll) {
params.client_ids.forEach(function (i) {
url += connectSymbol + 'client_ids=' + i;
connectSymbol = '&';
@ -157,6 +175,7 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
$scope.chooseClient = function (client) {
if (client == 'all') {
$scope.choseSubClientNow = 'chose';
$scope.params.client_ids = angular.copy($scope.clientIds);
$scope.isAll = true;
$scope.chooseClientId = '';
@ -182,6 +201,21 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
$scope.loadSettlementLogs(1);
};
if ($scope.currentUser.client.has_children && !$scope.currentUser.client.hide_sub_mch) {
$scope.searchSubClients('',1);
$scope.params.dateto = new Date();
var day = new Date();
day.setDate(day.getDate() - 7);
$scope.params.datefrom = day;
$scope.chooseClient('all');
}else {
$scope.params.dateto = new Date();
var day = new Date();
day.setDate(day.getDate() - 7);
$scope.params.datefrom = day;
$scope.chooseClient('all');
}
$scope.chooseLevel3Client = function (client) {
if (client == 'all') {
$scope.params.client_ids = angular.copy($scope.level3ClientIds);
@ -198,6 +232,18 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
$scope.getClearingTransactions = function (client_id, detailId) {
clearingDetailService.clientClearingDetail(client_id, detailId, true)
}
$scope.checkSubClientChoseShow = function (client) {
$scope.more20ChoseSubClient = !$scope.more20ChoseSubClient;
if (client != '') {
$scope.choseSubClientNow = client.short_name;
}
}
$scope.clickDisplayChoseDiv = function (event) {
$scope.more20ChoseSubClient = false;
}
$scope.choseDivStopPropagation = function (event) {
event.stopPropagation()
};
}]);
return app;
});

@ -34,6 +34,45 @@
.line_height_ {
line-height: 22px;
}
.white_content {
display: none;
position: absolute;
width: 80%;
height: 400px;
padding: 20px;
border: 1px solid orange;
background-color: white;
z-index:1002;
overflow: auto;
}
.white_content::-webkit-scrollbar:vertical {
width: 11px;
}
/*定义滚动条高宽及背景
高宽分别对应横竖滚动条的尺寸*/
.white_content::-webkit-scrollbar
{
-webkit-appearance: none;
width:16px;
height:16px;
background-color:#F5F5F5;
}
/*定义滚动条轨道
内阴影+圆角*/
.white_content::-webkit-scrollbar-track
{
-webkit-box-shadow:inset 0 0 6px rgba(0,0,0,0.3);
border-radius:10px;
background-color:#F5F5F5;
}
/*定义滑块
内阴影+圆角*/
.white_content::-webkit-scrollbar-thumb
{
border-radius:10px;
-webkit-box-shadow:inset 0 0 6px rgba(0,0,0,.3);
background-color:#555;
}
</style>
<section class="content-header">
<h1>Transactions</h1>
@ -44,7 +83,7 @@
<li class="active">Transactions</li>
</ol>
</section>
<div class="content">
<div class="content" ng-click="clickDisplayChoseDiv($event)">
<div class="row">
<div class="col-sm-12">
<div class="box-solid">
@ -208,15 +247,113 @@
ng-if="currentUser.client.has_children && !currentUser.client.hide_sub_mch">
<label class="control-label col-xs-4 col-sm-2">Sub Partner</label>
<div class="col-sm-10 col-xs-8">
<p class="form-control-static">
<p class="form-control-static" ng-if="clients.length<50">
<a role="button" ng-class="{'bg-primary':isAll}"
ng-click="chooseClient('all')">All</a>
<label ng-repeat="sub in clients">
|&nbsp;<a role="button"
ng-class="{'bg-primary':sub.client_id==chooseClientId}"
ng-click="chooseClient(sub)">{{sub.short_name}}</a>&nbsp;
</label>
</p>
<p class="form-control-static" ng-if="clients.length>=50">
<a role="button" ng-class="{'bg-primary':isAll}"
ng-click="chooseClient('all')">All</a>
<label ng-click="checkSubClientChoseShow('');choseDivStopPropagation($event)" style="cursor: pointer;">
<input ng-model="choseSubClientNow" style="border:none;cursor: pointer;" readonly>
</label>
</p>
<div id="light" class="white_content" ng-if="more20ChoseSubClient" style="display: block;" ng-click="choseDivStopPropagation($event)">
<div class="row">
<div class="form-group col-xs-12">
<div class="col-sm-8 col-xs-8">
<input class="form-control" placeholder="Keyword"
ng-model="subSearchText">
</div>
<div class="col-sm-3">
<button class="btn btn-success" type="button" ng-click="searchSubClients(subSearchText,1)">
<i class="fa fa-search"></i> Search
</button>
</div>
</div>
<div class="col-sm-12 table-responsive">
<div class="col-sm-6" style="padding: 0 2px">
<table class="table table-bordered table-striped table-hover" style="padding: 6px">
<thead>
<tr>
<th>Partner Code</th>
<th>Partner Name</th>
<th>Operation</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="subPartner in subClientTable1">
<td ng-click="showClient(subPartner); toShow = !toShow" style="cursor:pointer">
{{subPartner.client_moniker}}
</td>
<td ng-bind="subPartner.short_name"></td>
<td>
<button role="button" class="btn btn-info" title="Add Search"
style="padding: 1px 6px;"
ng-click="chooseClient(subPartner);checkSubClientChoseShow(subPartner)">
<i class="fa fa-plus"></i>
</button>
</td>
</tr>
</tbody>
</table>
</div>
<div class="col-sm-6" style="padding: 0 2px">
<table class="table table-bordered table-striped table-hover" style="padding: 6px">
<thead>
<tr>
<th>Partner Code</th>
<th>Partner Name</th>
<th>Operation</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="subPartner in subClientTable2">
<td ng-click="showClient(subPartner); toShow = !toShow" style="cursor:pointer">
{{subPartner.client_moniker}}
</td>
<td ng-bind="subPartner.short_name"></td>
<td>
<button role="button" class="btn btn-info" title="Add Search"
style="padding: 1px 6px;"
ng-click="chooseClient(subPartner);checkSubClientChoseShow(subPartner)">
<i class="fa fa-plus"></i>
</button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="box-footer" ng-if="clients.length" style="float: right;">
<uib-pagination class="pagination"
total-items="subClientPagination.totalCount"
boundary-links="true"
ng-model="subClientPagination.page"
items-per-page="subClientPagination.limit"
max-size="10"
ng-change="searchSubClients('',subClientPagination.page)"
previous-text="&lsaquo;"
next-text="&rsaquo;"
first-text="&laquo;"
last-text="&raquo;"></uib-pagination>
<div class="row">
<div class="col-xs-12">
Total Records:{{subClientPagination.totalCount}};Total Pages:{{subClientPagination.totalPages}}
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-danger" ng-click="checkSubClientChoseShow('')">Cancel</button>
</div>
</div>
</div>
</div>
<div class="form-group col-xs-12"
@ -240,8 +377,6 @@
<button class="btn btn-success" type="button" ng-click="loadTradeLogs()">
<i class="fa fa-search"></i> Search
</button>
<!--<a ng-if="pagination.totalCount>0" class="btn btn-success" style="float: right"-->
<!--target="_blank" ng-href="{{export()}}">Export</a>-->
<div class="btn-group" uib-dropdown ng-if="pagination.totalCount>0"
style="float: right;right: 20px;">
<button id="single-button" type="button" class="btn btn-primary"
@ -258,7 +393,6 @@
Partner Detail)</a></li>
</ul>
</div>
</div>
</div>
</div>

@ -9,6 +9,45 @@
.alignCen,.alignCen th{
text-align: center;
}
.white_content {
display: none;
position: absolute;
width: 80%;
height: 400px;
padding: 20px;
border: 1px solid orange;
background-color: white;
z-index:1002;
overflow: auto;
}
.white_content::-webkit-scrollbar:vertical {
width: 11px;
}
/*定义滚动条高宽及背景
高宽分别对应横竖滚动条的尺寸*/
.white_content::-webkit-scrollbar
{
-webkit-appearance: none;
width:16px;
height:16px;
background-color:#F5F5F5;
}
/*定义滚动条轨道
内阴影+圆角*/
.white_content::-webkit-scrollbar-track
{
-webkit-box-shadow:inset 0 0 6px rgba(0,0,0,0.3);
border-radius:10px;
background-color:#F5F5F5;
}
/*定义滑块
内阴影+圆角*/
.white_content::-webkit-scrollbar-thumb
{
border-radius:10px;
-webkit-box-shadow:inset 0 0 6px rgba(0,0,0,.3);
background-color:#555;
}
</style>
<section class="content-header">
<h1>Settlement</h1>
@ -19,7 +58,7 @@
<li class="active">Settlement</li>
</ol>
</section>
<div class="content">
<div class="content" ng-click="clickDisplayChoseDiv($event)">
<div class="row">
<div class="col-sm-12">
<div class="box-solid">
@ -74,7 +113,7 @@
<div class="form-group col-xs-12" ng-if="currentUser.client.has_children && !currentUser.client.hide_sub_mch">
<label class="control-label col-xs-4 col-sm-2">Sub Partner</label>
<div class="col-sm-10 col-xs-8">
<p class="form-control-static">
<p class="form-control-static" ng-if="clients.length<50">
<a role="button" ng-class="{'bg-primary':isAll}"
ng-click="chooseClient('all')">All</a>
<label ng-repeat="sub in clients">
@ -83,6 +122,103 @@
ng-click="chooseClient(sub)">{{sub.short_name}}</a>&nbsp;
</label>
</p>
<p class="form-control-static" ng-if="clients.length>=50">
<a role="button" ng-class="{'bg-primary':isAll}"
ng-click="chooseClient('all')">All</a>
<label ng-click="checkSubClientChoseShow('');choseDivStopPropagation($event)" style="cursor: pointer;">
<input ng-model="choseSubClientNow" style="border:none;cursor: pointer;" readonly>
</label>
</p>
<div id="light" class="white_content" ng-if="more20ChoseSubClient" style="display: block;" ng-click="choseDivStopPropagation($event)">
<div class="row">
<div class="form-group col-xs-12">
<div class="col-sm-8 col-xs-8">
<input class="form-control" placeholder="Keyword"
ng-model="subSearchText">
</div>
<div class="col-sm-3">
<button class="btn btn-success" type="button" ng-click="searchSubClients(subSearchText,1)">
<i class="fa fa-search"></i> Search
</button>
</div>
</div>
<div class="col-sm-12 table-responsive">
<div class="col-sm-6" style="padding: 0 2px">
<table class="table table-bordered table-striped table-hover" style="padding: 6px">
<thead>
<tr>
<th>Partner Code</th>
<th>Partner Name</th>
<th>Operation</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="subPartner in subClientTable1">
<td ng-click="showClient(subPartner); toShow = !toShow" style="cursor:pointer">
{{subPartner.client_moniker}}
</td>
<td ng-bind="subPartner.short_name"></td>
<td>
<button role="button" class="btn btn-info" title="Add Search"
style="padding: 1px 6px;"
ng-click="chooseClient(subPartner);checkSubClientChoseShow(subPartner)">
<i class="fa fa-plus"></i>
</button>
</td>
</tr>
</tbody>
</table>
</div>
<div class="col-sm-6" style="padding: 0 2px">
<table class="table table-bordered table-striped table-hover" style="padding: 6px">
<thead>
<tr>
<th>Partner Code</th>
<th>Partner Name</th>
<th>Operation</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="subPartner in subClientTable2">
<td ng-click="showClient(subPartner); toShow = !toShow" style="cursor:pointer">
{{subPartner.client_moniker}}
</td>
<td ng-bind="subPartner.short_name"></td>
<td>
<button role="button" class="btn btn-info" title="Add Search"
style="padding: 1px 6px;"
ng-click="chooseClient(subPartner);checkSubClientChoseShow(subPartner)">
<i class="fa fa-plus"></i>
</button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="box-footer" ng-if="clients.length" style="float: right;">
<uib-pagination class="pagination"
total-items="subClientPagination.totalCount"
boundary-links="true"
ng-model="subClientPagination.page"
items-per-page="subClientPagination.limit"
max-size="10"
ng-change="searchSubClients('',subClientPagination.page)"
previous-text="&lsaquo;"
next-text="&rsaquo;"
first-text="&laquo;"
last-text="&raquo;"></uib-pagination>
<div class="row">
<div class="col-xs-12">
Total Records:{{subClientPagination.totalCount}};Total Pages:{{subClientPagination.totalPages}}
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-danger" ng-click="checkSubClientChoseShow('')">Cancel</button>
</div>
</div>
</div>
</div>
<div class="form-group col-xs-12" ng-if="level3Clients && showLevel3Clients">

@ -78,6 +78,45 @@
.line_height_ {
line-height: 22px;
}
.white_content {
display: none;
position: absolute;
width: 80%;
height: 400px;
padding: 20px;
border: 1px solid orange;
background-color: white;
z-index:1002;
overflow: auto;
}
.white_content::-webkit-scrollbar:vertical {
width: 11px;
}
/*定义滚动条高宽及背景
高宽分别对应横竖滚动条的尺寸*/
.white_content::-webkit-scrollbar
{
-webkit-appearance: none;
width:16px;
height:16px;
background-color:#F5F5F5;
}
/*定义滚动条轨道
内阴影+圆角*/
.white_content::-webkit-scrollbar-track
{
-webkit-box-shadow:inset 0 0 6px rgba(0,0,0,0.3);
border-radius:10px;
background-color:#F5F5F5;
}
/*定义滑块
内阴影+圆角*/
.white_content::-webkit-scrollbar-thumb
{
border-radius:10px;
-webkit-box-shadow:inset 0 0 6px rgba(0,0,0,.3);
background-color:#555;
}
</style>
<section class="content-header">
<h1>Orders</h1>
@ -88,7 +127,7 @@
<li class="active">Orders</li>
</ol>
</section>
<div class="content">
<div class="content" ng-click="clickDisplayChoseDiv($event)">
<div class="callout callout-info" ng-repeat="order in alerts">
<h4><span style="font-size: 22px">{{order.display_amount|currency:order.currency+' '}}</span> Paid
Success!</h4>
@ -290,7 +329,7 @@
ng-if="currentUser.client.has_children && !currentUser.client.hide_sub_mch">
<label class="control-label col-xs-4 col-sm-2">Sub Partner</label>
<div class="col-sm-10 col-xs-8">
<p class="form-control-static">
<p class="form-control-static" ng-if="clients.length<50">
<a role="button" ng-class="{'bg-primary':isAll}"
ng-click="chooseClient('all')">All</a>
<label ng-repeat="sub in clients">
@ -301,6 +340,103 @@
&nbsp;
</label>
</p>
<p class="form-control-static" ng-if="clients.length>=50">
<a role="button" ng-class="{'bg-primary':isAll}"
ng-click="chooseClient('all')">All</a>
<label ng-click="checkSubClientChoseShow('');choseDivStopPropagation($event)" style="cursor: pointer;">
<input ng-model="choseSubClientNow" style="border:none;cursor: pointer;" readonly>
</label>
</p>
<div id="light" class="white_content" ng-if="more20ChoseSubClient" style="display: block;" ng-click="choseDivStopPropagation($event)">
<div class="row">
<div class="form-group col-xs-12">
<div class="col-sm-8 col-xs-8">
<input class="form-control" placeholder="Keyword"
ng-model="subSearchText">
</div>
<div class="col-sm-3">
<button class="btn btn-success" type="button" ng-click="searchSubClients(subSearchText,1)">
<i class="fa fa-search"></i> Search
</button>
</div>
</div>
<div class="col-sm-12 table-responsive">
<div class="col-sm-6" style="padding: 0 2px">
<table class="table table-bordered table-striped table-hover" style="padding: 6px">
<thead>
<tr>
<th>Partner Code</th>
<th>Partner Name</th>
<th>Operation</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="subPartner in subClientTable1">
<td ng-click="showClient(subPartner); toShow = !toShow" style="cursor:pointer">
{{subPartner.client_moniker}}
</td>
<td ng-bind="subPartner.short_name"></td>
<td>
<button role="button" class="btn btn-info" title="Add Search"
style="padding: 1px 6px;"
ng-click="chooseClient(subPartner);checkSubClientChoseShow(subPartner)">
<i class="fa fa-plus"></i>
</button>
</td>
</tr>
</tbody>
</table>
</div>
<div class="col-sm-6" style="padding: 0 2px">
<table class="table table-bordered table-striped table-hover" style="padding: 6px">
<thead>
<tr>
<th>Partner Code</th>
<th>Partner Name</th>
<th>Operation</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="subPartner in subClientTable2">
<td ng-click="showClient(subPartner); toShow = !toShow" style="cursor:pointer">
{{subPartner.client_moniker}}
</td>
<td ng-bind="subPartner.short_name"></td>
<td>
<button role="button" class="btn btn-info" title="Add Search"
style="padding: 1px 6px;"
ng-click="chooseClient(subPartner);checkSubClientChoseShow(subPartner)">
<i class="fa fa-plus"></i>
</button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="box-footer" ng-if="clients.length" style="float: right;">
<uib-pagination class="pagination"
total-items="subClientPagination.totalCount"
boundary-links="true"
ng-model="subClientPagination.page"
items-per-page="subClientPagination.limit"
max-size="10"
ng-change="searchSubClients('',subClientPagination.page)"
previous-text="&lsaquo;"
next-text="&rsaquo;"
first-text="&laquo;"
last-text="&raquo;"></uib-pagination>
<div class="row">
<div class="col-xs-12">
Total Records:{{subClientPagination.totalCount}};Total Pages:{{subClientPagination.totalPages}}
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-danger" ng-click="checkSubClientChoseShow('')">Cancel</button>
</div>
</div>
</div>
</div>
<div class="form-group col-xs-12"

@ -28,6 +28,10 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
$scope.dev_params = {client_type:'sunmi',limit:100};
$scope.clients = [$scope.currentUser.client];
$scope.showLevel3Clients = false;
$scope.subClientTable1 = [$scope.currentUser.client];
$scope.subClientTable2 = [];
$scope.choseSubClientNow = 'chose';
$scope.subSearchText = '';
$scope.chooseToday = function () {
@ -72,6 +76,9 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
if (params.dateto) {
params.dateto = $filter('date')(params.dateto, 'yyyyMMdd');
}
if ($scope.isAll) {
delete params.client_ids;
}
params.page = page || $scope.pagination.page || 1;
if(params.gateway){
if((params.gateway.sort().toString()!=[0,1].toString()) && (params.gateway.sort().toString()!=[5,6].toString())){
@ -183,6 +190,7 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
});
$scope.chooseClient = function (client) {
if (client == 'all') {
$scope.choseSubClientNow = 'chose';
$scope.params.client_ids = angular.copy($scope.clientIds);
$scope.isAll = true;
$scope.chooseClientId = '';
@ -235,12 +243,18 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
$scope.listDevices = function () {
var params = angular.copy($scope.dev_params)
if ($scope.isAll) {
delete params.client_ids;
}
$http.get('/client/partner_info/devices', {params: params}).then(function (resp) {
$scope.devices = resp.data.data;
})
};
$scope.listDevicesIds = function () {
var params = angular.copy($scope.params)
if ($scope.isAll) {
delete params.client_ids;
}
$http.get('/client/partner_info/device_ids',{params: params}).then(function (resp) {
$scope.deviceIds = resp.data.data;
})
@ -278,10 +292,25 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
$scope.listDevices();
$scope.listDevicesIds();
if ($scope.currentUser.client.has_children && !$scope.currentUser.client.hide_sub_mch) {
$http.get('/client/partner_info/sub_partners').then(function (resp) {
var clientList = resp.data;
$scope.searchSubClients = function (subSearchText,page) {
$scope.subClientTable1 = [$scope.currentUser.client];
$scope.subClientTable2 = [];
var params = {};
params.page = page || $scope.subClientPagination.page || 1;
if (subSearchText != '') {
$scope.subSearchText = subSearchText;
params.searchText = subSearchText;
}
$http.get('/client/partner_info/sub_partners/page',{params: params}).then(function (resp) {
var clientList = resp.data.data;
$scope.subClientPagination = resp.data.pagination;
clientList.forEach(function (client) {
if ($scope.subClientTable1.length < 11) {
$scope.subClientTable1.push(client);
}else {
$scope.subClientTable2.push(client);
}
$scope.clients.push(client);
});
$scope.clientIds = [];
@ -294,12 +323,22 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
}
});
$scope.params.client_ids = angular.copy($scope.clientIds);
$scope.loadTradeLogs(1);
$scope.listDevicesIds();
//console.log($rootScope.currentUser.client.clientList);
})
});
};
if ($scope.currentUser.client.has_children && !$scope.currentUser.client.hide_sub_mch) {
$scope.searchSubClients('',1);
$scope.params.dateto = new Date();
var day = new Date();
day.setDate(day.getDate() - 7);
$scope.params.datefrom = day;
$scope.chooseClient('all')
}else{
$scope.loadTradeLogs(1);
$scope.params.dateto = new Date();
var day = new Date();
day.setDate(day.getDate() - 7);
$scope.params.datefrom = day;
$scope.chooseClient('all');
}
$scope.fullReleasePreAuth = function (){
@ -322,6 +361,18 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
})
});
}
$scope.checkSubClientChoseShow = function (client) {
$scope.more20ChoseSubClient = !$scope.more20ChoseSubClient;
if (client != '') {
$scope.choseSubClientNow = client.short_name;
}
}
$scope.clickDisplayChoseDiv = function (event) {
$scope.more20ChoseSubClient = false;
}
$scope.choseDivStopPropagation = function (event) {
event.stopPropagation()
};
}]);
app.controller('IncrementalTradeLogCtrl', ['$scope', '$http', '$filter', '$timeout', 'partnerRefunder', 'orderService', 'commonDialog',
@ -426,6 +477,7 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
});
$scope.chooseClient = function (client) {
if (client == 'all') {
$scope.choseSubClientNow = 'chose';
$scope.params.client_ids = angular.copy($scope.clientIds);
$scope.isAll = true;
$scope.chooseClientId = '';

@ -15,6 +15,7 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
app.controller('balanceListCtrl', ['$scope', '$http', '$filter', '$timeout', 'refunder', 'orderService','$sce', function ($scope, $http, $filter, $timeout, refunder,orderService,$sce) {
$scope.params = {textType: 'all'};
$scope.pagination = {};
$scope.subClientPagination = {};
$scope.params.clearing_status = -1;
$scope.params.channel = 'ALL'
$scope.dev_params = {client_type:'sunmi',limit:100};
@ -22,9 +23,14 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
$scope.order_device_isAll = true;
$scope.params.trans_type = 0;
$scope.isAll = true;
$scope.more20ChoseSubClient = false;
$scope.clients = [$scope.currentUser.client];
$scope.params.client_ids = [$scope.currentUser.client.client_id];
$scope.showLevel3Clients = false;
$scope.subClientTable1 = [$scope.currentUser.client];
$scope.subClientTable2 = [];
$scope.choseSubClientNow = 'chose';
$scope.subSearchText = '';
$scope.today = new Date();
$scope.chooseToday = function () {
@ -42,7 +48,7 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
var day = new Date();
day.setDate(day.getDate() - 7);
$scope.params.datefrom = day;
$scope.chooseClient('all');
$scope.loadTradeLogs(1);
};
$scope.thisMonth = function () {
$scope.params.dateto = new Date();
@ -63,12 +69,18 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
};
$scope.listDevices = function () {
var params = angular.copy($scope.dev_params)
if ($scope.isAll) {
delete params.client_ids;
}
$http.get('/client/partner_info/devices', {params: params}).then(function (resp) {
$scope.devices = resp.data.data;
})
};
$scope.listDevicesIds = function () {
var params = angular.copy($scope.params)
if ($scope.isAll) {
delete params.client_ids;
}
$http.get('/client/partner_info/device_ids',{params: params}).then(function (resp) {
$scope.deviceIds = resp.data.data;
})
@ -104,8 +116,46 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
};
$scope.listDevices();
$scope.listDevicesIds();
$scope.searchSubClients = function (subSearchText,page) {
$scope.subClientTable1 = [$scope.currentUser.client];
$scope.subClientTable2 = [];
var params = {};
params.page = page || $scope.subClientPagination.page || 1;
if (subSearchText != '') {
$scope.subSearchText = subSearchText;
params.searchText = subSearchText;
}
$http.get('/client/partner_info/sub_partners/page',{params: params}).then(function (resp) {
var clientList = resp.data.data;
$scope.subClientPagination = resp.data.pagination;
clientList.forEach(function (client) {
if ($scope.subClientTable1.length < 11) {
$scope.subClientTable1.push(client);
}else {
$scope.subClientTable2.push(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.loadTradeLogs = function (page) {
var params = angular.copy($scope.params);
if ($scope.isAll) {
delete params.client_ids;
}
if (params.datefrom) {
params.datefrom = $filter('date')(params.datefrom, 'yyyyMMdd');
}
@ -124,6 +174,7 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
};
$scope.chooseClient = function (client) {
if (client == 'all') {
$scope.choseSubClientNow = 'chose';
$scope.params.client_ids = angular.copy($scope.clientIds);
$scope.isAll = true;
$scope.chooseClientId = '';
@ -200,7 +251,7 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
url += connectSymbol + 'dev_id=' + params.dev_id;
connectSymbol = '&'
}
if (params.client_ids) {
if (params.client_ids && !$scope.isAll) {
params.client_ids.forEach(function (i) {
url += connectSymbol + 'client_ids=' + i;
connectSymbol = '&';
@ -223,25 +274,18 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
}
if ($scope.currentUser.client.has_children && !$scope.currentUser.client.hide_sub_mch) {
$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();
})
$scope.searchSubClients('',1);
$scope.params.dateto = new Date();
var day = new Date();
day.setDate(day.getDate() - 7);
$scope.params.datefrom = day;
$scope.chooseClient('all');
}else {
$scope.chooseLast7Days();
$scope.params.dateto = new Date();
var day = new Date();
day.setDate(day.getDate() - 7);
$scope.params.datefrom = day;
$scope.chooseClient('all');
}
$scope.htmlToolst = function(){
@ -264,6 +308,18 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
$scope.tradeLogs[i].htmlTooltip = $sce.trustAsHtml(tip);
}
};
$scope.checkSubClientChoseShow = function (client) {
$scope.more20ChoseSubClient = !$scope.more20ChoseSubClient;
if (client != '') {
$scope.choseSubClientNow = client.short_name;
}
}
$scope.clickDisplayChoseDiv = function (event) {
$scope.more20ChoseSubClient = false;
}
$scope.choseDivStopPropagation = function (event) {
event.stopPropagation()
};
}]);

@ -14,6 +14,7 @@ import org.thymeleaf.spring5.SpringTemplateEngine;
import javax.annotation.Resource;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
@ -33,7 +34,8 @@ public class SettleMailTest {
@Test
public void parse() throws IOException {
Date date = DateUtils.truncate(new Date(), Calendar.DATE);
List<ABAFile> abaFileList = cleanService.getAba(date, "CBA");
final ArrayList<String> clearIds = new ArrayList<>();
List<ABAFile> abaFileList = cleanService.getAba(date, "CBA", cleanService.getSettleLogs(date, clearIds));
Context ctx = new Context();
ctx.setVariable("date", DateFormatUtils.format(date, "dd-MM-yyyy"));

@ -0,0 +1,211 @@
server {
listen 80;
server_name _ default;
underscores_in_headers on;
proxy_ignore_client_abort on;
client_max_body_size 0;
location / {
root /var/www/royalpay/;
try_files $uri $uri/login.html @route;
}
location @route {
proxy_pass http://127.0.0.1:3000;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
server {
listen 3000;
server_name _ default;
location ~ ^/api/v1.0/retail/((?!(app|rsvc)).)+ {
proxy_pass http://rppaycenter;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Host $host;
proxy_set_header Real-IP $remote_addr;
proxy_read_timeout 300s;
}
location /oauth {
proxy_pass http://rpgateway;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Host $host;
proxy_set_header Real-IP $remote_addr;
proxy_read_timeout 300s;
}
location /api/v1.0/retail/app {
proxy_pass http://rpgateway;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Host $host;
proxy_set_header Real-IP $remote_addr;
proxy_read_timeout 300s;
}
location ~ ^/api/v1.0/((jd)|(customs)|(alipay)|(rpay)|(yeepay)|(lakala_pay)|(cb_bankpay)|(bestpay)|(hf)|(wechat_jsapi_gateway)|(h5_payment)|(gateway)|(hf_gateway)|(jd_gateway)|(micropay)|(retail_qrcode)|(jsapi_gateway)|(share_code)|(payment))/ {
proxy_pass http://rppaycenter;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Host $host;
proxy_set_header Real-IP $remote_addr;
proxy_read_timeout 300s;
}
location /static {
proxy_pass http://rppaycenter;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Host $host;
proxy_set_header Real-IP $remote_addr;
proxy_read_timeout 300s;
}
location /api/wechat {
proxy_pass http://rppaycenter;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Host $host;
proxy_set_header Real-IP $remote_addr;
proxy_read_timeout 300s;
}
location /api/payment/v1.0/wechat_jsapi_payment/ {
proxy_pass http://rppaycenter;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Host $host;
proxy_set_header Real-IP $remote_addr;
proxy_read_timeout 300s;
}
location /partner/cashiers/payment {
proxy_pass http://rppaycenter;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Host $host;
proxy_set_header Real-IP $remote_addr;
proxy_read_timeout 300s;
}
location /client/goods {
proxy_pass http://rppaycenter;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Host $host;
proxy_set_header Real-IP $remote_addr;
proxy_read_timeout 300s;
}
location /goods/payment {
proxy_pass http://rppaycenter;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Host $host;
proxy_set_header Real-IP $remote_addr;
proxy_read_timeout 300s;
}
location /dev/status {
proxy_pass http://rppaycenter;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Host $host;
proxy_set_header Real-IP $remote_addr;
proxy_read_timeout 300s;
}
location / {
proxy_pass http://rpmanage;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Host $host;
proxy_set_header Real-IP $remote_addr;
proxy_read_timeout 300s;
}
}

@ -0,0 +1,12 @@
upstream rpmanage{
server ${MANAGE_SVC};
}
upstream rppaycenter{
server ${PAYCENTER_SVC};
}
upstream rptrans{
server ${TRANS_SVC};
}
upstream rpgateway{
server ${GTWAY_SVC};
}
Loading…
Cancel
Save