Commit a4d76490 by linboxuan

opneedInfo update

parents 6aa57898 12fbd04b
......@@ -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) {
......@@ -39,16 +39,16 @@ class DiagnosisService extends ServiceBase {
brand_pic: actionBody.brandPic,
industry_pic: actionBody.industryPic
}
if(actionBody.diagnosisMode == "zn") {
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,
......@@ -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
......@@ -96,6 +96,7 @@ class DiagnosisService extends ServiceBase {
let res = await this.dao.findAndCountAll(query)
return system.getResultSuccess(res);
}
<<<<<<< HEAD
// 过滤数组 筛选出选择过的资质
checkIsChoice(obj) {
console.log(obj)
......@@ -104,6 +105,12 @@ class DiagnosisService extends ServiceBase {
async diagnosisDetail(pobj) {
if(!pobj.actionBody.diagnosisNo) {
return system.getResultFail(-5008, "诊断单号不能为空");
=======
async diagnosisDetail (pobj) {
if (!pobj.actionBody.diagnosisNo) {
return system.getResultFail(-5008, "诊断单号不能为空");
>>>>>>> 12fbd04b2d9c1d2ff1e7164a1cfe49808f252f60
}
let diagnosisResult = await this.dao.findOneByDiagnosisNo(pobj.actionBody.diagnosisNo)
diagnosisResult.needQualifications_pic = diagnosisResult.qualifications_pic.filter(this.checkIsChoice);
......@@ -112,11 +119,11 @@ class DiagnosisService extends ServiceBase {
return system.getResultSuccess(diagnosisResult);
}
async enterpriseInfo(pobj) {
async enterpriseInfo (pobj) {
let diagnosisResult = await this.dao.findOneOrderByCreateAt(pobj.userInfo.channel_userid)
if(diagnosisResult) {
if (diagnosisResult) {
diagnosisResult.auth_result_name = "未认证"
if(diagnosisResult.diagnosis_result == "tg") {
if (diagnosisResult.diagnosis_result == "tg") {
diagnosisResult.auth_result_name = "已认证"
}
return system.getResultSuccess(diagnosisResult);
......
......@@ -46,7 +46,7 @@ class diagnosisneedbusService extends ServiceBase {
where.publish_name = { [this.db.Op.like]: `%${data.publishName}%` }
}
if (data.stdate && data.endate) {
where.updated_at = { [this.db.Op.between]: [data.stdate, data.endate]}
where.updated_at = { [this.db.Op.between]: [data.stdate, data.endate] }
}
if (data.corporateType) {
where.corporate_type = data.corporateType
......
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