Browse Source

更新选择接谈室连点导致排号单多个问题

xubin.jiang 9 months ago
parent
commit
a7ae1fc668
2 changed files with 10 additions and 3 deletions
  1. 4 2
      src/controller/taskFlow.js
  2. 6 1
      src/handle/util.js

+ 4 - 2
src/controller/taskFlow.js

@@ -582,8 +582,10 @@ module.exports = class extends Base {
           (data.businessID === 36 && data.handleModel === '省直机关接谈')) {
           // 当这两种情况下,去生成接谈室排队号
           // 接谈单位id为 data.deptID_pre
-          let roomCodeNum = await util.getRoomCodeNum(data.deptID_pre);// 生成接谈室排号(接谈单位id
-          await util.saveQueue(roomCodeNum,data.taskId,data.deptID_pre);// 保存接谈排号单(接谈室排号,taskId,接谈单位id
+          // let roomCodeNum = await util.getRoomCodeNum(data.deptID_pre);// 生成接谈室排号(接谈单位id
+          // await util.saveQueue(roomCodeNum,data.taskId,data.deptID_pre);// 保存接谈排号单(接谈室排号,taskId,接谈单位id
+          // 24-1-24修改生成排号与保存排号单一起进行
+          await util.saveQueue(data.taskId,data.deptID_pre)
         }
       };
       if (data.businessID === 1 && typeof data.queueId !== 'undefined' && data.queueId !== null) {

+ 6 - 1
src/handle/util.js

@@ -632,12 +632,17 @@ async function getRoomCodeNum(orgID){
   }
 }
 // 保存接谈排号单
-async function saveQueue(roomCodeNum,taskId,orgID){
+// async function saveQueue(roomCodeNum,taskId,orgID){
+async function saveQueue(taskId,orgID){
   let matter = await think.model('matter').where({'taskid':taskId}).find();
+  let queue = await think.model('queue').where({'matterID':matter.id}).find();
   let room = await think.model('meeting_room').where({'roomOrgID':orgID}).find();
   if (think.isEmpty(matter) || think.isEmpty(room)){
     return false
+  } else if (queue.roomOrgID === orgID) {// 这个事项已经安排过这个接谈室,不再进行排号
+    return false
   } else {
+    let roomCodeNum = await getRoomCodeNum(orgID);
     let contentClassifyAll = ""; // 问题分类全称
     let cc = matter.contentClassifyID.split(',');// 问题分类
     let ccaID = matter.contentClassifyID;