Commit 69c9fdd8 by sxy

feat: 存储商机

parent 8963aa90
...@@ -25,12 +25,9 @@ class FgbusinesschanceAPI extends APIBase { ...@@ -25,12 +25,9 @@ class FgbusinesschanceAPI extends APIBase {
case "create": //创建复购商机 case "create": //创建复购商机
opResult = await this.orderinfoSve.create(pobj, pobj.actionBody); opResult = await this.orderinfoSve.create(pobj, pobj.actionBody);
break; break;
case "getInfo": //获取商机 // case "getInfo": //获取商机
opResult = await this.orderinfoSve.getInfo(pobj, pobj.actionBody); // opResult = await this.orderinfoSve.getInfo(pobj, pobj.actionBody);
break; // break;
case "updateStatus": //更新商机跟进状态 TODO
opResult = await this.orderinfoSve.findByBusinessId(pobj, pobj.actionBody);
break;
default: default:
opResult = system.getResult(null, "action_type参数错误"); opResult = system.getResult(null, "action_type参数错误");
break; break;
......
...@@ -17,26 +17,26 @@ class FgbusinesschancService extends ServiceBase { ...@@ -17,26 +17,26 @@ class FgbusinesschancService extends ServiceBase {
// this.customQuery(sql); // this.customQuery(sql);
// } // }
async create(req, actionBody) { async create(req, actionBody) {
var sql = "INSERT INTO `fg_businesschance` (`companyId` ,`companyName`,`businessId`,`status`,`stateName`,`created_at`,`collectContent` ) VALUE (:companyId,:companyName,:businessId,:status,:stateName,:created_at,:collectContent)"; var sql = "INSERT INTO `fg_businesschance` (`companyId` ,`companyName`,`businessId`,`created_at` ) VALUE (:companyId,:companyName,:businessId,:created_at)";
await this.customInsert(sql, { await this.customInsert(sql, {
...actionBody, ...actionBody,
"created_at": new Date() "created_at": actionBody.createTime ? new Date(actionBody.createTime) : new Date()
}); });
return system.getResultSuccess(); return system.getResultSuccess();
}; };
async getInfo(req, actionBody) { // async getInfo(req, actionBody) {
let sql = "select * from `fg_businesschance` where businessId=:businessId"; // let sql = "select * from `fg_businesschance` where businessId=:businessId";
var result = system.getResultSuccess(); // var result = system.getResultSuccess();
result.data = await this.customQuery(sql, { // result.data = await this.customQuery(sql, {
businessId: actionBody.businessId // businessId: actionBody.businessId
}); // });
return result // return result
}; // };
async updateStatus(req, actionBody) { // async updateStatus(req, actionBody) {
var sql = "UPDATE `fg_businesschance` SET status=:status, stateName=:stateName where businessId=:businessId"; // var sql = "UPDATE `fg_businesschance` SET status=:status, stateName=:stateName where businessId=:businessId";
await this.customUpdate(sql, actionBody); // await this.customUpdate(sql, actionBody);
return system.getResultSuccess(); // return system.getResultSuccess();
} // }
} }
module.exports = FgbusinesschancService; module.exports = FgbusinesschancService;
\ No newline at end of file
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