diff --git a/src/main/java/com/dbnt/faisp/main/equip/EquipController.java b/src/main/java/com/dbnt/faisp/main/equip/EquipController.java index a75c0686..119b1e59 100644 --- a/src/main/java/com/dbnt/faisp/main/equip/EquipController.java +++ b/src/main/java/com/dbnt/faisp/main/equip/EquipController.java @@ -295,18 +295,18 @@ public class EquipController { } @GetMapping("/pvreUseList") - public ModelAndView pvreUseList(@AuthenticationPrincipal UserInfo loginUser,UseList useList,HttpServletResponse response) { + public ModelAndView pvreUseList(@AuthenticationPrincipal UserInfo loginUser, UseInfo useInfo, HttpServletResponse response) { ModelAndView mav = new ModelAndView("equip/pvreUseList"); - useList.setDownOrganCdList(loginUser.getDownOrganCdList()); - useList.setUseType("PVRE"); + useInfo.setDownOrganCdList(loginUser.getDownOrganCdList()); + useInfo.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 = { "연번", "경찰서","사용일시", "사용사유", "사용인원", "비고", "최종수정일"}; + if(useInfo.getExcel() != null && useInfo.getExcel().equals("Y")){ + String[] headers = { "use_no", "sosok", "buseo","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 useExcelList= equipService.selectUseList(useList); + List useExcelList= equipService.selectUseInfoList(useInfo); try { Utils.useListToExcel(useExcelList, response, headers, headerNames, columnType, sheetName, excelFileName); @@ -318,28 +318,27 @@ public class EquipController { //메뉴권한 확인 String accessAuth = authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/equip/pvreUseList").get(0).getAccessAuth(); mav.addObject("accessAuth", accessAuth); - useList.setQueryInfo(); - mav.addObject("useList", equipService.selectUseList(useList)); - useList.setContentCnt(equipService.selectUseListCnt(useList)); - useList.setPaginationInfo(); - mav.addObject("organList", equipService.selectOrganList(useList)); - mav.addObject("searchParams", useList); + useInfo.setQueryInfo(); + mav.addObject("useList", equipService.selectUseInfoList(useInfo)); + useInfo.setContentCnt(equipService.selectUseInfoListCnt(useInfo)); + useInfo.setPaginationInfo(); + mav.addObject("organList", equipService.selectOrganList(useInfo)); + mav.addObject("searchParams", useInfo); return mav; } @GetMapping("/useEditModal") - public ModelAndView useEditModal(@AuthenticationPrincipal UserInfo loginUser,UseList useList) { + public ModelAndView useEditModal(@AuthenticationPrincipal UserInfo loginUser, UseInfo useInfo) { ModelAndView mav = new ModelAndView("equip/useEditModal"); - useList.setDownOrganCdList(loginUser.getDownOrganCdList()); - mav.addObject("organList", equipService.selectOrganList(useList)); - mav.addObject("userOrgan", loginUser.getOgCd()); - mav.addObject("useType", useList.getUseType()); + useInfo.setDownOrganCdList(loginUser.getDownOrganCdList()); + mav.addObject("downOrganList", loginUser.getDownOrganCdList()); + mav.addObject("useType", useInfo.getUseType()); //메뉴권한 확인 String accessAuth; - if(useList.getUseType().equals("PVRE")) { + if(useInfo.getUseType().equals("PVRE")) { accessAuth = authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/equip/pvreUseList").get(0).getAccessAuth(); mav.addObject("accessAuth", accessAuth); - }else if(useList.getUseType().equals("QIR")) { + }else if(useInfo.getUseType().equals("QIR")) { accessAuth = authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/equip/qirUseList").get(0).getAccessAuth(); mav.addObject("accessAuth", accessAuth); } @@ -347,30 +346,31 @@ public class EquipController { } @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); + public void saveUseInfo(@AuthenticationPrincipal UserInfo loginUser, UseInfo useInfo){ + useInfo.setIsDeleted("N"); + useInfo.setWrtOrgan(loginUser.getOgCd()); + useInfo.setWrtPart(loginUser.getOfcCd()); + useInfo.setWrtUserGrd(loginUser.getTitleCd()); + useInfo.setWrtUserSeq(loginUser.getUserSeq()); + useInfo.setWrtUserNm(loginUser.getUserNm()); + useInfo.setWrtDt(LocalDateTime.now()); + equipService.saveUseInfo(useInfo); } @GetMapping("/useModifyModal") - public ModelAndView useModifyModal(@AuthenticationPrincipal UserInfo loginUser,UseList useList) { + public ModelAndView useModifyModal(@AuthenticationPrincipal UserInfo loginUser, UseInfo useInfo) { ModelAndView mav = new ModelAndView("equip/useModifyModal"); - useList.setDownOrganCdList(loginUser.getDownOrganCdList()); - mav.addObject("organList", equipService.selectOrganList(useList)); - mav.addObject("info", equipService.selectUseInfo(useList)); + useInfo.setDownOrganCdList(loginUser.getDownOrganCdList()); + mav.addObject("organList", equipService.selectOrganList(useInfo)); + mav.addObject("info", equipService.selectUseInfo(useInfo)); mav.addObject("userSeq", loginUser.getUserSeq()); //메뉴권한 확인 String accessAuth; - if(useList.getUseType().equals("PVRE")) { + if(useInfo.getUseType().equals("PVRE")) { accessAuth = authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/equip/pvreUseList").get(0).getAccessAuth(); mav.addObject("accessAuth", accessAuth); - }else if(useList.getUseType().equals("QIR")) { + }else if(useInfo.getUseType().equals("QIR")) { accessAuth = authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/equip/qirUseList").get(0).getAccessAuth(); mav.addObject("accessAuth", accessAuth); } @@ -378,47 +378,47 @@ public class EquipController { } @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); + public UseInfo uadateUse(@AuthenticationPrincipal UserInfo loginUser, UseInfo useInfo){ + useInfo.setWrtOrgan(loginUser.getOgCd()); + useInfo.setWrtPart(loginUser.getOfcCd()); + useInfo.setWrtUserGrd(loginUser.getTitleCd()); + useInfo.setWrtUserSeq(loginUser.getUserSeq()); + useInfo.setWrtUserNm(loginUser.getUserNm()); + useInfo.setWrtDt(LocalDateTime.now()); + return equipService.updateUse(useInfo); } @GetMapping("/useHistory") - public ModelAndView useHistory(@AuthenticationPrincipal UserInfo loginUser,UseList useList) { + public ModelAndView useHistory(@AuthenticationPrincipal UserInfo loginUser, UseInfo useInfo) { ModelAndView mav = new ModelAndView("equip/useHistory"); - mav.addObject("infoList", equipService.selectUseHistoryList(useList)); + mav.addObject("infoList", equipService.selectUseHistoryList(useInfo)); return mav; } @GetMapping("/HistoryView") @ResponseBody - public UseList HistoryView(UseList useList){ - return equipService.selectUseInfo(useList); + public UseInfo HistoryView(UseInfo useInfo){ + return equipService.selectUseInfo(useInfo); } @PostMapping("/useDelete") - public void useDelete(@RequestBody List useList){ - equipService.useDelete(useList); + public void useDelete(@RequestBody List useInfo){ + equipService.useDelete(useInfo); } @GetMapping("/qirUseList") - public ModelAndView qirUseList(@AuthenticationPrincipal UserInfo loginUser,UseList useList,HttpServletResponse response) { + public ModelAndView qirUseList(@AuthenticationPrincipal UserInfo loginUser, UseInfo useInfo, HttpServletResponse response) { ModelAndView mav = new ModelAndView("equip/qirUseList"); - useList.setDownOrganCdList(loginUser.getDownOrganCdList()); - useList.setUseType("QIR"); + useInfo.setDownOrganCdList(loginUser.getDownOrganCdList()); + useInfo.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 = { "연번", "경찰서","사용일시", "사용사유", "사용인원", "비고", "최종수정일"}; + if(useInfo.getExcel() != null && useInfo.getExcel().equals("Y")){ + String[] headers = { "use_no", "sosok", "buseo", "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 useExcelList= equipService.selectUseList(useList); + List useExcelList= equipService.selectUseInfoList(useInfo); try { Utils.useListToExcel(useExcelList, response, headers, headerNames, columnType, sheetName, excelFileName); @@ -430,12 +430,12 @@ public class EquipController { //메뉴권한 확인 String accessAuth = authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/equip/qirUseList").get(0).getAccessAuth(); mav.addObject("accessAuth", accessAuth); - useList.setQueryInfo(); - mav.addObject("useList", equipService.selectUseList(useList)); - useList.setContentCnt(equipService.selectUseListCnt(useList)); - useList.setPaginationInfo(); - mav.addObject("searchParams", useList); - mav.addObject("organList", equipService.selectOrganList(useList)); + useInfo.setQueryInfo(); + mav.addObject("useList", equipService.selectUseInfoList(useInfo)); + useInfo.setContentCnt(equipService.selectUseInfoListCnt(useInfo)); + useInfo.setPaginationInfo(); + mav.addObject("searchParams", useInfo); + mav.addObject("downOrganList", loginUser.getDownOrganCdList()); return mav; } diff --git a/src/main/java/com/dbnt/faisp/main/equip/mapper/EquipMapper.java b/src/main/java/com/dbnt/faisp/main/equip/mapper/EquipMapper.java index 68fdf6d5..8cc1e213 100644 --- a/src/main/java/com/dbnt/faisp/main/equip/mapper/EquipMapper.java +++ b/src/main/java/com/dbnt/faisp/main/equip/mapper/EquipMapper.java @@ -3,7 +3,7 @@ package com.dbnt.faisp.main.equip.mapper; 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.UseInfo; import com.dbnt.faisp.util.ParamMap; import org.apache.ibatis.annotations.Mapper; @@ -35,21 +35,19 @@ public interface EquipMapper { Integer selectCellPhoneListCnt(CellPhone cellPhone); - List selectOrganList(UseList useList); + List selectOrganList(UseInfo useInfo); - UseList selectUseNoCnt(UseList useList); + UseInfo selectUseNoCnt(UseInfo useInfo); - Integer selectLastUseNo(UseList useList); + Integer selectLastUseNo(UseInfo useInfo); - List selectUseList(UseList useList); + List selectUseInfoList(UseInfo useInfo); - Integer selectUseListCnt(UseList useList); - - UseList selectUseInfo(UseList useList); + Integer selectUseInfoListCnt(UseInfo useInfo); List selectHistoryList(Equip equip); - List selectUseHistoryList(UseList useList); + List selectUseHistoryList(UseInfo useInfo); diff --git a/src/main/java/com/dbnt/faisp/main/equip/model/UseInfo.java b/src/main/java/com/dbnt/faisp/main/equip/model/UseInfo.java index c15d20d3..c3c4b9a7 100644 --- a/src/main/java/com/dbnt/faisp/main/equip/model/UseInfo.java +++ b/src/main/java/com/dbnt/faisp/main/equip/model/UseInfo.java @@ -20,16 +20,20 @@ import java.io.Serializable; @Table(name = "use_info") public class UseInfo extends UseInfoBase { @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "use_key") private Integer useKey; - @Column(name = "state") - private String state; + + @Column(name = "is_deleted") + private String isDeleted; @Transient private String excel; @Transient private String sosok; + @Transient + private String buseo; @Transient private String year; diff --git a/src/main/java/com/dbnt/faisp/main/equip/repository/UseInfoRepository.java b/src/main/java/com/dbnt/faisp/main/equip/repository/UseInfoRepository.java index 3aff6a95..98c75b4d 100644 --- a/src/main/java/com/dbnt/faisp/main/equip/repository/UseInfoRepository.java +++ b/src/main/java/com/dbnt/faisp/main/equip/repository/UseInfoRepository.java @@ -13,6 +13,6 @@ import org.springframework.data.jpa.repository.Query; public interface UseInfoRepository extends JpaRepository { @Modifying(clearAutomatically = true) - @Query("update UseInfo set state = 'D' where useKey in (:useKeyList)") + @Query("update UseInfo set isDeleted = 'Y' where useKey in (:useKeyList)") void bulkModifyingByUseInfoToUseKeyList(List useKeyList); } diff --git a/src/main/java/com/dbnt/faisp/main/equip/service/EquipService.java b/src/main/java/com/dbnt/faisp/main/equip/service/EquipService.java index 52a9d15b..7ab5790d 100644 --- a/src/main/java/com/dbnt/faisp/main/equip/service/EquipService.java +++ b/src/main/java/com/dbnt/faisp/main/equip/service/EquipService.java @@ -3,26 +3,18 @@ package com.dbnt.faisp.main.equip.service; import com.dbnt.faisp.config.BaseService; import com.dbnt.faisp.main.equip.mapper.EquipMapper; -import com.dbnt.faisp.main.equip.model.CellPhone; -import com.dbnt.faisp.main.equip.model.Equip; +import com.dbnt.faisp.main.equip.model.*; import com.dbnt.faisp.main.equip.model.Equip.EquipId; -import com.dbnt.faisp.main.equip.model.EquipFile; import com.dbnt.faisp.main.equip.model.EquipFile.EquipFileId; -import com.dbnt.faisp.main.equip.model.EquipLog; -import com.dbnt.faisp.main.equip.model.UseList; -import com.dbnt.faisp.main.equip.model.UseList.UseListId; -import com.dbnt.faisp.main.equip.repository.CellPhoneRepository; -import com.dbnt.faisp.main.equip.repository.EquipFileRepository; -import com.dbnt.faisp.main.equip.repository.EquipLogRepository; -import com.dbnt.faisp.main.equip.repository.EquipRepository; -import com.dbnt.faisp.main.equip.repository.UseListRepository; +import com.dbnt.faisp.main.equip.model.UseInfo; +import com.dbnt.faisp.main.equip.repository.*; import com.dbnt.faisp.main.userInfo.model.UserInfo; import com.dbnt.faisp.util.ParamMap; import com.dbnt.faisp.util.Utils; import lombok.RequiredArgsConstructor; -import org.springframework.beans.factory.annotation.Value; +import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.FileCopyUtils; @@ -30,7 +22,6 @@ import org.springframework.web.multipart.MultipartHttpServletRequest; import org.springframework.web.multipart.MultipartFile; import java.io.File; -import java.text.SimpleDateFormat; import java.time.LocalDateTime; import java.util.*; @@ -42,11 +33,10 @@ public class EquipService extends BaseService { private final EquipFileRepository equipFileRepository; private final EquipLogRepository equipLogRepository; private final CellPhoneRepository cellPhoneRepository; - private final UseListRepository useListRepository; + private final UseInfoRepository useInfoRepository; + private final UseInfoVersionRepository useInfoVersionRepository; private final EquipMapper equipMapper; - SimpleDateFormat Date = new SimpleDateFormat("yyyy"); - String year = Date.format(new Date()); @Transactional @@ -307,77 +297,65 @@ public class EquipService extends BaseService { cellPhoneRepository.deleteAll(cellPhone); } - public List selectOrganList(UseList useList) { - return equipMapper.selectOrganList(useList); + public List selectOrganList(UseInfo useInfo) { + return equipMapper.selectOrganList(useInfo); } @Transactional - public void saveUse(UseList useList) { - useList.setYear(year); - Integer useNo = equipMapper.selectLastUseNo(useList); + public void saveUseInfo(UseInfo useInfo) { + String year = ((Integer) useInfo.getUseDt().getYear()).toString(); + useInfo.setYear(year); + Integer useNo = equipMapper.selectLastUseNo(useInfo); if(useNo == null) { - useList.setUseNo(year+"-001"); - useList.setVersionNo(1); + useInfo.setUseNo(year+"-001"); } else { - useList.setUseNo(year+"-"+String.format("%03d", useNo+1)); - useList.setVersionNo(1); + useInfo.setUseNo(year+"-"+String.format("%03d", useNo+1)); } - useListRepository.save(useList); - - } - - public List 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); + useInfoRepository.save(useInfo); + saveUseInfoVersion(useInfo); } @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 UseInfo updateUse(UseInfo useInfo) { + useInfoRepository.save(useInfo); + saveUseInfoVersion(useInfo); + return useInfo; } - public List selectUseHistoryList(UseList useList) { - return equipMapper.selectUseHistoryList(useList); + private void saveUseInfoVersion(UseInfo useInfo){ + UseInfoVersion savedInfo = useInfoVersionRepository.findByUseKey(useInfo.getUseKey()).orElse(null); + UseInfoVersion versionInfo = new UseInfoVersion(); + BeanUtils.copyProperties(useInfo, versionInfo); + versionInfo.setVersionNo(savedInfo==null?1:(savedInfo.getVersionNo()+1)); + useInfoVersionRepository.save(versionInfo); + } + + public List selectUseInfoList(UseInfo useInfo) { + return equipMapper.selectUseInfoList(useInfo); + } + + public Integer selectUseInfoListCnt(UseInfo useInfo) { + return equipMapper.selectUseInfoListCnt(useInfo); + } + + public UseInfo selectUseInfo(UseInfo useInfo) { + return useInfoRepository.findById(useInfo.getUseKey()).orElse(null); + } + + + public List selectUseHistoryList(UseInfo useInfo) { + return equipMapper.selectUseHistoryList(useInfo); } @Transactional - public void useDelete(List useList) { - for(UseList use:useList) { - useListRepository.deleteByMgtOrganAndUseNoAndUseType(use.getMgtOrgan(),use.getUseNo(),use.getUseType()); + public void useDelete(List useInfo) { + List useKeyList = new ArrayList<>(); + for(UseInfo use: useInfo) { + useKeyList.add(use.getUseKey()); } + useInfoRepository.bulkModifyingByUseInfoToUseKeyList(useKeyList); } - 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); } diff --git a/src/main/java/com/dbnt/faisp/util/Utils.java b/src/main/java/com/dbnt/faisp/util/Utils.java index f4ff230d..26158dda 100644 --- a/src/main/java/com/dbnt/faisp/util/Utils.java +++ b/src/main/java/com/dbnt/faisp/util/Utils.java @@ -14,6 +14,7 @@ import javax.servlet.http.HttpServletResponse; import com.dbnt.faisp.main.codeMgt.model.CodeMgt; +import com.dbnt.faisp.main.equip.model.UseInfo; import org.apache.poi.ss.usermodel.BorderStyle; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.CellStyle; @@ -27,7 +28,6 @@ import org.apache.poi.xssf.usermodel.XSSFDataFormat; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import com.dbnt.faisp.main.equip.model.CellPhone; -import com.dbnt.faisp.main.equip.model.UseList; import com.dbnt.faisp.main.fipTarget.model.PartInfo; import com.dbnt.faisp.main.fipTarget.model.PartWork; import com.dbnt.faisp.main.userInfo.model.UserInfo; @@ -666,7 +666,7 @@ public class Utils { } - public static void useListToExcel(List useExcelList, HttpServletResponse response, String[] headers, + public static void useListToExcel(List useExcelList, HttpServletResponse response, String[] headers, String[] headerNames, String[] columnType, String sheetName, String excelFileName) throws IOException { if(Utils.isNotEmpty(useExcelList)) { // 메모리에 100개의 행을 유지합니다. 행의 수가 넘으면 디스크에 적습니다. diff --git a/src/main/resources/mybatisMapper/EquipMapper.xml b/src/main/resources/mybatisMapper/EquipMapper.xml index 6bd3de84..ea9d8f21 100644 --- a/src/main/resources/mybatisMapper/EquipMapper.xml +++ b/src/main/resources/mybatisMapper/EquipMapper.xml @@ -199,41 +199,41 @@ @@ -241,44 +241,44 @@ select (select item_value from code_mgt cm where cm.item_cd = equ_type) as equ_type, - (select item_value from code_mgt cm where cm.item_cd = detail_type) as detail_name, - detail_type, - (select item_value from code_mgt where item_cd = wrt_organ) as sosok, - (select item_value from code_mgt where item_cd = wrt_part) as detail_sosok, - el_contents, - wrt_part, - (select item_value from code_mgt where item_cd = wrt_title) as wrt_title, - wrt_nm, - wrt_dt + (select item_value from code_mgt cm where cm.item_cd = detail_type) as detail_name, + detail_type, + (select item_value from code_mgt where item_cd = wrt_organ) as sosok, + (select item_value from code_mgt where item_cd = wrt_part) as detail_sosok, + el_contents, + wrt_part, + (select item_value from code_mgt where item_cd = wrt_title) as wrt_title, + wrt_nm, + wrt_dt from equ_log where wrt_organ in @@ -380,23 +380,23 @@ select phone_key, - case - when oc.organ_type = 'OGC001' then (select item_value from code_mgt cm where cm.item_cd = oc.organ_cd ) - when oc.organ_type = 'OGC002' then (select item_value from code_mgt cm where cm.item_cd = oc.organ_cd ) - else concat( - (select item_value from code_mgt cm where cm.item_cd = oc.parent_organ ), - '-', - (select item_value from code_mgt cm where cm.item_cd = oc.organ_cd ) - ) - end as sosok, - tel_no, - p_user_seq, - ui.user_nm as user_nm, - ext_mail, - webex_no, - katalk_id + case + when oc.organ_type = 'OGC001' then (select item_value from code_mgt cm where cm.item_cd = oc.organ_cd ) + when oc.organ_type = 'OGC002' then (select item_value from code_mgt cm where cm.item_cd = oc.organ_cd ) + else concat( + (select item_value from code_mgt cm where cm.item_cd = oc.parent_organ ), + '-', + (select item_value from code_mgt cm where cm.item_cd = oc.organ_cd ) + ) + end as sosok, + tel_no, + p_user_seq, + ui.user_nm as user_nm, + ext_mail, + webex_no, + katalk_id from cellphone_mgt cm, - organ_config oc, - user_info ui + organ_config oc, + user_info ui order by cm.wrt_dt desc @@ -466,45 +466,45 @@ - select item_cd, - item_value + item_value from code_mgt cm, organ_config oc where cm.item_cd = oc.organ_cd - and oc.organ_type = 'OGC003' - and cm.use_chk = 'T' - and item_cd in - - #{item} - + and oc.organ_type = 'OGC003' + and cm.use_chk = 'T' + and item_cd in + + #{item} + order by item_cd asc - select a.useNo from( select substring(use_no, 6, 3)::int as useNo - from use_list + from use_info where mgt_organ = #{mgtOrgan} and use_no like #{year}||'%' and use_type = #{useType} @@ -514,7 +514,15 @@ limit 1 - + + where use_type = #{useType} + and is_deleted = 'N' + + and ul.mgt_organ in + + #{item} + + and ul.mgt_organ = #{mgtOrgan} @@ -542,128 +550,49 @@ - select (select item_value from code_mgt where item_cd = ul.mgt_organ) as sosok, - ul.mgt_organ, - ul.use_type, - ul.use_no, - ul.version_no, - use_dt, - (select item_value from code_mgt where item_cd = detail_type) as detail_type_name, - detail_type, - detail_self, - people_cnt, - description, - wrt_dt - from use_list ul, - (select use_no,max(version_no) as lastVer,mgt_organ,use_type from use_list - where use_type = #{useType} - and mgt_organ in - - #{item} - - group by use_no,use_type,mgt_organ) b - where ul.use_no = b.use_no - and ul.version_no = b.lastVer - and ul.mgt_organ = b.mgt_organ - and ul.use_type = b.use_type - and ul.use_type = #{useType} - and ul.mgt_organ in - - #{item} - - - order by ul.use_no desc - - limit #{rowCnt} offset #{firstIndex} - - - - - - - + select count(*) + from use_info ul + + + + diff --git a/src/main/resources/static/js/equip/use.js b/src/main/resources/static/js/equip/use.js index 151f4855..9ef43fae 100644 --- a/src/main/resources/static/js/equip/use.js +++ b/src/main/resources/static/js/equip/use.js @@ -16,6 +16,12 @@ $(document).on('click', '#addQir', function (){ showEditModal(useType); }) +$(document).on('change', '#mgtOrgan', function (){ + const partSelector = $("#mgtPart") + partSelector.find('.partOption').hide(); + partSelector.find('.'+this.value).show(); +}) + function showEditModal(useType){ $.ajax({ url: '/equip/useEditModal', @@ -79,19 +85,14 @@ $(document).on('change', '#detailType', function (){ $(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"); - showModifyModal(useNo,useType,mgtOrgan); + showModifyModal($(target).parent('tr').attr("data-usekey")); } }); -function showModifyModal(useNo,useType,mgtOrgan){ +function showModifyModal(useKey){ $.ajax({ url: '/equip/useModifyModal', - data: {useNo: useNo, - useType: useType, - mgtOrgan: mgtOrgan}, + data: {useKey: useKey}, type: 'GET', dataType:"html", success: function(html){ diff --git a/src/main/resources/static/js/faRpt/sri.js b/src/main/resources/static/js/faRpt/sri.js index 89c982c5..fc11509a 100644 --- a/src/main/resources/static/js/faRpt/sri.js +++ b/src/main/resources/static/js/faRpt/sri.js @@ -87,17 +87,19 @@ $(document).on('click', '.saveBtn', function (){ } }) function sriDataCheck(){ - if(!$("#faSriType").val()){ - alert("분류를 선택해주세요.") - return false; - } - if(!$("#faSriEdate").val()){ - alert("제출기한일을 선택해주세요.") - return false; - } - if(!$("#faSriETime").val()){ - alert("제출기한 시간을 입력해주세요.") - return false; + if(!$("#refKey").val()) { + if (!$("#faSriType").val()) { + alert("분류를 선택해주세요.") + return false; + } + if (!$("#faSriEdate").val()) { + alert("제출기한일을 선택해주세요.") + return false; + } + if (!$("#faSriETime").val()) { + alert("제출기한 시간을 입력해주세요.") + return false; + } } if(!$("#title").val()){ alert("제목을 입력해주세요.") diff --git a/src/main/resources/static/js/police/careerMgt.js b/src/main/resources/static/js/police/careerMgt.js index 196a84bd..cb172269 100644 --- a/src/main/resources/static/js/police/careerMgt.js +++ b/src/main/resources/static/js/police/careerMgt.js @@ -41,6 +41,12 @@ $(document).on('click', '.careerAddBtn', function (){ }); }) +$(document).on('change', '#workOrgan', function (){ + const partSelector = $("#workPart"); + partSelector.find('option').hide(); + partSelector.find('.'+this.value).show(); +}) + $(document).on('click', '.kwmsCareerBtn', function (){ getKwmsCareerModal($("#mngModelUserSeq").val(), $("#mngModelDicCode").val()) }) @@ -136,6 +142,7 @@ $(document).on('click', '#saveBtn', function (){ }) } }) + $(document).on('click', '.deleteCareerBtn', function (){ if(confirm("삭제하시겠습니까?")){ contentFade("in"); diff --git a/src/main/resources/templates/equip/pvreUseList.html b/src/main/resources/templates/equip/pvreUseList.html index 4c8b2646..b0597fe2 100644 --- a/src/main/resources/templates/equip/pvreUseList.html +++ b/src/main/resources/templates/equip/pvreUseList.html @@ -89,7 +89,7 @@ - + diff --git a/src/main/resources/templates/equip/qirUseList.html b/src/main/resources/templates/equip/qirUseList.html index b1c7de17..f2cffc6b 100644 --- a/src/main/resources/templates/equip/qirUseList.html +++ b/src/main/resources/templates/equip/qirUseList.html @@ -39,8 +39,8 @@
@@ -78,9 +78,10 @@ - + + @@ -89,16 +90,19 @@ - - - - - - - - - - + + + + + + + + + +
연번 경찰서부서 사용일시 사용사유 사용인원
+ + +
@@ -106,7 +110,7 @@
- +
diff --git a/src/main/resources/templates/equip/useEditModal.html b/src/main/resources/templates/equip/useEditModal.html index afc390f0..f5568679 100644 --- a/src/main/resources/templates/equip/useEditModal.html +++ b/src/main/resources/templates/equip/useEditModal.html @@ -14,8 +14,22 @@
+
+
+
+ +
+
diff --git a/src/main/resources/templates/fipTarget/vulnerableList.html b/src/main/resources/templates/fipTarget/vulnerableList.html index 67dcf355..bf2ab457 100644 --- a/src/main/resources/templates/fipTarget/vulnerableList.html +++ b/src/main/resources/templates/fipTarget/vulnerableList.html @@ -59,7 +59,7 @@