Compare commits
No commits in common. "master" and "kakaoFT" have entirely different histories.
2
.claude/.gitignore
vendored
2
.claude/.gitignore
vendored
@ -1,2 +0,0 @@
|
||||
/settings.local.json
|
||||
/mcp_settings.json
|
||||
BIN
.claude/etc1.png
BIN
.claude/etc1.png
Binary file not shown.
|
Before Width: | Height: | Size: 73 KiB |
BIN
.claude/etc2.png
BIN
.claude/etc2.png
Binary file not shown.
|
Before Width: | Height: | Size: 46 KiB |
13
.gitignore
vendored
13
.gitignore
vendored
@ -96,9 +96,6 @@ local.properties
|
||||
|
||||
# End of https://www.gitignore.io/api/eclipse
|
||||
|
||||
# gemini
|
||||
.gemini/
|
||||
|
||||
# Maven
|
||||
target/
|
||||
pom.xml.tag
|
||||
@ -201,13 +198,3 @@ fabric.properties
|
||||
rebel.xml
|
||||
/mvnw
|
||||
/mvnw.cmd
|
||||
/.gemini
|
||||
/.gemini.zip
|
||||
/CLAUDE.md
|
||||
|
||||
<<<<<<< HEAD
|
||||
# Mac OS
|
||||
=======
|
||||
### Mac OS ###
|
||||
>>>>>>> refs/heads/5419_전화번호거짓표시50건이상
|
||||
.DS_Store
|
||||
85
pom.xml
85
pom.xml
@ -54,8 +54,28 @@
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>maven-public</id>
|
||||
<url>http://nexus.iten.co.kr:9999/repository/maven-public/</url>
|
||||
<id>mvn2</id>
|
||||
<url>https://repo1.maven.org/maven2/</url>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>egovframe</id>
|
||||
<url>https://www.egovframe.go.kr/maven/</url>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
<snapshots>
|
||||
<enabled>false</enabled>
|
||||
</snapshots>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>egovframe2</id>
|
||||
<url>http://maven.egovframe.kr:8080/maven/</url>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
@ -63,6 +83,12 @@
|
||||
<enabled>false</enabled>
|
||||
</snapshots>
|
||||
</repository>
|
||||
<!-- Komoran 형태소분석기 -->
|
||||
<repository>
|
||||
<id>jitpack.io</id>
|
||||
<url>https://jitpack.io</url>
|
||||
</repository>
|
||||
<!-- Komoran 형태소분석기 -->
|
||||
</repositories>
|
||||
|
||||
<dependencies>
|
||||
@ -85,7 +111,6 @@
|
||||
<groupId>egovframework.rte</groupId>
|
||||
<artifactId>egovframework.rte.fdl.idgnr</artifactId>
|
||||
<version>${egovframework.rte.version}</version>
|
||||
<!--<version>4.2.0</version>-->
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>egovframework.rte</groupId>
|
||||
@ -118,12 +143,11 @@
|
||||
<version>1.1.2</version>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/cglib/cglib -->
|
||||
<dependency>
|
||||
<groupId>cglib</groupId>
|
||||
<artifactId>cglib</artifactId>
|
||||
<version>3.3.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cglib</groupId>
|
||||
<artifactId>cglib</artifactId>
|
||||
<version>3.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.antlr</groupId>
|
||||
@ -146,7 +170,7 @@
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>5.1.49</version>
|
||||
<version>5.1.31</version>
|
||||
</dependency>
|
||||
|
||||
<!-- oracle 10g driver -->
|
||||
@ -477,19 +501,12 @@
|
||||
</dependency>
|
||||
|
||||
<!-- kmc 본인인증 -->
|
||||
<!-- <dependency>
|
||||
<dependency>
|
||||
<groupId>kmc</groupId>
|
||||
<artifactId>ICERTSecu_JDK18</artifactId>
|
||||
<version>1</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${basedir}/src/main/webapp/WEB-INF/lib/ICERTSecu_JDK18.jar</systemPath>
|
||||
</dependency> -->
|
||||
|
||||
<!-- kmc 본인인증 ver 2 암호화 모듈 추가 버전 -->
|
||||
<dependency>
|
||||
<groupId>kmc</groupId>
|
||||
<artifactId>ICERTSecu</artifactId>
|
||||
<version>JDK18_v2</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
@ -540,37 +557,7 @@
|
||||
<artifactId>KOMORAN</artifactId>
|
||||
<version>3.3.4</version>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.18.24</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
|
||||
<!-- valkey -->
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.session</groupId>
|
||||
<artifactId>spring-session</artifactId>
|
||||
<version>1.3.1.RELEASE</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>redis.clients</groupId>
|
||||
<artifactId>jedis</artifactId>
|
||||
<version>2.9.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.data</groupId>
|
||||
<artifactId>spring-data-redis</artifactId>
|
||||
<version>1.8.11.RELEASE</version>
|
||||
</dependency>
|
||||
|
||||
<!-- valkey -->
|
||||
<!-- Komoran 형태소 분석기 -->
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
@ -1,10 +0,0 @@
|
||||
package egovframework.com.idgen;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import egovframework.rte.fdl.cmmn.exception.FdlException;
|
||||
import egovframework.rte.fdl.idgnr.EgovIdGnrService;
|
||||
|
||||
public interface CustomIdGnrService extends EgovIdGnrService {
|
||||
List<String> getNextStringId(int count) throws FdlException;
|
||||
}
|
||||
@ -1,196 +0,0 @@
|
||||
package egovframework.com.idgen.impl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement; // java.sql.PreparedStatement로 임포트
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
import org.springframework.jdbc.datasource.DataSourceUtils;
|
||||
|
||||
import egovframework.com.idgen.CustomIdGnrService;
|
||||
import egovframework.rte.fdl.cmmn.exception.FdlException;
|
||||
import egovframework.rte.fdl.idgnr.EgovIdGnrStrategy;
|
||||
|
||||
public class CustomTableIdGnrServiceImpl implements CustomIdGnrService {
|
||||
|
||||
private long allocatedId;
|
||||
private long allocatedMaxId;
|
||||
private int blockSize = 10; // 기본값, 필요에 따라 변경
|
||||
private DataSource dataSource;
|
||||
private String table; // 실제 테이블 이름 (예: IDS)
|
||||
private String tableName; // TABLE_NAME 컬럼에서 사용할 값 (예: MSG_ID)
|
||||
private String columnName = "NEXT_ID"; // NEXT_ID 컬럼명
|
||||
private String prefix;
|
||||
private String fillChar = "0"; // 채울 문자 (예: 0)
|
||||
private int cipers = 13; // 자리수 (예: 14)
|
||||
private boolean applyYear;
|
||||
private boolean useBigDecimals = false;
|
||||
|
||||
@Override
|
||||
public synchronized List<String> getNextStringId(int count) throws FdlException {
|
||||
List<String> idList = new ArrayList<>(count);
|
||||
try {
|
||||
for (int i = 0; i < count; i++) {
|
||||
if (allocatedId >= allocatedMaxId) {
|
||||
allocateIdBlock(count);
|
||||
}
|
||||
long id = allocatedId++;
|
||||
idList.add(createStringId(id));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new FdlException("ID Generation Error", e);
|
||||
}
|
||||
return idList;
|
||||
}
|
||||
|
||||
private void allocateIdBlock(int requiredCount) throws SQLException, FdlException {
|
||||
Connection conn = DataSourceUtils.getConnection(dataSource);
|
||||
try {
|
||||
conn.setAutoCommit(false);
|
||||
|
||||
int newBlockSize = Math.max(this.blockSize, requiredCount);
|
||||
|
||||
// SELECT 쿼리 수정
|
||||
String query = "SELECT " + columnName + " FROM " + table + " WHERE TABLE_NAME = ? FOR UPDATE";
|
||||
try (PreparedStatement stmt = conn.prepareStatement(query)) {
|
||||
stmt.setString(1, tableName);
|
||||
try (ResultSet rs = stmt.executeQuery()) {
|
||||
long oldId = 0;
|
||||
if (rs.next()) {
|
||||
oldId = rs.getLong(1);
|
||||
} else {
|
||||
throw new FdlException(
|
||||
"ID Generation Error: No record found in " + table + " for TABLE_NAME = " + tableName);
|
||||
}
|
||||
|
||||
long newId = oldId + newBlockSize;
|
||||
|
||||
// UPDATE 쿼리 수정
|
||||
String update = "UPDATE " + table + " SET " + columnName + " = ? WHERE TABLE_NAME = ? AND "
|
||||
+ columnName + " = ?";
|
||||
try (PreparedStatement updateStmt = conn.prepareStatement(update)) {
|
||||
updateStmt.setLong(1, newId);
|
||||
updateStmt.setString(2, tableName);
|
||||
updateStmt.setLong(3, oldId);
|
||||
int row = updateStmt.executeUpdate();
|
||||
|
||||
if (row == 0) {
|
||||
throw new FdlException(
|
||||
"ID Generation Error: Failed to update ID. Possible concurrent modification.");
|
||||
}
|
||||
}
|
||||
|
||||
conn.commit();
|
||||
|
||||
allocatedId = oldId;
|
||||
allocatedMaxId = newId;
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
conn.rollback();
|
||||
throw e;
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
throw new FdlException("ID Generation Error", e);
|
||||
} finally {
|
||||
DataSourceUtils.releaseConnection(conn, dataSource);
|
||||
}
|
||||
}
|
||||
|
||||
private String createStringId(long id) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (prefix != null) {
|
||||
sb.append(prefix);
|
||||
}
|
||||
if (applyYear) {
|
||||
sb.append(new SimpleDateFormat("yyyy").format(new Date()));
|
||||
}
|
||||
String idStr = String.format("%0" + cipers + "d", id);
|
||||
sb.append(idStr);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
// 인터페이스의 다른 메서드 구현 (필요에 따라 UnsupportedOperationException 또는 직접 구현)
|
||||
@Override
|
||||
public BigDecimal getNextBigDecimalId() throws FdlException {
|
||||
throw new UnsupportedOperationException("getNextBigDecimalId is not supported");
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getNextLongId() throws FdlException {
|
||||
throw new UnsupportedOperationException("getNextLongId is not supported");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getNextIntegerId() throws FdlException {
|
||||
throw new UnsupportedOperationException("getNextIntegerId is not supported");
|
||||
}
|
||||
|
||||
@Override
|
||||
public short getNextShortId() throws FdlException {
|
||||
throw new UnsupportedOperationException("getNextShortId is not supported");
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte getNextByteId() throws FdlException {
|
||||
throw new UnsupportedOperationException("getNextByteId is not supported");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNextStringId() throws FdlException {
|
||||
throw new UnsupportedOperationException("getNextStringId is not supported");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNextStringId(String strategyId) throws FdlException {
|
||||
throw new UnsupportedOperationException("getNextStringId(String strategyId) is not supported");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNextStringId(EgovIdGnrStrategy strategy) throws FdlException {
|
||||
throw new UnsupportedOperationException("getNextStringId(EgovIdGnrStrategy strategy) is not supported");
|
||||
}
|
||||
|
||||
// 필요한 setter 메서드들 추가
|
||||
public void setDataSource(DataSource dataSource) {
|
||||
this.dataSource = dataSource;
|
||||
}
|
||||
|
||||
public void setTable(String table) {
|
||||
this.table = table;
|
||||
}
|
||||
|
||||
public void setTableName(String tableName) {
|
||||
this.tableName = tableName;
|
||||
}
|
||||
|
||||
public void setColumnName(String columnName) {
|
||||
this.columnName = columnName;
|
||||
}
|
||||
|
||||
public void setPrefix(String prefix) {
|
||||
this.prefix = prefix;
|
||||
}
|
||||
|
||||
public void setFillChar(String fillChar) {
|
||||
this.fillChar = fillChar;
|
||||
}
|
||||
|
||||
public void setCipers(int cipers) {
|
||||
this.cipers = cipers;
|
||||
}
|
||||
|
||||
public void setApplyYear(boolean applyYear) {
|
||||
this.applyYear = applyYear;
|
||||
}
|
||||
|
||||
public void setBlockSize(int blockSize) {
|
||||
this.blockSize = blockSize;
|
||||
}
|
||||
}
|
||||
@ -114,11 +114,6 @@ public class LoginVO implements Serializable{
|
||||
|
||||
private String dormantYn; // 휴먼회원여부 ( N:일반회원, Y:휴먼회원)
|
||||
|
||||
/**
|
||||
* 보안로그인 여부
|
||||
*/
|
||||
private String secuLoginFlag;
|
||||
|
||||
public String getDormantYn() {
|
||||
return dormantYn;
|
||||
}
|
||||
@ -416,12 +411,5 @@ public class LoginVO implements Serializable{
|
||||
public void setOuterCertYn(String outerCertYn) {
|
||||
this.outerCertYn = outerCertYn;
|
||||
}
|
||||
public String getSecuLoginFlag() {
|
||||
return secuLoginFlag;
|
||||
}
|
||||
public void setSecuLoginFlag(String secuLoginFlag) {
|
||||
this.secuLoginFlag = secuLoginFlag;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -1,130 +0,0 @@
|
||||
package itn.com.cmm;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
public class MjonFTSendVO{
|
||||
|
||||
|
||||
/**
|
||||
* @description : 수신자번호
|
||||
*/
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* @description : [*이름*] - 치환문자
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* @description : [*1*] - 치환문자
|
||||
*/
|
||||
private String rep1;
|
||||
|
||||
/**
|
||||
* @description : [*2*] - 치환문자
|
||||
*/
|
||||
private String rep2;
|
||||
|
||||
/**
|
||||
* @description : [*3*] - 치환문자
|
||||
*/
|
||||
private String rep3;
|
||||
|
||||
/**
|
||||
* @description : [*4*] - 치환문자
|
||||
*/
|
||||
private String rep4;
|
||||
|
||||
/**
|
||||
* @description : 문자ID
|
||||
*/
|
||||
private String msgId;
|
||||
|
||||
/**
|
||||
* @description : 전송그룹ID (대량문자의 경우 하나의 그룹으로 세팅)
|
||||
*/
|
||||
private String msgGroupId;
|
||||
|
||||
/**
|
||||
* @description : 문자온 일반회원ID
|
||||
*/
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* @description : 발신번호 (하이픈 등의 문자를 제외한 12byte이하의 숫자로 입력한다.)
|
||||
*/
|
||||
private String callFrom;
|
||||
/**
|
||||
* @description : 수신번호 (하이픈 등의 문자를 제외한 12byte이하의 숫자로 입력한다.)
|
||||
*/
|
||||
private String callTo;
|
||||
/**
|
||||
* @description : 예약 발송일시
|
||||
*/
|
||||
private String reqDate;
|
||||
/**
|
||||
* @description :전송사(04:다우, 05:JJ, 07:IVT, 01:아이하트 , 02:현대퓨처넷, 03:아이엠오)
|
||||
*/
|
||||
private String agentCode;
|
||||
|
||||
/**
|
||||
* @description : MMS용 메시지제목
|
||||
*/
|
||||
private String subject;
|
||||
|
||||
/**
|
||||
* @description : SMS용 메시지본문
|
||||
*/
|
||||
private String smsTxt;
|
||||
|
||||
/**
|
||||
* @description : 메세지타입(4: SMS 전송, 5: URL 전송, 6: MMS전송, 7: BARCODE전송, 8: 카카오 알림톡 전송)
|
||||
*/
|
||||
private String msgType;
|
||||
|
||||
|
||||
/**
|
||||
* @description : 첨부파일 갯수
|
||||
*/
|
||||
private String fileCnt;
|
||||
|
||||
/**
|
||||
* @description : 파일이름1
|
||||
*/
|
||||
private String filePath1;
|
||||
|
||||
/**
|
||||
* @description : 파일이름2
|
||||
*/
|
||||
private String filePath2;
|
||||
|
||||
/**
|
||||
* @description : 파일이름3
|
||||
*/
|
||||
private String filePath3;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @description : event 여부 / group tb에 넣는 용도 / 기본값 N
|
||||
*/
|
||||
private String eventYn="N";
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @description : 개별단가
|
||||
*/
|
||||
private String eachPrice;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -1,129 +0,0 @@
|
||||
package itn.com.cmm;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
public class MjonMsgSendVO{
|
||||
|
||||
|
||||
/**
|
||||
* @description : 수신자번호
|
||||
*/
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* @description : [*이름*] - 치환문자
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* @description : [*1*] - 치환문자
|
||||
*/
|
||||
private String rep1;
|
||||
|
||||
/**
|
||||
* @description : [*2*] - 치환문자
|
||||
*/
|
||||
private String rep2;
|
||||
|
||||
/**
|
||||
* @description : [*3*] - 치환문자
|
||||
*/
|
||||
private String rep3;
|
||||
|
||||
/**
|
||||
* @description : [*4*] - 치환문자
|
||||
*/
|
||||
private String rep4;
|
||||
|
||||
/**
|
||||
* @description : 문자ID
|
||||
*/
|
||||
private String msgId;
|
||||
|
||||
/**
|
||||
* @description : 전송그룹ID (대량문자의 경우 하나의 그룹으로 세팅)
|
||||
*/
|
||||
private String msgGroupId;
|
||||
|
||||
/**
|
||||
* @description : 문자온 일반회원ID
|
||||
*/
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* @description : 발신번호 (하이픈 등의 문자를 제외한 12byte이하의 숫자로 입력한다.)
|
||||
*/
|
||||
private String callFrom;
|
||||
/**
|
||||
* @description : 수신번호 (하이픈 등의 문자를 제외한 12byte이하의 숫자로 입력한다.)
|
||||
*/
|
||||
private String callTo;
|
||||
/**
|
||||
* @description : 예약 발송일시
|
||||
*/
|
||||
private String reqDate;
|
||||
/**
|
||||
* @description :전송사(04:다우, 05:JJ, 07:IVT, 01:아이하트 , 02:현대퓨처넷, 03:아이엠오)
|
||||
*/
|
||||
private String agentCode;
|
||||
|
||||
/**
|
||||
* @description : MMS용 메시지제목
|
||||
*/
|
||||
private String subject;
|
||||
|
||||
/**
|
||||
* @description : SMS용 메시지본문
|
||||
*/
|
||||
private String smsTxt;
|
||||
|
||||
/**
|
||||
* @description : 메세지타입(4: SMS 전송, 5: URL 전송, 6: MMS전송, 7: BARCODE전송, 8: 카카오 알림톡 전송)
|
||||
*/
|
||||
private String msgType;
|
||||
|
||||
/**
|
||||
* @description : 첨부파일 갯수
|
||||
*/
|
||||
private String fileCnt;
|
||||
|
||||
/**
|
||||
* @description : 파일이름1
|
||||
*/
|
||||
private String filePath1;
|
||||
|
||||
/**
|
||||
* @description : 파일이름2
|
||||
*/
|
||||
private String filePath2;
|
||||
|
||||
/**
|
||||
* @description : 파일이름3
|
||||
*/
|
||||
private String filePath3;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @description : event 여부 / group tb에 넣는 용도 / 기본값 N
|
||||
*/
|
||||
private String eventYn="N";
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @description : 개별단가
|
||||
*/
|
||||
private String eachPrice;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -1,37 +0,0 @@
|
||||
package itn.com.cmm;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import itn.let.mjo.event.service.MjonEventVO;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author : 이호영
|
||||
* @fileName : OptimalMsgResultDTO.java
|
||||
* @date : 2024.11.26
|
||||
* @description : 이벤트 vo 생성 및 종료 vo 생성
|
||||
* ===========================================================
|
||||
* DATE AUTHOR NOTE
|
||||
* ----------------------------------------------------------- *
|
||||
* 2024.11.26 이호영 최초 생성
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@Builder
|
||||
public class OptimalMsgResultDTO{
|
||||
|
||||
private List<MjonMsgSendVO> optimalMsgList;
|
||||
private MjonEventVO eventInfo;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -1,65 +0,0 @@
|
||||
package itn.com.cmm;
|
||||
|
||||
import org.springframework.http.HttpStatus;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @fileName : RestResponse.java
|
||||
* @author : 이호영
|
||||
* @date : 2022.07.04
|
||||
* @description : RestApi 응답에 사용할 Class
|
||||
* @TODO :
|
||||
* ===========================================================
|
||||
* DATE AUTHOR NOTE
|
||||
* ----------------------------------------------------------- *
|
||||
* 2022.07.04 이호영 최초 생성
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* • 1XX : 조건부 응답
|
||||
* • 2XX : 성공
|
||||
* • 3XX : 리다이렉션 완료
|
||||
* • 4XX : 요청 오류
|
||||
* • 500 : 서버 오류
|
||||
*
|
||||
* 참고 : https://km0830.tistory.com/33
|
||||
*
|
||||
* ====== 자주 사용하는 코드 =====
|
||||
* 200 : Ok : 서버가 클라이언트의 요청을 성공적으로 처리, 웹 페이지에서는 페이지 요청이 정상적으로 완료 (Ok)
|
||||
* 400 : Bad Request : 잘못 요청 (Bad Request)
|
||||
* 401 : Unauthorized : 권한 없음, 예를 들면, 로그인 페이지가 필요한 페이지를 로그인 없이 접속하려는 경우 반환되는 코드 (인증 실패) (Unauthorized)
|
||||
*
|
||||
* */
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
public class RestResponse {
|
||||
|
||||
private HttpStatus status;
|
||||
|
||||
private String msg;
|
||||
|
||||
private Object data;
|
||||
|
||||
|
||||
@Builder
|
||||
public RestResponse(HttpStatus status, String msg, Object data) {
|
||||
this.status = status;
|
||||
this.msg = msg;
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -1,48 +1,48 @@
|
||||
/*
|
||||
* Copyright 2008-2009 MOPAS(Ministry of Public Administration and Security).
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package itn.com.cmm.filter;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.servlet.Filter;
|
||||
import javax.servlet.FilterChain;
|
||||
import javax.servlet.FilterConfig;
|
||||
import javax.servlet.ServletContext;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.ServletResponse;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
public class XssFilter implements Filter{
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private FilterConfig config;
|
||||
|
||||
public void doFilter(ServletRequest request, ServletResponse response,
|
||||
FilterChain chain) throws IOException, ServletException {
|
||||
ServletContext context = config.getServletContext();
|
||||
chain.doFilter(new XssFilterRequestWrapper((HttpServletRequest)request), response);
|
||||
//chain.doFilter(new XssFilterRequestWrapper((HttpServletRequest)request , response , context ), response);
|
||||
}
|
||||
|
||||
public void init(FilterConfig config) throws ServletException {
|
||||
this.config = config;
|
||||
}
|
||||
|
||||
public void destroy() {
|
||||
this.config = null;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Copyright 2008-2009 MOPAS(Ministry of Public Administration and Security).
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package itn.com.cmm.filter;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.servlet.Filter;
|
||||
import javax.servlet.FilterChain;
|
||||
import javax.servlet.FilterConfig;
|
||||
import javax.servlet.ServletContext;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.ServletResponse;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
public class XssFilter implements Filter{
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private FilterConfig config;
|
||||
|
||||
public void doFilter(ServletRequest request, ServletResponse response,
|
||||
FilterChain chain) throws IOException, ServletException {
|
||||
ServletContext context = config.getServletContext();
|
||||
chain.doFilter(new XssFilterRequestWrapper((HttpServletRequest)request), response);
|
||||
//chain.doFilter(new XssFilterRequestWrapper((HttpServletRequest)request , response , context ), response);
|
||||
}
|
||||
|
||||
public void init(FilterConfig config) throws ServletException {
|
||||
this.config = config;
|
||||
}
|
||||
|
||||
public void destroy() {
|
||||
this.config = null;
|
||||
}
|
||||
}
|
||||
|
||||
@ -61,7 +61,6 @@ public class IPIgnoreInterceptorHandler extends HandlerInterceptorAdapter{
|
||||
v_ret = false;
|
||||
}
|
||||
|
||||
// lettnloginlog 테이블에 insert 패턴 추가 (/web/user/login/usrIdCheckAjax.do)
|
||||
}else if(request.getRequestURI().indexOf("ListAjax.do")>-1
|
||||
|| request.getRequestURI().indexOf("ViewAjax.do")>-1
|
||||
|| request.getRequestURI().indexOf("DataAjax.do")>-1
|
||||
@ -75,7 +74,6 @@ public class IPIgnoreInterceptorHandler extends HandlerInterceptorAdapter{
|
||||
|| request.getRequestURI().indexOf("MapUrl")>-1
|
||||
|| request.getRequestURI().indexOf("uss/ion/fms/FmsFileInsertAjax")>-1
|
||||
|| request.getRequestURI().indexOf("web/mjon/addr/sendExelFilePhoneNumAjax")>-1
|
||||
|| request.getRequestURI().indexOf("/web/user/login/usrIdCheckAjax.do")>-1
|
||||
|
||||
|
||||
|
||||
|
||||
@ -61,13 +61,4 @@ public interface EgovCmmUseService {
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<CmmnDetailCode> selectGroupIdDetail(ComDefaultCodeVO vo) throws Exception;
|
||||
|
||||
/**
|
||||
* 선택 코드 상세정보 조회
|
||||
*
|
||||
* @param 조회조건정보 vo
|
||||
* @return CmmnDetailCode
|
||||
* @throws Exception
|
||||
*/
|
||||
public CmmnDetailCode selectCmmCodeDetailValue(ComDefaultCodeVO vo) throws Exception;
|
||||
}
|
||||
|
||||
@ -92,16 +92,4 @@ public class EgovCmmUseServiceImpl extends EgovAbstractServiceImpl implements Eg
|
||||
public List<CmmnDetailCode> selectGroupIdDetail(ComDefaultCodeVO vo) throws Exception {
|
||||
return cmmUseDAO.selectGroupIdDetail(vo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 선택 코드 상세정보 조회
|
||||
*
|
||||
* @param 조회조건정보 vo
|
||||
* @return CmmnDetailCode
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public CmmnDetailCode selectCmmCodeDetailValue(ComDefaultCodeVO vo) throws Exception {
|
||||
return cmmUseDAO.selectCmmCodeDetailValue(vo);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,39 +0,0 @@
|
||||
package itn.com.cmm.session;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.data.redis.connection.jedis.JedisConnectionFactory;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;
|
||||
|
||||
@Configuration
|
||||
@EnableRedisHttpSession(maxInactiveIntervalInSeconds = 1800) // 세션 timeout 설정
|
||||
public class HttpSessionConfig {
|
||||
|
||||
@Value("#{globalSettings['Globals.valkey.ip']}")
|
||||
private String ip;
|
||||
|
||||
@Value("#{globalSettings['Globals.valkey.port']}")
|
||||
private int port;
|
||||
|
||||
@Value("#{globalSettings['Globals.valkey.password']}")
|
||||
private String password;
|
||||
|
||||
@Bean
|
||||
public JedisConnectionFactory connectionFactory() {
|
||||
JedisConnectionFactory factory = new JedisConnectionFactory();
|
||||
factory.setHostName(this.ip);
|
||||
factory.setPort(this.port);
|
||||
factory.setPassword(this.password);
|
||||
factory.afterPropertiesSet();
|
||||
return factory;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public RedisTemplate<Object, Object> redisTemplate() {
|
||||
RedisTemplate<Object, Object> template = new RedisTemplate<>();
|
||||
template.setConnectionFactory(connectionFactory());
|
||||
return template;
|
||||
}
|
||||
}
|
||||
112
src/main/java/itn/com/cmm/util/DateUtil.java
Normal file
112
src/main/java/itn/com/cmm/util/DateUtil.java
Normal file
@ -0,0 +1,112 @@
|
||||
package itn.com.cmm.util;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.Month;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author : 이호영
|
||||
* @fileName : DateUtil.java
|
||||
* @date : 2023.04.06
|
||||
* @description : Date 다루는 Util
|
||||
* ===========================================================
|
||||
* DATE AUTHOR NOTE
|
||||
* ----------------------------------------------------------- *
|
||||
* 2023.04.06 이호영 최초 생성
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
public final class DateUtil {
|
||||
|
||||
|
||||
/**
|
||||
* @methodName : getTodayYearAndMonthAndFirstDay
|
||||
* @author : 이호영
|
||||
* @date : 2023.04.06
|
||||
* @description : 해당 년월일 구하기 : 일은 1일
|
||||
* @return ex) 2023/04/01
|
||||
*/
|
||||
public static String getTodayYearAndMonthAndFirstDay() {
|
||||
LocalDate currentDate = LocalDate.now();
|
||||
return LocalDate.of(currentDate.getYear(), currentDate.getMonthValue(), 1)
|
||||
.format( DateTimeFormatter.ofPattern("yyyy/MM/dd"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @methodName : getTodayYearAndMonthAndLastDay
|
||||
* @author : 이호영
|
||||
* @date : 2023.04.06
|
||||
* @description : 해당 년월일 구하기 : 일은 마지막일
|
||||
* @return ex) 2023/04/30
|
||||
*/
|
||||
public static String getTodayYearAndMonthAndLastDay() {
|
||||
LocalDate currentDate = LocalDate.now();
|
||||
return LocalDate.of(currentDate.getYear(), currentDate.getMonthValue(), currentDate.lengthOfMonth())
|
||||
.format( DateTimeFormatter.ofPattern("yyyy/MM/dd"));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @methodName : getNowYearToString
|
||||
* @author : 이호영
|
||||
* @date : 2023.04.07
|
||||
* @description : 현재 연도
|
||||
* @return : String
|
||||
*/
|
||||
public static String getNowYearToString() {
|
||||
return Integer.toString(LocalDate.now().getYear());
|
||||
}
|
||||
|
||||
/**
|
||||
* @methodName : getNowMonthToString
|
||||
* @author : 이호영
|
||||
* @date : 2023.04.07
|
||||
* @description : 현재 월
|
||||
* @return : String
|
||||
*/
|
||||
public static String getNowMonthToString() {
|
||||
LocalDate currentDate = LocalDate.now();
|
||||
return Integer.toString(currentDate.getMonthValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* @methodName : getNowDayToString
|
||||
* @author : 이호영
|
||||
* @date : 2023.04.07
|
||||
* @description : 현재 일
|
||||
* @return : String
|
||||
*/
|
||||
public static String getNowDayToString() {
|
||||
LocalDate currentDate = LocalDate.now();
|
||||
return Integer.toString(currentDate.getDayOfMonth());
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @methodName : getNowDayToString
|
||||
* @author : 이호영
|
||||
* @date : 2023.08.08
|
||||
* @description : yyyy-MM-dd HH:mm:ss.S 형식을 yyyy-MM-dd HH:mm 로 변환
|
||||
* @return
|
||||
* @throws ParseException
|
||||
*/
|
||||
public static String getChangFormatS(String str) throws ParseException {
|
||||
SimpleDateFormat inputFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.S"); // 원본 형식
|
||||
Date date = inputFormat.parse(str); // 문자열을 날짜 객체로 변환
|
||||
|
||||
SimpleDateFormat outputFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm"); // 원하는 출력 형식
|
||||
String formattedDate = outputFormat.format(date); // 날짜 객체를 원하는 형식의 문자열로 변환
|
||||
|
||||
return formattedDate; // 출력: 2023-08-07 09:36
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -1,205 +0,0 @@
|
||||
package itn.com.cmm.util;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author : 이호영
|
||||
* @fileName : DateUtil.java
|
||||
* @date : 2023.04.06
|
||||
* @description : Date 다루는 Util
|
||||
* ===========================================================
|
||||
* DATE AUTHOR NOTE
|
||||
* ----------------------------------------------------------- *
|
||||
* 2023.04.06 이호영 최초 생성
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
public final class DateUtils {
|
||||
|
||||
// 날짜를 포맷하는 기본 포맷터 정의
|
||||
private static final DateTimeFormatter SLUSH_FORMATTER = DateTimeFormatter.ofPattern("yyyy/MM/dd");
|
||||
|
||||
/**
|
||||
* @methodName : getTodayYearAndMonthAndFirstDay
|
||||
* @author : 이호영
|
||||
* @date : 2023.04.06
|
||||
* @description : 해당 년월일 구하기 : 일은 1일
|
||||
* @return ex) 2023/04/01
|
||||
*/
|
||||
public static String getTodayYearAndMonthAndFirstDay() {
|
||||
LocalDate currentDate = LocalDate.now();
|
||||
return LocalDate.of(currentDate.getYear(), currentDate.getMonthValue(), 1)
|
||||
.format( DateTimeFormatter.ofPattern("yyyy/MM/dd"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @methodName : getTodayYearAndMonthAndLastDay
|
||||
* @author : 이호영
|
||||
* @date : 2023.04.06
|
||||
* @description : 해당 년월일 구하기 : 일은 마지막일
|
||||
* @return ex) 2023/04/30
|
||||
*/
|
||||
public static String getTodayYearAndMonthAndLastDay() {
|
||||
LocalDate currentDate = LocalDate.now();
|
||||
return LocalDate.of(currentDate.getYear(), currentDate.getMonthValue(), currentDate.lengthOfMonth())
|
||||
.format( DateTimeFormatter.ofPattern("yyyy/MM/dd"));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @methodName : getNowYearToString
|
||||
* @author : 이호영
|
||||
* @date : 2023.04.07
|
||||
* @description : 현재 연도
|
||||
* @return : String
|
||||
*/
|
||||
public static String getNowYearToString() {
|
||||
return Integer.toString(LocalDate.now().getYear());
|
||||
}
|
||||
|
||||
/**
|
||||
* @methodName : getNowMonthToString
|
||||
* @author : 이호영
|
||||
* @date : 2023.04.07
|
||||
* @description : 현재 월
|
||||
* @return : String
|
||||
*/
|
||||
public static String getNowMonthToString() {
|
||||
LocalDate currentDate = LocalDate.now();
|
||||
return Integer.toString(currentDate.getMonthValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* @methodName : getNowDayToString
|
||||
* @author : 이호영
|
||||
* @date : 2023.04.07
|
||||
* @description : 현재 일
|
||||
* @return : String
|
||||
*/
|
||||
public static String getNowDayToString() {
|
||||
LocalDate currentDate = LocalDate.now();
|
||||
return Integer.toString(currentDate.getDayOfMonth());
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @methodName : getNowDayToString
|
||||
* @author : 이호영
|
||||
* @date : 2023.08.08
|
||||
* @description : yyyy-MM-dd HH:mm:ss.S 형식을 yyyy-MM-dd HH:mm 로 변환
|
||||
* @return
|
||||
* @throws ParseException
|
||||
*/
|
||||
public static String getChangFormatS(String str) throws ParseException {
|
||||
SimpleDateFormat inputFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.S"); // 원본 형식
|
||||
Date date = inputFormat.parse(str); // 문자열을 날짜 객체로 변환
|
||||
|
||||
SimpleDateFormat outputFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm"); // 원하는 출력 형식
|
||||
String formattedDate = outputFormat.format(date); // 날짜 객체를 원하는 형식의 문자열로 변환
|
||||
|
||||
return formattedDate; // 출력: 2023-08-07 09:36
|
||||
}
|
||||
|
||||
|
||||
// 현재 날짜를 기본 포맷으로 반환
|
||||
public static String getCurrentDate() {
|
||||
return getCurrentDate(SLUSH_FORMATTER);
|
||||
}
|
||||
|
||||
// 현재 날짜를 지정된 포맷으로 반환
|
||||
public static String getCurrentDate(DateTimeFormatter formatter) {
|
||||
LocalDate today = LocalDate.now();
|
||||
return today.format(formatter);
|
||||
}
|
||||
|
||||
// 현재 날짜에서 특정 일수 전 날짜를 기본 포맷으로 반환
|
||||
public static String getDateMonthsAgo(int months) {
|
||||
return getDateMonthsAgo(months, SLUSH_FORMATTER);
|
||||
}
|
||||
|
||||
// 현재 날짜에서 특정 일수 전 날짜를 지정된 포맷으로 반환
|
||||
public static String getDateMonthsAgo(int months, DateTimeFormatter formatter) {
|
||||
LocalDate today = LocalDate.now();
|
||||
// System.out.println("months : "+ months);
|
||||
// System.out.println("today.minusMonths(months) : "+ today.minusMonths(months).format(formatter));
|
||||
LocalDate monthsAgo = today.minusMonths(months).plusDays(1);
|
||||
// System.out.println("monthsAgo : " + monthsAgo);
|
||||
// System.out.println("monthsAgo.format(formatter) : " + monthsAgo.format(formatter));
|
||||
return monthsAgo.format(formatter);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @methodName : dateChkAndValueChk
|
||||
* @author : 이호영
|
||||
* @date : 2024.07.05
|
||||
* @description : 검색 날짜 검증 및 일수 체크
|
||||
* @param searchStartDate
|
||||
* @param searchEndDate
|
||||
* @param dateVal
|
||||
* @return
|
||||
*/
|
||||
public static boolean dateChkAndValueChk(String searchStartDate, String searchEndDate, int months) {
|
||||
boolean isValid = true;
|
||||
|
||||
|
||||
// 날짜 검증
|
||||
LocalDate startDate = null;
|
||||
LocalDate endDate = null;
|
||||
|
||||
// 검색 시작일자와 종료일자가 있는지 체크
|
||||
if (searchStartDate == null || searchStartDate.isEmpty() || searchEndDate == null || searchEndDate.isEmpty()) {
|
||||
isValid = false;
|
||||
}
|
||||
|
||||
// 날짜 형식으로 변환
|
||||
if (isValid) {
|
||||
try {
|
||||
startDate = LocalDate.parse(searchStartDate, SLUSH_FORMATTER);
|
||||
endDate = LocalDate.parse(searchEndDate, SLUSH_FORMATTER);
|
||||
} catch (Exception e) {
|
||||
isValid = false;
|
||||
}
|
||||
}
|
||||
|
||||
// 시작일자가 종료일자보다 이후인지 확인
|
||||
if (isValid && startDate.isAfter(endDate)) {
|
||||
isValid = false;
|
||||
}
|
||||
|
||||
// 총 기간이 지정한 개월 수를 넘는지 확인
|
||||
if (isValid) {
|
||||
long monthsBetween = ChronoUnit.MONTHS.between(startDate, endDate);
|
||||
if (monthsBetween >= months) {
|
||||
isValid = false;
|
||||
}
|
||||
}
|
||||
|
||||
return isValid;
|
||||
}
|
||||
|
||||
public static String setStrToDataFormatter(String str, String formatter) {
|
||||
|
||||
// 입력 문자열을 LocalDateTime으로 변환
|
||||
DateTimeFormatter inputFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
LocalDateTime dateTime = LocalDateTime.parse(str, inputFormatter);
|
||||
|
||||
// 원하는 출력 포맷 적용
|
||||
DateTimeFormatter outputFormatter = DateTimeFormatter.ofPattern(formatter);
|
||||
String formattedDate = dateTime.format(outputFormatter);
|
||||
|
||||
return formattedDate;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -25,44 +25,45 @@ import org.apache.commons.lang3.StringUtils;
|
||||
*/
|
||||
public final class FileUtil {
|
||||
|
||||
/**
|
||||
* @methodName : downLoad
|
||||
* @author : 이호영
|
||||
* @date : 2023.04.06
|
||||
* @description : 파일 다운로드
|
||||
* @param response
|
||||
* @param fileInfo
|
||||
* @param fileName
|
||||
* @throws Exception
|
||||
*/
|
||||
public static void downLoad(HttpServletResponse response, String fileInfo, String fileNameP) throws Exception {
|
||||
|
||||
|
||||
try {
|
||||
String path = fileInfo; // 경로에 접근할 때 역슬래시('\') 사용
|
||||
|
||||
File file = new File(path);
|
||||
|
||||
String fileName = "";
|
||||
if(StringUtils.isNotEmpty(fileNameP))
|
||||
fileName = URLEncoder.encode(fileNameP,"UTF-8").replaceAll("\\+", "%20");
|
||||
else
|
||||
fileName = file.getName();
|
||||
|
||||
response.setHeader("Content-Disposition", "attachment;filename=" + fileName); // 다운로드 되거나 로컬에 저장되는 용도로 쓰이는지를 알려주는 헤더
|
||||
|
||||
FileInputStream fileInputStream = new FileInputStream(path); // 파일 읽어오기
|
||||
OutputStream out = response.getOutputStream();
|
||||
|
||||
int read = 0;
|
||||
byte[] buffer = new byte[1024];
|
||||
while ((read = fileInputStream.read(buffer)) != -1) { // 1024바이트씩 계속 읽으면서 outputStream에 저장, -1이 나오면 더이상 읽을 파일이 없음
|
||||
out.write(buffer, 0, read);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new Exception("download error");
|
||||
}
|
||||
/**
|
||||
* @methodName : downLoad
|
||||
* @author : 이호영
|
||||
* @date : 2023.04.06
|
||||
* @description : 파일 다운로드
|
||||
* @param response
|
||||
* @param fileInfo
|
||||
* @param fileName
|
||||
* @throws Exception
|
||||
*/
|
||||
public static void downLoad(HttpServletResponse response, String fileInfo, String fileNameP) throws Exception {
|
||||
|
||||
|
||||
try {
|
||||
String path = fileInfo; // 경로에 접근할 때 역슬래시('\') 사용
|
||||
|
||||
File file = new File(path);
|
||||
|
||||
String fileName = "";
|
||||
if(StringUtils.isNotEmpty(fileNameP))
|
||||
fileName = URLEncoder.encode(fileNameP,"UTF-8").replaceAll("\\+", "%20");
|
||||
else
|
||||
fileName = file.getName();
|
||||
|
||||
response.setHeader("Content-Disposition", "attachment;filename=" + fileName); // 다운로드 되거나 로컬에 저장되는 용도로 쓰이는지를 알려주는 헤더
|
||||
|
||||
FileInputStream fileInputStream = new FileInputStream(path); // 파일 읽어오기
|
||||
OutputStream out = response.getOutputStream();
|
||||
|
||||
int read = 0;
|
||||
byte[] buffer = new byte[1024];
|
||||
while ((read = fileInputStream.read(buffer)) != -1) { // 1024바이트씩 계속 읽으면서 outputStream에 저장, -1이 나오면 더이상 읽을 파일이 없음
|
||||
out.write(buffer, 0, read);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
throw new Exception("download error");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -144,6 +144,7 @@ public final class MJUtil {
|
||||
date = date.replaceAll("-", "/");//날짜에 하이픈(-)을 슬러쉬(/)로 변환
|
||||
|
||||
SimpleDateFormat sdformat = new SimpleDateFormat("yyyy/MM/dd");
|
||||
System.out.println(getRealTime());
|
||||
|
||||
Date nowDate = sdformat.parse(getRealTime());
|
||||
Date endDate = sdformat.parse(date);
|
||||
@ -318,17 +319,4 @@ public final class MJUtil {
|
||||
return dupliBlockList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 사업자등록번호 대시('-') 추가
|
||||
* 대시 유무 상관없음
|
||||
* 유효성 맞지 않을시 변환안됨.
|
||||
*/
|
||||
public static String bizNoAddDash(String str) {
|
||||
if(str == null) {
|
||||
return str;
|
||||
}
|
||||
String regExp = "(\\d{3})(\\d{2})(\\d{5})$";
|
||||
String chgf = "$1-$2-$3";
|
||||
return str.replaceFirst(regExp, chgf);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,972 +0,0 @@
|
||||
package itn.com.cmm.util;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.function.Function;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.http.HttpStatus;
|
||||
|
||||
import itn.com.cmm.MjonMsgSendVO;
|
||||
import itn.com.cmm.OptimalMsgResultDTO;
|
||||
import itn.let.mail.service.StatusResponse;
|
||||
import itn.let.mjo.event.service.MjonEventVO;
|
||||
import itn.let.mjo.mjocommon.MjonCommon;
|
||||
import itn.let.mjo.msg.service.MjonMsgVO;
|
||||
import itn.let.mjo.msgagent.service.MjonMsgAgentStsVO;
|
||||
import itn.let.mjo.spammsg.web.ComGetSpamStringParser;
|
||||
import itn.let.sym.site.service.JoinSettingVO;
|
||||
import itn.let.uss.umt.service.MberManageVO;
|
||||
import itn.let.uss.umt.service.UserManageVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author : 이호영
|
||||
* @fileName : MsgSendUtils.java
|
||||
* @date : 2024.09.23
|
||||
* @description : 메세지발송 데이터 다루는 유틸
|
||||
* ===========================================================
|
||||
* DATE AUTHOR NOTE
|
||||
* ----------------------------------------------------------- *
|
||||
* 2024.09.23 이호영 최초 생성
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
@Slf4j
|
||||
public final class MsgSendUtils {
|
||||
|
||||
// 단문 메세지 타입
|
||||
public static final String SHORT_MSG_TYPE = "4";
|
||||
// 장문 메세지 타입
|
||||
public static final String LONG_MSG_TYPE = "6";
|
||||
// 이벤트 최저 잔액
|
||||
public static final double MIN_EVENT_REMAIN_CASH = 7.5; // 이벤트 최소 잔액
|
||||
|
||||
|
||||
/**
|
||||
* @methodName : getMsgType
|
||||
* @author : 이호영
|
||||
* @date : 2024.09.23
|
||||
* @description : msgType 재정의
|
||||
* @param mjonMsgVO
|
||||
* @param smsTxtByte
|
||||
* @return
|
||||
* @throws UnsupportedEncodingException
|
||||
*/
|
||||
public static String getMsgTypeWithByteValidation(MjonMsgSendVO sendVO, String p_smsTxt) throws UnsupportedEncodingException {
|
||||
|
||||
|
||||
// // 내문자저장함에 저장 후 문자를 발송하는 경우 문자 타입이 숫자가 아닌 문자로 넘어와서 변경 처리함
|
||||
// if ("P".equals(msgType) || "L".equals(msgType)) {
|
||||
// msgType = "6";
|
||||
// } else if ("S".equals(msgType)) {
|
||||
// msgType = "4";
|
||||
// }
|
||||
|
||||
int smsTxtByte = MjonCommon.getSmsTxtBytes(p_smsTxt);
|
||||
String msgType = SHORT_MSG_TYPE;
|
||||
|
||||
// 1. 2000 Byte 초과는 에러 처리
|
||||
if (smsTxtByte > 2000) {
|
||||
return "INVALID";
|
||||
}
|
||||
|
||||
// 2. 첨부파일 여부 확인 (첨부파일이 있으면 장문으로 설정)
|
||||
if (StringUtils.isNotEmpty(sendVO.getFilePath1())) {
|
||||
msgType = LONG_MSG_TYPE;
|
||||
}
|
||||
// 3. 문자 길이에 따라 메시지 타입 설정 (90 Byte 초과는 장문)
|
||||
else if (smsTxtByte > 90) {
|
||||
msgType = LONG_MSG_TYPE;
|
||||
}
|
||||
return msgType;
|
||||
}
|
||||
|
||||
public static float getValidPrice(Float personalPrice, Float defaultPrice) {
|
||||
return (personalPrice != null && personalPrice > 0) ? personalPrice : defaultPrice;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @methodName : determinePriceByMsgType
|
||||
* @author : 이호영
|
||||
* @date : 2024.09.24
|
||||
* @description : 문자 메시지 타입에 따라 단가를 결정하는 메서드
|
||||
* @param mjonMsgVO
|
||||
* @param shortPrice
|
||||
* @param longPrice
|
||||
* @param picturePrice
|
||||
* @param picture2Price
|
||||
* @param picture3Price
|
||||
* @return
|
||||
*/
|
||||
public static float determinePriceByMsgType(MjonMsgVO mjonMsgVO, float shortPrice, float longPrice,
|
||||
float picturePrice, float picture2Price, float picture3Price) {
|
||||
float price = 0;
|
||||
String msgType = mjonMsgVO.getMsgType();
|
||||
|
||||
if (SHORT_MSG_TYPE.equals(msgType)) {
|
||||
price = shortPrice;
|
||||
} else if (LONG_MSG_TYPE.equals(msgType)) {
|
||||
// 파일 첨부 여부에 따라 장문 단가 설정
|
||||
if (mjonMsgVO.getFileName3() != null) {
|
||||
price = picture3Price;
|
||||
} else if (mjonMsgVO.getFileName2() != null) {
|
||||
price = picture2Price;
|
||||
} else if (mjonMsgVO.getFileName1() != null) {
|
||||
price = picturePrice;
|
||||
} else {
|
||||
price = longPrice;
|
||||
}
|
||||
}
|
||||
return price;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @methodName : isReplacementRequired
|
||||
* @author : 이호영
|
||||
* @date : 2024.11.12
|
||||
* @description : 치환데이터가 있는지 확인
|
||||
* @param mjonMsgVO
|
||||
* @return
|
||||
*/
|
||||
public static boolean isRepleasYN(MjonMsgVO mjonMsgVO) {
|
||||
|
||||
// 치환 구문 패턴 리스트
|
||||
String[] placeholders = {"\\[\\*이름\\*\\]", "\\[\\*1\\*\\]", "\\[\\*2\\*\\]", "\\[\\*4\\*\\]", "\\[\\*3\\*\\]"};
|
||||
|
||||
for (String placeholder : placeholders) {
|
||||
Pattern pattern = Pattern.compile(placeholder);
|
||||
Matcher matcher = pattern.matcher(mjonMsgVO.getSmsTxt());
|
||||
// 해당 패턴이 존재하면 true 반환
|
||||
if (matcher.find()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @methodName : populateReplacementLists
|
||||
* @author : 이호영
|
||||
* @date : 2024.09.26
|
||||
* @description : 배열에 데이터를 채우는 메서드
|
||||
* 1. 치환 문자열 데이터 확인 및 문자 치환
|
||||
* 2. 스팸 문자 체크
|
||||
* 3. 메세지 타입 구하기
|
||||
* 4. 제목 셋팅 : 타입에 따라 분기
|
||||
* 5. 이미지 갯수 셋팅
|
||||
* 6. 예약 및 분할에 따른 시간 설정
|
||||
* 7. 전송사 코드 셋팅
|
||||
* @param mjonMsgVO
|
||||
* @param lists
|
||||
* @param statusResponse
|
||||
* @param agentSendCounts
|
||||
* @param sendRateList
|
||||
* @param isHolidayNotified
|
||||
* @return call by reference
|
||||
* @throws Exception
|
||||
*/
|
||||
public static Boolean populateSendLists(MjonMsgVO mjonMsgVO, List<MjonMsgSendVO> mjonMsgSendListVO
|
||||
, StatusResponse statusResponse, List<String> resultSpamTxt
|
||||
, Map<String, Integer> agentSendCounts, List<MjonMsgVO> sendRateList, boolean isHolidayNotified, UserManageVO userManageVO) throws Exception{
|
||||
|
||||
|
||||
|
||||
log.info(" :: populateSendLists :: ");
|
||||
|
||||
String smishingYn = userManageVO.getSmishingYn();
|
||||
String exceptSpamYn = userManageVO.getExceptSpamYn();
|
||||
|
||||
|
||||
// 예약 시간 기본값 설정
|
||||
Date now = new Date();
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
|
||||
|
||||
// ReqDate가 비어 있으면 현재 시간으로 설정, 그렇지 않으면 ReqDate로 설정
|
||||
// 화면에서 예약문자면 예약시간을 regDate로 설정한다.
|
||||
Date baseDate;
|
||||
if (StringUtils.isEmpty(mjonMsgVO.getReqDate())) {
|
||||
mjonMsgVO.setReqDate(sdf.format(now)); // ReqDate에 현재 시간 설정
|
||||
baseDate = now;
|
||||
} else {
|
||||
baseDate = sdf.parse(mjonMsgVO.getReqDate()); // ReqDate를 baseDate로 설정
|
||||
}
|
||||
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(baseDate); // calendar에 baseDate 설정
|
||||
int counter = 0; // 분할 건수 카운터
|
||||
|
||||
// 데이터 모두 스팸 체크를 안하고 건별로 갯수를 정해서 스팸체크를 한다.
|
||||
int spamChkSize = getSpamChkSize(mjonMsgSendListVO.size());
|
||||
int sampleCounter = 0;
|
||||
|
||||
|
||||
|
||||
// 치환 구문과 필드 getter 매핑
|
||||
Map<String, Function<MjonMsgSendVO, String>> placeholders = new HashMap<>();
|
||||
placeholders.put("[*이름*]", MjonMsgSendVO::getName);
|
||||
placeholders.put("[*1*]", MjonMsgSendVO::getRep1);
|
||||
placeholders.put("[*2*]", MjonMsgSendVO::getRep2);
|
||||
placeholders.put("[*3*]", MjonMsgSendVO::getRep3);
|
||||
placeholders.put("[*4*]", MjonMsgSendVO::getRep4);
|
||||
|
||||
boolean hasPerformedSpamCheck = false; // 치환 문자가 없는 경우, 스팸 체크가 한 번만 수행되도록 제어
|
||||
boolean hasPerformedMsgType = false; // 치환 문자가 없는 경우, 메세지 타입 체크 한번
|
||||
boolean hasPerformedDelayYn = false; // 치환 문자가 없는 경우,
|
||||
|
||||
String msgKind = mjonMsgVO.getMsgKind();
|
||||
String smsTxtTemp = mjonMsgVO.getSmsTxt();
|
||||
String mmsSubject = mjonMsgVO.getMmsSubject();
|
||||
Boolean replaceYN = getReplaceYN(smsTxtTemp);
|
||||
|
||||
String msgTypeResult = null;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
for (MjonMsgSendVO sendVO : mjonMsgSendListVO) {
|
||||
|
||||
sendVO.setCallFrom(mjonMsgVO.getCallFrom());
|
||||
sendVO.setCallTo(sendVO.getPhone());
|
||||
sendVO.setUserId(mjonMsgVO.getUserId());
|
||||
|
||||
String smsTxt = smsTxtTemp;
|
||||
// 치환 문자면
|
||||
if(replaceYN) {
|
||||
|
||||
// 각 치환 구문을 확인하고 치환할 값이 없으면 오류 반환
|
||||
for (Map.Entry<String, Function<MjonMsgSendVO, String>> entry : placeholders.entrySet()) {
|
||||
String placeholder = entry.getKey();
|
||||
String value = entry.getValue().apply(sendVO);
|
||||
if (smsTxt.contains(placeholder)) {
|
||||
if (StringUtils.isEmpty(value)) {
|
||||
// statusResponseSet(statusResponse, HttpStatus.BAD_REQUEST, "치환 문구중 " + placeholder + " 데이터가 없습니다.");
|
||||
StatusResponse.statusResponseSet(statusResponse, HttpStatus.BAD_REQUEST, "치환 문구중 " + placeholder + " 데이터가 없습니다.", "STAT_1040");
|
||||
return false;
|
||||
}
|
||||
smsTxt = smsTxt.replace(placeholder, value);
|
||||
// log.info(" + smsTxt [{}]", smsTxt);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
String smsSpamChkTxt = smsTxt;
|
||||
if(StringUtils.isNotEmpty(smsTxt)) {
|
||||
smsSpamChkTxt = smsTxt.replaceAll(String.valueOf((char) 13), "");
|
||||
}
|
||||
|
||||
// 이미지 셋팅
|
||||
setImagePathsForMsgSendVO(mjonMsgVO, sendVO);
|
||||
|
||||
|
||||
// == 치환 여부에 따라 처리 로직 분기 ==
|
||||
// 치환 문자가 아닌 경우
|
||||
if (!replaceYN) {
|
||||
// 스팸 체크와 메시지 타입 체크 각각 한 번만 수행
|
||||
if (!hasPerformedSpamCheck && "N".equals(exceptSpamYn)) {
|
||||
checkSpamAndSetStatus(mjonMsgVO, smsSpamChkTxt, resultSpamTxt, isHolidayNotified);
|
||||
hasPerformedSpamCheck = true;
|
||||
}
|
||||
if (!hasPerformedMsgType) {
|
||||
msgTypeResult = getMsgTypeWithByteValidation(sendVO, smsTxt);
|
||||
if ("INVALID".equals(msgTypeResult)) {
|
||||
// statusResponseSet(statusResponse, HttpStatus.BAD_REQUEST, "문자 치환 후 전송 문자 길이를 초과하였습니다.");
|
||||
StatusResponse.statusResponseSet(statusResponse, HttpStatus.BAD_REQUEST, "문자 치환 후 전송 문자 길이를 초과하였습니다.", "STAT_1050");
|
||||
return false;
|
||||
}
|
||||
hasPerformedMsgType = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{// 치환 문자인 경우
|
||||
// 스팸 체크는 `spamChkSize`만큼 반복 수행
|
||||
if (sampleCounter < spamChkSize && !"Y".equals(mjonMsgVO.getSpamStatus()) && "N".equals(exceptSpamYn)) {
|
||||
checkSpamAndSetStatus(mjonMsgVO, smsSpamChkTxt, resultSpamTxt, isHolidayNotified);
|
||||
sampleCounter++;
|
||||
}
|
||||
|
||||
// 메시지 타입 체크는 매번 수행
|
||||
msgTypeResult = getMsgTypeWithByteValidation(sendVO, smsTxt);
|
||||
if ("INVALID".equals(msgTypeResult)) {
|
||||
// statusResponseSet(statusResponse, HttpStatus.BAD_REQUEST, "문자 치환 후 전송 문자 길이를 초과하였습니다.");
|
||||
StatusResponse.statusResponseSet(statusResponse, HttpStatus.BAD_REQUEST, "문자 치환 후 전송 문자 길이를 초과하였습니다.", "STAT_1050");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
sendVO.setSmsTxt(smsTxt);
|
||||
sendVO.setMsgType(msgTypeResult);
|
||||
|
||||
// 제목 셋팅
|
||||
if (LONG_MSG_TYPE.equals(msgTypeResult)){
|
||||
String mmsTitleTemp = "";
|
||||
// 제목이 비어 있고 전송할 SMS 텍스트가 존재하는 경우에만 처리
|
||||
if (StringUtils.isEmpty(mmsSubject) && StringUtils.isNotEmpty(smsTxt)) {
|
||||
// SMS 텍스트를 줄 단위로 나누기
|
||||
mmsTitleTemp = getMmsgSubject(smsTxt, msgKind);
|
||||
// 설정된 제목을 현재 메시지 객체에 적용
|
||||
sendVO.setSubject(mmsTitleTemp);
|
||||
|
||||
}else {
|
||||
// 설정된 제목을 현재 메시지 객체에 적용
|
||||
sendVO.setSubject(mmsSubject);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* @isHolidayNotified
|
||||
* - 관리자 알림 설정으로 인해
|
||||
* - 해당 시간이면 지연 미처리
|
||||
* @smishingYn
|
||||
* - 회원 별 '스미싱 온' 상태값
|
||||
* - Y면 알림, 지연 처리해야 함
|
||||
* */
|
||||
if("Y".equalsIgnoreCase(smishingYn) && isHolidayNotified) {
|
||||
mjonMsgVO.setSpamStatus("Y");
|
||||
mjonMsgVO.setSmishingYn("Y");
|
||||
mjonMsgVO.setDelayYn("Y");
|
||||
}
|
||||
|
||||
// 지연 여부 처리
|
||||
if (( "Y".equalsIgnoreCase(smishingYn) || "Y".equalsIgnoreCase(mjonMsgVO.getDelayYn()))
|
||||
&& !hasPerformedDelayYn && isHolidayNotified) {
|
||||
calendar.add(Calendar.MINUTE, 30); // 모든 시간을 30분 뒤로 미룸
|
||||
// TEST
|
||||
// calendar.add(Calendar.MINUTE, 5); // 모든 시간을 30분 뒤로 미룸
|
||||
hasPerformedDelayYn = true;
|
||||
}
|
||||
|
||||
// 예약 여부 확인
|
||||
if ("Y".equalsIgnoreCase(mjonMsgVO.getReserveYn())) {
|
||||
// 분할 발송일 경우
|
||||
if ("on".equalsIgnoreCase(mjonMsgVO.getDivideChk())) {
|
||||
if (counter == Integer.parseInt(mjonMsgVO.getDivideCnt())) { // 지정된 건수마다 간격 추가
|
||||
counter = 0;
|
||||
calendar.add(Calendar.MINUTE, Integer.parseInt(mjonMsgVO.getDivideTime()));
|
||||
}
|
||||
counter++;
|
||||
}
|
||||
// 예약 시간 설정
|
||||
sendVO.setReqDate(sdf.format(calendar.getTime())); // 분할된 시간 설정 또는 기본 예약 시간 사용
|
||||
} else {
|
||||
// 예약 여부가 N일 경우에도 기본 예약 시간 설정
|
||||
sendVO.setReqDate(sdf.format(calendar.getTime()));
|
||||
}
|
||||
|
||||
// 전송사 코드 셋팅
|
||||
String agentCode = "00".equals(mjonMsgVO.getAgentCode())
|
||||
? MsgSendUtils.assignAgentBasedOnCount(agentSendCounts, sendRateList)
|
||||
: mjonMsgVO.getAgentCode();
|
||||
sendVO.setAgentCode(agentCode);
|
||||
|
||||
}
|
||||
// Group TB에 넣어줄 제목
|
||||
// 치환안된 sms 데이터로 넣어야함
|
||||
log.info(" mjonMsgSendListVO size :: [{}]", mjonMsgSendListVO.size());
|
||||
if (LONG_MSG_TYPE.equals(mjonMsgSendListVO.get(0).getMsgType())){
|
||||
mjonMsgVO.setMmsSubject(getMmsgSubject(smsTxtTemp, msgKind));
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @methodName : setImagePathsForMsgSendVO
|
||||
* @author : 이호영
|
||||
* @date : 2024.11.26
|
||||
* @description : vo에 이미지 셋팅
|
||||
* @param mjonMsgVO
|
||||
* @param sendVO
|
||||
*/
|
||||
private static void setImagePathsForMsgSendVO(MjonMsgVO mjonMsgVO, MjonMsgSendVO sendVO) {
|
||||
int fileCount = Integer.parseInt(mjonMsgVO.getFileCnt());
|
||||
|
||||
switch (fileCount) {
|
||||
case 3:
|
||||
sendVO.setFilePath3(mjonMsgVO.getFileName3());
|
||||
case 2:
|
||||
sendVO.setFilePath2(mjonMsgVO.getFileName2());
|
||||
case 1:
|
||||
sendVO.setFilePath1(mjonMsgVO.getFileName1());
|
||||
break;
|
||||
default:
|
||||
// fileCount가 0이거나 설정할 파일이 없는 경우
|
||||
break;
|
||||
}
|
||||
sendVO.setFileCnt(mjonMsgVO.getFileCnt());
|
||||
}
|
||||
|
||||
private static void checkSpamAndSetStatus(MjonMsgVO mjonMsgVO, String personalizedSmsTxt, List<String> resultSpamTxt, boolean isHolidayNotified) throws Exception {
|
||||
|
||||
|
||||
mjonMsgVO.setSpamStatus("N");
|
||||
mjonMsgVO.setDelayYn("N");
|
||||
|
||||
if(StringUtils.isNotEmpty(personalizedSmsTxt)) {
|
||||
|
||||
String resultParser = ComGetSpamStringParser.getSpamTextParse(personalizedSmsTxt).trim();
|
||||
int spmCnt = 0;
|
||||
String spmFilterTxt = "";
|
||||
|
||||
for (String spmTxt : resultSpamTxt) {
|
||||
String parserStr = ComGetSpamStringParser.getSpamTextParse(spmTxt).trim();
|
||||
if (resultParser.contains(parserStr)) {
|
||||
spmCnt++;
|
||||
spmFilterTxt += spmTxt + ",";
|
||||
}
|
||||
}
|
||||
|
||||
if (spmCnt > 0) { // 스팸 문자가 포함된 경우
|
||||
|
||||
if (StringUtil.getWordRight(spmFilterTxt.trim(), 1).equals(",")) {
|
||||
// 처음부터 idx 만큼 잘라낸 나머지 글자
|
||||
spmFilterTxt = StringUtil.getWordLeft(spmFilterTxt.trim(), 1);
|
||||
|
||||
}
|
||||
|
||||
/* @isHolidayNotified
|
||||
* - 관리자 알림 설정으로 인해
|
||||
* - 해당 시간이면 지연 미처리
|
||||
* */
|
||||
mjonMsgVO.setSpamStatus("Y");
|
||||
if(isHolidayNotified) {
|
||||
mjonMsgVO.setDelayYn("Y");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static Boolean getReplaceYN(String smsTxtTemplate) {// 여러 치환 구문이 포함된 정규식 패턴
|
||||
|
||||
if (smsTxtTemplate == null) {
|
||||
return false; // null일 경우 false 반환
|
||||
}
|
||||
|
||||
Boolean replaceYN = false;
|
||||
|
||||
Pattern pattern = Pattern.compile("\\[\\*이름\\*\\]|\\[\\*1\\*\\]|\\[\\*2\\*\\]|\\[\\*3\\*\\]|\\[\\*4\\*\\]");
|
||||
Matcher matcher = pattern.matcher(smsTxtTemplate);
|
||||
|
||||
// 정규식 패턴에 해당하는 치환 구문이 존재하는지 확인
|
||||
if (matcher.find()) {
|
||||
replaceYN = true;
|
||||
}
|
||||
return replaceYN;
|
||||
}
|
||||
|
||||
/**
|
||||
* @methodName : getSpamChkSize
|
||||
* @author : 이호영
|
||||
* @date : 2024.11.13
|
||||
* @description : 수신자 건수별로 스팸체크하는 갯수 설정
|
||||
* @param size
|
||||
* @return
|
||||
*/
|
||||
private static int getSpamChkSize(int size) {
|
||||
int chkSize = 1; // 기본 샘플 크기
|
||||
|
||||
// 수신자 수에 따른 샘플 크기 결정
|
||||
if (size > 100 && size <= 1000) {
|
||||
chkSize = 10;
|
||||
} else if (size > 1000) {
|
||||
chkSize = 50;
|
||||
}
|
||||
|
||||
return chkSize;
|
||||
}
|
||||
|
||||
/**
|
||||
* 특정 플레이스홀더를 리스트에서 가져온 값으로 치환합니다.
|
||||
*
|
||||
* @param smsTxt 문자 내용
|
||||
* @param placeholder 치환할 플레이스홀더 (예: [*이름*])
|
||||
* @param list 치환할 데이터 리스트
|
||||
* @param index 현재 인덱스
|
||||
* @return 치환된 문자 내용
|
||||
*/
|
||||
private static String replacePlaceholder(String smsTxt, String placeholder, String[] list, int index) {
|
||||
if (smsTxt.contains(placeholder)) {
|
||||
if (list.length > index && StringUtil.isNotEmpty(list[index])) {
|
||||
smsTxt = smsTxt.replaceAll(placeholder, StringUtil.getString(list[index].replaceAll("§", ",")));
|
||||
} else {
|
||||
smsTxt = smsTxt.replaceAll(placeholder, "");
|
||||
}
|
||||
}
|
||||
return smsTxt;
|
||||
}
|
||||
|
||||
// 배열 인덱스를 안전하게 접근하는 메서드
|
||||
private static String getSafeValue(String[] array, int index) {
|
||||
return (array != null && array.length > index) ? array[index] : " ";
|
||||
}
|
||||
|
||||
// 치환 처리에 특수문자 제거 로직이 포함된 메서드
|
||||
private static String getReplacementValue(String[] array, int index, String placeholder) {
|
||||
if (array != null && array.length > index && StringUtil.isNotEmpty(array[index])) {
|
||||
return StringUtil.getString(array[index].replaceAll("§", ","));
|
||||
} else {
|
||||
return " ";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static void statusResponseSet (StatusResponse statusResponse, HttpStatus httpStatus, String msg ) {
|
||||
statusResponse.setStatus(httpStatus);
|
||||
statusResponse.setMessage(msg);
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static StatusResponse validateFilesForMessageSending(int fileCount, MjonMsgVO mjonMsgVO) {
|
||||
if (fileCount > 0) {
|
||||
boolean allFilesAreNull = Stream
|
||||
.of(mjonMsgVO.getFileName1(), mjonMsgVO.getFileName2(), mjonMsgVO.getFileName3())
|
||||
.allMatch(Objects::isNull);
|
||||
|
||||
if (allFilesAreNull) {
|
||||
return new StatusResponse(HttpStatus.NO_CONTENT, "문자 메세지 이미지 추가에 오류가 발생하여 문자 발송이 취소 되었습니다.");
|
||||
}
|
||||
}
|
||||
return null; // 유효성 검사를 통과한 경우
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @methodName : validateReplacementData
|
||||
* @author : 이호영
|
||||
* @date : 2024.09.25
|
||||
* @description : 치환문자가 사용될 때 데이터가 올바른지 확인하는 메서드
|
||||
* @param mjonMsgVO
|
||||
* @param list
|
||||
* @return boolean
|
||||
*/
|
||||
/*
|
||||
* public static boolean validateReplacementData(MjonMsgVO mjonMsgVO,
|
||||
* List<MjonMsgSendVO> list) { // 치환 구문과 필드 getter 매핑 Map<String,
|
||||
* Function<MjonMsgSendVO, String>> placeholders = new HashMap<>();
|
||||
* placeholders.put("\\[\\*이름\\*\\]", MjonMsgSendVO::getName);
|
||||
* placeholders.put("\\[\\*1\\*\\]", MjonMsgSendVO::getRep1);
|
||||
* placeholders.put("\\[\\*2\\*\\]", MjonMsgSendVO::getRep2);
|
||||
* placeholders.put("\\[\\*3\\*\\]", MjonMsgSendVO::getRep3);
|
||||
* placeholders.put("\\[\\*4\\*\\]", MjonMsgSendVO::getRep4);
|
||||
*
|
||||
* // smsTxt 에서 필요한 치환 구문이 포함되어 있는지 확인 String smsTxt = mjonMsgVO.getSmsTxt();
|
||||
* for (Map.Entry<String, Function<MjonMsgSendVO, String>> entry :
|
||||
* placeholders.entrySet()) { if
|
||||
* (Pattern.compile(entry.getKey()).matcher(smsTxt).find()) { // 해당 치환 구문이 존재할
|
||||
* 경우 모든 수신자에서 필드 값 확인 for (MjonMsgSendVO recipient : list) { if
|
||||
* (StringUtils.isEmpty(entry.getValue().apply(recipient))) { return false; //
|
||||
* 데이터가 없는 경우 } } } } // 모든 치환 구문이 유효한 데이터를 가지고 있으면 true 반환 return true; }
|
||||
*/
|
||||
|
||||
// 배열이 비어있는지 확인하는 메서드
|
||||
public static boolean isEmpty(String[] array) {
|
||||
return array == null || array.length == 0;
|
||||
}
|
||||
|
||||
public static void setPriceforVO(MjonMsgVO mjonMsgVO, List<MjonMsgSendVO> mjonMsgSendVOList, JoinSettingVO sysJoinSetVO,
|
||||
MberManageVO mberManageVO) {
|
||||
|
||||
// 사용자 단가 정보 설정 (협의 단가가 없을 경우 시스템 단가를 적용)
|
||||
float shortPrice = MsgSendUtils.getValidPrice(mberManageVO.getShortPrice(), sysJoinSetVO.getShortPrice());
|
||||
float longPrice = MsgSendUtils.getValidPrice(mberManageVO.getLongPrice(), sysJoinSetVO.getLongPrice());
|
||||
float picturePrice = MsgSendUtils.getValidPrice(mberManageVO.getPicturePrice(), sysJoinSetVO.getPicturePrice());
|
||||
float picture2Price = MsgSendUtils.getValidPrice(mberManageVO.getPicture2Price(), sysJoinSetVO.getPicture2Price());
|
||||
float picture3Price = MsgSendUtils.getValidPrice(mberManageVO.getPicture3Price(), sysJoinSetVO.getPicture3Price());
|
||||
|
||||
|
||||
// 각 메시지 타입에 따라 사용자 단가 설정 및 총 단가 계산
|
||||
float totalPrice = 0.0f;
|
||||
|
||||
for (MjonMsgSendVO sendVO : mjonMsgSendVOList) {
|
||||
String msgType = sendVO.getMsgType();
|
||||
String eachPrice;
|
||||
|
||||
switch (msgType) {
|
||||
case SHORT_MSG_TYPE: // 단문 메시지 타입
|
||||
eachPrice = Float.toString(shortPrice);
|
||||
break;
|
||||
|
||||
case LONG_MSG_TYPE: // 장문 또는 이미지 메시지 타입
|
||||
eachPrice = getPicturePrice(sendVO, longPrice, picturePrice, picture2Price, picture3Price);
|
||||
break;
|
||||
|
||||
default:
|
||||
// 기본값이 필요하다면 추가 가능
|
||||
throw new IllegalArgumentException("setPriceforVO :: type Exception ");
|
||||
}
|
||||
|
||||
sendVO.setEachPrice(eachPrice);
|
||||
// log.info(" eachPrice :: [{}]", eachPrice);
|
||||
|
||||
// 각 가격을 합산
|
||||
totalPrice += Float.parseFloat(eachPrice);
|
||||
}
|
||||
mjonMsgVO.setTotalPrice(totalPrice);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @methodName : setPriceforVO
|
||||
* @author : 이호영
|
||||
* @date : 2024.12.02
|
||||
* @description : total금액 구하기
|
||||
* @param mjonMsgSendVOList
|
||||
* @return
|
||||
*/
|
||||
public static float setPriceforVO(List<MjonMsgSendVO> mjonMsgSendVOList) {
|
||||
|
||||
float totalPrice = 0.0f;
|
||||
for (MjonMsgSendVO sendVO : mjonMsgSendVOList) {
|
||||
String priceStr = sendVO.getEachPrice();
|
||||
if(StringUtils.isNotEmpty(priceStr)) {
|
||||
totalPrice += Float.parseFloat(priceStr);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return totalPrice;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 이미지 파일 경로를 기준으로 적절한 가격을 반환하는 헬퍼 메소드.
|
||||
*/
|
||||
private static String getPicturePrice(MjonMsgSendVO sendVO, float longPrice, float picturePrice, float picture2Price, float picture3Price) {
|
||||
|
||||
switch (sendVO.getFilePath3() != null ? "FILE3" :
|
||||
sendVO.getFilePath2() != null ? "FILE2" :
|
||||
sendVO.getFilePath1() != null ? "FILE1" : "NONE") {
|
||||
case "FILE3":
|
||||
return Float.toString(picture3Price);
|
||||
case "FILE2":
|
||||
return Float.toString(picture2Price);
|
||||
case "FILE1":
|
||||
return Float.toString(picturePrice);
|
||||
default:
|
||||
return Float.toString(longPrice);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @methodName : getOptimalMsgList
|
||||
* @author : 이호영
|
||||
* @date : 2024.11.26
|
||||
* @description : 주어진 이벤트 정보와 메시지 리스트를 기반으로, 잔액 내에서 최적의 메시지 리스트를 생성하고 결과를 반환합니다.
|
||||
* 만약 잔액이 부족하거나 이벤트가 종료된 상태라면, 이벤트 종료 정보를 포함하여 반환합니다.
|
||||
*
|
||||
* @param eventMberInfo 이벤트 정보 객체 (MjonEventVO). 이벤트 상태 및 잔액 정보를 포함.
|
||||
* @param mjonMsgSendVOList 최적화를 수행할 메시지 리스트 (List<MjonMsgSendVO>).
|
||||
* @return OptimalMsgResultDTO 최적 메시지 리스트와 이벤트 상태 정보를 포함한 DTO 객체.
|
||||
* @throws Exception 메시지 단가 계산 오류 또는 기타 처리 중 발생한 예외를 상위로 전달.
|
||||
*/
|
||||
public static OptimalMsgResultDTO getOptimalMsgList(
|
||||
MjonEventVO eventMberInfo,
|
||||
List<MjonMsgSendVO> mjonMsgSendVOList) throws Exception {
|
||||
|
||||
// 최적의 메시지 리스트를 담을 리스트
|
||||
List<MjonMsgSendVO> optimalList = new ArrayList<>();
|
||||
|
||||
// 이벤트 정보가 없는 경우
|
||||
if (eventMberInfo == null) {
|
||||
return OptimalMsgResultDTO.builder()
|
||||
.optimalMsgList(optimalList)
|
||||
.eventInfo(null)
|
||||
.build();
|
||||
}
|
||||
|
||||
// 이벤트 잔액과 종료 조건 확인
|
||||
double remainCash = eventMberInfo.getEventRemainCash();
|
||||
String eventEndDate = eventMberInfo.getEventEndDate();
|
||||
|
||||
if (isEventExpired(remainCash, eventEndDate)) {
|
||||
MjonEventVO returnEventMberInfo = terminateEvent(eventMberInfo, remainCash);
|
||||
return OptimalMsgResultDTO.builder()
|
||||
.optimalMsgList(optimalList)
|
||||
.eventInfo(returnEventMberInfo)
|
||||
.build();
|
||||
}
|
||||
|
||||
// 단가 설정
|
||||
float eventShortPrice = Float.parseFloat(eventMberInfo.getEventShortPrice());
|
||||
float eventLongPrice = Float.parseFloat(eventMberInfo.getEventLongPrice());
|
||||
float eventPicturePrice = Float.parseFloat(eventMberInfo.getEventPicturePrice());
|
||||
float eventPicture2Price = Float.parseFloat(eventMberInfo.getEventPicture2Price());
|
||||
float eventPicture3Price = Float.parseFloat(eventMberInfo.getEventPicture3Price());
|
||||
|
||||
// 최적의 메시지 리스트 생성
|
||||
double sum = 0.0;
|
||||
Iterator<MjonMsgSendVO> iterator = mjonMsgSendVOList.iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
MjonMsgSendVO msg = iterator.next();
|
||||
|
||||
// 단가 계산 및 예외 처리
|
||||
String eachPrice = getEachPriceOrThrow(msg, eventShortPrice, eventLongPrice, eventPicturePrice, eventPicture2Price, eventPicture3Price);
|
||||
|
||||
float floatEachPrice = Float.parseFloat(eachPrice);
|
||||
|
||||
// 최적의 메시지 리스트에 추가
|
||||
if (sum + floatEachPrice <= remainCash) {
|
||||
sum += floatEachPrice;
|
||||
|
||||
msg.setEachPrice(eachPrice);
|
||||
msg.setEventYn("Y");
|
||||
|
||||
optimalList.add(msg);
|
||||
iterator.remove();
|
||||
} else {
|
||||
break; // 예산 초과로 추가 불가능
|
||||
}
|
||||
}
|
||||
|
||||
// 이벤트 잔액 처리하는 매소드 terminateEvent
|
||||
// double remainAmt = targetCash - sum;
|
||||
// MjonEventVO returnEventMberInfo = terminateEvent(eventMberInfo, remainAmt);
|
||||
return OptimalMsgResultDTO.builder()
|
||||
.optimalMsgList(optimalList)
|
||||
// .eventInfo(returnEventMberInfo)
|
||||
.build();
|
||||
|
||||
// 결과 반환
|
||||
// return OptimalMsgResultDTO.builder()
|
||||
// .optimalMsgList(optimalList)
|
||||
// .eventInfo(null)
|
||||
// .build();
|
||||
}
|
||||
|
||||
/**
|
||||
* @methodName : getEachPriceOrThrow
|
||||
* @author : 이호영
|
||||
* @date : 2024.11.26
|
||||
* @description :
|
||||
* @param msg
|
||||
* @param shortPrice
|
||||
* @param longPrice
|
||||
* @param picturePrice
|
||||
* @param picture2Price
|
||||
* @param picture3Price
|
||||
* @return
|
||||
*/
|
||||
private static String getEachPriceOrThrow(
|
||||
MjonMsgSendVO msg,
|
||||
float shortPrice,
|
||||
float longPrice,
|
||||
float picturePrice,
|
||||
float picture2Price,
|
||||
float picture3Price) {
|
||||
|
||||
switch (msg.getMsgType()) {
|
||||
case SHORT_MSG_TYPE:
|
||||
return Float.toString(shortPrice);
|
||||
case LONG_MSG_TYPE:
|
||||
return getPicturePrice(msg, longPrice, picturePrice, picture2Price, picture3Price);
|
||||
default:
|
||||
throw new IllegalArgumentException("Unsupported message type: " + msg.getMsgType());
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean isEventExpired(double targetCash, String eventEndDate) throws Exception {
|
||||
return !MJUtil.getCompareDate(eventEndDate) || targetCash < MIN_EVENT_REMAIN_CASH;
|
||||
}
|
||||
|
||||
/**
|
||||
* @methodName : terminateEvent
|
||||
* @author : 이호영
|
||||
* @date : 2024.11.26
|
||||
* @description : 이벤트 종료 VO 생성
|
||||
* @param eventMberInfo
|
||||
* @param remainCash
|
||||
* @return
|
||||
*/
|
||||
public static MjonEventVO terminateEvent(MjonEventVO eventMberInfo, double remainCash) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
// 이벤트 상태를 종료로 변경
|
||||
MjonEventVO returnEventMberInfo = new MjonEventVO();
|
||||
returnEventMberInfo.setEventInfoId(eventMberInfo.getEventInfoId());
|
||||
returnEventMberInfo.setMberId(eventMberInfo.getMberId());
|
||||
returnEventMberInfo.setEventRemainCash(remainCash);
|
||||
returnEventMberInfo.setEventStatus("Y");
|
||||
|
||||
if (remainCash < MIN_EVENT_REMAIN_CASH) {
|
||||
returnEventMberInfo.setEventStatus("E");
|
||||
returnEventMberInfo.setEventMemo("발송 최소 금액("+ MIN_EVENT_REMAIN_CASH +") 부족 혹은 이벤트 종료일 초과되어 이벤트 종료 시킴");
|
||||
}
|
||||
return returnEventMberInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* @methodName : handleHotlineAgentRate
|
||||
* @author : 이호영
|
||||
* @date : 2024.11.26
|
||||
* @description : 전용 전송사 비율이 0이면 대표 전송사로 수정
|
||||
* @param userInfo
|
||||
* @param tmp
|
||||
* @param hotlineAgentCode
|
||||
* @return
|
||||
*/
|
||||
public static String handleHotlineAgentRate(MberManageVO userInfo, MjonMsgAgentStsVO tmp, String hotlineAgentCode) {
|
||||
String sendRate = tmp.getSendRate();
|
||||
String repAgent = tmp.getRepAgent();
|
||||
String useYn = tmp.getUseYn();
|
||||
|
||||
// 블라인드 코드가 'N'인 경우 전송 비율 및 사용 가능 여부 확인
|
||||
if ("N".equals(userInfo.getBlineCode())) {
|
||||
// 전송 비율이 0이거나 사용 불가인 경우 대표 전송사로 변경
|
||||
if ("0".equals(sendRate) || "N".equals(useYn)) {
|
||||
hotlineAgentCode = repAgent;
|
||||
}
|
||||
}
|
||||
|
||||
return hotlineAgentCode; // 변경된 hotlineAgentCode 반환
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @methodName : initializeAgentSendCounts
|
||||
* @author : 이호영
|
||||
* @date : 2024.11.26
|
||||
* @description : 전송사별 코드로 map 초기화 하기
|
||||
* @return
|
||||
*/
|
||||
public static Map<String, Integer> initializeAgentSendCounts() {
|
||||
Map<String, Integer> agentSendCounts = new HashMap<>();
|
||||
agentSendCounts.put("01", 0); // 아이하트
|
||||
agentSendCounts.put("02", 0); // 현대 퓨쳐넷
|
||||
agentSendCounts.put("03", 0); // 아이엠오
|
||||
agentSendCounts.put("04", 0); // 비즈뿌리오
|
||||
agentSendCounts.put("05", 0); // 제이제이
|
||||
agentSendCounts.put("07", 0); // 인비토
|
||||
return agentSendCounts;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @methodName : calculateSendCounts
|
||||
* @author : 이호영
|
||||
* @date : 2024.11.26
|
||||
* @description : agentSendCounts에 있는 에이젼트 map에 전송사 비율에 따라 카운트 put 하기
|
||||
* @param agentSendCounts
|
||||
* @param sendRate
|
||||
* @param finalSize
|
||||
*/
|
||||
public static void calculateSendCounts(Map<String, Integer> agentSendCounts, MjonMsgVO sendRate, int finalSize) {
|
||||
String agentCode = sendRate.getAgentCode();
|
||||
float sendRatePercentage = Float.parseFloat(sendRate.getSendRate());
|
||||
|
||||
int sendCount = Math.round(finalSize * sendRatePercentage);
|
||||
|
||||
if (agentSendCounts.containsKey(agentCode)) {
|
||||
agentSendCounts.put(agentCode, sendCount);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @methodName : assignAgentBasedOnCount
|
||||
* @author : 이호영
|
||||
* @date : 2024.11.26
|
||||
* @description : initializeAgentSendCounts()에서 만든 map으로 발송 agent 데이터 Set
|
||||
* @param agentSendCounts
|
||||
* @param sendRateList
|
||||
* @return
|
||||
*/
|
||||
public static String assignAgentBasedOnCount(Map<String, Integer> agentSendCounts, List<MjonMsgVO> sendRateList) {
|
||||
// 전송사 코드 순서대로 확인 :: initializeAgentSendCounts 메소드와 맞춰야함
|
||||
List<String> agentCodes = Arrays.asList("01", "02", "03", "04", "05", "07");
|
||||
|
||||
// 전송 가능한 코드 찾기
|
||||
for (String agentCode : agentCodes) {
|
||||
if (agentSendCounts.get(agentCode) > 0) {
|
||||
agentSendCounts.put(agentCode, agentSendCounts.get(agentCode) - 1);
|
||||
return agentCode;
|
||||
}
|
||||
}
|
||||
|
||||
// 모든 코드의 전송 가능 횟수가 0이면 대표 전송사로 할당
|
||||
return sendRateList.get(0).getRepAgent();
|
||||
}
|
||||
|
||||
/**
|
||||
* @methodName : getMmsgSubject
|
||||
* @author : 이호영
|
||||
* @date : 2024.12.02
|
||||
* @description : 타이틀 생성
|
||||
* @param smsTxt
|
||||
* @param msgKind
|
||||
* @return
|
||||
*/
|
||||
public static String getMmsgSubject(String smsTxt, String msgKind) {
|
||||
|
||||
String mmsTitleTemp = "";
|
||||
if(StringUtils.isEmpty(smsTxt)) {
|
||||
return mmsTitleTemp;
|
||||
}
|
||||
// SMS 텍스트를 줄 단위로 나누기
|
||||
String[] split = smsTxt.split("\n");
|
||||
|
||||
if (split.length > 0) {
|
||||
// "C" 메시지 종류인 경우 두 번째 줄, 그렇지 않으면 첫 번째 줄을 제목으로 설정
|
||||
mmsTitleTemp = "C".equals(msgKind) && split.length > 1 ? split[1].trim() : split[0].trim();
|
||||
|
||||
// 제목 글자 수를 20자로 제한 (초과 시 잘라냄)
|
||||
mmsTitleTemp = mmsTitleTemp.length() > 20 ? mmsTitleTemp.substring(0, 20) : mmsTitleTemp;
|
||||
}
|
||||
return mmsTitleTemp;
|
||||
}
|
||||
|
||||
/**
|
||||
* @methodName : eventYN
|
||||
* @author : 이호영
|
||||
* @date : 2025.02.10
|
||||
* @description : 이벤트 확인
|
||||
* @param eventMberInfo
|
||||
* @return
|
||||
*/
|
||||
public static Boolean isNotEvent(MjonEventVO eventMberInfo) {
|
||||
|
||||
|
||||
if (eventMberInfo == null
|
||||
|| "E".equals(eventMberInfo.getEventStatus())
|
||||
|| org.apache.commons.lang3.StringUtils.isEmpty(eventMberInfo.getEventEndDate())
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -1,48 +0,0 @@
|
||||
package itn.com.cmm.util;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author : 이호영
|
||||
* @fileName : PayUtil.java
|
||||
* @date : 2024.07.16
|
||||
* @description : pay 다루는 Util
|
||||
* ===========================================================
|
||||
* DATE AUTHOR NOTE
|
||||
* ----------------------------------------------------------- *
|
||||
* 2023.04.06 이호영 최초 생성
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
public final class PayUtils {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @methodName : getTrimToFirstDecimal
|
||||
* @author : 이호영
|
||||
* @date : 2023.07.16
|
||||
* @description : 소수점 첫째자리 빼고 다 버림
|
||||
* @return ex) 0000.0
|
||||
*/
|
||||
public static String getTrimToFirstDecimal(String input) {
|
||||
|
||||
try {
|
||||
// 쉼표 제거
|
||||
String normalizedInput = input.replace(",", "");
|
||||
// Double로 변환
|
||||
double value = Double.parseDouble(normalizedInput);
|
||||
// 소수점 첫째자리까지만 남기고 나머지는 버림
|
||||
double trimmedValue = Math.floor(value * 10) / 10.0;
|
||||
// 숫자가 너무 커지면 지수 표기법으로 나타내서 방지하기 위한 구문
|
||||
DecimalFormat df = new DecimalFormat("#.0");
|
||||
// 문자열로 변환하여 반환
|
||||
return df.format(trimmedValue);
|
||||
} catch (NumberFormatException e) {
|
||||
System.err.println("Number format exception: " + e.getMessage());
|
||||
return "0";
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,145 +0,0 @@
|
||||
package itn.com.cmm.util;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import itn.let.kakao.kakaoComm.KakaoSendAdvcVO;
|
||||
import itn.let.kakao.kakaoComm.KakaoVO;
|
||||
import itn.let.mjo.msg.service.MjonMsgVO;
|
||||
|
||||
public class SlackMessageFormatUtil {
|
||||
|
||||
private static final String PREFIX_SMISHING = "[스미싱의심]";
|
||||
private static final String PREFIX_RESERVE = "[예약]";
|
||||
private static final String PREFIX_IMAGE = "그림문자 ";
|
||||
|
||||
/**
|
||||
* 일반 SMS 메시지 텍스트 포맷팅
|
||||
*/
|
||||
public static String formatSmsText(MjonMsgVO mjonMsgVO) {
|
||||
String smsTxt = mjonMsgVO.getSmsTxt();
|
||||
String reserveYn = safeGetString(mjonMsgVO.getReserveYn());
|
||||
String delayYn = safeGetString(mjonMsgVO.getDelayYn());
|
||||
String smishingYn = safeGetString(mjonMsgVO.getSmishingYn());
|
||||
|
||||
// 공통 텍스트 포맷팅 로직 적용
|
||||
smsTxt = formatMessagePrefix(smsTxt, reserveYn,
|
||||
"Y".equals(smishingYn) || "Y".equals(delayYn));
|
||||
|
||||
// 그림 문자 처리 (SMS 전용 로직)
|
||||
int fileCount = parseIntOrDefault(mjonMsgVO.getFileCnt(), 0);
|
||||
if ("6".equals(mjonMsgVO.getMsgType()) && fileCount > 0 && StringUtils.isEmpty(smsTxt)) {
|
||||
smsTxt = "그림문자 " + smsTxt;
|
||||
}
|
||||
|
||||
return smsTxt;
|
||||
}
|
||||
|
||||
/**
|
||||
* 카카오톡 메시지 텍스트 포맷팅
|
||||
*/
|
||||
public static String formatKakaoText(KakaoSendAdvcVO sendVO) {
|
||||
String smsTxt = sendVO.getTemplateContent();
|
||||
String reserveYn = safeGetString(sendVO.getReserveYn());
|
||||
String atDelayYn = safeGetString(sendVO.getAtDelayYn());
|
||||
|
||||
// 공통 텍스트 포맷팅 로직 적용
|
||||
return formatMessagePrefix(smsTxt, reserveYn, "Y".equals(atDelayYn));
|
||||
}
|
||||
|
||||
|
||||
public static String formatSandName(MjonMsgVO mjonMsgVO) {
|
||||
String userId = mjonMsgVO.getUserId();
|
||||
String callFrom = mjonMsgVO.getCallFrom();
|
||||
String msgType = getMessageTypeLabel(mjonMsgVO.getMsgType(), mjonMsgVO.getFileCnt());
|
||||
return String.format("[%s][%s]%s", userId, callFrom, msgType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 메시지 접두사 포맷팅 공통 로직 (예약 및 스미싱 의심 접두사 처리)
|
||||
*
|
||||
* @param messageText 원본 메시지 텍스트
|
||||
* @param reserveYn 예약 여부
|
||||
* @param isSmishing 스미싱 의심 여부
|
||||
* @return 포맷팅된 메시지 텍스트
|
||||
*/
|
||||
public static String formatMessagePrefix(String messageText, String reserveYn, boolean isSmishing) {
|
||||
if ("Y".equals(reserveYn)) {
|
||||
return isSmishing ? PREFIX_SMISHING + PREFIX_RESERVE + messageText : PREFIX_RESERVE + messageText;
|
||||
} else if (isSmishing) {
|
||||
return PREFIX_SMISHING + messageText;
|
||||
}
|
||||
return messageText;
|
||||
}
|
||||
|
||||
/**
|
||||
* @카카오톡용 sandName 포맷팅 메서드
|
||||
*/
|
||||
public static String formatKakaoSandName(KakaoSendAdvcVO sendVO) {
|
||||
String userId = sendVO.getUserId();
|
||||
String callFrom = sendVO.getCallFrom();
|
||||
String msgType = getKakaoMessageTypeLabel(sendVO.getMsgType());
|
||||
return String.format("[%s][%s]%s", userId, callFrom, msgType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 메시지 타입 레이블 반환 (SMS 전용)
|
||||
*
|
||||
* @param msgType 메시지 타입
|
||||
* @param fileCnt 파일 개수
|
||||
* @return 메시지 타입 레이블
|
||||
*/
|
||||
public static String getMessageTypeLabel(String msgType, String fileCnt) {
|
||||
int fileCount = parseIntOrDefault(fileCnt, 0);
|
||||
|
||||
switch (msgType) {
|
||||
case "4":
|
||||
return "[단문]";
|
||||
case "6":
|
||||
return fileCount == 0 ? "[장문]" : "[그림]";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 카카오톡 메시지 타입 레이블 반환
|
||||
*
|
||||
* @param msgType 메시지 타입
|
||||
* @return 메시지 타입 레이블
|
||||
*/
|
||||
public static String getKakaoMessageTypeLabel(String msgType) {
|
||||
switch (msgType) {
|
||||
case "8":
|
||||
return "[알림톡]";
|
||||
case "9":
|
||||
return "[친구톡]";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 정수로 변환, 변환 실패 시 기본값 반환
|
||||
*
|
||||
* @param value 변환할 문자열
|
||||
* @param defaultValue 기본값
|
||||
* @return 변환된 정수 또는 기본값
|
||||
*/
|
||||
public static int parseIntOrDefault(String value, int defaultValue) {
|
||||
try {
|
||||
return Integer.parseInt(value);
|
||||
} catch (NumberFormatException e) {
|
||||
return defaultValue;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 안전하게 문자열 가져오기 (null 체크)
|
||||
*
|
||||
* @param value 원본 문자열
|
||||
* @return 원본 문자열 또는 빈 문자열
|
||||
*/
|
||||
public static String safeGetString(String value) {
|
||||
return value == null ? "" : value;
|
||||
}
|
||||
}
|
||||
@ -26,8 +26,6 @@ import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
public class StringUtil {
|
||||
|
||||
private static final int HIGHEST_SPECIAL = '>'; // for escaping html code. by hessie; since 2007/10/01.
|
||||
@ -602,16 +600,4 @@ public class StringUtil {
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static String getLengthChkAndSubString(String str, int maxLength) {
|
||||
|
||||
if (StringUtils.length(str) > maxLength) {
|
||||
str = StringUtils.substring(str, 0, maxLength);
|
||||
// 잘라낸 문자열을 다시 설정 (필요한 경우)
|
||||
}
|
||||
return str;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -1,40 +0,0 @@
|
||||
package itn.com.uss.ion.bnr.pop.service;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
import itn.com.cmm.ComDefaultVO;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @author : 이호영
|
||||
* @fileName : MainPopupLinkVO.java
|
||||
* @date : 2025.02.26
|
||||
* @description :
|
||||
* ===========================================================
|
||||
* DATE AUTHOR NOTE
|
||||
* ----------------------------------------------------------- *
|
||||
* 2025.02.26 이호영 최초 생성
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
public class MainPopupLinkVO extends ComDefaultVO implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* @description :
|
||||
*/
|
||||
private static final long serialVersionUID = 1998370534684278351L;
|
||||
|
||||
private String popId; // 메인존ID
|
||||
private String mlink; // 링크
|
||||
private String coords; // 링크좌표
|
||||
private String popLinkId; // 링크좌표
|
||||
|
||||
}
|
||||
@ -1,34 +0,0 @@
|
||||
package itn.com.uss.ion.bnr.pop.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import itn.com.cmm.RestResponse;
|
||||
|
||||
/**
|
||||
* 개요
|
||||
* - 팝업창에 대한 Service Interface를 정의한다.
|
||||
*
|
||||
* 상세내용
|
||||
* - 팝업창에 대한 등록, 수정, 삭제, 조회, 반영확인 기능을 제공한다.
|
||||
* - 팝업창의 조회기능은 목록조회, 상세조회, 팝업사용자 보기로 구분된다.
|
||||
* @author 이창원
|
||||
* @version 1.0
|
||||
* @created 05-8-2009 오후 2:19:58
|
||||
*/
|
||||
public interface MainPopupManageService {
|
||||
|
||||
public List<?> selectMainPopupList(MainPopupVO mainPopupVO) throws Exception;
|
||||
|
||||
public int selectMainPopupCount(MainPopupVO mainPopupVO) throws Exception;
|
||||
|
||||
public MainPopupVO selectMainPopupVO(String mazId) throws Exception;
|
||||
|
||||
public List<MainPopupVO> selectMainPopupListRolling();
|
||||
|
||||
public void deleteMainPopup(String id);
|
||||
|
||||
public void resetMainPopupSort(MainPopupVO mainPopupVO);
|
||||
|
||||
public RestResponse deleteMainPopupLink(MainPopupLinkVO mainPopupLinkVO);
|
||||
|
||||
}
|
||||
@ -1,59 +0,0 @@
|
||||
package itn.com.uss.ion.bnr.pop.service;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import itn.com.cmm.ComDefaultVO;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author : 이호영
|
||||
* @fileName : MainPopupVO.java
|
||||
* @date : 2025.02.26
|
||||
* @description :
|
||||
* ===========================================================
|
||||
* DATE AUTHOR NOTE
|
||||
* ----------------------------------------------------------- *
|
||||
* 2025.02.26 이호영 최초 생성
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
public class MainPopupVO extends ComDefaultVO implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* @description :
|
||||
*/
|
||||
private static final long serialVersionUID = 1998370534684278351L;
|
||||
|
||||
private String popId; // 메인존ID
|
||||
private String content; // 대체택스트
|
||||
private String del; // 삭제여부
|
||||
private String mainzoneImageFile; // 이미지파일ID
|
||||
private String mainzoneImage; // 이미지파일명
|
||||
private String regdt; // 등록일
|
||||
private String moddt; // 수정일
|
||||
private String popNm; // 메인팝업존키
|
||||
private String useYn; // 사용여부
|
||||
private String registerId; // 등록자 아이디
|
||||
private String deviceType; // 접근타입
|
||||
private String ntceBgnde; // 게시 시작일자
|
||||
private String ntceEndde; // 게시 종료일자
|
||||
|
||||
private String ntceBgndeHH;
|
||||
private String ntceBgndeMM;
|
||||
private String ntceEnddeHH;
|
||||
private String ntceEnddeMM;
|
||||
|
||||
private String devicetype;
|
||||
|
||||
private List<MainPopupLinkVO> mainPopupLinkList; // 게시 종료일자
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -1,62 +0,0 @@
|
||||
package itn.com.uss.ion.bnr.pop.service.impl;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import itn.com.cmm.service.impl.EgovComAbstractDAO;
|
||||
import itn.com.uss.ion.bnr.pop.service.MainPopupLinkVO;
|
||||
import itn.com.uss.ion.bnr.pop.service.MainPopupVO;
|
||||
|
||||
/**
|
||||
* 개요
|
||||
* - 팝업창에 대한 DAO를 정의한다.
|
||||
*
|
||||
* 상세내용
|
||||
* - 팝업창에 대한 등록, 수정, 삭제, 조회, 반영확인 기능을 제공한다.
|
||||
* - 팝업창의 조회기능은 목록조회, 상세조회로, 사용자화면 보기로 구분된다.
|
||||
* @author 이창원
|
||||
* @version 1.0
|
||||
* @created 05-8-2009 오후 2:21:04
|
||||
*/
|
||||
@Repository("mainPopupManageDAO")
|
||||
public class MainPopupManageDAO extends EgovComAbstractDAO {
|
||||
|
||||
|
||||
/**
|
||||
* 메인이미지 목록을 조회한다.
|
||||
* @return 글 목록
|
||||
* @exception Exception
|
||||
*/
|
||||
public List<?> selectMainPopupList(MainPopupVO mainPopupVO ) throws Exception{
|
||||
return list("mainPopup.selectMainPopupList", mainPopupVO);
|
||||
}
|
||||
|
||||
|
||||
public int selectMainPopupCount(MainPopupVO mainPopupVO) throws Exception{
|
||||
return (int)select("mainPopup.selectMainPopupCount", mainPopupVO);
|
||||
}
|
||||
|
||||
|
||||
public MainPopupVO selectMainPopupVO(String mazId) throws Exception{
|
||||
return (MainPopupVO)select("mainPopup.selectMainPopupVO", mazId);
|
||||
}
|
||||
|
||||
|
||||
public List<MainPopupVO> selectMainPopupListRolling() {
|
||||
return (List<MainPopupVO>) list("mainPopup.selectMainPopupListRolling");
|
||||
}
|
||||
|
||||
|
||||
public void deleteMainPopup(String popId) {
|
||||
delete("mainPopup.deleteMainPopup", popId);
|
||||
}
|
||||
|
||||
|
||||
public void resetMainPopupSort(MainPopupVO mainPopupVO) {
|
||||
update("mainPopup.resetMainPopupSort", mainPopupVO);
|
||||
}
|
||||
|
||||
public void deleteMainPopupLinkInfo(MainPopupLinkVO mainPopupLinkVO) {
|
||||
delete("mainPopup.deleteMainPopupLinkInfo", mainPopupLinkVO);
|
||||
}
|
||||
}
|
||||
@ -1,89 +0,0 @@
|
||||
package itn.com.uss.ion.bnr.pop.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl;
|
||||
import egovframework.rte.fdl.idgnr.EgovIdGnrService;
|
||||
import itn.com.cmm.RestResponse;
|
||||
import itn.com.uss.ion.bnr.pop.service.MainPopupLinkVO;
|
||||
import itn.com.uss.ion.bnr.pop.service.MainPopupManageService;
|
||||
import itn.com.uss.ion.bnr.pop.service.MainPopupVO;
|
||||
import itn.com.uss.ion.pwm.service.impl.PopupManageDAO;
|
||||
|
||||
/**
|
||||
* 개요
|
||||
* - 팝업창에 대한 ServiceImpl을 정의한다.
|
||||
*
|
||||
* 상세내용
|
||||
* - 팝업창에 대한 등록, 수정, 삭제, 조회, 반영확인 기능을 제공한다.
|
||||
* - 팝업창의 조회기능은 목록조회, 상세조회로, 사용자화면 보기로 구분된다.
|
||||
* @author 이창원
|
||||
* @version 1.0
|
||||
* @created 05-8-2009 오후 2:19:58
|
||||
*/
|
||||
|
||||
@Service("mainPopupManageService")
|
||||
public class MainPopupManageServiceImpl extends EgovAbstractServiceImpl implements MainPopupManageService {
|
||||
|
||||
@Resource(name = "mainPopupManageDAO")
|
||||
public MainPopupManageDAO dao;
|
||||
|
||||
@Resource(name = "popupManageDAO")
|
||||
public PopupManageDAO popupDao;
|
||||
|
||||
@Resource(name = "egovPopupManageIdGnrService")
|
||||
private EgovIdGnrService idgenService;
|
||||
|
||||
@Override
|
||||
public List<?> selectMainPopupList(MainPopupVO mainPopupVO) throws Exception {
|
||||
return dao.selectMainPopupList(mainPopupVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int selectMainPopupCount(MainPopupVO mainPopupVO) throws Exception {
|
||||
return dao.selectMainPopupCount(mainPopupVO);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public MainPopupVO selectMainPopupVO(String mazId) throws Exception {
|
||||
MainPopupVO resultVO = dao.selectMainPopupVO(mazId);
|
||||
if (resultVO == null)
|
||||
throw processException("info.nodata.msg");
|
||||
return resultVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MainPopupVO> selectMainPopupListRolling() {
|
||||
return dao.selectMainPopupListRolling();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteMainPopup(String id) {
|
||||
popupDao.deleteMainPopupLinkInfo(id);
|
||||
dao.deleteMainPopup(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resetMainPopupSort(MainPopupVO mainPopupVO) {
|
||||
dao.resetMainPopupSort(mainPopupVO);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public RestResponse deleteMainPopupLink(MainPopupLinkVO mainPopupLinkVO) {
|
||||
dao.deleteMainPopupLinkInfo(mainPopupLinkVO);
|
||||
|
||||
return RestResponse.builder()
|
||||
.status(HttpStatus.OK) // 200, Series.SUCCESSFUL, "OK"
|
||||
.msg("삭제 되었습니다.")
|
||||
.build();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,343 +0,0 @@
|
||||
package itn.com.uss.ion.bnr.pop.web;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
import org.springmodules.validation.commons.DefaultBeanValidator;
|
||||
|
||||
import egovframework.rte.fdl.idgnr.EgovIdGnrService;
|
||||
import egovframework.rte.fdl.property.EgovPropertyService;
|
||||
import egovframework.rte.fdl.security.userdetails.util.EgovUserDetailsHelper;
|
||||
import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo;
|
||||
import itn.com.cmm.ComDefaultCodeVO;
|
||||
import itn.com.cmm.EgovMessageSource;
|
||||
import itn.com.cmm.LoginVO;
|
||||
import itn.com.cmm.RestResponse;
|
||||
import itn.com.cmm.service.EgovCmmUseService;
|
||||
import itn.com.cmm.service.EgovFileMngService;
|
||||
import itn.com.cmm.service.EgovFileMngUtil;
|
||||
import itn.com.cmm.service.FileVO;
|
||||
import itn.com.cmm.util.RedirectUrlMaker;
|
||||
import itn.com.uss.ion.bnr.pop.service.MainPopupLinkVO;
|
||||
import itn.com.uss.ion.bnr.pop.service.MainPopupManageService;
|
||||
import itn.com.uss.ion.bnr.pop.service.MainPopupVO;
|
||||
import itn.com.uss.ion.bnr.sub.service.SubMainZoneManageService;
|
||||
import itn.let.sym.site.service.EgovSiteManagerService;
|
||||
|
||||
/**
|
||||
* 개요
|
||||
* - 팝업창에 대한 Controller를 정의한다.
|
||||
*
|
||||
* 상세내용
|
||||
* - 팝업창에 대한 등록, 수정, 삭제, 조회, 반영확인 기능을 제공한다.
|
||||
* - 팝업창의 조회기능은 목록조회, 상세조회로, 사용자 화면 보기로 구분된다.
|
||||
* @author 이창원
|
||||
* @version 1.0
|
||||
* @created 05-8-2009 오후 2:19:57
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2025.02.24 이호영 최초 생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
|
||||
@Controller
|
||||
public class MainPopupController {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(MainPopupController.class);
|
||||
|
||||
@Autowired
|
||||
private DefaultBeanValidator beanValidator;
|
||||
|
||||
/** EgovMessageSource */
|
||||
@Resource(name = "egovMessageSource")
|
||||
EgovMessageSource egovMessageSource;
|
||||
|
||||
/** EgovPropertyService */
|
||||
@Resource(name = "propertiesService")
|
||||
protected EgovPropertyService propertiesService;
|
||||
|
||||
/** EgovPopupManageService */
|
||||
@Resource(name = "subMainZoneManageService")
|
||||
private SubMainZoneManageService subMainZoneManageService;
|
||||
|
||||
@Resource(name = "mainPopupManageService")
|
||||
private MainPopupManageService mainPopupManageService;
|
||||
|
||||
/** cmmUseService */
|
||||
@Resource(name = "EgovCmmUseService")
|
||||
private EgovCmmUseService cmmUseService;
|
||||
|
||||
@Resource(name="EgovFileMngUtil")
|
||||
private EgovFileMngUtil fileUtil;
|
||||
|
||||
@Resource(name="EgovFileMngService")
|
||||
private EgovFileMngService fileMngService;
|
||||
|
||||
@Resource(name = "egovPopupZoneIdGnrService")
|
||||
private EgovIdGnrService idgenService;
|
||||
|
||||
// @Resource(name = "egovMainZoneIdGnrService")
|
||||
// private EgovIdGnrService idgenServiceMain;
|
||||
|
||||
@Resource(name = "egovSubMainZoneIdGnrService")
|
||||
private EgovIdGnrService idgenServiceSubMain;
|
||||
|
||||
@Resource(name = "egovSiteManagerService")
|
||||
EgovSiteManagerService egovSiteManagerService;
|
||||
|
||||
@Resource(name = "EgovFileMngService")
|
||||
private EgovFileMngService fileService;
|
||||
|
||||
|
||||
|
||||
|
||||
/*메인이미지 관리*/
|
||||
// @RequestMapping(value="/uss/ion/bnr/subMainZoneList.do")
|
||||
@RequestMapping(value="/uss/ion/bnr/pop/mainPopupList.do")
|
||||
public String selectMainzoneList(ModelMap model , MainPopupVO mainPopupVO , HttpSession session ) throws Exception {
|
||||
LoginVO loginVO = (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser();
|
||||
|
||||
|
||||
if(mainPopupVO.getPageUnit()% 8 != 0) {//9 배수로 넘어오지 않으면 초기세팅
|
||||
mainPopupVO.setPageUnit(8);
|
||||
}else {
|
||||
mainPopupVO.setPageUnit(mainPopupVO.getPageUnit());
|
||||
}
|
||||
|
||||
/** pageing */
|
||||
PaginationInfo paginationInfo = new PaginationInfo();
|
||||
paginationInfo.setCurrentPageNo(mainPopupVO.getPageIndex());
|
||||
paginationInfo.setRecordCountPerPage(mainPopupVO.getPageUnit());
|
||||
paginationInfo.setPageSize(mainPopupVO.getPageSize());
|
||||
|
||||
mainPopupVO.setFirstIndex(paginationInfo.getFirstRecordIndex());
|
||||
mainPopupVO.setLastIndex(paginationInfo.getLastRecordIndex());
|
||||
mainPopupVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());
|
||||
|
||||
if(null != loginVO && !"super".equals(loginVO.getSiteId())){ //각각의 사이트
|
||||
mainPopupVO.setSiteId(loginVO.getSiteId());
|
||||
}
|
||||
List<?> mainPopupList = mainPopupManageService.selectMainPopupList(mainPopupVO);
|
||||
model.addAttribute("mainPopupList", mainPopupList);
|
||||
|
||||
int totCnt = mainPopupManageService.selectMainPopupCount(mainPopupVO);
|
||||
|
||||
paginationInfo.setTotalRecordCount(totCnt);
|
||||
model.addAttribute("paginationInfo", paginationInfo);
|
||||
|
||||
return "uss/ion/bnr/pop/mainPopupList";
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*알림창등록/수정 view*/
|
||||
@RequestMapping(value="/uss/ion/bnr/pop/mainPopupModify.do")
|
||||
public String updateMainZoneView(@RequestParam Map<?, ?> commandMap,
|
||||
HttpServletRequest request, Model model, HttpSession session)
|
||||
throws Exception {
|
||||
|
||||
MainPopupVO mainPopupVO = new MainPopupVO();
|
||||
if("Modify".equals((String)commandMap.get("pageType"))){ //수정
|
||||
String mazId = (String)commandMap.get("selectedId");
|
||||
mainPopupVO = mainPopupManageService.selectMainPopupVO(mazId);
|
||||
String sNtceBgnde = mainPopupVO.getNtceBgnde();
|
||||
String sNtceEndde = mainPopupVO.getNtceEndde();
|
||||
|
||||
if(sNtceBgnde != null && sNtceEndde != null ) {
|
||||
|
||||
mainPopupVO.setNtceBgndeHH(sNtceBgnde.substring(8, 10));
|
||||
mainPopupVO.setNtceBgndeMM(sNtceBgnde.substring(10, 12));
|
||||
|
||||
mainPopupVO.setNtceEnddeHH(sNtceEndde.substring(8, 10));
|
||||
mainPopupVO.setNtceEnddeMM(sNtceEndde.substring(10, 12));
|
||||
|
||||
//게시기간 시작일자(시)
|
||||
model.addAttribute("ntceBgndeHH", getTimeHH());
|
||||
//게시기간 시작일자(분)
|
||||
model.addAttribute("ntceBgndeMM", getTimeMM());
|
||||
//게시기간 종료일자(시)
|
||||
model.addAttribute("ntceEnddeHH", getTimeHH());
|
||||
//게시기간 종료일자(분)
|
||||
model.addAttribute("ntceEnddeMM", getTimeMM());
|
||||
|
||||
|
||||
}
|
||||
|
||||
if(mainPopupVO != null){
|
||||
mainPopupVO.setBeSort(mainPopupVO.getSort());
|
||||
|
||||
FileVO fileVO = new FileVO();
|
||||
String atchFileId = mainPopupVO.getMainzoneImageFile();
|
||||
fileVO.setAtchFileId(atchFileId);
|
||||
List<FileVO> fileList = fileService.selectFileInfs(fileVO);
|
||||
model.addAttribute("fileList", fileList);
|
||||
}
|
||||
}else{ //등록
|
||||
|
||||
//게시기간 시작일자(시)
|
||||
model.addAttribute("ntceBgndeHH", getTimeHH());
|
||||
//게시기간 시작일자(분)
|
||||
model.addAttribute("ntceBgndeMM", getTimeMM());
|
||||
//게시기간 종료일자(시)
|
||||
model.addAttribute("ntceEnddeHH", getTimeHH());
|
||||
//게시기간 종료일자(분)
|
||||
model.addAttribute("ntceEnddeMM", getTimeMM());
|
||||
|
||||
}
|
||||
|
||||
//model.addAttribute("sortList", sortList);
|
||||
model.addAttribute("mainPopupVO", mainPopupVO);
|
||||
System.out.println("mainPopupVO :: "+ mainPopupVO.toString());
|
||||
|
||||
/* 타겟 코드 */
|
||||
ComDefaultCodeVO vo = new ComDefaultCodeVO();
|
||||
vo.setCodeId("COM037");
|
||||
//List<?> targetList = cmmUseService.selectCmmCodeDetail(vo);
|
||||
//model.addAttribute("targetList", targetList);
|
||||
|
||||
|
||||
return "uss/ion/bnr/pop/mainPopupModify";
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*메인 이미지삭제 */
|
||||
@RequestMapping("/uss/ion/bnr/pop/mainPopupListDelete.do")
|
||||
public String deleteMainzoneDelete(@RequestParam("del") String[] del, RedirectAttributes redirectAttributes , Model model) throws Exception {
|
||||
LoginVO loginVO = (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser();
|
||||
MainPopupVO mainPopupVO = new MainPopupVO();
|
||||
for(String id:del) {
|
||||
try{
|
||||
mainPopupVO = mainPopupManageService.selectMainPopupVO(id);
|
||||
}catch(Exception e){
|
||||
redirectAttributes.addFlashAttribute("message", egovMessageSource.getMessage("info.nodata.msg"));
|
||||
RedirectUrlMaker redirectUrlMaker = new RedirectUrlMaker("/uss/ion/bnr/pop/mainPopupList.do");
|
||||
return redirectUrlMaker.getRedirectUrl();
|
||||
}
|
||||
mainPopupManageService.deleteMainPopup(id);
|
||||
if(null != loginVO && !"super".equals(loginVO.getSiteId())){
|
||||
mainPopupVO.setSiteId(loginVO.getSiteId());
|
||||
}
|
||||
mainPopupManageService.resetMainPopupSort(mainPopupVO);
|
||||
}
|
||||
|
||||
redirectAttributes.addFlashAttribute("message", egovMessageSource.getMessage("success.common.delete"));
|
||||
RedirectUrlMaker redirectUrlMaker = new RedirectUrlMaker("/uss/ion/bnr/pop/mainPopupList.do");
|
||||
return redirectUrlMaker.getRedirectUrl();
|
||||
}
|
||||
|
||||
/**
|
||||
* @methodName : mainPopupLinkDeleteAjax
|
||||
* @author : 이호영
|
||||
* @date : 2025.03.04
|
||||
* @description : 메인팝업링크 데이터 삭제
|
||||
* @param request
|
||||
* @param mainPopupLinkVO
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(value="/uss/ion/bnr/pop/mainPopupLinkDeleteAjax.do")
|
||||
public ResponseEntity<?> mainPopupLinkDeleteAjax(
|
||||
HttpServletRequest request
|
||||
,@RequestBody MainPopupLinkVO mainPopupLinkVO) throws Exception {
|
||||
|
||||
Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated();
|
||||
|
||||
if(!isAuthenticated) {
|
||||
return ResponseEntity.ok(
|
||||
RestResponse.builder()
|
||||
.status(HttpStatus.UNAUTHORIZED) // 401 권한 인증 에러
|
||||
.msg("로그인을 하셔야 이용 가능합니다.")
|
||||
.build()
|
||||
);
|
||||
}
|
||||
return ResponseEntity.ok(mainPopupManageService.deleteMainPopupLink(mainPopupLinkVO));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 시간을 LIST를 반환한다.
|
||||
* @return List
|
||||
* @throws
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
private List<ComDefaultCodeVO> getTimeHH() {
|
||||
ArrayList<ComDefaultCodeVO> listHH = new ArrayList<ComDefaultCodeVO>();
|
||||
HashMap<?, ?> hmHHMM;
|
||||
for (int i = 0; i <= 24; i++) {
|
||||
String sHH = "";
|
||||
String strI = String.valueOf(i);
|
||||
if (i < 10) {
|
||||
sHH = "0" + strI;
|
||||
} else {
|
||||
sHH = strI;
|
||||
}
|
||||
|
||||
ComDefaultCodeVO codeVO = new ComDefaultCodeVO();
|
||||
codeVO.setCode(sHH);
|
||||
codeVO.setCodeNm(sHH);
|
||||
|
||||
listHH.add(codeVO);
|
||||
}
|
||||
|
||||
return listHH;
|
||||
}
|
||||
|
||||
/**
|
||||
* 분을 LIST를 반환한다.
|
||||
* @return List
|
||||
* @throws
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
private List<ComDefaultCodeVO> getTimeMM() {
|
||||
ArrayList<ComDefaultCodeVO> listMM = new ArrayList<ComDefaultCodeVO>();
|
||||
HashMap<?, ?> hmHHMM;
|
||||
for (int i = 0; i <= 60; i++) {
|
||||
|
||||
String sMM = "";
|
||||
String strI = String.valueOf(i);
|
||||
if (i < 10) {
|
||||
sMM = "0" + strI;
|
||||
} else {
|
||||
sMM = strI;
|
||||
}
|
||||
|
||||
ComDefaultCodeVO codeVO = new ComDefaultCodeVO();
|
||||
codeVO.setCode(sMM);
|
||||
codeVO.setCodeNm(sMM);
|
||||
|
||||
listMM.add(codeVO);
|
||||
}
|
||||
return listMM;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -1,37 +0,0 @@
|
||||
package itn.com.uss.ion.bnr.sub.service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import itn.com.uss.ion.pwm.service.MainzoneVO;
|
||||
import itn.com.uss.ion.pwm.service.PopupManageVO;
|
||||
import itn.com.uss.ion.pwm.service.PopupzoneVO;
|
||||
import itn.com.uss.ion.pwm.service.SocialVO;
|
||||
import itn.com.uss.ion.pwm.service.SortVO;
|
||||
|
||||
/**
|
||||
* 개요
|
||||
* - 팝업창에 대한 Service Interface를 정의한다.
|
||||
*
|
||||
* 상세내용
|
||||
* - 팝업창에 대한 등록, 수정, 삭제, 조회, 반영확인 기능을 제공한다.
|
||||
* - 팝업창의 조회기능은 목록조회, 상세조회, 팝업사용자 보기로 구분된다.
|
||||
* @author 이창원
|
||||
* @version 1.0
|
||||
* @created 05-8-2009 오후 2:19:58
|
||||
*/
|
||||
public interface SubMainZoneManageService {
|
||||
|
||||
public List<?> selectSubMainzoneList(MainzoneVO mainzoneVO) throws Exception;
|
||||
|
||||
public int selectSubMainzoneCount(MainzoneVO mainzoneVO) throws Exception;
|
||||
|
||||
public MainzoneVO selectSubMainzoneVO(String mazId) throws Exception;
|
||||
|
||||
public List<MainzoneVO> selectSubMainzoneListRolling();
|
||||
|
||||
public void deleteSubMainzone(String id);
|
||||
|
||||
public void resetSubMainVOSort(MainzoneVO mainzoneVO);
|
||||
|
||||
}
|
||||
@ -1,309 +0,0 @@
|
||||
package itn.com.uss.ion.bnr.sub.service.impl;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import egovframework.rte.psl.dataaccess.util.EgovMap;
|
||||
import itn.com.cmm.service.impl.EgovComAbstractDAO;
|
||||
import itn.com.uss.ion.pwm.service.MainzoneVO;
|
||||
import itn.com.uss.ion.pwm.service.PopupManageVO;
|
||||
import itn.com.uss.ion.pwm.service.PopupzoneVO;
|
||||
import itn.com.uss.ion.pwm.service.SocialVO;
|
||||
import itn.com.uss.ion.pwm.service.SortVO;
|
||||
|
||||
/**
|
||||
* 개요
|
||||
* - 팝업창에 대한 DAO를 정의한다.
|
||||
*
|
||||
* 상세내용
|
||||
* - 팝업창에 대한 등록, 수정, 삭제, 조회, 반영확인 기능을 제공한다.
|
||||
* - 팝업창의 조회기능은 목록조회, 상세조회로, 사용자화면 보기로 구분된다.
|
||||
* @author 이창원
|
||||
* @version 1.0
|
||||
* @created 05-8-2009 오후 2:21:04
|
||||
*/
|
||||
@Repository("subMainZoneManageDAO")
|
||||
public class SubMainZoneManageDAO extends EgovComAbstractDAO {
|
||||
|
||||
|
||||
/**
|
||||
* 메인이미지 목록을 조회한다.
|
||||
* @return 글 목록
|
||||
* @exception Exception
|
||||
*/
|
||||
public List<?> selectSubMainzoneList(MainzoneVO mainzoneVO ) throws Exception{
|
||||
return list("subMainzoneManage.selectSubMainzoneList", mainzoneVO);
|
||||
}
|
||||
|
||||
|
||||
public int selectSubMainzoneCount(MainzoneVO mainzoneVO) throws Exception{
|
||||
return (int)select("subMainzoneManage.selectSubMainzoneCount", mainzoneVO);
|
||||
}
|
||||
|
||||
|
||||
public MainzoneVO selectSubMainzoneVO(String mazId) throws Exception{
|
||||
return (MainzoneVO)select("subMainzoneManage.selectSubMainzoneVO", mazId);
|
||||
}
|
||||
|
||||
|
||||
public List<MainzoneVO> selectSubMainzoneListRolling() {
|
||||
return (List<MainzoneVO>) list("subMainzoneManage.selectSubMainzoneListRolling");
|
||||
}
|
||||
|
||||
|
||||
public void deleteSubMainzone(String mazId) {
|
||||
delete("subMainzoneManage.deleteSubMainzone", mazId);
|
||||
}
|
||||
|
||||
|
||||
public void resetSubMainVOSort(MainzoneVO mainzoneVO) {
|
||||
update("subMainzoneManage.resetSubMainVOSort", mainzoneVO);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//
|
||||
// public SubMainZoneManageDAO(){}
|
||||
//
|
||||
// /**
|
||||
// * 기 등록된 팝업창정보를 삭제한다.
|
||||
// * @param popupManage - 팝업창 model
|
||||
// * @return boolean - 반영성공 여부
|
||||
// *
|
||||
// * @param popupManage
|
||||
// */
|
||||
// public void deletePopup(PopupManageVO popupManageVO) throws Exception {
|
||||
// delete("PopupManage.deletePopupManage", popupManageVO);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 팝업창정보를 신규로 등록한다.
|
||||
// * @param popupManage - 팝업창 model
|
||||
// * @return boolean - 반영성공 여부
|
||||
// *
|
||||
// * @param popupManage
|
||||
// */
|
||||
// public void insertPopup(PopupManageVO popupManageVO) throws Exception {
|
||||
// insert("PopupManage.insertPopupManage", popupManageVO);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 기 등록된 팝업창정보를 수정한다.
|
||||
// * @param popupManage - 팝업창 model
|
||||
// * @return boolean - 반영성공 여부
|
||||
// *
|
||||
// * @param popupManage
|
||||
// */
|
||||
// public void updatePopup(PopupManageVO popupManageVO) throws Exception {
|
||||
// update("PopupManage.updatePopupManage", popupManageVO);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 팝업창을 사용자 화면에서 볼수 있는 정보들을 조회한다.
|
||||
// * @param popupManageVO - 팝업창 Vo
|
||||
// * @return popupManageVO - 팝업창 Vo
|
||||
// *
|
||||
// * @param popupManageVO
|
||||
// */
|
||||
// public PopupManageVO selectPopup(PopupManageVO popupManageVO) throws Exception {
|
||||
// return (PopupManageVO)select("PopupManage.selectPopupManageDetail", popupManageVO);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 팝업창를 관리하기 위해 등록된 팝업창목록을 조회한다.
|
||||
// * @param popupManageVO - 팝업창 Vo
|
||||
// * @return List - 팝업창 목록
|
||||
// *
|
||||
// * @param popupManageVO
|
||||
// */
|
||||
// public List<?> selectPopupList(PopupManageVO popupManageVO) throws Exception {
|
||||
// return list("PopupManage.selectPopupManage", popupManageVO);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 팝업창를 관리하기 위해 등록된 팝업창목록 총갯수를 조회한다.
|
||||
// * @param popupManageVO - 팝업창 Vo
|
||||
// * @return List - 팝업창 목록
|
||||
// *
|
||||
// * @param popupManageVO
|
||||
// */
|
||||
// public int selectPopupListCount(PopupManageVO popupManageVO) throws Exception {
|
||||
// return (Integer)select("PopupManage.selectPopupManageCnt", popupManageVO);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 팝업창를 사용하기 위해 등록된 팝업창목록을 조회한다.
|
||||
// * @param popupManageVO - 팝업창 Vo
|
||||
// * @return List - 팝업창 목록
|
||||
// *
|
||||
// * @param popupManageVO
|
||||
// */
|
||||
// public List<?> selectPopupMainList(PopupManageVO popupManageVO) throws Exception {
|
||||
// return list("PopupManage.selectPopupManageMain", popupManageVO);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 메인알림창 목록을 조회한다.
|
||||
// * @return 글 목록
|
||||
// * @exception Exception
|
||||
// */
|
||||
// public List<?> selectPopupzoneList(PopupzoneVO popupzoneVo) throws Exception{
|
||||
// return list("PopupzoneManage.selectPopupzoneList", popupzoneVo);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 메인배너 순번정보를 가져온다.
|
||||
// * @param mode - 0:등록 1:수정
|
||||
// * @return 순번정보
|
||||
// * @exception Exception
|
||||
// */
|
||||
// @SuppressWarnings("unchecked")
|
||||
// public List<EgovMap> getSortList() throws Exception{
|
||||
// return (List<EgovMap>) list("PopupzoneManage.getSortList",null);
|
||||
// }
|
||||
//
|
||||
// public PopupzoneVO selectPopupzoneVO(String pozId) throws Exception {
|
||||
// return (PopupzoneVO)select("PopupzoneManage.selectPopupzoneVO", pozId);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 메인배너 변경할때 나머지 배너들 순서 변경
|
||||
// * @param 입력된 sort번호
|
||||
// * @return 등록 결과
|
||||
// * @exception Exception
|
||||
// */
|
||||
// public void updateSortUp(SortVO sortVO) throws Exception{
|
||||
// update("PopupzoneManage.updateSortUp", sortVO);
|
||||
// }
|
||||
//
|
||||
// public void updateSortDown(SortVO sortVO) throws Exception {
|
||||
// update("PopupzoneManage.updateSortDown", sortVO);
|
||||
// }
|
||||
//
|
||||
// public void updatePopupzone(PopupzoneVO popupzoneVO) throws Exception {
|
||||
// update("PopupzoneManage.updatePopupzone", popupzoneVO);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 메인알림창을 삭제한다.
|
||||
// * @param pozId - 삭제할 메인알림창 번호
|
||||
// * @return void형
|
||||
// * @exception Exception
|
||||
// */
|
||||
// public void deletePopupzone(String pozId) throws Exception {
|
||||
// delete("PopupzoneManage.deletePopupzone", pozId);
|
||||
// }
|
||||
//
|
||||
// public int getMaxSort() throws Exception{
|
||||
// return (Integer)select("PopupzoneManage.getMaxSort") ;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 메인배너의 새로운seq를 가지고온다.
|
||||
// * @return seq
|
||||
// * @exception Exception
|
||||
// */
|
||||
// public int selectNextSeq() throws Exception{
|
||||
// return (Integer)select("PopupzoneManage.selectNextSeq");
|
||||
// }
|
||||
//
|
||||
// public void insertPopupzone(PopupzoneVO popupzoneVO) throws Exception{
|
||||
// insert("PopupzoneManage.insertPopupzone", popupzoneVO);
|
||||
// }
|
||||
//
|
||||
// public void resetSort(PopupzoneVO popupzoneVO) throws Exception{
|
||||
// update("PopupzoneManage.resetSort", popupzoneVO);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 메인이미지 목록을 조회한다.
|
||||
// * @return 글 목록
|
||||
// * @exception Exception
|
||||
// */
|
||||
// public List<?> selectMainzoneList(MainzoneVO mainzoneVO ) throws Exception{
|
||||
// return list("MainzoneManage.selectMainzoneList", mainzoneVO);
|
||||
// }
|
||||
//
|
||||
// public int getMainMaxSort() throws Exception{
|
||||
// return (Integer)select("MainzoneManage.getMainMaxSort");
|
||||
// }
|
||||
//
|
||||
// public void insertMainzone(MainzoneVO mainzoneVO) throws Exception{
|
||||
// insert("MainzoneManage.insertMainzone", mainzoneVO);
|
||||
// }
|
||||
//
|
||||
// public void resetMainSort(MainzoneVO mainzoneVO) throws Exception{
|
||||
// insert("MainzoneManage.resetMainSort", mainzoneVO);
|
||||
// }
|
||||
//
|
||||
// public void updateMainSortUp(SortVO sortVO) throws Exception{
|
||||
// update("MainzoneManage.updateMainSortUp", sortVO);
|
||||
// }
|
||||
//
|
||||
// public MainzoneVO selectMainzoneVO(String mazId) throws Exception{
|
||||
// return (MainzoneVO)select("MainzoneManage.selectMainzoneVO", mazId);
|
||||
// }
|
||||
//
|
||||
// @SuppressWarnings("unchecked")
|
||||
// public List<EgovMap> getMainSortList() throws Exception{
|
||||
// return (List<EgovMap>) list("MainzoneManage.getMainSortList",null);
|
||||
// }
|
||||
//
|
||||
// public void deleteMainzone(String mazId) throws Exception{
|
||||
// delete("MainzoneManage.deleteMainzone", mazId);
|
||||
// }
|
||||
//
|
||||
// public void updateMainSortDown(SortVO sortVO) throws Exception{
|
||||
// update("MainzoneManage.updateMainSortDown", sortVO);
|
||||
// }
|
||||
//
|
||||
// public void updateMainzone(MainzoneVO mainzoneVO) throws Exception{
|
||||
// update("MainzoneManage.updateMainzone", mainzoneVO);
|
||||
// }
|
||||
//
|
||||
// @SuppressWarnings("unchecked")
|
||||
// public List<MainzoneVO> selectMainzoneListRolling() throws Exception{
|
||||
// return (List<MainzoneVO>) list("MainzoneManage.selectMainzoneListRolling");
|
||||
// }
|
||||
//
|
||||
// public int selectPopupzoneListTotCnt(PopupzoneVO popupzoneVo) throws Exception {
|
||||
// return (int)select("PopupzoneManage.selectPopupzoneListTotCnt", popupzoneVo);
|
||||
// }
|
||||
//
|
||||
// public int selectMainzoneCount(MainzoneVO mainzoneVO) throws Exception{
|
||||
// return (int)select("MainzoneManage.selectMainzoneCount", mainzoneVO);
|
||||
// }
|
||||
//
|
||||
// public void resetVOSort(PopupzoneVO popupzoneVO) throws Exception{
|
||||
// update("PopupzoneManage.resetVOSort", popupzoneVO);
|
||||
// }
|
||||
//
|
||||
// public void resetMainVOSort(MainzoneVO mainzoneVO) throws Exception{
|
||||
// update("MainzoneManage.resetMainVOSort", mainzoneVO);
|
||||
// }
|
||||
//
|
||||
// @SuppressWarnings("unchecked")
|
||||
// public List<SocialVO> selectSocialList(SocialVO socialVO) throws Exception{
|
||||
// return (List<SocialVO>) list("SocialManage.selectSocialList",socialVO);
|
||||
// }
|
||||
//
|
||||
// public SocialVO selectSocialVO(String socialId) throws Exception{
|
||||
// return (SocialVO)select("SocialManage.selectSocialVO", socialId);
|
||||
// }
|
||||
//
|
||||
// public void updateSocial(SocialVO socialVO) throws Exception{
|
||||
// update("SocialManage.updateSocial", socialVO);
|
||||
// }
|
||||
//
|
||||
// public void resetSocialSort(SocialVO socialVO) throws Exception{
|
||||
// update("SocialManage.resetSocialSort", socialVO);
|
||||
// }
|
||||
//
|
||||
// public void insertSocial(SocialVO socialVO) throws Exception{
|
||||
// insert("SocialManage.insertSocial", socialVO);
|
||||
// }
|
||||
//
|
||||
// public void deleteSocial(String id) throws Exception{
|
||||
// delete("SocialManage.deleteSocial", id);
|
||||
// }
|
||||
}
|
||||
@ -1,85 +0,0 @@
|
||||
package itn.com.uss.ion.bnr.sub.service.impl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl;
|
||||
import egovframework.rte.fdl.idgnr.EgovIdGnrService;
|
||||
import egovframework.rte.psl.dataaccess.util.EgovMap;
|
||||
import itn.com.uss.ion.bnr.sub.service.SubMainZoneManageService;
|
||||
import itn.com.uss.ion.pwm.service.MainzoneVO;
|
||||
import itn.com.uss.ion.pwm.service.PopupManageVO;
|
||||
import itn.com.uss.ion.pwm.service.PopupzoneVO;
|
||||
import itn.com.uss.ion.pwm.service.SocialVO;
|
||||
import itn.com.uss.ion.pwm.service.SortVO;
|
||||
import itn.com.uss.ion.pwm.service.impl.PopupManageDAO;
|
||||
import itn.com.uss.ion.pwm.service.impl.PopupzoneManageDAO;
|
||||
|
||||
/**
|
||||
* 개요
|
||||
* - 팝업창에 대한 ServiceImpl을 정의한다.
|
||||
*
|
||||
* 상세내용
|
||||
* - 팝업창에 대한 등록, 수정, 삭제, 조회, 반영확인 기능을 제공한다.
|
||||
* - 팝업창의 조회기능은 목록조회, 상세조회로, 사용자화면 보기로 구분된다.
|
||||
* @author 이창원
|
||||
* @version 1.0
|
||||
* @created 05-8-2009 오후 2:19:58
|
||||
*/
|
||||
|
||||
@Service("subMainZoneManageService")
|
||||
public class SubMainZoneManageServiceImpl extends EgovAbstractServiceImpl implements SubMainZoneManageService {
|
||||
|
||||
@Resource(name = "subMainZoneManageDAO")
|
||||
public SubMainZoneManageDAO dao;
|
||||
|
||||
/** PopupzoneManageDAO */
|
||||
@Resource(name="popupzoneManageDAO")
|
||||
private PopupzoneManageDAO popupzoneManageDAO;
|
||||
|
||||
@Resource(name = "egovPopupManageIdGnrService")
|
||||
private EgovIdGnrService idgenService;
|
||||
|
||||
@Override
|
||||
public List<?> selectSubMainzoneList(MainzoneVO mainzoneVO) throws Exception {
|
||||
return dao.selectSubMainzoneList(mainzoneVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int selectSubMainzoneCount(MainzoneVO mainzoneVO) throws Exception {
|
||||
return dao.selectSubMainzoneCount(mainzoneVO);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public MainzoneVO selectSubMainzoneVO(String mazId) throws Exception {
|
||||
MainzoneVO resultVO = dao.selectSubMainzoneVO(mazId);
|
||||
if (resultVO == null)
|
||||
throw processException("info.nodata.msg");
|
||||
return resultVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MainzoneVO> selectSubMainzoneListRolling() {
|
||||
return dao.selectSubMainzoneListRolling();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteSubMainzone(String id) {
|
||||
dao.deleteSubMainzone(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resetSubMainVOSort(MainzoneVO mainzoneVO) {
|
||||
dao.resetSubMainVOSort(mainzoneVO);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -1,308 +0,0 @@
|
||||
package itn.com.uss.ion.bnr.sub.web;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
import org.springmodules.validation.commons.DefaultBeanValidator;
|
||||
|
||||
import egovframework.rte.fdl.idgnr.EgovIdGnrService;
|
||||
import egovframework.rte.fdl.property.EgovPropertyService;
|
||||
import egovframework.rte.fdl.security.userdetails.util.EgovUserDetailsHelper;
|
||||
import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo;
|
||||
import itn.com.cmm.ComDefaultCodeVO;
|
||||
import itn.com.cmm.EgovMessageSource;
|
||||
import itn.com.cmm.LoginVO;
|
||||
import itn.com.cmm.service.EgovCmmUseService;
|
||||
import itn.com.cmm.service.EgovFileMngService;
|
||||
import itn.com.cmm.service.EgovFileMngUtil;
|
||||
import itn.com.cmm.service.FileVO;
|
||||
import itn.com.cmm.util.RedirectUrlMaker;
|
||||
import itn.com.uss.ion.bnr.sub.service.SubMainZoneManageService;
|
||||
import itn.com.uss.ion.pwm.service.MainzoneVO;
|
||||
import itn.let.sym.site.service.EgovSiteManagerService;
|
||||
|
||||
/**
|
||||
* 개요
|
||||
* - 팝업창에 대한 Controller를 정의한다.
|
||||
*
|
||||
* 상세내용
|
||||
* - 팝업창에 대한 등록, 수정, 삭제, 조회, 반영확인 기능을 제공한다.
|
||||
* - 팝업창의 조회기능은 목록조회, 상세조회로, 사용자 화면 보기로 구분된다.
|
||||
* @author 이창원
|
||||
* @version 1.0
|
||||
* @created 05-8-2009 오후 2:19:57
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2025.02.24 이호영 최초 생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
|
||||
@Controller
|
||||
public class SubMainZoneManageController {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(SubMainZoneManageController.class);
|
||||
|
||||
@Autowired
|
||||
private DefaultBeanValidator beanValidator;
|
||||
|
||||
/** EgovMessageSource */
|
||||
@Resource(name = "egovMessageSource")
|
||||
EgovMessageSource egovMessageSource;
|
||||
|
||||
/** EgovPropertyService */
|
||||
@Resource(name = "propertiesService")
|
||||
protected EgovPropertyService propertiesService;
|
||||
|
||||
/** EgovPopupManageService */
|
||||
@Resource(name = "subMainZoneManageService")
|
||||
private SubMainZoneManageService subMainZoneManageService;
|
||||
|
||||
/** cmmUseService */
|
||||
@Resource(name = "EgovCmmUseService")
|
||||
private EgovCmmUseService cmmUseService;
|
||||
|
||||
@Resource(name="EgovFileMngUtil")
|
||||
private EgovFileMngUtil fileUtil;
|
||||
|
||||
@Resource(name="EgovFileMngService")
|
||||
private EgovFileMngService fileMngService;
|
||||
|
||||
@Resource(name = "egovPopupZoneIdGnrService")
|
||||
private EgovIdGnrService idgenService;
|
||||
|
||||
// @Resource(name = "egovMainZoneIdGnrService")
|
||||
// private EgovIdGnrService idgenServiceMain;
|
||||
|
||||
@Resource(name = "egovSubMainZoneIdGnrService")
|
||||
private EgovIdGnrService idgenServiceSubMain;
|
||||
|
||||
@Resource(name = "egovSiteManagerService")
|
||||
EgovSiteManagerService egovSiteManagerService;
|
||||
|
||||
@Resource(name = "EgovFileMngService")
|
||||
private EgovFileMngService fileService;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*메인이미지 관리*/
|
||||
@RequestMapping(value="/uss/ion/bnr/sub/subMainZoneList.do")
|
||||
// @RequestMapping(value="/uss/ion/pwm/mainzoneList.do")
|
||||
public String selectMainzoneList(ModelMap model , MainzoneVO mainzoneVO , HttpSession session ) throws Exception {
|
||||
LoginVO loginVO = (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser();
|
||||
|
||||
|
||||
if(mainzoneVO.getPageUnit()% 8 != 0) {//9 배수로 넘어오지 않으면 초기세팅
|
||||
mainzoneVO.setPageUnit(8);
|
||||
}else {
|
||||
mainzoneVO.setPageUnit(mainzoneVO.getPageUnit());
|
||||
}
|
||||
|
||||
/** pageing */
|
||||
PaginationInfo paginationInfo = new PaginationInfo();
|
||||
paginationInfo.setCurrentPageNo(mainzoneVO.getPageIndex());
|
||||
paginationInfo.setRecordCountPerPage(mainzoneVO.getPageUnit());
|
||||
paginationInfo.setPageSize(mainzoneVO.getPageSize());
|
||||
|
||||
mainzoneVO.setFirstIndex(paginationInfo.getFirstRecordIndex());
|
||||
mainzoneVO.setLastIndex(paginationInfo.getLastRecordIndex());
|
||||
mainzoneVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());
|
||||
|
||||
if(null != loginVO && !"super".equals(loginVO.getSiteId())){ //각각의 사이트
|
||||
mainzoneVO.setSiteId(loginVO.getSiteId());
|
||||
}
|
||||
List<?> mainzoneList = subMainZoneManageService.selectSubMainzoneList(mainzoneVO);
|
||||
model.addAttribute("mainzoneList", mainzoneList);
|
||||
|
||||
int totCnt = subMainZoneManageService.selectSubMainzoneCount(mainzoneVO);
|
||||
|
||||
paginationInfo.setTotalRecordCount(totCnt);
|
||||
model.addAttribute("paginationInfo", paginationInfo);
|
||||
|
||||
return "uss/ion/bnr/sub/subMainZoneList";
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*알림창등록/수정 view*/
|
||||
@RequestMapping(value="/uss/ion/bnr/sub/subMainzoneModify.do")
|
||||
public String updateMainZoneView(@RequestParam Map<?, ?> commandMap,
|
||||
HttpServletRequest request, Model model, HttpSession session)
|
||||
throws Exception {
|
||||
|
||||
MainzoneVO mainzoneVO = new MainzoneVO();
|
||||
if("Modify".equals((String)commandMap.get("pageType"))){ //수정
|
||||
String mazId = (String)commandMap.get("selectedId");
|
||||
mainzoneVO = subMainZoneManageService.selectSubMainzoneVO(mazId);
|
||||
String sNtceBgnde = mainzoneVO.getNtceBgnde();
|
||||
String sNtceEndde = mainzoneVO.getNtceEndde();
|
||||
|
||||
if(sNtceBgnde != null && sNtceEndde != null ) {
|
||||
|
||||
mainzoneVO.setNtceBgndeHH(sNtceBgnde.substring(8, 10));
|
||||
mainzoneVO.setNtceBgndeMM(sNtceBgnde.substring(10, 12));
|
||||
|
||||
mainzoneVO.setNtceEnddeHH(sNtceEndde.substring(8, 10));
|
||||
mainzoneVO.setNtceEnddeMM(sNtceEndde.substring(10, 12));
|
||||
|
||||
//게시기간 시작일자(시)
|
||||
model.addAttribute("ntceBgndeHH", getTimeHH());
|
||||
//게시기간 시작일자(분)
|
||||
model.addAttribute("ntceBgndeMM", getTimeMM());
|
||||
//게시기간 종료일자(시)
|
||||
model.addAttribute("ntceEnddeHH", getTimeHH());
|
||||
//게시기간 종료일자(분)
|
||||
model.addAttribute("ntceEnddeMM", getTimeMM());
|
||||
|
||||
|
||||
}
|
||||
|
||||
if(mainzoneVO != null){
|
||||
mainzoneVO.setBeSort(mainzoneVO.getSort());
|
||||
|
||||
FileVO fileVO = new FileVO();
|
||||
String atchFileId = mainzoneVO.getMainzoneImageFile();
|
||||
fileVO.setAtchFileId(atchFileId);
|
||||
List<FileVO> fileList = fileService.selectFileInfs(fileVO);
|
||||
model.addAttribute("fileList", fileList);
|
||||
}
|
||||
}else{ //등록
|
||||
|
||||
//게시기간 시작일자(시)
|
||||
model.addAttribute("ntceBgndeHH", getTimeHH());
|
||||
//게시기간 시작일자(분)
|
||||
model.addAttribute("ntceBgndeMM", getTimeMM());
|
||||
//게시기간 종료일자(시)
|
||||
model.addAttribute("ntceEnddeHH", getTimeHH());
|
||||
//게시기간 종료일자(분)
|
||||
model.addAttribute("ntceEnddeMM", getTimeMM());
|
||||
|
||||
}
|
||||
|
||||
//model.addAttribute("sortList", sortList);
|
||||
model.addAttribute("mainzoneVO", mainzoneVO);
|
||||
System.out.println("mainzoneVO :: "+ mainzoneVO.toString());
|
||||
|
||||
/* 타겟 코드 */
|
||||
ComDefaultCodeVO vo = new ComDefaultCodeVO();
|
||||
vo.setCodeId("COM037");
|
||||
//List<?> targetList = cmmUseService.selectCmmCodeDetail(vo);
|
||||
//model.addAttribute("targetList", targetList);
|
||||
|
||||
|
||||
return "uss/ion/bnr/sub/subMainZoneModify";
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*메인 이미지삭제 */
|
||||
@RequestMapping("/uss/ion/bnr/sub/subMainzoneListDelete.do")
|
||||
public String deleteMainzoneDelete(@RequestParam("del") String[] del, RedirectAttributes redirectAttributes , Model model) throws Exception {
|
||||
LoginVO loginVO = (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser();
|
||||
MainzoneVO mainzoneVO = new MainzoneVO();
|
||||
for(String id:del) {
|
||||
try{
|
||||
mainzoneVO = subMainZoneManageService.selectSubMainzoneVO(id);
|
||||
}catch(Exception e){
|
||||
redirectAttributes.addFlashAttribute("message", egovMessageSource.getMessage("info.nodata.msg"));
|
||||
RedirectUrlMaker redirectUrlMaker = new RedirectUrlMaker("/uss/ion/bnr/subMainZoneList.do");
|
||||
return redirectUrlMaker.getRedirectUrl();
|
||||
}
|
||||
subMainZoneManageService.deleteSubMainzone(id);
|
||||
if(null != loginVO && !"super".equals(loginVO.getSiteId())){
|
||||
mainzoneVO.setSiteId(loginVO.getSiteId());
|
||||
}
|
||||
subMainZoneManageService.resetSubMainVOSort(mainzoneVO);
|
||||
}
|
||||
|
||||
redirectAttributes.addFlashAttribute("message", egovMessageSource.getMessage("success.common.delete"));
|
||||
RedirectUrlMaker redirectUrlMaker = new RedirectUrlMaker("/uss/ion/bnr/subMainZoneList.do");
|
||||
return redirectUrlMaker.getRedirectUrl();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 시간을 LIST를 반환한다.
|
||||
* @return List
|
||||
* @throws
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
private List<ComDefaultCodeVO> getTimeHH() {
|
||||
ArrayList<ComDefaultCodeVO> listHH = new ArrayList<ComDefaultCodeVO>();
|
||||
HashMap<?, ?> hmHHMM;
|
||||
for (int i = 0; i <= 24; i++) {
|
||||
String sHH = "";
|
||||
String strI = String.valueOf(i);
|
||||
if (i < 10) {
|
||||
sHH = "0" + strI;
|
||||
} else {
|
||||
sHH = strI;
|
||||
}
|
||||
|
||||
ComDefaultCodeVO codeVO = new ComDefaultCodeVO();
|
||||
codeVO.setCode(sHH);
|
||||
codeVO.setCodeNm(sHH);
|
||||
|
||||
listHH.add(codeVO);
|
||||
}
|
||||
|
||||
return listHH;
|
||||
}
|
||||
|
||||
/**
|
||||
* 분을 LIST를 반환한다.
|
||||
* @return List
|
||||
* @throws
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
private List<ComDefaultCodeVO> getTimeMM() {
|
||||
ArrayList<ComDefaultCodeVO> listMM = new ArrayList<ComDefaultCodeVO>();
|
||||
HashMap<?, ?> hmHHMM;
|
||||
for (int i = 0; i <= 60; i++) {
|
||||
|
||||
String sMM = "";
|
||||
String strI = String.valueOf(i);
|
||||
if (i < 10) {
|
||||
sMM = "0" + strI;
|
||||
} else {
|
||||
sMM = strI;
|
||||
}
|
||||
|
||||
ComDefaultCodeVO codeVO = new ComDefaultCodeVO();
|
||||
codeVO.setCode(sMM);
|
||||
codeVO.setCodeNm(sMM);
|
||||
|
||||
listMM.add(codeVO);
|
||||
}
|
||||
return listMM;
|
||||
}
|
||||
|
||||
}
|
||||
@ -38,7 +38,6 @@ import itn.com.cmm.service.EgovFileMngService;
|
||||
import itn.com.cmm.service.EgovFileMngUtil;
|
||||
import itn.com.cmm.service.FileVO;
|
||||
import itn.com.cmm.util.RedirectUrlMaker;
|
||||
import itn.com.uss.ion.bnr.pop.service.MainPopupVO;
|
||||
import itn.com.uss.ion.bnr.service.Banner;
|
||||
import itn.com.uss.ion.bnr.service.BannerVO;
|
||||
import itn.com.uss.ion.bnr.service.EgovBannerService;
|
||||
@ -113,12 +112,6 @@ public class FmsFileController {
|
||||
@Resource(name = "egovMainZoneIdGnrService")
|
||||
private EgovIdGnrService idgenServiceMain;
|
||||
|
||||
@Resource(name = "egovSubMainZoneIdGnrService")
|
||||
private EgovIdGnrService idgenServiceSubMain;
|
||||
|
||||
@Resource(name = "egovMainPopupIdGnrService")
|
||||
private EgovIdGnrService idgenServiceMainPopup;
|
||||
|
||||
@Resource(name = "egovBannerService")
|
||||
private EgovBannerService egovBannerService;
|
||||
|
||||
@ -394,7 +387,6 @@ public class FmsFileController {
|
||||
public ModelAndView insertFmsFileInsertAjax(@RequestParam Map<?, ?> commandMap,
|
||||
@ModelAttribute("fmsFileVO") FmsFileVO fmsFileVO,
|
||||
MainzoneVO mainzoneVO,
|
||||
MainPopupVO mainPopupVO,
|
||||
PopupzoneVO popupzoneVO,
|
||||
Banner banner,
|
||||
BannerVO bannerVO,
|
||||
@ -422,10 +414,6 @@ public class FmsFileController {
|
||||
String KeyStr = "FMS_";
|
||||
if("mainzone".equals(fileVO.getMenuName())) { //메인비주얼
|
||||
KeyStr = "MAZ_";
|
||||
}else if("subMainzone".equals(fileVO.getMenuName())) { //메인비주얼
|
||||
KeyStr = "SMAZ_";
|
||||
}else if("mainPopup".equals(fileVO.getMenuName())) { //메인비주얼
|
||||
KeyStr = "MPP_";
|
||||
}else if("popupzone".equals(fileVO.getMenuName())) { //매뉴별 비주얼
|
||||
KeyStr = "POZ_";
|
||||
}else if("banner".equals(fileVO.getMenuName())) { //매뉴별 비주얼
|
||||
@ -454,9 +442,6 @@ public class FmsFileController {
|
||||
mainzoneVO.setMainzoneImage(orignlFileNm);
|
||||
mainzoneVO.setMainzoneImageFile(atchFileId);
|
||||
|
||||
mainPopupVO.setMainzoneImage(orignlFileNm);
|
||||
mainPopupVO.setMainzoneImageFile(atchFileId);
|
||||
|
||||
fmsFileVO.setFmsImage(orignlFileNm);
|
||||
fmsFileVO.setFmsImageFile(atchFileId);
|
||||
|
||||
@ -492,24 +477,7 @@ public class FmsFileController {
|
||||
egovPopupManageService.insertMainzone(mainzoneVO);
|
||||
mainzoneVO.setSortOver("D"); //앞쪽에 넣음
|
||||
egovPopupManageService.resetMainVOSort(mainzoneVO);
|
||||
}
|
||||
else if("subMainzone".equals(fileVO.getMenuName())) { // 서브 메인비주얼 새글
|
||||
String mainId = idgenServiceSubMain.getNextStringId();
|
||||
mainzoneVO.setMazId(mainId);
|
||||
mainzoneVO.setRegisterId(loginVO.getUniqId());
|
||||
egovPopupManageService.insertSubMainzone(mainzoneVO);
|
||||
mainzoneVO.setSortOver("D"); //앞쪽에 넣음
|
||||
egovPopupManageService.resetSubMainVOSort(mainzoneVO);
|
||||
}
|
||||
else if("mainPopup".equals(fileVO.getMenuName())) { // 메인팝업 새글
|
||||
String mainId = idgenServiceMainPopup.getNextStringId();
|
||||
mainPopupVO.setPopId(mainId);
|
||||
mainPopupVO.setRegisterId(loginVO.getUniqId());
|
||||
egovPopupManageService.insertMainPopup(mainPopupVO);
|
||||
mainPopupVO.setSortOver("D"); //앞쪽에 넣음
|
||||
egovPopupManageService.resetMainPopup(mainPopupVO);
|
||||
}
|
||||
else if("popupzone".equals(fileVO.getMenuName())) { //매뉴별 비주얼
|
||||
}else if("popupzone".equals(fileVO.getMenuName())) { //매뉴별 비주얼
|
||||
String pozId = idgenService.getNextStringId();
|
||||
popupzoneVO.setPozId(pozId);
|
||||
popupzoneVO.setRegisterId(loginVO.getUniqId());
|
||||
@ -553,19 +521,6 @@ public class FmsFileController {
|
||||
mainzoneVO.setSortOver("D");
|
||||
}
|
||||
egovPopupManageService.resetMainVOSort(mainzoneVO);
|
||||
}else if("subMainzone".equals(fileVO.getMenuName())) { //메인비주얼 수정
|
||||
egovPopupManageService.updateSubMainzone(mainzoneVO);
|
||||
if(mainzoneVO.getSort() < mainzoneVO.getBeSort() ){ //sortOver : A 후번호로 변경 , D : 선번호로 변경
|
||||
mainzoneVO.setSortOver("D");
|
||||
}
|
||||
egovPopupManageService.resetMainVOSort(mainzoneVO);
|
||||
}else if("mainPopup".equals(fileVO.getMenuName())) { // 메인팝업 새글
|
||||
egovPopupManageService.updateMainPopup(mainPopupVO);
|
||||
if(mainzoneVO.getSort() < mainzoneVO.getBeSort() ){ //sortOver : A 후번호로 변경 , D : 선번호로 변경
|
||||
mainzoneVO.setSortOver("D");
|
||||
}
|
||||
egovPopupManageService.resetMainPopup(mainPopupVO);
|
||||
|
||||
}else if("popupzone".equals(fileVO.getMenuName())) { //매뉴별 비주얼
|
||||
egovPopupManageService.updatePopupzone(popupzoneVO);
|
||||
if(popupzoneVO.getSort() < popupzoneVO.getBeSort() ){ //sortOver : A 후번호로 변경 , D : 선번호로 변경
|
||||
@ -602,8 +557,7 @@ public class FmsFileController {
|
||||
}
|
||||
}
|
||||
modelAndView.addObject("result", "success");
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}catch (Exception e) {
|
||||
modelAndView.addObject("result", "fail");
|
||||
}
|
||||
return modelAndView;
|
||||
|
||||
@ -3,8 +3,6 @@ package itn.com.uss.ion.pwm.service;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import itn.com.uss.ion.bnr.pop.service.MainPopupVO;
|
||||
|
||||
/**
|
||||
* 개요
|
||||
* - 팝업창에 대한 Service Interface를 정의한다.
|
||||
@ -125,8 +123,6 @@ public interface EgovPopupManageService {
|
||||
public int getMainMaxSort() throws Exception;
|
||||
|
||||
public void insertMainzone(MainzoneVO mainzoneVO) throws Exception;
|
||||
|
||||
public void insertSubMainzone(MainzoneVO mainzoneVO) throws Exception;
|
||||
|
||||
public void resetMainSort(MainzoneVO mainzoneVO) throws Exception;
|
||||
|
||||
@ -141,8 +137,6 @@ public interface EgovPopupManageService {
|
||||
public void updateMainSortDown(SortVO sortVO) throws Exception;
|
||||
|
||||
public void updateMainzone(MainzoneVO mainzoneVO) throws Exception;
|
||||
|
||||
public void updateSubMainzone(MainzoneVO mainzoneVO) throws Exception;
|
||||
|
||||
public int selectPopupzoneListTotCnt(PopupzoneVO popupzoneVo) throws Exception;
|
||||
|
||||
@ -151,8 +145,6 @@ public interface EgovPopupManageService {
|
||||
public void resetVOSort(PopupzoneVO popupzoneVO) throws Exception;
|
||||
|
||||
public void resetMainVOSort(MainzoneVO mainzoneVO) throws Exception;
|
||||
|
||||
public void resetSubMainVOSort(MainzoneVO mainzoneVO) throws Exception;
|
||||
|
||||
public List<SocialVO> selectSocialList(SocialVO socialVO) throws Exception;
|
||||
|
||||
@ -169,11 +161,4 @@ public interface EgovPopupManageService {
|
||||
//사용자 메인화면 롤링 배너 이미지 조회
|
||||
public List<MainzoneVO> selectMainzoneListRolling() throws Exception;
|
||||
|
||||
public void insertMainPopup(MainPopupVO mainPopupVO);
|
||||
|
||||
public void resetMainPopup(MainPopupVO mainPopupVO) throws Exception;
|
||||
|
||||
public void updateMainPopup(MainPopupVO mainPopupVO) throws Exception;
|
||||
|
||||
|
||||
}
|
||||
@ -18,8 +18,6 @@ package itn.com.uss.ion.pwm.service;
|
||||
import java.io.Serializable;
|
||||
|
||||
import itn.com.cmm.ComDefaultVO;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* @Class Name : MainzoneVO.java
|
||||
@ -37,8 +35,6 @@ import lombok.Setter;
|
||||
*
|
||||
*
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
public class MainzoneVO extends ComDefaultVO implements Serializable {
|
||||
|
||||
|
||||
@ -99,8 +95,190 @@ public class MainzoneVO extends ComDefaultVO implements Serializable {
|
||||
|
||||
private String ntceEnddeHH = "";
|
||||
private String ntceEnddeMM = "";
|
||||
|
||||
private String topTxt = "";
|
||||
private String lowTxt = "";
|
||||
|
||||
public int getSeq() {
|
||||
return seq;
|
||||
}
|
||||
|
||||
public void setSeq(int seq) {
|
||||
this.seq = seq;
|
||||
}
|
||||
|
||||
public String getUpfile() {
|
||||
return upfile;
|
||||
}
|
||||
|
||||
public void setUpfile(String upfile) {
|
||||
this.upfile = upfile;
|
||||
}
|
||||
|
||||
public String getUpfileUrl() {
|
||||
return upfileUrl;
|
||||
}
|
||||
|
||||
public void setUpfileUrl(String upfileUrl) {
|
||||
this.upfileUrl = upfileUrl;
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public String getMlink() {
|
||||
return mlink;
|
||||
}
|
||||
|
||||
public void setMlink(String mlink) {
|
||||
this.mlink = mlink;
|
||||
}
|
||||
|
||||
public String getIstarget() {
|
||||
return istarget;
|
||||
}
|
||||
|
||||
public void setIstarget(String istarget) {
|
||||
this.istarget = istarget;
|
||||
}
|
||||
|
||||
public String getDel() {
|
||||
return del;
|
||||
}
|
||||
|
||||
public void setDel(String del) {
|
||||
this.del = del;
|
||||
}
|
||||
|
||||
public int getSort() {
|
||||
return sort;
|
||||
}
|
||||
|
||||
public void setSort(int sort) {
|
||||
this.sort = sort;
|
||||
}
|
||||
|
||||
public String getRegdt() {
|
||||
return regdt;
|
||||
}
|
||||
|
||||
public void setRegdt(String regdt) {
|
||||
this.regdt = regdt;
|
||||
}
|
||||
|
||||
public String getMainzoneImage() {
|
||||
return mainzoneImage;
|
||||
}
|
||||
|
||||
public void setMainzoneImage(String mainzoneImage) {
|
||||
this.mainzoneImage = mainzoneImage;
|
||||
}
|
||||
|
||||
public String getMainzoneImageFile() {
|
||||
return mainzoneImageFile;
|
||||
}
|
||||
|
||||
public void setMainzoneImageFile(String mainzoneImageFile) {
|
||||
this.mainzoneImageFile = mainzoneImageFile;
|
||||
}
|
||||
|
||||
public String getMazId() {
|
||||
return mazId;
|
||||
}
|
||||
|
||||
public void setMazId(String mazId) {
|
||||
this.mazId = mazId;
|
||||
}
|
||||
|
||||
public String getMazNm() {
|
||||
return mazNm;
|
||||
}
|
||||
|
||||
public void setMazNm(String mazNm) {
|
||||
this.mazNm = mazNm;
|
||||
}
|
||||
|
||||
public String getUseYn() {
|
||||
return useYn;
|
||||
}
|
||||
|
||||
public void setUseYn(String useYn) {
|
||||
this.useYn = useYn;
|
||||
}
|
||||
|
||||
public String getRegisterId() {
|
||||
return registerId;
|
||||
}
|
||||
|
||||
public void setRegisterId(String registerId) {
|
||||
this.registerId = registerId;
|
||||
}
|
||||
|
||||
public String getModdt() {
|
||||
return moddt;
|
||||
}
|
||||
|
||||
public void setModdt(String moddt) {
|
||||
this.moddt = moddt;
|
||||
}
|
||||
|
||||
public String getDeviceType() {
|
||||
return deviceType;
|
||||
}
|
||||
|
||||
public void setDeviceType(String deviceType) {
|
||||
this.deviceType = deviceType;
|
||||
}
|
||||
|
||||
public String getNtceBgnde() {
|
||||
return ntceBgnde;
|
||||
}
|
||||
|
||||
public void setNtceBgnde(String ntceBgnde) {
|
||||
this.ntceBgnde = ntceBgnde;
|
||||
}
|
||||
|
||||
public String getNtceEndde() {
|
||||
return ntceEndde;
|
||||
}
|
||||
|
||||
public void setNtceEndde(String ntceEndde) {
|
||||
this.ntceEndde = ntceEndde;
|
||||
}
|
||||
|
||||
public String getNtceBgndeHH() {
|
||||
return ntceBgndeHH;
|
||||
}
|
||||
|
||||
public void setNtceBgndeHH(String ntceBgndeHH) {
|
||||
this.ntceBgndeHH = ntceBgndeHH;
|
||||
}
|
||||
|
||||
public String getNtceBgndeMM() {
|
||||
return ntceBgndeMM;
|
||||
}
|
||||
|
||||
public void setNtceBgndeMM(String ntceBgndeMM) {
|
||||
this.ntceBgndeMM = ntceBgndeMM;
|
||||
}
|
||||
|
||||
public String getNtceEnddeHH() {
|
||||
return ntceEnddeHH;
|
||||
}
|
||||
|
||||
public void setNtceEnddeHH(String ntceEnddeHH) {
|
||||
this.ntceEnddeHH = ntceEnddeHH;
|
||||
}
|
||||
|
||||
public String getNtceEnddeMM() {
|
||||
return ntceEnddeMM;
|
||||
}
|
||||
|
||||
public void setNtceEnddeMM(String ntceEnddeMM) {
|
||||
this.ntceEnddeMM = ntceEnddeMM;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -1,23 +1,17 @@
|
||||
package itn.com.uss.ion.pwm.service.impl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl;
|
||||
import egovframework.rte.fdl.idgnr.EgovIdGnrService;
|
||||
import egovframework.rte.psl.dataaccess.util.EgovMap;
|
||||
import itn.com.uss.ion.bnr.pop.service.MainPopupLinkVO;
|
||||
import itn.com.uss.ion.bnr.pop.service.MainPopupVO;
|
||||
import itn.com.uss.ion.pwm.service.EgovPopupManageService;
|
||||
import itn.com.uss.ion.pwm.service.MainzoneVO;
|
||||
import itn.com.uss.ion.pwm.service.PopupManageVO;
|
||||
@ -245,15 +239,6 @@ public class EgovPopupManageServiceImpl extends EgovAbstractServiceImpl implemen
|
||||
public void insertMainzone(MainzoneVO mainzoneVO) throws Exception {
|
||||
dao.insertMainzone(mainzoneVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insertSubMainzone(MainzoneVO mainzoneVO) throws Exception {
|
||||
dao.insertSubMainzone(mainzoneVO);
|
||||
}
|
||||
@Override
|
||||
public void resetMainPopup(MainPopupVO mainPopupVO) throws Exception {
|
||||
dao.resetMainPopup(mainPopupVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resetMainSort(MainzoneVO mainzoneVO) throws Exception {
|
||||
@ -310,12 +295,6 @@ public class EgovPopupManageServiceImpl extends EgovAbstractServiceImpl implemen
|
||||
dao.updateMainzone(mainzoneVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateSubMainzone(MainzoneVO mainzoneVO) throws Exception {
|
||||
dao.updateSubMainzone(mainzoneVO);
|
||||
}
|
||||
|
||||
|
||||
//사용자 메인화면 롤링 배너 이미지 조회
|
||||
@Override
|
||||
public List<MainzoneVO> selectMainzoneListRolling() throws Exception{
|
||||
@ -345,12 +324,6 @@ public class EgovPopupManageServiceImpl extends EgovAbstractServiceImpl implemen
|
||||
dao.resetMainVOSort(mainzoneVO);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resetSubMainVOSort(MainzoneVO mainzoneVO) throws Exception {
|
||||
dao.resetSubMainVOSort(mainzoneVO);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SocialVO> selectSocialList(SocialVO socialVO) throws Exception {
|
||||
@ -382,52 +355,4 @@ public class EgovPopupManageServiceImpl extends EgovAbstractServiceImpl implemen
|
||||
public void deleteSocial(String id) throws Exception {
|
||||
dao.deleteSocial(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insertMainPopup(MainPopupVO mainPopupVO) {
|
||||
dao.insertMainPopup(mainPopupVO);
|
||||
|
||||
|
||||
|
||||
if(CollectionUtils.isNotEmpty(mainPopupVO.getMainPopupLinkList())) {
|
||||
|
||||
List<MainPopupLinkVO> mainPopupLinkListVO = getMainPopupLinkList(mainPopupVO);
|
||||
// mainPopupLinkListVO.stream().forEach(t-> System.out.println(t.toString()));
|
||||
dao.insertMainPopupLinkInfo(mainPopupLinkListVO);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateMainPopup(MainPopupVO mainPopupVO) throws Exception {
|
||||
|
||||
dao.updateMainPopup(mainPopupVO);
|
||||
|
||||
|
||||
if(CollectionUtils.isNotEmpty(mainPopupVO.getMainPopupLinkList())) {
|
||||
|
||||
List<MainPopupLinkVO> mainPopupLinkListVO = getMainPopupLinkList(mainPopupVO);
|
||||
|
||||
dao.deleteMainPopupLinkInfo(mainPopupVO.getPopId());
|
||||
|
||||
dao.insertMainPopupLinkInfo(mainPopupLinkListVO);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private List<MainPopupLinkVO> getMainPopupLinkList(MainPopupVO mainPopupVO) {
|
||||
|
||||
List<MainPopupLinkVO> mainPopupLinkListVO = mainPopupVO.getMainPopupLinkList();
|
||||
|
||||
// 기존 sort 값을 숫자로 변환하여 오름차순 정렬
|
||||
mainPopupLinkListVO.sort(Comparator.comparingInt(vo -> vo.getSort()));
|
||||
// 2. 정렬된 상태에서 sort 값을 연속적인 숫자로 변경 (1, 2, 3, ...)
|
||||
IntStream.range(0, mainPopupLinkListVO.size())
|
||||
.forEach(i -> mainPopupLinkListVO.get(i).setSort(i + 1));
|
||||
|
||||
mainPopupLinkListVO.stream().forEach(t-> t.setPopId(mainPopupVO.getPopId()));
|
||||
return mainPopupLinkListVO;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -5,8 +5,6 @@ import org.springframework.stereotype.Repository;
|
||||
|
||||
import egovframework.rte.psl.dataaccess.util.EgovMap;
|
||||
import itn.com.cmm.service.impl.EgovComAbstractDAO;
|
||||
import itn.com.uss.ion.bnr.pop.service.MainPopupLinkVO;
|
||||
import itn.com.uss.ion.bnr.pop.service.MainPopupVO;
|
||||
import itn.com.uss.ion.pwm.service.MainzoneVO;
|
||||
import itn.com.uss.ion.pwm.service.PopupManageVO;
|
||||
import itn.com.uss.ion.pwm.service.PopupzoneVO;
|
||||
@ -195,10 +193,6 @@ public class PopupManageDAO extends EgovComAbstractDAO {
|
||||
public void insertMainzone(MainzoneVO mainzoneVO) throws Exception{
|
||||
insert("MainzoneManage.insertMainzone", mainzoneVO);
|
||||
}
|
||||
|
||||
public void insertSubMainzone(MainzoneVO mainzoneVO) throws Exception{
|
||||
insert("MainzoneManage.insertSubMainzone", mainzoneVO);
|
||||
}
|
||||
|
||||
public void resetMainSort(MainzoneVO mainzoneVO) throws Exception{
|
||||
insert("MainzoneManage.resetMainSort", mainzoneVO);
|
||||
@ -229,10 +223,6 @@ public class PopupManageDAO extends EgovComAbstractDAO {
|
||||
update("MainzoneManage.updateMainzone", mainzoneVO);
|
||||
}
|
||||
|
||||
public void updateSubMainzone(MainzoneVO mainzoneVO) throws Exception{
|
||||
update("MainzoneManage.updateSubMainzone", mainzoneVO);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public List<MainzoneVO> selectMainzoneListRolling() throws Exception{
|
||||
return (List<MainzoneVO>) list("MainzoneManage.selectMainzoneListRolling");
|
||||
@ -253,10 +243,6 @@ public class PopupManageDAO extends EgovComAbstractDAO {
|
||||
public void resetMainVOSort(MainzoneVO mainzoneVO) throws Exception{
|
||||
update("MainzoneManage.resetMainVOSort", mainzoneVO);
|
||||
}
|
||||
|
||||
public void resetSubMainVOSort(MainzoneVO mainzoneVO) throws Exception{
|
||||
update("MainzoneManage.resetSubMainVOSort", mainzoneVO);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public List<SocialVO> selectSocialList(SocialVO socialVO) throws Exception{
|
||||
@ -282,30 +268,4 @@ public class PopupManageDAO extends EgovComAbstractDAO {
|
||||
public void deleteSocial(String id) throws Exception{
|
||||
delete("SocialManage.deleteSocial", id);
|
||||
}
|
||||
|
||||
public void insertMainPopup(MainPopupVO mainPopupVO) {
|
||||
insert("MainzoneManage.insertMainPopup", mainPopupVO);
|
||||
}
|
||||
|
||||
public void insertMainPopupLinkInfo(List<MainPopupLinkVO> mainPopupLinkListVO) {
|
||||
insert("MainzoneManage.insertMainPopupLinkInfo", mainPopupLinkListVO);
|
||||
}
|
||||
|
||||
public void resetMainPopup(MainPopupVO mainPopupVO) {
|
||||
// update("MainzoneManage.resetSubMainVOSort", mainzoneVO);
|
||||
insert("MainzoneManage.resetMainPopup", mainPopupVO);
|
||||
}
|
||||
|
||||
public void updateMainPopup(MainPopupVO mainPopupVO) throws Exception{
|
||||
update("MainzoneManage.updateMainPopup", mainPopupVO);
|
||||
}
|
||||
|
||||
public void updateMainPopupLinkInfo(MainPopupLinkVO mainPopupLinkVO) {
|
||||
update("MainzoneManage.updateMainPopupLinkInfo", mainPopupLinkVO);
|
||||
|
||||
}
|
||||
|
||||
public void deleteMainPopupLinkInfo(String popId) {
|
||||
delete("MainzoneManage.deleteMainPopupLinkInfo", popId);
|
||||
}
|
||||
}
|
||||
@ -845,8 +845,6 @@ public class EgovPopupManageController {
|
||||
HttpServletRequest request, Model model, HttpSession session)
|
||||
throws Exception {
|
||||
|
||||
System.out.println("??????");
|
||||
|
||||
MainzoneVO mainzoneVO = new MainzoneVO();
|
||||
if("Modify".equals((String)commandMap.get("pageType"))){ //수정
|
||||
String mazId = (String)commandMap.get("selectedId");
|
||||
@ -898,8 +896,7 @@ public class EgovPopupManageController {
|
||||
|
||||
//model.addAttribute("sortList", sortList);
|
||||
model.addAttribute("mainzoneVO", mainzoneVO);
|
||||
|
||||
System.out.println("mainzoneVO :: "+ mainzoneVO.toString());
|
||||
|
||||
/* 타겟 코드 */
|
||||
ComDefaultCodeVO vo = new ComDefaultCodeVO();
|
||||
vo.setCodeId("COM037");
|
||||
|
||||
@ -1,34 +0,0 @@
|
||||
package itn.let.cert.ip.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import itn.let.mail.service.StatusResponse;
|
||||
|
||||
public interface CertIpService {
|
||||
|
||||
// public List<MberCertPhoneVO> selectMberCertPhoneList(String userId);
|
||||
//
|
||||
// public StatusResponse insertMberCertPhoneInfo(MberCertPhoneVO mberCertPhoneVO);
|
||||
//
|
||||
// public StatusResponse deleteCertPhoneInfo(MberCertPhoneVO mberCertPhoneVO);
|
||||
//
|
||||
// public List<MberCertPhoneVO> selectMberCertPhoneListVO(MberCertPhoneVO mberCertPhoneVO);
|
||||
//
|
||||
// public StatusResponse findByCertPhoneInfo(MberCertPhoneVO mberCertPhoneVO);
|
||||
//
|
||||
// public StatusResponse updateMberCertPhoneInfo(MberCertPhoneVO mberCertPhoneVO);
|
||||
|
||||
public StatusResponse selectMberCertIpList(MberCertIpVO mberCertPhoneVO);
|
||||
|
||||
public StatusResponse insertCertIp(MberCertIpVO mberCertIpVO);
|
||||
|
||||
public StatusResponse deleteCertIp(MberCertIpVO mberCertIpVO);
|
||||
|
||||
public Boolean checkCertIp(MberCertIpVO mberCertIpVO);
|
||||
|
||||
public Boolean checkRegCertIp(MberCertIpVO mberCertIpVO);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -1,19 +0,0 @@
|
||||
package itn.let.cert.ip.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import egovframework.rte.fdl.cmmn.exception.FdlException;
|
||||
|
||||
public interface CertLoginLogService {
|
||||
|
||||
|
||||
public void insertCertLoginLog(MberCertLoginLogVO mberCertLoginLogVO, HttpServletRequest request) throws FdlException;
|
||||
|
||||
public List<MberCertLoginLogVO> findAllCertLoginLogVO(MberCertLoginLogVO mberCertLoginLogVO);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -1,71 +0,0 @@
|
||||
package itn.let.cert.ip.service;
|
||||
|
||||
import itn.let.uss.umt.service.UserDefaultVO;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author : 이호영
|
||||
* @fileName : MberCertPhoneVO.java
|
||||
* @date : 2024.11.18
|
||||
* @description : 발신번호 lettngnrlmber_cert_ip 관련 vo
|
||||
* ===========================================================
|
||||
* DATE AUTHOR NOTE
|
||||
* ----------------------------------------------------------- *
|
||||
* 2024.11.18 이호영 최초 생성
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class MberCertIpVO extends UserDefaultVO{
|
||||
|
||||
|
||||
/**
|
||||
* @description :
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
private String mberId;
|
||||
private String certIp;
|
||||
private String certMemo;
|
||||
private String certUseYn;
|
||||
private String certMbtlnum;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public String getMberId() {
|
||||
return mberId;
|
||||
}
|
||||
public void setMberId(String mberId) {
|
||||
this.mberId = mberId;
|
||||
}
|
||||
public String getCertIp() {
|
||||
return certIp;
|
||||
}
|
||||
public void setCertIp(String certIp) {
|
||||
this.certIp = certIp;
|
||||
}
|
||||
public String getCertMemo() {
|
||||
return certMemo;
|
||||
}
|
||||
public void setCertMemo(String certMemo) {
|
||||
this.certMemo = certMemo;
|
||||
}
|
||||
public String getCertUseYn() {
|
||||
return certUseYn;
|
||||
}
|
||||
public void setCertUseYn(String certUseYn) {
|
||||
this.certUseYn = certUseYn;
|
||||
}
|
||||
public String getCertMbtlnum() {
|
||||
return certMbtlnum;
|
||||
}
|
||||
public void setCertMbtlnum(String certMbtlnum) {
|
||||
this.certMbtlnum = certMbtlnum;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -1,76 +0,0 @@
|
||||
package itn.let.cert.ip.service;
|
||||
|
||||
import itn.let.uss.umt.service.UserDefaultVO;
|
||||
/**
|
||||
*
|
||||
* @author : 이호영
|
||||
* @fileName : MberCertLoginLogVO.java
|
||||
* @date : 2024.11.21
|
||||
* @description : 로그인 이력관리 92동안만 관리하고 삭제
|
||||
* ===========================================================
|
||||
* DATE AUTHOR NOTE
|
||||
* ----------------------------------------------------------- *
|
||||
* 2024.11.21 이호영 최초 생성
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class MberCertLoginLogVO extends UserDefaultVO{
|
||||
|
||||
|
||||
/**
|
||||
* @description :
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
private String certLoginId;
|
||||
private String loginId;
|
||||
private String loginIp;
|
||||
private String loginDevice;
|
||||
private String loginDt;
|
||||
|
||||
private String secuLoginFlag;
|
||||
|
||||
|
||||
public String getCertLoginId() {
|
||||
return certLoginId;
|
||||
}
|
||||
public void setCertLoginId(String certLoginId) {
|
||||
this.certLoginId = certLoginId;
|
||||
}
|
||||
public String getLoginId() {
|
||||
return loginId;
|
||||
}
|
||||
public void setLoginId(String loginId) {
|
||||
this.loginId = loginId;
|
||||
}
|
||||
public String getLoginIp() {
|
||||
return loginIp;
|
||||
}
|
||||
public void setLoginIp(String loginIp) {
|
||||
this.loginIp = loginIp;
|
||||
}
|
||||
public String getLoginDevice() {
|
||||
return loginDevice;
|
||||
}
|
||||
public void setLoginDevice(String loginDevice) {
|
||||
this.loginDevice = loginDevice;
|
||||
}
|
||||
public String getLoginDt() {
|
||||
return loginDt;
|
||||
}
|
||||
public void setLoginDt(String loginDt) {
|
||||
this.loginDt = loginDt;
|
||||
}
|
||||
public String getSecuLoginFlag() {
|
||||
return secuLoginFlag;
|
||||
}
|
||||
public void setSecuLoginFlag(String secuLoginFlag) {
|
||||
this.secuLoginFlag = secuLoginFlag;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -1,39 +0,0 @@
|
||||
package itn.let.cert.ip.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import egovframework.rte.psl.dataaccess.EgovAbstractDAO;
|
||||
import itn.let.cert.ip.service.MberCertIpVO;
|
||||
|
||||
@Repository("CertIpDAO")
|
||||
public class CertIpDAO extends EgovAbstractDAO {
|
||||
|
||||
|
||||
|
||||
public List<MberCertIpVO> selectMberCertIpList(MberCertIpVO mberCertIpVO) {
|
||||
return (List<MberCertIpVO>) list("MberCertIpVO.selectMberCertIpList", mberCertIpVO);
|
||||
}
|
||||
|
||||
public void insertCertIp(MberCertIpVO mberCertIpVO) {
|
||||
insert("MberCertIpVO.insertCertIp", mberCertIpVO);
|
||||
}
|
||||
|
||||
public void deleteCertIp(MberCertIpVO mberCertIpVO) {
|
||||
insert("MberCertIpVO.deleteCertIp", mberCertIpVO);
|
||||
}
|
||||
|
||||
public MberCertIpVO findByMberCertIpList(MberCertIpVO mberCertIpVO) {
|
||||
return (MberCertIpVO) select("MberCertIpVO.findByMberCertIpList", mberCertIpVO);
|
||||
}
|
||||
|
||||
public List<MberCertIpVO> checkCertIp(MberCertIpVO mberCertIpVO) {
|
||||
return (List<MberCertIpVO>) list("MberCertIpVO.checkCertIp", mberCertIpVO);
|
||||
}
|
||||
|
||||
public List<MberCertIpVO> checkRegCertIp(MberCertIpVO mberCertIpVO) {
|
||||
return (List<MberCertIpVO>) list("MberCertIpVO.checkRegCertIp", mberCertIpVO);
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,68 +0,0 @@
|
||||
package itn.let.cert.ip.service.impl;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl;
|
||||
import itn.let.cert.ip.service.CertIpService;
|
||||
import itn.let.cert.ip.service.MberCertIpVO;
|
||||
import itn.let.mail.service.StatusResponse;
|
||||
|
||||
@Service("CertIpService")
|
||||
public class CertIpServiceImpl extends EgovAbstractServiceImpl implements CertIpService {
|
||||
|
||||
@Resource(name = "CertIpDAO")
|
||||
private CertIpDAO certIpDAO;
|
||||
|
||||
|
||||
@Override
|
||||
public StatusResponse selectMberCertIpList(MberCertIpVO mberCertIpVO) {
|
||||
List<MberCertIpVO> mberCertIpListVO = certIpDAO.selectMberCertIpList(mberCertIpVO);
|
||||
return new StatusResponse(HttpStatus.OK, mberCertIpListVO, LocalDateTime.now());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public StatusResponse insertCertIp(MberCertIpVO mberCertIpVO) {
|
||||
MberCertIpVO mberCertIpListVO = certIpDAO.findByMberCertIpList(mberCertIpVO);
|
||||
if(mberCertIpListVO != null) {
|
||||
return new StatusResponse(HttpStatus.CONFLICT, "중복 IP입니다.", LocalDateTime.now());
|
||||
}
|
||||
certIpDAO.insertCertIp(mberCertIpVO);
|
||||
return new StatusResponse(HttpStatus.OK, "등록 하였습니다.", LocalDateTime.now());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public StatusResponse deleteCertIp(MberCertIpVO mberCertIpVO) {
|
||||
certIpDAO.deleteCertIp(mberCertIpVO);
|
||||
return new StatusResponse(HttpStatus.OK, "삭제 하였습니다.", LocalDateTime.now());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Boolean checkCertIp(MberCertIpVO mberCertIpVO) {
|
||||
List<MberCertIpVO> mberCertIpListVO = certIpDAO.checkCertIp(mberCertIpVO);
|
||||
if(mberCertIpListVO.size()>0) {
|
||||
return true;
|
||||
}else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean checkRegCertIp(MberCertIpVO mberCertIpVO) {
|
||||
List<MberCertIpVO> mberCertIpListVO = certIpDAO.checkRegCertIp(mberCertIpVO);
|
||||
if(mberCertIpListVO.size()>0) {
|
||||
return true;
|
||||
}else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,47 +0,0 @@
|
||||
package itn.let.cert.ip.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import egovframework.rte.psl.dataaccess.EgovAbstractDAO;
|
||||
import itn.let.cert.ip.service.MberCertLoginLogVO;
|
||||
|
||||
@Repository("CertLoginLogDAO")
|
||||
public class CertLoginLogDAO extends EgovAbstractDAO {
|
||||
|
||||
|
||||
/*
|
||||
public List<MberCertIpVO> selectMberCertIpList(MberCertIpVO mberCertIpVO) {
|
||||
return (List<MberCertIpVO>) list("MberCertIpVO.selectMberCertIpList", mberCertIpVO);
|
||||
}
|
||||
|
||||
public void insertCertIp(MberCertIpVO mberCertIpVO) {
|
||||
insert("MberCertIpVO.insertCertIp", mberCertIpVO);
|
||||
}
|
||||
|
||||
public void deleteCertIp(MberCertIpVO mberCertIpVO) {
|
||||
insert("MberCertIpVO.deleteCertIp", mberCertIpVO);
|
||||
}
|
||||
|
||||
public MberCertIpVO findByMberCertIpList(MberCertIpVO mberCertIpVO) {
|
||||
return (MberCertIpVO) select("MberCertIpVO.findByMberCertIpList", mberCertIpVO);
|
||||
}
|
||||
*/
|
||||
public void insertCertLoginLog(MberCertLoginLogVO mberCertLoginLogVO) {
|
||||
insert("MberCertLoginLogVO.insertCertLoginLog", mberCertLoginLogVO);
|
||||
}
|
||||
|
||||
public int checkLoginIpExists(MberCertLoginLogVO mberCertLoginLogVO) {
|
||||
return (int) select("MberCertLoginLogVO.checkLoginIpExists", mberCertLoginLogVO);
|
||||
}
|
||||
|
||||
public void updateCertLoginLog(MberCertLoginLogVO mberCertLoginLogVO) {
|
||||
insert("MberCertLoginLogVO.updateCertLoginLog", mberCertLoginLogVO);
|
||||
}
|
||||
|
||||
public List<MberCertLoginLogVO> findAllCertLoginLogVO(MberCertLoginLogVO mberCertLoginLogVO) {
|
||||
return (List<MberCertLoginLogVO>) list("MberCertLoginLogVO.findAllCertLoginLogVO", mberCertLoginLogVO);
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,87 +0,0 @@
|
||||
package itn.let.cert.ip.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl;
|
||||
import egovframework.rte.fdl.cmmn.exception.FdlException;
|
||||
import egovframework.rte.fdl.idgnr.EgovIdGnrService;
|
||||
import itn.let.cert.ip.service.CertLoginLogService;
|
||||
import itn.let.cert.ip.service.MberCertLoginLogVO;
|
||||
|
||||
@Service("CertLoginLogService")
|
||||
public class CertLoginLogServiceImpl extends EgovAbstractServiceImpl implements CertLoginLogService {
|
||||
|
||||
@Resource(name = "CertLoginLogDAO")
|
||||
private CertLoginLogDAO certLoginLogDAO;
|
||||
|
||||
@Resource(name = "egovMjonCertLoginLogIdGnrService")
|
||||
private EgovIdGnrService certLoginLogIdGnrService;
|
||||
/*
|
||||
@Override
|
||||
public StatusResponse selectMberCertIpList(MberCertIpVO mberCertPhoneVO) {
|
||||
List<MberCertIpVO> mberCertIpListVO = certLoginLogDAO.selectMberCertIpList(mberCertPhoneVO);
|
||||
return new StatusResponse(HttpStatus.OK, mberCertIpListVO, LocalDateTime.now());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public StatusResponse insertCertIp(MberCertIpVO mberCertIpVO) {
|
||||
MberCertIpVO mberCertIpListVO = certLoginLogDAO.findByMberCertIpList(mberCertIpVO);
|
||||
if(mberCertIpListVO != null) {
|
||||
return new StatusResponse(HttpStatus.CONFLICT, "중복 IP입니다.", LocalDateTime.now());
|
||||
}
|
||||
certLoginLogDAO.insertCertIp(mberCertIpVO);
|
||||
return new StatusResponse(HttpStatus.OK, "등록 하였습니다.", LocalDateTime.now());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public StatusResponse deleteCertIp(MberCertIpVO mberCertIpVO) {
|
||||
certLoginLogDAO.deleteCertIp(mberCertIpVO);
|
||||
return new StatusResponse(HttpStatus.OK, "삭제 하였습니다.", LocalDateTime.now());
|
||||
}
|
||||
*/
|
||||
|
||||
@Override
|
||||
public void insertCertLoginLog(MberCertLoginLogVO mberCertLoginLogVO, HttpServletRequest request) throws FdlException {
|
||||
|
||||
|
||||
// int count = certLoginLogDAO.checkLoginIpExists(mberCertLoginLogVO);
|
||||
//
|
||||
// if (count > 0) {
|
||||
// // 이미 존재하면 UPDATE
|
||||
// certLoginLogDAO.updateCertLoginLog(mberCertLoginLogVO);
|
||||
// } else {
|
||||
|
||||
mberCertLoginLogVO.setCertLoginId(certLoginLogIdGnrService.getNextStringId());
|
||||
mberCertLoginLogVO.setLoginDevice(getDevice(request));
|
||||
certLoginLogDAO.insertCertLoginLog(mberCertLoginLogVO);
|
||||
|
||||
// }
|
||||
}
|
||||
|
||||
private String getDevice(HttpServletRequest request) {
|
||||
String userAgent = request.getHeader("User-Agent").toLowerCase();
|
||||
|
||||
if (userAgent.contains("mobile") || userAgent.contains("android") || userAgent.contains("iphone")) {
|
||||
return "M";
|
||||
} else if (userAgent.contains("tablet") || userAgent.contains("ipad")) {
|
||||
return "T";
|
||||
} else {
|
||||
return "D";
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MberCertLoginLogVO> findAllCertLoginLogVO(MberCertLoginLogVO mberCertLoginLogVO) {
|
||||
// TODO Auto-generated method stub
|
||||
return certLoginLogDAO.findAllCertLoginLogVO(mberCertLoginLogVO);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,127 +0,0 @@
|
||||
package itn.let.cert.ip.web;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import egovframework.rte.fdl.security.userdetails.util.EgovUserDetailsHelper;
|
||||
import itn.com.cmm.LoginVO;
|
||||
import itn.com.utl.fcc.service.EgovStringUtil;
|
||||
import itn.let.cert.ip.service.CertIpService;
|
||||
import itn.let.cert.ip.service.MberCertIpVO;
|
||||
import itn.let.mail.service.StatusResponse;
|
||||
import itn.let.utl.sim.service.EgovClntInfo;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author : 이호영
|
||||
* @fileName : CertIpController.java
|
||||
* @date : 2024.11.19
|
||||
* @description : 허용 IP 관련 컨트롤러
|
||||
* ===========================================================
|
||||
* DATE AUTHOR NOTE
|
||||
* ----------------------------------------------------------- *
|
||||
* 2024.11.19 이호영 최초 생성
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
@Controller
|
||||
public class CertIpController {
|
||||
|
||||
|
||||
/* certIpService */
|
||||
@Resource(name = "CertIpService")
|
||||
private CertIpService certIpService;
|
||||
|
||||
|
||||
@RequestMapping(value = {"/cert/ip/selectMberCertIpList.do"})
|
||||
public ResponseEntity<StatusResponse> selectMberCertIpList(MberCertIpVO mberCertPhoneVO) throws Exception {
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView();
|
||||
modelAndView.setViewName("jsonView");
|
||||
|
||||
//로그인 권한정보 불러오기
|
||||
LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated()? (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null;
|
||||
String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId());
|
||||
|
||||
if(userId == null) {
|
||||
if(StringUtils.isEmpty(userId)) return ResponseEntity.ok().body(new StatusResponse(HttpStatus.BAD_REQUEST, "로그인 후 이용해 주세요", LocalDateTime.now()));
|
||||
}
|
||||
mberCertPhoneVO.setMberId(userId);
|
||||
return ResponseEntity.ok().body(certIpService.selectMberCertIpList(mberCertPhoneVO));
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = {"/cert/ip/insertCertIp.do"})
|
||||
public ResponseEntity<StatusResponse> insertCertIp(MberCertIpVO mberCertIpVO) throws Exception {
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView();
|
||||
modelAndView.setViewName("jsonView");
|
||||
|
||||
//로그인 권한정보 불러오기
|
||||
LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated()? (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null;
|
||||
String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId());
|
||||
|
||||
if(userId == null) {
|
||||
if(StringUtils.isEmpty(userId)) return ResponseEntity.ok().body(new StatusResponse(HttpStatus.BAD_REQUEST, "로그인 후 이용해 주세요", LocalDateTime.now()));
|
||||
}
|
||||
mberCertIpVO.setFrstRegisterId(userId);
|
||||
mberCertIpVO.setMberId(userId);
|
||||
|
||||
|
||||
return ResponseEntity.ok().body(certIpService.insertCertIp(mberCertIpVO));
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = {"/cert/ip/insertCennetCertIp.do"})
|
||||
public ResponseEntity<StatusResponse> insertCennetCertIp(MberCertIpVO mberCertIpVO,HttpServletRequest request) throws Exception {
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView();
|
||||
modelAndView.setViewName("jsonView");
|
||||
|
||||
//로그인 권한정보 불러오기
|
||||
LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated()? (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null;
|
||||
String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId());
|
||||
|
||||
if(userId == null) {
|
||||
if(StringUtils.isEmpty(userId)) return ResponseEntity.ok().body(new StatusResponse(HttpStatus.BAD_REQUEST, "로그인 후 이용해 주세요", LocalDateTime.now()));
|
||||
}
|
||||
mberCertIpVO.setFrstRegisterId(userId);
|
||||
mberCertIpVO.setMberId(userId);
|
||||
|
||||
mberCertIpVO.setCertIp(EgovClntInfo.getClntIP(request));
|
||||
mberCertIpVO.setCertMemo("허용 IP 등록");
|
||||
|
||||
return ResponseEntity.ok().body(certIpService.insertCertIp(mberCertIpVO));
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/cert/ip/deleteCertIp.do"})
|
||||
public ResponseEntity<StatusResponse> deleteCertIp(MberCertIpVO mberCertIpVO) throws Exception {
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView();
|
||||
modelAndView.setViewName("jsonView");
|
||||
|
||||
//로그인 권한정보 불러오기
|
||||
LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated()? (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null;
|
||||
String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId());
|
||||
|
||||
if(userId == null) {
|
||||
if(StringUtils.isEmpty(userId)) return ResponseEntity.ok().body(new StatusResponse(HttpStatus.BAD_REQUEST, "로그인 후 이용해 주세요", LocalDateTime.now()));
|
||||
}
|
||||
mberCertIpVO.setLastUpdusrId(userId);
|
||||
mberCertIpVO.setMberId(userId);
|
||||
|
||||
|
||||
return ResponseEntity.ok().body(certIpService.deleteCertIp(mberCertIpVO));
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,102 +0,0 @@
|
||||
package itn.let.cert.ip.web;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import egovframework.rte.fdl.security.userdetails.util.EgovUserDetailsHelper;
|
||||
import itn.com.cmm.LoginVO;
|
||||
import itn.com.utl.fcc.service.EgovStringUtil;
|
||||
import itn.let.cert.ip.service.CertLoginLogService;
|
||||
import itn.let.cert.ip.service.MberCertIpVO;
|
||||
import itn.let.mail.service.StatusResponse;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author : 이호영
|
||||
* @fileName : CertIpController.java
|
||||
* @date : 2024.11.19
|
||||
* @description : 허용 IP 관련 컨트롤러
|
||||
* ===========================================================
|
||||
* DATE AUTHOR NOTE
|
||||
* ----------------------------------------------------------- *
|
||||
* 2024.11.19 이호영 최초 생성
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
@Controller
|
||||
public class CertLoginLogController {
|
||||
|
||||
|
||||
/* CertLoginLogService */
|
||||
@Resource(name = "CertLoginLogService")
|
||||
private CertLoginLogService certLoginLogService;
|
||||
|
||||
/*
|
||||
@RequestMapping(value = {"/cert/ip/selectMberCertIpList.do"})
|
||||
public ResponseEntity<StatusResponse> selectMberCertIpList(MberCertIpVO mberCertPhoneVO) throws Exception {
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView();
|
||||
modelAndView.setViewName("jsonView");
|
||||
|
||||
//로그인 권한정보 불러오기
|
||||
LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated()? (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null;
|
||||
String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId());
|
||||
|
||||
if(userId == null) {
|
||||
if(StringUtils.isEmpty(userId)) return ResponseEntity.ok().body(new StatusResponse(HttpStatus.BAD_REQUEST, "로그인 후 이용해 주세요", LocalDateTime.now()));
|
||||
}
|
||||
mberCertPhoneVO.setMberId(userId);
|
||||
return ResponseEntity.ok().body(certLoginLogService.selectMberCertIpList(mberCertPhoneVO));
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = {"/cert/ip/insertCertIp.do"})
|
||||
public ResponseEntity<StatusResponse> insertCertIp(MberCertIpVO mberCertIpVO) throws Exception {
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView();
|
||||
modelAndView.setViewName("jsonView");
|
||||
|
||||
//로그인 권한정보 불러오기
|
||||
LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated()? (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null;
|
||||
String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId());
|
||||
|
||||
if(userId == null) {
|
||||
if(StringUtils.isEmpty(userId)) return ResponseEntity.ok().body(new StatusResponse(HttpStatus.BAD_REQUEST, "로그인 후 이용해 주세요", LocalDateTime.now()));
|
||||
}
|
||||
mberCertIpVO.setFrstRegisterId(userId);
|
||||
mberCertIpVO.setMberId(userId);
|
||||
|
||||
|
||||
return ResponseEntity.ok().body(certLoginLogService.insertCertIp(mberCertIpVO));
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/cert/ip/deleteCertIp.do"})
|
||||
public ResponseEntity<StatusResponse> deleteCertIp(MberCertIpVO mberCertIpVO) throws Exception {
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView();
|
||||
modelAndView.setViewName("jsonView");
|
||||
|
||||
//로그인 권한정보 불러오기
|
||||
LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated()? (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null;
|
||||
String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId());
|
||||
|
||||
if(userId == null) {
|
||||
if(StringUtils.isEmpty(userId)) return ResponseEntity.ok().body(new StatusResponse(HttpStatus.BAD_REQUEST, "로그인 후 이용해 주세요", LocalDateTime.now()));
|
||||
}
|
||||
mberCertIpVO.setLastUpdusrId(userId);
|
||||
mberCertIpVO.setMberId(userId);
|
||||
|
||||
|
||||
return ResponseEntity.ok().body(certLoginLogService.deleteCertIp(mberCertIpVO));
|
||||
}
|
||||
*/
|
||||
}
|
||||
@ -1,46 +0,0 @@
|
||||
package itn.let.cert.phone.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import itn.let.mail.service.StatusResponse;
|
||||
import itn.let.uat.uia.service.AuthCertVO;
|
||||
import itn.let.uat.uia.web.SendLogVO;
|
||||
|
||||
public interface CertPhoneService {
|
||||
|
||||
|
||||
// public List<MberCertPhoneVO> selectMberCertPhoneList(String userId);
|
||||
//
|
||||
// public StatusResponse insertMberCertPhoneInfo(MberCertPhoneVO mberCertPhoneVO);
|
||||
//
|
||||
// public StatusResponse deleteCertPhoneInfo(MberCertPhoneVO mberCertPhoneVO);
|
||||
//
|
||||
// public List<MberCertPhoneVO> selectMberCertPhoneListVO(MberCertPhoneVO mberCertPhoneVO);
|
||||
//
|
||||
public StatusResponse findByCertPhoneInfo(MberCertPhoneVO mberCertPhoneVO);
|
||||
//
|
||||
// public StatusResponse updateMberCertPhoneInfo(MberCertPhoneVO mberCertPhoneVO);
|
||||
|
||||
public StatusResponse selectMberCertPhoneList(MberCertPhoneVO mberCertPhoneVO);
|
||||
|
||||
public StatusResponse insertCertPhone(MberCertPhoneVO mberCertPhoneVO, String moblphonNo);
|
||||
|
||||
public StatusResponse deleteCertPhone(MberCertPhoneVO mberCertPhoneVO);
|
||||
|
||||
public List<MberCertPhoneVO> selectMberCertPhoneList(String userId);
|
||||
|
||||
public StatusResponse selectMberCertPhoneListWhereUserId(String userId);
|
||||
|
||||
public StatusResponse updateMberCertPhone(MberCertPhoneVO mberCertPhoneVO);
|
||||
|
||||
public StatusResponse selectSysMsgLogCheck(MberCertPhoneVO mberCertPhoneVO);
|
||||
|
||||
public MberCertPhoneVO selectCertUrlCode(MberCertPhoneVO mberCertPhoneVO) throws Exception;
|
||||
|
||||
public StatusResponse insertCertLog(HttpServletRequest request) throws Exception;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -1,159 +0,0 @@
|
||||
package itn.let.cert.phone.service;
|
||||
|
||||
import itn.let.uss.umt.service.UserDefaultVO;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author : 이호영
|
||||
* @fileName : MberCertPhoneVO.java
|
||||
* @date : 2024.11.18
|
||||
* @description : 발신번호 lettngnrlmber_cert_ip 관련 vo
|
||||
* ===========================================================
|
||||
* DATE AUTHOR NOTE
|
||||
* ----------------------------------------------------------- *
|
||||
* 2024.11.18 이호영 최초 생성
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
public class MberCertPhoneVO extends UserDefaultVO{
|
||||
|
||||
|
||||
/**
|
||||
* @description :
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
private String mberId;
|
||||
private String mbtlnum;
|
||||
private String certAlias;
|
||||
private String certMemo;
|
||||
private String certUseYn;
|
||||
|
||||
private String checkNo;
|
||||
|
||||
private String trUrl;
|
||||
private String urlCode;
|
||||
private String url;
|
||||
private String host;
|
||||
private String name = "";
|
||||
private String phoneNo = "";
|
||||
private String phoneCorp = "";
|
||||
private String birthDay = "";
|
||||
private String gender = "";
|
||||
private String nation = "0";
|
||||
private String plusInfo = "";
|
||||
|
||||
|
||||
public String getMberId() {
|
||||
return mberId;
|
||||
}
|
||||
public void setMberId(String mberId) {
|
||||
this.mberId = mberId;
|
||||
}
|
||||
public String getMbtlnum() {
|
||||
return mbtlnum;
|
||||
}
|
||||
public void setMbtlnum(String mbtlnum) {
|
||||
this.mbtlnum = mbtlnum;
|
||||
}
|
||||
public String getCertAlias() {
|
||||
return certAlias;
|
||||
}
|
||||
public void setCertAlias(String certAlias) {
|
||||
this.certAlias = certAlias;
|
||||
}
|
||||
public String getCertMemo() {
|
||||
return certMemo;
|
||||
}
|
||||
public void setCertMemo(String certMemo) {
|
||||
this.certMemo = certMemo;
|
||||
}
|
||||
public String getCertUseYn() {
|
||||
return certUseYn;
|
||||
}
|
||||
public void setCertUseYn(String certUseYn) {
|
||||
this.certUseYn = certUseYn;
|
||||
}
|
||||
public String getCheckNo() {
|
||||
return checkNo;
|
||||
}
|
||||
public void setCheckNo(String checkNo) {
|
||||
this.checkNo = checkNo;
|
||||
}
|
||||
public String getUrlCode() {
|
||||
return urlCode;
|
||||
}
|
||||
public void setUrlCode(String urlCode) {
|
||||
this.urlCode = urlCode;
|
||||
}
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
public String getHost() {
|
||||
return host;
|
||||
}
|
||||
public void setHost(String host) {
|
||||
this.host = host;
|
||||
}
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
public String getPhoneNo() {
|
||||
return phoneNo;
|
||||
}
|
||||
public void setPhoneNo(String phoneNo) {
|
||||
this.phoneNo = phoneNo;
|
||||
}
|
||||
public String getPhoneCorp() {
|
||||
return phoneCorp;
|
||||
}
|
||||
public void setPhoneCorp(String phoneCorp) {
|
||||
this.phoneCorp = phoneCorp;
|
||||
}
|
||||
public String getBirthDay() {
|
||||
return birthDay;
|
||||
}
|
||||
public void setBirthDay(String birthDay) {
|
||||
this.birthDay = birthDay;
|
||||
}
|
||||
public String getGender() {
|
||||
return gender;
|
||||
}
|
||||
public void setGender(String gender) {
|
||||
this.gender = gender;
|
||||
}
|
||||
public String getNation() {
|
||||
return nation;
|
||||
}
|
||||
public void setNation(String nation) {
|
||||
this.nation = nation;
|
||||
}
|
||||
public String getPlusInfo() {
|
||||
return plusInfo;
|
||||
}
|
||||
public void setPlusInfo(String plusInfo) {
|
||||
this.plusInfo = plusInfo;
|
||||
}
|
||||
public String getTrUrl() {
|
||||
return trUrl;
|
||||
}
|
||||
public void setTrUrl(String trUrl) {
|
||||
this.trUrl = trUrl;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -1,50 +0,0 @@
|
||||
package itn.let.cert.phone.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import egovframework.rte.psl.dataaccess.EgovAbstractDAO;
|
||||
import itn.let.cert.phone.service.MberCertPhoneVO;
|
||||
import itn.let.uat.uia.service.AuthCertVO;
|
||||
|
||||
@Repository("CertPhoneDAO")
|
||||
public class CertPhoneDAO extends EgovAbstractDAO {
|
||||
|
||||
public List<MberCertPhoneVO> selectMberCertPhoneList(String userId) {
|
||||
return (List<MberCertPhoneVO>) list("mberCertPhoneVO.selectMberCertPhoneList", userId);
|
||||
}
|
||||
|
||||
public void insertCertPhone(MberCertPhoneVO mberCertPhoneVO) {
|
||||
insert("mberCertPhoneVO.insertCertPhone", mberCertPhoneVO);
|
||||
}
|
||||
|
||||
public void deleteCertPhone(MberCertPhoneVO mberCertPhoneVO) {
|
||||
insert("mberCertPhoneVO.deleteCertPhone", mberCertPhoneVO);
|
||||
}
|
||||
|
||||
public MberCertPhoneVO findByCertPhoneInfo(MberCertPhoneVO mberCertPhoneVO) {
|
||||
return (MberCertPhoneVO) select("mberCertPhoneVO.findByCertPhoneInfo", mberCertPhoneVO);
|
||||
}
|
||||
|
||||
public void updateMberCertPhone(MberCertPhoneVO mberCertPhoneVO) {
|
||||
insert("mberCertPhoneVO.updateMberCertPhone", mberCertPhoneVO);
|
||||
|
||||
}
|
||||
|
||||
public List<MberCertPhoneVO> selectMberCertPhoneListVO(MberCertPhoneVO mberCertPhoneVO) {
|
||||
return (List<MberCertPhoneVO>) list("mberCertPhoneVO.selectMberCertPhoneListVO", mberCertPhoneVO);
|
||||
}
|
||||
|
||||
public int countSysMsgLogCheck(MberCertPhoneVO mberCertPhoneVO) {
|
||||
return (int) select("mberCertPhoneVO.countSysMsgLogCheck", mberCertPhoneVO);
|
||||
}
|
||||
|
||||
public MberCertPhoneVO selectCertUrlCode(MberCertPhoneVO mberCertPhoneVO) {
|
||||
return (MberCertPhoneVO) select("certPhoneDAO.selectCertUrlCode", mberCertPhoneVO);
|
||||
}
|
||||
|
||||
public void insertCertLog(AuthCertVO authCertVO) throws Exception {
|
||||
insert("certPhoneDAO.insertCertLog", authCertVO);
|
||||
}
|
||||
}
|
||||
@ -1,141 +0,0 @@
|
||||
package itn.let.cert.phone.service.impl;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl;
|
||||
import egovframework.rte.fdl.security.userdetails.util.EgovUserDetailsHelper;
|
||||
import itn.com.cmm.LoginVO;
|
||||
import itn.com.cmm.util.IpUtil;
|
||||
import itn.com.utl.fcc.service.EgovStringUtil;
|
||||
import itn.let.cert.phone.service.CertPhoneService;
|
||||
import itn.let.cert.phone.service.MberCertPhoneVO;
|
||||
import itn.let.mail.service.StatusResponse;
|
||||
import itn.let.uat.uia.service.AuthCertVO;
|
||||
|
||||
@Service("CertPhoneService")
|
||||
public class CertPhoneServiceImpl extends EgovAbstractServiceImpl implements CertPhoneService {
|
||||
|
||||
@Resource(name = "CertPhoneDAO")
|
||||
private CertPhoneDAO certPhoneDAO;
|
||||
|
||||
|
||||
@Override
|
||||
public StatusResponse selectMberCertPhoneList(MberCertPhoneVO mberCertPhoneVO) {
|
||||
List<MberCertPhoneVO> mberCertIpListVO = certPhoneDAO.selectMberCertPhoneListVO(mberCertPhoneVO);
|
||||
return new StatusResponse(HttpStatus.OK, mberCertIpListVO, LocalDateTime.now());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public StatusResponse insertCertPhone(MberCertPhoneVO mberCertPhoneVO, String moblphonNo) {
|
||||
System.out.println("findByCertPhoneInfo : :::: ");
|
||||
try {
|
||||
|
||||
MberCertPhoneVO mberCertPhoneListVO = certPhoneDAO.findByCertPhoneInfo(mberCertPhoneVO);
|
||||
if(mberCertPhoneListVO != null) {
|
||||
if(mberCertPhoneListVO.getMbtlnum().equals(moblphonNo)) {
|
||||
return new StatusResponse(HttpStatus.CONFLICT, "중복 번호입니다.", LocalDateTime.now());
|
||||
}
|
||||
}
|
||||
|
||||
certPhoneDAO.insertCertPhone(mberCertPhoneVO);
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace(); // TODO: handle exception
|
||||
return new StatusResponse(HttpStatus.OK, "오류가 발생하였습니다.", LocalDateTime.now());
|
||||
}
|
||||
return new StatusResponse(HttpStatus.OK, "등록 하였습니다.", LocalDateTime.now());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public StatusResponse deleteCertPhone(MberCertPhoneVO mberCertPhoneVO) {
|
||||
certPhoneDAO.deleteCertPhone(mberCertPhoneVO);
|
||||
return new StatusResponse(HttpStatus.OK, "삭제 하였습니다.", LocalDateTime.now());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public StatusResponse findByCertPhoneInfo(MberCertPhoneVO mberCertPhoneVO) {
|
||||
MberCertPhoneVO mberCertIpListVO = certPhoneDAO.findByCertPhoneInfo(mberCertPhoneVO);
|
||||
return new StatusResponse(HttpStatus.OK, mberCertIpListVO, LocalDateTime.now());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<MberCertPhoneVO> selectMberCertPhoneList(String userId) {
|
||||
return certPhoneDAO.selectMberCertPhoneList(userId);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public StatusResponse selectMberCertPhoneListWhereUserId(String userId) {
|
||||
return new StatusResponse(HttpStatus.OK, certPhoneDAO.selectMberCertPhoneList(userId), LocalDateTime.now());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public StatusResponse updateMberCertPhone(MberCertPhoneVO mberCertPhoneVO) {
|
||||
certPhoneDAO.updateMberCertPhone(mberCertPhoneVO);
|
||||
return new StatusResponse(HttpStatus.OK, "수정 하였습니다.", LocalDateTime.now());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public StatusResponse selectSysMsgLogCheck(MberCertPhoneVO mberCertPhoneVO) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
int certCnt = 0;
|
||||
certCnt = certPhoneDAO.countSysMsgLogCheck(mberCertPhoneVO);
|
||||
|
||||
if(certCnt < 1) {
|
||||
return new StatusResponse(HttpStatus.BAD_REQUEST, "[인증번호 불일치] 입력하신 정보를 재확인 해주세요.", LocalDateTime.now());
|
||||
}
|
||||
|
||||
return new StatusResponse(HttpStatus.OK, "", LocalDateTime.now());
|
||||
}
|
||||
|
||||
@Override
|
||||
public MberCertPhoneVO selectCertUrlCode(MberCertPhoneVO mberCertPhoneVO) {
|
||||
return certPhoneDAO.selectCertUrlCode(mberCertPhoneVO);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public StatusResponse insertCertLog(HttpServletRequest request) throws Exception {
|
||||
try {
|
||||
//로그인 권한정보 불러오기
|
||||
LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated()? (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null;
|
||||
String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId());
|
||||
|
||||
//KMC 본인인증 로그 insert
|
||||
AuthCertVO authCertVO = new AuthCertVO();
|
||||
authCertVO.setMberId(userId);
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||
authCertVO.setCertDate(sdf.format(new Date()));
|
||||
authCertVO.setCertType("본인인증 시도");
|
||||
authCertVO.setCertIpaddr(IpUtil.getClientIP(request));
|
||||
|
||||
certPhoneDAO.insertCertLog(authCertVO);
|
||||
} catch (Exception e) {
|
||||
System.out.println("본인인증 시도 로그 실패");
|
||||
}
|
||||
|
||||
return new StatusResponse(HttpStatus.OK, "", LocalDateTime.now());
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -1,239 +0,0 @@
|
||||
package itn.let.cert.phone.web;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import egovframework.rte.fdl.security.userdetails.util.EgovUserDetailsHelper;
|
||||
import itn.com.cmm.LoginVO;
|
||||
import itn.com.utl.fcc.service.EgovStringUtil;
|
||||
import itn.let.cert.phone.service.CertPhoneService;
|
||||
import itn.let.cert.phone.service.MberCertPhoneVO;
|
||||
import itn.let.mail.service.StatusResponse;
|
||||
import itn.let.mjo.msg.service.MjonMsgVO;
|
||||
import itn.let.mjo.msgdata.service.MjonMsgDataService;
|
||||
import itn.let.mjo.msgdata.service.MjonMsgReturnVO;
|
||||
import itn.let.uat.uia.web.SendLogVO;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author : 이호영
|
||||
* @fileName : CertIpController.java
|
||||
* @date : 2024.11.19
|
||||
* @description : 허용 IP 관련 컨트롤러
|
||||
* ===========================================================
|
||||
* DATE AUTHOR NOTE
|
||||
* ----------------------------------------------------------- *
|
||||
* 2024.11.19 이호영 최초 생성
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
@Controller
|
||||
public class CertPhoneController {
|
||||
|
||||
|
||||
/* certPhoneService */
|
||||
@Resource(name = "CertPhoneService")
|
||||
private CertPhoneService certPhoneService;
|
||||
|
||||
@Resource(name = "MjonMsgDataService")
|
||||
private MjonMsgDataService mjonMsgDataService;
|
||||
|
||||
|
||||
|
||||
@RequestMapping(value = {"/cert/phone/selectMberCertPhoneList"})
|
||||
public ResponseEntity<StatusResponse> selectMberCertPhoneList(MberCertPhoneVO mberCertPhoneVO) throws Exception {
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView();
|
||||
modelAndView.setViewName("jsonView");
|
||||
|
||||
//로그인 권한정보 불러오기
|
||||
LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated()? (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null;
|
||||
String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId());
|
||||
|
||||
if(userId == null) {
|
||||
if(StringUtils.isEmpty(userId)) return ResponseEntity.ok().body(new StatusResponse(HttpStatus.BAD_REQUEST, "로그인 후 이용해 주세요", LocalDateTime.now()));
|
||||
}
|
||||
mberCertPhoneVO.setMberId(userId);
|
||||
|
||||
return ResponseEntity.ok().body(certPhoneService.selectMberCertPhoneListWhereUserId(userId));
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/cert/phone/findByCertPhoneInfo.do"})
|
||||
public ResponseEntity<StatusResponse> findByCertPhoneInfo(MberCertPhoneVO mberCertPhoneVO) throws Exception {
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView();
|
||||
modelAndView.setViewName("jsonView");
|
||||
|
||||
//로그인 권한정보 불러오기
|
||||
LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated()? (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null;
|
||||
String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId());
|
||||
|
||||
if(userId == null) {
|
||||
if(StringUtils.isEmpty(userId)) return ResponseEntity.ok().body(new StatusResponse(HttpStatus.BAD_REQUEST, "로그인 후 이용해 주세요", LocalDateTime.now()));
|
||||
}
|
||||
return ResponseEntity.ok().body(certPhoneService.findByCertPhoneInfo(mberCertPhoneVO));
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/cert/phone/insertCertPhone.do"})
|
||||
public ResponseEntity<StatusResponse> insertCertPhone(MberCertPhoneVO mberCertPhoneVO) throws Exception {
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView();
|
||||
modelAndView.setViewName("jsonView");
|
||||
|
||||
|
||||
System.out.println(" :: insertCertPhone :: ");
|
||||
|
||||
//로그인 권한정보 불러오기
|
||||
LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated()? (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null;
|
||||
String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId());
|
||||
|
||||
if(userId == null) {
|
||||
if(StringUtils.isEmpty(userId)) return ResponseEntity.ok().body(new StatusResponse(HttpStatus.BAD_REQUEST, "로그인 후 이용해 주세요", LocalDateTime.now()));
|
||||
}
|
||||
mberCertPhoneVO.setFrstRegisterId(userId);
|
||||
mberCertPhoneVO.setMberId(userId);
|
||||
|
||||
|
||||
return ResponseEntity.ok().body(certPhoneService.insertCertPhone(mberCertPhoneVO, loginVO.getMoblphonNo()));
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/cert/phone/updateCertPhone.do"})
|
||||
public ResponseEntity<StatusResponse> updateCertPhone(MberCertPhoneVO mberCertPhoneVO) throws Exception {
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView();
|
||||
modelAndView.setViewName("jsonView");
|
||||
|
||||
//로그인 권한정보 불러오기
|
||||
LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated()? (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null;
|
||||
String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId());
|
||||
|
||||
if(userId == null) {
|
||||
if(StringUtils.isEmpty(userId)) return ResponseEntity.ok().body(new StatusResponse(HttpStatus.BAD_REQUEST, "로그인 후 이용해 주세요", LocalDateTime.now()));
|
||||
}
|
||||
mberCertPhoneVO.setFrstRegisterId(userId);
|
||||
if(StringUtils.isEmpty(mberCertPhoneVO.getMberId()) ) {
|
||||
mberCertPhoneVO.setMberId(userId);
|
||||
}
|
||||
|
||||
|
||||
return ResponseEntity.ok().body(certPhoneService.updateMberCertPhone(mberCertPhoneVO));
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/cert/phone/deleteCertPhone.do"})
|
||||
public ResponseEntity<StatusResponse> deleteCertPhone(MberCertPhoneVO mberCertPhoneVO) throws Exception {
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView();
|
||||
modelAndView.setViewName("jsonView");
|
||||
|
||||
//로그인 권한정보 불러오기
|
||||
LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated()? (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null;
|
||||
String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId());
|
||||
|
||||
if(userId == null) {
|
||||
if(StringUtils.isEmpty(userId)) return ResponseEntity.ok().body(new StatusResponse(HttpStatus.BAD_REQUEST, "로그인 후 이용해 주세요", LocalDateTime.now()));
|
||||
}
|
||||
mberCertPhoneVO.setLastUpdusrId(userId);
|
||||
|
||||
if(StringUtils.isEmpty(mberCertPhoneVO.getMberId()) ) {
|
||||
mberCertPhoneVO.setMberId(userId);
|
||||
}
|
||||
|
||||
|
||||
return ResponseEntity.ok().body(certPhoneService.deleteCertPhone(mberCertPhoneVO));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@RequestMapping(value = {"/cert/phone/sendSysMsgDataAjax.do"})
|
||||
public ResponseEntity<StatusResponse> sendSysMsgDataAjax(MberCertPhoneVO mberCertPhoneVO,
|
||||
HttpServletRequest request) throws Exception {
|
||||
|
||||
|
||||
//로그인 권한정보 불러오기
|
||||
LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated()? (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null;
|
||||
String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId());
|
||||
|
||||
if(userId == null) {
|
||||
if(StringUtils.isEmpty(userId)) return ResponseEntity.ok().body(new StatusResponse(HttpStatus.BAD_REQUEST, "로그인 후 이용해 주세요", LocalDateTime.now()));
|
||||
}
|
||||
mberCertPhoneVO.setMberId(userId);
|
||||
|
||||
// 번호 중복 확인
|
||||
MberCertPhoneVO mberCertIpListVO = (MberCertPhoneVO) certPhoneService.findByCertPhoneInfo(mberCertPhoneVO).getObject();
|
||||
if(mberCertIpListVO != null || loginVO.getMoblphonNo().equals(mberCertPhoneVO.getMbtlnum()) ) {
|
||||
return ResponseEntity.ok().body(new StatusResponse(HttpStatus.CONFLICT, "등록된 번호입니다.", LocalDateTime.now()));
|
||||
}
|
||||
|
||||
MjonMsgVO mjonMsgVO = new MjonMsgVO();
|
||||
mjonMsgVO.setCallTo(mberCertPhoneVO.getMbtlnum());
|
||||
MjonMsgReturnVO returnVO = mjonMsgDataService.sendSysMsgData(mjonMsgVO, request);
|
||||
|
||||
String resultSts = returnVO.getSendMsgCnt();
|
||||
String resultBlockSts = returnVO.getSendMsgBlockCnt();
|
||||
|
||||
String msg= "";
|
||||
Map<String, String> returnMap = new HashMap<>();
|
||||
HttpStatus httpStatus = null;
|
||||
if (!resultSts.equals("0")) {
|
||||
|
||||
httpStatus = HttpStatus.OK;
|
||||
returnMap.put("msg", "문자 전송이 완료되었습니다.");
|
||||
returnMap.put("resultSts", resultSts);
|
||||
returnMap.put("resultBlockSts", resultBlockSts);
|
||||
|
||||
} else {
|
||||
|
||||
httpStatus = HttpStatus.BAD_REQUEST;
|
||||
returnMap.put("msg", "문자 전송에 오류가 발생하였습니다.");
|
||||
returnMap.put("resultSts", "0");
|
||||
returnMap.put("resultBlockSts", "0");
|
||||
|
||||
}
|
||||
return ResponseEntity.ok().body(new StatusResponse(httpStatus, returnMap, LocalDateTime.now()));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@RequestMapping(value = {"/cert/phone/selectSysMsgLogCheck.do"})
|
||||
public ResponseEntity<StatusResponse> selectSysMsgLogCheck(MberCertPhoneVO mberCertPhoneVO) throws Exception {
|
||||
|
||||
//로그인 권한정보 불러오기
|
||||
LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated()? (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null;
|
||||
String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId());
|
||||
|
||||
if(userId == null) {
|
||||
if(StringUtils.isEmpty(userId)) return ResponseEntity.ok().body(new StatusResponse(HttpStatus.BAD_REQUEST, "로그인 후 이용해 주세요", LocalDateTime.now()));
|
||||
}
|
||||
mberCertPhoneVO.setMberId(userId);
|
||||
//
|
||||
return ResponseEntity.ok().body(certPhoneService.selectSysMsgLogCheck(mberCertPhoneVO));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -1,44 +0,0 @@
|
||||
package itn.let.cert.phone.web;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import egovframework.rte.fdl.security.userdetails.util.EgovUserDetailsHelper;
|
||||
import itn.com.cmm.LoginVO;
|
||||
import itn.com.utl.fcc.service.EgovStringUtil;
|
||||
import itn.let.cert.phone.service.CertPhoneService;
|
||||
import itn.let.cert.phone.service.MberCertPhoneVO;
|
||||
import itn.let.mail.service.StatusResponse;
|
||||
import itn.let.mjo.msg.service.MjonMsgVO;
|
||||
import itn.let.mjo.msgdata.service.MjonMsgDataService;
|
||||
import itn.let.mjo.msgdata.service.MjonMsgReturnVO;
|
||||
import itn.let.uat.uia.service.AuthCertVO;
|
||||
import itn.let.uat.uia.web.SendLogVO;
|
||||
|
||||
@Controller
|
||||
public class CertPhoneWebController {
|
||||
|
||||
@Resource(name = "CertPhoneService")
|
||||
private CertPhoneService certPhoneService;
|
||||
|
||||
@RequestMapping(value = {"/web/cert/log/insertCertLog.do"})
|
||||
public ResponseEntity<StatusResponse> insertCertLog(HttpServletRequest request) throws Exception {
|
||||
return ResponseEntity.ok().body(new StatusResponse(HttpStatus.OK, certPhoneService.insertCertLog(request), LocalDateTime.now()));
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/web/cert/log/kmcErrorPage.do"})
|
||||
public String kmcErrorPage() throws Exception {
|
||||
return "web/cop/kmc/certResultError";
|
||||
}
|
||||
}
|
||||
@ -1,32 +0,0 @@
|
||||
package itn.let.cmm.vo;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author : 이호영
|
||||
* @fileName : FileInfoVO.java
|
||||
* @date : 2025.01.17
|
||||
* @description : 파일 풀 경로에서 파일명만 가져와 ID 가져올때 사용하는 VO
|
||||
* MjonMsgDetailSentVO 참고
|
||||
* ===========================================================
|
||||
* DATE AUTHOR NOTE
|
||||
* ----------------------------------------------------------- *
|
||||
* 2025.01.17 이호영 최초 생성
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
public class FileInfoVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String atchFileId; // 첨부파일 ID
|
||||
private String fileSn; // 파일 순번
|
||||
|
||||
}
|
||||
@ -4656,126 +4656,78 @@ public class EgovBBSManageController {
|
||||
@ModelAttribute("searchVO") TermsVO termsVO, ModelMap model ,
|
||||
RedirectAttributes redirectAttributes) throws Exception {
|
||||
|
||||
String menuNm = termsVO.getMenuNm();
|
||||
String termsMstNo = termsVO.getTermsMastNo();
|
||||
|
||||
// String effectDate_02 = "";
|
||||
// String effectDate_03 = "";
|
||||
|
||||
//초기 화면 로딩시 값이 Null 인경우 이용약관, 2024년 도 정보 불러오도록 셋팅
|
||||
if(menuNm == null) {
|
||||
menuNm = "02";
|
||||
}
|
||||
if(termsMstNo == null) {
|
||||
termsMstNo = "2023";
|
||||
}
|
||||
|
||||
// if(termsMstNo.equals("2024")) {
|
||||
// effectDate_02 = " v2.0";
|
||||
// effectDate_03 = " v2.0";
|
||||
// }else if(termsMstNo.equals("2023")) {
|
||||
// effectDate_02 = "(2023.04.26~2024.10.31)";
|
||||
// effectDate_03 = "(2023.12.15~2024.10.31)";
|
||||
// }else if(termsMstNo.equals("2022")) {
|
||||
// effectDate_02 = "(2022.08.01~2023.04.25)";
|
||||
// effectDate_03 = "(2022.08.01~2023.12.14)";
|
||||
// }
|
||||
|
||||
// model.addAttribute("effectDate_02", effectDate_02); //이용약관 개정 일자 표시
|
||||
// model.addAttribute("effectDate_03", effectDate_03); //개인정보처리방침 개정 일자 표시
|
||||
model.addAttribute("termsMstNo", termsMstNo); //요청 버전 값(2024, 2023, 2022 등)
|
||||
|
||||
//상세 하단 리스트
|
||||
if(request.getRequestURI().contains("ListAjax.do")) {
|
||||
|
||||
if(menuNm.equals("02")) {
|
||||
String jspName = "TermsListAgreement_" + termsMstNo + "_Ajax";
|
||||
return "web/cop/bbs/"+jspName;
|
||||
|
||||
}else if(menuNm.equals("03")) {
|
||||
String jspName = "TermsListPrivate_" + termsMstNo + "_Ajax";
|
||||
return "web/cop/bbs/"+jspName;
|
||||
}
|
||||
|
||||
|
||||
// 공통
|
||||
List<TermsVO> resultList = new ArrayList<TermsVO>();
|
||||
List<TermsVO> resultList = new ArrayList<TermsVO>();
|
||||
|
||||
/*
|
||||
* 이용약관 및 개인정보 처리방침 화면은 HTML 화면으로 전환되어 디비 조회 코드는 주석 처리함
|
||||
* 2024 10 25 우영두 수정
|
||||
* */
|
||||
// 이용약관, 개인정보보호방침 이전버전 List
|
||||
TermsVO termsVO2 = new TermsVO();
|
||||
termsVO2.setFirstIndex(0);
|
||||
termsVO2.setRecordCountPerPage(20);
|
||||
termsVO2.setSearchDiv(termsVO.getMenuNm());
|
||||
termsVO2.setSearchUseYn("N");
|
||||
termsVO2.setSearchSortCnd("effectDate");
|
||||
termsVO2.setSearchSortOrd("desc");
|
||||
List<TermsVO> termsMastList = egovSiteManagerService.selectTermsMastMngBeforeList(termsVO2);
|
||||
model.addAttribute("termsMastList", termsMastList);
|
||||
|
||||
// // 이용약관, 개인정보보호방침 이전버전 List
|
||||
// TermsVO termsVO2 = new TermsVO();
|
||||
// termsVO2.setFirstIndex(0);
|
||||
// termsVO2.setRecordCountPerPage(20);
|
||||
// termsVO2.setSearchDiv(termsVO.getMenuNm());
|
||||
// termsVO2.setSearchUseYn("N");
|
||||
// termsVO2.setSearchSortCnd("effectDate");
|
||||
// termsVO2.setSearchSortOrd("desc");
|
||||
// List<TermsVO> termsMastList = egovSiteManagerService.selectTermsMastMngBeforeList(termsVO2);
|
||||
// model.addAttribute("termsMastList", termsMastList);
|
||||
//
|
||||
// // NEW
|
||||
// // 이용약관, 개인정보보호방침 최신버전 List
|
||||
// TermsVO termsVO3 = new TermsVO();
|
||||
// termsVO3.setFirstIndex(0);
|
||||
// termsVO3.setRecordCountPerPage(1);
|
||||
// termsVO3.setSearchDiv(termsVO.getMenuNm());
|
||||
// termsVO3.setSearchUseYn("Y");
|
||||
// termsVO3.setSearchSortCnd("effectDate");
|
||||
// termsVO3.setSearchSortOrd("desc");
|
||||
// List<TermsVO> termsMastList2 = egovSiteManagerService.selectTermsMastMngList(termsVO3);
|
||||
// if (termsMastList2.size() > 0) {
|
||||
// TermsVO termsVO4 = new TermsVO();
|
||||
// termsVO4.setFirstIndex(0);
|
||||
// termsVO4.setRecordCountPerPage(20);
|
||||
// termsVO4.setTermsMastNo(termsMastList2.get(0).getTermsMastNo());
|
||||
// termsVO4.setSearchUseYn("Y");
|
||||
// termsVO4.setSearchSortCnd("sort");
|
||||
// termsVO4.setSearchSortOrd("ASC");
|
||||
// resultList = egovSiteManagerService.selectTermsSubMngList(termsVO4);
|
||||
// }
|
||||
// NEW
|
||||
// 이용약관, 개인정보보호방침 최신버전 List
|
||||
TermsVO termsVO3 = new TermsVO();
|
||||
termsVO3.setFirstIndex(0);
|
||||
termsVO3.setRecordCountPerPage(1);
|
||||
termsVO3.setSearchDiv(termsVO.getMenuNm());
|
||||
termsVO3.setSearchUseYn("Y");
|
||||
termsVO3.setSearchSortCnd("effectDate");
|
||||
termsVO3.setSearchSortOrd("desc");
|
||||
List<TermsVO> termsMastList2 = egovSiteManagerService.selectTermsMastMngList(termsVO3);
|
||||
if (termsMastList2.size() > 0) {
|
||||
TermsVO termsVO4 = new TermsVO();
|
||||
termsVO4.setFirstIndex(0);
|
||||
termsVO4.setRecordCountPerPage(20);
|
||||
termsVO4.setTermsMastNo(termsMastList2.get(0).getTermsMastNo());
|
||||
termsVO4.setSearchUseYn("Y");
|
||||
termsVO4.setSearchSortCnd("sort");
|
||||
termsVO4.setSearchSortOrd("ASC");
|
||||
resultList = egovSiteManagerService.selectTermsSubMngList(termsVO4);
|
||||
}
|
||||
|
||||
// 불법스팸방지안내
|
||||
if (termsVO.getMenuNm().equals("04")) {
|
||||
|
||||
if("2023".equals(termsMstNo)) {
|
||||
termsVO.setSearchSortCnd("TERMS_ID");
|
||||
termsVO.setSearchSortOrd("ASC");
|
||||
resultList = egovSiteManagerService.selectTermsMenu(termsVO);
|
||||
model.addAttribute("resultList", resultList);
|
||||
}
|
||||
|
||||
String jspName = "TermsListSpam_" + termsMstNo + "_Ajax";
|
||||
return "web/cop/bbs/"+jspName;
|
||||
|
||||
termsVO.setSearchSortCnd("TERMS_ID");
|
||||
termsVO.setSearchSortOrd("ASC");
|
||||
resultList = egovSiteManagerService.selectTermsMenu(termsVO);
|
||||
}
|
||||
|
||||
model.addAttribute("resultList", resultList);
|
||||
|
||||
return "web/cop/bbs/TermsListAjax";
|
||||
}
|
||||
// else {
|
||||
// String effectDate_02 = "";
|
||||
// String effectDate_03 = "";
|
||||
// TermsVO termsVO7 = new TermsVO();
|
||||
// termsVO7.setFirstIndex(0);
|
||||
// termsVO7.setRecordCountPerPage(2);
|
||||
// termsVO7.setSearchUseYn("Y");
|
||||
// termsVO7.setSearchSortCnd("effectDate");
|
||||
// termsVO7.setSearchSortOrd("desc");
|
||||
// List<TermsVO> termsMastList7 = egovSiteManagerService.selectTermsMastMngList(termsVO7);
|
||||
// for(TermsVO item : termsMastList7) {
|
||||
// if (item.getTermsDivCode().equals("02")) {
|
||||
// effectDate_02 = "(" + item.getEffectDate() + ")";
|
||||
// }
|
||||
// if (item.getTermsDivCode().equals("03")) {
|
||||
//
|
||||
// effectDate_03 = "(" + item.getEffectDate() + ")";
|
||||
// }
|
||||
// }
|
||||
else {
|
||||
String effectDate_02 = "";
|
||||
String effectDate_03 = "";
|
||||
TermsVO termsVO7 = new TermsVO();
|
||||
termsVO7.setFirstIndex(0);
|
||||
termsVO7.setRecordCountPerPage(2);
|
||||
termsVO7.setSearchUseYn("Y");
|
||||
termsVO7.setSearchSortCnd("effectDate");
|
||||
termsVO7.setSearchSortOrd("desc");
|
||||
List<TermsVO> termsMastList7 = egovSiteManagerService.selectTermsMastMngList(termsVO7);
|
||||
for(TermsVO item : termsMastList7) {
|
||||
if (item.getTermsDivCode().equals("02")) {
|
||||
effectDate_02 = "(" + item.getEffectDate() + ")";
|
||||
}
|
||||
if (item.getTermsDivCode().equals("03")) {
|
||||
effectDate_03 = "(" + item.getEffectDate() + ")";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// model.addAttribute("effectDate_02", effectDate_02);
|
||||
// model.addAttribute("effectDate_03", effectDate_03);
|
||||
// }
|
||||
model.addAttribute("effectDate_02", effectDate_02);
|
||||
model.addAttribute("effectDate_03", effectDate_03);
|
||||
}
|
||||
|
||||
return "web/cop/bbs/TermsList";
|
||||
}
|
||||
@ -4818,7 +4770,7 @@ public class EgovBBSManageController {
|
||||
|
||||
try {
|
||||
// 이용약관 회원 전체발송
|
||||
mjonNoticeSendUtil.userAllTermsEmailSend();
|
||||
//mjonNoticeSendUtil.userAllTermsEmailSend();
|
||||
}
|
||||
catch(Exception e) {
|
||||
isSuccess = false;
|
||||
|
||||
@ -2,8 +2,6 @@ package itn.let.fax.addr.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import itn.let.mail.service.StatusResponse;
|
||||
import itn.let.mjo.addr.service.AddrGroupVO;
|
||||
import itn.let.mjo.addr.service.AddrVO;
|
||||
|
||||
public interface FaxAddrService {
|
||||
@ -92,11 +90,4 @@ public interface FaxAddrService {
|
||||
|
||||
List<FaxAddrVO> selectFaxAddrListAjax(FaxAddrVO faxAddrVO);
|
||||
|
||||
public StatusResponse faxAddrMassInsertByTempAjax_advc(List<FaxAddrVO> faxAddrListVO, String userId) throws Exception;
|
||||
|
||||
void deleteFaxAddr_advc(FaxAddrGroupVO faxAddrGroupVO) throws Exception;
|
||||
|
||||
int getFaxAddrCount(FaxAddrGroupVO faxAddrGroupVO) throws Exception;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -35,11 +35,6 @@ public class FaxAddrVO extends ComDefaultVO{
|
||||
|
||||
private String[] excelDownTitles;
|
||||
|
||||
// 주소록 등록 batch 몇번째인지 확인
|
||||
private int batchStart;
|
||||
//
|
||||
private int dataTotCount;
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
private List addrIdList;
|
||||
|
||||
@ -291,24 +286,6 @@ public class FaxAddrVO extends ComDefaultVO{
|
||||
public void setMoveAddrAllFlag(String moveAddrAllFlag) {
|
||||
this.moveAddrAllFlag = moveAddrAllFlag;
|
||||
}
|
||||
|
||||
|
||||
public int getBatchStart() {
|
||||
return batchStart;
|
||||
}
|
||||
|
||||
public void setBatchStart(int batchStart) {
|
||||
this.batchStart = batchStart;
|
||||
}
|
||||
|
||||
|
||||
public int getDataTotCount() {
|
||||
return dataTotCount;
|
||||
}
|
||||
|
||||
public void setDataTotCount(int dataTotCount) {
|
||||
this.dataTotCount = dataTotCount;
|
||||
}
|
||||
|
||||
public String getFieldValue(String field) {
|
||||
if("addrPhoneNo".equals(field)) {
|
||||
|
||||
@ -90,9 +90,4 @@ public class FaxAddrGroupDAO extends EgovAbstractDAO{
|
||||
public int selectMaxOrderFaxNumber(FaxAddrGroupVO addrGroupVO) throws Exception{
|
||||
return (Integer)select("FaxAddrGroupDAO.selectMaxOrderFaxNumber", addrGroupVO);
|
||||
}
|
||||
|
||||
public void deleteFaxAddrGroup_advc(FaxAddrGroupVO addrGroupVO) {
|
||||
update("FaxAddrGroupDAO.deleteFaxAddrGroup_advc", addrGroupVO);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,19 +1,12 @@
|
||||
package itn.let.fax.addr.service.impl;
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl;
|
||||
@ -24,11 +17,8 @@ import itn.let.fax.addr.service.FaxAddrGroupVO;
|
||||
import itn.let.fax.addr.service.FaxAddrService;
|
||||
import itn.let.fax.addr.service.FaxAddrTransHistVO;
|
||||
import itn.let.fax.addr.service.FaxAddrVO;
|
||||
import itn.let.mail.service.StatusResponse;
|
||||
import itn.let.mjo.addr.service.AddrVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@Slf4j
|
||||
@Service("FaxAddrService")
|
||||
public class FaxAddrServiceImpl extends EgovAbstractServiceImpl implements FaxAddrService{
|
||||
|
||||
@ -45,15 +35,6 @@ public class FaxAddrServiceImpl extends EgovAbstractServiceImpl implements FaxAd
|
||||
@Resource(name = "egovAddrTransHistIdGnrService")
|
||||
private EgovIdGnrService idgenAddrTransHistId;
|
||||
|
||||
|
||||
private static final String FAX_REGEX = "^(02\\d|03[1-3]|04[1-4]|05[1-5]|06[1-4]|030|050|060|070|080|1\\d{2})$";
|
||||
|
||||
private static final Pattern FAX_PATTERN = Pattern.compile(FAX_REGEX);
|
||||
|
||||
private static final Charset EUC_KR = Charset.forName("EUC-KR");
|
||||
|
||||
private static final int MAX_SINGLE_ENTRY_CNT = 300000;
|
||||
private static final int MAX_FAX_ADDR_CNT = 1000000; // 팩스 주소록 등록 최대 수량
|
||||
|
||||
public List<FaxAddrVO> selectFaxAddrList(FaxAddrVO addrVO) throws Exception {
|
||||
return faxAddrDAO.selectFaxAddrList(addrVO);
|
||||
@ -377,194 +358,5 @@ public class FaxAddrServiceImpl extends EgovAbstractServiceImpl implements FaxAd
|
||||
public List<FaxAddrVO> selectFaxAddrListAjax(FaxAddrVO faxAddrVO) {
|
||||
return faxAddrDAO.selectFaxAddrListAjax(faxAddrVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public StatusResponse faxAddrMassInsertByTempAjax_advc(List<FaxAddrVO> faxAddrListVO, String userId) throws Exception {
|
||||
|
||||
for (FaxAddrVO faxAddr : faxAddrListVO) { faxAddr.setMberId(userId); }
|
||||
|
||||
if(faxAddrListVO.size() > MAX_SINGLE_ENTRY_CNT) {
|
||||
return new StatusResponse(
|
||||
HttpStatus.BAD_REQUEST
|
||||
, "주소록은 한번에 30만개까지만 등록이 가능합니다."
|
||||
, LocalDateTime.now()
|
||||
);
|
||||
}
|
||||
|
||||
// step1 현재 주소록 갯수 조회
|
||||
// 배치 처음 돌때만 실행
|
||||
if(faxAddrListVO.get(0).getBatchStart() < 1) {
|
||||
|
||||
// step1-1 회원별 주소록 전체 갯수 조회
|
||||
int faxAddrBefCnt = faxAddrDAO.selectFaxAddrTotalCount(faxAddrListVO.get(0));
|
||||
int faxAddrNewCnt = faxAddrListVO.get(0).getDataTotCount(); //신규 추가할 주소록 갯수
|
||||
int sumFaxAddrCnt = faxAddrBefCnt + faxAddrNewCnt;
|
||||
|
||||
System.out.println("faxAddrListVO.size() : "+ faxAddrListVO.size());
|
||||
|
||||
// step1-2 총 갯수가 (주소록 갯수 + 신규 주소록)1000만건 체크
|
||||
if(sumFaxAddrCnt > MAX_FAX_ADDR_CNT) {
|
||||
return new StatusResponse(
|
||||
HttpStatus.BAD_REQUEST
|
||||
, "주소록은 총 100만개까지만 등록이 가능합니다."
|
||||
, LocalDateTime.now()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// step3
|
||||
// => 팩스번호 빼고 바이트 체크해서 20byte만 짜르고 넣기
|
||||
// => 팩스번호는 유효성 체크 하기
|
||||
long startTime = System.currentTimeMillis();
|
||||
|
||||
// 유효성 체크 및 하이픈 제거, 유효하지 않은 번호는 리스트에서 제거
|
||||
// 나머지 필드들 20byte (euc-kr) 체크 후 넘으면 자르기
|
||||
AtomicInteger invalid = new AtomicInteger(0); // 스레드-안전(thread-safe)하게 정수 값을 업데이트할 수 있는 기능을 제공
|
||||
|
||||
// log.info(" ++ before faxAddrListVO.size() :: [{}]", faxAddrListVO.size());
|
||||
|
||||
/*faxAddrListVO.removeIf(faxAddr -> {
|
||||
String phoneNo = faxAddr.getAddrPhoneNo().replaceAll("[^0-9]", "");
|
||||
if (isValidFaxNumber(phoneNo)) {
|
||||
faxAddr.setAddrPhoneNo(phoneNo); // 하이픈이 제거된 유효한 번호 설정
|
||||
trimFieldsBytes(faxAddr); // 다른 필드들에 대한 20바이트 체크 및 자르기
|
||||
return false; // 유효한 번호는 제거하지 않음
|
||||
} else{
|
||||
System.out.println(" + else phoneNo : "+ phoneNo);
|
||||
invalid.getAndIncrement(); // 유효하지 않은 번호 개수 증가
|
||||
return true; // 유효하지 않은 번호는 제거
|
||||
}
|
||||
});*/
|
||||
// log.info(" ++ after faxAddrListVO.size() :: [{}]", faxAddrListVO.size());
|
||||
|
||||
long endTime = System.currentTimeMillis();
|
||||
double executionTime = (endTime - startTime) / 1000.0;
|
||||
System.out.println(" number chk Execution time: " + executionTime + " seconds");
|
||||
|
||||
startTime = System.currentTimeMillis();
|
||||
System.out.println("addrListVO.size() : "+ faxAddrListVO.size());
|
||||
|
||||
try {
|
||||
if(faxAddrListVO.size() > 0) {
|
||||
|
||||
|
||||
|
||||
// step2 신규 주소록 생성 및 북마크 체크
|
||||
if ("NEW".equals(faxAddrListVO.get(0).getAddrGrpId())) {
|
||||
FaxAddrGroupVO faxAddrGroupVO = new FaxAddrGroupVO();
|
||||
faxAddrGroupVO.setMberId(userId);
|
||||
faxAddrGroupVO.setAddrGrpNm(faxAddrListVO.get(0).getAddrGrpNm());
|
||||
|
||||
// 정렬순서
|
||||
int nextOrderNumber = faxAddrGroupDAO.selectMaxOrderFaxNumber(faxAddrGroupVO);
|
||||
faxAddrGroupVO.setGrpOrder(nextOrderNumber);
|
||||
|
||||
faxAddrGroupDAO.insertFaxAddrGroup(faxAddrGroupVO);
|
||||
|
||||
// 신규 추가한 그룹아이디
|
||||
for (FaxAddrVO faxAddr : faxAddrListVO) { faxAddr.setAddrGrpId(faxAddrGroupVO.getAddrGrpId()); }
|
||||
}else if ("bookmark".equals(faxAddrListVO.get(0).getAddrGrpId())) {
|
||||
for (FaxAddrVO faxAddr : faxAddrListVO) {
|
||||
faxAddr.setBookmark("Y");
|
||||
faxAddr.setAddrGrpId("0");
|
||||
}
|
||||
}else {
|
||||
for (FaxAddrVO faxAddr : faxAddrListVO) { faxAddr.setBookmark("N"); }
|
||||
}
|
||||
|
||||
|
||||
// 등록
|
||||
faxAddrDAO.insertFaxAddrList(faxAddrListVO);
|
||||
}else {
|
||||
|
||||
return new StatusResponse(
|
||||
HttpStatus.BAD_REQUEST
|
||||
, "오류가 발생하였습니다."
|
||||
, ""
|
||||
);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
// TODO: handle exception
|
||||
e.printStackTrace();
|
||||
return new StatusResponse(
|
||||
HttpStatus.BAD_REQUEST
|
||||
, "배치오류"
|
||||
, LocalDateTime.now()
|
||||
);
|
||||
}
|
||||
endTime = System.currentTimeMillis();
|
||||
executionTime = (endTime - startTime) / 1000.0;
|
||||
System.out.println("INSERT Execution time: " + executionTime + " seconds");
|
||||
|
||||
|
||||
// 현재 시간 가져오기
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
|
||||
// 원하는 포맷 설정
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
// 포맷된 시간 문자열로 변환
|
||||
String formattedDateTime = now.format(formatter);
|
||||
|
||||
// 출력
|
||||
System.out.println(formattedDateTime);
|
||||
|
||||
|
||||
System.out.println("faxAddrListVO.size() : "+ faxAddrListVO.size());
|
||||
|
||||
|
||||
String message = "저장에 성공했습니다.\n저장 : " + faxAddrListVO.size() + "건"
|
||||
+", INERT 총 시간 : " + executionTime+ "초"
|
||||
+", 현재시간 : " + formattedDateTime;
|
||||
System.out.println("++ message : "+ message);
|
||||
return new StatusResponse(
|
||||
HttpStatus.OK
|
||||
, message
|
||||
, faxAddrListVO.get(0).getAddrGrpId()
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteFaxAddr_advc(FaxAddrGroupVO faxAddrGroupVO) throws Exception {
|
||||
faxAddrGroupDAO.deleteFaxAddrGroup_advc(faxAddrGroupVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFaxAddrCount(FaxAddrGroupVO faxAddrGroupVO) throws Exception {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static boolean isValidFaxNumber(String faxNo) {
|
||||
if (faxNo == null || faxNo.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
// 앞 3자리 추출
|
||||
String subNumber = faxNo.substring(0, 3);
|
||||
Matcher matcher = FAX_PATTERN.matcher(subNumber);
|
||||
return matcher.matches();
|
||||
}
|
||||
|
||||
|
||||
public static void trimFieldsBytes(FaxAddrVO faxAddr) {
|
||||
faxAddr.setAddrNm(trimToBytes(faxAddr.getAddrNm(), 20));
|
||||
faxAddr.setAddrComment(trimToBytes(faxAddr.getAddrComment(), 250));
|
||||
}
|
||||
|
||||
// maxBytes만큼 글자수 처리해서 리턴
|
||||
public static String trimToBytes(String str, int maxBytes) {
|
||||
if (str == null) {
|
||||
return null;
|
||||
}
|
||||
byte[] bytes = str.getBytes(EUC_KR);
|
||||
if (bytes.length <= maxBytes) {
|
||||
return str;
|
||||
}
|
||||
int len = maxBytes;
|
||||
while (len > 0 && bytes[len - 1] < 0) {
|
||||
len--; // 바이트 배열을 maxBytes로 자를 때, 잘못된 분할을 피하기 위해 문자 경계 확인
|
||||
}
|
||||
return new String(bytes, 0, len, EUC_KR);
|
||||
}
|
||||
}
|
||||
|
||||
@ -14,7 +14,6 @@ import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.hssf.usermodel.HSSFCell;
|
||||
import org.apache.poi.hssf.usermodel.HSSFRow;
|
||||
import org.apache.poi.hssf.usermodel.HSSFSheet;
|
||||
@ -158,7 +157,6 @@ public class FaxAddrController {
|
||||
try {
|
||||
|
||||
List<FaxAddrVO> resultAddrList = faxAddrService.selectFaxAddrListAjax(faxAddrVO);
|
||||
System.out.println("resultAddrList.size() :: "+ resultAddrList.size());
|
||||
|
||||
modelAndView.addObject("resultAddrList", resultAddrList);
|
||||
modelAndView.addObject("result", "success");
|
||||
@ -208,14 +206,11 @@ public class FaxAddrController {
|
||||
|
||||
if("".equals(addrVO.getSearchSortCnd())){ //최초조회시 최신것 조회List
|
||||
addrVO.setSearchSortCnd("addrId");
|
||||
addrVO.setSearchSortOrd("asc");
|
||||
}
|
||||
List<FaxAddrVO> addrList = new ArrayList();
|
||||
if(StringUtils.isNotEmpty(addrVO.getSearchAddrGrpId())) {
|
||||
addrList = faxAddrService.selectFaxAddrList(addrVO);
|
||||
|
||||
addrVO.setSearchSortOrd("desc");
|
||||
}
|
||||
|
||||
List<FaxAddrVO> addrList = faxAddrService.selectFaxAddrList(addrVO);
|
||||
|
||||
int totCnt = 0;
|
||||
if(addrList.size() > 0) {
|
||||
totCnt = addrList.get(0).getTotcnt();
|
||||
@ -268,7 +263,7 @@ public class FaxAddrController {
|
||||
|
||||
if("".equals(addrVO.getSearchSortCnd())){ //최초조회시 최신것 조회List
|
||||
addrVO.setSearchSortCnd("addrId");
|
||||
addrVO.setSearchSortOrd("asc");
|
||||
addrVO.setSearchSortOrd("desc");
|
||||
}
|
||||
|
||||
List<FaxAddrVO> addrDupliList = faxAddrService.selectFaxAddrDupliListByAll(addrVO);
|
||||
@ -861,7 +856,7 @@ public class FaxAddrController {
|
||||
|
||||
if("".equals(addrVO.getSearchSortCnd())){ //최초조회시 최신것 조회List
|
||||
addrVO.setSearchSortCnd("addrId");
|
||||
addrVO.setSearchSortOrd("asc");
|
||||
addrVO.setSearchSortOrd("desc");
|
||||
}
|
||||
|
||||
LoginVO loginVO = (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser();
|
||||
@ -1666,7 +1661,7 @@ public class FaxAddrController {
|
||||
List<FaxAddrGroupVO> addrGroupList = faxAddrGroupService.selectFaxAddrGroupList(faxaddrGroupVO);
|
||||
|
||||
//회원별 주소록 전체 갯수 조회
|
||||
// int addrTotalCount = faxAddrService.selectFaxAddrTotalCount(faxaddrVO);
|
||||
int addrTotalCount = faxAddrService.selectFaxAddrTotalCount(faxaddrVO);
|
||||
|
||||
faxaddrVO.setType("bookmark");
|
||||
List<FaxAddrVO> addrBookmarkList = faxAddrService.selectFaxAddrBasicGrpList(faxaddrVO);
|
||||
@ -1674,30 +1669,6 @@ public class FaxAddrController {
|
||||
faxaddrVO.setType("noGrp");
|
||||
List<FaxAddrVO> addrNoGrpList = faxAddrService.selectFaxAddrBasicGrpList(faxaddrVO);
|
||||
|
||||
|
||||
|
||||
int totalGrpCount = addrGroupList.stream()
|
||||
.mapToInt(group -> {
|
||||
String grpCountStr = group.getGrpCount();
|
||||
if (grpCountStr != null && !grpCountStr.isEmpty()) {
|
||||
try {
|
||||
return Integer.parseInt(grpCountStr);
|
||||
} catch (NumberFormatException e) {
|
||||
// 파싱에 실패한 경우 0을 반환하거나 예외 처리를 합니다.
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
})
|
||||
.sum();
|
||||
|
||||
int addrTotalCount = (addrNoGrpList.size() >0 ? addrNoGrpList.get(0).getTotcnt() : 0)
|
||||
+ (addrBookmarkList.size() >0 ? addrBookmarkList.get(0).getTotcnt() : 0)
|
||||
+ totalGrpCount
|
||||
;
|
||||
|
||||
|
||||
model.addAttribute("addrTotalCount", addrTotalCount);
|
||||
model.addAttribute("addrGroupList", addrGroupList);
|
||||
model.addAttribute("addrBookmarkList", addrBookmarkList);
|
||||
|
||||
@ -21,7 +21,6 @@ import egovframework.rte.fdl.security.userdetails.util.EgovUserDetailsHelper;
|
||||
import itn.com.cmm.EgovMessageSource;
|
||||
import itn.com.cmm.LoginVO;
|
||||
import itn.com.utl.fcc.service.EgovStringUtil;
|
||||
import itn.let.cert.phone.service.MberCertPhoneVO;
|
||||
import itn.let.fax.addr.service.FaxAddrGroupService;
|
||||
import itn.let.fax.addr.service.FaxAddrGroupVO;
|
||||
import itn.let.fax.addr.service.FaxAddrService;
|
||||
@ -53,9 +52,6 @@ public class FaxAddrGroupController {
|
||||
@Resource(name = "mberManageService")
|
||||
private EgovMberManageService mberManageService;
|
||||
|
||||
@Resource(name = "KmcCertChecker")
|
||||
private KmcCertChecker kmcCertCheck;
|
||||
|
||||
|
||||
/**
|
||||
* 팩스 주소록 그룹 리스트
|
||||
@ -93,36 +89,15 @@ public class FaxAddrGroupController {
|
||||
addrGroupVO.setSiteId("web");
|
||||
List<FaxAddrGroupVO> addrGroupList = faxAddrGroupService.selectFaxAddrGroupList(addrGroupVO);
|
||||
|
||||
// //회원별 주소록 전체 갯수 조회
|
||||
// int addrTotalCount = faxAddrService.selectFaxAddrTotalCount(addrVO);
|
||||
//회원별 주소록 전체 갯수 조회
|
||||
int addrTotalCount = faxAddrService.selectFaxAddrTotalCount(addrVO);
|
||||
|
||||
addrVO.setType("bookmark");
|
||||
List<FaxAddrVO> addrBookmarkList = faxAddrService.selectFaxAddrBasicGrpList(addrVO);
|
||||
|
||||
addrVO.setType("noGrp");
|
||||
List<FaxAddrVO> addrNoGrpList = faxAddrService.selectFaxAddrBasicGrpList(addrVO);
|
||||
|
||||
|
||||
int totalGrpCount = addrGroupList.stream()
|
||||
.mapToInt(group -> {
|
||||
String grpCountStr = group.getGrpCount();
|
||||
if (grpCountStr != null && !grpCountStr.isEmpty()) {
|
||||
try {
|
||||
return Integer.parseInt(grpCountStr);
|
||||
} catch (NumberFormatException e) {
|
||||
// 파싱에 실패한 경우 0을 반환하거나 예외 처리를 합니다.
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
})
|
||||
.sum();
|
||||
|
||||
int addrTotalCount = (addrNoGrpList.size() >0 ? addrNoGrpList.get(0).getTotcnt() : 0)
|
||||
+ (addrBookmarkList.size() >0 ? addrBookmarkList.get(0).getTotcnt() : 0)
|
||||
+ totalGrpCount
|
||||
;
|
||||
|
||||
|
||||
model.addAttribute("addrTotalCount", addrTotalCount);
|
||||
@ -378,15 +353,18 @@ public class FaxAddrGroupController {
|
||||
LoginVO user = (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser();
|
||||
addrGroupVO.setLastUpdusrId(user.getId());
|
||||
addrGroupVO.setMberId(user.getId());
|
||||
FaxAddrVO addrVO = new FaxAddrVO();
|
||||
|
||||
for(String id:grpCheck) {
|
||||
try {
|
||||
|
||||
addrGroupVO.setAddrGrpId(id);
|
||||
addrGroupVO.setMberId(user.getId());
|
||||
addrGroupVO.setLastUpdusrId(user.getId());
|
||||
faxAddrGroupService.deleteFaxAddrGroup(addrGroupVO);
|
||||
|
||||
faxAddrService.deleteFaxAddr_advc(addrGroupVO);
|
||||
addrVO.setAddrGrpId(id);
|
||||
addrVO.setGrpDelete("Y");
|
||||
addrVO.setMberId(user.getId());
|
||||
addrVO.setLastUpdusrId(user.getId());
|
||||
faxAddrService.deleteFaxAddr(addrVO);
|
||||
|
||||
modelAndView.addObject("result", "success");
|
||||
} catch (Exception e) {
|
||||
@ -395,7 +373,9 @@ public class FaxAddrGroupController {
|
||||
return modelAndView;
|
||||
}
|
||||
}
|
||||
|
||||
return modelAndView;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -548,25 +528,21 @@ public class FaxAddrGroupController {
|
||||
modelAndView.setViewName("jsonView");
|
||||
|
||||
try {
|
||||
// KmcCertChecker kmcCertCheck = new KmcCertChecker();
|
||||
//
|
||||
// // mberId null일경우 ""로
|
||||
// mberManageVO.setMberId(EgovStringUtil.isNullToString(mberManageVO.getMberId()));
|
||||
//
|
||||
// // kmc 본인인증 실/개발 서버 구분
|
||||
// String serverNm = "";
|
||||
// if (request.getServerName().contains("219.240.88.15") || request.getServerName().contains("localhost")) {
|
||||
// serverNm = request.getScheme() + "://219.240.88.15:8095";
|
||||
// } else {
|
||||
// serverNm = request.getScheme() + "://www.munjaon.co.kr";
|
||||
// }
|
||||
|
||||
|
||||
MberCertPhoneVO mberCertPhoneVO = new MberCertPhoneVO();
|
||||
mberCertPhoneVO.setTrUrl("/web/cop/kmc/authRequestAddrSubmitAjax.do");
|
||||
mberCertPhoneVO.setPlusInfo(mberManageVO.getMberId());
|
||||
|
||||
AuthCertVO certVO = kmcCertCheck.authCertCheck(mberCertPhoneVO, request);
|
||||
KmcCertChecker kmcCertCheck = new KmcCertChecker();
|
||||
|
||||
// mberId null일경우 ""로
|
||||
mberManageVO.setMberId(EgovStringUtil.isNullToString(mberManageVO.getMberId()));
|
||||
|
||||
// kmc 본인인증 실/개발 서버 구분
|
||||
String serverNm = "";
|
||||
if (request.getServerName().contains("219.240.88.15") || request.getServerName().contains("localhost")) {
|
||||
serverNm = request.getScheme() + "://219.240.88.15:8095";
|
||||
} else {
|
||||
serverNm = request.getScheme() + "://www.munjaon.co.kr";
|
||||
}
|
||||
|
||||
AuthCertVO certVO = kmcCertCheck.authCertCheckEight(serverNm + "/web/cop/kmc/authRequestAddrSubmitAjax.do",
|
||||
mberManageVO.getMberId());
|
||||
|
||||
modelAndView.addObject("tr_cert", certVO.getTr_cert());
|
||||
modelAndView.addObject("tr_url", certVO.getTr_url());
|
||||
|
||||
@ -1,81 +0,0 @@
|
||||
package itn.let.fax.addr.web;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.apache.commons.vfs2.util.DelegatingFileSystemOptionsBuilder;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import egovframework.rte.fdl.security.userdetails.util.EgovUserDetailsHelper;
|
||||
import itn.com.cmm.EgovMessageSource;
|
||||
import itn.com.cmm.LoginVO;
|
||||
import itn.com.utl.fcc.service.EgovStringUtil;
|
||||
import itn.let.fax.addr.service.FaxAddrGroupService;
|
||||
import itn.let.fax.addr.service.FaxAddrService;
|
||||
import itn.let.fax.addr.service.FaxAddrVO;
|
||||
import itn.let.mail.service.StatusResponse;
|
||||
|
||||
/**
|
||||
* 팩스 주소록 관한 controller 클래스를 정의한다.
|
||||
* @author ITN
|
||||
* @since 2024.11.08
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2021.04.08 ITN 최초 생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
@RestController
|
||||
public class FaxAddrRestController {
|
||||
|
||||
|
||||
@Resource (name = "FaxAddrService")
|
||||
private FaxAddrService faxAddrService;
|
||||
|
||||
@Resource (name = "FaxAddrGroupService")
|
||||
private FaxAddrGroupService faxAddrGroupService;
|
||||
|
||||
/** EgovMessageSource */
|
||||
@Resource(name="egovMessageSource")
|
||||
EgovMessageSource egovMessageSource;
|
||||
|
||||
/**
|
||||
* 팩스 주소록 대량등록 저장
|
||||
* @param searchVO
|
||||
* @param model
|
||||
* @return "/web/mjon/addr/addrMassInsertByTempAjax_advc.do"
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value= {"/web/mjon/fax/addr/faxAddrMassInsertByTempAjax_advc.do"})
|
||||
public ResponseEntity<StatusResponse> faxAddrMassInsertByTempAjax_advc(
|
||||
@RequestBody List<FaxAddrVO> faxAddrListVO
|
||||
,ModelMap model) throws Exception{
|
||||
|
||||
LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated()? (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null;
|
||||
String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId());
|
||||
|
||||
if(userId.equals("")) {
|
||||
return ResponseEntity.ok(
|
||||
new StatusResponse(HttpStatus.UNAUTHORIZED
|
||||
, "로그인을 하셔야 이용 가능합니다."
|
||||
, LocalDateTime.now()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
return ResponseEntity.ok().body(faxAddrService.faxAddrMassInsertByTempAjax_advc(faxAddrListVO, userId));
|
||||
}
|
||||
}
|
||||
@ -20,7 +20,7 @@ import org.springframework.stereotype.Service;
|
||||
import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl;
|
||||
import egovframework.rte.fdl.idgnr.EgovIdGnrService;
|
||||
import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo;
|
||||
import itn.com.cmm.util.DateUtils;
|
||||
import itn.com.cmm.util.DateUtil;
|
||||
import itn.com.utl.fcc.service.EgovDateUtil;
|
||||
import itn.let.fax.admin.service.FaxAdmService;
|
||||
import itn.let.fax.admin.service.FaxStatVO;
|
||||
@ -195,8 +195,8 @@ public class FaxAdmServiceImpl extends EgovAbstractServiceImpl implements FaxAdm
|
||||
String date = simpleDateFormat.format(new Date());
|
||||
if("".equals(faxGroupDataVO.getSearchDateType()) || faxGroupDataVO.getSearchDateType() == null) {
|
||||
faxGroupDataVO.setSearchDateType("month");
|
||||
faxGroupDataVO.setSearchYear(DateUtils.getNowYearToString());
|
||||
faxGroupDataVO.setSearchMonth(DateUtils.getNowMonthToString());
|
||||
faxGroupDataVO.setSearchYear(DateUtil.getNowYearToString());
|
||||
faxGroupDataVO.setSearchMonth(DateUtil.getNowMonthToString());
|
||||
}
|
||||
|
||||
List<FaxGroupDataVO> faxGroupListVO = faxDao.selectFaxStatList(faxGroupDataVO);
|
||||
|
||||
@ -394,7 +394,7 @@ public class FaxAdmController {
|
||||
|
||||
if("".equals(addrVO.getSearchSortCnd())){ //최초조회시 최신것 조회List
|
||||
addrVO.setSearchSortCnd("addrId");
|
||||
addrVO.setSearchSortOrd("asc");
|
||||
addrVO.setSearchSortOrd("desc");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -211,14 +211,6 @@ public class FaxGroupDataVO extends FaxTranVO implements Serializable {
|
||||
private String successCntMonth;
|
||||
private String successCntYear;
|
||||
|
||||
|
||||
private String totalEaSum;
|
||||
private String holdEaSum;
|
||||
private String sentEaSum;
|
||||
private String unSendEaSum;
|
||||
private String errorEaSum;
|
||||
|
||||
|
||||
public String getSuccessDay() {
|
||||
return successDay;
|
||||
}
|
||||
@ -696,63 +688,5 @@ public class FaxGroupDataVO extends FaxTranVO implements Serializable {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public String getSearchQuarter() {
|
||||
return searchQuarter;
|
||||
}
|
||||
|
||||
public void setSearchQuarter(String searchQuarter) {
|
||||
this.searchQuarter = searchQuarter;
|
||||
}
|
||||
|
||||
public String getTotalEaSum() {
|
||||
return totalEaSum;
|
||||
}
|
||||
|
||||
public void setTotalEaSum(String totalEaSum) {
|
||||
this.totalEaSum = totalEaSum;
|
||||
}
|
||||
|
||||
public String getHoldEaSum() {
|
||||
return holdEaSum;
|
||||
}
|
||||
|
||||
public void setHoldEaSum(String holdEaSum) {
|
||||
this.holdEaSum = holdEaSum;
|
||||
}
|
||||
|
||||
public String getSentEaSum() {
|
||||
return sentEaSum;
|
||||
}
|
||||
|
||||
public void setSentEaSum(String sentEaSum) {
|
||||
this.sentEaSum = sentEaSum;
|
||||
}
|
||||
|
||||
public String getUnSendEaSum() {
|
||||
return unSendEaSum;
|
||||
}
|
||||
|
||||
public void setUnSendEaSum(String unSendEaSum) {
|
||||
this.unSendEaSum = unSendEaSum;
|
||||
}
|
||||
|
||||
public String getErrorEaSum() {
|
||||
return errorEaSum;
|
||||
}
|
||||
|
||||
public void setErrorEaSum(String errorEaSum) {
|
||||
this.errorEaSum = errorEaSum;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -90,9 +90,6 @@ public class FaxDAO extends EgovComAbstractDAO{
|
||||
public List<FaxGroupDataVO> selectFaxSendList(FaxGroupDataVO faxGroupDataVO) {
|
||||
return (List<FaxGroupDataVO>) list("faxDAO.selectFaxSendList", faxGroupDataVO);
|
||||
}
|
||||
public List<FaxGroupDataVO> selectFaxSendList_advc(FaxGroupDataVO faxGroupDataVO) {
|
||||
return (List<FaxGroupDataVO>) list("faxDAO.selectFaxSendList_advc", faxGroupDataVO);
|
||||
}
|
||||
|
||||
public List<FaxGroupDataVO> selectFaxSendDetailList(FaxGroupDataVO faxGroupDataVO) {
|
||||
return (List<FaxGroupDataVO>) list("faxDAO.selectFaxSendDetailList", faxGroupDataVO);
|
||||
@ -152,5 +149,4 @@ public class FaxDAO extends EgovComAbstractDAO{
|
||||
public List<FaxGroupDataVO> selectMyFaxSendList(FaxGroupDataVO faxGroupDataVO) {
|
||||
return (List<FaxGroupDataVO>) list("faxDAO.selectMyFaxSendList", faxGroupDataVO);
|
||||
}
|
||||
|
||||
}
|
||||
@ -30,7 +30,7 @@ import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl;
|
||||
import egovframework.rte.fdl.cmmn.exception.FdlException;
|
||||
import egovframework.rte.fdl.idgnr.EgovIdGnrService;
|
||||
import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo;
|
||||
import itn.com.cmm.util.DateUtils;
|
||||
import itn.com.cmm.util.DateUtil;
|
||||
import itn.com.cmm.util.FaxUtil;
|
||||
import itn.let.fax.user.service.FaxConvertMngVO;
|
||||
import itn.let.fax.user.service.FaxConvertVO;
|
||||
@ -240,8 +240,8 @@ public class FaxServiceImpl extends EgovAbstractServiceImpl implements FaxServic
|
||||
if(StringUtils.isEmpty(faxGroupDataVO.getSearchStartDate())
|
||||
&& StringUtils.isEmpty(faxGroupDataVO.getSearchEndDate())
|
||||
) {
|
||||
faxGroupDataVO.setSearchStartDate(DateUtils.getTodayYearAndMonthAndFirstDay());
|
||||
faxGroupDataVO.setSearchEndDate(DateUtils.getTodayYearAndMonthAndLastDay());
|
||||
faxGroupDataVO.setSearchStartDate(DateUtil.getTodayYearAndMonthAndFirstDay());
|
||||
faxGroupDataVO.setSearchEndDate(DateUtil.getTodayYearAndMonthAndLastDay());
|
||||
}
|
||||
|
||||
/** pageing */
|
||||
@ -254,26 +254,7 @@ public class FaxServiceImpl extends EgovAbstractServiceImpl implements FaxServic
|
||||
faxGroupDataVO.setLastIndex(paginationInfo.getLastRecordIndex());
|
||||
faxGroupDataVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());
|
||||
|
||||
|
||||
|
||||
List<FaxGroupDataVO> faxGroupListVO = faxDao.selectFaxSendList_advc(faxGroupDataVO);
|
||||
|
||||
|
||||
if(faxGroupListVO.size() >0) {
|
||||
|
||||
// 총 건수
|
||||
resultMap.put("totalEaSum" ,faxGroupListVO.get(0).getTotalEaSum());
|
||||
System.out.println("faxGroupListVO.get(0).getTotalEaSum() : "+ faxGroupListVO.get(0).getTotalEaSum());
|
||||
// 총 대기 건수
|
||||
resultMap.put("holdEaSum" ,faxGroupListVO.get(0).getHoldEaSum());
|
||||
// 총 성공 건수
|
||||
resultMap.put("sentEaSum" ,faxGroupListVO.get(0).getSentEaSum());
|
||||
// 총 실패 건수
|
||||
resultMap.put("errorEaSum" ,faxGroupListVO.get(0).getErrorEaSum());
|
||||
// 총 기타 건수
|
||||
resultMap.put("unSendEaSum" ,faxGroupListVO.get(0).getUnSendEaSum());
|
||||
|
||||
}
|
||||
List<FaxGroupDataVO> faxGroupListVO = faxDao.selectFaxSendList(faxGroupDataVO);
|
||||
|
||||
paginationInfo.setTotalRecordCount(faxGroupListVO.size() > 0 ? faxGroupListVO.get(0).getTotCnt() : 0);
|
||||
resultMap.put("faxGroupListVO", faxGroupListVO);
|
||||
@ -306,9 +287,9 @@ public class FaxServiceImpl extends EgovAbstractServiceImpl implements FaxServic
|
||||
Map<String, Object> dateMap = new HashMap<String, Object>();
|
||||
|
||||
|
||||
dateMap.put("year", DateUtils.getNowYearToString());
|
||||
dateMap.put("month", DateUtils.getNowMonthToString());
|
||||
dateMap.put("day", DateUtils.getNowDayToString());
|
||||
dateMap.put("year", DateUtil.getNowYearToString());
|
||||
dateMap.put("month", DateUtil.getNowMonthToString());
|
||||
dateMap.put("day", DateUtil.getNowDayToString());
|
||||
resultMap.put("dateMap", dateMap);
|
||||
|
||||
return resultMap;
|
||||
@ -625,7 +606,7 @@ public class FaxServiceImpl extends EgovAbstractServiceImpl implements FaxServic
|
||||
&& StringUtils.isEmpty(faxGroupDataVO.getSearchEndDate())
|
||||
) {
|
||||
// faxGroupDataVO.setSearchStartDate(DateUtil.getTodayYearAndMonthAndFirstDay());
|
||||
faxGroupDataVO.setSearchEndDate(DateUtils.getTodayYearAndMonthAndLastDay());
|
||||
faxGroupDataVO.setSearchEndDate(DateUtil.getTodayYearAndMonthAndLastDay());
|
||||
}
|
||||
|
||||
/** pageing */
|
||||
|
||||
@ -190,23 +190,7 @@ public class FaxController {
|
||||
// 전송내역
|
||||
model.addAttribute("faxGroupListVO", faxSendListMap.get("faxGroupListVO"));
|
||||
model.addAttribute("searchKeyword", faxSendListMap.get("searchKeyword"));
|
||||
model.addAttribute("paginationInfo", faxSendListMap.get("paginationInfo"));
|
||||
|
||||
|
||||
|
||||
// 총 건수
|
||||
model.addAttribute("totalEaSum" ,faxSendListMap.get("totalEaSum"));
|
||||
// 총 대기 건수
|
||||
model.addAttribute("holdEaSum" ,faxSendListMap.get("holdEaSum"));
|
||||
// 총 성공 건수
|
||||
model.addAttribute("sentEaSum" ,faxSendListMap.get("sentEaSum"));
|
||||
// 총 실패 건수
|
||||
model.addAttribute("errorEaSum" ,faxSendListMap.get("errorEaSum"));
|
||||
// 총 기타 건수
|
||||
model.addAttribute("unSendEaSum" ,faxSendListMap.get("unSendEaSum"));
|
||||
|
||||
|
||||
|
||||
model.addAttribute("paginationInfo", faxSendListMap.get("paginationInfo"));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
// TODO: handle exception
|
||||
|
||||
@ -45,14 +45,5 @@ public interface MjonKakaoATService {
|
||||
|
||||
//알림톡 지연문자 리스트 조회
|
||||
List<KakaoVO> selectKakaoATDelaySentList(String userId) throws Exception;
|
||||
|
||||
//알림톡 전체 발송 리스트(대시보드용)
|
||||
List<KakaoVO> selectMjonKakaoATGroupCompleteByUserList_advc(KakaoVO searchVO) throws Exception;
|
||||
|
||||
//알림톡 발송 상세 리스트
|
||||
List<KakaoVO> selectMjonKakaoATGroupDtList_advc(KakaoVO searchVO) throws Exception;
|
||||
|
||||
//알림톡 전송내역 상세
|
||||
KakaoVO selectMjonKakaoATVO_advc(KakaoVO mjonKakaoATVO) throws Exception;
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -97,18 +97,4 @@ public class MjonKakaoATDAO extends EgovAbstractDAO {
|
||||
public List<KakaoVO> selectKakaoATDelaySentList(String userId) throws Exception{
|
||||
return (List<KakaoVO>)list("mjonKakaoATDAO.selectKakaoATDelaySentList", userId);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public List<KakaoVO> selectMjonKakaoATGroupCompleteByUserList_advc(KakaoVO p_mjonKakaoATVO) throws Exception{
|
||||
return (List<KakaoVO>)list("mjonKakaoATDAO.selectMjonKakaoATGroupCompleteByUserList_advc", p_mjonKakaoATVO);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public List<KakaoVO> selectMjonKakaoATGroupDtList_advc(KakaoVO p_mjonKakaoATVO) throws Exception{
|
||||
return (List<KakaoVO>)list("mjonKakaoATDAO.selectMjonKakaoATGroupDtList_advc", p_mjonKakaoATVO);
|
||||
}
|
||||
|
||||
public KakaoVO selectMjonKakaoATVO_advc(KakaoVO p_mjonKakaoATVO) throws Exception{
|
||||
return (KakaoVO) select("mjonKakaoATDAO.selectMjonKakaoATVO_advc", p_mjonKakaoATVO);
|
||||
}
|
||||
}
|
||||
|
||||
@ -199,55 +199,4 @@ public class MjonKakaoATServiceImpl extends EgovAbstractServiceImpl implements M
|
||||
public List<KakaoVO> selectKakaoATDelaySentList(String userId) throws Exception {
|
||||
return mjonKakaoATDAO.selectKakaoATDelaySentList(userId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<KakaoVO> selectMjonKakaoATGroupCompleteByUserList_advc(KakaoVO p_mjonKakaoATVO) throws Exception {
|
||||
|
||||
List<KakaoVO> result = new ArrayList<KakaoVO>();
|
||||
|
||||
try {
|
||||
|
||||
result = mjonKakaoATDAO.selectMjonKakaoATGroupCompleteByUserList_advc(p_mjonKakaoATVO);
|
||||
|
||||
} catch (Exception e) {
|
||||
System.out.println("selectMjonKakaoATGroupCompleteByUserList ServiceImpl Error ::: " + e);
|
||||
}
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<KakaoVO> selectMjonKakaoATGroupDtList_advc(KakaoVO p_mjonKakaoATVO) throws Exception {
|
||||
|
||||
List<KakaoVO> resultList = new ArrayList<KakaoVO>();
|
||||
|
||||
try {
|
||||
|
||||
resultList = mjonKakaoATDAO.selectMjonKakaoATGroupDtList_advc(p_mjonKakaoATVO);
|
||||
|
||||
} catch (Exception e) {
|
||||
System.out.println("selectMjonKakaoATGroupDtList ServiceImpl Error ::: " + e);
|
||||
|
||||
}
|
||||
|
||||
return resultList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public KakaoVO selectMjonKakaoATVO_advc(KakaoVO p_mjonKakaoATVO) throws Exception {
|
||||
|
||||
KakaoVO result = new KakaoVO();
|
||||
|
||||
try {
|
||||
|
||||
result = mjonKakaoATDAO.selectMjonKakaoATVO_advc(p_mjonKakaoATVO);
|
||||
|
||||
} catch (Exception e) {
|
||||
System.out.println("selectMjonKakaoATVO Service Impl Error !!! " + e);
|
||||
}
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@ -241,8 +241,7 @@ public class MjonKakaoATController {
|
||||
kakaoVO.setNtceBgnde(beforeMonthDay);
|
||||
}
|
||||
|
||||
// resultList = mjonKakaoATService.selectMjonKakaoATGroupCompleteByUserList(kakaoVO);
|
||||
resultList = mjonKakaoATService.selectMjonKakaoATGroupCompleteByUserList_advc(kakaoVO);
|
||||
resultList = mjonKakaoATService.selectMjonKakaoATGroupCompleteByUserList(kakaoVO);
|
||||
|
||||
model.addAttribute("resultList", resultList);
|
||||
|
||||
@ -332,8 +331,7 @@ public class MjonKakaoATController {
|
||||
}
|
||||
|
||||
List<KakaoVO> resultList = new ArrayList<KakaoVO>();
|
||||
// resultList = mjonKakaoATService.selectMjonKakaoATGroupDtList(searchVO);
|
||||
resultList = mjonKakaoATService.selectMjonKakaoATGroupDtList_advc(searchVO);
|
||||
resultList = mjonKakaoATService.selectMjonKakaoATGroupDtList(searchVO);
|
||||
|
||||
model.addAttribute("resultList", resultList);
|
||||
model.addAttribute("searchVO", searchVO);
|
||||
@ -379,8 +377,7 @@ public class MjonKakaoATController {
|
||||
|
||||
KakaoVO mjonKakaoATDetailVO = new KakaoVO();
|
||||
if(null != searchVO.getUserData() && !"".equals(searchVO.getUserData())) { //수정
|
||||
// mjonKakaoATDetailVO = mjonKakaoATService.selectMjonKakaoATVO(searchVO);
|
||||
mjonKakaoATDetailVO = mjonKakaoATService.selectMjonKakaoATVO_advc(searchVO);
|
||||
mjonKakaoATDetailVO = mjonKakaoATService.selectMjonKakaoATVO(searchVO);
|
||||
|
||||
}
|
||||
|
||||
@ -796,16 +793,9 @@ public class MjonKakaoATController {
|
||||
String lastUpdtPnttm = resultChannelList.get(i).getLastUpdtPnttm();
|
||||
kakaoProfileVO.setSenderKey(senderKey);
|
||||
kakaoProfileVO.setProfileId(profileId);
|
||||
KakaoReturnVO tmpProfileVO = null;
|
||||
// try {
|
||||
//
|
||||
// tmpProfileVO = kakaoApiProfile.kakaoApiProfileList(kakaoProfileVO);
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// // TODO: handle exception
|
||||
// }
|
||||
|
||||
tmpProfileVO = kakaoApiProfile.kakaoApiProfileList(kakaoProfileVO);
|
||||
|
||||
KakaoReturnVO tmpProfileVO = kakaoApiProfile.kakaoApiProfileList(kakaoProfileVO);
|
||||
|
||||
ChannelIDVO returnChannelVO = new ChannelIDVO();
|
||||
|
||||
returnChannelVO.setSenderKey(tmpProfileVO.getSenderKey());
|
||||
|
||||
@ -1,34 +0,0 @@
|
||||
package itn.let.kakao.kakaoComm;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
/**
|
||||
* @ BIZ_KAKAO_PRICE 테이블 관련
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ToString
|
||||
public class BizKakaoPriceVO {
|
||||
|
||||
private Long bizKakaoPriceId;
|
||||
|
||||
private String bizKakaoAtPrice; // 알림톡 단가
|
||||
private String bizKakaoFtPrice; // 친구톡 단가
|
||||
private String bizKakaoFtImgPrice; // 친구톡 이미지 단가
|
||||
private String bizKakaoFtWideImgPrice; // 친구톡 와이드 이미지 단가
|
||||
private String bizSmsPrice; // SMS 단가
|
||||
private String bizMmsPrice; // MMS 단가
|
||||
|
||||
private String msgGroupId; // 메시지 그룹 ID
|
||||
|
||||
|
||||
// getters and setters 생략
|
||||
}
|
||||
@ -1,9 +1,5 @@
|
||||
package itn.let.kakao.kakaoComm;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
/**
|
||||
* @FileName : KakaoButtonVO.java
|
||||
* @Project : mjon
|
||||
@ -12,9 +8,6 @@ import lombok.ToString;
|
||||
|
||||
* @프로그램 설명 : button, quickReplies 변수
|
||||
*/
|
||||
@ToString
|
||||
@Getter
|
||||
@Setter
|
||||
public class KakaoButtonVO {
|
||||
|
||||
private String name = ""; // 버튼명 - linkType “AC” 선택 시 버튼명은 “채널추가” 로 고정
|
||||
@ -25,4 +18,48 @@ public class KakaoButtonVO {
|
||||
private String linkPc = ""; // PC 웹 링크 주소 (WL 사용시 선택)
|
||||
private String pluginId = ""; // 플러그인 ID (P1, P2, P3 사용시 필수)
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
public String getLinkType() {
|
||||
return linkType;
|
||||
}
|
||||
public void setLinkType(String linkType) {
|
||||
this.linkType = linkType;
|
||||
}
|
||||
public String getLinkAnd() {
|
||||
return linkAnd;
|
||||
}
|
||||
public void setLinkAnd(String linkAnd) {
|
||||
this.linkAnd = linkAnd;
|
||||
}
|
||||
public String getLinkIos() {
|
||||
return linkIos;
|
||||
}
|
||||
public void setLinkIos(String linkIos) {
|
||||
this.linkIos = linkIos;
|
||||
}
|
||||
public String getLinkMo() {
|
||||
return linkMo;
|
||||
}
|
||||
public void setLinkMo(String linkMo) {
|
||||
this.linkMo = linkMo;
|
||||
}
|
||||
public String getLinkPc() {
|
||||
return linkPc;
|
||||
}
|
||||
public void setLinkPc(String linkPc) {
|
||||
this.linkPc = linkPc;
|
||||
}
|
||||
public String getPluginId() {
|
||||
return pluginId;
|
||||
}
|
||||
public void setPluginId(String pluginId) {
|
||||
this.pluginId = pluginId;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -3,10 +3,6 @@ package itn.let.kakao.kakaoComm;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
/**
|
||||
* @FileName : KakaoCommentVO.java
|
||||
* @Project : mjon
|
||||
@ -15,9 +11,6 @@ import lombok.ToString;
|
||||
|
||||
* @프로그램 설명 : comment 변수
|
||||
*/
|
||||
@ToString
|
||||
@Getter
|
||||
@Setter
|
||||
public class KakaoCommentVO {
|
||||
|
||||
private String content = ""; // 댓글 본분
|
||||
@ -33,4 +26,60 @@ public class KakaoCommentVO {
|
||||
private String originalFileName = "";
|
||||
|
||||
private String filePath = "";
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public String getCreatedAt() {
|
||||
return createdAt;
|
||||
}
|
||||
|
||||
public void setCreatedAt(String createdAt) {
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getUserName() {
|
||||
return userName;
|
||||
}
|
||||
|
||||
public void setUserName(String userName) {
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public String getOriginalFileName() {
|
||||
return originalFileName;
|
||||
}
|
||||
|
||||
public void setOriginalFileName(String originalFileName) {
|
||||
this.originalFileName = originalFileName;
|
||||
}
|
||||
|
||||
public String getFilePath() {
|
||||
return filePath;
|
||||
}
|
||||
|
||||
public void setFilePath(String filePath) {
|
||||
this.filePath = filePath;
|
||||
}
|
||||
|
||||
public List<KakaoCommentVO> getAttachFileList() {
|
||||
return attachFileList;
|
||||
}
|
||||
|
||||
public void setAttachFileList(List<KakaoCommentVO> attachFileList) {
|
||||
this.attachFileList = attachFileList;
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,9 +4,6 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import itn.com.cmm.ComDefaultVO;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
/**
|
||||
* @FileName : KakaoReturnVO.java
|
||||
@ -16,9 +13,6 @@ import lombok.ToString;
|
||||
|
||||
* @프로그램 설명 : 카카오톡 리턴 변수 목록
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
public class KakaoReturnVO extends ComDefaultVO{
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@ -136,4 +130,415 @@ public class KakaoReturnVO extends ComDefaultVO{
|
||||
|
||||
private String businessType = ""; //카카오톡 채널 비즈니스 인증 타입
|
||||
|
||||
public static long getSerialversionuid() {
|
||||
return serialVersionUID;
|
||||
}
|
||||
|
||||
public String getBizReturnMsg() {
|
||||
return bizReturnMsg;
|
||||
}
|
||||
|
||||
public void setBizReturnMsg(String bizReturnMsg) {
|
||||
this.bizReturnMsg = bizReturnMsg;
|
||||
}
|
||||
|
||||
public String getBizReturnCode() {
|
||||
return bizReturnCode;
|
||||
}
|
||||
|
||||
public void setBizReturnCode(String bizReturnCode) {
|
||||
this.bizReturnCode = bizReturnCode;
|
||||
}
|
||||
|
||||
public String getProfileId() {
|
||||
return profileId;
|
||||
}
|
||||
|
||||
public void setProfileId(String profileId) {
|
||||
this.profileId = profileId;
|
||||
}
|
||||
|
||||
public String getTotalCount() {
|
||||
return totalCount;
|
||||
}
|
||||
|
||||
public void setTotalCount(String totalCount) {
|
||||
this.totalCount = totalCount;
|
||||
}
|
||||
|
||||
public String getTotalPage() {
|
||||
return totalPage;
|
||||
}
|
||||
|
||||
public void setTotalPage(String totalPage) {
|
||||
this.totalPage = totalPage;
|
||||
}
|
||||
|
||||
public String getCurrentPage() {
|
||||
return currentPage;
|
||||
}
|
||||
|
||||
public void setCurrentPage(String currentPage) {
|
||||
this.currentPage = currentPage;
|
||||
}
|
||||
|
||||
public String getSenderKey() {
|
||||
return senderKey;
|
||||
}
|
||||
|
||||
public void setSenderKey(String senderKey) {
|
||||
this.senderKey = senderKey;
|
||||
}
|
||||
|
||||
public String getSenderKeyType() {
|
||||
return senderKeyType;
|
||||
}
|
||||
|
||||
public void setSenderKeyType(String senderKeyType) {
|
||||
this.senderKeyType = senderKeyType;
|
||||
}
|
||||
|
||||
public String getTemplateCode() {
|
||||
return templateCode;
|
||||
}
|
||||
|
||||
public void setTemplateCode(String templateCode) {
|
||||
this.templateCode = templateCode;
|
||||
}
|
||||
|
||||
public String getTemplateName() {
|
||||
return templateName;
|
||||
}
|
||||
|
||||
public void setTemplateName(String templateName) {
|
||||
this.templateName = templateName;
|
||||
}
|
||||
|
||||
public String getCategoryCode() {
|
||||
return categoryCode;
|
||||
}
|
||||
|
||||
public void setCategoryCode(String categoryCode) {
|
||||
this.categoryCode = categoryCode;
|
||||
}
|
||||
|
||||
public String getCreatedAt() {
|
||||
return createdAt;
|
||||
}
|
||||
|
||||
public void setCreatedAt(String createdAt) {
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public String getModifiedAt() {
|
||||
return modifiedAt;
|
||||
}
|
||||
|
||||
public void setModifiedAt(String modifiedAt) {
|
||||
this.modifiedAt = modifiedAt;
|
||||
}
|
||||
|
||||
public String getServiceStatus() {
|
||||
return serviceStatus;
|
||||
}
|
||||
|
||||
public void setServiceStatus(String serviceStatus) {
|
||||
this.serviceStatus = serviceStatus;
|
||||
}
|
||||
|
||||
public List<KakaoReturnVO> getTemplatList() {
|
||||
return templatList;
|
||||
}
|
||||
|
||||
public void setTemplatList(List<KakaoReturnVO> templatList) {
|
||||
this.templatList = templatList;
|
||||
}
|
||||
|
||||
public String getUuid() {
|
||||
return uuid;
|
||||
}
|
||||
|
||||
public void setUuid(String uuid) {
|
||||
this.uuid = uuid;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public boolean isBlock() {
|
||||
return block;
|
||||
}
|
||||
|
||||
public void setBlock(boolean block) {
|
||||
this.block = block;
|
||||
}
|
||||
|
||||
public boolean isDormant() {
|
||||
return dormant;
|
||||
}
|
||||
|
||||
public void setDormant(boolean dormant) {
|
||||
this.dormant = dormant;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getImageUrl() {
|
||||
return imageUrl;
|
||||
}
|
||||
|
||||
public void setImageUrl(String imageUrl) {
|
||||
this.imageUrl = imageUrl;
|
||||
}
|
||||
|
||||
public String getListTitle() {
|
||||
return listTitle;
|
||||
}
|
||||
|
||||
public void setListTitle(String listTitle) {
|
||||
this.listTitle = listTitle;
|
||||
}
|
||||
|
||||
public String getListDescription() {
|
||||
return listDescription;
|
||||
}
|
||||
|
||||
public void setListDescription(String listDescription) {
|
||||
this.listDescription = listDescription;
|
||||
}
|
||||
|
||||
public String getSumTitle() {
|
||||
return sumTitle;
|
||||
}
|
||||
|
||||
public void setSumTitle(String sumTitle) {
|
||||
this.sumTitle = sumTitle;
|
||||
}
|
||||
|
||||
public String getSumDescription() {
|
||||
return sumDescription;
|
||||
}
|
||||
|
||||
public void setSumDescription(String sumDescription) {
|
||||
this.sumDescription = sumDescription;
|
||||
}
|
||||
|
||||
public String getProfileStatus() {
|
||||
return profileStatus;
|
||||
}
|
||||
|
||||
public void setProfileStatus(String profileStatus) {
|
||||
this.profileStatus = profileStatus;
|
||||
}
|
||||
|
||||
public boolean isAlimtalk() {
|
||||
return alimtalk;
|
||||
}
|
||||
|
||||
public void setAlimtalk(boolean alimtalk) {
|
||||
this.alimtalk = alimtalk;
|
||||
}
|
||||
|
||||
public boolean isBizchat() {
|
||||
return bizchat;
|
||||
}
|
||||
|
||||
public void setBizchat(boolean bizchat) {
|
||||
this.bizchat = bizchat;
|
||||
}
|
||||
|
||||
public boolean isBrandtalk() {
|
||||
return brandtalk;
|
||||
}
|
||||
|
||||
public void setBrandtalk(boolean brandtalk) {
|
||||
this.brandtalk = brandtalk;
|
||||
}
|
||||
|
||||
public String getCommittalCompanyName() {
|
||||
return committalCompanyName;
|
||||
}
|
||||
|
||||
public void setCommittalCompanyName(String committalCompanyName) {
|
||||
this.committalCompanyName = committalCompanyName;
|
||||
}
|
||||
|
||||
public String getChannelKey() {
|
||||
return channelKey;
|
||||
}
|
||||
|
||||
public void setChannelKey(String channelKey) {
|
||||
this.channelKey = channelKey;
|
||||
}
|
||||
|
||||
public boolean isBusinessProfile() {
|
||||
return businessProfile;
|
||||
}
|
||||
|
||||
public void setBusinessProfile(boolean businessProfile) {
|
||||
this.businessProfile = businessProfile;
|
||||
}
|
||||
|
||||
public String getBusinessType() {
|
||||
return businessType;
|
||||
}
|
||||
|
||||
public void setBusinessType(String businessType) {
|
||||
this.businessType = businessType;
|
||||
}
|
||||
|
||||
public String getTemplateMessageType() {
|
||||
return templateMessageType;
|
||||
}
|
||||
|
||||
public void setTemplateMessageType(String templateMessageType) {
|
||||
this.templateMessageType = templateMessageType;
|
||||
}
|
||||
|
||||
public String getTemplateEmphasizeType() {
|
||||
return templateEmphasizeType;
|
||||
}
|
||||
|
||||
public void setTemplateEmphasizeType(String templateEmphasizeType) {
|
||||
this.templateEmphasizeType = templateEmphasizeType;
|
||||
}
|
||||
|
||||
public String getTemplateContent() {
|
||||
return templateContent;
|
||||
}
|
||||
|
||||
public void setTemplateContent(String templateContent) {
|
||||
this.templateContent = templateContent;
|
||||
}
|
||||
|
||||
public String getTemplateExtra() {
|
||||
return templateExtra;
|
||||
}
|
||||
|
||||
public void setTemplateExtra(String templateExtra) {
|
||||
this.templateExtra = templateExtra;
|
||||
}
|
||||
|
||||
public String getTemplateAd() {
|
||||
return templateAd;
|
||||
}
|
||||
|
||||
public void setTemplateAd(String templateAd) {
|
||||
this.templateAd = templateAd;
|
||||
}
|
||||
|
||||
public String getTemplateImageName() {
|
||||
return templateImageName;
|
||||
}
|
||||
|
||||
public void setTemplateImageName(String templateImageName) {
|
||||
this.templateImageName = templateImageName;
|
||||
}
|
||||
|
||||
public String getTemplateImageUrl() {
|
||||
return templateImageUrl;
|
||||
}
|
||||
|
||||
public void setTemplateImageUrl(String templateImageUrl) {
|
||||
this.templateImageUrl = templateImageUrl;
|
||||
}
|
||||
|
||||
public String getTemplateTitle() {
|
||||
return templateTitle;
|
||||
}
|
||||
|
||||
public void setTemplateTitle(String templateTitle) {
|
||||
this.templateTitle = templateTitle;
|
||||
}
|
||||
|
||||
public String getTemplateSubtitle() {
|
||||
return templateSubtitle;
|
||||
}
|
||||
|
||||
public void setTemplateSubtitle(String templateSubtitle) {
|
||||
this.templateSubtitle = templateSubtitle;
|
||||
}
|
||||
|
||||
public String getTemplateHeader() {
|
||||
return templateHeader;
|
||||
}
|
||||
|
||||
public void setTemplateHeader(String templateHeader) {
|
||||
this.templateHeader = templateHeader;
|
||||
}
|
||||
|
||||
public Boolean getSecurityFlag() {
|
||||
return securityFlag;
|
||||
}
|
||||
|
||||
public void setSecurityFlag(Boolean securityFlag) {
|
||||
this.securityFlag = securityFlag;
|
||||
}
|
||||
|
||||
public String getInspectionStatus() {
|
||||
return inspectionStatus;
|
||||
}
|
||||
|
||||
public void setInspectionStatus(String inspectionStatus) {
|
||||
this.inspectionStatus = inspectionStatus;
|
||||
}
|
||||
|
||||
public List<KakaoButtonVO> getButtonList() {
|
||||
return buttonList;
|
||||
}
|
||||
|
||||
public void setButtonList(List<KakaoButtonVO> buttonList) {
|
||||
this.buttonList = buttonList;
|
||||
}
|
||||
|
||||
public List<KakaoButtonVO> getQuickReplyList() {
|
||||
return quickReplyList;
|
||||
}
|
||||
|
||||
public void setQuickReplyList(List<KakaoButtonVO> quickReplyList) {
|
||||
this.quickReplyList = quickReplyList;
|
||||
}
|
||||
|
||||
public List<KakaoCommentVO> getCommentList() {
|
||||
return commentList;
|
||||
}
|
||||
|
||||
public void setCommentList(List<KakaoCommentVO> commentList) {
|
||||
this.commentList = commentList;
|
||||
}
|
||||
|
||||
public List<KakaoItemVO> getItemList() {
|
||||
return itemList;
|
||||
}
|
||||
|
||||
public void setItemList(List<KakaoItemVO> itemList) {
|
||||
this.itemList = itemList;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,133 +0,0 @@
|
||||
package itn.let.kakao.kakaoComm;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* @FileName : KakaoSendVO.java
|
||||
* @Project : mjon
|
||||
* @Date : 2025. 3. 25.
|
||||
* @작성자 : 이호영
|
||||
|
||||
* @프로그램 설명 : 문자온 발송부분만 ADVC
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
public class KakaoSendAdvcVO implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 343099046833205405L;
|
||||
|
||||
// =====
|
||||
// Insert 데이터
|
||||
private String msgId; // 문자ID
|
||||
private String msgGroupId; // 전송그룹ID
|
||||
private String msgGroupCnt; // 전송그룹ID
|
||||
private String userId; // 사용자ID
|
||||
private String agentCode; // 전송사코드
|
||||
private String senderKey; // 발신프로필 키
|
||||
private String templateCode; // 템플릿 코드
|
||||
private String callTo; // 수신번호
|
||||
private String callFrom; // 발신번호
|
||||
private String msgType; // 메시지 타입
|
||||
private String templateContent; // 템플릿 내용
|
||||
private String templateTitle; // 템플릿 제목
|
||||
List<KakaoButtonVO> buttonList; // 템플릿 버튼 리스트
|
||||
private String subMsgSendYn; // 대체문자 전송 여부
|
||||
private String subMsgTxt; // 대체문자 내용
|
||||
private String subMsgType; // 대체문자 타입
|
||||
private String reqDate; // 예약일시
|
||||
|
||||
private String msgKind; // 예약일시
|
||||
|
||||
private String jsonStr; // jsonStr
|
||||
|
||||
|
||||
|
||||
private String adFlag; //친구톡 광고성 정보 사용 유무(Y:사용 , N:미사용)
|
||||
|
||||
private String sendKind; //문자전송 타입(H:홈페이지, A:API)
|
||||
// =====
|
||||
// =====
|
||||
|
||||
private String eachPrice; // sms 단가
|
||||
private String smsPrice; // sms 단가
|
||||
private String mmsPrice; // mms 단가
|
||||
private String picturePrice; // mms 단가
|
||||
private String totPrice; // mms 단가
|
||||
private String befCash; // mms 단가
|
||||
private String befPoint; // mms 단가
|
||||
private String kakaoAtPrice; // 카카오 알림톡 단가
|
||||
private String bizJsonName; // 카카오 알림톡 단가
|
||||
private String reserveYn; // 카카오 알림톡 단가
|
||||
private String atDelayYn; // 지연 문자 발송
|
||||
private String bizKakaoResendOrgnlTxt; // 카카오 알림톡 단가
|
||||
private String bizKakaoResendType; // 카카오 알림톡 단가
|
||||
private String filePath1; // 대체문자 이미지
|
||||
private String fileCnt; // 파일 카운트
|
||||
private String bizKakaoImageType; // 파일 카운트
|
||||
|
||||
private String spamStatus;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MsgSendVO[" +
|
||||
"\n msgId=[" + msgId + "]" +
|
||||
"\n , msgGroupId=[" + msgGroupId + "]" +
|
||||
"\n , msgGroupCnt=[" + msgGroupCnt + "]" +
|
||||
"\n , userId=[" + userId + "]" +
|
||||
"\n , agentCode=[" + agentCode + "]" +
|
||||
"\n , senderKey=[" + senderKey + "]" +
|
||||
"\n , templateCode=[" + templateCode + "]" +
|
||||
"\n , callTo=[" + callTo + "]" +
|
||||
"\n , callFrom=[" + callFrom + "]" +
|
||||
"\n , msgType=[" + msgType + "]" +
|
||||
"\n , templateContent=[" + templateContent + "]" +
|
||||
"\n , templateTitle=[" + templateTitle + "]" +
|
||||
"\n , buttonList=[" + (buttonList != null ? buttonList.toString() : "") + "]" +
|
||||
"\n , subMsgSendYn=[" + subMsgSendYn + "]" +
|
||||
"\n , subMsgTxt=[" + subMsgTxt + "]" +
|
||||
"\n , subMsgType=[" + subMsgType + "]" +
|
||||
"\n , reqDate=[" + reqDate + "]" +
|
||||
"\n , jsonStr=[" + jsonStr + "]" +
|
||||
"\n , sendKind=[" + sendKind + "]" +
|
||||
"\n , ==== MJ_MSG_DATA INSERT DATA END =======" +
|
||||
"\n " +
|
||||
"\n , eachPrice=[" + eachPrice + "]" +
|
||||
"\n , smsPrice=[" + smsPrice + "]" +
|
||||
"\n , mmsPrice=[" + mmsPrice + "]" +
|
||||
"\n , totPrice=[" + totPrice + "]" +
|
||||
"\n , befCash=[" + befCash + "]" +
|
||||
"\n , befPoint=[" + befPoint + "]" +
|
||||
"\n , kakaoAtPrice=[" + kakaoAtPrice + "]" +
|
||||
"\n , bizJsonName=[" + bizJsonName + "]" +
|
||||
"\n , reserveYn=[" + reserveYn + "]" +
|
||||
"\n , atDelayYn=[" + atDelayYn + "]" +
|
||||
"\n , bizKakaoResendOrgnlTxt=[" + bizKakaoResendOrgnlTxt + "]" +
|
||||
"\n , bizKakaoResendType=[" + bizKakaoResendType + "]" +
|
||||
"\n , filePath1=[" + filePath1 + "]" +
|
||||
"\n , bizKakaoImageType=[" + bizKakaoImageType + "]" +
|
||||
"\n ]";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -5,10 +5,7 @@ import java.awt.image.BufferedImage;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.InputStream;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
@ -18,9 +15,6 @@ import javax.annotation.Resource;
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.swing.ImageIcon;
|
||||
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
import org.apache.commons.io.output.ByteArrayOutputStream;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.http.HttpEntity;
|
||||
import org.apache.http.HttpResponse;
|
||||
import org.apache.http.client.HttpClient;
|
||||
@ -36,21 +30,16 @@ import org.apache.http.util.EntityUtils;
|
||||
import org.json.simple.JSONObject;
|
||||
import org.json.simple.parser.JSONParser;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import egovframework.rte.fdl.property.EgovPropertyService;
|
||||
import itn.com.cmm.service.EgovFileMngService;
|
||||
import itn.com.cmm.service.EgovFileMngUtil;
|
||||
import itn.com.cmm.service.FileVO;
|
||||
import itn.let.kakao.kakaoComm.KakaoReturnVO;
|
||||
import itn.let.kakao.kakaoComm.KakaoVO;
|
||||
import itn.let.mail.service.StatusResponse;
|
||||
import itn.let.utl.fcc.service.EgovStringUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@Slf4j
|
||||
@Component("kakaoApiImageUpload")
|
||||
public class KakaoApiImageUpload {
|
||||
|
||||
@ -68,17 +57,7 @@ public class KakaoApiImageUpload {
|
||||
|
||||
@Resource(name = "propertiesService")
|
||||
protected EgovPropertyService propertyService;
|
||||
|
||||
/** 첨부파일 저장경로 */
|
||||
@Value("#{globalSettings['Globals.file.saveDir']}")
|
||||
private String fileSaveDir;
|
||||
|
||||
@Resource(name="EgovFileMngUtil")
|
||||
private EgovFileMngUtil fileUtil;
|
||||
|
||||
|
||||
@Resource(name="EgovFileMngService")
|
||||
private EgovFileMngService fileMngService;
|
||||
|
||||
|
||||
/**
|
||||
* @Method Name : kakaoApiImageUpload
|
||||
@ -240,13 +219,13 @@ public class KakaoApiImageUpload {
|
||||
.addTextBody("bizId", mjonBizId)
|
||||
.addTextBody("apiKey", mjonBizKakaoApiKey)
|
||||
.addTextBody("imageType", kakaoVO.getImageType())
|
||||
.addTextBody("title", "test")
|
||||
.addTextBody("link", "https://maaa.com")
|
||||
.addTextBody("title", kakaoVO.getImgTitle())
|
||||
.addTextBody("link", kakaoVO.getImgLink())
|
||||
.addTextBody("senderKey", kakaoVO.getSenderKey())
|
||||
.addBinaryBody("image", new File(filePath),ContentType.MULTIPART_FORM_DATA,fullFileName)
|
||||
.build();
|
||||
|
||||
httpPost.setEntity(httpEntity);
|
||||
httpPost.setEntity(httpEntity);
|
||||
|
||||
CloseableHttpResponse response = httpClient.execute(httpPost);
|
||||
|
||||
@ -266,7 +245,6 @@ public class KakaoApiImageUpload {
|
||||
String msg = object.get("message").toString();
|
||||
String imgUrl = "";
|
||||
|
||||
log.info(" : code :: [{}]", code);
|
||||
if(code.equals("200")) {
|
||||
imgUrl = object.get("image").toString();
|
||||
}
|
||||
@ -295,176 +273,6 @@ public class KakaoApiImageUpload {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @methodName : kakaoApiImageUpload_advc
|
||||
* @author : 이호영
|
||||
* @date : 2025. 6. 4.
|
||||
* @description : kakaoApiImageUpload 수정
|
||||
* @return : StatusResponse
|
||||
* @param kakaoVO
|
||||
* @param files
|
||||
* @param i
|
||||
* @return
|
||||
* @throws Exception
|
||||
*
|
||||
*/
|
||||
public StatusResponse kakaoApiImageUpload_advc(KakaoVO kakaoVO, Map<String, MultipartFile> files, int fileKeyParam) throws Exception {
|
||||
// try {
|
||||
String storePathString = propertyService.getString("Globals.fileStorePath");
|
||||
File saveFolder = new File(storePathString);
|
||||
if (!saveFolder.exists()) saveFolder.mkdirs();
|
||||
|
||||
// for (MultipartFile file : files.values()) {
|
||||
MultipartFile file = files.values().stream().findFirst().orElse(null);
|
||||
if (file == null || file.isEmpty()) {
|
||||
return new StatusResponse(HttpStatus.BAD_REQUEST, "유효한 이미지 파일이 없습니다.", LocalDateTime.now());
|
||||
}
|
||||
|
||||
|
||||
String originalName = file.getOriginalFilename();
|
||||
if (originalName == null || originalName.isEmpty()) {
|
||||
return new StatusResponse(HttpStatus.BAD_REQUEST, "파일명이 비어 있습니다.", LocalDateTime.now());
|
||||
}
|
||||
|
||||
String ext = FilenameUtils.getExtension(originalName).toLowerCase();
|
||||
if (!ext.matches("jpg|jpeg|png")) {
|
||||
return new StatusResponse(HttpStatus.BAD_REQUEST, "지원하지 않는 이미지 형식입니다.");
|
||||
}
|
||||
|
||||
long size = file.getSize();
|
||||
if (size > 5 * 1024 * 1024) {
|
||||
return new StatusResponse(HttpStatus.BAD_REQUEST, "이미지 용량은 5MB 이내여야 합니다.");
|
||||
}
|
||||
|
||||
BufferedImage image = ImageIO.read(file.getInputStream());
|
||||
if (image == null) {
|
||||
return new StatusResponse(HttpStatus.BAD_REQUEST, "이미지를 읽을 수 없습니다.");
|
||||
}
|
||||
|
||||
int width = image.getWidth();
|
||||
int height = image.getHeight();
|
||||
String type = kakaoVO.getImageType();
|
||||
|
||||
if ("W".equals(type)) {
|
||||
if (width != 800 || height != 600) {
|
||||
return new StatusResponse(HttpStatus.BAD_REQUEST, "와이드 이미지는 800x600 사이즈만 허용됩니다.");
|
||||
}
|
||||
} else {
|
||||
float ratio = width / (float) height;
|
||||
// log.info("width : [{}], ",width);
|
||||
// log.info("height : [{}], ",height);
|
||||
// log.info("ratio : [{}], ",ratio);
|
||||
if (width < 500 || ratio < 0.75 || ratio > 2.0) {
|
||||
return new StatusResponse(HttpStatus.BAD_REQUEST, "일반 이미지는 가로 500px 이상, 비율 2:1 이상 또는 3:4 이하만 허용됩니다.");
|
||||
}
|
||||
}
|
||||
|
||||
String atchFileId = this.saveImgFile(files);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
String newName = EgovStringUtil.getTimeStamp() + fileKeyParam;
|
||||
String filePath = storePathString + File.separator + newName + "." + ext;
|
||||
file.transferTo(new File(filePath));
|
||||
|
||||
// 카카오 API 호출
|
||||
CloseableHttpClient httpClient = HttpClients.createDefault();
|
||||
String apiUrl = mjonBizUrl + "/v3/kakao/image/upload";
|
||||
|
||||
HttpPost httpPost = new HttpPost(apiUrl);
|
||||
/*HttpEntity httpEntity = MultipartEntityBuilder.create()
|
||||
.addTextBody("bizId", mjonBizId)
|
||||
.addTextBody("apiKey", mjonBizKakaoApiKey)
|
||||
.addTextBody("imageType", kakaoVO.getImageType())
|
||||
.addTextBody("title", kakaoVO.getImgTitle())
|
||||
.addTextBody("link", kakaoVO.getImgLink())
|
||||
.addTextBody("senderKey", kakaoVO.getSenderKey())
|
||||
.addBinaryBody("image", new File(filePath), ContentType.MULTIPART_FORM_DATA, newName + "." + ext)
|
||||
.build();
|
||||
*/
|
||||
|
||||
HttpEntity httpEntity = MultipartEntityBuilder.create()
|
||||
.addTextBody("bizId", mjonBizId)
|
||||
.addTextBody("apiKey", mjonBizKakaoApiKey)
|
||||
.addTextBody("imageType", kakaoVO.getImageType())
|
||||
.addTextBody("title", originalName)
|
||||
.addTextBody("link", StringUtils.isEmpty(kakaoVO.getImgLink()) ? "https://" : kakaoVO.getImgLink())
|
||||
.addTextBody("senderKey", kakaoVO.getSenderKey())
|
||||
.addBinaryBody("image", new File(filePath), ContentType.MULTIPART_FORM_DATA, newName + "." + ext)
|
||||
.build();
|
||||
;
|
||||
|
||||
httpPost.setEntity(httpEntity);
|
||||
|
||||
|
||||
|
||||
CloseableHttpResponse response = httpClient.execute(httpPost);
|
||||
int statusCode = response.getStatusLine().getStatusCode();
|
||||
|
||||
if (statusCode == 200) {
|
||||
String result = EntityUtils.toString(response.getEntity(), "UTF-8");
|
||||
JSONParser parser = new JSONParser();
|
||||
JSONObject object = (JSONObject) parser.parse(result);
|
||||
log.info("object + :: [{}]", object.toJSONString());
|
||||
|
||||
String code = object.get("code").toString();
|
||||
if ("200".equals(code)) {
|
||||
Map<String, Object> returnMap = new HashMap<>();
|
||||
returnMap.put("imgUrl", object.get("image").toString());
|
||||
returnMap.put("fileName", originalName);
|
||||
returnMap.put("atchFileId", atchFileId);
|
||||
|
||||
return new StatusResponse(HttpStatus.OK, "이미지 등록이 완료 되었습니다.", returnMap);
|
||||
} else {
|
||||
return new StatusResponse(HttpStatus.BAD_REQUEST, object.get("message").toString(), LocalDateTime.now());
|
||||
}
|
||||
} else {
|
||||
return new StatusResponse(HttpStatus.BAD_REQUEST, "카카오 API 요청 실패", LocalDateTime.now());
|
||||
}
|
||||
// }
|
||||
// } catch (Exception e) {
|
||||
// log.error("kakaoApiImageUpload_advc API Error", e);
|
||||
// return new StatusResponse(HttpStatus.BAD_REQUEST, "친구톡 이미지 등록에 실패했습니다.", LocalDateTime.now());
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
|
||||
private String saveImgFile(Map<String, MultipartFile> files) throws Exception {
|
||||
|
||||
|
||||
|
||||
String atchFileId = "";
|
||||
String isThumbFile = "";
|
||||
String imagePath = "";
|
||||
String KeyStr = "CANVASIMG_";
|
||||
|
||||
|
||||
Date now = new Date();
|
||||
SimpleDateFormat formatDate = new SimpleDateFormat("yyyyMMdd");
|
||||
String fdlDate = formatDate.format(now);
|
||||
|
||||
|
||||
imagePath = fileSaveDir+"/file/MMS/" + fdlDate;
|
||||
|
||||
|
||||
|
||||
if (!files.isEmpty()) {
|
||||
List<FileVO> result = fileUtil.parseImageFileInf(files, KeyStr, 0, atchFileId, imagePath, isThumbFile);
|
||||
atchFileId = fileMngService.insertFileInfs(result);
|
||||
}
|
||||
|
||||
|
||||
return atchFileId;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @Method Name : kakaoApiTemplateImageUpload
|
||||
* @작성일 : 2023. 2. 16.
|
||||
@ -680,20 +488,17 @@ public class KakaoApiImageUpload {
|
||||
jsonObject.put("apiKey", mjonBizKakaoApiKey);
|
||||
jsonObject.put("imageUrl", kakaoVO.getTemplateImageUrl());
|
||||
|
||||
log.info("kakaoVO.getTemplateImageUrl() :: [{}]", kakaoVO.getTemplateImageUrl());
|
||||
|
||||
HttpClient httpClient = HttpClientBuilder.create().build();
|
||||
HttpPost httpPost = new HttpPost(sendUrl);
|
||||
httpPost.setEntity(new StringEntity(jsonObject.toString(), "UTF-8"));
|
||||
httpPost.addHeader("Content-type", "application/json");
|
||||
httpPost.addHeader("Accept", "application/json");
|
||||
httpPost.addHeader("Accept", "application/json");
|
||||
|
||||
HttpResponse response = httpClient.execute(httpPost);
|
||||
|
||||
String result = "";
|
||||
String statusCode = Integer.toString(response.getStatusLine().getStatusCode());
|
||||
|
||||
log.info(" + statusCode :: [{}]", statusCode);
|
||||
if(statusCode.equals("200")) {
|
||||
|
||||
result = EntityUtils.toString(response.getEntity());
|
||||
@ -723,7 +528,5 @@ public class KakaoApiImageUpload {
|
||||
|
||||
return kakaoReturnVO;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -8,24 +8,16 @@ import java.io.OutputStreamWriter;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.json.simple.JSONArray;
|
||||
import org.json.simple.JSONObject;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.node.ArrayNode;
|
||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||
|
||||
import itn.com.cmm.util.StringUtil;
|
||||
import itn.let.kakao.kakaoComm.KakaoButtonVO;
|
||||
import itn.let.kakao.kakaoComm.KakaoReturnVO;
|
||||
import itn.let.kakao.kakaoComm.KakaoSendAdvcVO;
|
||||
import itn.let.kakao.kakaoComm.KakaoVO;
|
||||
|
||||
@Component
|
||||
@ -40,57 +32,7 @@ public class KakaoApiJsonSave {
|
||||
|
||||
static String json;
|
||||
|
||||
public String kakaoApiJsonSave_advc(KakaoSendAdvcVO sendVO, KakaoReturnVO templateDetail) {
|
||||
|
||||
// 버튼리스트 JSON 생성
|
||||
JSONArray buttonList = new JSONArray();
|
||||
for(KakaoButtonVO buttonInfoVO : sendVO.getButtonList()) {
|
||||
JSONObject buttonInfo = new JSONObject();
|
||||
|
||||
buttonInfo.put("name", buttonInfoVO.getName());
|
||||
buttonInfo.put("type", buttonInfoVO.getLinkType());
|
||||
|
||||
if(buttonInfoVO.getLinkType().equals("WL")) {
|
||||
buttonInfo.put("url_mobile", buttonInfoVO.getLinkMo());
|
||||
buttonInfo.put("url_pc", buttonInfoVO.getLinkPc());
|
||||
}else if(buttonInfoVO.getLinkType().equals("AL")) {
|
||||
buttonInfo.put("scheme_ios", buttonInfoVO.getLinkIos());
|
||||
buttonInfo.put("scheme_android", buttonInfoVO.getLinkAnd());
|
||||
}else if(buttonInfoVO.getLinkType().equals("BC")) {
|
||||
// 상담톡 진행시 등록해야함
|
||||
}else if(buttonInfoVO.getLinkType().equals("BT")) {
|
||||
// 봇 전환 시 전달
|
||||
}
|
||||
buttonList.add(buttonInfo);
|
||||
}
|
||||
|
||||
// 강조유형 JSON 생성
|
||||
JSONObject templateDetailInfo = new JSONObject();
|
||||
String emphasizeType = templateDetail.getTemplateEmphasizeType();
|
||||
|
||||
|
||||
if(emphasizeType.equals("TEXT")) {
|
||||
templateDetailInfo.put("title", sendVO.getTemplateTitle());
|
||||
}else if(emphasizeType.equals("IMAGE")) {
|
||||
templateDetailInfo.put("msg_type", "ai");
|
||||
}
|
||||
|
||||
|
||||
JSONObject jo = new JSONObject();
|
||||
|
||||
if(buttonList.size() != 0) {
|
||||
jo.put("button", buttonList);
|
||||
}
|
||||
if(templateDetailInfo.size() != 0) {
|
||||
jo.put("extra", templateDetailInfo);
|
||||
}
|
||||
|
||||
// 입력 json 데이터를 파일로 변경
|
||||
String jsonStr = jo.toString();
|
||||
|
||||
return jsonStr;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public String kakaoApiJsonSave(KakaoVO kakaoVO, String[] varValInfo) {
|
||||
// json파일 저장
|
||||
|
||||
@ -167,12 +109,12 @@ public class KakaoApiJsonSave {
|
||||
for(int i=0; i < varNm.length; i++) {
|
||||
for(int j=0; j < varValInfo.length; j++) {
|
||||
if (templateTitle.indexOf(varNm[i]) > -1) {
|
||||
if(varValInfo[j] != null) {
|
||||
templateTitle = templateTitle.replaceAll(varNm[i] , StringUtil.getString(varValInfo[j]));
|
||||
}else {
|
||||
templateTitle = templateTitle.replaceAll(varNm[i] , "");
|
||||
}
|
||||
}
|
||||
if(varValInfo[j] != null) {
|
||||
templateTitle = templateTitle.replaceAll(varNm[i] , StringUtil.getString(varValInfo[j]));
|
||||
}else {
|
||||
templateTitle = templateTitle.replaceAll(varNm[i] , "");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -198,8 +140,8 @@ public class KakaoApiJsonSave {
|
||||
|
||||
// 입력 json 데이터를 파일로 변경
|
||||
String jsonStr = jo.toString();
|
||||
// System.out.println("jsonFileName : "+jsonFileName);
|
||||
|
||||
System.out.println("jsonFileName : "+jsonFileName);
|
||||
|
||||
File outPut = new File(jsonFileName);
|
||||
outPut.createNewFile();
|
||||
|
||||
@ -214,139 +156,6 @@ public class KakaoApiJsonSave {
|
||||
return jsonFileName;
|
||||
}
|
||||
|
||||
/*
|
||||
* 친구톡 발송시 이미지, 버튼 추가에 따른 Json 파일 생성
|
||||
* 2025.04.18
|
||||
* 우영두
|
||||
* 파일은 하나만 생성해서 동일하게 사용함.
|
||||
*
|
||||
* */
|
||||
public String kakaoApiFTJsonSave_advc(KakaoVO kakaoVO) throws JsonProcessingException {
|
||||
// json파일 저장
|
||||
|
||||
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
ObjectNode jo = mapper.createObjectNode();
|
||||
|
||||
|
||||
|
||||
// 버튼
|
||||
if (kakaoVO.getButtonVOList() != null && !kakaoVO.getButtonVOList().isEmpty()) {
|
||||
ArrayNode buttonList = mapper.createArrayNode();
|
||||
|
||||
for (KakaoButtonVO buttonInfoVO : kakaoVO.getButtonVOList()) {
|
||||
ObjectNode button = mapper.createObjectNode();
|
||||
button.put("name", buttonInfoVO.getName());
|
||||
button.put("type", buttonInfoVO.getLinkType());
|
||||
|
||||
switch (buttonInfoVO.getLinkType()) {
|
||||
case "WL":
|
||||
button.put("url_mobile", buttonInfoVO.getLinkMo());
|
||||
button.put("url_pc", buttonInfoVO.getLinkPc());
|
||||
break;
|
||||
case "AL":
|
||||
button.put("scheme_ios", buttonInfoVO.getLinkIos());
|
||||
button.put("scheme_android", buttonInfoVO.getLinkAnd());
|
||||
break;
|
||||
case "BC":
|
||||
// 상담톡
|
||||
break;
|
||||
case "BT":
|
||||
// 봇 전환
|
||||
break;
|
||||
}
|
||||
buttonList.add(button);
|
||||
}
|
||||
jo.set("button", buttonList);
|
||||
}
|
||||
|
||||
|
||||
// 이미지
|
||||
String imageType = kakaoVO.getImageType();
|
||||
if (StringUtils.isNotEmpty(imageType)) {
|
||||
ObjectNode image = mapper.createObjectNode();
|
||||
image.put("img_url", kakaoVO.getTemplateImageUrl());
|
||||
image.put("img_link", StringUtils.isNotEmpty(kakaoVO.getImgLink()) ? kakaoVO.getImgLink() : kakaoVO.getTemplateImageUrl());
|
||||
jo.set("image", image);
|
||||
|
||||
// wide 여부
|
||||
if ("W".equals(imageType)) {
|
||||
ObjectNode extra = mapper.createObjectNode();
|
||||
extra.put("wide", "Y");
|
||||
jo.set("extra", extra);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// 문자열로 변환 (이스케이프 없음)
|
||||
return mapper.writeValueAsString(jo);
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
||||
|
||||
// 버튼리스트 JSON 생성
|
||||
JSONArray buttonList = new JSONArray();
|
||||
for(KakaoButtonVO buttonInfoVO : kakaoVO.getButtonVOList()) {
|
||||
JSONObject buttonInfo = new JSONObject();
|
||||
|
||||
buttonInfo.put("name", buttonInfoVO.getName());
|
||||
buttonInfo.put("type", buttonInfoVO.getLinkType());
|
||||
|
||||
if(buttonInfoVO.getLinkType().equals("WL")) {
|
||||
buttonInfo.put("url_mobile", buttonInfoVO.getLinkMo());
|
||||
buttonInfo.put("url_pc", buttonInfoVO.getLinkPc());
|
||||
}else if(buttonInfoVO.getLinkType().equals("AL")) {
|
||||
buttonInfo.put("scheme_ios", buttonInfoVO.getLinkIos());
|
||||
buttonInfo.put("scheme_android", buttonInfoVO.getLinkAnd());
|
||||
}else if(buttonInfoVO.getLinkType().equals("BC")) {
|
||||
// 상담톡 진행시 등록해야함
|
||||
}else if(buttonInfoVO.getLinkType().equals("BT")) {
|
||||
// 봇 전환 시 전달
|
||||
}
|
||||
buttonList.add(buttonInfo);
|
||||
}
|
||||
|
||||
// 강조유형 JSON 생성
|
||||
JSONObject templateImageInfo = new JSONObject();
|
||||
JSONObject templateImageExtInfo = new JSONObject();
|
||||
String imageType = kakaoVO.getImageType();
|
||||
|
||||
if(StringUtils.isNotEmpty(imageType)) {
|
||||
templateImageInfo.put("img_url", kakaoVO.getTemplateImageUrl());
|
||||
templateImageInfo.put("img_link", StringUtils.isNotEmpty(kakaoVO.getImgLink()) ? kakaoVO.getImgLink() : kakaoVO.getTemplateImageUrl() );
|
||||
}
|
||||
|
||||
// wide 여부
|
||||
if ("W".equals(imageType)) {
|
||||
ObjectNode extra = mapper.createObjectNode();
|
||||
extra.put("wide", "Y");
|
||||
jo.set("extra", extra);
|
||||
}
|
||||
|
||||
|
||||
JSONObject jo = new JSONObject();
|
||||
|
||||
if(buttonList.size() != 0) {
|
||||
jo.put("button", buttonList);
|
||||
}
|
||||
|
||||
if(templateImageInfo.size() != 0) {
|
||||
jo.put("image", templateImageInfo);
|
||||
}
|
||||
|
||||
if(templateImageExtInfo.size() != 0) {
|
||||
jo.put("extra", templateImageExtInfo);
|
||||
}
|
||||
|
||||
// 입력 json 데이터를 파일로 변경
|
||||
String jsonStr = jo.toString();
|
||||
|
||||
return jsonStr;*/
|
||||
}
|
||||
|
||||
/*
|
||||
* 친구톡 발송시 이미지, 버튼 추가에 따른 Json 파일 생성
|
||||
* 2024.01.17
|
||||
@ -437,7 +246,7 @@ public class KakaoApiJsonSave {
|
||||
// 입력 json 데이터를 파일로 변경
|
||||
String jsonStr = jo.toString();
|
||||
System.out.println("jsonFileName : "+jsonFileName);
|
||||
|
||||
|
||||
File outPut = new File(jsonFileName);
|
||||
outPut.createNewFile();
|
||||
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
package itn.let.kakao.kakaoComm.kakaoApi;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.apache.http.HttpResponse;
|
||||
@ -148,8 +146,24 @@ public class KakaoApiProfile {
|
||||
kakaoReturnVO.setBizReturnMsg(msg);
|
||||
|
||||
if(code.equals("200")) {
|
||||
kakaoReturnVO.setSenderKey((String) ((JSONObject) object.get("data")).get("senderKey"));
|
||||
JSONObject tempCate = (JSONObject) object.get("data");
|
||||
String senderKey = tempCate.get("senderKey").toString();
|
||||
kakaoVO.setSenderKey(senderKey);
|
||||
int profileCnt = kakaoApiService.selectKakaoProfileCnt(kakaoVO);
|
||||
|
||||
//중복된 발신프로필이 없으면 추가 입력
|
||||
if(profileCnt == 0) {
|
||||
kakaoApiService.insertKakaoProfileInfo(kakaoVO);
|
||||
}else {//중복이 있는 경우 처리
|
||||
|
||||
kakaoReturnVO.setBizReturnCode("310");
|
||||
kakaoReturnVO.setBizReturnMsg("이미 등록되어 있는 발신프로필 입니다");
|
||||
|
||||
return kakaoReturnVO;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}else {
|
||||
|
||||
kakaoReturnVO.setBizReturnCode(statusCode);
|
||||
@ -214,25 +228,24 @@ public class KakaoApiProfile {
|
||||
if(code.equals("200")) {
|
||||
|
||||
JSONObject templateProfile = (JSONObject) object.get("data");
|
||||
System.out.println("templateProfile = " + templateProfile.toJSONString());
|
||||
|
||||
String senderKey = getStringValue(templateProfile, "senderKey"); //발신프로필키
|
||||
String uuid = getStringValue(templateProfile, "uuid"); //카카오톡 채널
|
||||
String name = getStringValue(templateProfile, "name"); //카카오톡 채널 발신프로필 명
|
||||
String status = getStringValue(templateProfile, "status"); //발신프로필 상태
|
||||
boolean block = extractBoolean(templateProfile,"block", false); //발신프로필 차단 여부
|
||||
boolean dormant = extractBoolean(templateProfile, "dormant", false); //발신프로필 휴면 여부
|
||||
String profileStatus = getStringValue(templateProfile, "profileStatus"); //카카오톡 채널 상태((A: activated, C: deactivated, B: block, E: deleting, D: deleted)
|
||||
String createdAt = getStringValue(templateProfile, "createdAt"); //발신프로필 등록일
|
||||
String modifiedAt = getStringValue(templateProfile, "modifiedAt"); //최종수정일
|
||||
String categoryCode = getStringValue(templateProfile, "categoryCode"); //발신프로필 카테고리코드
|
||||
boolean alimtalk = extractBoolean(templateProfile, "alimtalk", false); //알림톡 사용 여부
|
||||
boolean bizchat =extractBoolean(templateProfile, "bizchat", false); //상담톡 사용 여부
|
||||
boolean brandtalk = extractBoolean(templateProfile, "brandtalk", false); //브랜드톡 사용 여부
|
||||
String committalCompanyName = getStringValue(templateProfile, "committalCompanyName"); //위탁사 이름(상담톡 관련)
|
||||
String channelKey = getStringValue(templateProfile, "channelKey"); //메시지 전송 결과 수신 채널키
|
||||
boolean businessProfile = extractBoolean(templateProfile, "businessProfile", false); //카카오톡 채널 비즈니스 인증 여부
|
||||
String businessType = getStringValue(templateProfile, "businessType"); //카카오톡 채널 비즈니스 인증 타입
|
||||
|
||||
String senderKey = (templateProfile.get("senderKey") == null) ? null : templateProfile.get("senderKey").toString(); //발신프로필키
|
||||
String uuid = (templateProfile.get("uuid") == null) ? null : templateProfile.get("uuid").toString(); //카카오톡 채널
|
||||
String name = (templateProfile.get("name") == null) ? null : templateProfile.get("name").toString(); //카카오톡 채널 발신프로필 명
|
||||
String status = (templateProfile.get("status") == null) ? null : templateProfile.get("status").toString(); //발신프로필 상태
|
||||
boolean block = (boolean) templateProfile.get("block"); //발신프로필 차단 여부
|
||||
boolean dormant = (boolean) templateProfile.get("dormant"); //발신프로필 휴면 여부
|
||||
String profileStatus = (templateProfile.get("profileStatus") == null) ? null : templateProfile.get("profileStatus").toString(); //카카오톡 채널 상태((A: activated, C: deactivated, B: block, E: deleting, D: deleted)
|
||||
String createdAt = (templateProfile.get("createdAt") == null) ? null : templateProfile.get("createdAt").toString(); //발신프로필 등록일
|
||||
String modifiedAt = (templateProfile.get("modifiedAt") == null) ? null : templateProfile.get("modifiedAt").toString(); //최종수정일
|
||||
String categoryCode = (templateProfile.get("categoryCode") == null) ? null : templateProfile.get("categoryCode").toString(); //발신프로필 카테고리코드
|
||||
boolean alimtalk = (boolean) templateProfile.get("alimtalk"); //알림톡 사용 여부
|
||||
boolean bizchat = (boolean) templateProfile.get("bizchat"); //상담톡 사용 여부
|
||||
boolean brandtalk = (boolean) templateProfile.get("brandtalk"); //브랜드톡 사용 여부
|
||||
String committalCompanyName = (templateProfile.get("committalCompanyName") == null) ? null : templateProfile.get("committalCompanyName").toString(); //위탁사 이름(상담톡 관련)
|
||||
String channelKey = (templateProfile.get("channelKey") == null) ? null : templateProfile.get("channelKey").toString(); //메시지 전송 결과 수신 채널키
|
||||
boolean businessProfile = (boolean) templateProfile.get("businessProfile"); //카카오톡 채널 비즈니스 인증 여부
|
||||
String businessType = (templateProfile.get("businessType") == null) ? null : templateProfile.get("businessType").toString(); //카카오톡 채널 비즈니스 인증 타입
|
||||
|
||||
|
||||
/*if(templateProfile.get("committalCompanyName") != null) {//위탁사 이름(상담톡 관련) 데이터가 NULL 로 넘어오는 경우가 있어서 예외처리해줌
|
||||
@ -277,16 +290,4 @@ public class KakaoApiProfile {
|
||||
return kakaoReturnVO;
|
||||
}
|
||||
|
||||
// 헬퍼 메서드
|
||||
private String getStringValue(JSONObject json, String key) {
|
||||
return Optional.ofNullable(json.get(key))
|
||||
.map(Object::toString)
|
||||
.orElse(null);
|
||||
}
|
||||
// Boolean 값 추출 헬퍼 메서드 (기본값 포함)
|
||||
private boolean extractBoolean(JSONObject json, String key, boolean defaultValue) {
|
||||
return Optional.ofNullable(json.get(key))
|
||||
.map(value -> (boolean) value) // boolean으로 캐스팅
|
||||
.orElse(defaultValue); // 키가 없으면 기본값 반환
|
||||
}
|
||||
}
|
||||
|
||||
@ -41,7 +41,6 @@ import itn.let.kakao.kakaoComm.KakaoReturnVO;
|
||||
import itn.let.kakao.kakaoComm.KakaoVO;
|
||||
import itn.let.kakao.kakaoComm.kakaoApi.service.KakaoApiService;
|
||||
import itn.let.utl.fcc.service.EgovStringUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* @FileName : KakaoApiTemplate.java
|
||||
@ -51,7 +50,6 @@ import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
* @프로그램 설명 :
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class KakaoApiTemplate {
|
||||
|
||||
@ -396,7 +394,6 @@ public class KakaoApiTemplate {
|
||||
|
||||
String sendUrl = mjonBizUrl + "/v3/kakao/template/list";
|
||||
|
||||
log.info(" + kakaoVO.getCategoryCode() :: [{}]", kakaoVO.getCategoryCode());
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("bizId", mjonBizId);
|
||||
jsonObject.put("apiKey", mjonBizKakaoApiKey);
|
||||
@ -440,8 +437,6 @@ public class KakaoApiTemplate {
|
||||
JSONParser parser = new JSONParser();
|
||||
Object obj = parser.parse(result);
|
||||
JSONObject object = (JSONObject) obj;
|
||||
log.info(" + object [{}]",object.toJSONString());
|
||||
|
||||
|
||||
String code = object.get("code").toString();
|
||||
String msg = object.get("message").toString();
|
||||
@ -461,9 +456,6 @@ public class KakaoApiTemplate {
|
||||
List<KakaoReturnVO> templatList = new ArrayList<KakaoReturnVO>() ;
|
||||
for(int i=0; i < tempJSONList.size(); i++) {
|
||||
JSONObject templateInfo = (JSONObject)tempJSONList.get(i);
|
||||
|
||||
|
||||
log.info(" + templateInfo [{}]",templateInfo.toJSONString());
|
||||
KakaoReturnVO templateInfoVO = new KakaoReturnVO();
|
||||
|
||||
String senderKey = templateInfo.get("senderKey").toString();
|
||||
|
||||
@ -30,6 +30,115 @@ public class KakaoFTJsonSave {
|
||||
|
||||
static String json;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public String kakaoApiJsonSave(KakaoVO kakaoVO, String[] varValInfo) {
|
||||
// json파일 저장
|
||||
|
||||
|
||||
Date nowDate = new Date();
|
||||
SimpleDateFormat todayFrom = new SimpleDateFormat("yyyyMMdd");
|
||||
SimpleDateFormat timeFrom = new SimpleDateFormat("HHmmss");
|
||||
String jsonFileName = mjonBizJsonDir+"/"+kakaoVO.getUserId()+"/"+todayFrom.format(nowDate)+"/"+kakaoVO.getSendType(); // 아이디/날짜/타입
|
||||
|
||||
String fileName = timeFrom.format(nowDate)+"_"+kakaoVO.getDestPhone()+".json";
|
||||
|
||||
try {
|
||||
|
||||
File userIdFile = new File(jsonFileName);
|
||||
if(!userIdFile.exists()) {
|
||||
userIdFile.mkdirs(); // 없으면 하위 디렉토리 까지 생성
|
||||
jsonFileName = jsonFileName +"/"+fileName;
|
||||
}else {
|
||||
|
||||
jsonFileName = jsonFileName +"/"+fileName;
|
||||
System.out.println("jsonFileName : "+jsonFileName);
|
||||
File file1 = new File(jsonFileName);
|
||||
if (file1.isFile()) {
|
||||
return jsonFileName;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
KakaoReturnVO templateDetail = kakaoApiTemplate.selectKakaoApiTemplateDetail(kakaoVO);
|
||||
|
||||
// 버튼리스트 JSON 생성
|
||||
JSONArray buttonList = new JSONArray();
|
||||
|
||||
// 버튼 수량 체크 후 진행
|
||||
for(KakaoButtonVO buttonInfoVO : templateDetail.getButtonList()) {
|
||||
JSONObject buttonInfo = new JSONObject();
|
||||
|
||||
buttonInfo.put("name", buttonInfoVO.getName());
|
||||
buttonInfo.put("type", buttonInfoVO.getLinkType());
|
||||
|
||||
if(buttonInfoVO.getLinkType().equals("WL")) {
|
||||
buttonInfo.put("url_mobile", buttonInfoVO.getLinkMo());
|
||||
buttonInfo.put("url_pc", buttonInfoVO.getLinkPc());
|
||||
}else if(buttonInfoVO.getLinkType().equals("AL")) {
|
||||
buttonInfo.put("scheme_ios", buttonInfoVO.getLinkIos());
|
||||
buttonInfo.put("scheme_android", buttonInfoVO.getLinkAnd());
|
||||
}else if(buttonInfoVO.getLinkType().equals("BC")) {
|
||||
// 상담톡 진행시 등록해야함
|
||||
}else if(buttonInfoVO.getLinkType().equals("BT")) {
|
||||
// 봇 전환 시 전달
|
||||
}
|
||||
buttonList.add(buttonInfo);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// Image JSON 생성
|
||||
JSONObject imageJson = new JSONObject();
|
||||
// img형과 wide 형인경우만 등록 (if문으로 제어)
|
||||
imageJson.put("img_url", "등록된 이미지 URL");
|
||||
imageJson.put("img_link", "이동 페이지 URL");
|
||||
|
||||
|
||||
// Wide JSON 생성
|
||||
JSONObject wideJson = new JSONObject();
|
||||
// wide 형인경우만 등록(if문으로 제어)
|
||||
wideJson.put("wide", "Y");
|
||||
|
||||
|
||||
|
||||
|
||||
JSONObject jo = new JSONObject();
|
||||
|
||||
if(imageJson.size() != 0) {
|
||||
jo.put("image", imageJson);
|
||||
}
|
||||
if(wideJson.size() != 0) {
|
||||
jo.put("extra", wideJson);
|
||||
}
|
||||
|
||||
if(buttonList.size() != 0) {
|
||||
jo.put("button", buttonList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// 입력 json 데이터를 파일로 변경
|
||||
String jsonStr = jo.toString();
|
||||
System.out.println("jsonFileName : "+jsonFileName);
|
||||
|
||||
File outPut = new File(jsonFileName);
|
||||
outPut.createNewFile();
|
||||
|
||||
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outPut), "euc-kr"));
|
||||
bw.write(jsonStr);
|
||||
bw.close();
|
||||
|
||||
} catch (IOException e) {
|
||||
System.out.println("json 생성 실패");
|
||||
e.printStackTrace();
|
||||
}
|
||||
return jsonFileName;
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public String kakaoApiJsonSave(KakaoVO kakaoVO) {
|
||||
|
||||
@ -2,11 +2,7 @@ package itn.let.kakao.user.kakaoAt.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import itn.let.kakao.kakaoComm.KakaoReturnVO;
|
||||
import itn.let.kakao.kakaoComm.KakaoVO;
|
||||
import itn.let.mail.service.StatusResponse;
|
||||
import itn.let.mjo.msgdata.service.MjonMsgReturnVO;
|
||||
|
||||
public interface KakaoAlimTalkService {
|
||||
@ -23,13 +19,10 @@ public interface KakaoAlimTalkService {
|
||||
//카카오 친구톡 발신
|
||||
public MjonMsgReturnVO insertKakaoFtSendAjax(KakaoVO kakaoVO) throws Exception;
|
||||
|
||||
StatusResponse insertKakaoAtSandAjax_advc(KakaoVO kakaoVO, HttpServletRequest request) throws Exception;
|
||||
//카카오 알림톡 전송 실패 환불리스트 조회
|
||||
public void selectKakaoAtSentRefundList() throws Exception;
|
||||
|
||||
//카카오(알림톡, 친구톡 통합) 전송 실패 환불리스트 조회
|
||||
public List<KakaoVO> selectKakaoSentRefundListForSingle() throws Exception;
|
||||
//카카오 친구톡 전송 실패 환불리스트 조회
|
||||
public void selectKakaoFtSentRefundList() throws Exception;
|
||||
|
||||
public void kakaoSingleRefund(KakaoVO kakaoVO) throws Exception;
|
||||
|
||||
//발신 프로필 등록 처리
|
||||
public KakaoReturnVO createKaKaoProfile(KakaoVO kakaoVO) throws Exception;
|
||||
}
|
||||
|
||||
@ -6,7 +6,6 @@ import java.util.List;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import egovframework.rte.psl.dataaccess.EgovAbstractDAO;
|
||||
import itn.let.kakao.kakaoComm.KakaoSendAdvcVO;
|
||||
import itn.let.kakao.kakaoComm.KakaoVO;
|
||||
|
||||
@Repository("kakaoAlimTalkDAO")
|
||||
@ -44,13 +43,27 @@ public class KakaoAlimTalkDAO extends EgovAbstractDAO {
|
||||
return result;
|
||||
}
|
||||
|
||||
public int insertKakaoAtDataInfo(List<KakaoVO> kakaoAtSandList) throws Exception{
|
||||
|
||||
int result = 0;
|
||||
|
||||
result = update("kakaoAlimTalkDAO.insertKakaoAtDataInfo", kakaoAtSandList);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public void insertKakaoSendPrice(KakaoVO kakaoVO) throws Exception{
|
||||
insert("kakaoAlimTalkDAO.insertKakaoSendPrice",kakaoVO);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public List<KakaoVO> selectKakaoSentRefundList() throws Exception{
|
||||
return (List<KakaoVO>) list("kakaoAlimTalkDAO.selectKakaoSentRefundList");
|
||||
public List<KakaoVO> selectKakaoAtSentRefundList() throws Exception{
|
||||
return (List<KakaoVO>) list("kakaoAlimTalkDAO.selectKakaoAtSentRefundList");
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public List<KakaoVO> selectKakaoFtSentRefundList() throws Exception{
|
||||
return (List<KakaoVO>) list("kakaoAlimTalkDAO.selectKakaoFtSentRefundList");
|
||||
}
|
||||
|
||||
public KakaoVO selectKakaoAtUmid(KakaoVO kakaoVO) throws Exception{
|
||||
@ -81,31 +94,4 @@ public class KakaoAlimTalkDAO extends EgovAbstractDAO {
|
||||
public void updateKakaoFtNotSend(KakaoVO kakaoVO) {
|
||||
select("kakaoAlimTalkDAO.updateKakaoFtNotSend", kakaoVO);
|
||||
}
|
||||
|
||||
public int insertKakaoAtDataInfo(List<KakaoVO> kakaoAtSandList) throws Exception{
|
||||
|
||||
int result = 0;
|
||||
|
||||
result = update("kakaoAlimTalkDAO.insertKakaoAtDataInfo", kakaoAtSandList);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public int insertKakaoAtDataInfo_advc(List<KakaoSendAdvcVO> kakaoSendAdvcVOList) {
|
||||
|
||||
return update("kakaoAlimTalkDAO.insertKakaoAtDataInfo_advc", kakaoSendAdvcVOList);
|
||||
}
|
||||
|
||||
public void insertKakaoAtDataJsonInfo_advc(List<KakaoSendAdvcVO> kakaoSendAdvcVOList) {
|
||||
insert("kakaoAlimTalkDAO.insertKakaoAtDataJsonInfo_advc", kakaoSendAdvcVOList);
|
||||
}
|
||||
|
||||
public void insertKakaoGroupDataTb_advc(KakaoSendAdvcVO sendVO) {
|
||||
insert("kakaoAlimTalkDAO.insertKakaoGroupDataTb_advc", sendVO);
|
||||
}
|
||||
|
||||
public KakaoVO selectBizLog(String bizUmid) {
|
||||
return (KakaoVO) select("kakaoAlimTalkDAO.selectBizLog", bizUmid);
|
||||
// return (KakaoVO) select("kakaoAlimTalkDAO.selectKakaoAtUmid", bizUmid);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,40 +1,19 @@
|
||||
package itn.let.kakao.user.kakaoAt.service.impl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl;
|
||||
import egovframework.rte.fdl.idgnr.EgovIdGnrService;
|
||||
import egovframework.rte.fdl.security.userdetails.util.EgovUserDetailsHelper;
|
||||
import itn.com.cmm.LoginVO;
|
||||
import itn.com.utl.fcc.service.EgovStringUtil;
|
||||
import itn.let.kakao.kakaoComm.BizKakaoPriceVO;
|
||||
import itn.let.kakao.kakaoComm.KakaoReturnVO;
|
||||
import itn.let.kakao.kakaoComm.KakaoSendAdvcVO;
|
||||
import itn.let.kakao.kakaoComm.KakaoSendUtil;
|
||||
import itn.let.kakao.kakaoComm.KakaoVO;
|
||||
import itn.let.kakao.kakaoComm.kakaoApi.service.KakaoApiService;
|
||||
import itn.let.kakao.user.kakaoAt.service.KakaoAlimTalkService;
|
||||
import itn.let.mail.service.StatusResponse;
|
||||
import itn.let.mjo.mjocommon.MjonCommon;
|
||||
import itn.let.mjo.mjocommon.MjonHolidayApi;
|
||||
import itn.let.mjo.msg.service.MjonMsgVO;
|
||||
import itn.let.mjo.msg.service.impl.MjonMsgDAO;
|
||||
@ -45,14 +24,9 @@ import itn.let.mjo.msgholiday.service.MsgHolidayVO;
|
||||
import itn.let.mjo.msgholiday.service.impl.MsgHolidayDAO;
|
||||
import itn.let.mjo.pay.service.MjonPayService;
|
||||
import itn.let.mjo.pay.service.MjonPayVO;
|
||||
import itn.let.mjo.pay.service.impl.MjonPayDAO;
|
||||
import itn.let.module.base.PriceAndPoint;
|
||||
import itn.let.sym.site.service.JoinSettingVO;
|
||||
import itn.let.sym.site.service.impl.SiteManagerDAO;
|
||||
import itn.let.uss.umt.service.EgovUserManageService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@Slf4j
|
||||
@Service("kakaoAlimTalkService")
|
||||
public class KakaoAlimTalkServiceImpl extends EgovAbstractServiceImpl implements KakaoAlimTalkService{
|
||||
|
||||
@ -73,41 +47,12 @@ public class KakaoAlimTalkServiceImpl extends EgovAbstractServiceImpl implements
|
||||
|
||||
@Resource(name = "egovMjonMsgIdGnrService")
|
||||
private EgovIdGnrService idgenMsgId;
|
||||
|
||||
@Resource(name = "egovMjonMsgGroupIdGnrService")
|
||||
private EgovIdGnrService idgenMjonMsgGroupId;
|
||||
|
||||
@Resource(name = "mjonPayService")
|
||||
private MjonPayService mjonPayService;
|
||||
|
||||
@Resource(name = "egovMjonCashIdGnrService")
|
||||
private EgovIdGnrService idgenMjonCashId;
|
||||
|
||||
/** userManageService */
|
||||
@Resource(name = "userManageService")
|
||||
private EgovUserManageService userManageService;
|
||||
|
||||
@Resource(name = "kakaoApiService")
|
||||
private KakaoApiService kakaoApiService;
|
||||
|
||||
@Autowired
|
||||
private MjonPayDAO mjonPayDAO;
|
||||
|
||||
@Autowired
|
||||
KakaoSendUtil kakaoSendUtil;
|
||||
|
||||
@Autowired
|
||||
private MjonCommon mjonCommon;
|
||||
|
||||
@Autowired
|
||||
private PriceAndPoint priceAndPoint;
|
||||
|
||||
final String KAKAO_SUCCESS_CODE = "7000";
|
||||
final String RESEND_YN_YES = "Y";
|
||||
final String SMS_SUCCESS_CODE = "4100"; // SMS 성공 코드
|
||||
final String MMS_SUCCESS_CODE = "6600"; // MMS 성공 코드
|
||||
final String AT_MSG_TYPE = "8"; // MSG 타입 알림톡
|
||||
final String FT_MSG_TYPE = "9"; // MSG 타입 친구톡
|
||||
|
||||
//발신프로필 상태값 변경(삭제/복구 기능)
|
||||
@Override
|
||||
@ -796,491 +741,79 @@ public class KakaoAlimTalkServiceImpl extends EgovAbstractServiceImpl implements
|
||||
return returnVO;
|
||||
}
|
||||
|
||||
private void processKakaoSendCharge(KakaoVO kakaoVO) throws Exception {
|
||||
|
||||
//1-1.카카오톡 발송 성공 + 대체문자 신청 O : 대체문자 금액 환불
|
||||
if(RESEND_YN_YES.equals(kakaoVO.getSubMsgSendYn())) {
|
||||
|
||||
BizKakaoPriceVO bizKakaoPriceVO = mjonPayDAO.selectBizKakaoPrice(kakaoVO.getMsgGroupId());
|
||||
|
||||
BigDecimal sendPrice = null;
|
||||
|
||||
if(AT_MSG_TYPE.equals(kakaoVO.getMsgType())){
|
||||
sendPrice = new BigDecimal(bizKakaoPriceVO.getBizKakaoAtPrice());
|
||||
}else {
|
||||
if(StringUtils.isEmpty(kakaoVO.getBizKakaoImageType())){
|
||||
sendPrice = new BigDecimal(bizKakaoPriceVO.getBizKakaoFtPrice());
|
||||
}else if("I".equals(kakaoVO.getBizKakaoImageType())){
|
||||
sendPrice = new BigDecimal(bizKakaoPriceVO.getBizKakaoFtImgPrice());
|
||||
}else if("W".equals(kakaoVO.getBizKakaoImageType())){
|
||||
sendPrice = new BigDecimal(bizKakaoPriceVO.getBizKakaoFtWideImgPrice());
|
||||
}
|
||||
}
|
||||
// 예시: 각 건당 가격이 이미 String 형태라면 변환
|
||||
BigDecimal eachPrice = new BigDecimal(kakaoVO.getEachPrice());
|
||||
|
||||
// 차이 계산
|
||||
BigDecimal diffPrice = eachPrice.subtract(sendPrice);
|
||||
|
||||
//대체문자 비용(eachPrace - sendPrice)
|
||||
if (diffPrice.compareTo(BigDecimal.ZERO) > 0) {
|
||||
String result = diffPrice.toString();
|
||||
kakaoVO.setEachPrice(result);
|
||||
handleRefund(kakaoVO, "카카오 " + kakaoVO.getMsgTypeTxt() + " 발송 성공 후 대체문자 금액 환불");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//1-2.카카오톡 발송 성공 + 대체문자 신청 X : 금액 환불 X
|
||||
}
|
||||
|
||||
private void handleAlternativeMessageScenario(KakaoVO kakaoVO) throws Exception {
|
||||
KakaoVO bizLogVO = kakaoAlimTalkDAO.selectBizLog(kakaoVO.getBizUmid());
|
||||
log.info("대체문자 전송 UMID: {}", kakaoVO.getBizUmid());
|
||||
|
||||
//2-1.카카오톡 발송 실패 + 대체문자 발송 성공 : 금액 환불 X
|
||||
boolean isAlternativeMessageSuccessful = false;
|
||||
if (bizLogVO != null && StringUtils.isNotEmpty(bizLogVO.getBizLogCallStatus())) {
|
||||
if (SMS_SUCCESS_CODE.equals(bizLogVO.getBizLogCallStatus())
|
||||
|| MMS_SUCCESS_CODE.equals(bizLogVO.getBizLogCallStatus())) {
|
||||
isAlternativeMessageSuccessful = true;
|
||||
}
|
||||
log.info("bizLogVO.getBizLogCallStatus() :: [{}]", bizLogVO.getBizLogCallStatus());
|
||||
log.info("isAlternativeMessageSuccessful :: [{}]", isAlternativeMessageSuccessful);
|
||||
}
|
||||
|
||||
|
||||
//2-2.카카오톡 발송 실패 + 대체문자 발송 실패 : 전액 환불
|
||||
if (!isAlternativeMessageSuccessful) {
|
||||
handleRefund(kakaoVO, "카카오 " + kakaoVO.getMsgTypeTxt() + " 전송 실패로 인한 결제 금액 환불");
|
||||
}
|
||||
}
|
||||
|
||||
private void handleRefund(KakaoVO vo, String msg) throws Exception {
|
||||
// mj_cash 테이블에 환불 내역 추가 및 회원 금액 업데이트
|
||||
// eachPrice는 환불될 금액이므로 양수여야 합니다.
|
||||
priceAndPoint.insertCashAndPointNoUpdate(
|
||||
vo.getUserId(),
|
||||
Float.parseFloat(vo.getEachPrice()), // 환불 금액은 양수
|
||||
msg,
|
||||
vo.getMsgGroupId(),
|
||||
vo.getUserData()
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public StatusResponse insertKakaoAtSandAjax_advc(KakaoVO kakaoVO, HttpServletRequest request) throws Exception {
|
||||
|
||||
log.info(" :: [{}]", kakaoVO.toString());
|
||||
|
||||
|
||||
// 측정할 메소드 호출 전 시간 기록
|
||||
Instant start = Instant.now();
|
||||
// KakaoSendAdvcVO
|
||||
|
||||
Map<String, Object> returnMap = new HashMap<>();
|
||||
Map<String, Object> apiReturnMap = new HashMap<>();
|
||||
|
||||
String userId = "";
|
||||
if("A".equals(kakaoVO.getSendKind()))
|
||||
{
|
||||
userId = kakaoVO.getMberId();
|
||||
}else {
|
||||
LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated()
|
||||
? (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser()
|
||||
: null;
|
||||
userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId());
|
||||
|
||||
if (userId.equals("")) {
|
||||
return new StatusResponse(HttpStatus.BAD_REQUEST, "로그인 후 이용이 가능합니다.");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
kakaoVO.setUserId(userId);
|
||||
|
||||
/**
|
||||
* 회원 정지된 상태이면 문자 발송이 안되도록 처리함 현재 로그인 세션도 만료 처리함
|
||||
*/
|
||||
boolean mberSttus = userManageService.selectUserStatusInfo(userId);
|
||||
if (!mberSttus) {
|
||||
request.getSession().invalidate();
|
||||
// UNAUTHORIZED : 인증되지 않은 사용자가 접근하려고 할 때
|
||||
return new StatusResponse(HttpStatus.UNAUTHORIZED,
|
||||
"현재 고객님께서는 문자온 서비스 이용이 정지된 상태로 알림톡을 발송하실 수 없습니다. 이용정지 해제를 원하시면 고객센터로 연락주시기 바랍니다.", "STAT_1070");
|
||||
}
|
||||
|
||||
|
||||
StatusResponse statusResponse = new StatusResponse();
|
||||
|
||||
/** @isHolidayNotified
|
||||
* @false : 알림 X
|
||||
* @true : 알림 O */
|
||||
boolean isNotified = mjonCommon.processUserAndCheckAT(kakaoVO);
|
||||
|
||||
|
||||
|
||||
/** @카카오톡 전송 list 셋팅 -------------------------------------------*/
|
||||
List<KakaoSendAdvcVO> kakaoSendAdvcListVO = kakaoSendUtil.populateSendLists(kakaoVO, isNotified, statusResponse);
|
||||
if (statusResponse.getStatus() != null && !statusResponse.getStatus().equals(HttpStatus.OK)) {
|
||||
log.error(" + populateSendLists 처리 중 오류 발생: {}", statusResponse.getMessage());
|
||||
return statusResponse;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** @전송금액 확인 --------------------------------------------------*/
|
||||
if (!kakaoSendUtil.isCashSufficient(userId, kakaoSendAdvcListVO)) {
|
||||
log.error("Insufficient balance for message sending.");
|
||||
return new StatusResponse(HttpStatus.BAD_REQUEST, "문자 발송에 필요한 보유 잔액이 부족 합니다.", "STAT_1060");
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** @json파일이 있을 떄 biz_attachments insert */
|
||||
kakaoSendUtil.insertKakaoAtDataJsonInfo_advc(kakaoSendAdvcListVO);
|
||||
// this.insertKakaoAtDataJsonInfo_advc(kakaoSendAdvcListVO);
|
||||
|
||||
|
||||
Map<String, List<KakaoSendAdvcVO>> priceGroupedMessages = kakaoSendAdvcListVO.stream()
|
||||
.collect(Collectors.groupingBy(KakaoSendAdvcVO::getEachPrice));
|
||||
// instTotalCnt : 화면에서 보여줄 총 발송건수
|
||||
int instTotalCnt = 0;
|
||||
// 임시
|
||||
List<String> nextMsgGroupIdA = new ArrayList<>();
|
||||
// 대안: entrySet() 직접 사용
|
||||
String apiMsgGroupId = "";
|
||||
String apiMsgType = "";
|
||||
for (Map.Entry<String, List<KakaoSendAdvcVO>> entry : priceGroupedMessages.entrySet()) {
|
||||
// entry 사용
|
||||
|
||||
List<KakaoSendAdvcVO> groupedMsgList = entry.getValue(); // 해당 가격의 메시지 리스트
|
||||
|
||||
String nextMsgGroupId = idgenMjonMsgGroupId.getNextStringId();
|
||||
groupedMsgList.forEach(t -> t.setMsgGroupId(nextMsgGroupId));
|
||||
|
||||
|
||||
// api 전달 값
|
||||
apiMsgGroupId = StringUtils.isNotEmpty(apiMsgGroupId)
|
||||
? apiMsgGroupId + "," + nextMsgGroupId
|
||||
: nextMsgGroupId;
|
||||
|
||||
apiMsgType = StringUtils.isNotEmpty(apiMsgType)
|
||||
? apiMsgType + "," + kakaoSendAdvcListVO.get(0).getMsgType()
|
||||
: kakaoSendAdvcListVO.get(0).getMsgType();
|
||||
|
||||
|
||||
|
||||
groupedMsgList.stream().forEach(t-> log.info("t.toString() [{}]", t.toString()));
|
||||
|
||||
//
|
||||
// if(1==1) {
|
||||
//
|
||||
// // 강제로 예외 발생
|
||||
// throw new RuntimeException("강제 예외 발생 테스트");
|
||||
// }
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
// 발송 데이터 삽입
|
||||
int instCnt = kakaoSendUtil.insertKakaoData_advc(groupedMsgList);
|
||||
// int instCnt = 6;
|
||||
|
||||
if(instCnt > 0) {
|
||||
|
||||
instTotalCnt += instCnt;
|
||||
|
||||
KakaoSendAdvcVO sendVO = groupedMsgList.get(0);
|
||||
|
||||
// log.info(" ++ kakaoVO.getAtSmishingYn() :: [{}]", kakaoVO.getAtSmishingYn());
|
||||
// log.info(" ++ kakaoVO.getAtDelayYn() :: [{}]", kakaoVO.getAtDelayYn());
|
||||
/** @groupData 테이블 insert */
|
||||
kakaoSendUtil.insertKakaoGroupDataTb_advc(instCnt, kakaoVO, sendVO);
|
||||
|
||||
|
||||
/** @biz_kakao_price에 insert (대체문자 환불관련 테이블)*/
|
||||
kakaoVO.setMsgGroupId(sendVO.getMsgGroupId());
|
||||
kakaoVO.setKakaoAtPrice(Float.parseFloat(sendVO.getKakaoAtPrice()));
|
||||
kakaoVO.setSmsPrice(Float.parseFloat(sendVO.getSmsPrice()));
|
||||
kakaoVO.setMmsPrice(Float.parseFloat(sendVO.getMmsPrice()));
|
||||
|
||||
kakaoAlimTalkDAO.insertKakaoSendPrice(kakaoVO);
|
||||
|
||||
|
||||
priceAndPoint.insertCashAndPoint(kakaoVO.getUserId()
|
||||
, -Float.parseFloat(sendVO.getTotPrice())
|
||||
, "카카오 알림톡 총 "+groupedMsgList.size()+"건 중 " + instCnt + "건 발송"
|
||||
, nextMsgGroupId
|
||||
);
|
||||
|
||||
|
||||
/** @SLACK발송 */
|
||||
/** @발송조건이되면 발송 */
|
||||
if(isNotified) {
|
||||
mjonCommon.getAdminKakaoAtSendSlack(sendVO);
|
||||
}else if("Y".equals(kakaoVO.getAtSmishingYn())){
|
||||
/** @발송조건이 안되면 DB INSERT */
|
||||
mjonMsgDAO.insertSpamPassMsgData(MjonMsgVO.builder()
|
||||
.msgGroupId(nextMsgGroupId)
|
||||
.userId(kakaoVO.getUserId())
|
||||
.reqDate(kakaoVO.getReqDate())
|
||||
.smsTxt(groupedMsgList.get(0).getTemplateContent())
|
||||
.totalCallCnt(instCnt)
|
||||
.callFrom(kakaoVO.getCallFrom())
|
||||
.msgType("8")
|
||||
.reserveYn(kakaoVO.getReserveYn())
|
||||
.build()
|
||||
);
|
||||
}
|
||||
|
||||
nextMsgGroupIdA.add(nextMsgGroupId);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
apiReturnMap.put("resultSts", instTotalCnt);
|
||||
// 그룹 ID
|
||||
apiReturnMap.put("msgGroupId", apiMsgGroupId);
|
||||
// 메세지 타입
|
||||
apiReturnMap.put("msgType", apiMsgType);
|
||||
|
||||
returnMap.put("resultSts", instTotalCnt);
|
||||
|
||||
returnMap.put("reserYn", kakaoVO.getReserveYn());
|
||||
returnMap.put("groupIds", nextMsgGroupIdA);
|
||||
|
||||
|
||||
// 측정할 메소드 호출 후 시간 기록
|
||||
Instant end = Instant.now();
|
||||
|
||||
log.info(" + start :: [{}]", start);
|
||||
// 실행 시간 계산 (나노초, 밀리초, 초)
|
||||
long seconds = Duration.between(start, end).getSeconds();
|
||||
System.out.println("메소드 실행 시간 (초): " + seconds + " s");
|
||||
double minutes = seconds / 60.0; // 소수점 포함을 위해 60.0으로 나눔
|
||||
|
||||
returnMap.put("second", seconds+" s");
|
||||
returnMap.put("minutes", minutes+" min");
|
||||
|
||||
|
||||
// System.out.println("메소드 실행 시간 (분): " + minutes + " min");
|
||||
|
||||
|
||||
|
||||
|
||||
// priceAndPoint.getBefCash(userId);
|
||||
|
||||
|
||||
|
||||
|
||||
statusResponse.setStatus(HttpStatus.OK);
|
||||
statusResponse.setObject(returnMap);
|
||||
apiReturnMap.put("result", HttpStatus.OK);
|
||||
apiReturnMap.put("message", "전송이 완료되었습니다.");
|
||||
statusResponse.setApiReturn(apiReturnMap);
|
||||
|
||||
return statusResponse;
|
||||
}
|
||||
@Override
|
||||
public List<KakaoVO> selectKakaoSentRefundListForSingle() throws Exception{
|
||||
return kakaoAlimTalkDAO.selectKakaoSentRefundList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void kakaoSingleRefund(KakaoVO kakaoVO) throws Exception {
|
||||
|
||||
System.out.println(kakaoVO.getMsgGroupId() +"________결과 : " +kakaoVO.getRsltCode() +" 대체문자 전송 : "+kakaoVO.getSubMsgSendYn());
|
||||
kakaoVO.setMsgTypeTxt(AT_MSG_TYPE.equals(kakaoVO.getMsgType()) ? "알림톡" : "친구톡");
|
||||
|
||||
if(KAKAO_SUCCESS_CODE.equals(kakaoVO.getRsltCode())) {
|
||||
//1.카카오톡 발송 성공
|
||||
processKakaoSendCharge(kakaoVO);
|
||||
|
||||
}else if(RESEND_YN_YES.equals(kakaoVO.getSubMsgSendYn())) {//카카오톡 발송 실패, 대체문자 발송 신청 O
|
||||
//2.카카오톡 발송 실패 + 대체문자 신청 O
|
||||
handleAlternativeMessageScenario(kakaoVO);
|
||||
|
||||
}else {
|
||||
//3.카카오톡 발송 실패 + 대체문자 신청 X : 전액 환불
|
||||
handleRefund(kakaoVO, "카카오 " + kakaoVO.getMsgTypeTxt() + " 전송 실패로 인한 결제 금액 환불");
|
||||
}
|
||||
|
||||
//모든 유형 환불 완료 처리
|
||||
mjonMsgDAO.updateRefundY(kakaoVO);
|
||||
}
|
||||
|
||||
private void insertKakaoAtDataJsonInfo_advc(List<KakaoSendAdvcVO> kakaoSendAdvcListVO) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
// 측정할 메소드 호출 전 시간 기록
|
||||
List<KakaoSendAdvcVO> jsonInfoData = new ArrayList<>(kakaoSendAdvcListVO);
|
||||
jsonInfoData.removeIf(t -> StringUtils.isBlank(t.getJsonStr()));
|
||||
log.info(" + jsonInfoData Insert :: [{}]", jsonInfoData.size());
|
||||
if(jsonInfoData.size() > 0) {
|
||||
kakaoAlimTalkDAO.insertKakaoAtDataJsonInfo_advc(jsonInfoData);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void insertKakaoGroupDataTb_advc(int instCnt, KakaoVO kakaoVO, KakaoSendAdvcVO sendVO) throws Exception {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
// log.info(" + insertKakaoGroupDataTb_advc kakaoVO :: \n[{}]", kakaoVO.toString());;
|
||||
// log.info(" + insertKakaoGroupDataTb_advc kakaoSendAdvcVOList :: \n[{}]", sendVO.toString());
|
||||
|
||||
sendVO.setMsgGroupCnt(Integer.toString(instCnt));
|
||||
sendVO.setReserveYn(kakaoVO.getReserveYn());
|
||||
sendVO.setBefCash(priceAndPoint.getBefCash(sendVO.getUserId()));
|
||||
sendVO.setBefPoint(priceAndPoint.getBefPoint(sendVO.getUserId()));
|
||||
|
||||
Float eachPrice = Float.parseFloat(sendVO.getEachPrice());
|
||||
|
||||
Float totPrice = eachPrice * instCnt;
|
||||
sendVO.setTotPrice(String.format("%.1f", totPrice));
|
||||
|
||||
sendVO.setAtDelayYn(StringUtils.isEmpty(kakaoVO.getAtSmishingYn()) ? "N" : kakaoVO.getAtSmishingYn());
|
||||
sendVO.setSendKind(StringUtils.isEmpty(kakaoVO.getSendKind()) ? "H" : kakaoVO.getSendKind());
|
||||
sendVO.setBizKakaoResendOrgnlTxt(kakaoVO.getSubMsgTxt());
|
||||
sendVO.setBizKakaoResendType(sendVO.getSubMsgType());
|
||||
|
||||
kakaoAlimTalkDAO.insertKakaoGroupDataTb_advc(sendVO);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @methodName : insertKakaoData_advc
|
||||
* @author : 이호영
|
||||
* @date : 2025. 3. 20.
|
||||
* @description : 카카오 batch 발송 => mj_msg_data
|
||||
* @return : int
|
||||
* @param kakaoSendAdvcVOList
|
||||
* @param parentLoopCount
|
||||
* @param isJsonNotEmpty
|
||||
* @param isJsonNameAllSame
|
||||
* @return
|
||||
/*
|
||||
* 카카오 알림톡 발송 실패에 따른 금액 환불 처리
|
||||
*
|
||||
*/
|
||||
private int insertKakaoData_advc(List<KakaoSendAdvcVO> kakaoSendAdvcVOList) {
|
||||
|
||||
|
||||
// 시작 시간 측정
|
||||
long totalStartTime = System.currentTimeMillis();
|
||||
|
||||
int totalSize = kakaoSendAdvcVOList.size(); // 총 데이터 개수
|
||||
// Batch 크기 설정 (고정값)
|
||||
// int batchSize = 10000; 465
|
||||
int batchSize = 50000; // 9분 18초
|
||||
|
||||
log.info("총 데이터 개수 :: [{}] ", totalSize);
|
||||
log.info("설정된 Batch 크기 :: [{}] ", batchSize);
|
||||
|
||||
// 총 insert 카운트
|
||||
int instCnt = 0;
|
||||
int batchCount = 0;
|
||||
|
||||
// 각 배치별 실행 시간 기록
|
||||
List<Double> batchExecutionTimes = new ArrayList<>();
|
||||
|
||||
|
||||
// 첫 번째 배치에서만 삽입했는지 추적하는 플래그
|
||||
for (int i = 0; i < totalSize; i += batchSize) {
|
||||
// Batch 시작 시간 측정
|
||||
long batchStartTime = System.currentTimeMillis();
|
||||
|
||||
// Batch 리스트 생성
|
||||
List<KakaoSendAdvcVO> batchList = kakaoSendAdvcVOList.subList(i, Math.min(i + batchSize, totalSize));
|
||||
System.out.println("Batch 시작 인덱스: " + i);
|
||||
|
||||
// mj_msg_data 테이블 insert
|
||||
int insertedCount = kakaoAlimTalkDAO.insertKakaoAtDataInfo_advc(batchList);
|
||||
|
||||
/** @kakaoSendUtil.populateSendLists
|
||||
* 하단에서
|
||||
* getJsonStr 데이터 처리 후 활용
|
||||
* */
|
||||
instCnt += insertedCount;
|
||||
|
||||
// Batch 종료 시간 측정 및 실행 시간 계산
|
||||
long batchEndTime = System.currentTimeMillis();
|
||||
double batchExecutionTimeInSeconds = (batchEndTime - batchStartTime) / 1000.0;
|
||||
|
||||
// 실행 시간 기록
|
||||
batchExecutionTimes.add(batchExecutionTimeInSeconds);
|
||||
batchCount++;
|
||||
}
|
||||
|
||||
// 종료 시간 측정
|
||||
long totalEndTime = System.currentTimeMillis();
|
||||
|
||||
// 총 실행 시간 계산 (밀리초 -> 초로 변환)
|
||||
double totalExecutionTimeInSeconds = (totalEndTime - totalStartTime) / 1000.0;
|
||||
|
||||
// 실행 시간 출력
|
||||
log.info("총 배치 실행 횟수 :: [{}] ", batchCount);
|
||||
log.info("batchSize :: [{}] ", batchSize);
|
||||
log.info("총 실행 시간 :: [{}] ", totalExecutionTimeInSeconds + "초");
|
||||
log.info("총 삽입 건수 :: [{}] ", instCnt);
|
||||
|
||||
// 각 배치별 실행 시간 출력
|
||||
for (int k = 0; k < batchExecutionTimes.size(); k++) {
|
||||
System.out.println("배치 " + (k + 1) + " 실행 시간 :: " + batchExecutionTimes.get(k) + "초");
|
||||
}
|
||||
|
||||
return instCnt;
|
||||
|
||||
}
|
||||
|
||||
// 보유 금액이 충분한지 확인하는 메서드
|
||||
private boolean isCashSufficient(String userId, List<KakaoSendAdvcVO> kakaoSendAdvcListVO) throws Exception {
|
||||
|
||||
|
||||
String userMoney = priceAndPoint.getBefCash(userId);
|
||||
// 쉼표 제거
|
||||
userMoney = userMoney.replace(",", "");
|
||||
|
||||
// 사용자 보유 금액 BigDecimal 변환 (HALF_EVEN 적용)
|
||||
BigDecimal befCash = new BigDecimal(userMoney).setScale(2, RoundingMode.HALF_EVEN);
|
||||
|
||||
// 총 메시지 금액 계산 (HALF_EVEN 적용)
|
||||
BigDecimal totalEachPrice = kakaoSendAdvcListVO.stream()
|
||||
.map(msg -> new BigDecimal(String.valueOf(msg.getEachPrice()))) // 변환 오류 방지
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add)
|
||||
.setScale(2, RoundingMode.HALF_EVEN); // 일관성 유지
|
||||
|
||||
// 비교 수행
|
||||
return befCash.compareTo(totalEachPrice) >= 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
* */
|
||||
@Override
|
||||
public KakaoReturnVO createKaKaoProfile(KakaoVO kakaoVO) throws Exception {
|
||||
KakaoReturnVO returnVO = new KakaoReturnVO();
|
||||
public void selectKakaoAtSentRefundList() throws Exception {
|
||||
|
||||
/* senderKey 사용 우무 */
|
||||
int profileCnt = kakaoApiService.selectKakaoProfileCnt(kakaoVO);
|
||||
if(profileCnt > 0) {
|
||||
returnVO.setBizReturnMsg("이미 등록된 발신프로필입니다. 동일 채널ID는 중복 등록이 불가합니다.");
|
||||
}else {
|
||||
List<KakaoVO> delProfileList = new ArrayList<KakaoVO>();
|
||||
delProfileList = selectDeleteProfileInfo(kakaoVO);
|
||||
|
||||
if(delProfileList.size() != 0) {
|
||||
kakaoVO.setProfileId(delProfileList.get(0).getProfileId());
|
||||
kakaoVO.setDeleteYn("N");
|
||||
updateKakaoProfileStatus(kakaoVO);
|
||||
returnVO.setBizReturnMsg("삭제 발신프로필의 복구가 완료 되었습니다.");
|
||||
/**
|
||||
* 1. 카카오 AT 전송성공 확인
|
||||
* 2. 카카오 AT 전송실패, 대채문자 전송확인
|
||||
* 3. 카카오 AT 전송 실패 확인
|
||||
*/
|
||||
List<KakaoVO> kakaoAtSentRefundList = kakaoAlimTalkDAO.selectKakaoAtSentRefundList();
|
||||
|
||||
for(KakaoVO vo : kakaoAtSentRefundList) {
|
||||
System.out.println(vo.getMsgGroupId() +"________결과 : " +vo.getRsltCode() +" 대체문자 전송 : "+vo.getSubMsgSendYn());
|
||||
if(vo.getRsltCode().equals("7000")) {
|
||||
kakaoAlimTalkDAO.updateKakaoAtSend(vo);
|
||||
}else if(vo.getSubMsgSendYn().equals("Y")) {
|
||||
KakaoVO info = kakaoAlimTalkDAO.selectKakaoAtUmid(vo);
|
||||
|
||||
System.out.println("대체문자 전송 : " + info.getBizUmid());
|
||||
if (info.getBizUmid() != null) {
|
||||
kakaoAlimTalkDAO.updateKakaoAtSubMsgSend(vo);
|
||||
}else {
|
||||
kakaoAlimTalkDAO.updateKakaoAtNotSend(vo);
|
||||
}
|
||||
|
||||
}else {
|
||||
kakaoApiService.insertKakaoProfileInfo(kakaoVO);
|
||||
returnVO.setBizReturnMsg("발신프로필의 등록이 완료 되었습니다.");
|
||||
kakaoAlimTalkDAO.updateKakaoAtNotSend(vo);
|
||||
}
|
||||
|
||||
}
|
||||
return returnVO;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* 카카오 친구톡 발송 실패에 따른 금액 환불 처리
|
||||
* 카카오 친구톡 대체문자 선택에 대해 성공시 친구톡과 문자 간 금액 차액의 환불도 처리 됨.
|
||||
* */
|
||||
@Override
|
||||
public void selectKakaoFtSentRefundList() throws Exception {
|
||||
|
||||
/**
|
||||
* 1. 카카오 FT 전송성공 확인
|
||||
* 2. 카카오 FT 전송실패, 대채문자 전송확인
|
||||
* 3. 카카오 FT 전송 실패 확인
|
||||
*/
|
||||
List<KakaoVO> kakaoFtSentRefundList = kakaoAlimTalkDAO.selectKakaoFtSentRefundList();
|
||||
|
||||
for(KakaoVO vo : kakaoFtSentRefundList) {
|
||||
System.out.println(vo.getMsgGroupId() +"________결과 : " +vo.getRsltCode() +" 대체문자 전송 : "+vo.getSubMsgSendYn());
|
||||
|
||||
if(vo.getRsltCode().equals("7000")) {//친구톡 발송 성공시
|
||||
|
||||
kakaoAlimTalkDAO.updateKakaoFtSend(vo);
|
||||
|
||||
}else if(vo.getSubMsgSendYn().equals("Y")) {//친구톡 발송 실패 했을 경우
|
||||
|
||||
//대체문자 발송 UMID 번호 조회 - 알림톡 쿼리 동일하게 사용
|
||||
KakaoVO info = kakaoAlimTalkDAO.selectKakaoAtUmid(vo);
|
||||
|
||||
System.out.println("대체문자 전송 : " + info.getBizUmid());
|
||||
|
||||
if (info.getBizUmid() != null) {//대체문자 발송 완료인 경우
|
||||
kakaoAlimTalkDAO.updateKakaoAtSubMsgSend(vo);
|
||||
}else {
|
||||
kakaoAlimTalkDAO.updateKakaoFtNotSend(vo);
|
||||
}
|
||||
|
||||
}else {
|
||||
kakaoAlimTalkDAO.updateKakaoFtNotSend(vo);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -96,10 +96,7 @@ public class KakaoAlimTalkController {
|
||||
|
||||
KakaoReturnVO tmpProfileVO = kakaoApiProfile.kakaoApiProfileList(kakaoProfileVO);
|
||||
|
||||
/* API를 통하여 정상적으로 조회된 프로필만 add 처리 */
|
||||
if("200".equals(tmpProfileVO.getBizReturnCode())) {
|
||||
resultApiProfileList.add(tmpProfileVO);
|
||||
}
|
||||
resultApiProfileList.add(tmpProfileVO);
|
||||
|
||||
}
|
||||
|
||||
@ -140,8 +137,21 @@ public class KakaoAlimTalkController {
|
||||
|
||||
KakaoReturnVO kakaoInfo = kakaoApiProfile.kakaoApiProfileToken(kakaoVO); //발신프로필 인증 토큰 요청하기
|
||||
|
||||
String bizReturnCd = kakaoInfo.getBizReturnCode();
|
||||
String bizReturnMsg = kakaoInfo.getBizReturnMsg();
|
||||
|
||||
List<KakaoVO> delProfileList = new ArrayList<KakaoVO>();
|
||||
if(bizReturnCd.equals("310") && bizReturnMsg.equals("이미 등록되어 있는 발신프로필 입니다")) {
|
||||
|
||||
kakaoVO.setUserId(userId);
|
||||
delProfileList = kakaoAlimTalkService.selectDeleteProfileInfo(kakaoVO);
|
||||
|
||||
}
|
||||
|
||||
int listSize = delProfileList.size();
|
||||
modelAndView.addObject("kakaoInfo", kakaoInfo);
|
||||
modelAndView.addObject("result", "success");
|
||||
modelAndView.addObject("delInfoCnt", listSize);
|
||||
|
||||
}catch(Exception ex){
|
||||
ex.printStackTrace();
|
||||
@ -259,14 +269,68 @@ public class KakaoAlimTalkController {
|
||||
kakaoVO.setLastUpdusrId(userId);
|
||||
KakaoReturnVO kakaoInfo = kakaoApiProfile.kakaoApiProfileCreate(kakaoVO);
|
||||
|
||||
if("200".equals(kakaoInfo.getBizReturnCode())) {
|
||||
kakaoVO.setSenderKey(kakaoInfo.getSenderKey());
|
||||
KakaoReturnVO internalReuslt = kakaoAlimTalkService.createKaKaoProfile(kakaoVO);
|
||||
kakaoInfo.setBizReturnMsg(internalReuslt.getBizReturnMsg());
|
||||
String bizReturnCd = kakaoInfo.getBizReturnCode();
|
||||
String bizReturnMsg = kakaoInfo.getBizReturnMsg();
|
||||
|
||||
System.out.println(bizReturnCd);
|
||||
System.out.println(bizReturnMsg);
|
||||
|
||||
/*
|
||||
* 기존에 등록된 발신프로필이라고 결과가 오는 경우 데이터베이스에서 삭제 기록을 조회해 본다.
|
||||
* 삭제 기록이 있는 경우 복구를 해주고(deleteYn 값을 'N'으로 변경)
|
||||
* 기록이 없는 경우 타 사이트에 등록되었을 수 있음.
|
||||
*
|
||||
* */
|
||||
|
||||
List<KakaoVO> delProfileList = new ArrayList<KakaoVO>();
|
||||
if((bizReturnCd.equals("509") && bizReturnMsg.equals("이미 사용중인 카카오톡 채널입니다.")) || (bizReturnCd.equals("310") && bizReturnMsg.equals("이미 등록되어 있는 발신프로필 입니다"))) {
|
||||
|
||||
delProfileList = kakaoAlimTalkService.selectDeleteProfileInfo(kakaoVO);
|
||||
|
||||
}
|
||||
|
||||
//삭제처리된 발신프로필이 있는 경우
|
||||
if(delProfileList != null && delProfileList.size() > 0) {
|
||||
|
||||
int resultCnt = 0;
|
||||
for(int i=0; i< delProfileList.size(); i++) {
|
||||
|
||||
KakaoVO tmpKakaoVO = new KakaoVO();
|
||||
tmpKakaoVO.setUserId(userId);
|
||||
tmpKakaoVO.setProfileId(delProfileList.get(i).getProfileId());
|
||||
tmpKakaoVO.setDeleteYn("N");
|
||||
|
||||
int count = kakaoAlimTalkService.updateKakaoProfileStatus(tmpKakaoVO);
|
||||
|
||||
resultCnt = resultCnt + count;
|
||||
|
||||
}
|
||||
|
||||
KakaoReturnVO kakaoReturnVO = new KakaoReturnVO();
|
||||
if(resultCnt > 0) {
|
||||
|
||||
kakaoReturnVO.setBizReturnCode("200");
|
||||
kakaoReturnVO.setBizReturnMsg("삭제 발신프로필의 복구가 완료 되었습니다.");
|
||||
modelAndView.addObject("kakaoInfo", kakaoReturnVO);
|
||||
modelAndView.addObject("result", "success");
|
||||
|
||||
}else {
|
||||
|
||||
kakaoReturnVO.setBizReturnCode("200");
|
||||
kakaoReturnVO.setBizReturnMsg("삭제 발신프로필의 복구에 오류가 발생하였습니다.");
|
||||
modelAndView.addObject("kakaoInfo", kakaoReturnVO);
|
||||
modelAndView.addObject("result", "zeroUpdate");
|
||||
|
||||
}
|
||||
|
||||
|
||||
}else {//삭제된 내역이 없는 경우 타 사이트에 발신프로필이 등록되어 있을 수 있다.
|
||||
|
||||
modelAndView.addObject("kakaoInfo", kakaoInfo);
|
||||
modelAndView.addObject("result", "success");
|
||||
|
||||
}
|
||||
|
||||
modelAndView.addObject("kakaoInfo", kakaoInfo);
|
||||
modelAndView.addObject("result", "success");
|
||||
|
||||
}
|
||||
}catch(Exception ex){
|
||||
|
||||
@ -9,11 +9,9 @@ import java.util.Arrays;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@ -37,11 +35,9 @@ import org.apache.poi.xssf.usermodel.XSSFRow;
|
||||
import org.apache.poi.xssf.usermodel.XSSFSheet;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
@ -50,8 +46,6 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
||||
import egovframework.rte.fdl.idgnr.EgovIdGnrService;
|
||||
import egovframework.rte.fdl.security.userdetails.util.EgovUserDetailsHelper;
|
||||
import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo;
|
||||
@ -71,7 +65,6 @@ import itn.let.kakao.kakaoComm.kakaoApi.KakaoApiProfileCategory;
|
||||
import itn.let.kakao.kakaoComm.kakaoApi.KakaoApiTemplate;
|
||||
import itn.let.kakao.kakaoComm.kakaoApi.service.KakaoApiService;
|
||||
import itn.let.kakao.user.kakaoAt.service.KakaoAlimTalkService;
|
||||
import itn.let.mail.service.StatusResponse;
|
||||
import itn.let.mjo.mjocommon.MjonCommon;
|
||||
import itn.let.mjo.mjocommon.MjonHolidayApi;
|
||||
import itn.let.mjo.msgdata.service.MjonMsgDataService;
|
||||
@ -80,9 +73,6 @@ import itn.let.mjo.msgdata.service.MjonMsgReturnVO;
|
||||
import itn.let.mjo.msgholiday.service.MsgAlarmSetVO;
|
||||
import itn.let.mjo.msgholiday.service.MsgHolidayService;
|
||||
import itn.let.mjo.msgholiday.service.MsgHolidayVO;
|
||||
import itn.let.mjo.pay.service.MjonPayService;
|
||||
import itn.let.mjo.pay.service.MjonPayVO;
|
||||
import itn.let.org.web.OrgChartManageController;
|
||||
import itn.let.sym.site.service.EgovSiteManagerService;
|
||||
import itn.let.sym.site.service.JoinSettingVO;
|
||||
import itn.let.uss.umt.service.EgovUserManageService;
|
||||
@ -106,8 +96,6 @@ import itn.let.uss.umt.service.UserManageVO;
|
||||
@Controller
|
||||
public class KakaoAlimTalkSendController {
|
||||
|
||||
private final OrgChartManageController orgChartManageController;
|
||||
|
||||
@Resource(name = "egovMjonMsgGroupIdGnrService")
|
||||
private EgovIdGnrService idgenMjonMsgGroupId;
|
||||
|
||||
@ -152,16 +140,6 @@ public class KakaoAlimTalkSendController {
|
||||
|
||||
@Autowired
|
||||
KakaoApiJsonSave kakaoApiJsonSave;
|
||||
|
||||
@Autowired
|
||||
private MjonCommon mjonCommon;
|
||||
|
||||
@Resource(name = "mjonPayService")
|
||||
private MjonPayService mjonPayService;
|
||||
|
||||
KakaoAlimTalkSendController(OrgChartManageController orgChartManageController) {
|
||||
this.orgChartManageController = orgChartManageController;
|
||||
}
|
||||
|
||||
@RequestMapping(value= {"/web/mjon/alimtalk/kakaoAlimtalkMsgDataView.do"})
|
||||
public String KakaoAlimtalkMsgDataView(ModelMap model
|
||||
@ -235,29 +213,7 @@ public class KakaoAlimTalkSendController {
|
||||
model.addAttribute("sendPrice", kakaoSendUtil.selectSendPriceOfKakaoAtAndSmsAndMms(userId));
|
||||
}
|
||||
|
||||
if("Y".equals(kakaoVO.getMsgResendAllFlag())) {
|
||||
List<MjonMsgDataVO> resendList = new ArrayList<MjonMsgDataVO>();
|
||||
|
||||
MjonMsgDataVO mjonMsgDataVO = new MjonMsgDataVO();
|
||||
mjonMsgDataVO.setMsgGroupId(kakaoVO.getMsgResendAllGroupId());
|
||||
mjonMsgDataVO.setUserId(userId);
|
||||
resendList = mjonMsgDataService.selectMjMsgListByResend(mjonMsgDataVO);
|
||||
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
try {
|
||||
String resendListJson = mapper.writeValueAsString(resendList);
|
||||
model.addAttribute("resendListJson", resendListJson);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
return "web/kakao/msgdata/at/KakaoAlimtalkMsgDataView";
|
||||
// return "web/kakao/msgdata/at/KakaoAlimtalkMsgDataView_advcbackup_20250310";
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -563,8 +519,8 @@ public class KakaoAlimTalkSendController {
|
||||
HSSFWorkbook workbook = new HSSFWorkbook(files.get(0).getInputStream());
|
||||
HSSFSheet sheet = workbook.getSheetAt(0);
|
||||
|
||||
if(sheet.getLastRowNum() > 300000) {
|
||||
errMessage = "한번에 전송 가능한 최대 발송건은 300,000건 입니다.";
|
||||
if(sheet.getLastRowNum() > 501) {
|
||||
errMessage = "한번에 전송 가능한 최대 발송건은 500건 입니다.";
|
||||
jr.setSuccess(false);
|
||||
jr.setMessage(errMessage);
|
||||
return jr;
|
||||
@ -696,20 +652,12 @@ public class KakaoAlimTalkSendController {
|
||||
|
||||
}
|
||||
|
||||
// if(totRowDataCnt > 501) { //
|
||||
// errMessage = "한번에 전송 가능한 최대 발송건은 500건 입니다.";
|
||||
// jr.setSuccess(false);
|
||||
// jr.setMessage(errMessage);
|
||||
// return jr;
|
||||
// }
|
||||
|
||||
if(sheet.getLastRowNum() > 300000) {
|
||||
errMessage = "한번에 전송 가능한 최대 발송건은 300,000건 입니다.";
|
||||
if(totRowDataCnt > 501) { //
|
||||
errMessage = "한번에 전송 가능한 최대 발송건은 500건 입니다.";
|
||||
jr.setSuccess(false);
|
||||
jr.setMessage(errMessage);
|
||||
return jr;
|
||||
}
|
||||
|
||||
|
||||
List<HashMap<String, String>> json = new ArrayList<HashMap<String, String>>();
|
||||
|
||||
@ -841,13 +789,13 @@ public class KakaoAlimTalkSendController {
|
||||
modelAndView.setViewName("jsonView");
|
||||
|
||||
try {
|
||||
// LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated()? (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null;
|
||||
// String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId());
|
||||
LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated()? (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null;
|
||||
String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId());
|
||||
|
||||
// if(userId == "") {
|
||||
// modelAndView.addObject("result", "notLogin");
|
||||
// return modelAndView;
|
||||
// }else {
|
||||
if(userId == "") {
|
||||
modelAndView.addObject("result", "notLogin");
|
||||
return modelAndView;
|
||||
}else {
|
||||
|
||||
KakaoReturnVO kakaoTemplateTempList = kakaoApiTemplate.selectKakaoApiTemplate(kakaoVO);
|
||||
|
||||
@ -863,7 +811,7 @@ public class KakaoAlimTalkSendController {
|
||||
|
||||
modelAndView.addObject("kakaoTemplateList", kakaoTemplateTempList);
|
||||
modelAndView.addObject("result", "success");
|
||||
// }
|
||||
}
|
||||
}catch(Exception ex){
|
||||
ex.printStackTrace();
|
||||
modelAndView.addObject("message", egovMessageSource.getMessage("fail.common.select"));
|
||||
@ -1106,16 +1054,6 @@ public class KakaoAlimTalkSendController {
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
@RequestMapping(value= {"/web/mjon/kakao/alimtalk/kakaoAlimTalkMsgSendAjax_advc.do"}, method = RequestMethod.POST)
|
||||
public ResponseEntity<StatusResponse> kakaoAlimTalkMsgSendAjax_advc(
|
||||
@RequestBody KakaoVO kakaoVO,
|
||||
HttpServletRequest request
|
||||
) throws Exception {
|
||||
|
||||
System.out.println(" + kakaoAlimTalkMsgSendAjax_advc + ");
|
||||
return ResponseEntity.ok().body(kakaoAlimTalkService.insertKakaoAtSandAjax_advc(kakaoVO, request)) ;
|
||||
}
|
||||
|
||||
@RequestMapping(value= {"/web/mjon/kakao/alimtalk/kakaoAlimTalkMsgSendAjax.do"}, method = RequestMethod.POST)
|
||||
// @ResponseBody
|
||||
public ModelAndView kakaoAlimTalkMsgSendAjax(
|
||||
@ -1123,10 +1061,6 @@ public class KakaoAlimTalkSendController {
|
||||
HttpServletRequest request,
|
||||
@ModelAttribute("kakaoVO") KakaoVO kakaoVO
|
||||
) throws Exception {
|
||||
// 시작 시간
|
||||
long startTime = System.currentTimeMillis();
|
||||
|
||||
System.out.println(" :: kakaoAlimTalkMsgSendAjax :: ");
|
||||
ModelAndView modelAndView = new ModelAndView();
|
||||
modelAndView.setViewName("jsonView");
|
||||
|
||||
@ -1451,7 +1385,8 @@ public class KakaoAlimTalkSendController {
|
||||
|
||||
if(!smishingAlarmPassSts) {//평일,주말, 공휴일 알림설정 시간에 포함되지 않는 경우 슬랙 알림 발송
|
||||
|
||||
// mjonCommon.getAdminKakaoAtSendSlack(kakaoVO);
|
||||
MjonCommon comm = new MjonCommon();
|
||||
comm.getAdminKakaoAtSandSlack(kakaoVO);
|
||||
|
||||
}
|
||||
|
||||
@ -1463,145 +1398,7 @@ public class KakaoAlimTalkSendController {
|
||||
} catch (Exception e) {
|
||||
throw new Exception("++++++++++++++++++++++ getAdminPhoneSendMsgData Error !!! " + e);
|
||||
}
|
||||
// 종료 시간
|
||||
long endTime = System.currentTimeMillis();
|
||||
|
||||
// 실행 시간 계산 (초 단위)
|
||||
double executionTimeSeconds = (endTime - startTime) / 1000.0;
|
||||
|
||||
System.out.println("실행 시간: " + String.format("%.3f", executionTimeSeconds) + "초");
|
||||
|
||||
|
||||
String returnTxt = String.format("%.3f", executionTimeSeconds) + "초";
|
||||
modelAndView.addObject("seconds", returnTxt);
|
||||
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value= {"/web/mjon/alimtalk/kakaoAlimtalkMsgDataView_test_set.do"})
|
||||
public String kakaoAlimtalkMsgDataView_test_set(ModelMap model
|
||||
, @ModelAttribute("kakaoVO") KakaoVO kakaoVO) throws Exception {
|
||||
|
||||
LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated()? (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null;
|
||||
String author = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getAuthority());
|
||||
String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId());
|
||||
|
||||
model.addAttribute("loginVO", loginVO);
|
||||
/* if(userId == "") {
|
||||
return "redirect:/web/user/login/login.do";
|
||||
}*/
|
||||
|
||||
|
||||
//2.사용자 개인 단가 정보 불러오기
|
||||
if(!userId.equals("") && !author.equals("ROLE_ADMIN")) {
|
||||
|
||||
// 사용자 아이디를 이용한 발신프로필 조회
|
||||
kakaoVO.setUserId(userId);
|
||||
List<KakaoVO> selectKakaoProfileList = kakaoApiService.selectKakaoProfileList(kakaoVO);
|
||||
model.addAttribute("kakaoProfileList", selectKakaoProfileList);
|
||||
|
||||
//발신번호 불러오기
|
||||
//아이디 발신번호 리스트 불러오기.
|
||||
List<String> resultSendPhonList = mjonMsgDataService.selectSendPhonNumList(userId);
|
||||
List<String> resultPhonList = new ArrayList<String>();
|
||||
MJUtil mjUtil = new MJUtil();
|
||||
|
||||
for(String phone : resultSendPhonList) {
|
||||
|
||||
resultPhonList.add(mjUtil.addDash(phone));
|
||||
|
||||
}
|
||||
model.addAttribute("resultPhonList", resultPhonList);
|
||||
|
||||
|
||||
MberManageVO mberManageVO = mjonMsgDataService.selectMberManageInfo(userId);
|
||||
|
||||
model.addAttribute("atSmishingYn", mberManageVO.getAtSmishingYn());
|
||||
|
||||
//3.사용자 개인단가 정보가 0이 아니면 개인단가 사용, 없으면 시스템 기본 단가 사용
|
||||
Float shortPrice = mberManageVO.getShortPrice();
|
||||
Float longPrice = mberManageVO.getLongPrice();
|
||||
Float picturePrice = mberManageVO.getPicturePrice();
|
||||
Float picture2Price = mberManageVO.getPicture2Price();
|
||||
Float picture3Price = mberManageVO.getPicture3Price();
|
||||
BigDecimal userMoney = new BigDecimal(mberManageVO.getUserMoney()).setScale(2, RoundingMode.HALF_EVEN);
|
||||
|
||||
model.addAttribute("userMoney", userMoney);
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
//최근 전송 내역
|
||||
MjonMsgDataVO searchVO = new MjonMsgDataVO();
|
||||
Calendar cal = Calendar.getInstance();
|
||||
Date now = new Date();
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyy/MM/dd");
|
||||
cal.setTime(now);
|
||||
cal.add(Calendar.DATE, -3);
|
||||
String chkDate = format.format(cal.getTime());
|
||||
searchVO.setUserId(userId);
|
||||
searchVO.setMyMsgStDt(chkDate); //검색 시작일 저장 - 현재날짜로 부터 3일 이전 날짜로 시작
|
||||
model.addAttribute("resultLatestMsgList", mjonMsgDataService.selectLatestMsgList(searchVO));
|
||||
|
||||
//자주보내는 번호
|
||||
model.addAttribute("resultBookMarkMsgList", mjonMsgDataService.selectBookMarkMsgList(searchVO));
|
||||
|
||||
// 사용자 저으이
|
||||
model.addAttribute("sendPrice", kakaoSendUtil.selectSendPriceOfKakaoAtAndSmsAndMms(userId));
|
||||
}
|
||||
|
||||
return "web/kakao/msgdata/at/KakaoAlimtalkMsgDataView_tmp";
|
||||
}
|
||||
|
||||
public void kakaoRefundSingleTransaction() throws Exception{
|
||||
System.out.println("=============카카오 환불 싱글 트랜잭션 수행 =============");
|
||||
|
||||
/* 회원 money 업데이트 처리 트랜잭션 분리를 위하여 impl이 아닌 현재 위치에서 반복문 실행 */
|
||||
System.out.println("=============SchedulerUtil=====runKakaoOneTime =============>");
|
||||
List<KakaoVO> kakaoRefundList = kakaoAlimTalkService.selectKakaoSentRefundListForSingle();
|
||||
Set<String> targetIdSet = new HashSet<>();
|
||||
|
||||
for(KakaoVO kakaoVO : kakaoRefundList) {
|
||||
try {
|
||||
kakaoAlimTalkService.kakaoSingleRefund(kakaoVO);
|
||||
targetIdSet.add(kakaoVO.getUserId());
|
||||
} catch (Exception e) {
|
||||
String msg = "[문자온] 환불 실패 - " + kakaoVO.getMsgId() +"("+ kakaoVO.getUserId() + ")";
|
||||
mjonCommon.sendSimpleSlackMsg(msg);;
|
||||
}
|
||||
}
|
||||
|
||||
MjonPayVO mjonPayVO = new MjonPayVO();
|
||||
for(String userId : targetIdSet) {
|
||||
try {
|
||||
mjonPayVO.setUserId(userId);
|
||||
mjonPayService.updateMemberCash(mjonPayVO); //회원정보 업데이트
|
||||
} catch(Exception e) {
|
||||
String msg = "[문자온] 환불 후 잔액 갱신 실패 - " + userId;
|
||||
mjonCommon.sendSimpleSlackMsg(msg);;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @Method Name : kakaoMsgSendRefundTestAjax
|
||||
* @작성일 : 2025. 8. 6.
|
||||
* @작성자 : 이지우
|
||||
* @Method 설명 : 카카오 친구톡 전송 환불 스케줄러 서비스 테스트
|
||||
*/
|
||||
@RequestMapping(value= {"/web/mjon/kakao/alimtalk/kakaoMsgSendRefundTestAjax.do"})
|
||||
public ModelAndView kakaoMsgSendRefundTestAjax(ModelMap model
|
||||
, HttpServletRequest request
|
||||
, @ModelAttribute("kakaoVO") KakaoVO kakaoVO) throws Exception {
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView();
|
||||
modelAndView.setViewName("jsonView");
|
||||
|
||||
this.kakaoRefundSingleTransaction();
|
||||
|
||||
modelAndView.addObject("result", "success");
|
||||
return modelAndView;
|
||||
}
|
||||
}
|
||||
|
||||
@ -305,9 +305,6 @@ public class KakaoAlimTalkTemplateController {
|
||||
|
||||
KakaoReturnVO kakaoTemplateInfo =kakaoApiTemplate.selectKakaoApiTemplateDetail(kakaoVO);
|
||||
|
||||
System.out.println("kakaoTemplateInfo :; "+ kakaoTemplateInfo);
|
||||
|
||||
|
||||
String kakaoButtonTypeDs = "";
|
||||
for(int i=0; i < kakaoTemplateInfo.getButtonList().size(); i++) {
|
||||
String buttonType = kakaoTemplateInfo.getButtonList().get(i).getLinkType();
|
||||
|
||||
@ -1,12 +0,0 @@
|
||||
package itn.let.kakao.user.kakaoFt.service;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import itn.let.kakao.kakaoComm.KakaoVO;
|
||||
import itn.let.mail.service.StatusResponse;
|
||||
|
||||
public interface KakaoFriendsTalkService {
|
||||
|
||||
StatusResponse insertKakaoFtSandAjax_advc(KakaoVO kakaoVO, HttpServletRequest request) throws Exception;
|
||||
|
||||
}
|
||||
@ -1,292 +0,0 @@
|
||||
package itn.let.kakao.user.kakaoFt.service.impl;
|
||||
|
||||
import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl;
|
||||
import egovframework.rte.fdl.idgnr.EgovIdGnrService;
|
||||
import egovframework.rte.fdl.security.userdetails.util.EgovUserDetailsHelper;
|
||||
import itn.com.cmm.LoginVO;
|
||||
import itn.com.utl.fcc.service.EgovStringUtil;
|
||||
import itn.let.kakao.kakaoComm.KakaoSendAdvcVO;
|
||||
import itn.let.kakao.kakaoComm.KakaoSendUtil;
|
||||
import itn.let.kakao.kakaoComm.KakaoVO;
|
||||
import itn.let.kakao.user.kakaoAt.service.impl.KakaoAlimTalkDAO;
|
||||
import itn.let.kakao.user.kakaoFt.service.KakaoFriendsTalkService;
|
||||
import itn.let.mail.service.StatusResponse;
|
||||
import itn.let.mjo.mjocommon.MjonCommon;
|
||||
import itn.let.mjo.msg.service.MjonMsgVO;
|
||||
import itn.let.mjo.msg.service.impl.MjonMsgDAO;
|
||||
import itn.let.mjo.msgdata.service.MjonMsgDataService;
|
||||
import itn.let.module.base.PriceAndPoint;
|
||||
import itn.let.uss.umt.service.EgovUserManageService;
|
||||
import itn.let.uss.umt.service.UserManageVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@Slf4j
|
||||
@Service("KakaoFriendsTalkService")
|
||||
public class KakaoFriendsTalkServiceImpl extends EgovAbstractServiceImpl implements KakaoFriendsTalkService{
|
||||
|
||||
@Resource(name = "egovFriendstalkTemplateIdService")
|
||||
private EgovIdGnrService idgenFriendTalkTmpId;
|
||||
|
||||
@Resource(name="kakaoFriendsTalkTemplateDAO")
|
||||
private KakaoFriendsTalkTemplateDAO kakaoFriendsTalkTemplateDAO;
|
||||
|
||||
@Resource(name="mjonMsgDAO")
|
||||
private MjonMsgDAO mjonMsgDAO;
|
||||
|
||||
/** userManageService */
|
||||
@Resource(name = "userManageService")
|
||||
private EgovUserManageService userManageService;
|
||||
|
||||
@Resource(name = "egovMjonMsgGroupIdGnrService")
|
||||
private EgovIdGnrService idgenMjonMsgGroupId;
|
||||
|
||||
|
||||
@Resource(name="kakaoAlimTalkDAO")
|
||||
private KakaoAlimTalkDAO kakaoAlimTalkDAO;
|
||||
|
||||
@Resource(name = "MjonMsgDataService")
|
||||
private MjonMsgDataService mjonMsgDataService;
|
||||
|
||||
@Autowired
|
||||
KakaoSendUtil kakaoSendUtil;
|
||||
|
||||
@Autowired
|
||||
private MjonCommon mjonCommon;
|
||||
|
||||
@Autowired
|
||||
private PriceAndPoint priceAndPoint;
|
||||
|
||||
@Override
|
||||
public StatusResponse insertKakaoFtSandAjax_advc(KakaoVO kakaoVO, HttpServletRequest request) throws Exception {
|
||||
StatusResponse statusResponse = new StatusResponse();
|
||||
|
||||
log.info(" + kakaoVO.toString() :: [{}]", kakaoVO.toString());
|
||||
|
||||
log.info(" + kakaoVO.toString() :: [{}]", kakaoVO.ftToString());
|
||||
|
||||
|
||||
// if(1==1) {
|
||||
// throw new RuntimeException("강제로 발생시킨 예외");
|
||||
// }
|
||||
|
||||
// 측정할 메소드 호출 전 시간 기록
|
||||
Instant start = Instant.now();
|
||||
// KakaoSendAdvcVO
|
||||
|
||||
Map<String, Object> returnMap = new HashMap<>();
|
||||
Map<String, Object> apiReturnMap = new HashMap<>();
|
||||
|
||||
String userId = "";
|
||||
if("A".equals(kakaoVO.getSendKind()))
|
||||
{
|
||||
userId = kakaoVO.getMberId();
|
||||
}else {
|
||||
|
||||
LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated()
|
||||
? (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser()
|
||||
: null;
|
||||
userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId());
|
||||
|
||||
if (userId.equals("")) {
|
||||
return new StatusResponse(HttpStatus.BAD_REQUEST, "로그인 후 이용이 가능합니다.");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
kakaoVO.setUserId(userId);
|
||||
|
||||
/**
|
||||
* 회원 정지된 상태이면 문자 발송이 안되도록 처리함 현재 로그인 세션도 만료 처리함
|
||||
*/
|
||||
boolean mberSttus = userManageService.selectUserStatusInfo(userId);
|
||||
if (!mberSttus) {
|
||||
request.getSession().invalidate();
|
||||
// UNAUTHORIZED : 인증되지 않은 사용자가 접근하려고 할 때
|
||||
return new StatusResponse(HttpStatus.UNAUTHORIZED,
|
||||
"현재 고객님께서는 문자온 서비스 이용이 정지된 상태로 친구톡을 발송하실 수 없습니다. 이용정지 해제를 원하시면 고객센터로 연락주시기 바랍니다.", "STAT_1070");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 친구톡은 발송 시간 제약이 있음
|
||||
*/
|
||||
if(kakaoSendUtil.isRestrictedFriendTalkTime(kakaoSendUtil.resolveBaseDate(kakaoVO))) {
|
||||
// UNAUTHORIZED : 인증되지 않은 사용자가 접근하려고 할 때
|
||||
return new StatusResponse(HttpStatus.BAD_REQUEST,
|
||||
"친구톡은 20시 50분부터 익일 08시까지 발송이 제한됩니다.","STAT_2080");
|
||||
}
|
||||
|
||||
|
||||
/** @isHolidayNotified
|
||||
* @false : 알림 X
|
||||
* @true : 알림 O */
|
||||
boolean isHolidayNotified = mjonCommon.processUserAndCheckFT(kakaoVO);
|
||||
|
||||
|
||||
UserManageVO userManageVO = mjonCommon.getUserManageInfo(userId);
|
||||
|
||||
|
||||
// 스팸관련 키워드 select
|
||||
List<String> resultSpamTxt = mjonMsgDataService.selectSpamKeywordList();
|
||||
|
||||
/** @카카오톡 전송 list 셋팅 -------------------------------------------*/
|
||||
List<KakaoSendAdvcVO> kakaoSendAdvcListVO = kakaoSendUtil.populateSendListsFT(kakaoVO, isHolidayNotified, statusResponse, userManageVO, resultSpamTxt);
|
||||
if (statusResponse.getStatus() != null && !statusResponse.getStatus().equals(HttpStatus.OK)) {
|
||||
log.error(" + populateSendLists 처리 중 오류 발생: {}", statusResponse.getMessage());
|
||||
return statusResponse;
|
||||
}
|
||||
|
||||
|
||||
/** @전송금액 확인 --------------------------------------------------*/
|
||||
if (!kakaoSendUtil.isCashSufficient(userId, kakaoSendAdvcListVO)) {
|
||||
log.error("Insufficient balance for message sending.");
|
||||
return new StatusResponse(HttpStatus.BAD_REQUEST, "문자 발송에 필요한 보유 잔액이 부족 합니다.", "STAT_1060");
|
||||
}
|
||||
|
||||
|
||||
/** @json파일이 있을 떄 biz_attachments insert */
|
||||
kakaoSendUtil.insertKakaoAtDataJsonInfo_advc(kakaoSendAdvcListVO);
|
||||
|
||||
|
||||
|
||||
Map<String, List<KakaoSendAdvcVO>> priceGroupedMessages = kakaoSendAdvcListVO.stream()
|
||||
.collect(Collectors.groupingBy(KakaoSendAdvcVO::getEachPrice));
|
||||
// instTotalCnt : 화면에서 보여줄 총 발송건수
|
||||
int instTotalCnt = 0;
|
||||
|
||||
|
||||
// 임시
|
||||
List<String> nextMsgGroupIdA = new ArrayList<>();
|
||||
// 대안: entrySet() 직접 사용
|
||||
String apiMsgGroupId = "";
|
||||
String apiMsgType = "";
|
||||
for (Map.Entry<String, List<KakaoSendAdvcVO>> entry : priceGroupedMessages.entrySet()) {
|
||||
// entry 사용
|
||||
|
||||
List<KakaoSendAdvcVO> groupedMsgList = entry.getValue(); // 해당 가격의 메시지 리스트
|
||||
|
||||
String nextMsgGroupId = idgenMjonMsgGroupId.getNextStringId();
|
||||
groupedMsgList.forEach(t -> t.setMsgGroupId(nextMsgGroupId));
|
||||
|
||||
// api 전달 값
|
||||
apiMsgGroupId = StringUtils.isNotEmpty(apiMsgGroupId)
|
||||
? apiMsgGroupId + "," + nextMsgGroupId
|
||||
: nextMsgGroupId;
|
||||
|
||||
apiMsgType = StringUtils.isNotEmpty(apiMsgType)
|
||||
? apiMsgType + "," + kakaoSendAdvcListVO.get(0).getMsgType()
|
||||
: kakaoSendAdvcListVO.get(0).getMsgType();
|
||||
|
||||
// 발송 데이터 삽입
|
||||
int instCnt = kakaoSendUtil.insertKakaoData_advc(groupedMsgList);
|
||||
// int instCnt = 6;
|
||||
|
||||
if(instCnt > 0) {
|
||||
|
||||
instTotalCnt += instCnt;
|
||||
|
||||
KakaoSendAdvcVO sendVO = groupedMsgList.get(0);
|
||||
|
||||
/** @groupData 테이블 insert */
|
||||
kakaoSendUtil.insertKakaoGroupDataTb_advc(instCnt, kakaoVO, sendVO);
|
||||
|
||||
|
||||
|
||||
/** @biz_kakao_price에 insert (대체문자 환불관련 테이블)*/
|
||||
priceAndPoint.insertBizFtKakaoPrice(kakaoVO.getUserId(), sendVO.getMsgGroupId());
|
||||
|
||||
|
||||
priceAndPoint.insertCashAndPoint(kakaoVO.getUserId()
|
||||
, -Float.parseFloat(sendVO.getTotPrice())
|
||||
, "카카오 친구톡 총 "+groupedMsgList.size()+"건 중 " + instCnt + "건 발송"
|
||||
, nextMsgGroupId
|
||||
);
|
||||
|
||||
|
||||
/** @SLACK발송 */
|
||||
/** @발송조건이되면 발송 */
|
||||
if(isHolidayNotified
|
||||
&& ("Y".equals(userManageVO.getAtSmishingYn()) || "Y".equals(kakaoVO.getAtDelayYn()))
|
||||
) {
|
||||
mjonCommon.getAdminKakaoAtSendSlack(sendVO);
|
||||
}else if("Y".equals(kakaoVO.getAtSmishingYn())){
|
||||
/** @발송조건이 안되면 DB INSERT */
|
||||
mjonMsgDAO.insertSpamPassMsgData(MjonMsgVO.builder()
|
||||
.msgGroupId(nextMsgGroupId)
|
||||
.userId(kakaoVO.getUserId())
|
||||
.reqDate(kakaoVO.getReqDate())
|
||||
.smsTxt(groupedMsgList.get(0).getTemplateContent())
|
||||
.totalCallCnt(instCnt)
|
||||
.callFrom(kakaoVO.getCallFrom())
|
||||
.msgType("8")
|
||||
.reserveYn(kakaoVO.getReserveYn())
|
||||
.build()
|
||||
);
|
||||
}
|
||||
|
||||
nextMsgGroupIdA.add(nextMsgGroupId);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
apiReturnMap.put("resultSts", instTotalCnt);
|
||||
// 그룹 ID
|
||||
apiReturnMap.put("msgGroupId", apiMsgGroupId);
|
||||
// 메세지 타입
|
||||
apiReturnMap.put("msgType", apiMsgType);
|
||||
|
||||
returnMap.put("resultSts", instTotalCnt);
|
||||
returnMap.put("reserYn", kakaoVO.getReserveYn());
|
||||
returnMap.put("groupIds", nextMsgGroupIdA);
|
||||
|
||||
|
||||
// 측정할 메소드 호출 후 시간 기록
|
||||
Instant end = Instant.now();
|
||||
|
||||
log.info(" + start :: [{}]", start);
|
||||
// 실행 시간 계산 (나노초, 밀리초, 초)
|
||||
long seconds = Duration.between(start, end).getSeconds();
|
||||
log.info("메소드 실행 시간 (초): {} s", seconds);
|
||||
double minutes = seconds / 60.0; // 소수점 포함을 위해 60.0으로 나눔
|
||||
|
||||
returnMap.put("second", seconds+" s");
|
||||
returnMap.put("minutes", minutes+" min");
|
||||
|
||||
|
||||
// System.out.println("메소드 실행 시간 (분): " + minutes + " min");
|
||||
|
||||
|
||||
|
||||
|
||||
// priceAndPoint.getBefCash(userId);
|
||||
|
||||
|
||||
|
||||
|
||||
statusResponse.setStatus(HttpStatus.OK);
|
||||
statusResponse.setObject(returnMap);
|
||||
apiReturnMap.put("result", HttpStatus.OK);
|
||||
apiReturnMap.put("message", "전송이 완료되었습니다.");
|
||||
statusResponse.setApiReturn(apiReturnMap);
|
||||
|
||||
return statusResponse;
|
||||
}
|
||||
|
||||
}
|
||||
@ -13,11 +13,9 @@ import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
@ -31,9 +29,7 @@ import itn.let.kakao.kakaoComm.KakaoSendUtil;
|
||||
import itn.let.kakao.kakaoComm.KakaoVO;
|
||||
import itn.let.kakao.kakaoComm.kakaoApi.service.KakaoApiService;
|
||||
import itn.let.kakao.user.kakaoAt.service.KakaoAlimTalkService;
|
||||
import itn.let.kakao.user.kakaoFt.service.KakaoFriendsTalkService;
|
||||
import itn.let.kakao.user.kakaoFt.service.KakaoFriendsTalkTemplateService;
|
||||
import itn.let.mail.service.StatusResponse;
|
||||
import itn.let.mjo.mjocommon.MjonCommon;
|
||||
import itn.let.mjo.mjocommon.MjonHolidayApi;
|
||||
import itn.let.mjo.msgdata.service.MjonMsgDataService;
|
||||
@ -72,9 +68,6 @@ public class KakaoFriendsTalkSendController {
|
||||
@Resource(name = "kakaoFriendsTalkTemplateService")
|
||||
private KakaoFriendsTalkTemplateService kakaoFtTemplateService;
|
||||
|
||||
@Resource(name = "KakaoFriendsTalkService")
|
||||
private KakaoFriendsTalkService kakaoFriendsTalkService;
|
||||
|
||||
/** userManageService */
|
||||
@Resource(name = "userManageService")
|
||||
private EgovUserManageService userManageService;
|
||||
@ -120,109 +113,114 @@ public class KakaoFriendsTalkSendController {
|
||||
|
||||
model.addAttribute("loginVO", loginVO);
|
||||
|
||||
try {
|
||||
|
||||
if(!"".equals(userId) && !"ROLE_ADMIN".equals(author)) {
|
||||
|
||||
//사용자 등록 발신프로필 정보 조회해오기
|
||||
kakaoVO.setUserId(userId);
|
||||
List<KakaoVO> resultProfileList = kakaoApiService.selectKakaoProfileList(kakaoVO);
|
||||
model.addAttribute("resultProfileList", resultProfileList);
|
||||
if(!userId.equals("") && !author.equals("ROLE_ADMIN")) {
|
||||
|
||||
// 특수문자 리스트 불러오기
|
||||
MjonSymbolVO symbolVO = new MjonSymbolVO();
|
||||
List<MjonSymbolVO> symbolList = mjonSymbolService.selectMjonSymbolList(symbolVO);
|
||||
model.addAttribute("symbolList", symbolList);
|
||||
|
||||
//아이디 발신번호 리스트 불러오기.
|
||||
List<String> resultSendPhonList = mjonMsgDataService.selectSendPhonNumList(userId);
|
||||
List<String> resultPhonList = new ArrayList<String>();
|
||||
MJUtil mjUtil = new MJUtil();
|
||||
for(String phone : resultSendPhonList) {
|
||||
resultPhonList.add(mjUtil.addDash(phone));
|
||||
}
|
||||
model.addAttribute("resultPhonList", resultPhonList);
|
||||
|
||||
|
||||
MberManageVO mberManageVO = mjonMsgDataService.selectMberManageInfo(userId);
|
||||
|
||||
model.addAttribute("atSmishingYn", mberManageVO.getAtSmishingYn());
|
||||
|
||||
//3.사용자 개인단가 정보가 0이 아니면 개인단가 사용, 없으면 시스템 기본 단가 사용
|
||||
/*Float shortPrice = mberManageVO.getShortPrice();
|
||||
Float longPrice = mberManageVO.getLongPrice();
|
||||
Float picturePrice = mberManageVO.getPicturePrice();
|
||||
Float picture2Price = mberManageVO.getPicture2Price();
|
||||
Float picture3Price = mberManageVO.getPicture3Price();*/
|
||||
BigDecimal userMoney = new BigDecimal(mberManageVO.getUserMoney()).setScale(2, RoundingMode.HALF_EVEN);
|
||||
|
||||
model.addAttribute("userMoney", userMoney);
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
//최근 전송 내역
|
||||
MjonMsgDataVO searchVO = new MjonMsgDataVO();
|
||||
Calendar cal = Calendar.getInstance();
|
||||
Date now = new Date();
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyy/MM/dd");
|
||||
cal.setTime(now);
|
||||
cal.add(Calendar.DATE, -3);
|
||||
String chkDate = format.format(cal.getTime());
|
||||
searchVO.setUserId(userId);
|
||||
searchVO.setMyMsgStDt(chkDate); //검색 시작일 저장 - 현재날짜로 부터 3일 이전 날짜로 시작
|
||||
// model.addAttribute("resultLatestMsgList", mjonMsgDataService.selectLatestMsgList(searchVO));
|
||||
|
||||
//자주보내는 번호
|
||||
// model.addAttribute("resultBookMarkMsgList", mjonMsgDataService.selectBookMarkMsgList(searchVO));
|
||||
|
||||
// 사용자 정의 단가 정보 불러오기(시스템 단가 혹은 협의 단가)
|
||||
model.addAttribute("sendPrice", kakaoSendUtil.selectSendPriceOfKakaoAtAndSmsAndMms(userId));
|
||||
|
||||
|
||||
//사용자 템플릿 정보 조회
|
||||
String friendId = kakaoVO.getFriendId();
|
||||
KakaoVO resultTemplateVO = new KakaoVO();
|
||||
|
||||
if(friendId != null) {
|
||||
resultTemplateVO = kakaoFtTemplateService.selectKakaoFriendsTemplateDetail(kakaoVO);
|
||||
}
|
||||
model.addAttribute("resultTemplateVO", resultTemplateVO);
|
||||
|
||||
|
||||
//친구톡 발송시간 체크 하기 - 20:50 ~ 익일 08:00 사이에는 발송 금지
|
||||
|
||||
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
Date nows = new Date();
|
||||
String nowDate = sdf1.format(nows);
|
||||
cal.setTime(nows);
|
||||
|
||||
int hours = cal.get(Calendar.HOUR_OF_DAY);
|
||||
int minuts = cal.get(Calendar.MINUTE);
|
||||
|
||||
boolean sendStatus = true;
|
||||
|
||||
if(hours >= 20) {
|
||||
//사용자 등록 발신프로필 정보 조회해오기
|
||||
kakaoVO.setUserId(userId);
|
||||
List<KakaoVO> resultProfileList = kakaoApiService.selectKakaoProfileList(kakaoVO);
|
||||
model.addAttribute("resultProfileList", resultProfileList);
|
||||
|
||||
if(minuts >= 50) {
|
||||
// 특수문자 리스트 불러오기
|
||||
MjonSymbolVO symbolVO = new MjonSymbolVO();
|
||||
List<MjonSymbolVO> symbolList = mjonSymbolService.selectMjonSymbolList(symbolVO);
|
||||
model.addAttribute("symbolList", symbolList);
|
||||
|
||||
//아이디 발신번호 리스트 불러오기.
|
||||
List<String> resultSendPhonList = mjonMsgDataService.selectSendPhonNumList(userId);
|
||||
List<String> resultPhonList = new ArrayList<String>();
|
||||
MJUtil mjUtil = new MJUtil();
|
||||
for(String phone : resultSendPhonList) {
|
||||
resultPhonList.add(mjUtil.addDash(phone));
|
||||
}
|
||||
model.addAttribute("resultPhonList", resultPhonList);
|
||||
|
||||
|
||||
MberManageVO mberManageVO = mjonMsgDataService.selectMberManageInfo(userId);
|
||||
|
||||
model.addAttribute("atSmishingYn", mberManageVO.getAtSmishingYn());
|
||||
|
||||
//3.사용자 개인단가 정보가 0이 아니면 개인단가 사용, 없으면 시스템 기본 단가 사용
|
||||
/*Float shortPrice = mberManageVO.getShortPrice();
|
||||
Float longPrice = mberManageVO.getLongPrice();
|
||||
Float picturePrice = mberManageVO.getPicturePrice();
|
||||
Float picture2Price = mberManageVO.getPicture2Price();
|
||||
Float picture3Price = mberManageVO.getPicture3Price();*/
|
||||
BigDecimal userMoney = new BigDecimal(mberManageVO.getUserMoney()).setScale(2, RoundingMode.HALF_EVEN);
|
||||
|
||||
model.addAttribute("userMoney", userMoney);
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
//최근 전송 내역
|
||||
MjonMsgDataVO searchVO = new MjonMsgDataVO();
|
||||
Calendar cal = Calendar.getInstance();
|
||||
Date now = new Date();
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyy/MM/dd");
|
||||
cal.setTime(now);
|
||||
cal.add(Calendar.DATE, -3);
|
||||
String chkDate = format.format(cal.getTime());
|
||||
searchVO.setUserId(userId);
|
||||
searchVO.setMyMsgStDt(chkDate); //검색 시작일 저장 - 현재날짜로 부터 3일 이전 날짜로 시작
|
||||
model.addAttribute("resultLatestMsgList", mjonMsgDataService.selectLatestMsgList(searchVO));
|
||||
|
||||
//자주보내는 번호
|
||||
model.addAttribute("resultBookMarkMsgList", mjonMsgDataService.selectBookMarkMsgList(searchVO));
|
||||
|
||||
// 사용자 정의 단가 정보 불러오기(시스템 단가 혹은 협의 단가)
|
||||
model.addAttribute("sendPrice", kakaoSendUtil.selectSendPriceOfKakaoAtAndSmsAndMms(userId));
|
||||
|
||||
|
||||
//사용자 템플릿 정보 조회
|
||||
String friendId = kakaoVO.getFriendId();
|
||||
KakaoVO resultTemplateVO = new KakaoVO();
|
||||
|
||||
if(friendId != null) {
|
||||
resultTemplateVO = kakaoFtTemplateService.selectKakaoFriendsTemplateDetail(kakaoVO);
|
||||
}
|
||||
model.addAttribute("resultTemplateVO", resultTemplateVO);
|
||||
|
||||
|
||||
//친구톡 발송시간 체크 하기 - 20:50 ~ 익일 08:00 사이에는 발송 금지
|
||||
|
||||
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
Date nows = new Date();
|
||||
String nowDate = sdf1.format(nows);
|
||||
cal.setTime(nows);
|
||||
|
||||
int hours = cal.get(Calendar.HOUR_OF_DAY);
|
||||
int minuts = cal.get(Calendar.MINUTE);
|
||||
|
||||
boolean sendStatus = true;
|
||||
|
||||
if(hours >= 20) {
|
||||
|
||||
System.out.println("발송금지 시간" + hours + ":" + minuts);
|
||||
if(minuts >= 50) {
|
||||
|
||||
System.out.println("발송금지 시간" + hours + ":" + minuts);
|
||||
sendStatus = false;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(hours < 8) {
|
||||
|
||||
System.out.println("발송금지 시간" + hours + ":" + minuts);
|
||||
sendStatus = false;
|
||||
|
||||
}
|
||||
|
||||
System.out.println("발송상태는 ::: "+sendStatus);
|
||||
model.addAttribute("sendStatus", sendStatus);
|
||||
|
||||
}
|
||||
|
||||
if(hours < 8) {
|
||||
|
||||
System.out.println("발송금지 시간" + hours + ":" + minuts);
|
||||
sendStatus = false;
|
||||
|
||||
}
|
||||
|
||||
System.out.println("발송상태는 ::: "+sendStatus);
|
||||
model.addAttribute("sendStatus", sendStatus);
|
||||
|
||||
} catch (Exception e) {
|
||||
System.out.println(" kakaoFriendsTalkMsgDataViewDataRegist Error ::: " + e);
|
||||
}
|
||||
|
||||
return "web/kakao/msgdata/ft/KakaoFriendsTalkMsgDataView";
|
||||
@ -315,29 +313,7 @@ public class KakaoFriendsTalkSendController {
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @methodName : sendMsgData_ft_advc
|
||||
* @author : 이호영
|
||||
* @date : 2025. 4. 17.
|
||||
* @description : 친구톡 발송기능
|
||||
* @return : ResponseEntity<StatusResponse>
|
||||
* @param kakaoVO
|
||||
* @param request
|
||||
* @param model
|
||||
* @return
|
||||
* @throws Exception
|
||||
*
|
||||
*/
|
||||
@RequestMapping(value = "/web/mjon/kakao/friendstalk/kakaoFriendsTalkMsgSendAjax_advc.do")
|
||||
public ResponseEntity<StatusResponse> kakaoFriendsTalkMsgSendAjax_advc(
|
||||
@RequestBody KakaoVO kakaoVO,
|
||||
HttpServletRequest request
|
||||
) throws Exception {
|
||||
System.out.println(" :: sendMsgData_ft_advc :: ");
|
||||
return ResponseEntity.ok().body(kakaoFriendsTalkService.insertKakaoFtSandAjax_advc(kakaoVO, request)) ;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @Method Name : kakaoFriendsTalkMsgSendAjax
|
||||
@ -687,7 +663,7 @@ public class KakaoFriendsTalkSendController {
|
||||
if(!smishingAlarmPassSts) {//평일,주말, 공휴일 알림설정 시간에 포함되지 않는 경우 슬랙 알림 발송
|
||||
|
||||
MjonCommon comm = new MjonCommon();
|
||||
// comm.getAdminKakaoAtSendSlack(kakaoVO);
|
||||
comm.getAdminKakaoAtSandSlack(kakaoVO);
|
||||
|
||||
}
|
||||
|
||||
@ -711,6 +687,27 @@ public class KakaoFriendsTalkSendController {
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @Method Name : kakaoFriendsTalkMsgSendRefundTestAjax
|
||||
* @작성일 : 2024. 1. 18.
|
||||
* @작성자 : 우영두
|
||||
* @Method 설명 : 카카오 친구톡 전송 환불 스케줄러 서비스 테스트
|
||||
*/
|
||||
@RequestMapping(value= {"/web/mjon/kakao/friendstalk/kakaoFriendsTalkMsgSendRefundTestAjax.do"})
|
||||
public ModelAndView kakaoFriendsTalkMsgSendRefundTestAjax(ModelMap model
|
||||
, HttpServletRequest request
|
||||
, @ModelAttribute("kakaoVO") KakaoVO kakaoVO) throws Exception {
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView();
|
||||
modelAndView.setViewName("jsonView");
|
||||
|
||||
kakaoAlimTalkService.selectKakaoFtSentRefundList();
|
||||
|
||||
modelAndView.addObject("result", "success");
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
/**
|
||||
* @Method Name : kakaoFriendsTalkMsgSendRefundTestAjax
|
||||
* @작성일 : 2024. 1. 18.
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
package itn.let.kakao.user.kakaoFt.web;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -9,16 +8,11 @@ import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
@ -27,7 +21,6 @@ import egovframework.rte.fdl.security.userdetails.util.EgovUserDetailsHelper;
|
||||
import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo;
|
||||
import itn.com.cmm.EgovMessageSource;
|
||||
import itn.com.cmm.LoginVO;
|
||||
import itn.com.cmm.RestResponse;
|
||||
import itn.com.cmm.service.EgovCmmUseService;
|
||||
import itn.com.utl.fcc.service.EgovStringUtil;
|
||||
import itn.let.kakao.kakaoComm.KakaoReturnVO;
|
||||
@ -39,14 +32,10 @@ import itn.let.kakao.kakaoComm.kakaoApi.KakaoApiTemplate;
|
||||
import itn.let.kakao.kakaoComm.kakaoApi.KakaoFTJsonSave;
|
||||
import itn.let.kakao.kakaoComm.kakaoApi.service.KakaoApiService;
|
||||
import itn.let.kakao.user.kakaoFt.service.KakaoFriendsTalkTemplateService;
|
||||
import itn.let.mail.service.StatusResponse;
|
||||
import itn.let.mjo.symbol.service.MjonSymbolService;
|
||||
import itn.let.mjo.symbol.service.MjonSymbolVO;
|
||||
import itn.let.uss.ion.cnt.service.CntManageVO;
|
||||
import itn.let.uss.umt.service.EgovUserManageService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@Slf4j
|
||||
@Controller
|
||||
public class KakaoFriendsTalkTemplateController {
|
||||
|
||||
@ -181,67 +170,6 @@ public class KakaoFriendsTalkTemplateController {
|
||||
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value="/web/pop/ft/kakaoTemplatePop.do")
|
||||
public String siteContentIntro(@ModelAttribute CntManageVO cntManageVO, HttpServletRequest request, Model model) throws Exception {
|
||||
|
||||
return "/web/pop/kakaoFtPop";
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@RequestMapping(value= {"/web/mjon/kakao/template/sendKakaoFriendsTemplateImageUploadAjax_advc.do"})
|
||||
public ResponseEntity<StatusResponse> sendKakaoFriendsTemplateImageUploadAjax_advc(
|
||||
@ModelAttribute("kakaoVO") KakaoVO kakaoVO
|
||||
, final MultipartHttpServletRequest multiRequest
|
||||
) throws Exception {
|
||||
ModelAndView modelAndView = new ModelAndView();
|
||||
modelAndView.setViewName("jsonView");
|
||||
|
||||
try {
|
||||
|
||||
if(!"A".equals(kakaoVO.getSendKind())) {
|
||||
|
||||
LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated()? (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null;
|
||||
String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId());
|
||||
|
||||
if(StringUtils.isEmpty(userId)) {
|
||||
return ResponseEntity.ok(
|
||||
new StatusResponse(HttpStatus.UNAUTHORIZED
|
||||
, "로그인을 하셔야 이용 가능합니다."
|
||||
, LocalDateTime.now()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
final Map<String, MultipartFile> files = multiRequest.getFileMap();
|
||||
/* if (!files.isEmpty()){
|
||||
|
||||
Map<String, String> resultMap = kakaoApiImageUpload.kakaoApiImageUpload(kakaoVO, files, 0);
|
||||
|
||||
//테스트 용
|
||||
modelAndView.addObject("code", resultMap.get("code"));
|
||||
modelAndView.addObject("msg", resultMap.get("msg"));
|
||||
modelAndView.addObject("imgUrl", resultMap.get("imgUrl"));
|
||||
}
|
||||
|
||||
modelAndView.addObject("result", "success");*/
|
||||
|
||||
return ResponseEntity.ok().body(kakaoApiImageUpload.kakaoApiImageUpload_advc(kakaoVO, files, 0));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
// TODO: handle exception
|
||||
return ResponseEntity.ok().body(new StatusResponse(
|
||||
HttpStatus.BAD_REQUEST
|
||||
, "오류가 발생하였습니다."
|
||||
, ""
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// 카카오 친구톡 템플릿 등록요청
|
||||
@ -261,13 +189,9 @@ public class KakaoFriendsTalkTemplateController {
|
||||
@ModelAttribute("kakaoVO") KakaoVO kakaoVO
|
||||
, final MultipartHttpServletRequest multiRequest
|
||||
) throws Exception {
|
||||
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView();
|
||||
modelAndView.setViewName("jsonView");
|
||||
|
||||
// log.info(" + kakaoVO.getAdFlag() :: [{}]", kakaoVO.getAdFlag());
|
||||
log.info(" + ImgLink :: [{}]", kakaoVO.getImgLink());
|
||||
try {
|
||||
LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated()? (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null;
|
||||
String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId());
|
||||
@ -283,18 +207,16 @@ public class KakaoFriendsTalkTemplateController {
|
||||
kakaoVO.setLastUpdusrId(userId);
|
||||
kakaoVO.setSendType("FT");
|
||||
|
||||
/*
|
||||
String imgUrl = kakaoVO.getTemplateImageUrl();
|
||||
int buttonSize = kakaoVO.getButtonVOList().size();
|
||||
|
||||
if(!imgUrl.equals("") || buttonSize > 0) {
|
||||
|
||||
log.info(" + kakaoVO.getAdFlag() :: [{}]", kakaoVO.getAdFlag());
|
||||
|
||||
//json 파일 생성 처리
|
||||
String resultJsonPath = kakaoFTJsonSave.kakaoApiJsonSave(kakaoVO);
|
||||
kakaoVO.setBizJsonName(resultJsonPath);
|
||||
|
||||
}*/
|
||||
}
|
||||
|
||||
int result = kakaoFtTemplateService.insertKakaoFriendsTemplateData(kakaoVO);
|
||||
|
||||
|
||||
@ -1,51 +0,0 @@
|
||||
package itn.let.kakao.user.sent.service;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class KakaoSentDetailVO extends KakaoSentVO{
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String msgGroupId;
|
||||
private String reqDate;
|
||||
private String regDate;
|
||||
private String msgGroupCnt;
|
||||
private String reserveYn;
|
||||
private String reserveCYn;
|
||||
private String canceldate;
|
||||
private String callFrom;
|
||||
private String userId;
|
||||
private String smsTxt;
|
||||
private String subject;
|
||||
private String subjectChkYn;
|
||||
private String msgType;
|
||||
private String fileCnt;
|
||||
private String msgKind;
|
||||
private String eachPrice;
|
||||
private String filePath1;
|
||||
private String filePath2;
|
||||
private String filePath3;
|
||||
|
||||
private String callTo;
|
||||
private String statusTxt;
|
||||
private String addrNm;
|
||||
|
||||
private String successPct;
|
||||
private String failedPct;
|
||||
private String waitingPct;
|
||||
|
||||
private String statusCd; // 진행상태 코드
|
||||
private String divideYn;
|
||||
private String divideText;
|
||||
private String totPrice;
|
||||
private String yellowId;
|
||||
private String msgNoticetalkTmpKey;
|
||||
|
||||
// FileInfo 리스트 필드 추가
|
||||
// private List<FileInfoVO> fileInfos;
|
||||
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user