Commit 916edf9a by 庄冰

temp

parent ff72169e
...@@ -3,12 +3,18 @@ var settings = require("../../../../config/settings"); ...@@ -3,12 +3,18 @@ var settings = require("../../../../config/settings");
const CtlBase = require("../../ctl.base"); const CtlBase = require("../../ctl.base");
var cacheBaseComp = null; var cacheBaseComp = null;
class FormInfoCtl extends CtlBase { class TemplateinfoCtl extends CtlBase {
constructor() { constructor() {
super("templateinfomag", CtlBase.getServiceName(FormInfoCtl)); super("template", CtlBase.getServiceName(TemplateinfoCtl));
this.templateinfoSve = system.getObject('service.template.templateinfoSve'); this.templateinfoSve = system.getObject('service.template.templateinfoSve');
} }
/**
* 创建模板
* @param {*} pobj
*/
async createTemplate(pobj){
return this.templateinfoSve.createTemplate(pobj);
}
/** /**
* 重写查询方法 * 重写查询方法
* @param pobj * @param pobj
...@@ -25,9 +31,9 @@ class FormInfoCtl extends CtlBase { ...@@ -25,9 +31,9 @@ class FormInfoCtl extends CtlBase {
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
async create(pobj){ async create(pobj){
let result = await this.templateinfoSve.createTemplate(pobj); let result = await this.templateinfoSve.editTemplateTdk(pobj);
return result; return result;
} }
} }
module.exports = FormInfoCtl; module.exports = TemplateinfoCtl;
...@@ -19,14 +19,13 @@ class TemplateinfoService extends ServiceBase { ...@@ -19,14 +19,13 @@ class TemplateinfoService extends ServiceBase {
*/ */
async createTemplate(pobj){ async createTemplate(pobj){
var ab = {}; var ab = {};
var xctx = pobj.xctx;
var code = await this.getBusUid("mt");//自动生成模板编码 var code = await this.getBusUid("mt");//自动生成模板编码
var name = "营销模板";//模板名称 var name = "营销模板";//模板名称
ab.code = code; ab.code = code;
ab.name = name; ab.name = name;
ab.user_id=xctx.credid; ab.user_id=pobj.userid;
ab.user_name=xctx.username; ab.user_name=pobj.username;
ab.company_id=xctx.companyid; ab.company_id=pobj.company_id;
ab.is_enabled=0; ab.is_enabled=0;
var res = await this.create(ab); var res = await this.create(ab);
return system.getResultSuccess(res); return system.getResultSuccess(res);
...@@ -112,9 +111,8 @@ class TemplateinfoService extends ServiceBase { ...@@ -112,9 +111,8 @@ class TemplateinfoService extends ServiceBase {
* @param {*} pobj * @param {*} pobj
*/ */
async editTemplateTdk(pobj){ async editTemplateTdk(pobj){
var ab = pobj.actionBody; var ab = pobj;
var updateObj = {}; var updateObj = {};
var xctx = pobj.xctx;
if(!ab){ if(!ab){
return system.getResultFail(-100,"参数错误"); return system.getResultFail(-100,"参数错误");
} }
......
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