| | |
| | | import com.ruoyi.integration.mongodb.service.SecurityDetectionService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | |
| | | public List<SecurityDetection> findAll() { |
| | | return mongoTemplate.findAll(SecurityDetection.class); |
| | | } |
| | | |
| | | /** |
| | | * 根据业务流水号查询数据 |
| | | * @param transactionSerialNumber |
| | | * @return |
| | | */ |
| | | @Override |
| | | public SecurityDetection getSecurityDetection(String transactionSerialNumber) { |
| | | List<SecurityDetection> securityDetectionList = mongoTemplate.find(new Query().addCriteria(Criteria.where("transaction_serial_number") |
| | | .is(transactionSerialNumber)), SecurityDetection.class); |
| | | return securityDetectionList.size() > 0 ? securityDetectionList.get(0) : null; |
| | | } |
| | | } |