mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
add maquinas default corte
This commit is contained in:
@ -27,16 +27,37 @@ class DefaultConfigVariablesSeeder extends Seeder
|
|||||||
"name" => "maquina_guillotina_id_default",
|
"name" => "maquina_guillotina_id_default",
|
||||||
"value" => 20,
|
"value" => 20,
|
||||||
"description" => "ID de máquina que se asigna a tareas de corte tras impresión"
|
"description" => "ID de máquina que se asigna a tareas de corte tras impresión"
|
||||||
]
|
],
|
||||||
|
[
|
||||||
|
"name" => "maquina_guillotina_prep_id_default",
|
||||||
|
"value" => 31,
|
||||||
|
"description" => "ID de máquina que se asigna a tareas de corte tras impresión"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"name" => "maquina_tecnau_id",
|
||||||
|
"value" => 54,
|
||||||
|
"description" => "ID de máquina que se asigna a tareas de corte TECNAU"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"name" => "maquina_hunkeler_id",
|
||||||
|
"value" => 151,
|
||||||
|
"description" => "ID de máquina que se asigna a tareas de corte HUNKELER"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"name" => "maquina_trimming_id",
|
||||||
|
"value" => 149,
|
||||||
|
"description" => "ID de máquina que se asigna a tareas de corte HUNKELER"
|
||||||
|
],
|
||||||
|
|
||||||
];
|
];
|
||||||
public function run()
|
public function run()
|
||||||
{
|
{
|
||||||
|
|
||||||
$variableModel = model(ConfigVariableModel::class);
|
$variableModel = model(ConfigVariableModel::class);
|
||||||
foreach ($this->data as $row) {
|
foreach ($this->data as $row) {
|
||||||
if($variableModel->where("name",$row["name"])->first() == null){
|
if ($variableModel->where("name", $row["name"])->first() == null) {
|
||||||
$variableModel->insert($row);
|
$variableModel->insert($row);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -85,6 +85,11 @@ class ProductionService extends BaseService
|
|||||||
*/
|
*/
|
||||||
public string $statusColor;
|
public string $statusColor;
|
||||||
public int $guillotinaMaquinaId;
|
public int $guillotinaMaquinaId;
|
||||||
|
public int $hunkelerMaquinaId;
|
||||||
|
public int $tecnauMaquinaId;
|
||||||
|
public int $trimmingMaquinaId;
|
||||||
|
public int $guillotinaPreparacionInteriorMaquinaId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Valor límite del POD
|
* Valor límite del POD
|
||||||
*
|
*
|
||||||
@ -214,6 +219,11 @@ class ProductionService extends BaseService
|
|||||||
$this->configVariableModel = model(ConfigVariableModel::class);
|
$this->configVariableModel = model(ConfigVariableModel::class);
|
||||||
$this->podValue = $this->configVariableModel->getVariable('POD')->value;
|
$this->podValue = $this->configVariableModel->getVariable('POD')->value;
|
||||||
$this->guillotinaMaquinaId = $this->configVariableModel->getVariable('maquina_guillotina_id_default')->value;
|
$this->guillotinaMaquinaId = $this->configVariableModel->getVariable('maquina_guillotina_id_default')->value;
|
||||||
|
$this->hunkelerMaquinaId = $this->configVariableModel->getVariable('maquina_hunkeler_id')->value;
|
||||||
|
$this->tecnauMaquinaId = $this->configVariableModel->getVariable('maquina_tecnau_id')->value;
|
||||||
|
$this->trimmingMaquinaId = $this->configVariableModel->getVariable('maquina_trimming_id')->value;
|
||||||
|
$this->guillotinaPreparacionInteriorMaquinaId = $this->configVariableModel->getVariable('maquina_guillotina_prep_id_default')->value;
|
||||||
|
|
||||||
$this->OT_TAREA_STATUS_TITLE = [
|
$this->OT_TAREA_STATUS_TITLE = [
|
||||||
"P" => lang('Produccion.tarea_estados.P'),
|
"P" => lang('Produccion.tarea_estados.P'),
|
||||||
"F" => lang('Produccion.tarea_estados.F'),
|
"F" => lang('Produccion.tarea_estados.F'),
|
||||||
@ -424,14 +434,14 @@ class ProductionService extends BaseService
|
|||||||
*/
|
*/
|
||||||
protected function storeTareaCorteFinal(): ?OrdenTrabajoTareaEntity
|
protected function storeTareaCorteFinal(): ?OrdenTrabajoTareaEntity
|
||||||
{
|
{
|
||||||
|
$maquina_id = $this->presupuesto->solapas == 1 ? $this->trimmingMaquinaId : $this->defaultMaquinaCorte->id;
|
||||||
$presupuestoLineaImpresion = $this->presupuesto->presupuestoLineaImpresion();
|
$presupuestoLineaImpresion = $this->presupuesto->presupuestoLineaImpresion();
|
||||||
$data = [
|
$data = [
|
||||||
'orden_trabajo_id' => $this->ot->id,
|
'orden_trabajo_id' => $this->ot->id,
|
||||||
'presupuesto_linea_id' => $presupuestoLineaImpresion->id,
|
'presupuesto_linea_id' => $presupuestoLineaImpresion->id,
|
||||||
'nombre' => lang('Produccion.end_cut'),
|
'nombre' => lang('Produccion.end_cut'),
|
||||||
'maquina_id' => $this->defaultMaquinaCorte->id,
|
'maquina_id' => $maquina_id,
|
||||||
'orden' => $this->defaultMaquinaCorte->orden_planning,
|
'orden' => $this->maquinaModel->find($maquina_id)->orden_planning,
|
||||||
'tiempo_estimado' => 0,
|
'tiempo_estimado' => 0,
|
||||||
'tiempo_real' => 0,
|
'tiempo_real' => 0,
|
||||||
'is_corte' => true,
|
'is_corte' => true,
|
||||||
@ -457,8 +467,8 @@ class ProductionService extends BaseService
|
|||||||
'orden_trabajo_id' => $this->ot->id,
|
'orden_trabajo_id' => $this->ot->id,
|
||||||
'presupuesto_linea_id' => $pLinea->id,
|
'presupuesto_linea_id' => $pLinea->id,
|
||||||
'nombre' => 'Corte',
|
'nombre' => 'Corte',
|
||||||
'maquina_id' => $this->guillotinaMaquinaId,
|
'maquina_id' => $this->guillotinaPreparacionInteriorMaquinaId,
|
||||||
'orden' => $pLinea->maquina()->orden_planning + 1,
|
'orden' => $this->maquinaModel->find($this->guillotinaPreparacionInteriorMaquinaId)->orden_planning,
|
||||||
'tiempo_estimado' => $pLinea->rotativa_tiempo_corte * 60,
|
'tiempo_estimado' => $pLinea->rotativa_tiempo_corte * 60,
|
||||||
'tiempo_real' => 0,
|
'tiempo_real' => 0,
|
||||||
'is_corte' => true,
|
'is_corte' => true,
|
||||||
@ -493,13 +503,14 @@ class ProductionService extends BaseService
|
|||||||
{
|
{
|
||||||
$otCorte = null;
|
$otCorte = null;
|
||||||
$name = $this->cosido() ? lang('Produccion.hunkeler') : lang('Produccion.tecnau');
|
$name = $this->cosido() ? lang('Produccion.hunkeler') : lang('Produccion.tecnau');
|
||||||
|
$maquina_id = $this->cosido() ? $this->hunkelerMaquinaId : $this->tecnauMaquinaId;
|
||||||
if ($pLinea->isRotativa()) {
|
if ($pLinea->isRotativa()) {
|
||||||
$tareaId = $this->otTarea->insert([
|
$tareaId = $this->otTarea->insert([
|
||||||
'orden_trabajo_id' => $this->ot->id,
|
'orden_trabajo_id' => $this->ot->id,
|
||||||
'presupuesto_linea_id' => $pLinea->id,
|
'presupuesto_linea_id' => $pLinea->id,
|
||||||
'nombre' => $name,
|
'nombre' => $name,
|
||||||
'maquina_id' => $this->defaultMaquinaCorte->id,
|
'maquina_id' => $maquina_id,
|
||||||
'orden' => $pLinea->maquina()->orden_planning + 1,
|
'orden' => $this->maquinaModel->find($maquina_id)->orden_planning,
|
||||||
'tiempo_estimado' => $pLinea->rotativa_tiempo_corte * 60,
|
'tiempo_estimado' => $pLinea->rotativa_tiempo_corte * 60,
|
||||||
'tiempo_real' => 0,
|
'tiempo_real' => 0,
|
||||||
'is_corte' => true,
|
'is_corte' => true,
|
||||||
|
|||||||
Reference in New Issue
Block a user