@ -13,31 +13,13 @@ import au.com.royalpay.payment.manage.analysis.mappers.TransactionAnalysisMapper
import au.com.royalpay.payment.manage.appclient.beans.AppClientBean ;
import au.com.royalpay.payment.manage.device.core.DeviceManager ;
import au.com.royalpay.payment.manage.mappers.financial.FinancialBDConfigMapper ;
import au.com.royalpay.payment.manage.mappers.log.ClientsOperationLogMapper ;
import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper ;
import au.com.royalpay.payment.manage.mappers.redpack.ActClientInvitationCodeMapper ;
import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper ;
import au.com.royalpay.payment.manage.mappers.system.ClientApplyMapper ;
import au.com.royalpay.payment.manage.mappers.system.ClientAuditProcessMapper ;
import au.com.royalpay.payment.manage.mappers.system.ClientBDMapper ;
import au.com.royalpay.payment.manage.mappers.system.ClientBankAccountMapper ;
import au.com.royalpay.payment.manage.mappers.system.ClientDeviceMapper ;
import au.com.royalpay.payment.manage.mappers.system.ClientFilesMapper ;
import au.com.royalpay.payment.manage.mappers.system.ClientMapper ;
import au.com.royalpay.payment.manage.mappers.system.ClientRateMapper ;
import au.com.royalpay.payment.manage.mappers.system.ClientsContractMapper ;
import au.com.royalpay.payment.manage.mappers.system.CommoditiesMapper ;
import au.com.royalpay.payment.manage.mappers.system.ManagerMapper ;
import au.com.royalpay.payment.manage.mappers.system.OrgMapper ;
import au.com.royalpay.payment.manage.mappers.system.SysWxMerchantApplyMapper ;
import au.com.royalpay.payment.manage.merchants.beans.ActivityPosterBuilder ;
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.mappers.system.* ;
import au.com.royalpay.payment.manage.merchants.beans.* ;
import au.com.royalpay.payment.manage.merchants.core.ClientComplyValidator ;
import au.com.royalpay.payment.manage.merchants.core.ClientInfoCacheSupport ;
import au.com.royalpay.payment.manage.merchants.core.ClientManager ;
import au.com.royalpay.payment.manage.notice.core.MailService ;
import au.com.royalpay.payment.manage.signin.beans.TodoNotice ;
@ -66,21 +48,16 @@ import au.com.royalpay.payment.tools.merchants.qrboard.QRBoard;
import au.com.royalpay.payment.tools.merchants.qrboard.QRBoardProvider ;
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.ImageUtils ;
import au.com.royalpay.payment.tools.utils.PageListUtils ;
import au.com.royalpay.payment.tools.utils.PasswordUtils ;
import au.com.royalpay.payment.tools.utils.PdfUtils ;
import au.com.royalpay.payment.tools.utils.QRCodeUtils ;
import au.com.royalpay.payment.tools.utils.TimeZoneUtils ;
import au.com.royalpay.payment.tools.utils.* ;
import au.com.royalpay.payment.tools.websocket.notify.PartnerPageEvent ;
import cn.yixblog.platform.http.HttpRequestGenerator ;
import cn.yixblog.platform.http.HttpRequestResult ;
import com.alibaba.fastjson.JSON ;
import com.alibaba.fastjson.JSONArray ;
import com.alibaba.fastjson.JSONObject ;
import com.github.miemiedev.mybatis.paginator.domain.Order ;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds ;
import com.github.miemiedev.mybatis.paginator.domain.PageList ;
import org.apache.commons.io.IOUtils ;
import org.apache.commons.lang3.ArrayUtils ;
import org.apache.commons.lang3.RandomStringUtils ;
@ -106,35 +83,23 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.thymeleaf.context.Context ;
import org.thymeleaf.spring4.SpringTemplateEngine ;
import javax.annotation.Resource ;
import javax.imageio.ImageIO ;
import javax.servlet.ServletOutputStream ;
import javax.servlet.http.HttpServletResponse ;
import java.awt.* ;
import java.awt.image.BufferedImage ;
import java.io.ByteArrayInputStream ;
import java.io.ByteArrayOutputStream ;
import java.io.File ;
import java.io.IOException ;
import java.io.InputStream ;
import java.io.OutputStream ;
import java.io.* ;
import java.math.BigDecimal ;
import java.net.URISyntaxException ;
import java.net.URL ;
import java.util.ArrayList ;
import java.util.Arrays ;
import java.util.Date ;
import java.util.* ;
import java.util.List ;
import java.util.Objects ;
import java.util.concurrent.TimeUnit ;
import java.util.stream.Collectors ;
import java.util.zip.ZipEntry ;
import java.util.zip.ZipOutputStream ;
import javax.annotation.Resource ;
import javax.imageio.ImageIO ;
import javax.servlet.ServletOutputStream ;
import javax.servlet.http.HttpServletResponse ;
import cn.yixblog.platform.http.HttpRequestGenerator ;
import cn.yixblog.platform.http.HttpRequestResult ;
import static au.com.royalpay.payment.manage.permission.utils.OrgCheckUtils.checkOrgPermission ;
/ * *
@ -219,6 +184,10 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
private ClientContractService clientContractService ;
@Resource
private MessageSource messageSource ;
@Resource
private ClientsOperationLogMapper clientsOperationLogMapper ;
@Resource
private ClientInfoCacheSupport clientInfoCacheSupport ;
private static final String SOURCE_AGREE_FILE = "source_agree_file" ;
private static final String CLIENT_BANK_FILE = "client_bank_file" ;
@ -247,22 +216,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
return clientMapper . findClient ( clientId ) ;
}
@Override
@CacheEvict ( value = ":app_client_info:" , key = "''+#clientId" )
public void clearClientCache ( int clientId ) {
List < JSONObject > accounts = clientAccountMapper . listPartnerAccounts ( clientId ) ;
for ( JSONObject acc : accounts ) {
signInAccountService . clearAccountCache ( acc . getString ( "account_id" ) ) ;
}
JSONObject client = getClientInfo ( clientId ) ;
clearClientMonikerCache ( client . getString ( "client_moniker" ) ) ;
}
@Override
@CacheEvict ( value = ":app_client_info_moniker:" , key = "#clientMoniker" )
public void clearClientMonikerCache ( String clientMoniker ) {
}
@Override
public JSONObject getClientInfoIgnoreInvalid ( int clientId ) {
return clientMapper . findClientIgnoreInvalid ( clientId ) ;
@ -571,7 +524,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
}
clientMapper . update ( updateInfo ) ;
cl earClientCache( clientId ) ;
cl ientInfoCacheSupport. cl earClientCache( clientId ) ;
}
@Override
@ -597,7 +550,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
clientMapper . update ( update ) ;
}
}
cl earClientCache( clientId ) ;
cl ientInfoCacheSupport. cl earClientCache( clientId ) ;
}
@Override
@ -634,7 +587,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
saveClientAuditProcess ( client . getIntValue ( "client_id" ) , open_status , 5 , "合规通过" , manager ) ;
}
}
cl earClientCache( client . getIntValue ( "client_id" ) ) ;
cl ientInfoCacheSupport. cl earClientCache( client . getIntValue ( "client_id" ) ) ;
}
@Override
@ -655,7 +608,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
saveClientAuditProcess ( client . getIntValue ( "client_id" ) , 10 , 1 , "绿色通道申请通过" , manager ) ;
sendCommissionWechatMessage ( client ) ;
initAdminUserAndSendEmail ( manager , clientMoniker , client ) ;
cl earClientCache( client . getIntValue ( "client_id" ) ) ;
cl ientInfoCacheSupport. cl earClientCache( client . getIntValue ( "client_id" ) ) ;
}
private void initAdminUserAndSendEmail ( JSONObject manager , String clientMoniker , JSONObject client ) {
@ -713,7 +666,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
sendInitEmail ( client , account . getString ( "username" ) , pwd ) ;
}
}
cl earClientCache( clientId ) ;
cl ientInfoCacheSupport. cl earClientCache( clientId ) ;
}
@Override
@ -833,7 +786,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
int clientId = client . getIntValue ( "client_id" ) ;
updateClientApproveEmailStatus ( clientId , 1 ) ;
cl earClientCache( clientId ) ;
cl ientInfoCacheSupport. cl earClientCache( clientId ) ;
}
private void updateClientApproveEmailStatus ( int clientId , int status ) {
@ -884,7 +837,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
checkOrgPermission ( manager , client ) ;
client . put ( permissionKey , allow ) ;
clientMapper . update ( client ) ;
cl earClientCache( client . getIntValue ( "client_id" ) ) ;
cl ientInfoCacheSupport. cl earClientCache( client . getIntValue ( "client_id" ) ) ;
}
@Override
@ -1071,7 +1024,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
Assert . notNull ( partner ) ;
partner . put ( "enable_pay_notice" , enable ) ;
clientMapper . update ( partner ) ;
cl earClientCache( partner . getIntValue ( "client_id" ) ) ;
cl ientInfoCacheSupport. cl earClientCache( partner . getIntValue ( "client_id" ) ) ;
}
@Override
@ -1099,7 +1052,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
Assert . notNull ( partner , "Merchant is null" ) ;
partner . put ( "enable_refund_auth" , enable ) ;
clientMapper . update ( partner ) ;
cl earClientCache( partner . getIntValue ( "client_id" ) ) ;
cl ientInfoCacheSupport. cl earClientCache( partner . getIntValue ( "client_id" ) ) ;
}
@Override
@ -1134,7 +1087,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
subClient . put ( "bd_user" , managerId ) ;
clientMapper . update ( subClient ) ;
}
cl earClientCache( client . getIntValue ( "client_id" ) ) ;
cl ientInfoCacheSupport. cl earClientCache( client . getIntValue ( "client_id" ) ) ;
}
@Override
@ -1146,7 +1099,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
checkOrgPermission ( manager , client ) ;
client . put ( "credential_code" , RandomStringUtils . random ( 32 , true , true ) ) ;
clientMapper . update ( client ) ;
cl earClientCache( client . getIntValue ( "client_id" ) ) ;
cl ientInfoCacheSupport. cl earClientCache( client . getIntValue ( "client_id" ) ) ;
}
@Override
@ -1217,7 +1170,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
update . put ( "client_id" , client . getIntValue ( "client_id" ) ) ;
update . put ( "settle_hour" , hour ) ;
clientMapper . update ( update ) ;
cl earClientCache( client . getIntValue ( "client_id" ) ) ;
cl ientInfoCacheSupport. cl earClientCache( client . getIntValue ( "client_id" ) ) ;
}
@Override
@ -1689,7 +1642,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
partner . put ( "client_id" , clientId ) ;
partner . put ( "timezone" , timezone ) ;
clientMapper . update ( partner ) ;
cl earClientCache( clientId ) ;
cl ientInfoCacheSupport. cl earClientCache( clientId ) ;
}
@Override
@ -2191,8 +2144,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
client . put ( "refund_pwd" , pwdHash ) ;
client . put ( "refund_pwd_salt" , salt ) ;
clientMapper . update ( client ) ;
clearClientCache ( client . getIntValue ( "client_id" ) ) ;
clearClientMonikerCache ( client . getString ( "client_moniker" ) ) ;
clientInfoCacheSupport . clearClientCache ( client . getIntValue ( "client_id" ) ) ;
}
@Override
@ -2224,7 +2176,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
update . put ( "client_id" , clientId ) ;
update . put ( "qrcode_surcharge" , paySurcharge ) ;
clientMapper . update ( update ) ;
cl earClientCache( clientId ) ;
cl ientInfoCacheSupport. cl earClientCache( clientId ) ;
}
@Override
@ -2238,7 +2190,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
update . put ( "client_id" , clientId ) ;
update . put ( "api_surcharge" , enableApiSurcharge ) ;
clientMapper . update ( update ) ;
cl earClientCache( clientId ) ;
cl ientInfoCacheSupport. cl earClientCache( clientId ) ;
}
@Override
@ -2252,7 +2204,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
update . put ( "client_id" , clientId ) ;
update . put ( "retail_surcharge" , paySurcharge ) ;
clientMapper . update ( update ) ;
cl earClientCache( clientId ) ;
cl ientInfoCacheSupport. cl earClientCache( clientId ) ;
}
@Override
@ -2266,7 +2218,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
update . put ( "client_id" , clientId ) ;
update . put ( "tax_in_surcharge" , taxInSurcharge ) ;
clientMapper . update ( update ) ;
cl earClientCache( clientId ) ;
cl ientInfoCacheSupport. cl earClientCache( clientId ) ;
}
@Override
@ -2282,13 +2234,13 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
@Override
public void updateClientCleanDays ( int clientId , int cleanDays ) {
clientMapper . updateCleanDays ( clientId , cleanDays ) ;
cl earClientCache( clientId ) ;
cl ientInfoCacheSupport. cl earClientCache( clientId ) ;
}
@Override
public void updateClientEmail ( int clientId , String contact_email ) {
clientMapper . updateClientEmail ( clientId , contact_email ) ;
cl earClientCache( clientId ) ;
cl ientInfoCacheSupport. cl earClientCache( clientId ) ;
}
@Override
@ -2296,7 +2248,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
JSONObject client = clientDetail ( manager , clientMoniker ) ;
int clientId = client . getIntValue ( "client_id" ) ;
clientMapper . disableClient ( clientId ) ;
cl earClientCache( clientId ) ;
cl ientInfoCacheSupport. cl earClientCache( clientId ) ;
}
@Override
@ -2590,7 +2542,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
checkOrgPermission ( manager , client ) ;
client . put ( "paypad_version" , paypad_version ) ;
clientMapper . update ( client ) ;
cl earClientCache( client . getIntValue ( "client_id" ) ) ;
cl ientInfoCacheSupport. cl earClientCache( client . getIntValue ( "client_id" ) ) ;
}
@Override
@ -2604,7 +2556,31 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
updateObj . put ( "client_id" , client . getIntValue ( "client_id" ) ) ;
updateObj . put ( "paypad_version" , paypad_version ) ;
clientMapper . update ( updateObj ) ;
clearClientCache ( clientId ) ;
clientInfoCacheSupport . clearClientCache ( clientId ) ;
}
@Override
@Transactional
public void changeManualSettle ( int client_id , boolean manual_settle , String operator_id , int type , String operation ) {
JSONObject client = getClientInfo ( client_id ) ;
if ( client = = null ) {
throw new BadRequestException ( "merchant not found" ) ;
}
JSONObject record = new JSONObject ( ) ;
record . put ( "client_id" , client_id ) ;
record . put ( "manual_settle" , manual_settle ) ;
clientMapper . update ( record ) ;
JSONObject actClientLog = new JSONObject ( ) ;
actClientLog . put ( "client_id" , client_id ) ;
actClientLog . put ( "operator_id" , operator_id ) ;
actClientLog . put ( "operation" , operation ) ;
actClientLog . put ( "create_time" , new Date ( ) ) ;
actClientLog . put ( "operator_type" , type ) ;
clientsOperationLogMapper . save ( actClientLog ) ;
clientInfoCacheSupport . clearClientCache ( client_id ) ;
}
@Override
@ -2618,7 +2594,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
updateObj . put ( "client_id" , client . getIntValue ( "client_id" ) ) ;
updateObj . put ( "qrcode_surcharge" , paySurcharge ) ;
clientMapper . update ( updateObj ) ;
cl earClientCache( clientId ) ;
cl ientInfoCacheSupport. cl earClientCache( clientId ) ;
}
@Override
@ -2632,7 +2608,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
updateObj . put ( "client_id" , client . getIntValue ( "client_id" ) ) ;
updateObj . put ( "api_surcharge" , enableApiSurcharge ) ;
clientMapper . update ( updateObj ) ;
cl earClientCache( clientId ) ;
cl ientInfoCacheSupport. cl earClientCache( clientId ) ;
}
@Override
@ -2650,7 +2626,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
updateObj . put ( "client_id" , client . getIntValue ( "client_id" ) ) ;
updateObj . put ( "retail_surcharge" , paySurcharge ) ;
clientMapper . update ( updateObj ) ;
cl earClientCache( clientId ) ;
cl ientInfoCacheSupport. cl earClientCache( clientId ) ;
}
@Override
@ -2678,7 +2654,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
updateObj . put ( "retail_surcharge" , updateSurchargeDTO . getRetailSurcharge ( ) ) ;
clientMapper . update ( updateObj ) ;
}
cl earClientCache( clientId ) ;
cl ientInfoCacheSupport. cl earClientCache( clientId ) ;
}
@Override
@ -2709,7 +2685,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
} catch ( Exception e ) {
logger . error ( "RefusePartnerError=======:" + clientMoniker + "," + e . getMessage ( ) ) ;
}
cl earClientCache( client . getIntValue ( "client_id" ) ) ;
cl ientInfoCacheSupport. cl earClientCache( client . getIntValue ( "client_id" ) ) ;
}
@Override
@ -2742,7 +2718,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
BigDecimal customerSurchargeRate = new BigDecimal ( appClientBean . getCustomerSurchargeRate ( ) ) . setScale ( 2 , BigDecimal . ROUND_HALF_DOWN ) ;
setCustomerSurchargeRate ( client . getString ( "client_moniker" ) , customerSurchargeRate ) ;
}
cl earClientCache( client_id ) ;
cl ientInfoCacheSupport. cl earClientCache( client_id ) ;
}
@Override
@ -2756,7 +2732,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
update . put ( "client_id" , clientId ) ;
update . put ( "skip_clearing" , skip_clearing ) ;
clientMapper . update ( update ) ;
cl earClientCache( clientId ) ;
cl ientInfoCacheSupport. cl earClientCache( clientId ) ;
}
@Override
@ -2770,7 +2746,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
update . put ( "client_id" , clientId ) ;
update . put ( "gateway_upgrade" , gatewayUpgrade ) ;
clientMapper . update ( update ) ;
cl earClientCache( clientId ) ;
cl ientInfoCacheSupport. cl earClientCache( clientId ) ;
}
private void sendMessagetoCompliance ( JSONObject client , String bd_user_name ) {