This commit is contained in:
Server D3 Linksehat
2025-08-19 09:39:37 +07:00
parent 60f5f38ffe
commit 9634b12f11
11 changed files with 162 additions and 15 deletions

View File

@@ -100,7 +100,10 @@ class MemberController extends Controller
// Provider
$providers = DB::table('organizations')
->where('organizations.type', '=', 'hospital')
->where('organizations.corporate_id_partner', '!=', 8)
->orWhere('organizations.corporate_id_partner', NULL)
->where('status', '=', 'active')
->orderBy('organizations.name','asc')
->select(
'organizations.id',
'organizations.name'

View File

@@ -167,15 +167,13 @@ class DashboardController extends Controller
public function listDokter(Request $request)
{
$idDokter = [
'68268',
'75047',
'75046',
'75045',
'75044',
'75043',
'75027',
'75021',
'75020',
'120866',
'107922',
'107921',
'107920',
'101192',
'99232',
'99230',
]; // List dokter
$listDokters = Dokter::with([])->whereIn('nIDUser', $idDokter)->get();
@@ -184,8 +182,8 @@ class DashboardController extends Controller
return [
'id' => $dokter->nIDUser,
'code' => $dokter->nIDUser,
'name' => $dokter->user->fullName,
'online' => $dokter->sStatus,
'name' => $dokter->user ? $dokter->user->fullName : '-',
'online' => $dokter->sIsOnline,
];
});

View File

@@ -67,6 +67,7 @@ class LivechatController extends Controller
public function export(Request $request)
{
ini_set('memory_limit', '1G');
$startDate = $request->has('startDate') ? $request->input('startDate') : '';
$endDate = $request->has('endDate') ? $request->input('endDate') : '';
$type = $request->has('type') ? $request->input('type') : '';

View File

@@ -16,7 +16,8 @@ class NavigationController extends Controller
public function index(Request $request)
{
// Ambil semua navigasi dari tabel dan ubah menjadi array
$navigations = Navigations::all()->toArray();
// $navigations = Navigations::all()->toArray();
$navigations = Navigations::orderBy('urutan', 'asc')->get()->toArray();
$navigationMaster = [];
if ($navigations) {

View File

@@ -202,4 +202,34 @@ class UserManagementController extends Controller
return response()->json($userAccess);
}
public function delete(Request $request, $id)
{
try {
// Cari user berdasarkan ID
$user = User::findOrFail($id);
// Hapus user
$user->delete();
// Response sukses
return response()->json([
'code' => 200,
'message' => 'User berhasil dihapus',
'data' => null,
]);
} catch (\Illuminate\Database\Eloquent\ModelNotFoundException $e) {
return response()->json([
'code' => 404,
'message' => 'User tidak ditemukan',
'data' => null,
], 404);
} catch (\Exception $e) {
return response()->json([
'code' => 500,
'message' => 'Terjadi kesalahan saat menghapus user',
'error' => $e->getMessage(),
], 500);
}
}
}

View File

@@ -415,6 +415,7 @@ Route::prefix('internal')->group(function () {
Route::post('user/access', [UserManagementController::class, 'store_access']);
Route::get('user/access/{id}', [UserManagementController::class, 'edit_access']);
Route::put('user/access/{id}', [UserManagementController::class, 'update_access']);
Route::post('user/access/{id}/delete', [UserManagementController::class, 'delete']);
Route::get('role-list', [UserManagementController::class, 'list_role']);
Route::get('organization-list', [UserManagementController::class, 'list_organization']);

View File

@@ -412,7 +412,7 @@ class MemberEnrollmentService
->first();
if (empty($member)) {
throw new ImportRowException(__('enrollment.MAPING_ID_NOT_SAME_MEMBER_ID'), 0, null, $row);
// throw new ImportRowException(__('enrollment.MAPING_ID_NOT_SAME_MEMBER_ID'), 0, null, $row);
} else {
// if ($member['record_type'] != 'P'){
// throw new ImportRowException(__('enrollment.PRINCIPAL_ID_NOT_SAME_MEMBER_ID'), 0, null, $row);

View File

@@ -27,7 +27,7 @@ class RequestLogResource extends JsonResource
'submission_date' => $this->created_at, // submsion_date diambil dari kolom created_at
'admission_date' => $this->submission_date, // admission_date diambil dari kolom submission
'submission_date_fgl' => $this->approved_final_log_at,
'member_name' => $this->member->name,
'member_name' => $this->member->name ?? '-',
'status' => $this->status ?? 'unknown',
'provider' => $provider ? $provider->name : '-',
'status_final_log' => $this->status_final_log ?? 'unknown',

View File

@@ -0,0 +1,67 @@
<?php
namespace Database\Seeders;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
class NoSpjSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
// Ambil data dari tabel api_logs
$apiLogs = DB::connection('oldlms')->table('api_logs')
->selectRaw("`sResponse` as sResponse")
->where('sTarget', 'INHPostSJPdanRujukan')
->orderByDesc('nID')
->limit(1000)
->get();
// Proses setiap log untuk mengambil nosjp dan refasalsjp
$berhasil = 0;
foreach ($apiLogs as $log) {
// Decode JSON string
$decodedResponse = json_decode($log->sResponse, true);
// Cek apakah decode berhasil
if (json_last_error() === JSON_ERROR_NONE) {
// Ambil data dari field 'data' yang berisi JSON string
$data = json_decode($decodedResponse['data'], true);
// Pastikan data yang diambil ada dan formatnya benar
if (isset($data['data'][0]['nosjp'], $data['data'][0]['refasalsjp'])) {
$nosjp = $data['data'][0]['nosjp'];
$refasalsjp = $data['data'][0]['refasalsjp'];
$nIDLiveChat = substr($refasalsjp, -5);
// // Tampilkan hasil atau lakukan penyimpanan ke tabel lain
// echo "nosjp: " . $nosjp . ", refasalsjp: " . $refasalsjp . ", 5 karakter terakhir: " . $lastFiveCharacters . "\n";
// Contoh penyimpanan ke tabel lain (misal, table `processed_logs`)
DB::connection('oldlms')->table('tx_livechat')
->where('nID', $nIDLiveChat) // Kondisi where ditempatkan sebelum update
->update([
'sNoSpj' => $nosjp,
]
);
echo "Berhasil data ke: " .$berhasil ++ . "\n";;
} else {
// Tangani kasus jika data tidak sesuai
echo "Data tidak ditemukan dalam response: " . $log->sResponse . "\n";
}
} else {
// Tangani kesalahan JSON decode
echo "Error decoding JSON: " . json_last_error_msg() . " in response: " . $log->sResponse . "\n";
}
}
}
}

View File

@@ -0,0 +1,47 @@
<?php
namespace Database\Seeders;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
class TambahDataKecamatanLMS extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
// Data yang akan dimasukkan ke dalam tabel
$kelurahanData = [
['nIDKota' => 337205, 'nIDProvinsi' => 33, 'nIDKecamatan' => 337205, 'sKelurahan' => 'Banyuanyar', 'nKodePos' => 57137],
['nIDKota' => 337205, 'nIDProvinsi' => 33, 'nIDKecamatan' => 337205, 'sKelurahan' => 'Gilingan', 'nKodePos' => 57134],
['nIDKota' => 337205, 'nIDProvinsi' => 33, 'nIDKecamatan' => 337205, 'sKelurahan' => 'Kadipiro', 'nKodePos' => 57136],
['nIDKota' => 337205, 'nIDProvinsi' => 33, 'nIDKecamatan' => 337205, 'sKelurahan' => 'Keprabon', 'nKodePos' => 57131],
['nIDKota' => 337205, 'nIDProvinsi' => 33, 'nIDKecamatan' => 337205, 'sKelurahan' => 'Kestalan', 'nKodePos' => 57133],
['nIDKota' => 337205, 'nIDProvinsi' => 33, 'nIDKecamatan' => 337205, 'sKelurahan' => 'Ketelan', 'nKodePos' => 57132],
['nIDKota' => 337205, 'nIDProvinsi' => 33, 'nIDKecamatan' => 337205, 'sKelurahan' => 'Manahan', 'nKodePos' => 57139],
['nIDKota' => 337205, 'nIDProvinsi' => 33, 'nIDKecamatan' => 337205, 'sKelurahan' => 'Mangkubumen', 'nKodePos' => 57139],
['nIDKota' => 337205, 'nIDProvinsi' => 33, 'nIDKecamatan' => 337205, 'sKelurahan' => 'Nusukan', 'nKodePos' => 57135],
['nIDKota' => 337205, 'nIDProvinsi' => 33, 'nIDKecamatan' => 337205, 'sKelurahan' => 'Punggawan', 'nKodePos' => 57132],
['nIDKota' => 337205, 'nIDProvinsi' => 33, 'nIDKecamatan' => 337205, 'sKelurahan' => 'Setabelan', 'nKodePos' => 57133],
['nIDKota' => 337205, 'nIDProvinsi' => 33, 'nIDKecamatan' => 337205, 'sKelurahan' => 'Sumber', 'nKodePos' => 57138],
['nIDKota' => 337205, 'nIDProvinsi' => 33, 'nIDKecamatan' => 337205, 'sKelurahan' => 'Timuran', 'nKodePos' => 57131],
];
// Insert data ke dalam tabel kelurahan
foreach ($kelurahanData as $data) {
DB::connection('oldlms')->table('tm_kelurahan')->insert([
'nIDKota' => $data['nIDKota'],
'nIDProvinsi' => $data['nIDProvinsi'],
'nIDKecamatan' => $data['nIDKecamatan'],
'sKelurahan' => $data['sKelurahan'],
'nKodePos' => $data['nKodePos'],
]);
}
}
}

View File

@@ -43,7 +43,6 @@ export type DetailFinalLogType = {
marital_status : string,
admission_date : string,
submission_date : string,
admission_date : string,
approved_final_log_at : string,
service_type : string,
claim_method : string,