agent 관련 게시판 제거

This commit is contained in:
hehihoho3@gmail.com 2025-03-27 12:28:21 +09:00
parent ae3e566297
commit ccc1aa283e
30 changed files with 2 additions and 2805 deletions

View File

@ -1,85 +0,0 @@
package com.itn.admin.agent.client.cmm.service;
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 java.util.ArrayList;
import java.util.List;
@Slf4j
public abstract class AbstractAgentService<T, M> implements AgentService<T> {
@Autowired
protected M mapper; // 매퍼를 protected로 선언하여 서브 클래스에서 접근 가능
private static final int BATCH_SIZE = 100000;
@Override
public RestResponse send(T agentVO) {
List<T> agentVOL = new ArrayList<>();
int sendCnt = parseSendCount(agentVO);
for (int i = 0; i < sendCnt; i++) {
T paramVO = createCopy(agentVO, i, sendCnt);
agentVOL.add(paramVO);
}
int totalSize = agentVOL.size();
long startTime = System.currentTimeMillis() / 1000;
int totalBatches = (int) Math.ceil((double) totalSize / BATCH_SIZE);
for (int i = 0; i < totalSize; i += BATCH_SIZE) {
int end = Math.min(totalSize, i + BATCH_SIZE);
List<T> batchList = agentVOL.subList(i, end);
insertBatch(batchList);
logBatchProgress(i, totalBatches);
}
long endTime = System.currentTimeMillis() / 1000;
long totalTime = endTime - startTime;
log.info("insert 시간 : [{}]", totalTime);
return new RestResponse(HttpStatus.OK, "데이터를 정상적으로 입력했습니다.", totalTime + "");
}
public RestResponse findByInsertCnt(T agentVO) {
int count = countByCondition(agentVO);
return new RestResponse(HttpStatus.OK, "", count);
}
@Override
public RestResponse findByLogMoveCntWhereMessage(T agentVO) {
int count = countByLogMoveCntWhereMsgTypeAndMessage(agentVO);
return new RestResponse(HttpStatus.OK, "", count);
}
public RestResponse findAllLogMoveCnt(T agentVO) {
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);
protected abstract int countByCondition(T agentVO);
protected abstract int parseSendCount(T agentVO);
protected abstract T createCopy(T originalVO, int index, int sendCnt);
protected abstract void insertBatch(List<T> batchList);
private void logBatchProgress(int i, int totalBatches) {
int currentBatch = (i / BATCH_SIZE) + 1;
log.info("현재 처리 중인 배치: [{}]", currentBatch + "/" + totalBatches);
log.info("남은 배치 수: [{}]", (totalBatches - currentBatch));
}
}

View File

@ -1,11 +0,0 @@
package com.itn.admin.agent.client.cmm.service;
import com.itn.admin.cmn.msg.RestResponse;
public interface AgentService<T> {
RestResponse send(T agentVO);
RestResponse findByLogMoveCntWhereMessage(T agentVO);
RestResponse findAllLogMoveCnt(T agentVO);
}

View File

@ -1,50 +0,0 @@
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;
/**
* packageName : com.itn.admin.agent.mapper
* fileName : AgentMapper
* author : hylee
* date : 2024-07-31
* description :
* ===========================================================
* DATE AUTHOR NOTE
* -----------------------------------------------------------
* 2024-07-31 hylee 최초 생성
*/
@Mapper
public interface AgentCOneMapper {
List<AgentCOneVO> findAll(AgentCOneVO agentCTwoVO);
void insertAgents(List<AgentCOneVO> agentCTwoVO);
int countBySendStatusNotAndMsgType(AgentCOneVO agentCTwoVO);
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

@ -1,48 +0,0 @@
package com.itn.admin.agent.client.one.mapper.domain;
import lombok.*;
import java.io.Serializable;
/**
* packageName : com.itn.admin.agent.mapper.domain
* fileName : AgentVO
* author : hylee
* date : 2024-07-31
* description : 에이젼트 테스트발송
* ===========================================================
* DATE AUTHOR NOTE
* -----------------------------------------------------------
* 2023-05-09 hylee 최초 생성
*/
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Getter
@Setter
@ToString
public class AgentCOneVO implements Serializable {
private static final long serialVersionUID = 1L;
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;
private String reportCnt;
private String minReportDate;
private String maxReportDate;
private String cnt;
}

View File

@ -1,24 +0,0 @@
package com.itn.admin.agent.client.one.service;
import com.itn.admin.agent.client.one.mapper.domain.AgentCOneVO;
import com.itn.admin.cmn.msg.RestResponse;
public interface AgentCOneService {
RestResponse send(AgentCOneVO agentCOneVO);
RestResponse findByInsertCnt(AgentCOneVO agentCOneVO);
RestResponse findByLogMoveCntWhereMessage(AgentCOneVO agentCOneVO);
RestResponse findAllLogMoveCnt(AgentCOneVO agentCOneVO);
RestResponse findByRequestDateWhereMessageFromLog(AgentCOneVO agentCOneVO);
RestResponse findByReportLog(AgentCOneVO agentCOneVO);
// RestResponse findByReportCnt(AgentCTwoVO agentCTwoVO);
}

View File

@ -1,126 +0,0 @@
package com.itn.admin.agent.client.one.service.impl;
import com.itn.admin.agent.client.cmm.service.AbstractAgentService;
import com.itn.admin.agent.client.one.mapper.AgentCOneMapper;
import com.itn.admin.agent.client.one.mapper.domain.AgentCOneVO;
import com.itn.admin.agent.client.one.service.AgentCOneService;
import com.itn.admin.cmn.msg.RestResponse;
import jakarta.annotation.PostConstruct;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Arrays;
import java.util.List;
@Slf4j
@Service
public class AgentCOneServiceImpl extends AbstractAgentService<AgentCOneVO, AgentCOneMapper> implements AgentCOneService {
@Autowired
private AgentCOneMapper agentCOneMapper;
@PostConstruct
private void init() {
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);
}
@Override
protected int countByCondition(AgentCOneVO agentVO) {
return mapper.countBySendStatusNotAndMsgType(agentVO);
}
@Override
protected int parseSendCount(AgentCOneVO agentVO) {
try {
return StringUtils.isNotEmpty(agentVO.getSendCnt()) ? Integer.parseInt(agentVO.getSendCnt()) : 0;
} catch (NumberFormatException e) {
return 0;
}
}
@Override
protected AgentCOneVO createCopy(AgentCOneVO originalVO, int index, int sendCnt) {
// if (!originalVO.getMessage().startsWith("ITN")) {
// return originalVO;
// }
AgentCOneVO paramVO = new AgentCOneVO();
String msgType = originalVO.getMsgType();
paramVO.setMsgType(msgType);
paramVO.setSendStatus(originalVO.getSendStatus());
if(sendCnt < 2){
paramVO.setRecvPhone(originalVO.getRecvPhone());
}else{
paramVO.setRecvPhone(modifyPhoneNumber(originalVO.getRecvPhone(), index));
}
paramVO.setSendPhone(originalVO.getSendPhone());
paramVO.setFileName01(originalVO.getFileName01());
paramVO.setFileName02(originalVO.getFileName02());
paramVO.setFileName03(originalVO.getFileName03());
paramVO.setMessage(originalVO.getMessage() + " " + (index + 1));
if (!"S".equals(msgType)) {
paramVO.setSubject(originalVO.getSubject() + " " + (index + 1));
}
return paramVO;
}
@Override
protected void insertBatch(List<AgentCOneVO> batchList) {
mapper.insertAgents(batchList);
}
private String modifyPhoneNumber(String phone, int index) {
// 휴대폰 번호는 010-XXXX-YYYY 형식으로 가정
// String prefix = phone.substring(0, 4); // "010-" 부분
// String middle = phone.substring(4, 8); // "XXXX" 부분
// String suffix = phone.substring(8); // "YYYY" 부분
//
// // 중간 부분 숫자 수정
// int middleNumber = Integer.parseInt(middle);
// middleNumber = (middleNumber + index) % 10000; // 0000~9999 사이의 값으로 제한
// middle = String.format("%04d", middleNumber); // 자리 숫자로 포맷
//
// return prefix + middle + suffix;
// 인덱스를 번호 리스트 길이에 맞게 순환시키기 위해 모듈러 연산 사용
int adjustedIndex = index % PHONE_NUMBER_LIST.size();
return PHONE_NUMBER_LIST.get(adjustedIndex);
}
// 번호 목록을 리스트로 저장
private static final List<String> PHONE_NUMBER_LIST = Arrays.asList(
"01057559725", "01093414986", "01041101024",
"01057058729", "01030266269", "01063170383",
"01066137278", "01023221941", "01087872615",
"01083584250", "01071101861", "01073859908",
"01034910882", "01051842895", "01094597958"
);
}

View File

@ -1,32 +0,0 @@
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.two.mapper.domain.AgentCTwoVO;
import com.itn.admin.agent.client.two.service.AgentCTwoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
@Controller
public class AgentCOneController {
private AgentCOneService agentCOneService;
@Value("${spring.mjagent.client.one.userid}")
private String ONE_USER_ID;
@Value("${spring.mjagent.client.two.userid}")
private String TOW_USER_ID;
@Autowired
public void setAgentCOneService(AgentCOneService agentCOneService) {
this.agentCOneService = agentCOneService;
}
}

View File

@ -1,168 +0,0 @@
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.cmn.msg.RestResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
@RestController
public class AgentCOneRestController {
private AgentCOneService agentCOneService;
private final String UPLOAD_DIR = "/home/mjon_client_agent_1/mmsfile";
@Value("${agent.file.dir.path}")
private String AGENT_FILE_PATH;
@Autowired
public void setAgentService(AgentCOneService agentCOneService) {
this.agentCOneService = agentCOneService;
}
/*
* client db에 insert
* */
@PostMapping("/agent/one/send")
public ResponseEntity<RestResponse> send(@RequestBody AgentCOneVO agentCOneVO) throws Exception {
return ResponseEntity.ok().body(agentCOneService.send(agentCOneVO));
}
/*
* client db에 insert 됐는지 확인 count
* */
@PostMapping("/agent/one/findByInsertCnt")
public ResponseEntity<RestResponse> findByInsertCnt(@RequestBody AgentCOneVO agentCOneVO) throws Exception {
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 테이블에 이동됐는지 확인
* select cnt MESSAGE LIKE CONCAT(#{message}, '%')
* */
@PostMapping("/agent/one/findByLogMoveCntWhereMessage")
public ResponseEntity<RestResponse> findByLogMoveCntWhereMessage(@RequestBody AgentCOneVO agentCOneVO) throws Exception {
return ResponseEntity.ok().body(agentCOneService.findByLogMoveCntWhereMessage(agentCOneVO));
}
/*
* client LOG TB에 insert 됐는지 확인 count
* 리포트할때 동일 타입 데이터가 LOG 테이블에 이동됐는지 확인
* select cnt WHERE msgType = #{msgType}
* */
@PostMapping("/agent/one/findByLogMoveCnt")
public ResponseEntity<RestResponse> findByLogMoveCnt(@RequestBody AgentCOneVO agentCOneVO) throws Exception {
return ResponseEntity.ok().body(agentCOneService.findAllLogMoveCnt(agentCOneVO));
}
@PostMapping("/agent/one/uploadFiles")
public ResponseEntity<RestResponse> uploadFiles(@RequestParam("fileName01") MultipartFile file1,
@RequestParam("fileName02") MultipartFile file2,
@RequestParam("fileName03") MultipartFile file3) {
try {
Map<String, String> fileNames = new HashMap<>();
// 파일을 업로드하고 파일명을 수집
String fileName = "";
if (!file1.isEmpty()) {
fileName = uploadSingleFile(file1);
fileNames.put("fileName01", fileName);
}
if (!file2.isEmpty()) {
fileName = uploadSingleFile(file2);
fileNames.put("fileName02", fileName);
}
if (!file3.isEmpty()) {
fileName = uploadSingleFile(file3);
fileNames.put("fileName03", fileName);
}
// 경로와 파일명 반환
Map<String, Object> response = new HashMap<>();
response.put("fileNames", fileNames);
response.put("status", "OK");
return ResponseEntity.ok(new RestResponse(HttpStatus.OK, "",response) );
} catch (IOException ex) {
return ResponseEntity.ok(new RestResponse(HttpStatus.INTERNAL_SERVER_ERROR, "저장실패","") );
}
}
/*
* 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 originalFileName = StringUtils.cleanPath(file.getOriginalFilename());
// 파일의 확장자를 추출합니다. 파일 이름에서 마지막 "." 이후 부분을 확장자로 간주합니다.
String fileExtension = "";
int dotIndex = originalFileName.lastIndexOf(".");
if (dotIndex > 0) {
fileExtension = originalFileName.substring(dotIndex);
}
// 고유한 파일명을 생성합니다.
String uniqueFileName = UUID.randomUUID().toString() + fileExtension;
// 파일이 업로드될 경로를 설정합니다.
Path uploadPath = Paths.get(AGENT_FILE_PATH);
// 해당 경로가 존재하지 않으면 디렉터리를 생성합니다.
if (!Files.exists(uploadPath)) {
Files.createDirectories(uploadPath);
}
// 파일을 저장할 최종 경로를 생성합니다.
Path filePath = uploadPath.resolve(uniqueFileName);
// 파일을 업로드 경로에 복사합니다. 이미 파일이 존재하면 대체합니다.
Files.copy(file.getInputStream(), filePath, StandardCopyOption.REPLACE_EXISTING);
// 업로드된 고유한 파일명을 반환합니다.
return uniqueFileName;
}
}

View File

@ -1,50 +0,0 @@
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;
/**
* packageName : com.itn.admin.agent.mapper
* fileName : AgentMapper
* author : hylee
* date : 2024-07-31
* description :
* ===========================================================
* DATE AUTHOR NOTE
* -----------------------------------------------------------
* 2024-07-31 hylee 최초 생성
*/
@Mapper
public interface AgentCTwoMapper {
List<AgentCTwoVO> findAll(AgentCTwoVO agentCTwoVO);
void insertAgents(List<AgentCTwoVO> agentCTwoVO);
int countBySendStatusNotAndMsgType(AgentCTwoVO agentCTwoVO);
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

@ -1,46 +0,0 @@
package com.itn.admin.agent.client.two.mapper.domain;
import lombok.*;
import java.io.Serializable;
/**
* packageName : com.itn.admin.agent.mapper.domain
* fileName : AgentVO
* author : hylee
* date : 2024-07-31
* description : 에이젼트 테스트발송
* ===========================================================
* DATE AUTHOR NOTE
* -----------------------------------------------------------
* 2023-05-09 hylee 최초 생성
*/
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Getter
@Setter
@ToString
public class AgentCTwoVO implements Serializable {
private static final long serialVersionUID = 1L;
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;
private String cnt;
private String reportCnt;
private String minReportDate;
private String maxReportDate;
}

View File

@ -1,22 +0,0 @@
package com.itn.admin.agent.client.two.service;
import com.itn.admin.agent.client.two.mapper.domain.AgentCTwoVO;
import com.itn.admin.cmn.msg.RestResponse;
public interface AgentCTwoService {
RestResponse send(AgentCTwoVO agentCTwoVO);
RestResponse findByInsertCnt(AgentCTwoVO agentCTwoVO);
RestResponse findByLogMoveCntWhereMessage(AgentCTwoVO agentCTwoVO);
RestResponse findAllLogMoveCnt(AgentCTwoVO agentCTwoVO);
RestResponse findByRequestDateWhereMessageFromLog(AgentCTwoVO agentCTwoVO);
RestResponse findByReportLog(AgentCTwoVO agentCtwoVO);
}

View File

@ -1,120 +0,0 @@
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;
import jakarta.annotation.PostConstruct;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Arrays;
import java.util.List;
@Slf4j
@Service
public class AgentCTwoServiceImpl extends AbstractAgentService<AgentCTwoVO, AgentCTwoMapper> implements AgentCTwoService {
@Autowired
private AgentCTwoMapper agentCTwoMapper;
@PostConstruct
private void init() {
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);
}
@Override
protected int parseSendCount(AgentCTwoVO agentVO) {
try {
return StringUtils.isNotEmpty(agentVO.getSendCnt()) ? Integer.parseInt(agentVO.getSendCnt()) : 0;
} catch (NumberFormatException e) {
return 0;
}
}
@Override
protected AgentCTwoVO createCopy(AgentCTwoVO originalVO, int index, int sendCnt) {
// if (!originalVO.getMessage().startsWith("ITN")) {
// return originalVO;
// }
AgentCTwoVO paramVO = new AgentCTwoVO();
String msgType = originalVO.getMsgType();
paramVO.setMsgType(msgType);
paramVO.setSendStatus(originalVO.getSendStatus());
if(sendCnt < 2){
paramVO.setRecvPhone(originalVO.getRecvPhone());
}else{
paramVO.setRecvPhone(modifyPhoneNumber(originalVO.getRecvPhone(), index));
}
// paramVO.setSendPhone(modifyPhoneNumber(originalVO.getSendPhone(), index));
paramVO.setSendPhone(originalVO.getSendPhone());
paramVO.setFileName01(originalVO.getFileName01());
paramVO.setFileName02(originalVO.getFileName02());
paramVO.setFileName03(originalVO.getFileName03());
paramVO.setMessage(originalVO.getMessage() + " " + (index + 1));
if (!"S".equals(msgType)) {
paramVO.setSubject(originalVO.getSubject() + " " + (index + 1));
}
return paramVO;
}
@Override
protected void insertBatch(List<AgentCTwoVO> batchList) {
mapper.insertAgents(batchList);
}
private String modifyPhoneNumber(String phone, int index) {
// 인덱스를 번호 리스트 길이에 맞게 순환시키기 위해 모듈러 연산 사용
int adjustedIndex = index % PHONE_NUMBER_LIST.size();
return PHONE_NUMBER_LIST.get(adjustedIndex);
}
// 번호 목록을 리스트로 저장
private static final List<String> PHONE_NUMBER_LIST = Arrays.asList(
"01057559725", "01093414986", "01041101024",
"01057058729", "01030266269", "01063170383",
"01066137278", "01023221941", "01087872615",
"01083584250", "01071101861", "01073859908",
"01034910882", "01051842895", "01094597958"
);
}

View File

@ -1,48 +0,0 @@
package com.itn.admin.agent.client.two.web;
import com.itn.admin.agent.client.two.service.AgentCTwoService;
import com.itn.admin.agent.client.two.mapper.domain.AgentCTwoVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
@Controller
public class AgentCTwoController {
private AgentCTwoService agentCTwoService;
@Value("${spring.mjagent.client.one.userid}")
private String ONE_USER_ID;
@Value("${spring.mjagent.client.two.userid}")
private String TOW_USER_ID;
@Autowired
public void setAgentCTwoService(AgentCTwoService agentCTwoService) {
this.agentCTwoService = agentCTwoService;
}
@GetMapping(value = "/agent/view")
public String list(@ModelAttribute("agentVO") AgentCTwoVO agentCTwoVO, Model model) {
model.addAttribute("oneUserId", ONE_USER_ID);
model.addAttribute("twoUserId", TOW_USER_ID);
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,156 +0,0 @@
package com.itn.admin.agent.client.two.web;
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;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;
import java.util.*;
@RestController
public class AgentCTwoRestController {
private AgentCTwoService agentCTwoService;
private final String UPLOAD_DIR = "/home/mjon_client_agent_2/mmsfile";
@Value("${agent.file.dir.path}")
private String AGENT_FILE_PATH;
@Autowired
public void setAgentService(AgentCTwoService agentCTwoService) {
this.agentCTwoService = agentCTwoService;
}
/*
* client db에 insert
* */
@PostMapping("/agent/two/send")
public ResponseEntity<RestResponse> send(@RequestBody AgentCTwoVO agentCTwoVO) throws Exception {
return ResponseEntity.ok().body(agentCTwoService.send(agentCTwoVO));
}
/*
* client db에 insert 됐는지 확인 count
* */
@PostMapping("/agent/two/findByInsertCnt")
public ResponseEntity<RestResponse> findByInsertCnt(@RequestBody AgentCTwoVO agentCTwoVO) throws Exception {
System.out.println("message : "+ agentCTwoVO.getMessage());
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 테이블에 이동됐는지 확인
* select cnt WHERE MESSAGE LIKE CONCAT(#{message}, '%')
* */
@PostMapping("/agent/two/findByLogMoveCntWhereMessage")
public ResponseEntity<RestResponse> findByLogMoveCntWhereMessage(@RequestBody AgentCTwoVO agentCTwoVO) throws Exception {
return ResponseEntity.ok().body(agentCTwoService.findByLogMoveCntWhereMessage(agentCTwoVO));
}
/*
* client LOG TB에 insert 됐는지 확인 count
* 리포트 update한 모든 데이터가 LOG 테이블에 이동됐는지 확인
* */
@PostMapping("/agent/two/findByLogMoveCnt")
public ResponseEntity<RestResponse> findByLogMoveCnt(@RequestBody AgentCTwoVO agentCTwoVO) throws Exception {
return ResponseEntity.ok().body(agentCTwoService.findAllLogMoveCnt(agentCTwoVO));
}
@PostMapping("/agent/two/uploadFiles")
public ResponseEntity<RestResponse> uploadFiles(@RequestParam("fileName01") MultipartFile file1,
@RequestParam("fileName02") MultipartFile file2,
@RequestParam("fileName03") MultipartFile file3) {
try {
Map<String, String> fileNames = new HashMap<>();
// 파일을 업로드하고 파일명을 수집
String fileName = "";
if (!file1.isEmpty()) {
fileName = uploadSingleFile(file1);
fileNames.put("fileName01", fileName);
}
if (!file2.isEmpty()) {
fileName = uploadSingleFile(file2);
fileNames.put("fileName02", fileName);
}
if (!file3.isEmpty()) {
fileName = uploadSingleFile(file3);
fileNames.put("fileName03", fileName);
}
return ResponseEntity.ok(new RestResponse(HttpStatus.OK, "",fileNames) );
} catch (IOException ex) {
return ResponseEntity.ok(new RestResponse(HttpStatus.INTERNAL_SERVER_ERROR, "저장실패","") );
}
}
private String uploadSingleFile(MultipartFile file) throws IOException {
// 업로드된 파일의 이름을 가져옵니다.
String originalFileName = StringUtils.cleanPath(file.getOriginalFilename());
// 파일의 확장자를 추출합니다. 파일 이름에서 마지막 "." 이후 부분을 확장자로 간주합니다.
String fileExtension = "";
int dotIndex = originalFileName.lastIndexOf(".");
if (dotIndex > 0) {
fileExtension = originalFileName.substring(dotIndex);
}
// 고유한 파일명을 생성합니다.
String uniqueFileName = UUID.randomUUID().toString() + fileExtension;
// 파일이 업로드될 경로를 설정합니다.
Path uploadPath = Paths.get(AGENT_FILE_PATH);
// 해당 경로가 존재하지 않으면 디렉터리를 생성합니다.
if (!Files.exists(uploadPath)) {
Files.createDirectories(uploadPath);
}
// 파일을 저장할 최종 경로를 생성합니다.
Path filePath = uploadPath.resolve(uniqueFileName);
// 파일을 업로드 경로에 복사합니다. 이미 파일이 존재하면 대체합니다.
Files.copy(file.getInputStream(), filePath, StandardCopyOption.REPLACE_EXISTING);
// 업로드된 고유한 파일명을 반환합니다.
return uniqueFileName;
}
/*
* 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

@ -1,50 +0,0 @@
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
* fileName : AgentMapper
* author : hylee
* date : 2024-07-31
* description :
* ===========================================================
* DATE AUTHOR NOTE
* -----------------------------$------------------------------
* 2024-07-31 hylee 최초 생성
*/
@Mapper
public interface AgentSMapper {
int countByCurStateAndUserId(AgentSVO agentSVO);
int updateReportWhereUserId(AgentSVO agentSVO);
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

@ -1,101 +0,0 @@
package com.itn.admin.agent.server.mapper.domain;
import lombok.*;
import java.io.Serializable;
import java.util.Date;
/**
* packageName : com.itn.admin.agent.server.mapper.domain
* fileName : AgentSVO
* author : hylee
* date : 2024-07-31
* description : 에이젼트 테스트발송
* ===========================================================
* DATE AUTHOR NOTE
* -----------------------------------------------------------
* 2023-05-09 hylee 최초 생성
*/
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Getter
@Setter
@ToString
public class AgentSVO implements Serializable {
private static final long serialVersionUID = 1L;
private String msgId; // 문자ID
private String userId; // 문자온 일반회원ID
private Integer userdata; // 사용자 정의 코드
private Long msgSeq; // 메시지의 고유번호
private String agentMsgId; // 고객전송 문자ID
private Integer curState; // 상태
private Date sentDate; // 메시지를 전송한 시각
private Date rsltDate; // 핸드폰에 전달된 시간
private Date reportDate; // 레포트 처리한 시간
private Date reqDate; // 예약일시
private Integer rsltCode; // 결과처리코드
private String rsltCode2; // 결과처리 상세코드
private String rsltNet; // 결과처리 통신사
private String callTo; // 수신번호
private String callFrom; // 발신번호
private String subject; // MMS경우 제목
private String smsTxt; // SMS용 메시지본문
private String msgType; // 메시지의 종류
private String msgPayCode; // 최종전송콘텐트 종류 저장
private Integer contSeq; // MMS의 콘텐츠 Key
private Integer msgTypeResend; // 재전송할 문자 타입
private Integer centerSeqResend; // 재전송할 센터
private String msgNoticetalkSenderKey; // 카카오 알림톡에 등록된 사용자 고유키
private String msgNoticetalkTmpKey; // 카카오 알림톡에 등록된 문자 템플릿 고유키
private Integer msgResendCount; // 재전송한 카운트
private Date msgResendDate; // 재전송된 시간
private Date sentDatePre; // 이전 메시지를 전송한 시각
private Date rsltDatePre; // 이전 핸드폰에 전달된 시간
private Date reportDatePre; // 이전 레포트 처리한 시간
private Integer rsltCodePre; // 이전 결과처리코드
private String rsltCode2Pre; // 이전 결과처리 상세코드
private String rsltNetPre; // 이전 결과처리 통신사
private String conectMthd; // 접속한 기기
private String agentCode; // 전송사
private String delFlag; // 사용자 삭제여부
private Integer fileCnt; // 첨부파일 갯수
private String filePath1; // 첨부파일 1 경로
private String filePath2; // 첨부파일 2 경로
private String filePath3; // 첨부파일 3 경로
private String msgGroupId; // 문자그룹ID
private String neoType; // NEO MMS메세지 타입
private String reserveCYn; // 예약 취소 유무
private String refundYn; // 문자발송 실패의 환불처리 유무
private Date resultLogUpdtPnttm; // LOG 테이블의 결과를 업데이트한 시간
private String resellerCode; // 발송사업자 식별코드 정의
private String bizKakaoResendType; // 카카오 재전송 type
private String bizKakaoResendData; // 카카오 재전송 내용
private String bizKakaoJsonFile; // 카카오 json 첨부파일
private String bizKakaoResendYn; // 카카오 재전송 여부
private String bizKakaoTitle; // 카카오 강조유형 타이틀
private String bizUmid; // 비즈뿌리오 서버에서 정의한 ID
private String message; //
// client 컬럼
private String sendStatus;
private String requestSate;
private String recvPhone;
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

@ -1,17 +0,0 @@
package com.itn.admin.agent.server.service;
import com.itn.admin.agent.server.mapper.domain.AgentSVO;
import com.itn.admin.cmn.msg.RestResponse;
public interface AgentSService {
RestResponse findByTransferCnt(AgentSVO agentSVO);
RestResponse serverReport(AgentSVO agentSVO);
RestResponse nowDataReport(AgentSVO agentSVO);
RestResponse findByCompanyLogAndSTransfer(AgentSVO agentSVO);
}

View File

@ -1,59 +0,0 @@
package com.itn.admin.agent.server.service.impl;
import com.itn.admin.agent.server.mapper.AgentSMapper;
import com.itn.admin.agent.server.mapper.domain.AgentSVO;
import com.itn.admin.agent.server.service.AgentSService;
import com.itn.admin.cmn.msg.RestResponse;
import io.micrometer.common.util.StringUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Service;
import java.util.List;
@Slf4j
@Service
public class AgentSServiceImpl implements AgentSService {
@Autowired
AgentSMapper agentSMapper;
@Override
public RestResponse findByTransferCnt(AgentSVO agentSVO) {
// int cnt = agentSMapper.countByCurStateAndUserId(agentSVO);
String cntTxt = agentSMapper.findByCurStateAndUserIdAndSmsTxt(agentSVO);
if(StringUtils.isNotEmpty(cntTxt) ){
cntTxt = cntTxt.replace(agentSVO.getMessage(),"").trim();
}
return new RestResponse(HttpStatus.OK,"", cntTxt);
}
@Override
public RestResponse serverReport(AgentSVO agentSVO) {
int cnt = agentSMapper.updateReportWhereUserId(agentSVO);
String msg = agentSVO.getUserId()+ "관련 모든 데이터 report 시작합니다.";
return new RestResponse(HttpStatus.OK,msg, cnt);
}
@Override
public RestResponse nowDataReport(AgentSVO agentSVO) {
int cnt = agentSMapper.updateReportWhereUserIdAndMassage(agentSVO);
log.info(" + nowDataReport cnt : [{}]", cnt);
String msg = agentSVO.getMessage() + "관련 데이터 report 시작합니다.";
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

@ -1,18 +0,0 @@
package com.itn.admin.agent.server.web;
import com.itn.admin.agent.client.two.service.AgentCTwoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
@Controller
public class AgentSController {
private AgentCTwoService agentCTwoService;
@Autowired
public void setCommuteService(AgentCTwoService agentCTwoService) {
this.agentCTwoService = agentCTwoService;
}
}

View File

@ -1,61 +0,0 @@
package com.itn.admin.agent.server.web;
import com.itn.admin.agent.server.mapper.domain.AgentSVO;
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.*;
@RestController
public class AgentSRestController {
private AgentSService agentSService;
@Autowired
public void setAgentService(AgentSService agentSService) {
this.agentSService = agentSService;
}
/*
*
* */
@PostMapping("/agent/server/findByTransferCnt")
public ResponseEntity<RestResponse> findByTransferCnt(@RequestBody AgentSVO agentSVO) throws Exception {
return ResponseEntity.ok().body(agentSService.findByTransferCnt(agentSVO));
}
/*
* 전송사가 리턴해준것처럼
* server DB에 update
* @@ 모든 데이터 대량 없뎃
* */
@PostMapping("/agent/server/allReport")
public ResponseEntity<RestResponse> serverReport(@RequestBody AgentSVO agentSVO) throws Exception {
return ResponseEntity.ok().body(agentSService.serverReport(agentSVO));
}
/*
* 전송사가 리턴해준것처럼
* server DB에 update
* @@ 현재 화면 기준 data만 없뎃
* */
@PostMapping("/agent/server/nowDataReport")
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

@ -1,47 +0,0 @@
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

@ -1,48 +0,0 @@
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

@ -1,48 +0,0 @@
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.one.mapper", sqlSessionFactoryRef = "factory5")
class MjonAgentCOneDatabaseConfig {
private final String COMMUTE_DATA_SOURCE = "MjagentClienOneDatabase";
// A database DataSource
@Bean(COMMUTE_DATA_SOURCE)
@ConfigurationProperties(prefix = "spring.mjagent.client.one.datasource")
public DataSource CommuteDataSource() {
return DataSourceBuilder.create()
// .type(HikariDataSource.class)
.build();
}
// SqlSessionTemplate 에서 사용할 SqlSession 생성하는 Factory
@Bean(name = "factory5")
public SqlSessionFactory MjonAgentCOneSqlSessionFactory(@Qualifier(COMMUTE_DATA_SOURCE) DataSource dataSource) throws Exception {
SqlSessionFactoryBean sqlSessionFactory = new SqlSessionFactoryBean();
sqlSessionFactory.setDataSource(dataSource);
sqlSessionFactory.setTypeAliasesPackage("com.itn.admin.agent.client.one.*");
sqlSessionFactory.setMapperLocations(new PathMatchingResourcePatternResolver().getResources("classpath:mapper/agent/client/one/*Mapper.xml"));
sqlSessionFactory.setConfigLocation(new PathMatchingResourcePatternResolver().getResource("classpath:mybatis-config.xml"));
return sqlSessionFactory.getObject();
}
// DataSource 에서 Transaction 관리를 위한 Manager 클래스 등록
@Bean(name = "sqlSession5")
public SqlSessionTemplate sqlSession(SqlSessionFactory sqlSessionFactory) {
return new SqlSessionTemplate(sqlSessionFactory);
}
}

View File

@ -1,48 +0,0 @@
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

@ -1,48 +0,0 @@
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.two.mapper", sqlSessionFactoryRef = "factory3")
class MjonAgentCTwoDatabaseConfig {
private final String COMMUTE_DATA_SOURCE = "MjagentClienTwoDatabase";
// A database DataSource
@Bean(COMMUTE_DATA_SOURCE)
@ConfigurationProperties(prefix = "spring.mjagent.client.two.datasource")
public DataSource CommuteDataSource() {
return DataSourceBuilder.create()
// .type(HikariDataSource.class)
.build();
}
// SqlSessionTemplate 에서 사용할 SqlSession 생성하는 Factory
@Bean(name = "factory3")
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.two.*");
sqlSessionFactory.setMapperLocations(new PathMatchingResourcePatternResolver().getResources("classpath:mapper/agent/client/two/*Mapper.xml"));
sqlSessionFactory.setConfigLocation(new PathMatchingResourcePatternResolver().getResource("classpath:mybatis-config.xml"));
return sqlSessionFactory.getObject();
}
// DataSource 에서 Transaction 관리를 위한 Manager 클래스 등록
@Bean(name = "sqlSession6")
public SqlSessionTemplate sqlSession(SqlSessionFactory sqlSessionFactory) {
return new SqlSessionTemplate(sqlSessionFactory);
}
}

View File

@ -1,48 +0,0 @@
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.server.mapper", sqlSessionFactoryRef = "factory4")
class MjonAgentSDatabaseConfig {
private final String AGENT_S_DATA_SOURCE = "MjagentServerDatabase";
// A database DataSource
@Bean(AGENT_S_DATA_SOURCE)
@ConfigurationProperties(prefix = "spring.mjagent.server.datasource")
public DataSource MjagentServerSource() {
return DataSourceBuilder.create()
.type(com.zaxxer.hikari.HikariDataSource.class) // HikariDataSource를 명시적으로 사용
.build();
}
// SqlSessionTemplate 에서 사용할 SqlSession 생성하는 Factory
@Bean(name = "factory4")
public SqlSessionFactory MjonAgentSSqlSessionFactory(@Qualifier(AGENT_S_DATA_SOURCE) DataSource dataSource) throws Exception {
SqlSessionFactoryBean sqlSessionFactory = new SqlSessionFactoryBean();
sqlSessionFactory.setDataSource(dataSource);
sqlSessionFactory.setTypeAliasesPackage("com.itn.admin.agent.server.*");
sqlSessionFactory.setMapperLocations(new PathMatchingResourcePatternResolver().getResources("classpath:mapper/agent/server/*Mapper.xml"));
sqlSessionFactory.setConfigLocation(new PathMatchingResourcePatternResolver().getResource("classpath:mybatis-config.xml"));
return sqlSessionFactory.getObject();
}
// DataSource 에서 Transaction 관리를 위한 Manager 클래스 등록
@Bean(name = "sqlSession4")
public SqlSessionTemplate sqlSession(SqlSessionFactory sqlSessionFactory) {
return new SqlSessionTemplate(sqlSessionFactory);
}
}

View File

@ -19,9 +19,6 @@
<typeAlias type="com.itn.admin.itn.dict.mapper.domain.DictionaryVO" alias="dictionaryVO"/>
<typeAlias type="com.itn.admin.itn.mjon.spam.mapper.domain.SpamVO" alias="spamVO"/>
<typeAlias type="com.itn.admin.itn.user.mapper.domain.UserVO" alias="userVO"/>
<typeAlias type="com.itn.admin.agent.client.one.mapper.domain.AgentCOneVO" alias="agentCOneVO"/>
<typeAlias type="com.itn.admin.agent.client.two.mapper.domain.AgentCTwoVO" alias="agentCTwoVO"/>
<typeAlias type="com.itn.admin.agent.server.mapper.domain.AgentSVO" alias="agentSVO"/>
<typeAlias type="com.itn.admin.itn.code.mapper.domain.CodeVO" alias="codeVO"/>
<typeAlias type="com.itn.admin.itn.code.mapper.domain.CodeDetailVO" alias="codeDetailVO"/>

View File

@ -1,344 +0,0 @@
<!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

@ -1,852 +0,0 @@
<!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" th:href="@{/plugins/datatables-bs4/css/dataTables.bootstrap4.min.css}">
<link rel="stylesheet" th:href="@{/plugins/datatables-responsive/css/responsive.bootstrap4.min.css}">
<link rel="stylesheet" th:href="@{/plugins/datatables-buttons/css/buttons.bootstrap4.min.css}">
<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<style>
.byte-count {
margin-top: 5px;
font-size: 14px;
color: #555;
}
.custom-height {
height: 100px;
}
.example-button {
border-radius: 20px;
margin-right: 10px;
}
.input-group .example-button {
margin-right: 10px;
}
.slider {
width: 100%;
margin-top: 10px;
}
#hidden-info {
background-color: #f9f9f9;
border-top: 1px solid #ddd;
padding: 10px;
border-radius: 0 0 5px 5px;
}
.info-section {
margin-bottom: 15px;
}
.section-title {
font-weight: bold;
color: #333;
margin-bottom: 5px;
}
.info-item {
margin: 0;
padding-left: 10px;
color: #555;
}
.toggle-info-btn i {
transition: transform 0.2s ease-in-out;
}
.toggle-info-btn.rotate i {
transform: rotate(180deg);
}
.nowCardCTwo{
background-color: beige;
}
</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">
<input type="hidden" id="oneUserId" th:value="${oneUserId}">
<input type="hidden" id="twoUserId" th:value="${twoUserId}">
<!-- <div class="col-12">-->
<!-- /.card -->
<div class="col-md-6" id="divOneSms">
<div class="card">
<div class="card-header">
<h3 class="card-title" th:text="'Client 3 :: '+ ${oneUserId}"/>
<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>
<div class="p-3 hidden-info" style="display: none;">
<!-- Client 1의 정보 -->
<div class="p-3 hidden-info" style="display: none;">
<div class="info-section">
<p class="section-title">사용자ID</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.31:3307</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_3</p>
</div>
</div>
<!-- 기타 정보들 추가 -->
</div>
<div class="card-body">
<form class="sendForm">
<!-- Client 1의 입력 폼 -->
<input type="hidden" name="sendStatus" value="0">
<div class="form-group">
<label for="msgType1">문자타입 - MSG_TYPE</label>
<div class="input-group">
<select type="text" class="form-control msgType" id="msgType1" 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="recvPhone1">수신번호 - RECV_PHONE</label>
<div class="input-group">
<input type="text" class="form-control recvPhone" id="recvPhone1" name="recvPhone" placeholder="수신번호 - RECV_PHONE">
</div>
</div>
<div class="form-group">
<label for="sendPhone1">회신번호 - SEND_PHONE</label>
<div class="input-group">
<input type="text" class="form-control sendPhone" id="sendPhone1" name="sendPhone" placeholder="회신번호 - SEND_PHONE">
</div>
</div>
<div class="form-group" style="display: none">
<label for="subject1">제목 - SUBJECT</label>
<div class="input-group">
<input type="text" class="form-control subject" id="subject1" name="subject" placeholder="제목 - SUBJECT">
</div>
</div>
<div class="form-group fileUploadGroup" style="display: none;">
<label for="file2">파일첨부</label>
<div class="input-group">
<input type="file" class="form-control file1" id="file2" 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="sendPhone1">메세지 - MESSAGE</label>
<div class="input-group">
<textarea class="form-control message" id="message1" 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="slider1">건수 (max 1,000,000 | 백만)</label>
<div class="input-group">
<input type="text" class="form-control sliderValue" id="sendCnt1" name="sendCnt" placeholder="건수" autocomplete="off">
<div class="slider mt-2" id="slider1"></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>
</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 4 :: '+ ${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" th:text="${twoUserId}"></p>
</div>
<div class="info-section">
<p class="section-title">DB정보</p>
<p class="info-item">- 192.168.0.31:3308</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.31 (윈도우)</p>
<p class="info-item">- /dev/mjon_agent/agent_client_04</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>
<!-- 새로운 현황 섹션 -->
<!-- <div class="col-md-6">-->
<!-- <div class="card" style="background-color: beige;">-->
<!-- <div class="card-header">-->
<!-- <h3 class="card-title">Client 1 현재현황</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">-->
<!-- &lt;!&ndash; MSG 건 &ndash;&gt;-->
<!-- <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="client1MsgCnt">0</span>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- &lt;!&ndash; MSG_LOG 건 &ndash;&gt;-->
<!-- <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="client1MsgLogCnt">0</span>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- &lt;!&ndash; report(X) 건 &ndash;&gt;-->
<!-- <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="client1ReportCnt">0</span>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </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">-->
<!-- &lt;!&ndash; MSG 건 &ndash;&gt;-->
<!-- <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>-->
<!-- &lt;!&ndash; MSG_LOG 건 &ndash;&gt;-->
<!-- <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>-->
<!-- &lt;!&ndash; report(X) 건 &ndash;&gt;-->
<!-- <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>-->
<div class="col-md-6">
<div class="card" id="divOneSmsCard">
<div class="card-header">
<div class="d-flex justify-content-start align-items-center">
<h3 class="card-title mb-0">클라이언트1 현황확인</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">-->
<!-- <button class="btn btn-success rprtCrrntStrtBtn" data-tagid="oneUserId">-->
<!-- <i class="fas fa-chart-line"></i> Report Current Data-->
<!-- </button>-->
<!-- <button class="btn btn-danger rprtAllStrtBtn" data-tagid="oneUserId">-->
<!-- <i class="fas fa-chart-line"></i> Report All Data-->
<!-- </button>-->
<!-- </div>-->
<!-- </div>-->
</div>
</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 -->
</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 th:src="@{/cmn/js/agent/init.js}"></script>
<script th:src="@{/cmn/js/agent/timerForOneC.js}"></script>
<script th:src="@{/cmn/js/agent/timerForTwoC.js}"></script>
<script>
$(function () {
// client_1 영역
// client_1 영역
// client_1 영역
// client_1 영역
// client_1 영역
/*
* client_1 msg insert
* */
$("#divOneSms .sendBtn").on("click", function () {
// 폼 데이터를 수집
var formData = new FormData($("#divOneSms .sendForm")[0]);
// 먼저 파일을 업로드하고 파일명만 받음
var fileUploadForm = new FormData();
fileUploadForm.append("fileName01", formData.get("fileName01"));
fileUploadForm.append("fileName02", formData.get("fileName02"));
fileUploadForm.append("fileName03", formData.get("fileName03"));
$.ajax({
type: "POST",
url: "/agent/one/uploadFiles",
data: fileUploadForm,
processData: false,
contentType: false,
success: function(response) {
console.log('response : ', response);
if (response.status === 'OK') {
// 파일명만 formData에 추가
// 파일명 formData에 추가
if (response.data.fileNames.fileName01) {
formData.append("fileName01", response.data.fileNames.fileName01);
}
if (response.data.fileNames.fileName02) {
formData.append("fileName02", response.data.fileNames.fileName02);
}
if (response.data.fileNames.fileName03) {
formData.append("fileName03", response.data.fileNames.fileName03);
}
var jsonObject = {};
formData.forEach((value, key) => {
if (!(value instanceof File)) {
jsonObject[key] = value;
}
});
// if(jsonObject['recvPhone'] === ""){
// alert('정보를 입력하거나 예시입력을 클릭해주세요.')
// return false;
// }
console.log('one jsonObject send : ', jsonObject);
$.ajax({
type: "POST",
url: "/agent/one/send",
data: JSON.stringify(jsonObject), // JSON 문자열로 변환된 데이터를 전송
dataType: 'json',
contentType: 'application/json',
// async: true,
success: function (data) {
// console.log('data : ', data);
if (data.status === 'OK') {
fn_successAlert('경과시간 : '+data.data, data.msg);
// fn_successAlert(data, message)
}
else {
alert("오류 알림 : :: "+data.msg);
}
},
error: function (e) {
alert("저장에 실패하였습니다.");
console.log("ERROR : " + JSON.stringify(e));
},
beforeSend : function(xmlHttpRequest) {
fn_oneInsertScriptStart();
},
complete : function(xhr, textStatus) {
// oneStopInsertTimer();
}
});
} else {
alert("파일 업로드 실패: " + response.msg);
}
},
error: function(e) {
alert("파일 업로드에 실패하였습니다.");
console.log("ERROR : " + JSON.stringify(e));
}
});
});
// client_2 영역
// client_2 영역
// client_2 영역
// client_2 영역
// client_2 영역
/*
* client_2 msg insert
* */
$("#divTwoSms .sendBtn").on("click", function () {
// 폼 데이터를 수집
var formData = new FormData($("#divTwoSms .sendForm")[0]);
// 먼저 파일을 업로드하고 파일명만 받음
var fileUploadForm = new FormData();
fileUploadForm.append("fileName01", formData.get("fileName01"));
fileUploadForm.append("fileName02", formData.get("fileName02"));
fileUploadForm.append("fileName03", formData.get("fileName03"));
$.ajax({
type: "POST",
url: "/agent/two/uploadFiles",
data: fileUploadForm,
processData: false,
contentType: false,
success: function(response) {
console.log('response : ', response);
if (response.status === 'OK') {
// 파일명만 formData에 추가
// 파일명 formData에 추가
if (response.data.fileName01) {
formData.append("fileName01", response.data.fileName01);
}
if (response.data.fileName02) {
formData.append("fileName02", response.data.fileName02);
}
if (response.data.fileName03) {
formData.append("fileName03", response.data.fileName03);
}
var jsonObject = {};
formData.forEach((value, key) => {
if (!(value instanceof File)) {
jsonObject[key] = value;
}
});
// if(jsonObject['recvPhone'] === ""){
// alert('정보를 입력하거나 예시입력을 클릭해주세요.')
// return false;
// }
$.ajax({
type: "POST",
url: "/agent/two/send",
data: JSON.stringify(jsonObject), // JSON 문자열로 변환된 데이터를 전송
dataType: 'json',
contentType: 'application/json',
// async: true,
success: function (data) {
// console.log('data : ', data);
if (data.status === 'OK') {
fn_successAlert('경과시간 : '+data.data, data.msg);
// fn_successAlert(data, message)
}
else {
alert("오류 알림 : :: "+data.msg);
}
},
error: function (e) {
alert("데이터 저장에 실패하였습니다.");
console.log("ERROR : " + JSON.stringify(e));
},
beforeSend : function(xmlHttpRequest) {
fn_twoInsertScriptStart();
},
complete : function(xhr, textStatus) {
oneStopInsertTimer();
}
});
} else {
alert("파일 업로드 실패: " + response.msg);
}
},
error: function(e) {
alert("파일 업로드에 실패하였습니다.");
console.log("ERROR : " + JSON.stringify(e));
}
});
});
});
</script>
</body>
</html>

View File

@ -89,32 +89,7 @@
<p>단어사전</p>
</a>
</li>
<li class="nav-item">
<a href="#" class="nav-link" >
<i class="nav-icon fas fa-vial"></i>
<p>
테스트
<i class="right fas fa-angle-left"></i>
</p>
</a>
<ul class="nav nav-treeview">
<li class="nav-item">
<a th:href="@{/agent/view}" class="nav-link">
<i class="far fa-paper-plane nav-icon"></i>
<p>agent발송</p>
</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">
<!-- <li class="nav-item">
<a href="#" class="nav-link" >
<i class="nav-icon fas fa-sms"></i>
<p>
@ -138,7 +113,7 @@
</a>
</li>
</ul>
</li>
</li>-->
</ul>
</nav>
<!-- /.sidebar-menu -->