강석 최 2022-09-28 18:21:31 +09:00
commit eea0329555
13 changed files with 922 additions and 2 deletions

View File

@ -0,0 +1,94 @@
package com.dbnt.faisp.fipTarget;
import com.dbnt.faisp.authMgt.service.AuthMgtService;
import com.dbnt.faisp.equip.model.Equip;
import com.dbnt.faisp.equip.model.EquipLog;
import com.dbnt.faisp.equip.service.EquipService;
import com.dbnt.faisp.fipTarget.model.PartInfo;
import com.dbnt.faisp.fipTarget.service.FipTargetService;
import com.dbnt.faisp.organMgt.service.OrganConfigService;
import com.dbnt.faisp.publicBoard.model.PublicBoard;
import com.dbnt.faisp.translator.model.Translator;
import com.dbnt.faisp.userInfo.model.UserInfo;
import com.dbnt.faisp.util.ParamMap;
import com.dbnt.faisp.util.Utils;
import lombok.RequiredArgsConstructor;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.time.LocalDateTime;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
@RestController
@RequiredArgsConstructor
@RequestMapping("/target")
public class FipTargetController {
private final OrganConfigService organConfigService;
private final AuthMgtService authMgtService;
private final FipTargetService fipTargetSevice;
@GetMapping("/partInfoList")
public ModelAndView partInfoList(@AuthenticationPrincipal UserInfo loginUser,PartInfo partInfo) {
ModelAndView mav = new ModelAndView("fipTarget/partInfoList");
//메뉴권한 확인
String accessAuth = authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/equip/equipStatus").get(0).getAccessAuth();
mav.addObject("accessAuth", accessAuth);
partInfo.setDownOrganCdList(loginUser.getDownOrganCdList());
partInfo.setQueryInfo();
mav.addObject("partInfoList", fipTargetSevice.selectPartInfoList(partInfo));
partInfo.setContentCnt(fipTargetSevice.selectPartInfoListCnt(partInfo));
partInfo.setPaginationInfo();
mav.addObject("searchParams", partInfo);
return mav;
}
@GetMapping("/partInfoEditModal")
public ModelAndView partInfoEditModal(@AuthenticationPrincipal UserInfo loginUser,PartInfo partInfo) {
ModelAndView mav = new ModelAndView("fipTarget/partInfoEditModal");
mav.addObject("mgtOrganList", loginUser.getDownOrganCdList());
return mav;
}
@GetMapping("/partInfoSelecBox")
public ModelAndView equipTypeSelecBox(String ogCd) {
ModelAndView mav = new ModelAndView("fipTarget/parkInfoSelecBox");
ParamMap param = new ParamMap();
param.put("downOrganCdList", organConfigService.selectDownOrganListWhereUserOgCd(ogCd));
mav.addObject("managerList", fipTargetSevice.selectPartInfoManagerList(param));
return mav;
}
@PostMapping("/savePartInfo")
public void savePartInfo (@AuthenticationPrincipal UserInfo loginUser, PartInfo partInfo,MultipartHttpServletRequest request){
partInfo.setMultipartFileList(request.getMultiFileMap().get("uploadFiles"));
partInfo.setWrtNm(loginUser.getUserId());
partInfo.setWrtPart(loginUser.getOfcCd());
partInfo.setWrtUserSeq(loginUser.getUserSeq());
partInfo.setWrtOrgan(loginUser.getOgCd());
partInfo.setWrtDt(LocalDateTime.now());
fipTargetSevice.savePartInfo(partInfo);
}
}

View File

@ -0,0 +1,22 @@
package com.dbnt.faisp.fipTarget.mapper;
import com.dbnt.faisp.fipTarget.model.PartInfo;
import com.dbnt.faisp.util.ParamMap;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface FipTargetMapper {
List<ParamMap> selectPartInfoManagerList(ParamMap param);
List<PartInfo> selectPartInfoList(PartInfo partInfo);
Integer selectPartInfoListCnt(PartInfo partInfo);
}

View File

@ -0,0 +1,129 @@
package com.dbnt.faisp.fipTarget.model;
import com.dbnt.faisp.config.BaseModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.multipart.MultipartFile;
import javax.persistence.*;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;
@Getter
@Setter
@Entity
@NoArgsConstructor
@DynamicInsert
@DynamicUpdate
@IdClass(PartInfo.PartInfoId.class)
@Table(name = "part_info")
public class PartInfo extends BaseModel implements Serializable{
@Id
@Column(name = "pi_seq")
private Integer piSeq;
@Id
@Column(name = "version_no")
private Integer versionNo;
@Column(name = "mgt_organ")
private String mgtOrgan;
@Column(name = "pi_user_seq")
private Integer piUserSeq;
@Column(name = "land_police")
private String landPolice;
@Column(name = "rent_type")
private String rentType;
@Column(name = "rent_price")
private Integer rentPrice;
@Column(name = "utility_type")
private String utilityType;
@Column(name = "utility_price")
private Integer utilityPrice;
@Column(name = "terminal_nm")
private String terminalNm;
@Column(name = "mp_work_type")
private String mpWorkType;
@Column(name = "mp_people_cnt")
private Integer mpPeopleCnt;
@Column(name = "mp_description")
private String mpDescription;
@Column(name = "pl_work_type")
private String plWorkType;
@Column(name = "pl_people_cnt")
private Integer plPeopleCnt;
@Column(name = "pl_description")
private String plDescription;
@Column(name = "wrt_organ")
private String wrtOrgan;
@Column(name = "wrt_part")
private String wrtPart;
@Column(name = "wrt_user_seq")
private Integer wrtUserSeq;
@Column(name = "wrt_nm")
private String wrtNm;
@Column(name = "wrt_dt")
private LocalDateTime wrtDt;
@Transient
private List<MultipartFile> multipartFileList;
@Transient
private String piManagerName;
@Override
public String toString() {
return "PartInfo [piSeq=" + piSeq + ", versionNo=" + versionNo + ", mgtOrgan=" + mgtOrgan + ", piUserSeq="
+ piUserSeq + ", landPolice=" + landPolice + ", rentType=" + rentType + ", rentPrice=" + rentPrice
+ ", utilityType=" + utilityType + ", utilityPrice=" + utilityPrice + ", terminalNm=" + terminalNm
+ ", mpWorkType=" + mpWorkType + ", mpPeopleCnt=" + mpPeopleCnt + ", mpDescription=" + mpDescription
+ ", plWorkType=" + plWorkType + ", plPeopleCnt=" + plPeopleCnt + ", plDescription=" + plDescription
+ ", wrtOrgan=" + wrtOrgan + ", wrtPart=" + wrtPart + ", wrtUserSeq=" + wrtUserSeq + ", wrtNm=" + wrtNm
+ ", wrtDt=" + wrtDt + ", multipartFileList=" + multipartFileList + "]";
}
@Embeddable
@Data
@NoArgsConstructor
@AllArgsConstructor
public static class PartInfoId implements Serializable {
private Integer piSeq;
private Integer versionNo;
}
}

View File

@ -0,0 +1,78 @@
package com.dbnt.faisp.fipTarget.model;
import com.dbnt.faisp.config.BaseModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.springframework.format.annotation.DateTimeFormat;
import javax.persistence.*;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;
@Getter
@Setter
@Entity
@NoArgsConstructor
@DynamicInsert
@DynamicUpdate
@IdClass(PartInfoFile.PartInfoFileId.class)
@Table(name = "part_info_file")
public class PartInfoFile extends BaseModel implements Serializable{
@Id
@Column(name = "file_seq")
private Integer fileSeq;
@Id
@Column(name = "pi_seq")
private Integer piSeq;
@Id
@Column(name = "version_no")
private Integer versionNo;
@Column(name = "orig_nm")
private String origNm;
@Column(name = "conv_nm")
private String convNm;
@Column(name = "file_extn")
private String fileExtn;
@Column(name = "file_size")
private String fileSize;
@Column(name = "file_path")
private String filePath;
@Embeddable
@Data
@NoArgsConstructor
@AllArgsConstructor
public static class PartInfoFileId implements Serializable {
private Integer fileSeq;
private Integer piSeq;
private Integer versionNo;
}
}

View File

@ -0,0 +1,24 @@
package com.dbnt.faisp.fipTarget.repository;
import com.dbnt.faisp.fipTarget.model.PartInfoFile;
import org.springframework.data.jpa.repository.JpaRepository;
public interface PartInfoFileRepository extends JpaRepository<PartInfoFile, PartInfoFile.PartInfoFileId> {
PartInfoFile findTopByPiSeqOrderByFileSeq(Integer piSeq);
}

View File

@ -0,0 +1,22 @@
package com.dbnt.faisp.fipTarget.repository;
import com.dbnt.faisp.fipTarget.model.PartInfo;
import org.springframework.data.jpa.repository.JpaRepository;
public interface PartInfoRepository extends JpaRepository<PartInfo, PartInfo.PartInfoId> {
PartInfo findFirstByOrderByPiSeqDesc();
}

View File

@ -0,0 +1,104 @@
package com.dbnt.faisp.fipTarget.service;
import com.dbnt.faisp.config.BaseService;
import com.dbnt.faisp.equip.model.Equip;
import com.dbnt.faisp.equip.model.EquipLog;
import com.dbnt.faisp.fipTarget.mapper.FipTargetMapper;
import com.dbnt.faisp.fipTarget.model.PartInfo;
import com.dbnt.faisp.fipTarget.model.PartInfoFile;
import com.dbnt.faisp.fipTarget.repository.PartInfoFileRepository;
import com.dbnt.faisp.fipTarget.repository.PartInfoRepository;
import com.dbnt.faisp.publicBoard.model.PublicFile;
import com.dbnt.faisp.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.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.FileCopyUtils;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.multipart.MultipartFile;
import java.io.File;
import java.time.LocalDateTime;
import java.util.*;
@Service
@RequiredArgsConstructor
public class FipTargetService extends BaseService {
@Value("${spring.servlet.multipart.location}")
protected String locationPath;
private final PartInfoRepository partInfoRepository;
private final PartInfoFileRepository partInfoFileRepository;
private final FipTargetMapper fipTargetMapper;
public List<ParamMap> selectPartInfoManagerList(ParamMap param) {
return fipTargetMapper.selectPartInfoManagerList(param);
}
@Transactional
public void savePartInfo(PartInfo partInfo) {
PartInfo dbPart = partInfoRepository.findFirstByOrderByPiSeqDesc();
if(dbPart == null) {
partInfo.setPiSeq(1);
partInfo.setVersionNo(1);
partInfoRepository.save(partInfo);
} else {
partInfo.setPiSeq(dbPart.getPiSeq()+1);
partInfo.setVersionNo(1);
partInfoRepository.save(partInfo);
}
saveUploadFiles(partInfo.getPiSeq(),partInfo.getVersionNo(), partInfo.getMultipartFileList());
}
private void saveUploadFiles(Integer piSeq,Integer versionNo, List<MultipartFile> multipartFileList) {
PartInfoFile lastFileInfo = partInfoFileRepository.findTopByPiSeqOrderByFileSeq(piSeq);
int fileSeq = lastFileInfo==null?1:(lastFileInfo.getFileSeq()+1);
if(multipartFileList == null || multipartFileList.isEmpty()) {
PartInfoFile fileInfo = new PartInfoFile();
fileInfo.setFileSeq(fileSeq);
fileInfo.setPiSeq(piSeq);
fileInfo.setVersionNo(versionNo);
partInfoFileRepository.save(fileInfo);
} else {
for(MultipartFile file : multipartFileList){
String saveName = UUID.randomUUID().toString();
String path = locationPath+File.separator+"publicFile"+File.separator;
saveFile(file, new File(path+File.separator+saveName));
String originalFilename = file.getOriginalFilename();
int extnIdx = originalFilename.lastIndexOf(".");
PartInfoFile fileInfo = new PartInfoFile();
fileInfo.setFileSeq(fileSeq++);
fileInfo.setPiSeq(piSeq);
fileInfo.setVersionNo(versionNo);
fileInfo.setOrigNm(originalFilename.substring(0, extnIdx));
fileInfo.setFileExtn(originalFilename.substring(extnIdx+1));
fileInfo.setConvNm(saveName);
fileInfo.setFileSize(calculationSize(file.getSize()));
fileInfo.setFilePath(path);
partInfoFileRepository.save(fileInfo);
}
}
}
public List<PartInfo> selectPartInfoList(PartInfo partInfo) {
return fipTargetMapper.selectPartInfoList(partInfo);
}
public Integer selectPartInfoListCnt(PartInfo partInfo) {
return fipTargetMapper.selectPartInfoListCnt(partInfo);
}
}

View File

@ -0,0 +1,82 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.dbnt.faisp.fipTarget.mapper.FipTargetMapper">
<select id="selectPartInfoManagerList" resultType="com.dbnt.faisp.util.ParamMap" parameterType="com.dbnt.faisp.util.ParamMap">
select user_seq,
user_id
user_name
from user_info
where og_cd in
<foreach collection="downOrganCdList" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
order by user_nm asc
</select>
<select id="selectPartInfoList" resultType="PartInfo" parameterType="PartInfo">
select pi.pi_seq,
version_no,
(select item_value from code_mgt where item_cd = mgt_organ) as mgt_organ,
land_police,
(select item_value from code_mgt where item_cd = mp_work_type) as mp_work_type,
mp_people_cnt,
mp_description,
(select item_value from code_mgt where item_cd = pl_work_type) as pl_work_type,
pl_people_cnt,
pl_description,
(select user_nm from user_info where user_seq = pi_user_seq ) as pi_manager_name,
rent_type,
rent_price,
utility_type,
utility_price,
wrt_dt
from part_info pi,
(select pi_seq,max(version_no) as lastVer
from part_info group by pi_seq) b
where pi.pi_seq = b.pi_seq
and pi.version_no = b.lastVer
and wrt_organ in
<foreach collection="downOrganCdList" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
order by wrt_dt desc
limit #{rowCnt} offset #{firstIndex}
</select>
<select id="selectPartInfoListCnt" resultType="int" parameterType="PartInfo">
select count(*)
from(
select pi.pi_seq,
version_no,
mgt_organ,
land_police,
mp_work_type,
mp_people_cnt,
mp_description,
pl_work_type,
pl_people_cnt,
pl_description,
(select user_nm from user_info where user_seq = pi_user_seq ) as pi_manager_name,
rent_type,
rent_price,
utility_type,
utility_price,
wrt_dt
from part_info pi,
(select pi_seq,max(version_no) as lastVer
from part_info group by pi_seq) b
where pi.pi_seq = b.pi_seq
and pi.version_no = b.lastVer
and wrt_organ in
<foreach collection="downOrganCdList" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
order by wrt_dt desc
) a
</select>
</mapper>

View File

@ -0,0 +1,90 @@
let files = [];
$(document).on('click', '#addPartInfo', function (){
$.ajax({
url: '/target/partInfoEditModal',
type: 'GET',
dataType:"html",
success: function(html){
$("#partInfoEditModalEditModalContent").empty().append(html);
$("#partInfoEditModal").modal('show');
$("#rentPrice").hide();
$("#utilityPrice").hide();
setUploadDiv();
},
error:function(){
}
});
})
$(document).on('change', '#rentType', function (){
if($("#rentType").val() == 'Y'){
$("#rentPrice").show();
}else{
$("#rentPrice").hide();
$("#rentPrice").val('');
}
});
$(document).on('change', '#utilityType', function (){
if($("#utilityType").val() == 'Y'){
$("#utilityPrice").show();
}else{
$("#utilityPrice").hide();
$("#utilityPrice").val('');
}
});
$(document).on('change', '#mgtOrgan', function (){
const ogCd = $(this).val();
if(ogCd != ''){
$.ajax({
url: '/target/partInfoSelecBox',
data: {
ogCd,
},
type: 'GET',
dataType:"html",
success: function(html){
$("#piUserSeq").empty().append(html);
$("#piUserSeq").prop('disabled',false);
},
error:function(){
}
});
}else{
$("#piUserSeq").prop('disabled',true);
$("#piUserSeq").val('');
}
});
$(document).on('click', '#savePartInfo', function (){
if(confirm("저장하시겠습니까?")){
contentFade("in");
const formData = new FormData($("#partInfoSave")[0]);
for(const file of files) {
if(!file.isDelete)
formData.append('uploadFiles', file, file.name);
}
$.ajax({
type : 'POST',
data : formData,
url : "/target/savePartInfo",
processData: false,
contentType: false,
success : function(result) {
alert("저장되었습니다.");
contentFade("out");
location.reload();
},
error : function(xhr, status) {
alert("저장에 실패하였습니다.")
contentFade("out");
}
})
}
})

View File

@ -0,0 +1,7 @@
<!DOCTYPE html>
<html lang="ko" xmlns:th="http://www.thymeleaf.org">
<option value="">-선택-</option>
<th:block th:each="info:${managerList}">
<option th:value="${info.user_seq}" th:text="${info.user_name}"></option>
</th:block>
</html>

View File

@ -0,0 +1,129 @@
<!DOCTYPE html>
<html lang="ko" xmlns:th="http://www.thymeleaf.org">
<div class="modal-header">
<h5 class="modal-title" id="menuEditModalLabel">등록</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<form id="partInfoSave" method="post">
<input type="hidden" name="_csrf_header" th:value="${_csrf.headerName}"/>
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/>
<div class="mb-2 row">
<label for="ogCd" class="col-sm-2 col-form-label text-center">해경서</label>
<div class="col-sm-3">
<select class="form-select form-select-sm" id="mgtOrgan" name="mgtOrgan">
<option value="">선택</option>
<th:block th:each="commonCode:${session.commonCode.get('OG')}">
<th:block th:if="${#lists.contains(mgtOrganList, commonCode.itemCd)}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"></option>
</th:block>
</th:block>
</select>
</div>
<label for="ofcCd" class="col-sm-2 col-form-label text-center">육경서</label>
<div class="col-sm-3">
<input type="text" class="form-control" id="landPolice" name="landPolice" placeholder="직접입력">
</div>
</div>
<div class="mb-2 row">
<label for="ogCd" class="col-sm-2 col-form-label text-center">담당자</label>
<div class="col-sm-3">
<select class="form-select form-select-sm" id="piUserSeq" name="piUserSeq" disabled>
<option value="">선택</option>
</select>
</div>
</div>
<br><br>
<h6>해경</h6>
<div class="mb-3 row">
<label for="ogCd" class="col-sm-2 col-form-label text-center">근무방법</label>
<div class="col-sm-2">
<select class="form-select form-select-sm" name="mpWorkType">
<option value="">선택</option>
<th:block th:each="commonCode:${session.commonCode.get('PIS')}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"></option>
</th:block>
</select>
</div>
<label for="ofcCd" class="col-sm-2 col-form-label text-center">인원수</label>
<div class="col-sm-2">
<input type="number" class="form-control" id="mpPeopleCnt" name="mpPeopleCnt">
</div>
<label for="ofcCd" class="col-sm-1 col-form-label text-center">비고</label>
<div class="col-sm-3">
<input type="text" class="form-control" id="mpDescription" name="mpDescription">
</div>
</div>
<h6>육경</h6>
<div class="mb-3 row">
<label for="ogCd" class="col-sm-2 col-form-label text-center">근무방법</label>
<div class="col-sm-2">
<select class="form-select form-select-sm" name="plWorkType">
<option value="">선택</option>
<th:block th:each="commonCode:${session.commonCode.get('PIS')}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"></option>
</th:block>
</select>
</div>
<label for="ofcCd" class="col-sm-2 col-form-label text-center">인원수</label>
<div class="col-sm-2">
<input type="number" class="form-control" id="plPeopleCnt" name="plPeopleCnt">
</div>
<label for="ofcCd" class="col-sm-1 col-form-label text-center">비고</label>
<div class="col-sm-3">
<input type="text" class="form-control" id="plDescription" name="plDescription">
</div>
</div>
<br><br>
<div class="mb-3 row">
<label for="ogCd" class="col-sm-2 col-form-label text-center">터미널명</label>
<div class="col-sm-2">
<input type="text" class="form-control" id="terminalNm" name="terminalNm" placeholder="직접입력">
</div>
</div>
<div class="mb-3 row">
<label for="ofcCd" class="col-sm-2 col-form-label text-center">임차료</label>
<div class="col-sm-2">
<select class="form-select form-select-sm" id="rentType" name="rentType">
<option value="">선택</option>
<option value="N">무상</option>
<option value="Y">유상</option>
</select>
</div>
<div class="col-sm-3">
<input type="number" class="form-control" id="rentPrice" name="rentPrice" placeholder="직접입력">
</div>
</div>
<div class="mb-3 row">
<label for="ofcCd" class="col-sm-2 col-form-label text-center">공공요금</label>
<div class="col-sm-2">
<select class="form-select form-select-sm" id="utilityType" name="utilityType">
<option value="">선택</option>
<option value="N">무상</option>
<option value="Y">유상</option>
</select>
</div>
<div class="col-sm-3">
<input type="number" class="form-control" id="utilityPrice" name="utilityPrice" placeholder="직접입력">
</div>
</div>
<div class="row mb-3">
<label for="fileInputer" class="col-sm-2 col-form-label text-center">업로드 자료</label>
<div class="col-sm-10" style="min-height: 70px;">
<div class="w-100 h-100 border border-info rounded text-center" id="uploadDiv">
<br>파일을 업로드 해주세요.
</div>
</div>
<input type="file" class="d-none" id="fileInputer" multiple>
</div>
</form>
</div>
<div class="modal-footer justify-content-between">
<div class="col-auto">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button>
<button type="button" class="btn btn-primary" id="savePartInfo">저장</button>
</div>
</div>
</html>

View File

@ -0,0 +1,139 @@
<!DOCTYPE html>
<html lang="ko" xmlns:th="http://www.thymeleaf.org"
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorate="~{layout/layout}">
<th:block layout:fragment="script">
<script type="text/javascript" th:src="@{/js/fipTarget/partInfo.js}"></script>
</th:block>
<div layout:fragment="content">
<main class="pt-3">
<h4>외사 분실 현황</h4>
<input type="hidden" name="_csrf_header" th:value="${_csrf.headerName}"/>
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/>
<div class="row mx-0">
<div class="col-12 card text-center">
<div class="card-body">
<form id="searchFm" method="get" th:action="@{/translator/info}">
<input type="hidden" name="excel">
<input type="hidden" name="pageIndex" id="pageIndex" th:value="${searchParams.pageIndex}">
<div class="row justify-content-between pe-3 py-1">
<div class="col-auto">
<select class="form-select" 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" id="searchBtn" value="검색">
</div>
</div>
</div>
</form>
<div class="row justify-content-start">
<div class="col-12">
<div class="card">
<div class="card-body">
<div class="row">
<input type="hidden" id="selectedKey">
<input type="hidden" id="selectedVerNo">
<table class="table table-striped">
<thead>
<tr>
<th rowspan="2">해경서</th>
<th rowspan="2">육경서</th>
<th colspan="3">해경</th>
<th colspan="3">육경</th>
<th rowspan="2">터미널명</th>
<th rowspan="2">담당자</th>
<th rowspan="2">임차료</th>
<th rowspan="2">공공요금</th>
<th rowspan="2">최종수정일</th>
</tr>
<tr>
<th>근무방법</th>
<th></th>
<th>비고</th>
<th>근무방법</th>
<th></th>
<th>비고</th>
</thead>
<tbody>
<tr th:each="pi:${partInfoList}">
<td th:text="${pi.mgtOrgan}"></td>
<td th:text="${pi.landPolice}"></td>
<td th:text="${pi.mpWorkType}"></td>
<td th:text="${pi.mpPeopleCnt}"></td>
<td th:text="${pi.mpDescription}"></td>
<td th:text="${pi.plWorkType}"></td>
<td th:text="${pi.plPeopleCnt}"></td>
<td th:text="${pi.plDescription}"></td>
<td th:text="${pi.piManagerName}"></td>
<td th:text="${pi.rentType}"></td>
<td th:text="${pi.rentPrice}" th:if="${pi.rentType eq 'Y'}"></td>
<td th:text="${pi.rentType}" th:if="${pi.rentType eq 'N'}"></td>
<td th:text="${pi.utilityPrice}" th:if="${pi.utilityType eq 'Y'}"></td>
<td th:text="${pi.utilityType}" th:if="${pi.utilityType eq 'N'}"></td>
<td th:text="${#temporals.format(pi.wrtDt, 'yyyy-MM-dd')}"></td>
</tr>
</tbody>
</table>
</div>
<div class="row justify-content-center">
<div class="col-auto">
<nav aria-label="Page navigation">
<ul class="pagination">
<th:block th:if="${searchParams.pageIndex>3}">
<li class="page-item" th:data-pageindex="${(searchParams.pageIndex)-3}">
<a class="page-link" href="#" aria-label="Previous">
<span aria-hidden="true">&laquo;</span>
</a>
</li>
</th:block>
<th:block th:each="num : ${#numbers.sequence(searchParams.startNum, searchParams.endNum)}">
<li class="page-item" th:data-pageindex="${num}" th:classappend="${searchParams.pageIndex==num?'active':''}">
<a class="page-link" href="#" th:text="${num}"></a>
</li>
</th:block>
<th:block th:if="${searchParams.maxNum>searchParams.endNum+2}">
<li class="page-item" th:data-pageindex="${(searchParams.pageIndex)+3}">
<a class="page-link" href="#" aria-label="Next">
<span aria-hidden="true">&raquo;</span>
</a>
</li>
</th:block>
</ul>
</nav>
<div class="col-auto">
<input type="button" class="btn btn-success" value="등록" id="addPartInfo" >
<button id="goExcel">엑셀다운</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</main>
<div class="modal fade" id="partInfoEditModal" 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-content" id="partInfoEditModalEditModalContent">
<div class="modal-header">
</div>
<div class="modal-body">
<div class="tab-content border border-top-0" id="configInfo">
</div>
</div>
</div>
</div>
</div>
</div>
</html>

View File

@ -98,8 +98,8 @@
<div class="col-sm-2"> <div class="col-sm-2">
<select class="form-select form-select-sm" name="dmlYn"> <select class="form-select form-select-sm" name="dmlYn">
<option value="">선택</option> <option value="">선택</option>
<option value="O"></option> <option value="O" th:selected="'O' == ${trInfo.dmlYn}"></option>
<option value="X">아니오</option> <option value="X" th:selected="'X' == ${trInfo.dmlYn}">아니오</option>
</select> </select>
</div> </div>