Commit 81d7406e by wkliang

fix

parent bf3cddbb
...@@ -40,6 +40,9 @@ class DiagnosisNeedBusAPI extends APIBase { ...@@ -40,6 +40,9 @@ class DiagnosisNeedBusAPI extends APIBase {
case 'getNeedDetail': // 需求详情 case 'getNeedDetail': // 需求详情
opResult = await this.needSve.getItemByNeedNo(pobj); opResult = await this.needSve.getItemByNeedNo(pobj);
break break
case 'addCase':
opResult = await this.dnbSve.addCase(pobj)
break
default: default:
opResult = system.getResult(null, "actionType参数错误"); opResult = system.getResult(null, "actionType参数错误");
break; break;
......
...@@ -3,6 +3,7 @@ const System = require('../../../system'); ...@@ -3,6 +3,7 @@ const System = require('../../../system');
class diagnosisneedbusService extends ServiceBase { class diagnosisneedbusService extends ServiceBase {
constructor () { constructor () {
super("dbneed", 'diagnosisDao'); super("dbneed", 'diagnosisDao');
this.solDao = System.getObject('db.dbneed.diagnosisneedsolutionDao')
} }
async getList (pobj, data, req) { async getList (pobj, data, req) {
...@@ -95,5 +96,20 @@ class diagnosisneedbusService extends ServiceBase { ...@@ -95,5 +96,20 @@ class diagnosisneedbusService extends ServiceBase {
return System.getResultFail(-1, error.message) return System.getResultFail(-1, error.message)
} }
} }
async addCase (pobj, data, req) {
try {
let param = {
diagnosis_no: data.diagnosisNo,
solution_content: data.solutionContent,
creator_id: pobj.userInfo.id,
updator_id: pobj.userInfo.id
}
let res = await this.solDao.create(param)
return System.getResultSuccess(res)
} catch (error) {
return System.getResultFail(-1, error.message)
}
}
} }
module.exports = diagnosisneedbusService; module.exports = diagnosisneedbusService;
\ No newline at end of file
...@@ -79,7 +79,7 @@ class NeedinfoService extends ServiceBase { ...@@ -79,7 +79,7 @@ class NeedinfoService extends ServiceBase {
sobj.search.publishMobile = actionBody.publishMobile sobj.search.publishMobile = actionBody.publishMobile
} }
if (actionBody.stdate && actionBody.endate) { if (actionBody.stdate && actionBody.endate) {
sobj.search.updated_at = { [this.db.Op.between]: [actionBody.stdate, actionBody.endate] } sobj.search.updated_at = [actionBody.stdate, actionBody.endate]
} }
var r = await this.dao.findAndCountAll(sobj); var r = await this.dao.findAndCountAll(sobj);
return system.getResultSuccess(r); return system.getResultSuccess(r);
...@@ -114,7 +114,7 @@ class NeedinfoService extends ServiceBase { ...@@ -114,7 +114,7 @@ class NeedinfoService extends ServiceBase {
sobj.search.publishMobile = actionBody.publishMobile sobj.search.publishMobile = actionBody.publishMobile
} }
if (actionBody.stdate && actionBody.endate) { if (actionBody.stdate && actionBody.endate) {
sobj.search.updated_at = { [this.db.Op.between]: [actionBody.stdate, actionBody.endate] } sobj.search.updated_at = [actionBody.stdate, actionBody.endate]
} }
var r = await this.dao.findAndCountAll(sobj); var r = await this.dao.findAndCountAll(sobj);
return system.getResultSuccess(r); return system.getResultSuccess(r);
......
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