Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //ISUT-542 получение значений из справочника по имени справочника
- def getLookupValues(def requestData) {
- def args = requestData.columns != null ? requestData.columns : ["UUID", "title"];
- return modules.common.gson(utils.find(requestData.className, [:]).collect{ obj ->
- args.collectEntries { arg ->
- return ["${arg}": obj."${arg}"]
- }
- });
- }
- //ISUT-542 получение значений из класса по имени класса
- def getObjectCollection(def requestData) {
- logger.error("1");
- def args = requestData.columns;// != null ? requestData.columns : getClassAttributes(requestData.className);
- logger.error("2");
- if(requestData.className == "ae")
- return modules.common.gson(utils.find(requestData.className, [metaClass:["subSystem", "funcComponent", "funcModule"]]).collect{ obj ->
- args.collectEntries { arg ->
- return ["${arg}": obj."${arg}"]
- }
- });
- else
- {
- logger.error("3");
- def result = utils.find(requestData.className, ['UUID': 'ou$92701']);
- if(args)
- {
- logger.error("4");
- return modules.common.gson(result.collect{ obj ->
- args.collectEntries { arg ->
- return ["${arg}": obj."${arg}"]
- }
- });
- }
- else
- {
- logger.error("5");
- return modules.common.gson(result);
- }
- }
- }
- //ISUT-542 получение кодов колонок класса по имени класса
- def getClassAttributes(def objName)
- {
- def codes=[];
- api.metainfo.getMetaClass(objName).attributes.each { attribute ->
- if(attribute.type.code == "object" || attribute.type.code == "date"
- || attribute.type.code == "string" || attribute.type.code == "text" || attribute.type.code == "integer" || attribute.type.code == "bool" )
- codes.push(attribute.code)
- };
- return codes;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement