Commit 7e4c8f1e by 王勇飞

bizopt fix api

parent 88cd8ea8
......@@ -59,10 +59,10 @@ class CtlBase {
//添加组织结构路径,如果是上级,取上级
if (req.xctx.ptags && req.xctx.ptags != "") {
pobj.opath = req.xctx.ptags
pob.isPrincipal = true
pobj.isPrincipal = true
} else {
pobj.opath = req.xctx.opath
pob.isPrincipal = false
pobj.isPrincipal = false
}
if (!req.xctx.appkey) {
return [-200, "请求头缺少应用x-app-key"]
......
......@@ -75,30 +75,30 @@ class BizOptCtl extends CtlBase {
* @param {*} mobj
* @param {*} qobj
* @param {*} req
*/
async distribution(mobj, qobj, req) {
let pobj = mobj.d;
let params = {
* {
demand_code_list: ["1", "2", "3"],//至少一个需求编号
salesman_opcode: "",//唯一标识
salesman_id: "jdlfaj",//销售员id
salesman_name: "",//销售员姓名
salesman_phone: "",//销售员手机号
}
*/
async distribution(mobj, qobj, req) {
let pobj = mobj.d;
}
/**
* 关闭需求
* @param {*} mobj
*/
async closeBizopt(mobj, qobj, req) {
let pobj = mobj.d;
pobj.business_status = "isClosed";
let params = {
* {
demand_code: "",//需求编号
close_reason: "",//关闭原因
remarks: ""//备注
}
*/
async closeBizopt(mobj, qobj, req) {
let pobj = mobj.d;
pobj.business_status = "isClosed";
//根据需求编号去更新该条需求的状态为已关闭
try {
let res = await this.service.updateStatusByDemandCode(pobj);
......
......@@ -10,46 +10,46 @@ class OperationrecordCtl extends CtlBase {
/**
* 查询记录信息
* @param {*} mobj
*/
async findOne(mobj, qobj, req) {
let pobj = mobj.d;
let params = {
* {
demand_code: "",//需求编号
close_reason: "",//关闭原因
remarks: ""//备注
operation_type: ""//操作类型
}
*/
async findAllInfo(mobj, qobj, req) {
let pobj = mobj.d;
try {
if (!pobj.demand_code) {
return system.getResultError("fitaxschemeCtl/findOne 缺少需求编号!");
return system.getResultError("operationrecordCtl/findAllInfo 缺少需求编号!");
}
let res = await this.service.findInfo(pobj);
let res = await this.service.findAllInfo(pobj);
return system.getResult(res);
} catch (error) {
console.log("fitaxschemeCtl/findOne " + error);
return system.getResultError("fitaxschemeCtl/findOne 查询企业失败!");
console.log("operationrecordCtl/findAllInfo " + error);
return system.getResultError("operationrecordCtl/findAllInfo 查询企业失败!");
}
}
/**
* 新建记录信息
* @param {*} mobj
* {
demand_code: "",//需求编号
operator: { id: "", name: "" },//操作人
operation_type: "",//操作类型
operation_details: {}//操作详细记录
}
*/
async insertInfo(mobj, qobj, req) {
let pobj = mobj.d;
let params = {
demand_code: "",//需求编号
close_reason: "",//关闭原因
remarks: ""//备注
}
try {
if (!pobj.demand_code) {
return system.getResultError("fitaxschemeCtl/insertInfo 缺少需求编号!");
}
let insertRes = await this.service.insertInfo(pobj);
return system.getResult("添加企业成功!");
return system.getResult("添加记录信息成功!");
} catch (error) {
console.log("operationrecordCtl/insertInfo " + error);
return system.getResultError("operationrecordCtl/insertInfo 添加&修改企业信息失败!");
return system.getResultError("operationrecordCtl/insertInfo 添加记录信息失败!");
}
}
}
......
......@@ -10,6 +10,7 @@ class OperationrecordDao extends Dao {
*@param {*} qobj
*/
async findAllInfo(qobj) {
qobj.order_type = "BIZ",//数据类型需求|订单
qobj.raw = true;
return await this.model.findAll(qobj);
}
......@@ -22,6 +23,7 @@ class OperationrecordDao extends Dao {
async insertInfo(qobj, t) {
let obj = {
"demand_code": qobj.demand_code,// 需求编码
"order_type": "BIZ",
}
if (qobj.operator) {// 操作人
obj.operator = qobj.operator;
......
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