diff --git a/app/controllers/master.controller.js b/app/controllers/master.controller.js index 6ce07b2..7c3cdb5 100644 --- a/app/controllers/master.controller.js +++ b/app/controllers/master.controller.js @@ -575,34 +575,34 @@ exports.ReInitiate = async (req, res) => { // } // }; -// exports.Reassign = async (req, res) => { -// try -// { -// const id = req.query.id; +exports.Reassign = async (req, res) => { + try + { + const id = req.query.id; -// Entities.findOne({where : { id : id },attributes: ['process_instance_id'] }) -// .then(data => { -// const processInstanceId = data.dataValues.process_instance_id; -// task_id = camundaHelper.financialsListOfProcessInstances(processInstanceId); -// task_id.then(function(task_id){ -// console.log(task_id) -// if(task_id != false){ -// // value = false -// camundaHelper.financialsTaskComplete(task_id,value) -// } -// }); -// }); -// setTimeout(()=>{ -// res.send({'status':200,'message':"success",'data':"No data"}); -// },1000) -// logMsg.info("Cheker Completed Success"); -// } -// catch(err) { -// res.status(500).send({'status':404, -// message: err.message || "Some error occurred while Cheker Complete." ,'data': "No data" -// }); } + Entities.findOne({where : { id : id },attributes: ['process_instance_id'] }) + .then(data => { + const processInstanceId = data.dataValues.process_instance_id; + task_id = camundaHelper.financialsListOfProcessInstances(processInstanceId); + task_id.then(function(task_id){ + console.log(task_id) + if(task_id != false){ + value = false + camundaHelper.financialsTaskComplete(task_id,value) + } + }); + }); + setTimeout(()=>{ + res.send({'status':200,'message':"success",'data':"No data"}); + },1000) + logMsg.info("Cheker Completed Success"); + } + catch(err) { + res.status(500).send({'status':404, + message: err.message || "Some error occurred while Cheker Complete." ,'data': "No data" + }); } -// }; +}; diff --git a/app/routes/routes.js b/app/routes/routes.js index 6a305c9..4009f7d 100644 --- a/app/routes/routes.js +++ b/app/routes/routes.js @@ -876,6 +876,39 @@ module.exports = app => { */ router.get("/TaskComplete", master.TaskComplete); + /** +* @swagger +* /api/ReInitiate: +* get: +* summary: ReInitiate +* description: ReInitiate +* parameters: +* - in: query +* name: losid +* schema: +* type: string +* required: true +* description: LOSID +* example: MW112233 +* - in: query +* name: pan +* schema: +* type: string +* required: true +* description: pan no +* example: AAA123AAA +* - in: query +* name: cin +* schema: +* type: string +* required: true +* description: cin no +* example: CIN +* responses: +* 200: +* description: success +*/ + router.get("/ReInitiate", master.ReInitiate); diff --git a/app/services/camunda.helper.js b/app/services/camunda.helper.js index e9beb2b..e652586 100644 --- a/app/services/camunda.helper.js +++ b/app/services/camunda.helper.js @@ -75,8 +75,7 @@ const URL = process.env.CAMUNDA_URL { try { - console.log(value) - console.log(taskid) + const task_complete_url = URL+"task/"+taskid+"/complete"; const myJSONObject = {"variables":{"review_status":{"value":value}}}; request({