Commit 893487ac authored by Manggar Mahardhika's avatar Manggar Mahardhika

bugfix

parent 46257a7c
...@@ -81,7 +81,9 @@ urlpatterns = [ ...@@ -81,7 +81,9 @@ urlpatterns = [
path('load_point_id', views.load_point_id), path('load_point_id', views.load_point_id),
path('edit_detail_poin', views.edit_detail_poin), path('edit_detail_poin', views.edit_detail_poin),
path('dpoint', views.dpoint, name='dpoint'), path('dpoint', views.dpoint, name='dpoint'),
path('reloadpoint', views.reload_point, name='reloadpoint'),
path('download_perbaikan_data', views.download_perbaikan_data), path('download_perbaikan_data', views.download_perbaikan_data),
path('search_list_perbaikan', views.search_list_perbaikan) path('search_list_perbaikan', views.search_list_perbaikan)
] ]
\ No newline at end of file
...@@ -3721,7 +3721,61 @@ def search_list_perbaikan(request): ...@@ -3721,7 +3721,61 @@ def search_list_perbaikan(request):
rn = 1 rn = 1
AND ( gl.NAME ILIKE'{}%' OR tp.NAME ILIKE'{}%' OR tp.TYPE ILIKE'{}%' OR tp.anggaran ILIKE'{}%' )""".format(v,v,v,v)) AND ( gl.NAME ILIKE'{}%' OR tp.NAME ILIKE'{}%' OR tp.TYPE ILIKE'{}%' OR tp.anggaran ILIKE'{}%' )""".format(v,v,v,v))
search_list = list_s.fetchall() search_list = list_s.fetchall()
return Response(search_list)
@api_view(('POST',))
def reload_point(request):
with conn.cursor() as kantor_administrasi:
kantor_administrasi.execute("""SELECT
json_build_object (
'type',
'Feature',
'administrasi',
(
A.namobj,
A.remark,
A.alamat,
A.luas_bangunan,
A.luas_tanah,
A.satuan_luas_bangunan,
A.satuan_luas_tanah,
A.gambar,
A.tinggi_bangunan,
A.perangkat,
A.tipe_gambar,
b.kabupaten,
c.kecamatan,
d.desa,
a.id,
(
SELECT ARRAY_AGG
( '' || ID || ',' || tgl_perbaikan || ',' || jenis_perbaikan || '' ORDER BY tgl_perbaikan DESC )
FROM
tbl_perbaikan
WHERE
id_object = A.ID
AND type_id = 1
)
),
'geometry',
ST_AsGeoJSON ( A.geom :: geometry ) :: json
)
FROM
geo_kantor_administrasi A
JOIN geo_prov_kab b ON st_intersects ( A.geom, b.geom )
JOIN geo_data_kecamatan c ON st_intersects(A.geom, c.geom)
join geo_data_kelurahan d on st_intersects(A.geom, d.geom)
WHERE a.is_deleted = 0""")
kantor_administrasi_res = kantor_administrasi.fetchall()
return Response(search_list) kantor_administrasi_result = []
for i in kantor_administrasi_res:
if i[0]['administrasi']['f16'] == None:
i[0]['administrasi']['f16'] = "None"
kantor_administrasi_result.append(i[0])
context = {
'kantor_administrasi':kantor_administrasi_result,
}
return (context)
\ No newline at end of file
...@@ -903,11 +903,24 @@ ...@@ -903,11 +903,24 @@
}, function() { }, function() {
$("#modal_adm").modal('hide'); $("#modal_adm").modal('hide');
$("#modal_detail_non_kelurahan").modal('hide') $("#modal_detail_non_kelurahan").modal('hide')
// markeradm.remove()
// location.reload(); // geo_po_adm.remove()
// valket()
location.reload();
// $.ajax({
// url: "{% url 'api:reloadpoint' %}",
// data: data,
// dataType: 'json',
// type: 'POST',
// processData: false,
// contentType: false,
// success: function(data) {
// let rel = data
// geo_json_po_adm(data);
// var checkBox = document.getElementById("knt_adm"); // var checkBox = document.getElementById("knt_adm");
// document.getElementById("knt_adm").checked = true;
// newe(markeradm, geo_po_adm, checkBox) // newe(markeradm, geo_po_adm, checkBox)
// }
// })
}) })
} else { } else {
swal({ swal({
...@@ -988,7 +1001,7 @@ ...@@ -988,7 +1001,7 @@
}, function() { }, function() {
$("#modald_adm").modal('hide'); $("#modald_adm").modal('hide');
$("#modal_detail_non_kelurahan").modal('hide') $("#modal_detail_non_kelurahan").modal('hide')
//location.reload(); location.reload();
}) })
} else { } else {
swal({ swal({
...@@ -1404,7 +1417,7 @@ ...@@ -1404,7 +1417,7 @@
$("#modal_adm").modal('hide'); $("#modal_adm").modal('hide');
$("#modal_detail_non_kelurahan").modal('hide') $("#modal_detail_non_kelurahan").modal('hide')
//location.reload(); location.reload();
}) })
} else { } else {
swal({ swal({
...@@ -1818,7 +1831,7 @@ ...@@ -1818,7 +1831,7 @@
}, function() { }, function() {
$("#modal_adm").modal("hide"); $("#modal_adm").modal("hide");
$("#modal_detail_non_kelurahan").modal('hide') $("#modal_detail_non_kelurahan").modal('hide')
//location.reload(); location.reload();
}) })
} else { } else {
swal({ swal({
...@@ -2217,7 +2230,7 @@ ...@@ -2217,7 +2230,7 @@
}, function() { }, function() {
$("#modal_adm").modal('hide'); $("#modal_adm").modal('hide');
$("#modal_detail_non_kelurahan").modal('hide') $("#modal_detail_non_kelurahan").modal('hide')
//location.reload(); location.reload();
}) })
} else { } else {
swal({ swal({
...@@ -2739,7 +2752,7 @@ ...@@ -2739,7 +2752,7 @@
}, function() { }, function() {
$("#modal_adm").modal('hide'); $("#modal_adm").modal('hide');
$("#modal_detail_non_kelurahan").modal('hide') $("#modal_detail_non_kelurahan").modal('hide')
//location.reload(); location.reload();
}) })
} else { } else {
swal({ swal({
...@@ -3227,7 +3240,7 @@ ...@@ -3227,7 +3240,7 @@
}, function() { }, function() {
$("#modal_adm").modal('hide'); $("#modal_adm").modal('hide');
$("#modal_detail_non_kelurahan").modal('hide') $("#modal_detail_non_kelurahan").modal('hide')
//location.reload(); location.reload();
}) })
} else { } else {
swal({ swal({
...@@ -3602,7 +3615,7 @@ ...@@ -3602,7 +3615,7 @@
}, function() { }, function() {
$("#modal_adm").modal('hide'); $("#modal_adm").modal('hide');
$("#modal_detail_non_kelurahan").modal('hide') $("#modal_detail_non_kelurahan").modal('hide')
//location.reload(); location.reload();
}) })
} else { } else {
swal({ swal({
...@@ -3997,7 +4010,7 @@ ...@@ -3997,7 +4010,7 @@
}, function() { }, function() {
$("#modal_adm").modal('hide'); $("#modal_adm").modal('hide');
$("#modal_detail_non_kelurahan").modal('hide') $("#modal_detail_non_kelurahan").modal('hide')
//location.reload(); location.reload();
}) })
} else { } else {
swal({ swal({
...@@ -4385,7 +4398,7 @@ ...@@ -4385,7 +4398,7 @@
}, function() { }, function() {
$("#modal_adm").modal('hide'); $("#modal_adm").modal('hide');
$("#modal_detail_non_kelurahan").modal('hide') $("#modal_detail_non_kelurahan").modal('hide')
//location.reload(); location.reload();
}) })
} else { } else {
swal({ swal({
...@@ -4774,7 +4787,7 @@ ...@@ -4774,7 +4787,7 @@
}, function() { }, function() {
$("#modal_adm").modal('hide'); $("#modal_adm").modal('hide');
$("#modal_detail_non_kelurahan").modal('hide') $("#modal_detail_non_kelurahan").modal('hide')
//location.reload(); location.reload();
}) })
} else { } else {
swal({ swal({
...@@ -5174,7 +5187,7 @@ ...@@ -5174,7 +5187,7 @@
}, function() { }, function() {
$("#modal_adm").modal('hide'); $("#modal_adm").modal('hide');
$("#modal_detail_non_kelurahan").modal('hide') $("#modal_detail_non_kelurahan").modal('hide')
//location.reload(); location.reload();
}) })
} else { } else {
swal({ swal({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment