no message
This commit is contained in:
parent
ce5c56bfca
commit
6b5a47213c
1 changed files with 12 additions and 6 deletions
|
|
@ -263,26 +263,31 @@ export class WorkflowController extends Controller {
|
||||||
},
|
},
|
||||||
relations: ["workflow"],
|
relations: ["workflow"],
|
||||||
});
|
});
|
||||||
if (!stateOperatorUser)
|
const workflow = await this.workflowRepo.findOne({
|
||||||
throw new HttpError(HttpStatus.NOT_FOUND, "ผู้ใช้งานนี้ไม่มีหน้าที่ในกระบวนการนี้");
|
where: {
|
||||||
|
refId: body.refId,
|
||||||
|
sysName: body.system,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
if (!workflow) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่สามารถดำเนินการกระบวนการนี้ได้");
|
||||||
const operator = await this.stateOperatorRepo.findOne({
|
const operator = await this.stateOperatorRepo.findOne({
|
||||||
where: {
|
where: {
|
||||||
operator: stateOperatorUser.operator,
|
operator: stateOperatorUser?.operator || "",
|
||||||
stateId: stateOperatorUser.workflow.stateId,
|
stateId: workflow.stateId,
|
||||||
},
|
},
|
||||||
relations: ["state"],
|
relations: ["state"],
|
||||||
});
|
});
|
||||||
if (!operator) {
|
if (!operator) {
|
||||||
const state = await this.stateRepo.findOne({
|
const state = await this.stateRepo.findOne({
|
||||||
where: {
|
where: {
|
||||||
id: stateOperatorUser.workflow.stateId,
|
id: workflow.stateId,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
return new HttpSuccess({
|
return new HttpSuccess({
|
||||||
stateId: state?.id || null,
|
stateId: state?.id || null,
|
||||||
stateNo: state?.order || null,
|
stateNo: state?.order || null,
|
||||||
stateName: state?.name || null,
|
stateName: state?.name || null,
|
||||||
operator: stateOperatorUser.operator,
|
operator: stateOperatorUser?.operator || null,
|
||||||
can_view: false,
|
can_view: false,
|
||||||
can_update: false,
|
can_update: false,
|
||||||
can_operate: false,
|
can_operate: false,
|
||||||
|
|
@ -333,6 +338,7 @@ export class WorkflowController extends Controller {
|
||||||
prefix: x.profile.prefix,
|
prefix: x.profile.prefix,
|
||||||
firstName: x.profile.firstName,
|
firstName: x.profile.firstName,
|
||||||
lastName: x.profile.lastName,
|
lastName: x.profile.lastName,
|
||||||
|
isComment: x.profile.keycloak == req.user.sub ? true : false,
|
||||||
profileId: x.profileId,
|
profileId: x.profileId,
|
||||||
isAcceptSetting: x.isAcceptSetting,
|
isAcceptSetting: x.isAcceptSetting,
|
||||||
isApproveSetting: x.isApproveSetting,
|
isApproveSetting: x.isApproveSetting,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue