completed_data
This commit is contained in:
parent
2e3f976c82
commit
bc842cf0eb
@ -36,7 +36,7 @@ exports.PullSalesPdData = async (req, res) =>
|
|||||||
values.forEach(async(values) => {
|
values.forEach(async(values) => {
|
||||||
if (keys == 'section1') {
|
if (keys == 'section1') {
|
||||||
if(values.pincode == 'Others') { pincode = values.pincode_others; }else { pincode = values.pincode; }
|
if(values.pincode == 'Others') { pincode = values.pincode_others; }else { pincode = values.pincode; }
|
||||||
Object.assign(values, { ref_no: req.body.pdid , product :req.body.product , case_no :req.body.caseno , pincode : pincode});
|
Object.assign(values, { ref_no: req.body.pdid , product :req.body.product , case_no :req.body.caseno , completed_date : req.body.completed_date , pincode : pincode});
|
||||||
await GeneralSection.create( values )
|
await GeneralSection.create( values )
|
||||||
.then((successData)=>{logMsg.info("GeneralSection insert success ,PdId= "+successData.dataValues.pd_id);})
|
.then((successData)=>{logMsg.info("GeneralSection insert success ,PdId= "+successData.dataValues.pd_id);})
|
||||||
.catch((err)=>{ logMsg.info("GeneralSection insert failed ,PdId(ref_no)= "+req.body.pdid+ " ERR =" + err); });
|
.catch((err)=>{ logMsg.info("GeneralSection insert failed ,PdId(ref_no)= "+req.body.pdid+ " ERR =" + err); });
|
||||||
@ -82,7 +82,7 @@ exports.PullSalesPdData = async (req, res) =>
|
|||||||
{
|
{
|
||||||
if (keys == 'section1') {
|
if (keys == 'section1') {
|
||||||
if(values.pincode == 'Others') { pincode = values.pincode_others; }else { pincode = values.pincode; }
|
if(values.pincode == 'Others') { pincode = values.pincode_others; }else { pincode = values.pincode; }
|
||||||
Object.assign(values, { ref_no: req.body.pdid , product :req.body.product , case_no :req.body.caseno , pincode : pincode});
|
Object.assign(values, { ref_no: req.body.pdid , product :req.body.product , case_no :req.body.caseno ,completed_date : req.body.completed_date , pincode : pincode});
|
||||||
await GeneralSection.create( values )
|
await GeneralSection.create( values )
|
||||||
.then((successData)=>{logMsg.info("GeneralSection insert success ,PdId= "+successData.dataValues.pd_id);})
|
.then((successData)=>{logMsg.info("GeneralSection insert success ,PdId= "+successData.dataValues.pd_id);})
|
||||||
.catch((err)=>{ logMsg.info("GeneralSection insert failed ,PdId(ref_no)= "+req.body.pdid+ " ERR =" + err); });
|
.catch((err)=>{ logMsg.info("GeneralSection insert failed ,PdId(ref_no)= "+req.body.pdid+ " ERR =" + err); });
|
||||||
@ -522,7 +522,38 @@ exports.DownloadPdReport = async (req, res) =>
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//GeneralSection data List Api
|
||||||
|
exports.SalesPDLandingPageList = async (req, res) =>
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
losid = req.query.losid;
|
||||||
|
GeneralSection.findAll({ where:{losid:losid,is_active : 1}})
|
||||||
|
.then(data =>
|
||||||
|
{
|
||||||
|
|
||||||
|
if(data.length > 0)
|
||||||
|
{
|
||||||
|
res.send({'status':200,'message':"success",'data':data});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
res.send({'status':404,'message':"failed",'data':"No data"});
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
res.send({'status':404,message: err.message || "Some error occurred while retrieving data" ,'data': "No data" });
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} catch(err) {
|
||||||
|
res.send({'status':404,message: err.message || "Some error occurred while retrieving data." ,'data': "No data" });
|
||||||
|
} //end of try catch
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -35,7 +35,8 @@ module.exports = (sequelize, DataTypes) => {
|
|||||||
business_office_address: { type: DataTypes.STRING },
|
business_office_address: { type: DataTypes.STRING },
|
||||||
remarks: { type: DataTypes.STRING },
|
remarks: { type: DataTypes.STRING },
|
||||||
createdby: { type: DataTypes.INTEGER },
|
createdby: { type: DataTypes.INTEGER },
|
||||||
updatedby: { type: DataTypes.INTEGER }
|
updatedby: { type: DataTypes.INTEGER },
|
||||||
|
completed_date : {type : DataTypes.DATE}
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@ -18,9 +18,25 @@ module.exports = app => {
|
|||||||
*/
|
*/
|
||||||
router.get("/demo", Mycontroller.Welcome);
|
router.get("/demo", Mycontroller.Welcome);
|
||||||
|
|
||||||
|
// landing page api
|
||||||
|
/**
|
||||||
|
* @swagger
|
||||||
|
* /api/SalesPDLandingPageList:
|
||||||
|
* get:
|
||||||
|
* summary: get all sales pd data list general section
|
||||||
|
* description:
|
||||||
|
* parameters:
|
||||||
|
* - in: query
|
||||||
|
* name: losid
|
||||||
|
* schema:
|
||||||
|
* type: string
|
||||||
|
* required: true
|
||||||
|
* example: MW112233
|
||||||
|
* responses:
|
||||||
|
* 200:
|
||||||
|
* description: success
|
||||||
|
*/
|
||||||
|
router.get('/SalesPDLandingPageList',SalesPdController.SalesPDLandingPageList);
|
||||||
|
|
||||||
// phptograph upload
|
// phptograph upload
|
||||||
const multer = require('multer');
|
const multer = require('multer');
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user