fix: 강남심사 소스 freezing

main
minuk926 2 years ago
parent bf753051e6
commit 4454856cca

@ -49,7 +49,7 @@ public class MinPasswordEncoder implements PasswordEncoder {
return false; return false;
} }
return Objects.equals(minUserinfoDao.queryGetPasswd(rawPassword.toString()), encodedPassword); return Objects.equals(minUserinfoDao.queryGetPasswdEncode(rawPassword.toString()), encodedPassword);
} }
/** /**

@ -45,8 +45,8 @@ public class CmmFileController {
@Value("${file.cmm.upload.root:c:/data/file/upload}") @Value("${file.cmm.upload.root:c:/data/file/upload}")
private String rootPath; private String rootPath;
@Value("${file.cmm.upload.path:/kangnamSIM/simUpFile/}") // @Value("${file.cmm.upload.path:/kangnamSIM/simUpFile/}")
private String uploadPath; // private String uploadPath;
@Value("${file.cmm.upload.simsaPath:[simUpFile_sc1]}") @Value("${file.cmm.upload.simsaPath:[simUpFile_sc1]}")
private String[] judgeUploadPath; private String[] judgeUploadPath;

@ -38,12 +38,12 @@ import java.util.Arrays;
@RequestMapping("/api/v2/ctgy/file") @RequestMapping("/api/v2/ctgy/file")
public class CtgyFileMgtController { public class CtgyFileMgtController {
private final Environment env; //private final Environment env;
@Value("${file.cmm.upload.root:c:/data/file/upload}") @Value("${file.cmm.upload.root}")
private String rootPath; private String rootPath;
@Value("${file.cmm.upload.path:/kangnamSIM/simUpFile/}") @Value("${file.cmm.upload.pboard}")
private String uploadPath; private String uploadPath;
@Value("${file.cmm.upload.url}") @Value("${file.cmm.upload.url}")
@ -80,12 +80,14 @@ public class CtgyFileMgtController {
MinInfoBoard680Dto dto = service.findFiles(inCode); MinInfoBoard680Dto dto = service.findFiles(inCode);
String absFile = ""; // String absFile = "";
//
// if (Arrays.asList(env.getActiveProfiles()).contains("local"))
// absFile = rootPath + dto.getInFileurl().split(serviceUrl)[1] + "/"+ dto.getInFilename();
// else
// absFile = dto.getInFileurl() + "/" + dto.getInFilename();
if (Arrays.asList(env.getActiveProfiles()).contains("local")) String absFile = absFile = rootPath + uploadPath + "/" + dto.getInFilename();
absFile = dto.getInFileurl() + File.separator + dto.getInFilename();
else
absFile = rootPath + dto.getInFileurl().split(serviceUrl)[1] + File.separator + dto.getInFilename();
Path path = Paths.get(absFile); Path path = Paths.get(absFile);
String contentType = null; String contentType = null;
@ -121,49 +123,4 @@ public class CtgyFileMgtController {
throw new CustomBaseException(ErrorCode.FILE_NOT_FOUND); throw new CustomBaseException(ErrorCode.FILE_NOT_FOUND);
} }
} }
@GetMapping("/download2/{inCode}")
public ResponseEntity<Resource> download(@PathVariable Long inCode, HttpServletResponse response) {
MinInfoBoard680Dto entity = service.findFiles(inCode);
String absFile = "";
if (Arrays.asList(env.getActiveProfiles()).contains("local"))
absFile = entity.getInFileurl() + File.separator + entity.getInFilename();
else
absFile = rootPath + entity.getInFileurl().split(serviceUrl)[1] + File.separator + entity.getInFilename();
Path path = Paths.get(absFile);
String contentType = null;
try {
contentType = Files.probeContentType(path);
} catch (IOException e) {
throw new CustomBaseException(ErrorCode.FILE_NOT_FOUND);
}
// File file = new File(absFile);
// try {
// byte[] fileByte = FileUtils.readFileToByteArray(file);
// } catch (IOException e) {
// throw new CustomBaseException(ErrorCode.FILE_NOT_FOUND);
// }
HttpHeaders headers = new HttpHeaders();
headers.add(HttpHeaders.CONTENT_TYPE, contentType);
headers.setContentDisposition(ContentDisposition.builder("attachment")
.filename(entity.getInFilename(), StandardCharsets.UTF_8)
//.filename(URLEncoder.encode(entity.getInFilename(), "utf-8"))
.build());
headers.add(HttpHeaders.CONTENT_LENGTH, String.valueOf(entity.getInFilesize()));
Resource resource = null;
try {
resource = new InputStreamResource(Files.newInputStream(path));
} catch (IOException e) {
throw new CustomBaseException(ErrorCode.FILE_NOT_FOUND);
}
return new ResponseEntity<>(resource, headers, HttpStatus.OK);
}
} }

@ -47,7 +47,6 @@ public class UserDao extends BaseMpowerDaoSupport {
return selectOneColumn(sql); return selectOneColumn(sql);
} }
//@Query(value = "SELECT ECL_DECRYPT(MU.passwd) AS passwd FROM min_userinfo MU WHERE MU.userid = ?1", nativeQuery = true)
public String queryGetPasswd(@NotNull final String userid){ public String queryGetPasswd(@NotNull final String userid){
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectPasswdDec") final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectPasswdDec")
.setParameter("userid", userid) .setParameter("userid", userid)

@ -29,7 +29,7 @@ public class CtgyFileService implements ICtgyFileService {
@Value("${file.cmm.upload.root:c:/data/file/upload}") @Value("${file.cmm.upload.root:c:/data/file/upload}")
private String rootPath; private String rootPath;
@Value("${file.cmm.upload.path:/kangnamSIM/simUpFile/}") @Value("${file.cmm.upload.pboard}")
private String uploadPath; private String uploadPath;
@Value("${file.cmm.upload.url}") @Value("${file.cmm.upload.url}")

@ -491,17 +491,14 @@ public abstract class BaseMpowerDaoSupport {
int index = 1; int index = 1;
if("picad".equals(imgDiv)){ if("picad".equals(imgDiv)){
log.info("<<< ==== Mpower picad 이미지 file name ====>>>");
// A, B, C, D // A, B, C, D
for(int idx = 0; idx <=3; idx++) client.setInput("dnfile"+index++,mpowerFilePre + fileNames.get(idx)); for(int idx = 0; idx <=3; idx++) client.setInput("dnfile"+index++,mpowerFilePre + fileNames.get(idx));
}else if("frecad".equals(imgDiv)) { }else if("frecad".equals(imgDiv)) {
log.info("<<< ==== Mpower frecad 이미지 file name ====>>>");
index = 1; index = 1;
// A, B, C, D // A, B, C, D
for (int idx = 0; idx <= 3; idx++) client.setInput("dnfile" + index++, mpowerFilePre + fileNames.get(idx)); for (int idx = 0; idx <= 3; idx++) client.setInput("dnfile" + index++, mpowerFilePre + fileNames.get(idx));
}else { }else {
log.info("<<< ==== Mpower contad 이미지 file name ====>>>");
index = 1; index = 1;
// F, G, H, I // F, G, H, I
for (int idx = 5; idx <= 8; idx++) client.setInput("dnfile" + index++, mpowerFilePre + fileNames.get(idx)); for (int idx = 5; idx <= 8; idx++) client.setInput("dnfile" + index++, mpowerFilePre + fileNames.get(idx));
@ -513,7 +510,6 @@ public abstract class BaseMpowerDaoSupport {
if (result.equals("true")){ if (result.equals("true")){
fileDownAndSet(list, client, svrSavedPhotoPath, file); fileDownAndSet(list, client, svrSavedPhotoPath, file);
}else{ }else{
throw new MpowerException("MPower File download error::"+result); throw new MpowerException("MPower File download error::"+result);
} }
@ -530,7 +526,6 @@ public abstract class BaseMpowerDaoSupport {
// 진술서 return // 진술서 return
//----------------------------------------------------------------- //-----------------------------------------------------------------
if("frecad".equals(imgDiv)) { if("frecad".equals(imgDiv)) {
log.info("<<< ==== Mpower frecad 이미지 file name ====>>>");
// E // E
client.setInput("dnfile1", mpowerFilePre + "E.jpg"); client.setInput("dnfile1", mpowerFilePre + "E.jpg");
client.Request(); client.Request();
@ -544,9 +539,6 @@ public abstract class BaseMpowerDaoSupport {
client.savefile("imageA", svrSavedPhotoPath); client.savefile("imageA", svrSavedPhotoPath);
} }
setFileInfo(list, client.getFileName("imageA"), svrSavedPhotoPath); setFileInfo(list, client.getFileName("imageA"), svrSavedPhotoPath);
} else {
setNoFileInfo(list);
} }
} }
return list; return list;
@ -558,7 +550,6 @@ public abstract class BaseMpowerDaoSupport {
//----------------------------------------------------------------- //-----------------------------------------------------------------
// 참고자료 return // 참고자료 return
//----------------------------------------------------------------- //-----------------------------------------------------------------
log.info("<<< ==== Mpower contad 이미지 file name ====>>>");
index = 1; index = 1;
// J, K, L, M // J, K, L, M
for (int idx = 9; idx <= 12; idx++) client.setInput("dnfile" + index++, mpowerFilePre + fileNames.get(idx)); for (int idx = 9; idx <= 12; idx++) client.setInput("dnfile" + index++, mpowerFilePre + fileNames.get(idx));
@ -588,11 +579,7 @@ public abstract class BaseMpowerDaoSupport {
client.savefile("imageA", svrSavedPhotoPath); client.savefile("imageA", svrSavedPhotoPath);
} }
setFileInfo(list, client.getFileName("imageA"), svrSavedPhotoPath); setFileInfo(list, client.getFileName("imageA"), svrSavedPhotoPath);
} }
// else{
// setNoFileInfo(list);
// }
if(Checks.isNotEmpty(client.getFileName("imageB"))){ if(Checks.isNotEmpty(client.getFileName("imageB"))){
if(!file.exists()) file.mkdirs(); if(!file.exists()) file.mkdirs();
@ -602,9 +589,6 @@ public abstract class BaseMpowerDaoSupport {
} }
setFileInfo(list, client.getFileName("imageB"), svrSavedPhotoPath); setFileInfo(list, client.getFileName("imageB"), svrSavedPhotoPath);
} }
// else{
// setNoFileInfo(list);
// }
}else{ }else{
throw new MpowerException("MPower File download error::"+result); throw new MpowerException("MPower File download error::"+result);
@ -629,9 +613,6 @@ public abstract class BaseMpowerDaoSupport {
setFileInfo(list, client.getFileName("imageA"), svrSavedPhotoPath); setFileInfo(list, client.getFileName("imageA"), svrSavedPhotoPath);
} }
// else{
// setNoFileInfo(list);
// }
if(Checks.isNotEmpty(client.getFileName("imageB"))){ if(Checks.isNotEmpty(client.getFileName("imageB"))){
if(!file.exists()) file.mkdirs(); if(!file.exists()) file.mkdirs();
@ -641,9 +622,6 @@ public abstract class BaseMpowerDaoSupport {
} }
setFileInfo(list, client.getFileName("imageB"), svrSavedPhotoPath); setFileInfo(list, client.getFileName("imageB"), svrSavedPhotoPath);
} }
// else{
// setNoFileInfo(list);
// }
if(Checks.isNotEmpty(client.getFileName("imageC"))){ if(Checks.isNotEmpty(client.getFileName("imageC"))){
if(!file.exists()) file.mkdirs(); if(!file.exists()) file.mkdirs();
@ -653,9 +631,6 @@ public abstract class BaseMpowerDaoSupport {
} }
setFileInfo(list, client.getFileName("imageC"), svrSavedPhotoPath); setFileInfo(list, client.getFileName("imageC"), svrSavedPhotoPath);
} }
// else{
// setNoFileInfo(list);
// }
if(Checks.isNotEmpty(client.getFileName("imageD"))){ if(Checks.isNotEmpty(client.getFileName("imageD"))){
if(!file.exists()) file.mkdirs(); if(!file.exists()) file.mkdirs();
@ -665,9 +640,6 @@ public abstract class BaseMpowerDaoSupport {
} }
setFileInfo(list, client.getFileName("imageD"), svrSavedPhotoPath); setFileInfo(list, client.getFileName("imageD"), svrSavedPhotoPath);
} }
// else{
// setNoFileInfo(list);
// }
} }
private void setFileInfo(List<Map<String, Object>> list, String imgName, String strpath) { private void setFileInfo(List<Map<String, Object>> list, String imgName, String strpath) {

@ -12,7 +12,7 @@ xit:
# api response logging 여부 # api response logging 여부
api: api:
reponse: reponse:
logging: true logging: false
file: file:
cmm: cmm:
@ -20,8 +20,7 @@ file:
root: d:/data/file/upload root: d:/data/file/upload
# root: /Users/minuk/data/file/upload # root: /Users/minuk/data/file/upload
# 공지사항 # 공지사항
path: /kangnamSIM/simUpFile pboard: /simUpFile #/kangnamSIM/simUpFile
publicPath: /simUpFile #/kangnamSIM/simUpFile
simsaPath: /simUpFile_sc1, /simUpFile_sc2 # 거주자 simUpFile_sc1, 장애인 simUpFile_sc2 simsaPath: /simUpFile_sc1, /simUpFile_sc2 # 거주자 simUpFile_sc1, 장애인 simUpFile_sc2
url: http://traffic.gangnam.go.kr url: http://traffic.gangnam.go.kr
allow: allow:
@ -43,7 +42,7 @@ mpower:
port: 9999 port: 9999
serviceName: XitFile.XitDownload serviceName: XitFile.XitDownload
# 단속사진 # 단속사진
picadPath: C:\\NewTraffic_Photo\\JUCHA_PHOTO\\ picadPath: C:/NewTraffic_Photo/JUCHA_PHOTO/
# 진술서 # 진술서
frecadPath: /picad frecadPath: /picad
# 첨부자료 # 첨부자료

Loading…
Cancel
Save