Commit 26939bc6 by 庄冰

abolishIcpProgrammeByNeed

parent 9632428e
......@@ -73,7 +73,7 @@ class QcAPI extends APIBase {
case "closeOrderDelivery"://交付商关闭交付单
opResult = await this.aliyunqcSve.closeOrderDelivery(pobj);
break;
case "abolishIcpProgrammeByNeed"://前端关闭ICP需求
case "abolishIcpProgrammeByNeed"://前端关闭ICP需求及方案
opResult = await this.aliyunqcSve.abolishIcpProgrammeByNeed(pobj);
break;
default:
......
......@@ -48,15 +48,14 @@ class AliyunQcService{
return system.getResultFail(-202, "该方案需求状态为" + needinfo.statusName + ",不能执行此操作");
}
//获取方案信息
var ns = await this.needsolutionDao.model.findAll({
var ns = await this.needsolutionDao.model.findOne({
where: { needNo: needinfo.needNo,isInvalid:0 }, raw: true
});
for (var i = 0; i < ns.length; i++) {
var fa = ns[i];
if (fa.status == "ywc") {
if(ns && ns.id){
if (ns.status == "ywc") {
return system.getResultFail(-103, "方案状态错误,不能废弃已完成方案");
}
var flowStatus = fa.solutionContent && fa.solutionContent.status?fa.solutionContent.status:"";
var flowStatus = ns.solutionContent && ns.solutionContent.status?ns.solutionContent.status:"";
if(flowStatus && [ "GXB_REFUSE","CLOSE"].indexOf(flowStatus)<0){
return system.getResultFail(-104, "⽅案状态为关闭或不予受理才可关闭需求");
}
......@@ -68,7 +67,7 @@ class AliyunQcService{
};
await self.needinfoDao.update(needObj,t);//关闭需求
await self.needsolutionDao.model.update({ status: "yzf",isInvalid:1 }, { where: { needNo: needinfo.needNo,isInvalid:0 }, transaction: t });//方案废弃
return system.getResultSuccess();
return system.getResultSuccess(ns.orderNo);
})
}
......
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