에이젼트 결과 확인 게시판 추가

This commit is contained in:
hehihoho3@gmail.com 2024-09-23 17:51:48 +09:00
parent c23a198243
commit 608c66475d
43 changed files with 1375 additions and 263 deletions

View File

@ -56,8 +56,18 @@ public abstract class AbstractAgentService<T, M> implements AgentService<T> {
int count = this.countAllLogMoveCnt(agentVO);
return new RestResponse(HttpStatus.OK, "", count);
}
public RestResponse findByRequestDateWhereMessageFromLog(T agentVO) {
String count = this.findByRequestDateWhereMessageFromLogFn(agentVO);
return new RestResponse(HttpStatus.OK, "", count);
}
public RestResponse findByReportLog(T agentVO) {
return new RestResponse(HttpStatus.OK, "", this.findByReportLogFn(agentVO));
}
protected abstract T findByReportLogFn(T agentVO);
protected abstract int countAllLogMoveCnt(T agentVO);
protected abstract String findByRequestDateWhereMessageFromLogFn(T agentVO);
protected abstract int countByLogMoveCntWhereMsgTypeAndMessage(T agentVO);

View File

@ -0,0 +1,45 @@
package com.itn.admin.agent.client.five.mapper;
import com.itn.admin.agent.client.five.mapper.domain.AgentCFiveVO;
import com.itn.admin.agent.client.one.mapper.domain.AgentCOneVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
/**
* packageName : com.itn.admin.agent.client.three.mapper
* fileName : AgentCThreeMapper
* author : hylee
* date : 2024-09-20
* description :
* ===========================================================
* DATE AUTHOR NOTE
* -----------------------------$------------------------------
* 2024-09-20 hylee 최초 생성
*/
@Mapper
public interface AgentCFiveMapper {
@Select(
"SELECT count(*) " +
"FROM MUNJAON_MSG " +
"WHERE MESSAGE LIKE CONCAT(#{message}, '%') "
)
int findByInsertCnt(AgentCFiveVO agentCFiveVO);
@Select("SELECT min(REQUEST_DATE) as requestDate " +
"FROM MUNJAON_MSG_LOG " +
"WHERE MESSAGE LIKE CONCAT(#{message}, '%')")
String findByRequestDateWhereMessageFromLog(AgentCFiveVO agentCFiveVO);
@Select("""
SELECT
COUNT(*) AS reportCnt, -- ' 카운트',
MIN(REPORT_DATE) AS minReportDate, -- '가장 빠른 REPORT_DATE',
MAX(REPORT_DATE) AS maxReportDate -- '가장 늦은 REPORT_DATE'
FROM
MUNJAON_MSG_LOG
WHERE
MESSAGE LIKE CONCAT(#{message}, '%')
""")
AgentCFiveVO findByReportLog(AgentCFiveVO agentCFiveVO);
}

View File

@ -0,0 +1,58 @@
package com.itn.admin.agent.client.five.mapper.domain;
import lombok.*;
import java.io.Serializable;
/**
* packageName : com.itn.admin.agent.client.three.mapper.domain
* fileName : AgentCThreeVO
* author : hylee
* date : 2024-07-31
* description : 에이젼트 테스트발송
* ===========================================================
* DATE AUTHOR NOTE
* -----------------------------------------------------------
* 2023-05-09 hylee 최초 생성
*/
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Getter
@Setter
@ToString
public class AgentCFiveVO implements Serializable {
private static final long serialVersionUID = 1L;
private int msgId; // int unsigned
private String msgType;
private String sendStatus;
private String requestSate;
private String recvPhone;
private String sendPhone;
private String subject;
private String message;
private String sendCnt;
private String fileName01;
private String fileName02;
private String fileName03;
private String requestDate; // datetime
private String telecom; // varchar(7)
private String agentCode; // varchar(5)
private String kakaoSenderKey; // varchar(40)
private String kakaoTemplateCode; // varchar(64)
private String kakaoJsonFile; // varchar(100)
private String deliverDate; // datetime
private String sentDate; // datetime
private String reportDate; // datetime
private String cnt;
private String reportCnt;
private String minReportDate;
private String maxReportDate;
}

View File

@ -0,0 +1,13 @@
package com.itn.admin.agent.client.five.service;
import com.itn.admin.agent.client.five.mapper.domain.AgentCFiveVO;
import com.itn.admin.cmn.msg.RestResponse;
public interface AgentCFiveService {
RestResponse findByInsertCnt(AgentCFiveVO agentCFiveVO);
RestResponse findByRequestDateWhereMessageFromLog(AgentCFiveVO agentCFiveVO);
RestResponse findByReportLog(AgentCFiveVO agentCFiveVO);
}

View File

@ -0,0 +1,37 @@
package com.itn.admin.agent.client.five.service.impl;
import com.itn.admin.agent.client.five.mapper.AgentCFiveMapper;
import com.itn.admin.agent.client.five.mapper.domain.AgentCFiveVO;
import com.itn.admin.agent.client.five.service.AgentCFiveService;
import com.itn.admin.cmn.msg.RestResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Service;
@Slf4j
@Service
public class AgentCFiveServiceImpl implements AgentCFiveService {
@Autowired
AgentCFiveMapper agentCFiveMapper;
@Override
public RestResponse findByInsertCnt(AgentCFiveVO agentCFiveVO) {
int cnt = agentCFiveMapper.findByInsertCnt(agentCFiveVO);
return new RestResponse(HttpStatus.OK,"", cnt);
}
@Override
public RestResponse findByRequestDateWhereMessageFromLog(AgentCFiveVO agentCFiveVO) {
String cnt = agentCFiveMapper.findByRequestDateWhereMessageFromLog(agentCFiveVO);
return new RestResponse(HttpStatus.OK,"", cnt);
}
@Override
public RestResponse findByReportLog(AgentCFiveVO agentCFiveVO) {
return new RestResponse(HttpStatus.OK,"", agentCFiveMapper.findByReportLog(agentCFiveVO));
}
}

View File

@ -0,0 +1,58 @@
package com.itn.admin.agent.client.five.web;
import com.itn.admin.agent.client.five.mapper.domain.AgentCFiveVO;
import com.itn.admin.agent.client.five.service.AgentCFiveService;
import com.itn.admin.agent.client.four.mapper.domain.AgentCFourVO;
import com.itn.admin.cmn.msg.RestResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class AgentCFiveRestController {
private AgentCFiveService agentCFiveService;
private final String UPLOAD_DIR = "/home/mjon_client_agent_2/mmsfile";
@Autowired
public void setAgentService(AgentCFiveService agentCFiveService) {
this.agentCFiveService = agentCFiveService;
}
/*
* client db에 insert 됐는지 확인 count
* */
@GetMapping("/agent/five/findByInsertCnt")
public ResponseEntity<RestResponse> findByInsertCnt(@RequestParam String message) throws Exception {
AgentCFiveVO agentCFiveVO = new AgentCFiveVO();
agentCFiveVO.setMessage(message);
return ResponseEntity.ok().body(agentCFiveService.findByInsertCnt(agentCFiveVO));
}
/*
* client db에 최초 insert된 시간
* */
@GetMapping("/agent/five/findByRequestDateWhereMessageFromLog")
public ResponseEntity<RestResponse> findByRequestDateWhereMessageFromLog(@RequestParam String message) throws Exception {
AgentCFiveVO agentCFiveVO = new AgentCFiveVO();
agentCFiveVO.setMessage(message);
return ResponseEntity.ok().body(agentCFiveService.findByRequestDateWhereMessageFromLog(agentCFiveVO));
}
/*
* client db에 report한 시간
* */
@GetMapping("/agent/five/findByReportLog")
public ResponseEntity<RestResponse> findByReportLog(@RequestParam String message) throws Exception {
AgentCFiveVO agentCFiveVO = new AgentCFiveVO();
agentCFiveVO.setMessage(message);
return ResponseEntity.ok().body(agentCFiveService.findByReportLog(agentCFiveVO));
}
}

View File

@ -0,0 +1,45 @@
package com.itn.admin.agent.client.four.mapper;
import com.itn.admin.agent.client.four.mapper.domain.AgentCFourVO;
import com.itn.admin.agent.client.one.mapper.domain.AgentCOneVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
/**
* packageName : com.itn.admin.agent.client.three.mapper
* fileName : AgentCThreeMapper
* author : hylee
* date : 2024-09-20
* description :
* ===========================================================
* DATE AUTHOR NOTE
* -----------------------------$------------------------------
* 2024-09-20 hylee 최초 생성
*/
@Mapper
public interface AgentCFourMapper {
@Select(
"SELECT count(*) " +
"FROM MUNJAON_MSG " +
"WHERE MESSAGE LIKE CONCAT(#{message}, '%') "
)
int findByInsertCnt(AgentCFourVO agentCFourVO);
@Select("SELECT min(REQUEST_DATE) as requestDate " +
"FROM MUNJAON_MSG_LOG " +
"WHERE MESSAGE LIKE CONCAT(#{message}, '%')")
String findByRequestDateWhereMessageFromLog(AgentCFourVO agentCFourVO);
@Select("""
SELECT
COUNT(*) AS reportCnt, -- ' 카운트',
MIN(REPORT_DATE) AS minReportDate, -- '가장 빠른 REPORT_DATE',
MAX(REPORT_DATE) AS maxReportDate -- '가장 늦은 REPORT_DATE'
FROM
MUNJAON_MSG_LOG
WHERE
MESSAGE LIKE CONCAT(#{message}, '%')
""")
AgentCFourVO findByReportLog(AgentCFourVO agentCFourVO);
}

View File

@ -0,0 +1,58 @@
package com.itn.admin.agent.client.four.mapper.domain;
import lombok.*;
import java.io.Serializable;
/**
* packageName : com.itn.admin.agent.client.three.mapper.domain
* fileName : AgentCThreeVO
* author : hylee
* date : 2024-07-31
* description : 에이젼트 테스트발송
* ===========================================================
* DATE AUTHOR NOTE
* -----------------------------------------------------------
* 2023-05-09 hylee 최초 생성
*/
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Getter
@Setter
@ToString
public class AgentCFourVO implements Serializable {
private static final long serialVersionUID = 1L;
private int msgId; // int unsigned
private String msgType;
private String sendStatus;
private String requestSate;
private String recvPhone;
private String sendPhone;
private String subject;
private String message;
private String sendCnt;
private String fileName01;
private String fileName02;
private String fileName03;
private String requestDate; // datetime
private String telecom; // varchar(7)
private String agentCode; // varchar(5)
private String kakaoSenderKey; // varchar(40)
private String kakaoTemplateCode; // varchar(64)
private String kakaoJsonFile; // varchar(100)
private String deliverDate; // datetime
private String sentDate; // datetime
private String reportDate; // datetime
private String cnt;
private String reportCnt;
private String minReportDate;
private String maxReportDate;
}

View File

@ -0,0 +1,13 @@
package com.itn.admin.agent.client.four.service;
import com.itn.admin.agent.client.four.mapper.domain.AgentCFourVO;
import com.itn.admin.cmn.msg.RestResponse;
public interface AgentCFourService {
RestResponse findByInsertCnt(AgentCFourVO agentCFourVO);
RestResponse findByRequestDateWhereMessageFromLog(AgentCFourVO agentCFourVO);
RestResponse findByReportLog(AgentCFourVO agentCFourVO);
}

View File

@ -0,0 +1,37 @@
package com.itn.admin.agent.client.four.service.impl;
import com.itn.admin.agent.client.four.mapper.AgentCFourMapper;
import com.itn.admin.agent.client.four.mapper.domain.AgentCFourVO;
import com.itn.admin.agent.client.four.service.AgentCFourService;
import com.itn.admin.cmn.msg.RestResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Service;
@Slf4j
@Service
public class AgentCFourServiceImpl implements AgentCFourService {
@Autowired
AgentCFourMapper agentCFourMapper;
@Override
public RestResponse findByInsertCnt(AgentCFourVO agentCFourVO) {
int cnt = agentCFourMapper.findByInsertCnt(agentCFourVO);
return new RestResponse(HttpStatus.OK,"", cnt);
}
@Override
public RestResponse findByRequestDateWhereMessageFromLog(AgentCFourVO agentCFourVO) {
String cnt = agentCFourMapper.findByRequestDateWhereMessageFromLog(agentCFourVO);
return new RestResponse(HttpStatus.OK,"", cnt);
}
@Override
public RestResponse findByReportLog(AgentCFourVO agentCFourVO) {
return new RestResponse(HttpStatus.OK,"", agentCFourMapper.findByReportLog(agentCFourVO));
}
}

View File

@ -0,0 +1,58 @@
package com.itn.admin.agent.client.four.web;
import com.itn.admin.agent.client.four.mapper.domain.AgentCFourVO;
import com.itn.admin.agent.client.four.service.AgentCFourService;
import com.itn.admin.agent.client.three.mapper.domain.AgentCThreeVO;
import com.itn.admin.cmn.msg.RestResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class AgentCFourRestController {
private AgentCFourService agentCFourService;
private final String UPLOAD_DIR = "/home/mjon_client_agent_2/mmsfile";
@Autowired
public void setAgentService(AgentCFourService agentCFourService) {
this.agentCFourService = agentCFourService;
}
/*
* client db에 insert 됐는지 확인 count
* */
@GetMapping("/agent/four/findByInsertCnt")
public ResponseEntity<RestResponse> findByInsertCnt(@RequestParam String message) throws Exception {
AgentCFourVO agentCFourVO = new AgentCFourVO();
agentCFourVO.setMessage(message);
return ResponseEntity.ok().body(agentCFourService.findByInsertCnt(agentCFourVO));
}
/*
* client db에 최초 insert된 시간
* */
@GetMapping("/agent/four/findByRequestDateWhereMessageFromLog")
public ResponseEntity<RestResponse> findByRequestDateWhereMessageFromLog(@RequestParam String message) throws Exception {
AgentCFourVO agentCFourVO = new AgentCFourVO();
agentCFourVO.setMessage(message);
return ResponseEntity.ok().body(agentCFourService.findByRequestDateWhereMessageFromLog(agentCFourVO));
}
/*
* client db에 report한 시간
* */
@GetMapping("/agent/four/findByReportLog")
public ResponseEntity<RestResponse> findByReportLog(@RequestParam String message) throws Exception {
AgentCFourVO agentCFourVO = new AgentCFourVO();
agentCFourVO.setMessage(message);
return ResponseEntity.ok().body(agentCFourService.findByReportLog(agentCFourVO));
}
}

View File

@ -2,6 +2,7 @@ package com.itn.admin.agent.client.one.mapper;
import com.itn.admin.agent.client.one.mapper.domain.AgentCOneVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.List;
@ -28,4 +29,22 @@ public interface AgentCOneMapper {
int countByLogMoveCntWhereMsgTypeAndMessage(AgentCOneVO agentVO);
int findAllLogMoveCnt(AgentCOneVO agentVO);
@Select("SELECT min(REQUEST_DATE) as requestDate " +
"FROM MUNJAON_MSG_LOG " +
"WHERE MESSAGE LIKE CONCAT(#{message}, '%')")
String findByRequestDateWhereMessageFromLogFn(AgentCOneVO agentVO);
@Select("""
SELECT
COUNT(*) AS reportCnt, -- ' 카운트',
MIN(REPORT_DATE) AS minReportDate, -- '가장 빠른 REPORT_DATE',
MAX(REPORT_DATE) AS maxReportDate -- '가장 늦은 REPORT_DATE'
FROM
MUNJAON_MSG_LOG
WHERE
MESSAGE LIKE CONCAT(#{message}, '%')
""")
AgentCOneVO findByReportLogFn(AgentCOneVO agentVO);
}

View File

@ -35,6 +35,12 @@ public class AgentCOneVO implements Serializable {
private String fileName01;
private String fileName02;
private String fileName03;
private String requestDate;
private String reportCnt;
private String minReportDate;
private String maxReportDate;
private String cnt;

View File

@ -16,5 +16,9 @@ public interface AgentCOneService {
RestResponse findAllLogMoveCnt(AgentCOneVO agentCOneVO);
RestResponse findByRequestDateWhereMessageFromLog(AgentCOneVO agentCOneVO);
RestResponse findByReportLog(AgentCOneVO agentCOneVO);
// RestResponse findByReportCnt(AgentCTwoVO agentCTwoVO);
}

View File

@ -25,11 +25,20 @@ public class AgentCOneServiceImpl extends AbstractAgentService<AgentCOneVO, Agen
this.mapper = agentCOneMapper;
}
@Override
protected AgentCOneVO findByReportLogFn(AgentCOneVO agentVO) {
return mapper.findByReportLogFn(agentVO);
}
@Override
protected int countAllLogMoveCnt(AgentCOneVO agentVO) {
return mapper.findAllLogMoveCnt(agentVO);
}
protected String findByRequestDateWhereMessageFromLogFn(AgentCOneVO agentVO) {
return mapper.findByRequestDateWhereMessageFromLogFn(agentVO);
}
@Override
protected int countByLogMoveCntWhereMsgTypeAndMessage(AgentCOneVO agentVO) {
return mapper.countByLogMoveCntWhereMsgTypeAndMessage(agentVO);

View File

@ -2,15 +2,13 @@ package com.itn.admin.agent.client.one.web;
import com.itn.admin.agent.client.one.mapper.domain.AgentCOneVO;
import com.itn.admin.agent.client.one.service.AgentCOneService;
import com.itn.admin.agent.client.three.mapper.domain.AgentCThreeVO;
import com.itn.admin.cmn.msg.RestResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
@ -50,6 +48,13 @@ public class AgentCOneRestController {
return ResponseEntity.ok().body(agentCOneService.findByInsertCnt(agentCOneVO));
}
@GetMapping("/agent/one/findByInsertCnt")
public ResponseEntity<RestResponse> findByInsertCntGet(@RequestParam String message) throws Exception {
AgentCOneVO agentCOneVO = new AgentCOneVO();
agentCOneVO.setMessage(message);
return ResponseEntity.ok().body(agentCOneService.findByInsertCnt(agentCOneVO));
}
/*
* client LOG TB에 insert 됐는지 확인 count
* 리포트할때 ''현재'' 데이터가 LOG 테이블에 이동됐는지 확인
@ -105,6 +110,27 @@ public class AgentCOneRestController {
}
}
/*
* client db에 최초 insert된 시간
* */
@GetMapping("/agent/one/findByRequestDateWhereMessageFromLog")
public ResponseEntity<RestResponse> findByRequestDateWhereMessageFromLog(@RequestParam String message) throws Exception {
AgentCOneVO agentCOneVO = new AgentCOneVO();
agentCOneVO.setMessage(message);
return ResponseEntity.ok().body(agentCOneService.findByRequestDateWhereMessageFromLog(agentCOneVO));
}
/*
* client db에 report한 시간
* */
@GetMapping("/agent/one/findByReportLog")
public ResponseEntity<RestResponse> findByReportLog(@RequestParam String message) throws Exception {
AgentCOneVO agentCOneVO = new AgentCOneVO();
agentCOneVO.setMessage(message);
return ResponseEntity.ok().body(agentCOneService.findByReportLog(agentCOneVO));
}
private String uploadSingleFile(MultipartFile file) throws IOException {
String fileName = StringUtils.cleanPath(file.getOriginalFilename());
Path uploadPath = Paths.get(UPLOAD_DIR);

View File

@ -0,0 +1,45 @@
package com.itn.admin.agent.client.three.mapper;
import com.itn.admin.agent.client.three.mapper.domain.AgentCThreeVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
/**
* packageName : com.itn.admin.agent.client.three.mapper
* fileName : AgentCThreeMapper
* author : hylee
* date : 2024-09-20
* description :
* ===========================================================
* DATE AUTHOR NOTE
* -----------------------------$------------------------------
* 2024-09-20 hylee 최초 생성
*/
@Mapper
public interface AgentCThreeMapper {
@Select(
"SELECT count(*) " +
"FROM MUNJAON_MSG " +
"WHERE MESSAGE LIKE CONCAT(#{message}, '%') "
)
int findByInsertCnt(AgentCThreeVO agentCFourVO);
@Select("SELECT min(REQUEST_DATE) as requestDate " +
"FROM MUNJAON_MSG_LOG " +
"WHERE MESSAGE LIKE CONCAT(#{message}, '%')")
String findByRequestDateWhereMessageFromLog(AgentCThreeVO agentCFourVO);
@Select("""
SELECT
COUNT(*) AS reportCnt, -- ' 카운트',
MIN(REPORT_DATE) AS minReportDate, -- '가장 빠른 REPORT_DATE',
MAX(REPORT_DATE) AS maxReportDate -- '가장 늦은 REPORT_DATE'
FROM
MUNJAON_MSG_LOG
WHERE
MESSAGE LIKE CONCAT(#{message}, '%')
""")
AgentCThreeVO findByReportLog(AgentCThreeVO agentCThreeVO);
}

View File

@ -0,0 +1,58 @@
package com.itn.admin.agent.client.three.mapper.domain;
import lombok.*;
import java.io.Serializable;
/**
* packageName : com.itn.admin.agent.client.three.mapper.domain
* fileName : AgentCThreeVO
* author : hylee
* date : 2024-07-31
* description : 에이젼트 테스트발송
* ===========================================================
* DATE AUTHOR NOTE
* -----------------------------------------------------------
* 2023-05-09 hylee 최초 생성
*/
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Getter
@Setter
@ToString
public class AgentCThreeVO implements Serializable {
private static final long serialVersionUID = 1L;
private int msgId; // int unsigned
private String msgType;
private String sendStatus;
private String requestSate;
private String recvPhone;
private String sendPhone;
private String subject;
private String message;
private String sendCnt;
private String fileName01;
private String fileName02;
private String fileName03;
private String requestDate; // datetime
private String telecom; // varchar(7)
private String agentCode; // varchar(5)
private String kakaoSenderKey; // varchar(40)
private String kakaoTemplateCode; // varchar(64)
private String kakaoJsonFile; // varchar(100)
private String deliverDate; // datetime
private String sentDate; // datetime
private String reportDate; // datetime
private String cnt;
private String reportCnt;
private String minReportDate;
private String maxReportDate;
}

View File

@ -0,0 +1,13 @@
package com.itn.admin.agent.client.three.service;
import com.itn.admin.agent.client.three.mapper.domain.AgentCThreeVO;
import com.itn.admin.cmn.msg.RestResponse;
public interface AgentCThreeService {
RestResponse findByInsertCnt(AgentCThreeVO agentCFourVO);
RestResponse findByRequestDateWhereMessageFromLog(AgentCThreeVO agentCFourVO);
RestResponse findByReportLog(AgentCThreeVO agentCThreeVO);
}

View File

@ -0,0 +1,38 @@
package com.itn.admin.agent.client.three.service.impl;
import com.itn.admin.agent.client.three.mapper.AgentCThreeMapper;
import com.itn.admin.agent.client.three.mapper.domain.AgentCThreeVO;
import com.itn.admin.agent.client.three.service.AgentCThreeService;
import com.itn.admin.cmn.msg.RestResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Service;
@Slf4j
@Service
public class AgentCThreeServiceImpl implements AgentCThreeService {
@Autowired
AgentCThreeMapper agentCThreeMapper;
@Override
public RestResponse findByInsertCnt(AgentCThreeVO agentCThreeVO) {
int cnt = agentCThreeMapper.findByInsertCnt(agentCThreeVO);
return new RestResponse(HttpStatus.OK,"", cnt);
}
@Override
public RestResponse findByRequestDateWhereMessageFromLog(AgentCThreeVO agentCThreeVO) {
String requestDateText = agentCThreeMapper.findByRequestDateWhereMessageFromLog(agentCThreeVO);
return new RestResponse(HttpStatus.OK,"", requestDateText);
}
@Override
public RestResponse findByReportLog(AgentCThreeVO agentCThreeVO) {
return new RestResponse(HttpStatus.OK,"", agentCThreeMapper.findByReportLog(agentCThreeVO));
}
}

View File

@ -0,0 +1,56 @@
package com.itn.admin.agent.client.three.web;
import com.itn.admin.agent.client.one.mapper.domain.AgentCOneVO;
import com.itn.admin.agent.client.three.mapper.domain.AgentCThreeVO;
import com.itn.admin.agent.client.three.service.AgentCThreeService;
import com.itn.admin.cmn.msg.RestResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.GetMapping;
@RestController
public class AgentCThreeRestController {
private AgentCThreeService agentCThreeService;
private final String UPLOAD_DIR = "/home/mjon_client_agent_2/mmsfile";
@Autowired
public void setAgentService(AgentCThreeService agentCThreeService) {
this.agentCThreeService = agentCThreeService;
}
/*
* client db에 insert 됐는지 확인 count
* */
@GetMapping("/agent/three/findByInsertCnt")
public ResponseEntity<RestResponse> findByInsertCnt(@RequestParam String message) throws Exception {
AgentCThreeVO agentCThreeVO = new AgentCThreeVO();
agentCThreeVO.setMessage(message);
return ResponseEntity.ok().body(agentCThreeService.findByInsertCnt(agentCThreeVO));
}
/*
* client db에 최초 insert된 시간
* */
@GetMapping("/agent/three/findByRequestDateWhereMessageFromLog")
public ResponseEntity<RestResponse> findByRequestDateWhereMessageFromLog(@RequestParam String message) throws Exception {
AgentCThreeVO agentCThreeVO = new AgentCThreeVO();
agentCThreeVO.setMessage(message);
return ResponseEntity.ok().body(agentCThreeService.findByRequestDateWhereMessageFromLog(agentCThreeVO));
}
/*
* client db에 report한 시간
* */
@GetMapping("/agent/three/findByReportLog")
public ResponseEntity<RestResponse> findByReportLog(@RequestParam String message) throws Exception {
AgentCThreeVO agentCThreeVO = new AgentCThreeVO();
agentCThreeVO.setMessage(message);
return ResponseEntity.ok().body(agentCThreeService.findByReportLog(agentCThreeVO));
}
}

View File

@ -2,6 +2,7 @@ package com.itn.admin.agent.client.two.mapper;
import com.itn.admin.agent.client.two.mapper.domain.AgentCTwoVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.List;
@ -28,4 +29,22 @@ public interface AgentCTwoMapper {
int countByLogMoveCntWhereMsgTypeAndMessage(AgentCTwoVO agentVO);
int findAllLogMoveCnt(AgentCTwoVO agentVO);
@Select("SELECT min(REQUEST_DATE) as requestDate " +
"FROM MUNJAON_MSG_LOG " +
"WHERE MESSAGE LIKE CONCAT(#{message}, '%')")
String findByRequestDateWhereMessageFromLogFn(AgentCTwoVO agentVO);
@Select("""
SELECT
COUNT(*) AS reportCnt, -- ' 카운트',
MIN(REPORT_DATE) AS minReportDate, -- '가장 빠른 REPORT_DATE',
MAX(REPORT_DATE) AS maxReportDate -- '가장 늦은 REPORT_DATE'
FROM
MUNJAON_MSG_LOG
WHERE
MESSAGE LIKE CONCAT(#{message}, '%')
""")
AgentCTwoVO findByReportLogFn(AgentCTwoVO agentVO);
}

View File

@ -35,8 +35,12 @@ public class AgentCTwoVO implements Serializable {
private String fileName01;
private String fileName02;
private String fileName03;
private String requestDate;
private String cnt;
private String reportCnt;
private String minReportDate;
private String maxReportDate;
}

View File

@ -15,4 +15,8 @@ public interface AgentCTwoService {
RestResponse findByLogMoveCntWhereMessage(AgentCTwoVO agentCTwoVO);
RestResponse findAllLogMoveCnt(AgentCTwoVO agentCTwoVO);
RestResponse findByRequestDateWhereMessageFromLog(AgentCTwoVO agentCTwoVO);
RestResponse findByReportLog(AgentCTwoVO agentCtwoVO);
}

View File

@ -1,6 +1,7 @@
package com.itn.admin.agent.client.two.service.impl;
import com.itn.admin.agent.client.cmm.service.AbstractAgentService;
import com.itn.admin.agent.client.one.mapper.domain.AgentCOneVO;
import com.itn.admin.agent.client.two.mapper.domain.AgentCTwoVO;
import com.itn.admin.agent.client.two.mapper.AgentCTwoMapper;
import com.itn.admin.agent.client.two.service.AgentCTwoService;
@ -25,16 +26,28 @@ public class AgentCTwoServiceImpl extends AbstractAgentService<AgentCTwoVO, Agen
this.mapper = agentCTwoMapper;
}
@Override
protected int countByLogMoveCntWhereMsgTypeAndMessage(AgentCTwoVO agentVO) {
return mapper.countByLogMoveCntWhereMsgTypeAndMessage(agentVO);
// return mapper.countByLogMoveCntWhereMsgTypeAndMessage(agentVO);
}
@Override
protected AgentCTwoVO findByReportLogFn(AgentCTwoVO agentVO) {
return mapper.findByReportLogFn(agentVO);
}
@Override
protected int countAllLogMoveCnt(AgentCTwoVO agentVO) {
return mapper.findAllLogMoveCnt(agentVO);
}
@Override
protected String findByRequestDateWhereMessageFromLogFn(AgentCTwoVO agentVO) {
return mapper.findByRequestDateWhereMessageFromLogFn(agentVO);
}
@Override
protected int countByCondition(AgentCTwoVO agentVO) {
return mapper.countBySendStatusNotAndMsgType(agentVO);

View File

@ -35,5 +35,14 @@ public class AgentCTwoController {
return "agent/view";
}
@GetMapping(value = "/agent/result")
public String result(@ModelAttribute("agentVO") AgentCTwoVO agentCTwoVO, Model model) {
model.addAttribute("oneUserId", ONE_USER_ID);
model.addAttribute("twoUserId", TOW_USER_ID);
return "agent/result";
}
}

View File

@ -1,5 +1,7 @@
package com.itn.admin.agent.client.two.web;
import com.itn.admin.agent.client.one.mapper.domain.AgentCOneVO;
import com.itn.admin.agent.client.three.mapper.domain.AgentCThreeVO;
import com.itn.admin.agent.client.two.mapper.domain.AgentCTwoVO;
import com.itn.admin.agent.client.two.service.AgentCTwoService;
import com.itn.admin.cmn.msg.RestResponse;
@ -46,11 +48,21 @@ public class AgentCTwoRestController {
* client db에 insert 됐는지 확인 count
* */
@PostMapping("/agent/two/findByInsertCnt")
public ResponseEntity<RestResponse> findByInsertCnt(@RequestBody AgentCTwoVO agentCTwoVO) throws Exception {
System.out.println(" :: /agent/two/findByInsertCnt :: ");
public ResponseEntity<RestResponse> findByInsertCnt(@RequestParam String message) throws Exception {
AgentCTwoVO agentCTwoVO = new AgentCTwoVO();
agentCTwoVO.setMessage(message);
return ResponseEntity.ok().body(agentCTwoService.findByInsertCnt(agentCTwoVO));
}
/*
* client db에 최초 insert된 시간
* */
@GetMapping("/agent/two/findByRequestDateWhereMessageFromLog")
public ResponseEntity<RestResponse> findByRequestDateWhereMessageFromLog(@RequestParam String message) throws Exception {
AgentCTwoVO agentCTwoVO = new AgentCTwoVO();
agentCTwoVO.setMessage(message);
return ResponseEntity.ok().body(agentCTwoService.findByRequestDateWhereMessageFromLog(agentCTwoVO));
}
/*
* client LOG TB에 insert 됐는지 확인 count
* 리포트할때 ''현재'' 데이터가 LOG 테이블에 이동됐는지 확인
@ -114,4 +126,17 @@ public class AgentCTwoRestController {
return fileName;
}
/*
* client db에 report한 시간
* */
@GetMapping("/agent/two/findByReportLog")
public ResponseEntity<RestResponse> findByReportLog(@RequestParam String message) throws Exception {
AgentCTwoVO agentCtwoVO = new AgentCTwoVO();
agentCtwoVO.setMessage(message);
return ResponseEntity.ok().body(agentCTwoService.findByReportLog(agentCtwoVO));
}
}

View File

@ -2,6 +2,9 @@ package com.itn.admin.agent.server.mapper;
import com.itn.admin.agent.server.mapper.domain.AgentSVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.List;
/**
* packageName : com.itn.admin.agent.mapper
@ -23,4 +26,25 @@ public interface AgentSMapper {
String findByCurStateAndUserIdAndSmsTxt(AgentSVO agentSVO);
int updateReportWhereUserIdAndMassage(AgentSVO agentSVO);
@Select("""
SELECT
USER_ID,
MIN(REQ_DATE) AS minReqDate, -- 이관시작시간
MAX(REQ_DATE) AS maxReqDate, -- 이관종료시간
MIN(RESULT_LOG_UPDT_PNTTM) AS minResultLogUpdtPnttm, -- 전송사시작시간
MAX(RESULT_LOG_UPDT_PNTTM) AS maxResultLogUpdtPnttm, -- 전송사종료시간
COUNT(REQ_DATE) AS cnt, -- 갯수
COUNT(CASE WHEN RESULT_LOG_UPDT_PNTTM IS NULL THEN 1 END) AS resultNull -- 전송사_report_안된_갯수
FROM
mj_msg_data
WHERE
USER_ID IN ('006star', 'daltex', 'hylee250', 'dlwnsgh', 'dlwldn')
AND SMS_TXT LIKE CONCAT(#{message}, '%')
GROUP BY
USER_ID
ORDER BY
FIELD(USER_ID, 'daltex', '006star', 'hylee250', 'dlwnsgh', 'dlwldn')
""")
List<AgentSVO> findByCompanyLogAndSTransfer(AgentSVO agentSVO);
}

View File

@ -87,5 +87,15 @@ public class AgentSVO implements Serializable {
private String sendPhone;
private String sendCnt;
private String minReqDate; // 이관시작시간
private String maxReqDate; // 이관종료시간
private String minResultLogUpdtPnttm; // 전송사시작시간
private String maxResultLogUpdtPnttm; // 전송사종료시간
private String cnt; // 갯수
private String resultNull; // 전송사_report_안된_갯수
}

View File

@ -12,4 +12,6 @@ public interface AgentSService {
RestResponse serverReport(AgentSVO agentSVO);
RestResponse nowDataReport(AgentSVO agentSVO);
RestResponse findByCompanyLogAndSTransfer(AgentSVO agentSVO);
}

View File

@ -10,6 +10,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Service;
import java.util.List;
@Slf4j
@Service
@ -48,4 +50,10 @@ public class AgentSServiceImpl implements AgentSService {
return new RestResponse(HttpStatus.OK,msg, cnt);
}
@Override
public RestResponse findByCompanyLogAndSTransfer(AgentSVO agentSVO) {
List<AgentSVO> resultVo = agentSMapper.findByCompanyLogAndSTransfer(agentSVO);
return new RestResponse(HttpStatus.OK, "", resultVo);
}
}

View File

@ -5,9 +5,7 @@ import com.itn.admin.agent.server.service.AgentSService;
import com.itn.admin.cmn.msg.RestResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
@RestController
public class AgentSRestController {
@ -46,4 +44,18 @@ public class AgentSRestController {
public ResponseEntity<RestResponse> serverNowDataReport(@RequestBody AgentSVO agentSVO) throws Exception {
return ResponseEntity.ok().body(agentSService.nowDataReport(agentSVO));
}
/*
* 전송사가 리턴해준것처럼
* server DB에 update
* @@ 현재 화면 기준 data만 없뎃
* */
@GetMapping("/agent/server/findByCompanyLogAndSTransfer")
public ResponseEntity<RestResponse> findByCompanyLogAndSTransfer(@RequestParam String message) throws Exception {
AgentSVO agentSVO = new AgentSVO();
agentSVO.setMessage(message);
return ResponseEntity.ok().body(agentSService.findByCompanyLogAndSTransfer(agentSVO));
}
}

View File

@ -0,0 +1,47 @@
package com.itn.admin.cmn.config;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.SqlSessionFactoryBean;
import org.mybatis.spring.SqlSessionTemplate;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import javax.sql.DataSource;
@Configuration
@MapperScan(value = "com.itn.admin.agent.client.five.mapper", sqlSessionFactoryRef = "factory8")
class MjonAgentCFiveDatabaseConfig {
private final String COMMUTE_DATA_SOURCE = "MjagentClienFiveDatabase";
// A database DataSource
@Bean(COMMUTE_DATA_SOURCE)
@ConfigurationProperties(prefix = "spring.mjagent.client.five.datasource")
public DataSource CommuteDataSource() {
return DataSourceBuilder.create()
// .type(HikariDataSource.class)
.build();
}
// SqlSessionTemplate 에서 사용할 SqlSession 생성하는 Factory
@Bean(name = "factory8")
public SqlSessionFactory MjonAgentCTwoSqlSessionFactory(@Qualifier(COMMUTE_DATA_SOURCE) DataSource dataSource) throws Exception {
SqlSessionFactoryBean sqlSessionFactory = new SqlSessionFactoryBean();
sqlSessionFactory.setDataSource(dataSource);
sqlSessionFactory.setTypeAliasesPackage("com.itn.admin.agent.client.five.*");
//sqlSessionFactory.setMapperLocations(new PathMatchingResourcePatternResolver().getResources("classpath:mapper/agent/client/five/*Mapper.xml"));
//sqlSessionFactory.setConfigLocation(new PathMatchingResourcePatternResolver().getResource("classpath:mybatis-config.xml"));
return sqlSessionFactory.getObject();
}
// DataSource 에서 Transaction 관리를 위한 Manager 클래스 등록
@Bean(name = "sqlSession9")
public SqlSessionTemplate sqlSession(SqlSessionFactory sqlSessionFactory) {
return new SqlSessionTemplate(sqlSessionFactory);
}
}

View File

@ -0,0 +1,48 @@
package com.itn.admin.cmn.config;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.SqlSessionFactoryBean;
import org.mybatis.spring.SqlSessionTemplate;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import javax.sql.DataSource;
@Configuration
@MapperScan(value = "com.itn.admin.agent.client.four.mapper", sqlSessionFactoryRef = "factory7")
class MjonAgentCFourDatabaseConfig {
private final String COMMUTE_DATA_SOURCE = "MjagentClienFourDatabase";
// A database DataSource
@Bean(COMMUTE_DATA_SOURCE)
@ConfigurationProperties(prefix = "spring.mjagent.client.four.datasource")
public DataSource CommuteDataSource() {
return DataSourceBuilder.create()
// .type(HikariDataSource.class)
.build();
}
// SqlSessionTemplate 에서 사용할 SqlSession 생성하는 Factory
@Bean(name = "factory7")
public SqlSessionFactory MjonAgentCTwoSqlSessionFactory(@Qualifier(COMMUTE_DATA_SOURCE) DataSource dataSource) throws Exception {
SqlSessionFactoryBean sqlSessionFactory = new SqlSessionFactoryBean();
sqlSessionFactory.setDataSource(dataSource);
sqlSessionFactory.setTypeAliasesPackage("com.itn.admin.agent.client.four.*");
//sqlSessionFactory.setMapperLocations(new PathMatchingResourcePatternResolver().getResources("classpath:mapper/agent/client/four/*Mapper.xml"));
//sqlSessionFactory.setConfigLocation(new PathMatchingResourcePatternResolver().getResource("classpath:mybatis-config.xml"));
return sqlSessionFactory.getObject();
}
// DataSource 에서 Transaction 관리를 위한 Manager 클래스 등록
@Bean(name = "sqlSession8")
public SqlSessionTemplate sqlSession(SqlSessionFactory sqlSessionFactory) {
return new SqlSessionTemplate(sqlSessionFactory);
}
}

View File

@ -0,0 +1,48 @@
package com.itn.admin.cmn.config;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.SqlSessionFactoryBean;
import org.mybatis.spring.SqlSessionTemplate;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import javax.sql.DataSource;
@Configuration
@MapperScan(value = "com.itn.admin.agent.client.three.mapper", sqlSessionFactoryRef = "factory6")
class MjonAgentCThreeDatabaseConfig {
private final String COMMUTE_DATA_SOURCE = "MjagentClienThreeDatabase";
// A database DataSource
@Bean(COMMUTE_DATA_SOURCE)
@ConfigurationProperties(prefix = "spring.mjagent.client.three.datasource")
public DataSource CommuteDataSource() {
return DataSourceBuilder.create()
// .type(HikariDataSource.class)
.build();
}
// SqlSessionTemplate 에서 사용할 SqlSession 생성하는 Factory
@Bean(name = "factory6")
public SqlSessionFactory MjonAgentCTwoSqlSessionFactory(@Qualifier(COMMUTE_DATA_SOURCE) DataSource dataSource) throws Exception {
SqlSessionFactoryBean sqlSessionFactory = new SqlSessionFactoryBean();
sqlSessionFactory.setDataSource(dataSource);
sqlSessionFactory.setTypeAliasesPackage("com.itn.admin.agent.client.three.*");
//sqlSessionFactory.setMapperLocations(new PathMatchingResourcePatternResolver().getResources("classpath:mapper/agent/client/three/*Mapper.xml"));
//sqlSessionFactory.setConfigLocation(new PathMatchingResourcePatternResolver().getResource("classpath:mybatis-config.xml"));
return sqlSessionFactory.getObject();
}
// DataSource 에서 Transaction 관리를 위한 Manager 클래스 등록
@Bean(name = "sqlSession7")
public SqlSessionTemplate sqlSession(SqlSessionFactory sqlSessionFactory) {
return new SqlSessionTemplate(sqlSessionFactory);
}
}

View File

@ -41,7 +41,7 @@ class MjonAgentCTwoDatabaseConfig {
}
// DataSource 에서 Transaction 관리를 위한 Manager 클래스 등록
@Bean(name = "sqlSession3")
@Bean(name = "sqlSession6")
public SqlSessionTemplate sqlSession(SqlSessionFactory sqlSessionFactory) {
return new SqlSessionTemplate(sqlSessionFactory);
}

View File

@ -50,6 +50,28 @@ spring.mjagent.client.two.datasource.jdbc-url=jdbc:log4jdbc:mysql://192.168.0.30
spring.mjagent.client.two.datasource.username=mjonAgentUr
spring.mjagent.client.two.datasource.password=mjonAgentUr!@#$
# agent client 3
spring.mjagent.client.three.userid=hylee250
spring.mjagent.client.three.datasource.driverClassName=net.sf.log4jdbc.sql.jdbcapi.DriverSpy
spring.mjagent.client.three.datasource.jdbc-url=jdbc:log4jdbc:mysql://192.168.0.31:3307/mjonUr_agent?serverTimezone=Asia/Seoul
spring.mjagent.client.three.datasource.username=mjonAgentUr
spring.mjagent.client.three.datasource.password=mjonAgentUr!@#$
# agent client 4
spring.mjagent.client.four.userid=dlwnsgh
spring.mjagent.client.four.datasource.driverClassName=net.sf.log4jdbc.sql.jdbcapi.DriverSpy
spring.mjagent.client.four.datasource.jdbc-url=jdbc:log4jdbc:mysql://192.168.0.31:3308/mjonUr_agent?serverTimezone=Asia/Seoul
spring.mjagent.client.four.datasource.username=mjonAgentUr
spring.mjagent.client.four.datasource.password=mjonAgentUr!@#$
# agent client 5
spring.mjagent.client.five.userid=dlwldn
spring.mjagent.client.five.datasource.driverClassName=net.sf.log4jdbc.sql.jdbcapi.DriverSpy
spring.mjagent.client.five.datasource.jdbc-url=jdbc:log4jdbc:mysql://192.168.0.31:3309/mjonUr_agent?serverTimezone=Asia/Seoul
spring.mjagent.client.five.datasource.username=mjonAgentUr
spring.mjagent.client.five.datasource.password=mjonAgentUr!@#$
# agent server
spring.mjagent.server.datasource.driverClassName=net.sf.log4jdbc.sql.jdbcapi.DriverSpy
spring.mjagent.server.datasource.jdbc-url=jdbc:log4jdbc:mysql://119.193.215.98:3306/mjon_agent_back?serverTimezone=Asia/Seoul

View File

@ -59,7 +59,9 @@
FROM
MUNJAON_MSG
WHERE SEND_STATUS != 1000
and MSG_TYPE = #{msgType}
<if test="msgType != null">
and MSG_TYPE = #{msgType}
</if>
and MESSAGE LIKE CONCAT(#{message}, '%')
</select>

View File

@ -59,7 +59,9 @@
FROM
MUNJAON_MSG
WHERE SEND_STATUS != 1000
and MSG_TYPE = #{msgType}
<if test="msgType != null">
and MSG_TYPE = #{msgType}
</if>
and MESSAGE LIKE CONCAT(#{message}, '%')
</select>

View File

@ -41,7 +41,7 @@
<!-- </environment>-->
<!-- </environments>-->
<!-- <mappers>-->
<!-- <mapper resource="mapper/agent/AgentCTwoMapper.xml"/>-->
<!-- <mapper resource="mapper/agent/AgentCThreeMapper.xml"/>-->
<!-- </mappers>-->
</configuration>

View File

@ -0,0 +1,344 @@
<!DOCTYPE html>
<!-- 관련 Namespace 선언 및 layout:decorate 추가 -->
<html lang="en"
xmlns:th="http://www.thymeleaf.org"
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorate="layout">
<head>
<!-- layout.html 에 들어간 head 부분을 제외하고 개별 파일에만 적용되는 head 부분 추가 -->
<title>agent 발송 테스트</title>
<!-- 필요하다면 개별 파일에 사용될 css/js 선언 -->
<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<style>
.table th, .table td {
text-align: center;
vertical-align: middle;
}
.table {
width: 100%;
margin-bottom: 1rem;
color: #212529;
background-color: transparent;
border-collapse: collapse;
}
.table th, .table td {
padding: 0.75rem;
border-top: 1px solid #dee2e6;
}
.table thead th {
vertical-align: bottom;
border-bottom: 2px solid #dee2e6;
background-color: #f8f9fa; /* 회색 배경색 추가 */
}
.table tbody + tbody {
border-top: 2px solid #dee2e6;
}
.card {
position: relative;
display: flex;
flex-direction: column;
min-width: 0;
word-wrap: break-word;
background-color: #fff;
background-clip: border-box;
border: 1px solid rgba(0, 0, 0, 0.125);
border-radius: 0.25rem;
}
.card-header {
padding: 0.75rem 1.25rem;
margin-bottom: 0;
background-color: rgba(0, 0, 0, 0.03);
border-bottom: 1px solid rgba(0, 0, 0, 0.125);
}
.card-body {
flex: 1 1 auto;
padding: 1.25rem;
}
</style>
</head>
<body layout:fragment="body">
<div class="wrapper">
<div th:replace="~{fragments/top_nav :: topFragment}"/>
<!-- Main Sidebar Container -->
<aside class="main-sidebar sidebar-dark-primary elevation-4"
th:insert="~{fragments/mainsidebar :: sidebarFragment}">
</aside>
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1 class="m-0">AGENT 결과</h1>
</div><!-- /.col -->
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="#">Home</a></li>
<li class="breadcrumb-item active">AGENT 결과</li>
</ol>
</div><!-- /.col -->
</div><!-- /.row -->
</div><!-- /.container-fluid -->
</div>
<!-- /.content-header -->
<!-- Main content -->
<section class="content">
<div class="container-fluid">
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-header">
<h3 class="card-title"></h3>
</div>
<!-- /.card-header -->
<div class="card-body">
<div class="input-group mb-3">
<div class="input-group-append">
<button id="searchButton" class="btn btn-primary" type="button">조회</button>
</div>
<input type="text" id="messageInput" class="form-control" placeholder="메시지를 입력하세요" value="ITN SMS test 240920|09:41">
</div>
<table class="table">
<thead>
<tr>
<th>C 번호</th>
<th>사용자명</th>
<th>[C]DB 등록시간</th>
<th>이관 시작시간</th>
<th>이관 완료시간</th>
<th>이관 갯수</th>
<th>[C]리포트 시작시간</th>
<th>[C]리포트 완료시간</th>
<th>[C]리포트 갯수</th>
<th>전송사 에이전트 리포트 시작시간</th>
<th>전송사 에이전트 리포트 종료시간</th>
<th>전송사 에이전트 리포트 남은 갯수</th>
</tr>
</thead>
<tbody>
<tr>
<td id="cNumber1">1</td>
<td id="username1">daltex</td>
<td id="dbRegisterTime1"></td>
<td id="minReqDate1"></td>
<td id="maxReqDate1"></td>
<td id="cnt1"></td>
<td id="minReportDate1"></td>
<td id="maxReportDate1"></td>
<td id="reportCnt1"></td>
<td id="minResultLogUpdtPnttm1"></td>
<td id="maxResultLogUpdtPnttm1"></td>
<td id="resultNull1"></td>
</tr>
<tr>
<td id="cNumber2">2</td>
<td id="username2">006star</td>
<td id="dbRegisterTime2"></td>
<td id="minReqDate2"></td>
<td id="maxReqDate2"></td>
<td id="cnt2"></td>
<td id="minReportDate2"></td>
<td id="maxReportDate2"></td>
<td id="reportCnt2"></td>
<td id="minResultLogUpdtPnttm2"></td>
<td id="maxResultLogUpdtPnttm2"></td>
<td id="resultNull2"></td>
</tr>
<tr>
<td id="cNumber3">3</td>
<td id="username3">hylee250</td>
<td id="dbRegisterTime3"></td>
<td id="minReqDate3"></td>
<td id="maxReqDate3"></td>
<td id="cnt3"></td>
<td id="minReportDate3"></td>
<td id="maxReportDate3"></td>
<td id="reportCnt3"></td>
<td id="minResultLogUpdtPnttm3"></td>
<td id="maxResultLogUpdtPnttm3"></td>
<td id="resultNull3"></td>
</tr>
<tr>
<td id="cNumber4">4</td>
<td id="username4">dlwnsgh</td>
<td id="dbRegisterTime4"></td>
<td id="minReqDate4"></td>
<td id="maxReqDate4"></td>
<td id="cnt4"></td>
<td id="minReportDate4"></td>
<td id="maxReportDate4"></td>
<td id="reportCnt4"></td>
<td id="minResultLogUpdtPnttm4"></td>
<td id="maxResultLogUpdtPnttm4"></td>
<td id="resultNull4"></td>
</tr>
<tr>
<td id="cNumber5">5</td>
<td id="username5">dlwldn</td>
<td id="dbRegisterTime5"></td>
<td id="minReqDate5"></td>
<td id="maxReqDate5"></td>
<td id="cnt5"></td>
<td id="minReportDate5"></td>
<td id="maxReportDate5"></td>
<td id="reportCnt5"></td>
<td id="minResultLogUpdtPnttm5"></td>
<td id="maxResultLogUpdtPnttm5"></td>
<td id="resultNull5"></td>
</tr>
</tbody>
</table>
</div>
<!-- /.card-body -->
</div>
<!-- /.card -->
</div>
<!-- /.col -->
</div>
<!-- /.row -->
</div>
<!-- /.container-fluid -->
</section>
<!-- /Main content -->
</div>
<!-- /.content-wrapper -->
<footer class="main-footer"
th:insert="~{fragments/footer :: footerFragment}">
</footer>
<!-- Control Sidebar -->
<aside class="control-sidebar control-sidebar-dark">
<!-- Control sidebar content goes here -->
</aside>
<!-- /.control-sidebar -->
</div>
<!-- ./wrapper -->
<script>
$(function () {
const cDBInsertInfo = [
{ id: 1, name: 'daltex', url: '/agent/one/findByRequestDateWhereMessageFromLog', tagId: 'dbRegisterTime'},
{ id: 2, name: '006star', url: '/agent/two/findByRequestDateWhereMessageFromLog', tagId: 'dbRegisterTime'},
{ id: 3, name: 'hylee250', url: '/agent/three/findByRequestDateWhereMessageFromLog', tagId: 'dbRegisterTime'},
{ id: 4, name: 'dlwnsgh', url: '/agent/four/findByRequestDateWhereMessageFromLog', tagId: 'dbRegisterTime'},
{ id: 5, name: 'dlwldn', url: '/agent/five/findByRequestDateWhereMessageFromLog', tagId: 'dbRegisterTime'},
];
const cDBReportInfo = [
{ id: 1, name: 'daltex', url: '/agent/one/findByReportLog'}
,{ id: 2, name: '006star', url: '/agent/two/findByReportLog'}
,{ id: 3, name: 'hylee250', url: '/agent/three/findByReportLog'}
,{ id: 4, name: 'dlwnsgh', url: '/agent/four/findByReportLog'}
,{ id: 5, name: 'dlwldn', url: '/agent/five/findByReportLog'}
];
// AJAX로 데이터 가져오기
$('#searchButton').on('click', function() {
const message = $('#messageInput').val();
// [C] DB 최초 등록시간 가져오기
cDBInsertInfo.forEach(user => {
fn_insertLogAjax(message, user.url, user.id, user.tagId);
});
cDBReportInfo.forEach(user => {
fn_reportLogAjax(message, user.url, user.id);
});
fn_serverLog(message);
});
});
function fn_insertLogAjax(message, url, order, tagId){
// AJAX로 데이터 가져오기
$.ajax({
url: url, // 데이터 가져올 API 엔드포인트
method: 'GET',
data: { message: message },
success: function(data) {
// console.log('url : ',url,' :: data : ', data);
$('#' + tagId + order).text(data.data);
},
error: function(error) {
console.error('데이터를 가져오는 데 실패했습니다:', error);
},
// complit 구현
complete: function() {
console.log('AJAX 요청이 완료되었습니다.');
}
});
}
function fn_reportLogAjax(message, url, order){
// AJAX로 데이터 가져오기
$.ajax({
url: url, // 데이터 가져올 API 엔드포인트
method: 'GET',
data: { message: message },
success: function(data) {
console.log(data);
var returnData = data.data;
$('#reportCnt' + order).text(returnData.reportCnt);
$('#minReportDate' + order).text(returnData.minReportDate);
$('#maxReportDate' + order).text(returnData.maxReportDate);
},
error: function(error) {
console.error('데이터를 가져오는 데 실패했습니다:', error);
},
// complit 구현
complete: function() {
console.log('AJAX 요청이 완료되었습니다.');
}
});
}
/*
* @discription 서버 로그
*
* */
function fn_serverLog(message){
console.log('fn_serverLog :: 서버 데이터 조회중')
// AJAX로 데이터 가져오기
$.ajax({
url: '/agent/server/findByCompanyLogAndSTransfer', // 데이터 가져올 API 엔드포인트
method: 'GET',
data: { message: message },
success: function(data) {
var returnData = data.data;
for (var i = 0; i < returnData.length && i < 5; i++) {
$('#minReqDate' + (i + 1)).text(returnData[i].minReqDate);
$('#maxReqDate' + (i + 1)).text(returnData[i].maxReqDate);
$('#minResultLogUpdtPnttm' + (i + 1)).text(returnData[i].minResultLogUpdtPnttm);
$('#maxResultLogUpdtPnttm' + (i + 1)).text(returnData[i].maxResultLogUpdtPnttm);
$('#cnt' + (i + 1)).text(returnData[i].cnt);
$('#resultNull' + (i + 1)).text(returnData[i].resultNull);
}
},
error: function(error) {
console.error('데이터를 가져오는 데 실패했습니다:', error);
},
// complit 구현
complete: function() {
console.log('AJAX 요청이 완료되었습니다.');
}
});
}
</script>
</body>
</html>

View File

@ -116,7 +116,7 @@
<div class="col-md-6" id="divOneSms">
<div class="card">
<div class="card-header">
<h3 class="card-title" th:text="'Client 1 :: '+ ${oneUserId}"/>
<h3 class="card-title" th:text="'Client 5 :: '+ ${oneUserId}"/>
<div class="card-tools">
<button type="button" class="btn btn-tool" data-card-widget="collapse">
<i class="fas fa-minus"></i>
@ -131,11 +131,11 @@
<div class="p-3 hidden-info" style="display: none;">
<div class="info-section">
<p class="section-title">사용자ID</p>
<p class="info-item">- daltex</p>
<p class="info-item" th:text="${oneUserId}"></p>
</div>
<div class="info-section">
<p class="section-title">DB정보</p>
<p class="info-item">- 192.168.0.125:3306</p>
<p class="info-item">- 192.168.0.31:3308</p>
</div>
<div class="info-section">
<p class="section-title">msg 발송 TB</p>
@ -147,8 +147,8 @@
</div>
<div class="info-section">
<p class="section-title">서버위치</p>
<p class="info-item">- 192.168.0.78</p>
<p class="info-item">- /home/mjon_client_agent_1</p>
<p class="info-item">- 192.168.0.31 (윈도우)</p>
<p class="info-item">- /dev/mjon_agent/agent_client_05</p>
</div>
</div>
<!-- 기타 정보들 추가 -->
@ -221,117 +221,6 @@
</div>
</div>
</div>
<div class="col-md-6" id="divTwoSms">
<div class="card">
<div class="card-header">
<!-- <h3 class="card-title">Client 2 (006star)</h3>-->
<h3 class="card-title" th:text="'Client 2 :: '+ ${twoUserId}"/>
<div class="card-tools">
<button type="button" class="btn btn-tool" data-card-widget="collapse">
<i class="fas fa-minus"></i>
</button>
<button type="button" class="btn btn-tool toggle-info-btn">
<i class="fas fa-info-circle"></i>
</button>
</div>
</div>
<!-- /.card-header -->
<div class="p-3 hidden-info" style="display: none;">
<div class="info-section">
<p class="section-title">사용자ID</p>
<p class="info-item">- 006star</p>
</div>
<div class="info-section">
<p class="section-title">DB정보</p>
<p class="info-item">- 192.168.0.30:3306</p>
</div>
<div class="info-section">
<p class="section-title">msg 발송 TB</p>
<p class="info-item">- MUNJAON_MSG</p>
</div>
<div class="info-section">
<p class="section-title">msg 리포팅 TB</p>
<p class="info-item">- MUNJAON_MSG_LOG</p>
</div>
<div class="info-section">
<p class="section-title">서버위치</p>
<p class="info-item">- 192.168.0.78</p>
<p class="info-item">- /home/mjon_client_agent_2</p>
</div>
</div>
<!-- /.card-header -->
<div class="card-body">
<form class="sendForm">
<input type="hidden" name="msgType" value="S">
<input type="hidden" name="sendStatus" value="0">
<div class="form-group">
<label for="msgType">문자타입 - MSG_TYPE</label>
<div class="input-group">
<select type="text" class="form-control msgType" id="msgType" name="msgType">
<option value="S">SMS</option>
<option value="L">LMS</option>
<option value="M">MMS</option>
<option value="A">알림톡</option>
<option value="F">친구톡</option>
</select>
</div>
</div>
<div class="form-group">
<label for="recvPhone">수신번호 - RECV_PHONE</label>
<div class="input-group">
<input type="text" class="form-control recvPhone" id="recvPhone" name="recvPhone" placeholder="수신번호 - RECV_PHONE">
</div>
</div>
<div class="form-group">
<label for="sendPhone">회신번호 - SEND_PHONE</label>
<div class="input-group">
<input type="text" class="form-control sendPhone" id="sendPhone" name="sendPhone" placeholder="회신번호 - SEND_PHONE">
</div>
</div>
<div class="form-group" style="display: none">
<label for="subject">제목 - SUBJECT</label>
<div class="input-group">
<input type="text" class="form-control subject" id="subject" name="subject" placeholder="제목 - SUBJECT">
</div>
</div>
<div class="form-group fileUploadGroup" style="display: none;">
<label for="file1">파일첨부</label>
<div class="input-group">
<input type="file" class="form-control file1" id="file1" name="fileName01">
</div>
<div class="input-group mt-2">
<input type="file" class="form-control file2" name="fileName02">
</div>
<div class="input-group mt-2">
<input type="file" class="form-control file3" name="fileName03">
</div>
</div>
<div class="form-group">
<label for="message">메세지 - MESSAGE</label>
<div class="input-group">
<textarea class="form-control message" id="message" name="message" placeholder="메세지 - MESSAGE" rows="5" oninput="updateByteCount(this)"></textarea>
</div>
<div class="byte-count">0 bytes</div>
</div>
<div class="form-group">
<label for="slider">건수 (max 1,000,000 | 백만)</label>
<div class="input-group">
<input type="text" class="form-control sliderValue" id="sendCnt" name="sendCnt" placeholder="건수" autocomplete="off">
<div class="slider mt-2" id="slider"></div>
</div>
</div>
<button type="button" class="btn btn-primary w-20 sendBtn">발송</button>
<button type="button" class="btn btn-info w-40 examBtn">예시입력</button>
<button type="reset" class="btn btn-secondary w-30">Reset</button>
</form>
</div>
<!-- /.card-body -->
</div>
<!-- /.card -->
</div>
@ -382,50 +271,6 @@
</div>
</div>
<div class="col-md-6">
<div class="card" style="background-color: beige;">
<div class="card-header">
<h3 class="card-title">Client 2 현재현황</h3>
<button type="button" class="btn btn-tool" onclick="refreshClient2Status()">
<i class="fas fa-sync-alt"></i>
</button>
</div>
<div class="card-body">
<div class="row">
<!-- MSG 건 -->
<div class="col-md-4 col-sm-6 col-12">
<div class="info-box bg-light">
<span class="info-box-icon bg-gray"><i class="fas fa-envelope"></i></span>
<div class="info-box-content">
<span class="info-box-text">MSG 건</span>
<span class="info-box-number" id="client2MsgCnt">0</span>
</div>
</div>
</div>
<!-- MSG_LOG 건 -->
<div class="col-md-4 col-sm-6 col-12">
<div class="info-box bg-light">
<span class="info-box-icon bg-gray"><i class="fas fa-file-alt"></i></span>
<div class="info-box-content">
<span class="info-box-text">MSG_LOG 건</span>
<span class="info-box-number" id="client2MsgLogCnt">0</span>
</div>
</div>
</div>
<!-- report(X) 건 -->
<div class="col-md-4 col-sm-6 col-12">
<div class="info-box bg-light">
<span class="info-box-icon bg-gray"><i class="fas fa-chart-bar"></i></span>
<div class="info-box-content">
<span class="info-box-text">report(X) 건</span>
<span class="info-box-number" id="client2ReportCnt">0</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@ -525,96 +370,6 @@
</div>
</div>
<div class="col-md-6">
<div class="card" id="divTwoSmsCard">
<div class="card-header">
<div class="d-flex justify-content-start align-items-center">
<h3 class="card-title mb-0">클라이언트2 현황확인</h3>
<span class="text-primary font-weight-bold h4 ml-2 sendCntTxt"></span>
</div>
</div>
<div class="card-body">
<div class="row"><!-- 클라이언트 insert -->
<div class="col-md-4 col-sm-6 col-12">
<div class="info-box bg-light">
<span class="info-box-icon bg-gray" style="width: 35px;"><i class="fas fa-upload"></i></span>
<div class="info-box-content">
<span class="info-box-text">클라이언트 insert</span>
<div class="d-flex justify-content-between">
<span class="info-box-number insertCnt">0</span>
<span class="info-box-unit font-weight-bold">건수</span>
</div>
<div class="progress">
<div class="progress-bar" style="width: 100%"></div>
</div>
<span class="progress-description insertSeconds">
0초
</span>
</div>
</div>
</div>
<!-- 데이터 이관 시간 -->
<div class="col-md-4 col-sm-6 col-12">
<div class="info-box bg-light">
<span class="info-box-icon bg-gray" style="width: 35px;"><i class="fas fa-clock"></i></span>
<div class="info-box-content">
<span class="info-box-text">데이터 이관 시간 (C -> S)</span>
<div class="d-flex justify-content-between">
<span class="info-box-number transferCnt">0</span>
<span class="info-box-unit font-weight-bold">건수</span>
</div>
<div class="progress">
<div class="progress-bar" style="width: 100%"></div>
</div>
<span class="progress-description transferSeconds">
0초
</span>
</div>
</div>
</div>
<!-- 클라이언트 report -->
<div class="col-md-4 col-sm-6 col-12">
<div class="info-box bg-light">
<span class="info-box-icon bg-gray" style="width: 35px;"><i class="fas fa-chart-line"></i></span>
<div class="info-box-content">
<span class="info-box-text">클라이언트 report (S -> C)</span>
<div class="d-flex justify-content-between align-items-center">
<span class="info-box-number reportStartCnt">0</span><!--<span class="reportStartSubCnt"></span>-->
<!-- <span class="info-box-number mx-2">→</span>-->
<!-- <span class="info-box-number reportSndCnt">0</span>-->
<span class="info-box-unit font-weight-bold ml-2">건수</span>
</div>
<div class="progress">
<div class="progress-bar" style="width: 100%"></div>
</div>
<span class="progress-description reportSeconds">
0초
</span>
</div>
</div>
</div>
</div>
<!-- Reporting start 버튼 -->
<!-- <div class="row">-->
<!-- <div class="col-12 text-left">-->
<!--&lt;!&ndash; <button class="btn btn-success newButtonClass">Now data report start</button> &lt;!&ndash; 새로운 버튼 추가 &ndash;&gt;&ndash;&gt;-->
<!--&lt;!&ndash; <button class="btn btn-danger rprtAllStrtBtn" data-tagid="twoUserId">ALL data Reporting start</button>&ndash;&gt;-->
<!-- <button class="btn btn-success rprtCrrntStrtBtn" data-tagid="twoUserId">-->
<!-- <i class="fas fa-chart-line"></i> Report Current Data-->
<!-- </button>-->
<!-- <button class="btn btn-danger rprtAllStrtBtn" data-tagid="twoUserId">-->
<!-- <i class="fas fa-chart-line"></i> Report All Data-->
<!-- </button>-->
<!-- </div>-->
<!-- </div>-->
</div>
</div>
</div>
<!-- /.col -->
</div>
<!-- /.row -->
</div>
<!-- /.container-fluid -->

View File

@ -96,6 +96,14 @@
</a>
</li>
</ul>
<ul class="nav nav-treeview">
<li class="nav-item">
<a th:href="@{/agent/result}" class="nav-link">
<i class="far fa-check-circle nav-icon"></i>
<p>agent 결과</p>
</a>
</li>
</ul>
</li>
<li class="nav-item">
<a href="#" class="nav-link" >