2025-01-16 05:53:43 +00:00
|
|
|
package geoinfo.admins.constructionProjectManagement;
|
|
|
|
|
|
2025-11-17 05:50:38 +00:00
|
|
|
import java.io.IOException;
|
2025-11-17 00:12:41 +00:00
|
|
|
import java.io.OutputStream;
|
2025-11-17 05:50:38 +00:00
|
|
|
import java.io.UnsupportedEncodingException;
|
2025-12-17 07:34:15 +00:00
|
|
|
import java.net.URLEncoder;
|
|
|
|
|
import java.text.SimpleDateFormat;
|
2025-01-16 05:53:43 +00:00
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.List;
|
2025-12-17 07:34:15 +00:00
|
|
|
import java.util.Locale;
|
2025-11-21 07:10:31 +00:00
|
|
|
import java.util.Map;
|
2025-01-16 05:53:43 +00:00
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
2025-12-17 07:34:15 +00:00
|
|
|
import javax.servlet.ServletOutputStream;
|
2025-01-16 05:53:43 +00:00
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
2025-12-17 07:34:15 +00:00
|
|
|
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
|
|
|
|
import org.apache.poi.ss.usermodel.Sheet;
|
2025-01-16 05:53:43 +00:00
|
|
|
import org.json.simple.JSONArray;
|
|
|
|
|
import org.json.simple.JSONObject;
|
|
|
|
|
import org.json.simple.parser.JSONParser;
|
2025-11-17 05:50:38 +00:00
|
|
|
import org.springframework.http.ResponseEntity;
|
2025-01-16 05:53:43 +00:00
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
|
|
import org.springframework.ui.ModelMap;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
|
|
|
|
|
|
import egovframework.rte.psl.dataaccess.util.EgovMap;
|
|
|
|
|
import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo;
|
2025-11-21 07:10:31 +00:00
|
|
|
import geoinfo.admins.constructionProjectManagement.service.ConstructionProjectManagementService;
|
2025-11-17 00:12:41 +00:00
|
|
|
import geoinfo.admins.user.service.DrillingInquiryService;
|
2025-01-16 05:53:43 +00:00
|
|
|
import geoinfo.admins.user.service.GeneralUserMngService;
|
|
|
|
|
import geoinfo.admins.user.service.HomeTrainingService;
|
2025-12-17 07:34:15 +00:00
|
|
|
import geoinfo.com.EgovExcel;
|
2025-11-17 00:12:41 +00:00
|
|
|
import geoinfo.comm.util.strUtil;
|
2025-01-16 05:53:43 +00:00
|
|
|
import geoinfo.session.UserInfo;
|
2025-12-17 07:34:15 +00:00
|
|
|
import geoinfo.util.ExcelMergeHeaderUtil;
|
2025-01-16 05:53:43 +00:00
|
|
|
import geoinfo.util.MyUtil;
|
|
|
|
|
|
|
|
|
|
@Controller
|
|
|
|
|
public class ConstructionProjectManagementController {
|
|
|
|
|
@Resource(name = "generalUserMngService")
|
|
|
|
|
private GeneralUserMngService masterService;
|
|
|
|
|
|
|
|
|
|
@Resource(name = "homeTrainingService")
|
|
|
|
|
private HomeTrainingService homeTrainingService;
|
2025-11-17 00:12:41 +00:00
|
|
|
|
|
|
|
|
|
2025-11-21 07:10:31 +00:00
|
|
|
// [변경] 새로 만든 서비스 주입
|
|
|
|
|
@Resource(name = "constructionProjectManagementService")
|
|
|
|
|
private ConstructionProjectManagementService constructionProjectManagementService;
|
|
|
|
|
|
|
|
|
|
// [추가] 기존 검색/조회 기능을 위해 필요 (변수 선언 추가)
|
|
|
|
|
@Resource(name = "drillingInquiryService")
|
|
|
|
|
private DrillingInquiryService drillingInquiryService;
|
2025-01-16 05:53:43 +00:00
|
|
|
|
|
|
|
|
/**
|
2025-11-21 07:10:31 +00:00
|
|
|
* 건설현장 통계 화면
|
2025-01-16 05:53:43 +00:00
|
|
|
* @param params
|
|
|
|
|
* @param model
|
|
|
|
|
* @param response
|
|
|
|
|
* @param request
|
|
|
|
|
* @return
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping(value = "admins/constructionProjectManagement/construction-project-statistics-index.do")
|
|
|
|
|
public String homeTrainingIndex(@RequestParam HashMap<String, Object> params, ModelMap model, HttpServletResponse response, HttpServletRequest request) throws Exception {
|
|
|
|
|
|
|
|
|
|
if (!UserInfo.isValidSession(request, response, "admin")) {
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
model.addAttribute("params", params);
|
|
|
|
|
return "admins/constructionProjectManagement/construction-project-statistics-index";
|
|
|
|
|
}
|
2025-10-10 07:40:32 +00:00
|
|
|
|
2025-11-21 07:10:31 +00:00
|
|
|
/**
|
|
|
|
|
* 건설현장 통계 데이터 조회 (AJAX)
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping(value = "admins/constructionProjectManagement/selectStatistics.do", method = RequestMethod.POST)
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public JSONObject selectStatistics(HttpServletRequest request, @RequestBody String strJSON, HttpServletResponse response) {
|
|
|
|
|
JSONObject jsonResponse = new JSONObject();
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
// 1. 파라미터 파싱
|
|
|
|
|
JSONParser jsonParser = new JSONParser();
|
|
|
|
|
JSONObject jsonObject = (JSONObject) jsonParser.parse(strJSON);
|
|
|
|
|
HashMap<String, Object> params = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
if (jsonObject != null) {
|
|
|
|
|
for(Object key : jsonObject.keySet()){
|
|
|
|
|
params.put((String)key, jsonObject.get(key));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 2. 서비스 호출 (새로 만든 서비스 사용)
|
|
|
|
|
Map<String, Object> stats = constructionProjectManagementService.selectConstructionProjectStatistics(params);
|
|
|
|
|
|
|
|
|
|
jsonResponse.put("result", "true");
|
|
|
|
|
jsonResponse.put("data", stats);
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
jsonResponse.put("result", "false");
|
|
|
|
|
jsonResponse.put("message", e.getMessage());
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return jsonResponse;
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-16 05:53:43 +00:00
|
|
|
/**
|
|
|
|
|
* 집합교육 추가
|
|
|
|
|
* @param request
|
|
|
|
|
* @param strJSON
|
|
|
|
|
* @param response
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping(value = "admins/constructionProjectManagement/home-training-index/add.do", method = RequestMethod.POST)
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public JSONObject addHomeTraining(
|
|
|
|
|
HttpServletRequest request,
|
|
|
|
|
@RequestBody String strJSON,
|
|
|
|
|
HttpServletResponse response) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JSONObject jsonResponse = new JSONObject();
|
|
|
|
|
|
|
|
|
|
System.out.println(
|
|
|
|
|
"\n--------------------------------------------------------------\n" +
|
|
|
|
|
request.getRequestURI() + " IN:" +
|
|
|
|
|
"\n--------------------------------------------------------------\n" +
|
|
|
|
|
"strJSON" + strJSON + "\n" +
|
|
|
|
|
"\n--------------------------------------------------------------\n"
|
|
|
|
|
);
|
|
|
|
|
JSONParser jsonParser = new JSONParser();
|
|
|
|
|
JSONArray jsonArr = null;
|
|
|
|
|
boolean isFail = false;
|
|
|
|
|
String failMsg = "";
|
|
|
|
|
try {
|
|
|
|
|
jsonArr = (JSONArray)jsonParser.parse(strJSON);
|
|
|
|
|
for (Object obj : jsonArr) {
|
|
|
|
|
JSONObject jsonObject = (JSONObject) obj;
|
|
|
|
|
|
|
|
|
|
// JSONObject를 HashMap으로 변환
|
|
|
|
|
HashMap<String, Object> params = new HashMap<>();
|
|
|
|
|
for (Object key : jsonObject.keySet()) {
|
|
|
|
|
String keyStr = (String) key;
|
|
|
|
|
Object value = jsonObject.get(keyStr);
|
|
|
|
|
params.put(keyStr, value);
|
|
|
|
|
}
|
|
|
|
|
try {
|
|
|
|
|
HashMap<String, Object> hashMap = homeTrainingService.addHomeTraining(request, response, params);
|
|
|
|
|
int nRetCode = MyUtil.getIntegerFromObject(hashMap.get("p_result_code"));
|
|
|
|
|
String lpszRetMsg = MyUtil.getStringFromObject(hashMap.get("p_err_msg"));
|
|
|
|
|
|
|
|
|
|
long lWvtRegId = MyUtil.getLongFromObject(hashMap.get("p_wvt_reg_id"));
|
|
|
|
|
|
|
|
|
|
if( nRetCode == 100 ) {
|
|
|
|
|
jsonResponse.put("resultCode", nRetCode);
|
|
|
|
|
jsonResponse.put("result", "true");
|
|
|
|
|
jsonResponse.put("message", "등록이 완료되었습니다.");
|
|
|
|
|
} else {
|
|
|
|
|
if( nRetCode == 11 ) {
|
|
|
|
|
lpszRetMsg += "\n" +
|
|
|
|
|
"사업명: " + params.get("constName");
|
|
|
|
|
}
|
|
|
|
|
jsonResponse.put("resultCode", nRetCode);
|
|
|
|
|
jsonResponse.put("result", "false");
|
|
|
|
|
jsonResponse.put("message", lpszRetMsg);
|
|
|
|
|
|
|
|
|
|
isFail = true;
|
|
|
|
|
failMsg = lpszRetMsg;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
|
String strTxt =
|
|
|
|
|
"---------- BUG REPORTING START ----------" + "\n" +
|
|
|
|
|
"에러 문구:[" + request.getRequestURI() + " " + "]" + "\n" +
|
|
|
|
|
"strJSON:[\n" + strJSON + "\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);
|
|
|
|
|
jsonResponse.put("resultCode", -1);
|
|
|
|
|
jsonResponse.put("result", "false");
|
|
|
|
|
jsonResponse.put("message", e.getMessage());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} catch (org.json.simple.parser.ParseException e) {
|
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( isFail ) {
|
|
|
|
|
jsonResponse.put("resultCode", -2);
|
|
|
|
|
jsonResponse.put("result", "false");
|
|
|
|
|
jsonResponse.put("message", failMsg);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
System.out.println("\n--------------------------------------------------------------\n" +
|
|
|
|
|
request.getRequestURI() + " OUT:" +
|
|
|
|
|
"\n--------------------------------------------------------------\n" +
|
|
|
|
|
"jsonResponse.toJSONString():[" + jsonResponse.toJSONString() + "]\n" +
|
|
|
|
|
"\n--------------------------------------------------------------\n");
|
|
|
|
|
|
|
|
|
|
return jsonResponse;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 집합교육 수정
|
|
|
|
|
* @param request
|
|
|
|
|
* @param strJSON
|
|
|
|
|
* @param response
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping(value = "admins/constructionProjectManagement/home-training-index/update.do", method = RequestMethod.POST)
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public JSONObject updateHomeTraining(
|
|
|
|
|
HttpServletRequest request,
|
|
|
|
|
@RequestBody String strJSON,
|
|
|
|
|
HttpServletResponse response) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JSONObject jsonResponse = new JSONObject();
|
|
|
|
|
|
|
|
|
|
System.out.println(
|
|
|
|
|
"\n--------------------------------------------------------------\n" +
|
|
|
|
|
request.getRequestURI() + " IN:" +
|
|
|
|
|
"\n--------------------------------------------------------------\n" +
|
|
|
|
|
"strJSON" + strJSON + "\n" +
|
|
|
|
|
"\n--------------------------------------------------------------\n"
|
|
|
|
|
);
|
|
|
|
|
JSONParser jsonParser = new JSONParser();
|
|
|
|
|
JSONArray jsonArr = null;
|
|
|
|
|
boolean isFail = false;
|
|
|
|
|
String failMsg = "";
|
|
|
|
|
try {
|
|
|
|
|
jsonArr = (JSONArray)jsonParser.parse(strJSON);
|
|
|
|
|
for (Object obj : jsonArr) {
|
|
|
|
|
JSONObject jsonObject = (JSONObject) obj;
|
|
|
|
|
|
|
|
|
|
// JSONObject를 HashMap으로 변환
|
|
|
|
|
HashMap<String, Object> params = new HashMap<>();
|
|
|
|
|
for (Object key : jsonObject.keySet()) {
|
|
|
|
|
String keyStr = (String) key;
|
|
|
|
|
Object value = jsonObject.get(keyStr);
|
|
|
|
|
params.put(keyStr, value);
|
|
|
|
|
}
|
|
|
|
|
try {
|
|
|
|
|
HashMap<String, Object> hashMap = homeTrainingService.updateHomeTraining(request, response, params);
|
|
|
|
|
int nRetCode = MyUtil.getIntegerFromObject(hashMap.get("p_result_code"));
|
|
|
|
|
String lpszRetMsg = MyUtil.getStringFromObject(hashMap.get("p_err_msg"));
|
|
|
|
|
|
|
|
|
|
if( nRetCode == 100 ) {
|
|
|
|
|
jsonResponse.put("resultCode", nRetCode);
|
|
|
|
|
jsonResponse.put("result", "true");
|
|
|
|
|
jsonResponse.put("message", "수정이 완료되었습니다.");
|
|
|
|
|
} else {
|
|
|
|
|
if( nRetCode == 11 ) {
|
|
|
|
|
lpszRetMsg += "\n" +
|
|
|
|
|
"사업명: " + params.get("constName");
|
|
|
|
|
}
|
|
|
|
|
jsonResponse.put("resultCode", nRetCode);
|
|
|
|
|
jsonResponse.put("result", "false");
|
|
|
|
|
jsonResponse.put("message", lpszRetMsg);
|
|
|
|
|
|
|
|
|
|
isFail = true;
|
|
|
|
|
failMsg = lpszRetMsg;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
|
String strTxt =
|
|
|
|
|
"---------- BUG REPORTING START ----------" + "\n" +
|
|
|
|
|
"에러 문구:[" + request.getRequestURI() + " " + "]" + "\n" +
|
|
|
|
|
"strJSON:[\n" + strJSON + "\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);
|
|
|
|
|
jsonResponse.put("resultCode", -1);
|
|
|
|
|
jsonResponse.put("result", "false");
|
|
|
|
|
jsonResponse.put("message", e.getMessage());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} catch (org.json.simple.parser.ParseException e) {
|
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( isFail ) {
|
|
|
|
|
jsonResponse.put("resultCode", -2);
|
|
|
|
|
jsonResponse.put("result", "false");
|
|
|
|
|
jsonResponse.put("message", failMsg);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
System.out.println("\n--------------------------------------------------------------\n" +
|
|
|
|
|
request.getRequestURI() + " OUT:" +
|
|
|
|
|
"\n--------------------------------------------------------------\n" +
|
|
|
|
|
"jsonResponse.toJSONString():[" + jsonResponse.toJSONString() + "]\n" +
|
|
|
|
|
"\n--------------------------------------------------------------\n");
|
|
|
|
|
|
|
|
|
|
return jsonResponse;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "admins/constructionProjectManagement/home-training-index/list.do", method = RequestMethod.GET)
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public JSONObject getHomeTraining(
|
|
|
|
|
HttpServletRequest request,
|
|
|
|
|
@RequestParam HashMap<String, Object> params,
|
|
|
|
|
HttpServletResponse response) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JSONObject jsonResponse = new JSONObject();
|
|
|
|
|
|
|
|
|
|
System.out.println(
|
|
|
|
|
"\n--------------------------------------------------------------\n" +
|
|
|
|
|
request.getRequestURI() + " IN:" +
|
|
|
|
|
"\n--------------------------------------------------------------\n" +
|
|
|
|
|
"params.toString()" + params.toString() + "\n" +
|
|
|
|
|
"\n--------------------------------------------------------------\n"
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
homeTrainingService.getHomeTraining(request, response, jsonResponse, params);
|
|
|
|
|
jsonResponse.put("resultCode", 100);
|
|
|
|
|
jsonResponse.put("result", "true");
|
|
|
|
|
jsonResponse.put("message", "조회가 완료되었습니다.");
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
|
String strTxt =
|
|
|
|
|
"---------- BUG REPORTING START ----------" + "\n" +
|
|
|
|
|
"에러 문구:[" + request.getRequestURI() + " " + "]" + "\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);
|
|
|
|
|
|
|
|
|
|
String eMsg = e.getMessage();
|
|
|
|
|
if( eMsg != null ) {
|
|
|
|
|
if( eMsg.equals("로그인이 필요한 서비스입니다.") ) {
|
|
|
|
|
jsonResponse.put("resultCode", 401);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
jsonResponse.put("resultCode", -1);
|
|
|
|
|
jsonResponse.put("result", "false");
|
|
|
|
|
jsonResponse.put("message", e.getMessage());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
System.out.println(
|
|
|
|
|
"\n--------------------------------------------------------------\n" +
|
|
|
|
|
request.getRequestURI() + " OUT:" +
|
|
|
|
|
"\n--------------------------------------------------------------\n" +
|
|
|
|
|
"jsonResponse.toJSONString():[" + jsonResponse.toJSONString() + "]\n" +
|
|
|
|
|
"\n--------------------------------------------------------------\n"
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
return jsonResponse;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 특정 집합교육에 참여한 사용자 목록을 조회한다.
|
|
|
|
|
* @param request
|
|
|
|
|
* @param params
|
|
|
|
|
* @param response
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping(value = "admins/constructionProjectManagement/home-training-index/item/list.do", method = RequestMethod.GET)
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public JSONObject getHomeTrainingItemList(
|
|
|
|
|
HttpServletRequest request,
|
|
|
|
|
@RequestParam HashMap<String, Object> params,
|
|
|
|
|
HttpServletResponse response) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JSONObject jsonResponse = new JSONObject();
|
|
|
|
|
|
|
|
|
|
System.out.println(
|
|
|
|
|
"\n--------------------------------------------------------------\n" +
|
|
|
|
|
request.getRequestURI() + " IN:" +
|
|
|
|
|
"\n--------------------------------------------------------------\n" +
|
|
|
|
|
"params.toString()" + params.toString() + "\n" +
|
|
|
|
|
"\n--------------------------------------------------------------\n"
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
homeTrainingService.getHomeTrainingItemList(request, response, jsonResponse, params);
|
|
|
|
|
jsonResponse.put("resultCode", 100);
|
|
|
|
|
jsonResponse.put("result", "true");
|
|
|
|
|
jsonResponse.put("message", "조회가 완료되었습니다.");
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
|
String strTxt =
|
|
|
|
|
"---------- BUG REPORTING START ----------" + "\n" +
|
|
|
|
|
"에러 문구:[" + request.getRequestURI() + " " + "]" + "\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);
|
|
|
|
|
jsonResponse.put("resultCode", -1);
|
|
|
|
|
jsonResponse.put("result", "false");
|
|
|
|
|
jsonResponse.put("message", e.getMessage());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
System.out.println(
|
|
|
|
|
"\n--------------------------------------------------------------\n" +
|
|
|
|
|
request.getRequestURI() + " OUT:" +
|
|
|
|
|
"\n--------------------------------------------------------------\n" +
|
|
|
|
|
"jsonResponse.toJSONString():[" + jsonResponse.toJSONString() + "]\n" +
|
|
|
|
|
"\n--------------------------------------------------------------\n"
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
return jsonResponse;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "admins/constructionProjectManagement/home-training-index/item/delete.do", method = RequestMethod.POST)
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public JSONObject deleteHomeTrainingItem(
|
|
|
|
|
HttpServletRequest request,
|
|
|
|
|
@RequestBody String strJSON,
|
|
|
|
|
HttpServletResponse response) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JSONObject jsonResponse = new JSONObject();
|
|
|
|
|
|
|
|
|
|
System.out.println(
|
|
|
|
|
"\n--------------------------------------------------------------\n" +
|
|
|
|
|
request.getRequestURI() + " IN:" +
|
|
|
|
|
"\n--------------------------------------------------------------\n" +
|
|
|
|
|
"strJSON" + strJSON + "\n" +
|
|
|
|
|
"\n--------------------------------------------------------------\n"
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
JSONParser jsonParser = new JSONParser();
|
|
|
|
|
JSONArray jsonArr = null;
|
|
|
|
|
boolean isFail = false;
|
|
|
|
|
String failMsg = "";
|
|
|
|
|
try {
|
|
|
|
|
jsonArr = (JSONArray)jsonParser.parse(strJSON);
|
|
|
|
|
for (Object obj : jsonArr) {
|
|
|
|
|
JSONObject jsonObject = (JSONObject) obj;
|
|
|
|
|
|
|
|
|
|
// JSONObject를 HashMap으로 변환
|
|
|
|
|
HashMap<String, Object> params = new HashMap<>();
|
|
|
|
|
for (Object key : jsonObject.keySet()) {
|
|
|
|
|
String keyStr = (String) key;
|
|
|
|
|
Object value = jsonObject.get(keyStr);
|
|
|
|
|
params.put(keyStr, value);
|
|
|
|
|
}
|
|
|
|
|
try {
|
|
|
|
|
HashMap<String, Object> hashMap = homeTrainingService.deleteHomeTrainingItem(request, response, params);
|
|
|
|
|
int nRetCode = MyUtil.getIntegerFromObject(hashMap.get("p_result_code"));
|
|
|
|
|
String lpszRetMsg = MyUtil.getStringFromObject(hashMap.get("p_err_msg"));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if( nRetCode == 100 ) {
|
|
|
|
|
jsonResponse.put("resultCode", nRetCode);
|
|
|
|
|
jsonResponse.put("result", "true");
|
|
|
|
|
jsonResponse.put("message", "삭제가 완료되었습니다.");
|
|
|
|
|
} else {
|
|
|
|
|
if( nRetCode == 11 ) {
|
|
|
|
|
lpszRetMsg += "\n" +
|
|
|
|
|
"사업명: " + params.get("constName");
|
|
|
|
|
}
|
|
|
|
|
jsonResponse.put("resultCode", nRetCode);
|
|
|
|
|
jsonResponse.put("result", "false");
|
|
|
|
|
jsonResponse.put("message", lpszRetMsg);
|
|
|
|
|
|
|
|
|
|
isFail = true;
|
|
|
|
|
failMsg = lpszRetMsg;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
|
String strTxt =
|
|
|
|
|
"---------- BUG REPORTING START ----------" + "\n" +
|
|
|
|
|
"에러 문구:[" + request.getRequestURI() + " " + "]" + "\n" +
|
|
|
|
|
"strJSON:[\n" + strJSON + "\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);
|
|
|
|
|
jsonResponse.put("resultCode", -1);
|
|
|
|
|
jsonResponse.put("result", "false");
|
|
|
|
|
jsonResponse.put("message", e.getMessage());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} catch (org.json.simple.parser.ParseException e) {
|
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( isFail ) {
|
|
|
|
|
jsonResponse.put("resultCode", -2);
|
|
|
|
|
jsonResponse.put("result", "false");
|
|
|
|
|
jsonResponse.put("message", failMsg);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
System.out.println("\n--------------------------------------------------------------\n" +
|
|
|
|
|
request.getRequestURI() + " OUT:" +
|
|
|
|
|
"\n--------------------------------------------------------------\n" +
|
|
|
|
|
"jsonResponse.toJSONString():[" + jsonResponse.toJSONString() + "]\n" +
|
|
|
|
|
"\n--------------------------------------------------------------\n");
|
|
|
|
|
|
|
|
|
|
return jsonResponse;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 집합교육 승인 화면
|
|
|
|
|
* @param params
|
|
|
|
|
* @param model
|
|
|
|
|
* @param response
|
|
|
|
|
* @param request
|
|
|
|
|
* @return
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping(value = "admins/constructionProjectManagement/home-training-approval-system")
|
|
|
|
|
public String homeTrainingApprovalSystem(@RequestParam HashMap<String, Object> params, ModelMap model, HttpServletResponse response, HttpServletRequest request) throws Exception {
|
|
|
|
|
|
|
|
|
|
if (!UserInfo.isValidSession(request, response, "admin")) {
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
model.addAttribute("params", params);
|
|
|
|
|
return "admins/constructionProjectManagement/home-training-approval-system";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 방문교육 달력 화면
|
|
|
|
|
* @param params
|
|
|
|
|
* @param model
|
|
|
|
|
* @param response
|
|
|
|
|
* @param request
|
|
|
|
|
* @return
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping(value = "admins/constructionProjectManagement/visit-training-index.do")
|
|
|
|
|
public String visitTrainingIndex(@RequestParam HashMap<String, Object> params, ModelMap model, HttpServletResponse response, HttpServletRequest request) throws Exception {
|
|
|
|
|
|
|
|
|
|
if (!UserInfo.isValidSession(request, response, "admin")) {
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
model.addAttribute("params", params);
|
|
|
|
|
return "admins/constructionProjectManagement/visit-training-index";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 방문교육 승인 화면
|
|
|
|
|
* @param params
|
|
|
|
|
* @param model
|
|
|
|
|
* @param response
|
|
|
|
|
* @param request
|
|
|
|
|
* @return
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping(value = "admins/constructionProjectManagement/visit-training-approval-system")
|
|
|
|
|
public String visitTrainingApprovalSystem(@RequestParam HashMap<String, Object> params, ModelMap model, HttpServletResponse response, HttpServletRequest request) throws Exception {
|
|
|
|
|
|
|
|
|
|
if (!UserInfo.isValidSession(request, response, "admin")) {
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
model.addAttribute("params", params);
|
|
|
|
|
return "admins/constructionProjectManagement/visit-training-approval-system";
|
|
|
|
|
}
|
|
|
|
|
|
2025-11-21 07:41:00 +00:00
|
|
|
/**
|
|
|
|
|
* 건설현장 조회 목록화면
|
|
|
|
|
* @param params
|
|
|
|
|
* @param model
|
|
|
|
|
* @param response
|
|
|
|
|
* @param request
|
|
|
|
|
* @return
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping(value = "admins/constructionProjectManagement/construction-site-index.do")
|
|
|
|
|
public String constructionSiteIndex(@RequestParam HashMap<String, Object> params, ModelMap model, HttpServletResponse response, HttpServletRequest request) throws Exception {
|
|
|
|
|
|
2025-12-23 08:55:22 +00:00
|
|
|
JSONObject jsonObj = new JSONObject();
|
2025-11-21 07:41:00 +00:00
|
|
|
if (!UserInfo.isValidSession(request, response, "admin")) {
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
|
2025-12-23 08:55:22 +00:00
|
|
|
List<EgovMap> gDis = drillingInquiryService.getGDisList(params);
|
|
|
|
|
jsonObj.put("gDis", gDis);
|
|
|
|
|
|
|
|
|
|
model.put("result", jsonObj);
|
2025-11-21 07:41:00 +00:00
|
|
|
model.addAttribute("params", params);
|
|
|
|
|
return "admins/constructionProjectManagement/construction-site-index";
|
|
|
|
|
}
|
|
|
|
|
|
2025-11-14 05:03:23 +00:00
|
|
|
/**
|
|
|
|
|
* 건설현장 관리 > 발주기관 계정 화면
|
|
|
|
|
* @param params
|
|
|
|
|
* @param model
|
|
|
|
|
* @param response
|
|
|
|
|
* @param request
|
|
|
|
|
* @return
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping(value = "admins/constructionProjectManagement/construction-user-mgmt-index.do")
|
|
|
|
|
public String goConstructionUserMgmt(@RequestParam HashMap<String, Object> params, ModelMap model, HttpServletResponse response, HttpServletRequest request) throws Exception {
|
|
|
|
|
if (!UserInfo.isValidSession(request, response, "admin")) {
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 2023.10.25 LHJ 검색조건 추가 : 가입기간 시작/종료날짜를 8자리 숫자로 입력하지 않았을 때 처리 **/
|
|
|
|
|
String searchBgndt = (String) params.get("searchBgndt");
|
|
|
|
|
if(searchBgndt == null || searchBgndt.length() != 8 || !searchBgndt.matches("[0-9]+")) {
|
|
|
|
|
params.put("searchBgndt", "");
|
|
|
|
|
}
|
|
|
|
|
String searchEnddt = (String) params.get("searchEnddt");
|
|
|
|
|
if(searchEnddt == null || searchEnddt.length() != 8 || !searchEnddt.matches("[0-9]+")) {
|
|
|
|
|
params.put("searchEnddt", "");
|
|
|
|
|
}
|
2025-11-17 00:12:41 +00:00
|
|
|
params.put("cls", "2");
|
2025-11-14 05:03:23 +00:00
|
|
|
/** pageing */
|
|
|
|
|
PaginationInfo paginationInfo = new PaginationInfo();
|
|
|
|
|
|
|
|
|
|
if (params.get("pageIndex") == null || "".equals(params.get("pageIndex"))) {
|
|
|
|
|
paginationInfo.setCurrentPageNo(1);
|
|
|
|
|
params.put("pageIndex", 1);
|
|
|
|
|
} else {
|
|
|
|
|
paginationInfo.setCurrentPageNo(Integer.valueOf((String) params.get("pageIndex")));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
paginationInfo.setRecordCountPerPage(10);
|
|
|
|
|
paginationInfo.setPageSize(10);
|
|
|
|
|
|
|
|
|
|
params.put("firstRecordIndex", paginationInfo.getFirstRecordIndex());
|
|
|
|
|
params.put("recordCountPerPage", paginationInfo.getRecordCountPerPage());
|
|
|
|
|
|
|
|
|
|
List<?> resultList = masterService.selectInfoList(params);
|
|
|
|
|
|
|
|
|
|
int totalCnt = resultList.size() == 0 ? 0 : Integer.valueOf(((EgovMap) resultList.get(0)).get("totalrows").toString());
|
|
|
|
|
paginationInfo.setTotalRecordCount(totalCnt);
|
|
|
|
|
|
|
|
|
|
model.addAttribute("params", params);
|
|
|
|
|
model.addAttribute("resultList", resultList);
|
|
|
|
|
model.addAttribute("paginationInfo", paginationInfo);
|
|
|
|
|
|
|
|
|
|
return "admins/constructionProjectManagement/construction-user-mgmt-index";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2025-11-17 00:12:41 +00:00
|
|
|
* 건설현장 관리 > 발주기관 계정 상세조회 화면
|
|
|
|
|
* @param params
|
|
|
|
|
* @param model
|
|
|
|
|
* @param response
|
|
|
|
|
* @param request
|
|
|
|
|
* @return
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping(value = "admins/constructionProjectManagement/construction-user-detail.do")
|
|
|
|
|
public String goConstructionUserDetail(@RequestParam HashMap<String, Object> params, ModelMap model, HttpServletResponse response, HttpServletRequest request) throws Exception {
|
|
|
|
|
if (!UserInfo.isValidSession(request, response, "admin")) {
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
model.addAttribute("params", params);
|
|
|
|
|
return "admins/constructionProjectManagement/construction-user-detail";
|
|
|
|
|
}
|
|
|
|
|
|
2025-11-21 07:41:00 +00:00
|
|
|
/**
|
|
|
|
|
* 프로젝트 목록 조회 프로젝트명 자동검색
|
|
|
|
|
* @param request
|
|
|
|
|
* @param response
|
|
|
|
|
* @param params
|
|
|
|
|
* @return
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
|
@ResponseBody
|
|
|
|
|
@RequestMapping(value = "/drilling-project-list", method = RequestMethod.GET, produces = "application/json; charset=UTF-8")
|
|
|
|
|
public String getDrillingProjectList(HttpServletRequest request, HttpServletResponse response, @RequestParam HashMap<String,Object> params) throws Exception {
|
|
|
|
|
if (!UserInfo.isValidSession(request, response, "admin")) {
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
|
|
strUtil sUtil = new strUtil();
|
|
|
|
|
|
|
|
|
|
String projectName = sUtil.checkNull((String)params.get("projectName"));
|
|
|
|
|
|
|
|
|
|
JSONArray jsonListObject = new JSONArray();
|
|
|
|
|
JSONObject result = new JSONObject();
|
|
|
|
|
result.put("list", drillingInquiryService.drillingInquiryAutocompleteList(request, params));
|
|
|
|
|
|
|
|
|
|
jsonObject.put("resultMessage", "OK");
|
|
|
|
|
jsonObject.put("resultCode", 200);
|
|
|
|
|
jsonObject.put("result", result);
|
|
|
|
|
|
|
|
|
|
response.setContentType("application/json; charset=UTF-8"); // 응답 헤더 설정
|
|
|
|
|
response.setCharacterEncoding("UTF-8"); // 응답 데이터 인코딩 설정 (중요)
|
|
|
|
|
|
|
|
|
|
try (OutputStream os = response.getOutputStream()) { // OutputStream 사용
|
|
|
|
|
os.write(jsonObject.toString().getBytes("UTF-8")); // UTF-8 인코딩하여 출력
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return null; // @ResponseBody이므로 반환 값은 필요 없습니다.
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 발주기관 프로젝트목록 가져오기
|
|
|
|
|
* @param request
|
|
|
|
|
* @param params
|
|
|
|
|
* @param response
|
|
|
|
|
* @return
|
|
|
|
|
* @throws IOException
|
|
|
|
|
*/
|
2025-11-17 05:50:38 +00:00
|
|
|
@RequestMapping(value = "/drilling/inquiry/list.do", method = RequestMethod.GET, produces = { "application/json; charset=utf-8" })
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public ResponseEntity<JSONObject> drillingInquiryList (
|
|
|
|
|
HttpServletRequest request,
|
|
|
|
|
@RequestParam HashMap<String, Object> params,
|
|
|
|
|
HttpServletResponse response
|
|
|
|
|
) throws IOException {
|
2025-11-17 00:12:41 +00:00
|
|
|
if (!UserInfo.isValidSession(request, response, "admin")) {
|
2025-11-17 05:50:38 +00:00
|
|
|
return null;
|
2025-11-17 00:12:41 +00:00
|
|
|
}
|
2025-11-17 05:50:38 +00:00
|
|
|
|
|
|
|
|
System.out.println(
|
|
|
|
|
"\n--------------------------------------------------------------\n" +
|
|
|
|
|
request.getRequestURI() + " IN:" +
|
|
|
|
|
"\n--------------------------------------------------------------\n" +
|
|
|
|
|
"params" + params.toString() + "\n" +
|
|
|
|
|
"\n--------------------------------------------------------------\n"
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
JSONObject jSONOResponse = null;
|
|
|
|
|
try {
|
2025-12-17 07:34:15 +00:00
|
|
|
jSONOResponse = drillingInquiryService.drillingInquiryList( request, params );
|
2025-11-17 05:50:38 +00:00
|
|
|
} catch (Exception e) {
|
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
|
jSONOResponse = new JSONObject();
|
|
|
|
|
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);
|
|
|
|
|
jSONOResponse.put("resultCode", -1);
|
|
|
|
|
jSONOResponse.put("result", "false");
|
|
|
|
|
jSONOResponse.put("message", e.getMessage());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
System.out.println(
|
|
|
|
|
"\n--------------------------------------------------------------\n" +
|
|
|
|
|
request.getRequestURI() + " OUT:" +
|
|
|
|
|
"\n--------------------------------------------------------------\n" +
|
|
|
|
|
"jSONOResponse.toJSONString():[" + jSONOResponse.toJSONString() + "]\n" +
|
|
|
|
|
"\n--------------------------------------------------------------\n"
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int contentLength = 0;
|
|
|
|
|
try {
|
|
|
|
|
contentLength = jSONOResponse.toJSONString().getBytes("UTF-8").length;
|
|
|
|
|
} catch (UnsupportedEncodingException e1) {
|
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
|
e1.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
response.setStatus(HttpServletResponse.SC_OK);
|
|
|
|
|
response.setCharacterEncoding("UTF-8");
|
|
|
|
|
response.setHeader("Content-Type", "application/json; charset=utf-8");
|
|
|
|
|
response.setContentLength(contentLength); // Content-Length 설정
|
|
|
|
|
try {
|
|
|
|
|
response.getWriter().print(jSONOResponse);
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
}
|
2025-12-17 07:34:15 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 발주기관 건설현장 CSV 다운로드 처리
|
|
|
|
|
* @param workbook
|
|
|
|
|
* @param request
|
|
|
|
|
* @param response
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping(value = "admins/drilling/inquiry/excel.do")
|
|
|
|
|
public void downloadDrillingInquiryListExcel(HttpServletRequest request, HttpServletResponse response, HSSFWorkbook workbook, @RequestParam HashMap<String, Object> params) throws Exception {
|
|
|
|
|
|
|
|
|
|
HashMap<String, Object> map = new HashMap<String, Object>();
|
|
|
|
|
|
2025-12-23 01:09:27 +00:00
|
|
|
String[] headers = {"cid","constName","projectStateCodeName","constStartDate","constStateCodeName","inquiryDist" ,"masterCompanyDept","masterCompanyAdmin","masterCompanyTel","coinstCompanyDept","constCompanyAdmin","constCompanyTel"};
|
|
|
|
|
String[][] headerNames = {{"연번", "사업명", "입력상태", "사업내용", "", "발주기관현황", "", "", "", "건설사현황", "", ""},
|
|
|
|
|
{"", "", "", "사업기간", "사업단계", "발주처", "담당부서", "담당자", "담당자연락처", "건설사명", "담당자", "담당자연락처"}};
|
2025-12-17 07:34:15 +00:00
|
|
|
|
2025-12-23 01:09:27 +00:00
|
|
|
final int[] headerWidths = {1325, 15900, 4240, 6360, 5830, 8830, 6890, 2915, 3710, 5035, 2915, 3710};
|
|
|
|
|
String[] columnType = {"String", "String", "String", "String", "String", "String", "String", "String", "String", "String", "String", "String"};
|
2025-12-17 07:34:15 +00:00
|
|
|
String sheetName = "Sheet1";
|
|
|
|
|
|
|
|
|
|
String excelFileName = "발주기관 건설현장 목록";
|
|
|
|
|
|
|
|
|
|
// int startIndex = 0;
|
|
|
|
|
Long totalCount = 0L;
|
|
|
|
|
// DB 조회
|
|
|
|
|
JSONObject resultObj = drillingInquiryService.drillingInquiryList(request, params);
|
|
|
|
|
|
|
|
|
|
// 여기에서 list 꺼내기
|
|
|
|
|
List<EgovMap> list = (List<EgovMap>) resultObj.get("datas");
|
|
|
|
|
totalCount = (Long) resultObj.get("count");
|
|
|
|
|
|
|
|
|
|
int idx = 0;
|
|
|
|
|
for (EgovMap rowData : list) {
|
|
|
|
|
// 공사기간 형식 처리: startDate ~ endDate
|
|
|
|
|
String constStartDate = (String) rowData.get("constStartDate");
|
|
|
|
|
String constEndDate = (String) rowData.get("constEndDate");
|
|
|
|
|
rowData.put("constStartDate", constStartDate + " ~ " + constEndDate); // 공사기간을 'startDate ~ endDate' 형식으로 변환
|
|
|
|
|
rowData.put("cid", (totalCount) - (idx++));
|
2025-12-23 01:09:27 +00:00
|
|
|
|
|
|
|
|
String glName = "";
|
|
|
|
|
String gmName = "";
|
|
|
|
|
String gsName = "";
|
|
|
|
|
String inquiryDist = ""; // 발주처
|
|
|
|
|
if ((String)rowData.get("glName") != null) {
|
|
|
|
|
glName = (String)rowData.get("glName");
|
|
|
|
|
inquiryDist = inquiryDist + glName + " ";
|
|
|
|
|
}if ((String)rowData.get("gmName") != null) {
|
|
|
|
|
gmName = (String)rowData.get("gmName");
|
|
|
|
|
inquiryDist = inquiryDist + gmName + " ";
|
|
|
|
|
}if ((String)rowData.get("gsName") != null) {
|
|
|
|
|
gsName = (String)rowData.get("gsName");
|
|
|
|
|
inquiryDist = inquiryDist + gsName;
|
|
|
|
|
}
|
|
|
|
|
rowData.put("inquiryDist", inquiryDist);
|
2025-12-17 07:34:15 +00:00
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ExcelMergeHeaderUtil.listToExcelMergeHeader(list, response, headers, headerNames, headerWidths, columnType, sheetName, excelFileName);
|
|
|
|
|
}
|
|
|
|
|
|
2025-11-17 00:12:41 +00:00
|
|
|
/**
|
|
|
|
|
* 건설현장 관리 > 발주기관 로그인 내역 화면
|
2025-11-14 05:03:23 +00:00
|
|
|
* @param params
|
|
|
|
|
* @param model
|
|
|
|
|
* @param response
|
|
|
|
|
* @param request
|
|
|
|
|
* @return
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping(value = "admins/constructionProjectManagement/construction-user-login-history.do")
|
|
|
|
|
public String goConstructionUserloginHist(@RequestParam HashMap<String, Object> params, ModelMap model, HttpServletResponse response, HttpServletRequest request) throws Exception {
|
|
|
|
|
if (!UserInfo.isValidSession(request, response, "admin")) {
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 2023.10.25 LHJ 검색조건 추가 : 가입기간 시작/종료날짜를 8자리 숫자로 입력하지 않았을 때 처리 **/
|
|
|
|
|
String searchBgndt = (String) params.get("searchBgndt");
|
|
|
|
|
if(searchBgndt == null || searchBgndt.length() != 8 || !searchBgndt.matches("[0-9]+")) {
|
|
|
|
|
params.put("searchBgndt", "");
|
|
|
|
|
}
|
|
|
|
|
String searchEnddt = (String) params.get("searchEnddt");
|
|
|
|
|
if(searchEnddt == null || searchEnddt.length() != 8 || !searchEnddt.matches("[0-9]+")) {
|
|
|
|
|
params.put("searchEnddt", "");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** pageing */
|
|
|
|
|
PaginationInfo paginationInfo = new PaginationInfo();
|
|
|
|
|
|
|
|
|
|
if (params.get("pageIndex") == null || "".equals(params.get("pageIndex"))) {
|
|
|
|
|
paginationInfo.setCurrentPageNo(1);
|
|
|
|
|
params.put("pageIndex", 1);
|
|
|
|
|
} else {
|
|
|
|
|
paginationInfo.setCurrentPageNo(Integer.valueOf((String) params.get("pageIndex")));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
paginationInfo.setRecordCountPerPage(10);
|
|
|
|
|
paginationInfo.setPageSize(10);
|
|
|
|
|
|
|
|
|
|
params.put("firstRecordIndex", paginationInfo.getFirstRecordIndex());
|
|
|
|
|
params.put("recordCountPerPage", paginationInfo.getRecordCountPerPage());
|
|
|
|
|
|
2025-12-24 08:58:22 +00:00
|
|
|
List<EgovMap> resultList = masterService.selectUserLoginHistory(params);
|
2025-11-14 05:03:23 +00:00
|
|
|
|
|
|
|
|
int totalCnt = resultList.size() == 0 ? 0 : Integer.valueOf(((EgovMap) resultList.get(0)).get("totalrows").toString());
|
|
|
|
|
paginationInfo.setTotalRecordCount(totalCnt);
|
|
|
|
|
|
|
|
|
|
model.addAttribute("params", params);
|
|
|
|
|
model.addAttribute("resultList", resultList);
|
|
|
|
|
model.addAttribute("paginationInfo", paginationInfo);
|
|
|
|
|
|
|
|
|
|
return "admins/constructionProjectManagement/construction-user-login-history";
|
|
|
|
|
}
|
2025-12-17 07:34:15 +00:00
|
|
|
|
|
|
|
|
public void buildExcelDocument(Map<String, Object> model, HSSFWorkbook workbook, HttpServletRequest request, HttpServletResponse response) throws Exception {
|
|
|
|
|
|
|
|
|
|
List<?> selectInfoListExcel = (List<?>) model.get("selectInfoListExcel");
|
|
|
|
|
|
|
|
|
|
String[] arrHeader = (String[]) model.get("arrHeader");
|
|
|
|
|
|
|
|
|
|
Sheet sheet = workbook.createSheet((String) model.get("sheetName"));
|
|
|
|
|
|
|
|
|
|
EgovExcel.SetExcelList(workbook, sheet, arrHeader, selectInfoListExcel, 0, 0);
|
|
|
|
|
|
|
|
|
|
response.setContentType("application/vnd.ms-excel");
|
|
|
|
|
response.setHeader("Content-disposition",
|
|
|
|
|
"attachment;filename=" + URLEncoder.encode((String) model.get("fileName") + (new SimpleDateFormat("yyyy.MM.dd", Locale.KOREA)).format(new Date()), "UTF-8")
|
|
|
|
|
+ ".xls" + ";");
|
|
|
|
|
ServletOutputStream myOut = response.getOutputStream();
|
|
|
|
|
workbook.write(myOut); // 파일 저장
|
|
|
|
|
}
|
2025-12-24 08:58:22 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 발주기관 건설현장 CSV 다운로드 처리
|
|
|
|
|
* @param workbook
|
|
|
|
|
* @param request
|
|
|
|
|
* @param response
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping(value = "admins/constructionProjectManagement/excel.do")
|
|
|
|
|
public void constructionProjectManagementExcel(HttpServletRequest request, HttpServletResponse response, HSSFWorkbook workbook, @RequestParam HashMap<String, Object> params) throws Exception {
|
|
|
|
|
|
|
|
|
|
HashMap<String, Object> map = new HashMap<String, Object>();
|
|
|
|
|
|
|
|
|
|
String[] headers = {"num","userid","userName","companyName","datetime","note"};
|
|
|
|
|
String[] headerNames = {"번호", "아이디", "이름", "소속", "로그인일시", "로그인여부"};
|
|
|
|
|
|
|
|
|
|
final int[] headerWidths = {1325, 15900, 4240, 6360, 5830, 8830, 6890, 2915, 3710, 5035, 2915, 3710};
|
|
|
|
|
String[] columnType = {"String", "String", "String", "String", "String", "String"};
|
|
|
|
|
String sheetName = "발주기관 로그인 내역";
|
|
|
|
|
|
|
|
|
|
String excelFileName = "국토지반_발주기관_로그인_내역";
|
|
|
|
|
|
|
|
|
|
// int startIndex = 0;
|
|
|
|
|
Long totalCount = 0L;
|
|
|
|
|
// DB 조회
|
|
|
|
|
/** pageing */
|
|
|
|
|
PaginationInfo paginationInfo = new PaginationInfo();
|
|
|
|
|
|
|
|
|
|
if (params.get("pageIndex") == null || "".equals(params.get("pageIndex"))) {
|
|
|
|
|
paginationInfo.setCurrentPageNo(1);
|
|
|
|
|
params.put("pageIndex", 1);
|
|
|
|
|
} else {
|
|
|
|
|
paginationInfo.setCurrentPageNo(Integer.valueOf((String) params.get("pageIndex")));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
paginationInfo.setRecordCountPerPage(10);
|
|
|
|
|
paginationInfo.setPageSize(10);
|
|
|
|
|
|
|
|
|
|
params.put("firstRecordIndex", paginationInfo.getFirstRecordIndex());
|
|
|
|
|
params.put("recordCountPerPage", paginationInfo.getRecordCountPerPage());
|
|
|
|
|
|
|
|
|
|
List<EgovMap> resultList = masterService.selectUserLoginHistory(params);
|
|
|
|
|
|
|
|
|
|
int totalCnt = resultList.size() == 0 ? 0 : Integer.valueOf(((EgovMap) resultList.get(0)).get("totalrows").toString());
|
|
|
|
|
paginationInfo.setTotalRecordCount(totalCnt);
|
|
|
|
|
|
|
|
|
|
ExcelMergeHeaderUtil.listToExcelMergeHeaderForLoginHistory(resultList, response, headers, headerNames, headerWidths, columnType, sheetName, excelFileName);
|
|
|
|
|
}
|
2025-11-14 05:03:23 +00:00
|
|
|
|
2025-11-21 07:10:31 +00:00
|
|
|
}
|