@ -221,6 +221,25 @@ public class RiskBusinessServiceImpl implements RiskBusinessService {
} ) ;
} ) ;
}
}
@Override
public void sendUrgeEmail ( String riskId ) throws IOException {
JSONObject event = getRiskEventDetail ( riskId ) ;
Context ctx = getMailContext ( event ) ;
final List < String > emailsTos = ( List < String > ) ctx . getVariable ( "emailsTos" ) ;
final List < String > emailsCcs = ctx . getVariable ( "emailsCcs" ) = = null ? new ArrayList < > ( ) : ( List < String > ) ctx . getVariable ( "emailsCcs" ) ;
final String content = thymeleaf . process ( "mail/risk_urge_mail.html" , ctx ) ;
royalThreadPoolExecutor . execute ( ( ) - > {
try {
String emailId = mailService . sendRiskEmail ( "Please submit risk materials as soon as possible" , emailsTos . isEmpty ( ) ? "" : StringUtils . join ( emailsTos , "," ) ,
emailsCcs . isEmpty ( ) ? "" : StringUtils . join ( emailsCcs , "," ) , content , event . getIntValue ( "order_type" ) = = 3 ? ( List < JSONObject > ) ctx . getVariable ( "files" ) : null , event . getIntValue ( "order_type" ) ) ;
event . put ( "email_status" , 3 ) ;
riskEventMapper . update ( event ) ;
} catch ( Exception e ) {
throw new EmailException ( "Email Sending Failed" , e ) ;
}
} ) ;
}
private Context getMailContext ( JSONObject event ) throws IOException {
private Context getMailContext ( JSONObject event ) throws IOException {
JSONObject client = clientMapper . findClientByMonikerAll ( event . getString ( "client_moniker" ) ) ;
JSONObject client = clientMapper . findClientByMonikerAll ( event . getString ( "client_moniker" ) ) ;
if ( client = = null ) {
if ( client = = null ) {