@ -50,6 +50,7 @@ import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApiProvider;
import au.com.royalpay.payment.tools.connections.mpsupport.beans.TemplateMessage ;
import au.com.royalpay.payment.tools.connections.mpsupport.beans.TemplateMessage ;
import au.com.royalpay.payment.tools.connections.mpsupport.exceptions.WechatException ;
import au.com.royalpay.payment.tools.connections.mpsupport.exceptions.WechatException ;
import au.com.royalpay.payment.tools.env.PlatformEnvironment ;
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.env.SysConfigManager ;
import au.com.royalpay.payment.tools.exceptions.BadRequestException ;
import au.com.royalpay.payment.tools.exceptions.BadRequestException ;
import au.com.royalpay.payment.tools.exceptions.ForbiddenException ;
import au.com.royalpay.payment.tools.exceptions.ForbiddenException ;
@ -93,6 +94,7 @@ import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable ;
import org.springframework.cache.annotation.Cacheable ;
import org.springframework.context.ApplicationEventPublisher ;
import org.springframework.context.ApplicationEventPublisher ;
import org.springframework.context.ApplicationEventPublisherAware ;
import org.springframework.context.ApplicationEventPublisherAware ;
import org.springframework.context.MessageSource ;
import org.springframework.data.redis.core.StringRedisTemplate ;
import org.springframework.data.redis.core.StringRedisTemplate ;
import org.springframework.stereotype.Service ;
import org.springframework.stereotype.Service ;
import org.springframework.transaction.annotation.Transactional ;
import org.springframework.transaction.annotation.Transactional ;
@ -212,6 +214,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
private ClientsContractMapper clientsContractMapper ;
private ClientsContractMapper clientsContractMapper ;
@Resource
@Resource
private ClientContractService clientContractService ;
private ClientContractService clientContractService ;
@Resource
private MessageSource messageSource ;
private static final String SOURCE_AGREE_FILE = "source_agree_file" ;
private static final String SOURCE_AGREE_FILE = "source_agree_file" ;
private static final String CLIENT_BANK_FILE = "client_bank_file" ;
private static final String CLIENT_BANK_FILE = "client_bank_file" ;
@ -3127,21 +3131,20 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
result . put ( "is_ordinary" , true ) ;
result . put ( "is_ordinary" , true ) ;
if ( ! expire & & waring ) {
if ( ! expire & & waring ) {
String [ ] key = { result . getString ( "expire_days" ) } ;
String [ ] key = { result . getString ( "expire_days" ) } ;
result . put ( "contract_info" , editContractOrdinaryWaring ( key , config. getString ( "sys_contract_ordinary_waring" ) ) ) ;
result . put ( "contract_info" , editContractOrdinaryWaring ( key , messageSource. getMessage ( "sys.contract.ordinary.waring" , null , RequestEnvironment . getLocale ( ) ) ) ) ;
}
}
if ( expire ) {
if ( expire ) {
result . put ( "contract_info" , config. getString ( "sys_contract_ordinary_info" ) ) ;
result . put ( "contract_info" , messageSource. getMessage ( "sys.contract.ordinary.info" , null , RequestEnvironment . getLocale ( ) ) ) ;
}
}
return result ;
return result ;
} else {
} else {
result . put ( "contract_info" , config . getString ( "sys_contract_info" ) ) ;
result . put ( "is_ordinary" , false ) ;
result . put ( "is_ordinary" , false ) ;
if ( ! expire & & waring ) {
if ( ! expire & & waring ) {
String [ ] key = { result . getString ( "expire_days" ) } ;
String [ ] key = { result . getString ( "expire_days" ) } ;
result . put ( "contract_info" , editContractOrdinaryWaring( key , config . getString ( "sys_contract_waring" ) ) ) ;
result . put ( "contract_info" , messageSource. getMessage ( "sys.contract.waring" , null , RequestEnvironment . getLocale ( ) ) ) ;
}
}
if ( expire ) {
if ( expire ) {
result . put ( "contract_info" , config. getString ( "sys_contract_info" ) ) ;
result . put ( "contract_info" , messageSource. getMessage ( "sys.contract.info" , null , RequestEnvironment . getLocale ( ) ) ) ;
}
}
JSONObject file = clientContractService . getOrGenerateSourceAgreement ( account . getIntValue ( "client_id" ) , "pc" ) ;
JSONObject file = clientContractService . getOrGenerateSourceAgreement ( account . getIntValue ( "client_id" ) , "pc" ) ;
result . put ( "file_url" , file . getString ( "file_value" ) ) ;
result . put ( "file_url" , file . getString ( "file_value" ) ) ;