Commit 12fbd04b by wkliang

manualEvaluation return diagnosis_no

parent 6b6764bd
......@@ -4,11 +4,11 @@ const ServiceBase = require("../../sve.base");
const settings = require("../../../../config/settings");
var moment = require('moment')
class DiagnosisService extends ServiceBase {
constructor() {
constructor () {
super("dbneed", ServiceBase.getDaoName(DiagnosisService));
}
async manualEvaluation(pobj) {
async manualEvaluation (pobj) {
var actionBody = pobj.actionBody;
var diagnosisNeedNo = await this.getBusUid("n");
if (!actionBody.mobile) {
......@@ -22,7 +22,7 @@ class DiagnosisService extends ServiceBase {
}
if (!actionBody.diagnosisType) {
return system.getResultFail(-5007, "诊断类型不能为空");
}
}
var nobj = {
uapp_id: pobj.appInfo.uapp_id,
diagnosis_no: diagnosisNeedNo, // uuid
......@@ -39,16 +39,16 @@ class DiagnosisService extends ServiceBase {
brand_pic: actionBody.brandPic,
industry_pic: actionBody.industryPic
}
if(actionBody.diagnosisMode == "zn") {
nobj.diagnosis_result = actionBody.checkResult.data.isPass == false ? "wtg" : "tg";
nobj.status = "ywc"
nobj.diagnosis_result_data = actionBody.checkResult;// 诊断方式为智能时 channel会传来诊断结果,记录快照
}
if (actionBody.diagnosisMode == "zn") {
nobj.diagnosis_result = actionBody.checkResult.data.isPass == false ? "wtg" : "tg";
nobj.status = "ywc"
nobj.diagnosis_result_data = actionBody.checkResult;// 诊断方式为智能时 channel会传来诊断结果,记录快照
}
await this.dao.create(nobj);
return system.getResultSuccess();
return system.getResultSuccess({ diagnosis_no: diagnosisNeedNo });
}
async diagnosisInfo(pobj) {
async diagnosisInfo (pobj) {
var actionBody = pobj.actionBody;
let query = {
offset: ((actionBody.page - 1) * actionBody.pageSize) || 0,
......@@ -67,8 +67,8 @@ class DiagnosisService extends ServiceBase {
}
let where = {}
if (pobj.userInfo.channel_userid) {
where.channel_user_Id = pobj.userInfo.channel_userid
}
where.channel_user_Id = pobj.userInfo.channel_userid
}
if (actionBody.diagnosisNo) {
where.diagnosis_no = { [this.db.Op.like]: `%${actionBody.diagnosisNo}%` }
}
......@@ -85,7 +85,7 @@ class DiagnosisService extends ServiceBase {
where.publish_name = { [this.db.Op.like]: `%${actionBody.publish_name}%` }
}
if (actionBody.stdate && actionBody.endate) {
where.updated_at = { [this.db.Op.between]: [actionBody.stdate, actionBody.endate]}
where.updated_at = { [this.db.Op.between]: [actionBody.stdate, actionBody.endate] }
}
if (actionBody.corporateTypeName) {
where.corporate_type_name = actionBody.corporateTypeName
......@@ -97,24 +97,24 @@ class DiagnosisService extends ServiceBase {
return system.getResultSuccess(res);
}
async diagnosisDetail(pobj) {
if(!pobj.actionBody.diagnosisNo) {
return system.getResultFail(-5008, "诊断单号不能为空");
async diagnosisDetail (pobj) {
if (!pobj.actionBody.diagnosisNo) {
return system.getResultFail(-5008, "诊断单号不能为空");
}
let diagnosisResult = await this.dao.findOneByDiagnosisNo(pobj.actionBody.diagnosisNo)
return system.getResultSuccess(diagnosisResult);
}
async enterpriseInfo(pobj) {
async enterpriseInfo (pobj) {
let diagnosisResult = await this.dao.findOneOrderByCreateAt(pobj.userInfo.channel_userid)
if(diagnosisResult) {
diagnosisResult.auth_result_name = "未认证"
if(diagnosisResult.diagnosis_result == "tg") {
diagnosisResult.auth_result_name = "已认证"
}
return system.getResultSuccess(diagnosisResult);
if (diagnosisResult) {
diagnosisResult.auth_result_name = "未认证"
if (diagnosisResult.diagnosis_result == "tg") {
diagnosisResult.auth_result_name = "已认证"
}
return system.getResultSuccess(diagnosisResult);
} else {
return system.getResultSuccess();
return system.getResultSuccess();
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment