@ -71,6 +71,7 @@ import org.thymeleaf.context.Context;
import org.thymeleaf.spring5.SpringTemplateEngine ;
import javax.annotation.Resource ;
import javax.rmi.CORBA.Util ;
import javax.servlet.http.HttpServletResponse ;
import java.io.ByteArrayOutputStream ;
import java.io.IOException ;
@ -1432,6 +1433,28 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo
}
}
@Override
public JSONObject getEmailScreenshot ( String riskId ) {
JSONObject riskEvent = riskEventMapper . findById ( riskId ) ;
JSONObject result = new JSONObject ( ) ;
if ( riskEvent = = null | | riskEvent . isEmpty ( ) ) return result ;
List < JSONObject > riskMaterialList = riskMaterialMapper . findAllMaterials ( riskEvent . getString ( "risk_id" ) ) ;
if ( riskMaterialList ! = null & & ! riskMaterialList . isEmpty ( ) ) {
JSONObject fileNew = riskMaterialList . get ( 0 ) ;
List < JSONObject > files = riskFileMapper . findEmailScreenshot ( fileNew . getString ( "material_id" ) , "0" ) ;
logger . info ( "====>files:" + files ) ;
for ( JSONObject file : files ) {
// int fileType = file.getIntValue("file_type");
result . put ( "fileUrl" , file . getString ( "file_url" ) ) ;
}
result . put ( "description" , fileNew . getString ( "description" ) ) ;
}
return result ;
}
private List < String > getShopTemplate ( ) {
return Arrays . asList ( "1.与调查交易金额对应的购物小票/发票存根照片 要求:照片应清晰,必须显示商户名称、商户地址、购物时间、物品名称、购物金额等;\n" +
"Photos of shopping receipts/ invoice stubs Requirement corresponding with the investigated orders Requirement: The photos should be clear and must show Merchant name, Business address, Transaction time, Product information, Quantity purchased, etc;" ,