diff --git a/ais-structure/src/modules/customer/customer.ctrl.js b/ais-structure/src/modules/customer/customer.ctrl.js index 86a9433..3bee00f 100644 --- a/ais-structure/src/modules/customer/customer.ctrl.js +++ b/ais-structure/src/modules/customer/customer.ctrl.js @@ -55,10 +55,17 @@ exports.customer = async function (req, res, next) { var response = responseMsg.error(req,getCmd,40300); log.addErrorSummary(d01,method+"_"+sendCmd,response.resultCode,response.developerMessage); } - } else { + } else if(resultObj.resultCode.startsWith("404")){ + stats.receiveRestResponse(d01,method,sendCmd,constant.ERROR); + var response = responseMsg.direct(req,getCmd,resultObj); + log.addErrorSummary(d01,method+"_"+sendCmd,resultObj.resultCode,resultObj.developerMessage); + } else if(resultObj.resultCode.startsWith("5")){ stats.receiveRestResponse(d01,method,sendCmd,constant.ERROR); var response = responseMsg.direct(req,getCmd,resultObj); log.addErrorSummary(d01,method+"_"+sendCmd,resultObj.resultCode,resultObj.developerMessage); + } else { + stats.receiveRestResponse(d01,method,sendCmd,constant.ERROR); + var response = responseMsg.error(req,getCmd,50000); } } else { stats.receiveRestResponse(d01,method,sendCmd,constant.ERROR); diff --git a/ais-structure/src/modules/customer/postCustomer.ctrl.js b/ais-structure/src/modules/customer/postCustomer.ctrl.js index cc153ef..aaa2052 100644 --- a/ais-structure/src/modules/customer/postCustomer.ctrl.js +++ b/ais-structure/src/modules/customer/postCustomer.ctrl.js @@ -49,18 +49,21 @@ exports.postCustomer = async function (req, res, next){ stats.receiveRestResponse(d01,method,sendCmd,constant.SUCCESS); var response = responseMsg.direct(req,getCmd,resultObj,{customerId:objectData.customerId}); log.addSuccessSummary(d01,method+"_"+sendCmd,response.resultCode,response.developerMessage); - } else { - if(resultObj.resultCode != constant.RESPONSERESULT.DATA_NOT_FOUND.resultCode){ - resultObj.resultCode = constant.RESPONSERESULT.ERROR.resultCode; - } + } else if(resultObj.resultCode.startsWith("404")){ + stats.receiveRestResponse(d01,method,sendCmd,constant.ERROR); + var response = responseMsg.direct(req,getCmd,resultObj); + log.addErrorSummary(d01,method+"_"+sendCmd,response.resultCode,response.developerMessage); + } else if(resultObj.resultCode.startsWith("5")){ stats.receiveRestResponse(d01,method,sendCmd,constant.ERROR); var response = responseMsg.direct(req,getCmd,resultObj); log.addErrorSummary(d01,method+"_"+sendCmd,response.resultCode,response.developerMessage); + } else { + stats.receiveRestResponse(d01,method,sendCmd,constant.ERROR); + var response = responseMsg.error(req,getCmd,50000); } } else { stats.receiveRestResponse(d01,method,sendCmd,constant.ERROR); var response = responseMsg.error(req,getCmd,50000); - // log.addErrorSummary(d01,method+"_"+sendCmd,response.resultCode,response.developerMessage); } } diff --git a/ais-structure/src/modules/membercard/getMembership.ctrl.js b/ais-structure/src/modules/membercard/getMembership.ctrl.js index 6a71a27..0a4bd85 100644 --- a/ais-structure/src/modules/membercard/getMembership.ctrl.js +++ b/ais-structure/src/modules/membercard/getMembership.ctrl.js @@ -55,11 +55,11 @@ exports.getMembership = async function (req, res, next) { objectData = {customerId : cusIdArr} // console.log(objectData) const resultMemberCard = await connection.requestJsonToD01(objectData,sendMemCmd,method); - console.log(resultMemberCard) stats.receiveRestResponse(d01,method,sendMemCmd,constant.SUCCESS); log.logDetail.addInput(d01,method+"_"+sendCusCmd,constant.RESPONSE,resultMemberCard,resultMemberCard.response); // console.log(JSON.stringify(resultMemberCard)); var resultMemberCardObj = resultMemberCard.response; + console.log(JSON.stringify(resultMemberCardObj)) log.addSuccessSummary(d01,method+"_"+sendMemCmd,resultMemberCardObj.resultCode,resultMemberCardObj.resultDescription); for(var i = 0; i < resultObj.resultData.length; i++){ -- libgit2 0.21.2