shjung vor 2 Jahren
Ursprung
Commit
85303daf13

+ 0 - 1
.mvn/wrapper/MavenWrapperDownloader.java

@@ -90,7 +90,6 @@ public class MavenWrapperDownloader {
             System.exit(0);
         } catch (Throwable e) {
             System.out.println("- Error downloading");
-            e.printStackTrace();
             System.exit(1);
         }
     }

+ 0 - 34
src/main/java/com/its/op/controller/its/cctv/CctvControlController.java

@@ -145,38 +145,4 @@ public class CctvControlController {
         return this.service.controlReset(id, req);
     }
 
-    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-//    @ApiOperation(value = "CCTV PTZ 제어", response = CctvControlDto.CctvControlRes.class)
-//    @PostMapping(value = "/ptz/{id}", produces = {"application/json; charset=utf8"})
-//    public CctvControlDto.CctvControlRes controlPtz(
-//            @ApiParam(name = "id", value = "제어기번호", example = "1", required = true)
-//            @PathVariable("id") Long id,
-//            @ApiParam(name = "req", value = "CCTV PTZ 제어 정보", example = "[tilt-up, start, 20, ADMIN]", required = true)
-//            @RequestBody @Valid final CctvControlDto.CctvControlPtzReq req,
-//            HttpServletRequest request) {
-//        String userId = this.loginController.getSessionUserId(request);
-//        log.info("UUID: {}", userId);
-//        if (!userId.equals("")) {
-//            req.setUserId(userId);
-//        }
-//        return this.service.controlPtz(id, req);
-//    }
-//
-//    @ApiOperation(value = "CCTV Preset 제어", response = CctvControlDto.CctvControlRes.class)
-//    @PostMapping(value = "/preset/{id}", produces = {"application/json; charset=utf8"})
-//    public CctvControlDto.CctvControlRes controlPreset(
-//            @ApiParam(name = "id", value = "제어기번호", example = "1", required = true)
-//            @PathVariable("id") Long id,
-//            @ApiParam(name = "req", value = "CCTV Preset 제어 정보", example = "[preset, call, 1, 0, 0, ADMIN]", required = true)
-//            @RequestBody @Valid final CctvControlDto.CctvControlPresetReq req,
-//            HttpServletRequest request) {
-//        String userId = this.loginController.getSessionUserId(request);
-//        log.info("UUID: {}", userId);
-//        if (!userId.equals("")) {
-//            req.setUserId(userId);
-//        }
-//        return this.service.controlPreset(id, req);
-//    }
-    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
 }

+ 0 - 20
src/main/java/com/its/op/dto/its/facility/TbFcltSttsAlrmStupDto.java

@@ -226,26 +226,6 @@ public class TbFcltSttsAlrmStupDto implements Serializable {
         @Pattern(regexp = "[YN]")
         private String useYn;
 
-//        @Builder
-//        public TbFcltSttsAlrmStupUpdReq(String fclt_type, String fclt_id, String reg_dt, String cmnc_stts, String pwer_stts, String modl_stts, String door_stts, String front_door_stts, String back_door_stts, String video_input, String cntl_devc_stts, String atn_stts, String atn_mtns, String comm_stts, String user_id, String use_yn) {
-//            this.fcltType = fclt_type;
-//            this.fcltId = fclt_id;
-//            this.regDt = reg_dt;
-//            this.cmncStts = cmnc_stts;
-//            this.pwerStts = pwer_stts;
-//            this.modlStts = modl_stts;
-//            this.doorStts = door_stts;
-//            this.frontDoorStts = front_door_stts;
-//            this.backDoorStts = back_door_stts;
-//            this.videoInput = video_input;
-//            this.cntlDevcStts = cntl_devc_stts;
-//            this.atnStts = atn_stts;
-//            this.atnMtns = atn_mtns;
-//            this.commStts = comm_stts;
-//            this.userId = user_id;
-//            this.useYn = use_yn;
-//        }
-
         public TbFcltSttsAlrmStup toEntity() {
             return TbFcltSttsAlrmStup.builder()
                     .fcltType(this.fcltType)

+ 0 - 10
src/main/java/com/its/op/dto/its/vms/VmsControlDto.java

@@ -105,16 +105,6 @@ public class VmsControlDto implements Serializable {
         private String panlOffTime;
 
         @Builder
-//        public VmsControlParamReq(String user_id, Integer sch_msg_time, Integer module_temp, Integer fan_temp, Integer heater_temp, Integer module_fail, Integer retry_count, Integer timeout) {
-//            this.userId = user_id;
-//            this.schMsgTime = sch_msg_time;
-//            this.moduleTemp = module_temp;
-//            this.fanTemp = fan_temp;
-//            this.heaterTemp = heater_temp;
-//            this.moduleFail = module_fail;
-//            this.retryCount = retry_count;
-//            this.timeOut = timeout;
-//        }
         public VmsControlParamReq(String user_id, Integer fan_run_tmpr, Integer hetr_run_tmpr, String panl_on_time, String panl_off_time) {
             this.userId = user_id;
             this.fanRunTmpr = fan_run_tmpr;

+ 0 - 15
src/main/java/com/its/op/entity/its/oper/TbWwwMember.java

@@ -111,19 +111,4 @@ public class TbWwwMember implements Serializable {
         this.email = email;
     }
 
-//    public void updateInfo(TbWwwMemberDto.TbWwwMemberUpdReq req) {
-//        this.name = req.getName();
-//        this.pwd = req.getPwd();
-//        setPassword(req.getPwd());
-//        this.contactNum = req.getContactNum();
-//        this.userAuth = req.getUserAuth();
-//        this.hintQues = req.getHintQues();
-//        this.hintAns = req.getHintAns();
-//        this.loginFailCount = req.getLoginFailCount();
-//        this.isAccountLock = req.getIsAccountLock();
-//        this.ipAddress = req.getIpAddress();
-//        this.regDt = req.getRegDt();
-//        this.delYn = req.getDelYn();
-//    }
-
 }

+ 3 - 1
src/main/java/com/its/op/scheduler/ItsOpSigPhaseListener.java

@@ -43,8 +43,10 @@ public class ItsOpSigPhaseListener {
                     long delayMillis = doJob();
                     try {
                         Thread.sleep(delayMillis);
+                    } catch(InterruptedException ie) {
+                        log.error("--RUN: ItsOpSigPhaseListener. InterruptedException");
                     } catch (Exception e) {
-                        log.error("--RUN: ItsOpSigPhaseListener. Exception, {}", e.getMessage());
+                        log.error("--RUN: ItsOpSigPhaseListener. Exception");
                     }
                 }
                 log.info("--END: ItsOpSigPhaseListener.");

+ 1 - 1
src/main/java/com/its/op/scheduler/ItsOpSigPhaseListener_backup.java

@@ -89,7 +89,7 @@ public class ItsOpSigPhaseListener_backup implements DisposableBean, Runnable {
     }
 
     @Override
-    public void destroy() throws Exception {
+    public void destroy() {
         this.isShutdown = true;
         try {
             this.thread.join();

+ 1 - 0
src/main/java/com/its/op/security/UserDetailsServiceImpl.java

@@ -26,6 +26,7 @@ public class UserDetailsServiceImpl implements UserDetailsService {
         Optional<TbUserInfr> optUserInfr = this.userRepo.findById(userId);
         if (optUserInfr.isPresent()) {
             //optUserInfr.get().setPswd((this.userRepo.getCryptoDecrypt(optUserInfr.get().getPwd())));
+            optUserInfr.get().setPswd(optUserInfr.get().getPwd());
             return optUserInfr.get().toVo();
         }
         else {

+ 5 - 2
src/main/java/com/its/op/security/WebPasswordEncoder.java

@@ -1,5 +1,6 @@
 package com.its.op.security;
 
+import com.its.utils.SHA256Util;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang.StringUtils;
 import org.springframework.security.crypto.password.PasswordEncoder;
@@ -29,8 +30,10 @@ public class WebPasswordEncoder implements PasswordEncoder {
             log.warn("Empty encoded password");
             return false;
         }
-        //log.error("matches: {}, {}, {}", rawPassword.toString(), encodedPassword, StringUtils.equals(rawPassword.toString(), encodedPassword));
-        return StringUtils.equals(rawPassword.toString(), encodedPassword);
+        // 사용자가 입력한 비밀번호는 암호화가 되어있지 않기 때문에 암호화를 한 후
+        // 데이터베이스의 비밀번호와 비교해야 함.
+        String rawEncodedPassword = SHA256Util.encrypt(rawPassword.toString());
+        return StringUtils.equals(rawEncodedPassword, encodedPassword);
     }
 
     @Override

+ 4 - 4
src/main/java/com/its/op/service/its/TrafPrcsTime.java

@@ -93,7 +93,7 @@ public class TrafPrcsTime {
 		try {
 			to = transFormat.parse(paramTime);
 		} catch (ParseException e) {
-			e.printStackTrace();
+			log.error("convertString2Date: ParseException");
 		}
 		return to;
 	}
@@ -122,7 +122,7 @@ public class TrafPrcsTime {
 			to.setTime(transFormat.parse(paramTm).getTime() + addSec);
 			result = getDateToString(to, "yyyyMMddHHmmss");
 		} catch (ParseException e) {
-			e.printStackTrace();
+			log.error("calDate: ParseException");
 		}
 		return result;
 	}
@@ -136,7 +136,7 @@ public class TrafPrcsTime {
 			to.setTime(transFormat.parse(paramTm).getTime() + addSec);
 			result = getDateToString(to, paramFmt);
 		} catch (ParseException e) {
-			e.printStackTrace();
+			log.error("calDateFormat: ParseException");
 		}
 		return result;
 	}
@@ -154,7 +154,7 @@ public class TrafPrcsTime {
 			cal.set(Calendar.DAY_OF_MONTH, day);
 			return new SimpleDateFormat(paramFmt).format(cal.getTime());
 		} catch (ParseException e) {
-			e.printStackTrace();
+			log.error("calLastDayFormat: ParseException");
 		}
 		return result;
 	}

+ 1 - 1
src/main/java/com/its/op/service/its/facility/TbFcltSubjPartInService.java

@@ -51,7 +51,7 @@ public class TbFcltSubjPartInService {
         TbFcltSubjPartIn subjPart = null;
         try {
             subjPart = requireOne(req.getInSeq());
-        } catch (Exception e) {
+        } catch (NoSuchElementException e) {
             log.info("New Data: {}", req);
         }
         int validCnt = req.getInCnt();

+ 1 - 1
src/main/java/com/its/op/service/its/facility/TbFcltSubjPartOutService.java

@@ -52,7 +52,7 @@ public class TbFcltSubjPartOutService {
         TbFcltSubjPartOut subjPart = null;
         try {
             subjPart = requireOne(req.getOutSeq());
-        } catch (Exception e) {
+        } catch (NoSuchElementException e) {
             log.info("New Data: {}", req);
         }
         int validCnt = req.getOutCnt();

+ 3 - 2
src/main/java/com/its/op/service/its/rse/RseControlService.java

@@ -104,8 +104,9 @@ public class RseControlService {
                     }
                 } catch (IOException e) {
                     // 타임아웃
-                    log.error("{}", e.getMessage());
-                    result.setResult(1, "RSE 서버로 부터 응답수신시각이 초과되었습니다.(명령응답 타임아웃)");
+                    String errMsg = "RSE 서버로 부터 응답수신시각이 초과되었습니다.(명령응답 타임아웃)";
+                    log.error("{}", errMsg);
+                    result.setResult(1, errMsg);
                 }
             }
             else {

+ 1 - 1
src/main/java/com/its/op/service/its/xprotocol/CenterProtocol.java

@@ -279,7 +279,7 @@ public class CenterProtocol {
             os.write(data);
             os.flush();
         } catch (IOException e) {
-            String errMessage = e.getMessage();
+            String errMessage = "데이터 전송 오류";
             log.error("sendData: {}, {}", socket, errMessage);
             return false;
         }

+ 5 - 1
src/main/java/com/its/op/websocket/ItsWebSocketSession.java

@@ -5,6 +5,8 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.web.socket.TextMessage;
 import org.springframework.web.socket.WebSocketSession;
 
+import java.io.IOException;
+
 @Slf4j
 @Data
 public class ItsWebSocketSession {
@@ -23,8 +25,10 @@ public class ItsWebSocketSession {
             if (this.session.isOpen()) {
                 try {
                     this.session.sendMessage(message);
+                } catch (IOException e) {
+                    log.error("sendMessage: IOException, command: {}, session: {}", command, session);
                 } catch (Exception e) {
-                    log.error("sendMessage: command: {}, session: {}", command, session);
+                    log.error("sendMessage: Exception, command: {}, session: {}", command, session);
                 }
             }
         }

+ 1 - 1
src/main/java/com/its/op/xnetudp/handler/CenterCommServerPacketHandler.java

@@ -40,7 +40,7 @@ public class CenterCommServerPacketHandler extends SimpleChannelInboundHandler<O
 		InetSocketAddress remoteAddress = (InetSocketAddress)ctx.channel().remoteAddress();
         String ip = remoteAddress.getAddress().getHostAddress();
         log.error("CenterCommServerPacketHandler::exceptionCaught: {}, {}", ip, cause.getMessage());
-	    cause.printStackTrace();
+	    //cause.printStackTrace();
 		try {
 			super.exceptionCaught(ctx, cause);
 		} catch (IOException ie) {

+ 1 - 1
src/main/java/com/its/utils/SHA256Util.java

@@ -43,7 +43,7 @@ public class SHA256Util {
                 hexString.append(hex);
             }
             return hexString.toString();
-        } catch (Exception e) {
+        } catch (NoSuchAlgorithmException e) {
             throw new RuntimeException();
         }
     }

+ 5 - 5
src/main/java/com/its/utils/SignalUtils.java

@@ -18,7 +18,7 @@ public final class SignalUtils
 		double crdn;
 		try {
 			crdn = Long.parseLong(strCrdn);
-		} catch(Exception e) {
+		} catch(NumberFormatException e) {
 			crdn = 0;
 		}
 		return crdn / SIGNAL_CRDN_DOUBLE;
@@ -27,7 +27,7 @@ public final class SignalUtils
 		long inValue;
 		try {
 			inValue = Long.parseLong(value);
-		} catch(Exception e) {
+		} catch(NumberFormatException e) {
 			inValue = 0;
 		}
 		return crdnEntity2Dto(inValue);
@@ -37,7 +37,7 @@ public final class SignalUtils
 		double inValue;
 		try {
 			inValue = Double.parseDouble(value);
-		} catch(Exception e) {
+		} catch(NumberFormatException e) {
 			inValue = 0;
 		}
 		return inValue;
@@ -59,7 +59,7 @@ public final class SignalUtils
 		double inValue;
 		try {
 			inValue = Double.parseDouble(value);
-		} catch(Exception e) {
+		} catch(NumberFormatException e) {
 			inValue = 0;
 		}
 		return crdnDto2Entity(inValue);
@@ -75,7 +75,7 @@ public final class SignalUtils
 		double inValue;
 		try {
 			inValue = Double.parseDouble(value);
-		} catch(Exception e) {
+		} catch(NumberFormatException e) {
 			inValue = 0;
 		}
 		return crdnDto2EntityLong(inValue);

+ 1 - 1
src/main/java/com/its/utils/SysUtils.java

@@ -81,7 +81,7 @@ public final class SysUtils
 			startDateTime = fastDateFormat.parse(startTm);
 			endDateTime = fastDateFormat.parse(endTm);
 		} catch (ParseException e) {
-			e.printStackTrace();
+			log.error("gapTime: ParseException");
 			return -1;
 		}
 */

+ 1 - 1
src/test/java/com/its/op/ItsOpServerApplicationTests.java

@@ -29,7 +29,7 @@ public class ItsOpServerApplicationTests {
         try {
             Thread.sleep(2000);
         } catch (InterruptedException e) {
-            e.printStackTrace();
+            log.error("InterruptedException");
         }
         ldt = LocalDateTime.now();
         System.out.println(ldt.format(formatter) + "  Ended thread " + name);