Commit 7809a203 by Sxy

Merge branch 'tx-fi-tax' of gitlab.gongsibao.com:jiangyong/zhichan into tx-fi-tax

parents 80425617 bfb52868
......@@ -9,6 +9,9 @@ class BizOptCtl extends CtlBase {
constructor() {
super("bizchance", CtlBase.getServiceName(BizOptCtl));
this.schemeService = system.getObject("service.bizchance.schemeSve");
this.schemeSve = system.getObject("service.bizchance.fitaxschemeSve");//财税-方案信息
this.fitaxcompanySve = system.getObject("service.bizchance.fitaxcompanySve");//财税-企业信息
this.operationrecordSve = system.getObject("service.bizchance.operationrecordSve");//财税-需求分配记录
this.logService = system.getObject("service.bizchance.statuslogSve");
this.shisService = system.getObject("service.bizchance.salesmanhisSve");
this.receiveUrl = settings.receiveUrl();
......@@ -32,6 +35,7 @@ class BizOptCtl extends CtlBase {
delete pobj.search.dateType
}
const rs = await this.service.findAndCountAll(pobj);
console.log("rs-------------" + rs);
let rarr = [];
let results = rs.results.rows;
results.forEach(element => {
......@@ -66,6 +70,7 @@ class BizOptCtl extends CtlBase {
rs.results.rows = rarr;
return system.getResult(rs);
} catch (error) {
console.log("error------------------------" + error);
return system.getResultError(error);
}
}
......@@ -111,7 +116,58 @@ class BizOptCtl extends CtlBase {
}
/**
* 根据需求编号获取需求详情
* 获取跟进详情页所有信息
* @param {*} mobj
* {
demand_code: "",//需求编号
}
*/
async getFollowUpInfo(mobj, qobj, req) {
var pobj = mobj.d;
if (pobj.demand_code && pobj.demand_code != 'undefined') {
try {
var bizoptInfo = await this.service.findInfoByDemandCode(pobj);
var companyInfo = await this.fitaxcompanySve.findInfo(pobj);
pobj.operation_type = "followUp";
var followUpinfos = await this.operationrecordSve.findAllInfo(pobj);
var followUpinfo = {};
if (followUpinfos.length > 0) {
followUpinfo = followUpinfos[0];
}
return system.getResult({ bizoptInfo: bizoptInfo, companyInfo: companyInfo, followUpinfo: followUpinfo });
} catch (error) {
console.log("bizopt/getFollowUpInfo err: " + error);
return system.getResultError("bizoptCtl/closeBizopt 获取跟进详情页信息出错!");
}
}
}
/**
* 获取记录详情页所有信息
* @param {*} mobj
* {
demand_code: "",//需求编号
}
*/
async getRecordInfo(mobj, qobj, req) {
var pobj = mobj.d;
if (pobj.demand_code && pobj.demand_code != 'undefined') {
try {
var bizoptInfo = await this.service.findInfoByDemandCode(pobj);//需求信息
var companyInfo = await this.fitaxcompanySve.findInfo(pobj);//企业信息
var schemeInfo = await this.schemeSve.findInfo(pobj);//方案详情
var followUpinfos = await this.operationrecordSve.findAllInfo(pobj);//线索记录
return system.getResult({ bizoptInfo: bizoptInfo, companyInfo: companyInfo, schemeInfo: schemeInfo, followUpinfos: followUpinfos });
} catch (error) {
console.log("bizopt/getFollowUpInfo err: " + error);
return system.getResultError("bizoptCtl/closeBizopt 获取跟进详情页信息出错!");
}
}
}
/**
* @param {*} mobj
*/
async findInfoByDemandCode(mobj, qobj, req) {
......@@ -171,6 +227,7 @@ class BizOptCtl extends CtlBase {
return system.getResultError("参数错误!");
}
}
/*更新业务员信息*/
async updateSalesmanInfoByDemandCode(mobj, qobj, req) {
var pobj = mobj.d;
......
......@@ -11,8 +11,8 @@ class OperationrecordCtl extends CtlBase {
* 查询记录信息
* @param {*} mobj
* {
demand_code: "",//需求编号
operation_type: ""//操作类型
demand_code: "",//必须,需求编号
operation_type: ""//可选,操作类型
}
*/
async findAllInfo(mobj, qobj, req) {
......@@ -40,6 +40,7 @@ class OperationrecordCtl extends CtlBase {
}
*/
async insertInfo(mobj, qobj, req) {
console.log("用户信息: ", mobj.userid, mobj.username);
let pobj = mobj.d;
try {
if (!pobj.demand_code) {
......
......@@ -7,7 +7,7 @@ class BizoptDao extends Dao {
extraWhere(qobj, qw, qc) {//根据业务员id获取商机信息的组装条件
qc.raw = true;
//检查查询的用户所属公司是否是平台运营公司-1,如果是则不添加公司查询条件, 不添加路径条件,返回所有数据
//检查查询的用户所属公司是否是平台运营公司-1,如果是则不需要添加公司查询条件添加公司查询条件, 不添加路径条件,返回所有数据
if (qobj.company_id == 1) {
return qw
} else {
......@@ -19,14 +19,27 @@ class BizoptDao extends Dao {
}
//不是来自平台前端查询
if (qobj.bizpath && qobj.bizpath.indexOf("pmx") < 0) {
console.log("bizpath-------------" + qobj.bizpath);
qc.where.business_type = qc.where.business_type || {
[this.db.Op.In]: ["bookkeeping"]
[this.db.Op.eq]: "bookkeeping"
}
if (qobj.bizpath && qobj.bizpath != "") {
if (qobj.bizpath.indexOf("demandAllocation") > 0) {//从需求分配列表过来的
qw["business_status"] = {
[this.db.Op.eq]: "received"
};
}
if (qobj.bizpath.indexOf("demandfollow") > 0) {//从需求跟进列表过来的
qw["business_status"] = {
[this.db.Op.in]: ["beforeFollowUp", "followingUp", "beforeSubmission"]
};
}
if (qobj.bizpath.indexOf("distributionManagement") > 0) {//从分配记录列表过来的
qw["business_status"] = {
[this.db.Op.ne]: "received"
};
}
}
// if (qobj.bizpath && qobj.bizpath != "") {
// if (qobj.bizpath.indexOf("myChance") > 0) {//说明是从商机列表过来的
// qw["salesman_id"] = qobj.userid;
// }
// }
}
}
......@@ -35,7 +48,7 @@ class BizoptDao extends Dao {
/*根据商机编号获取商机详情*/
async findInfoByDemandCode(qobj) {
var qcwhere = { "demand_code": qobj.businessMode };
var qcwhere = { "demand_code": qobj.demand_code };
return await this.findOne(qcwhere);
}
......@@ -53,7 +66,7 @@ class BizoptDao extends Dao {
}
/*更新业务员信息*/
async updateSalesmanInfoByDemandCode(qobj,t){
async updateSalesmanInfoByDemandCode(qobj, t) {
var setobj = {};
if (qobj.salesmanId && qobj.salesmanId != 'undefined') {
setobj.salesman_id = qobj.salesmanId;
......
......@@ -10,9 +10,8 @@ class OperationrecordDao extends Dao {
*@param {*} qobj
*/
async findAllInfo(qobj) {
qobj.order_type = "BIZ",//数据类型需求|订单
qobj.raw = true;
return await this.model.findAll(qobj);
qobj.order_type = "BIZ";//数据类型需求|订单
return await this.model.findAll({ where: qobj, order: [["created_at","DESC"]] });
}
/**
......@@ -38,3 +37,14 @@ class OperationrecordDao extends Dao {
}
}
module.exports = OperationrecordDao;
// let test = new OperationrecordDao();
// let a = {
// "demand_code": "111"
// }
// start(a);
// async function start(a) {
// let res = await test.findAllInfo(a);
// console.log("结果:" + JSON.stringify(res));
// }
\ No newline at end of file
......@@ -17,7 +17,7 @@ module.exports = {
},
"bizoptStatus": {//财税需求状态
"pending": "待处理",
"received": "待处理",
"beforeFollowUp": "待跟进",
"followingUp": "跟进中",
"beforeSubmission": "待确认方案",
......
......@@ -63,7 +63,7 @@ module.exports = (db, DataTypes) => {
type: DataTypes.STRING
},
master_source_number:{//主订单号
allowNull: false,
allowNull: true,
type: DataTypes.STRING
},
settle_status: {// 服务单流转状态
......@@ -72,7 +72,7 @@ module.exports = (db, DataTypes) => {
defaultValue:'waittosettle'
},
selling_price: {//售价
allowNull: false,
allowNull: true,
type: DataTypes.INTEGER
},
cost_price: {//成本价
......@@ -107,7 +107,7 @@ module.exports = (db, DataTypes) => {
allowNull: true,
type: DataTypes.STRING
},
delivery_man_id: {// 交付员id
delivery_man_id: {// 交付员idP
allowNull: true,
type: DataTypes.STRING
},
......@@ -119,7 +119,10 @@ module.exports = (db, DataTypes) => {
allowNull: true,
type: DataTypes.STRING
},
biz_id: {// 财税服务示例id
allowNull: true,
type: DataTypes.STRING
}
}, {
paranoid: false,//假的删除
underscored: true,
......
......@@ -91,7 +91,7 @@ class BizOptService extends ServiceBase {
}
/*更新业务员信息*/
async updateSalesmanInfoByDemandCode(qobj){
async updateSalesmanInfoByDemandCode(qobj) {
var self = this;
return self.db.transaction(async function (t) {
return await self.dao.updateSalesmanInfoByDemandCode(qobj, t);
......@@ -107,4 +107,14 @@ class BizOptService extends ServiceBase {
}
}
module.exports = BizOptService;
\ No newline at end of file
module.exports = BizOptService;
// let test = new BizOptService();
// let a = {
// "demand_code": "111"
// }
// start(a);
// async function start(a) {
// let res = await test.findInfoByDemandCode(a);
// console.log("结果:" + JSON.stringify(res));
// }
\ No newline at end of file
......@@ -20,9 +20,9 @@ var settings = {
salt: "%iatpD1gcxz7iF#B",
defaultpwd: "gsb2020",
basepath: path.normalize(path.join(__dirname, '../..')),
port: process.env.NODE_PORT || 8888,
port: process.env.NODE_PORT || 8889,
logindex: "center_manage",
appname: "ic_deliver",
appname: "book-deliver",
kongurl: function () {
if (this.env == "localhost") {
var localsettings = require("./localsettings");
......
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