Merge branch 'master' into develop

master
yixian 4 years ago
commit d9e5a2f3cd

@ -0,0 +1,332 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>au.com.royalpay.payment</groupId>
<artifactId>payment-parent</artifactId>
<version>2.1.46</version>
</parent>
<groupId>au.com.royalpay.payment</groupId>
<artifactId>manage</artifactId>
<version>2.3.2</version>
<licenses>
<license>
<name>Apache License, Version 2.0</name>
<url>https://www.apache.org/licenses/LICENSE-2.0</url>
</license>
</licenses>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<docker-image.version>${project.version}</docker-image.version>
<jib-maven-plugin.version>2.2.0</jib-maven-plugin.version>
</properties>
<dependencies>
<dependency>
<groupId>au.com.royalpay.payment</groupId>
<artifactId>tools</artifactId>
</dependency>
<dependency>
<groupId>au.com.royalpay.payment</groupId>
<artifactId>payment-core</artifactId>
</dependency>
<dependency>
<groupId>au.com.royalpay.payment</groupId>
<artifactId>wxpay-core</artifactId>
</dependency>
<dependency>
<groupId>au.com.royalpay.payment</groupId>
<artifactId>alipay-core</artifactId>
</dependency>
<dependency>
<groupId>au.com.royalpay.payment</groupId>
<artifactId>rppaymentsvc</artifactId>
</dependency>
<dependency>
<groupId>au.com.royalpay.payment</groupId>
<artifactId>rpay-core</artifactId>
</dependency>
<dependency>
<groupId>com.github.stuxuhai</groupId>
<artifactId>jpinyin</artifactId>
<version>1.1.7</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-mongodb</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.68</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>net.sourceforge.nekohtml</groupId>
<artifactId>nekohtml</artifactId>
</dependency>
<dependency>
<groupId>cn.yixblog.google.kaptcha</groupId>
<artifactId>kaptcha</artifactId>
<version>2.3.2</version>
</dependency>
<dependency>
<groupId>com.auth0</groupId>
<artifactId>java-jwt</artifactId>
<version>3.7.0</version>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
</dependency>
<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports</artifactId>
<version>5.6.0</version>
<exclusions>
<exclusion>
<artifactId>itext</artifactId>
<groupId>com.lowagie</groupId>
</exclusion>
<exclusion>
<artifactId>olap4j</artifactId>
<groupId>org.olap4j</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports-fonts</artifactId>
<version>6.0.0</version>
</dependency>
<dependency>
<groupId>com.lowagie</groupId>
<artifactId>itext</artifactId>
<version>2.1.7</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>2.4.8</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.14</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.14</version>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.9.2</version>
</dependency>
<dependency>
<groupId>com.notnoop.apns</groupId>
<artifactId>apns</artifactId>
</dependency>
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4.7</version>
</dependency>
<dependency>
<groupId>com.github.qcloudsms</groupId>
<artifactId>qcloudsms</artifactId>
<version>1.0.3</version>
</dependency>
<dependency>
<groupId>cn.jpush.api</groupId>
<artifactId>jpush-client</artifactId>
<version>3.3.3</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.taobao.api</groupId>
<artifactId>taobao-sdk-java-auto</artifactId>
<version>1502853394064-20180710</version>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP</artifactId>
<version>3.2.0</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<executable>true</executable>
</configuration>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.17</version>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>officedev</id>
<build>
<plugins>
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<version>${jib-maven-plugin.version}</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>build</goal>
</goals>
</execution>
</executions>
<configuration>
<from>
<image>192.168.0.84:5000/royalpay/serverjre:openj9</image>
</from>
<to>
<image>192.168.0.84:5000/royalpay/manage-dev</image>
<tags>
<tag>latest</tag>
<tag>${docker-image.version}</tag>
</tags>
</to>
<extraDirectories>
<paths>
<path>extra/</path>
</paths>
</extraDirectories>
<allowInsecureRegistries>true</allowInsecureRegistries>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>dev</id>
<build>
<plugins>
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<version>${jib-maven-plugin.version}</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>build</goal>
</goals>
</execution>
</executions>
<configuration>
<from>
<image>hkccr.ccs.tencentyun.com/rpay/serverjre:openj9</image>
</from>
<to>
<image>hkccr.ccs.tencentyun.com/cross-payment-dev/manage-dev:${docker-image.version}</image>
</to>
<extraDirectories>
<paths>
<path>extra/</path>
</paths>
</extraDirectories>
<allowInsecureRegistries>true</allowInsecureRegistries>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>prod</id>
<build>
<plugins>
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<version>${jib-maven-plugin.version}</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>build</goal>
</goals>
</execution>
</executions>
<configuration>
<from>
<image>hkccr.ccs.tencentyun.com/rpay/serverjre:openj9</image>
</from>
<to>
<image>hkccr.ccs.tencentyun.com/rpay/manage:${docker-image.version}</image>
</to>
<extraDirectories>
<paths>
<path>extra/</path>
</paths>
</extraDirectories>
<allowInsecureRegistries>true</allowInsecureRegistries>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

@ -1,6 +1,6 @@
FROM nginx:alpine
COPY openapi/* /usr/share/nginx/html/
COPY default.conf /etc/nginx/conf.d/
COPY openapi/ /usr/share/nginx/html/openapi
COPY default.conf /etc/nginx/conf.d/default.conf
EXPOSE 80

@ -815,8 +815,10 @@
* @apiVersion 1.0.0
* @apiDescription
* 若订单创建时提供了notify_url系统会在用户支付成功后向这个地址主动发送支付成功状态推送请求方式为POST
* 与服务器API不同推送校验参数会包含在json内商户系统应该验证校验参数确定来源正确后再进行后续操作
* 商户系统收到请求后应按要求返回参数若RoyalPay未收到合法参数视为商户未接收成功推送动作最多会重试3次商户系统应当能够处理收到的重复请求
* 与服务器API不同推送校验参数会包含在json内商户系统应该验证校验参数确定来源正确后再次进行订单接口查询确认订单支付状态再进行后续操作
* 商户系统收到请求后应按要求返回参数若RoyalPay未收到合法参数视为商户未接收成功推送动作最多会重试3次商户系统应当能够处理收到的重复请求
*
* <h4 style="color: red;"> 建议在收到推送后主动调用查询接口确认支付状态避免其他第三方伪造推送!!!</h4>
* @apiHeader Accept application/json
* @apiHeader Content-Type application/json
* @apiParam (JSON) {long} time UTC时间戳

@ -3,7 +3,7 @@ server {
server_name _ default;
location / {
root /usr/share/nginx/html/;
root /usr/share/nginx/html/openapi/;
index index.html;
}

@ -826,6 +826,8 @@
* Different from Server APIs, sign parameters will be included in json entity. Partner system shall valid them to prevent fake requests.
* Partner system shall response with correct parameters. If RoyalPay did not receive valid response, system will regard as receiving failed and retry the notification.
* System will retry up to3 times. Partner system shall be able to handle the repeated requests.
*
* <h4 style="color: red;"> It is recommended to actively call the query API to confirm the payment status after receiving the push, so as to prevent other third parties from forging the push!</h4>
* @apiHeader Accept application/json
* @apiHeader Content-Type application/json
* @apiParam (JSON) {long} time UTC timestamp in millis

@ -23,6 +23,15 @@ orderBasic:
operator:
type: string
description: 操作人员标识
expire:
type: string
default: 5m
pattern: ^\d([mh])$
description: |
超时时间默认5m如果商户端有全局配置则取商户配置
可以提供以下格式的精确时间yyyy-MM-dd HH:mm:ss基于GMT+10时区。
或以以下格式提供:数字+m/hm=分钟h=小时
超时时间最小1m最大24h
orderWithChannel:
allOf:
- $ref: '#/orderBasic'

@ -23,6 +23,15 @@ orderBasic:
operator:
type: string
description: mark of operator
expire:
type: string
pattern: ^\d+([mh])$
default: 5m
description: |
can provide an accurate time with format yyyy-MM-dd HH:mm:ss in GMT+10 timezone.
or in format: digits with 'm' or 'h' tail. m=minutes, h=hours.
default is 5m. if merchants has a global configuration in our backend, it will take the configuration.
no shorter than 1m and no longer than 24h
orderWithChannel:
allOf:
- $ref: '#/orderBasic'

@ -12,9 +12,9 @@ public interface AliforexcelService {
void registerWechatMerchant();
JSONObject registerRangeAlipayOnlineMerchant(int start,int end);
void registerRangeAlipayOnlineMerchant(int start,int end);
JSONObject registerAlipayMerchant();
void registerAlipayMerchant();
JSONObject registerInsertAlipayMerchant(String partners);

@ -13,6 +13,7 @@ import au.com.royalpay.payment.manage.mappers.system.ClientConfigMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientMapper;
import au.com.royalpay.payment.manage.mappers.system.SysWxMerchantApplyMapper;
import au.com.royalpay.payment.tools.exceptions.BadRequestException;
import au.com.royalpay.payment.tools.threadpool.RoyalThreadPoolExecutor;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
@ -52,6 +53,8 @@ public class AliforexcelServiceImpl implements AliforexcelService {
@Resource
private SysWxMerchantApplyMapper sysWxMerchantApplyMapper;
private Logger logger = LoggerFactory.getLogger(getClass());
@Resource
private RoyalThreadPoolExecutor royalThreadPoolExecutor;
@Override
@ -170,64 +173,120 @@ public class AliforexcelServiceImpl implements AliforexcelService {
@Override
public void registerWechatMerchant() {
List<JSONObject> apClients = clientMapper.findApClient();
apClients.forEach(client -> {
JSONObject params = new JSONObject();
params.put("merchant_name", client.getString("company_name"));
params.put("merchant_shortname", client.getString("short_name"));
params.put("office_phone", client.getString("contact_phone"));
params.put("contact_phone", client.getString("contact_phone"));
params.put("contact_email", client.getString("contact_email"));
params.put("business_category", "392");
params.put("merchant_remark", client.getString("client_moniker"));
params.put("website", client.getString("website"));
SubMerchantInfo subMerchantInfo = JSONObject.toJavaObject(params, SubMerchantInfo.class);
params.put("merchant_id", client.getString("merchant_id"));
params.put("client_id", client.getString("client_id"));
params.put("create_time", new Date());
params.put("operator", "System");
Element elem = wxPayClient.subMerchantApplication(client.getString("merchant_id"), subMerchantInfo);
String sub_merchant_id = elem.elementText("sub_mch_id");
if (StringUtils.isNotEmpty(sub_merchant_id)) {
params.put("sub_merchant_id", sub_merchant_id);
sysWxMerchantApplyMapper.insertWxMerchantApply(params);
} else {
throw new BadRequestException(elem.elementText("return_msg"));
}
royalThreadPoolExecutor.execute(() -> {
List<JSONObject> apClients = clientMapper.findApClient();
apClients.forEach(client -> {
try {
JSONObject params = new JSONObject();
params.put("merchant_name", client.getString("company_name"));
params.put("merchant_shortname", StringUtils.substring(client.getString("short_name"), 0, 20));
params.put("office_phone", client.getString("contact_phone"));
params.put("contact_phone", client.getString("contact_phone"));
params.put("contact_email", client.getString("contact_email"));
params.put("business_category", "484");
params.put("merchant_remark", client.getString("client_moniker"));
params.put("website", client.getString("company_website"));
params.put("merchant_introduction", client.getString("short_name"));
SubMerchantInfo subMerchantInfo = JSONObject.toJavaObject(params, SubMerchantInfo.class);
params.put("merchant_id", client.getString("merchant_id"));
params.put("client_id", client.getString("client_id"));
params.put("create_time", new Date());
params.put("operator", "System");
Element elem = wxPayClient.subMerchantApplication(client.getString("merchant_id"), subMerchantInfo);
String sub_merchant_id = elem.elementText("sub_mch_id");
if (StringUtils.isNotEmpty(sub_merchant_id)) {
params.put("sub_merchant_id", sub_merchant_id);
sysWxMerchantApplyMapper.insertWxMerchantApply(params);
client.put("sub_merchant_id", sub_merchant_id);
clientMapper.update(client);
} else {
throw new BadRequestException(elem.elementText("return_msg"));
}
} catch (Exception e) {
}
});
});
}
@Override
public JSONObject registerRangeAlipayOnlineMerchant(int start, int end) {
JSONObject result = new JSONObject();
List<String> needRegisterMerchant = new ArrayList<>();
List<String> registerSuccessMerchant = new ArrayList<>();
List<JSONObject> registerFailMerchant = new ArrayList<>();
List<JSONObject> lessInfoMerchant = new ArrayList<>();
List<JSONObject> alipayApClients = clientMapper.findApClient();
alipayApClients.forEach(client -> {
try {
needRegisterMerchant.add(client.getString("client_moniker"));
if (StringUtils.isBlank(client.getString("company_website"))) {
client.put("company_website", client.getString("ali_sub_merchant_id") + ".royalpay.com.au");
public void registerRangeAlipayOnlineMerchant(int start, int end) {
royalThreadPoolExecutor.execute(() -> {
List<String> needRegisterMerchant = new ArrayList<>();
List<String> registerSuccessMerchant = new ArrayList<>();
List<JSONObject> registerFailMerchant = new ArrayList<>();
List<JSONObject> lessInfoMerchant = new ArrayList<>();
List<JSONObject> alipayApClients = clientMapper.findApClient();
alipayApClients.forEach(client -> {
try {
needRegisterMerchant.add(client.getString("client_moniker"));
if (StringUtils.isBlank(client.getString("company_website"))) {
client.put("company_website", client.getString("ali_sub_merchant_id") + ".royalpay.com.au");
}
if (StringUtils.isBlank(client.getString("alipayindustry"))) {
client.put("alipayindustry", "5311");
}
if (StringUtils.isBlank(client.getString("business_structure"))) {
client.put("business_structure", "da");
}
checkPartnerInfo(client, "online");
} catch (InvalidParameterException e) {
JSONObject exception = new JSONObject();
exception.put("client_moniker", client.getString("client_moniker"));
exception.put("return_msg", e.getMessage());
exception.put("bd_name", client.getString("bd_user_name"));
lessInfoMerchant.add(exception);
}
if (StringUtils.isBlank(client.getString("alipayindustry"))) {
client.put("alipayindustry", "5311");
try {
AlipayConfig.AlipayMerchant mch = AlipayEnvironment.getEnv().getAlipayOnlineMerchant();
Element resultElement = alipayClient.registerOnlineGmsPortal(mch.getPid(), client);
if (!StringUtils.equalsIgnoreCase("T", resultElement.elementText("is_success"))) {
JSONObject exception = new JSONObject();
exception.put("client_moniker", client.getString("client_moniker"));
exception.put("return_msg", resultElement.elementText("error"));
registerFailMerchant.add(exception);
}
Element responseElement = resultElement.element("response").element("alipay");
if (!StringUtils.equalsIgnoreCase("SUCCESS", responseElement.elementText("result_code"))) {
JSONObject exception = new JSONObject();
exception.put("client_moniker", client.getString("client_moniker"));
exception.put("return_msg", resultElement.elementText("error"));
registerFailMerchant.add(exception);
}
registerSuccessMerchant.add(client.getString("client_moniker"));
} catch (Exception e) {
JSONObject exception = new JSONObject();
exception.put("client_moniker", client.getString("client_moniker"));
exception.put("return_msg", e.getMessage());
registerFailMerchant.add(exception);
}
if (StringUtils.isBlank(client.getString("business_structure"))) {
client.put("business_structure", "da");
});
});
}
@Override
public void registerAlipayMerchant() {
royalThreadPoolExecutor.execute(() -> {
JSONObject result = new JSONObject();
List<String> needRegisterMerchant = new ArrayList<>();
List<String> registerSuccessMerchant = new ArrayList<>();
List<JSONObject> registerFailMerchant = new ArrayList<>();
List<JSONObject> lessInfoMerchant = new ArrayList<>();
List<JSONObject> alipayApClients = clientMapper.findApClient();
alipayApClients.forEach(client -> {
try {
needRegisterMerchant.add(client.getString("client_moniker"));
checkPartnerInfo(client, "offline");
} catch (InvalidParameterException e) {
JSONObject exception = new JSONObject();
exception.put("client_moniker", client.getString("client_moniker"));
exception.put("return_msg", e.getMessage());
exception.put("bd_name", client.getString("bd_user_name"));
lessInfoMerchant.add(exception);
}
checkPartnerInfo(client, "online");
} catch (InvalidParameterException e) {
JSONObject exception = new JSONObject();
exception.put("client_moniker", client.getString("client_moniker"));
exception.put("return_msg", e.getMessage());
exception.put("bd_name", client.getString("bd_user_name"));
lessInfoMerchant.add(exception);
}
try {
AlipayConfig.AlipayMerchant mch = AlipayEnvironment.getEnv().getAlipayOnlineMerchant();
Element resultElement = alipayClient.registerOnlineGmsPortal(mch.getPid(), client);
AlipayConfig.AlipayMerchant mch = AlipayEnvironment.getEnv().getAlipayRetailMerchant();
Element resultElement = alipayClient.registerGmsPortal(mch.getPid(), client);
if (!StringUtils.equalsIgnoreCase("T", resultElement.elementText("is_success"))) {
JSONObject exception = new JSONObject();
exception.put("client_moniker", client.getString("client_moniker"));
@ -242,62 +301,12 @@ public class AliforexcelServiceImpl implements AliforexcelService {
registerFailMerchant.add(exception);
}
registerSuccessMerchant.add(client.getString("client_moniker"));
} catch (Exception e) {
JSONObject exception = new JSONObject();
exception.put("client_moniker", client.getString("client_moniker"));
exception.put("return_msg", e.getMessage());
registerFailMerchant.add(exception);
}
});
result.put("need_register_merchant", needRegisterMerchant);
result.put("success_register_merchant", registerSuccessMerchant);
result.put("fail_register_merchant", registerFailMerchant);
result.put("less_info_merchant", lessInfoMerchant);
});
result.put("need_register_merchant", needRegisterMerchant);
result.put("success_register_merchant", registerSuccessMerchant);
result.put("fail_register_merchant", registerFailMerchant);
result.put("less_info_merchant", lessInfoMerchant);
logger.info("-------AlipayOnline Gms end----fail_register_merchant" + registerFailMerchant.toString());
return result;
}
@Override
public JSONObject registerAlipayMerchant() {
JSONObject result = new JSONObject();
List<String> needRegisterMerchant = new ArrayList<>();
List<String> registerSuccessMerchant = new ArrayList<>();
List<JSONObject> registerFailMerchant = new ArrayList<>();
List<JSONObject> lessInfoMerchant = new ArrayList<>();
List<JSONObject> alipayApClients = clientMapper.findApClient();
alipayApClients.forEach(client -> {
try {
needRegisterMerchant.add(client.getString("client_moniker"));
checkPartnerInfo(client, "offline");
} catch (InvalidParameterException e) {
JSONObject exception = new JSONObject();
exception.put("client_moniker", client.getString("client_moniker"));
exception.put("return_msg", e.getMessage());
exception.put("bd_name", client.getString("bd_user_name"));
lessInfoMerchant.add(exception);
}
AlipayConfig.AlipayMerchant mch = AlipayEnvironment.getEnv().getAlipayRetailMerchant();
Element resultElement = alipayClient.registerGmsPortal(mch.getPid(), client);
if (!StringUtils.equalsIgnoreCase("T", resultElement.elementText("is_success"))) {
JSONObject exception = new JSONObject();
exception.put("client_moniker", client.getString("client_moniker"));
exception.put("return_msg", resultElement.elementText("error"));
registerFailMerchant.add(exception);
}
Element responseElement = resultElement.element("response").element("alipay");
if (!StringUtils.equalsIgnoreCase("SUCCESS", responseElement.elementText("result_code"))) {
JSONObject exception = new JSONObject();
exception.put("client_moniker", client.getString("client_moniker"));
exception.put("return_msg", resultElement.elementText("error"));
registerFailMerchant.add(exception);
}
registerSuccessMerchant.add(client.getString("client_moniker"));
});
result.put("need_register_merchant", needRegisterMerchant);
result.put("success_register_merchant", registerSuccessMerchant);
result.put("fail_register_merchant", registerFailMerchant);
result.put("less_info_merchant", lessInfoMerchant);
return result;
}
@Override

@ -54,6 +54,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.ui.Model;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.util.Assert;
import org.springframework.validation.Errors;
import org.springframework.web.bind.annotation.*;
@ -130,6 +131,8 @@ public class TestController {
private SynchronizedScheduler synchronizedScheduler;
@Resource
private PmtCustomReportMapper pmtCustomReportsMapper;
@Resource
private MongoTemplate mongoTemplate;
@ManagerMapping(value = "/{clientMoniker}/export/agreepdf", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.DIRECTOR, ManagerRole.OPERATOR})
public void exportAgreeFile(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, HttpServletResponse httpResponse) throws Exception {
@ -399,6 +402,17 @@ public class TestController {
clientManager.updateAllPartnerPassword("PINE");
}
// @ManagerMapping(value = "/getPineAccoutPasswd", method = RequestMethod.GET, role = ManagerRole.DEVELOPER)
// public List<JSONObject> getPineAccountPasswd() {
// Query query = new Query();
// List<TestMerchantAccountInfo> accountInfos = mongoTemplate.find(query,TestMerchantAccountInfo.class);
// List<JSONObject> accounts = new ArrayList<>();
// for (TestMerchantAccountInfo accountInfo : accountInfos) {
// accounts.add(accountInfo.toJSON());
// }
// return accounts;
// }
@ManagerMapping(value = "/secure/hanyin_reports/{date}", role = ManagerRole.DEVELOPER, method = RequestMethod.GET)
public void downloadHanyinSecureReports(@PathVariable String date, @RequestParam(defaultValue = "false") boolean upload, HttpServletResponse resp) {
tradeSecureService.manualDownloadHanyinSecureReport(DateTime.parse(date).toDate(), upload, resp);
@ -409,20 +423,20 @@ public class TestController {
return aliforexcelService.registerAlipayOnlineMerchant();
}
@ManagerMapping(value = "/register/wechatGms", role = ManagerRole.DEVELOPER, method = RequestMethod.POST)
@GetMapping(value = "/register/wechatGms")
public void registerWechatMerchant() {
aliforexcelService.registerWechatMerchant();
}
@ManagerMapping(value = "/register/alipayOnlineGms", role = ManagerRole.DEVELOPER, method = RequestMethod.GET)
public JSONObject registerRangeAlipayOnlineMerchant(@RequestParam int start, @RequestParam int end) {
return aliforexcelService.registerRangeAlipayOnlineMerchant(start, end);
@GetMapping(value = "/register/alipayOnlineGms")
public void registerRangeAlipayOnlineMerchant(@RequestParam int start, @RequestParam int end) {
aliforexcelService.registerRangeAlipayOnlineMerchant(start, end);
}
@ManagerMapping(value = "/register/alipayGms", role = ManagerRole.DEVELOPER, method = RequestMethod.POST)
public JSONObject registerAlipayMerchant() {
return aliforexcelService.registerAlipayMerchant();
@GetMapping(value = "/register/alipayGms")
public void registerAlipayMerchant() {
aliforexcelService.registerAlipayMerchant();
}
@ManagerMapping(value = "/register/alipayGms/insert_partner", role = ManagerRole.DEVELOPER, method = RequestMethod.POST)
@ -473,15 +487,8 @@ public class TestController {
}
@GetMapping(value = "/task/analysisDashboard")
public void analysisDashboard(@RequestParam("date") String date) {
synchronizedScheduler.executeProcess("manage_task:dashboardTask", 120_000,
() -> {
try {
dashboardService.generateCustomersAndOrdersStatistics(DateUtils.addDays(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(date), -1));
} catch (ParseException e) {
e.printStackTrace();
}
});
public void analysisDashboard(@RequestParam("date") String date) throws ParseException {
dashboardService.generateCustomersAndOrdersStatistics(DateUtils.parseDate(date, "yyyyMMdd"));
}

@ -21,7 +21,6 @@ import java.util.List;
@AutoMapper(tablename = "pmt_transactions", pkName = "transaction_id", keyGenerator = Jdbc3KeyGenerator.class)
public interface TransactionMapper {
@CountRef(".countTransFlowPage")
PageList<JSONObject> listTransFlowPage(JSONObject params, PageBounds pagination);
int countTransFlowPage(JSONObject params);

@ -71,6 +71,7 @@ public class PartnerApplyController {
return clientApply.listPartnerApply(manager,apply);
}
@RequestMapping(value = "/{client_apply_id}",method = RequestMethod.GET)
@RequireManager(role = {ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.OPERATOR, ManagerRole.SERVANT})
public JSONObject getApplicationDetail(@PathVariable String client_apply_id) {

@ -6,9 +6,8 @@ import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;
import javax.sql.DataSource;
import java.util.HashMap;
import java.util.Map;

@ -54,15 +54,6 @@ spring:
application:
name: @project.artifactId@
version: @project.version@
datasource:
filters: stat,wall,log4j
max-active: 1000
max-idle: 150
max-pool-prepared-statement-per-connection-size: 100
max-wait: 3000
test-while-idle: true
time-between-eviction-runs-millis: 500
validation-query: select 1
mail:
host: smtp.office365.com
port: 587

@ -227,6 +227,18 @@
and ((c.approve_result=4 and c.open_status is null) or (c.approve_result=3 and c.open_status is null) or
c.open_status=1 or c.open_status=2 or c.open_status=4)
</if>
<if test="card_approving and approving">
OR c.client_id IN (
SELECT client_id FROM sys_client_upay_profile scup
WHERE ((scup.upay_approve_result=4 and scup.upay_open_status is null) or scup.upay_open_status=1 or scup.upay_open_status=2 or scup.upay_open_status=4)
)
</if>
<if test="card_approving">
AND c.client_id IN (
SELECT client_id FROM sys_client_upay_profile scup
WHERE ((scup.upay_approve_result=4 and scup.upay_open_status is null) or scup.upay_open_status=1 or scup.upay_open_status=2 or scup.upay_open_status=4)
)
</if>
<if test="quickPass">
and c.source=4
</if>
@ -853,8 +865,15 @@
</select>
<select id="findClientAprrovingStatus" resultType="com.alibaba.fastjson.JSONObject">
SELECT * FROM sys_client_upay_profile scup
WHERE scup.client_id=#{client_id} and ((scup.upay_approve_result=4 and scup.upay_open_status is null) or scup.upay_open_status=1 or scup.upay_open_status=2 or scup.upay_open_status=4)
SELECT
*
FROM
sys_client_upay_profile scup
WHERE
scup.client_id = #{client_id}
AND (
scup.upay_approve_result = 1
OR scup.upay_open_status = 5)
</select>
<select id="listUseAlipayMerchant" resultType="int">
select client_id

@ -0,0 +1 @@
1dd6d097298adb52873a6d614aba9bbb

@ -0,0 +1 @@
8a269da4e115610c6176bd016e1ef40d

@ -0,0 +1 @@
c325a4e10d7b8db8d7024adb48473ae9

@ -1 +1 @@
f2f97656020f8839d638986e22a2b24f
f2f97656020f8839d638986e22a2b24f

Binary file not shown.

Before

Width:  |  Height:  |  Size: 215 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

@ -51,6 +51,7 @@
margin: 21px 2%;
border-radius:10px;
text-align: center;
overflow: hidden;
}
.service-info-button{
cursor:pointer;
@ -110,7 +111,7 @@
</div>
</div>
<div style="background-color: #F06101">
<div class="row border-show" style="background-color: #F06101;margin: 0; width: 100%;margin-left: 0px" >
<div class="row" style="background-color: #F06101;margin: 0; width: 100%;margin-left: 0px" >
<a class="col-md-12 col-sm-12 col-xs-12 service-info-button"
title="点击查看交易详情" ui-sref="partnerIncrementalServiceInfo({channel:service.channel})">
查看交易情况
@ -159,7 +160,7 @@
</div>
</div>
<div style="background-color: #F06101">
<div class="row border-show"
<div class="row"
ng-if="currentUser.geek_shop_status"
style="background-color: #F06101;margin: 0; width: 100%;margin-left: 0px" >
<a class="col-md-12 col-sm-12 col-xs-12 service-info-button"

@ -62,15 +62,15 @@
<td ng-bind="cashier.nick_name"></td>
<td ng-bind="cashier.create_time"></td>
<td>
<a ng-if="!cashier.is_valid" class="text-primary" style="padding-right: 5px" role="button" title="Detail">
<a class="text-primary" ng-if="!cashier.is_valid" role="button" style="padding-right: 5px" title="Detail">
<i class="text-danger fa fa-close"></i>
</a>
<a ng-if="cashier.is_valid" class="text-primary" style="padding-right: 5px" role="button" title="Detail">
<a class="text-primary" ng-if="cashier.is_valid" role="button" style="padding-right: 5px" title="Detail">
<i class="text-success fa fa-check"></i>
</a>
</td>
<td>
<a ng-if="cashier.is_valid" class="text-primary" style="padding-right: 5px" role="button" title="Edit"
<a class="text-primary" ng-if="cashier.is_valid" role="button" style="padding-right: 5px" title="Edit"
ui-sref=".edit({cashier_id:cashier.cashier_id})">
<i class="fa fa-pencil-square-o"></i>
</a>

@ -185,34 +185,6 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
})
};
$scope.loadAlipayCategory();
$scope.loadJDindustry = function () {
$http.get('/static/data/jdindustry.json').then(function (resp) {
$scope.jdindustry = resp.data;
})
};
$scope.loadJDindustry();
$scope.loadLakalaPayindustry = function () {
$http.get('/static/data/lakalapayindustry.json').then(function (resp) {
$scope.lakalapayindustry = resp.data;
})
};
$scope.loadLakalaPayindustry();
$scope.loadLakalaPaySettle = function () {
$http.get('/static/data/lakalapaysettle.json').then(function (resp) {
$scope.lakalapaysettle = resp.data;
})
};
$scope.loadLakalaPaySettle();
$scope.loadLakalaPayGoods = function () {
$http.get('/static/data/lakalapaygoods.json').then(function (resp) {
$scope.lakalapaygoods = resp.data;
})
};
$scope.loadLakalaPayGoods();
$scope.loadRoyalpayindustry = function () {
$http.get('/static/data/royalpayindustry.json').then(function (resp) {
$scope.royalpayindustry = resp.data;
@ -220,13 +192,6 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
};
$scope.loadRoyalpayindustry();
$scope.loadHfindustry = function () {
$http.get('/static/data/hfindustry.json').then(function (resp) {
$scope.hfindustry = resp.data;
})
};
$scope.loadHfindustry();
$scope.onAlipayMccSelect = function (selectedItem) {
$scope.partner.alipay_category = selectedItem.label;
$scope.partner.alipayindustry = selectedItem.mccCode;
@ -237,13 +202,6 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
$scope.partner.royalpayindustry = selectedItem.mccCode;
};
$scope.onHfIndustrySelect = function (selectedItem) {
$scope.partner.hf_label = selectedItem.label;
$scope.partner.hfindustry = selectedItem.mccCode;
};
// $scope.t2city_map = angular.copy(t2city_map);
$scope.timezones = timezone.configs();
$scope.checkMerchantCodeIsValid = function (code) {
if (code.length != 4) {
@ -663,34 +621,6 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
})
};
$scope.loadAlipayCategory();
$scope.loadJDindustry = function () {
$http.get('/static/data/jdindustry.json').then(function (resp) {
$scope.jdindustry = resp.data;
})
};
$scope.loadJDindustry();
$scope.loadLakalaPayindustry = function () {
$http.get('/static/data/lakalapayindustry.json').then(function (resp) {
$scope.lakalapayindustry = resp.data;
})
};
$scope.loadLakalaPayindustry();
$scope.loadLakalaPaySettle = function () {
$http.get('/static/data/lakalapaysettle.json').then(function (resp) {
$scope.lakalapaysettle = resp.data;
})
};
$scope.loadLakalaPaySettle();
$scope.loadLakalaPayGoods = function () {
$http.get('/static/data/lakalapaygoods.json').then(function (resp) {
$scope.lakalapaygoods = resp.data;
})
};
$scope.loadLakalaPayGoods();
$scope.loadRoyalpayindustry = function () {
$http.get('/static/data/royalpayindustry.json').then(function (resp) {
$scope.royalpayindustry = resp.data;
@ -698,13 +628,6 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
};
$scope.loadRoyalpayindustry();
$scope.loadHfindustry = function () {
$http.get('/static/data/hfindustry.json').then(function (resp) {
$scope.hfindustry = resp.data;
})
};
$scope.loadHfindustry();
$scope.onAlipayMccSelect = function (selectedItem) {
$scope.partner.alipay_category = selectedItem.label;
$scope.partner.alipayindustry = selectedItem.mccCode;
@ -713,11 +636,6 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
$scope.partner.royalpay_label = selectedItem.label;
$scope.partner.royalpayindustry = selectedItem.mccCode;
};
$scope.onHfIndustrySelect = function (selectedItem) {
$scope.partner.hf_label = selectedItem.label;
$scope.partner.hfindustry = selectedItem.mccCode;
};
$scope.updatePartner = function (form) {
if (form.$invalid) {

@ -211,447 +211,8 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
url: '/incremental_service',
templateUrl: 'static/payment/partner/templates/incremental_service.html',
controller: 'incrementalServiceCtrl'
}).state('partners.edit', {
url: '/{clientMoniker}/edit',
params: {"commitCardPayment": false, "commitCrossBorderPayment": false},
templateUrl: 'static/payment/partner/templates/partner_edit.html',
controller: 'partnerEditCtrl',
resolve: {
partner: ['$http', '$stateParams', function ($http, $stateParams) {
return $http.get('/sys/partners/' + $stateParams.clientMoniker);
}]
}
});
}]);
app.controller('partnerEditCtrl', ['$scope', '$http', '$state', 'Upload', 'commonDialog', 'timezone', 'partner', 'upayIndustryMap',
function ($scope, $http, $state, Upload, commonDialog, timezone, partner, upayIndustryMap) {
$scope.upayIndustrys = upayIndustryMap.configs();
$scope.timezones = timezone.configs();
$scope.partner = partner.data;
if (!$scope.partner.client_type) {
$scope.partner.client_type = 'cross-border';
}
if ($scope.partner.representativeInfo != null) {
$scope.partner.registered_address = $scope.partner.representativeInfo.address;
$scope.partner.registered_suburb = $scope.partner.representativeInfo.suburb;
$scope.partner.registered_postcode = $scope.partner.representativeInfo.postcode;
$scope.partner.registered_state = $scope.partner.representativeInfo.state;
$scope.partner.legal_representative_person = $scope.partner.representativeInfo.representative_person;
$scope.partner.legal_representative_phone = $scope.partner.representativeInfo.phone;
$scope.partner.legal_representative_email = $scope.partner.representativeInfo.email;
$scope.partner.legal_representative_job = $scope.partner.representativeInfo.job_title;
$scope.partner.marketing_person = $scope.partner.representativeInfo.marketing_person;
$scope.partner.marketing_phone = $scope.partner.representativeInfo.marketing_phone;
$scope.partner.marketing_email = $scope.partner.representativeInfo.marketing_email;
$scope.partner.marketing_job = $scope.partner.representativeInfo.marketing_job_title;
$scope.partner.legal_representative_wechatid = $scope.partner.representativeInfo.legal_representative_wechatid;
$scope.partner.marketing_wechatid = $scope.partner.representativeInfo.marketing_wechatid;
}
$scope.enablePaymentType = function (type) {
$scope.partner[type] = !$scope.partner[type];
};
if ($state.params.commitCardPayment) {
$scope.enablePaymentType('enable_card_payment');
}
if ($state.params.commitCrossBorderPayment) {
$scope.enablePaymentType('enable_cross_payment');
}
function hasRole() {
var rolenum;
switch (sessionStorage.getItem('role')) {
case "administrator":
rolenum = 1;
break;
case "bduser":
rolenum = 4;
break;
case "salesmanager":
rolenum = 8192;
break;
case "accountant":
rolenum = 8;
break;
case "sitemanager":
rolenum = 128;
break;
case "director":
rolenum = 64;
break;
case "developer":
rolenum = 256;
break;
case "compliance":
rolenum = 2;
break;
case "guest":
rolenum = 2048;
break;
case "orgmanager":
rolenum = 4096;
break;
case "riskmanager":
rolenum = 1024;
break;
default:
break;
}
if ((window.currentUser.role & rolenum) > 0) {
return true;
} else {
sessionStorage.removeItem('role');
return false;
}
}
if (hasRole()) {
$scope.role = sessionStorage.getItem('role');
}
var origin_referrer_id = angular.copy($scope.partner.referrer_id);
var resetClientPayDescByTpey = function (type) {
type = parseInt(type);
if (type == 1) {
removeClientPayDesc($scope.partner.client_pay_desc, '10');
}
if (type == 2) {
removeClientPayDesc($scope.partner.client_pay_desc, '20');
}
};
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;
}
}
$scope.toggleClientPayType = function (type) {
if (!$scope.partner.client_pay_type) {
$scope.partner.client_pay_type = [];
}
var $idx = $scope.partner.client_pay_type.indexOf(type);
if ($idx >= 0) {
$scope.partner.client_pay_type.splice($idx, 1);
resetClientPayDescByTpey(type);
} else {
$scope.partner.client_pay_type.push(type);
$scope.partner.client_pay_type.sort(compare);
}
};
$scope.toggleClientPayDesc = function (type) {
if (!$scope.partner.client_pay_desc) {
$scope.partner.client_pay_desc = [];
}
var $idx = $scope.partner.client_pay_desc.indexOf(type);
if ($idx >= 0) {
if (type == '203') {
removeClientPayDesc($scope.partner.client_pay_desc, '2030')
}
$scope.partner.client_pay_desc.splice($idx, 1);
} else {
$scope.partner.client_pay_desc.push(type);
$scope.partner.client_pay_desc.sort(compare);
}
};
$scope.partner.sameAsContactPerson = false;
$scope.checkboxOnclick = function () {
$scope.partner.sameAsContactPerson = !($scope.partner.sameAsContactPerson);
if ($scope.partner.sameAsContactPerson) {
$scope.partner.legal_representative_person = $scope.partner.contact_person;
$scope.partner.legal_representative_phone = $scope.partner.contact_phone;
$scope.partner.legal_representative_email = $scope.partner.contact_email;
$scope.partner.legal_representative_job = $scope.partner.contact_job;
$scope.partner.legal_representative_wechatid = $scope.partner.contact_wechatid;
}
}
$scope.partner.marketingSameAsContact = false;
$scope.checkMarketingSameAsContact = function () {
$scope.partner.marketingSameAsContact = !($scope.partner.marketingSameAsContact);
if ($scope.partner.marketingSameAsContact) {
$scope.partner.marketing_person = $scope.partner.contact_person;
$scope.partner.marketing_phone = $scope.partner.contact_phone;
$scope.partner.marketing_email = $scope.partner.contact_email;
$scope.partner.marketing_job = $scope.partner.contact_job;
$scope.partner.marketing_wechatid = $scope.partner.contact_wechatid;
}
}
$scope.partner.sameAsAddress = false;
$scope.sameAddress = function () {
$scope.partner.sameAsAddress = !($scope.partner.sameAsAddress);
if ($scope.partner.sameAsAddress) {
$scope.partner.registered_address = $scope.partner.address;
$scope.partner.registered_suburb = $scope.partner.suburb;
$scope.partner.registered_postcode = $scope.partner.postcode;
$scope.partner.registered_state = $scope.partner.state;
}
}
$scope.listReferrers = function () {
$http.get('/sys/orgs/referrer').then(function (resp) {
$scope.referrers = resp.data;
})
};
$scope.listReferrers();
$scope.loadAlipayCategory = function () {
$http.get('/static/data/alipayMcc.json').then(function (resp) {
$scope.alipayMccCategory = resp.data;
})
};
$scope.loadAlipayCategory();
$scope.loadJDindustry = function () {
$http.get('/static/data/jdindustry.json').then(function (resp) {
$scope.jdindustry = resp.data;
})
};
$scope.loadJDindustry();
$scope.loadLakalaPayindustry = function () {
$http.get('/static/data/lakalapayindustry.json').then(function (resp) {
$scope.lakalapayindustry = resp.data;
})
};
$scope.loadLakalaPayindustry();
$scope.loadLakalaPaySettle = function () {
$http.get('/static/data/lakalapaysettle.json').then(function (resp) {
$scope.lakalapaysettle = resp.data;
})
};
$scope.loadLakalaPaySettle();
$scope.loadLakalaPayGoods = function () {
$http.get('/static/data/lakalapaygoods.json').then(function (resp) {
$scope.lakalapaygoods = resp.data;
})
};
$scope.loadLakalaPayGoods();
$scope.loadRoyalpayindustry = function () {
$http.get('/static/data/royalpayindustry.json').then(function (resp) {
$scope.royalpayindustry = resp.data;
})
};
$scope.loadRoyalpayindustry();
$scope.loadHfindustry = function () {
$http.get('/static/data/hfindustry.json').then(function (resp) {
$scope.hfindustry = resp.data;
})
};
$scope.loadHfindustry();
$scope.onAlipayMccSelect = function (selectedItem) {
$scope.partner.alipay_category = selectedItem.label;
$scope.partner.alipayindustry = selectedItem.mccCode;
};
$scope.onRoyalPayIndustrySelect = function (selectedItem) {
$scope.partner.royalpay_label = selectedItem.label;
$scope.partner.royalpayindustry = selectedItem.mccCode;
};
$scope.onHfIndustrySelect = function (selectedItem) {
$scope.partner.hf_label = selectedItem.label;
$scope.partner.hfindustry = selectedItem.mccCode;
};
$scope.updatePartner = function (form) {
if (form.$invalid) {
angular.forEach(form, function (item, key) {
if (key.indexOf('$') < 0) {
item.$dirty = true;
}
});
return;
}
if ($scope.partner.company_name.indexOf("Migration") != -1) {
alert("Company Name包含敏感词汇请检查后重新提交");
return;
}
if ($scope.partner.company_phone.indexOf(' ') != -1) {
alert('Company Phone can not contain space character');
return;
}
if ($scope.partner.contact_email.indexOf(' ') != -1) {
alert('Contact email Phone can not contain space character');
return;
}
if ($scope.partner.suburb.indexOf(' ') != -1) {
alert('suburb can not contain two and more continuous space characters');
return;
}
if ($scope.partner.client_pay_type.indexOf('2') >= 0) {
if (!$scope.partner.company_photo) {
alert('Shop Photo1 is necessary');
return;
}
if (!$scope.partner.store_photo) {
alert('Shop Photo2 is necessary');
return;
}
}
if ($scope.partner.acn && $scope.partner.business_structure == 'Company') {
if ($scope.partner.acn.length != 9) {
alert('Acn is not valid');
}
}
if ($scope.partner.referrer_id) {
$scope.referrers.forEach(function (e) {
if ($scope.partner.referrer_id == e.org_id) {
$scope.partner.referrer_name = e.name;
return;
}
})
}
var content = '';
if (!origin_referrer_id && $scope.partner.referrer_id) {
content = 'Update partner info successfully,But You Had add new Referrer,Please Change the BD Commission Proportion!';
}
if ($scope.partner.client_pay_type.length == 0) {
alert('请选择商户支付场景')
return;
}
if ($scope.partner.client_pay_desc.length == 0) {
alert('请选择商户支付方式')
return;
}
if ($scope.partner.client_pay_type.indexOf('1') >= 0) {
if ($scope.partner.client_pay_desc.join(',').indexOf('10') < 0) {
alert("请检查线上支付场景是否已选择支付方式");
return;
}
}
if ($scope.partner.client_pay_type.indexOf('2') >= 0) {
if ($scope.partner.client_pay_desc.join(',').indexOf('20') < 0) {
alert("请检查线下支付场景是否已选择支付方式");
return;
}
}
if ($scope.partner.client_pay_desc.join(',').indexOf('203') >= 0) {
if ($scope.partner.client_pay_desc.join(',').indexOf('2030') < 0 && $scope.partner.client_pay_desc.join(',').indexOf('20399') < 0) {
alert("请检查线下支付是否已选择收银系统类型");
return;
}
}
$scope.partner.client_pay_type = $scope.partner.client_pay_type.join(',');
$scope.partner.client_pay_desc = $scope.partner.client_pay_desc.join(',');
$http.put('/sys/partners/' + $scope.partner.client_moniker, $scope.partner).then(function () {
if (content != '') {
commonDialog.alert({
title: 'Warning',
content: content,
type: 'error'
});
} else {
commonDialog.alert({
title: 'Success',
content: 'Update partner information successfully',
type: 'success'
});
}
$scope.updateMerchantLocation();
$scope.loadPartners();
$state.go('^.detail', {clientMoniker: $scope.partner.client_moniker}, {reload: true});
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
});
};
$scope.uploadLogo = function (file) {
if (file != null) {
if (file.size > 1 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过1MB请压缩后重试', type: 'error'})
} else {
$scope.logoProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.logoProgress;
$scope.partner.logo_id = resp.data.fileid;
$scope.partner.logo_url = resp.data.url;
}, function (resp) {
delete $scope.logoProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.logoProgress.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.partner.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);
})
}
}
};
$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.partner.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.getMerchantLocation = function () {
$http.get('/sys/partners/' + $scope.partner.client_moniker + '/location').then(function (resp) {
$scope.merchant_location = resp.data;
});
};
$scope.getMerchantLocation();
$scope.updateMerchantLocation = function () {
var params = window.frames['merchant_detail'].merchant_location;
if (params) {
$http.put('/sys/partners/modify/' + $scope.partner.client_moniker + '/location', params).then(function () {
});
}
}
}]);
app.controller('partnerListCtrl', ['$scope', '$sce', '$http', '$filter', '$uibModal', 'businessStructuresMap', 'industryMap', 'stateMap', 'sectorMap', 'countryMap',
function ($scope, $sce, $http, $filter, $uibModal, businessStructuresMap, industryMap, stateMap, sectorMap, countryMap) {

@ -246,7 +246,7 @@
<label class="control-label col-sm-4"
for="royalpayindustry">RP商户类别</label>
<div class="col-sm-6">
<input style="background-color:#fff"
<input style="background-color:#fff;padding:6px 7px;border-radius: 7px;"
class="form-control" id="royalpayindustry"
name="royalpayindustry" readonly
ng-value="params.industry|partner_royalpay_industry"

@ -14,7 +14,7 @@ $(function () {
window.redirect = redirect;
}
}
setTimeout(checkStatus, 3000);
setTimeout(checkStatus, 1000);
// if (window.disable_ws) {
//
//
@ -49,7 +49,7 @@ $(function () {
}
location.href = window.redirect + concat + 'time=' + status.time + '&nonce_str=' + status.nonce_str + '&sign=' + status.sign;
} else {
setTimeout(checkStatus, 3000);
setTimeout(checkStatus, 1000);
}
}
})

@ -30,17 +30,77 @@ import java.util.Date;
@SpringBootTest
public class GatewayApplicationMerchantDemoTest {
static String SHORTID = "NH6NR8J53M";
static String RPDEMOPUBKEY = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtBE+bgY1FHUOP/7PIDdRZH8BUkDJBpZkI5kh+ytJs7uLJY7LJMOG2HTkJv5SdzdsBBaJgGAHcIjZrsd6oRrcBohWmAxTN0p+vlQEwNd689mlOAObds23lXWtn+huDv8cjorC4Doy79grPni8SZYJocqs9qFpdaQLIZaGUIRTIE0eTSV2tZ3ry4l6kNdFLpkBvXW76iWC6CZcrfuGcgiJq438CmFeXrY5HQPjRZfq243fFjyMPmc9ZfGiwqJERCQlwmLtVcgWPTjkIEhpPt8bldV6kZ9ctSUJr+KyC827kHrn/YAFj5DJWqX4mXW84w1OUeQZQlPOpNvzojbMfiW60wIDAQAB";
static String SPDEMOPRIKEY = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCdIiy3fFUrZx4X0aIU37PGzViqG03yRDprSk2tqhORnAiZL3sLNFsjmy2FR4+84bksp2VxIc+rMot+4iFIAmpK50t6qj2Fz7sO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Ma0Mo903JqAYA/22S6mbjeqJjO4+rLPZ0rJ5DbX0ltOwKBgA+3rYwaiHVfRZ69/g6W/eWUqL4TenMS0PiKkkdEJt6hGvTQz6methDTtWCkHAKDbe3ActMTt8RmoqgMMLvoTWgz4duwOknHGHgUFNa4ZeCFDx47Dknyet+QUOSsxTZ1SN/pIOBc2G9tFhkAJECytBumGVmCQrAv9pdPyyhPeHLhAoGATvtEmi3oYPQtoy8qDEhI8wCXrrKIZh2a7ahRjt8B056HZ26EjalKg2Yz+5WTRbS6Bgr8ZN+12wRl7CbjWyr+loOEsMTjAuJoxGDo9bm936IqvmwVlEdLkOoMoFnJY6OFiVqWmLIXHr56+z2ShryZVPc59gdLxNRA+ZJMF5kY27s=";
static String SPDEMOPUBKEY = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnSIst3xVK2ceF9GiFN+zxs1YqhtN8kQ6a0pNraoTkZwImS97CzRbI5sthUePvOG5LKdlcSHPqzKLfuIhSAJqSudLeqo9hc+7DjuQzEjdKUTfX5SKkNURSmJyEDfgcpnyfW12zDdmjfrG32c2UUwGT7SbhEvSSK5lA4uDcDXqgUo4X5VKpcmMd3ozMdgq8RwEvt+VuXwCvPHv//UkIjHSh8zTxZeL17QjKk2OzJO33my37BtGmkVTDP0Dnk+e7LMwd1om98FBYvcRrKnai4tLJAFnOEJjhjqLnu7r4noIRVmVxE3xTfyt8Es+U81UueZmtrtyjpJ/PzOBOyfekR8wDwIDAQAB";
/**
* The demo can run tests directly
*/
private static Provider securityProvider = new BouncyCastleProvider();
private Logger logger = LoggerFactory.getLogger(getClass());
static String SHORTID = "NH6NR8J53M";
static String RPDEMOPUBKEY = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtBE+bgY1FHUOP/7PIDdRZH8BUkDJBpZkI5kh+ytJs7uLJY7LJMOG2HTkJv5SdzdsBBaJgGAHcIjZrsd6oRrcBohWmAxTN0p+vlQEwNd689mlOAObds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k2OzJO33my37BtGmkVTDP0Dnk+e7LMwd1om98FBYvcRrKnai4tLJAFnOEJjhjqLnu7r4noIRVmVxE3xTfyt8Es+U81UueZmtrtyjpJ/PzOBOyfekR8wDwIDAQAB";
private static PublicKey loadPublicKey(InputStream ins) {
try {
BufferedReader reader = new BufferedReader(new InputStreamReader(ins));
String line;
StringBuilder certBuffer = new StringBuilder();
while ((line = reader.readLine()) != null) {
if (line.startsWith("-")) {
continue;
}
certBuffer.append(line).append("\r");
}
return resolvePublic(Base64.decodeBase64(certBuffer.toString()));
} catch (IOException | InvalidKeySpecException e) {
throw new ServerErrorException(e);
} finally {
IOUtils.closeQuietly(ins);
}
}
private Logger logger = LoggerFactory.getLogger(getClass());
private static PublicKey resolvePublic(byte[] bytes) throws InvalidKeySpecException {
X509EncodedKeySpec x509 = new X509EncodedKeySpec(bytes);
try {
KeyFactory factory = KeyFactory.getInstance("RSA", securityProvider);
return factory.generatePublic(x509);
} catch (NoSuchAlgorithmException e) {
//Shall Never Happense
e.printStackTrace();
return null;
}
}
private static PrivateKey loadPrivateKey(InputStream ins) {
try {
BufferedReader reader = new BufferedReader(new InputStreamReader(ins));
String line;
StringBuilder certBuffer = new StringBuilder();
while ((line = reader.readLine()) != null) {
if (line.startsWith("-")) {
continue;
}
certBuffer.append(line);
}
return resolvePrivate(Base64.decodeBase64(certBuffer.toString()));
} catch (IOException | InvalidKeySpecException e) {
throw new ServerErrorException(e);
} finally {
IOUtils.closeQuietly(ins);
}
}
private static PrivateKey resolvePrivate(byte[] bytes) throws InvalidKeySpecException {
PKCS8EncodedKeySpec pkcs8 = new PKCS8EncodedKeySpec(bytes);
try {
KeyFactory factory = KeyFactory.getInstance("RSA", securityProvider);
return factory.generatePrivate(pkcs8);
} catch (NoSuchAlgorithmException e) {
//Shall Never happens
e.printStackTrace();
return null;
}
}
@Test
public void applicationMerchant() throws Exception {
@ -139,7 +199,6 @@ public class GatewayApplicationMerchantDemoTest {
return checkSign(JSONObject.toJSONBytes(data, SerializerFeature.MapSortField), sign, RPDEMOPUBKEY);
}
@Test
public void queryMerchantStatus() throws Exception{
String partnerCode = "PHQ3";
@ -220,66 +279,4 @@ public class GatewayApplicationMerchantDemoTest {
throw new ServerErrorException(e);
}
}
private static PublicKey loadPublicKey(InputStream ins) {
try {
BufferedReader reader = new BufferedReader(new InputStreamReader(ins));
String line;
StringBuilder certBuffer = new StringBuilder();
while ((line = reader.readLine()) != null) {
if (line.startsWith("-")) {
continue;
}
certBuffer.append(line).append("\r");
}
return resolvePublic(Base64.decodeBase64(certBuffer.toString()));
} catch (IOException | InvalidKeySpecException e) {
throw new ServerErrorException(e);
} finally {
IOUtils.closeQuietly(ins);
}
}
private static PublicKey resolvePublic(byte[] bytes) throws InvalidKeySpecException {
X509EncodedKeySpec x509 = new X509EncodedKeySpec(bytes);
try {
KeyFactory factory = KeyFactory.getInstance("RSA", securityProvider);
return factory.generatePublic(x509);
} catch (NoSuchAlgorithmException e) {
//Shall Never Happense
e.printStackTrace();
return null;
}
}
private static PrivateKey loadPrivateKey(InputStream ins) {
try {
BufferedReader reader = new BufferedReader(new InputStreamReader(ins));
String line;
StringBuilder certBuffer = new StringBuilder();
while ((line = reader.readLine()) != null) {
if (line.startsWith("-")) {
continue;
}
certBuffer.append(line);
}
return resolvePrivate(Base64.decodeBase64(certBuffer.toString()));
} catch (IOException | InvalidKeySpecException e) {
throw new ServerErrorException(e);
} finally {
IOUtils.closeQuietly(ins);
}
}
private static PrivateKey resolvePrivate(byte[] bytes) throws InvalidKeySpecException {
PKCS8EncodedKeySpec pkcs8 = new PKCS8EncodedKeySpec(bytes);
try {
KeyFactory factory = KeyFactory.getInstance("RSA", securityProvider);
return factory.generatePrivate(pkcs8);
} catch (NoSuchAlgorithmException e) {
//Shall Never happens
e.printStackTrace();
return null;
}
}
}

Loading…
Cancel
Save