|
|
|
@ -25,6 +25,7 @@ import java.util.Map;
|
|
|
|
|
public class ExternalLaancController { |
|
|
|
|
|
|
|
|
|
private final TsService tsService; |
|
|
|
|
private final BasLaancService basLaancService; |
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
error code |
|
|
|
@ -54,28 +55,28 @@ public class ExternalLaancController {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// try {
|
|
|
|
|
// tsService.createPlanDos(tsPlanRq);
|
|
|
|
|
// } catch (CustomException e) {
|
|
|
|
|
// log.error("IGNORE: ", e);
|
|
|
|
|
//
|
|
|
|
|
// ErrorCode errorCode = ErrorCode.fromCode(e.getErrorCode());
|
|
|
|
|
// if (errorCode == null) errorCode = ErrorCode.TS_ETC;
|
|
|
|
|
//
|
|
|
|
|
// String tsErrorCode = errorCode.code().replaceAll("TS", "");
|
|
|
|
|
//
|
|
|
|
|
// Map<String, String> error = new HashMap<>();
|
|
|
|
|
// error.put("rspCode", tsErrorCode);
|
|
|
|
|
// error.put("rspMessage", errorCode.message());
|
|
|
|
|
//
|
|
|
|
|
// return ResponseEntity.status(Integer.parseInt(tsErrorCode)).body(error);
|
|
|
|
|
// } catch (Exception e) {
|
|
|
|
|
// log.error("IGNORE: ", e);
|
|
|
|
|
// Map<String, String> error = new HashMap<>();
|
|
|
|
|
// error.put("rspCode", ErrorCode.TS_ETC.code());
|
|
|
|
|
// error.put("rspMessage", ErrorCode.TS_ETC.message());
|
|
|
|
|
// return ResponseEntity.status(300).body(error);
|
|
|
|
|
// }
|
|
|
|
|
try { |
|
|
|
|
basLaancService.createPlanDos(tsPlanRq); |
|
|
|
|
} catch (CustomException e) { |
|
|
|
|
log.error("IGNORE: ", e); |
|
|
|
|
|
|
|
|
|
ErrorCode errorCode = ErrorCode.fromCode(e.getErrorCode()); |
|
|
|
|
if (errorCode == null) errorCode = ErrorCode.TS_ETC; |
|
|
|
|
|
|
|
|
|
String tsErrorCode = errorCode.code().replaceAll("TS", ""); |
|
|
|
|
|
|
|
|
|
Map<String, String> error = new HashMap<>(); |
|
|
|
|
error.put("rspCode", tsErrorCode); |
|
|
|
|
error.put("rspMessage", errorCode.message()); |
|
|
|
|
|
|
|
|
|
return ResponseEntity.status(Integer.parseInt(tsErrorCode)).body(error); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("IGNORE: ", e); |
|
|
|
|
Map<String, String> error = new HashMap<>(); |
|
|
|
|
error.put("rspCode", ErrorCode.TS_ETC.code()); |
|
|
|
|
error.put("rspMessage", ErrorCode.TS_ETC.message()); |
|
|
|
|
return ResponseEntity.status(300).body(error); |
|
|
|
|
} |
|
|
|
|
return ResponseEntity.ok().build(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|