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

def res = dataManager.loadValues('select c.contragent.name, c.contragent.personalAccount, c.id, c.realEstate.cadastralNumber, c.realEstate.address from rtneo$ContragentRealEstate c where c.realEstate.cadastralNumber in (\'38:36:000033:10035\',\'38:36:000033:10037\',\'38:36:000033:31938\',\'38:36:000033:35074\',\'38:36:000033:10137\',\'38:36:000033:4367\',\'38:36:000033:28274\',\'38:36:000033:32276\',\'38:36:000033:32438\',\'38:36:000033:3684\',\'38:36:000033:7278\',\'38:36:000033:39717\',\'38:36:000033:39718\',\'38:36:000033:15655\',\'38:36:000033:27386\',\'38:36:000033:32288\',\'38:36:000033:756\',\'38:36:000033:4603\',\'38:36:000033:4265\',\'38:36:000033:24366\',\'38:36:000033:4036\',\'38:36:000033:4418\',\'38:36:000033:4287\') and (select count(c1) from rtneo$Contract c1 where c1.contragent.id = c.contragent.id and c1.accepted = true)>1')

.properties("name", "pa", "id", "cad", "address")

.list()

inn, number cont, 1 принятый доп



for(def item : res){

def cy = dataManager.loadValues('select r.containerYard.code, r.containerYard.address from rtneo$RealEstateContainerYard r where r.contragentRealEstate.id = :id')

.properties("code", "address")

.parameter("id", item.getValue('id'))

.list()

def str = "${item.getValue('name')}|${item.getValue('pa')}|${item.getValue('cad')}|${item.getValue('address')}|"

cy.each{str += ", "+it.getValue("code")}

str += "|"

cy.each{str += it.getValue("address")}

_(str)

}





select distinct c.contragent.name, c.contragent.personalAccount, c.contragent.inn, (select max(ct1.number) from rtneo$Contract ct1 where ct1.contragent = c.contragent) from rtneo$ContragentRealEstate c where (lower(c.realEstate.address) like lower('%%большая речка%%') or lower(c.realEstate.address) like lower('%%Бурдугуз%%') or lower(c.realEstate.address) like lower('%%Тальцы%%') or lower(c.realEstate.address) like lower('%%Бутырки%%')) and (select count(ct) from rtneo$Contract ct where ct.contragent.id = c.contragent.id and ct.accepted = true)>0






/**

* Логирование

*/

import com.haulmont.cuba.core.app.serialization.EntitySerializationAPI;

import com.groupstp.rtneo.util.JsonUtil;

import java.text.DateFormat;

import java.text.SimpleDateFormat;

private _(Object obj, String... options){

if(obj == null){log("LOG.ERROR: Object is null!!!");return}

if(options.size() == 0){log(obj)}

for(def option : options){

if(option.equals("str")){log(obj)}

if(option.equals("for")){obj.each({_(it)})}

if(option.equals("json")){

EntitySerializationAPI entitySerializationAPI = AppBeans.get(EntitySerializationAPI.NAME)

try{log(entitySerializationAPI.toJson(obj))}

catch(Exception e){log("LOG.ERROR: JSON entity serialization failed")}

}

if(option.equals("objJson")){

JsonUtil jsonUtil = AppBeans.get(JsonUtil.NAME)

try{log.(jsonUtil.toJson(obj))}

catch(Exception e){log("LOG.ERROR: JSON object serialization failed")}

}

if(option.equals("date")){

DateFormat df = new SimpleDateFormat("dd.MM.yyyy");

try{log(df.format(obj))}

catch(Exception e){log("LOG.ERROR: Failed date format")}

}

}

}

private log(Object obj){log.debug(obj)}

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