Commit a8875550 by 王勇飞

bussiness_opt inti

parent a0fa347a
...@@ -17,12 +17,14 @@ class BizOptCtl extends CtlBase { ...@@ -17,12 +17,14 @@ class BizOptCtl extends CtlBase {
this.dateUtil = system.getObject("util.dateClient"); this.dateUtil = system.getObject("util.dateClient");
} }
/*根据用户id获取商机信息,分页获取*/ /**
* 根据用户id获取商机信息,分页获取
* @param pobj
*/
async findAndCountAll(pobj, qobj, req) { async findAndCountAll(pobj, qobj, req) {
try { try {
//TODO 根据业务员id获取该业务员所有列表
//设置查询条件 //设置查询条件
console.log("pobj--", pobj) console.log("bizoptCtl/findAndCountAll pobj--", pobj);
if (pobj.search && pobj.search.dateType) { if (pobj.search && pobj.search.dateType) {
if (pobj.search.dateType !== '全部') { if (pobj.search.dateType !== '全部') {
pobj.search.created_at = this.dateUtil.betweenTime(pobj.search.dateType); pobj.search.created_at = this.dateUtil.betweenTime(pobj.search.dateType);
...@@ -36,29 +38,28 @@ class BizOptCtl extends CtlBase { ...@@ -36,29 +38,28 @@ class BizOptCtl extends CtlBase {
let robj = {}; let robj = {};
robj.id = element.id;//数据的id robj.id = element.id;//数据的id
robj.demand_code = element.demand_code;//商机编号 robj.demand_code = element.demand_code;//商机编号
robj.source = element.source_name;//商机来源
// robj.source_name = element.source_name;//商机来源-jiansuo
robj.business_type = element.business_type;//商机类型
robj.business_info_person = element.business_info.contactsName;//联系人
robj.v_coname = element.v_coname;//联系人-shousuo
robj.business_info_phone = system.decryptStr(element.business_info.contactsPhone);//联系电话
robj.v_cophone = system.decryptStr(element.v_cophone);//联系电话-shousuo robj.v_cophone = system.decryptStr(element.v_cophone);//联系电话-shousuo
robj.business_status = element.business_status;//商机当前状态 robj.business_status = element.business_status;//商机当前状态
if (element.business_info.serviceName && element.business_info.serviceName != 'undefined'){ if (element.business_info.serviceName && element.business_info.serviceName != 'undefined') {
robj.serviceName = element.business_info.serviceName;//服务地区 robj.address = element.business_info.serviceName;//服务地区
} }
else{ else {
robj.serviceName = ""; robj.address = "";
} }
robj.updated_at = this.timeFormat(element.updated_at);//商机当前状态日期 // robj.updated_at = this.timeFormat(element.updated_at);//商机当前状态日期
robj.updated_at = element.updated_at;//商机当前状态日期
robj.servicerName = element.facilitator_name; robj.business_type = element.business_type;//商机类型
robj.facilitator_name = element.facilitator_name; robj.v_coname = element.v_coname;//联系人-shousuo
robj.sourceName = element.source_name;//渠道来源
robj.source_name = element.source_name;//渠道来源--前端服务 robj.source_name = element.source_name;//渠道来源--前端服务
robj.servicerName = element.facilitator_name;//服务商名称
robj.salesman_name=element.salesman_name; // robj.facilitator_name = element.facilitator_name;//服务商名称
robj.salesman_phone=system.decryptStr(element.salesman_phone); // robj.sourceName = element.source_name;//渠道来源
// robj.business_info_person = element.business_info.contactsName;//联系人
// robj.business_info_phone = system.decryptStr(element.business_info.contactsPhone);//联系电话
robj.salesman_name = element.salesman_name;
robj.salesman_phone = system.decryptStr(element.salesman_phone);
rarr.push(robj); rarr.push(robj);
}); });
...@@ -128,18 +129,18 @@ class BizOptCtl extends CtlBase { ...@@ -128,18 +129,18 @@ class BizOptCtl extends CtlBase {
} }
} }
/*更新业务员信息*/ /*更新业务员信息*/
async updateSalesmanInfoByDemandCode(mobj, qobj, req){ async updateSalesmanInfoByDemandCode(mobj, qobj, req) {
var pobj = mobj.d; var pobj = mobj.d;
if (pobj.businessMode && pobj.businessMode != 'undefined'){ if (pobj.businessMode && pobj.businessMode != 'undefined') {
try{ try {
var res = await this.service.findInfoByDemandCode(pobj); var res = await this.service.findInfoByDemandCode(pobj);
if (res){ if (res) {
var sInfo = { var sInfo = {
"flowType": "BIZ", "flowType": "BIZ",
"flowId": res.id, "flowId": res.id,
"flowCode":pobj.businessMode, "flowCode": pobj.businessMode,
"salesmanInfo":{ "salesmanInfo": {
"oldOpcode": res.salesman_opcode, "oldOpcode": res.salesman_opcode,
"oldClerkName": res.salesman_name, "oldClerkName": res.salesman_name,
"oldClerkId": res.salesman_id, "oldClerkId": res.salesman_id,
...@@ -158,16 +159,16 @@ class BizOptCtl extends CtlBase { ...@@ -158,16 +159,16 @@ class BizOptCtl extends CtlBase {
await this.service.updateSalesmanInfoByDemandCode(pobj);//更新业务员信息 await this.service.updateSalesmanInfoByDemandCode(pobj);//更新业务员信息
return system.getResult("操作成功!"); return system.getResult("操作成功!");
} }
else{ else {
return system.getResultError("未找到相关数据"); return system.getResultError("未找到相关数据");
} }
} }
catch(error){ catch (error) {
return system.getResultError(error); return system.getResultError(error);
} }
} }
else{ else {
return system.getResultError("参数错误!"); return system.getResultError("参数错误!");
} }
} }
......
const system = require("../../../system");
const Dao = require("../../dao.base");
class FitaxcompanyDao extends Dao {
constructor() {
super(Dao.getModelName(FitaxcompanyDao));
}
/**
* 插入状态信息
* @param {*} qobj
* @param {*} t
*/
async insertInfo(qobj,t){
}
/**
*增删改查
*/
}
module.exports = FitaxcompanyDao;
const system = require("../../../system");
const Dao = require("../../dao.base");
class FitaxschemeDao extends Dao {
constructor() {
super(Dao.getModelName(FitaxschemeDao));
}
/**
*增删改查
*/
/**
* 插入状态信息
* @param {*} qobj
* @param {*} t
*/
async insertInfo(qobj,t){
}
}
module.exports = FitaxschemeDao;
const system = require("../../../system");
const Dao = require("../../dao.base");
class OperationrecordDao extends Dao {
constructor() {
super(Dao.getModelName(OperationrecordDao));
}
/**
*增删改查
*/
/**
* 插入状态信息
* @param {*} qobj
* @param {*} t
*/
async insertInfo(qobj,t){
}
}
module.exports = OperationrecordDao;
...@@ -69,6 +69,10 @@ module.exports = (db, DataTypes) => { ...@@ -69,6 +69,10 @@ module.exports = (db, DataTypes) => {
salesman_phone: { // 业务员联系方式 salesman_phone: { // 业务员联系方式
allowNull: true, allowNull: true,
type: DataTypes.STRING type: DataTypes.STRING
},
biz_id: { // 融易算-服务实例id
allowNull: true,
type: DataTypes.STRING
} }
}, { }, {
paranoid: false,//假的删除 paranoid: false,//假的删除
......
const system = require("../../../system");
const settings = require("../../../../config/settings");
const appconfig = system.getSysConfig();
/**
* 财税-企业信息表
*/
module.exports = (db, DataTypes) => {
return db.define("fitaxcompany", {
demand_code: { // 需求编码
allowNull: true,
type: DataTypes.STRING
},
company_name: { // 企业名称
allowNull: true,
type: DataTypes.STRING
},
legal_person: { // 法人姓名
allowNull: true,
type: DataTypes.STRING
},
tax_number: { // 税号
allowNull: true,
type: DataTypes.STRING
},
taxpayer_type: { // 纳税人类型
allowNull: true,
type: DataTypes.STRING
},
engaged_industry: { // 所属行业
allowNull: true,
type: DataTypes.STRING
},
region: { // 地区
allowNull: true,
type: DataTypes.STRING
},
address: { // 企业地址
allowNull: true,
type: DataTypes.STRING
}
}, {
paranoid: false,//假的删除
underscored: true,
version: true,
freezeTableName: true,
//freezeTableName: true,
// define the table's name
tableName: 'fi_tax_company',
validate: {
},
indexes: [
// Create a unique index on email
// {
// unique: true,
// fields: ['email']
// },
//
// // Creates a gin index on data with the jsonb_path_ops operator
// {
// fields: ['data'],
// using: 'gin',
// operator: 'jsonb_path_ops'
// },
//
// // By default index name will be [table]_[fields]
// // Creates a multi column partial index
// {
// name: 'public_by_author',
// fields: ['author', 'status'],
// where: {
// status: 'public'
// }
// },
//
// // A BTREE index with a ordered field
// {
// name: 'title_index',
// method: 'BTREE',
// fields: ['author', {attribute: 'title', collate: 'en_US', order: 'DESC', length: 5}]
// }
]
});
}
const system = require("../../../system");
const settings = require("../../../../config/settings");
const appconfig = system.getSysConfig();
/**
* 财税-操作记录表
*/
module.exports = (db, DataTypes) => {
return db.define("operationrecord", {
demand_code: { // 需求编码
allowNull: true,
type: DataTypes.STRING
},
operator: { // 操作人
allowNull: true,
type: DataTypes.STRING
},
operation_type: { // 操作类型
allowNull: true,
type: DataTypes.STRING
},
operation_details: { // 操作详细记录
allowNull: true,
type: DataTypes.JSON
}
}, {
paranoid: false,//假的删除
underscored: true,
version: true,
freezeTableName: true,
//freezeTableName: true,
// define the table's name
tableName: 'fi_tax_operation_record',
validate: {
},
indexes: [
// Create a unique index on email
// {
// unique: true,
// fields: ['email']
// },
//
// // Creates a gin index on data with the jsonb_path_ops operator
// {
// fields: ['data'],
// using: 'gin',
// operator: 'jsonb_path_ops'
// },
//
// // By default index name will be [table]_[fields]
// // Creates a multi column partial index
// {
// name: 'public_by_author',
// fields: ['author', 'status'],
// where: {
// status: 'public'
// }
// },
//
// // A BTREE index with a ordered field
// {
// name: 'title_index',
// method: 'BTREE',
// fields: ['author', {attribute: 'title', collate: 'en_US', order: 'DESC', length: 5}]
// }
]
});
}
const system = require("../../../system");
const settings = require("../../../../config/settings");
const appconfig = system.getSysConfig();
/**
* 财税-方案表
*/
module.exports = (db, DataTypes) => {
return db.define("fitaxscheme", {
demand_code: { // 需求编码
allowNull: true,
type: DataTypes.STRING
},
solution_bizid: { // 方案编号
allowNull: true,
type: DataTypes.STRING
},
company_type: { // 公司类型
allowNull: true,
type: DataTypes.STRING
},
taxpayer_type: { // 纳税人类型
allowNull: true,
type: DataTypes.STRING
},
service_name: { // 服务地区
allowNull: true,
type: DataTypes.STRING
},
buy_duration: { // 购买时长
allowNull: true,
type: DataTypes.STRING
},
number: { // 数量
allowNull: true,
type: DataTypes.STRING
},
total_cost: { // 总计费用
allowNull: true,
type: DataTypes.STRING
},
remarks: { // 备注
allowNull: true,
type: DataTypes.STRING
},
}, {
paranoid: false,//假的删除
underscored: true,
version: true,
freezeTableName: true,
//freezeTableName: true,
// define the table's name
tableName: 'fi_tax_scheme',
validate: {
},
indexes: [
// Create a unique index on email
// {
// unique: true,
// fields: ['email']
// },
//
// // Creates a gin index on data with the jsonb_path_ops operator
// {
// fields: ['data'],
// using: 'gin',
// operator: 'jsonb_path_ops'
// },
//
// // By default index name will be [table]_[fields]
// // Creates a multi column partial index
// {
// name: 'public_by_author',
// fields: ['author', 'status'],
// where: {
// status: 'public'
// }
// },
//
// // A BTREE index with a ordered field
// {
// name: 'title_index',
// method: 'BTREE',
// fields: ['author', {attribute: 'title', collate: 'en_US', order: 'DESC', length: 5}]
// }
]
});
}
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