fix: 강남심사 소스 freezing

main
minuk926 2 years ago
parent bf753051e6
commit 4454856cca

@ -49,7 +49,7 @@ public class MinPasswordEncoder implements PasswordEncoder {
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}")
private String rootPath;
@Value("${file.cmm.upload.path:/kangnamSIM/simUpFile/}")
private String uploadPath;
// @Value("${file.cmm.upload.path:/kangnamSIM/simUpFile/}")
// private String uploadPath;
@Value("${file.cmm.upload.simsaPath:[simUpFile_sc1]}")
private String[] judgeUploadPath;

@ -38,12 +38,12 @@ import java.util.Arrays;
@RequestMapping("/api/v2/ctgy/file")
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;
@Value("${file.cmm.upload.path:/kangnamSIM/simUpFile/}")
@Value("${file.cmm.upload.pboard}")
private String uploadPath;
@Value("${file.cmm.upload.url}")
@ -80,12 +80,14 @@ public class CtgyFileMgtController {
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"))
absFile = dto.getInFileurl() + File.separator + dto.getInFilename();
else
absFile = rootPath + dto.getInFileurl().split(serviceUrl)[1] + File.separator + dto.getInFilename();
String absFile = absFile = rootPath + uploadPath + "/" + dto.getInFilename();
Path path = Paths.get(absFile);
String contentType = null;
@ -121,49 +123,4 @@ public class CtgyFileMgtController {
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);
}
//@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){
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectPasswdDec")
.setParameter("userid", userid)

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

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

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

Loading…
Cancel
Save