단속현황 수정 및 선원세부현황 중간커밋

jiHyung 2022-11-04 17:46:23 +09:00
parent 6d488684f1
commit 440210fd16
27 changed files with 1897 additions and 103 deletions

View File

@ -0,0 +1,127 @@
package com.dbnt.faisp.main.faStatistics.crackdownsStatus;
import com.dbnt.faisp.main.authMgt.service.AuthMgtService;
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.CrackdownStatus;
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.FishingBoat;
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.sailor.Sailor;
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.sailor.SailorVersion;
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.repository.*;
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.service.SailorService;
import com.dbnt.faisp.main.userInfo.model.UserInfo;
import lombok.RequiredArgsConstructor;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;
import java.time.LocalDateTime;
import java.util.List;
@RestController
@RequiredArgsConstructor
@RequestMapping("/faStatistics")
public class SailorController {
private final AuthMgtService authMgtService;
private final SailorService sailorService;
private final ViolationRepository violationRepository;
private final CrackdownStatusRepository crackdownStatusRepository;
private final FishingBoatRepository fishingBoatRepository;
private final SailorRepository sailorRepository;
@RequestMapping("/sailor")
public ModelAndView sailor(@AuthenticationPrincipal UserInfo loginUser, Sailor sailor) {
ModelAndView mav = new ModelAndView("faStatistics/sailor/sailor");
//메뉴권한 확인
String accessAuth = authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/faStatistics/sailor").get(0).getAccessAuth();
mav.addObject("accessAuth", accessAuth);
List<Sailor> sailorList = sailorService.selectSailorList(sailor);
for (Sailor s:sailorList) {
s.setFishingBoat(fishingBoatRepository.findByFbKey(s.getFbKey()));
s.setCrackdownStatus(crackdownStatusRepository.findByCdsKey(s.getFishingBoat().getCdsKey()));
s.setViolationList(violationRepository.findByFbKey(s.getFishingBoat().getFbKey()));
}
mav.addObject("sailorList", sailorList);
mav.addObject("searchParams", sailor);
return mav;
}
@GetMapping("/sailor/sailorViewModal")
public ModelAndView sailorViewModal(@AuthenticationPrincipal UserInfo loginUser, Sailor sailor){
ModelAndView mav = new ModelAndView("faStatistics/sailor/sailorViewModal");
sailor = sailorService.selectSailor(sailor.getSailorKey());
sailor.setFishingBoat(fishingBoatRepository.findByFbKey(sailor.getFbKey()));
sailor.setCrackdownStatus(crackdownStatusRepository.findByCdsKey(sailor.getFishingBoat().getCdsKey()));
sailor.setViolationList(violationRepository.findByFbKey(sailor.getFishingBoat().getFbKey()));
mav.addObject("sailor", sailor);
mav.addObject("userSeq",loginUser.getUserSeq());
//메뉴권한 확인
mav.addObject("accessAuth", authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/faStatistics/sailor").get(0).getAccessAuth());
return mav;
}
@GetMapping("/sailor/sailorHistoryViewModal")
public ModelAndView sailorHistoryViewModal(@AuthenticationPrincipal UserInfo loginUser, Sailor sailor){
ModelAndView mav = new ModelAndView("faStatistics/sailor/sailorHistoryViewModal");
List<SailorVersion> sailorVersionList = sailorService.selectSailorVersionList(sailor.getSailorKey());
mav.addObject("sailorVersionList", sailorVersionList);
return mav;
}
@GetMapping("/sailor/sailorHistoryDetail")
public ModelAndView sailorHistoryDetail(@AuthenticationPrincipal UserInfo loginUser, SailorVersion sailorVersion){
ModelAndView mav = new ModelAndView("faStatistics/sailor/sailorHistoryDetail");
sailorVersion = sailorService.selectSailorVersion(sailorVersion.getVersionNo());
sailorVersion.setFishingBoat(fishingBoatRepository.findByFbKey(7));
mav.addObject("sailorVersion", sailorVersion);
return mav;
}
@GetMapping("/sailor/sailorEditModal")
public ModelAndView sailorEditModal(@AuthenticationPrincipal UserInfo loginUser, Sailor sailor){
ModelAndView mav = new ModelAndView("faStatistics/sailor/sailorEditModal");
sailor = sailorService.selectSailor(sailor.getSailorKey());
sailor.setFishingBoat(fishingBoatRepository.findByFbKey(sailor.getFbKey()));
sailor.setCrackdownStatus(crackdownStatusRepository.findByCdsKey(sailor.getFishingBoat().getCdsKey()));
sailor.setViolationList(violationRepository.findByFbKey(sailor.getFishingBoat().getFbKey()));
mav.addObject("sailor", sailor);
return mav;
}
@GetMapping("/sailor/sailorAddModal")
public ModelAndView sailorAddModal(@AuthenticationPrincipal UserInfo loginUser, Sailor sailor){
ModelAndView mav = new ModelAndView("faStatistics/sailor/sailorAddModal");
sailor.setFishingBoatList(fishingBoatRepository.findAll());
sailor.setWrtOrgan(loginUser.getOgCd());
sailor.setWrtUserNm(loginUser.getUserNm());
sailor.setWrtDt(LocalDateTime.now());
mav.addObject("sailor", sailor);
return mav;
}
@PostMapping("/sailor/saveSailor")
public Integer saveSailor(@AuthenticationPrincipal UserInfo loginUser,
CrackdownStatus crackdownStatus,
FishingBoat fishingBoat,
Sailor sailor){
sailor.setWrtUserSeq(loginUser.getUserSeq());
sailor.setFishingBoat(fishingBoat);
sailor.setCrackdownStatus(crackdownStatus);
return sailorService.saveSailor(sailor);
}
}

View File

@ -0,0 +1,11 @@
package com.dbnt.faisp.main.faStatistics.crackdownsStatus.mapper;
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.sailor.Sailor;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface SailorMapper {
List<Sailor> selectSailorList(Sailor sailor);
}

View File

@ -1,6 +1,7 @@
package com.dbnt.faisp.main.faStatistics.crackdownsStatus.model; package com.dbnt.faisp.main.faStatistics.crackdownsStatus.model;
import com.dbnt.faisp.config.BaseModel; import com.dbnt.faisp.config.BaseModel;
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.sailor.Sailor;
import lombok.Getter; import lombok.Getter;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import lombok.Setter; import lombok.Setter;

View File

@ -0,0 +1,41 @@
package com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.sailor;
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.CrackdownStatus;
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.FishingBoat;
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.Violation;
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.sailor.SailorBaseEntity;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import javax.persistence.*;
import java.util.List;
@Getter
@Setter
@Entity
@NoArgsConstructor
@DynamicInsert
@DynamicUpdate
@Table(name = "sailor")
public class Sailor extends SailorBaseEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "sailor_key")
private Integer sailorKey;
@Column(name = "fb_key")
private Integer fbKey;
@Transient
private CrackdownStatus crackdownStatus;
@Transient
private FishingBoat fishingBoat;
@Transient
private List<FishingBoat> fishingBoatList;
@Transient
private List<Violation> violationList;
}

View File

@ -1,11 +1,9 @@
package com.dbnt.faisp.main.faStatistics.crackdownsStatus.model; package com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.sailor;
import com.dbnt.faisp.config.BaseModel; import com.dbnt.faisp.config.BaseModel;
import lombok.Getter; import lombok.Getter;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import lombok.Setter; import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import javax.persistence.*; import javax.persistence.*;
@ -14,20 +12,9 @@ import java.time.LocalDateTime;
@Getter @Getter
@Setter @Setter
@Entity @MappedSuperclass
@NoArgsConstructor @NoArgsConstructor
@DynamicInsert public class SailorBaseEntity extends BaseModel {
@DynamicUpdate
@Table(name = "sailor")
public class Sailor extends BaseModel {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "sailor_key")
private Integer sailorKey;
@Column(name = "fb_key")
private Integer fbKey;
@Column(name = "sailor_name_kr") @Column(name = "sailor_name_kr")
private String sailorNameKr; private String sailorNameKr;

View File

@ -0,0 +1,48 @@
package com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.sailor;
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.CrackdownStatus;
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.FishingBoat;
import lombok.*;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import javax.persistence.*;
import java.io.Serializable;
@Getter
@Setter
@Entity
@NoArgsConstructor
@DynamicInsert
@DynamicUpdate
@Table(name = "sailor_version")
@IdClass(SailorVersion.SailorVersionId.class)
public class SailorVersion extends SailorBaseEntity {
@Id
@Column(name = "version_no")
private Integer versionNo;
@Id
@Column(name = "sailor_key")
private Integer sailorKey;
@Embeddable
@Data
@NoArgsConstructor
@AllArgsConstructor
public static class SailorVersionId implements Serializable {
private Integer versionNo;
private Integer sailorKey;
}
/*@Transient
private CrackdownStatusVersion crackdownStatusVersion;
@Transient
private FishingBoatVersion fishingBoatVersion;*/
@Transient
private CrackdownStatus crackdownStatus;
@Transient
private FishingBoat fishingBoat;
}

View File

@ -22,7 +22,7 @@ import java.util.List;
@RestController @RestController
@RequiredArgsConstructor @RequiredArgsConstructor
@RequestMapping("/faStatistics") @RequestMapping("/faStatistics")
public class processResultController { public class ProcessResultController {
private final AuthMgtService authMgtService; private final AuthMgtService authMgtService;
private final ProcessResultService processResultService; private final ProcessResultService processResultService;

View File

@ -5,4 +5,5 @@ import org.springframework.data.jpa.repository.JpaRepository;
public interface FishingBoatRepository extends JpaRepository<FishingBoat, Integer> { public interface FishingBoatRepository extends JpaRepository<FishingBoat, Integer> {
FishingBoat findByCdsKey(Integer cdsKey); FishingBoat findByCdsKey(Integer cdsKey);
FishingBoat findByFbKey(Integer fbKey);
} }

View File

@ -1,6 +1,6 @@
package com.dbnt.faisp.main.faStatistics.crackdownsStatus.repository; package com.dbnt.faisp.main.faStatistics.crackdownsStatus.repository;
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.Sailor; import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.sailor.Sailor;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying; import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query; import org.springframework.data.jpa.repository.Query;
@ -16,4 +16,6 @@ public interface SailorRepository extends JpaRepository<Sailor, Integer> {
@Modifying @Modifying
@Query("delete from Sailor s where s.sailorKey in :idList") @Query("delete from Sailor s where s.sailorKey in :idList")
void deleteAllByIdInQuery(@Param("idList") List<Integer> sailorDeleteKeyList); void deleteAllByIdInQuery(@Param("idList") List<Integer> sailorDeleteKeyList);
Sailor findBySailorKey(Integer sailorKey);
} }

View File

@ -0,0 +1,14 @@
package com.dbnt.faisp.main.faStatistics.crackdownsStatus.repository;
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.sailor.SailorVersion;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;
import java.util.Optional;
public interface SailorVersionRepository extends JpaRepository<SailorVersion, SailorVersion.SailorVersionId> {
Optional<SailorVersion> findTopBySailorKeyOrderByVersionNoDesc(Integer sailorKey);
List<SailorVersion> findBySailorKey(Integer sailorKey);
SailorVersion findByVersionNo(Integer versionNo);
}

View File

@ -8,9 +8,11 @@ import org.springframework.data.repository.query.Param;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.List; import java.util.List;
import java.util.Optional;
public interface ViolationRepository extends JpaRepository<Violation, Violation.ViolationId> { public interface ViolationRepository extends JpaRepository<Violation, Violation.ViolationId> {
List<Violation> findByFbKey(Integer fbKey); List<Violation> findByFbKey(Integer fbKey);
Optional<Violation> findTopByFbKeyOrderByViolationKeyDesc(int fbKey);
@Transactional @Transactional
@Modifying @Modifying

View File

@ -4,7 +4,7 @@ package com.dbnt.faisp.main.faStatistics.crackdownsStatus.service;
import com.dbnt.faisp.config.BaseService; import com.dbnt.faisp.config.BaseService;
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.mapper.CrackdownStatusMapper; import com.dbnt.faisp.main.faStatistics.crackdownsStatus.mapper.CrackdownStatusMapper;
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.CrackdownStatus; import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.CrackdownStatus;
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.Sailor; import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.sailor.Sailor;
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.Violation; import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.Violation;
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.repository.*; import com.dbnt.faisp.main.faStatistics.crackdownsStatus.repository.*;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
@ -83,16 +83,6 @@ public class CrackdownStatusService extends BaseService {
suspectPersonInfoRepository.deleteAllByIdInQuery(internationalCrimeArrest.getDeleteSpiKeyList()); suspectPersonInfoRepository.deleteAllByIdInQuery(internationalCrimeArrest.getDeleteSpiKeyList());
}*/ }*/
if (crackdownStatus.getViolationList() != null) {
for(Violation violation: crackdownStatus.getViolationList()){
if (violation.getViolationEtc() != null) {
violation.setViolation(violation.getViolationEtc());
}
violation.setFbKey(crackdownStatus.getFishingBoat().getFbKey());
}
violationRepository.saveAll(crackdownStatus.getViolationList());
}
if (crackdownStatus.getSailorList() != null) { if (crackdownStatus.getSailorList() != null) {
for(Sailor sailor: crackdownStatus.getSailorList()){ for(Sailor sailor: crackdownStatus.getSailorList()){
sailor.setFbKey(crackdownStatus.getFishingBoat().getFbKey()); sailor.setFbKey(crackdownStatus.getFishingBoat().getFbKey());
@ -100,6 +90,23 @@ public class CrackdownStatusService extends BaseService {
sailorRepository.saveAll(crackdownStatus.getSailorList()); sailorRepository.saveAll(crackdownStatus.getSailorList());
} }
if (crackdownStatus.getViolationList().get(0).getViolation() != null) {
Violation lastViolation = violationRepository.findTopByFbKeyOrderByViolationKeyDesc(crackdownStatus.getFbKey()).orElse(null);
int violationKey = lastViolation==null?1:(lastViolation.getViolationKey()+1);
for(Violation violation: crackdownStatus.getViolationList()){
if (violation.getViolationEtc() != null) {
violation.setViolation(violation.getViolationEtc());
}
violation.setFbKey(crackdownStatus.getFishingBoat().getFbKey());
if (violation.getViolationKey() == null) {
violation.setViolationKey(violationKey);
violationKey++;
}
}
violationRepository.saveAll(crackdownStatus.getViolationList());
}
return cdsKey; return cdsKey;
} }
} }

View File

@ -27,7 +27,6 @@ public class ProcessResultService extends BaseService {
private final FishingBoatRepository fishingBoatRepository; private final FishingBoatRepository fishingBoatRepository;
private final ViolationRepository violationRepository; private final ViolationRepository violationRepository;
private final ProcessResultRepository processResultRepository; private final ProcessResultRepository processResultRepository;
private final SailorRepository sailorRepository;
public List<ProcessResult> selectProcessResultList(ProcessResult processResult) { public List<ProcessResult> selectProcessResultList(ProcessResult processResult) {
return processResultMapper.selectProcessResultList(processResult); return processResultMapper.selectProcessResultList(processResult);
@ -41,62 +40,6 @@ public class ProcessResultService extends BaseService {
return processResultRepository.findById(prKey).orElse(null); return processResultRepository.findById(prKey).orElse(null);
} }
@Transactional
public Integer saveCrackdownStatus(CrackdownStatus crackdownStatus) {
if (crackdownStatus.getCrackdownBoatEtc() != null) {
crackdownStatus.setCrackdownBoat(crackdownStatus.getCrackdownBoatEtc());
}
if (crackdownStatus.getCrackdownPoliceEtc() != null) {
crackdownStatus.setCrackdownPolice(crackdownStatus.getCrackdownPoliceEtc());
}
Integer cdsKey = crackdownStatusRepository.save(crackdownStatus).getCdsKey();
if (crackdownStatus.getFishingBoat() != null) {
if (crackdownStatus.getFishingBoat().getBoatMaterialEtc() != null) {
crackdownStatus.getFishingBoat().setBoatMaterial(crackdownStatus.getFishingBoat().getBoatMaterialEtc());
}
if (crackdownStatus.getFishingBoat().getFisheryTypeEtc() != null) {
crackdownStatus.getFishingBoat().setFisheryType(crackdownStatus.getFishingBoat().getFisheryTypeEtc());
}
crackdownStatus.getFishingBoat().setCdsKey(cdsKey);
Integer fbKey = fishingBoatRepository.save(crackdownStatus.getFishingBoat()).getFbKey();
crackdownStatus.getFishingBoat().setFbKey(fbKey);
}
if (crackdownStatus.getProcessResult() != null) {
if (crackdownStatus.getProcessResult().getProcessStatusEtc() != null) {
crackdownStatus.getProcessResult().setProcessStatus(crackdownStatus.getProcessResult().getProcessStatusEtc());
}
crackdownStatus.getProcessResult().setCdsKey(cdsKey);
Integer prKey = processResultRepository.save(crackdownStatus.getProcessResult()).getPrKey();
crackdownStatus.getProcessResult().setPrKey(prKey);
}
/*if (internationalCrimeArrest.getDeleteSpiKeyList() != null) {
suspectPersonInfoRepository.deleteAllByIdInQuery(internationalCrimeArrest.getDeleteSpiKeyList());
}*/
if (crackdownStatus.getViolationList() != null) {
for(Violation violation: crackdownStatus.getViolationList()){
if (violation.getViolationEtc() != null) {
violation.setViolation(violation.getViolationEtc());
}
violation.setFbKey(crackdownStatus.getFishingBoat().getFbKey());
}
violationRepository.saveAll(crackdownStatus.getViolationList());
}
if (crackdownStatus.getSailorList() != null) {
for(Sailor sailor: crackdownStatus.getSailorList()){
sailor.setFbKey(crackdownStatus.getFishingBoat().getFbKey());
}
sailorRepository.saveAll(crackdownStatus.getSailorList());
}
return cdsKey;
}
@Transactional @Transactional
public Integer saveProcessResult(ProcessResult processResult) { public Integer saveProcessResult(ProcessResult processResult) {
if (processResult.getCrackdownStatus().getViolationDeleteKeyList() != null) { if (processResult.getCrackdownStatus().getViolationDeleteKeyList() != null) {
@ -127,12 +70,19 @@ public class ProcessResultService extends BaseService {
fishingBoatRepository.save(existingFishingBoat); fishingBoatRepository.save(existingFishingBoat);
} }
if (processResult.getViolationList() != null) { if (processResult.getViolationList().get(0).getViolation() != null) {
Violation lastViolation = violationRepository.findTopByFbKeyOrderByViolationKeyDesc(processResult.getCrackdownStatus().getFbKey()).orElse(null);
int violationKey = lastViolation==null?1:(lastViolation.getViolationKey()+1);
for(Violation violation: processResult.getViolationList()){ for(Violation violation: processResult.getViolationList()){
if (violation.getViolationEtc() != null) { if (violation.getViolationEtc() != null) {
violation.setViolation(violation.getViolationEtc()); violation.setViolation(violation.getViolationEtc());
} }
violation.setFbKey(processResult.getFishingBoat().getFbKey()); violation.setFbKey(processResult.getFishingBoat().getFbKey());
if (violation.getViolationKey() == null) {
violation.setViolationKey(violationKey);
violationKey++;
}
} }
violationRepository.saveAll(processResult.getViolationList()); violationRepository.saveAll(processResult.getViolationList());
} }

View File

@ -0,0 +1,131 @@
package com.dbnt.faisp.main.faStatistics.crackdownsStatus.service;
import com.dbnt.faisp.config.BaseService;
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.mapper.SailorMapper;
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.*;
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.sailor.Sailor;
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.sailor.SailorVersion;
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.repository.*;
import com.dbnt.faisp.util.Utils;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@Service
@RequiredArgsConstructor
public class SailorService extends BaseService {
private final SailorMapper sailorMapper;
private final CrackdownStatusRepository crackdownStatusRepository;
private final FishingBoatRepository fishingBoatRepository;
private final ViolationRepository violationRepository;
private final ProcessResultRepository processResultRepository;
private final SailorRepository sailorRepository;
private final SailorVersionRepository sailorVersionRepository;
public List<Sailor> selectSailorList(Sailor sailor) {
return sailorMapper.selectSailorList(sailor);
}
public Sailor selectSailor(Integer sailorKey) {
return sailorRepository.findById(sailorKey).orElse(null);
}
public List<SailorVersion> selectSailorVersionList(Integer sailorKey) {
return sailorVersionRepository.findBySailorKey(sailorKey);
}
public SailorVersion selectSailorVersion(Integer versionNo) {
return sailorVersionRepository.findByVersionNo(versionNo);
}
@Transactional
public Integer saveSailor(Sailor sailor) {
if (sailor.getCrackdownStatus().getViolationDeleteKeyList() != null) {
violationRepository.deleteAllByIdInQuery(sailor.getCrackdownStatus().getViolationDeleteKeyList());
}
Integer sailorKey = 0;
Sailor existingSailor = sailorRepository.findBySailorKey(sailor.getSailorKey());
if (existingSailor != null) {
Utils.copyNonNullProperties(sailor, existingSailor);
existingSailor.setViolationList(null);
sailorKey = sailorRepository.save(existingSailor).getSailorKey();
saveSailorVersion(existingSailor);
} else {
sailorKey = sailorRepository.save(sailor).getSailorKey();
saveSailorVersion(sailor);
}
if (sailor.getCrackdownStatus() != null) {
if (sailor.getCrackdownStatus().getCrackdownPoliceEtc() != null) {
sailor.getCrackdownStatus().setCrackdownPolice(sailor.getCrackdownStatus().getCrackdownPoliceEtc());
}
CrackdownStatus existingCrackdownStatus = crackdownStatusRepository.findByCdsKey(sailor.getCrackdownStatus().getCdsKey());
Utils.copyNonNullProperties(sailor, existingCrackdownStatus);
sailor.setCrackdownStatus(crackdownStatusRepository.save(existingCrackdownStatus));
}
if (sailor.getFishingBoat() != null) {
FishingBoat existingFishingBoat = fishingBoatRepository.findByCdsKey(sailor.getCrackdownStatus().getCdsKey());
Utils.copyNonNullProperties(sailor, existingFishingBoat);
fishingBoatRepository.save(existingFishingBoat);
}
if (sailor.getViolationList() != null && sailor.getViolationList().get(0).getViolation() != null) {
Violation lastViolation = violationRepository.findTopByFbKeyOrderByViolationKeyDesc(sailor.getCrackdownStatus().getFbKey()).orElse(null);
int violationKey = lastViolation==null?1:(lastViolation.getViolationKey()+1);
for(Violation violation: sailor.getViolationList()){
if (violation.getViolationEtc() != null) {
violation.setViolation(violation.getViolationEtc());
}
violation.setFbKey(sailor.getFishingBoat().getFbKey());
if (violation.getViolationKey() == null) {
violation.setViolationKey(violationKey);
violationKey++;
}
}
violationRepository.saveAll(sailor.getViolationList());
}
return sailorKey;
}
public void saveSailorVersion(Sailor sailor) {
SailorVersion lastVersion = sailorVersionRepository.findTopBySailorKeyOrderByVersionNoDesc(sailor.getSailorKey()).orElse(null);
int versionNo = lastVersion==null?1:(lastVersion.getVersionNo()+1);
SailorVersion sailorVersion = new SailorVersion();
sailorVersion.setVersionNo(versionNo);
sailorVersion.setSailorKey(sailor.getSailorKey());
sailorVersion.setSailorNameKr(sailor.getSailorNameKr());
sailorVersion.setSailorNameCn(sailor.getSailorNameCn());
sailorVersion.setSailorNamePinyin(sailor.getSailorNamePinyin());
sailorVersion.setSailorContact(sailor.getSailorContact());
sailorVersion.setBirthdate(sailor.getBirthdate());
sailorVersion.setResidence(sailor.getResidence());
sailorVersion.setEducation(sailor.getEducation());
sailorVersion.setPosition(sailor.getPosition());
sailorVersion.setCareer(sailor.getCareer());
sailorVersion.setSimilarCriminalHistory(sailor.getSimilarCriminalHistory());
sailorVersion.setHeterogeneousCriminalHistory(sailor.getHeterogeneousCriminalHistory());
sailorVersion.setArrestHistory(sailor.getArrestHistory());
sailorVersion.setCriminalHistoryDetail(sailor.getCriminalHistoryDetail());
sailorVersion.setMonthlyWages(sailor.getMonthlyWages());
sailorVersion.setIsRestriction(sailor.getIsRestriction());
sailorVersion.setNote(sailor.getNote());
sailorVersion.setWrtOrgan(sailor.getWrtOrgan());
sailorVersion.setWrtPart(sailor.getWrtPart());
sailorVersion.setWrtUserSeq(sailor.getWrtUserSeq());
sailorVersion.setWrtUserGrd(sailorVersion.getWrtUserGrd());
sailorVersion.setWrtUserNm(sailor.getWrtUserNm());
sailorVersion.setWrtDt(sailor.getWrtDt());
sailorVersionRepository.save(sailorVersion);
}
}

View File

@ -0,0 +1,44 @@
<?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.main.faStatistics.crackdownsStatus.mapper.SailorMapper">
<sql id="selectSailorListWhere">
<where>
</where>
</sql>
<select id="selectSailorList" resultType="Sailor" parameterType="Sailor">
SELECT
s.sailor_key
, s.fb_key
, s.sailor_name_kr
, s.sailor_name_cn
, s.sailor_name_pinyin
, s.sailor_contact
, s.birthdate
, s.residence
, s.education
, s.position
, s.career
, s.similar_criminal_history
, s.heterogeneous_criminal_history
, s.arrest_history
, s.criminal_history_detail
, s.monthly_wages
, s.is_restriction
, s.note
, s.wrt_organ
, s.wrt_part
, s.wrt_user_seq
, s.wrt_user_grd
, s.wrt_user_nm
, s.wrt_dt
FROM sailor s
<include refid="selectSailorListWhere"></include>
ORDER BY s.sailor_key DESC
LIMIT #{rowCnt} OFFSET #{firstIndex}
</select>
</mapper>

View File

@ -19,6 +19,10 @@ $(document).on('click', '.tr', function (){
getCrackdownStatusViewModal($(this).data('key')); getCrackdownStatusViewModal($(this).data('key'));
}); });
$(document).on('change', 'select[name="crackdownPolice"]', function (){
dynamicOption('select[name="crackdownBoat"]', $(this).val());
});
$(document).on('click', '#sailorAddBtn', function (){ $(document).on('click', '#sailorAddBtn', function (){
$('#sailorDiv').append( $('#sailorDiv').append(
'<div class="row">' '<div class="row">'

View File

@ -209,7 +209,7 @@ function exportExcel(name){
return name; return name;
}, },
getExcelData : function(){ getExcelData : function(){
return document.getElementById('cdsTable'); //TABLE id return document.getElementById('prTable'); //TABLE id
}, },
getWorksheet : function(){ getWorksheet : function(){
return XLSX.utils.table_to_sheet(this.getExcelData()); return XLSX.utils.table_to_sheet(this.getExcelData());

View File

@ -0,0 +1,314 @@
$(document).on('click', '#sailorAddBtn', function () {
getSailorAddModal(null);
});
$(document).on('click', '#sailorEditBtn', function () {
$("#sailorViewModal").modal('hide');
getSailorEditModal(Number($("#sailorViewBody").find("[name='sailorKey']").val()));
});
$(document).on('click', '#saveSailorBtn', function (){
saveSailor('N')
});
$(document).on('click', '#saveTempBtn', function (){
saveSailor('Y')
});
$(document).on('click', '.tr', function (){
getSailorViewModal($(this).data('key'));
});
$(document).on('click', '#history-tab', function (){
getSailorHistoryViewModal($('#sailorEditForm').find('input[name="sailorKey"]').val());
});
$(document).on('click', '#sailor-tab', function (){
getSailorViewModal($('#sailorEditForm').find('input[name="sailorKey"]').val());
});
$(document).on('click', '.version-tr', function (){
$(this).find('input[name="versionNo"]').prop('checked', true);
getSailorHistoryDetail($(this).find('input[name="versionNo"]').val());
});
$(document).on('click', '#violationAddBtn', function (){
let violation = '';
commonCode.VT.forEach(function (item){
violation += '<option value="'+ item.itemCd +'">' + item.itemValue +'</option>';
})
$('#violationDiv').append(
'<div class="row">'
+ '<select class="form-select form-select-sm violation" name="violation">'
+ '<option value="">선택</option>'
+ violation
+ '<option value="etc">직접입력</option>'
+ '</select>'
+ '<button type="button" class="btn btn-primary col-auto" id="violationRemoveBtn">-</button>'
+ '</div>'
)
});
$(document).on('click', '#violationRemoveBtn', function (){
$(this).parent().remove();
let deleteKey = $(this).parent().children("input[name='violationKey']").val();
$("#sailorEditForm").append('<input type="hidden" name="violationDeleteKeyList" value="' + deleteKey + '">');
});
$(document).on('change', '.violation', function (){
if ($(this).val() == 'etc') {
$(this).after(
'<div class="row col-auto etcDiv">'
+ '<input type="text" class="form-control" name="violationEtc">'
+ '</div>'
);
} else {
$(this).next('.etcDiv').remove();
}
});
$(document).on('change', '#crackdownPolice', function (){
if ($(this).val() == 'etc') {
$(this).after(
'<div class="col-auto">'
+ '<input type="text" class="form-control" name="crackdownPoliceEtc">'
+ '</div>'
);
} else {
$(this).next().remove();
}
});
$(document).on('change', '#crackdownBoat', function (){
if ($(this).val() == 'etc') {
$(this).after(
'<div class="col-auto">'
+ '<input type="text" class="form-control" name="crackdownBoatEtc">'
+ '</div>'
);
} else {
$(this).next().remove();
}
});
$(document).on('change', 'select[name="boatNameKr"]', function (){
$('input[name="fbKey"]').val($('select[name="boatNameKr"] option:selected').data('key'));
$('input[name="cdsKey"]').val($('select[name="boatNameKr"] option:selected').data('key2'));
});
$(document).on('click', '#sailorDownExcel', function (){
exportExcel('불법조업 불법어선 처리현황');
});
function getSailorHistoryDetail(versionNo){
$.ajax({
url: '/faStatistics/sailor/sailorHistoryDetail',
data: {versionNo: versionNo},
type: 'GET',
dataType:"html",
success: function(html){
$("#historyDetailDiv").empty().append(html);
},
error:function(){
}
});
}
function getSailorViewModal(sailorKey){
$.ajax({
url: '/faStatistics/sailor/sailorViewModal',
data: {sailorKey: sailorKey},
type: 'GET',
dataType:"html",
success: function(html){
$("#sailorViewBody").empty().append(html)
$("#sailorViewModal").modal('show');
},
error:function(){
}
});
}
function getSailorHistoryViewModal(sailorKey){
$.ajax({
url: '/faStatistics/sailor/sailorHistoryViewModal',
data: {sailorKey: sailorKey},
type: 'GET',
dataType:"html",
success: function(html){
$("#sailorViewBody").empty().append(html)
$("#sailorViewModal").modal('show');
},
error:function(){
}
});
}
function getSailorEditModal(sailorKey){
$.ajax({
url: '/faStatistics/sailor/sailorEditModal',
data: {
sailorKey: sailorKey
},
type: 'GET',
dataType:"html",
success: function(html){
$("#sailorViewBody").empty();
$("#sailorEditModalContent").empty().append(html);
$("#sailorEditModal").modal('show');
$("#birthdate").datepicker({
format: "yyyy-mm-dd",
language: "ko"
});
},
error:function(){
}
});
}
function getSailorAddModal(){
$.ajax({
url: '/faStatistics/sailor/sailorAddModal',
type: 'GET',
dataType:"html",
success: function(html){
$("#sailorAddModalContent").empty().append(html);
$("#sailorAddModal").modal('show');
},
error:function(){
}
});
}
function saveSailor(saveYn){
/*$('input[name="warrantReqTakeTime"]').val(dateTimeCalc($("#consignmentStartDt").val(), $("#consignmentEndDt").val()));*/
if(contentCheck()){
if(confirm("저장하시겠습니까?")){
$("#saveYn").val(saveYn);
contentFade("in");
const formData = new FormData($("#sailorEditForm")[0]);
let violationList = [];
$(".violation").each(function (){
violationList.push({
violationKey: $(this).parent().find('input[name="violationKey"]').val() != undefined ? Number($(this).parent().find('input[name="violationKey"]').val()) : null,
fbKey: $("#sailorEditForm").find('input[name="fbKey"]').val() != undefined ? Number($("#sailorEditForm").find('input[name="fbKey"]').val()) : null,
violation: $(this).val() != '' ? $(this).val() : null,
violationEtc: $(this).parent().find('input[name="violationEtc"]').val() != undefined ? $(this).parent().find('input[name="violationEtc"]').val() : null
});
});
for (let i=0; i < violationList.length; i++) {
if (violationList[i].violationKey != null) {
formData.append(`violationList[${i}].violationKey`, violationList[i].violationKey);
}
if (violationList[i].fbKey != null) {
formData.append(`violationList[${i}].fbKey`, violationList[i].fbKey);
}
if (violationList[i].violation != null) {
formData.append(`violationList[${i}].violation`, violationList[i].violation);
}
if (violationList[i].violationEtc != null) {
formData.append(`violationList[${i}].violationEtc`, violationList[i].violationEtc);
}
}
$.ajax({
type : 'POST',
data : formData,
url : "/faStatistics/sailor/saveSailor",
processData: false,
contentType: false,
success : function(result) {
alert("저장되었습니다.");
contentFade("out");
$("#sailorEditModal").modal('hide');
$("#sailorAddModal").modal('hide');
},
error : function(xhr, status) {
alert("저장에 실패하였습니다.")
contentFade("out");
}
})
}
}
}
function contentCheck(){
let flag = true;
return flag;
}
function exportExcel(name){
var excelHandler = {
getExcelFileName : function(){
return name+getToday()+'.xlsx'; //파일명
},
getSheetName : function(){
return name;
},
getExcelData : function(){
return document.getElementById('sailorTable'); //TABLE id
},
getWorksheet : function(){
return XLSX.utils.table_to_sheet(this.getExcelData());
}
}
// step 1. workbook 생성
var wb = XLSX.utils.book_new();
// step 2. 시트 만들기
var newWorksheet = excelHandler.getWorksheet();
// step 3. workbook에 새로만든 워크시트에 이름을 주고 붙인다.
XLSX.utils.book_append_sheet(wb, newWorksheet, excelHandler.getSheetName());
// step 4. 엑셀 파일 만들기
var wbout = XLSX.write(wb, {bookType:'xlsx', type: 'binary'});
// step 5. 엑셀 파일 내보내기
saveAs(new Blob([s2ab(wbout)],{type:"application/octet-stream"}), excelHandler.getExcelFileName());
}
function s2ab(s) {
var buf = new ArrayBuffer(s.length); //convert s to arrayBuffer
var view = new Uint8Array(buf); //create uint8array as viewer
for (var i=0; i<s.length; i++) view[i] = s.charCodeAt(i) & 0xFF; //convert to octet
return buf;
}
function getToday() {
var date = new Date();
var year = date.getFullYear();
}
function dateTimeCalc(startDateTime, endDateTime) {
if (startDateTime != '' &&endDateTime != '' && startDateTime != undefined && endDateTime != undefined) {
const startDate = new Date(startDateTime);
const endDate = new Date(endDateTime);
let diffTime = endDate.getTime() - startDate.getTime();
const day = Math.floor(diffTime / (1000* 60 * 60 * 24));
const hour = Math.floor((diffTime % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
const minute = Math.floor((diffTime % (1000 * 60 * 60)) / (1000 * 60));
return day + '일' + hour + '시간' + minute + '분';
}
return null;
}

View File

@ -5,6 +5,7 @@
layout:decorate="~{layout/layout}"> layout:decorate="~{layout/layout}">
<th:block layout:fragment="script"> <th:block layout:fragment="script">
<script th:inline="javascript"> <script th:inline="javascript">
const crackdownStatus = [[${crackdownStatus}]];
const commonCode = [[${session.commonCode}]]; const commonCode = [[${session.commonCode}]];
</script> </script>
<script type="text/javascript" th:src="@{/js/faStatistics/crackdownStatus.js}"></script> <script type="text/javascript" th:src="@{/js/faStatistics/crackdownStatus.js}"></script>
@ -38,7 +39,7 @@
</div> </div>
</form> </form>
<div class="row justify-content-start" style="overflow: hidden; overflow-x: scroll"> <div class="row justify-content-start" style="overflow: hidden; overflow-x: scroll">
<table class="table table-striped" style="max-width: none; width: auto;" id="cdsTable"> <table class="table table-striped table-bordered" style="max-width: none; width: auto;" id="cdsTable">
<thead> <thead>
<tr> <tr>
<th rowspan="4">연번</th> <th rowspan="4">연번</th>
@ -203,7 +204,7 @@
<th th:text="${#aggregates.sum(crackdownStatusList.?[fishingBoat.confiscationFrame != null && fishingBoat.confiscationEtc != ''].![1]) ne null ? #aggregates.sum(crackdownStatusList.?[fishingBoat.confiscationEtc != null && fishingBoat.confiscationEtc != ''].![1]) : 0}"></th> <th th:text="${#aggregates.sum(crackdownStatusList.?[fishingBoat.confiscationFrame != null && fishingBoat.confiscationEtc != ''].![1]) ne null ? #aggregates.sum(crackdownStatusList.?[fishingBoat.confiscationEtc != null && fishingBoat.confiscationEtc != ''].![1]) : 0}"></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody class="table-group-divider">
<th:block th:each="crackdownStatus:${crackdownStatusList}"> <th:block th:each="crackdownStatus:${crackdownStatusList}">
<tr class="tr" th:data-key="${crackdownStatus.cdsKey}"> <tr class="tr" th:data-key="${crackdownStatus.cdsKey}">
<td th:text="${crackdownStatus.cdsKey}"></td> <td th:text="${crackdownStatus.cdsKey}"></td>
@ -246,11 +247,13 @@
<th:block th:if="${!#strings.contains(crackdownStatus.crackdownPolice, 'CPO')}"> <th:block th:if="${!#strings.contains(crackdownStatus.crackdownPolice, 'CPO')}">
<td th:text="${crackdownStatus.crackdownPolice}"></td> <td th:text="${crackdownStatus.crackdownPolice}"></td>
</th:block> </th:block>
<th:block th:each="commonCode:${session.commonCode.get('CDB')}"> <th:block th:each="num : ${#numbers.sequence(1,#lists.size(session.commonCode.get('CPO')))}">
<td th:if="${crackdownStatus.crackdownBoat eq commonCode.itemCd}" th:text="${commonCode.itemValue}"></td> <th:block th:if="${'CPO'+num == crackdownStatus.crackdownPolice}" th:each="commonCode:${session.commonCode.get('CPO'+num)}">
<td th:if="${crackdownStatus.crackdownBoat eq commonCode.itemCd}" th:text="${commonCode.itemValue}"></td>
</th:block>
</th:block> </th:block>
<th:block th:if="${!#strings.contains(crackdownStatus.crackdownBoat, 'CDB')}"> <th:block th:if="${!#strings.contains(crackdownStatus.crackdownBoat, 'CPO')}">
<td th:text="${crackdownStatus.crackdownBoat}"></td> <td></td>
</th:block> </th:block>
<td th:text="${crackdownStatus.mmsi}"></td> <td th:text="${crackdownStatus.mmsi}"></td>
<td th:text="${crackdownStatus.fishingBoat.boatNameKr}"></td> <td th:text="${crackdownStatus.fishingBoat.boatNameKr}"></td>

View File

@ -148,18 +148,17 @@
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}" <option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"
th:selected="${commonCode.itemCd eq crackdownStatus.crackdownPolice}"></option> th:selected="${commonCode.itemCd eq crackdownStatus.crackdownPolice}"></option>
</th:block> </th:block>
<option value="etc">직접입력</option>
</select> </select>
</div> </div>
<label class="col-sm-1 col-form-label text-center">단속함정</label> <label class="col-sm-1 col-form-label text-center">단속함정</label>
<div class="col-sm-2"> <div class="col-sm-2">
<select class="form-select form-select-sm" name="crackdownBoat" id="crackdownBoat"> <select class="form-select form-select-sm" name="crackdownBoat" id="crackdownBoat">
<option value="">선택</option> <option value="">선택</option>
<th:block th:each="commonCode:${session.commonCode.get('CDB')}"> <th:block th:each="num : ${#numbers.sequence(1,#lists.size(session.commonCode.get('CPO')))}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}" <th:block th:if="${'CPO'+num == crackdownStatus.crackdownPolice}" th:each="commonCode:${session.commonCode.get('CPO'+num)}">
th:selected="${commonCode.itemCd eq crackdownStatus.crackdownBoat}"></option> <option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}" th:selected="${crackdownStatus.crackdownBoat eq commonCode.itemCd}"></option>
</th:block>
</th:block> </th:block>
<option value="etc">직접입력</option>
</select> </select>
</div> </div>
<label class="col-sm-1 col-form-label text-center">MMSI.NO</label> <label class="col-sm-1 col-form-label text-center">MMSI.NO</label>

View File

@ -151,11 +151,11 @@
<div class="col-sm-2"> <div class="col-sm-2">
<select class="form-select form-select-sm" name="crackdownBoat" id="crackdownBoat"> <select class="form-select form-select-sm" name="crackdownBoat" id="crackdownBoat">
<option value="">선택</option> <option value="">선택</option>
<th:block th:each="commonCode:${session.commonCode.get('CDB')}"> <th:block th:each="num : ${#numbers.sequence(1,#lists.size(session.commonCode.get('CPO')))}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}" <th:block th:if="${'CPO'+num == crackdownStatus.crackdownPolice}" th:each="commonCode:${session.commonCode.get('CPO'+num)}">
th:selected="${commonCode.itemCd eq crackdownStatus.crackdownBoat}"></option> <option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}" th:selected="${crackdownStatus.crackdownBoat eq commonCode.itemCd}"></option>
</th:block>
</th:block> </th:block>
<option value="etc">직접입력</option>
</select> </select>
</div> </div>
<label class="col-sm-1 col-form-label text-center">MMSI.NO</label> <label class="col-sm-1 col-form-label text-center">MMSI.NO</label>

View File

@ -0,0 +1,280 @@
<!DOCTYPE html>
<html lang="ko" xmlns:th="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity5"
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorate="~{layout/layout}">
<th:block layout:fragment="script">
<script th:inline="javascript">
const commonCode = [[${session.commonCode}]];
</script>
<script type="text/javascript" th:src="@{/js/faStatistics/sailor.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">
<div class="card-body">
<form method="get" th:action="@{/faStatistics/sailor}" id="sailorSearchForm">
<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 eq num*10}"></option>
</th:block>
</select>
</div>
<div class="col-auto">
<div class="row justify-content-end">
<!--<div class="col-auto">
<input type="text" class="form-control form-control-sm" placeholder="사건번호" name="caseNum" th:value="${searchParams.caseNum}">
</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" style="overflow: hidden; overflow-x: scroll">
<table class="table table-striped table-bordered" style="max-width: none; width: auto;" id="sailorTable">
<thead>
<tr>
<th rowspan="2">연번</th>
<th rowspan="2">선박명</th>
<th rowspan="2">나포일시</th>
<th rowspan="2">단속경찰서</th>
<th rowspan="2">단속함정</th>
<th rowspan="2">위반장소</th>
<th rowspan="2">위반내용</th>
<th colspan="2">선원명</th>
<th rowspan="2">생년월일</th>
<th colspan="17">거주지(성기준)</th>
<th colspan="9">학력</th>
<th colspan="5">선박 내 직책</th>
<th colspan="6">승선경력</th>
<th colspan="5">동종 범죄경력</th>
<th colspan="5">이종 범죄경력</th>
<th colspan="5">검거이력<br>(나포이력, 선원 포함)</th>
<th rowspan="2">범죄경력<br>세부내용</th>
<th rowspan="2">임금<br>(월급여)</th>
<th rowspan="2">비고</th>
<th rowspan="2">최종수정일</th>
</tr>
<tr>
<th>한글</th>
<th>중문</th>
<th>요녕성</th>
<th>산동성</th>
<th>흑룡강성</th>
<th>하남성</th>
<th>길림성</th>
<th>내몽고</th>
<th>하북성</th>
<th>호남성</th>
<th>안휘성</th>
<th>산서성</th>
<th>강소성</th>
<th>사천성</th>
<th>섬서성</th>
<th>절강성</th>
<th>강동성</th>
<th>기타</th>
<th>확인불가</th>
<th>초등<br>중퇴</th>
<th>초등<br>졸업</th>
<th>중등<br>중퇴</th>
<th>중등<br>졸업</th>
<th>고등<br>중퇴</th>
<th>고등<br>졸업</th>
<th>대학<br>중퇴</th>
<th>대졸<br>이상</th>
<th>확인<br>불가</th>
<th>선장</th>
<th>항해장</th>
<th>기관장</th>
<th>기타<br>간부선원</th>
<th>일반선원<br>또는<br>확인불가</th>
<th>1년미만</th>
<th>1년이상<br>~<br>3년미만</th>
<th>3년이상<br>~<br>5년미만</th>
<th>5년이상<br>~<br>10년미만</th>
<th>10년이상</th>
<th>확인불가</th>
<th>1건</th>
<th>2건</th>
<th>3건</th>
<th>4건<br>이상</th>
<th>없음</th>
<th>1건</th>
<th>2건</th>
<th>3건</th>
<th>4건<br>이상</th>
<th>없음</th>
<th>1건</th>
<th>2건</th>
<th>3건</th>
<th>4건<br>이상</th>
<th>없음</th>
</tr>
</thead>
<tbody class="table-group-divider">
<th:block th:each="sailor:${sailorList}">
<tr class="tr" th:data-key="${sailor.sailorKey}">
<td th:text="${sailor.sailorKey}"></td>
<td th:text="${sailor.fishingBoat.boatNameKr}"></td>
<td th:text="${sailor.crackdownStatus.napoDt}"></td>
<th:block th:each="commonCode:${session.commonCode.get('CPO')}">
<td th:if="${sailor.crackdownStatus.crackdownPolice eq commonCode.itemCd}" th:text="${commonCode.itemValue}"></td>
</th:block>
<th:block th:if="${!#strings.contains(sailor.crackdownStatus.crackdownPolice, 'CPO')}">
<td th:text="${sailor.crackdownStatus.crackdownPolice}"></td>
</th:block>
<th:block th:each="num : ${#numbers.sequence(1,#lists.size(session.commonCode.get('CPO')))}">
<th:block th:if="${'CPO'+num == sailor.crackdownStatus.crackdownPolice}" th:each="commonCode:${session.commonCode.get('CPO'+num)}">
<td th:if="${sailor.crackdownStatus.crackdownBoat eq commonCode.itemCd}" th:text="${commonCode.itemValue}"></td>
</th:block>
</th:block>
<th:block th:if="${!#strings.contains(sailor.crackdownStatus.crackdownBoat, 'CPO')}">
<td></td>
</th:block>
<td>
<span th:text="${sailor.crackdownStatus.napoSeaPointLon}"> ~ </span>
<span th:text="${sailor.crackdownStatus.napoSeaPointLat}"></span>
<div th:text="${sailor.crackdownStatus.napoSeaPointDetail}"></div>
</td>
<td>
<th:block th:if="${#lists.size(sailor.violationList) >= 1}">
<th:block th:each="violation:${sailor.violationList}">
<th:block th:each="commonCode:${session.commonCode.get('VT')}">
<div th:if="${violation.violation eq commonCode.itemCd}" th:text="${commonCode.itemValue}"></div>
</th:block>
</th:block>
</th:block>
</td>
<td th:text="${sailor.sailorNameKr}"></td>
<td th:text="${sailor.sailorNameCn}"></td>
<td th:text="${sailor.birthdate}"></td>
<td th:text="${sailor.residence == 'RSC001' ? 1 : 0}"></td>
<td th:text="${sailor.residence == 'RSC002' ? 1 : 0}"></td>
<td th:text="${sailor.residence == 'RSC003' ? 1 : 0}"></td>
<td th:text="${sailor.residence == 'RSC004' ? 1 : 0}"></td>
<td th:text="${sailor.residence == 'RSC005' ? 1 : 0}"></td>
<td th:text="${sailor.residence == 'RSC006' ? 1 : 0}"></td>
<td th:text="${sailor.residence == 'RSC007' ? 1 : 0}"></td>
<td th:text="${sailor.residence == 'RSC008' ? 1 : 0}"></td>
<td th:text="${sailor.residence == 'RSC009' ? 1 : 0}"></td>
<td th:text="${sailor.residence == 'RSC010' ? 1 : 0}"></td>
<td th:text="${sailor.residence == 'RSC011' ? 1 : 0}"></td>
<td th:text="${sailor.residence == 'RSC012' ? 1 : 0}"></td>
<td th:text="${sailor.residence == 'RSC013' ? 1 : 0}"></td>
<td th:text="${sailor.residence == 'RSC014' ? 1 : 0}"></td>
<td th:text="${sailor.residence == 'RSC015' ? 1 : 0}"></td>
<td th:text="${sailor.residence ne null && !#strings.contains(sailor.residence, 'RSC') ? 1 : 0}"></td>
<td th:text="${sailor.residence == 'RSC016' ? 1 : 0}"></td>
<td th:text="${sailor.education == 'SED001' ? 1 : 0}"></td>
<td th:text="${sailor.education == 'SED002' ? 1 : 0}"></td>
<td th:text="${sailor.education == 'SED003' ? 1 : 0}"></td>
<td th:text="${sailor.education == 'SED004' ? 1 : 0}"></td>
<td th:text="${sailor.education == 'SED005' ? 1 : 0}"></td>
<td th:text="${sailor.education == 'SED006' ? 1 : 0}"></td>
<td th:text="${sailor.education == 'SED007' ? 1 : 0}"></td>
<td th:text="${sailor.education == 'SED008' ? 1 : 0}"></td>
<td th:text="${sailor.education == 'SED009' ? 1 : 0}"></td>
<td th:text="${sailor.position eq 'POS001' ? 1 : 0}"></td>
<td th:text="${sailor.position eq 'POS002' ? 1 : 0}"></td>
<td th:text="${sailor.position eq 'POS003' ? 1 : 0}"></td>
<td th:text="${sailor.position eq 'POS004' ? 1 : 0}"></td>
<td th:text="${sailor.position eq 'POS005' ? 1 : 0}"></td>
<td th:text="${sailor.position eq 'POS006' ? 1 : 0}"></td>
<td th:text="${sailor.education == 'BE001' ? 1 : 0}"></td>
<td th:text="${sailor.education == 'BE002' ? 1 : 0}"></td>
<td th:text="${sailor.education == 'BE003' ? 1 : 0}"></td>
<td th:text="${sailor.education == 'BE004' ? 1 : 0}"></td>
<td th:text="${sailor.education == 'BE005' ? 1 : 0}"></td>
<td th:text="${sailor.similarCriminalHistory == 1 ? 1 : 0}"></td>
<td th:text="${sailor.similarCriminalHistory == 2 ? 1 : 0}"></td>
<td th:text="${sailor.similarCriminalHistory == 3 ? 1 : 0}"></td>
<td th:text="${sailor.similarCriminalHistory > 3 ? 1 : 0}"></td>
<td th:text="${sailor.similarCriminalHistory == 0 ? 1 : 0}"></td>
<td th:text="${sailor.similarCriminalHistory == 1 ? 1 : 0}"></td>
<td th:text="${sailor.similarCriminalHistory == 2 ? 1 : 0}"></td>
<td th:text="${sailor.similarCriminalHistory == 3 ? 1 : 0}"></td>
<td th:text="${sailor.similarCriminalHistory > 3 ? 1 : 0}"></td>
<td th:text="${sailor.similarCriminalHistory == 0 ? 1 : 0}"></td>
<td th:text="${sailor.similarCriminalHistory == 1 ? 1 : 0}"></td>
<td th:text="${sailor.similarCriminalHistory == 2 ? 1 : 0}"></td>
<td th:text="${sailor.similarCriminalHistory == 3 ? 1 : 0}"></td>
<td th:text="${sailor.similarCriminalHistory > 3 ? 1 : 0}"></td>
<td th:text="${sailor.similarCriminalHistory == 0 ? 1 : 0}"></td>
<td th:text="${sailor.criminalHistoryDetail}"></td>
<td th:text="${sailor.monthlyWages}"></td>
<td th:text="${sailor.note}"></td>
<td th:text="${sailor.wrtDt}"></td>
</tr>
</th:block>
</tbody>
</table>
</div>
<div class="row justify-content">
<button class="btn btn-sm btn-primary col-auto" id="">관리자마감</button>
<button class="btn btn-sm btn-primary col-auto" id="sailorDownExcel">엑셀 다운로드</button>
<button class="btn btn-sm btn-primary col-auto" id="sailorAddBtn">등록</button>
</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 eq 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>
</div>
</div>
</div>
</div>
<div class="modal fade" id="sailorAddModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="sailorAddModalLabel" aria-hidden="true">
<div class="modal-dialog modal-xl modal-dialog-scrollable">
<div class="modal-content" id="sailorAddModalContent">
</div>
</div>
</div>
<div class="modal fade" id="sailorEditModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="sailorEditModalLabel" aria-hidden="true">
<div class="modal-dialog modal-xl modal-dialog-scrollable">
<div class="modal-content" id="sailorEditModalContent">
</div>
</div>
</div>
<div class="modal fade" id="sailorViewModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="sailorViewModalLabel" aria-hidden="true">
<div class="modal-dialog modal-xl modal-dialog-scrollable">
<div class="modal-content" id="sailorViewBody">
</div>
</div>
</div>
</main>
</div>
</html>

View File

@ -0,0 +1,142 @@
<!DOCTYPE html>
<html lang="ko" xmlns:th="http://www.thymeleaf.org">
<div class="modal-header">
<h5 class="modal-title" id="sailorAddModalLabel">선원 세부 현황 등록</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body" id="sailorAddBody">
<form action="#" method="post" id="sailorEditForm">
<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" name="sailorKey" th:value="${sailor.sailorKey}">
<input type="hidden" name="fbKey">
<input type="hidden" name="cdsKey">
<input type="hidden" name="wrtOrgan" th:value="${sailor.wrtOrgan}">
<input type="hidden" name="wrtUserNm" th:value="${sailor.wrtUserNm}">
<input type="hidden" name="wrtDt" th:value="${#temporals.format(sailor.wrtDt, 'yyyy-MM-dd HH:mm')}">
<input type="hidden" id="saveYn" name="saveYn">
<div class="mb-3 row">
<label class="col-sm-1 col-form-label text-center">선박명</label>
<div class="col-sm-2">
<select class="form-select form-select-sm" name="boatNameKr">
<option value="">선택</option>
<th:block th:each="fishingBoat : ${sailor.fishingBoatList}">
<option th:value="${fishingBoat.boatNameKr}" th:text="${fishingBoat.boatNameKr}" th:data-key="${fishingBoat.fbKey}" th:data-key2="${fishingBoat.cdsKey}"></option>
</th:block>
</select>
</div>
</div>
<div class="mb-3 row">
<label class="col-sm-1 col-form-label text-center">선원명(한글)</label>
<div class="col-sm-2">
<input class="form-control" name="sailorNameKr" id="sailorNameKr" th:value="${sailor.sailorNameKr}">
</div>
<label class="col-sm-1 col-form-label text-center">선원명(중문)</label>
<div class="col-sm-2">
<input class="form-control" name="sailorNameCn" id="sailorNameCn" th:value="${sailor.sailorNameCn}">
</div>
<label class="col-sm-1 col-form-label text-center">생년월일</label>
<div class="col-sm-2">
<input class="form-control" name="birthdate" id="birthdate" th:value="${#temporals.format(sailor.birthdate, 'yyyy-MM-dd')}">
</div>
</div>
<div class="mb-3 row">
<label class="col-sm-1 col-form-label text-center">거주지</label>
<div class="col-sm-2">
<select class="form-select form-select-sm" name="residence">
<option value="">선택</option>
<th:block th:each="commonCode:${session.commonCode.get('RSC')}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"
th:selected="${commonCode.itemCd eq sailor.residence}"></option>
</th:block>
</select>
</div>
<label class="col-sm-1 col-form-label text-center">학력</label>
<div class="col-sm-2">
<select class="form-select form-select-sm" name="education">
<option value="">선택</option>
<th:block th:each="commonCode:${session.commonCode.get('SED')}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"
th:selected="${commonCode.itemCd eq sailor.education}"></option>
</th:block>
</select>
</div>
<label class="col-sm-1 col-form-label text-center">선박 내 직책</label>
<div class="col-sm-2">
<select class="form-select form-select-sm" name="position">
<option value="">선택</option>
<th:block th:each="commonCode:${session.commonCode.get('POS')}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"
th:selected="${commonCode.itemCd eq sailor.position}"></option>
</th:block>
</select>
</div>
</div>
<div class="mb-3 row">
<label class="col-sm-1 col-form-label text-center">승선경력</label>
<div class="col-sm-2">
<select class="form-select form-select-sm" name="career">
<option value="">선택</option>
<th:block th:each="commonCode:${session.commonCode.get('BE')}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"
th:selected="${commonCode.itemCd eq sailor.career}"></option>
</th:block>
</select>
</div>
<label class="col-sm-1 col-form-label text-center">동종 범죄경력</label>
<div class="col-sm-2">
<select class="form-select form-select-sm" name="similarCriminalHistory">
<option value="">선택</option>
<option value="1" th:selected="${sailor.similarCriminalHistory == 1}">1건</option>
<option value="2" th:selected="${sailor.similarCriminalHistory == 2}">2건</option>
<option value="3" th:selected="${sailor.similarCriminalHistory == 3}">3건</option>
<option value="4" th:selected="${sailor.similarCriminalHistory == 4}">4이상</option>
<option value="0" th:selected="${sailor.similarCriminalHistory == 0}">없음</option>
</select>
</div>
<label class="col-sm-1 col-form-label text-center">이종 범죄경력</label>
<div class="col-sm-2">
<select class="form-select form-select-sm" name="heterogeneousCriminalHistory">
<option value="">선택</option>
<option value="1" th:selected="${sailor.heterogeneousCriminalHistory == 1}">1건</option>
<option value="2" th:selected="${sailor.heterogeneousCriminalHistory == 2}">2건</option>
<option value="3" th:selected="${sailor.heterogeneousCriminalHistory == 3}">3건</option>
<option value="4" th:selected="${sailor.heterogeneousCriminalHistory == 4}">4이상</option>
<option value="0" th:selected="${sailor.heterogeneousCriminalHistory == 0}">없음</option>
</select>
</div>
<label class="col-sm-1 col-form-label text-center">검거이력<br>(나포이력, 선원 포함)</label>
<div class="col-sm-2">
<select class="form-select form-select-sm" name="arrestHistory">
<option value="">선택</option>
<option value="1" th:selected="${sailor.arrestHistory == 1}">1건</option>
<option value="2" th:selected="${sailor.arrestHistory == 2}">2건</option>
<option value="3" th:selected="${sailor.arrestHistory == 3}">3건</option>
<option value="4" th:selected="${sailor.arrestHistory == 4}">4이상</option>
<option value="0" th:selected="${sailor.arrestHistory == 0}">없음</option>
</select>
</div>
</div>
<div class="mb-3 row">
<label class="col-sm-1 col-form-label text-center">범죄경력<br>세부내용</label>
<div class="col-sm-2">
<input class="form-control" name="criminalHistoryDetail" th:value="${sailor.criminalHistoryDetail}">
</div>
<label class="col-sm-1 col-form-label text-center">임금<br>(월급여)</label>
<div class="col-sm-2">
<input class="form-control" name="monthlyWages" th:value="${sailor.monthlyWages}">
</div>
<label class="col-sm-1 col-form-label text-center">비고</label>
<div class="col-sm-2">
<input class="form-control" name="note" th:value="${sailor.note}">
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button>
<button type="button" class="btn btn-warning" id="saveTempBtn">임시저장</button>
<button type="button" class="btn btn-primary" id="saveSailorBtn">저장</button>
</div>
</html>

View File

@ -0,0 +1,208 @@
<!DOCTYPE html>
<html lang="ko" xmlns:th="http://www.thymeleaf.org">
<div class="modal-header">
<h5 class="modal-title" id="sailorEditModalLabel">선원 세부 현황</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body" id="sailorEditBody">
<form action="#" method="post" id="sailorEditForm">
<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" name="cdsKey" th:value="${sailor.crackdownStatus.cdsKey}">
<input type="hidden" name="fbKey" th:value="${sailor.fishingBoat.fbKey}">
<input type="hidden" name="sailorKey" th:value="${sailor.sailorKey}">
<input type="hidden" name="wrtOrgan" th:value="${sailor.wrtOrgan}">
<input type="hidden" name="wrtUserNm" th:value="${sailor.wrtUserNm}">
<input type="hidden" name="wrtDt" th:value="${#temporals.format(sailor.wrtDt, 'yyyy-MM-dd HH:mm')}">
<input type="hidden" id="saveYn" name="saveYn">
<div class="mb-3 row">
<label class="col-sm-1 col-form-label text-center">선박명</label>
<div class="col-sm-2">
<input class="form-control" name="boatNameKr" id="boatNameKr" th:value="${sailor.fishingBoat.boatNameKr}">
</div>
<label class="col-sm-1 col-form-label text-center">단속경찰서</label>
<div class="col-sm-2">
<select class="form-select form-select-sm" name="crackdownPolice" id="crackdownPolice">
<option value="">선택</option>
<th:block th:each="commonCode:${session.commonCode.get('CPO')}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"
th:selected="${sailor.crackdownStatus.crackdownPolice eq commonCode.itemCd}"></option>
</th:block>
<option value="etc" th:selected="${sailor.crackdownStatus.crackdownPolice ne null && sailor.crackdownStatus.crackdownPolice ne '' && !#strings.contains(sailor.crackdownStatus.crackdownPolice, 'CPO')}">직접입력</option>
</select>
</div>
<label class="col-sm-1 col-form-label text-center">단속함정</label>
<div class="col-sm-2">
<select class="form-select form-select-sm" name="crackdownBoat" id="crackdownBoat">
<option value="">선택</option>
<th:block th:each="commonCode:${session.commonCode.get('CDB')}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"
th:selected="${commonCode.itemCd eq sailor.crackdownStatus.crackdownBoat}"></option>
</th:block>
<option value="etc" th:selected="${sailor.crackdownStatus.crackdownBoat ne null && sailor.crackdownStatus.crackdownBoat ne '' && !#strings.contains(sailor.crackdownStatus.crackdownBoat, 'CPO')}">직접입력</option>
</select>
</div>
</div>
<div class="mb-3 row">
<label class="col-sm-1 col-form-label text-center">위반장소</label>
<div class="col-sm-2">
<input class="form-control" placeholder="위도" name="napoSeaPointLat" th:value="${sailor.crackdownStatus.napoSeaPointLat}">
<input class="form-control" placeholder="경도" name="napoSeaPointLon" th:value="${sailor.crackdownStatus.napoSeaPointLon}">
<input class="form-control" placeholder="상세내용" name="napoSeaPointDetail" th:value="${sailor.crackdownStatus.napoSeaPointDetail}">
</div>
<div class="col-sm-1">
<label class="col-form-label text-center">위반내용</label>
<button type="button" class="btn btn-primary col-auto" id="violationAddBtn">+</button>
</div>
<div class="col-sm-2" id="violationDiv">
<th:block th:if="${#lists.isEmpty(sailor.crackdownStatus.violationList)}">
<div class="row">
<select class="form-select form-select-sm violation" name="violation">
<option value="">선택</option>
<th:block th:each="commonCode:${session.commonCode.get('VT')}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"></option>
</th:block>
<option value="etc">직접입력</option>
</select>
</div>
</th:block>
<th:block th:if="${!#lists.isEmpty(sailor.crackdownStatus.violationList)}">
<th:block th:each="violation, i : ${sailor.crackdownStatus.violationList}">
<div class="row">
<input type="hidden" name="violationKey" th:value="${violation.violationKey}">
<select class="form-select form-select-sm violation" name="violation">
<option value="">선택</option>
<th:block th:each="commonCode:${session.commonCode.get('VT')}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"
th:selected="${crackdownStatus.violationList != null and commonCode.itemCd eq violation.violation}"></option>
</th:block>
<option th:selected="${violation.violation ne null && !#strings.contains(violation.violation, 'VT')}" value="etc">직접입력</option>
</select>
<th:block th:if="${violation.violation ne null and !#strings.contains(violation.violation, 'VT')}">
<div class="col-auto">
<input type="text" class="form-control" name="violationEtc" th:value="${violation.violation}">
</div>
</th:block>
<th:block th:if="${i.index > 0}">
<button type="button" class="btn btn-primary col-auto" id="violationRemoveBtn">-</button>
<input type="hidden" name="violationKey" th:value="${violation.violationKey}">
</th:block>
</div>
</th:block>
</th:block>
</div>
</div>
<div class="mb-3 row">
<label class="col-sm-1 col-form-label text-center">선원명(한글)</label>
<div class="col-sm-2">
<input class="form-control" name="sailorNameKr" id="sailorNameKr" th:value="${sailor.sailorNameKr}">
</div>
<label class="col-sm-1 col-form-label text-center">선원명(중문)</label>
<div class="col-sm-2">
<input class="form-control" name="sailorNameCn" id="sailorNameCn" th:value="${sailor.sailorNameCn}">
</div>
<label class="col-sm-1 col-form-label text-center">생년월일</label>
<div class="col-sm-2">
<input class="form-control" name="birthdate" id="birthdate" th:value="${#temporals.format(sailor.birthdate, 'yyyy-MM-dd')}">
</div>
</div>
<div class="mb-3 row">
<label class="col-sm-1 col-form-label text-center">거주지</label>
<div class="col-sm-2">
<select class="form-select form-select-sm" name="residence">
<option value="">선택</option>
<th:block th:each="commonCode:${session.commonCode.get('RSC')}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"
th:selected="${commonCode.itemCd eq sailor.residence}"></option>
</th:block>
</select>
</div>
<label class="col-sm-1 col-form-label text-center">학력</label>
<div class="col-sm-2">
<select class="form-select form-select-sm" name="education">
<option value="">선택</option>
<th:block th:each="commonCode:${session.commonCode.get('SED')}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"
th:selected="${commonCode.itemCd eq sailor.education}"></option>
</th:block>
</select>
</div>
<label class="col-sm-1 col-form-label text-center">선박 내 직책</label>
<div class="col-sm-2">
<select class="form-select form-select-sm" name="position">
<option value="">선택</option>
<th:block th:each="commonCode:${session.commonCode.get('POS')}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"
th:selected="${commonCode.itemCd eq sailor.position}"></option>
</th:block>
</select>
</div>
</div>
<div class="mb-3 row">
<label class="col-sm-1 col-form-label text-center">승선경력</label>
<div class="col-sm-2">
<select class="form-select form-select-sm" name="career">
<option value="">선택</option>
<th:block th:each="commonCode:${session.commonCode.get('BE')}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"
th:selected="${commonCode.itemCd eq sailor.career}"></option>
</th:block>
</select>
</div>
<label class="col-sm-1 col-form-label text-center">동종 범죄경력</label>
<div class="col-sm-2">
<select class="form-select form-select-sm" name="similarCriminalHistory">
<option value="">선택</option>
<option value="1" th:selected="${sailor.similarCriminalHistory == 1}">1건</option>
<option value="2" th:selected="${sailor.similarCriminalHistory == 2}">2건</option>
<option value="3" th:selected="${sailor.similarCriminalHistory == 3}">3건</option>
<option value="4" th:selected="${sailor.similarCriminalHistory == 4}">4이상</option>
<option value="0" th:selected="${sailor.similarCriminalHistory == 0}">없음</option>
</select>
</div>
<label class="col-sm-1 col-form-label text-center">이종 범죄경력</label>
<div class="col-sm-2">
<select class="form-select form-select-sm" name="heterogeneousCriminalHistory">
<option value="">선택</option>
<option value="1" th:selected="${sailor.heterogeneousCriminalHistory == 1}">1건</option>
<option value="2" th:selected="${sailor.heterogeneousCriminalHistory == 2}">2건</option>
<option value="3" th:selected="${sailor.heterogeneousCriminalHistory == 3}">3건</option>
<option value="4" th:selected="${sailor.heterogeneousCriminalHistory == 4}">4이상</option>
<option value="0" th:selected="${sailor.heterogeneousCriminalHistory == 0}">없음</option>
</select>
</div>
<label class="col-sm-1 col-form-label text-center">검거이력<br>(나포이력, 선원 포함)</label>
<div class="col-sm-2">
<select class="form-select form-select-sm" name="arrestHistory">
<option value="">선택</option>
<option value="1" th:selected="${sailor.arrestHistory == 1}">1건</option>
<option value="2" th:selected="${sailor.arrestHistory == 2}">2건</option>
<option value="3" th:selected="${sailor.arrestHistory == 3}">3건</option>
<option value="4" th:selected="${sailor.arrestHistory == 4}">4이상</option>
<option value="0" th:selected="${sailor.arrestHistory == 0}">없음</option>
</select>
</div>
</div>
<div class="mb-3 row">
<label class="col-sm-1 col-form-label text-center">범죄경력<br>세부내용</label>
<div class="col-sm-2">
<input class="form-control" name="criminalHistoryDetail" th:value="${sailor.criminalHistoryDetail}">
</div>
<label class="col-sm-1 col-form-label text-center">임금<br>(월급여)</label>
<div class="col-sm-2">
<input class="form-control" name="monthlyWages" th:value="${sailor.monthlyWages}">
</div>
<label class="col-sm-1 col-form-label text-center">비고</label>
<div class="col-sm-2">
<input class="form-control" name="note" th:value="${sailor.note}">
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button>
<button type="button" class="btn btn-warning" id="saveTempBtn">임시저장</button>
<button type="button" class="btn btn-primary" id="saveSailorBtn">저장</button>
</div>
</html>

View File

@ -0,0 +1,114 @@
<!DOCTYPE html>
<html lang="ko" xmlns:th="http://www.thymeleaf.org">
<div class="mb-3 row">
<label class="col-sm-1 col-form-label text-center">선박명</label>
<div class="col-sm-2">
<input class="form-control" name="boatNameKr" th:value="${sailorVersion.fishingBoat.boatNameKr}">
</div>
</div>
<div class="mb-3 row">
<label class="col-sm-1 col-form-label text-center">선원명(한글)</label>
<div class="col-sm-2">
<input class="form-control" name="sailorNameKr" id="sailorNameKr" th:value="${sailorVersion.sailorNameKr}">
</div>
<label class="col-sm-1 col-form-label text-center">선원명(중문)</label>
<div class="col-sm-2">
<input class="form-control" name="sailorNameCn" id="sailorNameCn" th:value="${sailorVersion.sailorNameCn}">
</div>
<label class="col-sm-1 col-form-label text-center">생년월일</label>
<div class="col-sm-2">
<input class="form-control" name="birthdate" id="birthdate" th:value="${#temporals.format(sailorVersion.birthdate, 'yyyy-MM-dd')}">
</div>
</div>
<div class="mb-3 row">
<label class="col-sm-1 col-form-label text-center">거주지</label>
<div class="col-sm-2">
<select class="form-select form-select-sm" name="residence">
<option value="">선택</option>
<th:block th:each="commonCode:${session.commonCode.get('RSC')}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"
th:selected="${commonCode.itemCd eq sailorVersion.residence}"></option>
</th:block>
</select>
</div>
<label class="col-sm-1 col-form-label text-center">학력</label>
<div class="col-sm-2">
<select class="form-select form-select-sm" name="education">
<option value="">선택</option>
<th:block th:each="commonCode:${session.commonCode.get('SED')}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"
th:selected="${commonCode.itemCd eq sailorVersion.education}"></option>
</th:block>
</select>
</div>
<label class="col-sm-1 col-form-label text-center">선박 내 직책</label>
<div class="col-sm-2">
<select class="form-select form-select-sm" name="position">
<option value="">선택</option>
<th:block th:each="commonCode:${session.commonCode.get('POS')}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"
th:selected="${commonCode.itemCd eq sailorVersion.position}"></option>
</th:block>
</select>
</div>
</div>
<div class="mb-3 row">
<label class="col-sm-1 col-form-label text-center">승선경력</label>
<div class="col-sm-2">
<select class="form-select form-select-sm" name="career">
<option value="">선택</option>
<th:block th:each="commonCode:${session.commonCode.get('BE')}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"
th:selected="${commonCode.itemCd eq sailorVersion.career}"></option>
</th:block>
</select>
</div>
<label class="col-sm-1 col-form-label text-center">동종 범죄경력</label>
<div class="col-sm-2">
<select class="form-select form-select-sm" name="similarCriminalHistory">
<option value="">선택</option>
<option value="1" th:selected="${sailorVersion.similarCriminalHistory == 1}">1건</option>
<option value="2" th:selected="${sailorVersion.similarCriminalHistory == 2}">2건</option>
<option value="3" th:selected="${sailorVersion.similarCriminalHistory == 3}">3건</option>
<option value="4" th:selected="${sailorVersion.similarCriminalHistory == 4}">4이상</option>
<option value="0" th:selected="${sailorVersion.similarCriminalHistory == 0}">없음</option>
</select>
</div>
<label class="col-sm-1 col-form-label text-center">이종 범죄경력</label>
<div class="col-sm-2">
<select class="form-select form-select-sm" name="heterogeneousCriminalHistory">
<option value="">선택</option>
<option value="1" th:selected="${sailorVersion.heterogeneousCriminalHistory == 1}">1건</option>
<option value="2" th:selected="${sailorVersion.heterogeneousCriminalHistory == 2}">2건</option>
<option value="3" th:selected="${sailorVersion.heterogeneousCriminalHistory == 3}">3건</option>
<option value="4" th:selected="${sailorVersion.heterogeneousCriminalHistory == 4}">4이상</option>
<option value="0" th:selected="${sailorVersion.heterogeneousCriminalHistory == 0}">없음</option>
</select>
</div>
<label class="col-sm-1 col-form-label text-center">검거이력<br>(나포이력, 선원 포함)</label>
<div class="col-sm-2">
<select class="form-select form-select-sm" name="arrestHistory">
<option value="">선택</option>
<option value="1" th:selected="${sailorVersion.arrestHistory == 1}">1건</option>
<option value="2" th:selected="${sailorVersion.arrestHistory == 2}">2건</option>
<option value="3" th:selected="${sailorVersion.arrestHistory == 3}">3건</option>
<option value="4" th:selected="${sailorVersion.arrestHistory == 4}">4이상</option>
<option value="0" th:selected="${sailorVersion.arrestHistory == 0}">없음</option>
</select>
</div>
</div>
<div class="mb-3 row">
<label class="col-sm-1 col-form-label text-center">범죄경력<br>세부내용</label>
<div class="col-sm-2">
<input class="form-control" name="criminalHistoryDetail" th:value="${sailorVersion.criminalHistoryDetail}">
</div>
<label class="col-sm-1 col-form-label text-center">임금<br>(월급여)</label>
<div class="col-sm-2">
<input class="form-control" name="monthlyWages" th:value="${sailorVersion.monthlyWages}">
</div>
<label class="col-sm-1 col-form-label text-center">비고</label>
<div class="col-sm-2">
<input class="form-control" name="note" th:value="${sailorVersion.note}">
</div>
</div>
</html>

View File

@ -0,0 +1,136 @@
<!DOCTYPE html>
<th:block layout:fragment="script">
<script th:inline="javascript">
const sailorVersionList = [[${session.sailorVersionList}]];
</script>
</th:block>
<html lang="ko" xmlns:th="http://www.thymeleaf.org">
<div class="modal-header">
<h5 class="modal-title" id="sailorEditModalLabel">선원 세부 현황</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<!-- 탭 메뉴 -->
<ul class="nav nav-tabs" role="tablist">
<li class="nav-item" role="presentation">
<button class="nav-link sailorTab" id="sailor-tab" data-bs-toggle="tab"
data-bs-target="#sailor" type="button" role="tab" aria-controls="sailor" data-sailor-type="sailor"
aria-selected="true">상세</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link sailorTab active" id="history-tab" data-bs-toggle="tab"
data-bs-target="#history" type="button" role="tab" data-history-type="history"
aria-controls="history">수정이력</button>
</li>
</ul>
<!-- 내용 -->
<div class="tab-content">
<div class="tab-pane fade show active" id="history" role="tabpanel" aria-labelledby="history-tab">
<div class="modal-body" id="sailorEditBody">
<form action="#" method="post" id="sailorEditForm">
<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" name="sailorKey" th:value="${sailorVersionList[0].sailorKey}">
<div class="row justify-content-start">
<div class="col-4">
<table class="table table-striped table-bordered" style="max-width: none; width: auto;" id="sailorTable">
<thead>
<tr>
<th></th>
<th>작성인</th>
<th>작성/수정일</th>
</tr>
</thead>
<tbody class="table-group-divider">
<th:block th:each="sailorVersion:${sailorVersionList}">
<tr class="version-tr">
<td>
<input type="radio" name="versionNo" th:value="${sailorVersion.versionNo}">
</td>
<td th:text="${sailorVersion.wrtUserNm}"></td>
<td th:text="${sailorVersion.wrtDt}"></td>
</tr>
</th:block>
</tbody>
</table>
</div>
<div class="col-8">
<div id="historyDetailDiv">
<div class="mb-3 row">
<label class="col-sm-1 col-form-label text-center">선박명</label>
<div class="col-sm-2">
<input class="form-control" name="boatNameKr" readonly>
</div>
</div>
<div class="mb-3 row">
<label class="col-sm-1 col-form-label text-center">선원명(한글)</label>
<div class="col-sm-2">
<input class="form-control" name="sailorNameKr" readonly>
</div>
<label class="col-sm-1 col-form-label text-center">선원명(중문)</label>
<div class="col-sm-2">
<input class="form-control" name="sailorNameCn" readonly>
</div>
<label class="col-sm-1 col-form-label text-center">생년월일</label>
<div class="col-sm-2">
<input class="form-control" name="birthdate" readonly>
</div>
</div>
<div class="mb-3 row">
<label class="col-sm-1 col-form-label text-center">거주지</label>
<div class="col-sm-2">
<input class="form-control" name="residence" readonly>
</div>
<label class="col-sm-1 col-form-label text-center">학력</label>
<div class="col-sm-2">
<input class="form-control" name="education" readonly>
</div>
<label class="col-sm-1 col-form-label text-center">선박 내 직책</label>
<div class="col-sm-2">
<input class="form-control" name="position" readonly>
</div>
</div>
<div class="mb-3 row">
<label class="col-sm-1 col-form-label text-center">승선경력</label>
<div class="col-sm-2">
<input class="form-control" name="career" readonly>
</div>
<label class="col-sm-1 col-form-label text-center">동종 범죄경력</label>
<div class="col-sm-2">
<input class="form-control" name="similarCriminalHistory" readonly>
</div>
<label class="col-sm-1 col-form-label text-center">이종 범죄경력</label>
<div class="col-sm-2">
<input class="form-control" name="heterogeneousCriminalHistory" readonly>
</div>
<label class="col-sm-1 col-form-label text-center">검거이력<br>(나포이력, 선원 포함)</label>
<div class="col-sm-2">
<input class="form-control" name="arrestHistory" readonly>
</div>
</div>
<div class="mb-3 row">
<label class="col-sm-1 col-form-label text-center">범죄경력<br>세부내용</label>
<div class="col-sm-2">
<input class="form-control" name="criminalHistoryDetail" readonly>
</div>
<label class="col-sm-1 col-form-label text-center">임금<br>(월급여)</label>
<div class="col-sm-2">
<input class="form-control" name="monthlyWages" readonly>
</div>
<label class="col-sm-1 col-form-label text-center">비고</label>
<div class="col-sm-2">
<input class="form-control" name="note" readonly>
</div>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button>
</div>
</html>

View File

@ -0,0 +1,228 @@
<!DOCTYPE html>
<html lang="ko" xmlns:th="http://www.thymeleaf.org">
<div class="modal-header">
<h5 class="modal-title" id="sailorEditModalLabel">선원 세부 현황</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<!-- 탭 메뉴 -->
<ul class="nav nav-tabs" role="tablist">
<li class="nav-item" role="presentation">
<button class="nav-link sailorTab active" id="sailor-tab" data-bs-toggle="tab"
data-bs-target="#sailor" type="button" role="tab" aria-controls="sailor" data-sailor-type="sailor"
aria-selected="true">상세</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link sailorTab" id="history-tab" data-bs-toggle="tab"
data-bs-target="#history" type="button" role="tab" data-history-type="history"
aria-controls="history">수정이력</button>
</li>
</ul>
<!-- 내용 -->
<div class="tab-content">
<div class="tab-pane fade show active" id="sailor" role="tabpanel" aria-labelledby="sailor-tab">
<div class="modal-body" id="sailorEditBody">
<form action="#" method="post" id="sailorEditForm">
<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" name="cdsKey" th:value="${sailor.crackdownStatus.cdsKey}">
<input type="hidden" name="fbKey" th:value="${sailor.fishingBoat.fbKey}">
<input type="hidden" name="sailorKey" th:value="${sailor.sailorKey}">
<input type="hidden" name="wrtOrgan" th:value="${sailor.wrtOrgan}">
<input type="hidden" name="wrtUserNm" th:value="${sailor.wrtUserNm}">
<input type="hidden" name="wrtDt" th:value="${#temporals.format(sailor.wrtDt, 'yyyy-MM-dd HH:mm')}">
<input type="hidden" id="saveYn" name="saveYn">
<div class="mb-3 row">
<label class="col-sm-1 col-form-label text-center">선박명</label>
<div class="col-sm-2">
<input class="form-control" name="boatNameKr" id="boatNameKr" th:value="${sailor.fishingBoat.boatNameKr}">
</div>
<label class="col-sm-1 col-form-label text-center">단속경찰서</label>
<div class="col-sm-2">
<select class="form-select form-select-sm" name="crackdownPolice" id="crackdownPolice">
<option value="">선택</option>
<th:block th:each="commonCode:${session.commonCode.get('CPO')}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"
th:selected="${sailor.crackdownStatus.crackdownPolice eq commonCode.itemCd}"></option>
</th:block>
<option value="etc" th:selected="${sailor.crackdownStatus.crackdownPolice ne null && sailor.crackdownStatus.crackdownPolice ne '' && !#strings.contains(sailor.crackdownStatus.crackdownPolice, 'CPO')}">직접입력</option>
</select>
</div>
<label class="col-sm-1 col-form-label text-center">단속함정</label>
<div class="col-sm-2">
<select class="form-select form-select-sm" name="crackdownBoat" id="crackdownBoat">
<option value="">선택</option>
<th:block th:each="commonCode:${session.commonCode.get('CDB')}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"
th:selected="${commonCode.itemCd eq sailor.crackdownStatus.crackdownBoat}"></option>
</th:block>
<option value="etc" th:selected="${sailor.crackdownStatus.crackdownBoat ne null && sailor.crackdownStatus.crackdownBoat ne '' && !#strings.contains(sailor.crackdownStatus.crackdownBoat, 'CPO')}">직접입력</option>
</select>
</div>
</div>
<div class="mb-3 row">
<label class="col-sm-1 col-form-label text-center">위반장소</label>
<div class="col-sm-2">
<input class="form-control" placeholder="위도" name="napoSeaPointLat" th:value="${sailor.crackdownStatus.napoSeaPointLat}">
<input class="form-control" placeholder="경도" name="napoSeaPointLon" th:value="${sailor.crackdownStatus.napoSeaPointLon}">
<input class="form-control" placeholder="상세내용" name="napoSeaPointDetail" th:value="${sailor.crackdownStatus.napoSeaPointDetail}">
</div>
<div class="col-sm-1">
<label class="col-form-label text-center">위반내용</label>
<button type="button" class="btn btn-primary col-auto" id="violationAddBtn">+</button>
</div>
<div class="col-sm-2" id="violationDiv">
<th:block th:if="${#lists.isEmpty(sailor.crackdownStatus.violationList)}">
<div class="row">
<select class="form-select form-select-sm violation" name="violation">
<option value="">선택</option>
<th:block th:each="commonCode:${session.commonCode.get('VT')}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"></option>
</th:block>
<option value="etc">직접입력</option>
</select>
</div>
</th:block>
<th:block th:if="${!#lists.isEmpty(sailor.crackdownStatus.violationList)}">
<th:block th:each="violation, i : ${sailor.crackdownStatus.violationList}">
<div class="row">
<input type="hidden" name="violationKey" th:value="${violation.violationKey}">
<select class="form-select form-select-sm violation" name="violation">
<option value="">선택</option>
<th:block th:each="commonCode:${session.commonCode.get('VT')}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"
th:selected="${crackdownStatus.violationList != null and commonCode.itemCd eq violation.violation}"></option>
</th:block>
<option th:selected="${violation.violation ne null && !#strings.contains(violation.violation, 'VT')}" value="etc">직접입력</option>
</select>
<th:block th:if="${violation.violation ne null and !#strings.contains(violation.violation, 'VT')}">
<div class="col-auto">
<input type="text" class="form-control" name="violationEtc" th:value="${violation.violation}">
</div>
</th:block>
<th:block th:if="${i.index > 0}">
<button type="button" class="btn btn-primary col-auto" id="violationRemoveBtn">-</button>
<input type="hidden" name="violationKey" th:value="${violation.violationKey}">
</th:block>
</div>
</th:block>
</th:block>
</div>
</div>
<div class="mb-3 row">
<label class="col-sm-1 col-form-label text-center">선원명(한글)</label>
<div class="col-sm-2">
<input class="form-control" name="sailorNameKr" id="sailorNameKr" th:value="${sailor.sailorNameKr}">
</div>
<label class="col-sm-1 col-form-label text-center">선원명(중문)</label>
<div class="col-sm-2">
<input class="form-control" name="sailorNameCn" id="sailorNameCn" th:value="${sailor.sailorNameCn}">
</div>
<label class="col-sm-1 col-form-label text-center">생년월일</label>
<div class="col-sm-2">
<input class="form-control" name="birthdate" id="birthdate" th:value="${#temporals.format(sailor.birthdate, 'yyyy-MM-dd')}">
</div>
</div>
<div class="mb-3 row">
<label class="col-sm-1 col-form-label text-center">거주지</label>
<div class="col-sm-2">
<select class="form-select form-select-sm" name="residence">
<option value="">선택</option>
<th:block th:each="commonCode:${session.commonCode.get('RSC')}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"
th:selected="${commonCode.itemCd eq sailor.residence}"></option>
</th:block>
</select>
</div>
<label class="col-sm-1 col-form-label text-center">학력</label>
<div class="col-sm-2">
<select class="form-select form-select-sm" name="residence">
<option value="">선택</option>
<th:block th:each="commonCode:${session.commonCode.get('SED')}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"
th:selected="${commonCode.itemCd eq sailor.education}"></option>
</th:block>
</select>
</div>
<label class="col-sm-1 col-form-label text-center">선박 내 직책</label>
<div class="col-sm-2">
<select class="form-select form-select-sm" name="residence">
<option value="">선택</option>
<th:block th:each="commonCode:${session.commonCode.get('POS')}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"
th:selected="${commonCode.itemCd eq sailor.position}"></option>
</th:block>
</select>
</div>
</div>
<div class="mb-3 row">
<label class="col-sm-1 col-form-label text-center">승선경력</label>
<div class="col-sm-2">
<select class="form-select form-select-sm" name="career">
<option value="">선택</option>
<th:block th:each="commonCode:${session.commonCode.get('BE')}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"
th:selected="${commonCode.itemCd eq sailor.career}"></option>
</th:block>
</select>
</div>
<label class="col-sm-1 col-form-label text-center">동종 범죄경력</label>
<div class="col-sm-2">
<select class="form-select form-select-sm" name="similarCriminalHistory">
<option value="">선택</option>
<option value="1" th:selected="${sailor.similarCriminalHistory == 1}">1건</option>
<option value="2" th:selected="${sailor.similarCriminalHistory == 2}">2건</option>
<option value="3" th:selected="${sailor.similarCriminalHistory == 3}">3건</option>
<option value="4" th:selected="${sailor.similarCriminalHistory == 4}">4이상</option>
<option value="0" th:selected="${sailor.similarCriminalHistory == 0}">없음</option>
</select>
</div>
<label class="col-sm-1 col-form-label text-center">이종 범죄경력</label>
<div class="col-sm-2">
<select class="form-select form-select-sm" name="heterogeneousCriminalHistory">
<option value="">선택</option>
<option value="1" th:selected="${sailor.heterogeneousCriminalHistory == 1}">1건</option>
<option value="2" th:selected="${sailor.heterogeneousCriminalHistory == 2}">2건</option>
<option value="3" th:selected="${sailor.heterogeneousCriminalHistory == 3}">3건</option>
<option value="4" th:selected="${sailor.heterogeneousCriminalHistory == 4}">4이상</option>
<option value="0" th:selected="${sailor.heterogeneousCriminalHistory == 0}">없음</option>
</select>
</div>
<label class="col-sm-1 col-form-label text-center">검거이력<br>(나포이력, 선원 포함)</label>
<div class="col-sm-2">
<select class="form-select form-select-sm" name="arrestHistory">
<option value="">선택</option>
<option value="1" th:selected="${sailor.arrestHistory == 1}">1건</option>
<option value="2" th:selected="${sailor.arrestHistory == 2}">2건</option>
<option value="3" th:selected="${sailor.arrestHistory == 3}">3건</option>
<option value="4" th:selected="${sailor.arrestHistory == 4}">4이상</option>
<option value="0" th:selected="${sailor.arrestHistory == 0}">없음</option>
</select>
</div>
</div>
<div class="mb-3 row">
<label class="col-sm-1 col-form-label text-center">범죄경력<br>세부내용</label>
<div class="col-sm-2">
<input class="form-control" name="note" th:value="${sailor.criminalHistoryDetail}">
</div>
<label class="col-sm-1 col-form-label text-center">임금<br>(월급여)</label>
<div class="col-sm-2">
<input class="form-control" name="note" th:value="${sailor.monthlyWages}">
</div>
<label class="col-sm-1 col-form-label text-center">비고</label>
<div class="col-sm-2">
<input class="form-control" name="note" th:value="${sailor.note}">
</div>
</div>
</form>
</div>
</div>
</div>
<div class="modal-footer">
<th:block th:if="${userSeq eq sailor.wrtUserSeq or accessAuth eq 'ACC003'}"><!--작성자일 경우 수정 허용--><!--관리자일 경우 수정 허용-->
<button type="button" class="btn btn-warning" id="sailorEditBtn">수정</button>
</th:block>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button>
</div>
</html>