fix:외사장비현황 -> 세부장비현황 작업중
parent
cffa53ccb5
commit
f67b41c059
|
|
@ -69,11 +69,43 @@ public class EquipController {
|
|||
equip.setWrtOrgan(loginUser.getOgCd());
|
||||
equip.setWrtDt(LocalDateTime.now());
|
||||
equipService.saveEquip(equip,request);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@GetMapping("/List")
|
||||
public ModelAndView equipList(@AuthenticationPrincipal UserInfo loginUser,Equip equip) {
|
||||
ModelAndView mav = new ModelAndView("equip/equipList");
|
||||
equip.setDownOrganCdList(loginUser.getDownOrganCdList());
|
||||
ParamMap equType = equipService.selectEduType(equip);
|
||||
mav.addObject("equType", equType.get("equ_type"));
|
||||
mav.addObject("detailType", equType.get("detail_type"));
|
||||
equip.setQueryInfo();
|
||||
mav.addObject("equipList", equipService.selectEquipList(equip));
|
||||
equip.setContentCnt(equipService.selectEquipListCnt(equip));
|
||||
equip.setPaginationInfo();
|
||||
mav.addObject("searchParams", equip);
|
||||
|
||||
return mav;
|
||||
}
|
||||
|
||||
@GetMapping("/updatePage")
|
||||
public ModelAndView equipUpdatePage(Equip equip) {
|
||||
ModelAndView mav = new ModelAndView("equip/equipModifyModal");
|
||||
mav.addObject("equInfo", equipService.selectEquipInfo(equip));
|
||||
return mav;
|
||||
}
|
||||
|
||||
@PostMapping("/updateEquip")
|
||||
@ResponseBody
|
||||
public int updateEquip(@AuthenticationPrincipal UserInfo loginUser,Equip equip, MultipartHttpServletRequest request){
|
||||
System.out.println("equip@"+equip);
|
||||
equip.setWrtNm(loginUser.getUserId());
|
||||
equip.setMgtOrgan(loginUser.getOgCd());
|
||||
equip.setWrtOrgan(loginUser.getOgCd());
|
||||
equip.setWrtDt(LocalDateTime.now());
|
||||
int result = equipService.updateEquip(equip,request);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,14 @@ public interface EquipMapper {
|
|||
|
||||
List<ParamMap> selectEquipStatus(Equip equip);
|
||||
|
||||
List<Equip> selectEquipList(Equip equip);
|
||||
|
||||
Integer selectEquipListCnt(Equip equip);
|
||||
|
||||
Equip selectEquipInfo(Equip equip);
|
||||
|
||||
ParamMap selectEduType(Equip equip);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,6 +56,23 @@ public class Equip extends BaseModel implements Serializable{
|
|||
private String wrtNm;
|
||||
@Column(name = "wrt_dt")
|
||||
private LocalDateTime wrtDt;
|
||||
|
||||
@Transient
|
||||
private String sosok;
|
||||
@Transient
|
||||
private String detailSosok;
|
||||
@Transient
|
||||
private String detailName;
|
||||
@Transient
|
||||
private String origNm;
|
||||
@Transient
|
||||
private String convNm;
|
||||
@Transient
|
||||
private String filePath;
|
||||
@Transient
|
||||
private Integer deleteFileKey;
|
||||
@Transient
|
||||
private Integer deleteFileVnum;
|
||||
|
||||
|
||||
@Embeddable
|
||||
|
|
@ -73,7 +90,9 @@ public String toString() {
|
|||
return "Equip [equKey=" + equKey + ", versionNo=" + versionNo + ", mgtOrgan=" + mgtOrgan + ", equType=" + equType
|
||||
+ ", detailType=" + detailType + ", storedYear=" + storedYear + ", mgtType=" + mgtType + ", itemQty="
|
||||
+ itemQty + ", itemCondition=" + itemCondition + ", note=" + note + ", wrtOrgan=" + wrtOrgan + ", wrtNm="
|
||||
+ wrtNm + ", wrtDt=" + wrtDt + "]";
|
||||
+ wrtNm + ", wrtDt=" + wrtDt + ", sosok=" + sosok + ", detailSosok=" + detailSosok + ", detailName="
|
||||
+ detailName + ", origNm=" + origNm + ", convNm=" + convNm + ", filePath=" + filePath + ", deleteFileKey="
|
||||
+ deleteFileKey + ", deleteFileVnum=" + deleteFileVnum + "]";
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -83,4 +102,16 @@ public String toString() {
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,9 +28,6 @@ import java.util.Date;
|
|||
@IdClass(EquipFile.EquipFileId.class)
|
||||
@Table(name = "equ_file")
|
||||
public class EquipFile extends BaseModel implements Serializable{
|
||||
@Id
|
||||
@Column(name = "file_seq")
|
||||
private Integer fileSeq;
|
||||
@Id
|
||||
@Column(name = "equ_key")
|
||||
private Integer equKey;
|
||||
|
|
@ -55,7 +52,6 @@ public class EquipFile extends BaseModel implements Serializable{
|
|||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class EquipFileId implements Serializable {
|
||||
private Integer fileSeq;
|
||||
private Integer equKey;
|
||||
private Integer versionNo;
|
||||
}
|
||||
|
|
@ -64,9 +60,8 @@ public static class EquipFileId implements Serializable {
|
|||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "EquipFile [fileSeq=" + fileSeq + ", equKey=" + equKey + ", versionNo=" + versionNo + ", origNm=" + origNm
|
||||
+ ", convNm=" + convNm + ", fileExtn=" + fileExtn + ", fileSize=" + fileSize + ", filePath=" + filePath
|
||||
+ "]";
|
||||
return "EquipFile [equKey=" + equKey + ", versionNo=" + versionNo + ", origNm=" + origNm + ", convNm=" + convNm
|
||||
+ ", fileExtn=" + fileExtn + ", fileSize=" + fileSize + ", filePath=" + filePath + "]";
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -77,4 +72,7 @@ public String toString() {
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
package com.dbnt.faisp.equip.repository;
|
||||
|
||||
import com.dbnt.faisp.equip.model.Equip;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
|
||||
|
|
@ -12,4 +15,6 @@ public interface EquipRepository extends JpaRepository<Equip, Equip.EquipId> {
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,9 +3,13 @@ package com.dbnt.faisp.equip.service;
|
|||
|
||||
import com.dbnt.faisp.equip.mapper.EquipMapper;
|
||||
import com.dbnt.faisp.equip.model.Equip;
|
||||
import com.dbnt.faisp.equip.model.Equip.EquipId;
|
||||
import com.dbnt.faisp.equip.model.EquipFile;
|
||||
import com.dbnt.faisp.equip.model.EquipFile.EquipFileId;
|
||||
import com.dbnt.faisp.equip.repository.EquipFileRepository;
|
||||
import com.dbnt.faisp.equip.repository.EquipRepository;
|
||||
import com.dbnt.faisp.translator.model.Translator;
|
||||
import com.dbnt.faisp.translator.model.Translator.TranslatorId;
|
||||
import com.dbnt.faisp.util.ParamMap;
|
||||
import com.dbnt.faisp.util.Utils;
|
||||
|
||||
|
|
@ -44,7 +48,7 @@ public class EquipService {
|
|||
equip.setEquKey(dbEquip.getEquKey()+1);
|
||||
equip.setVersionNo(1);
|
||||
equipRepository.save(equip);
|
||||
}
|
||||
}
|
||||
saveFile(equip,request);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
|
@ -57,7 +61,7 @@ public class EquipService {
|
|||
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);
|
||||
|
|
@ -74,7 +78,6 @@ public class EquipService {
|
|||
FileCopyUtils.copy(mFile.getBytes(), new File(path, saveName));
|
||||
|
||||
EquipFile equipFile = new EquipFile();
|
||||
equipFile.setFileSeq(1);
|
||||
equipFile.setEquKey(equip.getEquKey());
|
||||
equipFile.setVersionNo(equip.getVersionNo());
|
||||
equipFile.setOrigNm(fileName);
|
||||
|
|
@ -82,17 +85,19 @@ public class EquipService {
|
|||
equipFile.setFileExtn(fileExt);
|
||||
equipFile.setFilePath(path);
|
||||
equipFile.setFileSize(FileSize);
|
||||
System.out.println(equipFile);
|
||||
|
||||
equipFileRepository.save(equipFile);
|
||||
} else {
|
||||
EquipFile equipFile = new EquipFile();
|
||||
equipFile.setEquKey(equip.getEquKey());
|
||||
equipFile.setVersionNo(equip.getVersionNo());
|
||||
equipFileRepository.save(equipFile);
|
||||
}
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
throw e;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -110,5 +115,106 @@ public class EquipService {
|
|||
return equipMapper.selectEquipStatus(equip);
|
||||
}
|
||||
|
||||
public List<Equip> selectEquipList(Equip equip) {
|
||||
return equipMapper.selectEquipList(equip);
|
||||
}
|
||||
|
||||
public Integer selectEquipListCnt(Equip equip) {
|
||||
return equipMapper.selectEquipListCnt(equip);
|
||||
}
|
||||
|
||||
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.setWrtNm(equip.getWrtNm());
|
||||
equipTmp.setWrtDt(equip.getWrtDt());
|
||||
equipRepository.save(equipTmp);
|
||||
updateFile(equip,equipTmp,request);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return equip.getEquKey();
|
||||
}
|
||||
|
||||
public void updateFile(Equip equip,Equip equipTmp, MultipartHttpServletRequest mRequest) throws Exception {
|
||||
try {
|
||||
String path = locationPath;
|
||||
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());
|
||||
|
||||
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;
|
||||
};
|
||||
|
||||
String fileExt = Utils.getFileExtention(fileName);
|
||||
String saveName = Utils.generationSaveName() + "." + fileExt;
|
||||
FileCopyUtils.copy(mFile.getBytes(), new File(path, saveName));
|
||||
|
||||
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);
|
||||
|
||||
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 ParamMap selectEduType(Equip equip) {
|
||||
return equipMapper.selectEduType(equip);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -195,6 +195,122 @@
|
|||
group by c.category_cd,c.equ_type,c.item_value,item_cd
|
||||
order by category_cd,item_cd asc
|
||||
</select>
|
||||
|
||||
<select id="selectEquipList" resultType="Equip" parameterType="Equip">
|
||||
select em.equ_key,
|
||||
em.version_no,
|
||||
mgt_organ,
|
||||
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 (select item_value from code_mgt cm where cm.item_cd = oc.parent_organ )
|
||||
end as sosok,
|
||||
case
|
||||
when oc.organ_type = 'OGC003' then (select item_value from code_mgt cm where cm.item_cd = oc.organ_cd )
|
||||
else null
|
||||
end as detail_sosok,
|
||||
equ_type,
|
||||
detail_type,
|
||||
stored_year,
|
||||
item_qty,
|
||||
(select item_value from code_mgt cm where cm.item_cd = item_condition) as item_condition,
|
||||
note,
|
||||
ef.orig_nm,
|
||||
ef.conv_nm,
|
||||
ef.file_path
|
||||
from equ_mgt em,
|
||||
(select equ_key,max(version_no) as lastVer
|
||||
from equ_mgt group by equ_key) b,
|
||||
equ_file ef,
|
||||
organ_config oc
|
||||
where em.equ_key = b.equ_key
|
||||
and em.version_no = b.lastVer
|
||||
and em.equ_key = ef.equ_key
|
||||
and em.version_no = ef.version_no
|
||||
and em.mgt_organ = oc.organ_cd
|
||||
and detail_type = #{detailType}
|
||||
and mgt_organ in
|
||||
<foreach collection="downOrganCdList" item="item" index="index" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
order by equ_key asc
|
||||
</select>
|
||||
|
||||
<select id="selectEquipListCnt" resultType="int" parameterType="Equip">
|
||||
select count(*)
|
||||
from(
|
||||
select em.equ_key,
|
||||
em.version_no,
|
||||
mgt_organ,
|
||||
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 (select item_value from code_mgt cm where cm.item_cd = oc.parent_organ )
|
||||
end as sosok,
|
||||
case
|
||||
when oc.organ_type = 'OGC003' then (select item_value from code_mgt cm where cm.item_cd = oc.organ_cd )
|
||||
else null
|
||||
end as detail_sosok,
|
||||
equ_type,
|
||||
detail_type,
|
||||
stored_year,
|
||||
item_qty,
|
||||
(select item_value from code_mgt cm where cm.item_cd = item_condition) as item_condition,
|
||||
note,
|
||||
ef.orig_nm,
|
||||
ef.conv_nm,
|
||||
ef.file_path
|
||||
from equ_mgt em,
|
||||
(select equ_key,max(version_no) as lastVer
|
||||
from equ_mgt group by equ_key) b,
|
||||
equ_file ef,
|
||||
organ_config oc
|
||||
where em.equ_key = b.equ_key
|
||||
and em.version_no = b.lastVer
|
||||
and em.equ_key = ef.equ_key
|
||||
and em.version_no = ef.version_no
|
||||
and em.mgt_organ = oc.organ_cd
|
||||
and detail_type = #{detailType}
|
||||
and mgt_organ in
|
||||
<foreach collection="downOrganCdList" item="item" index="index" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
order by equ_key asc
|
||||
) a
|
||||
</select>
|
||||
|
||||
<select id="selectEquipInfo" resultType="Equip" parameterType="Equip">
|
||||
select em.equ_key,
|
||||
em.version_no,
|
||||
mgt_organ,
|
||||
equ_type,
|
||||
(select item_value from code_mgt cm where cm.item_cd = detail_type ) as detail_Name,
|
||||
detail_type,
|
||||
stored_year,
|
||||
item_qty,
|
||||
item_condition,
|
||||
note,
|
||||
ef.orig_nm,
|
||||
ef.conv_nm,
|
||||
ef.file_path
|
||||
from equ_mgt em,
|
||||
(select equ_key,max(version_no) as lastVer
|
||||
from equ_mgt group by equ_key) b,
|
||||
equ_file ef
|
||||
where em.equ_key = b.equ_key
|
||||
and em.version_no = b.lastVer
|
||||
and em.equ_key = ef.equ_key
|
||||
and em.version_no = ef.version_no
|
||||
and em.equ_key = #{equKey}
|
||||
</select>
|
||||
|
||||
<select id="selectEduType" resultType="com.dbnt.faisp.util.ParamMap" parameterType="Equip">
|
||||
select (select item_value from code_mgt cm where cm.item_cd = a.category_cd) as equ_type,
|
||||
(select item_value from code_mgt cm where cm.item_cd = a.item_cd) as detail_type
|
||||
from code_mgt a
|
||||
where item_cd = #{detailType}
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
@ -45,6 +45,7 @@ $(document).on('change', '#equType', function (){
|
|||
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on('click', '#saveEquip', function (){
|
||||
if(confirm("저장하시겠습니까?")){
|
||||
|
|
@ -69,6 +70,68 @@ $(document).on('click', '#saveEquip', function (){
|
|||
})
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$(document).on('click', '#equUpdateBtn', function (){
|
||||
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){
|
||||
$("#configEqu").empty().append(html)
|
||||
$("#equipModifyModal").modal('show');
|
||||
},
|
||||
error:function(){
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(document).on('click', '#addImgBtn', function (){
|
||||
$("#imgUpload").remove();
|
||||
$("#imgUpdate").show();
|
||||
|
||||
})
|
||||
|
||||
function deleteImg(equKey,versionNo){
|
||||
$('#equipModifyForm').append('<input type="hidden" name="deleteFileKey" value="'+equKey+'">',
|
||||
'<input type="hidden" name="deleteFileVnum" value="'+versionNo+'">');
|
||||
$("#imgUpload").remove();
|
||||
$("#imgUpdate").show();
|
||||
}
|
||||
|
||||
$(document).on('click', '#updateEquip', function (){
|
||||
if(confirm("수정하시겠습니까?")){
|
||||
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");
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
});
|
||||
|
|
@ -43,9 +43,9 @@
|
|||
<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">
|
||||
<select class="form-select form-select-sm" name="item_condition">
|
||||
<select class="form-select form-select-sm" name="itemCondition">
|
||||
<option value="">상태 선택</option>
|
||||
<th:block th:each="commonCode:${session.commonCode.get('LGG')}">
|
||||
<th:block th:each="commonCode:${session.commonCode.get('ITCON')}">
|
||||
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"></option>
|
||||
</th:block>
|
||||
</select>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,149 @@
|
|||
<!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/equip/equip.js}"></script>
|
||||
</th:block>
|
||||
<div layout:fragment="content">
|
||||
<main class="pt-3">
|
||||
<h4 th:text="|${equType}-${detailType} 세부현황|"></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 method="get" th:action="@{/userMgt/userMgtPage}">
|
||||
<input type="hidden" name="userStatus" id="userStatus" >
|
||||
<input type="hidden" name="pageIndex" id="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">
|
||||
<div class="col-auto">
|
||||
<select class="form-select form-select-sm" name="ogCd">
|
||||
<option value="">관서 선택</option>
|
||||
<th:block th:each="commonCode:${session.commonCode.get('OG')}">
|
||||
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"></option>
|
||||
</th:block>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<select class="form-select form-select-sm" name="ofcCd">
|
||||
<option value="">부서 선택</option>
|
||||
<th:block th:each="commonCode:${session.commonCode.get('OFC')}">
|
||||
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"></option>
|
||||
</th:block>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<input type="text" class="form-control form-control-sm" name="userNm" >
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<input type="text" class="form-control form-control-sm" name="userId">
|
||||
</div>
|
||||
<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">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th> <input type="checkbox" id="chk-all" class="userInfoCheckBox"></th>
|
||||
<th>소속</th>
|
||||
<th>세부소속</th>
|
||||
<th>장비사진</th>
|
||||
<th>취득년도</th>
|
||||
<th>보유량</th>
|
||||
<th>상태</th>
|
||||
<th>비고</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr th:each="equ:${equipList}">
|
||||
<td>
|
||||
<input type="checkbox" name="equChk">
|
||||
<input type="hidden" class="equKey" th:value="${equ.equKey}">
|
||||
<input type="hidden" class="verNo" th:value="${equ.versionNo}">
|
||||
</td>
|
||||
<td th:text="${equ.sosok}"></td>
|
||||
<td th:text="${equ.detailSosok}"></td>
|
||||
<td th:text="${equ.origNm}"></td>
|
||||
<td th:text="${equ.storedYear}"></td>
|
||||
<td th:text="${equ.itemQty}"></td>
|
||||
<td th:text="${equ.itemCondition}"></td>
|
||||
<td th:text="${equ.note}"></td>
|
||||
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<input type="button" class="btn btn-success" value="삭제" id="">
|
||||
<input type="button" class="btn btn-success" value="수정" id="equUpdateBtn">
|
||||
<input type="button" class="btn btn-success" value="수정이력" id="">
|
||||
</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">«</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">»</span>
|
||||
</a>
|
||||
</li>
|
||||
</th:block>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</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-dialog modal-lg modal-dialog-scrollable">
|
||||
<div class="modal-content" id="equipEditModalContent">
|
||||
<div class="modal-header">
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="tab-content border border-top-0" id="configEqu">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,87 @@
|
|||
<!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="equipModifyForm" th:action="@{/equip/updateEquip}" method="post" enctype="multipart/form-data">
|
||||
<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="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>
|
||||
<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>
|
||||
</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>
|
||||
<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>
|
||||
</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>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" name="storedYear" th:value="${equInfo.storedYear}">
|
||||
</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" 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="col-sm-6">
|
||||
<select class="form-select form-select-sm" 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>
|
||||
</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>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" name="note" th:value="${equInfo.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">
|
||||
<div id="imgUpload">
|
||||
<input type="text" th:value="${equInfo.origNm}" readonly th:if="${not #strings.isEmpty(equInfo.origNm)}">
|
||||
<input type="button" id="deleteImgBtn" value="삭제" th:if="${not #strings.isEmpty(equInfo.origNm)}" th:attr="onclick=|deleteImg('${equInfo.equKey}','${equInfo.versionNo}')|">
|
||||
<input type="text" value="등록된 사진이 없습니다." readonly th:if="${#strings.isEmpty(equInfo.origNm)}">
|
||||
<input type="button" id="addImgBtn" value="추가" th:if="${#strings.isEmpty(equInfo.origNm)}">
|
||||
</div>
|
||||
<div id="imgUpdate" style="display:none">
|
||||
<input type="file" name="file">
|
||||
</div>
|
||||
</div>
|
||||
</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="updateEquip">수정</button>
|
||||
</div>
|
||||
</div>
|
||||
</html>
|
||||
|
|
@ -105,7 +105,7 @@
|
|||
<tr class="" th:each="equip,index:${equipList}">
|
||||
<td th:text="${index.index+1}"></td>
|
||||
<td class="table_id" th:text="${equip.equ_type}"></td>
|
||||
<td th:text="${equip.item_value}"></td>
|
||||
<td th:text="${equip.item_value}" th:onclick="|location.href='@{/equip/List(detailType=${equip.item_cd})}'|"></td>
|
||||
<td th:text="${equip.total}"></td>
|
||||
<td th:text="${equip.cnt_bon}"></td>
|
||||
<td th:text="${equip.cnt_center}"></td>
|
||||
|
|
@ -155,21 +155,14 @@
|
|||
<div class="modal-dialog modal-lg modal-dialog-scrollable">
|
||||
<div class="modal-content" id="equipEditModalContent">
|
||||
<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">
|
||||
<div class="tab-content border border-top-0" id="configInfo">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn" id="deleteBtn" style='background-color : red;float:left;'>삭제</button>
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button>
|
||||
<button type="button" class="btn btn-primary" id="updateBtn">저장</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</html>
|
||||
Loading…
Reference in New Issue