Commit a8875550 by 王勇飞

bussiness_opt inti

parent a0fa347a
......@@ -17,12 +17,14 @@ class BizOptCtl extends CtlBase {
this.dateUtil = system.getObject("util.dateClient");
}
/*根据用户id获取商机信息,分页获取*/
/**
* 根据用户id获取商机信息,分页获取
* @param pobj
*/
async findAndCountAll(pobj, qobj, req) {
try {
//TODO 根据业务员id获取该业务员所有列表
//设置查询条件
console.log("pobj--", pobj)
console.log("bizoptCtl/findAndCountAll pobj--", pobj);
if (pobj.search && pobj.search.dateType) {
if (pobj.search.dateType !== '全部') {
pobj.search.created_at = this.dateUtil.betweenTime(pobj.search.dateType);
......@@ -36,29 +38,28 @@ class BizOptCtl extends CtlBase {
let robj = {};
robj.id = element.id;//数据的id
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.business_status = element.business_status;//商机当前状态
if (element.business_info.serviceName && element.business_info.serviceName != 'undefined'){
robj.serviceName = element.business_info.serviceName;//服务地区
if (element.business_info.serviceName && element.business_info.serviceName != 'undefined') {
robj.address = element.business_info.serviceName;//服务地区
}
else{
robj.serviceName = "";
else {
robj.address = "";
}
robj.updated_at = this.timeFormat(element.updated_at);//商机当前状态日期
robj.servicerName = element.facilitator_name;
robj.facilitator_name = element.facilitator_name;
robj.sourceName = element.source_name;//渠道来源
// robj.updated_at = this.timeFormat(element.updated_at);//商机当前状态日期
robj.updated_at = element.updated_at;//商机当前状态日期
robj.business_type = element.business_type;//商机类型
robj.v_coname = element.v_coname;//联系人-shousuo
robj.source_name = element.source_name;//渠道来源--前端服务
robj.servicerName = element.facilitator_name;//服务商名称
robj.salesman_name=element.salesman_name;
robj.salesman_phone=system.decryptStr(element.salesman_phone);
// robj.facilitator_name = element.facilitator_name;//服务商名称
// 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);
});
......@@ -129,17 +130,17 @@ class BizOptCtl extends CtlBase {
}
/*更新业务员信息*/
async updateSalesmanInfoByDemandCode(mobj, qobj, req){
async updateSalesmanInfoByDemandCode(mobj, qobj, req) {
var pobj = mobj.d;
if (pobj.businessMode && pobj.businessMode != 'undefined'){
try{
if (pobj.businessMode && pobj.businessMode != 'undefined') {
try {
var res = await this.service.findInfoByDemandCode(pobj);
if (res){
if (res) {
var sInfo = {
"flowType": "BIZ",
"flowId": res.id,
"flowCode":pobj.businessMode,
"salesmanInfo":{
"flowCode": pobj.businessMode,
"salesmanInfo": {
"oldOpcode": res.salesman_opcode,
"oldClerkName": res.salesman_name,
"oldClerkId": res.salesman_id,
......@@ -158,16 +159,16 @@ class BizOptCtl extends CtlBase {
await this.service.updateSalesmanInfoByDemandCode(pobj);//更新业务员信息
return system.getResult("操作成功!");
}
else{
else {
return system.getResultError("未找到相关数据");
}
}
catch(error){
catch (error) {
return system.getResultError(error);
}
}
else{
else {
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) => {
salesman_phone: { // 业务员联系方式
allowNull: true,
type: DataTypes.STRING
},
biz_id: { // 融易算-服务实例id
allowNull: true,
type: DataTypes.STRING
}
}, {
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