first commit
This commit is contained in:
commit
4d332ef662
27586 changed files with 3281783 additions and 0 deletions
70
rus/WEB-INF/lib/abliaDbCom_src/AggiornaMagRigaDocumento.java
Normal file
70
rus/WEB-INF/lib/abliaDbCom_src/AggiornaMagRigaDocumento.java
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
import com.ablia.contab.Documento;
|
||||
import com.ablia.contab.RigaDocumento;
|
||||
import com.ablia.db.ApplParm;
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.ResParm;
|
||||
import com.ablia.util.DbConsole;
|
||||
import com.ablia.util.Vectumerator;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.Calendar;
|
||||
|
||||
public class AggiornaMagRigaDocumento extends DbConsole {
|
||||
public static void main(String[] args) {
|
||||
AggiornaMagRigaDocumento bean = new AggiornaMagRigaDocumento();
|
||||
bean.doImport();
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
public void doImport() {
|
||||
int i = 0, j = 0;
|
||||
int se1 = 10;
|
||||
int se2 = 100;
|
||||
String hostname = "localhost";
|
||||
String db = "ravinale";
|
||||
boolean step1 = true, step2 = true, step3 = true, step4 = true, step5 = true;
|
||||
System.out.println("Db: " + db);
|
||||
ApplParmFull apTarget = new ApplParmFull(new ApplParm(3, "//" + hostname + "/" + db, "root", "root", 1, 10, 60));
|
||||
apTarget.setDebug(false);
|
||||
StringBuffer msg = new StringBuffer();
|
||||
try {
|
||||
long l_id_articolo = 0L;
|
||||
ResParm rp = new ResParm(true);
|
||||
int pagerow = 1000;
|
||||
Timestamp start = new Timestamp(Calendar.getInstance().getTimeInMillis());
|
||||
System.out.println("START: " + start.toString());
|
||||
if (step1) {
|
||||
i = 0;
|
||||
System.out.println("Import All Movimento");
|
||||
RigaDocumento rd = new RigaDocumento(apTarget);
|
||||
Vectumerator<RigaDocumento> vec = rd.findByDocumento(51L, -1L, "", 0, 0, 0);
|
||||
Documento documento = new Documento(apTarget);
|
||||
documento.findByPrimaryKey(51L);
|
||||
System.out.println("tot record: " + vec.getTotNumberOfRecords());
|
||||
while (vec.hasMoreElements()) {
|
||||
rd = (RigaDocumento)vec.nextElement();
|
||||
System.out.println(String.valueOf(rd.getArticoloVariante().getCodiceVariante()) + " " + rd.getArticoloVariante().getQuantitaEffettivaAv() +
|
||||
" " + rd.getArticoloVariante().getQuantitaMagazzinoMovimentoHtml());
|
||||
if (rd.getArticoloVariante().getQuantitaEffettivaAv() == 0.0D) {
|
||||
rp = Documento.addRigaDocumento(documento, rd);
|
||||
if (rd.getArticoloVariante().getQuantitaEffettivaAv() == 0.0D)
|
||||
System.out.println(
|
||||
String.valueOf(rd.getArticoloVariante().getQuantitaEffettivaAv()) + " " + rd.getArticoloVariante().getCodiceVariante());
|
||||
}
|
||||
i++;
|
||||
if (se1 > 0 && i % se1 == 0)
|
||||
System.out.print(".");
|
||||
if (se2 > 0 && i % se2 == 0)
|
||||
System.out.println(i);
|
||||
}
|
||||
}
|
||||
Timestamp stop = new Timestamp(Calendar.getInstance().getTimeInMillis());
|
||||
stop = new Timestamp(Calendar.getInstance().getTimeInMillis());
|
||||
System.out.println("STOP: " + start.toString());
|
||||
System.out.println("DURATA: " + ((double)(stop.getTime() - start.getTime()) / 60000.0D) + " minuti");
|
||||
System.out.println("Fine");
|
||||
System.out.println(rp.getMsg());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue