Commit 2d749cc4 by 高宇强

gyq

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