feat: 발주기관 지도에서 해당 지역에 대한 MBR만 검색되도록 수정
parent
a4cbb83a59
commit
09ba6896af
15
list.txt
15
list.txt
|
|
@ -6,17 +6,6 @@ src\main\resources\egovframework\egovProps\globals.properties
|
|||
#src\main\webapp\com\css\common.v2.0.css.map
|
||||
src\main\webapp\WEB-INF\views\web\manage\list_reg.jsp
|
||||
|
||||
src\main\java\geoinfo\drilling\inquiry\DrillingInquiryController.java
|
||||
src\main\webapp\WEB-INF\views\drilling\inquiry\drilling_inquiry.jsp
|
||||
src\main\java\geoinfo\drilling\inquiry\service\impl\DrillingInquiryServiceImpl.java
|
||||
|
||||
src\main\java\geoinfo\drilling\input\service\DrillingInputService.java
|
||||
src\main\java\geoinfo\drilling\input\service\impl\DrillingInputServiceImpl.java
|
||||
src\main\resources\egovframework\sqlmap\mapper\drilling\input\DrillingInputMapper.xml
|
||||
src\main\java\geoinfo\drilling\input\service\DrillingInputMapper.java
|
||||
|
||||
src\main\webapp\WEB-INF\views\web\index.jsp
|
||||
src\main\java\geoinfo\regi\projectList\ProjectListController.java
|
||||
src\main\java\geoinfo\regi\manageList\ManageListController.java
|
||||
src\main\webapp\js\map\main\map.js
|
||||
src\main\webapp\WEB-INF\views\drilling\common\includeTopMenu.jsp
|
||||
src\main\webapp\WEB-INF\views\map\left\mapLeft.jsp
|
||||
src\main\webapp\js\map\main\map.js
|
||||
|
|
@ -10,11 +10,13 @@ import javax.servlet.http.HttpServletResponse;
|
|||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import geoinfo.drilling.inquiry.service.DrillingInquiryService;
|
||||
import geoinfo.main.login.service.LoginService;
|
||||
|
||||
@Controller
|
||||
|
|
@ -25,6 +27,8 @@ public class DrillingCommonController {
|
|||
@Resource(name = "loginService")
|
||||
private LoginService loginService;
|
||||
|
||||
@Autowired
|
||||
DrillingInquiryService drillingInquiryService;
|
||||
|
||||
@RequestMapping(value = "/drilling/common/includeTopMenu.do")
|
||||
public String memberRegi(@RequestParam HashMap<String, Object> params, ModelMap model, HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
|
|
@ -45,6 +49,10 @@ public class DrillingCommonController {
|
|||
|
||||
model.put("masterCompanyCode", result.get("master_company_code"));
|
||||
|
||||
|
||||
HashMap<String, Object> spGetProjectMbrParams = drillingInquiryService.spGetProjectMbr( request, params, String.valueOf(request.getSession().getAttribute("USERID")) );
|
||||
model.addAttribute("mbr", spGetProjectMbrParams);
|
||||
|
||||
return "/drilling/common/includeTopMenu";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -85,8 +85,6 @@ public class DrillingHomeController {
|
|||
model.addAttribute("cls", cls);
|
||||
|
||||
try {
|
||||
HashMap<String, Object> spGetProjectMbrParams = drillingInquiryService.spGetProjectMbr( request, params, userId );
|
||||
model.addAttribute("mbr", spGetProjectMbrParams);
|
||||
|
||||
if(request.getSession().getAttribute("USERNAME") == null){
|
||||
return "isError";
|
||||
|
|
@ -120,10 +118,39 @@ public class DrillingHomeController {
|
|||
}
|
||||
|
||||
// 지도에서 발주기관 소속 시추공 표시
|
||||
@RequestMapping(value = "/drilling/map/searchHole.do", method = RequestMethod.GET)
|
||||
public String drillingMapSearchHole(String projectCode, ModelMap model) throws Exception {
|
||||
@RequestMapping(value = "/drilling/map/search-hole.do", method = RequestMethod.GET)
|
||||
public String drillingMapSearchHole(HttpServletRequest request, String projectCode, ModelMap model) throws Exception {
|
||||
model.put("data", drillingHomeService.drillingMapSearchHole(projectCode));
|
||||
System.out.println("jsonView log 확인");
|
||||
|
||||
HashMap<String, Object> params = new HashMap<String, Object>();
|
||||
HashMap<String, Object> spGetProjectMbrParams = drillingInquiryService.spGetProjectMbr( request, params, String.valueOf(request.getSession().getAttribute("USERID")) );
|
||||
model.addAttribute("mbr", spGetProjectMbrParams);
|
||||
|
||||
return "jsonView";
|
||||
}
|
||||
|
||||
// MBR을 이용해 지도에서 발주기관 소속 시추공 표시
|
||||
@RequestMapping(value = "/drilling/map/search-hole-with-mbr.do", method = RequestMethod.GET)
|
||||
public String drillingMapSearchHoleWithMbr(HttpServletRequest request, String companyCode, ModelMap model) throws Exception {
|
||||
|
||||
|
||||
HashMap<String, Object> params = new HashMap<String, Object>();
|
||||
params.put("COM_CODE", companyCode);
|
||||
|
||||
EgovMap mbr = drillingInquiryService.getTblMasterCompanyMbrByComCode(request, params, String.valueOf(request.getSession().getAttribute("USERID")));
|
||||
model.addAttribute("mbr", mbr);
|
||||
|
||||
double nOffsetKm = 2.0f; // 2Km 밖 까지 허용한다.
|
||||
params.put("MIN_X", MyUtil.getDoubleFromObject( mbr.get("minX") ) - nOffsetKm*1000);
|
||||
params.put("MIN_Y", MyUtil.getDoubleFromObject( mbr.get("minY") ) - nOffsetKm*1000);
|
||||
params.put("MAX_X", MyUtil.getDoubleFromObject( mbr.get("maxX") ) + nOffsetKm*1000);
|
||||
params.put("MAX_Y", MyUtil.getDoubleFromObject( mbr.get("maxY") ) + nOffsetKm*1000);
|
||||
|
||||
model.put("data", drillingHomeService.drillingMapSearchHoleWithMbr(params));
|
||||
|
||||
return "jsonView";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,8 @@ import egovframework.rte.psl.dataaccess.util.EgovMap;
|
|||
|
||||
@Mapper("drillingHomeMapper")
|
||||
public interface DrillingHomeMapper {
|
||||
List<EgovMap> drillingMapSearchHole(String projectCode);
|
||||
List<EgovMap> drillingMapSearchHole(String comCode);
|
||||
List<EgovMap> drillingMapSearchHoleWithMbr(HashMap<String, Object> params);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -2,15 +2,11 @@ package geoinfo.drilling.home.service;
|
|||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.json.simple.JSONObject;
|
||||
|
||||
import egovframework.rte.psl.dataaccess.util.EgovMap;
|
||||
|
||||
|
||||
public interface DrillingHomeService {
|
||||
public List<EgovMap> drillingMapSearchHole(String projectCode);
|
||||
public List<EgovMap> drillingMapSearchHoleWithMbr(HashMap<String, Object> params);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,6 +37,11 @@ public class DrillingHomeServiceImpl implements DrillingHomeService {
|
|||
public List<EgovMap> drillingMapSearchHole(String projectCode) {
|
||||
return drillingHomeMapper.drillingMapSearchHole(projectCode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EgovMap> drillingMapSearchHoleWithMbr(HashMap<String, Object> params) {
|
||||
return drillingHomeMapper.drillingMapSearchHoleWithMbr(params);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -146,7 +146,6 @@ public class DrillingInputServiceImpl implements DrillingInputService {
|
|||
updateProjectCodeParams.put("PROJECT_CODE", params.get("PROJECT_CODE"));
|
||||
updateProjectCodeParams.put("PROJECT_STATE_CODE", params.get("PROJECT_STATE_CODE"));
|
||||
updateProjectCodeParams.put("CID", params.get("CID"));
|
||||
|
||||
|
||||
int nResult = drillingInputMapper.updateProjectCodeAndProjectStateCodeByCid(updateProjectCodeParams);
|
||||
if( nResult == 0 ) {
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ public interface DrillingInquiryMapper {
|
|||
public String spGetProjectMbr(HashMap<String, Object> params) throws SQLException;
|
||||
public List<EgovMap> drillingInquiryAutocompleteList(HashMap<String, Object> params) throws SQLException;
|
||||
public EgovMap getItemByProjectCode(HashMap<String, Object> params) throws SQLException;
|
||||
public EgovMap getTblMasterCompanyMbrByComCode(HashMap<String, Object> params) throws SQLException;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,5 +16,7 @@ public interface DrillingInquiryService {
|
|||
HashMap<String, Object> spGetProjectMbr(HttpServletRequest request, HashMap<String, Object> params, String userId) throws Exception;
|
||||
List<EgovMap> drillingInquiryAutocompleteList(HttpServletRequest request, HashMap<String, Object> params) throws Exception;
|
||||
EgovMap getItemByProjectCode(HttpServletRequest request, HashMap<String, Object> params) throws Exception;
|
||||
|
||||
EgovMap getTblMasterCompanyMbrByComCode(HttpServletRequest request, HashMap<String, Object> params, String userId) throws Exception;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -327,6 +327,37 @@ public class DrillingInquiryServiceImpl implements DrillingInquiryService {
|
|||
throw new Exception( "오류가 발생하였습니다." + "\n" + "SQLException" );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public EgovMap getTblMasterCompanyMbrByComCode(HttpServletRequest request,
|
||||
HashMap<String, Object> params, String userId) throws Exception {
|
||||
|
||||
// TODO Auto-generated method stub
|
||||
if( userId == null || userId.trim().isEmpty() ) {
|
||||
throw new Exception( "로그인이 필요한 서비스입니다." );
|
||||
}
|
||||
|
||||
|
||||
HashMap<String, Object> getTblMasterCompanyMbrByComCodeParams = new HashMap<String, Object>();
|
||||
getTblMasterCompanyMbrByComCodeParams.put("COM_CODE", params.get("COM_CODE"));
|
||||
|
||||
try {
|
||||
EgovMap item = drillingInquiryMapper.getTblMasterCompanyMbrByComCode( getTblMasterCompanyMbrByComCodeParams );
|
||||
return item;
|
||||
} catch (SQLException e) {
|
||||
String strTxt =
|
||||
"---------- BUG REPORTING START ----------" + "\n" +
|
||||
"에러 문구:[" + request.getRequestURI() + " " + "]" + "\n" +
|
||||
"params:[\n" + params.toString() + "\n]\n" +
|
||||
"e.getMessage():[\n" + e.getMessage() + "\n]\n" + "\n" +
|
||||
"new Date().toString():[" + new Date().toString() + "]\n" + "\n" +
|
||||
"---------- BUG REPORTING END ----------" + "\n" +
|
||||
"";
|
||||
System.out.println(strTxt);
|
||||
throw new Exception( "오류가 발생하였습니다." + "\n" + "SQLException" );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,8 +25,45 @@
|
|||
FROM
|
||||
TBL_MASTER_COMPANY tmc
|
||||
WHERE
|
||||
tmc.COM_CODE IN (TRIM(#{value}))
|
||||
tmc.COM_CODE IN (TRIM(#{COM_CODE}))
|
||||
)
|
||||
)
|
||||
</select>
|
||||
|
||||
|
||||
<select id="drillingMapSearchHoleWithMbr" parameterType="String" resultMap="holeLocationResultMap">
|
||||
<![CDATA[
|
||||
|
||||
SELECT
|
||||
HOLE.GID,
|
||||
HOLE.HOLE_CODE AS CODE,
|
||||
HOLE.THE_GEOM.GET_WKT() AS WKT
|
||||
FROM
|
||||
TBL_HEADER_HOLE HOLE
|
||||
WHERE
|
||||
HOLE.PROJECT_CODE IN (
|
||||
SELECT
|
||||
tpi.PROJECT_CODE
|
||||
FROM
|
||||
TBL_PROJECT_INFO tpi
|
||||
WHERE
|
||||
tpi.PROJECT_MASTER_COMPANY_CODE IN
|
||||
(
|
||||
SELECT
|
||||
tmc.COM_CODE
|
||||
FROM
|
||||
TBL_MASTER_COMPANY tmc
|
||||
WHERE
|
||||
tmc.COM_CODE IN (
|
||||
TRIM(#{COM_CODE})
|
||||
)
|
||||
)
|
||||
) AND
|
||||
#{MIN_X} <= HOLE.HOLE_LOCATION_TM_X AND
|
||||
#{MIN_Y} <= HOLE.HOLE_LOCATION_TM_Y AND
|
||||
HOLE.HOLE_LOCATION_TM_X <= #{MAX_X} AND
|
||||
HOLE.HOLE_LOCATION_TM_Y <= #{MAX_Y}
|
||||
|
||||
]]>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -102,5 +102,13 @@
|
|||
]]>
|
||||
</select>
|
||||
|
||||
<select id="getTblMasterCompanyMbrByComCode" parameterType="map" resultType="egovMap">
|
||||
<![CDATA[
|
||||
SELECT * FROM TBL_MASTER_COMPANY WHERE TRIM(COM_CODE) = #{COM_CODE}
|
||||
]]>
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
@ -17,6 +17,10 @@
|
|||
<input type="hidden" id="gf-district" name="gf-district" value="" />
|
||||
<input type="hidden" id="last-team-name" name="last-team-name" value="" />
|
||||
<input type="hidden" id="master-company-code" name="master-company-code" value="<c:out value="${masterCompanyCode}"/>" />
|
||||
<input type="hidden" id="mbr-v-min-x" name="mbr-v-min-x" value="<c:out value="${mbr.v_min_x}"/>" />
|
||||
<input type="hidden" id="mbr-v-max-x" name="mbr-v-max-x" value="<c:out value="${mbr.v_max_x}"/>" />
|
||||
<input type="hidden" id="mbr-v-min-y" name="mbr-v-min-y" value="<c:out value="${mbr.v_min_y}"/>" />
|
||||
<input type="hidden" id="mbr-v-max-y" name="mbr-v-max-y" value="<c:out value="${mbr.v_max_y}"/>" />
|
||||
|
||||
|
||||
<!-- header -------------------------------------------->
|
||||
|
|
|
|||
|
|
@ -1287,6 +1287,8 @@ function table3display(){
|
|||
|
||||
// 트리메뉴
|
||||
$("#browser").treeview();
|
||||
// thkim
|
||||
console.log( 'thkim:' + getQueryString("masterCompanyCode") );
|
||||
autocomplete();
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -941,7 +941,7 @@ function initApp(param){
|
|||
//소속 기관
|
||||
selectOptionByText(gs, document.getElementById("cmb_sido_all"));
|
||||
const getGuList2Callback = function () {
|
||||
onSichAllCheck();
|
||||
//onSichAllCheck();
|
||||
const selectedXY = getMiddleXY(document.getElementById("cmb_sido_all").value);
|
||||
//BASE_MAP.zoomToExtent(new OpenLayers.Bounds(selectedXY.minX, selectedXY.minY, selectedXY.maxX, selectedXY.maxY).transform('EPSG:5186', 'EPSG:3857'), true);
|
||||
}
|
||||
|
|
@ -951,13 +951,13 @@ function initApp(param){
|
|||
selectOptionByText(gs, document.getElementById("cmb_sido_all"));
|
||||
const getGuList2Callback = function () {
|
||||
if( gf === null || gf.trim() === "" ) {
|
||||
onSichAllCheck();
|
||||
//onSichAllCheck();
|
||||
const selectedXY = getMiddleXY(document.getElementById("cmb_sido_all").value);
|
||||
//BASE_MAP.zoomToExtent(new OpenLayers.Bounds(selectedXY.minX, selectedXY.minY, selectedXY.maxX, selectedXY.maxY).transform('EPSG:5186', 'EPSG:3857'), true);
|
||||
} else {
|
||||
selectOptionByText(gf, document.getElementById("cmb_gungu_all"));
|
||||
onSichAllCheck();
|
||||
const selectedXY = getMiddleXY(document.getElementById("cmb_gungu_all").value);
|
||||
//const selectedXY = getMiddleXY(document.getElementById("cmb_gungu_all").value);
|
||||
//BASE_MAP.zoomToExtent(new OpenLayers.Bounds(selectedXY.minX, selectedXY.minY, selectedXY.maxX, selectedXY.maxY).transform('EPSG:5186', 'EPSG:3857'), true);
|
||||
}
|
||||
}
|
||||
|
|
@ -968,20 +968,20 @@ function initApp(param){
|
|||
selectOptionByText(gm, document.getElementById("cmb_sido_all"));
|
||||
const getGuList2Callback = function () {
|
||||
if( gs === null || gs.trim() === "" ) {
|
||||
onSichAllCheck();
|
||||
//onSichAllCheck();
|
||||
const selectedSidoXY = getMiddleXY(document.getElementById("cmb_sido_all").value);
|
||||
//BASE_MAP.zoomToExtent(new OpenLayers.Bounds(selectedSidoXY.minX, selectedSidoXY.minY, selectedSidoXY.maxX, selectedSidoXY.maxY).transform('EPSG:5186', 'EPSG:3857'), true);
|
||||
} else {
|
||||
selectOptionByText(gs, document.getElementById("cmb_gungu_all"));
|
||||
const getDongList2Callback = function () {
|
||||
if( gf === null || gf.trim() === "" ) {
|
||||
onSichAllCheck();
|
||||
//onSichAllCheck();
|
||||
const selectedGunguXY = getMiddleXY(document.getElementById("cmb_gungu_all").value);
|
||||
var move_bound = new OpenLayers.Bounds(selectedGunguXY.minX, selectedGunguXY.minY, selectedGunguXY.maxX, selectedGunguXY.maxY).transform('EPSG:5186', 'EPSG:3857'); //5174
|
||||
//BASE_MAP.zoomToExtent(move_bound, true);
|
||||
} else {
|
||||
selectOptionByText(gf, document.getElementById("cmb_dong_all"));
|
||||
onSichAllCheck();
|
||||
//onSichAllCheck();
|
||||
const selectedDongXY = getMiddleXY(document.getElementById("cmb_dong_all").value);
|
||||
//BASE_MAP.zoomToExtent(new OpenLayers.Bounds(selectedDongXY.minX, selectedDongXY.minY, selectedDongXY.maxX, selectedDongXY.maxY).transform('EPSG:5186', 'EPSG:3857'), true);
|
||||
}
|
||||
|
|
@ -1610,31 +1610,46 @@ function addDrillingHoles(companyCode) {
|
|||
maxy: -Infinity
|
||||
};
|
||||
console.log("addProjectHoles projectCode ::: " + companyCode);
|
||||
$.get("/drilling/map/searchHole.do", { projectCode : companyCode }).done(function(response) {
|
||||
$.get("/drilling/map/search-hole-with-mbr.do", { companyCode : companyCode }).done(function(response) {
|
||||
if(response && response.data) {
|
||||
var format = new OpenLayers.Format.WKT();
|
||||
var features = [];
|
||||
|
||||
var isResultBaseMbr = true;
|
||||
for(var i=0, len=response.data.length; i < len; i++) {
|
||||
var row = response.data[i];
|
||||
var feature = format.read(row.wkt);
|
||||
feature.attributes.CODE = row.code;
|
||||
|
||||
//feature.geometry.x의 최솟값 구한다.
|
||||
bbox.minx = Math.min(bbox.minx, feature.geometry.x);
|
||||
//feature.geometry.x의 최댓값 구한다.
|
||||
bbox.maxx = Math.max(bbox.maxx, feature.geometry.x);
|
||||
//feature.geometry.y의 최솟값 구한다.
|
||||
bbox.miny = Math.min(bbox.miny, feature.geometry.y);
|
||||
//feature.geometry.y의 최댓값 구한다.
|
||||
bbox.maxy = Math.max(bbox.maxy, feature.geometry.y);
|
||||
// 검색 결과를 기반으로 MBR 설정
|
||||
if( isResultBaseMbr ) {
|
||||
//feature.geometry.x의 최솟값 구한다.
|
||||
bbox.minx = Math.min(bbox.minx, feature.geometry.x);
|
||||
//feature.geometry.x의 최댓값 구한다.
|
||||
bbox.maxx = Math.max(bbox.maxx, feature.geometry.x);
|
||||
//feature.geometry.y의 최솟값 구한다.
|
||||
bbox.miny = Math.min(bbox.miny, feature.geometry.y);
|
||||
//feature.geometry.y의 최댓값 구한다.
|
||||
bbox.maxy = Math.max(bbox.maxy, feature.geometry.y);
|
||||
} else {
|
||||
// 계정에 영역에 맞는 MBR 설정
|
||||
bbox.minx = response.mbr.v_min_x;
|
||||
bbox.maxx = response.mbr.v_max_x;
|
||||
bbox.miny = response.mbr.v_min_y;
|
||||
bbox.maxy = response.mbr.v_max_y;
|
||||
}
|
||||
|
||||
|
||||
feature.geometry.transform('EPSG:5186', 'EPSG:3857');
|
||||
features.push(feature);
|
||||
}
|
||||
features.push(feature);
|
||||
}
|
||||
|
||||
if(features.length > 0) {
|
||||
moveToExtent(bbox.minx, bbox.miny, bbox.maxx, bbox.maxy);
|
||||
if( isResultBaseMbr ) {
|
||||
moveToExtent(bbox.minx, bbox.miny, bbox.maxx, bbox.maxy);
|
||||
} else {
|
||||
BASE_MAP.zoomToExtent(new OpenLayers.Bounds(bbox.minx, bbox.miny, bbox.maxx, bbox.maxy).transform('EPSG:5186', 'EPSG:3857'), true);
|
||||
}
|
||||
HOLE_DRILLING.addFeatures(features);
|
||||
}
|
||||
}
|
||||
|
|
@ -3136,6 +3151,11 @@ var jibanLocArr = [];
|
|||
var jibanInfoArr = [];
|
||||
|
||||
function ajaxGetJibanList(){
|
||||
|
||||
if( getQueryString("masterCompanyCode") !== null ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$.get("/map/ajaxGetJibanInfoList.do").done(function(data) {
|
||||
if(data) {
|
||||
for(var i = 0; i < data.result.length; i ++){
|
||||
|
|
|
|||
Loading…
Reference in New Issue