Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
sistema_mcid
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
marcio neto
sistema_mcid
Commits
e60d6e63
Commit
e60d6e63
authored
Jan 10, 2024
by
sandroresende
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
melhorias na alteracao e exclusao do encaminhamento
parent
8813ca0e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
2 deletions
+39
-2
EncaminhamentoController.php
app/Http/Controllers/Mod_codem/EncaminhamentoController.php
+39
-2
No files found.
app/Http/Controllers/Mod_codem/EncaminhamentoController.php
View file @
e60d6e63
...
...
@@ -24,8 +24,7 @@ use Illuminate\Support\Facades\Session;
use
Illuminate\Support\Facades\Mail
;
use
App\Mail\Mod_codem\RespostaEncaminhamento
;
use
App\Mod_codem\RlcSituacaoDemanda
;
class
EncaminhamentoController
extends
Controller
{
...
...
@@ -77,6 +76,21 @@ class EncaminhamentoController extends Controller
if
(
$salvoSucesso
)
{
DB
::
commit
();
$demanda
=
Demanda
::
find
(
$demandaID
);
if
(
$demanda
->
situacao_id
!=
5
)
{
$demanda
->
situacao_id
=
5
;
$demanda
->
update
();
$situacaoDemanda
=
new
RlcSituacaoDemanda
();
$situacaoDemanda
->
demanda_id
=
$demanda
->
id
;
$situacaoDemanda
->
situacao_demanda_id
=
5
;
$situacaoDemanda
->
dte_situacao
=
date
(
"Y-m-d"
);
$situacaoDemanda
->
user_id
=
Auth
::
user
()
->
id
;
$situacaoDemanda
->
save
();
}
$ativarAba
=
'encaminhamento'
;
$usuarioDemandado
=
User
::
find
(
$request
->
usuario
);
...
...
@@ -113,6 +127,29 @@ class EncaminhamentoController extends Controller
if
(
$encaminhamentoDeletado
)
{
$encaminhamentos
=
Encaminhamento
::
where
(
'demanda_id'
,
$demandaId
)
->
get
();
if
(
count
(
$encaminhamentos
)
==
0
)
{
$demanda
=
Demanda
::
find
(
$demandaId
);
$demanda
->
situacao_id
=
2
;
$demanda
->
update
();
$where
=
[];
$where
[]
=
[
'situacao_id'
,
5
];
$where
[]
=
[
'demanda_id'
,
$demandaId
];
$situacaoDemanda
=
RlcSituacaoDemanda
::
where
(
$where
)
->
first
();
$situacaoDemanda
->
delete
();
$novaSituacaoDemanda
=
new
RlcSituacaoDemanda
();
$novaSituacaoDemanda
->
demanda_id
=
$demanda
->
id
;
$novaSituacaoDemanda
->
situacao_demanda_id
=
5
;
$novaSituacaoDemanda
->
dte_situacao
=
date
(
"Y-m-d"
);
$novaSituacaoDemanda
->
user_id
=
Auth
::
user
()
->
id
;
$novaSituacaoDemanda
->
save
();
}
DB
::
commit
();
flash
()
->
sucesso
(
"Sucesso"
,
"Encaminhamento excluído com sucesso!"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment