bug #6817
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@54703 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
bdbc1ef286
commit
27dc65408d
|
@ -344,7 +344,7 @@ public class FiscalHibernateDAO extends GenericHibernateDAO<String, String> impl
|
||||||
sql.append(" INNER JOIN estado ed ON ed.estado_id = cd.estado_id ");
|
sql.append(" INNER JOIN estado ed ON ed.estado_id = cd.estado_id ");
|
||||||
sql.append(" WHERE r4.datamov BETWEEN ? AND ? ");
|
sql.append(" WHERE r4.datamov BETWEEN ? AND ? ");
|
||||||
sql.append(" AND b.marca_id = ? ");
|
sql.append(" AND b.marca_id = ? ");
|
||||||
sql.append(" AND b.motivocancelacion_id in (31, 32, 10) ");
|
sql.append(" AND b.motivocancelacion_id in (31, 32) ");
|
||||||
sql.append(" GROUP BY r4.numserie20, ");
|
sql.append(" GROUP BY r4.numserie20, ");
|
||||||
sql.append(" r4.coo, ");
|
sql.append(" r4.coo, ");
|
||||||
sql.append(" r4.datainicialemissao, ");
|
sql.append(" r4.datainicialemissao, ");
|
||||||
|
@ -422,7 +422,6 @@ public class FiscalHibernateDAO extends GenericHibernateDAO<String, String> impl
|
||||||
sql.append(" INNER JOIN estado ed ON ed.estado_id = cd.estado_id ");
|
sql.append(" INNER JOIN estado ed ON ed.estado_id = cd.estado_id ");
|
||||||
sql.append(" WHERE r4.datamov BETWEEN ? AND ? ");
|
sql.append(" WHERE r4.datamov BETWEEN ? AND ? ");
|
||||||
sql.append(" AND b.marca_id = ? ");
|
sql.append(" AND b.marca_id = ? ");
|
||||||
sql.append(" AND r4.coo in (027319, 004172) ");
|
|
||||||
sql.append(" GROUP BY r4.numserie20, ");
|
sql.append(" GROUP BY r4.numserie20, ");
|
||||||
sql.append(" r4.coo, ");
|
sql.append(" r4.coo, ");
|
||||||
sql.append(" r4.datainicialemissao, ");
|
sql.append(" r4.datainicialemissao, ");
|
||||||
|
@ -523,9 +522,11 @@ public class FiscalHibernateDAO extends GenericHibernateDAO<String, String> impl
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (fiscal != null) {
|
||||||
List<ItemFiscalVO> itensFiscais = validaItensFiscais(fiscal, codProduto);
|
List<ItemFiscalVO> itensFiscais = validaItensFiscais(fiscal, codProduto);
|
||||||
fiscal.setItensFiscais(itensFiscais);
|
fiscal.setItensFiscais(itensFiscais);
|
||||||
list.add(fiscal);
|
list.add(fiscal);
|
||||||
|
}
|
||||||
|
|
||||||
if (!getConexao().isClosed())
|
if (!getConexao().isClosed())
|
||||||
getConexao().close();
|
getConexao().close();
|
||||||
|
|
|
@ -4,25 +4,32 @@ import java.io.BufferedReader;
|
||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
import java.io.FileReader;
|
import java.io.FileReader;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
public class ValidadorImportacaoEcf {
|
public class ValidadorImportacaoEcf {
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
BufferedReader br;
|
BufferedReader br;
|
||||||
try {
|
|
||||||
br = new BufferedReader(new FileReader("c:\\Users\\Wilian\\Downloads\\fiscal_201604050547.txt"));
|
|
||||||
try {
|
|
||||||
int linha = 1;
|
int linha = 1;
|
||||||
|
|
||||||
|
BigDecimal soma = BigDecimal.ZERO;
|
||||||
|
try {
|
||||||
|
br = new BufferedReader(new FileReader("c:\\Users\\rjgw\\Downloads\\fiscal_cancel_201604060542.txt"));
|
||||||
|
try {
|
||||||
|
// int linha = 1;
|
||||||
String line = br.readLine();
|
String line = br.readLine();
|
||||||
Integer l1 = null;
|
Integer l1 = null;
|
||||||
Integer l2 = null;
|
Integer l2 = null;
|
||||||
|
try {
|
||||||
while (line != null) {
|
while (line != null) {
|
||||||
if (line.startsWith("1")) {
|
if (line.startsWith("1")) {
|
||||||
l1 = Integer.valueOf(line.substring(51, 65));
|
l1 = Integer.valueOf(line.substring(51, 65).trim());
|
||||||
|
System.out.println("Linha: " + linha + " -- " + "Valor: " + l1);
|
||||||
|
soma = soma.add(new BigDecimal(l1).divide(new BigDecimal(100)));
|
||||||
l2 = 0;
|
l2 = 0;
|
||||||
}
|
}
|
||||||
if (line.startsWith("2")) {
|
if (line.startsWith("2")) {
|
||||||
l2 += Integer.valueOf(line.substring(47, 62));
|
l2 += Integer.valueOf(line.substring(47, 62).trim());
|
||||||
}
|
}
|
||||||
line = br.readLine();
|
line = br.readLine();
|
||||||
if (line.startsWith("1") && l1 != null && l2 != null) {
|
if (line.startsWith("1") && l1 != null && l2 != null) {
|
||||||
|
@ -32,8 +39,16 @@ public class ValidadorImportacaoEcf {
|
||||||
}
|
}
|
||||||
linha++;
|
linha++;
|
||||||
}
|
}
|
||||||
|
} catch (NullPointerException e) {
|
||||||
|
}
|
||||||
|
|
||||||
|
System.out.println("Soma: " + soma);
|
||||||
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
} catch (Exception e) {
|
||||||
|
System.out.println("Linha: " + linha);
|
||||||
|
e.printStackTrace();
|
||||||
} finally {
|
} finally {
|
||||||
try {
|
try {
|
||||||
br.close();
|
br.close();
|
||||||
|
|
Loading…
Reference in New Issue