Commit b516ab41 by linboxuan

Merge branch 'center-order' of http://gitlab.gongsibao.com/jiangyong/zhichan into center-order

parents f90a4562 6c85104a
......@@ -63,6 +63,17 @@ class QcAPI extends APIBase {
case "getProgrammeInfoByChannelNeedNo"://获取需求方案列表
opResult = await this.aliyunqcSve.getProgrammeInfoByChannelNeedNo(pobj);
break;
case "serviceProviderSubmitMaterial"://交付商提交材料信息
opResult = await this.aliyunqcSve.serviceProviderSubmitMaterial(pobj);
break;
case "serviceProviderNotification"://交付商通知状态变更
opResult = await this.aliyunqcSve.serviceProviderNotification(pobj);
break;
case "closeOrderDelivery"://交付商关闭交付单
opResult = await this.aliyunqcSve.closeOrderDelivery(pobj);
break;
default:
opResult = system.getResult(null, "action_type参数错误");
break;
......
......@@ -73,7 +73,7 @@ module.exports = {
"push_chance_type": { "wts": "未推送", "yts": "已推送", "ygj": "已跟进", "ycd": "已成单", "ygb": "已关闭" },
"policy_type": { 'fzbt': '租金减免', 'jrdk': '金融贷款', 'zdfc': '行政措施', 'ssjm': '税收优惠', 'rlzy': '人力资源' },
"customer_intention": { "dgj": "待跟进", "yyx": "有意向", "wyx": "无意向" },
"solution_status": { "dqr": "待确认", "ywc": "已完成", "yzf": "已作废" },
"solution_status": { "dqr": "待确认","ybh":"用户驳回", "ywc": "已完成", "yzf": "已作废" },
},
}
......
......@@ -206,6 +206,27 @@ class AliyunQcService{
})
}
//交付商关闭交付单
async closeOrderDelivery(pobj){
var ab = pobj.actionBody;
if (!ab.orderNo) {
return system.getResultFail(-101, "订单号不能为空");
}
if (!ab.note) {
return system.getResultFail(-106, "关闭理由不能为空");
}else{
ab.Note = ab.note;
}
var ns = await this.needsolutionDao.model.findOne({
where:{orderNo:ab.orderNo},raw:true
});
if (!ns || !ns.id) {
return system.getResultFail(-301, "未知方案");
}
ab["BizId"] = ns.channelSolutionNo;
pobj.actionBody = ab;
return this.abolishIcpProgramme(pobj);
}
//服务商方案作废 -- abolishIcpProgramme
async abolishIcpProgramme(pobj) {
var ab = pobj.actionBody;
......@@ -251,6 +272,22 @@ class AliyunQcService{
});
return system.getResultSuccess(ns);
}
//交付商提交材料信息
async serviceProviderSubmitMaterial(pobj){
var ab = pobj.actionBody;
if (!ab.orderNo) {
return system.getResultFail(-101, "订单号不能为空");
}
var ns = await this.needsolutionDao.model.findOne({
where:{orderNo:ab.orderNo},raw:true
});
if (!ns || !ns.id) {
return system.getResultFail(-301, "未知方案");
}
ab["BizId"] = ns.channelSolutionNo;
pobj.actionBody = ab;
return this.submitIcpMaterial(pobj);
}
//提交icp材料信息
async submitIcpMaterial(pobj) {
var ab = pobj.actionBody;
......@@ -327,6 +364,27 @@ class AliyunQcService{
})
}
//交付商通知状态变更
async serviceProviderNotification(pobj){
var ab = pobj.actionBody;
if (!ab.orderNo) {
return system.getResultFail(-101, "订单号不能为空");
}
if (!ab.status) {
return system.getResultFail(-102, "交付状态不能为空");
}else{
ab["ApplicationStatus"] = ab.status;
}
var ns = await this.needsolutionDao.model.findOne({
where:{orderNo:ab.orderNo},raw:true
});
if (!ns || !ns.id) {
return system.getResultFail(-301, "未知方案");
}
ab["BizId"] = ns.channelSolutionNo;
pobj.actionBody = ab;
return this.acceptIcpPartnerNotification(pobj);
}
//服务商通知状态变更
async acceptIcpPartnerNotification(pobj) {
var ab = pobj.actionBody;
......@@ -336,7 +394,7 @@ class AliyunQcService{
}
ab["createUserId"] = user.id;
if (!ab.BizId) {
return system.getResultFail(-101, "方案编号不能为空");
return system.getResultFail(-101, "渠道方案编号不能为空");
}
if (!ab.ApplicationStatus) {
return system.getResultFail(-102, "通知状态不能为空");
......@@ -415,7 +473,6 @@ class AliyunQcService{
status: "GXB_SUCCESS", statusName: this.icpSolutionStatusReference.GXB_SUCCESS, updated_at: new Date()
});
needsolutioninfo.status = "ywc";
needsolutioninfo.status = "ywc";
solutionContent.status = "GXB_SUCCESS";
solutionContent.statusName = this.icpSolutionStatusReference.GXB_SUCCESS;
}
......@@ -466,7 +523,7 @@ class AliyunQcService{
if (needinfo.status == "ycd" || needinfo.status == "ygb") {
return system.getResultFail(-105, "该方案需求状态为" + needinfo.statusName + ",不能执行此操作");
}
if (ns.status != "dqr" && ns.status != "yzf") {
if (ns.status != "dqr" && ns.status != "yzf" && ns.status != "ybh") {
return system.getResultFail(-103, "方案状态错误,不能作废已完成方案");
}
var solutionContent = ns.solutionContent;
......@@ -531,9 +588,6 @@ class AliyunQcService{
if (ab.status == "11") {//⽅案已关闭
updateObj["status"] = "yzf";
}
// else if(ab.status == "2" || ab.status == "4"){ //2, "⽤户已上传" 4, "⽤户已确认"
// updateObj["status"]="dqr";
// }
await this.needsolutionDao.update(updateObj);//方案状态修改
ns = await this.needsolutionDao.model.findOne({
where: { channelSolutionNo: ab.BizId }, raw: true
......@@ -576,9 +630,11 @@ class AliyunQcService{
var solutionContent = ns.solutionContent;
solutionContent.customerRemark = ab.description;
solutionContent.needStatus = ab.intentionStatus;
if (ab.intentionStatus == 1 || ab.intentionStatus == 2 || ab.intentionStatus == 3) {
if(ab.intentionStatus == 1){
updateObj["status"] = "ybh";
}else if (ab.intentionStatus == 2) {
updateObj["status"] = "dqr";
} else if (ab.intentionStatus == 4) {
} else if (ab.intentionStatus == 4 || ab.intentionStatus == 3) {
updateObj["status"] = "ywc";
} else if (ab.intentionStatus == 5) {
updateObj["status"] = "yzf";
......
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