문자 agent 테스트 프로세스 개선
This commit is contained in:
parent
7b835dfe22
commit
2954e6273f
@ -47,6 +47,20 @@ public abstract class AbstractAgentService<T, M> implements AgentService<T> {
|
||||
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);
|
||||
}
|
||||
|
||||
protected abstract int countAllLogMoveCnt(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);
|
||||
@ -57,4 +71,5 @@ public abstract class AbstractAgentService<T, M> implements AgentService<T> {
|
||||
log.info("현재 처리 중인 배치: [{}]", currentBatch + "/" + totalBatches);
|
||||
log.info("남은 배치 수: [{}]", (totalBatches - currentBatch));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -5,4 +5,8 @@ import com.itn.admin.cmn.msg.RestResponse;
|
||||
public interface AgentService<T> {
|
||||
RestResponse send(T agentVO);
|
||||
RestResponse findByInsertCnt(T agentVO);
|
||||
|
||||
RestResponse findByLogMoveCntWhereMessage(T agentVO);
|
||||
|
||||
RestResponse findAllLogMoveCnt(T agentVO);
|
||||
}
|
||||
|
||||
@ -24,4 +24,8 @@ public interface AgentCOneMapper {
|
||||
void insertAgents(List<AgentCOneVO> agentCTwoVO);
|
||||
|
||||
int countBySendStatusNotAndMsgType(AgentCOneVO agentCTwoVO);
|
||||
|
||||
int countByLogMoveCntWhereMsgTypeAndMessage(AgentCOneVO agentVO);
|
||||
|
||||
int findAllLogMoveCnt(AgentCOneVO agentVO);
|
||||
}
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
package com.itn.admin.agent.client.one.service;
|
||||
|
||||
import com.itn.admin.agent.client.one.mapper.domain.AgentCOneVO;
|
||||
import com.itn.admin.agent.client.two.mapper.domain.AgentCTwoVO;
|
||||
import com.itn.admin.cmn.msg.RestResponse;
|
||||
|
||||
|
||||
@ -13,5 +12,9 @@ public interface AgentCOneService {
|
||||
|
||||
RestResponse findByInsertCnt(AgentCOneVO agentCOneVO);
|
||||
|
||||
RestResponse findByLogMoveCntWhereMessage(AgentCOneVO agentCOneVO);
|
||||
|
||||
RestResponse findAllLogMoveCnt(AgentCOneVO agentCOneVO);
|
||||
|
||||
// RestResponse findByReportCnt(AgentCTwoVO agentCTwoVO);
|
||||
}
|
||||
|
||||
@ -10,11 +10,11 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Slf4j@Service
|
||||
@Slf4j
|
||||
@Service
|
||||
public class AgentCOneServiceImpl extends AbstractAgentService<AgentCOneVO, AgentCOneMapper> implements AgentCOneService {
|
||||
|
||||
@Autowired
|
||||
@ -25,6 +25,16 @@ public class AgentCOneServiceImpl extends AbstractAgentService<AgentCOneVO, Agen
|
||||
this.mapper = agentCOneMapper;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int countAllLogMoveCnt(AgentCOneVO agentVO) {
|
||||
return mapper.findAllLogMoveCnt(agentVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int countByLogMoveCntWhereMsgTypeAndMessage(AgentCOneVO agentVO) {
|
||||
return mapper.countByLogMoveCntWhereMsgTypeAndMessage(agentVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int countByCondition(AgentCOneVO agentVO) {
|
||||
return mapper.countBySendStatusNotAndMsgType(agentVO);
|
||||
@ -61,6 +71,7 @@ public class AgentCOneServiceImpl extends AbstractAgentService<AgentCOneVO, Agen
|
||||
}
|
||||
|
||||
|
||||
|
||||
private String modifyPhoneNumber(String phone, int index) {
|
||||
// 휴대폰 번호는 010-XXXX-YYYY 형식으로 가정
|
||||
String prefix = phone.substring(0, 4); // "010-" 부분
|
||||
|
||||
@ -2,8 +2,6 @@ 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 com.itn.admin.cmn.msg.RestResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
@ -40,10 +38,22 @@ public class AgentCOneRestController {
|
||||
}
|
||||
|
||||
/*
|
||||
* client db에 insert 됐는지 확인 count
|
||||
* client LOG TB에 insert 됐는지 확인 count
|
||||
* 리포트할때 ''현재'' 데이터가 LOG 테이블에 이동됐는지 확인
|
||||
* select cnt MESSAGE LIKE CONCAT(#{message}, '%')
|
||||
* */
|
||||
// @PostMapping("/agent/two/findByReportCnt")
|
||||
// public ResponseEntity<RestResponse> findByReportCnt(@RequestBody AgentCTwoVO agentCTwoVO) throws Exception {
|
||||
// return ResponseEntity.ok().body(agentCTwoService.findByReportCnt(agentCTwoVO));
|
||||
// }
|
||||
@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));
|
||||
}
|
||||
}
|
||||
|
||||
@ -24,4 +24,8 @@ public interface AgentCTwoMapper {
|
||||
void insertAgents(List<AgentCTwoVO> agentCTwoVO);
|
||||
|
||||
int countBySendStatusNotAndMsgType(AgentCTwoVO agentCTwoVO);
|
||||
|
||||
int countByLogMoveCntWhereMsgTypeAndMessage(AgentCTwoVO agentVO);
|
||||
|
||||
int findAllLogMoveCnt(AgentCTwoVO agentVO);
|
||||
}
|
||||
|
||||
@ -12,5 +12,7 @@ public interface AgentCTwoService {
|
||||
|
||||
RestResponse findByInsertCnt(AgentCTwoVO agentCTwoVO);
|
||||
|
||||
// RestResponse findByReportCnt(AgentCTwoVO agentCTwoVO);
|
||||
RestResponse findByLogMoveCntWhereMessage(AgentCTwoVO agentCTwoVO);
|
||||
|
||||
RestResponse findAllLogMoveCnt(AgentCTwoVO agentCTwoVO);
|
||||
}
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
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.service.AgentCOneService;
|
||||
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;
|
||||
@ -26,11 +25,22 @@ 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 int countAllLogMoveCnt(AgentCTwoVO agentVO) {
|
||||
return mapper.findAllLogMoveCnt(agentVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int countByCondition(AgentCTwoVO agentVO) {
|
||||
return mapper.countBySendStatusNotAndMsgType(agentVO);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected int parseSendCount(AgentCTwoVO agentVO) {
|
||||
try {
|
||||
|
||||
@ -36,10 +36,21 @@ public class AgentCTwoRestController {
|
||||
}
|
||||
|
||||
/*
|
||||
* client db에 insert 됐는지 확인 count
|
||||
* client LOG TB에 insert 됐는지 확인 count
|
||||
* 리포트할때 ''현재'' 데이터가 LOG 테이블에 이동됐는지 확인
|
||||
* select cnt WHERE MESSAGE LIKE CONCAT(#{message}, '%')
|
||||
* */
|
||||
// @PostMapping("/agent/two/findByReportCnt")
|
||||
// public ResponseEntity<RestResponse> findByReportCnt(@RequestBody AgentCTwoVO agentCTwoVO) throws Exception {
|
||||
// return ResponseEntity.ok().body(agentCTwoService.findByReportCnt(agentCTwoVO));
|
||||
// }
|
||||
@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));
|
||||
}
|
||||
}
|
||||
|
||||
@ -19,4 +19,8 @@ public interface AgentSMapper {
|
||||
int countByCurStateAndUserId(AgentSVO agentSVO);
|
||||
|
||||
int updateReportWhereUserId(AgentSVO agentSVO);
|
||||
|
||||
String findByCurStateAndUserIdAndSmsTxt(AgentSVO agentSVO);
|
||||
|
||||
int updateReportWhereUserIdAndMassage(AgentSVO agentSVO);
|
||||
}
|
||||
|
||||
@ -78,6 +78,14 @@ public class AgentSVO implements Serializable {
|
||||
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;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -10,4 +10,6 @@ public interface AgentSService {
|
||||
RestResponse findByTransferCnt(AgentSVO agentSVO);
|
||||
|
||||
RestResponse serverReport(AgentSVO agentSVO);
|
||||
|
||||
RestResponse nowDataReport(AgentSVO agentSVO);
|
||||
}
|
||||
|
||||
@ -21,14 +21,28 @@ public class AgentSServiceImpl implements AgentSService {
|
||||
@Override
|
||||
public RestResponse findByTransferCnt(AgentSVO agentSVO) {
|
||||
|
||||
int cnt = agentSMapper.countByCurStateAndUserId(agentSVO);
|
||||
// int cnt = agentSMapper.countByCurStateAndUserId(agentSVO);
|
||||
String cntTxt = agentSMapper.findByCurStateAndUserIdAndSmsTxt(agentSVO);
|
||||
|
||||
return new RestResponse(HttpStatus.OK,"", cnt);
|
||||
cntTxt = cntTxt.replace(agentSVO.getMessage(),"").trim();
|
||||
return new RestResponse(HttpStatus.OK,"", cntTxt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RestResponse serverReport(AgentSVO agentSVO) {
|
||||
int cnt = agentSMapper.updateReportWhereUserId(agentSVO);
|
||||
return new RestResponse(HttpStatus.OK,"report를 시작합니다.", cnt);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -30,11 +30,20 @@ public class AgentSRestController {
|
||||
/*
|
||||
* 전송사가 리턴해준것처럼
|
||||
* server DB에 update 함
|
||||
* @@ 대량 없뎃
|
||||
* @@ 모든 데이터 대량 없뎃
|
||||
* */
|
||||
@PostMapping("/agent/server/report")
|
||||
@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));
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,6 +6,8 @@ mybatis.mapper-locations=classpath:mapper/**/*.xml
|
||||
# model camel case set
|
||||
mybatis.configuration.map-underscore-to-camel-case=true
|
||||
|
||||
mybatis.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
|
||||
|
||||
server.servlet.session.timeout=30m
|
||||
|
||||
#sql \ucd9c\ub825 log \uc124\uc815
|
||||
@ -27,7 +29,6 @@ spring.main.datasource.jdbc-url=jdbc:log4jdbc:mysql://119.193.215.98:3306/itn_ad
|
||||
spring.main.datasource.username=itnAdmin
|
||||
spring.main.datasource.password=itntest123
|
||||
|
||||
|
||||
#
|
||||
spring.commute.datasource.driverClassName=net.sf.log4jdbc.sql.jdbcapi.DriverSpy
|
||||
spring.commute.datasource.jdbc-url=jdbc:log4jdbc:mysql://192.168.0.200:3312/biostar2_ac?serverTimezone=Asia/Seoul
|
||||
|
||||
@ -45,7 +45,7 @@
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
|
||||
<!-- 대량 개수만큼 insert 됐는지 확인 -->
|
||||
<select id="countBySendStatusNotAndMsgType" resultType="Integer" parameterType="agentCOneVO">
|
||||
/* one countBySendStatusNotAndMsgType */
|
||||
SELECT
|
||||
@ -56,4 +56,28 @@
|
||||
and MSG_TYPE = #{msgType}
|
||||
</select>
|
||||
|
||||
<!-- 리포트할때 현재 데이터가 LOG 테이블에 이동됐는지 확인 -->
|
||||
<select id="countByLogMoveCntWhereMsgTypeAndMessage" resultType="Integer" parameterType="agentCTwoVO">
|
||||
/* one countByLogMoveCntWhereMsgTypeAndMessage */
|
||||
SELECT
|
||||
count(*) as cnt
|
||||
FROM
|
||||
MUNJAON_MSG_LOG
|
||||
WHERE SEND_STATUS = 1000
|
||||
and MSG_TYPE = #{msgType}
|
||||
and MESSAGE LIKE CONCAT(#{message}, '%')
|
||||
</select>
|
||||
|
||||
<!-- 리포트할때 전체 데이터가 LOG 테이블에 이동됐느지 확인 -->
|
||||
<select id="countByLogMoveCntWhereMsgType" resultType="Integer" parameterType="agentCTwoVO">
|
||||
/* one countByLogMoveCntWhereMsgType */
|
||||
SELECT
|
||||
count(*) as cnt
|
||||
FROM
|
||||
MUNJAON_MSG_LOG
|
||||
WHERE SEND_STATUS = 1000
|
||||
and MSG_TYPE = #{msgType}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@ -45,7 +45,7 @@
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
|
||||
<!-- 대량 개수만큼 insert 됐는지 확인 -->
|
||||
<select id="countBySendStatusNotAndMsgType" resultType="Integer" parameterType="agentCTwoVO">
|
||||
/* two countBySendStatusNotAndMsgType */
|
||||
SELECT
|
||||
@ -54,6 +54,28 @@
|
||||
MUNJAON_MSG
|
||||
WHERE SEND_STATUS != 1000
|
||||
and MSG_TYPE = #{msgType}
|
||||
and MESSAGE LIKE CONCAT(#{message}, '%')
|
||||
</select>
|
||||
|
||||
<!-- 리포트할때 현재 데이터가 LOG 테이블에 이동됐는지 확인 -->
|
||||
<select id="countByLogMoveCntWhereMsgTypeAndMessage" resultType="Integer" parameterType="agentCTwoVO">
|
||||
/* one countByLogMoveCntWhereMsgTypeAndMessage */
|
||||
SELECT
|
||||
count(*) as cnt
|
||||
FROM
|
||||
MUNJAON_MSG_LOG
|
||||
WHERE SEND_STATUS = 1000
|
||||
and MSG_TYPE = #{msgType}
|
||||
and MESSAGE LIKE CONCAT(#{message}, '%')
|
||||
</select>
|
||||
|
||||
<!-- 리포트할때 전체 데이터가 LOG 테이블에 이동됐느지 확인 -->
|
||||
<select id="findAllLogMoveCnt" resultType="Integer" parameterType="agentCTwoVO">
|
||||
/* one findAllLogMoveCnt */
|
||||
SELECT
|
||||
count(*) as cnt
|
||||
FROM
|
||||
MUNJAON_MSG_LOG
|
||||
WHERE SEND_STATUS = 1000
|
||||
</select>
|
||||
</mapper>
|
||||
@ -6,6 +6,16 @@
|
||||
<mapper namespace="com.itn.admin.agent.server.mapper.AgentSMapper">
|
||||
|
||||
|
||||
<select id="findByCurStateAndUserIdAndSmsTxt" resultType="String" parameterType="agentSVO">
|
||||
|
||||
SELECT SMS_TXT
|
||||
FROM mj_msg_data
|
||||
WHERE SMS_TXT LIKE CONCAT(#{message}, '%')
|
||||
ORDER BY CAST(SUBSTRING(SMS_TXT, LENGTH(#{message}) + 2) AS UNSIGNED) DESC
|
||||
LIMIT 1
|
||||
|
||||
</select>
|
||||
|
||||
<select id="countByCurStateAndUserId" resultType="Integer" parameterType="agentSVO">
|
||||
SELECT
|
||||
count(*)
|
||||
@ -28,5 +38,17 @@
|
||||
</update>
|
||||
|
||||
|
||||
<update id="updateReportWhereUserIdAndMassage" parameterType="agentSVO">
|
||||
UPDATE mj_msg_data SET
|
||||
CUR_STATE = 3,
|
||||
SENT_DATE = NOW(),
|
||||
RSLT_DATE = NOW(),
|
||||
RSLT_CODE = 1000,
|
||||
RSLT_NET = 'SKT'
|
||||
WHERE CUR_STATE <![CDATA[ < ]]>3
|
||||
AND USER_ID = #{userId}
|
||||
AND SMS_TXT LIKE CONCAT(#{message}, '%');
|
||||
</update>
|
||||
|
||||
|
||||
</mapper>
|
||||
@ -12,11 +12,10 @@ let oneIntervalId_reporingSeconds;
|
||||
|
||||
|
||||
|
||||
function fn_oneScriptStart(){
|
||||
function fn_oneInsertScriptStart(){
|
||||
// 건수를 현황확인으로 이동
|
||||
$('#divOneSmsCard .sendCntTxt').text('('+$('#divOneSms .sliderValue').val()+'건)');
|
||||
oneStartInsertTimer(); // insert 타임어택 시작
|
||||
oneStartTransferTimer($('#oneUserId').val()); // 이관 카운트
|
||||
}
|
||||
|
||||
|
||||
@ -88,6 +87,7 @@ function fn_oneInsertCntAndTime(){
|
||||
console.log(' one cnt >= numberOnly :', cnt >= numberOnly);
|
||||
if(cnt >= numberOnly){
|
||||
oneStopInsertTimer();
|
||||
oneStartTransferTimer($('#oneUserId').val()); // 이관 카운트
|
||||
}
|
||||
}
|
||||
else {
|
||||
@ -108,6 +108,7 @@ function fn_oneInsertCntAndTime(){
|
||||
|
||||
|
||||
|
||||
// 이관 타이머 start
|
||||
function oneStartTransferTimer(userId) {
|
||||
console.log(' :: one startTransferTimer :: ');
|
||||
let startTime = Date.now();
|
||||
|
||||
@ -7,21 +7,20 @@ let twoReporingCntIntervalId;
|
||||
let twoIntervalId_insertSeconds;
|
||||
// 이관 타이머
|
||||
let twoIntervalId_transferSeconds;
|
||||
// 이관 타이머
|
||||
// 리포트 타이머
|
||||
let twoIntervalId_reporingSeconds;
|
||||
|
||||
|
||||
|
||||
function fn_twoScriptStart(){
|
||||
function fn_twoInsertScriptStart(){
|
||||
// 건수를 현황확인으로 이동
|
||||
$('#divTwoSmsCard .sendCntTxt').text('('+$('#divTwoSms .sliderValue').val()+'건)');
|
||||
twoStartInsertTimer(); // insert 타임어택 시작
|
||||
twoStartTransferTimer($('#twoUserId').val()); // 이관 카운트
|
||||
}
|
||||
|
||||
|
||||
function fn_twoReportScriptStart(){
|
||||
twoStartReportTimer($('#twoUserId').val()); // report 타임어택 시작
|
||||
function fn_twoReportScriptStart(ajaxUrl){
|
||||
twoStartReportTimer($('#twoUserId').val(), ajaxUrl); // report 타임어택 시작
|
||||
}
|
||||
|
||||
|
||||
@ -74,7 +73,7 @@ function fn_twoInsertCntAndTime(){
|
||||
contentType: 'application/json',
|
||||
// async: true,
|
||||
success: function (data) {
|
||||
console.log('insert data : ', data);
|
||||
// console.log('insert data : ', data);
|
||||
|
||||
if (data.status == 'OK') {
|
||||
var cnt = data.data;
|
||||
@ -82,10 +81,11 @@ function fn_twoInsertCntAndTime(){
|
||||
$('#divTwoSmsCard .insertCnt').text(cnt);
|
||||
let text = $('#divTwoSmsCard .sendCntTxt').text();
|
||||
let numberOnly = text.match(/\d+/)[0];
|
||||
console.log('numberOnly :', numberOnly);
|
||||
console.log('cnt >= numberOnly :', cnt >= numberOnly);
|
||||
// console.log('numberOnly :', numberOnly);
|
||||
// console.log('cnt >= numberOnly :', cnt >= numberOnly);
|
||||
if(cnt >= numberOnly){
|
||||
twoStopInsertTimer();
|
||||
twoStartTransferTimer($('#twoUserId').val()); // 이관 카운트
|
||||
}
|
||||
}
|
||||
else {
|
||||
@ -105,7 +105,7 @@ function fn_twoInsertCntAndTime(){
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 이관 타이머 start
|
||||
function twoStartTransferTimer(userId) {
|
||||
console.log(' :: two startTransferTimer :: ');
|
||||
let startTime = Date.now();
|
||||
@ -139,6 +139,7 @@ function fn_twoTranferCntAndTime(userId){
|
||||
// 폼 데이터를 수집
|
||||
var formData = new FormData($("#divTwoSms .sendForm")[0]);
|
||||
|
||||
console.log('? :: ', formData);
|
||||
var jsonObject = {};
|
||||
formData.forEach((value, key) => {
|
||||
jsonObject[key] = value;
|
||||
@ -154,7 +155,7 @@ function fn_twoTranferCntAndTime(userId){
|
||||
contentType: 'application/json',
|
||||
// async: true,
|
||||
success: function (data) {
|
||||
console.log('tranfer data : ', data);
|
||||
// console.log('tranfer data : ', data);
|
||||
|
||||
if (data.status == 'OK') {
|
||||
var cnt = data.data;
|
||||
@ -162,7 +163,10 @@ function fn_twoTranferCntAndTime(userId){
|
||||
$('#divTwoSmsCard .transferCnt').text(cnt);
|
||||
let text = $('#divTwoSmsCard .insertCnt').text();
|
||||
let numberOnly = text.match(/\d+/)[0];
|
||||
if(cnt >= numberOnly){
|
||||
// console.log('numberOnly : ', numberOnly);
|
||||
// console.log('cnt : ', cnt);
|
||||
// console.log('cnt >= numberOnly : ', cnt >= Number(numberOnly));
|
||||
if(cnt >= Number(numberOnly)){
|
||||
twoStopTransferTimer();
|
||||
}
|
||||
}
|
||||
@ -185,10 +189,10 @@ function fn_twoTranferCntAndTime(userId){
|
||||
// 리포트 영역
|
||||
// 리포트 영역
|
||||
// 리포트 영역
|
||||
function twoStartReportTimer(userId) {
|
||||
function twoStartReportTimer(userId, ajaxUrl) {
|
||||
console.log(' :: startReportTimer :: ');
|
||||
let startTime = Date.now();
|
||||
twoStartReporingCntTimer(userId);
|
||||
twoStartReporingCntTimer(userId, ajaxUrl);
|
||||
twoIntervalId_reporingSeconds = setInterval(function() {
|
||||
let currentTime = Date.now();
|
||||
let elapsedTime = (currentTime - startTime) / 1000; // 밀리초를 초 단위로 변환
|
||||
@ -196,10 +200,10 @@ function twoStartReportTimer(userId) {
|
||||
}, 1);
|
||||
}
|
||||
|
||||
function twoStartReporingCntTimer(userId) {
|
||||
function twoStartReporingCntTimer(userId, ajaxUrl) {
|
||||
// 1초마다 fn_twoReportCntAndTime 함수를 호출
|
||||
twoReporingCntIntervalId = setInterval(function() {
|
||||
fn_twoReportCntAndTime(userId);
|
||||
fn_twoReportCntAndTime(userId, ajaxUrl);
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
@ -210,7 +214,7 @@ function twoStopReporingTimer() {
|
||||
}
|
||||
|
||||
|
||||
function fn_twoReportCntAndTime(userId){
|
||||
function fn_twoReportCntAndTime(userId, ajaxUrl){
|
||||
|
||||
// 폼 데이터를 수집
|
||||
var formData = new FormData($("#divTwoSms .sendForm")[0]);
|
||||
@ -221,21 +225,29 @@ function fn_twoReportCntAndTime(userId){
|
||||
});
|
||||
jsonObject['userId'] = userId;
|
||||
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/agent/two/findByInsertCnt",
|
||||
url: ajaxUrl,
|
||||
data: JSON.stringify(jsonObject), // JSON 문자열로 변환된 데이터를 전송
|
||||
dataType: 'json',
|
||||
contentType: 'application/json',
|
||||
// async: true,
|
||||
success: function (data) {
|
||||
console.log('tranfer data : ', data);
|
||||
// console.log('tranfer data : ', data);
|
||||
|
||||
if (data.status == 'OK') {
|
||||
var cnt = data.data;
|
||||
|
||||
// 리포트 영역에 cnt 추가
|
||||
$('#divTwoSmsCard .reportSndCnt').text(cnt);
|
||||
if(cnt == 0){
|
||||
// server DB에 update한 건수와 cnt비교
|
||||
var reportStartCnt = $('#divTwoSmsCard .reportStartCnt').text();
|
||||
|
||||
console.log('cnt : ', cnt);
|
||||
console.log('reportStartCnt : ', reportStartCnt);
|
||||
console.log('');
|
||||
if(cnt >= Number(reportStartCnt)){
|
||||
twoStopReporingTimer();
|
||||
}
|
||||
}
|
||||
|
||||
@ -66,6 +66,11 @@
|
||||
.toggle-info-btn.rotate i {
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
|
||||
.nowCardCTwo{
|
||||
background-color: beige;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
</head>
|
||||
@ -192,7 +197,7 @@
|
||||
<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="건수">
|
||||
<input type="text" class="form-control sliderValue" id="sendCnt1" name="sendCnt" placeholder="건수" autocomplete="off">
|
||||
<div class="slider mt-2" id="slider1"></div>
|
||||
</div>
|
||||
</div>
|
||||
@ -287,7 +292,7 @@
|
||||
<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="건수" >
|
||||
<input type="text" class="form-control sliderValue" id="sendCnt" name="sendCnt" placeholder="건수" autocomplete="off">
|
||||
<div class="slider mt-2" id="slider"></div>
|
||||
</div>
|
||||
</div>
|
||||
@ -307,6 +312,105 @@
|
||||
|
||||
|
||||
|
||||
<!-- 새로운 현황 섹션 -->
|
||||
<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">
|
||||
<!-- 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="client1MsgCnt">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="client1MsgLogCnt">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="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">
|
||||
<!-- 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>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="card" id="divOneSmsCard">
|
||||
@ -363,7 +467,7 @@
|
||||
<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="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>
|
||||
@ -383,7 +487,7 @@
|
||||
<!-- Reporting start 버튼 -->
|
||||
<div class="row">
|
||||
<div class="col-12 text-left">
|
||||
<button class="btn btn-primary reportingStartBtn" data-tagid="oneUserId">Reporting start</button>
|
||||
<button class="btn btn-primary rprtAllStrtBtn" data-tagid="oneUserId">Reporting start</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -445,7 +549,7 @@
|
||||
<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="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>
|
||||
@ -465,7 +569,14 @@
|
||||
<!-- Reporting start 버튼 -->
|
||||
<div class="row">
|
||||
<div class="col-12 text-left">
|
||||
<button class="btn btn-primary reportingStartBtn" data-tagid="twoUserId">Reporting start</button>
|
||||
<!-- <button class="btn btn-success newButtonClass">Now data report start</button> <!– 새로운 버튼 추가 –>-->
|
||||
<!-- <button class="btn btn-danger rprtAllStrtBtn" data-tagid="twoUserId">ALL data Reporting start</button>-->
|
||||
<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>
|
||||
@ -532,7 +643,7 @@
|
||||
contentType: 'application/json',
|
||||
// async: true,
|
||||
success: function (data) {
|
||||
console.log('data : ', data);
|
||||
// console.log('data : ', data);
|
||||
|
||||
if (data.status === 'OK') {
|
||||
fn_successAlert('경과시간 : '+data.data, data.msg);
|
||||
@ -547,7 +658,7 @@
|
||||
console.log("ERROR : " + JSON.stringify(e));
|
||||
},
|
||||
beforeSend : function(xmlHttpRequest) {
|
||||
fn_oneScriptStart();
|
||||
fn_oneInsertScriptStart();
|
||||
|
||||
},
|
||||
complete : function(xhr, textStatus) {
|
||||
@ -561,7 +672,9 @@
|
||||
/*
|
||||
* client_1 reporting 버튼
|
||||
* */
|
||||
$("#divOneSmsCard .reportingStartBtn").on("click", function () {
|
||||
$("#divOneSmsCard .rprtAllStrtBtn").on("click", function () {
|
||||
|
||||
var ajaxUrl = '/agent/one/findByLogMoveCnt'
|
||||
// 폼 데이터를 수집
|
||||
var formData = new FormData($("#divTwoSms .sendForm")[0]);
|
||||
|
||||
@ -576,15 +689,21 @@
|
||||
console.log('jsonObject : ', jsonObject);
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/agent/server/report",
|
||||
url: "/agent/server/allReport",
|
||||
data: JSON.stringify(jsonObject), // JSON 문자열로 변환된 데이터를 전송
|
||||
dataType: 'json',
|
||||
contentType: 'application/json',
|
||||
// async: true,
|
||||
success: function (data) {
|
||||
console.log('data : ', data);
|
||||
// console.log('data : ', data);
|
||||
|
||||
if (data.status === 'OK') {
|
||||
if(data.data < 1){
|
||||
alert('리포팅할 데이터가 없습니다.');
|
||||
oneStopInsertTimer();
|
||||
return false;
|
||||
}
|
||||
|
||||
$("#divTwoSmsCard .reportStartCnt").text(data.data);
|
||||
fn_successAlert(data.data+'건', data.msg);
|
||||
}
|
||||
@ -596,7 +715,10 @@
|
||||
alert("저장에 실패하였습니다.");
|
||||
console.log("ERROR : " + JSON.stringify(e));
|
||||
},
|
||||
beforeSend : function(xmlHttpRequest) {
|
||||
beforeSend : function(xmlHttpRequest, data) {
|
||||
if(data.data > 0){
|
||||
return false;
|
||||
}
|
||||
// 건수를 현황확인으로 이동
|
||||
fn_oneReportScriptStart();
|
||||
|
||||
@ -607,6 +729,71 @@
|
||||
});
|
||||
});
|
||||
|
||||
/*
|
||||
* client_1 reporting 버튼
|
||||
* */
|
||||
$("#divOneSmsCard .rprtCrrntStrtBtn").on("click", function () {
|
||||
|
||||
var ajaxUrl = '/agent/one/findByLogMoveCntWhereMessage'
|
||||
|
||||
// 폼 데이터를 수집
|
||||
var formData = new FormData($("#divTwoSms .sendForm")[0]);
|
||||
|
||||
var jsonObject = {};
|
||||
formData.forEach((value, key) => {
|
||||
jsonObject[key] = value;
|
||||
});
|
||||
var usertagId = '#'+$(this).data('tagid');
|
||||
jsonObject['userId'] = $(usertagId).val();
|
||||
|
||||
// console.log('two rprtCrrntStrtBtn jsonObject : ', jsonObject);
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/agent/server/nowDataReport",
|
||||
data: JSON.stringify(jsonObject), // JSON 문자열로 변환된 데이터를 전송
|
||||
dataType: 'json',
|
||||
contentType: 'application/json',
|
||||
// async: true,
|
||||
success: function (data) {
|
||||
// console.log('two rprtCrrntStrtBtn data : ', data);
|
||||
|
||||
if (data.status === 'OK') {
|
||||
if(data.data < 1){
|
||||
alert('리포팅할 데이터가 없습니다.');
|
||||
oneStopInsertTimer();
|
||||
return false;
|
||||
}
|
||||
var $oriTag = $("#divOneSmsCard .reportStartCnt");
|
||||
var oriText = $oriTag.text();
|
||||
var dataCnt = data.data;
|
||||
var totalCnt = dataCnt;
|
||||
if(Number(oriText) > 0){
|
||||
totalCnt = dataCnt + Number(oriText);
|
||||
$("#divOneSmsCard .reportStartSubCnt").text(' (+'+dataCnt+')');
|
||||
}
|
||||
$oriTag.text(totalCnt);
|
||||
fn_successAlert(data.data+'건', data.msg);
|
||||
}
|
||||
else {
|
||||
alert("오류 알림 : :: "+data.msg);
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
alert("저장에 실패하였습니다.");
|
||||
console.log("ERROR : " + JSON.stringify(e));
|
||||
},
|
||||
beforeSend : function(data) {
|
||||
if(data.data > 0){
|
||||
return false;
|
||||
}
|
||||
fn_oneReportScriptStart(ajaxUrl);
|
||||
|
||||
},
|
||||
complete : function(xhr, textStatus) {
|
||||
oneStopInsertTimer();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// client_2 영역
|
||||
// client_2 영역
|
||||
@ -617,6 +804,7 @@
|
||||
* client_2 msg insert
|
||||
* */
|
||||
$("#divTwoSms .sendBtn").on("click", function () {
|
||||
console.log('#divTwoSms .sendBtn ');
|
||||
// 폼 데이터를 수집
|
||||
var formData = new FormData($("#divTwoSms .sendForm")[0]);
|
||||
|
||||
@ -630,7 +818,6 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
console.log('two sendBtn : ', jsonObject);
|
||||
|
||||
|
||||
@ -642,7 +829,7 @@
|
||||
contentType: 'application/json',
|
||||
// async: true,
|
||||
success: function (data) {
|
||||
console.log('data : ', data);
|
||||
// console.log('data : ', data);
|
||||
|
||||
if (data.status === 'OK') {
|
||||
fn_successAlert('경과시간 : '+data.data, data.msg);
|
||||
@ -657,7 +844,7 @@
|
||||
console.log("ERROR : " + JSON.stringify(e));
|
||||
},
|
||||
beforeSend : function(xmlHttpRequest) {
|
||||
fn_twoScriptStart();
|
||||
fn_twoInsertScriptStart();
|
||||
|
||||
},
|
||||
complete : function(xhr, textStatus) {
|
||||
@ -671,7 +858,9 @@
|
||||
/*
|
||||
* client_2 reporting 버튼
|
||||
* */
|
||||
$("#divTwoSmsCard .reportingStartBtn").on("click", function () {
|
||||
$("#divTwoSmsCard .rprtAllStrtBtn").on("click", function () {
|
||||
|
||||
var ajaxUrl = '/agent/two/findByLogMoveCnt'
|
||||
// 폼 데이터를 수집
|
||||
var formData = new FormData($("#divTwoSms .sendForm")[0]);
|
||||
|
||||
@ -685,15 +874,22 @@
|
||||
console.log('jsonObject : ', jsonObject);
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/agent/server/report",
|
||||
url: "/agent/server/allReport",
|
||||
data: JSON.stringify(jsonObject), // JSON 문자열로 변환된 데이터를 전송
|
||||
dataType: 'json',
|
||||
contentType: 'application/json',
|
||||
// async: true,
|
||||
success: function (data) {
|
||||
console.log('data : ', data);
|
||||
// console.log('data : ', data);
|
||||
|
||||
if (data.status === 'OK') {
|
||||
if(data.data < 1){
|
||||
alert('리포팅할 데이터가 없습니다.');
|
||||
oneStopInsertTimer();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
$("#divTwoSmsCard .reportStartCnt").text(data.data);
|
||||
fn_successAlert(data.data+'건', data.msg);
|
||||
}
|
||||
@ -705,9 +901,11 @@
|
||||
alert("저장에 실패하였습니다.");
|
||||
console.log("ERROR : " + JSON.stringify(e));
|
||||
},
|
||||
beforeSend : function(xmlHttpRequest) {
|
||||
// 건수를 현황확인으로 이동
|
||||
fn_twoReportScriptStart();
|
||||
beforeSend : function(xmlHttpRequest, data) {
|
||||
if(data.data > 0){
|
||||
return false;
|
||||
}
|
||||
fn_twoReportScriptStart(ajaxUrl);
|
||||
|
||||
},
|
||||
complete : function(xhr, textStatus) {
|
||||
@ -715,9 +913,74 @@
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
/*
|
||||
* client_2 reporting 버튼
|
||||
* */
|
||||
$("#divTwoSmsCard .rprtCrrntStrtBtn").on("click", function () {
|
||||
|
||||
var ajaxUrl = '/agent/two/findByLogMoveCntWhereMessage'
|
||||
|
||||
// 폼 데이터를 수집
|
||||
var formData = new FormData($("#divTwoSms .sendForm")[0]);
|
||||
|
||||
var jsonObject = {};
|
||||
formData.forEach((value, key) => {
|
||||
jsonObject[key] = value;
|
||||
});
|
||||
var usertagId = '#'+$(this).data('tagid');
|
||||
jsonObject['userId'] = $(usertagId).val();
|
||||
|
||||
// console.log('two rprtCrrntStrtBtn jsonObject : ', jsonObject);
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/agent/server/nowDataReport",
|
||||
data: JSON.stringify(jsonObject), // JSON 문자열로 변환된 데이터를 전송
|
||||
dataType: 'json',
|
||||
contentType: 'application/json',
|
||||
// async: true,
|
||||
success: function (data) {
|
||||
// console.log('two rprtCrrntStrtBtn data : ', data);
|
||||
|
||||
if (data.status === 'OK') {
|
||||
if(data.data < 1){
|
||||
alert('리포팅할 데이터가 없습니다.');
|
||||
twoStopInsertTimer();
|
||||
return false;
|
||||
}
|
||||
var $oriTag = $("#divTwoSmsCard .reportStartCnt");
|
||||
var oriText = $oriTag.text();
|
||||
var dataCnt = data.data;
|
||||
var totalCnt = dataCnt;
|
||||
if(Number(oriText) > 0){
|
||||
totalCnt = dataCnt + Number(oriText);
|
||||
$("#divTwoSmsCard .reportStartSubCnt").text(' (+'+dataCnt+')');
|
||||
}
|
||||
$oriTag.text(totalCnt);
|
||||
fn_successAlert(data.data+'건', data.msg);
|
||||
}
|
||||
else {
|
||||
alert("오류 알림 : :: "+data.msg);
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
alert("저장에 실패하였습니다.");
|
||||
console.log("ERROR : " + JSON.stringify(e));
|
||||
},
|
||||
beforeSend : function(data) {
|
||||
if(data.data > 0){
|
||||
return false;
|
||||
}
|
||||
fn_twoReportScriptStart(ajaxUrl);
|
||||
|
||||
},
|
||||
complete : function(xhr, textStatus) {
|
||||
twoStopInsertTimer();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
function fn_successAlert(title, msg){
|
||||
$(document).Toasts('create', {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user