You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.5 KiB
49 lines
1.5 KiB
package com.fr.plugin.xxxx.saml; |
|
|
|
import com.fr.log.FineLoggerFactory; |
|
import com.fr.plugin.xxxx.saml.dao.SignReportDao; |
|
import com.fr.plugin.xxxx.saml.entity.SignReportEntity; |
|
import com.fr.stable.db.action.DBAction; |
|
import com.fr.stable.db.dao.DAOContext; |
|
import com.fr.stable.query.QueryFactory; |
|
import com.fr.stable.query.restriction.RestrictionFactory; |
|
|
|
import java.util.List; |
|
|
|
/** |
|
* @Author fr.open |
|
* @Date 2020/12/3 |
|
* @Description |
|
**/ |
|
public class ReportService { |
|
|
|
private ReportService() { |
|
} |
|
|
|
public static ReportService getInstance() { |
|
return new ReportService(); |
|
} |
|
|
|
|
|
public boolean isAuth(String report) { |
|
List<SignReportEntity> query = null; |
|
try { |
|
return SignDBAccessProvider.getDbAccessor().runDMLAction(new DBAction<Boolean>() { |
|
@Override |
|
public Boolean run(DAOContext daoContext) throws Exception { |
|
List<SignReportEntity> list = daoContext.getDAO(SignReportDao.class).find(QueryFactory.create().addRestriction(RestrictionFactory.eq("signFlag",true))); |
|
for (SignReportEntity entity : list) { |
|
if (report.contains(entity.getReport())) { |
|
return false; |
|
} |
|
} |
|
return true; |
|
} |
|
}); |
|
} catch (Exception e) { |
|
FineLoggerFactory.getLogger().info(e.getMessage(), e); |
|
} |
|
return true; |
|
} |
|
|
|
}
|
|
|