Starter:GWM
This commit is contained in:
parent
5d6fd8722b
commit
528ba58925
@ -55,7 +55,7 @@ exports.MasterDatas = async (req, res) => {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
exports.MenuList = (req, res) => {
|
exports.MenuList = async (req, res) => {
|
||||||
Sync(function()
|
Sync(function()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@ -179,39 +179,60 @@ exports.MenuList = (req, res) => {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
EntityInsert.then(() => {
|
EntityInsert.then(async() => {
|
||||||
|
|
||||||
Statementsmaster.findAll({ where :{is_active : 1} , include: { all: true, nested: true , where :{is_active : 1} , required:false}})
|
Statementsmaster.findAll({ where :{is_active : 1} , include: { all: true, nested: true , where :{is_active : 1} , required:false}})
|
||||||
.then(MasterData => {
|
.then(MasterData => {
|
||||||
Entities.findAll({where : { losid } , attributes: [ 'id', 'losid' , 'pan' , 'cin' , 'bizname' , 'entity_type' , 'activity_group' , 'biz_act_desc' , 'process_instance_id' , 'probe42_data_status' ,'is_verified' ], order: [['id', 'ASC']] })
|
Entities.findAll({where : { losid } , attributes: [ 'id', 'losid' , 'pan' , 'cin' , 'bizname' , 'entity_type' , 'activity_group' , 'biz_act_desc' , 'process_instance_id' , 'probe42_data_status' ,'is_verified' ], order: [['id', 'ASC']] })
|
||||||
.then(EntitiesData => {
|
.then(async(EntitiesData) => {
|
||||||
|
|
||||||
|
|
||||||
let Time = 2000;
|
let Time = 2000;
|
||||||
let data = [];
|
let data = [];
|
||||||
EntitiesData.forEach((value, key)=>{
|
|
||||||
|
//EntitiesData.forEach((value, key)=>{
|
||||||
|
// Time = Time + 500;
|
||||||
|
// instancesid = value.dataValues.process_instance_id;
|
||||||
|
// taskid = camundaHelper.financialsListOfProcessInstances(instancesid);
|
||||||
|
// taskid.then(function(result){
|
||||||
|
// Time = Time + 500;
|
||||||
|
// formVariable = camundaHelper.financialsFormVariables(result);
|
||||||
|
// formVariable.then(function(form_result){
|
||||||
|
// formVariableResult = JSON.parse(form_result);
|
||||||
|
// if(formVariableResult.type){ camunda_status = {"process_status":"NULL"}; } else { camunda_status =JSON.parse(form_result); }
|
||||||
|
// obj_data = { ...value.dataValues ,status:camunda_status , statementsmasterrData:MasterData }
|
||||||
|
// data.push(obj_data);
|
||||||
|
// });
|
||||||
|
// });
|
||||||
|
//}); // end of EntitiesData foreach
|
||||||
|
|
||||||
|
for(const value of EntitiesData)
|
||||||
|
{
|
||||||
Time = Time + 500;
|
Time = Time + 500;
|
||||||
instancesid = value.dataValues.process_instance_id;
|
instancesid = value.dataValues.process_instance_id;
|
||||||
taskid = camundaHelper.financialsListOfProcessInstances(instancesid);
|
taskid = await camundaHelper.financialsListOfProcessInstances(instancesid);
|
||||||
taskid.then(function(result){
|
|
||||||
Time = Time + 500;
|
Time = Time + 500;
|
||||||
formVariable = camundaHelper.financialsFormVariables(result);
|
formVariable = await camundaHelper.financialsFormVariables(taskid);
|
||||||
formVariable.then(function(form_result){
|
formVariableResult = JSON.parse(formVariable);
|
||||||
formVariableResult = JSON.parse(form_result);
|
if(formVariableResult.type){ camunda_status = {"process_status":"NULL"}; } else { camunda_status =JSON.parse(formVariable); }
|
||||||
if(formVariableResult.type){ camunda_status = {"process_status":"NULL"}; } else { camunda_status =JSON.parse(form_result); }
|
|
||||||
obj_data = { ...value.dataValues ,status:camunda_status , statementsmasterrData:MasterData }
|
obj_data = { ...value.dataValues ,status:camunda_status , statementsmasterrData:MasterData }
|
||||||
data.push(obj_data);
|
data.push(obj_data);
|
||||||
});
|
} // end of for loop
|
||||||
});
|
|
||||||
// obj_data = { ...value.dataValues , statementsmasterrData:MasterData }
|
|
||||||
// data.push(obj_data);
|
|
||||||
}); // end of EntitiesData foreach
|
|
||||||
|
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
|
if(data.length >= 1)
|
||||||
|
{
|
||||||
// below code for overall sum object push process
|
// below code for overall sum object push process
|
||||||
sum_data = { ...{'losid':losid,'bizname':"Consolidated Financials Summary",'is_consolidated_api_call':1} , statementsmasterrData:MasterData };
|
sum_data = { ...{'losid':losid,'bizname':"Consolidated Financials Summary",'is_consolidated_api_call':1} , statementsmasterrData:MasterData };
|
||||||
data.push(sum_data);
|
data.push(sum_data);
|
||||||
// send respose to FE
|
// send respose to FE
|
||||||
res.send({'status':200,'message':"success",'data':data});
|
res.send({'status':200,'message':"success",'data':data});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
res.send({'status':404,'message':"failed",'data':"data not found"});
|
||||||
|
}
|
||||||
|
|
||||||
},Time)
|
},Time)
|
||||||
}); // end of findall EntitiesData
|
}); // end of findall EntitiesData
|
||||||
}); // end of findall masters datas
|
}); // end of findall masters datas
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user