fix:민간통역인 경력 기능추가
parent
7448c93356
commit
2789c63abd
|
|
@ -1,17 +1,16 @@
|
|||
package com.dbnt.faisp.translator;
|
||||
|
||||
import com.dbnt.faisp.authMgt.service.AuthMgtService;
|
||||
import com.dbnt.faisp.codeMgt.service.CodeMgtService;
|
||||
import com.dbnt.faisp.menuMgt.service.MenuMgtService;
|
||||
import com.dbnt.faisp.organMgt.service.OrganConfigService;
|
||||
import com.dbnt.faisp.translator.model.Translator;
|
||||
import com.dbnt.faisp.translator.model.TranslatorCrr;
|
||||
import com.dbnt.faisp.translator.service.TranslatorService;
|
||||
import com.dbnt.faisp.userInfo.service.UserInfoService;
|
||||
import com.dbnt.faisp.userInfo.model.UserInfo;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.security.core.annotation.AuthenticationPrincipal;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
|
@ -23,10 +22,7 @@ import org.springframework.web.servlet.ModelAndView;
|
|||
@RequestMapping("/translator")
|
||||
public class TranslatorController {
|
||||
|
||||
private final MenuMgtService menuMgtService;
|
||||
private final UserInfoService userInfoService;
|
||||
private final AuthMgtService authMgtService;
|
||||
private final CodeMgtService codeMgtService;
|
||||
private final TranslatorService translatorSevice;
|
||||
private final OrganConfigService organConfigService;
|
||||
|
||||
|
|
@ -34,6 +30,14 @@ public class TranslatorController {
|
|||
@GetMapping("/info")
|
||||
public ModelAndView translatorInfo(@AuthenticationPrincipal UserInfo loginUser,Translator translator) {
|
||||
ModelAndView mav = new ModelAndView("translator/translator");
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("userSeq", loginUser.getUserSeq());
|
||||
params.put("menuUrl", "/translator/info");
|
||||
//메뉴권한 확인
|
||||
String accessAuth = authMgtService.selectAccessConfigList(params).get(0).getAccessAuth();
|
||||
|
||||
mav.addObject("mgtOrganList", loginUser.getOrganCdList());
|
||||
mav.addObject("accessAuth", accessAuth);
|
||||
translator.setOrganCdList(organConfigService.selectOrganListWhereUserOgCd(loginUser.getOgCd()));
|
||||
translator.setQueryInfo();
|
||||
mav.addObject("translatorList", translatorSevice.selectTranslatorList(translator));
|
||||
|
|
@ -51,13 +55,19 @@ public class TranslatorController {
|
|||
}
|
||||
|
||||
@GetMapping("/translatorEditModal")
|
||||
public ModelAndView translatorEditModal(Translator translator){
|
||||
public ModelAndView translatorEditModal(@AuthenticationPrincipal UserInfo loginUser,Translator translator){
|
||||
ModelAndView mav = new ModelAndView("translator/translatorEditModal");
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("userSeq", loginUser.getUserSeq());
|
||||
params.put("menuUrl", "/translator/info");
|
||||
//메뉴권한 확인
|
||||
String accessAuth = authMgtService.selectAccessConfigList(params).get(0).getAccessAuth();
|
||||
mav.addObject("trInfo", translatorSevice.selectTranslatorView(translator));
|
||||
mav.addObject("accessAuth", accessAuth);
|
||||
return mav;
|
||||
}
|
||||
|
||||
@PostMapping("/updatetranslatorInfo")
|
||||
@PostMapping("/updateTranslatorInfo")
|
||||
public void updatetranslatorInfo(@AuthenticationPrincipal UserInfo loginUser,Translator translator) {
|
||||
translator.setWrtNm(loginUser.getUserId());
|
||||
translator.setWrtOrgan(loginUser.getOgCd());
|
||||
|
|
@ -79,11 +89,47 @@ public class TranslatorController {
|
|||
}
|
||||
|
||||
@GetMapping("/careerView")
|
||||
public ModelAndView careerView(TranslatorCrr translatorCrr){
|
||||
public ModelAndView careerView(@AuthenticationPrincipal UserInfo loginUser,TranslatorCrr translatorCrr){
|
||||
ModelAndView mav = new ModelAndView("translator/translatorCareerModal");
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("userSeq", loginUser.getUserSeq());
|
||||
params.put("menuUrl", "/translator/info");
|
||||
//메뉴권한 확인
|
||||
String accessAuth = authMgtService.selectAccessConfigList(params).get(0).getAccessAuth();
|
||||
mav.addObject("policeCrr", translatorSevice.selectMaritimePoliceCareer(translatorCrr));
|
||||
mav.addObject("anotherCrr", translatorSevice.selectAnotherOrganizationCareer(translatorCrr));
|
||||
mav.addObject("trKey", translatorCrr.getTranslatorKey());
|
||||
mav.addObject("accessAuth", accessAuth);
|
||||
return mav;
|
||||
}
|
||||
|
||||
@GetMapping("/careerInsertPage")
|
||||
public ModelAndView careerInsertPage(TranslatorCrr translatorCrr){
|
||||
ModelAndView mav = new ModelAndView("translator/translatorCareerInsert");
|
||||
mav.addObject("trKey", translatorCrr.getTranslatorKey());
|
||||
return mav;
|
||||
}
|
||||
|
||||
@PostMapping("/insertTranslatorCareer")
|
||||
@ResponseBody
|
||||
public int insertTranslatorCareer(@RequestBody List<TranslatorCrr> translatorCrr){
|
||||
int trKey = translatorSevice.insertTranslatorCareer(translatorCrr);
|
||||
return trKey;
|
||||
}
|
||||
|
||||
@PostMapping("/deleteCareer")
|
||||
@ResponseBody
|
||||
public int deleteCareer(@RequestBody TranslatorCrr translatorCrr) {
|
||||
int trKey = translatorSevice.deleteCareer(translatorCrr);
|
||||
return trKey;
|
||||
}
|
||||
|
||||
@PostMapping("/deleteTranslatorInfo")
|
||||
@ResponseBody
|
||||
public void deleteTranslatorInfo(@RequestBody int trKey) {
|
||||
translatorSevice.deleteTranslatorInfo(trKey);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.dbnt.faisp.translator.mapper;
|
||||
|
||||
import com.dbnt.faisp.translator.model.Translator;
|
||||
import com.dbnt.faisp.translator.model.TranslatorCrr;
|
||||
import com.dbnt.faisp.userInfo.model.UserInfo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
|
|
@ -17,4 +18,6 @@ public interface TranslatorMapper {
|
|||
|
||||
Translator HistoryView(Translator translator);
|
||||
|
||||
List<TranslatorCrr> selectCareerList(TranslatorCrr translatorCrr);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,5 @@
|
|||
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;
|
||||
|
|
@ -13,19 +10,12 @@ 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
|
||||
|
|
|
|||
|
|
@ -1,8 +1,5 @@
|
|||
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;
|
||||
|
|
@ -13,20 +10,11 @@ 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
|
||||
|
|
@ -35,14 +23,14 @@ import java.util.Set;
|
|||
@DynamicInsert
|
||||
@DynamicUpdate
|
||||
@Table(name = "translator_career")
|
||||
@IdClass(TranslatorCrr.TranslatorCrrId.class)
|
||||
public class TranslatorCrr extends BaseModel implements Serializable{
|
||||
@Id
|
||||
@Column(name = "career_seq")
|
||||
private Integer careerSeq;
|
||||
@Id
|
||||
@Column(name = "translator_key")
|
||||
private Integer translatorKey;
|
||||
@Column(name = "version_no")
|
||||
private Integer versionNo;
|
||||
@Column(name = "his_gubun")
|
||||
private String hisGubun;
|
||||
@Column(name = "contents")
|
||||
|
|
@ -56,15 +44,17 @@ public class TranslatorCrr extends BaseModel implements Serializable{
|
|||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "TranslatorCrr [careerSeq=" + careerSeq + ", translatorKey=" + translatorKey + ", versionNo=" + versionNo
|
||||
+ ", hisGubun=" + hisGubun + ", contents=" + contents + ", tcDt=" + tcDt + ", remark=" + remark + "]";
|
||||
return "TranslatorCrr [careerSeq=" + careerSeq + ", translatorKey=" + translatorKey + ", hisGubun=" + hisGubun
|
||||
+ ", contents=" + contents + ", tcDt=" + tcDt + ", remark=" + remark + "]";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Embeddable
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class TranslatorCrrId implements Serializable {
|
||||
private Integer careerSeq;
|
||||
private Integer translatorKey;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,25 @@
|
|||
package com.dbnt.faisp.translator.repository;
|
||||
|
||||
import com.dbnt.faisp.translator.model.TranslatorCrr;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
|
||||
public interface TranslatorCareerRepository extends JpaRepository<TranslatorCrr, TranslatorCrr.TranslatorCrrId> {
|
||||
|
||||
TranslatorCrr findTopByTranslatorKeyOrderByCareerSeqDesc(Integer translatorKey);
|
||||
|
||||
Optional<TranslatorCrr> findByCareerSeqAndTranslatorKey(Integer careerSeq, Integer translatorKey);
|
||||
|
||||
void deleteByTranslatorKey(int trKey);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,16 +1,16 @@
|
|||
package com.dbnt.faisp.translator.repository;
|
||||
|
||||
import com.dbnt.faisp.translator.model.Translator;
|
||||
import com.dbnt.faisp.userInfo.model.UserInfo;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
|
||||
public interface TranslatorRepository extends JpaRepository<Translator, Translator.TranslatorId> {
|
||||
|
||||
Translator findFirstByOrderByTranslatorKeyDesc();
|
||||
|
||||
void deleteByTranslatorKey(int trKey);
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,19 +1,17 @@
|
|||
package com.dbnt.faisp.translator.service;
|
||||
|
||||
import com.dbnt.faisp.menuMgt.mapper.MenuMgtMapper;
|
||||
import com.dbnt.faisp.menuMgt.model.MenuMgt;
|
||||
import com.dbnt.faisp.menuMgt.repository.MenuMgtRepository;
|
||||
|
||||
import com.dbnt.faisp.translator.mapper.TranslatorMapper;
|
||||
import com.dbnt.faisp.translator.model.Translator;
|
||||
import com.dbnt.faisp.translator.model.Translator.TranslatorId;
|
||||
import com.dbnt.faisp.translator.model.TranslatorCrr;
|
||||
import com.dbnt.faisp.translator.repository.TranslatorCareerRepository;
|
||||
import com.dbnt.faisp.translator.repository.TranslatorRepository;
|
||||
import com.dbnt.faisp.userInfo.model.UserInfo;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.persistence.Transient;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
|
|
@ -23,6 +21,7 @@ import java.util.*;
|
|||
public class TranslatorService {
|
||||
|
||||
private final TranslatorRepository translatorRepository;
|
||||
private final TranslatorCareerRepository translatorCareerRepository;
|
||||
private final TranslatorMapper translatorMapper;
|
||||
|
||||
public String insertTranslatorInfo(Translator translator) {
|
||||
|
|
@ -31,7 +30,6 @@ public class TranslatorService {
|
|||
if (dbTranslator == null) {
|
||||
translator.setTranslatorKey(1);
|
||||
translator.setVersionNo(1);
|
||||
translatorRepository.save(translator);
|
||||
return translatorRepository.save(translator).getTrName();
|
||||
} else {
|
||||
translator.setTranslatorKey(dbTranslator.getTranslatorKey() + 1);
|
||||
|
|
@ -89,4 +87,43 @@ public class TranslatorService {
|
|||
return translatorMapper.HistoryView(translator);
|
||||
}
|
||||
|
||||
public int insertTranslatorCareer(List<TranslatorCrr> translatorCrr) {
|
||||
int trKey = 0;
|
||||
for(TranslatorCrr tCrr : translatorCrr ) {
|
||||
TranslatorCrr dbCareer = translatorCareerRepository.findTopByTranslatorKeyOrderByCareerSeqDesc(tCrr.getTranslatorKey());
|
||||
if (dbCareer == null) {
|
||||
tCrr.setCareerSeq(1);
|
||||
translatorCareerRepository.save(tCrr);
|
||||
} else {
|
||||
tCrr.setCareerSeq(dbCareer.getCareerSeq()+ 1);
|
||||
translatorCareerRepository.save(tCrr);
|
||||
}
|
||||
trKey = tCrr.getTranslatorKey();
|
||||
}
|
||||
return trKey;
|
||||
}
|
||||
|
||||
public List<TranslatorCrr> selectMaritimePoliceCareer(TranslatorCrr translatorCrr) {
|
||||
translatorCrr.setHisGubun("Y");
|
||||
return translatorMapper.selectCareerList(translatorCrr);
|
||||
}
|
||||
|
||||
public List<TranslatorCrr> selectAnotherOrganizationCareer(TranslatorCrr translatorCrr) {
|
||||
translatorCrr.setHisGubun("N");
|
||||
return translatorMapper.selectCareerList(translatorCrr);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public int deleteCareer(TranslatorCrr translatorCrr) {
|
||||
TranslatorCrr dbCareer = translatorCareerRepository.findByCareerSeqAndTranslatorKey(translatorCrr.getCareerSeq(),translatorCrr.getTranslatorKey()).orElse(null);
|
||||
translatorCareerRepository.delete(dbCareer);
|
||||
return translatorCrr.getTranslatorKey();
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void deleteTranslatorInfo(int trKey) {
|
||||
translatorCareerRepository.deleteByTranslatorKey(trKey);
|
||||
translatorRepository.deleteByTranslatorKey(trKey);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,6 +36,27 @@
|
|||
<foreach collection="organCdList" item="item" index="index" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
<if test='trLang != null and trLang != ""'>
|
||||
and tr_lang = #{trLang}
|
||||
</if>
|
||||
<if test='ogdp1 != null and ogdp1 != ""'>
|
||||
and ogdp1 = #{ogdp1}
|
||||
</if>
|
||||
<if test='trName != null and trName != ""'>
|
||||
and tr_name = #{trName}
|
||||
</if>
|
||||
<if test='trNny != null and trNny != ""'>
|
||||
and tr_nny = #{trNny}
|
||||
</if>
|
||||
<if test='trVisa != null and trVisa != ""'>
|
||||
and tr_visa = #{trVisa}
|
||||
</if>
|
||||
<if test='aptDt != null'>
|
||||
and to_char(apt_dt,'YYYY-MM-DD') = #{aptDt}::VARCHAR
|
||||
</if>
|
||||
<if test='dmlYn != null and dmlYn != ""'>
|
||||
and dml_yn = #{dmlYn}
|
||||
</if>
|
||||
order by translator_key desc
|
||||
limit #{rowCnt} offset #{firstIndex}
|
||||
</select>
|
||||
|
|
@ -73,6 +94,27 @@
|
|||
<foreach collection="organCdList" item="item" index="index" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
<if test='trLang != null and trLang != ""'>
|
||||
and tr_lang = #{trLang}
|
||||
</if>
|
||||
<if test='ogdp1 != null and ogdp1 != ""'>
|
||||
and ogdp1 = #{ogdp1}
|
||||
</if>
|
||||
<if test='trName != null and trName != ""'>
|
||||
and tr_name = #{trName}
|
||||
</if>
|
||||
<if test='trNny != null and trNny != ""'>
|
||||
and tr_nny = #{trNny}
|
||||
</if>
|
||||
<if test='trVisa != null and trVisa != ""'>
|
||||
and tr_visa = #{trVisa}
|
||||
</if>
|
||||
<if test='aptDt != null'>
|
||||
and to_char(apt_dt,'YYYY-MM-DD') = #{aptDt}::VARCHAR
|
||||
</if>
|
||||
<if test='dmlYn != null and dmlYn != ""'>
|
||||
and dml_yn = #{dmlYn}
|
||||
</if>
|
||||
) a
|
||||
</select>
|
||||
|
||||
|
|
@ -113,5 +155,18 @@
|
|||
where translator_key = #{translatorKey}
|
||||
and version_no = #{versionNo}
|
||||
</select>
|
||||
|
||||
<select id="selectCareerList" resultType="TranslatorCrr" parameterType="TranslatorCrr">
|
||||
select career_seq,
|
||||
translator_key,
|
||||
his_gubun,
|
||||
contents,
|
||||
remark,
|
||||
tc_dt
|
||||
from translator_career
|
||||
where translator_key = #{translatorKey}
|
||||
and his_gubun = #{hisGubun}
|
||||
order by career_seq desc
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -6,21 +6,17 @@ $(document).on('click', '.userInfoTr', function (event){
|
|||
$("#selectedVerNo").val($(this).find(".verNo").val())
|
||||
const x = event.clientX;
|
||||
const y = event.clientY;
|
||||
$(".dropdown-menu.show").attr('style','position: absolute; inset: 0px auto auto 0px; margin: 0px; transform: translate(4px, 100px);');
|
||||
const dropdown = $(".dropdown-menu.show")
|
||||
if(dropdown.length>0){
|
||||
dropdown[0].style.inset = "0px auto auto "+(x-event.currentTarget.getBoundingClientRect().x)+"px";
|
||||
}
|
||||
})
|
||||
|
||||
function traslatorInfo(trKey){
|
||||
console.log(trKey);
|
||||
}
|
||||
|
||||
$(document).on('click', '.translatorInfo', function (){
|
||||
console.log($(this));
|
||||
document.getElementById('accessTab').classList.add('active');
|
||||
document.getElementById('approvalTab').classList.remove('active');
|
||||
const trKey = Number($("#selectedKey").val());
|
||||
const verNo = Number($("#selectedVerNo").val());
|
||||
console.log(trKey);
|
||||
console.log(verNo);
|
||||
const url = '/translator/translatorEditModal';
|
||||
revisionHistory(trKey,verNo,url);
|
||||
var html="";
|
||||
|
|
@ -29,25 +25,6 @@ $(document).on('click', '.translatorInfo', function (){
|
|||
$("#KeyValue").empty().html(html)
|
||||
})
|
||||
|
||||
$(document).on('click', '.careerInfo', function (){
|
||||
const trKey = (Number($(this).parents("tr").find('.trKey').val()));
|
||||
$.ajax({
|
||||
url: '/translator/careerView',
|
||||
data: {
|
||||
translatorKey: trKey,
|
||||
},
|
||||
type: 'GET',
|
||||
dataType:"html",
|
||||
success: function(html){
|
||||
$("#careerView").empty().append(html)
|
||||
$("#translatorCareerModal").modal('show');
|
||||
},
|
||||
error:function(){
|
||||
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
$(document).on('click', '#trView', function (){
|
||||
document.getElementById('accessTab').classList.add('active');
|
||||
document.getElementById('approvalTab').classList.remove('active');
|
||||
|
|
@ -68,7 +45,7 @@ $(document).on('click', '#updateBtn', function (){
|
|||
$.ajax({
|
||||
type : 'POST',
|
||||
data : formData,
|
||||
url : "/translator/updatetranslatorInfo",
|
||||
url : "/translator/updateTranslatorInfo",
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success : function() {
|
||||
|
|
@ -85,18 +62,9 @@ $(document).on('click', '#updateBtn', function (){
|
|||
})
|
||||
|
||||
$(document).on('click', '#saveBtn', function (){
|
||||
console.log(trCarrerList);
|
||||
if(confirm("저장하시겠습니까?")){
|
||||
contentFade("in");
|
||||
const formData = new FormData($("#translatorInsert")[0]);
|
||||
for(const carrer of trCarrerList){
|
||||
formData.append('contents', carrer.contents)
|
||||
formData.append('hisGubun', carrer.hisGubun)
|
||||
formData.append('remark', carrer.remark)
|
||||
formData.append('tcDt', carrer.tcDt)
|
||||
}
|
||||
// var values = JSON.stringify(trCarrerList);
|
||||
// $('input[name=TranslatorCrr]').val(values);
|
||||
$.ajax({
|
||||
type : 'POST',
|
||||
data : formData,
|
||||
|
|
@ -197,8 +165,6 @@ $(document).on('click', '.historyInfoTr', function (){
|
|||
$("#aptDtV").val(data.aptDt);
|
||||
$("#dmlYnV").val(data.dmlYn);
|
||||
$("#remarkV").val(data.remark);
|
||||
// $("#configInfo").empty().append(html)
|
||||
// $("#translatorEditModal").modal('show');
|
||||
},
|
||||
error:function(){
|
||||
|
||||
|
|
@ -246,6 +212,10 @@ function revisionHistory(trKey,verNo,url){
|
|||
success: function(html){
|
||||
$("#configInfo").empty().append(html)
|
||||
$("#translatorEditModal").modal('show');
|
||||
$("#viewAptDt").datepicker({
|
||||
format: "yyyy-mm-dd",
|
||||
language: "ko"
|
||||
});
|
||||
},
|
||||
error:function(){
|
||||
|
||||
|
|
@ -262,8 +232,9 @@ $(document).on('change', '#trNny', function (){
|
|||
});
|
||||
|
||||
$(document).on('click', '#crrAddBtn', function (){
|
||||
$('#crr').append(
|
||||
'<div class="mb-5 row" id="crrDiv">'+
|
||||
const trKey = (Number($('#tcInsertKey').val()));
|
||||
$('#insertCareer').append(
|
||||
'<div class="mb-12 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>'+
|
||||
|
|
@ -280,11 +251,11 @@ $(document).on('click', '#crrAddBtn', function (){
|
|||
'<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">'+
|
||||
'<div class="col-sm-2">'+
|
||||
'<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">'+
|
||||
'<div class="col-sm-2">'+
|
||||
'<input type="text" class="form-control crrInput" id="remark" name="remark">'+
|
||||
'</div>'+
|
||||
'</div>'
|
||||
|
|
@ -293,24 +264,18 @@ $(document).on('click', '#crrAddBtn', function (){
|
|||
format: "yyyy-mm-dd",
|
||||
language: "ko"
|
||||
});
|
||||
trCarrerList.push({hisGubun:"",tcDt:"",contents:"",remark:""});
|
||||
console.log(trCarrerList);
|
||||
trCarrerList.push({translatorKey:trKey, hisGubun:"",tcDt:"",contents:"",remark:""});
|
||||
})
|
||||
|
||||
$(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);
|
||||
|
||||
selectedIdx = $(this).parents("#crrDiv").index()-1;
|
||||
trCarrerList.splice(selectedIdx,1);
|
||||
$(this).parents('#crrDiv').remove();
|
||||
})
|
||||
|
||||
$(document).on('change', '.crrInput', function (){
|
||||
selectedIdx = $(this).parents('#crr').children('#crrDiv').length-1;
|
||||
selectedIdx = $(this).parents("#crrDiv").index()-1;
|
||||
const target = trCarrerList[selectedIdx];
|
||||
console.log(target)
|
||||
switch (this.name){
|
||||
case "hisGubun":
|
||||
target.hisGubun = this.value
|
||||
|
|
@ -326,3 +291,126 @@ $(document).on('change', '.crrInput', function (){
|
|||
break;
|
||||
}
|
||||
})
|
||||
|
||||
$(document).on('click', '.careerInfo', function (){
|
||||
const trKey = Number($("#selectedKey").val());
|
||||
showCareer(trKey);
|
||||
})
|
||||
|
||||
function showCareer(trKey){
|
||||
$.ajax({
|
||||
url: '/translator/careerView',
|
||||
data: {
|
||||
translatorKey: trKey,
|
||||
},
|
||||
type: 'GET',
|
||||
dataType:"html",
|
||||
success: function(html){
|
||||
$("#careerView").empty().append(html)
|
||||
$("#translatorCareerModal").modal('show');
|
||||
},
|
||||
error:function(){
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
$(document).on('click', '#crrInsertBtn', function (){
|
||||
const trKey = Number($("#tcmKey").val());
|
||||
$.ajax({
|
||||
url: '/translator/careerInsertPage',
|
||||
data: {
|
||||
translatorKey: trKey,
|
||||
},
|
||||
type: 'GET',
|
||||
dataType:"html",
|
||||
success: function(html){
|
||||
$("#careerView").empty().append(html)
|
||||
$("#translatorCareerModal").modal('show');
|
||||
},
|
||||
error:function(){
|
||||
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
$(document).on('click', '#crrSaveBtn', function (){
|
||||
if(confirm("저장하시겠습니까?")){
|
||||
contentFade("in");
|
||||
$.ajax({
|
||||
type : 'POST',
|
||||
data : JSON.stringify(trCarrerList),
|
||||
url : "/translator/insertTranslatorCareer",
|
||||
contentType: 'application/json',
|
||||
beforeSend: function (xhr){
|
||||
xhr.setRequestHeader($("[name='_csrf_header']").val(), $("[name='_csrf']").val());
|
||||
},
|
||||
success : function(data) {
|
||||
contentFade("out");
|
||||
alert("이력등록이 완료되었습니다.");
|
||||
showCareer(data);
|
||||
trCarrerList.length = 0;
|
||||
},
|
||||
error : function(xhr, status) {
|
||||
contentFade("out");
|
||||
alert("이력등록을 실패하였습니다");
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
function deleteCareerBtn(crrSeq,trKey){
|
||||
if(confirm("삭제하시겠습니까?")){
|
||||
$.ajax({
|
||||
type : 'POST',
|
||||
url : "/translator/deleteCareer",
|
||||
data : JSON.stringify({careerSeq:crrSeq,
|
||||
translatorKey:trKey}),
|
||||
contentType: 'application/json',
|
||||
beforeSend: function (xhr){
|
||||
xhr.setRequestHeader($("[name='_csrf_header']").val(), $("[name='_csrf']").val());
|
||||
},
|
||||
success : function(data) {
|
||||
alert("삭제 처리되었습니다.");
|
||||
showCareer(data);
|
||||
},
|
||||
error : function(xhr, status) {
|
||||
alert("삭제 처리에 실패하였습니다");
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
$(document).on('click', '.btn-close', function (){
|
||||
trCarrerList.length = 0;
|
||||
})
|
||||
|
||||
$(document).on('click', '#trDeleteBtn', function (){
|
||||
if(confirm("해임 하시겠습니까?")){
|
||||
contentFade("in");
|
||||
const trKey = Number($(".translatorKey").val());
|
||||
$.ajax({
|
||||
type : 'POST',
|
||||
data : JSON.stringify(trKey),
|
||||
url : "/translator/deleteTranslatorInfo",
|
||||
contentType: 'application/json',
|
||||
beforeSend: function (xhr){
|
||||
xhr.setRequestHeader($("[name='_csrf_header']").val(), $("[name='_csrf']").val());
|
||||
},
|
||||
success : function() {
|
||||
alert("해임되었습니다.");
|
||||
contentFade("out");
|
||||
location.reload();
|
||||
},
|
||||
error : function(xhr, status) {
|
||||
alert("해임을 실패하였습니다.");
|
||||
contentFade("out");
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
<div class="row mx-0">
|
||||
<div class="col-12 card text-center">
|
||||
<div class="card-body">
|
||||
<!-- <form method="get" th:action="@{/authMgt/authMgtPage}">
|
||||
<form method="get" th:action="@{/translator/info}">
|
||||
<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">
|
||||
|
|
@ -23,35 +23,66 @@
|
|||
</th:block>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<div class="col-auto">
|
||||
<div class="row justify-content-end">
|
||||
<div class="col-auto">
|
||||
<select class="form-select form-select-sm" name="ogCd">
|
||||
<select class="form-select form-select-sm" name="dmlYn">
|
||||
<option value="">-해촉 선택-</option>
|
||||
<option value="O" th:selected="${'O' eq searchParams.dmlYn}">O</option>
|
||||
<option value="X" th:selected="${'X' eq searchParams.dmlYn}">X</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<select class="form-select form-select-sm" name="ogdp1">
|
||||
<option value="">관서 선택</option>
|
||||
<th:block th:each="commonCode:${session.commonCode.get('OG')}">
|
||||
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}" th:selected="${searchParams.ogCd==commonCode.itemCd}"></option>
|
||||
</th:block>
|
||||
</select>
|
||||
<th:block th:if="${#lists.contains(mgtOrganList, commonCode.itemCd)}">
|
||||
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}" th:selected="${commonCode.itemCd eq searchParams.ogdp1}"></option>
|
||||
</th:block>
|
||||
</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}" th:selected="${searchParams.ofcCd==commonCode.itemCd}"></option>
|
||||
</th:block>
|
||||
</select>
|
||||
<select class="form-select form-select-sm" name="trLang">
|
||||
<option value="">언어 선택</option>
|
||||
<th:block th:each="commonCode:${session.commonCode.get('LGG')}">
|
||||
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}" th:selected="${commonCode.itemCd eq searchParams.trLang}"></option>
|
||||
</th:block>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<input type="text" class="form-control form-control-sm" name="userNm" placeholder="사용자명" th:value="${searchParams.userNm}">
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<input type="text" class="form-control form-control-sm" name="userId" placeholder="사용자 아이디" th:value="${searchParams.userId}">
|
||||
<input type="text" class="form-control form-control-sm" name="trName" th:value="${searchParams.trName}" placeholder="성명">
|
||||
</div>
|
||||
<input type="submit" class="btn btn-sm btn-primary col-auto" id="searchBtn" value="검색">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form> -->
|
||||
<div class="row justify-content-between py-1">
|
||||
<div class="col-auto">
|
||||
<div class="row justify-content-end">
|
||||
<div class="col-auto">
|
||||
<select class="form-select form-select-sm" id="trVisa" name="trVisa">
|
||||
<option value="">비자 선택</option>
|
||||
<th:block th:each="commonCode:${session.commonCode.get('VISA')}">
|
||||
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}" th:selected="${commonCode.itemCd eq searchParams.trVisa}"></option>
|
||||
</th:block>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<select class="form-select form-select-sm" id="trNny" name="trNny">
|
||||
<option value="">국적선택</option>
|
||||
<th:block th:each="commonCode:${session.commonCode.get('NNY')}">
|
||||
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}" th:selected="${commonCode.itemCd eq searchParams.trNny}"></option>
|
||||
</th:block>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<input type="text" class="form-control" id="aptDt" name="aptDt" th:value="${searchParams.aptDt}" placeholder="위촉일">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div class="row justify-content-start">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
|
|
@ -139,7 +170,7 @@
|
|||
</ul>
|
||||
</nav>
|
||||
<div class="col-auto">
|
||||
<button data-bs-toggle="modal" data-bs-target="#translatorInsertModal">등록</button>
|
||||
<button data-bs-toggle="modal" data-bs-target="#translatorInsertModal" th:unless="${accessAuth eq 'ACC001'}">등록</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -168,9 +199,11 @@
|
|||
<select class="form-select form-select-sm" name="ogdp1">
|
||||
<option value="">선택</option>
|
||||
<th:block th:each="commonCode:${session.commonCode.get('OG')}">
|
||||
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"></option>
|
||||
<th:block th:if="${#lists.contains(mgtOrganList, commonCode.itemCd)}">
|
||||
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"></option>
|
||||
</th:block>
|
||||
</th:block>
|
||||
</select>
|
||||
</select>
|
||||
</div>
|
||||
<label for="ofcCd" class="col-sm-1 col-form-label text-center">언어</label>
|
||||
<div class="col-sm-2">
|
||||
|
|
|
|||
|
|
@ -0,0 +1,31 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="ko" xmlns:th="http://www.thymeleaf.org">
|
||||
<main class="pt-3">
|
||||
<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">
|
||||
<div class="card-body">
|
||||
<div class="row justify-content-start">
|
||||
<h6>경력 등록</h6>
|
||||
<input type="hidden" id="tcInsertKey" th:value="${trKey}">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div id="insertCareer">
|
||||
<div class="row justify-content-center">
|
||||
<button class="btn btn-sm btn-outline-primary col-auto" id="crrAddBtn"><i class="bi bi-plus-lg"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-primary" id="crrSaveBtn">등록</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
</html>
|
||||
|
|
@ -12,21 +12,24 @@
|
|||
<div class="card-body">
|
||||
<div class="row">
|
||||
<h5>해양경찰청 이력</h5>
|
||||
<table class="table table-striped" id="categoryTable">
|
||||
<input type="hidden" id="tcmKey" th:value="${trKey}">
|
||||
<table class="table table-striped" id="categoryTable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>연번</th>
|
||||
<th>날짜</th>
|
||||
<th>내용</th>
|
||||
<th>비고</th>
|
||||
<th>연번</th>
|
||||
<th>날짜</th>
|
||||
<th>내용</th>
|
||||
<th>비고</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="overflow-scroll">
|
||||
<tr class="historyInfoTr" >
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<tr class="" th:each="crrInfo:${policeCrr}">
|
||||
<td th:text="${crrInfo.careerSeq}"></td>
|
||||
<td th:text="${crrInfo.tcDt}">ㅇ</td>
|
||||
<td th:text="${crrInfo.contents}"></td>
|
||||
<td th:text="${crrInfo.remark}"></td>
|
||||
<td><button type="button" class="btn btn-danger m-0" id="deleteCareerBtn" th:onclick="|javascript:deleteCareerBtn('${crrInfo.careerSeq}','${crrInfo.translatorKey}')|" th:unless="${accessAuth eq 'ACC001'}">삭제</button></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
@ -40,21 +43,25 @@
|
|||
<th>날짜</th>
|
||||
<th>내용</th>
|
||||
<th>비고</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="overflow-scroll">
|
||||
<tr class="historyInfoTr" >
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<tr class="" th:each="crrInfo:${anotherCrr}">
|
||||
<td th:text="${crrInfo.careerSeq}"></td>
|
||||
<td th:text="${crrInfo.tcDt}"></td>
|
||||
<td th:text="${crrInfo.contents}"></td>
|
||||
<td th:text="${crrInfo.remark}"></td>
|
||||
<td><button type="button" class="btn btn-danger m-0" id="deleteCareerBtn" th:onclick="|javascript:deleteCareerBtn('${crrInfo.careerSeq}','${crrInfo.translatorKey}')|" th:unless="${accessAuth eq 'ACC001'}">삭제</button></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-primary" id="crrInsertBtn" th:unless="${accessAuth eq 'ACC001'}">이력등록</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
<input type="hidden" class="versionNo" name="versionNo" th:value="${trInfo.versionNo}"/>
|
||||
<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">
|
||||
<select class="form-select form-select-sm" name="ogdp1">
|
||||
<option value="">선택</option>
|
||||
|
|
@ -91,7 +91,7 @@
|
|||
</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" id="aptDt" name="aptDt">
|
||||
<input type="text" class="form-control" id="viewAptDt" name="aptDt" th:value="${trInfo.aptDt}">
|
||||
</div>
|
||||
</div>
|
||||
<label for="ogCd" class="col-sm-2 col-form-label text-center">해촉</label>
|
||||
|
|
@ -112,8 +112,8 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" id="closeModalBtn">해임</button>
|
||||
<button type="button" class="btn btn-primary" id="updateBtn">수정</button>
|
||||
<button type="button" class="btn btn-secondary" id="trDeleteBtn" th:unless="${accessAuth eq 'ACC001'}">해임</button>
|
||||
<button type="button" class="btn btn-primary" id="updateBtn" th:unless="${accessAuth eq 'ACC001'}">수정</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue