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
7514bdf4
Commit
7514bdf4
authored
Aug 09, 2021
by
Manggar Mahardhika
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fix + history bangunan
parent
1fcdd69e
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
278 additions
and
141 deletions
+278
-141
API/views.py
API/views.py
+40
-2
Application/urls.py
Application/urls.py
+1
-0
Application/views.py
Application/views.py
+54
-0
templates/includes/css-o.html
templates/includes/css-o.html
+8
-0
templates/includes/js-m.html
templates/includes/js-m.html
+167
-139
templates/includes/js-o.html
templates/includes/js-o.html
+8
-0
No files found.
API/views.py
View file @
7514bdf4
...
...
@@ -7,7 +7,6 @@ from django.core.files.storage import FileSystemStorage
from
django.core.files.base
import
ContentFile
,
File
import
base64
import
json
from
PIL
import
Image
from
django.contrib.auth.decorators
import
login_required
,
user_passes_test
from
django.utils.decorators
import
method_decorator
...
...
@@ -82,7 +81,46 @@ def building(request):
# kulon lor, wetan lor, wetan kidul, kulon kidul, kulon lor
with
conn
.
cursor
()
as
buldings
:
buldings
.
execute
(
"SELECT json_build_object('type', 'Feature', 'properties', (id, name, information), 'administrasi',(address_1, address_2, address_3, provinsi, alamat, luas_bangunan, luas_tanah, tinggi_bangunan, gambar, pemilik, db_tipe, remark, point_id, point_name), 'geometry', ST_AsGeoJSON(geom :: geometry) :: json) FROM geo_bangunan WHERE st_intersects(geom,'SRID=0;POLYGON((
%
s
%
s,
%
s
%
s,
%
s
%
s,
%
s
%
s,
%
s
%
s))')"
%
(
kulon
,
lor
,
wetan
,
lor
,
wetan
,
kidul
,
kulon
,
kidul
,
kulon
,
lor
))
buldings
.
execute
(
"""SELECT
json_build_object (
'type',
'Feature',
'properties',
( gb.ID, gb.NAME, gb.information,
(
SELECT ARRAY_AGG
( '' || ID || ',' || tgl_perbaikan || ',' || jenis_perbaikan || '' ORDER BY tgl_perbaikan DESC )
FROM
tbl_perbaikan
WHERE
id_object = gb.ID
AND type_id = 1
)
),
'administrasi',
(
gb.address_1,
gb.address_2,
gb.address_3,
gb.provinsi,
gb.alamat,
gb.luas_bangunan,
gb.luas_tanah,
gb.tinggi_bangunan,
gb.gambar,
gb.pemilik,
gb.db_tipe,
gb.remark,
gb.point_id,
gb.point_name
),
'geometry',
ST_AsGeoJSON ( gb.geom :: geometry ) :: json
)
FROM
geo_bangunan gb
WHERE
st_intersects ( gb.geom, 'SRID=0;POLYGON((
%
s
%
s,
%
s
%
s,
%
s
%
s,
%
s
%
s,
%
s
%
s))' )"""
%
(
kulon
,
lor
,
wetan
,
lor
,
wetan
,
kidul
,
kulon
,
kidul
,
kulon
,
lor
))
prov_res
=
buldings
.
fetchall
()
polbang
=
[]
...
...
Application/urls.py
View file @
7514bdf4
...
...
@@ -20,5 +20,6 @@ urlpatterns = [
path
(
'get-jalan-perbaikan'
,
views
.
getjalanperbaikan
,
name
=
'get-jalan-perbaikan'
),
path
(
'get-detail-perbaikan'
,
views
.
getdetailperbaikan
,
name
=
'get-detail-perbaikan'
),
path
(
'get-detail-perbaikan-bang'
,
views
.
getdetailperbaikanbangunan
,
name
=
'get-detail-perbaikan-bang'
),
]
\ No newline at end of file
Application/views.py
View file @
7514bdf4
...
...
@@ -1042,6 +1042,60 @@ def getdetailperbaikan(request):
respon
=
res_all
return
Response
(
respon
)
@
api_view
((
'GET'
,))
def
getdetailperbaikanbangunan
(
request
):
id_object
=
request
.
GET
.
get
(
'id'
)
with
conn
.
cursor
()
as
data_per
:
data_per
.
execute
(
"""
SELECT
gl.NAME,
tp.name,
gj.remark,
tp.tgl_pembuatan,
tp.tgl_perbaikan,
tp.tgl_selesai,
tp.anggaran,
tp.pj,
tp.pj_lapangan,
tp.kontraktor,
ST_AsGeoJSON ( tp.geom :: geometry ) :: json,
tp.id_object,
tp.id,
tp.proposal,
tp.bukti_selesai,
tp.jenis_perbaikan
FROM
tbl_perbaikan tp
JOIN geo_label gl ON gl.ID = tp.type_id
JOIN geo_bangunan gj ON gj.ID = tp.id_object
where tp.id_object =
%
s
order by tp.tgl_perbaikan desc"""
%
id_object
)
res_perbaikan
=
data_per
.
fetchall
()
res_all
=
[]
for
j
in
res_perbaikan
:
data_all
=
{
'name'
:
j
[
1
],
'type'
:
j
[
2
],
'tgl_pembuatan'
:
j
[
3
],
'tgl_perbaikan'
:
j
[
4
],
'tgl_selesai'
:
j
[
5
],
'anggaran'
:
j
[
6
],
'pj'
:
j
[
7
],
'pj_lapangan'
:
j
[
8
],
'kontraktor'
:
j
[
9
],
'geometry'
:
j
[
10
],
'id_object'
:
j
[
11
],
'id'
:
j
[
12
],
'proposal'
:
j
[
13
],
'bukti_selesai'
:
j
[
14
],
'jenis_perbaikan'
:
j
[
15
]
}
res_all
.
append
(
data_all
)
respon
=
res_all
return
Response
(
respon
)
@
api_view
((
'GET'
,))
def
editkelurahan
(
request
):
kode_dagri
=
request
.
GET
.
get
(
'kode_dagri'
)
...
...
templates/includes/css-o.html
View file @
7514bdf4
...
...
@@ -223,6 +223,14 @@
display
:
none
;
}
#btn_detail_per_bang
{
display
:
none
;
}
#btn_perbaikan_bangunan
{
display
:
none
;
}
.leaflet-popup
{
display
:
none
;
}
...
...
templates/includes/js-m.html
View file @
7514bdf4
This diff is collapsed.
Click to expand it.
templates/includes/js-o.html
View file @
7514bdf4
...
...
@@ -47,6 +47,14 @@
.leaflet-popup
{
display
:
block
;
}
#btn_detail_per_bang
{
display
:
block
;
}
#btn_perbaikan_bangunan
{
display
:
block
;
}
</style>
{% elif group.name == 'Dinas Kependudukan dan Pencatatan Sipil' %}
<style>
...
...
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