|
|
@ -57,7 +57,7 @@ async function pomsProject (ctx) { |
|
|
|
if (p.pepProjectId) { |
|
|
|
pepProjectIds.add(p.pepProjectId) |
|
|
|
} |
|
|
|
if(p.createUser){ |
|
|
|
if (p.createUser) { |
|
|
|
createUsers.add(p.createUser) |
|
|
|
} |
|
|
|
for (let ap of p.anxinProjectId) { |
|
|
@ -66,18 +66,18 @@ async function pomsProject (ctx) { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
const pomsUser = await models.User.findAll({ |
|
|
|
where: { |
|
|
|
id: { $in: [...createUsers]} |
|
|
|
} |
|
|
|
}) |
|
|
|
let pepUserIds = new Set() |
|
|
|
for (let p of pomsUser) { |
|
|
|
if (p.pepUserId) { |
|
|
|
const pomsUser = await models.User.findAll({ |
|
|
|
where: { |
|
|
|
id: { $in: [...createUsers] } |
|
|
|
} |
|
|
|
}) |
|
|
|
let pepUserIds = new Set() |
|
|
|
for (let p of pomsUser) { |
|
|
|
if (p.pepUserId) { |
|
|
|
pepUserIds.add(p.pepUserId) |
|
|
|
} |
|
|
|
} |
|
|
|
const pepcaUser = pepUserIds.size ? |
|
|
|
} |
|
|
|
} |
|
|
|
const pepcaUser = pepUserIds.size ? |
|
|
|
await clickHouse.pepEmis.query( |
|
|
|
` |
|
|
|
SELECT * FROM user |
|
|
@ -112,7 +112,7 @@ async function pomsProject (ctx) { |
|
|
|
|
|
|
|
for (let p of proRes.rows) { |
|
|
|
const corPro = pepProjectRes.find(pp => pp.id == p.pepProjectId) || {} |
|
|
|
const pepUserName = (pepcaUser.find(qq => qq.id == (pomsUser.find(oo => oo.id == p.createUser)||{}).pepUserId)||{}).name ||'' |
|
|
|
const pepUserName = (pepcaUser.find(qq => qq.id == (pomsUser.find(oo => oo.id == p.createUser) || {}).pepUserId) || {}).name || '' |
|
|
|
p.dataValues.pepProjectName = corPro.project_name |
|
|
|
p.dataValues.pepProjectIsDelete = corPro.isdelete |
|
|
|
p.dataValues.constructionStatusId = corPro.construction_status_id |
|
|
@ -210,15 +210,23 @@ async function strucWithPomsProject (ctx) { |
|
|
|
const { clickHouse } = ctx.app.fs |
|
|
|
const { pomsProjectId } = ctx.query |
|
|
|
|
|
|
|
const bindRes = await models.ProjectCorrelation.findOne({ |
|
|
|
const bindRes = await models.ProjectCorrelation.findAll({ |
|
|
|
where: { |
|
|
|
id: pomsProjectId |
|
|
|
id: { $in: pomsProjectId.split(',') } |
|
|
|
} |
|
|
|
}) |
|
|
|
let anxinProjectIds = new Set() |
|
|
|
for (let b of bindRes) { |
|
|
|
if (b.anxinProjectId.length) { |
|
|
|
for (let aid of b.anxinProjectId) { |
|
|
|
anxinProjectIds.add(aid) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
let undelStruc = [] |
|
|
|
if (bindRes) { |
|
|
|
const undelStrucRes = bindRes.anxinProjectId.length ? |
|
|
|
const undelStrucRes = anxinProjectIds.size ? |
|
|
|
await clickHouse.anxinyun.query( |
|
|
|
`
|
|
|
|
SELECT |
|
|
@ -249,7 +257,7 @@ async function strucWithPomsProject (ctx) { |
|
|
|
WHERE |
|
|
|
project_state != -1 |
|
|
|
AND |
|
|
|
t_project.id IN (${bindRes.anxinProjectId.join(',')}) |
|
|
|
t_project.id IN (${[...anxinProjectIds].join(',')}, -1) |
|
|
|
ORDER BY strucId |
|
|
|
` |
|
|
|
).toPromise() : |
|
|
|