2024-02-22 10:43:39 +07:00
|
|
|
package repository
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
2024-02-23 14:10:40 +07:00
|
|
|
"strconv"
|
2024-02-22 10:43:39 +07:00
|
|
|
"strings"
|
|
|
|
"time"
|
|
|
|
|
|
|
|
"git.nochill.in/nochill/excel_import_playground/model"
|
|
|
|
"git.nochill.in/nochill/excel_import_playground/util"
|
|
|
|
"github.com/henvic/pgq"
|
|
|
|
"github.com/jackc/pgx/v5"
|
|
|
|
"github.com/jackc/pgx/v5/pgtype"
|
|
|
|
)
|
|
|
|
|
|
|
|
func (q *Queries) FindLastPatientInCertainFasyankes(ctx context.Context, fasyankes_id int32) (model.Patient, error) {
|
|
|
|
findLastPasienQuery := `
|
|
|
|
SELECT * FROM "Pasien" p
|
|
|
|
WHERE fasyankes_id = $1
|
|
|
|
ORDER BY p.id DESC
|
|
|
|
LIMIT(1)
|
|
|
|
`
|
|
|
|
row, _ := q.db.Query(ctx, findLastPasienQuery, fasyankes_id)
|
2024-02-23 14:10:40 +07:00
|
|
|
result, err := pgx.CollectOneRow[model.Patient](row, pgx.RowToStructByName[model.Patient])
|
2024-02-22 10:43:39 +07:00
|
|
|
return result, err
|
|
|
|
}
|
|
|
|
|
|
|
|
func (q *Queries) FindPatientByBPJSCode(ctx context.Context, BPJSCode string) (model.Patient, error) {
|
|
|
|
findPatientByBPJSCode := `
|
|
|
|
SELECT * FROM "Pasien" p
|
|
|
|
WHERE no_kartu_peserta_bpjs = $1
|
|
|
|
`
|
|
|
|
|
|
|
|
row, _ := q.db.Query(ctx, findPatientByBPJSCode, BPJSCode)
|
|
|
|
result, err := pgx.CollectExactlyOneRow[model.Patient](row, pgx.RowToStructByName[model.Patient])
|
|
|
|
|
|
|
|
return result, err
|
|
|
|
}
|
|
|
|
|
|
|
|
func (q *Queries) FindPatientByNoRm(ctx context.Context, noRm string) (model.Patient, error) {
|
|
|
|
findPasienByNoRmQuery := `
|
|
|
|
SELECT * FROM "Pasien" p
|
|
|
|
WHERE no_rm = $1
|
|
|
|
`
|
|
|
|
row, _ := q.db.Query(ctx, findPasienByNoRmQuery, noRm)
|
|
|
|
result, err := pgx.CollectExactlyOneRow[model.Patient](row, pgx.RowToStructByName[model.Patient])
|
|
|
|
return result, err
|
|
|
|
}
|
|
|
|
|
|
|
|
func (q *Queries) FindPatientByNik(ctx context.Context, nik string) (model.Patient, error) {
|
|
|
|
findPasienByNikQuery := `
|
|
|
|
SELECT * FROM "Pasien" p
|
|
|
|
WHERE nik = $1
|
|
|
|
`
|
|
|
|
row, _ := q.db.Query(ctx, findPasienByNikQuery, nik)
|
|
|
|
result, err := pgx.CollectExactlyOneRow[model.Patient](row, pgx.RowToStructByName[model.Patient])
|
|
|
|
return result, err
|
|
|
|
}
|
|
|
|
|
|
|
|
type UpdatePatientParams struct {
|
|
|
|
NoRm UpdateableField[string] `json:"no_rm" db:"no_rm"`
|
|
|
|
NamaPasien UpdateableField[string] `json:"nama_pasien" db:"nama_pasien"`
|
|
|
|
JenisIdentitas UpdateableField[pgtype.Int4] `json:"jenis_identitas" db:"jenis_identitas"`
|
|
|
|
NoIdentitas UpdateableField[pgtype.Text] `json:"no_identitas" db:"no_identitas"`
|
|
|
|
FotoProfil UpdateableField[pgtype.Text] `json:"foto_profil" db:"foto_profil"`
|
|
|
|
FotoKtp UpdateableField[pgtype.Text] `json:"foto_ktp" db:"foto_ktp"`
|
|
|
|
KotaLahir UpdateableField[pgtype.Int4] `json:"kota_lahir" db:"kota_lahir"`
|
|
|
|
TanggalLahir UpdateableField[time.Time] `json:"tanggal_lahir" db:"tanggal_lahir"`
|
|
|
|
JenisKelamin UpdateableField[pgtype.Int4] `json:"jenis_kelamin" db:"jenis_kelamin"`
|
|
|
|
Suku UpdateableField[pgtype.Int4] `json:"suku" db:"suku"`
|
|
|
|
Agama UpdateableField[pgtype.Int4] `json:"agama" db:"agama"`
|
|
|
|
Kebangsaan UpdateableField[pgtype.Int4] `json:"kebangsaan" db:"kebangsaan"`
|
|
|
|
Bahasa UpdateableField[pgtype.Int4] `json:"bahasa" db:"bahasa"`
|
|
|
|
Pendidikan UpdateableField[pgtype.Int4] `json:"pendidikan" db:"pendidikan"`
|
|
|
|
StatusPerkawinan UpdateableField[pgtype.Int4] `json:"status_perkawinan" db:"status_perkawinan"`
|
|
|
|
Email UpdateableField[pgtype.Text] `json:"email" db:"email"`
|
|
|
|
Pekerjaan UpdateableField[pgtype.Int4] `json:"pekerjaan" db:"pekerjaan"`
|
|
|
|
NoHp UpdateableField[pgtype.Text] `json:"no_hp" db:"no_hp"`
|
|
|
|
IsDeleted UpdateableField[bool] `json:"is_deleted" db:"is_deleted"`
|
|
|
|
FasyankesID UpdateableField[int] `json:"fasyankes_id" db:"fasyankes_id"`
|
|
|
|
Nik UpdateableField[pgtype.Text] `json:"nik" db:"nik"`
|
|
|
|
NoKk UpdateableField[pgtype.Text] `json:"no_kk" db:"no_kk"`
|
|
|
|
NoKartuPesertaBPJS UpdateableField[pgtype.Text] `json:"no_kartu_peserta_bpjs" db:"no_kartu_peserta_bpjs"`
|
|
|
|
UpdateBy int `json:"update_by" db:"update_by"`
|
|
|
|
}
|
|
|
|
|
|
|
|
func (q *Queries) UpdatePatient(ctx context.Context, arg UpdatePatientParams, patientId int32) (model.Patient, error) {
|
|
|
|
builder := pgq.Update("\"Pasien\"").Set("update_by", arg.UpdateBy).Set("updated_at", time.Now().UTC())
|
|
|
|
|
|
|
|
if arg.NoRm.IsFilled {
|
|
|
|
builder.Set("no_rm", arg.NoRm.Value)
|
|
|
|
}
|
|
|
|
if arg.NamaPasien.IsFilled {
|
|
|
|
builder = builder.Set("nama_pasien", arg.NamaPasien.Value)
|
|
|
|
}
|
|
|
|
if arg.JenisIdentitas.IsFilled {
|
|
|
|
builder = builder.Set("jenis_identitas", arg.JenisIdentitas.Value)
|
|
|
|
}
|
|
|
|
if arg.NoIdentitas.IsFilled {
|
|
|
|
builder = builder.Set("no_identitas", arg.NoIdentitas.Value)
|
|
|
|
}
|
|
|
|
if arg.FotoProfil.IsFilled {
|
|
|
|
builder = builder.Set("foto_profil", arg.FotoProfil.Value)
|
|
|
|
}
|
|
|
|
if arg.FotoKtp.IsFilled {
|
|
|
|
builder = builder.Set("foto_ktp", arg.FotoKtp.Value)
|
|
|
|
}
|
|
|
|
if arg.KotaLahir.IsFilled {
|
|
|
|
builder = builder.Set("kota_lahir", arg.KotaLahir.Value)
|
|
|
|
}
|
|
|
|
if arg.TanggalLahir.IsFilled {
|
|
|
|
builder = builder.Set("tanggal_lahir", arg.TanggalLahir.Value)
|
|
|
|
}
|
|
|
|
if arg.JenisKelamin.IsFilled {
|
|
|
|
builder = builder.Set("jenis_kelamin", arg.JenisKelamin.Value)
|
|
|
|
}
|
|
|
|
if arg.Suku.IsFilled {
|
|
|
|
builder = builder.Set("suku", arg.Suku.Value)
|
|
|
|
}
|
|
|
|
if arg.Agama.IsFilled {
|
|
|
|
builder = builder.Set("agama", arg.Agama.Value)
|
|
|
|
}
|
|
|
|
if arg.Kebangsaan.IsFilled {
|
|
|
|
builder = builder.Set("kebangsaan", arg.Kebangsaan.Value)
|
|
|
|
}
|
|
|
|
if arg.Bahasa.IsFilled {
|
|
|
|
builder = builder.Set("bahasa", arg.Bahasa.Value)
|
|
|
|
}
|
|
|
|
if arg.Pendidikan.IsFilled {
|
|
|
|
builder = builder.Set("pendidikan", arg.Pendidikan.Value)
|
|
|
|
}
|
|
|
|
if arg.StatusPerkawinan.IsFilled {
|
|
|
|
builder = builder.Set("status_perkawinan", arg.StatusPerkawinan.Value)
|
|
|
|
}
|
|
|
|
if arg.Email.IsFilled {
|
|
|
|
builder = builder.Set("email", arg.Email.Value)
|
|
|
|
}
|
|
|
|
if arg.Pekerjaan.IsFilled {
|
|
|
|
builder = builder.Set("pekerjaan", arg.Pekerjaan.Value)
|
|
|
|
}
|
|
|
|
if arg.NoHp.IsFilled {
|
|
|
|
builder = builder.Set("no_hp", arg.NoHp.Value)
|
|
|
|
}
|
|
|
|
if arg.IsDeleted.IsFilled {
|
|
|
|
builder = builder.Set("is_deleted", arg.IsDeleted.Value)
|
|
|
|
}
|
|
|
|
if arg.FasyankesID.IsFilled {
|
|
|
|
builder = builder.Set("fasyankes_id", arg.FasyankesID.Value)
|
|
|
|
}
|
|
|
|
if arg.Nik.IsFilled {
|
|
|
|
builder = builder.Set("nik", arg.Nik.Value)
|
|
|
|
}
|
|
|
|
if arg.NoKk.IsFilled {
|
|
|
|
builder = builder.Set("no_kk", arg.NoKk.Value)
|
|
|
|
}
|
|
|
|
if arg.NoKartuPesertaBPJS.IsFilled {
|
|
|
|
builder = builder.Set("no_kartu_peserta_bpjs", arg.NoKartuPesertaBPJS.Value)
|
|
|
|
}
|
|
|
|
|
|
|
|
query, args, err := builder.Where(pgq.Eq{"id": patientId}).Suffix("RETURNING *").SQL()
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
return model.Patient{}, err
|
|
|
|
}
|
|
|
|
|
|
|
|
row, _ := q.db.Query(ctx, query, args...)
|
|
|
|
result, err := pgx.CollectExactlyOneRow[model.Patient](row, pgx.RowToStructByName[model.Patient])
|
|
|
|
return result, err
|
|
|
|
}
|
|
|
|
|
|
|
|
func (q *Queries) UpdatePatientNik(ctx context.Context, nik *string, patientId int32) error {
|
|
|
|
updatePatientQuery := `
|
|
|
|
UPDATE "Pasien" p
|
|
|
|
SET nik = $1
|
|
|
|
WHERE id = $2
|
|
|
|
`
|
|
|
|
|
|
|
|
_, err := q.db.Exec(ctx, updatePatientQuery, nik, patientId)
|
|
|
|
return err
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2024-02-23 14:10:40 +07:00
|
|
|
type createPatientParams struct {
|
|
|
|
NoRm string `json:"no_rm" db:"no_rm"`
|
|
|
|
NamaPasien string `json:"nama_pasien" db:"nama_pasien"`
|
|
|
|
JenisIdentitas pgtype.Int4 `json:"jenis_identitas" db:"jenis_identitas"`
|
|
|
|
NoIdentitas pgtype.Text `json:"no_identitas" db:"no_identitas"`
|
|
|
|
FotoProfil pgtype.Text `json:"foto_profil" db:"foto_profil"`
|
|
|
|
FotoKtp pgtype.Text `json:"foto_ktp" db:"foto_ktp"`
|
|
|
|
KotaLahir pgtype.Int4 `json:"kota_lahir" db:"kota_lahir"`
|
|
|
|
TanggalLahir time.Time `json:"tanggal_lahir" db:"tanggal_lahir"`
|
|
|
|
JenisKelamin int8 `json:"jenis_kelamin" db:"jenis_kelamin"`
|
|
|
|
Suku pgtype.Int4 `json:"suku" db:"suku"`
|
|
|
|
Agama pgtype.Int4 `json:"agama" db:"agama"`
|
|
|
|
Kebangsaan pgtype.Int4 `json:"kebangsaan" db:"kebangsaan"`
|
|
|
|
Bahasa pgtype.Int4 `json:"bahasa" db:"bahasa"`
|
|
|
|
Pendidikan pgtype.Int4 `json:"pendidikan" db:"pendidikan"`
|
|
|
|
StatusPerkawinan pgtype.Int4 `json:"status_perkawinan" db:"status_perkawinan"`
|
|
|
|
Email pgtype.Text `json:"email" db:"email"`
|
|
|
|
Pekerjaan pgtype.Int4 `json:"pekerjaan" db:"pekerjaan"`
|
|
|
|
NoHp pgtype.Text `json:"no_hp" db:"no_hp"`
|
|
|
|
IsDeleted bool `json:"is_deleted" db:"is_deleted"`
|
|
|
|
FasyankesID int `json:"fasyankes_id" db:"fasyankes_id"`
|
|
|
|
Nik pgtype.Text `json:"nik" db:"nik"`
|
|
|
|
NoKk pgtype.Text `json:"no_kk" db:"no_kk"`
|
|
|
|
NoKartuPesertaBPJS pgtype.Text `json:"no_kartu_peserta_bpjs" db:"no_kartu_peserta_bpjs"`
|
|
|
|
CreateBy int `json:"create_by" db:"create_by"`
|
|
|
|
UpdateBy int `json:"update_by" db:"update_by"`
|
|
|
|
UpdatedAt time.Time `json:"updated_at" db:"updated_at"`
|
|
|
|
}
|
|
|
|
|
|
|
|
func (q *Queries) CreatePatient(ctx context.Context, arg createPatientParams) (model.Patient, error) {
|
2024-02-22 10:43:39 +07:00
|
|
|
createPasienQuery := `
|
|
|
|
INSERT INTO "Pasien"(
|
|
|
|
no_rm,
|
|
|
|
nama_pasien,
|
|
|
|
jenis_identitas,
|
|
|
|
no_identitas,
|
|
|
|
foto_profil,
|
|
|
|
foto_ktp,
|
|
|
|
kota_lahir,
|
|
|
|
tanggal_lahir,
|
|
|
|
jenis_kelamin,
|
|
|
|
suku,
|
|
|
|
agama,
|
|
|
|
kebangsaan,
|
|
|
|
bahasa,
|
|
|
|
pendidikan,
|
|
|
|
status_perkawinan,
|
|
|
|
email,
|
|
|
|
pekerjaan,
|
|
|
|
no_hp,
|
|
|
|
is_deleted,
|
|
|
|
fasyankes_id,
|
|
|
|
nik,
|
|
|
|
no_kk,
|
|
|
|
no_kartu_peserta_bpjs,
|
|
|
|
create_by,
|
2024-02-23 14:10:40 +07:00
|
|
|
update_by,
|
|
|
|
updated_at
|
|
|
|
) VALUES ( $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24, $25, $26)
|
2024-02-22 10:43:39 +07:00
|
|
|
RETURNING *;
|
|
|
|
`
|
|
|
|
|
|
|
|
row, _ := q.db.Query(ctx, createPasienQuery,
|
|
|
|
arg.NoRm,
|
|
|
|
arg.NamaPasien,
|
|
|
|
arg.JenisIdentitas,
|
|
|
|
arg.NoIdentitas,
|
|
|
|
arg.FotoProfil,
|
|
|
|
arg.FotoKtp,
|
|
|
|
arg.KotaLahir,
|
|
|
|
arg.TanggalLahir,
|
|
|
|
arg.JenisKelamin,
|
|
|
|
arg.Suku,
|
|
|
|
arg.Agama,
|
|
|
|
arg.Kebangsaan,
|
|
|
|
arg.Bahasa,
|
|
|
|
arg.Pendidikan,
|
|
|
|
arg.StatusPerkawinan,
|
|
|
|
arg.Email,
|
|
|
|
arg.Pekerjaan,
|
|
|
|
arg.NoHp,
|
|
|
|
arg.IsDeleted,
|
|
|
|
arg.FasyankesID,
|
|
|
|
arg.Nik,
|
|
|
|
arg.NoKk,
|
|
|
|
arg.NoKartuPesertaBPJS,
|
|
|
|
arg.CreateBy,
|
|
|
|
arg.UpdateBy,
|
|
|
|
arg.UpdatedAt,
|
|
|
|
)
|
|
|
|
|
|
|
|
result, err := pgx.CollectExactlyOneRow[model.Patient](row, pgx.RowToStructByName[model.Patient])
|
|
|
|
|
|
|
|
return result, err
|
|
|
|
}
|
|
|
|
|
|
|
|
type ImportDataPasienParams struct {
|
2024-03-06 09:15:08 +07:00
|
|
|
NoRekamMedis string
|
|
|
|
NamaPasien string
|
|
|
|
NoKTP pgtype.Text
|
|
|
|
NoBPJS pgtype.Text
|
|
|
|
TempatLahir pgtype.Int4
|
|
|
|
TglLahir time.Time
|
|
|
|
Kelamin int8
|
|
|
|
Kebangsaan pgtype.Int4
|
|
|
|
Agama pgtype.Int4
|
|
|
|
Suku pgtype.Int4
|
|
|
|
Pendidikan pgtype.Int4
|
|
|
|
Pekerjaan pgtype.Int4
|
|
|
|
Hp pgtype.Text
|
|
|
|
Email pgtype.Text
|
|
|
|
StatusKawin pgtype.Int4
|
|
|
|
Provinsi pgtype.Text
|
|
|
|
NamaJalan pgtype.Text
|
|
|
|
NamaPenjamin pgtype.Text
|
|
|
|
NikPenjamin pgtype.Text
|
|
|
|
HubunganPenjamin pgtype.Int2
|
|
|
|
HpPenjamin pgtype.Text
|
2024-02-22 10:43:39 +07:00
|
|
|
}
|
|
|
|
|
2024-02-23 14:10:40 +07:00
|
|
|
func (store *SQLStore) ImportPatientTx(ctx context.Context, params ImportDataPasienParams, createdBy int32, fasyankesId int32) error {
|
2024-02-22 10:43:39 +07:00
|
|
|
err := store.execTx(ctx, func(q *Queries) error {
|
|
|
|
var err error
|
|
|
|
|
2024-02-23 14:10:40 +07:00
|
|
|
patient, err := q.CreatePatient(ctx, createPatientParams{
|
2024-02-22 10:43:39 +07:00
|
|
|
NoRm: params.NoRekamMedis,
|
|
|
|
NamaPasien: params.NamaPasien,
|
2024-03-06 09:15:08 +07:00
|
|
|
Nik: params.NoKTP,
|
|
|
|
NoKartuPesertaBPJS: params.NoBPJS,
|
|
|
|
KotaLahir: params.TempatLahir,
|
2024-02-22 10:43:39 +07:00
|
|
|
TanggalLahir: params.TglLahir,
|
2024-03-06 09:15:08 +07:00
|
|
|
JenisKelamin: params.Kelamin,
|
|
|
|
Kebangsaan: params.Kebangsaan,
|
|
|
|
Agama: params.Agama,
|
|
|
|
Suku: params.Suku,
|
|
|
|
Pendidikan: params.Pendidikan,
|
|
|
|
Pekerjaan: params.Pekerjaan,
|
2024-02-22 10:43:39 +07:00
|
|
|
NoHp: params.Hp,
|
|
|
|
Email: params.Email,
|
2024-03-06 09:15:08 +07:00
|
|
|
StatusPerkawinan: params.StatusKawin,
|
2024-02-23 14:10:40 +07:00
|
|
|
FasyankesID: int(fasyankesId),
|
|
|
|
UpdatedAt: time.Now().UTC(),
|
2024-02-22 10:43:39 +07:00
|
|
|
})
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
if params.NamaJalan.Valid {
|
|
|
|
var provinsi_id *int32
|
2024-03-06 09:15:08 +07:00
|
|
|
provinsi, err := q.FindWilayahByName(ctx, params.Provinsi.String)
|
2024-02-22 10:43:39 +07:00
|
|
|
|
|
|
|
if err != nil {
|
2024-02-23 14:10:40 +07:00
|
|
|
if err != pgx.ErrNoRows {
|
|
|
|
return err
|
|
|
|
}
|
2024-02-22 10:43:39 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
if provinsi.Id == 0 {
|
|
|
|
provinsi_id = nil
|
|
|
|
} else {
|
|
|
|
provinsi_id = &provinsi.Id
|
|
|
|
}
|
|
|
|
|
|
|
|
_, err = q.CreateAlamat(ctx, model.Alamat{
|
|
|
|
Provinsi: provinsi_id,
|
|
|
|
Nama_jalan: ¶ms.NamaJalan.String,
|
|
|
|
Pasien_id: int32(patient.ID),
|
2024-02-23 14:10:40 +07:00
|
|
|
Kategori: nil,
|
|
|
|
Negara: nil,
|
|
|
|
Kabupaten: nil,
|
|
|
|
Kecamatan: nil,
|
|
|
|
Kelurahan: nil,
|
|
|
|
Kode_pos: nil,
|
|
|
|
Rt: nil,
|
|
|
|
Rw: nil,
|
|
|
|
No_hp: nil,
|
|
|
|
No_telpon: nil,
|
|
|
|
Status: nil,
|
2024-02-22 10:43:39 +07:00
|
|
|
})
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2024-03-06 09:15:08 +07:00
|
|
|
if params.HubunganPenjamin.Valid && params.NamaPenjamin.Valid {
|
2024-02-22 10:43:39 +07:00
|
|
|
_, err = q.CreateKeluarga(ctx, model.Keluarga{
|
|
|
|
Id: int32(patient.ID),
|
2024-03-06 09:15:08 +07:00
|
|
|
Nama: params.NamaPenjamin,
|
2024-02-22 10:43:39 +07:00
|
|
|
Hubungan: params.HubunganPenjamin,
|
|
|
|
})
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return err
|
|
|
|
})
|
|
|
|
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
func (q *Queries) GenerateNoRm(ctx context.Context, fasyankesId int32) (string, error) {
|
|
|
|
lastPasien, err := q.FindLastPatientInCertainFasyankes(ctx, fasyankesId)
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
return "", err
|
|
|
|
}
|
|
|
|
|
|
|
|
return genNoRm(&lastPasien.NoRm), nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func genNoRm(lastNoRm *string) string {
|
|
|
|
var tempNoRm string
|
|
|
|
|
|
|
|
if lastNoRm != nil {
|
|
|
|
tempNoRm = *lastNoRm
|
|
|
|
} else {
|
2024-02-23 14:10:40 +07:00
|
|
|
tempNoRm = "0"
|
2024-02-22 10:43:39 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
length := strings.IndexFunc(tempNoRm, func(r rune) bool {
|
|
|
|
return r != '0'
|
|
|
|
})
|
|
|
|
|
2024-02-23 14:10:40 +07:00
|
|
|
if lastNoRm == nil {
|
|
|
|
length = 6
|
|
|
|
}
|
2024-02-22 10:43:39 +07:00
|
|
|
|
2024-02-23 14:10:40 +07:00
|
|
|
tempNoRmNum, _ := strconv.ParseInt(tempNoRm, 10, 32)
|
|
|
|
|
|
|
|
return util.PadWithZeros(int(tempNoRmNum)+1, int(length))
|
|
|
|
}
|