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()
|
||||
{
|
||||
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}})
|
||||
.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']] })
|
||||
.then(EntitiesData => {
|
||||
.then(async(EntitiesData) => {
|
||||
|
||||
|
||||
let Time = 2000;
|
||||
let data = [];
|
||||
EntitiesData.forEach((value, key)=>{
|
||||
Time = Time + 500;
|
||||
instancesid = value.dataValues.process_instance_id;
|
||||
taskid = camundaHelper.financialsListOfProcessInstances(instancesid);
|
||||
taskid.then(function(result){
|
||||
|
||||
//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;
|
||||
instancesid = value.dataValues.process_instance_id;
|
||||
taskid = await camundaHelper.financialsListOfProcessInstances(instancesid);
|
||||
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);
|
||||
});
|
||||
});
|
||||
// obj_data = { ...value.dataValues , statementsmasterrData:MasterData }
|
||||
// data.push(obj_data);
|
||||
}); // end of EntitiesData foreach
|
||||
formVariable = await camundaHelper.financialsFormVariables(taskid);
|
||||
formVariableResult = JSON.parse(formVariable);
|
||||
if(formVariableResult.type){ camunda_status = {"process_status":"NULL"}; } else { camunda_status =JSON.parse(formVariable); }
|
||||
obj_data = { ...value.dataValues ,status:camunda_status , statementsmasterrData:MasterData }
|
||||
data.push(obj_data);
|
||||
} // end of for loop
|
||||
|
||||
setTimeout(()=>{
|
||||
// below code for overall sum object push process
|
||||
sum_data = { ...{'losid':losid,'bizname':"Consolidated Financials Summary",'is_consolidated_api_call':1} , statementsmasterrData:MasterData };
|
||||
data.push(sum_data);
|
||||
// send respose to FE
|
||||
res.send({'status':200,'message':"success",'data':data});
|
||||
if(data.length >= 1)
|
||||
{
|
||||
// below code for overall sum object push process
|
||||
sum_data = { ...{'losid':losid,'bizname':"Consolidated Financials Summary",'is_consolidated_api_call':1} , statementsmasterrData:MasterData };
|
||||
data.push(sum_data);
|
||||
// send respose to FE
|
||||
res.send({'status':200,'message':"success",'data':data});
|
||||
}
|
||||
else
|
||||
{
|
||||
res.send({'status':404,'message':"failed",'data':"data not found"});
|
||||
}
|
||||
|
||||
},Time)
|
||||
}); // end of findall EntitiesData
|
||||
}); // end of findall masters datas
|
||||
|
||||
@ -43,7 +43,7 @@ const URL = process.env.CAMUNDA_URL
|
||||
const myJSONObject = { "processInstanceIdIn":[instancesid] };
|
||||
return new Promise((resolve, reject) => {
|
||||
request({
|
||||
url: task_id_url,
|
||||
url: task_id_url,
|
||||
method: "POST",
|
||||
json: true,
|
||||
body: myJSONObject
|
||||
|
||||
Loading…
Reference in New Issue
Block a user