Commit 2d749cc4 by 高宇强

gyq

parent 6bdb1220
...@@ -198,8 +198,8 @@ class SchemeCtl extends CtlBase { ...@@ -198,8 +198,8 @@ class SchemeCtl extends CtlBase {
try{ try{
pobj.currentStatus = "beforeConfirmation";//同时把方案的状态也更新为待确认 pobj.currentStatus = "beforeConfirmation";//同时把方案的状态也更新为待确认
//修改方案的时候,需要把修改的方案传给商城 //修改方案的时候,需要把修改的方案传给商城
var mobj = pobj; var ttype = pobj.businessType;
mobj.businessType = appconfig.pdict.fdyDict[pobj.businessType]; pobj.businessType = appconfig.pdict.fdyDict[pobj.businessType];
var rc = system.getObject("util.execClient"); var rc = system.getObject("util.execClient");
var requrl = this.receiveUrl; var requrl = this.receiveUrl;
var params = { var params = {
...@@ -207,12 +207,13 @@ class SchemeCtl extends CtlBase { ...@@ -207,12 +207,13 @@ class SchemeCtl extends CtlBase {
"actionBody":{ "actionBody":{
"needNum": pobj.businessMode, "needNum": pobj.businessMode,
"solutionNum":pobj.schemeNumber, "solutionNum":pobj.schemeNumber,
"solutionContent": mobj "solutionContent": pobj
} }
} }
var rtn = await rc.execPost(params, requrl); var rtn = await rc.execPost(params, requrl);
var j = JSON.parse(rtn.stdout); var j = JSON.parse(rtn.stdout);
if (j.status == 1){ if (j.status == 1){
pobj.businessType = ttype;
var retn = await this.service.updateInfoByDemandCode(pobj);//更新方案详情 var retn = await this.service.updateInfoByDemandCode(pobj);//更新方案详情
var bobj = {"businessMode":pobj.businessMode,"currentStatus":"beforeConfirmation"};//同时把商机状态更新回待确认 var bobj = {"businessMode":pobj.businessMode,"currentStatus":"beforeConfirmation"};//同时把商机状态更新回待确认
await this.bizoptService.updateStatusByDemandCode(bobj); await this.bizoptService.updateStatusByDemandCode(bobj);
...@@ -269,8 +270,9 @@ class SchemeCtl extends CtlBase { ...@@ -269,8 +270,9 @@ class SchemeCtl extends CtlBase {
//pobj.statusReason = businessInfo.close_reason;//状态原因 //pobj.statusReason = businessInfo.close_reason;//状态原因
} }
//调商城的接口,把商机详情返回给商城 //调商城的接口,把商机详情返回给商城
var mobj = pobj; var btype = pobj.businessType;
mobj.businessType = appconfig.pdict.fdyDict[pobj.businessType]; pobj.businessType = appconfig.pdict.fdyDict[pobj.businessType];
var rc = system.getObject("util.execClient"); var rc = system.getObject("util.execClient");
var requrl = this.receiveUrl; var requrl = this.receiveUrl;
var params = { var params = {
...@@ -278,15 +280,16 @@ class SchemeCtl extends CtlBase { ...@@ -278,15 +280,16 @@ class SchemeCtl extends CtlBase {
"actionBody":{ "actionBody":{
"needNum": pobj.businessMode, "needNum": pobj.businessMode,
"solutionNum":"", "solutionNum":"",
"solutionContent": mobj "solutionContent": pobj
} }
} }
var rtn = await rc.execPost(params, requrl); var rtn = await rc.execPost(params, requrl);
var j = JSON.parse(rtn.stdout); var j = JSON.parse(rtn.stdout);
if (j.status == 1){ if (j.status == 1){
pobj.schemeNumber = j.data; pobj.schemeNumber = j.data;
await this.bizoptService.updateStatusByDemandCode(pobj);//先修改商机状态 pobj.businessType = btype;
await this.service.insertInfo(pobj); await this.service.insertInfo(pobj);
await this.bizoptService.updateStatusByDemandCode(pobj);//先修改商机状态
return system.getResult("操作成功!"); return system.getResult("操作成功!");
} }
else{ else{
...@@ -295,6 +298,7 @@ class SchemeCtl extends CtlBase { ...@@ -295,6 +298,7 @@ class SchemeCtl extends CtlBase {
} }
catch(error){ catch(error){
console.log(error);
return system.getResultError(error); return system.getResultError(error);
} }
} }
...@@ -312,9 +316,8 @@ class SchemeCtl extends CtlBase { ...@@ -312,9 +316,8 @@ class SchemeCtl extends CtlBase {
module.exports = SchemeCtl; module.exports = SchemeCtl;
// var task = new SchemeCtl(); // var task = new SchemeCtl();
// var obj={"businessMode":"202006100012","currentStatus":"beforeSubmission","baseInfo":{"memoInfo":"sfdsff","whetherType":"individual","creditCode":"1223345455","companyType":"有限公司","companyName":"三个五","establishedTime":"2010-5-6","registeredCapital":"5万元","shareholderName":"2B","businessTerm":"500","businessScope":"sgrgdrgghhh","residenceAddress":"北京市"}}; // var obj={"businessMode":"202006100002","baseInfo":{"memoInfo":"sfdsff","whetherType":"individual","creditCode":"1223345455","companyType":"有限公司","companyName":"三个五","establishedTime":"2010-5-6","registeredCapital":"5万元","shareholderName":"2B","businessTerm":"500","businessScope":"sgrgdrgghhh","residenceAddress":"北京市"}};
// task.insertInfo(obj,{},{}).then(d=>{ // task.insertInfo(obj,{},{}).then(d=>{
// console.log(d); // console.log(d);
// //console.log(d[0].analyse); // //console.log(d[0].analyse)
// }) // })
...@@ -6,49 +6,38 @@ class SchemeService extends ServiceBase { ...@@ -6,49 +6,38 @@ class SchemeService extends ServiceBase {
constructor() { constructor() {
super("bizchance", ServiceBase.getDaoName(SchemeService)); super("bizchance", ServiceBase.getDaoName(SchemeService));
} }
// async findAndCountAll(obj) {
// var self = this;
// const apps = await this.dao.findAndCountAll(obj);
// return apps;
// }
/*根据id获取方案信息*/ async findById(qobj){//根据id获取方案信息
async findById(qobj){
var oid = qobj.id; var oid = qobj.id;
return await this.dao.findById(oid); return await this.dao.findById(oid);
} }
/*根据方案编号获取方案详情*/ async findInfoByDemandCode(qobj){//根据方案编号获取方案详情
async findInfoByDemandCode(qobj){
return await this.dao.findInfoByDemandCode(qobj); return await this.dao.findInfoByDemandCode(qobj);
} }
/* 根据商机编号号更新方案状态及原因 */ async updateStatusByDemandCode(qobj){//根据商机编号号更新方案状态及原因
async updateStatusByDemandCode(qobj){
var self=this; var self=this;
return self.db.transaction(async function (t) { return self.db.transaction(async function (t) {
return await self.dao.updateStatusByDemandCode(qobj,t); return await self.dao.updateStatusByDemandCode(qobj,t);
}); });
} }
/*根据商机编号更新方案详情*/ async updateInfoByDemandCode(qobj){//根据商机编号更新方案详情
async updateInfoByDemandCode(qobj){
var self = this; var self = this;
return self.db.transaction(async function (t) { return self.db.transaction(async function (t) {
return await self.dao.updateInfoByDemandCode(qobj,t); return await self.dao.updateInfoByDemandCode(qobj,t);
}); });
} }
/*根据商机编号更新方案编号*/ async updateSchemeNumberByDemandCode(qobj){//根据商机编号更新方案编号
async updateSchemeNumberByDemandCode(qobj){
var self = this; var self = this;
return self.db.transaction(async function (t) { return self.db.transaction(async function (t) {
return await self.dao.updateSchemeNumberByDemandCode(qobj,t); return await self.dao.updateSchemeNumberByDemandCode(qobj,t);
}); });
} }
/*插入方案信息*/ async insertInfo(qobj){//插入方案信息
async insertInfo(qobj){
var self = this; var self = this;
return await self.db.transaction(async function (t) { return await self.db.transaction(async function (t) {
return await self.dao.insertInfo(qobj,t); return await self.dao.insertInfo(qobj,t);
......
...@@ -217,7 +217,7 @@ class System { ...@@ -217,7 +217,7 @@ class System {
try { try {
ClassObj = require(objabspath); ClassObj = require(objabspath);
} catch (e) { } catch (e) {
// console.log(e) console.log(e)
let fname = objsettings[packageName + "base"]; let fname = objsettings[packageName + "base"];
ClassObj = require(fname); ClassObj = require(fname);
} }
......
...@@ -30,7 +30,7 @@ class ExecClient { ...@@ -30,7 +30,7 @@ class ExecClient {
async execPost(subData, url) { async execPost(subData, url) {
let cmd = this.FetchPostCmd(subData, url); let cmd = this.FetchPostCmd(subData, url);
console.log("__________________" + cmd); //console.log("__________________" + cmd);
var result = await this.exec(cmd); var result = await this.exec(cmd);
return result; return result;
} }
......
...@@ -16,7 +16,7 @@ var settings = { ...@@ -16,7 +16,7 @@ var settings = {
salt: "%iatpD1gcxz7iF#B", salt: "%iatpD1gcxz7iF#B",
defaultpwd:"gsb2020", defaultpwd:"gsb2020",
basepath : path.normalize(path.join(__dirname, '../..')), basepath : path.normalize(path.join(__dirname, '../..')),
port : process.env.NODE_PORT || 8003, port : process.env.NODE_PORT || 8888,
kongurl: function(){ kongurl: function(){
if(this.env=="dev"){ if(this.env=="dev"){
return localsettings.kongurl; return localsettings.kongurl;
......
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