public static LicensePFEntity get() { LicensePFEntity license = new LicensePFEntity(); license.setNumCertified("123123"); return license; }
@Override public BusinessValidateVO execute(InvoiceEntity invoice) { BusinessValidateVO validation = new BusinessValidateVO(MapTypeEnum.POLICIA_FEDERAL); for (InvoiceProductEntity product : invoice.getListInvoiceProducts()) { // Verifica se a Produto deve realmente ter Licença na Federal List<ProductOfficialTypeEntity> listTypes = productOfficialTypeDAO.findByNameNcm( MapTypeEnum.POLICIA_FEDERAL.getType(), product.getProduct().getProductOfficial().getCodNcm()); if (listTypes.isEmpty()) { continue; } LicensePFEntity license = licensePFDAO.findByCompanyExpirationDate( invoice.getCompany().getIdCompany(), invoice.getDateCreate()); ProductOfficialEntity products = licensePFDAO.findByProductOfficial( license.getIdLicense(), product.getProduct().getProductOfficial().getCodNcm()); if (products == null) { validation.setValid(false); validation.setMsg(product.getProduct().getName() + msgErro); break; } } return validation; }