Commit ecd0e8cc by 王勇飞

gyq

parent 0739419f
......@@ -10,8 +10,9 @@ class BizOptCtl extends CtlBase {
super("bizchance", CtlBase.getServiceName(BizOptCtl));
this.schemeService = system.getObject("service.bizchance.schemeSve");
this.logService = system.getObject("service.bizchance.statuslogSve");
this.receiveUrl = "http://192.168.1.140:4011/api/receive/entService/springBoard";
this.queueUrl = "http://192.168.1.128:4018/api/queueAction/producer/springBoard";
this.receiveUrl = settings.receiveUrl();
this.queueUrl = settings.queueUrl();
//this.wdyUrl = settings.wdyUrl();
}
/*根据用户id获取商机信息,分页获取*/
......@@ -19,7 +20,7 @@ class BizOptCtl extends CtlBase {
try {
//TODO 根据业务员id获取该业务员所有列表
//设置查询条件
console.log("pobj--",pobj)
console.log("pobj--", pobj)
const rs = await this.service.findAndCountAll(pobj);
let rarr = [];
let results = rs.results.rows;
......@@ -48,47 +49,46 @@ class BizOptCtl extends CtlBase {
}
/*根据商机编号获取商机详情*/
async findInfoByDemandCode(mobj,qobj,req){
async findInfoByDemandCode(mobj, qobj, req) {
var pobj = mobj.d;
if (pobj.businessMode && pobj.businessMode != 'undefined')
{
try{
if (pobj.businessMode && pobj.businessMode != 'undefined') {
try {
var rs = await this.service.findInfoByDemandCode(pobj);
var ms = await this.schemeService.findInfoByDemandCode(pobj);
var rarr = {}
if (rs){
var statusInfo = {"currentStatus":rs.business_status};//商机状态
if (rs) {
var statusInfo = { "currentStatus": rs.business_status };//商机状态
var businessInfo = {};
businessInfo.businessMode = rs.demand_code;//商机编号
businessInfo.channelSource = appconfig.pdict.source[rs.source_name];///渠道来源
// businessInfo.businessType = rs.business_type;//商机类型代码
// businessInfo.businessType = rs.business_type;//商机类型代码
businessInfo.businessType = appconfig.pdict.businessType[rs.business_type];//商机类型名称
// businessInfo.serviceArea = rs.service_address;//服务地区
if (businessInfo.businessName == "云上园区注册"){
// businessInfo.serviceArea = rs.service_address;//服务地区
if (businessInfo.businessName == "云上园区注册") {
businessInfo.serviceArea = appconfig.pdict.registeredParkDict[rs.service_address];//服务地区名称
}
else{
else {
businessInfo.serviceArea = appconfig.pdict.registeredAreaDict[rs.service_address];//服务地区名称
}
if (businessInfo.businessName == "注册地址"){
if (businessInfo.businessName == "注册地址") {
businessInfo.registeredAddress = appconfig.pdict.registeredAreaDict[rs.service_address];//注册地址名称
}
businessInfo.statusReason = rs.close_reason;//商机关闭原因
businessInfo.memoInfo = rs.business_info.memoInfo;//备注信息
businessInfo.contactsName = rs.business_info.contactsName;//联系人名称
businessInfo.contactsPhone = rs.business_info.contactsPhone;//联系人联系方式
businessInfo.createdTime = this.timeFormat(rs.created_at);//商机创建时间
businessInfo.createdTime = this.timeFormat(rs.created_at);//商机创建时间
rarr.statusInfo = statusInfo;
rarr.businessInfo = businessInfo;
}
if (ms){
if (ms) {
var planInfo = ms.scheme_info;
planInfo.schemeNumber = ms.scheme_number;
planInfo.currentStatus = ms.scheme_status;
if ( ms.scheme_status && ms.scheme_status == "isReject"){
if (ms.scheme_status && ms.scheme_status == "isReject") {
planInfo.currentStatus = "已退回";
}
else{
else {
planInfo.currentStatus = ms.scheme_status;
}
planInfo.statusReason = ms.reject_reason;
......@@ -96,103 +96,106 @@ class BizOptCtl extends CtlBase {
}
return system.getResult(rarr);
}
catch(error){
catch (error) {
console.log("eeeeeeeeeeeeeeeeeeeeee");
console.log(error);
return system.getResultError(error);
}
}
else{
else {
return system.getResultError("参数错误!");
}
}
/*根据商机编号更新商机状态*/
async updateStatusByDemandCode(mobj,qobj,req){
async updateStatusByDemandCode(mobj, qobj, req) {
var pobj = mobj.d;
if (pobj.businessMode && pobj.businessMode != 'undefined' && pobj.currentStatus && pobj.currentStatus != 'undefined'){
try{
if (pobj.businessMode && pobj.businessMode != 'undefined' && pobj.currentStatus && pobj.currentStatus != 'undefined') {
try {
await this.service.updateStatusByDemandCode(pobj);
await this.schemeService.updateStatusByDemandCode(pobj);//同时更新方案的状态
var res = this.service.findInfoByDemandCode(pobj);
if (res && res != 'undefined'){
if (res && res != 'undefined') {
var logInfo = {
"flowType":"BIZ",
"flowId":res.id,
"statusCode":pobj.currentStatus,
"statusReason":res.close_reason,
"clerkName":res.salesman_name,
"clerkId":res.salesman_id
"flowType": "BIZ",
"flowId": res.id,
"statusCode": pobj.currentStatus,
"statusReason": res.close_reason,
"clerkName": res.salesman_name,
"clerkId": res.salesman_id
}
await this.logService.insertInfo(logInfo);//插入状态日至表
}
if (pobj.currentStatus == "isClosed"){ //关闭需求时调用
if (pobj.currentStatus == "isClosed") { //关闭需求时调用
var rc = system.getObject("util.execClient");
var requrl = this.queueUrl;
var params = {
"actionType":"produceData",
"actionBody":{
"pushUrl":this.receiveUrl,
"actionType":"closeNeed",
"identifyCode":"ic-manage",
"messageBody":{
var params = {
"actionType": "produceData",
"actionBody": {
"pushUrl": this.receiveUrl,
"actionType": "closeNeed",
"identifyCode": "ic-manage",
"messageBody": {
"needNum": pobj.businessMode,
"note":pobj.statusReason
"note": pobj.statusReason
}
}
}
}
var rtn = await rc.execPost(params, requrl);
var j = JSON.parse(rtn.stdout);
if (j.status == 1){
if (j.status == 1) {
return system.getResult("操作成功!");
}
else{
else {
return system.getResultError("更新方案状态出错!");
}
}
else {
return system.getResult("操作成功!");
}
}
catch (error){
catch (error) {
return system.getResultError(error);
}
}
else{
else {
return system.getResultError("参数错误!");
}
}
/*插入数据信息 */
async insertInfo(nobj,qobj,req){
async insertInfo(nobj, qobj, req) {
var pobj = nobj.d;
if (pobj.businessMode && pobj.businessMode != 'undefined' && pobj.businessType && pobj.businessType != 'undefined'){
try{
if (pobj.businessMode && pobj.businessMode != 'undefined' && pobj.businessType && pobj.businessType != 'undefined') {
try {
pobj.currentStatus = "beforeSubmission";//加上当前状态为待提交方案
pobj.channelSource = "tencentCloud";//目前渠道只有腾讯
pobj.sourceNumber = "1111111";
pobj.businessType = appconfig.pdict.dyDict[pobj.businessType];
var buInfo = await this.service.insertInfo(pobj);
var logInfo = {
"flowType":"BIZ",
"flowId":buInfo.id,
"statusCode":pobj.currentStatus,
"clerkName":pobj.clerkName,
"clerkId":pobj.salesmanId
"flowType": "BIZ",
"flowId": buInfo.id,
"statusCode": pobj.currentStatus,
"clerkName": pobj.clerkName,
"clerkId": pobj.salesmanId
}
await this.logService.insertInfo(logInfo);//插入状态日至表
return {
"status":1, //1代表成功,否则失败
"message":"操作成功",
"data":"",
"requestId":""
"status": 1, //1代表成功,否则失败
"message": "操作成功",
"data": "",
"requestId": ""
};
}
catch(error){
catch (error) {
console.log("TTTTTTTTTTTTTTTTTTTTTTT");
console.log(error);
return system.getResultError(error);
}
}
else{
else {
return system.getResultError("参数错误!");
}
}
......
......@@ -10,11 +10,12 @@ class DeliverybillCtl extends CtlBase {
super("bizchance", CtlBase.getServiceName(DeliverybillCtl));
this.materialService = system.getObject("service.bizchance.materialSve");
this.schemeService = system.getObject("service.bizchance.schemeSve");
this.bizoptService = system.getObject("service.bizchance.bizoptSve");
this.logService = system.getObject("service.bizchance.statuslogSve");
this.cacheService = system.getObject("service.bizchance.cacheinfoSve");
this.receiveUrl = "http://192.168.1.140:4011/api/receive/entService/springBoard";
this.queueUrl = "http://192.168.1.128:4018/api/queueAction/producer/springBoard";
this.wdyUrl = "http://192.168.1.113:4011/api/action/order/springBoard";
this.receiveUrl = settings.receiveUrl();
this.queueUrl = settings.queueUrl();
this.wdyUrl = settings.wdyUrl();
}
/*根据用户id获取商机信息,分页获取*/
......@@ -584,13 +585,20 @@ class DeliverybillCtl extends CtlBase {
if (pobj.companyInfo.companyPropertiesName && pobj.companyInfo.companyPropertiesName != 'undefined') {
if (pobj.businessName == "公司注册") {
pobj.companyInfo.companyProperties = appconfig.pdict.companyNatureDictT[pobj.companyInfo.companyPropertiesName];
pobj.baseInfo.companyProperties = pobj.companyInfo.companyProperties;
pobj.baseInfo.companyType = pobj.companyInfo.companyProperties;
}
else if (pobj.businessName == "云上园区注册") {
pobj.companyInfo.companyProperties = appconfig.pdict.registeredTypeDictT[pobj.companyInfo.companyPropertiesName];
pobj.baseInfo.companyProperties = pobj.companyInfo.companyProperties;
pobj.baseInfo.companyType = pobj.companyInfo.companyProperties;
}
pobj.baseInfo.companyProperties = pobj.companyInfo.companyProperties;
pobj.companyInfo.companyType = pobj.companyInfo.companyProperties;
pobj.baseInfo.companyType = pobj.companyInfo.companyProperties;
else{
pobj.companyInfo.companyType = pobj.companyInfo.companyPropertiesName;
pobj.baseInfo.companyProperties = pobj.companyInfo.companyPropertiesName;
pobj.baseInfo.companyType = pobj.companyInfo.companyPropertiesName;
}
}
if (pobj.companyInfo.engagedIndName && pobj.companyInfo.engagedIndName != 'undefined') {
pobj.companyInfo.engagedIndustry = appconfig.pdict.engagedIndustryDictT[pobj.companyInfo.engagedIndName];
......@@ -732,8 +740,6 @@ class DeliverybillCtl extends CtlBase {
}
}
timeFormat(date) {
let localTime = moment.utc(date).toDate();
localTime = moment(localTime).format("YYYY-MM-DD");
......@@ -809,7 +815,7 @@ class DeliverybillCtl extends CtlBase {
}
module.exports = DeliverybillCtl;
// var task = new DeliverybillCtl();
//var task = new DeliverybillCtl();
// var d = new Date("2020-06-05");
// console.log("dddddddddddd:" + d);
// var oneYear = task.oneYearPast(d,1);
......
......@@ -10,8 +10,9 @@ class SchemeCtl extends CtlBase {
super("bizchance", CtlBase.getServiceName(SchemeCtl));
this.bizoptService = system.getObject("service.bizchance.bizoptSve");
this.logService = system.getObject("service.bizchance.statuslogSve");
this.receiveUrl = "http://192.168.1.140:4011/api/receive/entService/springBoard";
// this.queueUrl = "http://192.168.1.128:4018/api/queueAction/producer/springBoard";
this.receiveUrl = settings.receiveUrl();
//this.queueUrl = settings.queueUrl();
//this.wdyUrl = settings.wdyUrl();
}
/*根据id获取方案信息详情*/
......
var path = require('path');
var ENVINPUT={
DB_HOST:process.env.DB_HOST,
DB_PORT:process.env.DB_PORT,
DB_USER:process.env.DB_USER,
DB_PWD:process.env.DB_PWD,
DB_NAME:process.env.PAAS_DB_NAME,
REDIS_HOST:process.env.REDIS_HOST,
REDIS_PORT:process.env.REDIS_PORT,
REDIS_PWD:process.env.REDIS_PWD,
REDIS_DB:process.env.PAAS_REDIS_DB,
APP_ENV:process.env.APP_ENV?process.env.APP_ENV:"dev"
var path = require('path');
var ENVINPUT = {
DB_HOST: process.env.DB_HOST,
DB_PORT: process.env.DB_PORT,
DB_USER: process.env.DB_USER,
DB_PWD: process.env.DB_PWD,
DB_NAME: process.env.PAAS_DB_NAME,
REDIS_HOST: process.env.REDIS_HOST,
REDIS_PORT: process.env.REDIS_PORT,
REDIS_PWD: process.env.REDIS_PWD,
REDIS_DB: process.env.PAAS_REDIS_DB,
APP_ENV: process.env.APP_ENV ? process.env.APP_ENV : "dev"
};
var settings = {
env:ENVINPUT.APP_ENV,
env: ENVINPUT.APP_ENV,
salt: "%iatpD1gcxz7iF#B",
defaultpwd:"gsb2020",
basepath : path.normalize(path.join(__dirname, '../..')),
port : process.env.NODE_PORT || 8888,
kongurl: function(){
if(this.env=="dev"){
defaultpwd: "gsb2020",
basepath: path.normalize(path.join(__dirname, '../..')),
port: process.env.NODE_PORT || 8888,
kongurl: function () {
if (this.env == "dev") {
return localsettings.kongurl;
}else {
} else {
return ENVINPUT.KONG_ADMIAN;
}
},
pmappid:1,
pmcompanyid:1,
pmroleid:{"ta":1,"pr":2},
redis:function(){
if(this.env=="dev"){
var localsettings=require("./localsettings");
receiveUrl: function () {
if (this.env == "dev") {
return "http://192.168.1.140:4011/api/receive/entService/springBoard";
} else {
return "";
}
},
queueUrl: function () {
if (this.env == "dev") {
return "http://192.168.1.128:4018/api/queueAction/producer/springBoard";
} else {
return "";
}
},
wdyUrl: function () {
if (this.env == "dev") {
return "http://192.168.1.113:4011/api/action/order/springBoard";
} else {
return "";
}
},
pmappid: 1,
pmcompanyid: 1,
pmroleid: { "ta": 1, "pr": 2 },
redis: function () {
if (this.env == "dev") {
var localsettings = require("./localsettings");
return localsettings.redis;
}else {
} else {
return {
host:ENVINPUT.REDIS_HOST,
port:ENVINPUT.REDIS_PORT,
password:ENVINPUT.REDIS_PWD,
db:ENVINPUT.REDIS_DB,
host: ENVINPUT.REDIS_HOST,
port: ENVINPUT.REDIS_PORT,
password: ENVINPUT.REDIS_PWD,
db: ENVINPUT.REDIS_DB,
};
}
},
database:function(){
if(this.env=="dev"){
var localsettings=require("./localsettings");
return localsettings.database;
}else{
database: function () {
if (this.env == "dev") {
var localsettings = require("./localsettings");
return localsettings.database;
} else {
return {
dbname : ENVINPUT.DB_NAME,
user : ENVINPUT.DB_USER,
password : ENVINPUT.DB_PWD,
config : {
host: ENVINPUT.DB_HOST,
dialect: 'mysql',
operatorsAliases: false,
pool: {
max: 5,
min: 0,
acquire: 90000000,
idle: 1000000
},
debug:false,
timezone:'+08:00',
dialectOptions:{
requestTimeout: 999999,
// instanceName:'DEV'
} //设置MSSQL超时时间
},
};
dbname: ENVINPUT.DB_NAME,
user: ENVINPUT.DB_USER,
password: ENVINPUT.DB_PWD,
config: {
host: ENVINPUT.DB_HOST,
dialect: 'mysql',
operatorsAliases: false,
pool: {
max: 5,
min: 0,
acquire: 90000000,
idle: 1000000
},
debug: false,
timezone: '+08:00',
dialectOptions: {
requestTimeout: 999999,
// instanceName:'DEV'
} //设置MSSQL超时时间
},
};
}
}
};
settings.ENVINPUT=ENVINPUT;
settings.ENVINPUT = ENVINPUT;
module.exports = settings;
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