mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
tareas corte y tiempo procesamiento
This commit is contained in:
@ -76,6 +76,7 @@ return [
|
||||
"formato" => "Formato",
|
||||
"paginas" => "Páginas",
|
||||
"guillotina" => "Guillotina/Corte",
|
||||
"prep_interior_guillotina" => "Prep. interior guillotina",
|
||||
"tirada" => "Tirada",
|
||||
"merma" => "Merma",
|
||||
"pendiente_ferro" => "Pendiente ferro",
|
||||
|
||||
@ -188,6 +188,14 @@ class ProductionService extends BaseService
|
||||
* @var boolean
|
||||
*/
|
||||
public bool $isCorte = false; //* CHECK DONE
|
||||
|
||||
/**
|
||||
* Indica si hay una tarea de preparacion interior de guillotina ya se cubierta o interior
|
||||
* Se usa para mostrar la fecha correspondiente en la vista
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public bool $isPrepInteriorGuillotina = false; //* CHECK DONE
|
||||
/**
|
||||
* Pedido Entity
|
||||
*
|
||||
@ -436,13 +444,14 @@ class ProductionService extends BaseService
|
||||
{
|
||||
$maquina_id = $this->presupuesto->solapas == 1 ? $this->trimmingMaquinaId : $this->defaultMaquinaCorte->id;
|
||||
$presupuestoLineaImpresion = $this->presupuesto->presupuestoLineaImpresion();
|
||||
$maquinaCorteEntity = $this->maquinaModel->find($maquina_id);
|
||||
$data = [
|
||||
'orden_trabajo_id' => $this->ot->id,
|
||||
'presupuesto_linea_id' => $presupuestoLineaImpresion->id,
|
||||
'nombre' => lang('Produccion.end_cut'),
|
||||
'maquina_id' => $maquina_id,
|
||||
'orden' => $this->maquinaModel->find($maquina_id)->orden_planning,
|
||||
'tiempo_estimado' => 0,
|
||||
'orden' => $maquinaCorteEntity->orden_planning,
|
||||
'tiempo_estimado' => $this->tiempoCorteFinalEstimado($maquinaCorteEntity),
|
||||
'tiempo_real' => 0,
|
||||
'is_corte' => true,
|
||||
'tipo_corte' => "bobina",
|
||||
@ -463,6 +472,7 @@ class ProductionService extends BaseService
|
||||
$otCorte = null;
|
||||
$presupuestoTipo = $this->presupuesto->tipo_presupuesto()->codigo;
|
||||
$isRusticaFresado = str_contains($presupuestoTipo, "Fresado");
|
||||
$maquinaCorteEntity = $this->maquinaModel->find($this->guillotinaPreparacionInteriorMaquinaId);
|
||||
$data = [
|
||||
'orden_trabajo_id' => $this->ot->id,
|
||||
'presupuesto_linea_id' => $pLinea->id,
|
||||
@ -476,10 +486,14 @@ class ProductionService extends BaseService
|
||||
];
|
||||
if ($pLinea->isCubierta()) {
|
||||
$data['nombre'] = lang('Produccion.cover_cut');
|
||||
$data['tiempo_estimado'] = $this->tiempoCortePrepInterior($maquinaCorteEntity);
|
||||
$tareaId = $this->otTarea->insert($data);
|
||||
$otCorte = $this->otTarea->find($tareaId);
|
||||
}
|
||||
if ($pLinea->isImpresionInteriorPlana() || $pLinea->isRotativa()) {
|
||||
if ($pLinea->isImpresionInteriorPlana()) {
|
||||
$data['tiempo_estimado'] = $this->tiempoCortePrepInterior($maquinaCorteEntity);
|
||||
}
|
||||
$data['nombre'] = lang('Produccion.interior_cut');
|
||||
//* Si es rustica fresado y rotativa no se añade preparación de interior en guillotina
|
||||
if (!$isRusticaFresado && !$pLinea->isRotativa()) {
|
||||
@ -939,7 +953,7 @@ class ProductionService extends BaseService
|
||||
->join("orden_trabajo_tareas", "orden_trabajo_tareas.orden_trabajo_id = ordenes_trabajo.id", "left")
|
||||
->join("presupuesto_linea", "presupuesto_linea.id = orden_trabajo_tareas.presupuesto_linea_id", "left")
|
||||
->join("presupuestos", "presupuestos.id = presupuesto_linea.presupuesto_id", "right")
|
||||
->join('lg_maquinas',"lg_maquinas.id = orden_trabajo_tareas.maquina_id","left")
|
||||
->join('lg_maquinas', "lg_maquinas.id = orden_trabajo_tareas.maquina_id", "left")
|
||||
->where("orden_trabajo_tareas.deleted_at", null)
|
||||
->where("orden_trabajo_tareas.presupuesto_linea_id IS NOT NULL", NULL, FALSE)
|
||||
->whereIn("presupuesto_linea.tipo", $this->TIPOS_PLANA)
|
||||
@ -1364,7 +1378,7 @@ class ProductionService extends BaseService
|
||||
}
|
||||
return $query->get()->getResultArray();
|
||||
}
|
||||
public function querySelectMaquinaPlanningPlana($q,?string $padreId)
|
||||
public function querySelectMaquinaPlanningPlana($q, ?string $padreId)
|
||||
{
|
||||
$query = $this->otModel->builder()->select([
|
||||
"orden_trabajo_tareas.maquina_id as id",
|
||||
@ -1381,8 +1395,8 @@ class ProductionService extends BaseService
|
||||
if ($q) {
|
||||
$query->like('lg_maquinas.nombre', $q);
|
||||
}
|
||||
if($padreId){
|
||||
$query->where('lg_maquinas.padre_id',$padreId);
|
||||
if ($padreId) {
|
||||
$query->where('lg_maquinas.padre_id', $padreId);
|
||||
}
|
||||
return $query->get()->getResultArray();
|
||||
}
|
||||
@ -1889,6 +1903,7 @@ class ProductionService extends BaseService
|
||||
"isColor" => $this->isColor,
|
||||
"isBN" => $this->isBN,
|
||||
"isCorte" => $this->corte(),
|
||||
"isPrepInteriorGuillotina" => $this->hasPrepInteriorGuillotina(),
|
||||
"isGrapado" => $this->isGrapado,
|
||||
"isCosido" => $this->cosido(),
|
||||
];
|
||||
@ -2054,6 +2069,17 @@ class ProductionService extends BaseService
|
||||
}
|
||||
return $this->isCorte;
|
||||
}
|
||||
public function hasPrepInteriorGuillotina(): bool
|
||||
{
|
||||
$ot_tareas = $this->ot->tareas();
|
||||
foreach ($ot_tareas as $key => $tarea) {
|
||||
if ($tarea->is_corte && $tarea->tipo_corte = "prep") {
|
||||
$this->isPrepInteriorGuillotina = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return $this->isPrepInteriorGuillotina;
|
||||
}
|
||||
public function getFileBarCode()
|
||||
{
|
||||
return $this->ot->getBarCodeFile();
|
||||
@ -2359,6 +2385,12 @@ class ProductionService extends BaseService
|
||||
if ($tarea->isEncuadernado()) {
|
||||
$dateName = "encuadernacion_at";
|
||||
}
|
||||
if ($tarea->is_corte) {
|
||||
$dateName = "corte_at";
|
||||
}
|
||||
if ($tarea->is_corte && $tarea->tipo_corte == "prep") {
|
||||
$dateName = "preparacion_interiores_at";
|
||||
}
|
||||
return $dateName;
|
||||
}
|
||||
public function getTitleTareaEstado($tarea_id): array
|
||||
@ -2380,4 +2412,38 @@ class ProductionService extends BaseService
|
||||
"userName" => $userName ?? "",
|
||||
];
|
||||
}
|
||||
/**
|
||||
* Devuelve en segundos el tiempo que tarda una máquina de corte en realizar el corte de la tirada completa
|
||||
*
|
||||
* $t = tirada[libros] / velocidad_maquina[libros/minutos]$
|
||||
*
|
||||
* @param MaquinaEntity $maquina
|
||||
* @return float $seconds
|
||||
*/
|
||||
public function tiempoCorteFinalEstimado(MaquinaEntity $maquina): float
|
||||
{
|
||||
$seconds = 0;
|
||||
if ($this->presupuesto->tirada > 0) {
|
||||
$minutos = $this->presupuesto->tirada / $maquina->velocidad;
|
||||
$seconds = $minutos * 60;
|
||||
}
|
||||
return $seconds;
|
||||
}
|
||||
/**
|
||||
* Devuelve en segundos el tiempo que tarda una máquina de corte en realizar
|
||||
*
|
||||
* $t = tirada[libros] / velocidad_maquina[libros/minutos]$
|
||||
*
|
||||
* @param MaquinaEntity $maquina
|
||||
* @return float $seconds
|
||||
*/
|
||||
public function tiempoCortePrepInterior(MaquinaEntity $maquina)
|
||||
{
|
||||
$seconds = 0;
|
||||
if ($this->presupuesto->tirada > 0) {
|
||||
$minutos = $this->presupuesto->tirada / $maquina->velocidad;
|
||||
$seconds = $minutos * 60;
|
||||
}
|
||||
return $seconds;
|
||||
}
|
||||
}
|
||||
|
||||
@ -280,15 +280,16 @@
|
||||
<div class="form-text"><?= $user_dates["marcapaginas_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $flags["isCorte"] ? "" : "d-none" ?>">
|
||||
<label for="ot-prep-guillotina" class="form-label"><?= @lang("Produccion.guillotina") ?></label>
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $flags["isPrepInteriorGuillotina"] ? "" : "d-none" ?>">
|
||||
<label for="ot-prep-interior-guillotina" class="form-label"><?= @lang("Produccion.prep_interior_guillotina") ?></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="corte_at" id="ot-prep-guillotina" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="preparacion_interiores_at" id="ot-prep-interior-guillotina" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["corte_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
<div class="form-text"><?= $user_dates["preparacion_interiores_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= count($ot->tareas_manipulado()) > 0 ? "" : "d-none" ?>">
|
||||
<label for="ot-manipulado" class="form-label"><?= @lang("Produccion.manipulado") ?></label>
|
||||
@ -309,6 +310,16 @@
|
||||
<div class="form-text"> <?= $user_dates["encuadernacion_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $flags["isCorte"] ? "" : "d-none" ?>">
|
||||
<label for="ot-prep-guillotina" class="form-label"><?= @lang("Produccion.guillotina") ?></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="corte_at" id="ot-prep-guillotina" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["corte_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<!-- Progress -->
|
||||
|
||||
@ -119,6 +119,8 @@ class OrdenTrabajo {
|
||||
|
||||
this.entradaManipulado = new DatePicker(this.otForm.find("#ot-manipulado"), option)
|
||||
this.prepGuillotina = new DatePicker(this.otForm.find("#ot-prep-guillotina"), option)
|
||||
this.prepInteriorGuillotina = new DatePicker(this.otForm.find("#ot-prep-interior-guillotina"), option)
|
||||
|
||||
|
||||
|
||||
this.prepCosido = new DatePicker(this.otForm.find("#ot-prep-cosido"), option)
|
||||
@ -527,7 +529,8 @@ class OrdenTrabajo {
|
||||
this.encuadernacion.setDate(this.summaryData.dates.encuadernacion_at)
|
||||
|
||||
this.prepGuillotina.setDate(this.summaryData.dates.corte_at)
|
||||
|
||||
this.prepInteriorGuillotina.setDate(this.summaryData.dates.preparacion_interiores_at)
|
||||
|
||||
this.entradaManipulado.setDate(this.summaryData.dates.entrada_manipulado_at)
|
||||
|
||||
// this.prepCosido.setDate(this.summaryData.dates.cosido_at)
|
||||
|
||||
Reference in New Issue
Block a user