@ -107,7 +107,7 @@ import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.RequestMethod ;
import org.springframework.web.bind.annotation.RequestMethod ;
import org.springframework.web.multipart.MultipartFile ;
import org.springframework.web.multipart.MultipartFile ;
import org.thymeleaf.context.Context ;
import org.thymeleaf.context.Context ;
import org.thymeleaf.spring 4 .SpringTemplateEngine;
import org.thymeleaf.spring 5 .SpringTemplateEngine;
import javax.annotation.PostConstruct ;
import javax.annotation.PostConstruct ;
import javax.annotation.Resource ;
import javax.annotation.Resource ;
@ -2036,7 +2036,24 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
throw new InvalidShortIdException ( ) ;
throw new InvalidShortIdException ( ) ;
}
}
JSONObject file = signInAccountService . checkAuthFileStatus ( client ) ;
JSONObject file = signInAccountService . checkAuthFileStatus ( client ) ;
file . put ( "file_company" , clientComplianceCompanyMapper . findFileByClientId ( account . getIntValue ( "client_id" ) ) ) ;
JSONObject compliance = clientComplianceCompanyMapper . findFileByClientId ( account . getIntValue ( "client_id" ) ) ;
file . put ( "file_company" , compliance ) ;
JSONObject photoInfo = new JSONObject ( ) ;
photoInfo . put ( "company_photo" , client . getString ( "company_photo" ) ) ;
photoInfo . put ( "store_photo" , client . getString ( "store_photo" ) ) ;
photoInfo . put ( "web_site" , client . getString ( "company_website" ) ) ;
if ( compliance ! = null ) {
if ( StringUtils . isNotBlank ( compliance . getString ( "company_photo" ) ) ) {
photoInfo . put ( "company_photo" , compliance . getString ( "company_photo" ) ) ;
}
if ( StringUtils . isNotBlank ( compliance . getString ( "store_photo" ) ) ) {
photoInfo . put ( "store_photo" , compliance . getString ( "store_photo" ) ) ;
}
if ( StringUtils . isNotBlank ( compliance . getString ( "company_website" ) ) ) {
photoInfo . put ( "web_site" , compliance . getString ( "company_website" ) ) ;
}
}
file . put ( "photo_info" , photoInfo ) ;
return file ;
return file ;
}
}
@ -2066,6 +2083,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
client . put ( "wechat_rate" , weChatRate . getBigDecimal ( "rate_value" ) . setScale ( 2 , BigDecimal . ROUND_DOWN ) ) ;
client . put ( "wechat_rate" , weChatRate . getBigDecimal ( "rate_value" ) . setScale ( 2 , BigDecimal . ROUND_DOWN ) ) ;
client . put ( "clean" , "T+" + weChatRate . getString ( "clean_days" ) ) ;
client . put ( "clean" , "T+" + weChatRate . getString ( "clean_days" ) ) ;
client . put ( "clean_days" , weChatRate . getString ( "clean_days" ) ) ;
client . put ( "clean_days" , weChatRate . getString ( "clean_days" ) ) ;
String rateConfig = sysConfigManager . getSysConfig ( ) . getString ( "sys_rates" ) ;
JSONObject sysConfigRate = JSONObject . parseObject ( rateConfig ) ;
try {
try {
JSONObject alipayRate = merchantInfoProvider . clientCurrentRate ( client . getIntValue ( "client_id" ) , new Date ( ) , "Alipay" ) ;
JSONObject alipayRate = merchantInfoProvider . clientCurrentRate ( client . getIntValue ( "client_id" ) , new Date ( ) , "Alipay" ) ;
@ -2073,16 +2092,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
client . put ( "alipay_rate" , alipayRate . getBigDecimal ( "rate_value" ) . setScale ( 2 , BigDecimal . ROUND_DOWN ) ) ;
client . put ( "alipay_rate" , alipayRate . getBigDecimal ( "rate_value" ) . setScale ( 2 , BigDecimal . ROUND_DOWN ) ) ;
}
}
JSONObject bestPayRate = merchantInfoProvider . clientCurrentRate ( client . getIntValue ( "client_id" ) , new Date ( ) , "Bestpay" ) ;
if ( bestPayRate ! = null ) {
client . put ( "bestpay_rate" , bestPayRate . getBigDecimal ( "rate_value" ) . setScale ( 2 , BigDecimal . ROUND_DOWN ) ) ;
}
JSONObject jdRate = merchantInfoProvider . clientCurrentRate ( client . getIntValue ( "client_id" ) , new Date ( ) , "jd" ) ;
if ( jdRate ! = null ) {
client . put ( "jd_rate" , jdRate . getBigDecimal ( "rate_value" ) . setScale ( 2 , BigDecimal . ROUND_DOWN ) ) ;
}
JSONObject alipayOnlineRate = merchantInfoProvider . clientCurrentRate ( client . getIntValue ( "client_id" ) , new Date ( ) , "AlipayOnline" ) ;
JSONObject alipayOnlineRate = merchantInfoProvider . clientCurrentRate ( client . getIntValue ( "client_id" ) , new Date ( ) , "AlipayOnline" ) ;
if ( alipayOnlineRate ! = null ) {
if ( alipayOnlineRate ! = null ) {
client . put ( "alipay_online_rate" , alipayOnlineRate . getBigDecimal ( "rate_value" ) . setScale ( 2 , BigDecimal . ROUND_DOWN ) ) ;
client . put ( "alipay_online_rate" , alipayOnlineRate . getBigDecimal ( "rate_value" ) . setScale ( 2 , BigDecimal . ROUND_DOWN ) ) ;
@ -2093,7 +2102,23 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
client . put ( "cbbank_rate" , cbBankPayRate . getBigDecimal ( "rate_value" ) . setScale ( 2 , BigDecimal . ROUND_DOWN ) ) ;
client . put ( "cbbank_rate" , cbBankPayRate . getBigDecimal ( "rate_value" ) . setScale ( 2 , BigDecimal . ROUND_DOWN ) ) ;
}
}
} catch ( Exception ignored ) {
} catch ( Exception ignored ) {
throw new BadRequestException ( "Merchant Rate Not Configure" ) ;
throw new BadRequestException ( "Merchant Rate Not Configure,Please Contact Customer Service" ) ;
}
try {
JSONObject bestPayRate = merchantInfoProvider . clientCurrentRate ( client . getIntValue ( "client_id" ) , new Date ( ) , "Bestpay" ) ;
if ( bestPayRate ! = null ) {
client . put ( "bestpay_rate" , bestPayRate . getBigDecimal ( "rate_value" ) . setScale ( 2 , BigDecimal . ROUND_DOWN ) ) ;
}
JSONObject jdRate = merchantInfoProvider . clientCurrentRate ( client . getIntValue ( "client_id" ) , new Date ( ) , "jd" ) ;
if ( jdRate ! = null ) {
client . put ( "jd_rate" , jdRate . getBigDecimal ( "rate_value" ) . setScale ( 2 , BigDecimal . ROUND_DOWN ) ) ;
}
} catch ( Exception ignored ) {
JSONObject rate = sysConfigRate . getJSONObject ( "t" + weChatRate . getString ( "clean_days" ) ) ;
client . put ( "bestpay_rate" , rate . getBigDecimal ( "Bestpay" ) . setScale ( 2 , BigDecimal . ROUND_DOWN ) ) ;
client . put ( "jd_rate" , rate . getBigDecimal ( "JDpay" ) . setScale ( 2 , BigDecimal . ROUND_DOWN ) ) ;
}
}
JSONObject bankAccount = getBankAccountByClientId ( client . getIntValue ( "client_id" ) ) ;
JSONObject bankAccount = getBankAccountByClientId ( client . getIntValue ( "client_id" ) ) ;
@ -2940,7 +2965,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
file . put ( "file_id" , existFile . getString ( "file_id" ) ) ;
file . put ( "file_id" , existFile . getString ( "file_id" ) ) ;
clientFilesMapper . update ( file ) ;
clientFilesMapper . update ( file ) ;
}
}
if ( ! renewal & & client . getIntValue ( "source" ) ! = 4 ) {
if ( ! renewal ) {
clientModifySupport . processClientModify ( new OpenStatusModify ( manager , clientMoniker , 2 ) ) ;
clientModifySupport . processClientModify ( new OpenStatusModify ( manager , clientMoniker , 2 ) ) ;
}
}
@ -3329,6 +3354,10 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
@Transactional
@Transactional
public void commitAuthFilesToCompliance ( String clientMoniker , JSONObject account , String source ) {
public void commitAuthFilesToCompliance ( String clientMoniker , JSONObject account , String source ) {
JSONObject client = getClientInfoByMoniker ( clientMoniker ) ;
JSONObject client = getClientInfoByMoniker ( clientMoniker ) ;
String clientPayType = "" ;
String companyPhoto = "" ;
String storePhoto = "" ;
String webSite = "" ;
int sourceEnum = 2 ;
int sourceEnum = 2 ;
if ( client = = null ) {
if ( client = = null ) {
throw new InvalidShortIdException ( ) ;
throw new InvalidShortIdException ( ) ;
@ -3353,13 +3382,21 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
if ( "app" . equals ( source . toLowerCase ( ) ) ) {
if ( "app" . equals ( source . toLowerCase ( ) ) ) {
sourceEnum = 1 ;
sourceEnum = 1 ;
}
}
JSONObject photoInfo = account . getJSONObject ( "photo_info" ) ;
if ( photoInfo ! = null ) {
companyPhoto = photoInfo . getString ( "company_photo" ) ;
storePhoto = photoInfo . getString ( "store_photo" ) ;
webSite = photoInfo . getString ( "web_site" ) ;
}
JSONObject fileComp = clientComplianceCompanyMapper . findFileByClientId ( client . getIntValue ( "client_id" ) ) ;
JSONObject fileComp = clientComplianceCompanyMapper . findFileByClientId ( client . getIntValue ( "client_id" ) ) ;
if ( fileComp = = null ) {
if ( fileComp = = null ) {
fileComp = new JSONObject ( ) ;
fileComp = new JSONObject ( ) ;
fileComp . put ( "client_id" , client . getIntValue ( "client_id" ) ) ;
fileComp . put ( "client_id" , client . getIntValue ( "client_id" ) ) ;
fileComp . put ( "submit_time" , new Date ( ) ) ;
fileComp . put ( "submit_time" , new Date ( ) ) ;
fileComp . put ( "status" , 0 ) ;
fileComp . put ( "status" , 0 ) ;
fileComp . put ( "company_photo" , companyPhoto ) ;
fileComp . put ( "store_photo" , storePhoto ) ;
fileComp . put ( "company_website" , webSite ) ;
fileComp . put ( "source" , sourceEnum ) ;
fileComp . put ( "source" , sourceEnum ) ;
fileComp . put ( "commit_by_id" , account . getString ( "account_id" ) ) ;
fileComp . put ( "commit_by_id" , account . getString ( "account_id" ) ) ;
clientComplianceCompanyMapper . save ( fileComp ) ;
clientComplianceCompanyMapper . save ( fileComp ) ;
@ -3367,6 +3404,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
} else if ( fileComp . getIntValue ( "status" ) = = 2 ) {
} else if ( fileComp . getIntValue ( "status" ) = = 2 ) {
fileComp . put ( "status" , 0 ) ;
fileComp . put ( "status" , 0 ) ;
fileComp . put ( "submit_time" , new Date ( ) ) ;
fileComp . put ( "submit_time" , new Date ( ) ) ;
fileComp . put ( "company_photo" , companyPhoto ) ;
fileComp . put ( "store_photo" , storePhoto ) ;
fileComp . put ( "company_website" , webSite ) ;
fileComp . put ( "source" , sourceEnum ) ;
fileComp . put ( "source" , sourceEnum ) ;
fileComp . put ( "commit_by_id" , account . getString ( "account_id" ) ) ;
fileComp . put ( "commit_by_id" , account . getString ( "account_id" ) ) ;
clientComplianceCompanyMapper . update ( fileComp ) ;
clientComplianceCompanyMapper . update ( fileComp ) ;
@ -3403,6 +3443,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
client . put ( "wechat_rate" , weChatRate . getBigDecimal ( "rate_value" ) . setScale ( 2 , BigDecimal . ROUND_DOWN ) ) ;
client . put ( "wechat_rate" , weChatRate . getBigDecimal ( "rate_value" ) . setScale ( 2 , BigDecimal . ROUND_DOWN ) ) ;
client . put ( "clean" , "T+" + weChatRate . getString ( "clean_days" ) ) ;
client . put ( "clean" , "T+" + weChatRate . getString ( "clean_days" ) ) ;
client . put ( "clean_days" , weChatRate . getString ( "clean_days" ) ) ;
client . put ( "clean_days" , weChatRate . getString ( "clean_days" ) ) ;
String rateConfig = sysConfigManager . getSysConfig ( ) . getString ( "sys_rates" ) ;
JSONObject sysConfigRate = JSONObject . parseObject ( rateConfig ) ;
try {
try {
JSONObject alipayRate = merchantInfoProvider . clientCurrentRate ( client . getIntValue ( "client_id" ) , new Date ( ) , "Alipay" ) ;
JSONObject alipayRate = merchantInfoProvider . clientCurrentRate ( client . getIntValue ( "client_id" ) , new Date ( ) , "Alipay" ) ;
@ -3410,16 +3452,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
client . put ( "alipay_rate" , alipayRate . getBigDecimal ( "rate_value" ) . setScale ( 2 , BigDecimal . ROUND_DOWN ) ) ;
client . put ( "alipay_rate" , alipayRate . getBigDecimal ( "rate_value" ) . setScale ( 2 , BigDecimal . ROUND_DOWN ) ) ;
}
}
JSONObject bestPayRate = merchantInfoProvider . clientCurrentRate ( client . getIntValue ( "client_id" ) , new Date ( ) , "Bestpay" ) ;
if ( bestPayRate ! = null ) {
client . put ( "bestpay_rate" , bestPayRate . getBigDecimal ( "rate_value" ) . setScale ( 2 , BigDecimal . ROUND_DOWN ) ) ;
}
JSONObject jdRate = merchantInfoProvider . clientCurrentRate ( client . getIntValue ( "client_id" ) , new Date ( ) , "jd" ) ;
if ( jdRate ! = null ) {
client . put ( "jd_rate" , jdRate . getBigDecimal ( "rate_value" ) . setScale ( 2 , BigDecimal . ROUND_DOWN ) ) ;
}
JSONObject alipayOnlineRate = merchantInfoProvider . clientCurrentRate ( client . getIntValue ( "client_id" ) , new Date ( ) , "AlipayOnline" ) ;
JSONObject alipayOnlineRate = merchantInfoProvider . clientCurrentRate ( client . getIntValue ( "client_id" ) , new Date ( ) , "AlipayOnline" ) ;
if ( alipayOnlineRate ! = null ) {
if ( alipayOnlineRate ! = null ) {
client . put ( "alipay_online_rate" , alipayOnlineRate . getBigDecimal ( "rate_value" ) . setScale ( 2 , BigDecimal . ROUND_DOWN ) ) ;
client . put ( "alipay_online_rate" , alipayOnlineRate . getBigDecimal ( "rate_value" ) . setScale ( 2 , BigDecimal . ROUND_DOWN ) ) ;
@ -3430,7 +3462,23 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
client . put ( "cbbank_rate" , cbBankPayRate . getBigDecimal ( "rate_value" ) . setScale ( 2 , BigDecimal . ROUND_DOWN ) ) ;
client . put ( "cbbank_rate" , cbBankPayRate . getBigDecimal ( "rate_value" ) . setScale ( 2 , BigDecimal . ROUND_DOWN ) ) ;
}
}
} catch ( Exception ignored ) {
} catch ( Exception ignored ) {
throw new BadRequestException ( "Merchant Rate Not Configure" ) ;
throw new BadRequestException ( "Merchant Rate Not Configure,Please Contact Customer Service" ) ;
}
try {
JSONObject bestPayRate = merchantInfoProvider . clientCurrentRate ( client . getIntValue ( "client_id" ) , new Date ( ) , "Bestpay" ) ;
if ( bestPayRate ! = null ) {
client . put ( "bestpay_rate" , bestPayRate . getBigDecimal ( "rate_value" ) . setScale ( 2 , BigDecimal . ROUND_DOWN ) ) ;
}
JSONObject jdRate = merchantInfoProvider . clientCurrentRate ( client . getIntValue ( "client_id" ) , new Date ( ) , "jd" ) ;
if ( jdRate ! = null ) {
client . put ( "jd_rate" , jdRate . getBigDecimal ( "rate_value" ) . setScale ( 2 , BigDecimal . ROUND_DOWN ) ) ;
}
} catch ( Exception ignored ) {
JSONObject rate = sysConfigRate . getJSONObject ( "t" + weChatRate . getString ( "clean_days" ) ) ;
client . put ( "bestpay_rate" , rate . getBigDecimal ( "Bestpay" ) . setScale ( 2 , BigDecimal . ROUND_DOWN ) ) ;
client . put ( "jd_rate" , rate . getBigDecimal ( "JDpay" ) . setScale ( 2 , BigDecimal . ROUND_DOWN ) ) ;
}
}
JSONObject bankAccount = getBankAccountByClientId ( client . getIntValue ( "client_id" ) ) ;
JSONObject bankAccount = getBankAccountByClientId ( client . getIntValue ( "client_id" ) ) ;
@ -4129,7 +4177,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
transactions . forEach ( e - > {
transactions . forEach ( e - > {
if ( "Credit" . equals ( e . getString ( "type" ) ) & & ! "settle revoke" . equals ( e . getString ( "remark" ) ) ) {
if ( "Credit" . equals ( e . getString ( "type" ) ) & & ! "settle revoke" . equals ( e . getString ( "remark" ) ) ) {
JSONObject manager = managerMapper . findDetail ( e . getString ( "operation" ) ) ;
JSONObject manager = managerMapper . findDetail ( e . getString ( "operation" ) ) ;
e . put ( "operator _displayname ", manager . getString ( "display_name" ) ) ;
e . put ( "operator ", manager . getString ( "display_name" ) ) ;
}
}
} ) ;
} ) ;
return transactions ;
return transactions ;
@ -4150,7 +4198,14 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
if ( client = = null ) {
if ( client = = null ) {
throw new InvalidShortIdException ( ) ;
throw new InvalidShortIdException ( ) ;
}
}
return clearingDistributedSurchargeMapper . findSurchargeTransactionsByDetailId ( client . getIntValue ( "client_id" ) , detailId ) ;
List < JSONObject > transactions = clearingDistributedSurchargeMapper . findSurchargeTransactionsByDetailId ( client . getIntValue ( "client_id" ) , detailId ) ;
transactions . forEach ( e - > {
if ( "Credit" . equals ( e . getString ( "type" ) ) & & ! "settle revoke" . equals ( e . getString ( "remark" ) ) ) {
JSONObject manager = managerMapper . findDetail ( e . getString ( "operation" ) ) ;
e . put ( "operator" , manager . getString ( "display_name" ) ) ;
}
} ) ;
return transactions ;
}
}
@Override
@Override