|
@@ -83,7 +83,7 @@ public class CctvControlService {
|
|
|
return new CctvStatusDto.CctvStatusDtoRes(1, "알수없는 CCTV 관리번호 입니다.", null);
|
|
|
}
|
|
|
if (cctv.getNetState() != NET.LOGINED) {
|
|
|
- return new CctvStatusDto.CctvStatusDtoRes(2, "CCTV 통신연결이 되어 있지 않습니다.", null);
|
|
|
+ return new CctvStatusDto.CctvStatusDtoRes(2, "CCTV 제어기와 통신연결이 되어 있지 않습니다.", null);
|
|
|
}
|
|
|
|
|
|
CctvStatusDto.CctvStatusDtoRes result = new CctvStatusDto.CctvStatusDtoRes(0, "success", cctv.getStts().toDto());
|
|
@@ -103,7 +103,7 @@ public class CctvControlService {
|
|
|
return new CctvPtzControlDto.CctvPtzControlRes(req.getCommand(), req.getAction(), 1, "알수없는 CCTV 관리번호 입니다.");
|
|
|
}
|
|
|
if (cctv.getNetState() != NET.LOGINED) {
|
|
|
- return new CctvPtzControlDto.CctvPtzControlRes(req.getCommand(), req.getAction(), 2, "CCTV 통신연결이 되어 있지 않습니다.");
|
|
|
+ return new CctvPtzControlDto.CctvPtzControlRes(req.getCommand(), req.getAction(), 2, "CCTV 제어기와 통신연결이 되어 있지 않습니다.");
|
|
|
}
|
|
|
|
|
|
ControlCmd command = this.ptzControlMap.get(req.getCommand());
|
|
@@ -154,13 +154,13 @@ public class CctvControlService {
|
|
|
* @return
|
|
|
*/
|
|
|
public CctvPresetControlDto.CctvPresetControlRes controlPreset(Long id, CctvPresetControlDto.CctvPresetControlReq req) {
|
|
|
- log.info("controlPreset: {}", req);
|
|
|
+ log.info("controlPreset: {}, {}", id, req);
|
|
|
TbCctvCtlr cctv = this.requireOne(id);
|
|
|
if (cctv == null) {
|
|
|
return new CctvPresetControlDto.CctvPresetControlRes(1, "CCTV 제어기 정보를 찾을 수 없습니다.");
|
|
|
}
|
|
|
if (cctv.getNetState() != NET.LOGINED) {
|
|
|
- return new CctvPresetControlDto.CctvPresetControlRes(2, "CCTV 통신연결이 되어 있지 않습니다.");
|
|
|
+ return new CctvPresetControlDto.CctvPresetControlRes(2, "CCTV 제어기와 통신연결이 되어 있지 않습니다.");
|
|
|
}
|
|
|
|
|
|
CctvPresetControlDto.CctvPresetControlRes result = new CctvPresetControlDto.CctvPresetControlRes(0, "success");
|
|
@@ -183,13 +183,13 @@ public class CctvControlService {
|
|
|
* @return
|
|
|
*/
|
|
|
public CctvParamControlDto.CctvParamControlRes controlParam(Long id, CctvParamControlDto.CctvParamControlReq req) {
|
|
|
- log.info("controlParam: {}", id);
|
|
|
+ log.info("controlParam: {}, {}", id, req);
|
|
|
TbCctvCtlr cctv = this.requireOne(id);
|
|
|
if (cctv == null) {
|
|
|
return new CctvParamControlDto.CctvParamControlRes(1, "CCTV 제어기 정보를 찾을 수 없습니다.");
|
|
|
}
|
|
|
if (cctv.getNetState() != NET.LOGINED) {
|
|
|
- return new CctvParamControlDto.CctvParamControlRes(2, "CCTV 통신연결이 되어 있지 않습니다.");
|
|
|
+ return new CctvParamControlDto.CctvParamControlRes(2, "CCTV 제어기와 통신연결이 되어 있지 않습니다.");
|
|
|
}
|
|
|
|
|
|
CctvParamControlDto.CctvParamControlRes result = new CctvParamControlDto.CctvParamControlRes(0, "success");
|
|
@@ -217,7 +217,7 @@ public class CctvControlService {
|
|
|
return new CctvParamControlDto.CctvParamValueRes(1, "CCTV 제어기 정보를 찾을 수 없습니다.");
|
|
|
}
|
|
|
if (cctv.getNetState() != NET.LOGINED) {
|
|
|
- return new CctvParamControlDto.CctvParamValueRes(2, "CCTV 통신연결이 되어 있지 않습니다.");
|
|
|
+ return new CctvParamControlDto.CctvParamValueRes(2, "CCTV 제어기와 통신연결이 되어 있지 않습니다.");
|
|
|
}
|
|
|
|
|
|
CctvParamControlDto.CctvParamValueRes result = new CctvParamControlDto.CctvParamValueRes(0, "success");
|
|
@@ -257,7 +257,7 @@ public class CctvControlService {
|
|
|
return new CctvPresetControlDto.CctvPresetValueRes(1, "CCTV 제어기 정보를 찾을 수 없습니다.");
|
|
|
}
|
|
|
if (cctv.getNetState() != NET.LOGINED) {
|
|
|
- return new CctvPresetControlDto.CctvPresetValueRes(2, "CCTV 통신연결이 되어 있지 않습니다.");
|
|
|
+ return new CctvPresetControlDto.CctvPresetValueRes(2, "CCTV 제어기와 통신연결이 되어 있지 않습니다.");
|
|
|
}
|
|
|
|
|
|
CctvPresetControlDto.CctvPresetValueRes result = new CctvPresetControlDto.CctvPresetValueRes(0, "success");
|
|
@@ -281,7 +281,7 @@ public class CctvControlService {
|
|
|
log.error("PRESET QRY send failed.");
|
|
|
}
|
|
|
} catch (InterruptedException e) {
|
|
|
- result.setResult(9, "CCTV PRESET 값조회 명령 전송 중 오류가 발생하였습니다.");
|
|
|
+ result.setResult(6, "CCTV PRESET 값조회 명령 전송 중 오류가 발생하였습니다.");
|
|
|
}
|
|
|
}
|
|
|
return result;
|
|
@@ -299,7 +299,7 @@ public class CctvControlService {
|
|
|
return new CctvStatusDto.CctvStatusNotifyDtoRes(1, "CCTV 제어기 정보를 찾을 수 없습니다.");
|
|
|
}
|
|
|
if (cctv.getNetState() != NET.LOGINED) {
|
|
|
- return new CctvStatusDto.CctvStatusNotifyDtoRes(2, "CCTV 통신연결이 되어 있지 않습니다.");
|
|
|
+ return new CctvStatusDto.CctvStatusNotifyDtoRes(2, "CCTV 제어기와 통신연결이 되어 있지 않습니다.");
|
|
|
}
|
|
|
|
|
|
CctvStatusDto.CctvStatusNotifyDtoRes result = new CctvStatusDto.CctvStatusNotifyDtoRes(0, "success");
|
|
@@ -321,13 +321,13 @@ public class CctvControlService {
|
|
|
* @return
|
|
|
*/
|
|
|
public CctvVarCharControlDto.CctvVarCharControlRes controlVarCharSet(Long id, CctvVarCharControlDto.CctvVarCharControlSetReq req) {
|
|
|
- log.info("controlVarCharSet: {}", id);
|
|
|
+ log.info("controlVarCharSet: {}, {}", id, req);
|
|
|
TbCctvCtlr cctv = this.requireOne(id);
|
|
|
if (cctv == null) {
|
|
|
return new CctvVarCharControlDto.CctvVarCharControlRes(1, "CCTV 제어기 정보를 찾을 수 없습니다.");
|
|
|
}
|
|
|
if (cctv.getNetState() != NET.LOGINED) {
|
|
|
- return new CctvVarCharControlDto.CctvVarCharControlRes(2, "CCTV 통신연결이 되어 있지 않습니다.");
|
|
|
+ return new CctvVarCharControlDto.CctvVarCharControlRes(2, "CCTV 제어기와 통신연결이 되어 있지 않습니다.");
|
|
|
}
|
|
|
|
|
|
CctvVarCharControlDto.CctvVarCharControlRes result = new CctvVarCharControlDto.CctvVarCharControlRes(0, "success");
|
|
@@ -359,13 +359,13 @@ public class CctvControlService {
|
|
|
* @return
|
|
|
*/
|
|
|
public CctvVarCharControlDto.CctvVarCharControlRes controlVarCharDel(Long id, CctvVarCharControlDto.CctvVarCharControlDelReq req) {
|
|
|
- log.info("controlVarCharDel: {}", id);
|
|
|
+ log.info("controlVarCharDel: {}, {}", id, req);
|
|
|
TbCctvCtlr cctv = this.requireOne(id);
|
|
|
if (cctv == null) {
|
|
|
return new CctvVarCharControlDto.CctvVarCharControlRes(1, "CCTV 제어기 정보를 찾을 수 없습니다.");
|
|
|
}
|
|
|
if (cctv.getNetState() != NET.LOGINED) {
|
|
|
- return new CctvVarCharControlDto.CctvVarCharControlRes(2, "CCTV 통신연결이 되어 있지 않습니다.");
|
|
|
+ return new CctvVarCharControlDto.CctvVarCharControlRes(2, "CCTV 제어기와 통신연결이 되어 있지 않습니다.");
|
|
|
}
|
|
|
|
|
|
CctvVarCharControlDto.CctvVarCharControlRes result = new CctvVarCharControlDto.CctvVarCharControlRes(0, "success");
|
|
@@ -382,4 +382,33 @@ public class CctvControlService {
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+ public CctvControlDto.CctvControlResetRes controlReset(Long id, CctvControlDto.CctvControlResetReq req) {
|
|
|
+ log.info("controlReset: {}, {}", id, req);
|
|
|
+ TbCctvCtlr cctv = this.requireOne(id);
|
|
|
+ if (cctv == null) {
|
|
|
+ return new CctvControlDto.CctvControlResetRes(1, "CCTV 제어기 정보를 찾을 수 없습니다.");
|
|
|
+ }
|
|
|
+ if (cctv.getNetState() != NET.LOGINED) {
|
|
|
+ return new CctvControlDto.CctvControlResetRes(2, "CCTV 제어기와 통신연결이 되어 있지 않습니다.");
|
|
|
+ }
|
|
|
+
|
|
|
+ CctvControlDto.CctvControlResetRes result = new CctvControlDto.CctvControlResetRes(0, "success");
|
|
|
+ if (0 == req.getResetType()) {
|
|
|
+ // SW Reset
|
|
|
+ if (!cctv.resetSw()) {
|
|
|
+ result.setResult(4, "CCTV 제어기 SW 리셋 명령 전송에 실패하였습니다.");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if (1 == req.getResetType()) {
|
|
|
+ // HW Reset
|
|
|
+ if (!cctv.resetHw()) {
|
|
|
+ result.setResult(5, "CCTV 제어기 HW 리셋 명령 전송에 실패하였습니다.");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ result.setResult(3, "CCTV 리셋 정보가 잘못 되었습니다.");
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
}
|