외사장비 모달 수정 완료

첩보수집활동 모달 작업 시작.
강석 최 2022-12-12 16:37:53 +09:00
parent 3df21b009a
commit c30d94f9d4
17 changed files with 1206 additions and 1248 deletions

View File

@ -2,10 +2,7 @@ package com.dbnt.faisp.main.equip;
import com.dbnt.faisp.main.authMgt.service.AuthMgtService;
import com.dbnt.faisp.main.equip.model.CellPhone;
import com.dbnt.faisp.main.equip.model.Equip;
import com.dbnt.faisp.main.equip.model.EquipLog;
import com.dbnt.faisp.main.equip.model.UseList;
import com.dbnt.faisp.main.equip.model.*;
import com.dbnt.faisp.main.equip.service.EquipService;
import com.dbnt.faisp.main.organMgt.service.OrganConfigService;
import com.dbnt.faisp.main.userInfo.model.UserInfo;
@ -41,52 +38,52 @@ public class EquipController {
private final AuthMgtService authMgtService;
private final OrganConfigService organConfigService;
private final UserInfoService userInfoService;
@GetMapping("/equipStatus")
public ModelAndView equipStatus(@AuthenticationPrincipal UserInfo loginUser, Equip equip) {
ModelAndView mav = new ModelAndView("equip/equipStatus");
//메뉴권한 확인
String accessAuth = authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/equip/equipStatus").get(0).getAccessAuth();
mav.addObject("accessAuth", accessAuth);
mav.addObject("equipList", equipService.selectEquipStatus(equip));
mav.addObject("equipList", equipService.selectEquipStatus(equip));
return mav;
}
@GetMapping("/equipEditModal")
public ModelAndView equipEditModal(@AuthenticationPrincipal UserInfo loginUser) {
ModelAndView mav = new ModelAndView("equip/equipEditModal");
//메뉴권한 확인
//메뉴권한 확인
String accessAuth = authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/equip/equipStatus").get(0).getAccessAuth();
mav.addObject("mgtOrganList", loginUser.getDownOrganCdList());
mav.addObject("userOrgan", loginUser.getOgCd());
mav.addObject("accessAuth", accessAuth);
return mav;
}
@GetMapping("/equipTypeSelecBox")
public ModelAndView equipTypeSelecBox(String equType) {
ModelAndView mav = new ModelAndView("equip/equipTypeSelecBox");
mav.addObject("equType", equType);
return mav;
}
@PostMapping("/saveEquip")
public void saveEquip(@AuthenticationPrincipal UserInfo loginUser,Equip equip, MultipartHttpServletRequest request){
equip.setWrtNm(loginUser.getUserNm());
equip.setWrtOrgan(loginUser.getOgCd());
equip.setWrtPart(loginUser.getOfcCd());
equip.setWrtTitle(loginUser.getTitleCd());
equip.setWrtDt(LocalDateTime.now());
equipService.saveEquip(equip,request);
equip.setWrtNm(loginUser.getUserNm());
equip.setWrtOrgan(loginUser.getOgCd());
equip.setWrtPart(loginUser.getOfcCd());
equip.setWrtTitle(loginUser.getTitleCd());
equip.setWrtDt(LocalDateTime.now());
equipService.saveEquip(equip,request);
}
@GetMapping("/List")
public ModelAndView equipList(@AuthenticationPrincipal UserInfo loginUser,Equip equip) {
ModelAndView mav = new ModelAndView("equip/equipList");
//메뉴권한 확인
String accessAuth = authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/equip/equipStatus").get(0).getAccessAuth();
mav.addObject("accessAuth", accessAuth);
@ -99,10 +96,10 @@ public class EquipController {
equip.setContentCnt(equipService.selectEquipListCnt(equip));
equip.setPaginationInfo();
mav.addObject("searchParams", equip);
return mav;
}
@GetMapping("/updatePage")
public ModelAndView equipUpdatePage(@AuthenticationPrincipal UserInfo loginUser, Equip equip) {
ModelAndView mav = new ModelAndView("equip/equipModifyModal");
@ -114,72 +111,72 @@ public class EquipController {
mav.addObject("equInfo", equipService.selectEquipInfo(equip));
return mav;
}
@PostMapping("/updateEquip")
@ResponseBody
public int updateEquip(@AuthenticationPrincipal UserInfo loginUser,Equip equip, MultipartHttpServletRequest request){
equip.setWrtNm(loginUser.getUserNm());
equip.setWrtOrgan(loginUser.getOgCd());
equip.setWrtPart(loginUser.getOfcCd());
equip.setWrtTitle(loginUser.getTitleCd());
equip.setWrtDt(LocalDateTime.now());
int result = equipService.updateEquip(equip,request);
return result;
equip.setWrtNm(loginUser.getUserNm());
equip.setWrtOrgan(loginUser.getOgCd());
equip.setWrtPart(loginUser.getOfcCd());
equip.setWrtTitle(loginUser.getTitleCd());
equip.setWrtDt(LocalDateTime.now());
int result = equipService.updateEquip(equip,request);
return result;
}
@GetMapping("/historyView")
public ModelAndView historyView(Equip equip) {
ModelAndView mav = new ModelAndView("equip/equipHistory");
mav.addObject("equList", equipService.selectHistoryList(equip));
return mav;
}
@GetMapping("/HistoryDetail")
@ResponseBody
public Equip HistoryDetail(Equip equip){
return equipService.selectHistoryDetail(equip);
}
@PostMapping("/epuipDelete")
public void epuipDelete(@AuthenticationPrincipal UserInfo loginUser, @RequestBody List<Equip> equip){
equipService.equipDelete(equip,loginUser);
equipService.equipDelete(equip,loginUser);
}
@GetMapping("/getEquipImg")
public void getThumbImage(Equip equip , HttpServletResponse response) throws Exception {
Equip dbImg = equipService.selectEquipInfo(equip);
String realFile = dbImg.getFilePath()+"/"+ dbImg.getConvNm();
String fileNm = dbImg.getConvNm();
BufferedOutputStream out = null;
InputStream in = null;
try {
response.setContentType("image/jpeg;charset=UTF-8");
response.setHeader("Content-Disposition", "inline;filename=" + fileNm);
File file = new File(realFile);
// File file = new File(realFile + "/" + fileNm);
if(file.exists()){
in = new FileInputStream(file);
out = new BufferedOutputStream(response.getOutputStream());
int len;
byte[] buf = new byte[1024];
while ((len = in.read(buf)) > 0) {
out.write(buf, 0, len);
}
}
} catch (Exception e) {
} finally {
if(out != null){ out.flush(); }
if(out != null){ out.close(); }
if(in != null){ in.close(); }
}
}
EquipFile dbImg = equipService.selectEquipFile(equip);
String realFile = dbImg.getFilePath()+"/"+ dbImg.getConvNm();
String fileNm = dbImg.getConvNm();
BufferedOutputStream out = null;
InputStream in = null;
try {
response.setContentType("image/jpeg;charset=UTF-8");
response.setHeader("Content-Disposition", "inline;filename=" + fileNm);
File file = new File(realFile);
// File file = new File(realFile + "/" + fileNm);
if(file.exists()){
in = new FileInputStream(file);
out = new BufferedOutputStream(response.getOutputStream());
int len;
byte[] buf = new byte[1024];
while ((len = in.read(buf)) > 0) {
out.write(buf, 0, len);
}
}
} catch (Exception e) {
} finally {
if(out != null){ out.flush(); }
if(out != null){ out.close(); }
if(in != null){ in.close(); }
}
}
@GetMapping("/Log")
public ModelAndView equipLog(@AuthenticationPrincipal UserInfo loginUser,EquipLog equipLog) {
ModelAndView mav = new ModelAndView("equip/equipLogList");
@ -189,82 +186,82 @@ public class EquipController {
equipLog.setContentCnt(equipService.selectEquipLogListCnt(equipLog));
equipLog.setPaginationInfo();
mav.addObject("searchParams", equipLog);
return mav;
}
@GetMapping("/statusExcelDown")
public void statisticsExcelDown(Model model,HttpServletResponse response, Equip equip) {
String[] headers = { "rownum","equ_type", "item_value", "total", "cnt_bon", "cnt_center", "cnt_incheon", "cnt_pyeongtaek", "cnt_taean","cnt_boryeong","cnt_west","cnt_mokpo","cnt_buan",
"cnt_gunsan","cnt_yusu","cnt_wando","cnt_south","cnt_ulsan","cnt_busan","cnt_changwon","cnt_tongyong","cnt_sacheon","cnt_east","cnt_sokcho","cnt_donghe",
"cnt_ulgin","cnt_pohang","cnt_jeju","cnt_jejuseo","cnt_seoguipo"};
String[] headerNames = { "", "", "", "", "", "중부", "", "","","","서해","","","","","","남해","","","","","","동해","","","","","제주","",""};
String[] headerNames2 = { "연번", "분류", "세부분류", "총계", "본청", "청", "인천서", "평택서","태안서","보령서","청","목포서","부안서","군산서","여수서","완도서","청","울산서","부산서","창원서","통영서","서천서","청","속초서","동해서","울진서","포항서","청","제주서","서귀포서"};
String[] columnType = { "int", "String", "String", "int", "int", "int", "int", "int","int","int","int","int","int","int","int","int","int","int","int","int",
"int","int","int","int","int","int","int","int","int","int"};
String sheetName = "외사장비현황";
String excelFileName = "외사장비현황";
List<ParamMap> equStatusList = equipService.selectEquipStatus(equip);
String[] headers = { "rownum","equ_type", "item_value", "total", "cnt_bon", "cnt_center", "cnt_incheon", "cnt_pyeongtaek", "cnt_taean","cnt_boryeong","cnt_west","cnt_mokpo","cnt_buan",
"cnt_gunsan","cnt_yusu","cnt_wando","cnt_south","cnt_ulsan","cnt_busan","cnt_changwon","cnt_tongyong","cnt_sacheon","cnt_east","cnt_sokcho","cnt_donghe",
"cnt_ulgin","cnt_pohang","cnt_jeju","cnt_jejuseo","cnt_seoguipo"};
String[] headerNames = { "", "", "", "", "", "중부", "", "","","","서해","","","","","","남해","","","","","","동해","","","","","제주","",""};
String[] headerNames2 = { "연번", "분류", "세부분류", "총계", "본청", "청", "인천서", "평택서","태안서","보령서","청","목포서","부안서","군산서","여수서","완도서","청","울산서","부산서","창원서","통영서","서천서","청","속초서","동해서","울진서","포항서","청","제주서","서귀포서"};
String[] columnType = { "int", "String", "String", "int", "int", "int", "int", "int","int","int","int","int","int","int","int","int","int","int","int","int",
"int","int","int","int","int","int","int","int","int","int"};
String sheetName = "외사장비현황";
String excelFileName = "외사장비현황";
List<ParamMap> equStatusList = equipService.selectEquipStatus(equip);
try {
Utils.downEquipStatusExcel(equStatusList, response, headers, headerNames,headerNames2, columnType, sheetName, excelFileName);
} catch (IOException e) {
model.addAttribute("message", "엑셀다운로드 중 오류가 발생했습니다.");
}
try {
Utils.downEquipStatusExcel(equStatusList, response, headers, headerNames,headerNames2, columnType, sheetName, excelFileName);
} catch (IOException e) {
model.addAttribute("message", "엑셀다운로드 중 오류가 발생했습니다.");
}
}
@GetMapping("/cellPhoneList")
public ModelAndView cellPhoneList(@AuthenticationPrincipal UserInfo loginUser,CellPhone cellPhone,HttpServletResponse response) {
ModelAndView mav = new ModelAndView("equip/cellPhoneList");
cellPhone.setDownOrganCdList(loginUser.getDownOrganCdList());
//엑셀다운
//엑셀다운
if(cellPhone.getExcel() != null && cellPhone.getExcel().equals("Y")){
String[] headers = { "phone_key", "sosok", "tel_no", "user_nm", "ext_mail", "webex_no", "katalk_id"};
String[] headerNames = { "연번", "소속","전화번호", "사용자(관리자)", "등록 외부메일", "웹엑스 미팅번호", "카카오톡 ID"};
String[] columnType = { "int", "String","String", "String", "String", "String", "String", "Stiring"};
String sheetName = "업무용 휴대전화 현황";
String excelFileName = "업무용 휴대전화 현황";
List<CellPhone> cellPhoneList= equipService.selectCellPhoneList(cellPhone);
String[] headers = { "phone_key", "sosok", "tel_no", "user_nm", "ext_mail", "webex_no", "katalk_id"};
String[] headerNames = { "연번", "소속","전화번호", "사용자(관리자)", "등록 외부메일", "웹엑스 미팅번호", "카카오톡 ID"};
String[] columnType = { "int", "String","String", "String", "String", "String", "String", "Stiring"};
String sheetName = "업무용 휴대전화 현황";
String excelFileName = "업무용 휴대전화 현황";
List<CellPhone> cellPhoneList= equipService.selectCellPhoneList(cellPhone);
try {
Utils.cellPhoneListToExcel(cellPhoneList, response, headers, headerNames, columnType, sheetName, excelFileName);
} catch (IOException e) {
}
return null;
try {
Utils.cellPhoneListToExcel(cellPhoneList, response, headers, headerNames, columnType, sheetName, excelFileName);
} catch (IOException e) {
}
return null;
}
//메뉴권한 확인
String accessAuth = authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/equip/cellPhoneList").get(0).getAccessAuth();
mav.addObject("accessAuth", accessAuth);
mav.addObject("accessAuth", accessAuth);
cellPhone.setQueryInfo();
mav.addObject("cellPhoneList", equipService.selectCellPhoneList(cellPhone));
cellPhone.setContentCnt(equipService.selectCellPhoneListCnt(cellPhone));
cellPhone.setPaginationInfo();
mav.addObject("searchParams", cellPhone);
return mav;
}
@GetMapping("/cellPhoneEditModal")
public ModelAndView cellPhoneEditModal(@AuthenticationPrincipal UserInfo loginUser,CellPhone cellPhone) {
ModelAndView mav = new ModelAndView("equip/cellPhoneEditModal");
ModelAndView mav = new ModelAndView("equip/cellPhoneEditModal");
if(cellPhone.getPhoneKey() != null) {
cellPhone = equipService.selectCellPhoneInfo(cellPhone.getPhoneKey());
ParamMap param = new ParamMap();
param.put("downOrganCdList", organConfigService.selectDownOrganListWhereUserOgCd(cellPhone.getMgtOrgan()));
mav.addObject("managerList", userInfoService.selectManagerList(param));
mav.addObject("userSeq", loginUser.getUserSeq());
cellPhone = equipService.selectCellPhoneInfo(cellPhone.getPhoneKey());
ParamMap param = new ParamMap();
param.put("downOrganCdList", organConfigService.selectDownOrganListWhereUserOgCd(cellPhone.getMgtOrgan()));
mav.addObject("managerList", userInfoService.selectManagerList(param));
mav.addObject("userSeq", loginUser.getUserSeq());
}
if(cellPhone.getPhoneKey() == null) {
cellPhone.setWrtOrgan(loginUser.getOgCd());
cellPhone.setWrtPart(loginUser.getOfcCd());
cellPhone.setWrtTitle(loginUser.getTitleCd());
cellPhone.setWrtUserSeq(loginUser.getUserSeq());
cellPhone.setWrtNm(loginUser.getUserNm());
cellPhone.setWrtOrgan(loginUser.getOgCd());
cellPhone.setWrtPart(loginUser.getOfcCd());
cellPhone.setWrtTitle(loginUser.getTitleCd());
cellPhone.setWrtUserSeq(loginUser.getUserSeq());
cellPhone.setWrtNm(loginUser.getUserNm());
}
//메뉴권한 확인
//메뉴권한 확인
String accessAuth = authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/equip/cellPhoneList").get(0).getAccessAuth();
mav.addObject("mgtOrganList", loginUser.getDownOrganCdList());
mav.addObject("userOrgan", loginUser.getOgCd());
@ -272,28 +269,28 @@ public class EquipController {
mav.addObject("info", cellPhone);
return mav;
}
@GetMapping("/cellPhoneSelecBox")
public ModelAndView cellPhoneSelecBox(String ogCd) {
ModelAndView mav = new ModelAndView("equip/cellPhoneSelecBox");
ParamMap param = new ParamMap();
ParamMap param = new ParamMap();
param.put("downOrganCdList", organConfigService.selectDownOrganListWhereUserOgCd(ogCd));
mav.addObject("managerList", userInfoService.selectManagerList(param));
return mav;
}
@PostMapping("/saveCellPhone")
public Integer saveCellPhone (@AuthenticationPrincipal UserInfo loginUser,CellPhone cellPhone){
cellPhone.setWrtDt(LocalDateTime.now());
return equipService.saveCellPhone(cellPhone);
cellPhone.setWrtDt(LocalDateTime.now());
return equipService.saveCellPhone(cellPhone);
}
@PostMapping("/deleteCellPhone")
public void deleteCellPhone(@RequestBody List<CellPhone> cellPhone){
equipService.deleteCellPhone(cellPhone);
equipService.deleteCellPhone(cellPhone);
}
@GetMapping("/pvreUseList")
public ModelAndView pvreUseList(@AuthenticationPrincipal UserInfo loginUser,UseList useList,HttpServletResponse response) {
ModelAndView mav = new ModelAndView("equip/pvreUseList");
@ -301,23 +298,23 @@ public class EquipController {
useList.setUseType("PVRE");
//엑셀다운
if(useList.getExcel() != null && useList.getExcel().equals("Y")){
String[] headers = { "use_no", "sosok", "use_dt", "detail_type_name", "people_cnt", "description", "wrt_dt"};
String[] headerNames = { "연번", "경찰서","사용일시", "사용사유", "사용인원", "비고", "최종수정일"};
String[] columnType = { "String", "String","String", "String", "int", "String", "String"};
String sheetName = "휴대용 녹화장비 사용 대장";
String excelFileName = "휴대용 녹화장비 사용 대장";
List<UseList> useExcelList= equipService.selectUseList(useList);
String[] headers = { "use_no", "sosok", "use_dt", "detail_type_name", "people_cnt", "description", "wrt_dt"};
String[] headerNames = { "연번", "경찰서","사용일시", "사용사유", "사용인원", "비고", "최종수정일"};
String[] columnType = { "String", "String","String", "String", "int", "String", "String"};
String sheetName = "휴대용 녹화장비 사용 대장";
String excelFileName = "휴대용 녹화장비 사용 대장";
List<UseList> useExcelList= equipService.selectUseList(useList);
try {
Utils.useListToExcel(useExcelList, response, headers, headerNames, columnType, sheetName, excelFileName);
} catch (IOException e) {
}
return null;
try {
Utils.useListToExcel(useExcelList, response, headers, headerNames, columnType, sheetName, excelFileName);
} catch (IOException e) {
}
return null;
}
//메뉴권한 확인
String accessAuth = authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/equip/pvreUseList").get(0).getAccessAuth();
mav.addObject("accessAuth", accessAuth);
mav.addObject("accessAuth", accessAuth);
useList.setQueryInfo();
mav.addObject("useList", equipService.selectUseList(useList));
useList.setContentCnt(equipService.selectUseListCnt(useList));
@ -326,7 +323,7 @@ public class EquipController {
mav.addObject("searchParams", useList);
return mav;
}
@GetMapping("/useEditModal")
public ModelAndView useEditModal(@AuthenticationPrincipal UserInfo loginUser,UseList useList) {
ModelAndView mav = new ModelAndView("equip/useEditModal");
@ -334,29 +331,29 @@ public class EquipController {
mav.addObject("organList", equipService.selectOrganList(useList));
mav.addObject("userOrgan", loginUser.getOgCd());
mav.addObject("useType", useList.getUseType());
//메뉴권한 확인
//메뉴권한 확인
String accessAuth;
if(useList.getUseType().equals("PVRE")) {
accessAuth = authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/equip/pvreUseList").get(0).getAccessAuth();
mav.addObject("accessAuth", accessAuth);
accessAuth = authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/equip/pvreUseList").get(0).getAccessAuth();
mav.addObject("accessAuth", accessAuth);
}else if(useList.getUseType().equals("QIR")) {
accessAuth = authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/equip/qirUseList").get(0).getAccessAuth();
mav.addObject("accessAuth", accessAuth);
accessAuth = authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/equip/qirUseList").get(0).getAccessAuth();
mav.addObject("accessAuth", accessAuth);
}
return mav;
}
@PostMapping("/saveUse")
public void saveUse(@AuthenticationPrincipal UserInfo loginUser,UseList useList){
useList.setWrtOrgan(loginUser.getOgCd());
useList.setWrtPart(loginUser.getOfcCd());
useList.setWrtTitle(loginUser.getTitleCd());
useList.setWrtUserSeq(loginUser.getUserSeq());
useList.setWrtNm(loginUser.getUserNm());
useList.setWrtDt(LocalDateTime.now());
equipService.saveUse(useList);
useList.setWrtOrgan(loginUser.getOgCd());
useList.setWrtPart(loginUser.getOfcCd());
useList.setWrtTitle(loginUser.getTitleCd());
useList.setWrtUserSeq(loginUser.getUserSeq());
useList.setWrtNm(loginUser.getUserNm());
useList.setWrtDt(LocalDateTime.now());
equipService.saveUse(useList);
}
@GetMapping("/useModifyModal")
public ModelAndView useModifyModal(@AuthenticationPrincipal UserInfo loginUser,UseList useList) {
ModelAndView mav = new ModelAndView("equip/useModifyModal");
@ -365,48 +362,48 @@ public class EquipController {
mav.addObject("info", equipService.selectUseInfo(useList));
mav.addObject("wrtUserSeq", equipService.selectFirstWrtUserSeq(useList));
mav.addObject("userSeq", loginUser.getUserSeq());
//메뉴권한 확인
//메뉴권한 확인
String accessAuth;
if(useList.getUseType().equals("PVRE")) {
accessAuth = authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/equip/pvreUseList").get(0).getAccessAuth();
mav.addObject("accessAuth", accessAuth);
accessAuth = authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/equip/pvreUseList").get(0).getAccessAuth();
mav.addObject("accessAuth", accessAuth);
}else if(useList.getUseType().equals("QIR")) {
accessAuth = authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/equip/qirUseList").get(0).getAccessAuth();
mav.addObject("accessAuth", accessAuth);
accessAuth = authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/equip/qirUseList").get(0).getAccessAuth();
mav.addObject("accessAuth", accessAuth);
}
return mav;
}
@PostMapping("/updateUse")
public UseList uadateUse(@AuthenticationPrincipal UserInfo loginUser,UseList useList){
useList.setWrtOrgan(loginUser.getOgCd());
useList.setWrtPart(loginUser.getOfcCd());
useList.setWrtTitle(loginUser.getTitleCd());
useList.setWrtUserSeq(loginUser.getUserSeq());
useList.setWrtNm(loginUser.getUserNm());
useList.setWrtDt(LocalDateTime.now());
return equipService.updateUse(useList);
useList.setWrtOrgan(loginUser.getOgCd());
useList.setWrtPart(loginUser.getOfcCd());
useList.setWrtTitle(loginUser.getTitleCd());
useList.setWrtUserSeq(loginUser.getUserSeq());
useList.setWrtNm(loginUser.getUserNm());
useList.setWrtDt(LocalDateTime.now());
return equipService.updateUse(useList);
}
@GetMapping("/useHistory")
public ModelAndView useHistory(@AuthenticationPrincipal UserInfo loginUser,UseList useList) {
ModelAndView mav = new ModelAndView("equip/useHistory");
mav.addObject("infoList", equipService.selectUseHistoryList(useList));
return mav;
}
@GetMapping("/HistoryView")
@ResponseBody
public UseList HistoryView(UseList useList){
return equipService.selectUseInfo(useList);
}
@PostMapping("/useDelete")
public void useDelete(@RequestBody List<UseList> useList){
equipService.useDelete(useList);
equipService.useDelete(useList);
}
@GetMapping("/qirUseList")
public ModelAndView qirUseList(@AuthenticationPrincipal UserInfo loginUser,UseList useList,HttpServletResponse response) {
ModelAndView mav = new ModelAndView("equip/qirUseList");
@ -414,23 +411,23 @@ public class EquipController {
useList.setUseType("QIR");
//엑셀다운
if(useList.getExcel() != null && useList.getExcel().equals("Y")){
String[] headers = { "use_no", "sosok", "use_dt", "detail_type_name", "people_cnt", "description", "wrt_dt"};
String[] headerNames = { "연번", "경찰서","사용일시", "사용사유", "사용인원", "비고", "최종수정일"};
String[] columnType = { "String", "String","String", "String", "int", "String", "String"};
String sheetName = "방역조사실 사용대장";
String excelFileName = "방역조사실 사용대장";
List<UseList> useExcelList= equipService.selectUseList(useList);
String[] headers = { "use_no", "sosok", "use_dt", "detail_type_name", "people_cnt", "description", "wrt_dt"};
String[] headerNames = { "연번", "경찰서","사용일시", "사용사유", "사용인원", "비고", "최종수정일"};
String[] columnType = { "String", "String","String", "String", "int", "String", "String"};
String sheetName = "방역조사실 사용대장";
String excelFileName = "방역조사실 사용대장";
List<UseList> useExcelList= equipService.selectUseList(useList);
try {
Utils.useListToExcel(useExcelList, response, headers, headerNames, columnType, sheetName, excelFileName);
} catch (IOException e) {
}
return null;
try {
Utils.useListToExcel(useExcelList, response, headers, headerNames, columnType, sheetName, excelFileName);
} catch (IOException e) {
}
return null;
}
//메뉴권한 확인
String accessAuth = authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/equip/qirUseList").get(0).getAccessAuth();
mav.addObject("accessAuth", accessAuth);
mav.addObject("accessAuth", accessAuth);
useList.setQueryInfo();
mav.addObject("useList", equipService.selectUseList(useList));
useList.setContentCnt(equipService.selectUseListCnt(useList));
@ -439,9 +436,9 @@ public class EquipController {
mav.addObject("organList", equipService.selectOrganList(useList));
return mav;
}
}

View File

@ -36,376 +36,363 @@ import java.util.*;
@Service
@RequiredArgsConstructor
public class EquipService {
@Value("${file.dir}")
protected String fileDir;
@Value("${file.dir.equip}")
protected String equ;
@Value("${file.dir}")
protected String fileDir;
@Value("${file.dir.equip}")
protected String equ;
private final EquipRepository equipRepository;
private final EquipFileRepository equipFileRepository;
private final EquipLogRepository equipLogRepository;
private final CellPhoneRepository cellPhoneRepository;
private final UseListRepository useListRepository;
private final EquipMapper equipMapper;
SimpleDateFormat Date = new SimpleDateFormat("yyyy");
String year = Date.format(new Date());
@Transactional
public void saveEquip(Equip equip, MultipartHttpServletRequest request) {
Equip dbEquip = equipRepository.findFirstByOrderByEquKeyDesc();
try {
if(dbEquip == null) {
equip.setEquKey(1);
equip.setVersionNo(1);
equipRepository.save(equip);
} else {
equip.setEquKey(dbEquip.getEquKey()+1);
equip.setVersionNo(1);
equipRepository.save(equip);
}
saveFile(equip,request);
EquipLog equLog = new EquipLog();
equLog.setEquType(equip.getEquType());
equLog.setDetailType(equip.getDetailType());
equLog.setElContents("입력");
equLog.setWrtNm(equip.getWrtNm());
equLog.setWrtOrgan(equip.getWrtOrgan());
equLog.setWrtPart(equip.getWrtPart());
equLog.setWrtTitle(equip.getWrtTitle());
equLog.setWrtDt(equip.getWrtDt());
equipLogRepository.save(equLog);
} catch (Exception e) {
e.printStackTrace();
}
}
public void saveFile(Equip equip, MultipartHttpServletRequest mRequest) throws Exception {
try {
String path = fileDir+equ;
String FileSize;
File dir = new File(path);
if(!dir.exists()) dir.mkdir();
//파일등록
List<MultipartFile> mFiles = mRequest.getFiles("file");
for(int i = 0; i < mFiles.size(); i++) {
MultipartFile mFile = mFiles.get(i);
FileSize = calculationSize(mFile.getSize());
if(!"".equals(mFile.getOriginalFilename())){
String fileName = mFile.getOriginalFilename();
if(fileName.contains("\\")){
String notSecuredFileName = fileName.substring(fileName.lastIndexOf("\\") +1);
fileName = ("".equals(notSecuredFileName) || null == notSecuredFileName) ? fileName : notSecuredFileName;
};
private final EquipRepository equipRepository;
private final EquipFileRepository equipFileRepository;
private final EquipLogRepository equipLogRepository;
private final CellPhoneRepository cellPhoneRepository;
private final UseListRepository useListRepository;
private final EquipMapper equipMapper;
String fileExt = Utils.getFileExtention(fileName);
String saveName = Utils.generationSaveName() + "." + fileExt;
FileCopyUtils.copy(mFile.getBytes(), new File(path, saveName));
SimpleDateFormat Date = new SimpleDateFormat("yyyy");
String year = Date.format(new Date());
EquipFile equipFile = new EquipFile();
equipFile.setEquKey(equip.getEquKey());
equipFile.setVersionNo(equip.getVersionNo());
equipFile.setOrigNm(fileName);
equipFile.setConvNm(saveName);
equipFile.setFileExtn(fileExt);
equipFile.setFilePath(path);
equipFile.setFileSize(FileSize);
equipFileRepository.save(equipFile);
} else {
EquipFile equipFile = new EquipFile();
equipFile.setEquKey(equip.getEquKey());
equipFile.setVersionNo(equip.getVersionNo());
equipFileRepository.save(equipFile);
}
}
@Transactional
public void saveEquip(Equip equip, MultipartHttpServletRequest request) {
Equip dbEquip = equipRepository.findFirstByOrderByEquKeyDesc();
try {
if(dbEquip == null) {
equip.setEquKey(1);
equip.setVersionNo(1);
equipRepository.save(equip);
} else {
equip.setEquKey(dbEquip.getEquKey()+1);
equip.setVersionNo(1);
equipRepository.save(equip);
}
saveFile(equip,request);
EquipLog equLog = new EquipLog();
equLog.setEquType(equip.getEquType());
equLog.setDetailType(equip.getDetailType());
equLog.setElContents("입력");
equLog.setWrtNm(equip.getWrtNm());
equLog.setWrtOrgan(equip.getWrtOrgan());
equLog.setWrtPart(equip.getWrtPart());
equLog.setWrtTitle(equip.getWrtTitle());
equLog.setWrtDt(equip.getWrtDt());
equipLogRepository.save(equLog);
} catch (Exception e) {
e.printStackTrace();
}
}
} catch (Exception e) {
throw e;
}
}
private String calculationSize(double fileSize){
String[] units = {"bytes", "KB", "MB", "GB", "TB", "PB"};
double unitSelector = Math.floor(Math.log(fileSize)/Math.log(1024));
if(fileSize>0){
return Math.round((fileSize/Math.pow(1024, unitSelector))*100)/100d+" "+units[(int)unitSelector];
}else{
return "";
}
}
public void saveFile(Equip equip, MultipartHttpServletRequest mRequest) throws Exception {
try {
String path = fileDir+equ;
String FileSize;
File dir = new File(path);
if(!dir.exists()) dir.mkdir();
//파일등록
List<MultipartFile> mFiles = mRequest.getFiles("file");
for(int i = 0; i < mFiles.size(); i++) {
MultipartFile mFile = mFiles.get(i);
FileSize = calculationSize(mFile.getSize());
if(!"".equals(mFile.getOriginalFilename())){
String fileName = mFile.getOriginalFilename();
if(fileName.contains("\\")){
String notSecuredFileName = fileName.substring(fileName.lastIndexOf("\\") +1);
fileName = ("".equals(notSecuredFileName) || null == notSecuredFileName) ? fileName : notSecuredFileName;
};
public List<ParamMap> selectEquipStatus(Equip equip) {
return equipMapper.selectEquipStatus(equip);
}
String fileExt = Utils.getFileExtention(fileName);
String saveName = Utils.generationSaveName() + "." + fileExt;
FileCopyUtils.copy(mFile.getBytes(), new File(path, saveName));
public List<Equip> selectEquipList(Equip equip) {
return equipMapper.selectEquipList(equip);
}
EquipFile equipFile = new EquipFile();
equipFile.setEquKey(equip.getEquKey());
equipFile.setVersionNo(equip.getVersionNo());
equipFile.setOrigNm(fileName);
equipFile.setConvNm(saveName);
equipFile.setFileExtn(fileExt);
equipFile.setFilePath(path);
equipFile.setFileSize(FileSize);
public Integer selectEquipListCnt(Equip equip) {
return equipMapper.selectEquipListCnt(equip);
}
equipFileRepository.save(equipFile);
} else {
EquipFile equipFile = new EquipFile();
equipFile.setEquKey(equip.getEquKey());
equipFile.setVersionNo(equip.getVersionNo());
equipFileRepository.save(equipFile);
}
}
public Equip selectEquipInfo(Equip equip) {
return equipMapper.selectEquipInfo(equip);
}
@Transactional
public int updateEquip(Equip equip, MultipartHttpServletRequest request) {
try {
Equip dbEquip = equipRepository.findById(new EquipId(equip.getEquKey(), equip.getVersionNo())).orElse(null);
Equip equipTmp = new Equip();
equipTmp.setEquKey(dbEquip.getEquKey());
equipTmp.setVersionNo(dbEquip.getVersionNo()+1);
equipTmp.setMgtOrgan(equip.getMgtOrgan());
equipTmp.setEquType(equip.getEquType());
equipTmp.setDetailType(equip.getDetailType());
equipTmp.setStoredYear(equip.getStoredYear());
equipTmp.setItemQty(equip.getItemQty());
equipTmp.setItemCondition(equip.getItemCondition());
equipTmp.setNote(equip.getNote());
equipTmp.setWrtOrgan(equip.getWrtOrgan());
equipTmp.setWrtPart(equip.getWrtPart());
equipTmp.setWrtTitle(equip.getWrtTitle());
equipTmp.setWrtNm(equip.getWrtNm());
equipTmp.setWrtDt(equip.getWrtDt());
equipRepository.save(equipTmp);
updateFile(equip,equipTmp,request);
EquipLog equLog = new EquipLog();
equLog.setEquType(equip.getEquType());
equLog.setDetailType(equip.getDetailType());
equLog.setElContents("수정");
equLog.setWrtNm(equip.getWrtNm());
equLog.setWrtOrgan(equip.getWrtOrgan());
equLog.setWrtDt(equip.getWrtDt());
equLog.setWrtPart(equip.getWrtPart());
equLog.setWrtTitle(equip.getWrtTitle());
equipLogRepository.save(equLog);
} catch (Exception e) {
e.printStackTrace();
}
return equip.getEquKey();
}
public void updateFile(Equip equip,Equip equipTmp, MultipartHttpServletRequest mRequest) throws Exception {
try {
String path = fileDir+equ;
String FileSize;
File dir = new File(path);
if(!dir.exists()) dir.mkdir();
//이미지 삭제했을경우
if(equip.getDeleteFileKey() != null) {
EquipFile equFile = new EquipFile();
equFile.setEquKey(equip.getDeleteFileKey());
equFile.setVersionNo(equip.getDeleteFileVnum());
EquipFile dbEquFile = equipFileRepository.findById(new EquipFileId(equFile.getEquKey(), equFile.getVersionNo())).orElse(null);
if(dbEquFile != null) {
File file = new File(dbEquFile.getFilePath(), dbEquFile.getConvNm());
} catch (Exception e) {
throw e;
}
}
if(file.exists()) {
file.delete();
}
}
}
//파일등록
List<MultipartFile> mFiles = mRequest.getFiles("file");
for(int i = 0; i < mFiles.size(); i++) {
MultipartFile mFile = mFiles.get(i);
FileSize = calculationSize(mFile.getSize());
if(!"".equals(mFile.getOriginalFilename())){
String fileName = mFile.getOriginalFilename();
if(fileName.contains("\\")){
String notSecuredFileName = fileName.substring(fileName.lastIndexOf("\\") +1);
fileName = ("".equals(notSecuredFileName) || null == notSecuredFileName) ? fileName : notSecuredFileName;
};
private String calculationSize(double fileSize){
String[] units = {"bytes", "KB", "MB", "GB", "TB", "PB"};
double unitSelector = Math.floor(Math.log(fileSize)/Math.log(1024));
if(fileSize>0){
return Math.round((fileSize/Math.pow(1024, unitSelector))*100)/100d+" "+units[(int)unitSelector];
}else{
return "";
}
}
String fileExt = Utils.getFileExtention(fileName);
String saveName = Utils.generationSaveName() + "." + fileExt;
FileCopyUtils.copy(mFile.getBytes(), new File(path, saveName));
public List<ParamMap> selectEquipStatus(Equip equip) {
return equipMapper.selectEquipStatus(equip);
}
EquipFile equipFile = new EquipFile();
equipFile.setEquKey(equipTmp.getEquKey());
equipFile.setVersionNo(equipTmp.getVersionNo());
equipFile.setOrigNm(fileName);
equipFile.setConvNm(saveName);
equipFile.setFileExtn(fileExt);
equipFile.setFilePath(path);
equipFile.setFileSize(FileSize);
public List<Equip> selectEquipList(Equip equip) {
return equipMapper.selectEquipList(equip);
}
equipFileRepository.save(equipFile);
} else if(equip.getNoUpdateImg() != null) {
EquipFile equipFile = new EquipFile();
equipFile.setEquKey(equipTmp.getEquKey());
equipFile.setVersionNo(equipTmp.getVersionNo());
EquipFile dbEquFile = equipFileRepository.findById(new EquipFileId(equip.getEquKey(), equip.getVersionNo())).orElse(null);
equipFile.setOrigNm(dbEquFile.getOrigNm());
equipFile.setConvNm(dbEquFile.getConvNm());
equipFile.setFileExtn(dbEquFile.getFileExtn());
equipFile.setFilePath(dbEquFile.getFilePath());
equipFile.setFileSize(dbEquFile.getFileSize());
equipFileRepository.save(equipFile);
} else {
EquipFile equipFile = new EquipFile();
equipFile.setEquKey(equipTmp.getEquKey());
equipFile.setVersionNo(equipTmp.getVersionNo());
equipFileRepository.save(equipFile);
}
}
} catch (Exception e) {
throw e;
}
}
public Integer selectEquipListCnt(Equip equip) {
return equipMapper.selectEquipListCnt(equip);
}
public ParamMap selectEduType(Equip equip) {
return equipMapper.selectEduType(equip);
}
public Equip selectEquipInfo(Equip equip) {
return equipMapper.selectEquipInfo(equip);
}
public List<Equip> selectHistoryList(Equip equip) {
return equipMapper.selectHistoryList(equip);
}
@Transactional
public int updateEquip(Equip equip, MultipartHttpServletRequest request) {
try {
Equip dbEquip = equipRepository.findById(new EquipId(equip.getEquKey(), equip.getVersionNo())).orElse(null);
Equip equipTmp = new Equip();
equipTmp.setEquKey(dbEquip.getEquKey());
equipTmp.setVersionNo(dbEquip.getVersionNo()+1);
equipTmp.setMgtOrgan(equip.getMgtOrgan());
equipTmp.setEquType(equip.getEquType());
equipTmp.setDetailType(equip.getDetailType());
equipTmp.setStoredYear(equip.getStoredYear());
equipTmp.setItemQty(equip.getItemQty());
equipTmp.setItemCondition(equip.getItemCondition());
equipTmp.setNote(equip.getNote());
equipTmp.setWrtOrgan(equip.getWrtOrgan());
equipTmp.setWrtPart(equip.getWrtPart());
equipTmp.setWrtTitle(equip.getWrtTitle());
equipTmp.setWrtNm(equip.getWrtNm());
equipTmp.setWrtDt(equip.getWrtDt());
equipRepository.save(equipTmp);
updateFile(equip,equipTmp,request);
EquipLog equLog = new EquipLog();
equLog.setEquType(equip.getEquType());
equLog.setDetailType(equip.getDetailType());
equLog.setElContents("수정");
equLog.setWrtNm(equip.getWrtNm());
equLog.setWrtOrgan(equip.getWrtOrgan());
equLog.setWrtDt(equip.getWrtDt());
equLog.setWrtPart(equip.getWrtPart());
equLog.setWrtTitle(equip.getWrtTitle());
equipLogRepository.save(equLog);
} catch (Exception e) {
e.printStackTrace();
}
return equip.getEquKey();
}
public Equip selectHistoryDetail(Equip equip) {
return equipMapper.selectHistoryDetail(equip);
}
@Transactional
public void equipDelete(List<Equip> equip,UserInfo loginUser) {
for(Equip equ: equip) {
//파일삭제
Equip dbEquip = equipMapper.selectEquipInfo(equ);
if(dbEquip.getOrigNm() != null) {
File file = new File(dbEquip.getFilePath(), dbEquip.getConvNm());
public void updateFile(Equip equip, Equip equipTmp, MultipartHttpServletRequest mRequest) throws Exception {
try {
String path = fileDir+equ;
String FileSize;
File dir = new File(path);
if(!dir.exists()) dir.mkdir();
if(file.exists()) {
//파일등록
List<MultipartFile> mFiles = mRequest.getFiles("file");
for(int i = 0; i < mFiles.size(); i++) {
MultipartFile mFile = mFiles.get(i);
FileSize = calculationSize(mFile.getSize());
if(!"".equals(mFile.getOriginalFilename())){
String fileName = mFile.getOriginalFilename();
if(fileName.contains("\\")){
String notSecuredFileName = fileName.substring(fileName.lastIndexOf("\\") +1);
fileName = ("".equals(notSecuredFileName) || null == notSecuredFileName) ? fileName : notSecuredFileName;
};
file.delete();
}
}
equipRepository.deleteByEquKey(equ.getEquKey());
equipFileRepository.deleteByEquKey(equ.getEquKey());
EquipLog equLog = new EquipLog();
equLog.setEquType(dbEquip.getEquType());
equLog.setDetailType(dbEquip.getDetailType());
equLog.setElContents("삭제");
equLog.setWrtNm(loginUser.getUserNm());
equLog.setWrtOrgan(loginUser.getOgCd());
equLog.setWrtPart(loginUser.getOfcCd());
equLog.setWrtTitle(loginUser.getTitleCd());
equLog.setWrtDt(LocalDateTime.now());
equipLogRepository.save(equLog);
}
}
String fileExt = Utils.getFileExtention(fileName);
String saveName = Utils.generationSaveName() + "." + fileExt;
FileCopyUtils.copy(mFile.getBytes(), new File(path, saveName));
public List<EquipLog> selectEquipLogList(EquipLog equipLog) {
return equipMapper.selectEquipLogList(equipLog);
}
EquipFile equipFile = new EquipFile();
equipFile.setEquKey(equipTmp.getEquKey());
equipFile.setVersionNo(equipTmp.getVersionNo());
equipFile.setOrigNm(fileName);
equipFile.setConvNm(saveName);
equipFile.setFileExtn(fileExt);
equipFile.setFilePath(path);
equipFile.setFileSize(FileSize);
public Integer selectEquipLogListCnt(EquipLog equipLog) {
return equipMapper.selectEquipLogListCnt(equipLog);
}
equipFileRepository.save(equipFile);
} else if(equip.getNoUpdateImg() != null) {
EquipFile equipFile = new EquipFile();
equipFile.setEquKey(equipTmp.getEquKey());
equipFile.setVersionNo(equipTmp.getVersionNo());
EquipFile dbEquFile = equipFileRepository.findById(new EquipFileId(equip.getEquKey(), equip.getVersionNo())).orElse(null);
equipFile.setOrigNm(dbEquFile.getOrigNm());
equipFile.setConvNm(dbEquFile.getConvNm());
equipFile.setFileExtn(dbEquFile.getFileExtn());
equipFile.setFilePath(dbEquFile.getFilePath());
equipFile.setFileSize(dbEquFile.getFileSize());
equipFileRepository.save(equipFile);
} else {
EquipFile equipFile = new EquipFile();
equipFile.setEquKey(equipTmp.getEquKey());
equipFile.setVersionNo(equipTmp.getVersionNo());
equipFileRepository.save(equipFile);
}
}
} catch (Exception e) {
throw e;
}
}
public String selectEquipFirstUserSeq(Equip equip) {
return equipMapper.selectEquipFirstUserSeq(equip);
}
@Transactional
public Integer saveCellPhone(CellPhone cellPhone) {
return cellPhoneRepository.save(cellPhone).getPhoneKey();
}
public ParamMap selectEduType(Equip equip) {
return equipMapper.selectEduType(equip);
}
public List<CellPhone> selectCellPhoneList(CellPhone cellPhone) {
return equipMapper.selectCellPhoneList(cellPhone);
}
public List<Equip> selectHistoryList(Equip equip) {
return equipMapper.selectHistoryList(equip);
}
public Integer selectCellPhoneListCnt(CellPhone cellPhone) {
return equipMapper.selectCellPhoneListCnt(cellPhone);
}
public Equip selectHistoryDetail(Equip equip) {
return equipMapper.selectHistoryDetail(equip);
}
public CellPhone selectCellPhoneInfo(Integer phoneKey) {
return cellPhoneRepository.findById(phoneKey).orElse(null);
}
@Transactional
public void deleteCellPhone(List<CellPhone> cellPhone) {
cellPhoneRepository.deleteAll(cellPhone);
}
@Transactional
public void equipDelete(List<Equip> equip,UserInfo loginUser) {
for(Equip equ: equip) {
//파일삭제
Equip dbEquip = equipMapper.selectEquipInfo(equ);
if(dbEquip.getOrigNm() != null) {
File file = new File(dbEquip.getFilePath(), dbEquip.getConvNm());
public List<ParamMap> selectOrganList(UseList useList) {
return equipMapper.selectOrganList(useList);
}
@Transactional
public void saveUse(UseList useList) {
useList.setYear(year);
Integer useNo = equipMapper.selectLastUseNo(useList);
if(useNo == null) {
useList.setUseNo(year+"-001");
useList.setVersionNo(1);
} else {
useList.setUseNo(year+"-"+String.format("%03d", useNo+1));
useList.setVersionNo(1);
}
useListRepository.save(useList);
}
if(file.exists()) {
public List<UseList> selectUseList(UseList useList) {
return equipMapper.selectUseList(useList);
}
file.delete();
}
}
equipRepository.deleteByEquKey(equ.getEquKey());
equipFileRepository.deleteByEquKey(equ.getEquKey());
EquipLog equLog = new EquipLog();
equLog.setEquType(dbEquip.getEquType());
equLog.setDetailType(dbEquip.getDetailType());
equLog.setElContents("삭제");
equLog.setWrtNm(loginUser.getUserNm());
equLog.setWrtOrgan(loginUser.getOgCd());
equLog.setWrtPart(loginUser.getOfcCd());
equLog.setWrtTitle(loginUser.getTitleCd());
equLog.setWrtDt(LocalDateTime.now());
equipLogRepository.save(equLog);
}
public Integer selectUseListCnt(UseList useList) {
return equipMapper.selectUseListCnt(useList);
}
}
public UseList selectUseInfo(UseList useList) {
return equipMapper.selectUseInfo(useList);
}
@Transactional
public UseList updateUse(UseList useList) {
UseList dbUseList = useListRepository
.findById(new UseListId(useList.getMgtOrgan(),useList.getUseNo(),useList.getVersionNo(),useList.getUseType())).orElse(null);
UseList useTmp = new UseList();
useTmp.setMgtOrgan(dbUseList.getMgtOrgan());
useTmp.setUseNo(dbUseList.getUseNo());
useTmp.setVersionNo(dbUseList.getVersionNo()+1);
useTmp.setUseType(dbUseList.getUseType());
useTmp.setUseDt(useList.getUseDt());
useTmp.setDetailType(useList.getDetailType());
useTmp.setDetailSelf(useList.getDetailSelf());
useTmp.setPeopleCnt(useList.getPeopleCnt());
useTmp.setDescription(useList.getDescription());
useTmp.setWrtOrgan(useList.getWrtOrgan());
useTmp.setWrtPart(useList.getWrtPart());
useTmp.setWrtTitle(useList.getWrtTitle());
useTmp.setWrtUserSeq(useList.getWrtUserSeq());
useTmp.setWrtNm(useList.getWrtNm());
useTmp.setWrtDt(useList.getWrtDt());
return useListRepository.save(useTmp);
}
public List<EquipLog> selectEquipLogList(EquipLog equipLog) {
return equipMapper.selectEquipLogList(equipLog);
}
public List<UseList> selectUseHistoryList(UseList useList) {
return equipMapper.selectUseHistoryList(useList);
}
@Transactional
public void useDelete(List<UseList> useList) {
for(UseList use:useList) {
useListRepository.deleteByMgtOrganAndUseNoAndUseType(use.getMgtOrgan(),use.getUseNo(),use.getUseType());
}
}
public Integer selectEquipLogListCnt(EquipLog equipLog) {
return equipMapper.selectEquipLogListCnt(equipLog);
}
public Integer selectFirstWrtUserSeq(UseList useList) {
return useListRepository.getWrtUserSeq(useList.getMgtOrgan(),useList.getUseNo(),useList.getUseType());
}
public String selectEquipFirstUserSeq(Equip equip) {
return equipMapper.selectEquipFirstUserSeq(equip);
}
@Transactional
public Integer saveCellPhone(CellPhone cellPhone) {
return cellPhoneRepository.save(cellPhone).getPhoneKey();
}
public List<CellPhone> selectCellPhoneList(CellPhone cellPhone) {
return equipMapper.selectCellPhoneList(cellPhone);
}
public Integer selectCellPhoneListCnt(CellPhone cellPhone) {
return equipMapper.selectCellPhoneListCnt(cellPhone);
}
public CellPhone selectCellPhoneInfo(Integer phoneKey) {
return cellPhoneRepository.findById(phoneKey).orElse(null);
}
@Transactional
public void deleteCellPhone(List<CellPhone> cellPhone) {
cellPhoneRepository.deleteAll(cellPhone);
}
public List<ParamMap> selectOrganList(UseList useList) {
return equipMapper.selectOrganList(useList);
}
@Transactional
public void saveUse(UseList useList) {
useList.setYear(year);
Integer useNo = equipMapper.selectLastUseNo(useList);
if(useNo == null) {
useList.setUseNo(year+"-001");
useList.setVersionNo(1);
} else {
useList.setUseNo(year+"-"+String.format("%03d", useNo+1));
useList.setVersionNo(1);
}
useListRepository.save(useList);
}
public List<UseList> selectUseList(UseList useList) {
return equipMapper.selectUseList(useList);
}
public Integer selectUseListCnt(UseList useList) {
return equipMapper.selectUseListCnt(useList);
}
public UseList selectUseInfo(UseList useList) {
return equipMapper.selectUseInfo(useList);
}
@Transactional
public UseList updateUse(UseList useList) {
UseList dbUseList = useListRepository
.findById(new UseListId(useList.getMgtOrgan(),useList.getUseNo(),useList.getVersionNo(),useList.getUseType())).orElse(null);
UseList useTmp = new UseList();
useTmp.setMgtOrgan(dbUseList.getMgtOrgan());
useTmp.setUseNo(dbUseList.getUseNo());
useTmp.setVersionNo(dbUseList.getVersionNo()+1);
useTmp.setUseType(dbUseList.getUseType());
useTmp.setUseDt(useList.getUseDt());
useTmp.setDetailType(useList.getDetailType());
useTmp.setDetailSelf(useList.getDetailSelf());
useTmp.setPeopleCnt(useList.getPeopleCnt());
useTmp.setDescription(useList.getDescription());
useTmp.setWrtOrgan(useList.getWrtOrgan());
useTmp.setWrtPart(useList.getWrtPart());
useTmp.setWrtTitle(useList.getWrtTitle());
useTmp.setWrtUserSeq(useList.getWrtUserSeq());
useTmp.setWrtNm(useList.getWrtNm());
useTmp.setWrtDt(useList.getWrtDt());
return useListRepository.save(useTmp);
}
public List<UseList> selectUseHistoryList(UseList useList) {
return equipMapper.selectUseHistoryList(useList);
}
@Transactional
public void useDelete(List<UseList> useList) {
for(UseList use:useList) {
useListRepository.deleteByMgtOrganAndUseNoAndUseType(use.getMgtOrgan(),use.getUseNo(),use.getUseType());
}
}
public Integer selectFirstWrtUserSeq(UseList useList) {
return useListRepository.getWrtUserSeq(useList.getMgtOrgan(),useList.getUseNo(),useList.getUseType());
}
public EquipFile selectEquipFile(Equip equip) {
return equipFileRepository.findById(new EquipFileId(equip.getEquKey(), equip.getVersionNo())).orElse(null);
}
}

View File

@ -96,9 +96,6 @@
.pl-15{
padding-left: 15%;
}
.pl-23{
padding-left: 23%;
}
.w-30{
width: 30%!important;
}

View File

@ -1,18 +1,18 @@
$(document).ready(function(){
$(".table_id").each(function(){
var rows = $(".table_id:contains('"+$(this).text()+"')");
if(rows.length > 1){
rows.eq(0).attr("rowspan", rows.length);
rows.not(":eq(0)").remove();
}
})
$(".table_id").each(function(){
var rows = $(".table_id:contains('"+$(this).text()+"')");
if(rows.length > 1){
rows.eq(0).attr("rowspan", rows.length);
rows.not(":eq(0)").remove();
}
})
});
$(document).on('click', '#addEquip', function (){
$.ajax({
$.ajax({
url: '/equip/equipEditModal',
type: 'GET',
dataType:"html",
@ -33,13 +33,13 @@ $(document).on('click', '#addEquip', function (){
})
$(document).on('change', '#equType', function (){
const equType = $(this).val();
$.ajax({
const equType = $(this).val();
$.ajax({
url: '/equip/equipTypeSelecBox',
data: {
equType,
},
equType,
},
type: 'GET',
dataType:"html",
success: function(html){
@ -50,236 +50,236 @@ $(document).on('change', '#equType', function (){
}
});
});
$(document).on('click', '#saveEquip', function (){
if($('#mgtOrgan').val() == ''){
alert("관리처를 선택해주세요.");
$('#mgtOrgan').focus();
return false;
}
if($('#equType').val() == ''){
alert("분류를 선택해주세요.");
$('#equType').focus();
return false;
}
if($('#detailType').val() == ''){
alert("세부분류를 선택해주세요.");
$('#detailType').focus();
return false;
}
if($('#itemQty').val() == ''){
alert("수량을 입력해주세요.");
$('#itemQty').focus();
return false;
}
if(confirm("저장하시겠습니까?")){
document.getElementById("mgtOrgan").disabled = false;
let ajaxUrl = "/equip/saveEquip";
const formData = new FormData($("#equipEditForm")[0]);
contentFade("in");
$.ajax({
type : 'POST',
data : formData,
url : ajaxUrl,
processData: false,
contentType: false,
success : function() {
alert("저장되었습니다.");
location.reload();
contentFade("out");
},
error : function(xhr, status) {
alert("저장에 실패하였습니다.")
contentFade("out");
}
})
}
if($('#mgtOrgan').val() == ''){
alert("관리처를 선택해주세요.");
$('#mgtOrgan').focus();
return false;
}
if($('#equType').val() == ''){
alert("분류를 선택해주세요.");
$('#equType').focus();
return false;
}
if($('#detailType').val() == ''){
alert("세부분류를 선택해주세요.");
$('#detailType').focus();
return false;
}
if($('#itemQty').val() == ''){
alert("수량을 입력해주세요.");
$('#itemQty').focus();
return false;
}
if(confirm("저장하시겠습니까?")){
document.getElementById("mgtOrgan").disabled = false;
let ajaxUrl = "/equip/saveEquip";
const formData = new FormData($("#equipEditForm")[0]);
contentFade("in");
$.ajax({
type : 'POST',
data : formData,
url : ajaxUrl,
processData: false,
contentType: false,
success : function() {
alert("저장되었습니다.");
location.reload();
contentFade("out");
},
error : function(xhr, status) {
alert("저장에 실패하였습니다.")
contentFade("out");
}
})
}
});
$(document).on('click', '#equUpdateBtn', function (){
if($('input:checkbox[name=equChk]:checked').length < 1){
alert("게시물을 선택해주세요")
return false;
}
if($('input:checkbox[name=equChk]:checked').length > 1){
alert("한개만 선택해주세요")
return false;
}
const target = $('input:checkbox[name=equChk]:checked');
const equKey = Number(target.parents('tr').find('.equKey').val());
showUpdateModal(equKey);
if($('input:checkbox[name=equChk]:checked').length < 1){
alert("게시물을 선택해주세요")
return false;
}
if($('input:checkbox[name=equChk]:checked').length > 1){
alert("한개만 선택해주세요")
return false;
}
const target = $('input:checkbox[name=equChk]:checked');
const equKey = Number(target.parents('tr').find('.equKey').val());
showUpdateModal(equKey);
})
function showUpdateModal(equKey){
$.ajax({
url: '/equip/updatePage',
data: {equKey: equKey},
type: 'GET',
dataType:"html",
success: function(html){
$("#equipEditModalContent").empty().append(html)
$("#equipModifyModal").modal('show');
$(".mStoredYear").datepicker({
minViewMode: 'years',
format: "yyyy",
language: "ko",
autoclose: true
})
},
error:function(){
}
});
$.ajax({
url: '/equip/updatePage',
data: {equKey: equKey},
type: 'GET',
dataType:"html",
success: function(html){
$("#equipModifyModalContent").empty().append(html)
$("#equipModifyModal").modal('show');
$(".mStoredYear").datepicker({
minViewMode: 'years',
format: "yyyy",
language: "ko",
autoclose: true
})
},
error:function(){
}
});
}
$(document).on('click', '#addImgBtn', function (){
$("#imgUpload").remove();
$("#addImgBtn").hide();
$("#imgUpdate").show();
$("#imgUpload").remove();
$("#addImgBtn").hide();
$("#imgUpdate").show();
})
function deleteImg(equKey,versionNo){
$('#equipModifyForm').append('<input type="hidden" name="deleteFileKey" value="'+equKey+'">',
'<input type="hidden" name="deleteFileVnum" value="'+versionNo+'">');
$("#imgUpload").remove();
$("#deleteImgBtn").hide();
$("#imgUpdate").show();
$('#equipModifyForm').append('<input type="hidden" name="deleteFileKey" value="'+equKey+'">',
'<input type="hidden" name="deleteFileVnum" value="'+versionNo+'">');
$("#imgUpload").remove();
$("#deleteImgBtn").hide();
$("#imgUpdate").show();
}
$(document).on('click', '#updateEquip', function (){
if($('#mMgtOrgan').val() == ''){
alert("관리처를 선택해주세요.");
$('#mMgtOrgan').focus();
return false;
}
if($('#mItemQty').val() == ''){
alert("수량을 입력해주세요.");
$('#mItemQty').focus();
return false;
}
if(confirm("수정하시겠습니까?")){
document.getElementById("mMgtOrgan").disabled = false;
let ajaxUrl = "/equip/updateEquip";
const formData = new FormData($("#equipModifyForm")[0]);
contentFade("in");
$.ajax({
type : 'POST',
data : formData,
url : ajaxUrl,
processData: false,
contentType: false,
success : function(data) {
alert("수정되었습니다.");
showUpdateModal(data);
contentFade("out");
},
error : function(xhr, status) {
alert("수정에 실패하였습니다.")
contentFade("out");
}
})
}
if($('#mMgtOrgan').val() == ''){
alert("관리처를 선택해주세요.");
$('#mMgtOrgan').focus();
return false;
}
if($('#mItemQty').val() == ''){
alert("수량을 입력해주세요.");
$('#mItemQty').focus();
return false;
}
if(confirm("수정하시겠습니까?")){
document.getElementById("mMgtOrgan").disabled = false;
let ajaxUrl = "/equip/updateEquip";
const formData = new FormData($("#equipModifyForm")[0]);
contentFade("in");
$.ajax({
type : 'POST',
data : formData,
url : ajaxUrl,
processData: false,
contentType: false,
success : function(data) {
alert("수정되었습니다.");
showUpdateModal(data);
contentFade("out");
},
error : function(xhr, status) {
alert("수정에 실패하였습니다.")
contentFade("out");
}
})
}
});
$(document).on('click', '#historyBtn', function (){
if($('input:checkbox[name=equChk]:checked').length < 1){
alert("게시물을 선택해주세요")
return false;
}
if($('input:checkbox[name=equChk]:checked').length > 1){
alert("한개만 선택해주세요")
return false;
}
const target = $('input:checkbox[name=equChk]:checked');
const equKey = Number(target.parents('tr').find('.equKey').val());
$.ajax({
url: '/equip/historyView',
data: {equKey: equKey},
type: 'GET',
dataType:"html",
success: function(html){
$("#configEqu").empty().append(html)
$("#equipModifyModal").modal('show');
},
error:function(){
}
});
if($('input:checkbox[name=equChk]:checked').length < 1){
alert("장비를 선택해주세요")
return false;
}
if($('input:checkbox[name=equChk]:checked').length > 1){
alert("한개만 선택해주세요")
return false;
}
const target = $('input:checkbox[name=equChk]:checked');
const equKey = Number(target.parents('tr').find('.equKey').val());
$.ajax({
url: '/equip/historyView',
data: {equKey: equKey},
type: 'GET',
dataType:"html",
success: function(html){
$("#equipHistoryModalContent").empty().append(html)
$("#equipHistoryModal").modal('show');
},
error:function(){
}
});
})
$(document).on('click', '.historyInfoTr', function (){
$(this).find('.hisChk').prop('checked',true)
if($(this).find('.hisChk').prop('checked')){
$('.hisChk').prop('checked',false);
$(this).find('.hisChk').prop('checked',true)
}
$(this).find('.hisChk').prop('checked',true)
if($(this).find('.hisChk').prop('checked')){
$('.hisChk').prop('checked',false);
$(this).find('.hisChk').prop('checked',true)
}
$.ajax({
url: '/equip/HistoryDetail',
data: {
equKey : Number($(this).find(".equKey").val()),
versionNo : Number($(this).find(".verNo").val())
},
type: 'GET',
dataType:"json",
success: function(data){
$('#vSosok').val(data.sosok);
$('#vEquType').val(data.equType);
$('#vDetailType').val(data.detailType);
$('#vStoredYear').val(data.storedYear);
$('#vItemQty').val(data.itemQty);
$('#vItemCondition').val(data.itemCondition);
$('#vNote').val(data.note);
$('#vImgName').val(data.origNm);
},
error:function(){
}
url: '/equip/HistoryDetail',
data: {
equKey : Number($(this).find(".equKey").val()),
versionNo : Number($(this).find(".verNo").val())
},
type: 'GET',
dataType:"json",
success: function(data){
$('#vSosok').val(data.sosok);
$('#vEquType').val(data.equType);
$('#vDetailType').val(data.detailType);
$('#vStoredYear').val(data.storedYear);
$('#vItemQty').val(data.itemQty);
$('#vItemCondition').val(data.itemCondition);
$('#vNote').val(data.note);
$('#vImgName').attr("src", "/equip/getEquipImg?equKey="+data.equKey+"&versionNo="+data.versionNo);
$('#vImgName').show();
},
error:function(){
}
});
})
$(document).on('click', '#equDeleteBtn', function (){
if(confirm("선택한 대상을 삭제처리 하시겠습니까?")){
const checkArr = [];
$('input:checkbox[name=equChk]:checked').each(function (idx, el){
checkArr.push({});
const target = $(el);
checkArr[idx].equKey = Number(target.parents('tr').find('.equKey').val());
})
deleteEquip(checkArr);
if(confirm("선택한 대상을 삭제처리 하시겠습니까?")){
const checkArr = [];
$('input:checkbox[name=equChk]:checked').each(function (idx, el){
checkArr.push({});
const target = $(el);
checkArr[idx].equKey = Number(target.parents('tr').find('.equKey').val());
})
deleteEquip(checkArr);
}
}
})
$(document).on('click', '#deleteEquip', function (){
if(confirm("선택한 대상을 삭제처리 하시겠습니까?")){
const checkArr = [];
checkArr.push({});
checkArr[0].equKey = Number($('#mEquKey').val());
deleteEquip(checkArr);
}
if(confirm("선택한 대상을 삭제처리 하시겠습니까?")){
const checkArr = [];
checkArr.push({});
checkArr[0].equKey = Number($('#mEquKey').val());
deleteEquip(checkArr);
}
})
function deleteEquip(checkArr){
$.ajax({
type : 'POST',
url : "/equip/epuipDelete",
data : JSON.stringify(checkArr),
contentType: 'application/json',
beforeSend: function (xhr){
xhr.setRequestHeader($("[name='_csrf_header']").val(), $("[name='_csrf']").val());
},
success : function() {
alert("삭제처리 되었습니다.");
location.reload();
},
error : function(xhr, status) {
alert("삭제처리에 실패하였습니다");
}
})
$.ajax({
type : 'POST',
url : "/equip/epuipDelete",
data : JSON.stringify(checkArr),
contentType: 'application/json',
beforeSend: function (xhr){
xhr.setRequestHeader($("[name='_csrf_header']").val(), $("[name='_csrf']").val());
},
success : function() {
alert("삭제처리 되었습니다.");
location.reload();
},
error : function(xhr, status) {
alert("삭제처리에 실패하였습니다");
}
})
}
$(document).ready( function() {
@ -289,13 +289,13 @@ $(document).ready( function() {
});
$(document).on('click', '#statusExcel', function (){
if(confirm("엑셀로 다운로드 하시겠습니까?")){
location.href='/equip/statusExcelDown'
}
if(confirm("엑셀로 다운로드 하시겠습니까?")){
location.href='/equip/statusExcelDown'
}
})
$(document).on('click', '.modalCloseBtn', function (){
location.reload();
location.reload();
})

View File

@ -7,19 +7,19 @@ $(function(){
})
$(document).on('click', '#addPvre', function (){
const useType = "PVRE";
showEditModal(useType);
const useType = "PVRE";
showEditModal(useType);
})
$(document).on('click', '#addQir', function (){
const useType = "QIR";
showEditModal(useType);
const useType = "QIR";
showEditModal(useType);
})
function showEditModal(useType){
$.ajax({
$.ajax({
url: '/equip/useEditModal',
data: {useType: useType},
data: {useType: useType},
type: 'GET',
dataType:"html",
success: function(html){
@ -39,59 +39,59 @@ function showEditModal(useType){
}
$(document).on('click', '#saveUse', function (){
if($('#mgtOrgan').val() == ""){
alert("사용관서를 선택해주세요.");
$('#mgtOrgan').focus();
return false;
}
if(confirm("저장하시겠습니까?")){
document.getElementById("mgtOrgan").disabled = false;
contentFade("in");
const formData = new FormData($("#useFm")[0]);
$.ajax({
type : 'POST',
data : formData,
url : "/equip/saveUse",
processData: false,
contentType: false,
success : function(result) {
alert("저장되었습니다.");
contentFade("out");
location.reload();
},
error : function(xhr, status) {
alert("저장에 실패하였습니다.")
contentFade("out");
}
})
}
if($('#mgtOrgan').val() == ""){
alert("사용관서를 선택해주세요.");
$('#mgtOrgan').focus();
return false;
}
if(confirm("저장하시겠습니까?")){
document.getElementById("mgtOrgan").disabled = false;
contentFade("in");
const formData = new FormData($("#useFm")[0]);
$.ajax({
type : 'POST',
data : formData,
url : "/equip/saveUse",
processData: false,
contentType: false,
success : function(result) {
alert("저장되었습니다.");
contentFade("out");
location.reload();
},
error : function(xhr, status) {
alert("저장에 실패하였습니다.")
contentFade("out");
}
})
}
})
$(document).on('change', '#detailType', function (){
if($(this).val() == 'PVREUSE007' || $(this).val() == 'QIRUSE006'){
$('#detailSelf').show();
}else{
$('#detailSelf').hide();
$('#detailSelf').val('');
}
if($(this).val() == 'PVREUSE007' || $(this).val() == 'QIRUSE006'){
$('#detailSelf').show();
}else{
$('#detailSelf').hide();
$('#detailSelf').val('');
}
});
$(document).on('click', '.useTr', function (event){
const target = event.target;
if(!(target.className === "useChk" ||$(target).parents("td").length>0)){
const useNo = $(target).parent('tr').data("useno");
const useType = $(target).parent('tr').data("usetype");
const mgtOrgan = $(target).parent('tr').data("mgtorgan");
showMdifyModal(useNo,useType,mgtOrgan);
}
const target = event.target;
if(!(target.className === "useChk" ||$(target).parents("td").length>0)){
const useNo = $(target).parent('tr').data("useno");
const useType = $(target).parent('tr').data("usetype");
const mgtOrgan = $(target).parent('tr').data("mgtorgan");
showModifyModal(useNo,useType,mgtOrgan);
}
});
function showMdifyModal(useNo,useType,mgtOrgan){
$.ajax({
function showModifyModal(useNo,useType,mgtOrgan){
$.ajax({
url: '/equip/useModifyModal',
data: {useNo: useNo,
useType: useType,
mgtOrgan: mgtOrgan},
data: {useNo: useNo,
useType: useType,
mgtOrgan: mgtOrgan},
type: 'GET',
dataType:"html",
success: function(html){
@ -103,10 +103,10 @@ function showMdifyModal(useNo,useType,mgtOrgan){
autoclose: true
});
if($('#mDetailType').val() != 'PVREUSE007' && $('#mDetailType').val() != 'QIRUSE006'){
$('#mDetailSelf').hide();
}else{
$('#mDetailSelf').show();
}
$('#mDetailSelf').hide();
}else{
$('#mDetailSelf').show();
}
},
error:function(){
@ -115,152 +115,152 @@ function showMdifyModal(useNo,useType,mgtOrgan){
}
$(document).on('change', '#mDetailType', function (){
if($(this).val() == 'PVREUSE007' || $(this).val() == 'QIRUSE006'){
$('#mDetailSelf').show();
}else{
$('#mDetailSelf').hide();
$('#mDetailSelf').val('');
}
if($(this).val() == 'PVREUSE007' || $(this).val() == 'QIRUSE006'){
$('#mDetailSelf').show();
}else{
$('#mDetailSelf').hide();
$('#mDetailSelf').val('');
}
});
$(document).on('click', '#updateUse', function (){
if(confirm("수정하시겠습니까?")){
document.getElementById("mMgtOrgan").disabled = false;
contentFade("in");
const formData = new FormData($("#useUpdateFm")[0]);
$.ajax({
type : 'POST',
data : formData,
url : "/equip/updateUse",
processData: false,
contentType: false,
success : function(data) {
alert("수정되었습니다.");
contentFade("out");
showMdifyModal(data.useNo,data.useType,data.mgtOrgan);
},
error : function(xhr, status) {
alert("수정에 실패하였습니다.")
contentFade("out");
}
})
}
if(confirm("수정하시겠습니까?")){
document.getElementById("mMgtOrgan").disabled = false;
contentFade("in");
const formData = new FormData($("#useUpdateFm")[0]);
$.ajax({
type : 'POST',
data : formData,
url : "/equip/updateUse",
processData: false,
contentType: false,
success : function(data) {
alert("수정되었습니다.");
contentFade("out");
showModifyModal(data.useNo,data.useType,data.mgtOrgan);
},
error : function(xhr, status) {
alert("수정에 실패하였습니다.")
contentFade("out");
}
})
}
})
$(document).on('click', '#historyBtn', function (){
if($('input:checkbox[name=useChk]:checked').length < 1){
alert("게시물을 선택해주세요")
return false;
}
if($('input:checkbox[name=useChk]:checked').length > 1){
alert("한개만 선택해주세요")
return false;
}
const target = $('input:checkbox[name=useChk]:checked');
const useNo = $(target).parent().parent('tr').data("useno");
const useType = $(target).parent().parent('tr').data("usetype");
const mgtOrgan = $(target).parent().parent('tr').data("mgtorgan");
$.ajax({
url: '/equip/useHistory',
data: {useNo: useNo,
useType: useType,
mgtOrgan: mgtOrgan},
type: 'GET',
dataType:"html",
success: function(html){
$("#useEditModalContent").empty().append(html);
$("#useEditModal").modal('show');
$('#vDetailSelf').hide();
},
error:function(){
}
});
})
$(document).on('click', '.historyTr', function (event){
const target = event.target;
$(this).find('.hisChk').prop('checked',true)
if($(this).find('.hisChk').prop('checked')){
$('.hisChk').prop('checked',false);
$(this).find('.hisChk').prop('checked',true)
}
$.ajax({
url: '/equip/HistoryView',
data: {
useNo: $(target).parents('tr').data("useno"),
versionNo : Number($(target).parents('tr').data("verno")),
useType : $(target).parents('tr').data("usetype"),
mgtOrgan : $(target).parents('tr').data("mgtorgan")
},
if($('input:checkbox[name=useChk]:checked').length < 1){
alert("게시물을 선택해주세요")
return false;
}
if($('input:checkbox[name=useChk]:checked').length > 1){
alert("한개만 선택해주세요")
return false;
}
const target = $('input:checkbox[name=useChk]:checked');
const useNo = $(target).parent().parent('tr').data("useno");
const useType = $(target).parent().parent('tr').data("usetype");
const mgtOrgan = $(target).parent().parent('tr').data("mgtorgan");
$.ajax({
url: '/equip/useHistory',
data: {useNo: useNo,
useType: useType,
mgtOrgan: mgtOrgan},
type: 'GET',
dataType:"json",
success: function(data){
$('#vSosok').val(data.sosok);
$('#vUseDt').val(data.useDt);
$('#vDetailType').val(data.detailTypeName);
if(data.detailType != 'PVREUSE007' && data.detailType != 'QIRUSE006'){
$('#vDetailSelf').hide();
$('#vDetailSelf').val('');
}else{
$('#vDetailSelf').show();
$('#vDetailSelf').val(data.detailSelf);
}
$('#vCnt').val(data.peopleCnt);
$('#vDescription').val(data.description);
dataType:"html",
success: function(html){
$("#useEditModalContent").empty().append(html);
$("#useEditModal").modal('show');
$('#vDetailSelf').hide();
},
error:function(){
}
});
});
})
$(document).on('click', '.historyTr', function (event){
const target = event.target;
$(this).find('.hisChk').prop('checked',true)
if($(this).find('.hisChk').prop('checked')){
$('.hisChk').prop('checked',false);
$(this).find('.hisChk').prop('checked',true)
}
$.ajax({
url: '/equip/HistoryView',
data: {
useNo: $(target).parents('tr').data("useno"),
versionNo : Number($(target).parents('tr').data("verno")),
useType : $(target).parents('tr').data("usetype"),
mgtOrgan : $(target).parents('tr').data("mgtorgan")
},
type: 'GET',
dataType:"json",
success: function(data){
$('#vSosok').val(data.sosok);
$('#vUseDt').val(data.useDt);
$('#vDetailType').val(data.detailTypeName);
if(data.detailType != 'PVREUSE007' && data.detailType != 'QIRUSE006'){
$('#vDetailSelf').hide();
$('#vDetailSelf').val('');
}else{
$('#vDetailSelf').show();
$('#vDetailSelf').val(data.detailSelf);
}
$('#vCnt').val(data.peopleCnt);
$('#vDescription').val(data.description);
},
error:function(){
}
});
})
$(document).on('click', '#deleteUse', function (){
if($('input:checkbox[name=useChk]:checked').length < 1){
alert("삭제할 게시물을 선택해주세요")
return false;
}
if(confirm("선택한 대상을 삭제처리 하시겠습니까?")){
const checkArr = [];
$('input:checkbox[name=useChk]:checked').each(function (idx, el){
checkArr.push({});
const target = $(el);
checkArr[idx].useNo = target.parents('tr').data("useno");
checkArr[idx].mgtOrgan = target.parents('tr').data("mgtorgan");
checkArr[idx].useType = target.parents('tr').data("usetype");
})
deleteUse(checkArr);
}
if($('input:checkbox[name=useChk]:checked').length < 1){
alert("삭제할 게시물을 선택해주세요")
return false;
}
if(confirm("선택한 대상을 삭제처리 하시겠습니까?")){
const checkArr = [];
$('input:checkbox[name=useChk]:checked').each(function (idx, el){
checkArr.push({});
const target = $(el);
checkArr[idx].useNo = target.parents('tr').data("useno");
checkArr[idx].mgtOrgan = target.parents('tr').data("mgtorgan");
checkArr[idx].useType = target.parents('tr').data("usetype");
})
deleteUse(checkArr);
}
})
function deleteUse(checkArr){
$.ajax({
type : 'POST',
url : "/equip/useDelete",
data : JSON.stringify(checkArr),
contentType: 'application/json',
beforeSend: function (xhr){
xhr.setRequestHeader($("[name='_csrf_header']").val(), $("[name='_csrf']").val());
},
success : function() {
alert("삭제처리 되었습니다.");
location.reload();
},
error : function(xhr, status) {
alert("삭제처리에 실패하였습니다");
}
})
$.ajax({
type : 'POST',
url : "/equip/useDelete",
data : JSON.stringify(checkArr),
contentType: 'application/json',
beforeSend: function (xhr){
xhr.setRequestHeader($("[name='_csrf_header']").val(), $("[name='_csrf']").val());
},
success : function() {
alert("삭제처리 되었습니다.");
location.reload();
},
error : function(xhr, status) {
alert("삭제처리에 실패하였습니다");
}
})
}
$(document).on('click', '#goExcel', function (){
if(confirm("엑셀로 다운로드 하시겠습니까?")){
$('input[name=excel]').val('Y');
$('#searchFm').submit();
$('input[name=excel]').val('');
}else{
false;
}
if(confirm("엑셀로 다운로드 하시겠습니까?")){
$('input[name=excel]').val('Y');
$('#searchFm').submit();
$('input[name=excel]').val('');
}else{
false;
}
})
$(document).ready( function() {
@ -270,5 +270,5 @@ $(document).ready( function() {
});
$(document).on('click', '#closeModal', function (){
location.reload();
location.reload();
})

View File

@ -20,7 +20,7 @@
<input type="hidden" name="wrtTitle" th:value="${info.wrtTitle}">
<input type="hidden" name="wrtUserSeq" th:value="${info.wrtUserSeq}">
<input type="hidden" name="wrtNm" th:value="${info.wrtNm}">
<div class="row mb-3">
<div class="row mb-1">
<label for="cat1Cd" class="col-sm-4 col-form-label col-form-label-sm text-center">관리처</label>
<div class="col-sm-6">
<select class="form-select form-select-sm" id="mgtOrgan" name="mgtOrgan" th:disabled="${accessAuth ne 'ACC003'}">
@ -39,7 +39,7 @@
</div>
</div>
<div class="row mb-1">
<label for="ogCd" class="col-sm-4 col-form-label text-center">사용자</label>
<label for="ogCd" class="col-sm-4 col-form-label col-form-label-sm text-center">사용자</label>
<div class="col-sm-6">
<select class="form-select form-select-sm" id="pUserSeq" name="pUserSeq">
<option value="">선택</option>
@ -51,34 +51,34 @@
</select>
</div>
</div>
<div class="row mb-3">
<div class="row mb-1">
<label for="cat1Cd" class="col-sm-4 col-form-label col-form-label-sm text-center">전화번호</label>
<div class="col-sm-6">
<input type="text" class="form-control" id="telNo" name="telNo" th:value="${info.telNo}" placeholder="EX: 010-0000-0000">
<input type="text" class="form-control form-control-sm" id="telNo" name="telNo" th:value="${info.telNo}" placeholder="EX: 010-0000-0000">
</div>
</div>
<div class="row mb-3">
<div class="row mb-1">
<label for="cat3Cd" class="col-sm-4 col-form-label col-form-label-sm text-center">등록외부메일</label>
<div class="col-sm-6">
<input type="text" class="form-control" id="extMail" name="extMail" th:value="${info.extMail}" placeholder="EX: test@test.com">
<input type="text" class="form-control form-control-sm" id="extMail" name="extMail" th:value="${info.extMail}" placeholder="EX: test@test.com">
</div>
</div>
<div class="row mb-3">
<label for="cat3Cd" class="col-sm-4 col-form-label col-form-label-sm text-center">웹엑스<br>미팅번호</label>
<div class="row mb-1">
<label for="cat3Cd" class="col-sm-4 col-form-label col-form-label-sm text-center">웹엑스 미팅번호</label>
<div class="col-sm-6">
<input type="text" class="form-control" id="webexNo" name="webexNo" th:value="${info.webexNo}">
<input type="text" class="form-control form-control-sm" id="webexNo" name="webexNo" th:value="${info.webexNo}">
</div>
</div>
<div class="row mb-3">
<div class="row mb-1">
<label for="cat2Cd" class="col-sm-4 col-form-label col-form-label-sm text-center">카카오톡 ID</label>
<div class="col-sm-6">
<input type="text" class="form-control" id="katalkId" name="katalkId" th:value="${info.katalkId}">
<input type="text" class="form-control form-control-sm" id="katalkId" name="katalkId" th:value="${info.katalkId}">
</div>
</div>
<div class="row mb-3">
<div class="row mb-1">
<label for="cat3Cd" class="col-sm-4 col-form-label col-form-label-sm text-center">비고</label>
<div class="col-sm-6">
<input type="text" class="form-control" id="description" name="description" th:value="${info.description}">
<input type="text" class="form-control form-control-sm" id="description" name="description" th:value="${info.description}">
</div>
</div>
</form>

View File

@ -117,14 +117,8 @@
</main>
<div class="modal fade" id="cellPhoneEditModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="userEditModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg modal-dialog-scrollable">
<div class="modal-dialog modal-dialog-scrollable">
<div class="modal-content" id="cellPhoneEditModalContent">
<div class="modal-header bg-dark">
</div>
<div class="modal-body">
<div class="tab-content bg-white border border-top-0" id="configCellPhone">
</div>
</div>
</div>
</div>
</div>

View File

@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="ko" xmlns:th="http://www.thymeleaf.org">
<div class="modal-header bg-dark">
<h5 class="modal-title text-white" id="menuEditModalLabel">등록</h5>
<h5 class="modal-title text-white" id="menuEditModalLabel">장비 등록</h5>
<button type="button" class="btn-close f-invert" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
@ -43,13 +43,13 @@
<div class="row mb-3">
<label for="cat3Cd" class="col-sm-4 col-form-label col-form-label-sm text-center">취득연도</label>
<div class="col-sm-6">
<input type="text" class="form-control storedYear" name="storedYear" readonly>
<input type="text" class="form-control form-control-sm storedYear" name="storedYear" readonly>
</div>
</div>
<div class="row mb-3">
<label for="cat3Cd" class="col-sm-4 col-form-label col-form-label-sm text-center">보유량</label>
<div class="col-sm-6">
<input type="number" class="form-control" id="itemQty" name="itemQty" placeholder="수량 직접입력">
<input type="number" class="form-control form-control-sm" id="itemQty" name="itemQty" placeholder="수량 직접입력">
</div>
</div>
<div class="row mb-3">
@ -66,13 +66,13 @@
<div class="row mb-3">
<label for="cat3Cd" class="col-sm-4 col-form-label col-form-label-sm text-center">비고</label>
<div class="col-sm-6">
<input type="text" class="form-control" name="note">
<input type="text" class="form-control form-control-sm" name="note">
</div>
</div>
<div class="row mb-3">
<label for="cat3Cd" class="col-sm-4 col-form-label col-form-label-sm text-center">장비사진</label>
<div class="col-sm-6">
<input type="file" class="form-control" name="file" accept="image/gif,image/jpeg,image/png">
<input type="file" class="form-control form-control-sm" name="file" accept="image/gif,image/jpeg,image/png">
</div>
</div>
</form>

View File

@ -1,103 +1,93 @@
<!DOCTYPE html>
<html lang="ko" xmlns:th="http://www.thymeleaf.org">
<input type="hidden" name="_csrf_header" th:value="${_csrf.headerName}"/>
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/>
<div class="modal-header bg-dark">
<h5 class="modal-title text-white">수정이력</h5>
<button type="button" class="btn-close f-invert" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="row mx-0">
<div class="col-100 card text-center">
<div class="card-body">
<div class="row">
</div>
<div class="row justify-content-start">
<div class="col-4">
<div class="card">
<div class="card-body">
<div class="row">
<table class="table table-sm table-hover table-bordered" id="categoryTable">
<thead>
<tr class="table-secondary">
<th></th>
<th>작성자</th>
<th>등록일</th>
</tr>
</thead>
<tbody class="table-group-divider overflow-scroll">
<tr class="historyInfoTr" th:each="equInfo:${equList}">
<td><input type="checkbox" class="hisChk">
<input type="hidden" class="equKey" th:value="${equInfo.equKey}">
<input type="hidden" class="verNo" th:value="${equInfo.versionNo}" >
</td>
<td th:text="|${equInfo.wrtTitle} ${equInfo.wrtNm}|"></td>
<td th:text="${#temporals.format(equInfo.wrtDt, 'yyyy-MM-dd')}"></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<input type="hidden" name="_csrf_header" th:value="${_csrf.headerName}"/>
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/>
<div class="modal-header bg-dark">
<h5 class="modal-title text-white">수정이력</h5>
<button type="button" class="btn-close f-invert" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body text-center">
<div class="card">
<div class="card-body">
<div class="row justify-content-start">
<div class="col-4">
<table class="table table-sm table-hover table-bordered" id="categoryTable">
<thead>
<tr class="table-secondary">
<th></th>
<th>작성자</th>
<th>등록일</th>
</tr>
</thead>
<tbody class="table-group-divider overflow-scroll">
<tr class="historyInfoTr" th:each="equInfo:${equList}">
<td><input type="checkbox" class="hisChk">
<input type="hidden" class="equKey" th:value="${equInfo.equKey}">
<input type="hidden" class="verNo" th:value="${equInfo.versionNo}" >
</td>
<td th:text="|${equInfo.wrtTitle} ${equInfo.wrtNm}|"></td>
<td th:text="${#temporals.format(equInfo.wrtDt, 'yyyy-MM-dd')}"></td>
</tr>
</tbody>
</table>
</div>
<div class="col-8" id="valueDiv">
<div class="row mb-3">
<label for="vSosok" class="col-sm-4 col-form-label col-form-label-sm text-center">관리처</label>
<div class="col-sm-6">
<input type="text" class="form-control form-control-sm" id="vSosok" readonly>
</div>
</div>
<div class="row mb-3">
<label for="vEquType" class="col-sm-4 col-form-label col-form-label-sm text-center">분류</label>
<div class="col-sm-6">
<input type="text" class="form-control form-control-sm" id="vEquType" readonly>
</div>
</div>
<div class="row mb-3">
<label for="vDetailType" class="col-sm-4 col-form-label col-form-label-sm text-center">세부분류</label>
<div class="col-sm-6">
<input type="text" class="form-control form-control-sm" id="vDetailType" readonly>
</div>
</div>
<div class="row mb-3">
<label for="vStoredYear" class="col-sm-4 col-form-label col-form-label-sm text-center">취득연도</label>
<div class="col-sm-6">
<input type="text" class="form-control form-control-sm" id="vStoredYear" readonly>
</div>
</div>
<div class="row mb-3">
<label for="vItemQty" class="col-sm-4 col-form-label col-form-label-sm text-center">보유량</label>
<div class="col-sm-6">
<input type="text" class="form-control form-control-sm" id="vItemQty" readonly>
</div>
</div>
<div class="row mb-3">
<label for="vItemCondition" class="col-sm-4 col-form-label col-form-label-sm text-center">상태</label>
<div class="col-sm-6">
<input type="text" class="form-control form-control-sm" id="vItemCondition" readonly>
</div>
</div>
<div class="row mb-3">
<label for="vNote" class="col-sm-4 col-form-label col-form-label-sm text-center">비고</label>
<div class="col-sm-6">
<input type="text" class="form-control form-control-sm" id="vNote" readonly>
</div>
</div>
<div class="row mb-3">
<label for="vImgName" class="col-sm-4 col-form-label col-form-label-sm text-center">장비사진</label>
<div class="col-sm-6">
<img id="vImgName" src="" alt="첨부이미지" style="width: 100%; height: 100%; display: none;" />
</div>
<div class="col-8" id="valueDiv">
<div class="row mb-3">
<label for="cat1Cd" class="col-sm-4 col-form-label col-form-label-sm text-center">관리처</label>
<div class="col-sm-6">
<input type="text" id="vSosok" readonly>
</div>
</div>
<div class="row mb-3">
<label for="cat1Cd" class="col-sm-4 col-form-label col-form-label-sm text-center">분류</label>
<div class="col-sm-6">
<input type="text" id="vEquType" readonly>
</div>
</div>
<div class="row mb-3">
<label for="cat2Cd" class="col-sm-4 col-form-label col-form-label-sm text-center">세부분류</label>
<div class="col-sm-6">
<input type="text" id="vDetailType" readonly>
</div>
</div>
<div class="row mb-3">
<label for="cat3Cd" class="col-sm-4 col-form-label col-form-label-sm text-center">취득연도</label>
<div class="col-sm-6">
<input type="text" id="vStoredYear" readonly>
</div>
</div>
<div class="row mb-3">
<label for="cat3Cd" class="col-sm-4 col-form-label col-form-label-sm text-center">보유량</label>
<div class="col-sm-6">
<input type="text" id="vItemQty" readonly>
</div>
</div>
<div class="row mb-3">
<label for="cat2Cd" class="col-sm-4 col-form-label col-form-label-sm text-center">상태</label>
<div class="col-sm-6">
<input type="text" id="vItemCondition" readonly>
</div>
</div>
<div class="row mb-3">
<label for="cat3Cd" class="col-sm-4 col-form-label col-form-label-sm text-center">비고</label>
<div class="col-sm-6">
<input type="text" id="vNote" readonly>
</div>
</div>
<div class="row mb-3">
<label for="cat3Cd" class="col-sm-4 col-form-label col-form-label-sm text-center">장비사진</label>
<div class="col-sm-6">
<input type="text" id="vImgName" readonly>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer justify-content-between bg-light">
<div class="col-auto">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer justify-content-between bg-light">
<div class="col-auto">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button>
</div>
</div>
</html>

View File

@ -13,24 +13,31 @@
<div class="row mx-0">
<div class="col-12 card bg-light text-center">
<div class="card-body">
<form method="get" th:action="@{/equip/List}">
<input type="hidden" name="pageIndex" id="pageIndex" th:value="${searchParams.pageIndex}">
<input type="hidden" name="detailType" th:value="${searchParams.detailType}">
<div class="row justify-content-between py-1">
<div class="col-auto">
<select class="form-select form-select-sm" name="rowCnt" id="rowCnt">
<th:block th:each="num : ${#numbers.sequence(1,5)}">
<option th:value="${num*10}" th:text="${num*10}" th:selected="${searchParams.rowCnt==num*10}"></option>
</th:block>
</select>
</div>
<div class="col-auto">
<div class="row justify-content-end">
<input type="submit" class="btn btn-sm btn-primary col-auto d-none" id="searchBtn" value="검색">
<div class="row justify-content-between py-1">
<div class="col-auto">
<form method="get" th:action="@{/equip/List}">
<input type="hidden" name="pageIndex" id="pageIndex" th:value="${searchParams.pageIndex}">
<input type="hidden" name="detailType" th:value="${searchParams.detailType}">
<div class="col-row">
<div class="col-auto">
<select class="form-select form-select-sm" name="rowCnt" id="rowCnt">
<th:block th:each="num : ${#numbers.sequence(1,5)}">
<option th:value="${num*10}" th:text="${num*10}" th:selected="${searchParams.rowCnt==num*10}"></option>
</th:block>
</select>
</div>
<div class="col-auto">
<div class="row justify-content-end">
<input type="submit" class="btn btn-sm btn-primary col-auto d-none" id="searchBtn" value="검색">
</div>
</div>
</div>
</div>
</form>
</div>
</form>
<div class="col-auto">
<a class="btn btn-info" href="/equip/equipStatus">돌아가기</a>
</div>
</div>
<div class="row justify-content-start">
<div class="col-12">
<div class="card">
@ -113,15 +120,15 @@
</div>
</main>
<div class="modal fade" id="equipModifyModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="userEditModalLabel" aria-hidden="true">
<div class="modal fade" id="equipModifyModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="equipModifyModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-scrollable">
<div class="modal-content" id="equipModifyModalContent">
</div>
</div>
</div>
<div class="modal fade" id="equipHistoryModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="equipHistoryModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg modal-dialog-scrollable">
<div class="modal-content" id="equipEditModalContent">
<div class="modal-header bg-dark">
</div>
<div class="modal-body">
<div class="tab-content border bg-white border-top-0" id="configEqu">
</div>
</div>
<div class="modal-content" id="equipHistoryModalContent">
</div>
</div>
</div>

View File

@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="ko" xmlns:th="http://www.thymeleaf.org">
<div class="modal-header bg-dark">
<h5 class="modal-title text-white" id="menuEditModalLabel">수정</h5>
<h5 class="modal-title text-white" id="menuEditModalLabel">장비 수정</h5>
<button type="button" class="btn-close modalCloseBtn f-invert" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
@ -11,89 +11,93 @@
<input type="hidden" id="mEquKey" name="equKey" th:value="${equInfo.equKey}">
<input type="hidden" name="versionNo" th:value="${equInfo.versionNo}">
<div class="row mb-3">
<label for="cat1Cd" class="col-sm-4 col-form-label col-form-label-sm text-center">관리처</label>
<label for="mMgtOrgan" class="col-sm-4 col-form-label col-form-label-sm text-center">관리처</label>
<div class="col-sm-6">
<select class="form-select form-select-sm" id="mMgtOrgan" name="mgtOrgan" th:disabled="${accessAuth ne 'ACC003'}">
<option value="">선택</option>
<th:block th:each="commonCode:${session.commonCode.get('OG')}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}" th:selected="${commonCode.itemCd} == ${equInfo.mgtOrgan}"></option>
</th:block>
</select>
<option value="">선택</option>
<th:block th:each="commonCode:${session.commonCode.get('OG')}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}" th:selected="${commonCode.itemCd} == ${equInfo.mgtOrgan}"></option>
</th:block>
</select>
</div>
</div>
<div class="row mb-3">
<label for="cat1Cd" class="col-sm-4 col-form-label col-form-label-sm text-center">분류</label>
<label for="equType" class="col-sm-4 col-form-label col-form-label-sm text-center">분류</label>
<div class="col-sm-6">
<select class="form-select form-select-sm" id="equType" name="equType">
<option value="">-분류 선택-</option>
<th:block th:each="commonCode:${session.commonCode.get('IT')}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}" th:selected="${commonCode.itemCd} == ${equInfo.equType}"></option>
</th:block>
<th:block th:each="commonCode:${session.commonCode.get('IT')}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}" th:selected="${commonCode.itemCd} == ${equInfo.equType}"></option>
</th:block>
</select>
</div>
</div>
<div class="row mb-3">
<label for="cat2Cd" class="col-sm-4 col-form-label col-form-label-sm text-center">세부분류</label>
<label for="detailType" class="col-sm-4 col-form-label col-form-label-sm text-center">세부분류</label>
<div class="col-sm-6">
<select class="form-select form-select-sm" id="detailType" name="detailType">
<option value="">-세부분류 선택-</option>
<th:block th:each="commonCode:${session.commonCode.get(equInfo.equType)}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}" th:selected="${commonCode.itemCd} == ${equInfo.detailType}"></option>
</th:block>
<option value="">-세부분류 선택-</option>
<th:block th:each="commonCode:${session.commonCode.get(equInfo.equType)}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}" th:selected="${commonCode.itemCd} == ${equInfo.detailType}"></option>
</th:block>
</select>
</div>
</div>
<div class="row mb-3">
<label for="cat3Cd" class="col-sm-4 col-form-label col-form-label-sm text-center">취득연도</label>
<label for="storedYear" class="col-sm-4 col-form-label col-form-label-sm text-center">취득연도</label>
<div class="col-sm-6">
<input type="text" class="form-control mStoredYear" name="storedYear" th:value="${equInfo.storedYear}" readonly>
<input type="text" class="form-control form-control-sm mStoredYear" id="storedYear" name="storedYear" th:value="${equInfo.storedYear}" readonly>
</div>
</div>
<div class="row mb-3">
<label for="cat3Cd" class="col-sm-4 col-form-label col-form-label-sm text-center">보유량</label>
<label for="mItemQty" class="col-sm-4 col-form-label col-form-label-sm text-center">보유량</label>
<div class="col-sm-6">
<input type="number" class="form-control" id="mItemQty" name="itemQty" th:value="${equInfo.itemQty}" placeholder="수량 직접입력">
<input type="number" class="form-control form-control-sm" id="mItemQty" name="itemQty" th:value="${equInfo.itemQty}" placeholder="수량 직접입력">
</div>
</div>
<div class="row mb-3">
<label for="cat2Cd" class="col-sm-4 col-form-label col-form-label-sm text-center">상태</label>
<div class="row mb-3">
<label for="itemCondition" class="col-sm-4 col-form-label col-form-label-sm text-center">상태</label>
<div class="col-sm-6">
<select class="form-select form-select-sm" name="itemCondition">
<select class="form-select form-select-sm" id="itemCondition" name="itemCondition">
<option value="">상태 선택</option>
<th:block th:each="commonCode:${session.commonCode.get('ITCON')}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}" th:selected="${commonCode.itemCd} == ${equInfo.itemCondition}"></option>
</th:block>
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}" th:selected="${commonCode.itemCd} == ${equInfo.itemCondition}"></option>
</th:block>
</select>
</div>
</div>
<div class="row mb-3">
<label for="cat3Cd" class="col-sm-4 col-form-label col-form-label-sm text-center">비고</label>
<label for="note" class="col-sm-4 col-form-label col-form-label-sm text-center">비고</label>
<div class="col-sm-6">
<input type="text" class="form-control" name="note" th:value="${equInfo.note}">
<input type="text" class="form-control form-control-sm" id="note" name="note" th:value="${equInfo.note}">
</div>
</div>
<div class="row mb-2">
<label for="cat3Cd" class="col-sm-4 col-form-label col-form-label-sm text-center">장비사진</label>
<label for="imgUpload" class="col-sm-4 col-form-label col-form-label-sm text-center">장비사진</label>
<div class="col-sm-6">
<div id="imgUpload">
<input type="text" name="noUpdateImg" class="form-control" th:value="${equInfo.origNm}" readonly th:if="${not #strings.isEmpty(equInfo.origNm)}">
<input type="text" class="form-control" value="등록된 사진이 없습니다." readonly th:if="${#strings.isEmpty(equInfo.origNm)}">
</div>
<div id="imgUpdate" style="display:none">
<input type="file" class="form-control" name="file" accept="image/gif,image/jpeg,image/png">
<div id="imgUpload">
<input type="text" name="noUpdateImg" class="form-control form-control-sm" th:value="${equInfo.origNm}" readonly th:if="${not #strings.isEmpty(equInfo.origNm)}">
<input type="text" class="form-control form-control-sm" value="등록된 사진이 없습니다." readonly th:if="${#strings.isEmpty(equInfo.origNm)}">
</div>
<div id="imgUpdate" style="display:none">
<input type="file" class="form-control form-control-sm" name="file" accept="image/gif,image/jpeg,image/png">
</div>
</div>
<div class="col-sm-1">
<input type="button" class="btn btn-danger" id="deleteImgBtn" value="X" th:if="${not #strings.isEmpty(equInfo.origNm)}" th:attr="onclick=|deleteImg('${equInfo.equKey}','${equInfo.versionNo}')|">
<input type="button" class="btn btn-primary" id="addImgBtn" value="+" th:if="${#strings.isEmpty(equInfo.origNm)}">
</div>
<div class="col-sm-1">
<button type="button" class="btn btn-sm btn-danger" id="deleteImgBtn" th:if="${not #strings.isEmpty(equInfo.origNm)}" th:attr="onclick=|deleteImg('${equInfo.equKey}','${equInfo.versionNo}')|">
<i class="bi bi-x"></i>
</button>
<button type="button" class="btn btn-primary" id="addImgBtn" th:if="${#strings.isEmpty(equInfo.origNm)}">
<i class="bi bi-plus"></i>
</button>
</div>
</div>
</form>
</div>
<div class="modal-footer justify-content-between bg-light">
<div class="col-auto">
<button type="button" class="btn btn-secondary modalCloseBtn" data-bs-dismiss="modal">닫기</button>
<button type="button" class="btn btn-danger" id="deleteEquip" th:if="${accessAuth eq 'ACC003'} or ${wrtUserSeq eq userSeq}">삭제</button>
<button type="button" class="btn btn-secondary modalCloseBtn" data-bs-dismiss="modal">닫기</button>
<button type="button" class="btn btn-danger" id="deleteEquip" th:if="${accessAuth eq 'ACC003'} or ${wrtUserSeq eq userSeq}">삭제</button>
</div>
<div class="col-auto">
<button type="button" class="btn btn-warning" id="updateEquip" th:if="${accessAuth eq 'ACC003'} or ${wrtUserSeq eq userSeq}">수정</button>

View File

@ -126,14 +126,8 @@
</main>
<div class="modal fade" id="equipEditModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="userEditModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg modal-dialog-scrollable">
<div class="modal-dialog modal-dialog-scrollable">
<div class="modal-content" id="equipEditModalContent">
<div class="modal-header bg-dark">
</div>
<div class="modal-body">
<div class="tab-content bg-white border border-top-0" id="configInfo">
</div>
</div>
</div>
</div>
</div>

View File

@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="ko" xmlns:th="http://www.thymeleaf.org">
<option value="">-세부분류 선택-</option>
<th:block th:each="commonCode:${session.commonCode.get(equType)}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"></option>
</th:block>
<option value="">-세부분류 선택-</option>
<th:block th:each="commonCode:${session.commonCode.get(equType)}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"></option>
</th:block>
</html>

View File

@ -142,14 +142,8 @@
</main>
<div class="modal fade" id="useEditModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="userEditModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg modal-dialog-scrollable">
<div class="modal-dialog modal-dialog-scrollable">
<div class="modal-content" id="useEditModalContent">
<div class="modal-header bg-dark">
</div>
<div class="modal-body">
<div class="tab-content bg-white border border-top-0" id="configCellPhone">
</div>
</div>
</div>
</div>
</div>

View File

@ -142,14 +142,8 @@
</main>
<div class="modal fade" id="useEditModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="userEditModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg modal-dialog-scrollable">
<div class="modal-dialog modal-dialog-scrollable">
<div class="modal-content" id="useEditModalContent">
<div class="modal-header bg-dark">
</div>
<div class="modal-body">
<div class="tab-content bg-white border border-top-0" id="configCellPhone">
</div>
</div>
</div>
</div>
</div>

View File

@ -2,63 +2,63 @@
<html lang="ko" xmlns:th="http://www.thymeleaf.org">
<div class="modal-header bg-dark">
<h5 class="modal-title text-white" id="menuEditModalLabel" th:text="${useType eq 'PVRE'?'휴대용 녹화장비 사용대장 등록':'방역조사실 사용대장 등록'}"></h5>
<button type="button" class="btn-close f-invert" data-bs-dismiss="modal" aria-label="Close"></button>
<h5 class="modal-title text-white" id="menuEditModalLabel" th:text="${useType eq 'PVRE'?'휴대용 녹화장비 사용대장 등록':'방역조사실 사용대장 등록'}"></h5>
<button type="button" class="btn-close f-invert" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body pl-23">
<div class="modal-body">
<form id="useFm" method="post">
<input type="hidden" name="_csrf_header" th:value="${_csrf.headerName}"/>
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/>
<input type="hidden" name="useType" th:value="${useType}">
<div class="row mb-1">
<label for="ogCd" class="col-sm-3 col-form-label text-center">사용관서</label>
<div class="col-sm-5">
<select class="form-select form-select-sm" id="mgtOrgan" name="mgtOrgan" th:disabled="${accessAuth ne 'ACC003'}">
<option value="">선택</option>
<th:block th:each="organList:${organList}">
<option th:value="${organList.item_cd}" th:text="${organList.item_value}" th:selected="${organList.item_cd eq userOrgan}"></option>
</th:block>
</select>
</div>
</div>
<div class="row mb-1">
<label for="ogCd" class="col-sm-3 col-form-label text-center">사용일시</label>
<div class="col-sm-5">
<input type="text" class="form-control" id="useDt" name="useDt" readonly>
</div>
</div>
<div class="row mb-1">
<label for="ogCd" class="col-sm-3 col-form-label text-center">사용사유</label>
<div class="col-sm-5">
<select class="form-select form-select-sm" id="detailType" name="detailType">
<option value="">선택</option>
<th:block th:if="${useType eq 'PVRE'}">
<th:block th:each="commonCode:${session.commonCode.get('PVREUSE')}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"></option>
</th:block>
</th:block>
<th:block th:if="${useType eq 'QIR'}">
<th:block th:each="commonCode:${session.commonCode.get('QIRUSE')}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"></option>
</th:block>
</th:block>
</select>
<input type="text" class="form-control" id="detailSelf" name="detailSelf">
</div>
</div>
<div class="row mb-1">
<label for="ogCd" class="col-sm-3 col-form-label text-center">사용인원</label>
<div class="col-sm-5">
<input type="number" class="form-control" id="peopleCnt" name="peopleCnt">
</div>
</div>
<div class="row mb-1">
<label for="ogCd" class="col-sm-3 col-form-label text-center">비고</label>
<div class="col-sm-5">
<input type="text" class="form-control" id="description" name="description">
</div>
</div>
</form>
<input type="hidden" name="_csrf_header" th:value="${_csrf.headerName}"/>
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/>
<input type="hidden" name="useType" th:value="${useType}">
<div class="row mb-1">
<label for="mgtOrgan" class="col-sm-4 col-form-label col-form-label-sm text-center">사용관서</label>
<div class="col-sm-6">
<select class="form-select form-select-sm" id="mgtOrgan" name="mgtOrgan" th:disabled="${accessAuth ne 'ACC003'}">
<option value="">선택</option>
<th:block th:each="organList:${organList}">
<option th:value="${organList.item_cd}" th:text="${organList.item_value}" th:selected="${organList.item_cd eq userOrgan}"></option>
</th:block>
</select>
</div>
</div>
<div class="row mb-1">
<label for="useDt" class="col-sm-4 col-form-label col-form-label-sm text-center">사용일시</label>
<div class="col-sm-6">
<input type="text" class="form-control form-control-sm" id="useDt" name="useDt" readonly>
</div>
</div>
<div class="row mb-1">
<label for="detailType" class="col-sm-4 col-form-label col-form-label-sm text-center">사용사유</label>
<div class="col-sm-6">
<select class="form-select form-select-sm" id="detailType" name="detailType">
<option value="">선택</option>
<th:block th:if="${useType eq 'PVRE'}">
<th:block th:each="commonCode:${session.commonCode.get('PVREUSE')}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"></option>
</th:block>
</th:block>
<th:block th:if="${useType eq 'QIR'}">
<th:block th:each="commonCode:${session.commonCode.get('QIRUSE')}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"></option>
</th:block>
</th:block>
</select>
<input type="text" class="form-control form-control-sm" id="detailSelf" name="detailSelf">
</div>
</div>
<div class="row mb-1">
<label for="peopleCnt" class="col-sm-4 col-form-label col-form-label-sm text-center">사용인원</label>
<div class="col-sm-6">
<input type="number" class="form-control form-control-sm" id="peopleCnt" name="peopleCnt">
</div>
</div>
<div class="row mb-1">
<label for="description" class="col-sm-4 col-form-label col-form-label-sm text-center">비고</label>
<div class="col-sm-6">
<input type="text" class="form-control form-control-sm" id="description" name="description">
</div>
</div>
</form>
</div>
<div class="modal-footer justify-content-between bg-light">
<div class="col-auto">

View File

@ -7,62 +7,62 @@
</h5>
<button type="button" class="btn-close f-invert" id="closeModal" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body pl-23">
<div class="modal-body">
<form id="useUpdateFm" method="post">
<input type="hidden" name="_csrf_header" th:value="${_csrf.headerName}"/>
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/>
<input type="hidden" name="useNo" th:value="${info.useNo}">
<input type="hidden" name="useType" th:value="${info.useType}">
<input type="hidden" name="versionNo" th:value="${info.versionNo}">
<div class="row mb-1">
<label for="ogCd" class="col-sm-3 col-form-label text-center">사용관서</label>
<div class="col-sm-5">
<select class="form-select form-select-sm" id="mMgtOrgan" name="mgtOrgan" disabled>
<option value="">선택</option>
<th:block th:each="organList:${organList}">
<option th:value="${organList.item_cd}" th:text="${organList.item_value}" th:selected="${organList.item_cd eq info.mgtOrgan}"></option>
</th:block>
</select>
</div>
</div>
<div class="row mb-1">
<label for="ogCd" class="col-sm-3 col-form-label text-center">사용일시</label>
<div class="col-sm-5">
<input type="text" class="form-control" id="mUseDt" name="useDt" th:value="${info.useDt}" readonly>
</div>
</div>
<div class="row mb-1">
<label for="ogCd" class="col-sm-3 col-form-label text-center">사용사유</label>
<div class="col-sm-5">
<select class="form-select form-select-sm" id="mDetailType" name="detailType">
<option value="">선택</option>
<th:block th:if="${info.useType eq 'PVRE'}">
<th:block th:each="commonCode:${session.commonCode.get('PVREUSE')}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}" th:selected="${commonCode.itemCd eq info.detailType}"></option>
</th:block>
</th:block>
<th:block th:if="${info.useType eq 'QIR'}">
<th:block th:each="commonCode:${session.commonCode.get('QIRUSE')}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}" th:selected="${commonCode.itemCd eq info.detailType}"></option>
</th:block>
</th:block>
</select>
<input type="text" class="form-control" id="mDetailSelf" name="detailSelf" th:value="${info.detailSelf}">
</div>
</div>
<div class="row mb-1">
<label for="ogCd" class="col-sm-3 col-form-label text-center">사용인원</label>
<div class="col-sm-5">
<input type="number" class="form-control" id="mPeopleCnt" name="peopleCnt" th:value="${info.peopleCnt}">
</div>
</div>
<div class="row mb-1">
<label for="ogCd" class="col-sm-3 col-form-label text-center">비고</label>
<div class="col-sm-5">
<input type="text" class="form-control" id="mDescription" name="description" th:value="${info.description}">
</div>
</div>
</form>
<input type="hidden" name="_csrf_header" th:value="${_csrf.headerName}"/>
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/>
<input type="hidden" name="useNo" th:value="${info.useNo}">
<input type="hidden" name="useType" th:value="${info.useType}">
<input type="hidden" name="versionNo" th:value="${info.versionNo}">
<div class="row mb-1">
<label for="mMgtOrgan" class="col-sm-4 col-form-label col-form-label-sm text-center">사용관서</label>
<div class="col-sm-6 ">
<select class="form-select form-select-sm" id="mMgtOrgan" name="mgtOrgan" disabled>
<option value="">선택</option>
<th:block th:each="organList:${organList}">
<option th:value="${organList.item_cd}" th:text="${organList.item_value}" th:selected="${organList.item_cd eq info.mgtOrgan}"></option>
</th:block>
</select>
</div>
</div>
<div class="row mb-1">
<label for="mUseDt" class="col-sm-4 col-form-label col-form-label-sm text-center">사용일시</label>
<div class="col-sm-6 ">
<input type="text" class="form-control form-control-sm" id="mUseDt" name="useDt" th:value="${info.useDt}" readonly>
</div>
</div>
<div class="row mb-1">
<label for="mDetailType" class="col-sm-4 col-form-label col-form-label-sm text-center">사용사유</label>
<div class="col-sm-6 ">
<select class="form-select form-select-sm" id="mDetailType" name="detailType">
<option value="">선택</option>
<th:block th:if="${info.useType eq 'PVRE'}">
<th:block th:each="commonCode:${session.commonCode.get('PVREUSE')}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}" th:selected="${commonCode.itemCd eq info.detailType}"></option>
</th:block>
</th:block>
<th:block th:if="${info.useType eq 'QIR'}">
<th:block th:each="commonCode:${session.commonCode.get('QIRUSE')}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}" th:selected="${commonCode.itemCd eq info.detailType}"></option>
</th:block>
</th:block>
</select>
<input type="text" class="form-control form-control-sm" id="mDetailSelf" name="detailSelf" th:value="${info.detailSelf}">
</div>
</div>
<div class="row mb-1">
<label for="mPeopleCnt" class="col-sm-4 col-form-label col-form-label-sm text-center">사용인원</label>
<div class="col-sm-6 ">
<input type="number" class="form-control form-control-sm" id="mPeopleCnt" name="peopleCnt" th:value="${info.peopleCnt}">
</div>
</div>
<div class="row mb-1">
<label for="mDescription" class="col-sm-4 col-form-label col-form-label-sm text-center">비고</label>
<div class="col-sm-6 ">
<input type="text" class="form-control form-control-sm" id="mDescription" name="description" th:value="${info.description}">
</div>
</div>
</form>
</div>
<div class="modal-footer justify-content-between bg-light">
<div class="col-auto">