|
|
@ -5,22 +5,22 @@ const fs = require('fs') |
|
|
|
var path = require('path'); |
|
|
|
var path = require('path'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
router.post('/add', function(req, res) { |
|
|
|
router.post('/add', function (req, res) { |
|
|
|
const userInfo ={ |
|
|
|
const userInfo = { |
|
|
|
firstName : req.body.firstName, |
|
|
|
firstName: req.body.firstName, |
|
|
|
lastName : req.body.lastName, |
|
|
|
lastName: req.body.lastName, |
|
|
|
fatherName : req.body.fatherName, |
|
|
|
fatherName: req.body.fatherName, |
|
|
|
codeMelli : req.body.codeMelli, |
|
|
|
codeMelli: req.body.codeMelli, |
|
|
|
workUnit : req.body.workUnit, |
|
|
|
workUnit: req.body.workUnit, |
|
|
|
workUnitCode : req.body.workUnitCode, |
|
|
|
workUnitCode: req.body.workUnitCode, |
|
|
|
address : req.body.address, |
|
|
|
address: req.body.address, |
|
|
|
obligationNumber : req.body.obligationNumber, |
|
|
|
obligationNumber: req.body.obligationNumber, |
|
|
|
obligationDate : req.body.obligationDate, |
|
|
|
obligationDate: req.body.obligationDate, |
|
|
|
requestNumber : req.body.requestNumber, |
|
|
|
requestNumber: req.body.requestNumber, |
|
|
|
requestDate : req.body.requestDate, |
|
|
|
requestDate: req.body.requestDate, |
|
|
|
writtenOrderNumber : req.body.writtenOrderNumber, |
|
|
|
writtenOrderNumber: req.body.writtenOrderNumber, |
|
|
|
writtenOrderDate : req.body.writtenOrderDate, |
|
|
|
writtenOrderDate: req.body.writtenOrderDate, |
|
|
|
deadline : req.body.deadline |
|
|
|
deadline: req.body.deadline |
|
|
|
} |
|
|
|
} |
|
|
|
userServeice.addUser(userInfo) |
|
|
|
userServeice.addUser(userInfo) |
|
|
|
.then((result) => { |
|
|
|
.then((result) => { |
|
|
@ -48,14 +48,12 @@ router.post('/add', function(req, res) { |
|
|
|
}) |
|
|
|
}) |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
router.post('/complete/form', function(req, res) { |
|
|
|
router.post('/complete/form', function (req, res) { |
|
|
|
userServeice.completeForm(req.body.userId) |
|
|
|
userServeice.completeForm(req.body.userId) |
|
|
|
.then((result) => { |
|
|
|
.then((result) => { |
|
|
|
console.log('sssssssssssssssssssss'); |
|
|
|
|
|
|
|
console.log(result); |
|
|
|
|
|
|
|
res.status(200).send({ |
|
|
|
res.status(200).send({ |
|
|
|
success: true, |
|
|
|
success: true, |
|
|
|
user: result |
|
|
|
link: result |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
.catch(err => { |
|
|
|
.catch(err => { |
|
|
@ -77,7 +75,7 @@ router.post('/complete/form', function(req, res) { |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
router.get('/download/:fileName', function(req, res){ |
|
|
|
router.get('/download/:fileName', function (req, res) { |
|
|
|
var file = fs.readFileSync(path.join(__dirname + `/../public/files/${req.params.fileName}`), 'binary'); |
|
|
|
var file = fs.readFileSync(path.join(__dirname + `/../public/files/${req.params.fileName}`), 'binary'); |
|
|
|
|
|
|
|
|
|
|
|
res.setHeader('Content-Length', file.length); |
|
|
|
res.setHeader('Content-Length', file.length); |
|
|
|