diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java index f8e0e53ca..a3161f2ab 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java @@ -575,8 +575,13 @@ public class RetailAppServiceImp implements RetailAppService { } break; case "Wechat": - JSONObject weUser = customerMapper.findCustomerByOpenId(customer_id); - if (weUser != null) { + JSONObject weUser = new JSONObject(); + if (customer_id.startsWith("olH")){ + weUser = customerMapper.findCustomerGlobalpayByOpenId(customer_id); + }else { + weUser = customerMapper.findCustomerByOpenId(customer_id); + } + if (weUser != null && !weUser.isEmpty()) { order.put("nickname", weUser.getString("nickname")); order.put("headimg", weUser.getString("headimg")); } diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java index 37e3b1f03..573d5f261 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java @@ -77,4 +77,8 @@ public interface ClientMapper { @AutoSql(type = SqlType.SELECT) List AllClients(); + + @AutoSql(type = SqlType.SELECT) + @AdvanceSelect(addonWhereClause = "is_valid=1") + List listClientsByBD(@Param("bd_user") String bd_user); } diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/CustomerMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/CustomerMapper.java index ee685e444..cfcc331b0 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/CustomerMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/system/CustomerMapper.java @@ -22,6 +22,9 @@ public interface CustomerMapper { @AutoSql(type = SqlType.SELECT) JSONObject findCustomerByOpenId(@Param("wechat_openid") String openId); + @AutoSql(type = SqlType.SELECT) + JSONObject findCustomerGlobalpayByOpenId(@Param("globalpay_openid") String openId); + @AutoSql(type = SqlType.SELECT) @AdvanceSelect(addonWhereClause = "wechat_openid like 'o32%'") JSONObject findCustomerBykangaOpenid(@Param("kanga_openid") String openId); diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java index dad9cb47d..b7abe8361 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java @@ -296,4 +296,6 @@ public interface ClientManager { void sendVerifyEmail(JSONObject client,String accountId); JSONObject getWithConfig(int client_id); + + List getClientsByBD(String bd_user); } diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java index 4e8823ee9..25e3b7319 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java @@ -3458,4 +3458,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid clientWithConfig.putAll(clientConfigService.find(client_id)); return clientWithConfig; } + + @Override + public List getClientsByBD(String bd_user) { + return clientMapper.listClientsByBD(bd_user); + } } diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java b/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java index 77bde5762..61baace0f 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java @@ -1,13 +1,7 @@ package au.com.royalpay.payment.manage.merchants.web; import au.com.royalpay.payment.manage.dev.core.MerchantLocationService; -import au.com.royalpay.payment.manage.merchants.beans.BankAccountInfo; -import au.com.royalpay.payment.manage.merchants.beans.ClientAuthFilesInfo; -import au.com.royalpay.payment.manage.merchants.beans.ClientRateConfig; -import au.com.royalpay.payment.manage.merchants.beans.ClientRegisterInfo; -import au.com.royalpay.payment.manage.merchants.beans.NewAccountBean; -import au.com.royalpay.payment.manage.merchants.beans.PartnerQuery; -import au.com.royalpay.payment.manage.merchants.beans.SubMerchantIdApply; +import au.com.royalpay.payment.manage.merchants.beans.*; import au.com.royalpay.payment.manage.merchants.core.ClientManager; import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; import au.com.royalpay.payment.manage.permission.manager.RequireManager; @@ -17,25 +11,16 @@ import au.com.royalpay.payment.tools.CommonConsts; import au.com.royalpay.payment.tools.http.HttpUtils; import au.com.royalpay.payment.tools.merchants.beans.QRCodeConfig; import au.com.royalpay.payment.tools.permission.enums.ManagerRole; - import com.alibaba.fastjson.JSONObject; - import org.springframework.validation.Errors; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -import java.io.IOException; -import java.io.OutputStream; -import java.util.List; +import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; +import java.io.IOException; +import java.io.OutputStream; +import java.util.List; /** * Created by yixian on 2016-06-27. @@ -533,4 +518,5 @@ public class PartnerManageController { return clientManager.getClientSubMerchantIdLogs(clientMoniker,manager); } + } diff --git a/src/main/java/au/com/royalpay/payment/manage/tradelog/core/impls/TradeLogServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/tradelog/core/impls/TradeLogServiceImpl.java index bbcdb18a6..5fc2e3f8b 100644 --- a/src/main/java/au/com/royalpay/payment/manage/tradelog/core/impls/TradeLogServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/tradelog/core/impls/TradeLogServiceImpl.java @@ -386,8 +386,13 @@ public class TradeLogServiceImpl implements TradeLogService { TimeZoneUtils.switchTimeZone(order, timezone, "create_time", "confirm_time", "transaction_time"); } - JSONObject customer = customerMapper.findCustomerByOpenId(order.getString("customer_id")); - if (customer != null) { + JSONObject customer = new JSONObject(); + if (order.getString("customer_id").startsWith("olH")){ + customer = customerMapper.findCustomerGlobalpayByOpenId(order.getString("customer_id")); + }else { + customer = customerMapper.findCustomerByOpenId(order.getString("customer_id")); + } + if (customer != null && !customer.isEmpty()) { order.put("headimg", customer.getString("headimg")); order.put("nickname", customer.getString("nickname")); }