Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OKU-GIS
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Muhamad
OKU-GIS
Commits
c3823ea7
Commit
c3823ea7
authored
3 years ago
by
Muhamad
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
manajemen perbaikan
parent
7d2550e5
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
290 additions
and
189 deletions
+290
-189
API/urls.py
API/urls.py
+2
-1
API/views.py
API/views.py
+39
-1
Application/views.py
Application/views.py
+34
-34
static/js/action.js
static/js/action.js
+0
-4
templates/includes/sidebar.html
templates/includes/sidebar.html
+215
-149
No files found.
API/urls.py
View file @
c3823ea7
...
...
@@ -98,6 +98,7 @@ urlpatterns = [
path
(
'reloadpoint'
,
views
.
reload_point
,
name
=
'reloadpoint'
),
path
(
'download_perbaikan_data'
,
views
.
download_perbaikan_data
),
path
(
'search_list_perbaikan'
,
views
.
search_list_perbaikan
)
path
(
'search_list_perbaikan'
,
views
.
search_list_perbaikan
),
path
(
'dataperbaikan'
,
views
.
data_perbaikan
),
]
\ No newline at end of file
This diff is collapsed.
Click to expand it.
API/views.py
View file @
c3823ea7
...
...
@@ -4322,4 +4322,42 @@ def reload_point(request):
'kantor_administrasi'
:
kantor_administrasi_result
,
}
return
(
context
)
\ No newline at end of file
@
api_view
((
'GET'
,))
def
data_perbaikan
(
request
):
with
conn
.
cursor
()
as
data_per
:
data_per
.
execute
(
"""
SELECT
gl.NAME,
tp.id_object,
tp.NAME,
tp.TYPE,
tp.tgl_perbaikan,
tp.anggaran,
tp.tgl_selesai,
gdl.desa,
gdc.kecamatan
FROM
( SELECT tbl_perbaikan.*, ROW_NUMBER ( ) OVER ( PARTITION BY id_object ORDER BY tgl_selesai DESC ) AS rn FROM tbl_perbaikan ) tp
JOIN geo_label gl ON gl.ID = tp.type_id
JOIN geo_data_kelurahan gdl on st_intersects(st_setsrid(gdl.geom, 4326), st_setsrid(tp.geom, 4326))
JOIN geo_data_kecamatan gdc ON st_intersects ( st_setsrid ( gdc.geom, 4326 ), st_setsrid ( tp.geom, 4326 ) )
"""
)
res_perbaikan
=
data_per
.
fetchall
()
res_all
=
[]
for
j
in
res_perbaikan
:
data_all
=
{
'name_perbaikan'
:
j
[
0
],
'id_object'
:
j
[
1
],
'name'
:
j
[
2
],
'type'
:
j
[
3
],
'tgl_perbaikan'
:
j
[
4
],
'anggaran'
:
j
[
5
],
'tgl_selesai'
:
j
[
6
],
'desa'
:
j
[
7
],
'kecamatan'
:
j
[
8
],
}
res_all
.
append
(
data_all
)
return
Response
(
res_all
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Application/views.py
View file @
c3823ea7
...
...
@@ -467,40 +467,40 @@ class Dashboard(generic.TemplateView):
# for i in gardu_listrik_res:
# gardu_listrik_result.append(i[0])
with
conn
.
cursor
()
as
data_per
:
data_per
.
execute
(
"""
SELECT
gl.NAME,
tp.id_object,
tp.NAME,
tp.TYPE,
tp.tgl_perbaikan,
tp.anggaran,
tp.tgl_selesai,
gdl.desa,
gdc.kecamatan
FROM
( SELECT tbl_perbaikan.*, ROW_NUMBER ( ) OVER ( PARTITION BY id_object ORDER BY tgl_selesai DESC ) AS rn FROM tbl_perbaikan ) tp
JOIN geo_label gl ON gl.ID = tp.type_id
JOIN geo_data_kelurahan gdl on st_intersects(st_setsrid(gdl.geom, 4326), st_setsrid(tp.geom, 4326))
JOIN geo_data_kecamatan gdc ON st_intersects ( st_setsrid ( gdc.geom, 4326 ), st_setsrid ( tp.geom, 4326 ) )
"""
)
res_perbaikan
=
data_per
.
fetchall
()
#
with conn.cursor() as data_per:
#
data_per.execute("""
#
SELECT
#
gl.NAME,
#
tp.id_object,
#
tp.NAME,
#
tp.TYPE,
#
tp.tgl_perbaikan,
#
tp.anggaran,
#
tp.tgl_selesai,
#
gdl.desa,
#
gdc.kecamatan
#
FROM
#
( SELECT tbl_perbaikan.*, ROW_NUMBER ( ) OVER ( PARTITION BY id_object ORDER BY tgl_selesai DESC ) AS rn FROM tbl_perbaikan ) tp
#
JOIN geo_label gl ON gl.ID = tp.type_id
#
JOIN geo_data_kelurahan gdl on st_intersects(st_setsrid(gdl.geom, 4326), st_setsrid(tp.geom, 4326))
#
JOIN geo_data_kecamatan gdc ON st_intersects ( st_setsrid ( gdc.geom, 4326 ), st_setsrid ( tp.geom, 4326 ) )
#
""")
#
res_perbaikan = data_per.fetchall()
res_all
=
[]
for
j
in
res_perbaikan
:
data_all
=
{
'name_perbaikan'
:
j
[
0
],
'id_object'
:
j
[
1
],
'name'
:
j
[
2
],
'type'
:
j
[
3
],
'tgl_perbaikan'
:
j
[
4
],
'anggaran'
:
j
[
5
],
'tgl_selesai'
:
j
[
6
],
'desa'
:
j
[
7
],
'kecamatan'
:
j
[
8
],
}
res_all
.
append
(
data_all
)
#
res_all = []
#
for j in res_perbaikan:
#
data_all = {
#
'name_perbaikan':j[0],
#
'id_object':j[1],
#
'name':j[2],
#
'type':j[3],
#
'tgl_perbaikan':j[4],
#
'anggaran':j[5],
#
'tgl_selesai':j[6],
#
'desa':j[7],
#
'kecamatan':j[8],
#
}
#
res_all.append(data_all)
perm_group
=
[]
if
request
.
user
.
is_authenticated
:
...
...
@@ -620,7 +620,7 @@ class Dashboard(generic.TemplateView):
# 'cagar_budaya':cagar_budaya_result,
# 'gardu_listrik':gardu_listrik_result,
'global'
:
all
[
0
],
'res_all'
:
res_all
,
#
'res_all':res_all,
'thisUser'
:
user_data
,
'perm_group'
:
perm_group
# 'user_res':user_res
...
...
This diff is collapsed.
Click to expand it.
static/js/action.js
View file @
c3823ea7
...
...
@@ -1764,9 +1764,5 @@ $(".send_pesan").click(function() {
document
.
querySelector
(
"
#map-create-all > div.leaflet-control-container > div.leaflet-bottom.leaflet-right > div
"
).
html
(
`Powered by <a href="https://khansia.co.id" target="_blank">Khansia</a> with <a href="https://leafletjs.com" target="_blank">Leaflet</a>`
)
document
.
querySelector
(
"
#map-create-all > div.leaflet-control-container > div.leaflet-bottom.leaflet-right > div
"
).
css
(
"
right
"
,
"
50px
"
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
templates/includes/sidebar.html
View file @
c3823ea7
This diff is collapsed.
Click to expand it.
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