MyTetra Share
Делитесь знаниями!
Выгрузка Контрагент + Договор
Время создания: 06.07.2020 12:22
Раздел: INFO - JOB - rtneo - Выгрузки
Запись: wwwlir/Tetra/master/base/1594009357vl7zb7sfrg/text.html на raw.githubusercontent.com

import com.groupstp.rtneo.entity.*

import com.haulmont.cuba.core.global.*;

import java.text.SimpleDateFormat


def i = 0;

def res = [];

def contr = [];

def df1 = new SimpleDateFormat("dd.MM.yyyy")

def like = "%%г. Иркутск%%"

def count = dataManager

.loadValue('select count(c) from rtneo$Contragent c join rtneo$Contract ct where c.legalAddress like \'%г% Иркутск%\' and ct.mainContract is null and c.id = ct.contragent.id and not c.inn is null and ct.accepted = true and not c.type = 3', Integer.class)

.one();

log.debug(count)

def contragents = dataManager

.loadValues('select c.inn, c.name, c.legalAddress, c.actualAddress, ct.number, ct.date, ct.acceptanceDate, ct.loadedFromBigTrio from rtneo$Contragent c join rtneo$Contract ct where c.legalAddress like \'%г% Иркутск%\' and ct.mainContract is null and c.id = ct.contragent.id and not c.inn is null and ct.accepted = true and not c.type = 3')

.properties("inn", "name", "legalAddress", "actualAddress", "number", "date", "acceptanceDate", "bt")

.firstResult(i*10000)

.maxResults(10000)

.list();

for(def contragent : contragents){

def date = contragent.getValue('date') == null? null:df1.format(contragent.getValue('date'));

def acDate = contragent.getValue('acceptanceDate') == null? null:df1.format(contragent.getValue('acceptanceDate'));

log.debug("!${contragent.getValue('inn')}!${contragent.getValue('name')}!${contragent.getValue('legalAddress')}!${contragent.getValue('actualAddress')}!${contragent.getValue('number')}!${date}!${acDate}!${contragent.getValue('bt')}".replaceAll("\\p{Cntrl}", ""))

// contr = [

// 'inn' : contragent.getValue('inn'),

// 'name' : contragent.getValue('name'),

// 'legalAddress' : contragent.getValue('legalAddress'),

// 'actualAddress' : contragent.getValue('actualAddress'),

// 'number' : contragent.getValue('number'),

// 'date' : contragent.getValue('date')

// ];

// res.add(contr)

}

//return res;

Так же в этом разделе:
 
MyTetra Share v.0.58
Яндекс индекс цитирования