|
@@ -259,7 +259,7 @@ module.exports = app => {
|
|
|
const users = await this.ctx.service.projectAccount.getAllDataByCondition({ where: { project_id: subProject.project_id, company: data.management }});
|
|
|
const orgMember = await this.ctx.service.subProjPermission.getAllDataByCondition({ where: { spid: subProject.id } });
|
|
|
const dm = [], um = [], im = [];
|
|
|
- const filing_type = this.ctx.service.filing.allFilingType, file_permission = '1,2';
|
|
|
+ const filing_type = this.ctx.service.filing.allFilingType.join(','), file_permission = '1,2';
|
|
|
for (const u of users) {
|
|
|
const nm = orgMember.find(x => { return u.id === x.uid; });
|
|
|
if (nm) {
|
|
@@ -273,7 +273,10 @@ module.exports = app => {
|
|
|
await conn.update(this.tableName, { id: subProject.id, management: data.management });
|
|
|
await this.ctx.service.filing.initFiling(subProject.id, conn);
|
|
|
if (dm.length > 0) await conn.delete(this.ctx.service.subProjPermission.tableName, { id: dm });
|
|
|
+ console.log(um);
|
|
|
+ console.log(1);
|
|
|
if (um.length > 0) await conn.updateRows(this.ctx.service.subProjPermission.tableName, um);
|
|
|
+ console.log(2);
|
|
|
if (im.length > 0) await conn.insert(this.ctx.service.subProjPermission.tableName, im);
|
|
|
|
|
|
await conn.commit();
|