Commit ed32a9e99f5cb682fe7dfb8fa0faa0673f5639c0
1 parent
91f86b1a
Exists in
master
and in
1 other branch
update stats vizcard
Showing
2 changed files
with
4 additions
and
6 deletions
Show diff stats
ais-structure/src/modules/helper/connection.js
... | ... | @@ -17,6 +17,7 @@ connection.requestSoapToSACF = async function (soap,cmd,myMethod) { |
17 | 17 | timeout : cfg.service.SACF[myMethod+"_"+cmd+"_Timeout"] |
18 | 18 | } |
19 | 19 | |
20 | + stats.sendSACFRequest(cfg.service.SACF.Name,cmd) | |
20 | 21 | log.logDetail.addOutput(cfg.service.SACF.Name,cmd,"Request",params.body,soap); |
21 | 22 | log.logDetail.write(); |
22 | 23 | |
... | ... | @@ -168,8 +169,6 @@ function asyncRequest (params = {},cmd,node) { |
168 | 169 | return new Promise((resolve, reject) => { |
169 | 170 | request(params, function (error, response, body) { |
170 | 171 | |
171 | - | |
172 | - | |
173 | 172 | if (error) { |
174 | 173 | |
175 | 174 | // console.log("End : "+new Date().toISOString()); | ... | ... |
ais-structure/src/modules/vizcard/vizCard.ctrl.js
... | ... | @@ -42,16 +42,15 @@ exports.vizcard = async function (req, res, next) { |
42 | 42 | // console.log(result.err) |
43 | 43 | |
44 | 44 | if(typeof result.err === 'undefined'){ |
45 | - | |
45 | + stats.reciveSACFResponse(sacf,sendCmd,"Success"); | |
46 | + | |
46 | 47 | var resultSoap = parseJson.xml2json(result.body, {compact: true, spaces: 4}) |
47 | 48 | resultSoap = JSON.parse(resultSoap) |
48 | 49 | resultSoap = resultSoap['soap:Envelope']['soap:Body']['tem:SearchCustomerResponse']['tem:SearchCustomerResult']['tem:CustomerSearchResult']; |
49 | 50 | |
50 | 51 | var resultSet = messageSOAP.soapToArray(req,resultSoap); |
51 | - | |
52 | 52 | var response = responseMsg.success(req,getCmd,{resultData:resultSet,rowCount:resultSet.length}); |
53 | 53 | |
54 | - stats.reciveSACFResponse(sacf,sendCmd,"Success"); | |
55 | 54 | log.addSuccessSummary(sacf,sendCmd,response); |
56 | 55 | // log.addErrorSummary("ABCD","EFGH",{resultCode : '50000',developerMessage : "error"}); |
57 | 56 | |
... | ... | @@ -62,7 +61,7 @@ exports.vizcard = async function (req, res, next) { |
62 | 61 | stats.reciveResponse(sacf,"SPW_"+sendCmd,"Error"); |
63 | 62 | } |
64 | 63 | |
65 | - log.logDetail.addOutput(sacf,getCmd,"Response",resultSet,response); | |
64 | + log.logDetail.addOutput(sacf,sendCmd,"Response",response,response); | |
66 | 65 | log.logDetail.write(); |
67 | 66 | log.logSummary(response); |
68 | 67 | res.status(200).json(response); | ... | ... |