불법조업 외국어선 정보 페이지 작업완료.
parent
218ebd45e3
commit
2c841a888f
|
|
@ -1,23 +1,35 @@
|
|||
package com.dbnt.faisp.config;
|
||||
|
||||
import com.dbnt.faisp.main.faRpt.service.FaRptService;
|
||||
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.service.FishingBoatService;
|
||||
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.service.SailorService;
|
||||
import com.dbnt.faisp.main.fpiMgt.affair.service.AffairService;
|
||||
import com.dbnt.faisp.main.fpiMgt.affairPlan.service.PlanService;
|
||||
import com.dbnt.faisp.main.fpiMgt.affairResult.service.ResultService;
|
||||
import com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.service.BoardInvestigationService;
|
||||
import com.dbnt.faisp.main.publicBoard.service.PublicBoardService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.core.io.FileSystemResource;
|
||||
import org.springframework.core.io.Resource;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.util.FileCopyUtils;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.*;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/file")
|
||||
public class FileController {
|
||||
|
||||
private final FaRptService faRptService;
|
||||
|
|
@ -26,13 +38,55 @@ public class FileController {
|
|||
private final AffairService affairService;
|
||||
private final ResultService resultService;
|
||||
private final BoardInvestigationService boardInvestigationService;
|
||||
private final FishingBoatService fishingBoatService;
|
||||
|
||||
@GetMapping("/file/fileDownload")
|
||||
@GetMapping("/fileDisplay")
|
||||
public ResponseEntity<Resource> fileDisplay(HttpServletRequest request,
|
||||
HttpServletResponse response,
|
||||
String board,
|
||||
Integer parentKey,
|
||||
Integer fileSeq) {
|
||||
FileInfo fileInfo = getFileInfo(board, parentKey, fileSeq);
|
||||
String pathStr = fileInfo.getSavePath()+fileInfo.getConvNm();
|
||||
Resource resource = new FileSystemResource(pathStr);
|
||||
if(!resource.exists()){
|
||||
return new ResponseEntity<>(HttpStatus.NOT_FOUND);
|
||||
}
|
||||
HttpHeaders header = new HttpHeaders();
|
||||
Path filePath = null;
|
||||
try {
|
||||
filePath = Paths.get(pathStr);
|
||||
header.add("Content-type", Files.probeContentType(filePath));
|
||||
}catch (IOException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
return new ResponseEntity<Resource>(resource, header, HttpStatus.OK);
|
||||
}
|
||||
@GetMapping("/fileDownload")
|
||||
public void fileDownload(HttpServletRequest request,
|
||||
HttpServletResponse response,
|
||||
String board,
|
||||
Integer parentKey,
|
||||
Integer fileSeq) {
|
||||
|
||||
FileInfo fileInfo = getFileInfo(board, parentKey, fileSeq);
|
||||
BufferedInputStream in;
|
||||
BufferedOutputStream out;
|
||||
try {
|
||||
File file = new File(fileInfo.getSavePath(), fileInfo.getConvNm());
|
||||
|
||||
setDisposition(fileInfo.getFullName(), request, response);
|
||||
in = new BufferedInputStream(new FileInputStream(file));
|
||||
out = new BufferedOutputStream(response.getOutputStream());
|
||||
FileCopyUtils.copy(in, out);
|
||||
out.flush();
|
||||
if(out!=null) out.close();
|
||||
if(in!=null )in.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
private FileInfo getFileInfo(String board, Integer parentKey, Integer fileSeq){
|
||||
FileInfo downloadFile = null;
|
||||
switch (board){
|
||||
case "faRpt":
|
||||
|
|
@ -53,23 +107,11 @@ public class FileController {
|
|||
case "ivsgt":
|
||||
downloadFile = boardInvestigationService.selectIvsgtFile(parentKey, fileSeq);
|
||||
break;
|
||||
case "sailor":
|
||||
downloadFile = fishingBoatService.selectSailorFile(parentKey, fileSeq);
|
||||
break;
|
||||
}
|
||||
|
||||
BufferedInputStream in;
|
||||
BufferedOutputStream out;
|
||||
try {
|
||||
File file = new File(downloadFile.getSavePath(), downloadFile.getConvNm());
|
||||
|
||||
setDisposition(downloadFile.getFullName(), request, response);
|
||||
in = new BufferedInputStream(new FileInputStream(file));
|
||||
out = new BufferedOutputStream(response.getOutputStream());
|
||||
FileCopyUtils.copy(in, out);
|
||||
out.flush();
|
||||
if(out!=null) out.close();
|
||||
if(in!=null )in.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return downloadFile;
|
||||
}
|
||||
private void setDisposition(String filename, HttpServletRequest request, HttpServletResponse response) throws IOException {
|
||||
String browser = getBrowser(request);
|
||||
|
|
|
|||
|
|
@ -10,10 +10,8 @@ import com.dbnt.faisp.main.faStatistics.crackdownsStatus.service.FishingBoatServ
|
|||
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.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
|
@ -96,8 +94,10 @@ public class FishingBoatController {
|
|||
}
|
||||
|
||||
@PostMapping("/saveFishingBoat")
|
||||
public Integer saveFishingBoat(@AuthenticationPrincipal UserInfo loginUser, CrackdownStatus crackdownStatus){
|
||||
return fishingBoatService.saveCrackdownStatus(crackdownStatus);
|
||||
public Integer saveFishingBoat(@AuthenticationPrincipal UserInfo loginUser,
|
||||
CrackdownStatus crackdownStatus,
|
||||
MultipartHttpServletRequest request){
|
||||
return fishingBoatService.saveCrackdownStatus(crackdownStatus, request.getMultiFileMap().get("uploadFiles"));
|
||||
}
|
||||
|
||||
@GetMapping("/checkCaseNum")
|
||||
|
|
|
|||
|
|
@ -0,0 +1,58 @@
|
|||
package com.dbnt.faisp.main.faStatistics.crackdownsStatus.model;
|
||||
|
||||
import com.dbnt.faisp.config.FileInfo;
|
||||
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
|
||||
@IdClass(CaptinPhotoVersion.CaptinPhotoVersionId.class)
|
||||
@Table(name = "captin_photo_version")
|
||||
public class CaptinPhotoVersion extends FileInfo {
|
||||
@Id
|
||||
@Column(name = "sailor_key")
|
||||
private Integer sailorKey;
|
||||
|
||||
@Id
|
||||
@Column(name = "file_seq")
|
||||
private Integer fileSeq;
|
||||
|
||||
@Id
|
||||
@Column(name = "version_no")
|
||||
private Integer versionNo;
|
||||
|
||||
@Column(name = "orig_nm")
|
||||
private String origNm;
|
||||
|
||||
@Column(name = "conv_nm")
|
||||
private String convNm;
|
||||
|
||||
@Column(name = "file_extn")
|
||||
private String fileExtn;
|
||||
|
||||
@Column(name = "file_size")
|
||||
private String fileSize;
|
||||
|
||||
@Column(name = "save_path")
|
||||
private String savePath;
|
||||
|
||||
|
||||
@Embeddable
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class CaptinPhotoVersionId implements Serializable {
|
||||
private Integer sailorKey;
|
||||
private Integer fileSeq;
|
||||
private Integer versionNo;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,15 +1,12 @@
|
|||
package com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.fishingBoat;
|
||||
|
||||
import com.dbnt.faisp.config.BaseModel;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.DynamicInsert;
|
||||
import org.hibernate.annotations.DynamicUpdate;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.sailor;
|
||||
|
||||
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.CaptinPhotoFile;
|
||||
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.crackdownStatus.CrackdownStatus;
|
||||
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.fishingBoat.FishingBoat;
|
||||
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.fishingBoat.Violation;
|
||||
|
|
@ -56,4 +57,7 @@ public class Sailor extends SailorBaseEntity {
|
|||
private String boatNameKr;
|
||||
@Transient
|
||||
private LocalDateTime napoDt;
|
||||
|
||||
@Transient
|
||||
private List<CaptinPhotoFile> fileList;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -83,4 +83,5 @@ public class SailorBaseEntity extends BaseModel {
|
|||
@Column(name = "wrt_dt")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
|
||||
private LocalDateTime wrtDt;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.sailor;
|
||||
|
||||
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.CaptinPhotoFile;
|
||||
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.CaptinPhotoVersion;
|
||||
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.crackdownStatus.CrackdownStatus;
|
||||
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.fishingBoat.FishingBoat;
|
||||
import lombok.*;
|
||||
|
|
@ -8,6 +10,7 @@ import org.hibernate.annotations.DynamicUpdate;
|
|||
|
||||
import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
|
|
@ -49,4 +52,7 @@ public class SailorVersion extends SailorBaseEntity {
|
|||
private CrackdownStatus crackdownStatus;
|
||||
@Transient
|
||||
private FishingBoat fishingBoat;
|
||||
|
||||
@Transient
|
||||
private List<CaptinPhotoVersion> fileList;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,9 @@ package com.dbnt.faisp.main.faStatistics.crackdownsStatus.repository;
|
|||
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.CaptinPhotoFile;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface CaptionPhotoFileRepository extends JpaRepository<CaptinPhotoFile, CaptinPhotoFile.CaptinPhotoFileId> {
|
||||
|
||||
List<CaptinPhotoFile> findBySailorKeyOrderByFileSeqAsc(Integer sailorKey);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,8 @@
|
|||
package com.dbnt.faisp.main.faStatistics.crackdownsStatus.repository;
|
||||
|
||||
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.CaptinPhotoVersion;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
public interface CaptionPhotoVersionRepository extends JpaRepository<CaptinPhotoVersion, CaptinPhotoVersion.CaptinPhotoVersionId> {
|
||||
|
||||
}
|
||||
|
|
@ -2,7 +2,10 @@ package com.dbnt.faisp.main.faStatistics.crackdownsStatus.service;
|
|||
|
||||
|
||||
import com.dbnt.faisp.config.BaseService;
|
||||
import com.dbnt.faisp.config.FileInfo;
|
||||
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.mapper.CrackdownStatusMapper;
|
||||
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.CaptinPhotoFile;
|
||||
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.CaptinPhotoVersion;
|
||||
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.crackdownStatus.CrackdownStatus;
|
||||
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.crackdownStatus.CrackdownStatusVersion;
|
||||
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.fishingBoat.FishingBoat;
|
||||
|
|
@ -16,12 +19,16 @@ import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.sailor.SailorVers
|
|||
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.repository.*;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.File;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
|
|
@ -38,6 +45,8 @@ public class FishingBoatService extends BaseService {
|
|||
private final ProcessResultVersionRepository processResultVersionRepository;
|
||||
private final SailorRepository sailorRepository;
|
||||
private final SailorVersionRepository sailorVersionRepository;
|
||||
private final CaptionPhotoFileRepository captionPhotoFileRepository;
|
||||
private final CaptionPhotoVersionRepository captionPhotoVersionRepository;
|
||||
|
||||
public List<CrackdownStatus> selectFishingBoatList(CrackdownStatus crackdownStatus){
|
||||
return crackdownStatusMapper.selectFishingBoatList(crackdownStatus);
|
||||
|
|
@ -54,14 +63,17 @@ public class FishingBoatService extends BaseService {
|
|||
crackdownStatus.setViolationList(violationRepository.findByFbKey(crackdownStatus.getFishingBoat().getFbKey()));
|
||||
crackdownStatus.setSailorList(sailorRepository.findByFbKey(crackdownStatus.getFishingBoat().getFbKey()));
|
||||
for(Sailor sailor: crackdownStatus.getSailorList()){
|
||||
//첨부파일 ...?
|
||||
if(sailor.getPosition().equals("POS001")){
|
||||
// 선장의 첨부파일 첨부
|
||||
sailor.setFileList(captionPhotoFileRepository.findBySailorKeyOrderByFileSeqAsc(sailor.getSailorKey()));
|
||||
}
|
||||
}
|
||||
}
|
||||
return crackdownStatus;
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public Integer saveCrackdownStatus(CrackdownStatus crackdownStatus) {
|
||||
public Integer saveCrackdownStatus(CrackdownStatus crackdownStatus, List<MultipartFile> sailorFiles) {
|
||||
Integer cdsKey, fbKey;
|
||||
if (crackdownStatus.getCdsKey()==null || crackdownStatus.getCdsKey().equals(0)){
|
||||
// 최초 등록시 단속현황, 처리현황, 선원정보를 같이 등록.
|
||||
|
|
@ -106,19 +118,25 @@ public class FishingBoatService extends BaseService {
|
|||
processResultVersionRepository.save(processResultVersion);
|
||||
// 선원정보, 선원정보버전 저장.
|
||||
List<Sailor> sailorList = crackdownStatus.getSailorList();
|
||||
List<SailorVersion> sailorVersionList = new ArrayList<>();
|
||||
i = 1;
|
||||
for(Sailor sailor: sailorList){
|
||||
sailor.setSailorKey(i++);
|
||||
sailor.setFbKey(fbKey);
|
||||
|
||||
SailorVersion sailorVersion = new SailorVersion();
|
||||
|
||||
Integer sailorKey = sailorRepository.save(sailor).getSailorKey();
|
||||
|
||||
BeanUtils.copyProperties(sailor, sailorVersion);
|
||||
sailorVersion.setVersionNo(1);
|
||||
sailorVersionList.add(sailorVersion);
|
||||
sailorVersion.setSailorKey(sailorKey);
|
||||
Integer versionNo = sailorVersionRepository.save(sailorVersion).getVersionNo();
|
||||
if(sailor.getPosition().equals("POS001")){
|
||||
//선장은 사진이 같이 업로드 됨.
|
||||
if(sailorFiles.size()>0) {
|
||||
saveCaptainPhoto(sailorKey, versionNo, sailorFiles);
|
||||
}
|
||||
}
|
||||
}
|
||||
sailorRepository.saveAll(sailorList);
|
||||
sailorVersionRepository.saveAll(sailorVersionList);
|
||||
|
||||
}else{
|
||||
// 업데이트시에는 어선정보만 수정.
|
||||
cdsKey = crackdownStatus.getCdsKey();
|
||||
|
|
@ -160,8 +178,14 @@ public class FishingBoatService extends BaseService {
|
|||
return fishingBoat;
|
||||
}
|
||||
|
||||
public FileInfo selectSailorFile(Integer sailorKey, Integer fileSeq) {
|
||||
return captionPhotoFileRepository.findById(new CaptinPhotoFile.CaptinPhotoFileId(sailorKey, fileSeq)).orElse(null);
|
||||
}
|
||||
|
||||
private CrackdownStatus setWriteInfo(CrackdownStatus crackdownStatus){
|
||||
FishingBoat fishingBoat = crackdownStatus.getFishingBoat();
|
||||
fishingBoat.setWrtDt(LocalDateTime.now());
|
||||
|
||||
crackdownStatus.setWrtOrgan(fishingBoat.getWrtOrgan());
|
||||
crackdownStatus.setWrtPart(fishingBoat.getWrtPart());
|
||||
crackdownStatus.setWrtUserSeq(fishingBoat.getWrtUserSeq());
|
||||
|
|
@ -186,4 +210,32 @@ public class FishingBoatService extends BaseService {
|
|||
}
|
||||
return crackdownStatus;
|
||||
}
|
||||
|
||||
@Value("${file.dir.sailor}")
|
||||
protected String sailorPath;
|
||||
|
||||
private void saveCaptainPhoto(Integer sailorKey, Integer versionNo, List<MultipartFile> fileList){
|
||||
int fileSeq = 1;
|
||||
for(MultipartFile file : fileList){
|
||||
String saveName = UUID.randomUUID().toString();
|
||||
String path = locationPath+ File.separator+sailorPath+File.separator;
|
||||
saveFile(file, new File(path+File.separator+saveName));
|
||||
|
||||
String originalFilename = file.getOriginalFilename();
|
||||
int extnIdx = originalFilename.lastIndexOf(".");
|
||||
CaptinPhotoFile fileInfo = new CaptinPhotoFile();
|
||||
fileInfo.setSailorKey(sailorKey);
|
||||
fileInfo.setFileSeq(fileSeq++);
|
||||
fileInfo.setOrigNm(originalFilename.substring(0, extnIdx));
|
||||
fileInfo.setFileExtn(originalFilename.substring(extnIdx+1));
|
||||
fileInfo.setConvNm(saveName);
|
||||
fileInfo.setFileSize(calculationSize(file.getSize()));
|
||||
fileInfo.setSavePath(path);
|
||||
CaptinPhotoVersion versionInfo = new CaptinPhotoVersion();
|
||||
BeanUtils.copyProperties(fileInfo, versionInfo);
|
||||
versionInfo.setVersionNo(versionNo);
|
||||
captionPhotoFileRepository.save(fileInfo);
|
||||
captionPhotoVersionRepository.save(versionInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@ file.dir=C:\\faispUploadFiles
|
|||
file.dir.vulnerable=/vulnerable
|
||||
file.dir.part=/part
|
||||
file.dir.equip=/equip
|
||||
file.dir.sailor=sailor
|
||||
file.dir.affair=affair
|
||||
|
||||
|
||||
#thymeleaf
|
||||
|
|
|
|||
|
|
@ -149,10 +149,10 @@ function setUploadDiv(){
|
|||
}
|
||||
}).on('click', function (e){
|
||||
if(e.target.className.indexOf("ileDelete")<0){
|
||||
if(e.target.className.indexOf("artInfo")<0){
|
||||
if(e.target.className.indexOf("artWork")<0){
|
||||
$("#fileInputer").click();
|
||||
}
|
||||
if(e.target.className.indexOf("artInfo")<0){
|
||||
if(e.target.className.indexOf("artWork")<0){
|
||||
$("#fileInputer").click();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
let selectedList = [];
|
||||
let fileList = [];
|
||||
$(document).on('click', '#getFishingBoatEditModalBtn', function (){
|
||||
getFishingBoatEditModal(null);
|
||||
})
|
||||
|
|
@ -135,7 +136,22 @@ $(document).on('change', '.pressurizedTimeTaken', function (){
|
|||
$(document).on('change', '.warrantReqTake', function (){
|
||||
$("#warrantReqTake").val($("#warrantReqTakeDate").val()+"일 "+$("#warrantReqTakeTime").val())
|
||||
})
|
||||
|
||||
$(document).on('click', '#captainPhoto', function (){
|
||||
const fileDownloadDiv = $("#fileDownloadDiv")[0]
|
||||
if(fileDownloadDiv.className==="d-none"){
|
||||
fileDownloadDiv.className="";
|
||||
}else{
|
||||
fileDownloadDiv.className="d-none"
|
||||
}
|
||||
})
|
||||
$(document).on('click', '.fileDownLink', function (){
|
||||
const target = $(this)
|
||||
let url = "/file/fileDownload?"
|
||||
url += "board="+target.attr("data-board");
|
||||
url += "&parentKey="+target.attr("data-parentkey");
|
||||
url += "&fileSeq="+target.attr("data-fileseq");
|
||||
window.open(encodeURI(url));
|
||||
})
|
||||
function getFishingBoatEditModal(cdsKey){
|
||||
$.ajax({
|
||||
url: '/faStatistics/fishingBoatEditModal',
|
||||
|
|
@ -168,6 +184,8 @@ function getFishingBoatEditModal(cdsKey){
|
|||
$(".crackdownStatusInfo").attr("disabled", "disabled")
|
||||
$(".sailorInfo").attr("disabled", "disabled")
|
||||
$(".processResultInfo").attr("disabled", "disabled")
|
||||
}else{
|
||||
setUploadDiv();
|
||||
}
|
||||
$("#fishingBoatEditModal").modal('show');
|
||||
},
|
||||
|
|
@ -219,6 +237,10 @@ function saveFishingBoatInfo(saveYn){
|
|||
$("#saveYn").val(saveYn)
|
||||
contentFade("in");
|
||||
const formData = new FormData($("#fishingBoatEditForm")[0]);
|
||||
for(const file of files) {
|
||||
if(!file.isDelete)
|
||||
formData.append('uploadFiles', file, file.name);
|
||||
}
|
||||
$.each($(".violationCd"), function (idx, input){
|
||||
formData.append('violationList['+idx+'].violation', $(input).val());
|
||||
});
|
||||
|
|
|
|||
|
|
@ -246,26 +246,25 @@
|
|||
<input type="text" class="form-control form-control-sm sailorInfo" id="note" th:value="${sailor.note}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label for="fileInputer" class="col-sm-2 col-form-label col-form-label-sm text-center">사진</label>
|
||||
<div class="col-sm-10" style="min-height: 70px;">
|
||||
<div class="w-100 h-100 border border-info rounded text-center" id="uploadDiv">
|
||||
<br>사진을 업로드 해주세요.
|
||||
<!--
|
||||
<th:block th:if="${#arrays.isEmpty(affair.fileList)}">
|
||||
<br>파일을 업로드 해주세요.
|
||||
</th:block>
|
||||
<th:block th:unless="${#arrays.isEmpty(affair.fileList)}">
|
||||
<div class='row-col-6' th:each="affairFile:${affair.fileList}">
|
||||
<span th:data-fileseq="${affairFile.fileSeq}" th:text="|${affairFile.origNm}.${affairFile.fileExtn} ${affairFile.fileSize}|"></span>
|
||||
<a href='#' class='uploadedFileDelete text-danger text-decoration-none'>삭제</a>
|
||||
</div>
|
||||
</th:block>
|
||||
-->
|
||||
<th:block th:if="${crackdownStatus.cdsKey eq null}">
|
||||
<div class="row mb-3">
|
||||
<label for="fileInputer" class="col-sm-2 col-form-label col-form-label-sm text-center">사진</label>
|
||||
<div class="col-sm-10" style="min-height: 70px;">
|
||||
<div class="w-100 h-100 border border-info rounded text-center" id="uploadDiv">
|
||||
<th:block th:if="${#arrays.isEmpty(sailor.fileList)}">
|
||||
<br>사진을 업로드 해주세요.
|
||||
</th:block>
|
||||
<th:block th:unless="${#arrays.isEmpty(sailor.fileList)}">
|
||||
<div class='row-col-6' th:each="file:${sailor.fileList}">
|
||||
<span th:data-fileseq="${file.fileSeq}" th:text="|${file.origNm}.${file.fileExtn} ${file.fileSize}|"></span>
|
||||
<a href='#' class='uploadedFileDelete text-danger text-decoration-none'>삭제</a>
|
||||
</div>
|
||||
</th:block>
|
||||
</div>
|
||||
</div>
|
||||
<input type="file" class="d-none sailorInfo" id="fileInputer" multiple>
|
||||
</div>
|
||||
<input type="file" class="d-none sailorInfo" id="fileInputer" multiple>
|
||||
</div>
|
||||
</th:block>
|
||||
</div>
|
||||
</th:block>
|
||||
<th:block th:if="${sailor.position eq 'POS004'}">
|
||||
|
|
|
|||
|
|
@ -76,12 +76,33 @@
|
|||
<div class="col-6" id="captainDiv">
|
||||
<div class="row border border-secondary">
|
||||
<label class="col-sm-2 border-end border-secondary col-form-label col-form-label-sm py-2 border-end border-secondary text-center">선장명</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="col-sm-8">
|
||||
<div class="input-group w-auto">
|
||||
<input type="text" class="form-control form-control-sm border-0" readonly th:value="${sailor.sailorNameKr}">
|
||||
<input type="text" class="form-control form-control-sm border-0" readonly th:value="${sailor.sailorNameCn}">
|
||||
<input type="text" class="form-control form-control-sm border-0" readonly th:value="${sailor.sailorNamePinyin}">
|
||||
</div>
|
||||
<th:block th:unless="${#lists.isEmpty(sailor.fileList)}">
|
||||
<div id="fileDownloadDiv" class="d-none">
|
||||
<div class="row justify-content-end">
|
||||
<div class="col-auto">
|
||||
<th:block th:each="file:${sailor.fileList}">
|
||||
<a href="#" class="fileDownLink" data-board="sailor"
|
||||
th:data-parentkey="${file.sailorKey}" th:data-fileseq="${file.fileSeq}" th:text="|${file.origNm}.${file.fileExtn}|"></a>
|
||||
<br>
|
||||
</th:block>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</th:block>
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
<th:block th:if="${#lists.isEmpty(sailor.fileList)}">
|
||||
<div>사진 없음</div>
|
||||
</th:block>
|
||||
<th:block th:unless="${#lists.isEmpty(sailor.fileList)}">
|
||||
<img id="captainPhoto" class="w-100" alt="선장 사진" th:src="|/file/fileDisplay?board=sailor&parentKey=${sailor.sailorKey}&fileSeq=1|">
|
||||
</th:block>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row border border-secondary border-top-0">
|
||||
|
|
|
|||
Loading…
Reference in New Issue