diff --git a/pom.xml b/pom.xml index 34a5bd459..edf11b4ce 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ 4.0.0 manage - 1.3.30 + 1.3.32 UTF-8 1.4.0 diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/DashboardServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/DashboardServiceImpl.java index d2e43a4fa..0c558bd7c 100644 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/DashboardServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/DashboardServiceImpl.java @@ -7,17 +7,15 @@ import au.com.royalpay.payment.manage.analysis.core.DashboardService; import au.com.royalpay.payment.manage.analysis.mappers.ClientAnalysisMapper; import au.com.royalpay.payment.manage.analysis.mappers.CustomerAndOrdersStatisticsMapper; import au.com.royalpay.payment.manage.analysis.mappers.TransactionAnalysisMapper; -import au.com.royalpay.payment.manage.mappers.client.ClientCustomersMapper; import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper; import au.com.royalpay.payment.manage.mappers.system.ClientMapper; import au.com.royalpay.payment.manage.mappers.system.ExchangeRateMapper; import au.com.royalpay.payment.manage.merchants.core.ClientManager; import au.com.royalpay.payment.tools.defines.TradeType; - +import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider; import com.alibaba.fastjson.JSONObject; import com.github.miemiedev.mybatis.paginator.domain.Order; import com.github.miemiedev.mybatis.paginator.domain.PageBounds; - import org.apache.commons.lang3.time.DateUtils; import org.apache.commons.lang3.time.DurationFormatUtils; import org.slf4j.Logger; @@ -26,6 +24,7 @@ import org.springframework.cache.annotation.Cacheable; import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.stereotype.Service; +import javax.annotation.Resource; import java.math.BigDecimal; import java.math.RoundingMode; import java.text.DateFormat; @@ -34,8 +33,6 @@ import java.text.SimpleDateFormat; import java.util.*; import java.util.concurrent.TimeUnit; -import javax.annotation.Resource; - /** * Created by davep on 2016-07-28. */ @@ -62,7 +59,7 @@ public class DashboardServiceImpl implements DashboardService,DashboardAnalysisT private StringRedisTemplate stringRedisTemplate; @Resource - private ClientCustomersMapper clientCustomersMapper; + private MerchantInfoProvider merchantInfoProvider; @@ -323,6 +320,8 @@ public class DashboardServiceImpl implements DashboardService,DashboardAnalysisT params.remove("client_ids"); } JSONObject res = new JSONObject(); + JSONObject mchConfig = merchantInfoProvider.getMchExtParams(partner.getIntValue("client_id")); + params.put("hide_sub_mch", mchConfig.getBooleanValue("hide_sub_mch")); params.put("client_id", partner.getIntValue("client_id")); JSONObject today = getTransJSONO(params); params.put("begin",DateUtils.addDays(params.getDate("begin"),-1)); diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/web/PartnerDashboardController.java b/src/main/java/au/com/royalpay/payment/manage/analysis/web/PartnerDashboardController.java index 7e59e6659..206ba609d 100644 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/web/PartnerDashboardController.java +++ b/src/main/java/au/com/royalpay/payment/manage/analysis/web/PartnerDashboardController.java @@ -2,16 +2,14 @@ package au.com.royalpay.payment.manage.analysis.web; import au.com.royalpay.payment.manage.analysis.beans.AnalysisBean; import au.com.royalpay.payment.manage.analysis.core.DashboardService; -import au.com.royalpay.payment.manage.analysis.core.PartnerCardDashboardService; -import au.com.royalpay.payment.manage.logview.beans.ClientLoginLogQueryBean; -import au.com.royalpay.payment.manage.management.clearing.core.CleanService; import au.com.royalpay.payment.manage.permission.manager.PartnerMapping; import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection; -import au.com.royalpay.payment.manage.signin.core.ClientLoginLogRepository; -import au.com.royalpay.payment.manage.tradelog.beans.TradeLogQuery; import au.com.royalpay.payment.tools.CommonConsts; import com.alibaba.fastjson.JSONObject; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; import java.util.List; @@ -24,13 +22,6 @@ import java.util.List; public class PartnerDashboardController { @Resource private DashboardService dashboardService; - - @Resource - private PartnerCardDashboardService partnerCardDashboardService; - - @Resource - private CleanService cleanService; - @PartnerMapping("/common_analysis") @ReadOnlyConnection public JSONObject commonAnalysis(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, AnalysisBean partnerAnalysisBean) { diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailRSvcController.java b/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailRSvcController.java index 248e263b8..0c42f40e4 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailRSvcController.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailRSvcController.java @@ -4,7 +4,10 @@ import au.com.royalpay.payment.manage.appclient.core.RetailRSvcService; import au.com.royalpay.payment.tools.CommonConsts; import au.com.royalpay.payment.tools.device.advise.AppClientController; import com.alibaba.fastjson.JSONObject; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; import javax.annotation.Resource; @@ -20,9 +23,6 @@ public class RetailRSvcController { return retailRSvcService.findMchInfoBySourceCode(device, source_code); } - @PostMapping(value = "/{source_code}/enterService") - public JSONObject enterIntoServiceBySourceCode(@PathVariable String source_code, @RequestBody JSONObject params) { - return retailRSvcService.enterIntoServiceBySourceCode(source_code, params); - } + } diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/web/RsvcServiceController.java b/src/main/java/au/com/royalpay/payment/manage/appclient/web/RsvcServiceController.java new file mode 100644 index 000000000..12d4568b0 --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/web/RsvcServiceController.java @@ -0,0 +1,22 @@ +package au.com.royalpay.payment.manage.appclient.web; + +import au.com.royalpay.payment.manage.appclient.core.RetailRSvcService; +import com.alibaba.fastjson.JSONObject; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; + +import javax.annotation.Resource; + +@RequestMapping("/api/v1.0/server/rsvc") +public class RsvcServiceController { + + @Resource + private RetailRSvcService retailRSvcService; + + @PostMapping(value = "/{source_code}/enterService") + public JSONObject enterIntoServiceBySourceCode(@PathVariable String source_code, @RequestBody JSONObject params) { + return retailRSvcService.enterIntoServiceBySourceCode(source_code, params); + } +} diff --git a/src/main/java/au/com/royalpay/payment/manage/gateway/beans/ClientPayConfig.java b/src/main/java/au/com/royalpay/payment/manage/gateway/beans/ClientPayConfig.java index 5ce71d06a..56496505f 100644 --- a/src/main/java/au/com/royalpay/payment/manage/gateway/beans/ClientPayConfig.java +++ b/src/main/java/au/com/royalpay/payment/manage/gateway/beans/ClientPayConfig.java @@ -18,10 +18,6 @@ public class ClientPayConfig { private String clientPayDesc; @JSONField(name = "royalpay_industry") private String royalpayindustry; - @JSONField(name = "wechat_industry") - private String wechatindustry; - @JSONField(name = "alipay_industry") - private String alipayindustry; @JSONField(name = "company_photo") private String companyPhoto; @JSONField(name = "store_photo") @@ -56,8 +52,8 @@ public class ClientPayConfig { public JSONObject payConfig() { JSONObject config = (JSONObject) JSON.toJSON(this); - config.put("alipayindustry", alipayindustry); - config.put("industry", wechatindustry); + config.put("alipayindustry", "5311"); + config.put("industry", "336"); config.put("royalpayindustry", royalpayindustry); return config; } 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 6aed5f44d..1eed5c2c2 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 @@ -428,6 +428,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } } List children = clientMapper.listChildClients(client.getIntValue("client_id")); + JSONObject mchConfig = merchantInfoProvider.getMchExtParams(client.getIntValue("client_id")); + client.putAll(mchConfig); + client.put("hide_sub_mch", mchConfig.getBooleanValue("hide_sub_mch")); client.put("has_children", !children.isEmpty()); if (client.getInteger("parent_client_id") != null) { client.put("parent_client", clientMapper.findClient(client.getInteger("parent_client_id"))); @@ -2074,6 +2077,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid checkOrgPermission(manager, client); List listChildClients = clientMapper.listChildClients(client.getIntValue("client_id")); JSONObject mchConfig = merchantInfoProvider.getMchExtParams(client.getIntValue("client_id")); + if(mchConfig.getBooleanValue("hide_sub_mch")){ + return new ArrayList<>(); + } if (!mchConfig.getBooleanValue("disable_level3_mch")) { for (JSONObject partner : listChildClients) { List clients = clientMapper.listChildClients(partner.getIntValue("client_id")); diff --git a/src/main/java/au/com/royalpay/payment/manage/signin/core/impls/SignInAccountServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/signin/core/impls/SignInAccountServiceImpl.java index 1a2427862..a34be1651 100644 --- a/src/main/java/au/com/royalpay/payment/manage/signin/core/impls/SignInAccountServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/signin/core/impls/SignInAccountServiceImpl.java @@ -18,11 +18,11 @@ import au.com.royalpay.payment.manage.support.sms.SmsSender; import au.com.royalpay.payment.manage.system.core.PermissionClientModulesService; 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.ServerErrorException; import au.com.royalpay.payment.tools.locale.LocaleSupport; +import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider; import au.com.royalpay.payment.tools.permission.enums.ManagerRole; import au.com.royalpay.payment.tools.threadpool.RoyalThreadPoolExecutor; import au.com.royalpay.payment.tools.utils.PasswordUtils; @@ -91,7 +91,7 @@ public class SignInAccountServiceImpl implements SignInAccountService, Applicati @Resource private ClientComplianceCompanyMapper clientComplianceCompanyMapper; @Resource - private SysConfigManager sysConfigManager; + private MerchantInfoProvider merchantInfoProvider; @Resource private SmsSender smsSender; @Resource @@ -179,7 +179,7 @@ public class SignInAccountServiceImpl implements SignInAccountService, Applicati client.putAll(clientConfigService.find(client_id)); client = clientInfoWithNoSecretInfo(client); client.put("client_less_file", false); - if ((client.getIntValue("approve_result") == 2 || client.getIntValue("open_status") == 10 || client.getIntValue("approve_result") ==1 || client.getIntValue("open_status") == 5)) { + if ((client.getIntValue("approve_result") == 2 || client.getIntValue("open_status") == 10 || client.getIntValue("approve_result") == 1 || client.getIntValue("open_status") == 5)) { List clientFiles = clientFilesMapper.findAllClientFile(client.getIntValue("client_id")); if (clientFiles != null && clientFiles.size() > 0) { clientFiles = clientFiles.stream().filter(fileJson -> ((fileJson.getIntValue("status") == 1 || fileJson.getIntValue("status") == 2))).collect(Collectors.toList()); @@ -189,7 +189,7 @@ public class SignInAccountServiceImpl implements SignInAccountService, Applicati client.put("client_less_file", true); } } - }else { + } else { client.put("client_less_file", true); } } @@ -199,6 +199,9 @@ public class SignInAccountServiceImpl implements SignInAccountService, Applicati rootPartner = clientInfoWithNoSecretInfo(rootPartner); account.put("parent_client", rootPartner); } + JSONObject mchConfig = merchantInfoProvider.getMchExtParams(client.getIntValue("client_id")); + client.putAll(mchConfig); + client.put("hide_sub_mch", mchConfig.getBooleanValue("hide_sub_mch")); account.put("client", client); account.put("client_moniker", client.getString("client_moniker")); if (client.getIntValue("approve_result") == 2) { @@ -370,7 +373,7 @@ public class SignInAccountServiceImpl implements SignInAccountService, Applicati } @Override - public JSONObject clientWechatOneSignIn(String unionId){ + public JSONObject clientWechatOneSignIn(String unionId) { JSONObject account = clientAccountMapper.findOneByUnionIdAndCreateTimeDesc(unionId); if (account == null) { return null; @@ -495,7 +498,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", "company_photo", "store_photo", "company_website", "contact_job" ,"sub_manage"}; + "enable_bestpay", "manual_settle", "skip_clearing", "mail_confirm", "surcharge_mode", "company_photo", "store_photo", "company_website", "contact_job", "sub_manage"}; for (String col : columns) { simpleClient.put(col, client.get(col)); } @@ -697,7 +700,7 @@ public class SignInAccountServiceImpl implements SignInAccountService, Applicati fileJson.put("name", FILE_NAMES[i]); fileJson.put("file_value", clientFileUrl); fileJson.put("file_write", false); - result.put(fileKey,fileJson); + result.put(fileKey, fileJson); } else { List clientBackToFileUrl = clientFiles.stream() .filter(fileJson -> (fileKey.equals(fileJson.getString("file_name")) && (fileJson.getIntValue("status") == 0 || fileJson.getIntValue("status") == 3))) @@ -717,15 +720,15 @@ public class SignInAccountServiceImpl implements SignInAccountService, Applicati List agreeFile = new ArrayList<>(); agreeFile.add(clientBackToFileUrl.get(0)); fileJson.put("file_value", agreeFile); - }else { + } else { fileJson.put("file_value", clientBackToFileUrl); } } fileJson.put("file_write", true); - result.put(fileKey,fileJson); + result.put(fileKey, fileJson); clientFilesIsLess = true; } - }else { + } else { clientFilesIsLess = true; for (int c = 0; c < FILE_KEYS.length; c++) { String key = FILE_KEYS[c]; @@ -733,7 +736,7 @@ public class SignInAccountServiceImpl implements SignInAccountService, Applicati fileJson.put("key", PUT_KEYS[c]); fileJson.put("name", FILE_NAMES[c]); fileJson.put("file_write", true); - result.put(key,fileJson); + result.put(key, fileJson); } } } @@ -760,7 +763,7 @@ public class SignInAccountServiceImpl implements SignInAccountService, Applicati List kycFiles = new ArrayList<>(); if ("client".equals(sourceType.toLowerCase())) { kycFiles = clientFilesMapper.findKycClientFileByClient(client.getIntValue("client_id")); - }else { + } else { kycFiles = clientFilesMapper.findKycClientFileByAudit(client.getIntValue("client_id")); } for (JSONObject file : kycFiles) { @@ -789,7 +792,7 @@ public class SignInAccountServiceImpl implements SignInAccountService, Applicati JSONObject result = new JSONObject(); boolean lessKycFiles = true; JSONObject kycFilesAuth = clientComplianceCompanyMapper.findKycFileComplete(client.getIntValue("client_id")); - if(kycFilesAuth != null){ + if (kycFilesAuth != null) { lessKycFiles = false; } result.put("client_less_file", lessKycFiles); @@ -819,7 +822,7 @@ public class SignInAccountServiceImpl implements SignInAccountService, Applicati return result; } - private void whenClientLessFile(JSONObject client,JSONObject 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")); diff --git a/src/main/java/au/com/royalpay/payment/manage/tradelog/beans/TradeLogQuery.java b/src/main/java/au/com/royalpay/payment/manage/tradelog/beans/TradeLogQuery.java index 0758af65d..0df88e908 100644 --- a/src/main/java/au/com/royalpay/payment/manage/tradelog/beans/TradeLogQuery.java +++ b/src/main/java/au/com/royalpay/payment/manage/tradelog/beans/TradeLogQuery.java @@ -5,7 +5,6 @@ import au.com.royalpay.payment.core.beans.PayChannel; import au.com.royalpay.payment.tools.defines.TradeType; import com.alibaba.fastjson.JSONObject; import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.time.DateUtils; import org.joda.time.DateTime; import org.joda.time.DateTimeZone; import org.joda.time.format.DateTimeFormat; 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 7b0daf23f..baac2647e 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 @@ -23,6 +23,7 @@ import au.com.royalpay.payment.tools.defines.TradeType; import au.com.royalpay.payment.tools.env.PlatformEnvironment; import au.com.royalpay.payment.tools.exceptions.BadRequestException; import au.com.royalpay.payment.tools.exceptions.ServerErrorException; +import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider; import au.com.royalpay.payment.tools.permission.enums.ManagerRole; import au.com.royalpay.payment.tools.permission.enums.PartnerRole; import au.com.royalpay.payment.tools.utils.CurrencyAmountUtils; @@ -127,6 +128,8 @@ public class TradeLogServiceImpl implements TradeLogService { @Resource private ClientDeviceMapper clientDeviceMapper; + @Resource + private MerchantInfoProvider merchantInfoProvider; // @Value("classpath:/jasper/trans_flow.jasper") // @Value("classpath:/jasper/trans_flow_new.jasper") @@ -159,6 +162,8 @@ public class TradeLogServiceImpl implements TradeLogService { add(query.getGatewayChild()); }}); } + JSONObject mchConfig = merchantInfoProvider.getMchExtParams(client.getIntValue("client_id")); + params.put("hide_sub_mch", mchConfig.getBooleanValue("hide_sub_mch")); PageList logs = orderMapper.listOrdersByClients(params, new PageBounds(query.getPage(), query.getLimit(), Order.formString("create_time.desc"))); if (timezone != null) { @@ -522,7 +527,8 @@ public class TradeLogServiceImpl implements TradeLogService { JSONObject params = query.toParams(timezone); clientManager.validateClients(client_id, params); params.put("client_id", client_id); - + JSONObject mchConfig = merchantInfoProvider.getMchExtParams(partner.getIntValue("client_id")); + params.put("hide_sub_mch", mchConfig.getBooleanValue("hide_sub_mch")); List logs = transactionMapper.listTransFlow(params); TimeZoneUtils.switchTimeZone(logs, timezone, "create_time", "confirm_time", "transaction_time"); Paginator paginator = new Paginator(query.getPage(), query.getLimit(), logs.size()); diff --git a/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/TransactionAnalysisMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/TransactionAnalysisMapper.xml index 3acfc9a3f..81dab16c5 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/TransactionAnalysisMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/TransactionAnalysisMapper.xml @@ -152,18 +152,22 @@ diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/OrderMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/OrderMapper.xml index ab0a1eb47..ddbbdc049 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/OrderMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/OrderMapper.xml @@ -443,7 +443,7 @@ - and p.client_id=#{client_id} + and (p.client_id=#{client_id} or p.parent_client_id=#{client_id}) and o.customer_id = #{customer_id} @@ -466,15 +466,18 @@ FROM pmt_orders o INNER JOIN sys_clients p ON p.client_id=o.client_id and p.is_valid=1 - + AND p.client_id IN #{client_id} - + and p.client_id=#{client_id} + + and (p.client_id=#{client_id} or p.parent_client_id=#{client_id}) + and o.customer_id = #{customer_id} @@ -551,7 +554,7 @@ - and p.client_id=#{client_id} + and (p.client_id=#{client_id} or p.parent_client_id=#{client_id}) LEFT JOIN pmt_transactions t on t.order_id=o.order_id and t.refund_id is null and t.transaction_type='Credit' LEFT JOIN pmt_incremental_detail i on i.transaction_id = t.transaction_id @@ -608,15 +611,18 @@ FROM pmt_orders o INNER JOIN sys_clients p ON p.client_id=o.client_id AND p.is_valid=1 - + AND p.client_id IN #{client_id} - + and p.client_id=#{client_id} + + and (p.client_id=#{client_id} or p.parent_client_id=#{client_id}) + INNER JOIN pmt_transactions t on t.order_id=o.order_id and (t.transaction_type='Credit' or t.refund_id is not null) @@ -800,7 +806,7 @@ - and p.client_id=#{client_id} + and (p.client_id=#{client_id} or p.parent_client_id=#{client_id}) and o.customer_id = #{customer_id} diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml index f09d0800a..2720e5b0c 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml @@ -156,14 +156,17 @@ left join sys_customer_relation_alipay ra on ra.alipay_uid = o.customer_id LEFT JOIN sys_clients c on c.client_id = t.client_id - + AND t.client_id IN #{client_id} - - and t.client_id=#{client_id} + + and c.client_id=#{client_id} + + + and (c.client_id=#{client_id} or c.parent_client_id=#{client_id}) and t.transaction_time >= #{from} and t.transaction_time < #{to} @@ -226,6 +229,7 @@ FROM pmt_transactions t left JOIN pmt_orders o on o.order_id=t.order_id + LEFT JOIN sys_clients c on c.client_id = t.client_id AND t.client_id IN @@ -234,7 +238,7 @@ - and t.client_id=#{client_id} + and (c.client_id=#{client_id} or c.parent_client_id=#{client_id}) and t.transaction_time >= #{from} and t.transaction_time < #{to} @@ -390,6 +394,7 @@ t.clearing_order clear_detail_id FROM pmt_transactions t left join log_clearing_detail cd on cd.clear_detail_id=t.clearing_order + left join sys_clients sc on t.client_id = sc.client_id WHERE t.channel='Settlement' ]]> @@ -399,7 +404,7 @@ - and t.client_id=#{client_id} + and (sc.client_id=#{client_id} or sc.parent_client_id =#{client_id}) and t.transaction_time >= #{from} and t.transaction_time < #{to} @@ -423,7 +428,7 @@ - and t.client_id=#{client_id} + and (c.client_id=#{client_id} or c.parent_client_id=#{client_id}) and t.transaction_time >= #{from} and t.transaction_time < #{to} diff --git a/src/main/ui/static/analysis/partner-customers-orders.js b/src/main/ui/static/analysis/partner-customers-orders.js index 6d917e215..a2691bb9e 100644 --- a/src/main/ui/static/analysis/partner-customers-orders.js +++ b/src/main/ui/static/analysis/partner-customers-orders.js @@ -14,7 +14,7 @@ define(['angular', 'uiBootstrap', 'uiRouter', 'angularEcharts'], function (angul $scope.params = {}; $scope.chooseShow = 'All'; $scope.clients = [$scope.currentUser.client]; - if ($scope.currentUser.client.has_children) { + if ($scope.currentUser.client.has_children && !$scope.currentUser.client.hide_sub_mch) { $scope.params.client_ids = []; $http.get('/client/partner_info/sub_partners').then(function (resp) { var clientList = resp.data; @@ -264,4 +264,4 @@ define(['angular', 'uiBootstrap', 'uiRouter', 'angularEcharts'], function (angul }]); return app; -}); \ No newline at end of file +}); diff --git a/src/main/ui/static/analysis/partner-trans-analysis.js b/src/main/ui/static/analysis/partner-trans-analysis.js index ed822863a..d48990998 100644 --- a/src/main/ui/static/analysis/partner-trans-analysis.js +++ b/src/main/ui/static/analysis/partner-trans-analysis.js @@ -14,7 +14,7 @@ define(['angular', 'uiBootstrap', 'uiRouter', 'angularEcharts'], function (angul $scope.params = {}; $scope.chooseShow = 'All'; $scope.clients = [$scope.currentUser.client]; - if ($scope.currentUser.client.has_children) { + if ($scope.currentUser.client.has_children && !$scope.currentUser.client.hide_sub_mch) { $scope.params.client_ids = []; $http.get('/client/partner_info/sub_partners').then(function (resp) { var clientList = resp.data; @@ -178,4 +178,4 @@ define(['angular', 'uiBootstrap', 'uiRouter', 'angularEcharts'], function (angul }]); return app; -}); \ No newline at end of file +}); diff --git a/src/main/ui/static/analysis/templates/partner_customers_orders.html b/src/main/ui/static/analysis/templates/partner_customers_orders.html index 976037fe3..91e48eed9 100644 --- a/src/main/ui/static/analysis/templates/partner_customers_orders.html +++ b/src/main/ui/static/analysis/templates/partner_customers_orders.html @@ -68,7 +68,7 @@ This Year -
+
-
+
- \ No newline at end of file + diff --git a/src/main/ui/static/dashboard/partner-dashboard.js b/src/main/ui/static/dashboard/partner-dashboard.js index 7ab9a69fe..df49cd683 100644 --- a/src/main/ui/static/dashboard/partner-dashboard.js +++ b/src/main/ui/static/dashboard/partner-dashboard.js @@ -619,7 +619,7 @@ define(['angular','decimal', 'uiRouter', 'uiBootstrap', 'angularEcharts'], funct $scope.clientMoniker = $scope.currentUser.client_moniker; $scope.chooseShow = 'All'; $scope.clients = [$scope.currentUser.client]; - if ($scope.currentUser.client.has_children) { + if ($scope.currentUser.client.has_children && !$scope.currentUser.client.hide_sub_mch) { $scope.params.client_ids = []; $http.get('/client/partner_info/sub_partners',$scope.req).then(function (resp) { var clientList = resp.data; @@ -665,7 +665,7 @@ define(['angular','decimal', 'uiRouter', 'uiBootstrap', 'angularEcharts'], funct $scope.loadSettlementLogs(1); }; - if (!$scope.currentUser.client.has_children){ + if (!$scope.currentUser.client.has_children || ($scope.currentUser.client.has_children && $scope.currentUser.client.hide_sub_mch)) { $scope.loadDashboard(); } function loadTransCommon() { diff --git a/src/main/ui/static/dashboard/templates/partner_dashboard.html b/src/main/ui/static/dashboard/templates/partner_dashboard.html index 726ca626b..7da27f9cf 100644 --- a/src/main/ui/static/dashboard/templates/partner_dashboard.html +++ b/src/main/ui/static/dashboard/templates/partner_dashboard.html @@ -212,7 +212,7 @@

Dashboard -
+
-
+

diff --git a/src/main/ui/static/invoice/invoice_assistant.js b/src/main/ui/static/invoice/invoice_assistant.js index 938e7b61c..4f0544787 100644 --- a/src/main/ui/static/invoice/invoice_assistant.js +++ b/src/main/ui/static/invoice/invoice_assistant.js @@ -17,7 +17,7 @@ define(['angular','decimal'], function (angular,decimal) { $scope.pagination = {}; $scope.today = new Date(); $scope.clients = [$scope.currentUser.client]; - if ($scope.currentUser.client.has_children) { + if ($scope.currentUser.client.has_children && !$scope.currentUser.client.hide_sub_mch) { $http.get('/client/partner_info/sub_partners').then(function (resp) { var clientList = resp.data; clientList.forEach(function (client) { diff --git a/src/main/ui/static/invoice/templates/invoice_assistant.html b/src/main/ui/static/invoice/templates/invoice_assistant.html index 1ffab462b..52ff8f13f 100644 --- a/src/main/ui/static/invoice/templates/invoice_assistant.html +++ b/src/main/ui/static/invoice/templates/invoice_assistant.html @@ -87,7 +87,7 @@

-
+

diff --git a/src/main/ui/static/payment/partner/partner-manage.js b/src/main/ui/static/payment/partner/partner-manage.js index 89654fcee..e44b62c50 100644 --- a/src/main/ui/static/payment/partner/partner-manage.js +++ b/src/main/ui/static/payment/partner/partner-manage.js @@ -3459,7 +3459,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter } $scope.loadTradeLogs(); }; - if ($scope.partner.has_children) { + if ($scope.partner.has_children && !$scope.partner.hide_sub_mch) { $http.get('/sys/partners/' + $scope.partner.client_moniker + '/sub_clients').then(function (resp) { var clientList = resp.data; clientList.forEach(function (client) { @@ -4296,9 +4296,9 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter $scope.isAll = true; $scope.initClientInfo = function(){ $http.get('/sys/partners/'+clientMoniker).then(function (resp) { - $scope.client = resp.data + $scope.client = resp.data; $scope.clients = [$scope.client]; - if ($scope.client.has_children) { + if ($scope.client.has_children && !$scope.client.hide_sub_mch) { $scope.params.client_ids = [$scope.client.client_id]; $http.get('/sys/partners/'+clientMoniker+'/sub_clients').then(function (resp) { var clientList = resp.data; diff --git a/src/main/ui/static/payment/partner/templates/partner_accounts.html b/src/main/ui/static/payment/partner/templates/partner_accounts.html index d41819a94..892e18a45 100644 --- a/src/main/ui/static/payment/partner/templates/partner_accounts.html +++ b/src/main/ui/static/payment/partner/templates/partner_accounts.html @@ -14,6 +14,7 @@ + @@ -24,6 +25,7 @@ +
Client Moniker Username Display Name OpenId
@@ -44,4 +46,4 @@

-
\ No newline at end of file +
diff --git a/src/main/ui/static/payment/partner/templates/partner_pay_logs.html b/src/main/ui/static/payment/partner/templates/partner_pay_logs.html index c9d3dcb5c..1b269b062 100644 --- a/src/main/ui/static/payment/partner/templates/partner_pay_logs.html +++ b/src/main/ui/static/payment/partner/templates/partner_pay_logs.html @@ -161,7 +161,7 @@ -
+

diff --git a/src/main/ui/static/payment/partner/templates/partner_settlement.html b/src/main/ui/static/payment/partner/templates/partner_settlement.html index 681a96237..068607521 100644 --- a/src/main/ui/static/payment/partner/templates/partner_settlement.html +++ b/src/main/ui/static/payment/partner/templates/partner_settlement.html @@ -50,7 +50,7 @@

-
+

@@ -135,4 +135,4 @@

- \ No newline at end of file + diff --git a/src/main/ui/static/payment/tradelog/partner-settlement-log.js b/src/main/ui/static/payment/tradelog/partner-settlement-log.js index d515dd67b..4979780a5 100644 --- a/src/main/ui/static/payment/tradelog/partner-settlement-log.js +++ b/src/main/ui/static/payment/tradelog/partner-settlement-log.js @@ -26,7 +26,7 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) { $scope.showLevel3Clients = false; $scope.isLevel3All = true; - if ($scope.currentUser.client.has_children) { + if ($scope.currentUser.client.has_children && !$scope.currentUser.client.hide_sub_mch) { $scope.params.client_ids = [$scope.currentUser.client.client_id]; $http.get('/client/partner_info/sub_partners').then(function (resp) { var clientList = resp.data; diff --git a/src/main/ui/static/payment/tradelog/templates/balance_report.html b/src/main/ui/static/payment/tradelog/templates/balance_report.html index b10512781..bf46a29cd 100644 --- a/src/main/ui/static/payment/tradelog/templates/balance_report.html +++ b/src/main/ui/static/payment/tradelog/templates/balance_report.html @@ -6,26 +6,32 @@ .tr_clearing { color: green; } - .box-icon_small{ + + .box-icon_small { width: 70px; height: 70px; font-size: 30px; line-height: 70px } - .info_box_bottom{ - min-height:70px; - margin-bottom:0px + + .info_box_bottom { + min-height: 70px; + margin-bottom: 0px } - .box-content_left{ - margin-left:70px + + .box-content_left { + margin-left: 70px } - .box-number_font{ - font-size:14px + + .box-number_font { + font-size: 14px } - .line_height{ + + .line_height { line-height: 14px } - .line_height_{ + + .line_height_ { line-height: 22px; } @@ -88,8 +94,10 @@ ng-click="params.channel='WECHAT';loadTradeLogs(1)">Wechat Pay | Alipay | - AlipayOnline | + AlipayOnline + | BestPay | Devices -
+

- All + All

@@ -172,7 +187,8 @@
-
+

@@ -186,14 +202,19 @@

-
- +
+

- All + All

@@ -203,16 +224,21 @@ Search - - @@ -226,7 +252,8 @@
- +
Transaction Amount
- +
Input Amount
-
- +
+
- Input Amount - Input Amount + - + ( {{analysis.pre_display_amount | currency:'pre authorization '}} ) - + ( {{analysis.pre_cny_display_amount | currency:'pre authorization '}} )
@@ -268,7 +301,8 @@
- +
Refund Amount
- +
Settlement Amount - + - {{trade.order_id2}} + {{trade.order_id2}} @@ -363,18 +401,18 @@ - - - - - - - - - - - - + + + + + + + + + + + + @@ -412,7 +450,9 @@ first-text="«" last-text="»">
-
Total Records:{{pagination.totalCount}};Total Pages:{{pagination.totalPages}}
+
Total Records:{{pagination.totalCount}};Total + Pages:{{pagination.totalPages}} +
diff --git a/src/main/ui/static/payment/tradelog/templates/partner_incremental_trade_logs.html b/src/main/ui/static/payment/tradelog/templates/partner_incremental_trade_logs.html index 6b4616779..3f596ccd8 100644 --- a/src/main/ui/static/payment/tradelog/templates/partner_incremental_trade_logs.html +++ b/src/main/ui/static/payment/tradelog/templates/partner_incremental_trade_logs.html @@ -195,7 +195,7 @@
-
+

diff --git a/src/main/ui/static/payment/tradelog/templates/partner_settlement_logs.html b/src/main/ui/static/payment/tradelog/templates/partner_settlement_logs.html index 349501fb0..cb24010e1 100644 --- a/src/main/ui/static/payment/tradelog/templates/partner_settlement_logs.html +++ b/src/main/ui/static/payment/tradelog/templates/partner_settlement_logs.html @@ -71,7 +71,7 @@

-
+

diff --git a/src/main/ui/static/payment/tradelog/templates/partner_trade_logs.html b/src/main/ui/static/payment/tradelog/templates/partner_trade_logs.html index 3e66ada1a..f283ffee2 100644 --- a/src/main/ui/static/payment/tradelog/templates/partner_trade_logs.html +++ b/src/main/ui/static/payment/tradelog/templates/partner_trade_logs.html @@ -30,43 +30,52 @@ -webkit-transform: rotate(90deg); } } - .popover-color{ + + .popover-color { background-color: #f7f7f7; border-bottom: 1px solid #ebebeb; color: black; } - .popover-content button{ + + .popover-content button { display: inline-block; } - .position_re{ + + .position_re { position: relative; } - .position_re .position_ab{ + + .position_re .position_ab { position: absolute; top: 90%; left: 90%; } -.box-icon_small{ + .box-icon_small { width: 70px; height: 70px; font-size: 30px; line-height: 70px } - .info_box_bottom{ - min-height:70px; - margin-bottom:0px + + .info_box_bottom { + min-height: 70px; + margin-bottom: 0px } - .box-content_left{ - margin-left:70px + + .box-content_left { + margin-left: 70px } - .box-number_font{ - font-size:14px; + + .box-number_font { + font-size: 14px; } - .line_height{ + + .line_height { line-height: 14px } - .line_height_{ + + .line_height_ { line-height: 22px; } @@ -105,7 +114,8 @@

-
@@ -129,13 +139,19 @@ All | Payment Success | + ng-click="params.status='PAID';loadTradeLogs(1)">Payment Success + | All Refund | - Partial Refund | - Full Refund + ng-click="params.status='ALL_REFUNDED';loadTradeLogs(1)">All + Refund | + Partial + Refund | + Full + Refund

@@ -149,8 +165,10 @@ ng-click="params.channel='WECHAT';loadTradeLogs(1)">Wechat Pay | Alipay | - AlipayOnline | + AlipayOnline + | BestPay | All | Retail In-Store | + ng-click="params.gateway=[0,1];initGatewayChild()">Retail + In-Store | Retail API | Mobile H5 | Third Party Gateway | + ng-click="params.gateway=[9];loadTradeLogs(1)">Third Party + Gateway | APP | Share Code | + ng-click="params.gateway=[11];loadTradeLogs(1)">Share Code | MiniProgram |
-
+ -
- + All + +

+
+
+
+
-
+

- All + All

@@ -307,27 +340,31 @@
- -
-
-
-
-
+ +
+
+
+
+
- +
Transaction Amount
- +
Input Amount
-
- +
+
- Input Amount - Input Amount + - + ( {{analysis.pre_display_amount | currency:'pre authorization '}} ) - + ( {{analysis.pre_cny_display_amount | currency:'pre authorization '}} )
@@ -369,7 +412,8 @@
- +
Refund Amount
- +
CUSTOMERS
-
-
-

Orders - +
+
+

Orders + Pre Authorization: @@ -404,103 +449,125 @@ ng-click="fullReleasePreAuth()">Release All Pre-Auth -

-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + +
Client Order IDOrder IDAmountInput AmountAUD AmountSettle AmountExchange RateStatusCreate TimeGatewayOrder DetailOperation
- - - - - - - BestPay - Alipay - AlipayOnline - - - - - - {{trade.order_id}} - - {{trade.total_amount|currency:trade.currency+' '}} - (-{{trade.refund_fee}}) - - - - - + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - -
Client Order IDOrder IDAmountInput AmountAUD AmountSettle AmountExchange RateStatusCreate TimeGatewayOrder DetailOperation
+ + + + + + + BestPay + Alipay + AlipayOnline + + + + + + {{trade.order_id}} + + {{trade.total_amount|currency:trade.currency+' '}} + (-{{trade.refund_fee}}) + + + - + - - - - - - - - - - -
+
+ + + + + + + + + +
-
- -
-

-
-
-
+
+ +
+
+
+
+
diff --git a/src/main/ui/static/payment/tradelog/tradelog.js b/src/main/ui/static/payment/tradelog/tradelog.js index 9e7fde900..703aeaaa8 100644 --- a/src/main/ui/static/payment/tradelog/tradelog.js +++ b/src/main/ui/static/payment/tradelog/tradelog.js @@ -278,7 +278,7 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) { $scope.listDevices(); $scope.listDevicesIds(); - if ($scope.currentUser.client.has_children) { + if ($scope.currentUser.client.has_children && !$scope.currentUser.client.hide_sub_mch) { $http.get('/client/partner_info/sub_partners').then(function (resp) { var clientList = resp.data; clientList.forEach(function (client) { @@ -493,7 +493,7 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) { }; $scope.listDevices(); - if ($scope.currentUser.client.has_children) { + if ($scope.currentUser.client.has_children && !$scope.currentUser.client.hide_sub_mch) { $http.get('/client/partner_info/sub_partners').then(function (resp) { var clientList = resp.data; clientList.forEach(function (client) { diff --git a/src/main/ui/static/payment/tradelog/transflow.js b/src/main/ui/static/payment/tradelog/transflow.js index 3dc58f0c8..246189708 100644 --- a/src/main/ui/static/payment/tradelog/transflow.js +++ b/src/main/ui/static/payment/tradelog/transflow.js @@ -200,9 +200,6 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) { url += connectSymbol + 'dev_id=' + params.dev_id; connectSymbol = '&' } - if (!params.client_ids) { - $scope.params.client_ids = [$scope.currentUser.client.client_id] - } params.client_ids.forEach(function (i) { url += connectSymbol + 'client_ids=' + i; connectSymbol = '&'; @@ -223,7 +220,7 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) { return url; } - if ($scope.currentUser.client.has_children) { + if ($scope.currentUser.client.has_children && !$scope.currentUser.client.hide_sub_mch) { $http.get('/client/partner_info/sub_partners').then(function (resp) { var clientList = resp.data; clientList.forEach(function (client) {