แก้ create เป็น update เมนูทะเบียนประวัติ

This commit is contained in:
AdisakKanthawilang 2024-08-27 12:11:31 +07:00
parent fde5f8d90a
commit f281ea0bc2
61 changed files with 193 additions and 147 deletions

View file

@ -2285,7 +2285,7 @@ export class ProfileController extends Controller {
) {
const _record = await this.profileRepo.findOneBy({ id: id });
if (_record) {
await new permission().PermissionOrgUserUpdate(request, "SYS_REGISTRY_OFFICER", id);//ตส
await new permission().PermissionOrgUserUpdate(request, "SYS_REGISTRY_OFFICER", _record.id); //ไม่แน่ใจOFF
}
const exists =
!!body.citizenId &&
@ -3159,10 +3159,7 @@ export class ProfileController extends Controller {
*
*/
@Get("profileid/position/{id}")
async getProfileByProfileid(
@Request() request: RequestWithUser,
@Path() id: string,
) {
async getProfileByProfileid(@Request() request: RequestWithUser, @Path() id: string) {
await new permission().PermissionOrgUserGet(request, "SYS_REGISTRY_OFFICER", id);
const profile = await this.profileRepo.findOne({
where: { id: id },
@ -3376,10 +3373,7 @@ export class ProfileController extends Controller {
*
*/
@Get("keycloakid/position/{id}")
async getProfileByKeycloakid(
@Request() request: RequestWithUser,
@Path() id: string,
) {
async getProfileByKeycloakid(@Request() request: RequestWithUser, @Path() id: string) {
const profile = await this.profileRepo.findOne({
where: { keycloak: id },
select: ["id"],
@ -3399,10 +3393,7 @@ export class ProfileController extends Controller {
* @param id (citizenId)
*/
@Get("citizenid/position/{id}")
async getProfileByCitizenId(
@Request() request: RequestWithUser,
@Path() id: string,
) {
async getProfileByCitizenId(@Request() request: RequestWithUser, @Path() id: string) {
const profile = await this.profileRepo.findOne({
where: { citizenId: id },
relations: ["posLevel", "posType", "current_holders", "current_holders.orgRoot"],
@ -3410,7 +3401,7 @@ export class ProfileController extends Controller {
if (!profile) {
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลบุคคลนี้ในระบบ");
}
await new permission().PermissionOrgUserList(request, "SYS_REGISTRY_OFFICER", profile.id);
await new permission().PermissionOrgUserList(request, "SYS_REGISTRY_OFFICER", profile.id);
const orgRevisionPublish = await this.orgRevisionRepo
.createQueryBuilder("orgRevision")
@ -3524,10 +3515,7 @@ export class ProfileController extends Controller {
*
*/
@Get("profileempid/position/{id}")
async getProfileByProfileempid(
@Request() request: RequestWithUser,
@Path() id: string,
) {
async getProfileByProfileempid(@Request() request: RequestWithUser, @Path() id: string) {
await new permission().PermissionOrgUserList(request, "SYS_REGISTRY_OFFICER", id);
const profile = await this.profileEmpRepo.findOne({
where: { id: id },
@ -4848,8 +4836,9 @@ export class ProfileController extends Controller {
* @summary
*
*/
@Get("profileid/retire/{year}") //ตส
async getProfileByRetireYear(@Path() year: number) {
@Get("profileid/retire/{year}")
async getProfileByRetireYear(@Path() year: number, @Request() req: RequestWithUser) {
// await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_OFFICER", id);//ไม่แน่ใจOFF
const profiles = await this.profileRepo
.createQueryBuilder("profile")
.leftJoinAndSelect("profile.posLevel", "posLevel")