중간저장
parent
ea61d6ad09
commit
295be173ba
|
|
@ -7,6 +7,7 @@ import com.dbnt.faisp.menuMgt.model.MenuMgt;
|
||||||
import com.dbnt.faisp.organMgt.OrganConfigService;
|
import com.dbnt.faisp.organMgt.OrganConfigService;
|
||||||
import com.dbnt.faisp.translator.TranslatorService;
|
import com.dbnt.faisp.translator.TranslatorService;
|
||||||
import com.dbnt.faisp.translator.model.Translator;
|
import com.dbnt.faisp.translator.model.Translator;
|
||||||
|
import com.dbnt.faisp.translator.model.TranslatorCrr;
|
||||||
import com.dbnt.faisp.userInfo.UserInfoService;
|
import com.dbnt.faisp.userInfo.UserInfoService;
|
||||||
import com.dbnt.faisp.userInfo.model.UserInfo;
|
import com.dbnt.faisp.userInfo.model.UserInfo;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
@ -44,9 +45,11 @@ public class TranslatorController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/insertTranslatorInfo")
|
@PostMapping("/insertTranslatorInfo")
|
||||||
public String insertTranslatorInfo(@AuthenticationPrincipal UserInfo loginUser,Translator translator) {
|
@ResponseBody
|
||||||
|
public String insertTranslatorInfo(@AuthenticationPrincipal UserInfo loginUser,Translator translator, @RequestParam List<TranslatorCrr> tCrr) {
|
||||||
translator.setWrtNm(loginUser.getUserId());
|
translator.setWrtNm(loginUser.getUserId());
|
||||||
translator.setWrtOrgan(loginUser.getOgCd());
|
translator.setWrtOrgan(loginUser.getOgCd());
|
||||||
|
System.out.println("@@="+tCrr);
|
||||||
return translatorSevice.insertTranslatorInfo(translator);
|
return translatorSevice.insertTranslatorInfo(translator);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -56,8 +56,8 @@ public class TranslatorService {
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public void updatetranslatorInfo(Translator translator) {
|
public void updatetranslatorInfo(Translator translator) {
|
||||||
Translator dbTranslator = translatorRepository
|
System.out.println("@@="+translator);
|
||||||
.findById(new TranslatorId(translator.getTranslatorKey(), translator.getVersionNo())).orElse(null);
|
Translator dbTranslator = translatorRepository.findById(new TranslatorId(translator.getTranslatorKey(), translator.getVersionNo())).orElse(null);
|
||||||
Translator translatorTmp = new Translator();
|
Translator translatorTmp = new Translator();
|
||||||
translatorTmp.setTranslatorKey(dbTranslator.getTranslatorKey());
|
translatorTmp.setTranslatorKey(dbTranslator.getTranslatorKey());
|
||||||
translatorTmp.setVersionNo(dbTranslator.getVersionNo() + 1);
|
translatorTmp.setVersionNo(dbTranslator.getVersionNo() + 1);
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,70 @@
|
||||||
|
package com.dbnt.faisp.translator.model;
|
||||||
|
|
||||||
|
import com.dbnt.faisp.authMgt.model.AccessConfig;
|
||||||
|
import com.dbnt.faisp.authMgt.model.ApprovalConfig;
|
||||||
|
import com.dbnt.faisp.codeMgt.model.CodeMgt;
|
||||||
|
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.security.core.GrantedAuthority;
|
||||||
|
import org.springframework.security.core.authority.SimpleGrantedAuthority;
|
||||||
|
import org.springframework.security.core.userdetails.UserDetails;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@Entity
|
||||||
|
@NoArgsConstructor
|
||||||
|
@DynamicInsert
|
||||||
|
@DynamicUpdate
|
||||||
|
@Table(name = "translator_career")
|
||||||
|
public class TranslatorCrr extends BaseModel implements Serializable{
|
||||||
|
@Id
|
||||||
|
@Column(name = "career_seq")
|
||||||
|
private Integer careerSeq;
|
||||||
|
@Column(name = "translator_key")
|
||||||
|
private Integer translatorKey;
|
||||||
|
@Column(name = "version_no")
|
||||||
|
private Integer versionNo;
|
||||||
|
@Column(name = "his_gubun")
|
||||||
|
private String hisGubun;
|
||||||
|
@Column(name = "contents")
|
||||||
|
private String contents;
|
||||||
|
@Column(name = "tc_dt")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private LocalDate tcDt;
|
||||||
|
@Column(name = "remark")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "TranslatorCrr [careerSeq=" + careerSeq + ", translatorKey=" + translatorKey + ", versionNo=" + versionNo
|
||||||
|
+ ", hisGubun=" + hisGubun + ", contents=" + contents + ", tcDt=" + tcDt + ", remark=" + remark + "]";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
let trCarrerList=[];
|
||||||
|
let selectedIdx=0;
|
||||||
|
|
||||||
$(document).on('click', '.userInfoTr', function (){
|
$(document).on('click', '.userInfoTr', function (){
|
||||||
document.getElementById('accessTab').classList.add('active');
|
document.getElementById('accessTab').classList.add('active');
|
||||||
document.getElementById('approvalTab').classList.remove('active');
|
document.getElementById('approvalTab').classList.remove('active');
|
||||||
|
|
@ -35,15 +38,17 @@ $(document).on('click', '#updateBtn', function (){
|
||||||
})
|
})
|
||||||
|
|
||||||
$(document).on('click', '#saveBtn', function (){
|
$(document).on('click', '#saveBtn', function (){
|
||||||
|
console.log(trCarrerList);
|
||||||
if(confirm("저장하시겠습니까?")){
|
if(confirm("저장하시겠습니까?")){
|
||||||
contentFade("in");
|
contentFade("in");
|
||||||
const formData = new FormData($("#translatorInsert")[0]);
|
const formData = new FormData($("#translatorInsert")[0]);
|
||||||
|
var values = JSON.stringify(trCarrerList);
|
||||||
|
$('input[name=TranslatorCrr]').val(values);
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type : 'POST',
|
type : 'POST',
|
||||||
data : formData,
|
data : formData,
|
||||||
url : "/translator/insertTranslatorInfo",
|
url : "/translator/insertTranslatorInfo",
|
||||||
processData: false,
|
contentType: 'false',
|
||||||
contentType: false,
|
|
||||||
success : function(result) {
|
success : function(result) {
|
||||||
alert("저장되었습니다.")
|
alert("저장되었습니다.")
|
||||||
contentFade("out");
|
contentFade("out");
|
||||||
|
|
@ -151,6 +156,10 @@ $(document).ready( function() {
|
||||||
format: "yyyy-mm-dd",
|
format: "yyyy-mm-dd",
|
||||||
language: "ko"
|
language: "ko"
|
||||||
});
|
});
|
||||||
|
$(".tcDt").datepicker({
|
||||||
|
format: "yyyy-mm-dd",
|
||||||
|
language: "ko"
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on('click', '#approvalTab', function (){
|
$(document).on('click', '#approvalTab', function (){
|
||||||
|
|
@ -197,3 +206,69 @@ $(document).on('change', '#trNny', function (){
|
||||||
$("#trVisa").removeAttr("disabled");
|
$("#trVisa").removeAttr("disabled");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$(document).on('click', '#crrAddBtn', function (){
|
||||||
|
$('#crr').append(
|
||||||
|
'<div class="mb-5 row" id="crrDiv">'+
|
||||||
|
'<div class="col-sm-1">'+
|
||||||
|
'<button type="button" class="btn btn-sm btn-outline-danger rowDeleteBtn"><i class="bi bi-x"></i></button>'+
|
||||||
|
'</div>'+
|
||||||
|
'<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 crrInput" name="hisGubun">'+
|
||||||
|
'<option value="">선택</option>'+
|
||||||
|
'<option value="Y">해양경찰청</option>'+
|
||||||
|
'<option value="N">타기관</option>'+
|
||||||
|
'</select>'+
|
||||||
|
'</div>'+
|
||||||
|
'<label for="ofcCd" class="col-sm-1 col-form-label text-center">날짜</label>'+
|
||||||
|
'<div class="col-sm-2">'+
|
||||||
|
'<input type="text" class="form-control tcDt crrInput" id="tcDt" name="tcDt">'+
|
||||||
|
'</div>'+
|
||||||
|
'<label for="ofcCd" class="col-sm-1 col-form-label text-center">내용</label>'+
|
||||||
|
'<div class="col-sm-4">'+
|
||||||
|
'<input type="text" class="form-control crrInput" id="contents" name="contents">'+
|
||||||
|
'</div>'+
|
||||||
|
'<label for="ofcCd" class="col-sm-1 col-form-label text-center">비고</label>'+
|
||||||
|
'<div class="col-sm-4">'+
|
||||||
|
'<input type="text" class="form-control crrInput" id="remark" name="remark">'+
|
||||||
|
'</div>'+
|
||||||
|
'</div>'
|
||||||
|
)
|
||||||
|
$(".tcDt").datepicker({
|
||||||
|
format: "yyyy-mm-dd",
|
||||||
|
language: "ko"
|
||||||
|
});
|
||||||
|
trCarrerList.push({hisGubun:"",tcDt:"",contents:"",remark:""});
|
||||||
|
console.log(trCarrerList);
|
||||||
|
})
|
||||||
|
|
||||||
|
$(document).on('click', '.rowDeleteBtn', function (){
|
||||||
|
console.log($(this).parents('#crr').children('#crrDiv'));
|
||||||
|
selectedIdx = $(this).parents('#crr').children('#crrDiv').length-1;
|
||||||
|
trCarrerList.splice(selectedIdx,1);
|
||||||
|
console.log(selectedIdx);
|
||||||
|
console.log(trCarrerList);
|
||||||
|
|
||||||
|
$(this).parents('#crrDiv').remove();
|
||||||
|
})
|
||||||
|
|
||||||
|
$(document).on('change', '.crrInput', function (){
|
||||||
|
selectedIdx = $(this).parents('#crr').children('#crrDiv').length-1;
|
||||||
|
const target = trCarrerList[selectedIdx];
|
||||||
|
console.log(target)
|
||||||
|
switch (this.name){
|
||||||
|
case "hisGubun":
|
||||||
|
target.hisGubun = this.value
|
||||||
|
break;
|
||||||
|
case "tcDt":
|
||||||
|
target.tcDt = this.value
|
||||||
|
break;
|
||||||
|
case "contents":
|
||||||
|
target.contents = this.value
|
||||||
|
break;
|
||||||
|
case "remark":
|
||||||
|
target.remark = this.value
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
|
||||||
|
|
@ -154,7 +154,6 @@
|
||||||
<form id="translatorInsert" action="#" method="post">
|
<form id="translatorInsert" action="#" method="post">
|
||||||
<input type="hidden" name="_csrf_header" th:value="${_csrf.headerName}"/>
|
<input type="hidden" name="_csrf_header" th:value="${_csrf.headerName}"/>
|
||||||
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/>
|
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/>
|
||||||
<div class="mb-3 row">
|
|
||||||
<div class="mb-3 row">
|
<div class="mb-3 row">
|
||||||
<label for="ogCd" class="col-sm-2 col-form-label text-center">관서</label>
|
<label for="ogCd" class="col-sm-2 col-form-label text-center">관서</label>
|
||||||
<div class="col-sm-2">
|
<div class="col-sm-2">
|
||||||
|
|
@ -241,6 +240,7 @@
|
||||||
<input type="text" class="form-control" id="aptDt" name="aptDt">
|
<input type="text" class="form-control" id="aptDt" name="aptDt">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="mb-3 row">
|
||||||
<label for="ogCd" class="col-sm-2 col-form-label text-center">해촉</label>
|
<label for="ogCd" class="col-sm-2 col-form-label text-center">해촉</label>
|
||||||
<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">
|
||||||
|
|
@ -249,20 +249,24 @@
|
||||||
<option value="X">X</option>
|
<option value="X">X</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<div class="mb-3 row">
|
<div class="mb-3 row">
|
||||||
<label for="tel" class="col-sm-2 col-form-label text-center">비고</label>
|
<label for="tel" class="col-sm-2 col-form-label text-center">비고</label>
|
||||||
<div class="col-sm-4">
|
<div class="col-sm-4">
|
||||||
<textarea class="form-control" id="remark" name="remark"></textarea>
|
<textarea class="form-control" id="remark" name="remark"></textarea>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</form>
|
||||||
|
<h4>경력사항</h4>
|
||||||
|
<div id="crr">
|
||||||
|
<div class="row justify-content-center">
|
||||||
|
<button type="button" class="btn btn-sm btn-outline-primary col-auto" id="crrAddBtn"><i class="bi bi-plus-lg"></i></button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal" id="closeModalBtn">닫기</button>
|
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal" id="closeModalBtn">닫기</button>
|
||||||
<button type="button" class="btn btn-primary" id="saveBtn">등록</button>
|
<button type="button" class="btn btn-primary" id="saveBtn">등록</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,8 @@
|
||||||
<form id="trInfoUpdate" method="post">
|
<form id="trInfoUpdate" method="post">
|
||||||
<input type="hidden" name="_csrf_header" th:value="${_csrf.headerName}"/>
|
<input type="hidden" name="_csrf_header" th:value="${_csrf.headerName}"/>
|
||||||
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/>
|
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/>
|
||||||
<input type="hidden" class="translatorKey" th:value="${trInfo.translatorKey}"/>
|
<input type="hidden" class="translatorKey" name="translatorKey" th:value="${trInfo.translatorKey}"/>
|
||||||
<input type="hidden" class="versionNo" th:value="${trInfo.versionNo}"/>
|
<input type="hidden" class="versionNo" name="versionNo" th:value="${trInfo.versionNo}"/>
|
||||||
<div class="mb-3 row">
|
<div class="mb-3 row">
|
||||||
<div class="mb-3 row">
|
<div class="mb-3 row">
|
||||||
<label for="ogCd" class="col-sm-2 col-form-label text-center">관서</label>
|
<label for="ogCd" class="col-sm-2 col-form-label text-center">관서</label>
|
||||||
|
|
@ -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="Y">예</option>
|
<option value="O">예</option>
|
||||||
<option value="N">아니오</option>
|
<option value="X">아니오</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue