diff --git a/extra/wx_test.p12 b/extra/wx_test.p12
new file mode 100644
index 000000000..f8962b8cf
Binary files /dev/null and b/extra/wx_test.p12 differ
diff --git a/pom.xml b/pom.xml
index d7e61a127..c4d11367e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,12 +5,12 @@
au.com.royalpay.payment
payment-parent
- 1.0.4
+ 1.0.6
4.0.0
manage
- 1.0.33
+ 1.0.34
UTF-8
diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientApplyMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientApplyMapper.java
index e8938bcb6..5e221cd6e 100644
--- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientApplyMapper.java
+++ b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientApplyMapper.java
@@ -24,6 +24,9 @@ public interface ClientApplyMapper {
@AutoSql(type = SqlType.SELECT)
JSONObject findClientApplicationById(@Param("client_apply_id") String client_apply_id);
+ @AutoSql(type = SqlType.SELECT)
+ JSONObject findClientApplicationByClientMoniker(@Param("client_moniker") String client_moniker);
+
PageList listPartnerApplications(JSONObject params, PageBounds pageBounds);
@AutoSql(type = SqlType.COUNT)
diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientApplyImpl.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientApplyImpl.java
index 2d9c07f5d..d2e549f7a 100644
--- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientApplyImpl.java
+++ b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientApplyImpl.java
@@ -218,8 +218,36 @@ public class ClientApplyImpl implements ClientApply, ApplicationEventPublisherAw
partner.put("bd_user", manager.getString("manager_id"));
partner.put("bd_user_name", manager.getString("display_name"));
- if (clientMapper.findClientByMoniker(info.getClientMoniker()) != null) {
- throw new BadRequestException("error.partner.valid.dumplicate_client_moniker");
+ JSONObject client;
+
+ if ((client = clientMapper.findClientByMoniker(info.getClientMoniker())) != null) {
+ if( manager.getString("manager_id").equals(client.getString("creator")) )
+ {
+ if(clientApplyMapper.findClientApplicationByClientMoniker(info.getClientMoniker()) != null)
+ {
+ throw new BadRequestException("无效,已关联商户");
+ }
+ JSONObject client_bd = new JSONObject();
+ client_bd.put("client_id", partner.getIntValue("client_id"));
+ client_bd.put("bd_id", manager.getString("manager_id"));
+ client_bd.put("bd_name", manager.getString("display_name"));
+ client_bd.put("create_time", new Date());
+ client_bd.put("create_id", manager.getString("manager_id"));
+ client_bd.put("start_date", new Date());
+ client_bd.put("proportion", 1);
+ clientBDMapper.saveBD(client_bd);
+
+ apply.put("client_apply_id", client_apply_id);
+ apply.put("client_id", partner.getIntValue("client_id"));
+ apply.put("client_moniker", info.getClientMoniker());
+ apply.put("apply_approve_result", 2);
+ apply.put("apply_approve_time", new Date());
+ clientApplyMapper.updatePartnerApplication(apply);
+
+ return partner;
+ }
+ throw new BadRequestException("您只能关联自己创建的商户");
+ //throw new BadRequestException("error.partner.valid.dumplicate_client_moniker");
}
partner.put("source", 2);//自主申请
partner.put("country", "AUS");//自主申请
diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties
index c8844ef37..d177ae586 100644
--- a/src/main/resources/application.properties
+++ b/src/main/resources/application.properties
@@ -88,7 +88,7 @@ app.mail.appid=1
app.mail.host=https://mailsupport.royalpay.com.au
mail.send.credentialCode=Fd1aRfdjc9
-spring.thymeleaf.mode=LEGACYHTML5
+spring.thymeleaf.mode=HTML
app.mpsupport.host=https://mp.royalpay.com.au
app.foreign-currency=AUD