Merge branch 'develop'

master
luoyang 5 years ago
commit 2b2fd28573

@ -5,7 +5,7 @@
<parent>
<groupId>au.com.royalpay.payment</groupId>
<artifactId>payment-parent</artifactId>
<version>1.0.13</version>
<version>1.1.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@ -51,10 +51,6 @@
<groupId>au.com.royalpay.payment</groupId>
<artifactId>yeepay-core</artifactId>
</dependency>
<dependency>
<groupId>au.com.royalpay.payment</groupId>
<artifactId>lakala-core</artifactId>
</dependency>
<dependency>
<groupId>au.com.royalpay.payment</groupId>
<artifactId>bestpay-core</artifactId>
@ -179,7 +175,6 @@
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.2.4</version>
</dependency>
<!--jpush end -->

@ -9,7 +9,7 @@ import au.com.royalpay.payment.tools.secure.impls.ApplyFirewallCheckInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import javax.annotation.Resource;
@ -17,7 +17,7 @@ import javax.annotation.Resource;
* Created by yixian on 2016-06-24.
*/
@Configuration
public class WebConfiguration extends WebMvcConfigurerAdapter {
public class WebConfiguration implements WebMvcConfigurer {
@Resource
private RequestInfoInterceptor requestInfoInterceptor;
@Resource
@ -38,7 +38,6 @@ public class WebConfiguration extends WebMvcConfigurerAdapter {
registry.addInterceptor(alipayUserInterceptor);
registry.addInterceptor(consumersInterceptor);
registry.addInterceptor(applyFirewallCheckInterceptor());
super.addInterceptors(registry);
}
@Bean

@ -3,16 +3,16 @@ package au.com.royalpay.payment.manage;
import au.com.royalpay.payment.tools.websocket.FastJsonSockJsMessageCodec;
import org.springframework.context.annotation.Configuration;
import org.springframework.messaging.simp.config.MessageBrokerRegistry;
import org.springframework.web.socket.config.annotation.AbstractWebSocketMessageBrokerConfigurer;
import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker;
import org.springframework.web.socket.config.annotation.StompEndpointRegistry;
import org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer;
/**
* Created by yixian on 2016-07-01.
*/
@Configuration
@EnableWebSocketMessageBroker
public class WebSocketConfig extends AbstractWebSocketMessageBrokerConfigurer {
public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {
@Override
public void configureMessageBroker(MessageBrokerRegistry registry) {
registry.enableSimpleBroker("/app");

@ -3,7 +3,7 @@ package au.com.royalpay.payment.manage.analysis.beans;
import au.com.royalpay.payment.core.exceptions.ParamInvalidException;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.time.DateUtils;
import org.hibernate.validator.constraints.NotEmpty;
import javax.validation.constraints.NotEmpty;
import java.math.BigDecimal;

@ -5,7 +5,7 @@ import au.com.royalpay.payment.tools.exceptions.BadRequestException;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.time.DateUtils;
import org.hibernate.validator.constraints.NotEmpty;
import javax.validation.constraints.NotEmpty;
import java.text.ParseException;
import java.util.Calendar;

@ -2,10 +2,8 @@ package au.com.royalpay.payment.manage.analysis.beans.ato;
import org.apache.commons.lang3.time.DateUtils;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
/**
* Create by yixian at 2018-08-30 21:13
@ -23,7 +21,7 @@ public class ReportingPartyData implements ATOBulkLine {
private ContactInfo contactInfo;
private String softwareProductType;
private Map<Integer, BusinessData> businesses = new HashMap<>();
private Map<Integer, BusinessData> businesses = new ConcurrentHashMap<>();
public ReportingPartyData(Date periodStart, Date periodEnd, String abn, String branchNumber, String registerName, String softwareProductType) {
this.periodStart = DateUtils.truncate(periodStart, Calendar.DATE);

@ -138,7 +138,7 @@ public class ClientRatesAnalysisServiceImpl implements ClientRatesAnalysisServic
@Override
public JSONObject listClientRatesOfBDUser(String bdId, ClientRateQueryBean query) {
JSONObject manager = managerMapper.findDetail(bdId);
Assert.notNull(manager);
Assert.notNull(manager, "bd not found");
JSONObject clientQueryParams = new JSONObject();
clientQueryParams.put("bd_id", bdId);

@ -97,14 +97,14 @@ public class EstimateAnalysisServiceImpl implements EstimateAnalysisService {
List<JSONObject> settleReport = new ArrayList<>();
//今天
Calendar calendar = Calendar.getInstance();
Calendar calendar = Calendar.getInstance();
calendar.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai"));
//如果是周一,显示周五的数据
Calendar cal=Calendar.getInstance();
Calendar cal = Calendar.getInstance();
cal.setTime(new Date());
int week=cal.get(Calendar.DAY_OF_WEEK);
if (week ==2) {
int week = cal.get(Calendar.DAY_OF_WEEK);
if (week == 2) {
cal.add(Calendar.DATE, -3);
}
Date todayDate = new Date();
@ -228,13 +228,13 @@ public class EstimateAnalysisServiceImpl implements EstimateAnalysisService {
//预计到账金额
Calendar cal = Calendar.getInstance();
cal.setTime(date);
cal.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DAY_OF_MONTH)-1, 0, 0, 0);
cal.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DAY_OF_MONTH) - 1, 0, 0, 0);
Date datefrom = cal.getTime();
if (new Date().getDate() == datefrom.getDate()) {
if (DateUtils.isSameDay(new Date(), datefrom)) {
JSONObject params = new JSONObject();
params.put("datefrom", DateFormatUtils.format(datefrom, "yyyy-MM-dd HH:mm:ss"));
params.put("dateto", DateFormatUtils.format(DateUtils.addDays(datefrom, 1),"yyyy-MM-dd HH:mm:ss"));
params.put("dateto", DateFormatUtils.format(DateUtils.addDays(datefrom, 1), "yyyy-MM-dd HH:mm:ss"));
List<JSONObject> lastDayClearingAmount = transactionMapper.getLastDaytransAmount(params);
BigDecimal total_clearing = BigDecimal.ZERO;
@ -258,7 +258,7 @@ public class EstimateAnalysisServiceImpl implements EstimateAnalysisService {
String end_date = maxDays.getString("date_str");
JSONObject cleanDays = estimateAnalysisMapper.findLastCleanDays(endStr, 1);
List<JSONObject> tencentSettle = platformSettlementMapper.findBySettleDate(new Date(maxDays.getDate("date_str").getTime() - 86400000L), "Wechat");
if (tencentSettle != null && tencentSettle.size()>0) {
if (tencentSettle != null && tencentSettle.size() > 0) {
for (JSONObject logs : tencentSettle) {
dayInfo.put("settlementFee_" + logs.getString("merchants"), logs.getBigDecimal("settlement_fee"));
if (!dayInfo.containsKey("platformGetSettleFee")) {
@ -273,7 +273,7 @@ public class EstimateAnalysisServiceImpl implements EstimateAnalysisService {
try {
tencentSettleList = mpPaymentApi.settlementLogs(new Date(maxDays.getDate("date_str").getTime() - 86400000L), new Date(maxDays.getDate("date_str").getTime() - 86400000L), mch.getMerchantId());
if (tencentSettle == null || tencentSettleList.size()<=0) {
if (tencentSettle == null || tencentSettleList.size() <= 0) {
logger.info("EstimateAnalysisServiceImpl.getDaySettleInfo ======>【" + mch.getMerchantId() + "】下没有清算记录");
} else {
for (SettlementLog settle : tencentSettleList) {
@ -294,19 +294,19 @@ public class EstimateAnalysisServiceImpl implements EstimateAnalysisService {
}
List<JSONObject> hfSettle = platformSettlementMapper.findBySettleDate(new Date(estimateAnalysisMapper.findLastCleanDays(end_date, 1).getDate("date_str").getTime()), "hf");
if (hfSettle !=null && hfSettle.size()>0) {
if (hfSettle != null && hfSettle.size() > 0) {
for (JSONObject logs : hfSettle) {
dayInfo.put("hfSettleFee_" + logs.getString("merchants"), logs.getBigDecimal("settlement_fee"));
dayInfo.put("platformGetSettleFee",dayInfo.getBigDecimal("hfSettleFee_" + logs.getString("merchants")));
dayInfo.put("platformGetSettleFee", dayInfo.getBigDecimal("hfSettleFee_" + logs.getString("merchants")));
}
}else {
dayInfo.put("platformGetSettleFee",BigDecimal.ZERO);
} else {
dayInfo.put("platformGetSettleFee", BigDecimal.ZERO);
}
List<JSONObject> alipaySettleLogs = platformSettlementMapper.findBySettleDate(new Date(estimateAnalysisMapper.findLastCleanDays(end_date, 1).getDate("date_str").getTime()), "Alipay");
for (JSONObject logs : alipaySettleLogs) {
dayInfo.put("aliSettleFee_" + logs.getString("merchants"), logs.getBigDecimal("settlement_fee"));
dayInfo.put("platformGetSettleFee",dayInfo.getBigDecimal("platformGetSettleFee").add(dayInfo.getBigDecimal("aliSettleFee_" + logs.getString("merchants"))));
dayInfo.put("platformGetSettleFee", dayInfo.getBigDecimal("platformGetSettleFee").add(dayInfo.getBigDecimal("aliSettleFee_" + logs.getString("merchants"))));
}
List<JSONObject> alipayOnlineSettleLogs = platformSettlementMapper.findBySettleDate(new Date(estimateAnalysisMapper.findLastCleanDays(end_date, 1).getDate("date_str").getTime()), "AlipayOnline");
@ -322,7 +322,7 @@ public class EstimateAnalysisServiceImpl implements EstimateAnalysisService {
@Override
public void generateSettleAmount() {
String report_date = DateFormatUtils.format(DateUtils.addDays(new Date(),-1), "yyyy/MM/dd");
String report_date = DateFormatUtils.format(DateUtils.addDays(new Date(), -1), "yyyy/MM/dd");
logger.info("系统开始生成[ " + report_date + " ]清算总额");
JSONObject isClearDay = estimateAnalysisMapper.checkIsClearDay(report_date);
@ -343,7 +343,8 @@ public class EstimateAnalysisServiceImpl implements EstimateAnalysisService {
estimateAnalysisMapper.save(estimate);
logger.info("系统自动生成[ " + report_date + " ]清算总额更新完毕");
}}
}
}
}
@Override
@ -358,7 +359,7 @@ public class EstimateAnalysisServiceImpl implements EstimateAnalysisService {
estimate.put("log_type", 2);
estimate.put("last_update_by", "System Auto Generat Transaction Logs");
JSONObject estimateExit = estimateAnalysisMapper.findByLogDate(start_date,2);
JSONObject estimateExit = estimateAnalysisMapper.findByLogDate(start_date, 2);
if (estimateExit != null) {
estimate.put("estimate_id", estimateExit.getString("estimate_id"));
estimateAnalysisMapper.update(estimate);
@ -375,7 +376,7 @@ public class EstimateAnalysisServiceImpl implements EstimateAnalysisService {
public List<JSONObject> listEstimateLog(int logType, String date) {
Date monthDate;
try {
monthDate = DateUtils.parseDate(date, new String[] { "yyyy-MM" });
monthDate = DateUtils.parseDate(date, new String[]{"yyyy-MM"});
} catch (ParseException e) {
throw new BadRequestException("Invalid month format");
}
@ -398,7 +399,7 @@ public class EstimateAnalysisServiceImpl implements EstimateAnalysisService {
estimate.put("last_update_date", new Date());
estimate.put("last_update_by", "developer import");
estimate.put("log_type", 1);
JSONObject estimateExit = estimateAnalysisMapper.findByLogDate(report_date,1);
JSONObject estimateExit = estimateAnalysisMapper.findByLogDate(report_date, 1);
if (estimateExit != null) {
estimate.put("estimate_id", estimateExit.getString("estimate_id"));
@ -417,7 +418,7 @@ public class EstimateAnalysisServiceImpl implements EstimateAnalysisService {
JSONObject estimate = getTransactionAmountDaily(start_date, end_date);
estimate.put("last_update_date", new Date());
estimate.put("last_update_by", "developer import");
JSONObject estimateExit = estimateAnalysisMapper.findByLogDate(start_date,2);
JSONObject estimateExit = estimateAnalysisMapper.findByLogDate(start_date, 2);
estimate.put("log_type", 2);
if (estimateExit != null) {
estimate.put("estimate_id", estimateExit.getString("estimate_id"));

@ -2,7 +2,7 @@ package au.com.royalpay.payment.manage.appclient.beans;
import au.com.royalpay.payment.manage.signin.beans.LoginInfo;
import au.com.royalpay.payment.tools.utils.PasswordUtils;
import org.hibernate.validator.constraints.NotEmpty;
import javax.validation.constraints.NotEmpty;
/**
* Created by yixian on 2016-12-14.

@ -208,5 +208,5 @@ public interface RetailAppService {
void deleteGreenChannelAuthFiles(JSONObject device, String filesInfo);
void commitAuthFilesToCompliance(JSONObject device);
void commitAuthFilesToCompliance(JSONObject device,JSONObject photoInfo);
}

@ -42,7 +42,7 @@ import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
import org.thymeleaf.context.Context;
import org.thymeleaf.spring4.SpringTemplateEngine;
import org.thymeleaf.spring5.SpringTemplateEngine;
import javax.annotation.Resource;
import java.math.BigDecimal;

@ -49,6 +49,7 @@ import au.com.royalpay.payment.tools.device.message.AppMsgSender;
import au.com.royalpay.payment.tools.device.support.DeviceRegister;
import au.com.royalpay.payment.tools.env.PlatformEnvironment;
import au.com.royalpay.payment.tools.env.RequestEnvironment;
import au.com.royalpay.payment.tools.env.SysConfigManager;
import au.com.royalpay.payment.tools.exceptions.BadRequestException;
import au.com.royalpay.payment.tools.exceptions.ForbiddenException;
import au.com.royalpay.payment.tools.exceptions.NotFoundException;
@ -87,7 +88,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert;
import org.springframework.web.multipart.MultipartFile;
import org.thymeleaf.context.Context;
import org.thymeleaf.spring4.SpringTemplateEngine;
import org.thymeleaf.spring5.SpringTemplateEngine;
import java.awt.image.BufferedImage;
import java.io.*;
@ -208,6 +209,8 @@ public class RetailAppServiceImp implements RetailAppService {
@Resource
private ClientBankAccountMapper clientBankAccountMapper;
@Resource
private SysConfigManager sysConfigManager;
@Resource
private StringRedisTemplate stringRedisTemplate;
private final String CBBANK_AGGREGATE_FILE = "https://file.royalpay.com.au/open/2019/08/05/1564972204689_uwZvpTBjtLUMcN8c540xcZvux1Rd3O.pdf";
private final String IMG_AGGREGATE_FILE = "https://file.royalpay.com.au/open/2019/08/22/1566440384256_R7Jc3cl5JPZsmVznKffzStwVMELwsl.pdf";
@ -2269,6 +2272,8 @@ public class RetailAppServiceImp implements RetailAppService {
client.put("wechat_rate", weChatRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN));
client.put("clean", "T+" + weChatRate.getString("clean_days"));
client.put("clean_days", weChatRate.getString("clean_days"));
String rateConfig = sysConfigManager.getSysConfig().getString("sys_rates");
JSONObject sysConfigRate = JSONObject.parseObject(rateConfig);
try {
JSONObject alipayRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Alipay");
@ -2276,16 +2281,6 @@ public class RetailAppServiceImp implements RetailAppService {
client.put("alipay_rate", alipayRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN));
}
JSONObject bestPayRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Bestpay");
if (bestPayRate != null) {
client.put("bestpay_rate", bestPayRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN));
}
JSONObject jdRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "jd");
if (jdRate != null) {
client.put("jd_rate", jdRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN));
}
JSONObject alipayOnlineRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "AlipayOnline");
if (alipayOnlineRate != null) {
client.put("alipay_online_rate", alipayOnlineRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN));
@ -2299,6 +2294,22 @@ public class RetailAppServiceImp implements RetailAppService {
throw new BadRequestException("Merchant Rate Not Configure,Please Contact Customer Service");
}
try {
JSONObject bestPayRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Bestpay");
if (bestPayRate != null) {
client.put("bestpay_rate", bestPayRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN));
}
JSONObject jdRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "jd");
if (jdRate != null) {
client.put("jd_rate", jdRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN));
}
} catch (Exception ignored) {
JSONObject rate = sysConfigRate.getJSONObject("t" + weChatRate.getString("clean_days"));
client.put("bestpay_rate", rate.getBigDecimal("Bestpay").setScale(2, BigDecimal.ROUND_DOWN));
client.put("jd_rate", rate.getBigDecimal("JDpay").setScale(2, BigDecimal.ROUND_DOWN));
}
JSONObject bankAccount = getBankAccountByClientId(client.getIntValue("client_id"));
if (bankAccount == null || bankAccount.size() <= 0) {
throw new BadRequestException("The Partner's Account is not config!");
@ -2349,11 +2360,12 @@ public class RetailAppServiceImp implements RetailAppService {
}
@Override
public void commitAuthFilesToCompliance(JSONObject device) {
public void commitAuthFilesToCompliance(JSONObject device, JSONObject photoInfo) {
String clientType = device.getString("client_type");
deviceSupport.findRegister(clientType);
JSONObject client = clientManager.getClientInfo(device.getIntValue("client_id"));
JSONObject account = clientAccountMapper.findById(device.getString("account_id"));
account.put("photo_info", photoInfo);
clientManager.commitAuthFilesToCompliance(client.getString("client_moniker"), account,"App");
}

@ -781,7 +781,16 @@ public class RetailAppController {
*/
@RequestMapping(value = "/client/auth_file/commit_to_compliance", method = RequestMethod.POST)
public void commitToComplianceAuthFiles(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device){
retailAppService.commitAuthFilesToCompliance(device);
retailAppService.commitAuthFilesToCompliance(device, null);
}
/**
*
* @param device
* @params photoInfo
*/
@RequestMapping(value = "/client/auth_file/commit_to_compliance_new", method = RequestMethod.POST)
public void commitToComplianceAuthFiles(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @RequestBody JSONObject photoInfo){
retailAppService.commitAuthFilesToCompliance(device, photoInfo);
}
}

@ -4,7 +4,7 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.hibernate.validator.constraints.NotEmpty;
import javax.validation.constraints.NotEmpty;
import java.util.ArrayList;
import java.util.List;

@ -3,7 +3,7 @@ package au.com.royalpay.payment.manage.application.beans;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.hibernate.validator.constraints.NotEmpty;
import javax.validation.constraints.NotEmpty;
/**
* Created by yuan on 2018/5/23.

@ -3,7 +3,7 @@ package au.com.royalpay.payment.manage.application.beans;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.annotation.JSONField;
import org.hibernate.validator.constraints.NotEmpty;
import javax.validation.constraints.NotEmpty;
/**
* Created by yishuqian on 02/03/2017.

@ -3,7 +3,8 @@ package au.com.royalpay.payment.manage.application.core;
import au.com.royalpay.payment.manage.merchants.beans.NewAccountBean;
import com.alibaba.fastjson.JSONObject;
import org.apache.catalina.servlet4preview.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequest;
public interface SimpleClientApplyService {
void verifyRegisterSMSCode(String codeKey, String phoneNumber);

@ -26,7 +26,6 @@ import au.com.royalpay.payment.tools.utils.PasswordUtils;
import com.alibaba.fastjson.JSONObject;
import org.apache.catalina.servlet4preview.http.HttpServletRequest;
import org.apache.commons.lang3.RandomStringUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils;
@ -37,7 +36,6 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.RequestMethod;
import org.thymeleaf.context.Context;
import org.thymeleaf.spring4.SpringTemplateEngine;
import java.io.IOException;
import java.net.URISyntaxException;
@ -49,9 +47,11 @@ import java.util.stream.Collectors;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import cn.yixblog.platform.http.HttpRequestGenerator;
import cn.yixblog.platform.http.HttpRequestResult;
import org.thymeleaf.spring5.SpringTemplateEngine;
@Service
public class SimpleClientApplyServiceImpl implements SimpleClientApplyService {

@ -3,28 +3,15 @@ package au.com.royalpay.payment.manage.application.web;
import au.com.royalpay.payment.manage.application.beans.ClientPreApplyBean;
import au.com.royalpay.payment.manage.application.beans.ClientPreApplyStep1Bean;
import au.com.royalpay.payment.manage.application.core.SimpleClientApplyService;
import au.com.royalpay.payment.manage.notice.core.MailService;
import au.com.royalpay.payment.tools.env.SysConfigManager;
import com.alibaba.fastjson.JSONObject;
import org.apache.catalina.servlet4preview.http.HttpServletRequest;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import org.thymeleaf.context.Context;
import org.thymeleaf.spring4.SpringTemplateEngine;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
import java.io.IOException;
import java.net.URISyntaxException;
@RestController
@RequestMapping("/register")

@ -5,7 +5,7 @@ import au.com.royalpay.payment.core.exceptions.ParamInvalidException;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.time.DateUtils;
import org.hibernate.validator.constraints.NotEmpty;
import javax.validation.constraints.NotEmpty;
import java.text.DateFormat;
import java.text.ParseException;

@ -2,7 +2,7 @@ package au.com.royalpay.payment.manage.cashiers.beans;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.hibernate.validator.constraints.NotEmpty;
import javax.validation.constraints.NotEmpty;
/**
* Created by yishuqian on 20/12/2016.

@ -23,6 +23,7 @@ public class CashierOrderServiceImp implements CashierOrderService {
private CashierMapper cashierMapper;
@Resource
private CashierOrderMapper cashierOrderMapper;
@Override
public JSONObject listCashierOrders(JSONObject partner, CashierQueryBean query) {
String timezone = partner.getJSONObject("client").getString("timezone");
@ -36,7 +37,7 @@ public class CashierOrderServiceImp implements CashierOrderService {
@Override
public JSONObject listCashierOrders(String cashier_id, JSONObject partner, CashierQueryBean query) {
JSONObject cashier = cashierMapper.findOne(cashier_id);
Assert.notNull(cashier);
Assert.notNull(cashier, "cashier not found");
String timezone = partner.getJSONObject("client").getString("timezone");
JSONObject params = query.params(timezone);
params.put("client_id", partner.getIntValue("client_id"));

@ -68,7 +68,7 @@ public class CashierServiceImp implements CashierService {
@Override
public void updateCashier(JSONObject partner, String cashier_id, CashierBean info) {
JSONObject cashier = cashierMapper.findOne(cashier_id);
Assert.notNull(cashier);
Assert.notNull(cashier, "cashier not found");
if (partner.getIntValue("client_id") != cashier.getIntValue("client_id")) {
throw new ForbiddenException("You have no permission!");
}
@ -85,13 +85,13 @@ public class CashierServiceImp implements CashierService {
@Override
public JSONObject getCashierByCashierId(String cashier_id, JSONObject partner) {
JSONObject cashier = cashierMapper.findOne(cashier_id);
Assert.notNull(cashier);
Assert.notNull(cashier, "cashier not found");
if (partner.getIntValue("client_id") != cashier.getIntValue("client_id")) {
throw new ForbiddenException("You have no permission!");
}
String url = PlatformEnvironment.getEnv().concatUrl("/partner/cashiers/payment/" + partner.getString("client_moniker") + "/" + cashier_id + "/qr_pay");
cashier.put("url", url);
cashier.put("qrcode", QRCodeUtils.qrcodeImageCode(url, 250,false));
cashier.put("qrcode", QRCodeUtils.qrcodeImageCode(url, 250, false));
return cashier;
}
@ -116,7 +116,7 @@ public class CashierServiceImp implements CashierService {
throw new BadRequestException("Invalid Cashier");
}
JSONObject cashier = cashierMapper.findOne(cashier_id);
Assert.notNull(cashier);
Assert.notNull(cashier, "cashier not found");
cashier.put("wechat_openid", wechat.getString("wepay_openid"));
cashier.put("nick_name", wechat.getString("nickname"));
cashier.put("headimgurl", wechat.getString("headimgurl"));

@ -1,9 +1,9 @@
package au.com.royalpay.payment.manage.citypartner.beans;
import com.alibaba.fastjson.JSONObject;
import org.hibernate.validator.constraints.Email;
import javax.validation.constraints.Email;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;
import javax.validation.constraints.NotBlank;
/**
* Created by yixian on 2017-01-23.

@ -6,6 +6,8 @@ import au.com.royalpay.payment.manage.complianceAudit.bean.ClientComplianceQuery
import au.com.royalpay.payment.manage.complianceAudit.core.ClientComplianceApply;
import au.com.royalpay.payment.manage.mappers.system.ClientComplianceCompanyMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientFilesMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientMapper;
import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import au.com.royalpay.payment.tools.exceptions.BadRequestException;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import au.com.royalpay.payment.tools.utils.PageListUtils;
@ -13,6 +15,7 @@ import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.Order;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import org.apache.commons.lang3.StringUtils;
import org.omg.CORBA.SystemException;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -31,6 +34,10 @@ public class ClientComplianceApplyImpl implements ClientComplianceApply
private ClientComplianceCompanyMapper clientComplianceCompanyMapper;
@Resource
private ClientFilesMapper clientFilesMapper;
@Resource
private ClientManager clientManager;
@Resource
private ClientMapper clientMapper;
@Override
public JSONObject listClientComplianceApply(JSONObject manager, ClientComplianceQuery applyQuery) {
@ -88,6 +95,24 @@ public class ClientComplianceApplyImpl implements ClientComplianceApply
complianceDetail.put("description",' ');
clientComplianceCompanyMapper.update(complianceDetail);
clientFilesMapper.passCompliance(clientId);
JSONObject client = clientManager.getClientInfo(clientId);
boolean clientChanged = false;
if (StringUtils.isNotBlank(complianceDetail.getString("company_photo"))) {
client.put("company_photo", complianceDetail.getString("company_photo"));
clientChanged = true;
}
if (StringUtils.isNotBlank(complianceDetail.getString("store_photo"))) {
client.put("store_photo", complianceDetail.getString("store_photo"));
clientChanged = true;
}
if (StringUtils.isNotBlank(complianceDetail.getString("company_website"))) {
client.put("company_website", complianceDetail.getString("company_website"));
clientChanged = true;
}
if (clientChanged) {
clientMapper.update(client);
}
}
@Override

@ -3,7 +3,7 @@ package au.com.royalpay.payment.manage.customers.beans;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.annotation.JSONField;
import org.hibernate.validator.constraints.NotEmpty;
import javax.validation.constraints.NotEmpty;
import java.util.Date;

@ -3,7 +3,7 @@ package au.com.royalpay.payment.manage.customers.beans;
import au.com.royalpay.payment.tools.exceptions.BadRequestException;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.annotation.JSONField;
import org.hibernate.validator.constraints.NotEmpty;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;

@ -2,7 +2,7 @@ package au.com.royalpay.payment.manage.customers.beans;
import au.com.royalpay.payment.core.exceptions.ParamInvalidException;
import org.apache.commons.lang3.StringUtils;
import org.hibernate.validator.constraints.NotEmpty;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;

@ -4,7 +4,7 @@ import au.com.royalpay.payment.core.exceptions.ParamInvalidException;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.hibernate.validator.constraints.NotEmpty;
import javax.validation.constraints.NotEmpty;
import java.text.DateFormat;
import java.text.ParseException;

@ -3,7 +3,7 @@ package au.com.royalpay.payment.manage.dev.bean;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.annotation.JSONField;
import org.hibernate.validator.constraints.NotEmpty;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;
/**

@ -2,7 +2,7 @@ package au.com.royalpay.payment.manage.dev.bean;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.hibernate.validator.constraints.NotEmpty;
import javax.validation.constraints.NotEmpty;
/**
* Created by yuan on 2017/9/7.

@ -25,6 +25,7 @@ import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
@ -39,7 +40,7 @@ public class MerchantLocationServiceImpl implements MerchantLocationService {
private ThreadPoolExecutor pool = new ThreadPoolExecutor(5, 100, 5, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>());
private Set<Integer> failureSet = new ConcurrentSet<>();
private Set<Integer> failureSet = ConcurrentHashMap.newKeySet();
@Resource
private ClientLocationsMapper clientLocationsMapper;

@ -282,6 +282,17 @@ public class TestController implements ApplicationEventPublisherAware {
return list.isEmpty() ? new JSONObject() : list.get(0);
}
@ManagerMapping(value = "/fix_transaction/{orderId}", method = RequestMethod.PUT, role = ManagerRole.DEVELOPER)
public void fixTransactionsByOrderId(@PathVariable String orderId) {
JSONObject order = orderMapper.find(orderId);
try {
String orderChannel = StringUtils.defaultIfEmpty(order.getString("order_channel"), order.getString("channel"));
paymentApi.checkOrderStatus(order.getString("order_id"), orderChannel, true);
} catch (Exception e) {
logger.error("fix transaction error:" + order.getString("order_id"));
}
}
@ManagerMapping(value = "/fix_transaction", method = RequestMethod.PUT, role = ManagerRole.DEVELOPER)
public void fixTransactions() {
List<JSONObject> orders = orderMapper.listOrdersWithNoTransactions();

@ -2,7 +2,7 @@ package au.com.royalpay.payment.manage.goods.bean;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.hibernate.validator.constraints.NotEmpty;
import javax.validation.constraints.NotEmpty;
import java.util.List;

@ -3,7 +3,7 @@ package au.com.royalpay.payment.manage.logview.beans;
import au.com.royalpay.payment.core.exceptions.ParamInvalidException;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.time.DateUtils;
import org.hibernate.validator.constraints.NotEmpty;
import javax.validation.constraints.NotEmpty;
import java.text.DateFormat;
import java.text.ParseException;

@ -64,7 +64,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert;
import org.springframework.util.CollectionUtils;
import org.thymeleaf.context.Context;
import org.thymeleaf.spring4.SpringTemplateEngine;
import org.thymeleaf.spring5.SpringTemplateEngine;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;

@ -6,6 +6,7 @@ import cn.yixblog.support.mybatis.autosql.annotations.AutoSql;
import cn.yixblog.support.mybatis.autosql.annotations.SqlType;
import com.alibaba.fastjson.JSONObject;
import org.apache.ibatis.annotations.Param;
import org.springframework.core.annotation.Order;
import java.util.List;
@ -32,8 +33,6 @@ public interface ClientFilesMapper {
@AdvanceSelect(addonWhereClause = "is_valid = 1 and (status = 0 or status = 3) and file_name='client_agree_file'")
List<JSONObject> findClientAggreeFileCommit(@Param("client_id") int clientId);
@AutoSql(type = SqlType.SELECT)
@AdvanceSelect(addonWhereClause = "is_valid = 1")
List<JSONObject> findAllClientFile(@Param("client_id") int clientId);
@AutoSql(type = SqlType.SELECT)

@ -3,7 +3,7 @@ package au.com.royalpay.payment.manage.merchants.beans;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.annotation.JSONField;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotEmpty;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;

@ -3,7 +3,7 @@ package au.com.royalpay.payment.manage.merchants.beans;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.annotation.JSONField;
import org.hibernate.validator.constraints.NotEmpty;
import javax.validation.constraints.NotEmpty;
/**
* Created by yixian on 2016-06-29.

@ -4,7 +4,7 @@ import au.com.royalpay.payment.tools.exceptions.BadRequestException;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.annotation.JSONField;
import org.apache.commons.lang3.time.DateUtils;
import org.hibernate.validator.constraints.NotEmpty;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Calendar;

@ -3,7 +3,7 @@ package au.com.royalpay.payment.manage.merchants.beans;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.annotation.JSONField;
import org.hibernate.validator.constraints.NotEmpty;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;

@ -3,7 +3,7 @@ package au.com.royalpay.payment.manage.merchants.beans;
import au.com.royalpay.payment.tools.permission.enums.PartnerRole;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.annotation.JSONField;
import org.hibernate.validator.constraints.NotEmpty;
import javax.validation.constraints.NotEmpty;
/**
* Created by yixian on 2016-07-02.

@ -3,7 +3,7 @@ package au.com.royalpay.payment.manage.merchants.beans;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.annotation.JSONField;
import org.hibernate.validator.constraints.NotEmpty;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;

@ -5,7 +5,7 @@ import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.annotation.JSONField;
import org.apache.commons.lang3.StringUtils;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;
import javax.validation.constraints.NotBlank;
/**
* Created by yuan on 2018/1/19.

@ -107,7 +107,7 @@ import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.multipart.MultipartFile;
import org.thymeleaf.context.Context;
import org.thymeleaf.spring4.SpringTemplateEngine;
import org.thymeleaf.spring5.SpringTemplateEngine;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
@ -2036,7 +2036,24 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
throw new InvalidShortIdException();
}
JSONObject file = signInAccountService.checkAuthFileStatus(client);
file.put("file_company", clientComplianceCompanyMapper.findFileByClientId(account.getIntValue("client_id")));
JSONObject compliance = clientComplianceCompanyMapper.findFileByClientId(account.getIntValue("client_id"));
file.put("file_company", compliance);
JSONObject photoInfo = new JSONObject();
photoInfo.put("company_photo", client.getString("company_photo"));
photoInfo.put("store_photo", client.getString("store_photo"));
photoInfo.put("web_site", client.getString("company_website"));
if (compliance != null) {
if (StringUtils.isNotBlank(compliance.getString("company_photo"))) {
photoInfo.put("company_photo", compliance.getString("company_photo"));
}
if (StringUtils.isNotBlank(compliance.getString("store_photo"))) {
photoInfo.put("store_photo", compliance.getString("store_photo"));
}
if (StringUtils.isNotBlank(compliance.getString("company_website"))) {
photoInfo.put("web_site", compliance.getString("company_website"));
}
}
file.put("photo_info", photoInfo);
return file;
}
@ -2066,6 +2083,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
client.put("wechat_rate", weChatRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN));
client.put("clean", "T+" + weChatRate.getString("clean_days"));
client.put("clean_days", weChatRate.getString("clean_days"));
String rateConfig = sysConfigManager.getSysConfig().getString("sys_rates");
JSONObject sysConfigRate = JSONObject.parseObject(rateConfig);
try {
JSONObject alipayRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Alipay");
@ -2073,16 +2092,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
client.put("alipay_rate", alipayRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN));
}
JSONObject bestPayRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Bestpay");
if (bestPayRate != null) {
client.put("bestpay_rate", bestPayRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN));
}
JSONObject jdRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "jd");
if (jdRate != null) {
client.put("jd_rate", jdRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN));
}
JSONObject alipayOnlineRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "AlipayOnline");
if (alipayOnlineRate != null) {
client.put("alipay_online_rate", alipayOnlineRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN));
@ -2093,7 +2102,23 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
client.put("cbbank_rate", cbBankPayRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN));
}
} catch (Exception ignored) {
throw new BadRequestException("Merchant Rate Not Configure");
throw new BadRequestException("Merchant Rate Not Configure,Please Contact Customer Service");
}
try {
JSONObject bestPayRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Bestpay");
if (bestPayRate != null) {
client.put("bestpay_rate", bestPayRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN));
}
JSONObject jdRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "jd");
if (jdRate != null) {
client.put("jd_rate", jdRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN));
}
} catch (Exception ignored) {
JSONObject rate = sysConfigRate.getJSONObject("t" + weChatRate.getString("clean_days"));
client.put("bestpay_rate", rate.getBigDecimal("Bestpay").setScale(2, BigDecimal.ROUND_DOWN));
client.put("jd_rate", rate.getBigDecimal("JDpay").setScale(2, BigDecimal.ROUND_DOWN));
}
JSONObject bankAccount = getBankAccountByClientId(client.getIntValue("client_id"));
@ -2940,7 +2965,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
file.put("file_id", existFile.getString("file_id"));
clientFilesMapper.update(file);
}
if (!renewal && client.getIntValue("source") != 4) {
if (!renewal) {
clientModifySupport.processClientModify(new OpenStatusModify(manager, clientMoniker, 2));
}
@ -3329,6 +3354,10 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
@Transactional
public void commitAuthFilesToCompliance(String clientMoniker, JSONObject account, String source) {
JSONObject client = getClientInfoByMoniker(clientMoniker);
String clientPayType = "";
String companyPhoto = "";
String storePhoto= "";
String webSite= "";
int sourceEnum = 2;
if (client == null) {
throw new InvalidShortIdException();
@ -3353,13 +3382,21 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
if ("app".equals(source.toLowerCase())) {
sourceEnum = 1;
}
JSONObject photoInfo = account.getJSONObject("photo_info");
if (photoInfo != null) {
companyPhoto = photoInfo.getString("company_photo");
storePhoto = photoInfo.getString("store_photo");
webSite = photoInfo.getString("web_site");
}
JSONObject fileComp = clientComplianceCompanyMapper.findFileByClientId(client.getIntValue("client_id"));
if (fileComp == null) {
fileComp = new JSONObject();
fileComp.put("client_id", client.getIntValue("client_id"));
fileComp.put("submit_time", new Date());
fileComp.put("status", 0);
fileComp.put("company_photo", companyPhoto);
fileComp.put("store_photo", storePhoto);
fileComp.put("company_website", webSite);
fileComp.put("source", sourceEnum);
fileComp.put("commit_by_id", account.getString("account_id"));
clientComplianceCompanyMapper.save(fileComp);
@ -3367,6 +3404,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
} else if (fileComp.getIntValue("status") == 2) {
fileComp.put("status", 0);
fileComp.put("submit_time", new Date());
fileComp.put("company_photo", companyPhoto);
fileComp.put("store_photo", storePhoto);
fileComp.put("company_website", webSite);
fileComp.put("source", sourceEnum);
fileComp.put("commit_by_id", account.getString("account_id"));
clientComplianceCompanyMapper.update(fileComp);
@ -3403,6 +3443,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
client.put("wechat_rate", weChatRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN));
client.put("clean", "T+" + weChatRate.getString("clean_days"));
client.put("clean_days", weChatRate.getString("clean_days"));
String rateConfig = sysConfigManager.getSysConfig().getString("sys_rates");
JSONObject sysConfigRate = JSONObject.parseObject(rateConfig);
try {
JSONObject alipayRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Alipay");
@ -3410,16 +3452,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
client.put("alipay_rate", alipayRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN));
}
JSONObject bestPayRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Bestpay");
if (bestPayRate != null) {
client.put("bestpay_rate", bestPayRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN));
}
JSONObject jdRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "jd");
if (jdRate != null) {
client.put("jd_rate", jdRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN));
}
JSONObject alipayOnlineRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "AlipayOnline");
if (alipayOnlineRate != null) {
client.put("alipay_online_rate", alipayOnlineRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN));
@ -3430,7 +3462,23 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
client.put("cbbank_rate", cbBankPayRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN));
}
} catch (Exception ignored) {
throw new BadRequestException("Merchant Rate Not Configure");
throw new BadRequestException("Merchant Rate Not Configure,Please Contact Customer Service");
}
try {
JSONObject bestPayRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Bestpay");
if (bestPayRate != null) {
client.put("bestpay_rate", bestPayRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN));
}
JSONObject jdRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "jd");
if (jdRate != null) {
client.put("jd_rate", jdRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN));
}
} catch (Exception ignored) {
JSONObject rate = sysConfigRate.getJSONObject("t" + weChatRate.getString("clean_days"));
client.put("bestpay_rate", rate.getBigDecimal("Bestpay").setScale(2, BigDecimal.ROUND_DOWN));
client.put("jd_rate", rate.getBigDecimal("JDpay").setScale(2, BigDecimal.ROUND_DOWN));
}
JSONObject bankAccount = getBankAccountByClientId(client.getIntValue("client_id"));
@ -4129,7 +4177,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
transactions.forEach(e -> {
if ("Credit".equals(e.getString("type")) && !"settle revoke".equals(e.getString("remark"))) {
JSONObject manager = managerMapper.findDetail(e.getString("operation"));
e.put("operator_displayname", manager.getString("display_name"));
e.put("operator", manager.getString("display_name"));
}
});
return transactions;
@ -4150,7 +4198,14 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
if (client == null) {
throw new InvalidShortIdException();
}
return clearingDistributedSurchargeMapper.findSurchargeTransactionsByDetailId(client.getIntValue("client_id"), detailId);
List<JSONObject> transactions = clearingDistributedSurchargeMapper.findSurchargeTransactionsByDetailId(client.getIntValue("client_id"), detailId);
transactions.forEach(e -> {
if ("Credit".equals(e.getString("type")) && !"settle revoke".equals(e.getString("remark"))) {
JSONObject manager = managerMapper.findDetail(e.getString("operation"));
e.put("operator", manager.getString("display_name"));
}
});
return transactions;
}
@Override

@ -55,9 +55,11 @@ public class PartnerManageController {
}
@RequestMapping(value = "/init/merchant_code", method = RequestMethod.GET)
public String initMerchantCode() {
return clientManager.initMerchantCode();
@RequestMapping(value = "/init/merchant_code", method = RequestMethod.GET,produces = "application/json")
public JSONObject initMerchantCode() {
JSONObject result = new JSONObject();
result.put("partner_code", clientManager.initMerchantCode());
return result;
}
@RequestMapping(value = "/init/check_code_isvalid", method = RequestMethod.GET)

@ -44,6 +44,7 @@ import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
@ -583,7 +584,8 @@ public class PartnerViewController {
@PartnerMapping(value = "/clientCompliance/{clientMoniker}/viewCommit", method = RequestMethod.POST)
@ResponseBody
public void clientComplianceViewCommit(@PathVariable String clientMoniker ,@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) {
public void clientComplianceViewCommit(@PathVariable String clientMoniker ,@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestBody JSONObject photoInfo) {
account.put("photo_info", photoInfo);
clientManager.commitAuthFilesToCompliance(clientMoniker, account, "Web");
}

@ -2,7 +2,7 @@ package au.com.royalpay.payment.manage.organizations.beans;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.hibernate.validator.constraints.NotEmpty;
import javax.validation.constraints.NotEmpty;
/**
* Created by yixian on 2016-10-18.

@ -9,7 +9,7 @@ import org.springframework.util.Assert;
*/
public class OrgCheckUtils {
public static void checkOrgPermission(JSONObject manager, JSONObject client) {
Assert.notNull(client);
Assert.notNull(client, "client should not be null");
if (manager != null && manager.getInteger("org_id") != null && manager.getIntValue("org_id") != client.getIntValue("org_id")) {
throw new ForbiddenException("This client was not belong to your organization");
}

@ -1,8 +1,8 @@
package au.com.royalpay.payment.manage.pos.datasource;
import com.zaxxer.hikari.HikariDataSource;
import org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;

@ -3,9 +3,10 @@ package au.com.royalpay.payment.manage.redpack.beans;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.annotation.JSONField;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotEmpty;
import org.hibernate.validator.constraints.Range;
import javax.validation.constraints.NotEmpty;
/**
* Created by davep on 2016-08-03.
*/

@ -60,7 +60,7 @@ import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.thymeleaf.context.Context;
import org.thymeleaf.spring4.SpringTemplateEngine;
import org.thymeleaf.spring5.SpringTemplateEngine;
import javax.servlet.http.HttpServletResponse;
import java.io.*;

@ -20,7 +20,7 @@ import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.thymeleaf.context.Context;
import org.thymeleaf.spring4.SpringTemplateEngine;
import org.thymeleaf.spring5.SpringTemplateEngine;
import javax.annotation.Resource;
import java.text.ParseException;

@ -1,6 +1,6 @@
package au.com.royalpay.payment.manage.signin.beans;
import org.hibernate.validator.constraints.NotEmpty;
import javax.validation.constraints.NotEmpty;
/**
* Created by yixian on 2016-06-29.

@ -1,6 +1,6 @@
package au.com.royalpay.payment.manage.signin.beans;
import org.hibernate.validator.constraints.NotEmpty;
import javax.validation.constraints.NotEmpty;
/**
* Created by yishuqian on 14/02/2017.

@ -1,7 +1,7 @@
package au.com.royalpay.payment.manage.signin.beans;
import au.com.royalpay.payment.tools.utils.PasswordUtils;
import org.hibernate.validator.constraints.NotEmpty;
import javax.validation.constraints.NotEmpty;
/**
* Created by yixian on 2016-06-29.

@ -5,8 +5,9 @@ import au.com.royalpay.payment.tools.utils.PasswordUtils;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.annotation.JSONField;
import org.apache.commons.lang3.StringUtils;
import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.NotEmpty;
import javax.validation.constraints.Email;
import javax.validation.constraints.NotEmpty;
import java.util.Date;

@ -38,7 +38,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert;
import org.thymeleaf.context.Context;
import org.thymeleaf.spring4.SpringTemplateEngine;
import org.thymeleaf.spring5.SpringTemplateEngine;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
@ -464,7 +464,7 @@ public class SignInAccountServiceImpl implements SignInAccountService, Applicati
"company_phone", "suburb", "postcode", "state", "contact_person", "contact_phone", "contact_email", "short_name", "logo_url", "enable_refund",
"enable_refund_auth", "retail_surcharge", "require_custinfo", "require_remark", "logo_thumbnail", "creator", "create_time", "approver",
"approve_result", "approve_time", "open_status", "timezone", "has_children", "source", "customer_surcharge_rate", "enable_alipay", "enable_wechat",
"enable_bestpay", "manual_settle", "skip_clearing", "mail_confirm", "surcharge_mode"};
"enable_bestpay", "manual_settle", "skip_clearing", "mail_confirm", "surcharge_mode", "company_photo", "store_photo", "company_website"};
for (String col : columns) {
simpleClient.put(col, client.get(col));
}
@ -707,13 +707,33 @@ public class SignInAccountServiceImpl implements SignInAccountService, Applicati
}
result.put("client_less_file", clientFilesIsLess);
if (clientFilesIsLess) {
JSONObject authFileCompliance = clientComplianceCompanyMapper.findFileByClientId(client.getIntValue("client_id"));
if (authFileCompliance != null && StringUtils.isNotBlank(authFileCompliance.getString("description"))) {
result.put("client_refuse_reason", "Refuse reason/打回原因:" + authFileCompliance.getString("description"));
}
whenClientLessFile(client, result);
}
}
}
return result;
}
private void whenClientLessFile(JSONObject client,JSONObject result) {
JSONObject authFileCompliance = clientComplianceCompanyMapper.findFileByClientId(client.getIntValue("client_id"));
if (authFileCompliance != null && StringUtils.isNotBlank(authFileCompliance.getString("description"))) {
result.put("client_refuse_reason", "Refuse reason/打回原因:" + authFileCompliance.getString("description"));
}
JSONObject photoInfo = new JSONObject();
photoInfo.put("company_photo", client.getString("company_photo"));
photoInfo.put("store_photo", client.getString("store_photo"));
photoInfo.put("web_site", client.getString("company_website"));
if (authFileCompliance != null) {
if (StringUtils.isNotBlank(authFileCompliance.getString("company_photo"))) {
photoInfo.put("company_photo", authFileCompliance.getString("company_photo"));
}
if (StringUtils.isNotBlank(authFileCompliance.getString("store_photo"))) {
photoInfo.put("store_photo", authFileCompliance.getString("store_photo"));
}
if (StringUtils.isNotBlank(authFileCompliance.getString("company_website"))) {
photoInfo.put("web_site", authFileCompliance.getString("company_website"));
}
}
result.put("photo_info", photoInfo);
}
}

@ -135,7 +135,7 @@ public class SurchargeAccountServiceImpl implements SurchargeAccountService {
surchargeAccount.put("balance", surchargeAccount.getBigDecimal("balance").add(transaction.getBigDecimal("amount")));
clientsSurchargeAccountsMapper.update(surchargeAccount);
detail.put("checkout", 1);
detail.put("operator_id", manager.getString("display_name"));
detail.put("operator_id", manager.getString("manager_id"));
financialSurchargeAccountDetailMapper.update(detail);
} finally {
locker.unlock(detail.getIntValue("client_id") + "_" + detail.getString("settle_month") + "_fill");

@ -2,7 +2,7 @@ package au.com.royalpay.payment.manage.vipcustomer.beans;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.hibernate.validator.constraints.NotEmpty;
import javax.validation.constraints.NotEmpty;
/**
* Created by yishuqian on 31/10/2016.

@ -29,23 +29,23 @@ public class VipCustomerServiceImp implements VipCustomerService {
@Override
public JSONObject listVipCustomers(JSONObject partner, VipCusQuery query) {
JSONObject params =query.toJsonParams();
params.put("client_id",partner.getIntValue("client_id"));
PageList<JSONObject> vipCustomers=vipCustomerMapper.listVipCustomers(params,new PageBounds(query.getPage(), query.getLimit(), Order.formString("create_time.desc")));
JSONObject params = query.toJsonParams();
params.put("client_id", partner.getIntValue("client_id"));
PageList<JSONObject> vipCustomers = vipCustomerMapper.listVipCustomers(params, new PageBounds(query.getPage(), query.getLimit(), Order.formString("create_time.desc")));
return PageListUtils.buildPageListResult(vipCustomers);
}
@Override
public JSONObject createVipCustomer(JSONObject partner, VipCustomerInfo vipCustomerInfo) {
String vipCode = partner.getString("client_moniker")+vipCustomerInfo.getVip_code().toUpperCase();
String vipCode = partner.getString("client_moniker") + vipCustomerInfo.getVip_code().toUpperCase();
JSONObject vipCustomer = getVipCustomerInfoByCode(vipCode);
if (vipCustomer != null){
if (vipCustomer != null) {
throw new BadRequestException("error.vipcustomer.valid.dumplicate_vip_code");
}
JSONObject info = vipCustomerInfo.insertObject();
info.put("vip_code",vipCode);
info.put("client_id",partner.getIntValue("client_id"));
info.put("create_time",new Date());
info.put("vip_code", vipCode);
info.put("client_id", partner.getIntValue("client_id"));
info.put("create_time", new Date());
vipCustomerMapper.save(info);
return info;
}
@ -53,26 +53,26 @@ public class VipCustomerServiceImp implements VipCustomerService {
@Override
public void updateVipCustomer(JSONObject partner, String vip_code, VipCustomerInfo info) {
JSONObject vipCustomerInfo = getVipCustomerInfoByCode(vip_code);
Assert.notNull(vipCustomerInfo);
Assert.notNull(vipCustomerInfo, "customer not exists");
JSONObject updateInfo = info.updateObject();
updateInfo.put("client_id",partner.getIntValue("client_id"));
updateInfo.put("vip_customer_id",vipCustomerInfo.getString("vip_customer_id"));
updateInfo.put("client_id", partner.getIntValue("client_id"));
updateInfo.put("vip_customer_id", vipCustomerInfo.getString("vip_customer_id"));
vipCustomerMapper.update(updateInfo);
}
@Override
public JSONObject getVipCustomerInfoByCode(String vipCode){
public JSONObject getVipCustomerInfoByCode(String vipCode) {
return vipCustomerMapper.findVipCustomerByCode(vipCode);
}
@Override
public JSONObject getVipCustomerDetail(JSONObject partner, String vip_code) {
JSONObject vip_customer = getVipCustomerInfoByCode(vip_code);
Assert.notNull(vip_customer);
Assert.notNull(vip_customer, "customer not exists");
String clientMoniker = partner.getString("client_moniker");
String url = PlatformEnvironment.getEnv().concatUrl("/partner/vip/"+clientMoniker+"/payment/qrcode/" + vip_code);
vip_customer.put("url",url);
vip_customer.put("qrcode", QRCodeUtils.qrcodeImageCode(url, 250,false));
String url = PlatformEnvironment.getEnv().concatUrl("/partner/vip/" + clientMoniker + "/payment/qrcode/" + vip_code);
vip_customer.put("url", url);
vip_customer.put("qrcode", QRCodeUtils.qrcodeImageCode(url, 250, false));
return vip_customer;
}
}

@ -1,7 +1,12 @@
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
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_production
spring.datasource.host=119.28.3.196:3310
spring.datasource.url=jdbc:mysql://${spring.datasource.host}/${spring.datasource.schema-name}?useUnicode=true&characterEncoding=utf8&useSSL=false
spring.datasource.username=readonly
spring.datasource.password=read0nly
spring.datasource.master.jdbc-url=jdbc:mysql://${spring.datasource.host}/${spring.datasource.schema-name}?useUnicode=true&characterEncoding=utf8&useSSL=false
spring.datasource.master.username=readonly
spring.datasource.master.password=read0nly
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=readonly
spring.datasource.slave.password=read0nly

@ -146,4 +146,9 @@ app.hanyin-secure.sftp-pwd=royalpay
qcloud.secret-id=AKIDlHdjgWzZliPvBauZFfrnW0MaZOyHdTPz
qcloud.secret-key=YswoQDsIZfWEqEAEvMXS8Yic84lFn9Jp
qcloud.scf.region=ap-hongkong
qcloud.scf.region=ap-hongkong
apple.message.apns.file=
apple.message.apns.password=
android.message.appkey=
android.message.secret=

@ -19,6 +19,11 @@
and file_name='client_agree_file'
and status != 1
</select>
<select id="findAllClientFile" resultType="com.alibaba.fastjson.JSONObject">
select * from sys_files where is_valid = 1
and client_id = #{client_id}
order by last_update_date asc
</select>
<update id="confirmAgreeFile">
update sys_files
set state = 2

@ -2,19 +2,19 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="au.com.royalpay.payment.manage.mappers.system.ClientMapper">
<select id="listValidClient" resultType="com.alibaba.fastjson.JSONObject">
SELECT client_id,client_moniker,parent_client_id FROM sys_clients
WHERE is_valid=1 and (approve_result = 1 or approve_result = 2)
SELECT client_id, client_moniker, parent_client_id
FROM sys_clients
WHERE is_valid = 1
and (approve_result = 1 or approve_result = 2)
</select>
<select id="listValidClientFor30Days" resultType="com.alibaba.fastjson.JSONObject">
SELECT
DISTINCT
sc.client_id,
sc.client_moniker,
sc.parent_client_id
SELECT DISTINCT sc.client_id,
sc.client_moniker,
sc.parent_client_id
FROM statistics_customer_order sco,
sys_clients sc
sys_clients sc
WHERE sco.date >= DATE_SUB(CURDATE(), INTERVAL 30 DAY)
AND sco.client_id = sc.client_id
AND sco.client_id = sc.client_id
</select>
<select id="listGreenChannel" resultType="com.alibaba.fastjson.JSONObject">
select m.manager_id manager_id,m.display_name display_name, m.wx_openid wx_openid , c.client_moniker
@ -173,7 +173,9 @@
</select>
<select id="listLessInfoPartners" resultType="com.alibaba.fastjson.JSONObject">
SELECT DISTINCT c.client_moniker,c.source,c.approve_result,c.short_name,c.company_phone,c.approve_time,c.create_time,c.open_status,c.address,c.state,c.suburb,c.is_valid,c.postcode,c.country,o.name org_name
SELECT DISTINCT
c.client_moniker,c.source,c.approve_result,c.short_name,c.company_phone,c.approve_time,c.create_time,c.open_status,c.address,c.state,c.suburb,c.is_valid,c.postcode,c.country,o.name
org_name
FROM sys_clients c
inner join sys_client_config cc on cc.client_id = c.client_id
inner join sys_org o
@ -214,7 +216,8 @@
AND c.approve_result = 5 AND c.approve_time is NOT NULL
</if>
<if test="bd_upload_and_completed">
AND ((c.open_status = 3 AND c.approve_result != 5 ) OR (c.open_status IS NULL AND c.approve_result IS NULL AND c.source != 4))
AND ((c.open_status = 3 AND c.approve_result != 5 ) OR (c.open_status IS NULL AND c.approve_result IS
NULL AND c.source != 4))
</if>
<if test="bd_upload_material">
AND c.open_status = 3 AND c.approve_result != 5
@ -359,8 +362,8 @@
</where>
</select>
<select id="listClientsIdAndMoniker" resultType="com.alibaba.fastjson.JSONObject">
SELECT
client_id,client_moniker
SELECT client_id,
client_moniker
from sys_clients
</select>
<select id="listPartnerSelection" resultType="com.alibaba.fastjson.JSONObject">
@ -407,51 +410,55 @@
GROUP BY c.contact_email
</select>
<select id="listClients" resultType="com.alibaba.fastjson.JSONObject">
SELECT
c.client_id,
c.short_name,
c.client_moniker
SELECT c.client_id,
c.short_name,
c.client_moniker
FROM sys_clients c
WHERE (c.approve_result = 1 OR c.approve_result= 2) AND c.is_valid = 1
WHERE (c.approve_result = 1 OR c.approve_result = 2)
AND c.is_valid = 1
</select>
<select id="listClientsForSettlement" resultType="com.alibaba.fastjson.JSONObject">
SELECT
c.client_id,
c.client_moniker,
c.short_name,
cc.clean_days,
cc.weekend_delay,
b.bsb_no,
b.account_no,
b.account_name
SELECT c.client_id,
c.client_moniker,
c.short_name,
cc.clean_days,
cc.weekend_delay,
b.bsb_no,
b.account_no,
b.account_name
FROM sys_clients c
INNER JOIN sys_bank_accounts b ON b.client_id = c.client_id
inner join sys_client_config cc on cc.client_id = c.client_id
WHERE cc.skip_clearing = 0 AND (c.approve_result = 1 or (c.approve_result=2 and (c.source=1 or c.source=2))) AND cc.is_valid = 1
INNER JOIN sys_bank_accounts b ON b.client_id = c.client_id
inner join sys_client_config cc on cc.client_id = c.client_id
WHERE cc.skip_clearing = 0
AND (c.approve_result = 1 or (c.approve_result = 2 and (c.source = 1 or c.source = 2)))
AND cc.is_valid = 1
ORDER BY client_moniker ASC
</select>
<select id="listClientsForSettlementWithDetail" resultType="com.alibaba.fastjson.JSONObject">
SELECT
c.*,
b.bsb_no,
b.account_no,
b.account_name
SELECT c.*,
b.bsb_no,
b.account_no,
b.account_name
FROM sys_clients c
INNER JOIN sys_bank_accounts b ON b.client_id = c.client_id
inner join sys_client_config cc on cc.client_id = c.client_id
WHERE cc.skip_clearing = 0 AND (c.approve_result = 1 or (c.approve_result=2 and (c.source=1 or c.source=2))) AND cc.is_valid = 1
INNER JOIN sys_bank_accounts b ON b.client_id = c.client_id
inner join sys_client_config cc on cc.client_id = c.client_id
WHERE cc.skip_clearing = 0
AND (c.approve_result = 1 or (c.approve_result = 2 and (c.source = 1 or c.source = 2)))
AND cc.is_valid = 1
ORDER BY client_moniker ASC
</select>
<select id="listUnAuthPartners" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[
SELECT
client_id,
client_moniker,
approve_time
SELECT client_id,
client_moniker,
approve_time
FROM sys_clients
WHERE is_valid = 1 AND approve_result = 2 AND source = 4 AND datediff(now(), approve_time) <= #{auth_days}
WHERE is_valid = 1
AND approve_result = 2
AND source = 4
AND datediff(now(), approve_time) <= #{auth_days}
]]>
</select>
@ -480,35 +487,41 @@
<select id="listCityClientIds" resultType="java.lang.String">
SELECT DISTINCT cb.client_id
FROM sys_client_bd cb
INNER JOIN financial_bd_config bc ON bc.manager_id = cb.bd_id AND bc.city = #{city}
WHERE cb.start_date &lt;= #{date} AND cb.is_valid = 1
AND (cb.end_date IS NULL OR cb.end_date &gt;= #{date})
INNER JOIN financial_bd_config bc ON bc.manager_id = cb.bd_id AND bc.city = #{city}
WHERE cb.start_date &lt;= #{date}
AND cb.is_valid = 1
AND (cb.end_date IS NULL OR cb.end_date &gt;= #{date})
</select>
<select id="listClientByCleanDays" resultType="java.lang.String">
SELECT c.client_id FROM sys_clients c
inner join sys_client_config cc on c.client_id = cc.client_id
WHERE c.is_valid = 1 and cc.clean_days = #{clean_days}
SELECT c.client_id
FROM sys_clients c
inner join sys_client_config cc on c.client_id = cc.client_id
WHERE c.is_valid = 1
and cc.clean_days = #{clean_days}
</select>
<select id="listSubMerchantId" resultType="com.alibaba.fastjson.JSONObject">
SELECT
COUNT(DISTINCT c.client_id) client_count,
c.sub_merchant_id,
c.merchant_id
SELECT COUNT(DISTINCT c.client_id) client_count,
c.sub_merchant_id,
c.merchant_id
FROM sys_clients c
WHERE (c.approve_result = 1 OR c.approve_result= 2) AND c.is_valid = 1 AND c.sub_merchant_id IS NOT NULL
AND c.merchant_id IS NOT NULL
WHERE (c.approve_result = 1 OR c.approve_result = 2)
AND c.is_valid = 1
AND c.sub_merchant_id IS NOT NULL
AND c.merchant_id IS NOT NULL
GROUP BY c.sub_merchant_id
</select>
<select id="listBySubMerchantId" resultType="com.alibaba.fastjson.JSONObject">
SELECT
c.client_moniker,
c.sub_merchant_id,
c.merchant_id
SELECT c.client_moniker,
c.sub_merchant_id,
c.merchant_id
FROM sys_clients c
WHERE (c.approve_result = 1 OR c.approve_result= 2) AND c.is_valid = 1 AND c.sub_merchant_id IS NOT NULL
AND c.merchant_id IS NOT NULL AND c.sub_merchant_id = #{sub_merchant_id}
WHERE (c.approve_result = 1 OR c.approve_result = 2)
AND c.is_valid = 1
AND c.sub_merchant_id IS NOT NULL
AND c.merchant_id IS NOT NULL
AND c.sub_merchant_id = #{sub_merchant_id}
</select>
<select id="simpleQuery" resultType="com.alibaba.fastjson.JSONObject">
select * from sys_clients
@ -531,134 +544,122 @@
</if>
</select>
<select id="listClientsWithTransactionsSettled" resultType="int">
select distinct c.client_id from sys_clients c
inner join pmt_transactions t on t.client_id=c.client_id and t.clearing_status=1 and t.system_generate=0
where t.transaction_time between #{from} and #{to}
select distinct t.client_id
from pmt_transactions t
where t.clearing_status = 1
and t.system_generate = 0
and t.transaction_time between #{from} and #{to}
</select>
<select id="findByhfPayUrlNotNull" resultType="com.alibaba.fastjson.JSONObject">
select client_id,client_moniker FROM sys_clients WHERE hf_pay_url != ''
select client_id, client_moniker
FROM sys_clients
WHERE hf_pay_url != ''
</select>
<select id="findByrpayNotNull" resultType="com.alibaba.fastjson.JSONObject">
select * FROM sys_clients WHERE rpay_enterprise_id != ''
select *
FROM sys_clients
WHERE rpay_enterprise_id != ''
</select>
<select id="countBdApproveClients" resultType="com.alibaba.fastjson.JSONObject">
SELECT SUM(IF(((approve_result=4 AND open_status IS NULL) OR (approve_result=3 AND open_status IS NULL) OR
open_status=1 OR open_status=2 OR open_status=4),1,0)) approving,
SUM(IF((open_status = 5 AND approve_result = 1 AND approve_time IS NOT NULL),1,0)) pass,
SUM(IF((YEAR(approve_time)=YEAR(now()) and MONTH(approve_time)=MONTH(now()) AND approve_result = 1 AND open_status = 5),1,0)) this_months_pass
FROM sys_clients
open_status=1 OR open_status=2 OR open_status=4),1,0)) approving,
SUM(IF((open_status = 5 AND approve_result = 1 AND approve_time IS NOT NULL),1,0)) pass,
SUM(IF((YEAR(approve_time)=YEAR(now()) and MONTH(approve_time)=MONTH(now()) AND approve_result = 1 AND
open_status = 5),1,0)) this_months_pass
FROM sys_clients
WHERE
<bind name="manager_id_pattern" value="'%'+manager_id+'%'"/>
bd_user LIKE #{manager_id_pattern} AND is_valid=1;
</select>
<select id="createClientsByGroup" resultType="com.alibaba.fastjson.JSONObject">
SELECT
t1.*,
ifnull( t2.clients_yesterday, 0 ) clients_yesterday
FROM
(
SELECT
fbc.bd_name,
fbc.bd_group,
fbc.bd_type,
sum( a.proportion ) clients_month
FROM
sys_client_bd a
INNER JOIN (
SELECT
bd_id,
max( create_time ) create_time
FROM
sys_client_bd
WHERE
client_id IN (
SELECT
client_id
FROM
sys_clients c
WHERE
c.approve_time &gt;= #{start_date_month}
AND c.approve_time &lt;= #{end_date}
AND c.is_valid = 1
AND c.approve_result = 1
AND c.org_id = 1
)
AND start_date &lt;= #{end_date} AND is_valid = 1 AND ( end_date &gt; #{start_date_month}
OR end_date IS NULL
)
GROUP BY
bd_id,
client_id
) b ON a.bd_id = b.bd_id
AND a.create_time = b.create_time
INNER JOIN financial_bd_config c ON a.bd_id = c.manager_id
INNER JOIN financial_bd_config fbc ON fbc.manager_id = c.bd_group
WHERE
a.is_valid = 1
GROUP BY
fbc.bd_group
ORDER BY
clients_month DESC
) t1
LEFT JOIN (
SELECT
fbc.bd_name,
fbc.bd_group,
fbc.bd_type,
sum( a.proportion ) clients_yesterday
FROM
sys_client_bd a
INNER JOIN (
SELECT
bd_id,
max( create_time ) create_time
FROM
sys_client_bd
WHERE
client_id IN (
SELECT
client_id
FROM
sys_clients c
WHERE
c.approve_time &gt;= #{start_date}
AND c.approve_time &lt; #{end_date}
AND c.is_valid = 1
AND c.approve_result = 1
AND c.org_id = 1
)
AND start_date &lt;= #{end_date} AND is_valid = 1 AND ( end_date &gt; #{start_date}
OR end_date IS NULL
)
GROUP BY
bd_id,
client_id
) b ON a.bd_id = b.bd_id
AND a.create_time = b.create_time
INNER JOIN financial_bd_config c ON a.bd_id = c.manager_id
INNER JOIN financial_bd_config fbc ON fbc.manager_id = c.bd_group
WHERE
a.is_valid = 1
GROUP BY
fbc.bd_group
ORDER BY
clients_yesterday DESC
SELECT t1.*,
ifnull(t2.clients_yesterday, 0) clients_yesterday
FROM (
SELECT fbc.bd_name,
fbc.bd_group,
fbc.bd_type,
sum(a.proportion) clients_month
FROM sys_client_bd a
INNER JOIN (
SELECT bd_id,
max(create_time) create_time
FROM sys_client_bd
WHERE client_id IN (
SELECT client_id
FROM sys_clients c
WHERE c.approve_time &gt;= #{start_date_month}
AND c.approve_time &lt;= #{end_date}
AND c.is_valid = 1
AND c.approve_result = 1
AND c.org_id = 1
)
AND start_date &lt;= #{end_date}
AND is_valid = 1
AND (end_date &gt; #{start_date_month}
OR end_date IS NULL
)
GROUP BY bd_id,
client_id
) b ON a.bd_id = b.bd_id
AND a.create_time = b.create_time
INNER JOIN financial_bd_config c ON a.bd_id = c.manager_id
INNER JOIN financial_bd_config fbc ON fbc.manager_id = c.bd_group
WHERE a.is_valid = 1
GROUP BY fbc.bd_group
ORDER BY clients_month DESC
) t1
LEFT JOIN (
SELECT fbc.bd_name,
fbc.bd_group,
fbc.bd_type,
sum(a.proportion) clients_yesterday
FROM sys_client_bd a
INNER JOIN (
SELECT bd_id,
max(create_time) create_time
FROM sys_client_bd
WHERE client_id IN (
SELECT client_id
FROM sys_clients c
WHERE c.approve_time &gt;= #{start_date}
AND c.approve_time &lt; #{end_date}
AND c.is_valid = 1
AND c.approve_result = 1
AND c.org_id = 1
)
AND start_date &lt;= #{end_date}
AND is_valid = 1
AND (end_date &gt; #{start_date}
OR end_date IS NULL
)
GROUP BY bd_id,
client_id
) b ON a.bd_id = b.bd_id
AND a.create_time = b.create_time
INNER JOIN financial_bd_config c ON a.bd_id = c.manager_id
INNER JOIN financial_bd_config fbc ON fbc.manager_id = c.bd_group
WHERE a.is_valid = 1
GROUP BY fbc.bd_group
ORDER BY clients_yesterday DESC
) t2 ON t1.bd_group = t2.bd_group
</select>
<select id="clientPayTypeInfoByClientIdRange" resultType="com.alibaba.fastjson.JSONObject">
SELECT p.client_id,p.client_moniker,c.client_pay_type,c.client_pay_desc FROM sys_clients p
INNER JOIN sys_client_config c ON c.client_id=p.client_id
WHERE p.is_valid=1
AND p.client_id >= #{begin}
AND p.client_id &lt; #{end}
SELECT p.client_id, p.client_moniker, c.client_pay_type, c.client_pay_desc
FROM sys_clients p
INNER JOIN sys_client_config c ON c.client_id = p.client_id
WHERE p.is_valid = 1
AND p.client_id >= #{begin}
AND p.client_id &lt; #{end}
</select>
<select id="getPartnercode" resultType="int">
SELECT count(1) FROM sys_clients where client_moniker=#{codes};
SELECT count(1)
FROM sys_clients
where client_moniker = #{codes};
</select>
<select id="listNeedOpenCbpayMerchant" resultType="com.alibaba.fastjson.JSONObject">
@ -675,82 +676,66 @@
</select>
<select id="findCountByBd" resultType="com.alibaba.fastjson.JSONObject">
SELECT
*
FROM
(
SELECT
count( * ) yesterday_count
FROM
sys_clients
WHERE
creator = #{bd_group}
AND create_time &gt;= #{yesterday}
AND create_time &lt; #{today}
AND is_valid = 1
) a,
(
SELECT
count( * ) month_count
FROM
sys_clients
WHERE
creator = #{bd_group}
AND create_time &gt;= #{month}
AND create_time &lt; #{today}
AND is_valid = 1
) b
SELECT *
FROM (
SELECT count(*) yesterday_count
FROM sys_clients
WHERE creator = #{bd_group}
AND create_time &gt;= #{yesterday}
AND create_time &lt; #{today}
AND is_valid = 1
) a,
(
SELECT count(*) month_count
FROM sys_clients
WHERE creator = #{bd_group}
AND create_time &gt;= #{month}
AND create_time &lt; #{today}
AND is_valid = 1
) b
</select>
<select id="findSamePhone" resultType="com.alibaba.fastjson.JSONObject">
SELECT
contact_phone,
GROUP_CONCAT(client_moniker separator ' ') a
FROM
sys_clients
WHERE contact_phone= #{contact_phone}
GROUP BY
contact_phone
SELECT contact_phone,
GROUP_CONCAT(client_moniker separator ' ') a
FROM sys_clients
WHERE contact_phone = #{contact_phone}
GROUP BY contact_phone
</select>
<select id="findSameCompanyName" resultType="com.alibaba.fastjson.JSONObject">
SELECT
company_name,
GROUP_CONCAT(client_moniker separator ' ') a
FROM
sys_clients
WHERE company_name= #{company_name}
GROUP BY
company_name
SELECT company_name,
GROUP_CONCAT(client_moniker separator ' ') a
FROM sys_clients
WHERE company_name = #{company_name}
GROUP BY company_name
</select>
<select id="findSameEmail" resultType="com.alibaba.fastjson.JSONObject">
SELECT
contact_email,
GROUP_CONCAT(client_moniker separator ' ') a
FROM
sys_clients
WHERE contact_email= #{contact_email}
GROUP BY
contact_email
SELECT contact_email,
GROUP_CONCAT(client_moniker separator ' ') a
FROM sys_clients
WHERE contact_email = #{contact_email}
GROUP BY contact_email
</select>
<select id="findSameAddress" resultType="com.alibaba.fastjson.JSONObject">
SELECT
address,
GROUP_CONCAT(client_moniker separator ' ') a
FROM
sys_clients
WHERE address= #{address}
GROUP BY
address
SELECT address,
GROUP_CONCAT(client_moniker separator ' ') a
FROM sys_clients
WHERE address = #{address}
GROUP BY address
</select>
<select id="listUseAlipayMerchant" resultType="int">
select client_id from sys_clients where gateway_alipay_online=1 and is_valid=1
and client_id >=#{start} and client_id &lt;#{end}
select client_id
from sys_clients
where gateway_alipay_online = 1
and is_valid = 1
and client_id >= #{start}
and client_id &lt; #{end}
</select>
</mapper>

@ -395,7 +395,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
}
$scope.initMerchantCode = function () {
$http.get('/sys/partners/init/merchant_code').then(function (response) {
$scope.partner.client_moniker = response.data;
$scope.partner.client_moniker = response.data.partner_code;
$scope.merchantCodeChecked = true;
$scope.merchantIsValid = true;
});
@ -2969,7 +2969,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
}
$scope.initMerchantCode = function () {
$http.get('/sys/partners/init/merchant_code').then(function (response) {
$scope.partner.client_moniker = response.data;
$scope.partner.client_moniker = response.data.partner_code;
$scope.merchantCodeChecked = true;
$scope.merchantIsValid = true;
});

@ -812,6 +812,50 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload', 'uiBoo
app.controller('clientCommitToComplianceFilesCtrl', ['$scope', '$http', '$rootScope', 'commonDialog', '$state', 'Upload', 'file','partner', function ($scope, $http, $rootScope, commonDialog, $state, Upload, file, partner) {
$scope.file = file.data || {};
$scope.partner = partner.data || {};
$scope.uploadStorePhoto = function (file) {
if (file != null) {
if (file.size > 2 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过2MB请压缩后重试', type: 'error'})
} else {
$scope.storePhotoProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.storePhotoProgress;
$scope.file.photo_info.store_photo = resp.data.url;
}, function (resp) {
delete $scope.storePhotoProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.storePhotoProgress.value = parseInt(100 * evt.loaded / evt.total);
})
}
}
};
$scope.uploadShopPhoto = function (file) {
if (file != null) {
if (file.size > 2 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过2MB请压缩后重试', type: 'error'})
} else {
$scope.shopPhotoProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.shopPhotoProgress;
$scope.file.photo_info.company_photo = resp.data.url;
}, function (resp) {
delete $scope.shopPhotoProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.shopPhotoProgress.value = parseInt(100 * evt.loaded / evt.total);
})
}
}
};
//audit files
$scope.uploadBankFile = function (file) {
if (file != null) {
@ -860,7 +904,6 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload', 'uiBoo
if ($scope.file.file_id_info && $scope.file.file_id_info.endsWith('pdf')) {
$scope.idIsImage = false;
}
$scope.uploadCompanyFile = function (file) {
if (file != null) {
if (file.size > 3 * 1024 * 1024) {
@ -1017,12 +1060,16 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload', 'uiBoo
commonDialog.alert({title: 'Error', content: '请提交* Certificate of Registration', type: 'error'});
return;
}
;
if ((!$scope.file.photo_info.company_photo || !$scope.file.photo_info.store_photo) && !$scope.file.photo_info.web_site) {
alert('Please upload two photos or fill out the website');
return;
}
commonDialog.confirm({
title: 'Warning',
content: 'Are you sure to submit files?'
}).then(function () {
$http.post('/client/partner_info/clientCompliance/' + $scope.partner.client_moniker + '/viewCommit', $scope.file).then(function () {
$http.post('/client/partner_info/clientCompliance/' + $scope.partner.client_moniker + '/viewCommit', $scope.file.photo_info).then(function () {
commonDialog.alert({
title: 'Success',
content: 'Commit Successful',
@ -1855,6 +1902,17 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload', 'uiBoo
$scope.$close(signInfo);
};
}]);
var compare = function (x, y) {
x = parseInt(x);
y = parseInt(y);
if (x < y) {
return -1;
} else if (x > y) {
return 1;
} else {
return 0;
}
};
return app;
});

@ -35,7 +35,11 @@
<div class="col-sm-10">
<p class="form-control-static">
<span id="parent_code">{{partner.client_moniker}}</span>
<a class="text-primary" role="button" title="Detail"
ui-sref="partners.detail({clientMoniker:partner.client_moniker})">
<span id="parent_code">{{partner.client_moniker}}</span>
</a>
</p>
</div>
</div>
@ -70,6 +74,41 @@
</div>
<div class="panel-body">
<div class="form-horizontal">
<div class="form-group">
<label class="control-label col-sm-4" style="text-align: center;">
Website
</label>
<div class="col-sm-6">
<input type="text" class="form-control" ng-if="file.file_company.company_website"
ng-model="file.file_company.company_website"
maxlength="200" readonly>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-4" style="text-align: center;">Shop Photo
</label>
<div class="col-sm-3">
<div class="form-control-static"><em>1:</em>&nbsp;
</div>
<uib-progressbar value="shopPhotoProgress.value"
ng-if="shopPhotoProgress"></uib-progressbar>
<a target="_blank" ng-if="file.file_company.company_photo" ng-href="{{file.file_company.company_photo}}">
<img ng-src="{{file.file_company.company_photo}}"
ng-if="file.file_company.company_photo"
class="thumbnail img-size col-sm-9">
</a>
</div>
<div class="col-sm-3">
<div class="form-control-static"><em>2:</em>&nbsp;
</div>
<uib-progressbar value="storePhotoProgress.value"
ng-if="storePhotoProgress"></uib-progressbar>
<a target="_blank" ng-if="file.file_company.store_photo" ng-href="{{file.file_company.store_photo}}">
<img ng-src="{{file.file_company.store_photo}}" ng-if="file.file_company.store_photo"
class="thumbnail img-size col-sm-9">
</a>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-4" style="text-align: center;">* bank statement
<span ng-if="file.client_bank_file[0].status == 0" class="small text-dark">(未提交)</span>

@ -2,6 +2,19 @@
img {
width: 100%;
}
.btn btn-default:active{
position: relative;
top: 1px;
box-shadow: inset 0 3px 5px 0 rgba(0,0,0, 0.2);
outline: 0;
}
.btn-default:active,
.btn-default.active,
.open > .dropdown-toggle.btn-default {
color: #333;
background-color: #f7bf90;
border-color: #adadad;
}
</style>
<section class="content-header">
<h1>商户合规文件补充
@ -11,6 +24,64 @@
</section>
<div class="panel-body box box-warning ng-scope" style="margin-top: 20px;">
<div class="form-horizontal">
<div class="form-group">
<div class="panel-body">
<div class="form-horizontal">
<div class="form-group">
<label class="control-label col-sm-3">Shop Photo</label>
<div class="col-sm-3">
<div class="form-control-static"><em>1:</em>&nbsp;
<button class="btn btn-primary" type="button" ng-if="file.client_less_file && file.file_company.status != 0 && file.file_company.status!=1"
ngf-select="uploadShopPhoto($file)" accept="image/*">
<i class="fa fa-upload"></i> Upload Shop Photo1
</button>
</div>
<uib-progressbar value="shopPhotoProgress.value"
ng-if="shopPhotoProgress"></uib-progressbar>
<a target="_blank" ng-if="file.photo_info.company_photo" ng-href="{{file.photo_info.company_photo}}">
<img ng-src="{{file.photo_info.company_photo}}"
ng-if="file.photo_info.company_photo"
class="thumbnail img-size col-sm-9">
</a>
</div>
<div class="col-sm-3">
<div class="form-control-static"><em>2:</em>&nbsp;
<button class="btn btn-primary" type="button" ng-if="file.client_less_file && file.file_company.status != 0 && file.file_company.status!=1"
ngf-select="uploadStorePhoto($file)" accept="image/*">
<i class="fa fa-upload"></i> Upload Shop Photo2
</button>
</div>
<uib-progressbar value="storePhotoProgress.value"
ng-if="storePhotoProgress"></uib-progressbar>
<a target="_blank" ng-if="file.photo_info.store_photo" ng-href="{{file.photo_info.store_photo}}">
<img ng-src="{{file.photo_info.store_photo}}" ng-if="file.photo_info.store_photo"
class="thumbnail img-size col-sm-9">
</a>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">
Website</label>
<div class="col-sm-6">
<input type="text" class="form-control" ng-if="file.client_less_file && file.file_company.status != 0 && file.file_company.status!=1"
ng-model="file.photo_info.web_site"
maxlength="200">
<input type="text" class="form-control" ng-if="!file.client_less_file"
ng-model="file.photo_info.web_site"
maxlength="200" readonly>
<p class="text-info">
<i class="fa fa-info"></i> We are dedicated to provide you and your customers a better payment experience. To achieve this, we would like to request a fully completed trading information from you according to your actual payment scenarios:<br>
1) please provide a website link if the transactions take place in online scenario;<br>
2) provide two shop photos with inside and outside scenes if the transactions take place in offline scenario.<br>
<i class="fa fa-info"></i> Please be aware that failing to submit the related documents may affect your payment service. Thank you very much for your cooperation.<br>
<i class="fa fa-info"></i> 请根据您的实际交易场景完善网站信息和店铺照片,如您使用线上交易,请补充网站信息。如您使用线下交易,请补充店铺照片两张。如未根据实际交易场景选择提交材料,将会影响交易
</p>
</div>
</div>
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">* bank statement</label>
<div class="col-sm-3">

@ -37,20 +37,17 @@ define(['angular', 'decimal', 'uiBootstrap', 'uiRouter', 'angularEcharts'], func
})
};
$scope.getDetailByMonths();
$scope.surchargeAccountDetail = function (client_moniker,mon) {
$scope.surchargeAccountDetail = function (detail) {
$uibModal.open({
templateUrl: '/static/payment/surchargeaccount/templates/client_surcharge_account_dialog.html',
controller: 'accountDetailCtrl',
size: 'lg',
resolve: {
client_moniker: function () {
return client_moniker;
detail: function(){
return detail;
},
month: function () {
return mon;
},
transactions: ['$http', function ($http) {
return $http.get('/client/partner_info/' + client_moniker + '/account/transactions/date?date=' + mon);
surchargeDetailData: ['$http', function ($http) {
return $http.get('/client/partner_info/' + detail.client_moniker + '/account/transactions/date?detailId=' + detail.detail_id);
}]
}
});

@ -25,13 +25,13 @@
<td ng-bind="details.total_surcharge|currency:'$'"
style="color: red;vertical-align:middle"></td>
<td style="vertical-align:middle">
<span ng-if="details.is_valid">Yes</span>
<span ng-if="!details.is_valid">No</span>
<span ng-if="details.checkout">Yes</span>
<span ng-if="!details.checkout">No</span>
</td>
<td style="vertical-align:middle">
<i class="fa fa-bars"
style="font-size: 15px;color: #3c8dbc;cursor: pointer;padding-left: 15px"
ng-click="surchargeAccountDetail(details.client_moniker,details.settle_month)"></i>
ng-click="surchargeAccountDetail(details)"></i>
</td>
</tr>
</tbody>

@ -2,6 +2,30 @@
<h4>Surcharge Accountdddd Detail{{partner.client_moniker?'('+partner.client_moniker+')':''}}</h4>
</div>
<div class="modal-body">
<div class="box box-default">
<div class="box-header">Credits</div>
<div class="box-body">
<div class="table-responsive col-sm-12">
<table class="table table-bordered table-striped table-hover">
<thead>
<tr>
<th>Create Time</th>
<th>Amount</th>
<th>Remark</th>
<th>Operator</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="surcharge in surchargeDetailData|propsFilter:{type:'Credit'}:true">
<td ng-bind="surcharge.create_time|date:'yyyy-MM-dd HH:mm:ss'"></td>
<td ng-bind="surcharge.amount|currency:'AUD'"></td>
<td ng-bind="surcharge.remark"></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="box box-default">
<div class="box-header">Debits</div>
<div class="box-body">
@ -17,7 +41,7 @@
</tr>
</thead>
<tbody>
<tr ng-repeat="detail in surchargeDetailData">
<tr ng-repeat="detail in surchargeDetailData|propsFilter:{type:'Debit'}:true">
<td ng-bind="detail.settle_date|date:'yyyy-MM-dd'"></td>
<td ng-bind="detail.amount|currency:'AUD'"></td>
<td ng-bind="detail.total_surcharge|currency:'AUD'"></td>

@ -19,7 +19,7 @@ import java.nio.charset.StandardCharsets;
* Create by yixian at 2018-08-31 14:40
*/
@SpringBootTest
@ActiveProfiles({"proxy", "wechat"})
@ActiveProfiles({"proxy", "wechat","alipay","bestpay","rpay","jd","yeepay"})
@TestPropertySource(properties = {"spring.datasource.username=root", "spring.datasource.password=ZOIBhellor0yalpay"})
@RunWith(SpringRunner.class)
public class ExportATOReport {
@ -28,7 +28,7 @@ public class ExportATOReport {
@Test
public void export() throws IOException {
String content = atoReportService.exportBTTPSFile(DateTime.parse("2017-07-01").toDate(), DateTime.parse("2018-06-30").toDate());
FileUtils.write(new File("C:\\Users\\yixian\\Documents\\royalpay2017070120180630.bttps"), content, StandardCharsets.US_ASCII);
String content = atoReportService.exportBTTPSFile(DateTime.parse("2018-07-01").toDate(), DateTime.parse("2019-06-30").toDate());
FileUtils.write(new File("C:\\Users\\davep\\Documents\\royalpay2018070120190630.bttps"), content, StandardCharsets.US_ASCII);
}
}

@ -10,7 +10,7 @@ import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringRunner;
import org.thymeleaf.context.Context;
import org.thymeleaf.spring4.SpringTemplateEngine;
import org.thymeleaf.spring5.SpringTemplateEngine;
import javax.annotation.Resource;
import java.io.IOException;

Loading…
Cancel
Save