MERGE_REFRESH_EMPTY_DISPLAY_ISSSUE
This commit is contained in:
commit
4f52390833
@ -497,11 +497,13 @@ class EmployeeRestController extends AdminController
|
|||||||
try {
|
try {
|
||||||
$file = $this->request->getFile('file');
|
$file = $this->request->getFile('file');
|
||||||
$client_id = $this->request->getPost('client_id');
|
$client_id = $this->request->getPost('client_id');
|
||||||
// $client_id = $this->request->getJSON('client_id');
|
|
||||||
$policy_id = $this->request->getPost('policy_id');
|
$policy_id = $this->request->getPost('policy_id');
|
||||||
|
|
||||||
$employee_id = $this->request->getPost('employee_id');
|
$token = $this->request->headers()['Auth']->getValue();
|
||||||
// $policy_id = $this->request->getJSON('policy_id');
|
$decodedPayload = json_decode(base64_decode(explode('.', $token)[1]), true);
|
||||||
|
|
||||||
|
// get the employee id from token
|
||||||
|
$employee_id = $decodedPayload['id'];
|
||||||
|
|
||||||
$client_policy = $this->clientPolicyModel->where('id', $policy_id)->where('client_id', $client_id)->first();
|
$client_policy = $this->clientPolicyModel->where('id', $policy_id)->where('client_id', $client_id)->first();
|
||||||
|
|
||||||
@ -586,18 +588,18 @@ class EmployeeRestController extends AdminController
|
|||||||
}
|
}
|
||||||
$dataToInsert = [];
|
$dataToInsert = [];
|
||||||
$basic_cover_si= [];
|
$basic_cover_si= [];
|
||||||
if ($extra[9]) {
|
// if ($extra[9]) {
|
||||||
$new_array = [];
|
// $new_array = [];
|
||||||
for ($i=0; $i < count($extra[9]); $i++) {
|
// for ($i=0; $i < count($extra[9]); $i++) {
|
||||||
if ($sum_insured_amount_for_check_employee_2 != $extra[9][$i] || $sum_insured_amount_for_check_employee_1 != $extra[9][$i]) {
|
// if ($sum_insured_amount_for_check_employee_2 != $extra[9][$i] || $sum_insured_amount_for_check_employee_1 != $extra[9][$i]) {
|
||||||
$new_array[] = $i+1;
|
// $new_array[] = $i+1;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
if (count($new_array) > 0) {
|
// if (count($new_array) > 0) {
|
||||||
$count =count($new_array);
|
// $count =count($new_array);
|
||||||
return $this->respond(['status' => 'failed', 'code' => 404, 'message' => "$count Employee Sum Insured is Not Match.. " , 'data' => $new_array], 200);
|
// return $this->respond(['status' => 'failed', 'code' => 404, 'message' => "$count Employee Sum Insured is Not Match.. " , 'data' => $new_array], 200);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
foreach ($extra['0'] as $index => $id) {
|
foreach ($extra['0'] as $index => $id) {
|
||||||
$relation ='';
|
$relation ='';
|
||||||
if ($extra['5'][$index] === 'Mother' || $extra['5'][$index] === 'Father') {
|
if ($extra['5'][$index] === 'Mother' || $extra['5'][$index] === 'Father') {
|
||||||
|
|||||||
@ -17,6 +17,7 @@ use App\Models\FileModel;
|
|||||||
use App\Models\EmpEndorsementModel;
|
use App\Models\EmpEndorsementModel;
|
||||||
|
|
||||||
use App\Controllers\Jobs ;
|
use App\Controllers\Jobs ;
|
||||||
|
use App\Controllers\JobWorker ;
|
||||||
|
|
||||||
use PhpOffice\PhpSpreadsheet\Spreadsheet;
|
use PhpOffice\PhpSpreadsheet\Spreadsheet;
|
||||||
use Kint\Kint;
|
use Kint\Kint;
|
||||||
@ -266,8 +267,9 @@ class EmployeeServiceController extends AdminController
|
|||||||
{
|
{
|
||||||
//proceed next data level validation in JOB queue
|
//proceed next data level validation in JOB queue
|
||||||
$job_details = new Jobs();
|
$job_details = new Jobs();
|
||||||
|
|
||||||
$r = Jobs::addJob(['job_name' => 'excelFileDataValidation','payload' => ['file_id' => $file_id]]);
|
$r = Jobs::addJob(['job_name' => 'excelFileDataValidation','payload' => ['file_id' => $file_id]]);
|
||||||
|
$jobWorker = new JobWorker();
|
||||||
|
JobWorker::processJob($r);
|
||||||
}
|
}
|
||||||
return $result;
|
return $result;
|
||||||
|
|
||||||
@ -438,6 +440,8 @@ class EmployeeServiceController extends AdminController
|
|||||||
$job_details = new Jobs();
|
$job_details = new Jobs();
|
||||||
|
|
||||||
$r = Jobs::addJob(['job_name' => 'employeesOnboardPreprocess','payload' => ['file_id' => $file_id]]);
|
$r = Jobs::addJob(['job_name' => 'employeesOnboardPreprocess','payload' => ['file_id' => $file_id]]);
|
||||||
|
$jobWorker = new JobWorker();
|
||||||
|
JobWorker::processJob($r);
|
||||||
}
|
}
|
||||||
return $result;
|
return $result;
|
||||||
|
|
||||||
|
|||||||
@ -27,6 +27,14 @@ class JobWorker extends AdminController
|
|||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function streamOutput($data)
|
||||||
|
{
|
||||||
|
ob_implicit_flush(true);
|
||||||
|
// try { ob_end_flush(); } catch(Exception $e) { echo $e->getMessage(); }
|
||||||
|
echo $data;
|
||||||
|
flush();
|
||||||
|
}
|
||||||
|
|
||||||
public static function processJobs(array $jobdata = [])
|
public static function processJobs(array $jobdata = [])
|
||||||
{
|
{
|
||||||
// echo 'listen';//die();
|
// echo 'listen';//die();
|
||||||
@ -49,6 +57,7 @@ class JobWorker extends AdminController
|
|||||||
//sleep(1);
|
//sleep(1);
|
||||||
|
|
||||||
SELF::processjob(['id' => $job->id,'uuid' => $job->uuid]);
|
SELF::processjob(['id' => $job->id,'uuid' => $job->uuid]);
|
||||||
|
usleep( 500000 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -86,8 +95,15 @@ class JobWorker extends AdminController
|
|||||||
{
|
{
|
||||||
$job = $job[0];
|
$job = $job[0];
|
||||||
|
|
||||||
echo "\nProcessing job id - " . $job->id . "\n";
|
|
||||||
echo "Job name - " . $job->name . "\n";
|
|
||||||
|
// echo "\nProcessing job id - " . $job->id . "\n";
|
||||||
|
SELF::streamOutput("\nProcessing job id - " . $job->id . "\n");
|
||||||
|
// sleep(5);
|
||||||
|
// echo "Job name - " . $job->name . "\n";
|
||||||
|
SELF::streamOutput("Job name - " . $job->name . "\n");
|
||||||
|
// sleep(5);
|
||||||
|
|
||||||
// print_r(SELF::$event_class_mapping);
|
// print_r(SELF::$event_class_mapping);
|
||||||
// echo array_key_exists($job->name,SELF::$event_class_mapping) ? 'mapped' : 'notmapped';
|
// echo array_key_exists($job->name,SELF::$event_class_mapping) ? 'mapped' : 'notmapped';
|
||||||
// die();
|
// die();
|
||||||
@ -173,7 +189,8 @@ class JobWorker extends AdminController
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
// echo "Job $job->id $job_status. Response - $response \n";
|
// echo "Job $job->id $job_status. Response - $response \n";
|
||||||
echo "Job $job->id $job_status \n";
|
// echo "Job $job->id $job_status \n";
|
||||||
|
SELF::streamOutput("Job $job->id $job_status \n");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -62,11 +62,13 @@ class ClientPolicyModel extends Model
|
|||||||
|
|
||||||
public function getClientPolicyByClientId($client_id){
|
public function getClientPolicyByClientId($client_id){
|
||||||
|
|
||||||
|
|
||||||
return $this->db->table('client_policy')
|
return $this->db->table('client_policy')
|
||||||
->select('client_policy.*')
|
->select('client_policy.*')
|
||||||
->select('insurers.name as insurer_name, insurers.short_name as insurer_short')
|
->select('insurers.name as insurer_name, insurers.short_name as insurer_short')
|
||||||
->select('tpa.name as tpa_name, tpa.short_name as tpa_short')
|
->select('tpa.name as tpa_name, tpa.short_name as tpa_short')
|
||||||
->select('policies.name as policy_name')
|
->select('policies.name as policy_name, policies.policy_type_id')
|
||||||
|
->select('policy_type.policy_type as policy_type_name')
|
||||||
->select('insurer_branch.branch_name as insurer_branch_name, insurer_branch.branch_code as insurer_branch_code')
|
->select('insurer_branch.branch_name as insurer_branch_name, insurer_branch.branch_code as insurer_branch_code')
|
||||||
->select('tpa_branch.branch_name as tpa_branch_name, tpa_branch.branch_code as tpa_branch_code')
|
->select('tpa_branch.branch_name as tpa_branch_name, tpa_branch.branch_code as tpa_branch_code')
|
||||||
->join('insurers', 'insurers.id = client_policy.insurer_id')
|
->join('insurers', 'insurers.id = client_policy.insurer_id')
|
||||||
@ -74,10 +76,13 @@ class ClientPolicyModel extends Model
|
|||||||
->join('tpa', 'tpa.id = client_policy.tpa_id')
|
->join('tpa', 'tpa.id = client_policy.tpa_id')
|
||||||
->join('tpa_branch', 'client_policy.tpa_branch_id = tpa_branch.id')
|
->join('tpa_branch', 'client_policy.tpa_branch_id = tpa_branch.id')
|
||||||
->join('policies', 'policies.id = client_policy.policy_id')
|
->join('policies', 'policies.id = client_policy.policy_id')
|
||||||
|
->join('policy_type', 'policy_type.id = policies.policy_type_id')
|
||||||
->where('client_policy.client_id', $client_id)
|
->where('client_policy.client_id', $client_id)
|
||||||
->get()
|
->get()
|
||||||
->getResult();
|
->getResult();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPolicyPremium($policy_id){
|
public function getPolicyPremium($policy_id){
|
||||||
|
|||||||
@ -105,13 +105,11 @@ input:checked + .slider:before {
|
|||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="form-group col-md-4">
|
<div class="form-group col-md-4">
|
||||||
<label for="pan">PAN<span class="text-danger">*</span></label>
|
<label for="pan">PAN<span class="text-danger">*</span></label>
|
||||||
<input type="text" class="form-control" id="pan"
|
<input type="text" class="form-control" id="pan" placeholder="Enter PAN Number" data-parsley-error-message="Invalid PAN Number. Example: ABCDE1234F" value="<?= isset($client['pan']) ? $client['pan'] : '' ?>" name="pan" data-parsley-trigger="change" data-parsley-pattern="^[A-Z]{5}[0-9]{4}[A-Z]$" required>
|
||||||
placeholder="Enter PAN Number" value="<?= isset($client['pan']) ? $client['pan'] : '' ?>" name="pan" data-parsley-trigger="change" data-parsley-pattern="^[A-Z]{5}[0-9]{4}[A-Z]$" required>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-4">
|
<div class="form-group col-md-4">
|
||||||
<label for="gst">GST<span class="text-danger">*</span></label>
|
<label for="gst">GST<span class="text-danger">*</span></label>
|
||||||
<input type="text" class="form-control" id="gst"
|
<input type="text" class="form-control" id="gst" placeholder="Enter GST Number" data-parsley-error-message="Invalid GST Number. Example: 12ABCDE1234F5Z6" value="<?= isset($client['gst']) ? $client['gst'] : '' ?>" name="gst" data-parsley-trigger="change" data-parsley-pattern="^\d{2}[A-Z]{5}\d{4}[A-Z]{1}[A-Z\d]{1}[Z]{1}[A-Z\d]{1}$" required>
|
||||||
placeholder="Enter GST Number" value="<?= isset($client['gst']) ? $client['gst'] : '' ?>" name="gst" data-parsley-trigger="change" data-parsley-pattern="^\d{2}[A-Z]{5}\d{4}[A-Z]{1}[A-Z\d]{1}[Z]{1}[A-Z\d]{1}$" required>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@ -194,12 +194,15 @@
|
|||||||
if (policy_PrimaryKey !== '') {
|
if (policy_PrimaryKey !== '') {
|
||||||
var policyTable = '';
|
var policyTable = '';
|
||||||
var data = <?= isset($client_policy) ? json_encode($client_policy) : '[]' ?>;
|
var data = <?= isset($client_policy) ? json_encode($client_policy) : '[]' ?>;
|
||||||
|
|
||||||
data.forEach(function(item) {
|
data.forEach(function(item) {
|
||||||
|
// console.log("----------------------------");
|
||||||
|
|
||||||
|
// console.log(item);
|
||||||
|
|
||||||
policyTable += `
|
policyTable += `
|
||||||
<tr>
|
<tr>
|
||||||
<td>${item.insurer_short} - ${item.insurer_branch_name}</td>
|
<td>${item.insurer_short} - ${item.insurer_branch_name}</td>
|
||||||
<td>${item.policy_name}</td>
|
<td>${item.policy_name} (${item.policy_type_name})</td>
|
||||||
<td>${item.tpa_short} - ${item.tpa_branch_code}</td>
|
<td>${item.tpa_short} - ${item.tpa_branch_code}</td>
|
||||||
<td>${rearrangeDateFormat(item.policy_start_date)} - ${rearrangeDateFormat(item.policy_end_date)}</td>
|
<td>${rearrangeDateFormat(item.policy_start_date)} - ${rearrangeDateFormat(item.policy_end_date)}</td>
|
||||||
<td>${checkDateStatus(item.policy_end_date, 1)}</td>
|
<td>${checkDateStatus(item.policy_end_date, 1)}</td>
|
||||||
|
|||||||
@ -75,7 +75,7 @@ table.dataTable tbody td {
|
|||||||
<!-- <th class="font-weight-medium">Employee code</th> -->
|
<!-- <th class="font-weight-medium">Employee code</th> -->
|
||||||
<th class="font-weight-medium">Name/code</th>
|
<th class="font-weight-medium">Name/code</th>
|
||||||
<th class="font-weight-medium">Policy name</th>
|
<th class="font-weight-medium">Policy name</th>
|
||||||
<th class="font-weight-medium">Insurar name</th>
|
<th class="font-weight-medium">Insurer name</th>
|
||||||
<th class="font-weight-medium">TPA ID</th>
|
<th class="font-weight-medium">TPA ID</th>
|
||||||
<th class="font-weight-medium">UHID ID</th>
|
<th class="font-weight-medium">UHID ID</th>
|
||||||
<th class="font-weight-medium">Policy status</th>
|
<th class="font-weight-medium">Policy status</th>
|
||||||
|
|||||||
@ -3,17 +3,17 @@
|
|||||||
# This template allows you to validate your PHP application.
|
# This template allows you to validate your PHP application.
|
||||||
# The workflow allows running tests and code linting on the default branch.
|
# The workflow allows running tests and code linting on the default branch.
|
||||||
|
|
||||||
image: composer:2.0
|
image: php:8.2-cli
|
||||||
|
|
||||||
|
|
||||||
pipelines:
|
pipelines:
|
||||||
default:
|
default:
|
||||||
- parallel:
|
- step:
|
||||||
- step:
|
name: Initialize and Deploy using Git FTP
|
||||||
name: Test
|
script:
|
||||||
script:
|
- apt-get update
|
||||||
- apt-get update
|
- apt-get -qq install git-ftp
|
||||||
- apt-get -qq install git-ftp
|
- git ftp init -u $FTP_USERNAME -p $FTP_PASSWORD $FTP_URL
|
||||||
- git ftp push -u $FTP_USERNAME -p $FTP_PASSWORD $FTP_URL
|
- git ftp push -u $FTP_USERNAME -p $FTP_PASSWORD $FTP_URL
|
||||||
caches:
|
caches:
|
||||||
- composer
|
- composer
|
||||||
|
|||||||
@ -175,9 +175,6 @@ paths:
|
|||||||
policy_id:
|
policy_id:
|
||||||
type: integer
|
type: integer
|
||||||
description: policy_id
|
description: policy_id
|
||||||
employee_id:
|
|
||||||
type: integer
|
|
||||||
description: employee_id
|
|
||||||
file:
|
file:
|
||||||
type: string
|
type: string
|
||||||
format: binary
|
format: binary
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user