Merge branch 'develop' into working
This commit is contained in:
commit
9370c9e72b
2 changed files with 27 additions and 4 deletions
|
|
@ -307,13 +307,25 @@ export class WorkflowController extends Controller {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
order: { order: "ASC", stateUserComments: { order: "ASC" } },
|
order: { order: "ASC", stateUserComments: { order: "ASC" } },
|
||||||
relations: ["stateUserComments"],
|
relations: ["stateUserComments", "stateUserComments.profile"],
|
||||||
});
|
});
|
||||||
const _state = state.map((x) => ({
|
const _state = state.map((x) => ({
|
||||||
stateId: x.id,
|
stateId: x.id,
|
||||||
stateNo: x.order,
|
stateNo: x.order,
|
||||||
stateName: x.name,
|
stateName: x.name,
|
||||||
stateUserComments: x.stateUserComments,
|
stateUserComments: x.stateUserComments.map((x) => ({
|
||||||
|
id: x.id,
|
||||||
|
prefix: x.profile.prefix,
|
||||||
|
firstName: x.profile.firstName,
|
||||||
|
lastName: x.profile.lastName,
|
||||||
|
profileId: x.profileId,
|
||||||
|
isAcceptSetting: x.isAcceptSetting,
|
||||||
|
isApproveSetting: x.isApproveSetting,
|
||||||
|
isReasonSetting: x.isReasonSetting,
|
||||||
|
isAccept: x.isAccept,
|
||||||
|
isApprove: x.isApprove,
|
||||||
|
reason: x.reason,
|
||||||
|
})),
|
||||||
}));
|
}));
|
||||||
return new HttpSuccess(_state);
|
return new HttpSuccess(_state);
|
||||||
}
|
}
|
||||||
|
|
@ -327,6 +339,17 @@ export class WorkflowController extends Controller {
|
||||||
system: string;
|
system: string;
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
|
const stateOperatorUserNow = await this.stateOperatorUserRepo.findOne({
|
||||||
|
where: {
|
||||||
|
workflow: {
|
||||||
|
refId: body.refId,
|
||||||
|
sysName: body.system,
|
||||||
|
},
|
||||||
|
profile: {
|
||||||
|
keycloak: req.user.sub,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
const stateOperatorUser = await this.stateOperatorUserRepo.find({
|
const stateOperatorUser = await this.stateOperatorUserRepo.find({
|
||||||
where: {
|
where: {
|
||||||
workflow: {
|
workflow: {
|
||||||
|
|
@ -336,6 +359,7 @@ export class WorkflowController extends Controller {
|
||||||
profile: {
|
profile: {
|
||||||
keycloak: Not(req.user.sub),
|
keycloak: Not(req.user.sub),
|
||||||
},
|
},
|
||||||
|
operator: stateOperatorUserNow?.operator || "",
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
await this.stateOperatorUserRepo.remove(stateOperatorUser);
|
await this.stateOperatorUserRepo.remove(stateOperatorUser);
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
import { Entity, Column, ManyToOne, JoinColumn, OneToMany } from "typeorm";
|
import { Entity, Column, ManyToOne, JoinColumn } from "typeorm";
|
||||||
import { EntityBase } from "./base/Base";
|
import { EntityBase } from "./base/Base";
|
||||||
import { StateOperator } from "./StateOperator";
|
|
||||||
import { Workflow } from "./Workflow";
|
import { Workflow } from "./Workflow";
|
||||||
import { Profile } from "./Profile";
|
import { Profile } from "./Profile";
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue