Commit 10f38c18 by 王勇飞

gyq

parent fa903c92
...@@ -248,45 +248,45 @@ class BizOptCtl extends CtlBase { ...@@ -248,45 +248,45 @@ class BizOptCtl extends CtlBase {
/*更新业务员信息*/ /*更新业务员信息*/
async updateSalesmanInfoByDemandCode(mobj, qobj, req) { async updateSalesmanInfoByDemandCode(mobj, qobj, req) {
var pobj = mobj.d; var pobj = mobj.d;
if (pobj.businessMode && pobj.businessMode != 'undefined') { if (pobj.businessMode && pobj.businessMode != 'undefined') {
try { try {
var res = await this.service.findInfoByDemandCode(pobj); var res = await this.service.findInfoByDemandCode(pobj);
if (res) { if (res) {
var sInfo = { var sInfo = {
"flowType": "BIZ", "flowType": "BIZ",
"flowId": res.id, "flowId": res.id,
"flowCode": pobj.businessMode, "flowCode": pobj.businessMode,
"salesmanInfo": { "salesmanInfo": {
"oldOpcode": res.salesman_opcode, "oldOpcode": res.salesman_opcode,
"oldClerkName": res.salesman_name, "oldClerkName": res.salesman_name,
"oldClerkId": res.salesman_id, "oldClerkId": res.salesman_id,
"oldClerkPhone": res.salesman_phone, "oldClerkPhone": res.salesman_phone,
"oldFacilitatorId": res.facilitator_id, "oldFacilitatorId": res.facilitator_id,
"oldFacilitatorName": res.facilitator_name, "oldFacilitatorName": res.facilitator_name,
"newOpcode": pobj.salesmanOpcode, "newOpcode": pobj.salesmanOpcode,
"newClerkName": pobj.salesmanName, "newClerkName": pobj.salesmanName,
"newClerkId": pobj.salesmanId, "newClerkId": pobj.salesmanId,
"newClerkPhone": pobj.salesmanPhone, "newClerkPhone": pobj.salesmanPhone,
"newFacilitatorId": pobj.facilitatorId, "newFacilitatorId": pobj.facilitatorId,
"newFacilitatorName": pobj.facilitatorName "newFacilitatorName": pobj.facilitatorName
}
} }
await this.shisService.insertInfo(sInfo); //之前业务员转历史
await this.service.updateSalesmanInfoByDemandCode(pobj); //更新业务员信息
return system.getResult("操作成功!");
} else {
return system.getResultError("未找到相关数据");
} }
await this.shisService.insertInfo(sInfo); //之前业务员转历史
} catch (error) { await this.service.updateSalesmanInfoByDemandCode(pobj); //更新业务员信息
return system.getResultError(error); return system.getResult("操作成功!");
} else {
return system.getResultError("未找到相关数据");
} }
} else {
return system.getResultError("参数错误!"); } catch (error) {
return system.getResultError(error);
} }
} else {
return system.getResultError("参数错误!");
} }
/*根据商机编号更新商机状态*/ }
/*根据商机编号更新商机状态*/
async updateStatusByDemandCode(mobj, qobj, req) { async updateStatusByDemandCode(mobj, qobj, req) {
var pobj = mobj.d; var pobj = mobj.d;
if (pobj.businessMode && pobj.businessMode != 'undefined' && pobj.currentStatus && pobj.currentStatus != 'undefined') { if (pobj.businessMode && pobj.businessMode != 'undefined' && pobj.currentStatus && pobj.currentStatus != 'undefined') {
...@@ -344,16 +344,16 @@ class BizOptCtl extends CtlBase { ...@@ -344,16 +344,16 @@ class BizOptCtl extends CtlBase {
var pobj = nobj.actionBody.messageBody; var pobj = nobj.actionBody.messageBody;
if (pobj.intentionBizId && pobj.intentionBizId != 'undefined') { if (pobj.intentionBizId && pobj.intentionBizId != 'undefined') {
try { try {
var  cachestr  =  sha235(JSON.stringify(nobj));       var cachestr = sha235(JSON.stringify(nobj));
var  cacheInfo  =  await  this.cacheManager["TxCache"].getCache(cachestr);  var cacheInfo = await this.cacheManager["TxCache"].getCache(cachestr);
if  (cacheInfo  &&  cacheInfo  !=  'undefined')  {         if (cacheInfo && cacheInfo != 'undefined') {
return  {           return {
"status":  1, "status": 1,
  //1代表成功,否则失败 //1代表成功,否则失败
"msg": "已处理成功!", "msg": "已处理成功!",
"data": cachestr , "data": cachestr,
"requestId": nobj.requestId "requestId": nobj.requestId
}       }
} else { } else {
pobj.businessStatus = 'received'; pobj.businessStatus = 'received';
pobj.sourceNumber = 'tx'; pobj.sourceNumber = 'tx';
...@@ -395,12 +395,40 @@ class BizOptCtl extends CtlBase { ...@@ -395,12 +395,40 @@ class BizOptCtl extends CtlBase {
} }
} }
timeFormat(date) { /*根据需求编号更新需求状态*/
let localTime = moment.utc(date).toDate(); async updatepayStatusByDemandCode(mobj, qobj, req) {
localTime = moment(localTime).format("YYYY-MM-DD"); var pobj = mobj.actionBody;
return localTime; if (pobj.solutionBizId && pobj.solutionBizId != 'undefined') {
try {
pobj.demand_code = pobj.solutionBizId;
if (pobj.operateType == 'PAID') {
pobj.business_status = 'isFinished';
}
var res = await this.service.findInfoByDemandCode(pobj);
if (res) {
Object.assign(res.business_info, { "payStatus": "已支付" })
await res.update({ business_info: res.business_info })
await this.service.updateStatusByDemandCode(pobj);
return system.getResult("操作成功!");
} else {
return system.getResultError("更新需求状态出错");
}
} catch (error) {
return system.getResultError(error);
}
} else {
return system.getResultError("参数错误!");
} }
//根据bizId查询商机表中的所有信息 }
timeFormat(date) {
let localTime = moment.utc(date).toDate();
localTime = moment(localTime).format("YYYY-MM-DD");
return localTime;
}
//根据bizId查询商机表中的所有信息
async getInfo(pobj, qobj, req) { async getInfo(pobj, qobj, req) {
try { try {
if (!pobj.bizId) { if (!pobj.bizId) {
......
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