Commit dccf462b by 兰国旗

取消关闭需求时关闭订单,并加有订单不能关闭需求的逻辑

parent 91793771
...@@ -96,6 +96,9 @@ class AliyunQcService { ...@@ -96,6 +96,9 @@ class AliyunQcService {
where: { needNo: needinfo.needNo, isInvalid: 0 }, raw: true where: { needNo: needinfo.needNo, isInvalid: 0 }, raw: true
}); });
if (ns && ns.id) { if (ns && ns.id) {
if (ns.orderNo) {
return system.getResultFail(-102, "该需求已生成订单,不能关闭!");
}
if (ns.status == "ywc") { if (ns.status == "ywc") {
return system.getResultFail(-103, "方案状态错误,不能废弃已完成方案-3"); return system.getResultFail(-103, "方案状态错误,不能废弃已完成方案-3");
} }
......
...@@ -84,13 +84,16 @@ class BaseQcService { ...@@ -84,13 +84,16 @@ class BaseQcService {
}); });
if (ns && ns.id) { if (ns && ns.id) {
if (ns.orderNo) {
return system.getResultFail(-102, "该需求已生成订单,不能关闭!");
}
if (ns.status == "ywc") { if (ns.status == "ywc") {
return system.getResultFail(-103, "方案状态错误,不能废弃已完成方案-2"); return system.getResultFail(-103, "方案状态错误,不能废弃已完成方案-2");
} }
var flowStatus = ns.solutionContent && ns.solutionContent.status ? ns.solutionContent.status : ""; var flowStatus = ns.solutionContent && ns.solutionContent.status ? ns.solutionContent.status : "";
if (flowStatus && [ if (flowStatus && [
"SOLUTION_SUBMIT", "PAID", "USER_UPLOADED", "MATERIAL_UNCONFIRM", "USER_CONFIRMED", "GXB_REFUSE", "CLOSE" "SOLUTION_SUBMIT", "PAID", "USER_UPLOADED", "MATERIAL_UNCONFIRM", "USER_CONFIRMED", "GXB_REFUSE", "CLOSE"
].indexOf(flowStatus) >= 0) { ].indexOf(flowStatus) >= 0) {
var self = this; var self = this;
return await this.needsolutionDao.db.transaction(async function (t) { return await this.needsolutionDao.db.transaction(async function (t) {
var needObj = { var needObj = {
......
...@@ -575,6 +575,9 @@ class NcService { ...@@ -575,6 +575,9 @@ class NcService {
}); });
// var newFlowStatus = []; // var newFlowStatus = [];
if (ns && ns.id) { if (ns && ns.id) {
if (ns.orderNo) {
return system.getResultFail(-102, "该需求已生成订单,不能关闭!");
}
if (ns.status == "ywc") { if (ns.status == "ywc") {
return system.getResultFail(-103, "方案状态错误,不能废弃已完成方案-4"); return system.getResultFail(-103, "方案状态错误,不能废弃已完成方案-4");
} }
......
...@@ -963,6 +963,9 @@ class RegCenterOrderService{ ...@@ -963,6 +963,9 @@ class RegCenterOrderService{
var nsLength = ns.rows.length var nsLength = ns.rows.length
if (nsLength > 0) { if (nsLength > 0) {
for (i = 0; i < nsLength; i++) { for (i = 0; i < nsLength; i++) {
if (ns.rows[i].orderNo) {
return system.getResultFail(-102, "该需求已生成订单,不能关闭!");
}
if (ns.rows[i].id) { if (ns.rows[i].id) {
ns.rows[i]['uapp_id'] = uappId; ns.rows[i]['uapp_id'] = uappId;
if (ns.rows[i].status == "ywc") { if (ns.rows[i].status == "ywc") {
...@@ -983,7 +986,6 @@ class RegCenterOrderService{ ...@@ -983,7 +986,6 @@ class RegCenterOrderService{
status: "ygb", notes: ab.note status: "ygb", notes: ab.note
}; };
await self.needinfoDao.updateByWhere(needObj, { where :{id: needinfo.id }, t });//关闭需求 await self.needinfoDao.updateByWhere(needObj, { where :{id: needinfo.id }, t });//关闭需求
// await self.needsolutionDao.update({ status: "yzf", isInvalid: 1 }, { where: { id: ns.rows[i].id }, transaction: t });//方案废弃
var a= await self.needsolutionDao.updateByWhere(updateSolution, { where: { id: ns.rows[i].id }, t });//方案废弃 var a= await self.needsolutionDao.updateByWhere(updateSolution, { where: { id: ns.rows[i].id }, t });//方案废弃
console.log("aaaa---",a) console.log("aaaa---",a)
}) })
......
...@@ -574,6 +574,9 @@ class RtService { ...@@ -574,6 +574,9 @@ class RtService {
where: { needNo: needinfo.needNo, isInvalid: 0 }, raw: true where: { needNo: needinfo.needNo, isInvalid: 0 }, raw: true
}); });
if (ns && ns.id) { if (ns && ns.id) {
if (ns.orderNo) {
return system.getResultFail(-102, "该需求已生成订单,不能关闭!");
}
if (ns.status == "ywc") { if (ns.status == "ywc") {
return system.getResultFail(-103, "方案状态错误,不能废弃已完成方案"); return system.getResultFail(-103, "方案状态错误,不能废弃已完成方案");
} }
......
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